From fc1f2f2685099157c11108ff931e00a681099269 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Thu, 6 Apr 2023 19:45:46 -0400 Subject: [PATCH] [MOM] Implement Cosmic Hunger --- Mage.Sets/src/mage/cards/c/CosmicHunger.java | 49 +++++++++++++++++++ .../src/mage/sets/MarchOfTheMachine.java | 1 + 2 files changed, 50 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CosmicHunger.java diff --git a/Mage.Sets/src/mage/cards/c/CosmicHunger.java b/Mage.Sets/src/mage/cards/c/CosmicHunger.java new file mode 100644 index 0000000000..a64ede39e3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CosmicHunger.java @@ -0,0 +1,49 @@ +package mage.cards.c; + +import mage.abilities.effects.common.DamageWithPowerFromOneToAnotherTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.other.AnotherTargetPredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class CosmicHunger extends CardImpl { + + private static final FilterPermanent filter + = new FilterPermanent("another target creature, planeswalker, or battle"); + + static { + filter.add(Predicates.or( + CardType.CREATURE.getPredicate(), + CardType.PLANESWALKER.getPredicate(), + CardType.BATTLE.getPredicate() + )); + filter.add(new AnotherTargetPredicate(2)); + } + + public CosmicHunger(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}"); + + // Target creature you control deals damage equal to its power to another target creature, planeswalker, or battle. + this.getSpellAbility().addEffect(new DamageWithPowerFromOneToAnotherTargetEffect()); + this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent().setTargetTag(1)); + this.getSpellAbility().addTarget(new TargetPermanent(filter).setTargetTag(2)); + } + + private CosmicHunger(final CosmicHunger card) { + super(card); + } + + @Override + public CosmicHunger copy() { + return new CosmicHunger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java index 4f3e15d983..ab06a87f4b 100644 --- a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java +++ b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java @@ -63,6 +63,7 @@ public final class MarchOfTheMachine extends ExpansionSet { cards.add(new SetCardInfo("Converter Beast", 180, Rarity.COMMON, mage.cards.c.ConverterBeast.class)); cards.add(new SetCardInfo("Copper Host Crusher", 181, Rarity.UNCOMMON, mage.cards.c.CopperHostCrusher.class)); cards.add(new SetCardInfo("Corrupted Conviction", 98, Rarity.COMMON, mage.cards.c.CorruptedConviction.class)); + cards.add(new SetCardInfo("Cosmic Hunger", 182, Rarity.COMMON, mage.cards.c.CosmicHunger.class)); cards.add(new SetCardInfo("Cragsmasher Yeti", 333, Rarity.COMMON, mage.cards.c.CragsmasherYeti.class)); cards.add(new SetCardInfo("Crystal Carapace", 183, Rarity.COMMON, mage.cards.c.CrystalCarapace.class)); cards.add(new SetCardInfo("Deadly Derision", 99, Rarity.COMMON, mage.cards.d.DeadlyDerision.class));