* Level up cards - Fixed tooltip rule text generation of level up cards.

This commit is contained in:
LevelX2 2013-10-30 16:23:32 +01:00
parent ecd790515a
commit 2d1c3397e8
4 changed files with 13 additions and 9 deletions

View file

@ -69,7 +69,7 @@ public class Effects extends ArrayList<Effect> {
sbText.append(endString).append(rule);
}
}
if (rule != null && rule.length()> 3 && !rule.endsWith(".") && !rule.endsWith("\"")) {
if (rule != null && rule.length()> 3 && !rule.endsWith(".") && !rule.endsWith("\"") && !rule.startsWith("<b>Level ")) {
sbText.append(".");
}
return sbText.toString();

View file

@ -28,11 +28,11 @@
package mage.abilities.keyword;
import mage.constants.TimingRule;
import mage.constants.Zone;
import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.constants.TimingRule;
import mage.constants.Zone;
import mage.counters.common.LevelCounter;
/**
@ -57,6 +57,7 @@ public class LevelUpAbility extends ActivatedAbilityImpl<LevelUpAbility> {
@Override
public String getRule() {
return "Level up " + manaCostsToPay.getText();
return new StringBuilder("Level up ").append(manaCostsToPay.getText())
.append(" <i>(").append(manaCostsToPay.getText()).append(": Put a level counter on this. Level up only as a sorcery.)</i>").toString();
}
}

View file

@ -77,7 +77,9 @@ public class LevelerCardBuilder {
for (Ability ability : abilities) {
ContinuousEffect effect = new GainAbilitySourceEffect(ability);
ConditionalContinousEffect abEffect = new ConditionalContinousEffect(effect, condition, "");
constructed.add(new SimpleStaticAbility(Zone.BATTLEFIELD, abEffect));
Ability staticAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, abEffect);
staticAbility.setRuleVisible(false);
constructed.add(staticAbility);
}
ContinuousEffect effect = new SetPowerToughnessSourceEffect(power, toughness, Duration.WhileOnBattlefield);
@ -216,14 +218,14 @@ public class LevelerCardBuilder {
public String getRule() {
StringBuilder sb = new StringBuilder();
sb.append("Level ").append(level1);
sb.append("<b>Level ").append(level1);
if (level2 == -1) {
sb.append("+");
}
else {
sb.append("-").append(level2);
}
sb.append(": ").append(power).append("/").append(toughness).append(" ");
sb.append(":</b> ").append(power).append("/").append(toughness).append(" ");
for (String rule: abilities.getRules("{this}")) {
sb.append(rule).append(" ");
}

View file

@ -28,11 +28,10 @@
package mage.cards;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
@ -47,6 +46,7 @@ public abstract class LevelerCard<T extends LevelerCard<T>> extends CardImpl<T>
public LevelerCard(LevelerCard card) {
super(card);
this.maxLevelCounters = card.maxLevelCounters;
}
public int getMaxLevelCounters() {
@ -56,4 +56,5 @@ public abstract class LevelerCard<T extends LevelerCard<T>> extends CardImpl<T>
public void setMaxLevelCounters(int maxLevelCounters) {
this.maxLevelCounters = maxLevelCounters;
}
}