private String getOptionalTextSuffix(Game game, Spell spell) { StringBuilder sb = new StringBuilder(); for (Ability ability : spell.getAbilities()) { if (ability instanceof OptionalAdditionalSourceCosts) { sb.append(((OptionalAdditionalSourceCosts) ability).getCastMessageSuffix()); } if (ability instanceof AlternativeSourceCosts && ((AlternativeSourceCosts) ability).isActivated(this, game)) { sb.append(((AlternativeSourceCosts) ability).getCastMessageSuffix(game)); } } return sb.toString(); }
@Override public boolean apply(Game game, Ability source) { MageObject object = game.getObject(source.getSourceId()); if (object instanceof Spell && ((Spell) object).getFromZone() == Zone.GRAVEYARD) { for (Ability ability : ((Spell) object).getAbilities(game)) { if (ability instanceof FlashbackAbility) { return true; } } } return false; } }
public String getSpellCastText(Game game) { for (Ability spellAbility : getAbilities()) { if (spellAbility instanceof MorphAbility && ((AlternativeSourceCosts) spellAbility).isActivated(getSpellAbility(), game)) { return "a card face down"; } } return GameLog.replaceNameByColoredName(card, getSpellAbility().toString()); }
@Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.isControlledBy(controllerId)) { for (Ability ability : spell.getAbilities()) { if (ability instanceof KickerAbility && ((KickerAbility) ability).getKickedCounter(game, spell.getSpellAbility()) > 0) { return true; } } } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.isControlledBy(controllerId)) { for (Ability ability : spell.getAbilities()) { if (ability instanceof KickerAbility && ((KickerAbility) ability).getKickedCounter(game, spell.getSpellAbility()) > 0) { return true; } } } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getSourceId().equals(getSourceId())) { Spell spell = game.getStack().getSpell(event.getSourceId()); for (Ability ability : spell.getAbilities(game)) { if (ability instanceof ConspireAbility && ((ConspireAbility) ability).getConspireId().equals(getConspireId())) { if (((ConspireAbility) ability).isActivated(spell.getSpellAbility(), game)) { for (Effect effect : this.getEffects()) { if (effect instanceof ConspireEffect) { ((ConspireEffect) effect).setConspiredSpell(spell); } } return true; } } } } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.isControlledBy(controllerId)) { int damageAmount = 0; for (Ability ability: spell.getAbilities()) { if (ability instanceof KickerAbility) { damageAmount += ((KickerAbility) ability).getKickedCounter(game, spell.getSpellAbility()); } } if (damageAmount > 0) { this.getEffects().get(0).setValue("damageAmount", damageAmount); return true; } } return false; }
Player controller = game.getPlayer(getControllerId()); if (controller != null && controller.getCommandersIds() != null && !controller.getCommandersIds().isEmpty()) { if (spell.getAbilities().contains(ChangelingAbility.getInstance())) { for (UUID cmdr : controller.getCommandersIds()) { MageObject commander = game.getObject(cmdr);
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); if (player != null && permanent != null) { for (StackObject stackObject : game.getStack()) { // only spells cast, so no copies of spells if ((stackObject instanceof Spell) && !stackObject.isCopy() && stackObject.isControlledBy(source.getControllerId())) { Spell spell = (Spell) stackObject; if (filter.match(spell, game)) { if (!spell.getAbilities().contains(ability)) { game.getState().addOtherAbility(spell.getCard(), ability); } } } } return true; } return false; } }
sourceAbilities = ((Spell) source).getAbilities(game); sourceControllerId = ((Spell) source).getControllerId(); } else if (source instanceof Card) {
sourceAbilities = ((Spell) source).getAbilities(game); sourceControllerId = ((Spell) source).getControllerId(); } else if (source instanceof Card) {