mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
fixed Ali from Cairo
the previous implementation did reduce the amount of damage that is being dealt to not reduce life below one. now the damage is untouched but the affected player's life total is set to 1 if the damage would otherwise reduce below 1.
This commit is contained in:
parent
d481c124ea
commit
a5504c1a96
2 changed files with 50 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue