From 2d1c3397e8c74951301b5e1c5553076f582768b6 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 30 Oct 2013 16:23:32 +0100 Subject: [PATCH] * Level up cards - Fixed tooltip rule text generation of level up cards. --- Mage/src/mage/abilities/effects/Effects.java | 2 +- Mage/src/mage/abilities/keyword/LevelUpAbility.java | 7 ++++--- Mage/src/mage/abilities/keyword/LevelerCardBuilder.java | 8 +++++--- Mage/src/mage/cards/LevelerCard.java | 5 +++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Mage/src/mage/abilities/effects/Effects.java b/Mage/src/mage/abilities/effects/Effects.java index 72215d68db..cd236daf64 100644 --- a/Mage/src/mage/abilities/effects/Effects.java +++ b/Mage/src/mage/abilities/effects/Effects.java @@ -69,7 +69,7 @@ public class Effects extends ArrayList { 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("Level ")) { sbText.append("."); } return sbText.toString(); diff --git a/Mage/src/mage/abilities/keyword/LevelUpAbility.java b/Mage/src/mage/abilities/keyword/LevelUpAbility.java index 1a4a3872fb..4b69206ddd 100644 --- a/Mage/src/mage/abilities/keyword/LevelUpAbility.java +++ b/Mage/src/mage/abilities/keyword/LevelUpAbility.java @@ -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 { @Override public String getRule() { - return "Level up " + manaCostsToPay.getText(); + return new StringBuilder("Level up ").append(manaCostsToPay.getText()) + .append(" (").append(manaCostsToPay.getText()).append(": Put a level counter on this. Level up only as a sorcery.)").toString(); } } diff --git a/Mage/src/mage/abilities/keyword/LevelerCardBuilder.java b/Mage/src/mage/abilities/keyword/LevelerCardBuilder.java index 20d6c6a16e..58e1751529 100644 --- a/Mage/src/mage/abilities/keyword/LevelerCardBuilder.java +++ b/Mage/src/mage/abilities/keyword/LevelerCardBuilder.java @@ -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("Level ").append(level1); if (level2 == -1) { sb.append("+"); } else { sb.append("-").append(level2); } - sb.append(": ").append(power).append("/").append(toughness).append(" "); + sb.append(": ").append(power).append("/").append(toughness).append(" "); for (String rule: abilities.getRules("{this}")) { sb.append(rule).append(" "); } diff --git a/Mage/src/mage/cards/LevelerCard.java b/Mage/src/mage/cards/LevelerCard.java index 368fa16c1f..e42578369a 100644 --- a/Mage/src/mage/cards/LevelerCard.java +++ b/Mage/src/mage/cards/LevelerCard.java @@ -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> extends CardImpl public LevelerCard(LevelerCard card) { super(card); + this.maxLevelCounters = card.maxLevelCounters; } public int getMaxLevelCounters() { @@ -56,4 +56,5 @@ public abstract class LevelerCard> extends CardImpl public void setMaxLevelCounters(int maxLevelCounters) { this.maxLevelCounters = maxLevelCounters; } + }