diff --git a/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java b/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java index c8232876235..e7e0d2c2537 100644 --- a/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java +++ b/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java @@ -519,7 +519,7 @@ public abstract class SpellAbilityEffect { String valid = sa.getParamOrDefault("ReplaceDyingValid", "Card.IsRemembered"); - String repeffstr = "Event$ Moved | ValidCard$ " + valid + + String repeffstr = "Event$ Moved | ValidLKI$ " + valid + "| Origin$ Battlefield | Destination$ Graveyard " + "| Description$ If that permanent would die this turn, exile it instead."; String effect = "DB$ ChangeZone | Defined$ ReplacedCard | Origin$ Battlefield | Destination$ " + zone; diff --git a/forge-game/src/main/java/forge/game/ability/effects/ReplaceCounterEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ReplaceCounterEffect.java index 0d7812f2635..af1684b8d9c 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ReplaceCounterEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ReplaceCounterEffect.java @@ -24,7 +24,6 @@ public class ReplaceCounterEffect extends SpellAbilityEffect { @Override public void resolve(SpellAbility sa) { - final Card card = sa.getHostCard(); // outside of Replacement Effect, unwanted result @@ -64,8 +63,6 @@ public class ReplaceCounterEffect extends SpellAbilityEffect { counterTable.get(p).put(e.getKey(), value); } } - - } else { for (Map.Entry, Map> e : counterTable.entrySet()) { if (!sa.matchesValidParam("ValidSource", e.getKey().orNull())) { diff --git a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java index 56fd67c5de7..9bee4a88830 100644 --- a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java +++ b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java @@ -2968,7 +2968,7 @@ public class CardFactoryUtil { final String manacost = k[1]; StringBuilder sb = new StringBuilder(); - sb.append("AB$ PutCounter| Cost$ ").append(manacost); + sb.append("AB$ PutCounter | Cost$ ").append(manacost); sb.append(" | PrecostDesc$ Level Up | CostDesc$ ").append(ManaCostParser.parse(manacost)); sb.append(" | SorcerySpeed$ True | LevelUp$ True | CounterNum$ 1 | CounterType$ LEVEL"); if (card.hasSVar("maxLevel")) { diff --git a/forge-game/src/main/java/forge/game/player/Player.java b/forge-game/src/main/java/forge/game/player/Player.java index 49cc9115457..c3c502f756c 100644 --- a/forge-game/src/main/java/forge/game/player/Player.java +++ b/forge-game/src/main/java/forge/game/player/Player.java @@ -1935,12 +1935,7 @@ public class Player extends GameEntity implements Comparable { return getOutcome().lossState != null; } - // Rule 704.5a - If a player has 0 or less life, he or she loses the game. - final boolean hasNoLife = getLife() <= 0; - if (hasNoLife && !cantLoseForZeroOrLessLife()) { - return loseConditionMet(GameLossReason.LifeReachedZero, null); - } - + // check this first because of Lich's Mirror (704.7) // Rule 704.5b - If a player attempted to draw a card from a library with no cards in it // since the last time state-based actions were checked, he or she loses the game. if (triedToDrawFromEmptyLibrary) { @@ -1951,6 +1946,12 @@ public class Player extends GameEntity implements Comparable { } } + // Rule 704.5a - If a player has 0 or less life, he or she loses the game. + final boolean hasNoLife = getLife() <= 0; + if (hasNoLife && !cantLoseForZeroOrLessLife()) { + return loseConditionMet(GameLossReason.LifeReachedZero, null); + } + // Rule 704.5c - If a player has ten or more poison counters, he or she loses the game. if (getCounters(CounterEnumType.POISON) >= 10) { return loseConditionMet(GameLossReason.Poisoned, null); diff --git a/forge-gui/res/cardsfolder/g/gisa_glorious_resurrector.txt b/forge-gui/res/cardsfolder/g/gisa_glorious_resurrector.txt index 7cbfd04b480..a87488d62fa 100644 --- a/forge-gui/res/cardsfolder/g/gisa_glorious_resurrector.txt +++ b/forge-gui/res/cardsfolder/g/gisa_glorious_resurrector.txt @@ -2,7 +2,7 @@ Name:Gisa, Glorious Resurrector ManaCost:2 B B Types:Legendary Creature Human Wizard PT:4/4 -R:Event$ Moved | ActiveZones$ Battlefield | CheckSelfLKIZone$ True | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.OppCtrl | ReplaceWith$ Exile | Description$ If a creature an opponent controls would die, exile it instead. +R:Event$ Moved | ActiveZones$ Battlefield | CheckSelfLKIZone$ True | Origin$ Battlefield | Destination$ Graveyard | ValidLKI$ Creature.OppCtrl | ReplaceWith$ Exile | Description$ If a creature an opponent controls would die, exile it instead. SVar:Exile:DB$ ChangeZone | Hidden$ True | Origin$ All | Destination$ Exile | Defined$ ReplacedCard T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | IsPresent$ Card.ExiledWithSource | PresentZone$ Exile | Execute$ TrigChange | TriggerDescription$ At the beginning of your upkeep, put all creature cards exiled with CARDNAME onto the battlefield under your control. They gain decayed. (A creature with decayed can't block. When it attacks, sacrifice it at end of combat.) SVar:TrigChange:DB$ ChangeZoneAll | ChangeType$ Card.ExiledWithSource | Origin$ Exile | Destination$ Battlefield | GainControl$ True | RememberChanged$ True | SubAbility$ DBPump diff --git a/forge-gui/res/cardsfolder/h/hardened_scales.txt b/forge-gui/res/cardsfolder/h/hardened_scales.txt index 3ea28653134..3d307b4429b 100644 --- a/forge-gui/res/cardsfolder/h/hardened_scales.txt +++ b/forge-gui/res/cardsfolder/h/hardened_scales.txt @@ -1,7 +1,7 @@ Name:Hardened Scales ManaCost:G Types:Enchantment -R:Event$ AddCounter | ActiveZones$ Battlefield | ValidCard$ Creature.YouCtrl+InZoneBattlefield | ValidCounterType$ P1P1 | ReplaceWith$ AddOneMoreCounters | Description$ If one or more +1/+1 counters would be put on a creature you control, that many plus one +1/+1 counters are put on it instead. +R:Event$ AddCounter | ActiveZones$ Battlefield | ValidCard$ Creature.YouCtrl+inZoneBattlefield | ValidCounterType$ P1P1 | ReplaceWith$ AddOneMoreCounters | Description$ If one or more +1/+1 counters would be put on a creature you control, that many plus one +1/+1 counters are put on it instead. SVar:AddOneMoreCounters:DB$ ReplaceCounter | ValidCounterType$ P1P1 | ChooseCounter$ True | Amount$ X SVar:X:ReplaceCount$CounterNum/Plus.1 AI:RemoveDeck:Random diff --git a/forge-gui/res/cardsfolder/r/rite_of_flame.txt b/forge-gui/res/cardsfolder/r/rite_of_flame.txt index 5a3f50ab7bf..45429884657 100644 --- a/forge-gui/res/cardsfolder/r/rite_of_flame.txt +++ b/forge-gui/res/cardsfolder/r/rite_of_flame.txt @@ -1,7 +1,7 @@ Name:Rite of Flame ManaCost:R Types:Sorcery -A:SP$ Mana | Produced$ R | Amount$ 2 | AILogic$ ManaRitual | AINoRecursiveCheck$ True | SpellDescription$ Add {R}{R}, then add {R} for each card named CARDNAME in each graveyard. +A:SP$ Mana | Produced$ R | Amount$ 2 | AILogic$ ManaRitual | AINoRecursiveCheck$ True | SubAbility$ SubMana | SpellDescription$ Add {R}{R}, then add {R} for each card named CARDNAME in each graveyard. SVar:SubMana:DB$ Mana | Produced$ R | Amount$ X SVar:X:Count$NamedInAllYards.Rite of Flame DeckHints:Name$Rite of Flame diff --git a/forge-gui/res/cardsfolder/s/submerged_boneyard.txt b/forge-gui/res/cardsfolder/s/submerged_boneyard.txt index 4ceb6d17f53..81d289643eb 100644 --- a/forge-gui/res/cardsfolder/s/submerged_boneyard.txt +++ b/forge-gui/res/cardsfolder/s/submerged_boneyard.txt @@ -2,5 +2,5 @@ Name:Submerged Boneyard ManaCost:no cost Types:Land K:CARDNAME enters the battlefield tapped. -A:AB$ Mana | Cost$ T | Produced$ Combo U | SpellDescription$ Add {U} or {B}. +A:AB$ Mana | Cost$ T | Produced$ Combo U B | SpellDescription$ Add {U} or {B}. Oracle:Submerged Boneyard enters the battlefield tapped.\n{T}: Add {U} or {B}. diff --git a/forge-gui/res/cardsfolder/v/valentin_dean_of_the_vein_lisette_dean_of_the_root.txt b/forge-gui/res/cardsfolder/v/valentin_dean_of_the_vein_lisette_dean_of_the_root.txt index a27337e8c2e..b1fb3f614c7 100644 --- a/forge-gui/res/cardsfolder/v/valentin_dean_of_the_vein_lisette_dean_of_the_root.txt +++ b/forge-gui/res/cardsfolder/v/valentin_dean_of_the_vein_lisette_dean_of_the_root.txt @@ -4,7 +4,7 @@ Types:Legendary Creature Vampire Warlock PT:1/1 K:Menace K:Lifelink -R:Event$ Moved | ActiveZones$ Battlefield | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Creature+nonToken+OppOwn | ReplaceWith$ Exile | Description$ If a nontoken creature an opponent controls would die, exile it instead. When you do, you may pay {2}. If you do, create a 1/1 black and green Pest creature token with "When this creature dies, you gain 1 life." +R:Event$ Moved | ActiveZones$ Battlefield | Origin$ Battlefield | Destination$ Graveyard | ValidLKI$ Card.Creature+nonToken+OppOwn | ReplaceWith$ Exile | Description$ If a nontoken creature an opponent controls would die, exile it instead. When you do, you may pay {2}. If you do, create a 1/1 black and green Pest creature token with "When this creature dies, you gain 1 life." SVar:Exile:DB$ ChangeZone | Hidden$ True | Origin$ All | Destination$ Exile | Defined$ ReplacedCard | SubAbility$ DBImmediateTrigger SVar:DBImmediateTrigger:DB$ ImmediateTrigger | Execute$ TrigToken | TriggerDescription$ If a nontoken creature an opponent controls would die, exile it instead. When you do, you may pay {2}. If you do, create a 1/1 black and green Pest creature token with "When this creature dies, you gain 1 life." SVar:TrigToken:AB$ Token | Cost$ 2 | TokenAmount$ 1 | TokenScript$ bg_1_1_pest_lifegain | TokenOwner$ You diff --git a/forge-gui/res/cardsfolder/v/void_maw.txt b/forge-gui/res/cardsfolder/v/void_maw.txt index a03a01e23eb..aa24541cdc2 100644 --- a/forge-gui/res/cardsfolder/v/void_maw.txt +++ b/forge-gui/res/cardsfolder/v/void_maw.txt @@ -3,7 +3,7 @@ ManaCost:4 B B Types:Creature Horror PT:4/5 K:Trample -R:Event$ Moved | ActiveZones$ Battlefield | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.Other | ReplaceWith$ Exile | Description$ If another creature would die, exile it instead. +R:Event$ Moved | ActiveZones$ Battlefield | Origin$ Battlefield | Destination$ Graveyard | ValidLKI$ Creature.Other | ReplaceWith$ Exile | Description$ If another creature would die, exile it instead. SVar:Exile:DB$ ChangeZone | Hidden$ True | Origin$ All | Destination$ Exile | Defined$ ReplacedCard | SubAbility$ DBRemember | RememberChanged$ True SVar:DBRemember:DB$ Pump | ConditionDefined$ Remembered | ConditionPresent$ Card.inZoneExile | ConditionCompare$ GE1 T:Mode$ ChangesZone | Origin$ Exile | Destination$ Any | Static$ True | ValidCard$ Card.IsRemembered+ExiledWithSource | Execute$ DBForget diff --git a/forge-gui/res/cardsfolder/z/zabaz_the_glimmerwasp.txt b/forge-gui/res/cardsfolder/z/zabaz_the_glimmerwasp.txt index d6a311ca3f5..39dceaef8ad 100644 --- a/forge-gui/res/cardsfolder/z/zabaz_the_glimmerwasp.txt +++ b/forge-gui/res/cardsfolder/z/zabaz_the_glimmerwasp.txt @@ -3,7 +3,7 @@ ManaCost:1 Types:Legendary Artifact Creature Insect PT:0/0 K:Modular:1 -R:Event$ AddCounter | ActiveZones$ Battlefield | ValidCause$ Triggered.Modular | ValidCard$ Creature.YouCtrl+InZoneBattlefield | ValidCounterType$ P1P1 | ReplaceWith$ AddOneMoreCounter | Description$ If a modular triggered ability would put one or more +1/+1 counters on a creature you control, that many plus one +1/+1 counters are put on it instead. +R:Event$ AddCounter | ActiveZones$ Battlefield | ValidCause$ Triggered.Modular | ValidCard$ Creature.YouCtrl+inZoneBattlefield | ValidCounterType$ P1P1 | ReplaceWith$ AddOneMoreCounter | Description$ If a modular triggered ability would put one or more +1/+1 counters on a creature you control, that many plus one +1/+1 counters are put on it instead. SVar:AddOneMoreCounter:DB$ ReplaceCounter | ValidCounterType$ P1P1 | ChooseCounter$ True | Amount$ X SVar:X:ReplaceCount$CounterNum/Plus.1 A:AB$ Destroy | Cost$ R | ValidTgts$ Artifact.YouCtrl | TgtPrompt$ Choose target artifact you control | SpellDescription$ Destroy target artifact you control.