* Support - Fixed rule text generation.

This commit is contained in:
LevelX2 2016-01-13 08:43:03 +01:00
parent 47c79fce8e
commit 1d98f78815
10 changed files with 20 additions and 25 deletions

View file

@ -44,22 +44,16 @@ import mage.util.CardUtil;
public class SupportEffect extends AddCountersTargetEffect {
private final DynamicValue amountSupportTargets;
private boolean otherPermanent;
private final boolean otherPermanent;
public SupportEffect(Card card, int amount) {
this(new StaticValue(amount));
if (card.getCardType().contains(CardType.INSTANT) || card.getCardType().contains(CardType.SORCERY)) {
otherPermanent = false;
card.getSpellAbility().addTarget(new TargetCreaturePermanent(0, amount, new FilterCreaturePermanent("target creatures"), false));
} else {
otherPermanent = true;
}
}
public SupportEffect(DynamicValue amount) {
public SupportEffect(Card card, int amount, boolean otherPermanent) {
super(CounterType.P1P1.createInstance(0), new StaticValue(1));
this.amountSupportTargets = amount;
this.staticText = setText();
this.amountSupportTargets = new StaticValue(amount);
this.otherPermanent = otherPermanent;
if (card.getCardType().contains(CardType.INSTANT) || card.getCardType().contains(CardType.SORCERY)) {
card.getSpellAbility().addTarget(new TargetCreaturePermanent(0, amount, new FilterCreaturePermanent("target creatures"), false));
}
staticText = setText();
}
public SupportEffect(final SupportEffect effect) {

View file

@ -42,7 +42,7 @@ import mage.target.common.TargetCreaturePermanent;
public class SupportAbility extends EntersBattlefieldTriggeredAbility {
public SupportAbility(Card card, int amount) {
super(new SupportEffect(card, amount), false);
super(new SupportEffect(card, amount, true));
if (!card.getCardType().contains(CardType.INSTANT) && !card.getCardType().contains(CardType.SORCERY)) {
FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures");
if (card.getCardType().contains(CardType.CREATURE)) {