Added method to SupportAbility class to allow for removal of 'other' text in rule generation

This commit is contained in:
etpalmer63 2020-05-11 10:52:34 -07:00
parent 8a3ba6729f
commit 235c5aa86f
2 changed files with 19 additions and 1 deletions

View file

@ -41,7 +41,7 @@ public final class TogetherForever extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}{W}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}{W}");
// When Together Forever enters the battlefield, support 2. (Put a +1/+1 counter on each of up to two other target creatures.) // When Together Forever enters the battlefield, support 2. (Put a +1/+1 counter on each of up to two other target creatures.)
this.addAbility(new SupportAbility(this, 2)); this.addAbility(new SupportAbility(this, 2, false));
// {1}: Choose target creature with a counter on it. When that creature dies this turn, return that card to its owner's hand. // {1}: Choose target creature with a counter on it. When that creature dies this turn, return that card to its owner's hand.
Ability ability = new SimpleActivatedAbility(new TogetherForeverEffect(), new GenericManaCost(1)); Ability ability = new SimpleActivatedAbility(new TogetherForeverEffect(), new GenericManaCost(1));

View file

@ -31,6 +31,24 @@ public class SupportAbility extends EntersBattlefieldTriggeredAbility {
} }
} }
/*
* For enchanments, the text should not include the word "other". This method
* allows the otherPermanent choice to be selected in the call to SupportAbility
* and removes the "other" text from rule creation.
*/
public SupportAbility(Card card, int amount, boolean otherPermanent) {
super(new SupportEffect(card, amount, otherPermanent));
if (!card.isInstant() && !card.isSorcery()) {
FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures");
if (card.isCreature()) {
filter.add(AnotherPredicate.instance);
filter.setMessage("other target creatures");
}
addTarget(new TargetCreaturePermanent(0, amount, filter, false));
}
}
public SupportAbility(final SupportAbility ability) { public SupportAbility(final SupportAbility ability) {
super(ability); super(ability);
} }