From 79cde5446bdfbdd6e9e0366e42d97bd85719aaca Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 11 Nov 2022 08:41:56 -0500 Subject: [PATCH] [BRO] Implement Dredging Claw --- Mage.Sets/src/mage/cards/d/DredgingClaw.java | 87 ++++++++++++++++++++ Mage.Sets/src/mage/sets/TheBrothersWar.java | 1 + 2 files changed, 88 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/d/DredgingClaw.java diff --git a/Mage.Sets/src/mage/cards/d/DredgingClaw.java b/Mage.Sets/src/mage/cards/d/DredgingClaw.java new file mode 100644 index 0000000000..10daded1f1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DredgingClaw.java @@ -0,0 +1,87 @@ +package mage.cards.d; + +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEquippedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.MenaceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; +import mage.game.events.GameEvent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class DredgingClaw extends CardImpl { + + public DredgingClaw(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); + + this.subtype.add(SubType.EQUIPMENT); + + // Equipped creature gets +1/+0 and has menace. + Ability ability = new SimpleStaticAbility(new BoostEquippedEffect(1, 0)); + ability.addEffect(new GainAbilityAttachedEffect( + new MenaceAbility(false), AttachmentType.EQUIPMENT + ).setText("and has menace. (It can't be blocked except by two or more creatures.)")); + this.addAbility(ability); + + // Whenever a creature enters the battlefield from your graveyard, you may attach Dredging Claw to it. + this.addAbility(new DredgingClawTriggeredAbility()); + + // Equip {1}{B} + this.addAbility(new EquipAbility(Outcome.BoostCreature, new ManaCostsImpl<>("{1}{B}"))); + } + + private DredgingClaw(final DredgingClaw card) { + super(card); + } + + @Override + public DredgingClaw copy() { + return new DredgingClaw(this); + } +} + +class DredgingClawTriggeredAbility extends TriggeredAbilityImpl { + + DredgingClawTriggeredAbility() { + super(Zone.BATTLEFIELD, new AttachEffect(Outcome.BoostCreature), true); + } + + private DredgingClawTriggeredAbility(final DredgingClawTriggeredAbility ability) { + super(ability); + } + + @Override + public DredgingClawTriggeredAbility copy() { + return new DredgingClawTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + EntersTheBattlefieldEvent etbEvent = (EntersTheBattlefieldEvent) event; + return etbEvent.getTarget().isCreature(game) + && etbEvent.getFromZone() == Zone.GRAVEYARD + && isControlledBy(etbEvent.getTarget().getOwnerId()); + } + + @Override + public String getRule() { + return "Whenever a creature enters the battlefield from your graveyard, you may attach {this} to it."; + } +} diff --git a/Mage.Sets/src/mage/sets/TheBrothersWar.java b/Mage.Sets/src/mage/sets/TheBrothersWar.java index 6dc93ff08f..89e598a73b 100644 --- a/Mage.Sets/src/mage/sets/TheBrothersWar.java +++ b/Mage.Sets/src/mage/sets/TheBrothersWar.java @@ -94,6 +94,7 @@ public final class TheBrothersWar extends ExpansionSet { cards.add(new SetCardInfo("Draconic Destiny", 130, Rarity.MYTHIC, mage.cards.d.DraconicDestiny.class)); cards.add(new SetCardInfo("Drafna, Founder of Lat-Nam", 47, Rarity.RARE, mage.cards.d.DrafnaFounderOfLatNam.class)); cards.add(new SetCardInfo("Dreams of Steel and Oil", 92, Rarity.UNCOMMON, mage.cards.d.DreamsOfSteelAndOil.class)); + cards.add(new SetCardInfo("Dredging Claw", 119, Rarity.COMMON, mage.cards.d.DredgingClaw.class)); cards.add(new SetCardInfo("Dwarven Forge-Chanter", 131, Rarity.COMMON, mage.cards.d.DwarvenForgeChanter.class)); cards.add(new SetCardInfo("Emergency Weld", 93, Rarity.COMMON, mage.cards.e.EmergencyWeld.class)); cards.add(new SetCardInfo("Energy Refractor", 234, Rarity.COMMON, mage.cards.e.EnergyRefractor.class));