From 9cc278a126eaff95f6a5a69aac6aabf016b51867 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 29 Oct 2020 21:48:13 -0400 Subject: [PATCH] [CMR] Implemented Kediss, Emberclaw Familiar --- .../mage/cards/k/KedissEmberclawFamiliar.java | 99 +++++++++++++++++++ Mage.Sets/src/mage/sets/CommanderLegends.java | 1 + 2 files changed, 100 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/k/KedissEmberclawFamiliar.java diff --git a/Mage.Sets/src/mage/cards/k/KedissEmberclawFamiliar.java b/Mage.Sets/src/mage/cards/k/KedissEmberclawFamiliar.java new file mode 100644 index 0000000000..675bbc7350 --- /dev/null +++ b/Mage.Sets/src/mage/cards/k/KedissEmberclawFamiliar.java @@ -0,0 +1,99 @@ +package mage.cards.k; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsDamageToAPlayerAllTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.PartnerAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.permanent.CommanderPredicate; +import mage.game.Game; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class KedissEmberclawFamiliar extends CardImpl { + + private static final FilterPermanent filter = new FilterControlledPermanent("commander you control"); + + static { + filter.add(CommanderPredicate.instance); + } + + public KedissEmberclawFamiliar(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.ELEMENTAL); + this.subtype.add(SubType.LIZARD); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever a commander you control deals combat damage to an opponent, it deals that much damage to each other opponent. + this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility( + new KedissEmberclawFamiliarEffect(), filter, false, + SetTargetPointer.PLAYER, true, true + )); + + // Partner + this.addAbility(PartnerAbility.getInstance()); + } + + private KedissEmberclawFamiliar(final KedissEmberclawFamiliar card) { + super(card); + } + + @Override + public KedissEmberclawFamiliar copy() { + return new KedissEmberclawFamiliar(this); + } +} + +class KedissEmberclawFamiliarEffect extends OneShotEffect { + + KedissEmberclawFamiliarEffect() { + super(Outcome.Benefit); + staticText = "it deals that much damage to each other opponent"; + } + + private KedissEmberclawFamiliarEffect(final KedissEmberclawFamiliarEffect effect) { + super(effect); + } + + @Override + public KedissEmberclawFamiliarEffect copy() { + return new KedissEmberclawFamiliarEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Object obj = getValue("sourceId"); + if (!(obj instanceof UUID)) { + return false; + } + UUID sourceId = (UUID) obj; + obj = getValue("damage"); + if (!(obj instanceof Integer)) { + return false; + } + int damage = (Integer) obj; + for (UUID playerId : game.getOpponents(source.getControllerId())) { + if (playerId.equals(getTargetPointer().getFirst(game, source))) { + continue; + } + Player player = game.getPlayer(playerId); + if (player == null) { + continue; + } + player.damage(damage, sourceId, game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegends.java b/Mage.Sets/src/mage/sets/CommanderLegends.java index 8852241253..dc66240eb7 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegends.java +++ b/Mage.Sets/src/mage/sets/CommanderLegends.java @@ -64,6 +64,7 @@ public final class CommanderLegends extends ExpansionSet { cards.add(new SetCardInfo("Interpret the Signs", 75, Rarity.UNCOMMON, mage.cards.i.InterpretTheSigns.class)); cards.add(new SetCardInfo("Jeweled Lotus", 319, Rarity.MYTHIC, mage.cards.j.JeweledLotus.class)); cards.add(new SetCardInfo("Kamahl, Heart of Krosa", 237, Rarity.MYTHIC, mage.cards.k.KamahlHeartOfKrosa.class)); + cards.add(new SetCardInfo("Kediss, Emberclaw Familiar", 188, Rarity.UNCOMMON, mage.cards.k.KedissEmberclawFamiliar.class)); cards.add(new SetCardInfo("Keeper of the Accord", 27, Rarity.RARE, mage.cards.k.KeeperOfTheAccord.class)); cards.add(new SetCardInfo("Kitesail Corsair", 76, Rarity.COMMON, mage.cards.k.KitesailCorsair.class)); cards.add(new SetCardInfo("Kitesail Skirmisher", 77, Rarity.COMMON, mage.cards.k.KitesailSkirmisher.class));