Merge pull request #6041 from ssouders412/MustBeBlockedFix

Irresistible Prey "must be blocked" fix
This commit is contained in:
Oleg Agafonov 2019-11-14 01:33:58 +01:00 committed by GitHub
commit 22fbe57d84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 41 additions and 13 deletions

View file

@ -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;
@ -26,7 +27,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}

View file

@ -27,11 +27,11 @@ 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()));
this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(new ElementalUprisingToken(), false, true, Duration.EndOfTurn));
this.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(effect);
}
public ElementalUprising(final ElementalUprising card) {

View file

@ -23,7 +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 effect = new MustBeBlockedByAtLeastOneTargetEffect(Duration.EndOfTurn);
effect.setText("and must be blocked this turn if able");
this.getSpellAbility().addEffect(effect);
}

View file

@ -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;
@ -25,7 +26,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());
}

View file

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

View file

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

View file

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