From 66c41358c3b0f7afd133eef4782a77f48398acdf Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 17 Sep 2018 20:30:31 -0400 Subject: [PATCH] Implemented Swathcutter Giant --- .../src/mage/cards/s/SwathcutterGiant.java | 75 +++++++++++++++++++ Mage.Sets/src/mage/sets/GuildsOfRavnica.java | 1 + 2 files changed, 76 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SwathcutterGiant.java diff --git a/Mage.Sets/src/mage/cards/s/SwathcutterGiant.java b/Mage.Sets/src/mage/cards/s/SwathcutterGiant.java new file mode 100644 index 0000000000..3113d45bd0 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SwathcutterGiant.java @@ -0,0 +1,75 @@ +package mage.cards.s; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageAllEffect; +import mage.constants.SubType; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.game.Game; + +/** + * + * @author TheElk801 + */ +public final class SwathcutterGiant extends CardImpl { + + public SwathcutterGiant(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}{W}"); + + this.subtype.add(SubType.GIANT); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // Whenever Swathcutter Giant attacks, it deals 1 damage to each creature defending player controls. + this.addAbility(new AttacksTriggeredAbility(new SwathcutterGiantEffect(), false)); + } + + public SwathcutterGiant(final SwathcutterGiant card) { + super(card); + } + + @Override + public SwathcutterGiant copy() { + return new SwathcutterGiant(this); + } +} + +class SwathcutterGiantEffect extends OneShotEffect { + + public SwathcutterGiantEffect() { + super(Outcome.Benefit); + this.staticText = "it deals 1 damage to each creature " + + "defending player controls."; + } + + public SwathcutterGiantEffect(final SwathcutterGiantEffect effect) { + super(effect); + } + + @Override + public SwathcutterGiantEffect copy() { + return new SwathcutterGiantEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + FilterCreaturePermanent filter = new FilterCreaturePermanent(); + filter.add(new ControllerIdPredicate( + game.getCombat().getDefenderId(source.getSourceId()) + )); + return new DamageAllEffect(1, filter).apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/sets/GuildsOfRavnica.java b/Mage.Sets/src/mage/sets/GuildsOfRavnica.java index c82d1f9cbc..77bfa6b75c 100644 --- a/Mage.Sets/src/mage/sets/GuildsOfRavnica.java +++ b/Mage.Sets/src/mage/sets/GuildsOfRavnica.java @@ -168,6 +168,7 @@ public final class GuildsOfRavnica extends ExpansionSet { cards.add(new SetCardInfo("Sunhome Stalwart", 26, Rarity.UNCOMMON, mage.cards.s.SunhomeStalwart.class)); cards.add(new SetCardInfo("Swamp", 262, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Swarm Guildmage", 201, Rarity.UNCOMMON, mage.cards.s.SwarmGuildmage.class)); + cards.add(new SetCardInfo("Swathcutter Giant", 202, Rarity.UNCOMMON, mage.cards.s.SwathcutterGiant.class)); cards.add(new SetCardInfo("Swiftblade Vindicator", 203, Rarity.RARE, mage.cards.s.SwiftbladeVindicator.class)); cards.add(new SetCardInfo("Temple Garden", 258, Rarity.RARE, mage.cards.t.TempleGarden.class)); cards.add(new SetCardInfo("Thought Erasure", 206, Rarity.UNCOMMON, mage.cards.t.ThoughtErasure.class));