From c1dc288ccfb3424217adc77c6f4707abce31683c Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 7 May 2013 16:56:46 +0200 Subject: [PATCH] Added manacosts to the display of half cards tooltip window. Minor changes of rule text generation. --- .../src/mage/sets/dragonsmaze/TurnBurn.java | 2 +- .../effects/common/DamageTargetEffect.java | 3 ++ Mage/src/mage/cards/SplitCard.java | 28 +++++++++++++++++-- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/TurnBurn.java b/Mage.Sets/src/mage/sets/dragonsmaze/TurnBurn.java index 21d9ba676c..9536ef0a53 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/TurnBurn.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/TurnBurn.java @@ -67,7 +67,7 @@ public class TurnBurn extends SplitCard { // Burn deals 2 damage to target creature or player. getRightHalfCard().getColor().setRed(true); Effect effect = new DamageTargetEffect(2); - effect.setText("Burn deals 2 damage to target creature or player."); + effect.setText("Burn deals 2 damage to target creature or player"); getRightHalfCard().getSpellAbility().addEffect(effect); getRightHalfCard().getSpellAbility().addTarget(new TargetCreatureOrPlayer(true)); diff --git a/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java b/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java index f35acc0b1b..44d0d4a89a 100644 --- a/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java @@ -133,6 +133,9 @@ public class DamageTargetEffect extends OneShotEffect { @Override public String getText(Mode mode) { + if (staticText != null && !staticText.isEmpty()) { + return staticText; + } StringBuilder sb = new StringBuilder(); String message = amount.getMessage(); sb.append("{source} deals "); diff --git a/Mage/src/mage/cards/SplitCard.java b/Mage/src/mage/cards/SplitCard.java index dcff7520ce..fae71ecb53 100644 --- a/Mage/src/mage/cards/SplitCard.java +++ b/Mage/src/mage/cards/SplitCard.java @@ -38,6 +38,8 @@ import mage.abilities.Abilities; import mage.abilities.AbilitiesImpl; import mage.abilities.Ability; import mage.abilities.SpellAbility; +import mage.abilities.costs.mana.ManaCosts; +import mage.abilities.costs.mana.ManaCostsImpl; import mage.watchers.Watcher; /** @@ -109,7 +111,7 @@ public abstract class SplitCard> extends CardImpl { rules.addAll(leftHalfCard.getRules()); rules.addAll(rightHalfCard.getRules()); if (getSpellAbility().getSpellAbilityType().equals(SpellAbilityType.SPLIT_FUSED)) { - rules.add("------------------------------------------------------------------------"); + rules.add("--------------------------------------------------------------------------"); rules.add("Fuse (You may cast one or both halves of this card from your hand.)"); } return rules; @@ -164,7 +166,17 @@ class LeftHalfCard extends CardImpl { @Override public List getRules() { List rules = new ArrayList(); - rules.add(new StringBuilder("").append(this.getName()).append("").toString()); + // TODO: Move formatting to client CardInfoPaneImpl.java + StringBuilder buffer = new StringBuilder(); + buffer.append(""); + buffer.append("
"); + buffer.append(this.getName()); + buffer.append(""); + buffer.append(getSpellAbility().getManaCosts().getText()); + buffer.append("
"); + rules.add(buffer.toString()); rules.addAll(super.getRules()); return rules; } @@ -193,7 +205,17 @@ class RightHalfCard extends CardImpl { @Override public List getRules() { List rules = new ArrayList(); - rules.add(new StringBuilder("").append(this.getName()).append("").toString()); + // TODO: Move formatting to client CardInfoPaneImpl.java + StringBuilder buffer = new StringBuilder(); + buffer.append(""); + buffer.append("
"); + buffer.append(this.getName()); + buffer.append(""); + buffer.append(getSpellAbility().getManaCosts().getText()); + buffer.append("
"); + rules.add(buffer.toString()); rules.addAll(super.getRules()); return rules; }