mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
Fixed some tests that failed after changes to rule text generation.
This commit is contained in:
parent
da099c2da5
commit
dfa91ceeaf
10 changed files with 27 additions and 47 deletions
|
|
@ -30,7 +30,6 @@ package mage.sets.eventide;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.Mana;
|
import mage.Mana;
|
||||||
import mage.ObjectColor;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,10 @@ import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.condition.common.HasCounterCondition;
|
import mage.abilities.condition.common.HasCounterCondition;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||||
|
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.WinGameEffect;
|
import mage.abilities.effects.common.WinGameEffect;
|
||||||
|
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||||
import mage.abilities.keyword.ShroudAbility;
|
import mage.abilities.keyword.ShroudAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
|
@ -66,7 +68,9 @@ public class HelixPinnacle extends CardImpl<HelixPinnacle> {
|
||||||
this.addAbility(ShroudAbility.getInstance());
|
this.addAbility(ShroudAbility.getInstance());
|
||||||
|
|
||||||
// {X}: Put X tower counters on Helix Pinnacle.
|
// {X}: Put X tower counters on Helix Pinnacle.
|
||||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new HelixPinnacleEffect(), new ManaCostsImpl("{X}")));
|
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||||
|
new AddCountersSourceEffect(CounterType.TOWER.createInstance(), new ManacostVariableValue(), true),
|
||||||
|
new ManaCostsImpl("{X}")));
|
||||||
|
|
||||||
// At the beginning of your upkeep, if there are 100 or more tower counters on Helix Pinnacle, you win the game.
|
// At the beginning of your upkeep, if there are 100 or more tower counters on Helix Pinnacle, you win the game.
|
||||||
Condition condition = new HasCounterCondition(CounterType.TOWER, 100);
|
Condition condition = new HasCounterCondition(CounterType.TOWER, 100);
|
||||||
|
|
@ -83,30 +87,3 @@ public class HelixPinnacle extends CardImpl<HelixPinnacle> {
|
||||||
return new HelixPinnacle(this);
|
return new HelixPinnacle(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class HelixPinnacleEffect extends OneShotEffect<HelixPinnacleEffect> {
|
|
||||||
|
|
||||||
HelixPinnacleEffect() {
|
|
||||||
super(Outcome.Benefit);
|
|
||||||
staticText = "Put X tower counters on {this}";
|
|
||||||
}
|
|
||||||
|
|
||||||
HelixPinnacleEffect(HelixPinnacleEffect effect) {
|
|
||||||
super(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public HelixPinnacleEffect copy() {
|
|
||||||
return new HelixPinnacleEffect(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
|
||||||
if (permanent != null) {
|
|
||||||
permanent.addCounters(CounterType.TOWER.createInstance(source.getManaCostsToPay().getX()), game);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -139,11 +139,15 @@ public class AddCountersSourceEffect extends OneShotEffect<AddCountersSourceEffe
|
||||||
sb.append("put ");
|
sb.append("put ");
|
||||||
if (counter.getCount() > 1) {
|
if (counter.getCount() > 1) {
|
||||||
sb.append(CardUtil.numberToText(counter.getCount())).append(" ");
|
sb.append(CardUtil.numberToText(counter.getCount())).append(" ");
|
||||||
|
} else {
|
||||||
|
if (amount.toString().equals("X") && amount.getMessage().isEmpty()) {
|
||||||
|
sb.append("X ");
|
||||||
} else {
|
} else {
|
||||||
sb.append("a ");
|
sb.append("a ");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
sb.append(counter.getName().toLowerCase()).append(" counter on {this}");
|
sb.append(counter.getName().toLowerCase()).append(" counter on {this}");
|
||||||
if (amount.getMessage().length() > 0) {
|
if (!amount.getMessage().isEmpty()) {
|
||||||
sb.append(" for each ").append(amount.getMessage());
|
sb.append(" for each ").append(amount.getMessage());
|
||||||
}
|
}
|
||||||
staticText = sb.toString();
|
staticText = sb.toString();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue