Changed old constructor to call the new one to prevent code duplication

This commit is contained in:
etpalmer63 2020-05-15 11:29:51 -07:00
parent 235c5aa86f
commit 25db5f11eb

View file

@ -19,22 +19,9 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class SupportAbility extends EntersBattlefieldTriggeredAbility {
public SupportAbility(Card card, int amount) {
super(new SupportEffect(card, amount, true));
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));
}
}
/*
* 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.
* For enchantments, the text should not include the word "other".
* The otherPermanent choice removes the word "other" from rule text creation.
*/
public SupportAbility(Card card, int amount, boolean otherPermanent) {
super(new SupportEffect(card, amount, otherPermanent));
@ -49,6 +36,9 @@ public class SupportAbility extends EntersBattlefieldTriggeredAbility {
}
public SupportAbility(Card card, int amount){ this( card, amount, true); }
public SupportAbility(final SupportAbility ability) {
super(ability);
}