[WOE] Implement Devouring Sugarmaw (#10969)

* [WOE] Implement Devouring Sugarmaw

* fix adventure cost

---------

Co-authored-by: xenohedron <xenohedron@users.noreply.github.com>
This commit is contained in:
Susucre 2023-08-24 02:38:26 +02:00 committed by GitHub
parent a756529e05
commit c047829614
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 83 additions and 3 deletions

View file

@ -0,0 +1,80 @@
package mage.cards.d;
import mage.MageInt;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.TapSourceEffect;
import mage.abilities.keyword.MenaceAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.AdventureCard;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.permanent.token.FoodToken;
import mage.game.permanent.token.HumanToken;
import java.util.UUID;
/**
* @author Susucr
*/
public final class DevouringSugarmaw extends AdventureCard {
private static final FilterControlledPermanent filter =
new FilterControlledPermanent("an artifact, enchantment, or token");
static {
filter.add(Predicates.or(
CardType.ARTIFACT.getPredicate(),
CardType.ENCHANTMENT.getPredicate(),
TokenPredicate.TRUE
));
}
public DevouringSugarmaw(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, new CardType[]{CardType.INSTANT}, "{2}{B}{B}", "Have for Dinner", "{1}{W}");
this.subtype.add(SubType.HORROR);
this.power = new MageInt(6);
this.toughness = new MageInt(6);
// Menace
this.addAbility(new MenaceAbility(false));
// Trample
this.addAbility(TrampleAbility.getInstance());
// At the beginning of your upkeep, you may sacrifice an artifact, enchantment, or token. If you don't, tap Devouring Sugarmaw.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
new DoIfCostPaid(
null,
new TapSourceEffect(),
new SacrificeTargetCost(filter),
true
),
TargetController.YOU,
false
));
// Have for Dinner
// Create a 1/1 white Human creature token and a Food token.
this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new HumanToken()));
this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new FoodToken())
.setText("and a Food token"));
}
private DevouringSugarmaw(final DevouringSugarmaw card) {
super(card);
}
@Override
public DevouringSugarmaw copy() {
return new DevouringSugarmaw(this);
}
}

View file

@ -53,6 +53,7 @@ public final class WildsOfEldraine extends ExpansionSet {
cards.add(new SetCardInfo("Cursed Courtier", 9, Rarity.UNCOMMON, mage.cards.c.CursedCourtier.class));
cards.add(new SetCardInfo("Cut In", 125, Rarity.COMMON, mage.cards.c.CutIn.class));
cards.add(new SetCardInfo("Decadent Dragon", 223, Rarity.RARE, mage.cards.d.DecadentDragon.class));
cards.add(new SetCardInfo("Devouring Sugarmaw", 224, Rarity.RARE, mage.cards.d.DevouringSugarmaw.class));
cards.add(new SetCardInfo("Discerning Financier", 10, Rarity.UNCOMMON, mage.cards.d.DiscerningFinancier.class));
cards.add(new SetCardInfo("Disdainful Stroke", 47, Rarity.UNCOMMON, mage.cards.d.DisdainfulStroke.class));
cards.add(new SetCardInfo("Dream Spoilers", 85, Rarity.UNCOMMON, mage.cards.d.DreamSpoilers.class));

View file

@ -160,9 +160,8 @@ public class DoIfCostPaid extends OneShotEffect {
return staticText;
}
return (optional ? "you may " : "")
+ CardUtil.addCostVerb(cost.getText())
+ ". If you do, "
+ executingEffects.getText(mode)
+ CardUtil.addCostVerb(cost.getText()) + "."
+ (!executingEffects.isEmpty() ? " If you do, " + executingEffects.getText(mode) : "")
+ (!otherwiseEffects.isEmpty() ? " If you don't, " + otherwiseEffects.getText(mode) : "");
}