@Override public void init(Ability source, Game game) { super.init(source, game); castOnTurn = game.getTurnNum(); }
@Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.controllerId)) { if (game.getTurnNum() != startingTurn) { return true; } } return false; }
@Override public void init(Ability source, Game game) { super.init(source, game); //To change body of generated methods, choose Tools | Templates. startingTurn = game.getTurnNum(); }
@Override public void init(Ability source, Game game) { turnNumber = game.getTurnNum(); phaseCount = game.getPhase().getCount(); }
protected void logLife(Game game) { StringBuilder sb = new StringBuilder(); sb.append(game.getTurn().getValue(game.getTurnNum())); for (Player player: game.getPlayers().values()) { sb.append("[player ").append(player.getName()).append(':').append(player.getLife()).append(']'); } logger.info(sb.toString()); }
public void addActivation(Game game) { if (game.getTurnNum() != turnNum) { activationCounter = 1; turnNum = game.getTurnNum(); } else { activationCounter++; } game.getState().setValue(key, activationCounter); game.getState().setValue(key + 'T', turnNum); }
@Override public boolean apply(Game game, Ability source) { DelayedTriggeredAbility delayedAbility = new JaceArchitectOfThoughtDelayedTriggeredAbility(game.getTurnNum()); game.addDelayedTriggeredAbility(delayedAbility, source); return true; } }
@Override public boolean isInactive(Ability source, Game game) { if (startingTurn != 0 && game.getTurnNum() != startingTurn) { if (game.isActivePlayer(source.getControllerId())) { return true; } } return false; } }
protected boolean hasMoreActivationsThisTurn(Game game) { if (getMaxActivationsPerTurn(game) == Integer.MAX_VALUE) { return true; } ActivationInfo activationInfo = getActivationInfo(game); return activationInfo == null || activationInfo.turnNum != game.getTurnNum() || activationInfo.activationCounter < getMaxActivationsPerTurn(game); }
@Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getTargetId().equals(this.getSourceId()) && game.getTurnNum() > turnUsed) { this.getTargets().clear(); TargetStackObject target = new TargetStackObject(); target.add(event.getSourceId(), game); this.addTarget(target); turnUsed = game.getTurnNum(); return true; } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getTargetId().equals(this.getSourceId()) && game.getTurnNum() > turnUsed) { this.getTargets().clear(); TargetStackObject target = new TargetStackObject(); target.add(event.getSourceId(), game); this.addTarget(target); turnUsed = game.getTurnNum(); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { String key = source.getSourceId().toString() + source.getSourceObjectZoneChangeCounter() + keyString + game.getTurnNum() + ((ActivatedAbilityImpl)source).getActivatorId(); game.getState().setValue(key,true); return true; } }
@Override public boolean isInactive(Ability source, Game game) { if (castOnTurn != game.getTurnNum() && game.getPhase().getStep().getType() == PhaseStep.END_TURN) { return game.isActivePlayer(source.getControllerId()); } return false; }
@Override public boolean isInactive(Ability source, Game game) { return (startingTurn != game.getTurnNum() && (game.getPhase().getType() == TurnPhase.END && game.isActivePlayer(source.getFirstTarget()))) || // 6/15/2010: If a creature controlled by the affected player can't attack Gideon Jura (because he's no longer on the battlefield, for example), that player may have it attack you, another one of your planeswalkers, or nothing at all. creatingPermanent.getPermanent(game) == null; }
@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 isInactive(Ability source, Game game) { return startingTurn != game.getTurnNum() && (game.getPhase().getType() == TurnPhase.END && game.isActivePlayer(this.getTargetPointer().getFirst(game, source))); }
@Override public boolean isInactive(Ability source, Game game) { if (castOnTurn != game.getTurnNum() && game.getPhase().getStep().getType() == PhaseStep.END_TURN) { return game.isActivePlayer(source.getControllerId()); } 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 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 applies(Permanent permanent, Ability source, Game game) { Permanent attachment = game.getPermanent(source.getSourceId()); if (attachment != null && attachment.getAttachedTo() != null && permanent.getId().equals(attachment.getAttachedTo())) { String key = source.getSourceId().toString() + attachment.getZoneChangeCounter(game) + keyString + game.getTurnNum() + permanent.getControllerId(); return game.getState().getValue(key) == null; } return false; }