From 24f1285a4309d5384d41e9d091a28a721a28715b Mon Sep 17 00:00:00 2001 From: Hythonia Date: Sat, 27 Mar 2021 12:02:13 +0100 Subject: [PATCH] Breena and PlayerProperty.java update --- .../main/java/forge/game/player/PlayerProperty.java | 8 +++++--- forge-gui/res/cardsfolder/c/celestial_convergence.txt | 3 +-- forge-gui/res/cardsfolder/t/the_mighty_will_fall.txt | 5 ++--- forge-gui/res/cardsfolder/t/triskaidekaphobia.txt | 5 ++--- .../res/cardsfolder/upcoming/breena_the_demagogue.txt | 11 +++++++++++ forge-gui/res/cardsfolder/y/your_inescapable_doom.txt | 3 +-- 6 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 forge-gui/res/cardsfolder/upcoming/breena_the_demagogue.txt diff --git a/forge-game/src/main/java/forge/game/player/PlayerProperty.java b/forge-game/src/main/java/forge/game/player/PlayerProperty.java index 966c6292b2a..ade61abc594 100644 --- a/forge-game/src/main/java/forge/game/player/PlayerProperty.java +++ b/forge-game/src/main/java/forge/game/player/PlayerProperty.java @@ -225,9 +225,11 @@ public class PlayerProperty { if (source.getChosenPlayer() == null || !source.getChosenPlayer().equals(player)) { return false; } - } else if (property.startsWith("LifeEquals_")) { - int life = AbilityUtils.calculateAmount(source, property.substring(11), null); - if (player.getLife() != life) { + } else if (property.startsWith("life")) { + int life = player.getLife(); + int amount = AbilityUtils.calculateAmount(source, property.substring(6), spellAbility); + + if (!Expressions.compare(life, property, amount)) { return false; } } else if (property.equals("IsPoisoned")) { diff --git a/forge-gui/res/cardsfolder/c/celestial_convergence.txt b/forge-gui/res/cardsfolder/c/celestial_convergence.txt index 6278935f4df..ce030fd6741 100644 --- a/forge-gui/res/cardsfolder/c/celestial_convergence.txt +++ b/forge-gui/res/cardsfolder/c/celestial_convergence.txt @@ -4,9 +4,8 @@ Types:Enchantment K:etbCounter:OMEN:7 T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigRemoveCtr | TriggerDescription$ At the beginning of your upkeep, remove an omen counter from CARDNAME. If there are no omen counters on CARDNAME, the player with the highest life total wins the game. If two or more players are tied for highest life total, the game is a draw. SVar:TrigRemoveCtr:DB$ RemoveCounter | Defined$ Self | CounterType$ OMEN | CounterNum$ 1 | SubAbility$ WinnerDecided -SVar:WinnerDecided:DB$ WinsGame | Defined$ Player.LifeEquals_X | ConditionPresent$ Card.Self+counters_EQ0_OMEN | ConditionCheckSVar$ NumHighestLife | ConditionSVarCompare$ LT2 | SubAbility$ GameIsADraw +SVar:WinnerDecided:DB$ WinsGame | Defined$ Player.lifeEQX | ConditionPresent$ Card.Self+counters_EQ0_OMEN | ConditionCheckSVar$ NumHighestLife | ConditionSVarCompare$ LT2 | SubAbility$ GameIsADraw SVar:GameIsADraw:DB$ GameDrawn | ConditionPresent$ Card.Self+counters_EQ0_OMEN | ConditionCheckSVar$ NumHighestLife | ConditionSVarCompare$ GE2 -SVar:Picture:http://www.wizards.com/global/images/magic/general/celestial_convergence.jpg SVar:X:PlayerCountPlayers$HighestLifeTotal SVar:NumHighestLife:PlayerCountPlayers$TiedForHighestLife AI:RemoveDeck:Random diff --git a/forge-gui/res/cardsfolder/t/the_mighty_will_fall.txt b/forge-gui/res/cardsfolder/t/the_mighty_will_fall.txt index 8c5f97ac470..53d53a7192e 100644 --- a/forge-gui/res/cardsfolder/t/the_mighty_will_fall.txt +++ b/forge-gui/res/cardsfolder/t/the_mighty_will_fall.txt @@ -2,8 +2,7 @@ Name:The Mighty Will Fall ManaCost:no cost Types:Scheme T:Mode$ SetInMotion | ValidCard$ Card.Self | Execute$ DBChoosePlayer | TriggerZones$ Command | TriggerDescription$ When you set this scheme in motion, choose an opponent with the highest life total among your opponents. That player loses 7 life. -SVar:DBChoosePlayer:DB$ ChoosePlayer | Defined$ You | Choices$ Player.Opponent+LifeEquals_X | SubAbility$ DBLoseLife +SVar:DBChoosePlayer:DB$ ChoosePlayer | Defined$ You | Choices$ Player.Opponent+lifeEQX | SubAbility$ DBLoseLife SVar:DBLoseLife:DB$ LoseLife | Defined$ ChosenPlayer | LifeAmount$ 7 SVar:X:PlayerCountOpponents$HighestLifeTotal -SVar:Picture:https://downloads.cardforge.org/images/cards/ARC/The Mighty Will Fall.full.jpg -Oracle:When you set this scheme in motion, choose an opponent with the highest life total among your opponents. That player loses 7 life. \ No newline at end of file +Oracle:When you set this scheme in motion, choose an opponent with the highest life total among your opponents. That player loses 7 life. diff --git a/forge-gui/res/cardsfolder/t/triskaidekaphobia.txt b/forge-gui/res/cardsfolder/t/triskaidekaphobia.txt index f74c40600a0..fa10a43cfac 100644 --- a/forge-gui/res/cardsfolder/t/triskaidekaphobia.txt +++ b/forge-gui/res/cardsfolder/t/triskaidekaphobia.txt @@ -3,11 +3,10 @@ ManaCost:3 B Types:Enchantment T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigCharm | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, ABILITY SVar:TrigCharm:DB$ Charm | Choices$ DBLoseGame1,DBLoseGame2 | CharmNum$ 1 -SVar:DBLoseGame1:DB$ LosesGame | Defined$ Player.LifeEquals_13 | SubAbility$ DBGainLife | SpellDescription$ Each player with exactly 13 life loses the game, then each player gains 1 life. +SVar:DBLoseGame1:DB$ LosesGame | Defined$ Player.lifeEQ13 | SubAbility$ DBGainLife | SpellDescription$ Each player with exactly 13 life loses the game, then each player gains 1 life. SVar:DBGainLife:DB$ GainLife | Defined$ Player | LifeAmount$ 1 -SVar:DBLoseGame2:DB$ LosesGame | Defined$ Player.LifeEquals_13 | SubAbility$ DBLoseLife | SpellDescription$ Each player with exactly 13 life loses the game, then each player loses 1 life. +SVar:DBLoseGame2:DB$ LosesGame | Defined$ Player.lifeEQ13 | SubAbility$ DBLoseLife | SpellDescription$ Each player with exactly 13 life loses the game, then each player loses 1 life. SVar:DBLoseLife:DB$ LoseLife | Defined$ Player | LifeAmount$ 1 AI:RemoveDeck:Random DeckHas:Ability$LifeGain -SVar:Picture:http://www.wizards.com/global/images/magic/general/triskaidekaphobia.jpg Oracle:At the beginning of your upkeep, choose one —\n• Each player with exactly 13 life loses the game, then each player gains 1 life.\n• Each player with exactly 13 life loses the game, then each player loses 1 life. diff --git a/forge-gui/res/cardsfolder/upcoming/breena_the_demagogue.txt b/forge-gui/res/cardsfolder/upcoming/breena_the_demagogue.txt new file mode 100644 index 00000000000..c1102502c88 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/breena_the_demagogue.txt @@ -0,0 +1,11 @@ +Name:Breena, the Demagogue +ManaCost:1 W B +Types:Legendary Creature Bird Warlock +PT:1/3 +K:Flying +T:Mode$ AttackersDeclared | AttackingPlayer$ Player | AttackedTarget$ Opponent.lifeGTX | Execute$ TrigDraw | TriggerZones$ Battlefield | TriggerDescription$ Whenever a player attacks one of your opponents, if that opponent has more life than another of your opponents, that attacking player draws a card and you put two +1/+1 counters on a creature you control. +SVar:TrigDraw:DB$ Draw | Defined$ AttackingPlayer | SubAbility$ DBChooseCard +SVar:DBChooseCard:DB$ ChooseCard | Choices$ Creature.YouCtrl | SubAbility$ DBPutCounter +SVar:DBPutCounter:DB$ PutCounter | Defined$ ChosenCard | CounterType$ P1P1 | CounterNum$ 2 +SVar:X:PlayerCountOpponents$LowestLifeTotal +Oracle:Flying\nWhenever a player attacks one of your opponents, if that opponent has more life than another of your opponents, that attacking player draws a card and you put two +1/+1 counters on a creature you control. diff --git a/forge-gui/res/cardsfolder/y/your_inescapable_doom.txt b/forge-gui/res/cardsfolder/y/your_inescapable_doom.txt index e0825b89244..9cbcfa90bff 100644 --- a/forge-gui/res/cardsfolder/y/your_inescapable_doom.txt +++ b/forge-gui/res/cardsfolder/y/your_inescapable_doom.txt @@ -3,9 +3,8 @@ ManaCost:no cost Types:Ongoing Scheme T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Command | Execute$ TrigPutCounter | TriggerDescription$ At the beginning of your end step, put a doom counter on this scheme, then this scheme deals damage equal to the number of doom counters on it to the opponent with the highest life total among your opponents. If two or more players are tied for highest life total, you choose one. SVar:TrigPutCounter:DB$ PutCounter | Defined$ Self | CounterType$ DOOM | CounterNum$ 1 | SubAbility$ DBChoosePlayer -SVar:DBChoosePlayer:DB$ ChoosePlayer | Defined$ You | Choices$ Player.Opponent+LifeEquals_X | SubAbility$ DBDmg +SVar:DBChoosePlayer:DB$ ChoosePlayer | Defined$ You | Choices$ Player.Opponent+lifeEQX | SubAbility$ DBDmg SVar:DBDmg:DB$ DealDamage | Defined$ ChosenPlayer | NumDmg$ Y SVar:X:PlayerCountOpponents$HighestLifeTotal SVar:Y:Count$CardCounters.DOOM -SVar:Picture:https://downloads.cardforge.org/images/cards/ARC/Your Inescapable Doom.full.jpg Oracle:(An ongoing scheme remains face up.)\nAt the beginning of your end step, put a doom counter on this scheme, then this scheme deals damage equal to the number of doom counters on it to the opponent with the highest life total among your opponents. If two or more players are tied for highest life total, you choose one.