mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- Converted the replacement ability of Lich to script.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -312,21 +312,15 @@ 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();
|
||||
this.addLife(lifeGain);
|
||||
newLifeSet = true;
|
||||
this.updateObservers();
|
||||
|
||||
// Run triggers
|
||||
final HashMap<String, Object> runParams = new HashMap<String, Object>();
|
||||
runParams.put("Player", this);
|
||||
runParams.put("LifeAmount", lifeGain);
|
||||
AllZone.getTriggerHandler().runTrigger("LifeGained", runParams);
|
||||
}
|
||||
// Run triggers
|
||||
final HashMap<String, Object> runParams = new HashMap<String, Object>();
|
||||
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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user