1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-03-30 09:08:36 -09:00

* Experimental Frenzy - Fixed a problem that casting cards from hand was not prevented ().

This commit is contained in:
LevelX2 2018-09-26 17:29:43 +02:00
parent 61b1b1ba05
commit 05dcfeaaa1
2 changed files with 41 additions and 2 deletions
Mage.Sets/src/mage/cards/e
Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords

View file

@ -128,6 +128,6 @@ class ExperimentalFrenzyRestrictionEffect extends ContinuousRuleModifyingEffectI
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
return event.getPlayerId().equals(source.getControllerId())
&& event.getZone() == Zone.HAND;
&& game.getState().getZone(event.getSourceId()) == Zone.HAND;
}
}

View file

@ -60,7 +60,7 @@ public class JumpStartTest extends CardTestPlayerBase {
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
assertGraveyardCount(playerB, "Counterspell", 1);
assertHandCount(playerA, 0); // 1 from sacrificed Clue and 1 from draw of turn 3
assertHandCount(playerA, 0);
assertGraveyardCount(playerA, "Direct Current", 0);
assertExileCount(playerA, "Direct Current", 1);
@ -68,4 +68,43 @@ public class JumpStartTest extends CardTestPlayerBase {
assertLife(playerB, 20);
}
@Test
public void testWithExperimentalFrenzy() {
// Direct Current deals 2 damage to any target.
// Jump-start
addCard(Zone.HAND, playerA, "Direct Current", 1); // Sorcery {1}{R}{R}
// You may look at the top card of your library any time.
// You may play the top card of your library.
// You can't play cards from your hand.
// {3}{R}: Destroy Experimental Frenzy.
addCard(Zone.HAND, playerA, "Experimental Frenzy", 1); // Enchantment {3}{R}
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 12);
addCard(Zone.HAND, playerA, "Lightning Bolt", 2);
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); // 2/2
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Direct Current", "Silvercoat Lion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Experimental Frenzy");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Direct Current with jump-start", playerB);
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerA, "Experimental Frenzy", 1);
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
assertGraveyardCount(playerA, "Direct Current", 0);
assertExileCount(playerA, "Direct Current", 1);
assertHandCount(playerA, "Lightning Bolt", 1); // prevented to cast from hand by Experimental Frenzy
assertGraveyardCount(playerA, "Lightning Bolt", 1); // Discarded by using jump-start
assertLife(playerA, 20);
assertLife(playerB, 18);
}
}