From 862bcf97a6e21e308b318f5770560df92f7b86f6 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 26 Jun 2019 08:04:18 -0400 Subject: [PATCH] Implemented Savage Gorger --- Mage.Sets/src/mage/cards/s/SavageGorger.java | 68 ++++++++++++++++++++ Mage.Sets/src/mage/sets/CoreSet2020.java | 1 + 2 files changed, 69 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SavageGorger.java diff --git a/Mage.Sets/src/mage/cards/s/SavageGorger.java b/Mage.Sets/src/mage/cards/s/SavageGorger.java new file mode 100644 index 0000000000..8d0f7d316e --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SavageGorger.java @@ -0,0 +1,68 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.counters.CounterType; +import mage.game.Game; +import mage.watchers.common.PlayerLostLifeWatcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SavageGorger extends CardImpl { + + public SavageGorger(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + + this.subtype.add(SubType.VAMPIRE); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // At the beginning of your upkeep, if an opponent lost life this turn, put a +1/+1 counter on Savage Gorger. + this.addAbility(new ConditionalInterveningIfTriggeredAbility( + new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect( + CounterType.P1P1.createInstance()), TargetController.YOU, false + ), SavageGorgerCondition.instance, "At the beginning of your upkeep, " + + "if an opponent lost life this turn, put a +1/+1 counter on {this}" + )); + } + + private SavageGorger(final SavageGorger card) { + super(card); + } + + @Override + public SavageGorger copy() { + return new SavageGorger(this); + } +} + +enum SavageGorgerCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + PlayerLostLifeWatcher watcher = game.getState().getWatcher(PlayerLostLifeWatcher.class); + return watcher != null && watcher.getAllOppLifeLost(source.getControllerId(), game) > 0; + } + + @Override + public String toString() { + return ""; + } +} diff --git a/Mage.Sets/src/mage/sets/CoreSet2020.java b/Mage.Sets/src/mage/sets/CoreSet2020.java index 8720a873b2..0c33d53650 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2020.java +++ b/Mage.Sets/src/mage/sets/CoreSet2020.java @@ -257,6 +257,7 @@ public final class CoreSet2020 extends ExpansionSet { cards.add(new SetCardInfo("Rule of Law", 35, Rarity.UNCOMMON, mage.cards.r.RuleOfLaw.class)); cards.add(new SetCardInfo("Sage's Row Denizen", 73, Rarity.COMMON, mage.cards.s.SagesRowDenizen.class)); cards.add(new SetCardInfo("Sanitarium Skeleton", 112, Rarity.COMMON, mage.cards.s.SanitariumSkeleton.class)); + cards.add(new SetCardInfo("Savage Gorger", 291, Rarity.COMMON, mage.cards.s.SavageGorger.class)); cards.add(new SetCardInfo("Savannah Sage", 284, Rarity.COMMON, mage.cards.s.SavannahSage.class)); cards.add(new SetCardInfo("Scheming Symmetry", 113, Rarity.RARE, mage.cards.s.SchemingSymmetry.class)); cards.add(new SetCardInfo("Scholar of the Ages", 74, Rarity.UNCOMMON, mage.cards.s.ScholarOfTheAges.class));