fix Sutured Ghoul

This commit is contained in:
xenohedron 2023-08-29 23:33:59 -04:00
parent 476136b766
commit a427406d5f
2 changed files with 24 additions and 11 deletions

View file

@ -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);
}

View file

@ -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();