From 23332a595447a8fbd21a4d246a873a09400c00d6 Mon Sep 17 00:00:00 2001 From: spjspj Date: Sat, 5 Nov 2016 23:14:06 +1100 Subject: [PATCH] spjspj - Ikra Shidiqi, the Usurper (C16) --- .../mage/cards/i/IkraShidiqiTheUsurper.java | 119 ++++++++++++++++++ Mage.Sets/src/mage/sets/Commander2016.java | 3 +- 2 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/i/IkraShidiqiTheUsurper.java diff --git a/Mage.Sets/src/mage/cards/i/IkraShidiqiTheUsurper.java b/Mage.Sets/src/mage/cards/i/IkraShidiqiTheUsurper.java new file mode 100644 index 0000000000..13fed98b4b --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/IkraShidiqiTheUsurper.java @@ -0,0 +1,119 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.i; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.keyword.MenaceAbility; +import mage.abilities.keyword.PartnerAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.DamagedEvent; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; + +/** + * + * @author spjspj + */ +public class IkraShidiqiTheUsurper extends CardImpl { + + public IkraShidiqiTheUsurper(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{G}"); + + this.supertype.add("Legendary"); + this.subtype.add("Naga"); + this.subtype.add("Wizard"); + this.power = new MageInt(3); + this.toughness = new MageInt(7); + + // Menace + this.addAbility(new MenaceAbility()); + + // Whenever a creature you control deals combat damage to a player, you gain life equal to that creature's toughness. + this.addAbility(new IkraShidiqiTheUsurperTriggeredAbility()); + + // Partner + this.addAbility(PartnerAbility.getInstance()); + } + + public IkraShidiqiTheUsurper(final IkraShidiqiTheUsurper card) { + super(card); + } + + @Override + public IkraShidiqiTheUsurper copy() { + return new IkraShidiqiTheUsurper(this); + } +} + +class IkraShidiqiTheUsurperTriggeredAbility extends TriggeredAbilityImpl { + + public IkraShidiqiTheUsurperTriggeredAbility() { + super(Zone.BATTLEFIELD, null); + } + + public IkraShidiqiTheUsurperTriggeredAbility(final IkraShidiqiTheUsurperTriggeredAbility ability) { + super(ability); + } + + @Override + public IkraShidiqiTheUsurperTriggeredAbility copy() { + return new IkraShidiqiTheUsurperTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + DamagedEvent damageEvent = (DamagedEvent) event; + if (damageEvent.isCombatDamage()) { + Permanent permanent = game.getPermanent(event.getSourceId()); + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.getControllerId().equals(this.getControllerId())) { + this.getEffects().clear(); + this.getEffects().add(new GainLifeEffect(permanent.getToughness().getValue())); + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever a creature you control deals combat damage to a player, you gain life equal to that creature's toughness"; + } +} diff --git a/Mage.Sets/src/mage/sets/Commander2016.java b/Mage.Sets/src/mage/sets/Commander2016.java index 75375de9c7..cfdc72e3b8 100644 --- a/Mage.Sets/src/mage/sets/Commander2016.java +++ b/Mage.Sets/src/mage/sets/Commander2016.java @@ -73,7 +73,7 @@ public class Commander2016 extends ExpansionSet { cards.add(new SetCardInfo("Beacon of Unrest", 107, Rarity.RARE, mage.cards.b.BeaconOfUnrest.class)); cards.add(new SetCardInfo("Beast Within", 141, Rarity.UNCOMMON, mage.cards.b.BeastWithin.class)); cards.add(new SetCardInfo("Beastmaster Ascension", 142, Rarity.RARE, mage.cards.b.BeastmasterAscension.class)); - cards.add(new SetCardInfo("Benefactor's Draught", 21, Rarity.RARE, mage.cards.b.BenefactorsDraught.class)); + cards.add(new SetCardInfo("Benefactor's Draught", 21, Rarity.RARE, mage.cards.b.BenefactorsDraught.class)); cards.add(new SetCardInfo("Bituminous Blast", 182, Rarity.UNCOMMON, mage.cards.b.BituminousBlast.class)); cards.add(new SetCardInfo("Blasphemous Act", 120, Rarity.RARE, mage.cards.b.BlasphemousAct.class)); cards.add(new SetCardInfo("Blazing Archon", 58, Rarity.RARE, mage.cards.b.BlazingArchon.class)); @@ -196,6 +196,7 @@ public class Commander2016 extends ExpansionSet { cards.add(new SetCardInfo("Humble Defector", 129, Rarity.UNCOMMON, mage.cards.h.HumbleDefector.class)); cards.add(new SetCardInfo("Hushwing Gryff", 68, Rarity.RARE, mage.cards.h.HushwingGryff.class)); cards.add(new SetCardInfo("Ichor Wellspring", 258, Rarity.COMMON, mage.cards.i.IchorWellspring.class)); + cards.add(new SetCardInfo("Ikra Shidiqi, the Usurper", 32, Rarity.MYTHIC, mage.cards.i.IkraShidiqiTheUsurper.class)); cards.add(new SetCardInfo("In Garruk's Wake", 113, Rarity.RARE, mage.cards.i.InGarruksWake.class)); cards.add(new SetCardInfo("Inspiring Call", 153, Rarity.UNCOMMON, mage.cards.i.InspiringCall.class)); cards.add(new SetCardInfo("Iroas, God of Victory", 205, Rarity.MYTHIC, mage.cards.i.IroasGodOfVictory.class));