Fixed some tests that failed after changes to rule text generation.

This commit is contained in:
LevelX2 2013-10-22 14:05:40 +02:00
parent da099c2da5
commit dfa91ceeaf
10 changed files with 27 additions and 47 deletions

View file

@ -30,7 +30,6 @@ package mage.sets.eventide;
import java.util.UUID;
import mage.MageInt;
import mage.Mana;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;

View file

@ -35,8 +35,10 @@ import mage.abilities.condition.Condition;
import mage.abilities.condition.common.HasCounterCondition;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.WinGameEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.ShroudAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -66,7 +68,9 @@ public class HelixPinnacle extends CardImpl<HelixPinnacle> {
this.addAbility(ShroudAbility.getInstance());
// {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.
Condition condition = new HasCounterCondition(CounterType.TOWER, 100);
@ -83,30 +87,3 @@ public class HelixPinnacle extends CardImpl<HelixPinnacle> {
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;
}
}

View file

@ -139,11 +139,15 @@ public class AddCountersSourceEffect extends OneShotEffect<AddCountersSourceEffe
sb.append("put ");
if (counter.getCount() > 1) {
sb.append(CardUtil.numberToText(counter.getCount())).append(" ");
} else {
if (amount.toString().equals("X") && amount.getMessage().isEmpty()) {
sb.append("X ");
} else {
sb.append("a ");
}
}
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());
}
staticText = sb.toString();