@Override public void init(Ability source, Game game) { super.init(source, game); if (commanderId == null) { throw new IllegalArgumentException("commanderId has to be set"); } }
@Override public void init(Ability source, Game game) { super.init(source, game); if (amountToPreventDynamic != null) { amountToPrevent = amountToPreventDynamic.calculate(game, source, this); } }
@Override public void init(Ability source, Game game) { this.damageSource.choose(Outcome.PreventDamage, source.getControllerId(), source.getSourceId(), game); super.init(source, game); }
@Override public void init(Ability source, Game game) { this.target.choose(Outcome.PreventDamage, source.getControllerId(), source.getSourceId(), game); super.init(source, game); }
@Override public void init(Ability source, Game game) { this.wonFlip = game.getPlayer(source.getControllerId()).flipCoin(source, game, true); super.init(source, game); }
@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; }
@Override public void init(Ability source, Game game) { super.init(source, game); Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); Permanent mageObject = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (player != null && mageObject != null) { ChoiceColor choice = new ChoiceColor(); if (!player.choose(outcome, choice, game)) { discard(); return; } if (!game.isSimulation()) { game.informPlayers(mageObject.getLogName() + ": " + player.getLogName() + " has chosen " + choice.getChoice()); } game.getState().setValue(mageObject.getId() + "_color", choice.getColor()); mageObject.addInfo("chosen color", CardUtil.addToolTipMarkTags("Chosen color: " + choice.getChoice()), game); } }