@Override public ConspireTriggeredAbility copy() { return new ConspireTriggeredAbility(this); }
public ConspireTriggeredAbility(UUID conspireId) { super(Zone.STACK, new ConspireEffect()); this.conspireId = conspireId; this.setRuleVisible(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; }
/** * Unique Id for a ConspireAbility but may not change while a continuous * effect gives Conspire * * @param conspireId * @param conspireTargets controls the content of the reminder text */ public ConspireAbility(UUID conspireId, ConspireTargets conspireTargets) { super(Zone.STACK, null); this.conspireId = conspireId; switch (conspireTargets) { case NONE: reminderText = "As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it."; break; case ONE: reminderText = "As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose a new target for the copy."; break; case MORE: reminderText = "As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose new targets for the copy."; break; } Cost cost = new TapTargetCost(new TargetControlledPermanent(2, 2, filter, true)); cost.setText(""); conspireCost = new OptionalAdditionalCostImpl(keywordText, " ", reminderText, cost); addSubAbility(new ConspireTriggeredAbility(conspireId)); }