From f707dfe94fd32d40067f73a7fdc58c5ab38c897a Mon Sep 17 00:00:00 2001
From: Evan Kranzler <theelk801@gmail.com>
Date: Fri, 4 Feb 2022 09:50:03 -0500
Subject: [PATCH] [ODY] two small changes to Flame Burst and Muscle Burst

---
 Mage.Sets/src/mage/cards/f/FlameBurst.java  | 47 +++++++------------
 Mage.Sets/src/mage/cards/m/MuscleBurst.java | 50 +++++++--------------
 2 files changed, 32 insertions(+), 65 deletions(-)

diff --git a/Mage.Sets/src/mage/cards/f/FlameBurst.java b/Mage.Sets/src/mage/cards/f/FlameBurst.java
index cdf034fb28..dc4842490a 100644
--- a/Mage.Sets/src/mage/cards/f/FlameBurst.java
+++ b/Mage.Sets/src/mage/cards/f/FlameBurst.java
@@ -1,11 +1,12 @@
 
 package mage.cards.f;
 
-import java.util.UUID;
 import mage.abilities.Ability;
 import mage.abilities.common.SimpleStaticAbility;
+import mage.abilities.dynamicvalue.AdditiveDynamicValue;
+import mage.abilities.dynamicvalue.DynamicValue;
 import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount;
-import mage.abilities.effects.Effect;
+import mage.abilities.dynamicvalue.common.StaticValue;
 import mage.abilities.effects.common.DamageTargetEffect;
 import mage.abilities.effects.common.InfoEffect;
 import mage.cards.CardImpl;
@@ -16,11 +17,11 @@ import mage.filter.FilterCard;
 import mage.filter.predicate.Predicates;
 import mage.filter.predicate.mageobject.AbilityPredicate;
 import mage.filter.predicate.mageobject.NamePredicate;
-import mage.game.Game;
 import mage.target.common.TargetAnyTarget;
 
+import java.util.UUID;
+
 /**
- *
  * @author LoneFox
  */
 public final class FlameBurst extends CardImpl {
@@ -28,17 +29,21 @@ public final class FlameBurst extends CardImpl {
     private static final FilterCard filter = new FilterCard();
 
     static {
-        filter.add(Predicates.or(new NamePredicate("Flame Burst"),
-            new AbilityPredicate(CountAsFlameBurstAbility.class)));
+        filter.add(Predicates.or(
+                new NamePredicate("Flame Burst"),
+                new AbilityPredicate(CountAsFlameBurstAbility.class)
+        ));
     }
 
+    private static final DynamicValue xValue = new AdditiveDynamicValue(
+            new CardsInAllGraveyardsCount(filter), StaticValue.get(2)
+    );
+
     public FlameBurst(UUID ownerId, CardSetInfo setInfo) {
-        super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{R}");
+        super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}");
 
         // Flame Burst deals X damage to any target, where X is 2 plus the number of cards named Flame Burst in all graveyards.
-        Effect effect = new DamageTargetEffect(new FlameBurstCount(filter));
-        effect.setText("{this} deals X damage to any target, where X is 2 plus the number of cards named Flame Burst in all graveyards.");
-        this.getSpellAbility().addEffect(effect);
+        this.getSpellAbility().addEffect(new DamageTargetEffect(xValue).setText("{this} deals X damage to any target, where X is 2 plus the number of cards named Flame Burst in all graveyards."));
         this.getSpellAbility().addTarget(new TargetAnyTarget());
     }
 
@@ -56,28 +61,6 @@ public final class FlameBurst extends CardImpl {
     }
 }
 
