From cb4e0e5721356816c9399f21e1a7d0c265c46b9d Mon Sep 17 00:00:00 2001 From: tool4ever Date: Fri, 27 Sep 2024 18:59:27 +0200 Subject: [PATCH] Some cleanup (#6209) --- .../src/main/java/forge/game/card/CardProperty.java | 11 ----------- .../res/cardsfolder/c/choose_your_champion.txt | 2 +- forge-gui/res/cardsfolder/f/fortunate_few.txt | 2 +- forge-gui/res/cardsfolder/k/keen_duelist.txt | 13 +++++-------- .../main/java/forge/gui/card/CardScriptParser.java | 3 +-- 5 files changed, 8 insertions(+), 23 deletions(-) diff --git a/forge-game/src/main/java/forge/game/card/CardProperty.java b/forge-game/src/main/java/forge/game/card/CardProperty.java index d8649bd4ebc..cccbaac5d86 100644 --- a/forge-game/src/main/java/forge/game/card/CardProperty.java +++ b/forge-game/src/main/java/forge/game/card/CardProperty.java @@ -292,17 +292,6 @@ public static boolean cardHasProperty(Card card, String property, Player sourceC if (!source.isRemembered(p)) { return false; } - } else if (property.startsWith("nonRememberedPlayerCtrl")) { - if (!source.hasRemembered()) { - final Card newCard = game.getCardState(source); - if (newCard.isRemembered(controller)) { - return false; - } - } - - if (source.isRemembered(controller)) { - return false; - } } else if (property.equals("targetedBy")) { if (!(spellAbility instanceof SpellAbility)) { return false; diff --git a/forge-gui/res/cardsfolder/c/choose_your_champion.txt b/forge-gui/res/cardsfolder/c/choose_your_champion.txt index 43e11ba6009..3a2eff44e61 100644 --- a/forge-gui/res/cardsfolder/c/choose_your_champion.txt +++ b/forge-gui/res/cardsfolder/c/choose_your_champion.txt @@ -4,6 +4,6 @@ Types:Scheme T:Mode$ SetInMotion | ValidCard$ Card.Self | Execute$ ChooseChampion | TriggerZones$ Command | TriggerDescription$ When you set this scheme in motion, target opponent chooses a player. Until your next turn, only you and the chosen player can cast spells and attack with creatures. SVar:ChooseChampion:DB$ ChoosePlayer | ValidTgts$ Opponent | Choices$ Player | AILogic$ BestAllyBoardPosition | SubAbility$ PrepChamps SVar:PrepChamps:DB$ Effect | RememberObjects$ ChosenPlayer,You | Name$ Choose Your Champion Scheme | Duration$ UntilYourNextTurn | StaticAbilities$ RestrictAttackers,RestrictCasting -SVar:RestrictAttackers:Mode$ CantAttack | EffectZone$ Command | ValidCard$ Creature.nonRememberedPlayerCtrl | Description$ Until your next turn, only you and the chosen player can attack with creatures. +SVar:RestrictAttackers:Mode$ CantAttack | EffectZone$ Command | ValidCard$ Creature.!RememberedPlayerCtrl | Description$ Until your next turn, only you and the chosen player can attack with creatures. SVar:RestrictCasting:Mode$ CantBeCast | ValidCard$ Card | Caster$ Player.IsNotRemembered | EffectZone$ Command | Description$ Until your next turn, only you and the chosen player can cast spells. Oracle:When you set this scheme in motion, target opponent chooses a player. Until your next turn, only you and the chosen player can cast spells and attack with creatures. diff --git a/forge-gui/res/cardsfolder/f/fortunate_few.txt b/forge-gui/res/cardsfolder/f/fortunate_few.txt index e6874990823..d39c590222d 100644 --- a/forge-gui/res/cardsfolder/f/fortunate_few.txt +++ b/forge-gui/res/cardsfolder/f/fortunate_few.txt @@ -2,7 +2,7 @@ Name:Fortunate Few ManaCost:3 W W Types:Sorcery A:SP$ RepeatEach | StartingWithActivator$ True | RepeatPlayers$ Player | RepeatSubAbility$ DBChoose | SubAbility$ DBDestroyAll | SpellDescription$ Choose a nonland permanent you don't control, then each other player chooses a nonland permanent they don't control that hasn't been chosen this way. Destroy all other nonland permanents. -SVar:DBChoose:DB$ ChooseCard | Defined$ Player.IsRemembered | Choices$ Permanent.nonLand+nonRememberedPlayerCtrl+IsNotRemembered | RememberChosen$ True | ChoiceZone$ Battlefield | AILogic$ WorstCard +SVar:DBChoose:DB$ ChooseCard | Defined$ Player.IsRemembered | Choices$ Permanent.nonLand+!RememberedPlayerCtrl+IsNotRemembered | RememberChosen$ True | ChoiceZone$ Battlefield | AILogic$ WorstCard SVar:DBDestroyAll:DB$ DestroyAll | ValidCards$ Permanent.nonLand+IsNotRemembered | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True Oracle:Choose a nonland permanent you don't control, then each other player chooses a nonland permanent they don't control that hasn't been chosen this way. Destroy all other nonland permanents. diff --git a/forge-gui/res/cardsfolder/k/keen_duelist.txt b/forge-gui/res/cardsfolder/k/keen_duelist.txt index c2857ad4526..b9737f76f5e 100644 --- a/forge-gui/res/cardsfolder/k/keen_duelist.txt +++ b/forge-gui/res/cardsfolder/k/keen_duelist.txt @@ -2,14 +2,11 @@ Name:Keen Duelist ManaCost:1 B Types:Creature Human Wizard PT:2/2 -T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigRepeatEach | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, you and target opponent each reveal the top card of your library. You each lose life equal to the mana value of the card revealed by the other player. You each put the card you revealed into your hand. -SVar:TrigRepeatEach:DB$ RepeatEach | ValidTgts$ Opponent | TgtPrompt$ Select target opponent | RepeatPlayers$ TargetedAndYou | RepeatSubAbility$ DBReveal | SubAbility$ DBRepeatEach -SVar:DBReveal:DB$ Dig | Defined$ Player.IsRemembered | DigNum$ 1 | Reveal$ True | ChangeNum$ All | ChangeValid$ Card | DestinationZone$ Library | RememberChanged$ True -SVar:DBRepeatEach:DB$ RepeatEach | RepeatPlayers$ TargetedAndYou | RepeatSubAbility$ DBImprint | SubAbility$ DBChangeZoneAll -SVar:DBImprint:DB$ Pump | ImprintCards$ ValidAll Card.IsRemembered+nonRememberedPlayerCtrl | SubAbility$ DBLoseLife -SVar:DBLoseLife:DB$ LoseLife | Defined$ Player.IsRemembered | LifeAmount$ X | SubAbility$ DBClearImprint -SVar:DBClearImprint:DB$ Cleanup | ClearImprinted$ True +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigReveal | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, you and target opponent each reveal the top card of your library. You each lose life equal to the mana value of the card revealed by the other player. You each put the card you revealed into your hand. +SVar:TrigReveal:DB$ PeekAndReveal | NoPeek$ True | ValidTgts$ Opponent | Defined$ TargetedAndYou | RememberRevealed$ True | SubAbility$ DBRepeatEach +SVar:DBRepeatEach:DB$ RepeatEach | RepeatPlayers$ TargetedAndYou | RepeatSubAbility$ DBLoseLife | SubAbility$ DBChangeZoneAll +SVar:DBLoseLife:DB$ LoseLife | Defined$ Player.IsRemembered | LifeAmount$ X SVar:DBChangeZoneAll:DB$ ChangeZoneAll | ChangeType$ Card.IsRemembered | Origin$ Library | Destination$ Hand | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True -SVar:X:Imprinted$CardManaCost +SVar:X:Count$ValidLibrary Card.IsRemembered+!RememberedPlayerCtrl$CardManaCost Oracle:At the beginning of your upkeep, you and target opponent each reveal the top card of your library. You each lose life equal to the mana value of the card revealed by the other player. You each put the card you revealed into your hand. diff --git a/forge-gui/src/main/java/forge/gui/card/CardScriptParser.java b/forge-gui/src/main/java/forge/gui/card/CardScriptParser.java index d776f1d4e8b..a65dd2873cf 100644 --- a/forge-gui/src/main/java/forge/gui/card/CardScriptParser.java +++ b/forge-gui/src/main/java/forge/gui/card/CardScriptParser.java @@ -445,8 +445,7 @@ private static boolean isValidLegal(final String valid) { "YouDontCtrl", "OppCtrl", "ChosenCtrl", "DefenderCtrl", "DefenderCtrlForRemembered", "DefendingPlayerCtrl", "EnchantedPlayerCtrl", "EnchantedControllerCtrl", - "RememberedPlayer", "RememberedPlayerCtrl", - "nonRememberedPlayerCtrl", "TargetedPlayerCtrl", + "RememberedPlayer", "RememberedPlayerCtrl", "TargetedPlayerCtrl", "TargetedControllerCtrl", "ActivePlayerCtrl", "YouOwn", "YouDontOwn", "OppOwn", "TargetedPlayerOwn", "OwnerDoesntControl", "Other", "Self",