use of mage.game.turn.TurnMod in project mage by magefree.
the class UntapAttackingThisTurnEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
// we can't add two turn modes at once, will add additional post combat on delayed trigger resolution
TurnMod combat = new TurnMod(source.getControllerId(), TurnPhase.COMBAT, TurnPhase.POSTCOMBAT_MAIN, false);
game.getState().getTurnMods().add(combat);
UntapDelayedTriggeredAbility delayedTriggeredAbility = new UntapDelayedTriggeredAbility();
delayedTriggeredAbility.setConnectedTurnMod(combat.getId());
game.addDelayedTriggeredAbility(delayedTriggeredAbility, source);
return true;
}
use of mage.game.turn.TurnMod in project mage by magefree.
the class DelayedAddMainPhaseAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.PHASE_CHANGED && this.connectedTurnMod.equals(event.getSourceId())) {
enabled = true;
}
if (event.getType() == GameEvent.EventType.COMBAT_PHASE_PRE && enabled) {
// add additional post combat main phase after that - after phase == null because add it after this combat
game.getState().getTurnMods().add(new TurnMod(getControllerId(), TurnPhase.POSTCOMBAT_MAIN, null, false));
enabled = false;
}
return false;
}
use of mage.game.turn.TurnMod in project mage by magefree.
the class DelayedAddMainPhaseAbility method apply.
@Override
public boolean apply(Game game, Ability source) {
// 15.07.2006 If it's somehow not a main phase when Fury of the Horde resolves, all it does is untap all creatures that attacked that turn. No new phases are created.
if (game.getTurn().getPhaseType() == TurnPhase.PRECOMBAT_MAIN || game.getTurn().getPhaseType() == TurnPhase.POSTCOMBAT_MAIN) {
// we can't add two turn modes at once, will add additional post combat on delayed trigger resolution
TurnMod combat = new TurnMod(source.getControllerId(), TurnPhase.COMBAT, TurnPhase.POSTCOMBAT_MAIN, false);
game.getState().getTurnMods().add(combat);
DelayedAddMainPhaseAbility delayedTriggeredAbility = new DelayedAddMainPhaseAbility();
delayedTriggeredAbility.setConnectedTurnMod(combat.getId());
game.addDelayedTriggeredAbility(delayedTriggeredAbility, source);
return true;
}
return false;
}
use of mage.game.turn.TurnMod in project mage by magefree.
the class MomirDuel method init.
@Override
protected void init(UUID choosingPlayerId) {
Ability ability = new SimpleStaticAbility(Zone.COMMAND, new InfoEffect("Vanguard effects"));
for (UUID playerId : state.getPlayerList(startingPlayerId)) {
Player player = getPlayer(playerId);
if (player != null) {
CardInfo cardInfo = CardRepository.instance.findCard("Momir Vig, Simic Visionary");
addEmblem(new MomirEmblem(), cardInfo.getCard(), playerId);
}
}
getState().addAbility(ability, null);
super.init(choosingPlayerId);
state.getTurnMods().add(new TurnMod(startingPlayerId, PhaseStep.DRAW));
}
use of mage.game.turn.TurnMod in project mage by magefree.
the class CruelEntertainmentEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player1 = game.getPlayer(getTargetPointer().getFirst(game, source));
Player player2 = null;
if (getTargetPointer().getTargets(game, source).size() > 1) {
player2 = game.getPlayer(getTargetPointer().getTargets(game, source).get(1));
}
if (player1 != null && player2 != null) {
game.getState().getTurnMods().add(new TurnMod(player1.getId(), player2.getId()));
game.getState().getTurnMods().add(new TurnMod(player2.getId(), player1.getId()));
return true;
}
return false;
}
Aggregations