* ConditionalReplacementEffect - Added text method that uses text of decorated effect.

This commit is contained in:
LevelX2 2013-10-30 08:16:33 +01:00
parent 4e35568bb5
commit ecd790515a

View file

@ -28,6 +28,7 @@
package mage.abilities.decorator;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.condition.Condition;
import mage.abilities.condition.FixedCondition;
import mage.abilities.effects.ReplacementEffect;
@ -115,6 +116,14 @@ public class ConditionalReplacementEffect extends ReplacementEffectImpl<Conditio
return false;
}
@Override
public String getText(Mode mode) {
if (staticText == null || staticText.isEmpty() && this.effect != null) { // usefull for conditional night/day card abilities
return effect.getText(mode);
}
return staticText;
}
@Override
public ConditionalReplacementEffect copy() {
return new ConditionalReplacementEffect(this);