From b441a1662764952e9be2a3854efc98ec4c4caeae Mon Sep 17 00:00:00 2001 From: Plopman Date: Wed, 5 Jun 2013 20:03:18 +0200 Subject: [PATCH] Added DynamicValue to damageControllerEffect --- .../common/DamageControllerEffect.java | 54 +++++++++++++++---- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git a/Mage/src/mage/abilities/effects/common/DamageControllerEffect.java b/Mage/src/mage/abilities/effects/common/DamageControllerEffect.java index d20400f73d..27a0c501e8 100644 --- a/Mage/src/mage/abilities/effects/common/DamageControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageControllerEffect.java @@ -30,6 +30,9 @@ package mage.abilities.effects.common; import mage.Constants.Outcome; import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; import mage.game.Game; import mage.players.Player; @@ -40,7 +43,7 @@ import mage.players.Player; */ public class DamageControllerEffect extends OneShotEffect { - protected int amount; + protected DynamicValue amount; protected boolean preventable; public DamageControllerEffect(int amount) { @@ -49,13 +52,22 @@ public class DamageControllerEffect extends OneShotEffect 0) { + if (message.equals("1")) { + sb.append(" equal to the number of "); + } else { + if (message.startsWith("the") || message.startsWith("twice")) { + sb.append(" equal to "); + } else { + sb.append(" for each "); + } + } + sb.append(message); + } + if (!preventable) { sb.append(". The damage can't be prevented"); - staticText = sb.toString(); + } + return sb.toString(); } }