From a10f8f4cb7b992799279084c1449b5f35970d32c Mon Sep 17 00:00:00 2001 From: tool4EvEr Date: Tue, 22 Nov 2022 12:26:29 +0100 Subject: [PATCH] Cleanup --- forge-game/src/main/java/forge/game/GameAction.java | 3 ++- .../java/forge/game/ability/effects/EffectEffect.java | 3 ++- forge-game/src/main/java/forge/game/card/Card.java | 2 +- .../src/main/java/forge/game/player/PlayerProperty.java | 2 +- .../game/staticability/StaticAbilityNumLoyaltyAct.java | 3 +-- forge-gui/res/cardsfolder/a/academy_loremaster.txt | 8 ++++---- forge-gui/res/cardsfolder/b/bartered_cow.txt | 4 ++-- forge-gui/res/cardsfolder/g/gate_to_the_aether.txt | 4 ++-- forge-gui/res/cardsfolder/o/obzedat_ghost_council.txt | 7 +++---- forge-gui/res/cardsfolder/w/wild_evocation.txt | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/forge-game/src/main/java/forge/game/GameAction.java b/forge-game/src/main/java/forge/game/GameAction.java index f2e6b62f67f..1eb2845064a 100644 --- a/forge-game/src/main/java/forge/game/GameAction.java +++ b/forge-game/src/main/java/forge/game/GameAction.java @@ -2430,7 +2430,7 @@ public class GameAction { } if (c.isPlaneswalker()) { int lethalPW = c.getCurrentLoyalty(); - // 120.10 + // CR 120.10 lethal = c.isCreature() ? Math.min(lethal, lethalPW) : lethalPW; } lethalDamage.put(c, lethal); @@ -2442,6 +2442,7 @@ public class GameAction { sourceLKI.getDamageHistory().registerDamage(e.getValue(), isCombat, sourceLKI, e.getKey(), lkiCache); } + // CR 702.15e if (sum > 0 && sourceLKI.hasKeyword(Keyword.LIFELINK)) { sourceLKI.getController().gainLife(sum, sourceLKI, cause); } diff --git a/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java b/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java index 0665b7fbe55..b7607038afa 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java @@ -27,6 +27,7 @@ import forge.game.trigger.Trigger; import forge.game.trigger.TriggerHandler; import forge.game.trigger.TriggerType; import forge.game.zone.ZoneType; +import forge.util.CardTranslation; import forge.util.TextUtil; import forge.util.collect.FCollection; @@ -113,7 +114,7 @@ public class EffectEffect extends SpellAbilityEffect { String name = sa.getParam("Name"); if (name == null) { - name = hostCard.getName() + (sa.hasParam("Boon") ? "'s Boon" : "'s Effect"); + name = CardTranslation.getTranslatedName(hostCard.getName()) + (sa.hasParam("Boon") ? "'s Boon" : "'s Effect"); } // Unique Effects shouldn't be duplicated diff --git a/forge-game/src/main/java/forge/game/card/Card.java b/forge-game/src/main/java/forge/game/card/Card.java index 1c3fdb8f152..1c23be603e8 100644 --- a/forge-game/src/main/java/forge/game/card/Card.java +++ b/forge-game/src/main/java/forge/game/card/Card.java @@ -5636,7 +5636,7 @@ public class Card extends GameEntity implements Comparable, IHasSVars { @Override public final int addDamageAfterPrevention(final int damageIn, final Card source, final boolean isCombat, GameEntityCounterTable counterTable) { if (damageIn <= 0) { - return 0; // Rule 119.8 + return 0; // 120.8 } // 120.1a Damage can’t be dealt to an object that’s neither a creature nor a planeswalker. 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 3bcda5ac413..a93167461f2 100644 --- a/forge-game/src/main/java/forge/game/player/PlayerProperty.java +++ b/forge-game/src/main/java/forge/game/player/PlayerProperty.java @@ -160,7 +160,7 @@ public class PlayerProperty { return false; } } else if (property.equals("Defending")) { - if (!game.getCombat().getAttackersAndDefenders().values().contains(player)) { + if (game.getCombat() == null || !game.getCombat().getAttackersAndDefenders().values().contains(player)) { return false; } } else if (property.equals("LostLifeThisTurn")) { diff --git a/forge-game/src/main/java/forge/game/staticability/StaticAbilityNumLoyaltyAct.java b/forge-game/src/main/java/forge/game/staticability/StaticAbilityNumLoyaltyAct.java index 43bd2d29646..adca5c1e5c2 100644 --- a/forge-game/src/main/java/forge/game/staticability/StaticAbilityNumLoyaltyAct.java +++ b/forge-game/src/main/java/forge/game/staticability/StaticAbilityNumLoyaltyAct.java @@ -29,7 +29,6 @@ public class StaticAbilityNumLoyaltyAct { } public static boolean applyLimitIncrease(final StaticAbility stAb, final Card card) { - if (!stAb.matchesValidParam("ValidCard", card)) { return false; } @@ -58,7 +57,7 @@ public class StaticAbilityNumLoyaltyAct { } } int more = AbilityUtils.calculateAmount(card, stAb.getParam("Additional"), stAb); - addl = addl + more; + addl += more; } } } diff --git a/forge-gui/res/cardsfolder/a/academy_loremaster.txt b/forge-gui/res/cardsfolder/a/academy_loremaster.txt index 81b9e42eb11..18ba66a4651 100644 --- a/forge-gui/res/cardsfolder/a/academy_loremaster.txt +++ b/forge-gui/res/cardsfolder/a/academy_loremaster.txt @@ -2,9 +2,9 @@ Name:Academy Loremaster ManaCost:U U Types:Creature Human Wizard PT:2/3 -T:Mode$ Phase | Phase$ Draw | ValidPlayer$ Player | TriggerZones$ Battlefield | OptionalDecider$ TriggeredPlayer | Execute$ TrigDraw | TriggerDescription$ At the beginning of each player's draw step, that player may draw an additional card. If they do, spells they cast this turn cost {2} more to cast +T:Mode$ Phase | Phase$ Draw | ValidPlayer$ Player | TriggerZones$ Battlefield | OptionalDecider$ TriggeredPlayer | Execute$ TrigDraw | TriggerDescription$ At the beginning of each player's draw step, that player may draw an additional card. If they do, spells they cast this turn cost {2} more to cast. SVar:TrigDraw:DB$ Draw | NumCards$ 1 | Defined$ TriggeredPlayer | RememberDrawn$ True | SubAbility$ DBEffect -SVar:DBEffect:DB$ Effect | ConditionDefined$ Remembered | ConditionPresent$ Card | Duration$ EndOfTurn | StaticAbilities$ RaiseCost | SubAbility$ DBCleanup | SpellDescription$ Spells they cast this turn cost {2} more to cast -SVar:RaiseCost:Mode$ RaiseCost | ValidCard$ Card.ActivePlayerCtrl | Type$ Spell | Amount$ 2 | Description$ Spells they cast this turn cost {2} more to cast +SVar:DBEffect:DB$ Effect | ConditionDefined$ Remembered | ConditionPresent$ Card | Duration$ EndOfTurn | StaticAbilities$ RaiseCost | SubAbility$ DBCleanup +SVar:RaiseCost:Mode$ RaiseCost | ValidCard$ Card.ActivePlayerCtrl | Type$ Spell | Amount$ 2 | Description$ Spells they cast this turn cost {2} more to cast. SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True -Oracle:At the beginning of each player's draw step, that player may draw an additional card. If they do, spells they cast this turn cost {2} more to cast +Oracle:At the beginning of each player's draw step, that player may draw an additional card. If they do, spells they cast this turn cost {2} more to cast. diff --git a/forge-gui/res/cardsfolder/b/bartered_cow.txt b/forge-gui/res/cardsfolder/b/bartered_cow.txt index 306ee01e996..c81014c01ad 100644 --- a/forge-gui/res/cardsfolder/b/bartered_cow.txt +++ b/forge-gui/res/cardsfolder/b/bartered_cow.txt @@ -2,8 +2,8 @@ Name:Bartered Cow ManaCost:3 W Types:Creature Ox PT:3/3 -T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Battlefield | Destination$ Graveyard | TriggerController$ TriggeredCardController | Execute$ TrigToken | TriggerDescription$ When CARDNAME dies or blocks you discard it, create a Food token. (It's an artifact with "{2}, {T}, Sacrifice this artifact: You gain 3 life.") -T:Mode$ Discarded | ValidCard$ Card.Self | Execute$ TrigToken | Secondary$ True | TriggerController$ TriggeredCardController | TriggerDescription$ When CARDNAME dies or blocks you discard it, create a Food token. (It's an artifact with "{2}, {T}, Sacrifice this artifact: You gain 3 life.") +T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Battlefield | Destination$ Graveyard | TriggerController$ TriggeredCardController | Execute$ TrigToken | TriggerDescription$ When CARDNAME dies or when you discard it, create a Food token. (It's an artifact with "{2}, {T}, Sacrifice this artifact: You gain 3 life.") +T:Mode$ Discarded | ValidCard$ Card.Self | Execute$ TrigToken | Secondary$ True | TriggerController$ TriggeredCardController | TriggerDescription$ When CARDNAME dies or when you discard it, create a Food token. (It's an artifact with "{2}, {T}, Sacrifice this artifact: You gain 3 life.") SVar:TrigToken:DB$ Token | TokenAmount$ 1 | TokenScript$ c_a_food_sac | TokenOwner$ You SVar:SacMe:1 SVar:DiscardMe:3 diff --git a/forge-gui/res/cardsfolder/g/gate_to_the_aether.txt b/forge-gui/res/cardsfolder/g/gate_to_the_aether.txt index 41e10748a6a..2ca8189afc6 100644 --- a/forge-gui/res/cardsfolder/g/gate_to_the_aether.txt +++ b/forge-gui/res/cardsfolder/g/gate_to_the_aether.txt @@ -1,7 +1,7 @@ Name:Gate to the Aether ManaCost:6 Types:Artifact -T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ Player | Execute$ TrigAetherDig | TriggerController$ TriggeredPlayer | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of each player's upkeep, that player reveals the top card of their library. If it's an artifact, creature, enchantment, or land card, the player may put it onto the battlefield. -SVar:TrigAetherDig:DB$ Dig | Defined$ TriggeredPlayer | DigNum$ 1 | Reveal$ True | DestinationZone$ Battlefield | DestinationZone2$ Library | LibraryPosition2$ 0 | ChangeNum$ 1 | Optional$ True | ChangeValid$ Artifact,Creature,Enchantment,Land +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ Player | Execute$ TrigAetherDig | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of each player's upkeep, that player reveals the top card of their library. If it's an artifact, creature, enchantment, or land card, the player may put it onto the battlefield. +SVar:TrigAetherDig:DB$ Dig | Defined$ TriggeredPlayer | Choser$ TriggeredPlayer | DigNum$ 1 | Reveal$ True | DestinationZone$ Battlefield | DestinationZone2$ Library | LibraryPosition2$ 0 | ChangeNum$ 1 | Optional$ True | ChangeValid$ Artifact,Creature,Enchantment,Land AI:RemoveDeck:Random Oracle:At the beginning of each player's upkeep, that player reveals the top card of their library. If it's an artifact, creature, enchantment, or land card, the player may put it onto the battlefield. diff --git a/forge-gui/res/cardsfolder/o/obzedat_ghost_council.txt b/forge-gui/res/cardsfolder/o/obzedat_ghost_council.txt index 8f1da8421b5..c1262308ae2 100644 --- a/forge-gui/res/cardsfolder/o/obzedat_ghost_council.txt +++ b/forge-gui/res/cardsfolder/o/obzedat_ghost_council.txt @@ -6,9 +6,8 @@ T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.S SVar:TrigDrain:DB$ LoseLife | ValidTgts$ Opponent | LifeAmount$ 2 | SubAbility$ DBGainLife SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ 2 T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigExile | OptionalDecider$ You | TriggerDescription$ At the beginning of your end step you may exile NICKNAME. If you do, return it to the battlefield under it's owner's control at the beginning of your next upkeep. It gains haste. -SVar:TrigExile:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | SubAbility$ DBDelaytrig -SVar:DBDelaytrig:DB$ Effect | Name$ Obzedat Effect | Triggers$ TrigEOT | RememberObjects$ Self | Duration$ Permanent -SVar:TrigEOT:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ ObzedatReturn | OneOff$ True | TriggerDescription$ Return CARDNAME to the battlefield under it's owner's control. It gains haste. -SVar:ObzedatReturn:DB$ ChangeZone | Defined$ Remembered | Origin$ Exile | Destination$ Battlefield | SubAbility$ ObzedatPump +SVar:TrigExile:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | RememberChanged$ True | SubAbility$ DelTrig +SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ ObzedatReturn | ConditionDefined$ Remembered | ConditionPresent$ Card | RememberObjects$ Remembered | TriggerDescription$ Return CARDNAME to the battlefield under its owner's control at the beginning of the next end step. +SVar:ObzedatReturn:DB$ ChangeZone | Defined$ DelayTriggerRememberedLKI | Origin$ Exile,Command | Destination$ Battlefield | SubAbility$ ObzedatPump SVar:ObzedatPump:DB$ Pump | Defined$ Remembered | KW$ Haste | Duration$ Permanent Oracle:When Obzedat, Ghost Council enters the battlefield, target opponent loses 2 life and you gain 2 life.\nAt the beginning of your end step, you may exile Obzedat. If you do, return it to the battlefield under its owner's control at the beginning of your next upkeep. It gains haste. diff --git a/forge-gui/res/cardsfolder/w/wild_evocation.txt b/forge-gui/res/cardsfolder/w/wild_evocation.txt index 1d00e3d27d6..d29161a75d3 100644 --- a/forge-gui/res/cardsfolder/w/wild_evocation.txt +++ b/forge-gui/res/cardsfolder/w/wild_evocation.txt @@ -4,7 +4,7 @@ Types:Enchantment T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ Player | Execute$ TrigEvoke | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of each player's upkeep, that player reveals a card at random from their hand. If it's a land card, the player puts it onto the battlefield. Otherwise, the player casts it without paying its mana cost if able. SVar:TrigEvoke:DB$ Reveal | Random$ True | RememberRevealed$ True | Defined$ TriggeredPlayer | SubAbility$ DBEvokeLand SVar:DBEvokeLand:DB$ ChangeZone | Origin$ Hand | Destination$ Battlefield | Defined$ ValidHand Land.IsRemembered | ForgetChanged$ True | SubAbility$ DBEvokePlay -SVar:DBEvokePlay:DB$ Play | ValidZone$ Hand | Controller$ TriggeredPlayer | Defined$ Remembered | WithoutManaCost$ True | SubAbility$ DBCleanup +SVar:DBEvokePlay:DB$ Play | ValidZone$ Hand | Controller$ TriggeredPlayer | Defined$ Remembered | ValidSA$ Spell | WithoutManaCost$ True | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True AI:RemoveDeck:Random Oracle:At the beginning of each player's upkeep, that player reveals a card at random from their hand. If it's a land card, the player puts it onto the battlefield. Otherwise, the player casts it without paying its mana cost if able.