From 98f7613d200bc5f51d970455d82527c1c4b704b5 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sun, 7 Dec 2025 15:05:31 -0500 Subject: [PATCH] [DSK] Implement Mirror Room // Fractured Realm --- .../cards/m/MirrorRoomFracturedRealm.java | 89 +++++++++++++++++++ .../src/mage/sets/DuskmournHouseOfHorror.java | 2 + 2 files changed, 91 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/m/MirrorRoomFracturedRealm.java diff --git a/Mage.Sets/src/mage/cards/m/MirrorRoomFracturedRealm.java b/Mage.Sets/src/mage/cards/m/MirrorRoomFracturedRealm.java new file mode 100644 index 00000000000..16582a29c0a --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MirrorRoomFracturedRealm.java @@ -0,0 +1,89 @@ +package mage.cards.m; + +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.UnlockThisDoorTriggeredAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.CreateTokenCopyTargetEffect; +import mage.cards.CardSetInfo; +import mage.cards.RoomCard; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.util.CardUtil; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MirrorRoomFracturedRealm extends RoomCard { + + public MirrorRoomFracturedRealm(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, "{2}{U}", "{5}{U}{U}"); + + // Mirror Room + // When you unlock this door, create a token that's a copy of target creature you control, except it's a Reflection in addition to its other creature types. + Ability ability = new UnlockThisDoorTriggeredAbility( + new CreateTokenCopyTargetEffect() + .withAdditionalSubType(SubType.REFLECTION) + .setText("create a token that's a copy of target creature you control, " + + "except it's a Reflection in addition to its other creature types"), + false, true + ); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.getLeftHalfCard().addAbility(ability); + + // Fractured Realm + // If a triggered ability of a permanent you control triggers, that ability triggers an additional time. + this.getRightHalfCard().addAbility(new SimpleStaticAbility(new FracturedRealmEffect())); + } + + private MirrorRoomFracturedRealm(final MirrorRoomFracturedRealm card) { + super(card); + } + + @Override + public MirrorRoomFracturedRealm copy() { + return new MirrorRoomFracturedRealm(this); + } +} + +class FracturedRealmEffect extends ReplacementEffectImpl { + + FracturedRealmEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "if a triggered ability of a permanent you control triggers, " + + "that ability triggers an additional time"; + } + + private FracturedRealmEffect(final FracturedRealmEffect effect) { + super(effect); + } + + @Override + public FracturedRealmEffect copy() { + return new FracturedRealmEffect(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.NUMBER_OF_TRIGGERS; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); + return permanent != null && permanent.isControlledBy(source.getControllerId()); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + event.setAmount(CardUtil.overflowInc(event.getAmount(), 1)); + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java b/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java index 8fe0d8e9a53..f221b78c050 100644 --- a/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java +++ b/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java @@ -230,6 +230,8 @@ public final class DuskmournHouseOfHorror extends ExpansionSet { cards.add(new SetCardInfo("Meathook Massacre II", 311, Rarity.MYTHIC, mage.cards.m.MeathookMassacreII.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Miasma Demon", 109, Rarity.UNCOMMON, mage.cards.m.MiasmaDemon.class)); cards.add(new SetCardInfo("Midnight Mayhem", 222, Rarity.UNCOMMON, mage.cards.m.MidnightMayhem.class)); + cards.add(new SetCardInfo("Mirror Room // Fractured Realm", 67, Rarity.MYTHIC, mage.cards.m.MirrorRoomFracturedRealm.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Mirror Room // Fractured Realm", 337, Rarity.MYTHIC, mage.cards.m.MirrorRoomFracturedRealm.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Moldering Gym // Weight Room", 190, Rarity.COMMON, mage.cards.m.MolderingGymWeightRoom.class)); cards.add(new SetCardInfo("Monstrous Emergence", 191, Rarity.COMMON, mage.cards.m.MonstrousEmergence.class)); cards.add(new SetCardInfo("Most Valuable Slayer", 144, Rarity.COMMON, mage.cards.m.MostValuableSlayer.class));