@Override public boolean apply(Game game, Ability source) { Spell spell = game.getStack().getSpell(source.getSourceId()); if (spell != null) { spell.addCounters(CounterType.CHARGE.createInstance(2), source, game); return spell.chooseNewTargets(game, ((ActivatedAbilityImpl) source).getActivatorId(), false, false, null); } return false; } }
@Override public boolean apply(Game game, Ability source) { Spell spell = game.getStack().getSpell(this.getTargetPointer().getFirst(game, source)); if (spell != null) { int numTargets = 0; for (Target target : spell.getSpellAbility().getTargets()) { numTargets += target.getTargets().size(); } if (numTargets == 1 && spell.getSpellAbility().getTargets().getFirstTarget().equals(source.getSourceId())) { spell.chooseNewTargets(game, source.getControllerId(), true, false, null); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); if (controller != null && spell != null) { spell.setControllerId(controller.getId()); spell.chooseNewTargets(game, controller.getId(), false, false, null); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Spell spell = game.getStack().getSpell(this.getTargetPointer().getFirst(game, source)); if (controller != null && spell != null) { spell.setControllerId(controller.getId()); spell.chooseNewTargets(game, controller.getId(), false, false, null); return true; } return false; } }
@Override public StackObject createCopyOnStack(Game game, Ability source, UUID newControllerId, boolean chooseNewTargets) { Spell copy = this.copySpell(newControllerId); game.getState().setZone(copy.getId(), Zone.STACK); // required for targeting ex: Nivmagus Elemental game.getStack().push(copy); if (chooseNewTargets) { copy.chooseNewTargets(game, newControllerId); } game.fireEvent(new GameEvent(EventType.COPIED_STACKOBJECT, copy.getId(), this.getId(), newControllerId)); return copy; }
@Override public boolean apply(Game game, Ability source) { Spell spell = game.getStack().getSpell(source.getFirstTarget()); Cost cost = new GenericManaCost(2); if (spell != null) { Player player = game.getPlayer(spell.getControllerId()); if (player != null) { cost.clearPaid(); if (!cost.pay(source, game, spell.getControllerId(), spell.getControllerId(), false, null)) { return spell.chooseNewTargets(game, source.getControllerId(), true, true, null); } } } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); if (spell != null && controller != null) { Spell copy = spell.copySpell(source.getControllerId()); copy.getColor(game).setRed(true); game.getStack().push(copy); copy.chooseNewTargets(game, controller.getId()); game.fireEvent(new GameEvent(GameEvent.EventType.COPIED_STACKOBJECT, copy.getId(), spell.getId(), source.getControllerId())); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); Player controller = game.getPlayer(source.getControllerId()); if (spell != null && controller != null) { Player spellCaster = game.getPlayer(spell.getControllerId()); // controller gets controll of spell spell.setControllerId(controller.getId()); // and chooses new targets spell.chooseNewTargets(game, controller.getId()); game.informPlayers(controller.getLogName() + " got control of " + spell.getName() + " spell."); // and spell controller get control of Perplexing Chimera if (spellCaster != null) { ContinuousEffect effect = new PerplexingChimeraControlEffect(); effect.setTargetPointer(new FixedTarget(spellCaster.getId())); game.addEffect(effect, source); } } return false; } }