mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
fix for #5417
This commit is contained in:
parent
2e17cb334e
commit
ed69c04490
2 changed files with 33 additions and 6 deletions
|
|
@ -59,14 +59,16 @@ class IcequakeEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
|
||||||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||||
if (permanent != null && controller != null) {
|
if (permanent != null) {
|
||||||
permanent.destroy(source.getSourceId(), game, false);
|
Player controller = game.getPlayer(permanent.getControllerId());
|
||||||
if (permanent.isSnow()) {
|
if(controller != null) {
|
||||||
controller.damage(1, source.getSourceId(), game, false, true);
|
permanent.destroy(source.getSourceId(), game, false);
|
||||||
|
if (permanent.isSnow()) {
|
||||||
|
controller.damage(1, source.getSourceId(), game, false, true);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package org.mage.test.cards.conditional;
|
||||||
|
|
||||||
|
import mage.constants.PhaseStep;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
|
|
||||||
|
public class IcequakeTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testIcequakeOnSnowLand(){
|
||||||
|
|
||||||
|
addCard(Zone.BATTLEFIELD, playerB, "Snow-Covered Plains");
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Swamp",10);
|
||||||
|
addCard(Zone.HAND, playerA, "Icequake");
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN,playerA, "Icequake", "Snow-Covered Plains");
|
||||||
|
|
||||||
|
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertLife(playerA, 20);
|
||||||
|
assertLife(playerB, 19);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue