From a668b992640a60bf17c5f7493144d98496f72594 Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Thu, 14 Jan 2021 15:32:03 -0600 Subject: [PATCH] [KHM] Implemented Deathknell Berserker (#7390) * [KHM] Implemented Deathknell Berserker * [KHM] Deathknell Berserker - Fixup Condition --- .../src/mage/cards/d/DeathknellBerserker.java | 59 +++++++++++++++++++ Mage.Sets/src/mage/sets/Kaldheim.java | 1 + 2 files changed, 60 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/d/DeathknellBerserker.java diff --git a/Mage.Sets/src/mage/cards/d/DeathknellBerserker.java b/Mage.Sets/src/mage/cards/d/DeathknellBerserker.java new file mode 100644 index 0000000000..5c40296135 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DeathknellBerserker.java @@ -0,0 +1,59 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesSourceTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.ZombieBerserkerToken; + +/** + * + * @author weirddan455 + */ +public final class DeathknellBerserker extends CardImpl { + + public DeathknellBerserker(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}"); + + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.BERSERKER); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Deathknell Berserker dies, if its power was 3 or greater, create a 2/2 black Zombie Berserker creature token. + this.addAbility(new ConditionalInterveningIfTriggeredAbility( + new DiesSourceTriggeredAbility(new CreateTokenEffect(new ZombieBerserkerToken())), + DeathknellBerserkerCondtion.instance, + "When {this} dies, if its power was 3 or greater, create a 2/2 black Zombie Berserker creature token." + )); + } + + private DeathknellBerserker(final DeathknellBerserker card) { + super(card); + } + + @Override + public DeathknellBerserker copy() { + return new DeathknellBerserker(this); + } +} + +enum DeathknellBerserkerCondtion implements Condition { + + instance; + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = (Permanent) source.getEffects().get(0).getValue("permanentLeftBattlefield"); + return permanent != null && permanent.getPower().getValue() >= 3; + } +} diff --git a/Mage.Sets/src/mage/sets/Kaldheim.java b/Mage.Sets/src/mage/sets/Kaldheim.java index ccbe9f6988..cc2956c1da 100644 --- a/Mage.Sets/src/mage/sets/Kaldheim.java +++ b/Mage.Sets/src/mage/sets/Kaldheim.java @@ -81,6 +81,7 @@ public final class Kaldheim extends ExpansionSet { cards.add(new SetCardInfo("Clarion Spirit", 6, Rarity.UNCOMMON, mage.cards.c.ClarionSpirit.class)); cards.add(new SetCardInfo("Cleaving Reaper", 376, Rarity.RARE, mage.cards.c.CleavingReaper.class)); cards.add(new SetCardInfo("Darkbore Pathway", 254, Rarity.RARE, mage.cards.d.DarkborePathway.class)); + cards.add(new SetCardInfo("Deathknell Berserker", 83, Rarity.COMMON, mage.cards.d.DeathknellBerserker.class)); cards.add(new SetCardInfo("Divine Gambit", 8, Rarity.UNCOMMON, mage.cards.d.DivineGambit.class)); cards.add(new SetCardInfo("Dogged Pursuit", 85, Rarity.COMMON, mage.cards.d.DoggedPursuit.class)); cards.add(new SetCardInfo("Doomskar Oracle", 10, Rarity.COMMON, mage.cards.d.DoomskarOracle.class));