Added manacosts to the display of half cards tooltip window. Minor changes of rule text generation.

This commit is contained in:
LevelX2 2013-05-07 16:56:46 +02:00
parent f31fc9d9aa
commit c1dc288ccf
3 changed files with 29 additions and 4 deletions

View file

@ -67,7 +67,7 @@ public class TurnBurn extends SplitCard<TurnBurn> {
// 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));

View file

@ -133,6 +133,9 @@ public class DamageTargetEffect extends OneShotEffect<DamageTargetEffect> {
@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 ");

View file

@ -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<T extends SplitCard<T>> extends CardImpl<T> {
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<LeftHalfCard> {
@Override
public List<String> getRules() {
List<String> rules = new ArrayList<String>();
rules.add(new StringBuilder("<b>").append(this.getName()).append("<b/>").toString());
// TODO: Move formatting to client CardInfoPaneImpl.java
StringBuilder buffer = new StringBuilder();
buffer.append("<table cellspacing=0 cellpadding=0 border=0 width='100%'>");
buffer.append("<tr><td valign='top'><b>");
buffer.append(this.getName());
buffer.append("</b></td><td align='right' valign='top' style='width:");
buffer.append(getSpellAbility().getManaCosts().getSymbols().size() * 11 + 1);
buffer.append("px'>");
buffer.append(getSpellAbility().getManaCosts().getText());
buffer.append("</td></tr></table>");
rules.add(buffer.toString());
rules.addAll(super.getRules());
return rules;
}
@ -193,7 +205,17 @@ class RightHalfCard extends CardImpl<RightHalfCard> {
@Override
public List<String> getRules() {
List<String> rules = new ArrayList<String>();
rules.add(new StringBuilder("<b>").append(this.getName()).append("<b/>").toString());
// TODO: Move formatting to client CardInfoPaneImpl.java
StringBuilder buffer = new StringBuilder();
buffer.append("<table cellspacing=0 cellpadding=0 border=0 width='100%'>");
buffer.append("<tr><td valign='top'><b>");
buffer.append(this.getName());
buffer.append("</b></td><td align='right' valign='top' style='width:");
buffer.append(getSpellAbility().getManaCosts().getSymbols().size() * 11 + 1);
buffer.append("px'>");
buffer.append(getSpellAbility().getManaCosts().getText());
buffer.append("</td></tr></table>");
rules.add(buffer.toString());
rules.addAll(super.getRules());
return rules;
}