From ee4312436d209f5a7b7dfa8e913ecd9bdc61f142 Mon Sep 17 00:00:00 2001 From: ssouders412 Date: Tue, 12 Nov 2019 19:04:12 -0500 Subject: [PATCH 1/4] Fixed Irresistible Prey's must be blocked ability Also unified the implementation of similar effects. --- Mage.Sets/src/mage/cards/e/ElementalUprising.java | 8 +++----- Mage.Sets/src/mage/cards/e/EmergentGrowth.java | 4 +--- Mage.Sets/src/mage/cards/i/IrresistiblePrey.java | 8 +------- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/Mage.Sets/src/mage/cards/e/ElementalUprising.java b/Mage.Sets/src/mage/cards/e/ElementalUprising.java index 319dcf1e2f0..622ce5a7b99 100644 --- a/Mage.Sets/src/mage/cards/e/ElementalUprising.java +++ b/Mage.Sets/src/mage/cards/e/ElementalUprising.java @@ -27,11 +27,9 @@ public final class ElementalUprising extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{G}"); // Target land you control becomes a 4/4 Elemental creature with haste until end of turn. It's still a land. It must be blocked this turn if able. - getSpellAbility().addEffect(new BecomesCreatureTargetEffect(new ElementalUprisingToken(), false, true, Duration.EndOfTurn)); - getSpellAbility().addTarget(new TargetPermanent(new FilterControlledLandPermanent())); - Effect effect = new MustBeBlockedByAtLeastOneTargetEffect(Duration.EndOfTurn); - effect.setText("It must be blocked this turn if able"); - getSpellAbility().addEffect(effect); + this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(new ElementalUprisingToken(), false, true, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetPermanent(new FilterControlledLandPermanent())); + this.getSpellAbility().addEffect(new MustBeBlockedByAtLeastOneTargetEffect(Duration.EndOfTurn)); } public ElementalUprising(final ElementalUprising card) { diff --git a/Mage.Sets/src/mage/cards/e/EmergentGrowth.java b/Mage.Sets/src/mage/cards/e/EmergentGrowth.java index 3aa667cbcb7..4c45f9e9a90 100644 --- a/Mage.Sets/src/mage/cards/e/EmergentGrowth.java +++ b/Mage.Sets/src/mage/cards/e/EmergentGrowth.java @@ -23,9 +23,7 @@ public final class EmergentGrowth extends CardImpl { // Target creature gets +5/+5 until end of turn and must be blocked this turn if able. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new BoostTargetEffect(5, 5, Duration.EndOfTurn)); - Effect effect = new MustBeBlockedByAtLeastOneTargetEffect(); - effect.setText("and must be blocked this turn if able"); - this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addEffect(new MustBeBlockedByAtLeastOneTargetEffect(Duration.EndOfTurn)); } public EmergentGrowth(final EmergentGrowth card) { diff --git a/Mage.Sets/src/mage/cards/i/IrresistiblePrey.java b/Mage.Sets/src/mage/cards/i/IrresistiblePrey.java index fb8579bc801..7f6f2d13c26 100644 --- a/Mage.Sets/src/mage/cards/i/IrresistiblePrey.java +++ b/Mage.Sets/src/mage/cards/i/IrresistiblePrey.java @@ -2,15 +2,12 @@ package mage.cards.i; import java.util.UUID; -import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.combat.MustBeBlockedByAtLeastOneTargetEffect; -import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Zone; import mage.target.common.TargetCreaturePermanent; /** @@ -25,10 +22,7 @@ public final class IrresistiblePrey extends CardImpl { // Target creature must be blocked this turn if able. // Draw a card. - this.getSpellAbility().addEffect( - new GainAbilityTargetEffect( - new SimpleStaticAbility(Zone.BATTLEFIELD, new MustBeBlockedByAtLeastOneTargetEffect()), - Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new MustBeBlockedByAtLeastOneTargetEffect(Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); } From 98c94a487b9fc19b0ffea82618648d9e5f6ca7d4 Mon Sep 17 00:00:00 2001 From: ssouders412 Date: Wed, 13 Nov 2019 17:29:45 -0500 Subject: [PATCH 2/4] Added Must Be Blocked test --- .../combat/AttackBlockRestrictionsTest.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Mage.Tests/src/test/java/org/mage/test/combat/AttackBlockRestrictionsTest.java b/Mage.Tests/src/test/java/org/mage/test/combat/AttackBlockRestrictionsTest.java index 145e79a9cb1..de7a50b3210 100644 --- a/Mage.Tests/src/test/java/org/mage/test/combat/AttackBlockRestrictionsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/combat/AttackBlockRestrictionsTest.java @@ -542,4 +542,31 @@ public class AttackBlockRestrictionsTest extends CardTestPlayerBase { assertLife(playerA, 20); assertLife(playerB, 20); } + + @Test + public void irresistiblePreyMustBeBlockedTest() { + addCard(Zone.BATTLEFIELD, playerA, "Llanowar Elves"); + addCard(Zone.BATTLEFIELD, playerA, "Alpha Myr"); + addCard(Zone.BATTLEFIELD, playerA, "Forest"); + addCard(Zone.HAND, playerA, "Irresistible Prey"); + + addCard(Zone.BATTLEFIELD, playerB, "Bronze Sable"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Irresistible Prey", "Llanowar Elves"); // must be blocked + + attack(1, playerA, "Llanowar Elves"); + attack(1, playerA, "Alpha Myr"); + + // attempt to block the creature that doesn't have "must be blocked" + block(1, playerB, "Bronze Sable", "Alpha Myr"); + + setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertGraveyardCount(playerA, "Irresistible Prey", 1); + assertGraveyardCount(playerA, "Llanowar Elves", 1); + assertGraveyardCount(playerB, "Bronze Sable", 1); + assertTapped("Alpha Myr", true); + assertLife(playerB, 18); + } } From 62891df612780e4ca536ea462b0412a4e2f80bca Mon Sep 17 00:00:00 2001 From: ssouders412 Date: Wed, 13 Nov 2019 18:56:57 -0500 Subject: [PATCH 3/4] Reverted to custom text Custom text is required for these cards. Added custom text to Enlarge and Deadly Allure. --- Mage.Sets/src/mage/cards/d/DeadlyAllure.java | 4 +++- Mage.Sets/src/mage/cards/e/ElementalUprising.java | 4 +++- Mage.Sets/src/mage/cards/e/EmergentGrowth.java | 4 +++- Mage.Sets/src/mage/cards/e/Enlarge.java | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/cards/d/DeadlyAllure.java b/Mage.Sets/src/mage/cards/d/DeadlyAllure.java index 0191d316bc2..6b95ffdfa26 100644 --- a/Mage.Sets/src/mage/cards/d/DeadlyAllure.java +++ b/Mage.Sets/src/mage/cards/d/DeadlyAllure.java @@ -26,7 +26,9 @@ public final class DeadlyAllure extends CardImpl { // Target creature gains deathtouch until end of turn and must be blocked this turn if able. this.getSpellAbility().addEffect(new GainAbilityTargetEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new MustBeBlockedByAtLeastOneTargetEffect(Duration.EndOfTurn)); + Effect effect = new MustBeBlockedByAtLeastOneTargetEffect(Duration.EndOfTurn); + effect.setText("and must be blocked this turn if able"); + this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // Flashback {G} diff --git a/Mage.Sets/src/mage/cards/e/ElementalUprising.java b/Mage.Sets/src/mage/cards/e/ElementalUprising.java index 622ce5a7b99..56fb5578331 100644 --- a/Mage.Sets/src/mage/cards/e/ElementalUprising.java +++ b/Mage.Sets/src/mage/cards/e/ElementalUprising.java @@ -29,7 +29,9 @@ public final class ElementalUprising extends CardImpl { // Target land you control becomes a 4/4 Elemental creature with haste until end of turn. It's still a land. It must be blocked this turn if able. this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(new ElementalUprisingToken(), false, true, Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetPermanent(new FilterControlledLandPermanent())); - this.getSpellAbility().addEffect(new MustBeBlockedByAtLeastOneTargetEffect(Duration.EndOfTurn)); + Effect effect = new MustBeBlockedByAtLeastOneTargetEffect(Duration.EndOfTurn); + effect.setText("It must be blocked this turn if able"); + this.getSpellAbility().addEffect(effect); } public ElementalUprising(final ElementalUprising card) { diff --git a/Mage.Sets/src/mage/cards/e/EmergentGrowth.java b/Mage.Sets/src/mage/cards/e/EmergentGrowth.java index 4c45f9e9a90..c7d9c68d461 100644 --- a/Mage.Sets/src/mage/cards/e/EmergentGrowth.java +++ b/Mage.Sets/src/mage/cards/e/EmergentGrowth.java @@ -23,7 +23,9 @@ public final class EmergentGrowth extends CardImpl { // Target creature gets +5/+5 until end of turn and must be blocked this turn if able. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new BoostTargetEffect(5, 5, Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new MustBeBlockedByAtLeastOneTargetEffect(Duration.EndOfTurn)); + Effect effect = new MustBeBlockedByAtLeastOneTargetEffect(Duration.EndOfTurn); + effect.setText("and must be blocked this turn if able"); + this.getSpellAbility().addEffect(effect); } public EmergentGrowth(final EmergentGrowth card) { diff --git a/Mage.Sets/src/mage/cards/e/Enlarge.java b/Mage.Sets/src/mage/cards/e/Enlarge.java index 73349d3edad..1818b4fc4b1 100644 --- a/Mage.Sets/src/mage/cards/e/Enlarge.java +++ b/Mage.Sets/src/mage/cards/e/Enlarge.java @@ -25,7 +25,9 @@ public final class Enlarge extends CardImpl { // Target creature gets +7/+7 and gains trample until end of turn. It must be blocked this turn if able. this.getSpellAbility().addEffect(new BoostTargetEffect(7,7, Duration.EndOfTurn)); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new MustBeBlockedByAtLeastOneTargetEffect(Duration.EndOfTurn)); + Effect effect = new MustBeBlockedByAtLeastOneTargetEffect(Duration.EndOfTurn); + effect.setText("It must be blocked this turn if able"); + this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } From 9293b7704ed4c23978627f8db73d4ef23978014b Mon Sep 17 00:00:00 2001 From: ssouders412 Date: Wed, 13 Nov 2019 19:08:45 -0500 Subject: [PATCH 4/4] Fixed missing import --- Mage.Sets/src/mage/cards/d/DeadlyAllure.java | 1 + Mage.Sets/src/mage/cards/e/Enlarge.java | 1 + Mage.Sets/src/mage/cards/g/GaeasProtector.java | 1 + 3 files changed, 3 insertions(+) diff --git a/Mage.Sets/src/mage/cards/d/DeadlyAllure.java b/Mage.Sets/src/mage/cards/d/DeadlyAllure.java index 6b95ffdfa26..bfe8ce12aae 100644 --- a/Mage.Sets/src/mage/cards/d/DeadlyAllure.java +++ b/Mage.Sets/src/mage/cards/d/DeadlyAllure.java @@ -3,6 +3,7 @@ package mage.cards.d; import java.util.UUID; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.combat.MustBeBlockedByAtLeastOneTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.keyword.DeathtouchAbility; diff --git a/Mage.Sets/src/mage/cards/e/Enlarge.java b/Mage.Sets/src/mage/cards/e/Enlarge.java index 1818b4fc4b1..0e8a887a21c 100644 --- a/Mage.Sets/src/mage/cards/e/Enlarge.java +++ b/Mage.Sets/src/mage/cards/e/Enlarge.java @@ -2,6 +2,7 @@ package mage.cards.e; import java.util.UUID; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.combat.MustBeBlockedByAtLeastOneTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; diff --git a/Mage.Sets/src/mage/cards/g/GaeasProtector.java b/Mage.Sets/src/mage/cards/g/GaeasProtector.java index 60e9adb41f8..4cd88df8832 100644 --- a/Mage.Sets/src/mage/cards/g/GaeasProtector.java +++ b/Mage.Sets/src/mage/cards/g/GaeasProtector.java @@ -5,6 +5,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.combat.MustBeBlockedByAtLeastOneSourceEffect; +import mage.abilities.effects.Effect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType;