From b59f8e889daae615a1144641f24038ef22db7054 Mon Sep 17 00:00:00 2001 From: Susucre <34709007+Susucre@users.noreply.github.com> Date: Sat, 29 Jun 2024 17:03:33 +0200 Subject: [PATCH] implement [BLB] Carrot Cake --- Mage.Sets/src/mage/cards/c/CarrotCake.java | 51 +++++++++++++++++++ .../src/mage/cards/d/DaemogothWoeEater.java | 2 +- Mage.Sets/src/mage/cards/f/FoulEmissary.java | 5 +- .../src/mage/cards/o/OrdealOfErebos.java | 12 ++--- .../src/mage/cards/o/OrdealOfHeliod.java | 12 ++--- Mage.Sets/src/mage/cards/o/OrdealOfNylea.java | 12 ++--- .../src/mage/cards/o/OrdealOfPurphoros.java | 12 ++--- .../src/mage/cards/o/OrdealOfThassa.java | 12 ++--- Mage.Sets/src/mage/sets/Bloomburrow.java | 1 + .../SacrificeSourceTriggeredAbility.java | 4 ++ 10 files changed, 89 insertions(+), 34 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/c/CarrotCake.java diff --git a/Mage.Sets/src/mage/cards/c/CarrotCake.java b/Mage.Sets/src/mage/cards/c/CarrotCake.java new file mode 100644 index 00000000000..fea10dc1c2c --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CarrotCake.java @@ -0,0 +1,51 @@ +package mage.cards.c; + +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SacrificeSourceTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.keyword.ScryEffect; +import mage.abilities.meta.OrTriggeredAbility; +import mage.abilities.token.FoodAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.game.permanent.token.RabbitToken; + +import java.util.UUID; + +/** + * @author Susucr + */ +public final class CarrotCake extends CardImpl { + + public CarrotCake(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}{W}"); + + this.subtype.add(SubType.FOOD); + + // When Carrot Cake enters and when you sacrifice it, create a 1/1 white Rabbit creature token and scry 1. + Ability ability = new OrTriggeredAbility( + Zone.ALL, + new CreateTokenEffect(new RabbitToken()), + new EntersBattlefieldTriggeredAbility(null), + new SacrificeSourceTriggeredAbility(null) + ).setTriggerPhrase("When {this} enters and when you sacrifice it, "); + ability.addEffect(new ScryEffect(1).concatBy("and")); + this.addAbility(ability); + + // {2}, {T}, Sacrifice Carrot Cake: You gain 3 life. + this.addAbility(new FoodAbility(true)); + } + + private CarrotCake(final CarrotCake card) { + super(card); + } + + @Override + public CarrotCake copy() { + return new CarrotCake(this); + } +} diff --git a/Mage.Sets/src/mage/cards/d/DaemogothWoeEater.java b/Mage.Sets/src/mage/cards/d/DaemogothWoeEater.java index 3be3397bd6b..60a28d0a39a 100644 --- a/Mage.Sets/src/mage/cards/d/DaemogothWoeEater.java +++ b/Mage.Sets/src/mage/cards/d/DaemogothWoeEater.java @@ -36,7 +36,7 @@ public final class DaemogothWoeEater extends CardImpl { // When you sacrifice Daemogoth Woe-Eater, each opponent discards a card, you draw a card, and you gain 2 life. Ability ability = new SacrificeSourceTriggeredAbility( - new DiscardEachPlayerEffect(TargetController.OPPONENT), false + new DiscardEachPlayerEffect(TargetController.OPPONENT) ); ability.addEffect(new DrawCardSourceControllerEffect(1).concatBy(", you")); ability.addEffect(new GainLifeEffect(2).concatBy(", and")); diff --git a/Mage.Sets/src/mage/cards/f/FoulEmissary.java b/Mage.Sets/src/mage/cards/f/FoulEmissary.java index 63fa32885c2..9d55a9716fd 100644 --- a/Mage.Sets/src/mage/cards/f/FoulEmissary.java +++ b/Mage.Sets/src/mage/cards/f/FoulEmissary.java @@ -20,13 +20,12 @@ import mage.game.stack.Spell; import java.util.UUID; /** - * * @author LevelX2 */ public final class FoulEmissary extends CardImpl { public FoulEmissary(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); this.subtype.add(SubType.HUMAN, SubType.HORROR); this.power = new MageInt(1); this.toughness = new MageInt(1); @@ -52,7 +51,7 @@ public final class FoulEmissary extends CardImpl { class FoulEmissaryTriggeredAbility extends SacrificeSourceTriggeredAbility { public FoulEmissaryTriggeredAbility() { - super(new CreateTokenEffect(new EldraziHorrorToken()), false); + super(new CreateTokenEffect(new EldraziHorrorToken())); setTriggerPhrase("When you sacrifice {this} while casting a spell with emerge, "); } diff --git a/Mage.Sets/src/mage/cards/o/OrdealOfErebos.java b/Mage.Sets/src/mage/cards/o/OrdealOfErebos.java index 15b098f4430..e5febf073a2 100644 --- a/Mage.Sets/src/mage/cards/o/OrdealOfErebos.java +++ b/Mage.Sets/src/mage/cards/o/OrdealOfErebos.java @@ -1,7 +1,6 @@ package mage.cards.o; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.AttacksAttachedTriggeredAbility; import mage.abilities.common.SacrificeSourceTriggeredAbility; @@ -16,21 +15,22 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.AttachmentType; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.counters.CounterType; import mage.target.TargetPermanent; import mage.target.TargetPlayer; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class OrdealOfErebos extends CardImpl { public OrdealOfErebos(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); this.subtype.add(SubType.AURA); @@ -42,12 +42,12 @@ public final class OrdealOfErebos extends CardImpl { this.addAbility(ability); // Whenever enchanted creature attacks, put a +1/+1 counter on it. Then if it has three or more +1/+1 counters on it, sacrifice Ordeal of Erebos. - ability = new AttacksAttachedTriggeredAbility(new AddCountersAttachedEffect(CounterType.P1P1.createInstance(),"it"), AttachmentType.AURA, false); + ability = new AttacksAttachedTriggeredAbility(new AddCountersAttachedEffect(CounterType.P1P1.createInstance(), "it"), AttachmentType.AURA, false); ability.addEffect(new ConditionalOneShotEffect(new SacrificeSourceEffect(), new AttachedToCounterCondition(CounterType.P1P1, 3), "Then if it has three or more +1/+1 counters on it, sacrifice {this}")); this.addAbility(ability); // When you sacrifice Ordeal of Erebos, target player discards two cards. - ability = new SacrificeSourceTriggeredAbility(new DiscardTargetEffect(2), false); + ability = new SacrificeSourceTriggeredAbility(new DiscardTargetEffect(2)); ability.addTarget(new TargetPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/o/OrdealOfHeliod.java b/Mage.Sets/src/mage/cards/o/OrdealOfHeliod.java index 6facaa739a9..0493cb8c683 100644 --- a/Mage.Sets/src/mage/cards/o/OrdealOfHeliod.java +++ b/Mage.Sets/src/mage/cards/o/OrdealOfHeliod.java @@ -1,7 +1,6 @@ package mage.cards.o; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.AttacksAttachedTriggeredAbility; import mage.abilities.common.SacrificeSourceTriggeredAbility; @@ -16,20 +15,21 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.AttachmentType; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.counters.CounterType; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class OrdealOfHeliod extends CardImpl { public OrdealOfHeliod(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); this.subtype.add(SubType.AURA); // Enchant creature @@ -39,12 +39,12 @@ public final class OrdealOfHeliod extends CardImpl { Ability ability = new EnchantAbility(auraTarget); this.addAbility(ability); // Whenever enchanted creature attacks, put a +1/+1 counter on it. Then if it has three or more +1/+1 counters on it, sacrifice Ordeal of Heliod. - ability = new AttacksAttachedTriggeredAbility(new AddCountersAttachedEffect(CounterType.P1P1.createInstance(),"it"), AttachmentType.AURA, false); + ability = new AttacksAttachedTriggeredAbility(new AddCountersAttachedEffect(CounterType.P1P1.createInstance(), "it"), AttachmentType.AURA, false); ability.addEffect(new ConditionalOneShotEffect(new SacrificeSourceEffect(), new AttachedToCounterCondition(CounterType.P1P1, 3), "Then if it has three or more +1/+1 counters on it, sacrifice {this}")); this.addAbility(ability); // When you sacrifice Ordeal of Heliod, you gain 10 life. - this.addAbility(new SacrificeSourceTriggeredAbility(new GainLifeEffect(10), false)); + this.addAbility(new SacrificeSourceTriggeredAbility(new GainLifeEffect(10))); } private OrdealOfHeliod(final OrdealOfHeliod card) { diff --git a/Mage.Sets/src/mage/cards/o/OrdealOfNylea.java b/Mage.Sets/src/mage/cards/o/OrdealOfNylea.java index f4e67aa7509..1f63874fb59 100644 --- a/Mage.Sets/src/mage/cards/o/OrdealOfNylea.java +++ b/Mage.Sets/src/mage/cards/o/OrdealOfNylea.java @@ -1,7 +1,6 @@ package mage.cards.o; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.AttacksAttachedTriggeredAbility; import mage.abilities.common.SacrificeSourceTriggeredAbility; @@ -16,22 +15,23 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.AttachmentType; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.counters.CounterType; import mage.filter.StaticFilters; import mage.target.TargetPermanent; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class OrdealOfNylea extends CardImpl { public OrdealOfNylea(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); this.subtype.add(SubType.AURA); @@ -43,13 +43,13 @@ public final class OrdealOfNylea extends CardImpl { this.addAbility(ability); // Whenever enchanted creature attacks, put a +1/+1 counter on it. Then if it has three or more +1/+1 counters on it, sacrifice Ordeal of Nylea. - ability = new AttacksAttachedTriggeredAbility(new AddCountersAttachedEffect(CounterType.P1P1.createInstance(),"it"), AttachmentType.AURA, false); + ability = new AttacksAttachedTriggeredAbility(new AddCountersAttachedEffect(CounterType.P1P1.createInstance(), "it"), AttachmentType.AURA, false); ability.addEffect(new ConditionalOneShotEffect(new SacrificeSourceEffect(), new AttachedToCounterCondition(CounterType.P1P1, 3), "Then if it has three or more +1/+1 counters on it, sacrifice {this}")); this.addAbility(ability); // When you sacrifice Ordeal of Nylea, search your library for up to two basic land cards, put them onto the battlefield tapped, then shuffle your library. ability = new SacrificeSourceTriggeredAbility( - new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0,2, StaticFilters.FILTER_CARD_BASIC_LANDS),true),false); + new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 2, StaticFilters.FILTER_CARD_BASIC_LANDS), true)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/o/OrdealOfPurphoros.java b/Mage.Sets/src/mage/cards/o/OrdealOfPurphoros.java index e79c1576949..f6d46edf6cf 100644 --- a/Mage.Sets/src/mage/cards/o/OrdealOfPurphoros.java +++ b/Mage.Sets/src/mage/cards/o/OrdealOfPurphoros.java @@ -1,7 +1,6 @@ package mage.cards.o; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.AttacksAttachedTriggeredAbility; import mage.abilities.common.SacrificeSourceTriggeredAbility; @@ -16,21 +15,22 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.AttachmentType; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.counters.CounterType; import mage.target.TargetPermanent; import mage.target.common.TargetAnyTarget; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** - * * @author Plopman */ public final class OrdealOfPurphoros extends CardImpl { public OrdealOfPurphoros(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); this.subtype.add(SubType.AURA); @@ -41,13 +41,13 @@ public final class OrdealOfPurphoros extends CardImpl { Ability ability = new EnchantAbility(auraTarget); this.addAbility(ability); // Whenever enchanted creature attacks, put a +1/+1 counter on it. Then if it has three or more +1/+1 counters on it, sacrifice Ordeal of Purphoros. - ability = new AttacksAttachedTriggeredAbility(new AddCountersAttachedEffect(CounterType.P1P1.createInstance(),"it"), AttachmentType.AURA, false); + ability = new AttacksAttachedTriggeredAbility(new AddCountersAttachedEffect(CounterType.P1P1.createInstance(), "it"), AttachmentType.AURA, false); ability.addEffect(new ConditionalOneShotEffect(new SacrificeSourceEffect(), new AttachedToCounterCondition(CounterType.P1P1, 3), "Then if it has three or more +1/+1 counters on it, sacrifice {this}")); this.addAbility(ability); // When you sacrifice Ordeal of Purphoros, it deals 3 damage to any target. ability = new SacrificeSourceTriggeredAbility( - new DamageTargetEffect(3, "it"),false); + new DamageTargetEffect(3, "it")); ability.addTarget(new TargetAnyTarget()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/o/OrdealOfThassa.java b/Mage.Sets/src/mage/cards/o/OrdealOfThassa.java index 52cf98261fd..8da664fa614 100644 --- a/Mage.Sets/src/mage/cards/o/OrdealOfThassa.java +++ b/Mage.Sets/src/mage/cards/o/OrdealOfThassa.java @@ -1,7 +1,6 @@ package mage.cards.o; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.AttacksAttachedTriggeredAbility; import mage.abilities.common.SacrificeSourceTriggeredAbility; @@ -16,20 +15,21 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.AttachmentType; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.counters.CounterType; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class OrdealOfThassa extends CardImpl { public OrdealOfThassa(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); this.subtype.add(SubType.AURA); @@ -40,12 +40,12 @@ public final class OrdealOfThassa extends CardImpl { Ability ability = new EnchantAbility(auraTarget); this.addAbility(ability); // Whenever enchanted creature attacks, put a +1/+1 counter on it. Then if it has three or more +1/+1 counters on it, sacrifice Ordeal of Thassa. - ability = new AttacksAttachedTriggeredAbility(new AddCountersAttachedEffect(CounterType.P1P1.createInstance(),"it"), AttachmentType.AURA, false); + ability = new AttacksAttachedTriggeredAbility(new AddCountersAttachedEffect(CounterType.P1P1.createInstance(), "it"), AttachmentType.AURA, false); ability.addEffect(new ConditionalOneShotEffect(new SacrificeSourceEffect(), new AttachedToCounterCondition(CounterType.P1P1, 3), "Then if it has three or more +1/+1 counters on it, sacrifice {this}")); this.addAbility(ability); // When you sacrifice Ordeal of Thassa, draw two cards. - this.addAbility(new SacrificeSourceTriggeredAbility(new DrawCardSourceControllerEffect(2), false)); + this.addAbility(new SacrificeSourceTriggeredAbility(new DrawCardSourceControllerEffect(2))); } diff --git a/Mage.Sets/src/mage/sets/Bloomburrow.java b/Mage.Sets/src/mage/sets/Bloomburrow.java index 5f15e7395c4..f104f87b6cd 100644 --- a/Mage.Sets/src/mage/sets/Bloomburrow.java +++ b/Mage.Sets/src/mage/sets/Bloomburrow.java @@ -23,6 +23,7 @@ public final class Bloomburrow extends ExpansionSet { cards.add(new SetCardInfo("Bria, Riptide Rogue", 379, Rarity.MYTHIC, mage.cards.b.BriaRiptideRogue.class)); cards.add(new SetCardInfo("Byrke, Long Ear of the Law", 380, Rarity.MYTHIC, mage.cards.b.ByrkeLongEarOfTheLaw.class)); + cards.add(new SetCardInfo("Carrot Cake", 7, Rarity.COMMON, mage.cards.c.CarrotCake.class)); cards.add(new SetCardInfo("Early Winter", 93, Rarity.COMMON, mage.cards.e.EarlyWinter.class)); cards.add(new SetCardInfo("Lilypad Village", 255, Rarity.UNCOMMON, mage.cards.l.LilypadVillage.class)); cards.add(new SetCardInfo("Lumra, Bellow of the Woods", 183, Rarity.MYTHIC, mage.cards.l.LumraBellowOfTheWoods.class)); diff --git a/Mage/src/main/java/mage/abilities/common/SacrificeSourceTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/SacrificeSourceTriggeredAbility.java index fbf28ed71ac..778854acbcc 100644 --- a/Mage/src/main/java/mage/abilities/common/SacrificeSourceTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/SacrificeSourceTriggeredAbility.java @@ -15,6 +15,10 @@ public class SacrificeSourceTriggeredAbility extends TriggeredAbilityImpl { private final boolean setTargetPointer; + public SacrificeSourceTriggeredAbility(Effect effect) { + this(effect, false); + } + public SacrificeSourceTriggeredAbility(Effect effect, boolean optional) { this(effect, optional, false); }