-class FlameBurstCount extends CardsInAllGraveyardsCount {
-
-    public FlameBurstCount(FilterCard filter) {
-        super(filter);
-    }
-
-    public FlameBurstCount(FlameBurstCount value) {
-        super(value);
-    }
-
-    @Override
-    public FlameBurstCount copy() {
-        return new FlameBurstCount(this);
-    }
-
-    @Override
-    public int calculate(Game game, Ability sourceAbility, Effect effect) {
-        return super.calculate(game, sourceAbility, effect) + 2;
-    }
-
-}
-
 class CountAsFlameBurstAbility extends SimpleStaticAbility {
 
     public CountAsFlameBurstAbility() {
diff --git a/Mage.Sets/src/mage/cards/m/MuscleBurst.java b/Mage.Sets/src/mage/cards/m/MuscleBurst.java
index b77fb96193..afb7881ac6 100644
--- a/Mage.Sets/src/mage/cards/m/MuscleBurst.java
+++ b/Mage.Sets/src/mage/cards/m/MuscleBurst.java
@@ -1,11 +1,12 @@
 
 package mage.cards.m;
 
-import java.util.UUID;
 import mage.abilities.Ability;
 import mage.abilities.common.SimpleStaticAbility;
+import mage.abilities.dynamicvalue.AdditiveDynamicValue;
+import mage.abilities.dynamicvalue.DynamicValue;
 import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount;
-import mage.abilities.effects.Effect;
+import mage.abilities.dynamicvalue.common.StaticValue;
 import mage.abilities.effects.common.InfoEffect;
 import mage.abilities.effects.common.continuous.BoostTargetEffect;
 import mage.cards.CardImpl;
@@ -17,11 +18,11 @@ import mage.filter.FilterCard;
 import mage.filter.predicate.Predicates;
 import mage.filter.predicate.mageobject.AbilityPredicate;
 import mage.filter.predicate.mageobject.NamePredicate;
-import mage.game.Game;
 import mage.target.common.TargetCreaturePermanent;
 
+import java.util.UUID;
+
 /**
- *
  * @author LoneFox
  */
 public final class MuscleBurst extends CardImpl {
@@ -29,18 +30,23 @@ public final class MuscleBurst extends CardImpl {
     private static final FilterCard filter = new FilterCard();
 
     static {
-        filter.add(Predicates.or(new NamePredicate("Muscle Burst"),
-            new AbilityPredicate(CountAsMuscleBurstAbility.class)));
+        filter.add(Predicates.or(
+                new NamePredicate("Muscle Burst"),
+                new AbilityPredicate(CountAsMuscleBurstAbility.class)
+        ));
     }
 
+    private static final DynamicValue xValue = new AdditiveDynamicValue(
+            new CardsInAllGraveyardsCount(filter), StaticValue.get(3)
+    );
+
     public MuscleBurst(UUID ownerId, CardSetInfo setInfo) {
-        super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{G}");
+        super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}");
 
         // Target creature gets +X/+X until end of turn, where X is 3 plus the number of cards named Muscle Burst in all graveyards.
-        MuscleBurstCount count = new MuscleBurstCount(filter);
-        Effect effect = new BoostTargetEffect(count, count, Duration.EndOfTurn, true);
-        effect.setText("Target creature gets +X/+X until end of turn, where X is 3 plus the number of cards named Muscle Burst in all graveyards.");
-        this.getSpellAbility().addEffect(effect);
+        this.getSpellAbility().addEffect(new BoostTargetEffect(
+                xValue, xValue, Duration.EndOfTurn, true
+        ).setText("Target creature gets +X/+X until end of turn, where X is 3 plus the number of cards named Muscle Burst in all graveyards."));
         this.getSpellAbility().addTarget(new TargetCreaturePermanent());
     }
 
@@ -58,28 +64,6 @@ public final class MuscleBurst extends CardImpl {
     }
 }
 
-class MuscleBurstCount extends CardsInAllGraveyardsCount {
-
-    public MuscleBurstCount(FilterCard filter) {
-        super(filter);
-    }
-
-    private MuscleBurstCount(MuscleBurstCount value) {
-        super(value);
-    }
-
-    @Override
-    public MuscleBurstCount copy() {
-        return new MuscleBurstCount(this);
-    }
-
-    @Override
-    public int calculate(Game game, Ability sourceAbility, Effect effect) {
-        return super.calculate(game, sourceAbility, effect) + 3;
-    }
-
-}
-
 class CountAsMuscleBurstAbility extends SimpleStaticAbility {
 
     public CountAsMuscleBurstAbility() {