use of mage.game.turn.TurnMod in project mage by magefree.
the class EonFrolickerEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getFirstTarget());
if (player == null) {
return false;
}
game.getState().getTurnMods().add(new TurnMod(player.getId(), false));
FilterPlayer filter = new FilterPlayer(player.getName());
filter.add(new PlayerIdPredicate(player.getId()));
Ability ability = new ProtectionAbility(filter);
game.addEffect(new GainAbilityControlledEffect(ability, Duration.UntilYourNextTurn, StaticFilters.FILTER_PERMANENT_PLANESWALKER), source);
game.addEffect(new GainAbilityControllerEffect(ability, Duration.UntilYourNextTurn), source);
return true;
}
use of mage.game.turn.TurnMod in project mage by magefree.
the class EmrakulThePromisedEndGainControlEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
if (controller != null && targetPlayer != null) {
TurnMod controlPlayerTurnMod = new TurnMod(targetPlayer.getId(), controller.getId());
TurnMod extraTurnMod = new TurnMod(targetPlayer.getId(), false);
controlPlayerTurnMod.setSubsequentTurnMod(extraTurnMod);
game.getState().getTurnMods().add(controlPlayerTurnMod);
return true;
}
return false;
}
use of mage.game.turn.TurnMod in project mage by magefree.
the class SphinxOfTheSecondSunWatcher method apply.
@Override
public boolean apply(Game game, Ability source) {
TurnPhase turnPhase = game.getPhase().getType();
for (TurnMod turnMod : game.getState().getTurnMods()) {
if ("sphinxSecondSun".equals(turnMod.getNote()) && turnMod.getPlayerId().equals(source.getControllerId()) && turnMod.getAfterPhase() == turnPhase) {
turnPhase = TurnPhase.BEGINNING;
turnMod.setNote("sphinxSecondSunIgnore");
break;
}
}
TurnMod newPhase = new TurnMod(source.getControllerId(), TurnPhase.BEGINNING, turnPhase, false);
newPhase.setNote("sphinxSecondSun");
game.getState().getTurnMods().add(newPhase);
return true;
}
use of mage.game.turn.TurnMod in project mage by magefree.
the class MoraugFuryOfAkoumWatcher method apply.
@Override
public boolean apply(Game game, Ability source) {
TurnPhase turnPhase = game.getPhase().getType();
for (TurnMod turnMod : game.getState().getTurnMods()) {
if ("moraug".equals(turnMod.getNote()) && turnMod.getPlayerId().equals(source.getControllerId()) && turnMod.getAfterPhase() == turnPhase) {
turnPhase = TurnPhase.COMBAT;
turnMod.setNote("moraugIgnore");
break;
}
}
TurnMod combat = new TurnMod(source.getControllerId(), TurnPhase.COMBAT, turnPhase, false);
combat.setNote("moraug");
game.getState().getTurnMods().add(combat);
game.addDelayedTriggeredAbility(new MoraugFuryOfAkoumDelayedTriggeredAbility(combat.getId()), source);
return true;
}
use of mage.game.turn.TurnMod in project mage by magefree.
the class TimeStretchEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
game.getState().getTurnMods().add(new TurnMod(source.getFirstTarget(), false));
game.getState().getTurnMods().add(new TurnMod(source.getFirstTarget(), false));
return true;
}
Aggregations