From bad1f90e46857b389795a1a864b8cf351ddf729c Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 5 Sep 2019 18:27:19 -0400 Subject: [PATCH] fixed Bloodthirsty Blade not attaching to creatures (fixes #5957) --- .../src/mage/cards/b/BloodthirstyBlade.java | 36 +++---------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/Mage.Sets/src/mage/cards/b/BloodthirstyBlade.java b/Mage.Sets/src/mage/cards/b/BloodthirstyBlade.java index a1a1da7ac0..9e1502a5fe 100644 --- a/Mage.Sets/src/mage/cards/b/BloodthirstyBlade.java +++ b/Mage.Sets/src/mage/cards/b/BloodthirstyBlade.java @@ -4,8 +4,8 @@ import mage.abilities.Ability; import mage.abilities.common.ActivateAsSorceryActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.RestrictionEffect; +import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.combat.AttacksIfAbleAttachedEffect; import mage.abilities.effects.common.continuous.BoostEquippedEffect; import mage.cards.CardImpl; @@ -17,8 +17,6 @@ import mage.target.common.TargetOpponentsCreaturePermanent; import java.util.UUID; -import static mage.constants.Outcome.Benefit; - /** * @author TheElk801 */ @@ -39,7 +37,10 @@ public final class BloodthirstyBlade extends CardImpl { // {1}: Attach Bloodthirsty Blade to target creature an opponent controls. Active this ability only any time you could cast a sorcery. ability = new ActivateAsSorceryActivatedAbility( - Zone.BATTLEFIELD, new BloodthirstyBladeEffect(), new GenericManaCost(1) + Zone.BATTLEFIELD, + new AttachEffect( + Outcome.Benefit, "Attach {this} to target creature an opponent controls" + ), new GenericManaCost(1) ); ability.addTarget(new TargetOpponentsCreaturePermanent()); this.addAbility(ability); @@ -86,30 +87,3 @@ class BloodthirstyBladeAttackEffect extends RestrictionEffect { return !defenderId.equals(source.getControllerId()); } } - -class BloodthirstyBladeEffect extends OneShotEffect { - - BloodthirstyBladeEffect() { - super(Benefit); - staticText = "attach {this} to target creature an opponent controls"; - } - - private BloodthirstyBladeEffect(final BloodthirstyBladeEffect effect) { - super(effect); - } - - @Override - public BloodthirstyBladeEffect copy() { - return new BloodthirstyBladeEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent == null) { - return false; - } - permanent.attachTo(source.getFirstTarget(), game); - return true; - } -}