@Override public void init(Ability source, Game game) { super.init(source, game); //To change body of generated methods, choose Tools | Templates. if (duration.isOnlyValidIfNoZoneChange()) { // If source permanent is no longer onto battlefield discard the effect if (source.getSourcePermanentIfItStillExists(game) == null) { discard(); } } }
@Override public String getInfoMessage(Ability source, GameEvent event, Game game) { String namedCard = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); String playerName = game.getPlayer(source.getControllerId()).getName(); if (namedCard == null || playerName == null || source.getSourceObject(game) == null){ return super.getInfoMessage(source, event, game); } return "Until "+playerName+"'s next turn, spells named "+namedCard+" can't be cast and lands named "+namedCard+" can't be played ("+source.getSourceObject(game).getIdName()+")."; } }
@Override public void init(Ability source, Game game) { super.init(source, game); zoneChangeCounter = game.getState().getZoneChangeCounter(source.getId()); }
@Override public void init(Ability source, Game game) { super.init(source, game); OvermasterWatcher watcher = game.getState().getWatcher(OvermasterWatcher.class, source.getControllerId()); if (watcher != null) { watcher.setReady(); } }
@Override public void init(Ability source, Game game) { super.init(source, game); InsistWatcher watcher = game.getState().getWatcher(InsistWatcher.class, source.getControllerId()); if (watcher != null) { watcher.setReady(); } }
@Override public void init(Ability source, Game game) { super.init(source, game); if (baseCondition instanceof LockedInCondition) { condition = new FixedCondition(((LockedInCondition) baseCondition).getBaseCondition().apply(game, source)); } else { condition = baseCondition; } effect.setTargetPointer(this.targetPointer); effect.init(source, game); if (otherwiseEffect != null) { otherwiseEffect.setTargetPointer(this.targetPointer); otherwiseEffect.init(source, game); } initDone = true; }