From 63d10798a8d2a641d2c29b98407f16dc5142a0a9 Mon Sep 17 00:00:00 2001 From: Grath <1895280+Grath@users.noreply.github.com> Date: Sat, 28 Jan 2023 18:14:57 -0500 Subject: [PATCH] [ONE] Implement Solphim, Mayhem Dominus (#9916) --- .../mage/cards/s/SolphimMayhemDominus.java | 103 ++++++++++++++++++ .../src/mage/sets/PhyrexiaAllWillBeOne.java | 1 + 2 files changed, 104 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SolphimMayhemDominus.java diff --git a/Mage.Sets/src/mage/cards/s/SolphimMayhemDominus.java b/Mage.Sets/src/mage/cards/s/SolphimMayhemDominus.java new file mode 100644 index 00000000000..4651a43279a --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SolphimMayhemDominus.java @@ -0,0 +1,103 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.DiscardTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.counters.CounterType; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.game.events.DamageEvent; +import mage.game.events.GameEvent; +import mage.players.Player; +import mage.target.common.TargetCardInHand; +import mage.util.CardUtil; + +import java.util.UUID; + +/** + * @author Grath + */ +public final class SolphimMayhemDominus extends CardImpl { + + public SolphimMayhemDominus(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.PHYREXIAN); + this.subtype.add(SubType.HORROR); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // If a source you control would deal noncombat damage to an opponent or a permanent an opponent controls, it deals double that damage to that player or permanent instead. + this.addAbility(new SimpleStaticAbility(new SolphimMayhemDominusEffect())); + + // {1}{R/P}{R/P}, Discard two cards: Put an indestructible counter on Solphim, Mayhem Dominus. + Ability ability = new SimpleActivatedAbility(new AddCountersSourceEffect(CounterType.INDESTRUCTIBLE.createInstance()), new ManaCostsImpl<>("{1}{R/P}{R/P}")); + ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards")))); + this.addAbility(ability); + } + + private SolphimMayhemDominus(final SolphimMayhemDominus card) { + super(card); + } + + @Override + public SolphimMayhemDominus copy() { + return new SolphimMayhemDominus(this); + } +} + +class SolphimMayhemDominusEffect extends ReplacementEffectImpl { + + SolphimMayhemDominusEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "if a source you control would deal noncombat damage to a permanent or player, " + + "it deals double that damage that permanent or player instead"; + } + + SolphimMayhemDominusEffect(final SolphimMayhemDominusEffect 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) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + return source.isControlledBy(game.getControllerId(event.getSourceId())) + && !((DamageEvent) event).isCombatDamage() + && (player.hasOpponent(event.getTargetId(), game) + || player.hasOpponent(game.getControllerId(event.getTargetId()), game)); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + event.setAmount(CardUtil.overflowInc(event.getAmount(), event.getAmount())); + return false; + } + + @Override + public SolphimMayhemDominusEffect copy() { + return new SolphimMayhemDominusEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/PhyrexiaAllWillBeOne.java b/Mage.Sets/src/mage/sets/PhyrexiaAllWillBeOne.java index 7dbacb2cadf..218e35f9cf2 100644 --- a/Mage.Sets/src/mage/sets/PhyrexiaAllWillBeOne.java +++ b/Mage.Sets/src/mage/sets/PhyrexiaAllWillBeOne.java @@ -159,6 +159,7 @@ public final class PhyrexiaAllWillBeOne extends ExpansionSet { cards.add(new SetCardInfo("Skrelv's Hive", 34, Rarity.RARE, mage.cards.s.SkrelvsHive.class)); cards.add(new SetCardInfo("Skyscythe Engulfer", 183, Rarity.COMMON, mage.cards.s.SkyscytheEngulfer.class)); cards.add(new SetCardInfo("Slaughter Singer", 216, Rarity.UNCOMMON, mage.cards.s.SlaughterSinger.class)); + cards.add(new SetCardInfo("Solphim, Mayhem Dominus", 150, Rarity.MYTHIC, mage.cards.s.SolphimMayhemDominus.class)); cards.add(new SetCardInfo("Staff of Compleation", 242, Rarity.MYTHIC, mage.cards.s.StaffOfCompleation.class)); cards.add(new SetCardInfo("Surgical Skullbomb", 243, Rarity.COMMON, mage.cards.s.SurgicalSkullbomb.class)); cards.add(new SetCardInfo("Swamp", 274, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS));