mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Added method to SupportAbility class to allow for removal of 'other' text in rule generation
This commit is contained in:
parent
8a3ba6729f
commit
235c5aa86f
2 changed files with 19 additions and 1 deletions
|
@ -41,7 +41,7 @@ public final class TogetherForever extends CardImpl {
|
|||
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.)
|
||||
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.
|
||||
Ability ability = new SimpleActivatedAbility(new TogetherForeverEffect(), new GenericManaCost(1));
|
||||
|
|
|
@ -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) {
|
||||
super(ability);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue