- Converted the replacement ability of Lich to script.

This commit is contained in:
Sloth
2012-01-08 15:37:26 +00:00
parent e933b27958
commit 7229e183c5
2 changed files with 12 additions and 15 deletions

View File

@@ -1,8 +1,11 @@
Name:Lich
ManaCost:B B B B
Types:Enchantment
Text:As CARDNAME enters the battlefield, you lose life equal to your life total.\r\nYou don't lose the game for having 0 or less life.\r\nIf you would gain life, draw that many cards instead.\r\nWhenever you're dealt damage, sacrifice that many nontoken permanents. If you can't, you lose the game.\r\nWhen CARDNAME is put into a graveyard from the battlefield, you lose the game.
Text:As CARDNAME enters the battlefield, you lose life equal to your life total.\r\nYou don't lose the game for having 0 or less life.\r\nWhenever you're dealt damage, sacrifice that many nontoken permanents. If you can't, you lose the game.\r\nWhen CARDNAME is put into a graveyard from the battlefield, you lose the game.
K:You don't lose the game for having 0 or less life.
R:Event$ GainLife | ValidPlayer$ You | ReplaceWith$ Draw | Description$ If you would gain life, draw that many cards instead.
SVar:Draw:AB$Draw | Cost$ 0 | Defined$ You | NumCards$ X
SVar:X:ReplaceCount$LifeGained
SVar:RemRandomDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/lich.jpg

View File

@@ -312,11 +312,6 @@ public abstract class Player extends GameEntity {
int lifeGain = toGain;
if (lifeGain > 0) {
if (AllZoneUtil.isCardInPlay("Lich", this)) {
// draw cards instead of gain life
this.drawCards(lifeGain);
newLifeSet = false;
} else {
this.addLife(lifeGain);
newLifeSet = true;
this.updateObservers();
@@ -326,7 +321,6 @@ public abstract class Player extends GameEntity {
runParams.put("Player", this);
runParams.put("LifeAmount", lifeGain);
AllZone.getTriggerHandler().runTrigger("LifeGained", runParams);
}
} else {
System.out.println("Player - trying to gain negative or 0 life");
}