implement [BLB] Carrot Cake

This commit is contained in:
Susucre 2024-06-29 17:03:33 +02:00
parent 65828866ec
commit b59f8e889d
10 changed files with 89 additions and 34 deletions

View file

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

View file

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

View file

@ -20,7 +20,6 @@ import mage.game.stack.Spell;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class FoulEmissary extends CardImpl {
@ -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, ");
}

View file

@ -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,15 +15,16 @@ 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 {
@ -47,7 +47,7 @@ public final class OrdealOfErebos extends CardImpl {
"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);

View file

@ -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,14 +15,15 @@ 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 {
@ -44,7 +44,7 @@ public final class OrdealOfHeliod extends CardImpl {
"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) {

View file

@ -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,16 +15,17 @@ 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 {
@ -49,7 +49,7 @@ public final class OrdealOfNylea extends CardImpl {
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);
}

View file

@ -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,15 +15,16 @@ 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 {
@ -47,7 +47,7 @@ public final class OrdealOfPurphoros extends CardImpl {
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);
}

View file

@ -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,14 +15,15 @@ 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 {
@ -45,7 +45,7 @@ public final class OrdealOfThassa extends CardImpl {
"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)));
}

View file

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

View file

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