mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
* Support - Fixed rule text generation.
This commit is contained in:
parent
47c79fce8e
commit
1d98f78815
10 changed files with 20 additions and 25 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue