represent alt mana cost {0} as MagicManaCost.NONE so that no log message if shown if there is no cost modification, fixes #640

master
melvinzhang 2016-01-11 10:35:06 +08:00
parent 165c19aee7
commit 8751f451e5
2 changed files with 6 additions and 3 deletions

View File

@ -221,9 +221,11 @@ public enum MagicCostEvent {
},
AltManaCost("(pay )?alt mana cost " + ARG.MANACOST) {
public MagicEvent toEvent(final Matcher arg, final MagicSource source) {
return source instanceof MagicCard ?
MagicPayManaCostEvent.Cast((MagicCard)source, MagicManaCost.create(ARG.manacost(arg))):
new MagicPayManaCostEvent(source, MagicManaCost.create(ARG.manacost(arg)));
final MagicManaCost origCost = MagicManaCost.create(ARG.manacost(arg));
final MagicManaCost cost = origCost == MagicManaCost.ZERO ? MagicManaCost.NONE : origCost;
return (source instanceof MagicCard) ?
MagicPayManaCostEvent.Cast((MagicCard)source, cost) :
new MagicPayManaCostEvent(source, cost);
}
},
DamageYou("SN deals " + ARG.NUMBER + " damage to you") {

View File

@ -32,6 +32,7 @@ class TestCostReduction extends TestGameBuilder {
addToHand(P, "Enrage", 1);
addToHand(P, "Bonfire of the Damned", 1);
addToHand(P, "Gut Shot", 1);
addToHand(P, "Kobolds of Kher Keep", 1);
P = opponent;