forked from External/mage
* Laboratory Maniac - Removed wrong checks that prevented the player to win if his life was below 1 and he drew from an empty libraray.
This commit is contained in:
parent
5a428f10ab
commit
bf598d1af2
3 changed files with 53 additions and 5 deletions
|
|
@ -113,10 +113,7 @@ class LaboratoryManiacEffect extends ReplacementEffectImpl {
|
|||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getPlayerId().equals(source.getControllerId())) {
|
||||
Player player = game.getPlayer(event.getPlayerId());
|
||||
if (!player.hasLost() && (
|
||||
(player.getLife() > 0 || !player.canLoseByZeroOrLessLife())
|
||||
&& player.isEmptyDraw()
|
||||
&& player.getCounters().getCount(CounterType.POISON) < 10)) {
|
||||
if (player != null && !player.hasLost() && player.isEmptyDraw()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class AngelsGrace extends CardImpl {
|
|||
this.expansionSetCode = "TSP";
|
||||
|
||||
|
||||
// Split second
|
||||
// Split second (As long as this spell is on the stack, players can't cast spells or activate abilities that aren't mana abilities.)
|
||||
this.addAbility(new SplitSecondAbility());
|
||||
|
||||
// You can't lose the game this turn and your opponents can't win the game this turn. Until end of turn, damage that would reduce your life total to less than 1 reduces it to 1 instead.
|
||||
|
|
|
|||
|
|
@ -93,4 +93,55 @@ public class WinLoseEffectsTest extends CardTestPlayerBase {
|
|||
assertLife(playerB, 20);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAngelsGrace2() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 4);
|
||||
// Instant {W}
|
||||
// You can't lose the game this turn and your opponents can't win the game this turn. Until end of turn, damage that would reduce your life total to less than 1 reduces it to 1 instead.
|
||||
addCard(Zone.HAND, playerA, "Angel's Grace");
|
||||
// Instant - {3}{B}{B}
|
||||
// Reveal the top card of your library and put that card into your hand. You lose life equal to its converted mana cost.
|
||||
// You may repeat this process any number of times.
|
||||
addCard(Zone.HAND, playerA, "Ad Nauseam");
|
||||
|
||||
// Creature
|
||||
// If you would draw a card while your library has no cards in it, you win the game instead.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Laboratory Maniac", 1);
|
||||
|
||||
skipInitShuffling();
|
||||
|
||||
playerA.getLibrary().clear();
|
||||
// Instant {U}
|
||||
// Draw a card. Scry 2
|
||||
addCard(Zone.LIBRARY, playerA, "Serum Visions"); // 1 life lost
|
||||
addCard(Zone.LIBRARY, playerA, "Bogardan Hellkite", 3); // 24 life lost
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Angel's Grace");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ad Nauseam");
|
||||
setChoice(playerA, "Yes");
|
||||
setChoice(playerA, "Yes");
|
||||
setChoice(playerA, "Yes");
|
||||
setChoice(playerA, "Yes");
|
||||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Serum Visions");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, "Angel's Grace", 1);
|
||||
assertGraveyardCount(playerA, "Ad Nauseam", 1);
|
||||
assertGraveyardCount(playerA, "Serum Visions", 1);
|
||||
|
||||
Assert.assertEquals("Player A library is empty", 0 , playerA.getLibrary().size());
|
||||
|
||||
assertLife(playerA, -5);
|
||||
assertLife(playerB, 20);
|
||||
|
||||
Assert.assertTrue("Player A has not won but should have", playerA.hasWon());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue