From ecbab0da9b10722edb06d579eb234da30c95e4df Mon Sep 17 00:00:00 2001 From: 4825764518 <100122841+4825764518@users.noreply.github.com> Date: Mon, 17 Feb 2025 21:20:04 -0500 Subject: [PATCH] [PIP] Implement Strong, the Brutish Thespian (#13359) --- .../cards/s/StrongTheBrutishThespian.java | 78 +++++++++++++++++++ Mage.Sets/src/mage/sets/Fallout.java | 8 +- .../game/command/emblems/RadiationEmblem.java | 10 ++- .../main/java/mage/game/events/GameEvent.java | 3 + 4 files changed, 93 insertions(+), 6 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/s/StrongTheBrutishThespian.java diff --git a/Mage.Sets/src/mage/cards/s/StrongTheBrutishThespian.java b/Mage.Sets/src/mage/cards/s/StrongTheBrutishThespian.java new file mode 100644 index 00000000000..d7c9f8849ad --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/StrongTheBrutishThespian.java @@ -0,0 +1,78 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealtDamageToSourceTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.abilities.effects.common.counter.AddCountersPlayersEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.WardAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; + +import java.util.UUID; + +public class StrongTheBrutishThespian extends CardImpl { + public StrongTheBrutishThespian(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); + this.addSuperType(SuperType.LEGENDARY); + this.addSubType(SubType.MUTANT); + this.addSubType(SubType.BERSERKER); + + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // Ward {2} + this.addAbility(new WardAbility(new ManaCostsImpl<>("{2}"))); + + // Enrage - Whenever strong is dealt damage, you get three rad counters and put three +1/+1 counters on Strong. + Ability enrageAbility = new DealtDamageToSourceTriggeredAbility(new AddCountersPlayersEffect(CounterType.RAD.createInstance(3), TargetController.YOU), false, true); + enrageAbility.addEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)).setText("put three +1/+1 counters on Strong")); + this.addAbility(enrageAbility); + + // You gain life rather than lose life from radiation. + Ability healAbility = new SimpleStaticAbility(new StrongTheBrutishThespianHealEffect().setText("You gain life rather than lose life from radiation.")); + this.addAbility(healAbility); + } + + public StrongTheBrutishThespian(StrongTheBrutishThespian card) { + super(card); + } + + @Override + public StrongTheBrutishThespian copy() { + return new StrongTheBrutishThespian(this); + } + + class StrongTheBrutishThespianHealEffect extends ContinuousRuleModifyingEffectImpl { + + protected StrongTheBrutishThespianHealEffect() { + super(Duration.Custom, Outcome.Benefit); + } + + public StrongTheBrutishThespianHealEffect(StrongTheBrutishThespianHealEffect effect) { + super(effect); + } + + @Override + public StrongTheBrutishThespianHealEffect copy() { + return new StrongTheBrutishThespianHealEffect(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.RADIATION_GAIN_LIFE; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return event.getPlayerId().equals(source.getControllerId()); + } + } +} diff --git a/Mage.Sets/src/mage/sets/Fallout.java b/Mage.Sets/src/mage/sets/Fallout.java index 8a977e570c8..cb256341aae 100644 --- a/Mage.Sets/src/mage/sets/Fallout.java +++ b/Mage.Sets/src/mage/sets/Fallout.java @@ -835,10 +835,10 @@ public final class Fallout extends ExpansionSet { //cards.add(new SetCardInfo("Strong Back", 611, Rarity.RARE, mage.cards.s.StrongBack.class, NON_FULL_USE_VARIOUS)); //cards.add(new SetCardInfo("Strong Back", 83, Rarity.RARE, mage.cards.s.StrongBack.class, NON_FULL_USE_VARIOUS)); //cards.add(new SetCardInfo("Strong Back", 930, Rarity.RARE, mage.cards.s.StrongBack.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("Strong, the Brutish Thespian", 403, Rarity.RARE, mage.cards.s.StrongTheBrutishThespian.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("Strong, the Brutish Thespian", 612, Rarity.RARE, mage.cards.s.StrongTheBrutishThespian.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("Strong, the Brutish Thespian", 84, Rarity.RARE, mage.cards.s.StrongTheBrutishThespian.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("Strong, the Brutish Thespian", 931, Rarity.RARE, mage.cards.s.StrongTheBrutishThespian.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Strong, the Brutish Thespian", 403, Rarity.RARE, mage.cards.s.StrongTheBrutishThespian.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Strong, the Brutish Thespian", 612, Rarity.RARE, mage.cards.s.StrongTheBrutishThespian.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Strong, the Brutish Thespian", 84, Rarity.RARE, mage.cards.s.StrongTheBrutishThespian.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Strong, the Brutish Thespian", 931, Rarity.RARE, mage.cards.s.StrongTheBrutishThespian.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Struggle for Project Purity", 380, Rarity.RARE, mage.cards.s.StruggleForProjectPurity.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Struggle for Project Purity", 39, Rarity.RARE, mage.cards.s.StruggleForProjectPurity.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Struggle for Project Purity", 567, Rarity.RARE, mage.cards.s.StruggleForProjectPurity.class, NON_FULL_USE_VARIOUS)); diff --git a/Mage/src/main/java/mage/game/command/emblems/RadiationEmblem.java b/Mage/src/main/java/mage/game/command/emblems/RadiationEmblem.java index 2593c8a2d74..9c2fcd54a1a 100644 --- a/Mage/src/main/java/mage/game/command/emblems/RadiationEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/RadiationEmblem.java @@ -16,6 +16,7 @@ import mage.counters.CounterType; import mage.filter.StaticFilters; import mage.game.Game; import mage.game.command.Emblem; +import mage.game.events.GameEvent; import mage.players.Player; /** @@ -106,8 +107,13 @@ class RadiationEffect extends OneShotEffect { Cards milled = player.millCards(amount, source, game); int countNonLand = milled.count(StaticFilters.FILTER_CARD_NON_LAND, player.getId(), source, game); if (countNonLand > 0) { - // TODO: support gaining life instead with [[Strong, the Brutish Thespian]] - player.loseLife(countNonLand, game, source, false); + GameEvent event = new GameEvent(GameEvent.EventType.RADIATION_GAIN_LIFE, null, source, player.getId(), amount, false); + if (game.replaceEvent(event)) { + player.gainLife(countNonLand, game, source); + } else { + player.loseLife(countNonLand, game, source, false); + } + player.loseCounters(CounterType.RAD.getName(), countNonLand, source, game); } return true; diff --git a/Mage/src/main/java/mage/game/events/GameEvent.java b/Mage/src/main/java/mage/game/events/GameEvent.java index 73d985e9493..77f1fd0ea22 100644 --- a/Mage/src/main/java/mage/game/events/GameEvent.java +++ b/Mage/src/main/java/mage/game/events/GameEvent.java @@ -672,6 +672,9 @@ public class GameEvent implements Serializable { playerId player who gave the gift */ GAVE_GIFT, + /* rad counter life loss/gain effect + */ + RADIATION_GAIN_LIFE, // custom events - must store some unique data to track CUSTOM_EVENT;