[BRO] Implement Dredging Claw

This commit is contained in:
Evan Kranzler 2022-11-11 08:41:56 -05:00
parent d06fabf9bd
commit 79cde5446b
2 changed files with 88 additions and 0 deletions

View file

@ -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. <i>(It can't be blocked except by two or more creatures.)</i>"));
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.";
}
}

View file

@ -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));