From a00b4cdc9e527de670dab5772a339ea1c57e414b Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 6 Jan 2020 21:24:12 -0500 Subject: [PATCH] Implemented Renata, Called to the Hunt --- .../mage/cards/g/GrumgullyTheGenerous.java | 4 +- .../mage/cards/r/RenataCalledToTheHunt.java | 92 +++++++++++++++++++ .../src/mage/sets/TherosBeyondDeath.java | 1 + 3 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/r/RenataCalledToTheHunt.java diff --git a/Mage.Sets/src/mage/cards/g/GrumgullyTheGenerous.java b/Mage.Sets/src/mage/cards/g/GrumgullyTheGenerous.java index cd77305d73..5815b684c5 100644 --- a/Mage.Sets/src/mage/cards/g/GrumgullyTheGenerous.java +++ b/Mage.Sets/src/mage/cards/g/GrumgullyTheGenerous.java @@ -29,7 +29,7 @@ public final class GrumgullyTheGenerous extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(3); - // Each other non-Human creature you controls enters the battlefield with an additional +1/+1 counter on it. + // Each other non-Human creature you control enters the battlefield with an additional +1/+1 counter on it. this.addAbility(new SimpleStaticAbility(new GrumgullyTheGenerousReplacementEffect())); } @@ -47,7 +47,7 @@ class GrumgullyTheGenerousReplacementEffect extends ReplacementEffectImpl { GrumgullyTheGenerousReplacementEffect() { super(Duration.WhileOnBattlefield, Outcome.BoostCreature); - staticText = "Each other non-Human creature you controls " + + staticText = "Each other non-Human creature you control " + "enters the battlefield with an additional +1/+1 counter on it."; } diff --git a/Mage.Sets/src/mage/cards/r/RenataCalledToTheHunt.java b/Mage.Sets/src/mage/cards/r/RenataCalledToTheHunt.java new file mode 100644 index 0000000000..b5e9dcb699 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RenataCalledToTheHunt.java @@ -0,0 +1,92 @@ +package mage.cards.r; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.DevotionCount; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class RenataCalledToTheHunt extends CardImpl { + + public RenataCalledToTheHunt(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{2}{G}{G}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.DEMIGOD); + this.power = new MageInt(0); + this.toughness = new MageInt(3); + + // Renata's power is equal to your devotion to green. + this.addAbility(new SimpleStaticAbility( + Zone.ALL, + new SetPowerSourceEffect(DevotionCount.G, Duration.EndOfGame) + .setText("{this}'s power is equal to your devotion to green") + ).addHint(DevotionCount.G.getHint())); + + // Each other creature you control enters the battlefield with an additional +1/+1 counter on it. + this.addAbility(new SimpleStaticAbility(new RenataCalledToTheHuntReplacementEffect())); + } + + private RenataCalledToTheHunt(final RenataCalledToTheHunt card) { + super(card); + } + + @Override + public RenataCalledToTheHunt copy() { + return new RenataCalledToTheHunt(this); + } +} + +class RenataCalledToTheHuntReplacementEffect extends ReplacementEffectImpl { + + RenataCalledToTheHuntReplacementEffect() { + super(Duration.WhileOnBattlefield, Outcome.BoostCreature); + staticText = "Each other creature you control enters the battlefield with an additional +1/+1 counter on it."; + } + + private RenataCalledToTheHuntReplacementEffect(final RenataCalledToTheHuntReplacementEffect effect) { + super(effect); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); + return creature != null + && creature.isCreature() + && !source.getSourceId().equals(creature.getId()) + && creature.isControlledBy(source.getControllerId()); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); + if (creature != null) { + creature.addCounters(CounterType.P1P1.createInstance(), source, game, event.getAppliedEffects()); + } + return false; + } + + @Override + public RenataCalledToTheHuntReplacementEffect copy() { + return new RenataCalledToTheHuntReplacementEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java index 24914820a8..aa8d08af0a 100644 --- a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java +++ b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java @@ -104,6 +104,7 @@ public final class TherosBeyondDeath extends ExpansionSet { cards.add(new SetCardInfo("Polukranos, Unchained", 224, Rarity.MYTHIC, mage.cards.p.PolukranosUnchained.class)); cards.add(new SetCardInfo("Purphoros's Intervention", 151, Rarity.RARE, mage.cards.p.PurphorossIntervention.class)); cards.add(new SetCardInfo("Purphoros, Bronze-Blooded", 150, Rarity.MYTHIC, mage.cards.p.PurphorosBronzeBlooded.class)); + cards.add(new SetCardInfo("Renata, Called to the Hunt", 196, Rarity.UNCOMMON, mage.cards.r.RenataCalledToTheHunt.class)); cards.add(new SetCardInfo("Reverent Hoplite", 33, Rarity.UNCOMMON, mage.cards.r.ReverentHoplite.class)); cards.add(new SetCardInfo("Revoke Existence", 34, Rarity.COMMON, mage.cards.r.RevokeExistence.class)); cards.add(new SetCardInfo("Rise to Glory", 225, Rarity.UNCOMMON, mage.cards.r.RiseToGlory.class));