@Override public void beginningOfTurn(Game game) { if (game.isActivePlayer(this.controllerId)) { this.controlledFromStartOfControllerTurn = true; } }
@Override public boolean checkTrigger(GameEvent event, Game game) { return game.isActivePlayer(controllerId); } @Override
@Override public boolean isInactive(Ability source, Game game) { if (startingTurn != 0 && game.getTurnNum() != startingTurn) { if (game.isActivePlayer(source.getControllerId())) { return true; } } return false; } }
@Override public boolean checkTrigger(GameEvent event, Game game) { if (game.isActivePlayer(this.controllerId)) { if (game.getCombat().attacksAlone()) { return true; } } return false; }
@Override public boolean applies(GameEvent event, Ability source, Game game) { return event.getTargetId() == permanentId && game.isActivePlayer(game.getPermanent(permanentId).getControllerId()); } }
@Override public boolean applies(Permanent permanent, Ability source, Game game) { if (permanent.getId().equals(getTargetPointer().getFirst(game, source))) { if (game.isActivePlayer(permanent.getControllerId())) { return true; } } return false; }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { if (condition.apply(game, this) && costs.canPay(this, sourceId, playerId, game) && game.isActivePlayer(playerId)) { this.activatorId = playerId; return ActivationStatus.getTrue(); } return ActivationStatus.getFalse(); }
@Override public boolean isInactive(Ability source, Game game) { if (game.getPhase().getStep().getType() == PhaseStep.UPKEEP) { if (game.isActivePlayer(source.getControllerId())) { return true; } } return false; }
@Override public boolean isInactive(Ability source, Game game) { if (startingTurn != 0 && game.getTurnNum() >= startingTurn && game.getPhase().getStep().getType() == PhaseStep.END_TURN) { if (game.isActivePlayer(source.getControllerId())) { return true; } } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { if (game.isActivePlayer(this.controllerId)) { if (game.getCombat().attacksAlone()) { for (Effect effect: this.getEffects()) { effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0))); } return true; } } return false; }
@Override public boolean isInactive(Ability source, Game game) { return startingTurn != game.getTurnNum() && (game.getPhase().getType() == TurnPhase.END && game.isActivePlayer(this.getTargetPointer().getFirst(game, source))); }
@Override public boolean apply(Game game, Ability source) { if (game.isActivePlayer(source.getControllerId())) { PlayerLostLifeWatcher watcher = game.getState().getWatcher(PlayerLostLifeWatcher.class); return watcher != null && watcher.getAllOppLifeLost(source.getControllerId(), game) > 0; } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); return spell != null && filter.match(spell,game) && game.getOpponents(this.getControllerId()).contains(spell.getControllerId()) && game.isActivePlayer(this.getControllerId()); }
@Override public boolean checkTrigger(GameEvent event, Game game) { // The sacrifice occurs only if you cast it using its own ability. If you cast it using some other // effect (for instance, if it gained flash from Vedalken Orrery), then it won't be sacrificed. // CHECK Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.getSourceId().equals(getSourceId())) { return !(game.isMainPhase() && game.isActivePlayer(event.getPlayerId()) && game.getStack().size() == 1); } return false; }
@Override public boolean isInactive(Ability source, Game game) { if (game.getPhase().getStep().getType() == PhaseStep.UPKEEP) { if (!sameStep && game.isActivePlayer(source.getControllerId()) || game.getPlayer(source.getControllerId()).hasReachedNextTurnAfterLeaving()) { return true; } } else { sameStep = false; } return false; }
@Override public boolean isInactive(Ability source, Game game) { if (game.getPhase().getStep().getType() == PhaseStep.UPKEEP) { if (!sameStep && game.isActivePlayer(source.getControllerId()) || game.getPlayer(source.getControllerId()).hasReachedNextTurnAfterLeaving()) { return true; } } else { sameStep = false; } return false; }
@Override public boolean isInactive(Ability source, Game game) { // the PRE step part is directly after the UNTAP events for permanents if (game.getPhase().getStep().getType() == PhaseStep.UNTAP && game.getStep().getStepPart() == Step.StepPart.PRE) { if (game.isActivePlayer(targetPlayerId) || game.getPlayer(source.getControllerId()).hasReachedNextTurnAfterLeaving()) { return true; } } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { Permanent enchantment = game.getPermanent(this.sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); if (player != null && game.isActivePlayer(player.getId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); return true; } } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { Permanent enchantment = game.getPermanent(this.sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); if (player != null && game.isActivePlayer(player.getId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); return true; } } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { Permanent enchantment = game.getPermanent(this.sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); if (player != null && game.isActivePlayer(player.getId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); return true; } } return false; }