From a427406d5fc5c0927b48ce6761ceb14e0181381f Mon Sep 17 00:00:00 2001 From: xenohedron Date: Tue, 29 Aug 2023 23:33:59 -0400 Subject: [PATCH] fix Sutured Ghoul --- Mage.Sets/src/mage/cards/s/SuturedGhoul.java | 19 ++++++++----------- .../SetBasePowerToughnessSourceEffect.java | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Mage.Sets/src/mage/cards/s/SuturedGhoul.java b/Mage.Sets/src/mage/cards/s/SuturedGhoul.java index a910577a8f8..888c9eb249b 100644 --- a/Mage.Sets/src/mage/cards/s/SuturedGhoul.java +++ b/Mage.Sets/src/mage/cards/s/SuturedGhoul.java @@ -8,7 +8,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.Card; import mage.cards.CardImpl; @@ -27,13 +27,10 @@ import mage.players.Player; import mage.target.common.TargetCardInYourGraveyard; /** - * @author nantuko + * @author nantuko, xenohedron */ public final class SuturedGhoul extends CardImpl { - private static final String staticText = "exile any number of creature cards from your graveyard"; - private static final String staticText2 = "Sutured Ghoul's power is equal to the total power of the exiled cards and its toughness is equal to their total toughness"; - public SuturedGhoul(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}{B}"); this.subtype.add(SubType.ZOMBIE); @@ -44,12 +41,12 @@ public final class SuturedGhoul extends CardImpl { this.addAbility(TrampleAbility.getInstance()); // As Sutured Ghoul enters the battlefield, exile any number of creature cards from your graveyard. - this.addAbility(new AsEntersBattlefieldAbility(new SuturedGhoulEffect(), staticText)); + this.addAbility(new AsEntersBattlefieldAbility(new SuturedGhoulEffect())); // Sutured Ghoul's power is equal to the total power of the exiled cards and its toughness is equal to their total toughness. - BoostSourceEffect effect = new BoostSourceEffect(SuturedGhoulPowerCount.instance, SuturedGhoulToughnessCount.instance, Duration.WhileOnBattlefield); - effect.setText(staticText2); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + this.addAbility(new SimpleStaticAbility(new SetBasePowerToughnessSourceEffect( + SuturedGhoulPowerCount.instance, SuturedGhoulToughnessCount.instance, Duration.WhileOnBattlefield, + "{this}'s power is equal to the total power of the exiled cards and its toughness is equal to their total toughness"))); } private SuturedGhoul(final SuturedGhoul card) { @@ -64,12 +61,12 @@ public final class SuturedGhoul extends CardImpl { class SuturedGhoulEffect extends OneShotEffect { - public SuturedGhoulEffect() { + SuturedGhoulEffect() { super(Outcome.Benefit); staticText = "exile any number of creature cards from your graveyard"; } - public SuturedGhoulEffect(SuturedGhoulEffect effect) { + private SuturedGhoulEffect(final SuturedGhoulEffect effect) { super(effect); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerToughnessSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerToughnessSourceEffect.java index 24970e7b122..b6e2803ac1f 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerToughnessSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetBasePowerToughnessSourceEffect.java @@ -52,6 +52,22 @@ public class SetBasePowerToughnessSourceEffect extends ContinuousEffectImpl { } } + /** + * @param power set in layer 7b + * @param toughness set in layer 7b + * @param duration Duration for the effect + * @param text Text to set as staticText + */ + public SetBasePowerToughnessSourceEffect(DynamicValue power, DynamicValue toughness, Duration duration, String text) { + this(power, toughness, duration, SubLayer.SetPT_7b); + this.staticText = text; + } + + /** + * @param power set in layer 7b + * @param toughness set in layer 7b + * @param duration Duration for the effect + */ public SetBasePowerToughnessSourceEffect(int power, int toughness, Duration duration) { this(StaticValue.get(power), StaticValue.get(toughness), duration, SubLayer.SetPT_7b); this.staticText = "{this} has base power and toughness " + power + '/' + toughness + ' ' + duration.toString();