diff --git a/Mage.Sets/src/mage/sets/arabiannights/AliFromCairo.java b/Mage.Sets/src/mage/sets/arabiannights/AliFromCairo.java index 076d03c794..5cc37d20a0 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/AliFromCairo.java +++ b/Mage.Sets/src/mage/sets/arabiannights/AliFromCairo.java @@ -97,11 +97,7 @@ class AliFromCairoReplacementEffect extends ReplacementEffectImpl { && (controller.getLife() > 0) &&(controller.getLife() - event.getAmount()) < 1 && event.getPlayerId().equals(controller.getId()) ) { - return true; - //unsure how to make this comply with - // 10/1/2008: The ability doesn't change how much damage is dealt; - // it just changes how much life that damage makes you lose. - // An effect such as Spirit Link will see the full amount of damage being dealt. + return true; } } return false; @@ -110,10 +106,17 @@ class AliFromCairoReplacementEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); + + // 10/1/2008: The ability doesn't change how much damage is dealt; + // it just changes how much life that damage makes you lose. + // An effect such as Spirit Link will see the full amount of damage being dealt. + game.fireEvent(event); + if (controller != null) { - event.setAmount(controller.getLife() - 1); + controller.setLife(1, game); } - return false; + + return true; } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/AliFromCairoTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/AliFromCairoTest.java new file mode 100644 index 0000000000..fefd0c65d2 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/AliFromCairoTest.java @@ -0,0 +1,40 @@ +package org.mage.test.cards.single; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author BetaSteward + */ +public class AliFromCairoTest extends CardTestPlayerBase { + + @Test + public void testCard() { + addCard(Zone.BATTLEFIELD, playerA, "Ali from Cairo", 1); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 12); + addCard(Zone.BATTLEFIELD, playerB, "Soulfire Grand Master", 1); + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 12); + addCard(Zone.HAND, playerA, "Lightning Bolt", 7); + addCard(Zone.HAND, playerB, "Lightning Bolt", 7); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerA); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerA); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerA); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerA); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerA); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerA); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerA); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerA); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", playerA); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertLife(playerA, 1); + assertLife(playerB, 23); + } +} \ No newline at end of file