From 0a25dbe6e8dda47964ecb343bdafca0db125c3e1 Mon Sep 17 00:00:00 2001 From: Cameron Merkel <44722506+Cguy7777@users.noreply.github.com> Date: Sat, 30 Nov 2024 11:46:32 -0600 Subject: [PATCH] [DSK] Implement The Rollercrusher Ride (#13084) * [DSK] Implement The Rollercrusher Ride * Use overflowMultiply() --- .../mage/cards/t/TheRollercrusherRide.java | 93 +++++++++++++++++++ .../src/mage/sets/DuskmournHouseOfHorror.java | 3 + 2 files changed, 96 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/TheRollercrusherRide.java diff --git a/Mage.Sets/src/mage/cards/t/TheRollercrusherRide.java b/Mage.Sets/src/mage/cards/t/TheRollercrusherRide.java new file mode 100644 index 00000000000..1dbe303bd32 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TheRollercrusherRide.java @@ -0,0 +1,93 @@ +package mage.cards.t; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.DeliriumCondition; +import mage.abilities.dynamicvalue.common.GetXValue; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.hint.common.CardTypesInGraveyardHint; +import mage.constants.*; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.game.Game; +import mage.game.events.DamageEvent; +import mage.game.events.GameEvent; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetadjustment.TargetsCountAdjuster; +import mage.util.CardUtil; + +/** + * @author Cguy7777 + */ +public final class TheRollercrusherRide extends CardImpl { + + public TheRollercrusherRide(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{X}{2}{R}"); + + this.supertype.add(SuperType.LEGENDARY); + + // Delirium -- If a source you control would deal noncombat damage to a permanent or player while there are four or more card types among cards in your graveyard, + // it deals double that damage instead. + this.addAbility(new SimpleStaticAbility(new TheRollercrusherRideEffect()) + .setAbilityWord(AbilityWord.DELIRIUM) + .addHint(CardTypesInGraveyardHint.YOU)); + + // When The Rollercrusher Ride enters, it deals X damage to each of up to X target creatures. + Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(GetXValue.instance) + .setText("it deals X damage to each of up to X target creatures")); + ability.addTarget(new TargetCreaturePermanent(0, 0)); + ability.setTargetAdjuster(new TargetsCountAdjuster(GetXValue.instance)); + this.addAbility(ability); + } + + private TheRollercrusherRide(final TheRollercrusherRide card) { + super(card); + } + + @Override + public TheRollercrusherRide copy() { + return new TheRollercrusherRide(this); + } +} + +class TheRollercrusherRideEffect extends ReplacementEffectImpl { + + TheRollercrusherRideEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "if a source you control would deal noncombat damage to a permanent or player " + + "while there are four or more card types among cards in your graveyard, " + + "it deals double that damage instead"; + } + + private TheRollercrusherRideEffect(final TheRollercrusherRideEffect effect) { + super(effect); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT + || event.getType() == GameEvent.EventType.DAMAGE_PLAYER; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return source.isControlledBy(game.getControllerId(event.getSourceId())) + && !((DamageEvent) event).isCombatDamage() + && DeliriumCondition.instance.apply(game, source); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + event.setAmount(CardUtil.overflowMultiply(event.getAmount(), 2)); + return false; + } + + @Override + public TheRollercrusherRideEffect copy() { + return new TheRollercrusherRideEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java b/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java index 8bd7ec7ddfb..54a0d029ed0 100644 --- a/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java +++ b/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java @@ -216,6 +216,9 @@ public final class DuskmournHouseOfHorror extends ExpansionSet { cards.add(new SetCardInfo("Terramorphic Expanse", 269, Rarity.COMMON, mage.cards.t.TerramorphicExpanse.class)); cards.add(new SetCardInfo("The Jolly Balloon Man", 219, Rarity.RARE, mage.cards.t.TheJollyBalloonMan.class)); cards.add(new SetCardInfo("The Mindskinner", 66, Rarity.RARE, mage.cards.t.TheMindskinner.class)); + cards.add(new SetCardInfo("The Rollercrusher Ride", 155, Rarity.MYTHIC, mage.cards.t.TheRollercrusherRide.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("The Rollercrusher Ride", 298, Rarity.MYTHIC, mage.cards.t.TheRollercrusherRide.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("The Rollercrusher Ride", 317, Rarity.MYTHIC, mage.cards.t.TheRollercrusherRide.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("The Swarmweaver", 236, Rarity.RARE, mage.cards.t.TheSwarmweaver.class)); cards.add(new SetCardInfo("The Wandering Rescuer", 41, Rarity.MYTHIC, mage.cards.t.TheWanderingRescuer.class)); cards.add(new SetCardInfo("Thornspire Verge", 270, Rarity.RARE, mage.cards.t.ThornspireVerge.class));