mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Festival, False Peace, Empty City Ruse, Moment of Silence impl. Extracted SkipNextCombatPhase class.
This commit is contained in:
parent
bbd9e0e323
commit
0d8b892272
9 changed files with 355 additions and 106 deletions
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TurnPhase;
|
||||
import mage.game.Game;
|
||||
import mage.game.turn.TurnMod;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
|
||||
*/
|
||||
public class SkipNextCombatEffect extends OneShotEffect {
|
||||
|
||||
public SkipNextCombatEffect() {
|
||||
super(Outcome.Detriment);
|
||||
staticText = "target opponent skips his or her next combat phase";
|
||||
}
|
||||
|
||||
public SkipNextCombatEffect(SkipNextCombatEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if (targetPointer != null) {
|
||||
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
if (player != null) {
|
||||
game.getState().getTurnMods().add(new TurnMod(player.getId(), TurnPhase.COMBAT, null, true));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SkipNextCombatEffect copy() {
|
||||
return new SkipNextCombatEffect();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue