Replace more custom effects with SavedDamageValue

This commit is contained in:
Alex W. Jackson 2022-04-02 02:11:12 -04:00
parent ca9b2ea135
commit 081b2f2f39
48 changed files with 318 additions and 1226 deletions

View file

@ -19,13 +19,13 @@ public class DamageAttachedControllerEffect extends OneShotEffect {
protected DynamicValue amount;
public DamageAttachedControllerEffect(int amount) {
super(Outcome.Damage);
this.amount = StaticValue.get(amount);
this(StaticValue.get(amount));
}
public DamageAttachedControllerEffect(DynamicValue amount) {
super(Outcome.Damage);
this.amount = amount;
this.staticText = "{this} deals " + amount + " damage to that creature's controller";
}
public DamageAttachedControllerEffect(final DamageAttachedControllerEffect effect) {
@ -60,15 +60,4 @@ public class DamageAttachedControllerEffect extends OneShotEffect {
}
return false;
}
@Override
public String getText(Mode mode) {
if (staticText != null && !staticText.isEmpty()) {
return staticText;
}
if ("equal to".equals(amount.toString())) {
return "{this} deals damage " + amount + " that creatures toughness to that creature's controller";
}
return "{this} deals " + amount + " damage to that creature's controller";
}
}