private void playExtraSteps(Game game, PhaseStep afterStep) { while (true) { Step extraStep = game.getState().getTurnMods().extraStep(activePlayerId, afterStep); if (extraStep == null) { return; } currentStep = extraStep; playStep(game); } }
@Override protected void init(UUID choosingPlayerId) { super.init(choosingPlayerId); state.getTurnMods().add(new TurnMod(startingPlayerId, PhaseStep.DRAW)); }
private void checkTurnIsControlledByOtherPlayer(Game game, UUID activePlayerId) { UUID newControllerId = game.getState().getTurnMods().controlsTurn(activePlayerId); if (newControllerId != null && !newControllerId.equals(activePlayerId)) { game.getPlayer(newControllerId).controlPlayersTurn(game, activePlayerId); } }
@Override protected void init(UUID choosingPlayerId) { super.init(choosingPlayerId); state.getTurnMods().add(new TurnMod(startingPlayerId, PhaseStep.DRAW)); }
@Override public boolean apply(Game game, Ability source) { UUID targetId = source.getFirstTarget(); UUID controllerId = source.getControllerId(); if (targetId != null && controllerId != null && !targetId.equals(controllerId)) { game.getState().getTurnMods().add(new TurnMod(targetId, controllerId)); return true; } return false; }
@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; } }
@Override public boolean apply(Game game, Ability source) { game.getState().getTurnMods().add(new TurnMod(source.getFirstTarget(), false)); return true; } }
@Override public boolean apply(Game game, Ability source) { game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false)); return true; } }
@Override public boolean apply(Game game, Ability source) { game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false)); return true; } }
@Override public boolean apply(Game game, Ability source) { game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), true)); return true; }
@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; }
@Override public boolean apply(Game game, Ability source) { game.getState().getTurnMods().add(new TurnMod(getTargetPointer().getFirst(game, source), false)); return true; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { game.getState().getTurnMods().add(new TurnMod(player.getId(), PhaseStep.DRAW)); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { game.getState().getTurnMods().add(new TurnMod(controller.getId(), PhaseStep.UNTAP)); return true; } return false; }
@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 boolean apply(Game game, Ability source) { if (this.getTargetPointer().getFirst(game, source) != null) { game.getState().getTurnMods().add(new TurnMod(this.getTargetPointer().getFirst(game, source), false)); } return true; } }
@Override public boolean apply(Game game, Ability source) { game.getState().getTurnMods().add(new TurnMod(this.getTargetPointer().getFirst(game, source), new UpkeepStep(), null)); return true; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { if (player.flipCoin(source, game, true)) { game.getState().getTurnMods().add(new TurnMod(player.getId(), false)); return true; } } return false; }
private void turnsForTimeVote(int timeCount, Player controller, Game game, Ability source) { if (timeCount == 1) { game.informPlayers(controller.getName() + " will take an extra turn"); } else { game.informPlayers(controller.getName() + " will take " + timeCount + " extra turns"); } do { game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), false)); timeCount--; } while (timeCount > 0); }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source)); if (permanent != null) { permanent.untap(game); game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false)); return true; } return false; }