From 436a3382b6e5c46c09c35709bb5669cc9d41fb4f Mon Sep 17 00:00:00 2001 From: TwentyToedToad Date: Wed, 2 Oct 2024 09:11:00 -0500 Subject: [PATCH] Sadistic Shell Game --- .../src/main/java/forge/game/GameActionUtil.java | 7 +------ .../java/forge/game/ability/SpellAbilityEffect.java | 9 ++++++--- .../forge/game/ability/effects/RepeatEachEffect.java | 12 +++--------- .../src/main/java/forge/game/player/Player.java | 2 +- .../adventure/common/custom_cards/farmers_tools.txt | 2 +- forge-gui/res/cardsfolder/a/alliance_of_arms.txt | 2 +- forge-gui/res/cardsfolder/c/collective_voyage.txt | 2 +- .../res/cardsfolder/d/disciple_of_caelus_nin.txt | 2 +- .../res/cardsfolder/d/druid_of_purification.txt | 7 +++---- forge-gui/res/cardsfolder/e/eureka.txt | 2 +- forge-gui/res/cardsfolder/f/fortunate_few.txt | 2 +- forge-gui/res/cardsfolder/h/hypergenesis.txt | 2 +- forge-gui/res/cardsfolder/l/liege_of_the_hollows.txt | 2 +- forge-gui/res/cardsfolder/m/mana_charged_dragon.txt | 2 +- forge-gui/res/cardsfolder/m/manifold_insights.txt | 2 +- forge-gui/res/cardsfolder/m/minds_aglow.txt | 2 +- forge-gui/res/cardsfolder/m/morphic_tide.txt | 2 +- forge-gui/res/cardsfolder/p/plague_of_vermin.txt | 2 +- forge-gui/res/cardsfolder/p/protection_racket.txt | 2 +- forge-gui/res/cardsfolder/r/reality_shaping.txt | 2 +- forge-gui/res/cardsfolder/s/shared_trauma.txt | 2 +- forge-gui/res/cardsfolder/t/the_horus_heresy.txt | 9 ++++----- forge-gui/res/cardsfolder/t/thieves_auction.txt | 2 +- .../res/cardsfolder/upcoming/sadistic_shell_game.txt | 6 ++++++ 24 files changed, 41 insertions(+), 45 deletions(-) create mode 100644 forge-gui/res/cardsfolder/upcoming/sadistic_shell_game.txt diff --git a/forge-game/src/main/java/forge/game/GameActionUtil.java b/forge-game/src/main/java/forge/game/GameActionUtil.java index 786067cd1d9..9d3bf408560 100644 --- a/forge-game/src/main/java/forge/game/GameActionUtil.java +++ b/forge-game/src/main/java/forge/game/GameActionUtil.java @@ -48,7 +48,6 @@ import forge.util.Lang; import forge.util.TextUtil; import org.apache.commons.lang3.StringUtils; -import java.util.Collections; import java.util.EnumSet; import java.util.List; import java.util.Map; @@ -832,12 +831,8 @@ public final class GameActionUtil { return list; } CardCollection completeList = new CardCollection(); - PlayerCollection players = new PlayerCollection(game.getPlayers()); // CR 613.7m use APNAP - int indexAP = players.indexOf(game.getPhaseHandler().getPlayerTurn()); - if (indexAP != -1) { - Collections.rotate(players, - indexAP); - } + PlayerCollection players = game.getPlayersInTurnOrder(game.getPhaseHandler().getPlayerTurn()); for (Player p : players) { CardCollection subList = new CardCollection(); for (Card c : list) { 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 5f145d9af5f..84e6e520fbf 100644 --- a/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java +++ b/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java @@ -279,6 +279,7 @@ public abstract class SpellAbilityEffect { return getPlayers(definedFirst, definedParam, sa, null); } private static PlayerCollection getPlayers(final boolean definedFirst, final String definedParam, final SpellAbility sa, List resultDuplicate) { + Game game = sa.getHostCard().getGame(); PlayerCollection resultUnique = null; final boolean useTargets = sa.usesTargeting() && (!definedFirst || !sa.hasParam(definedParam)); if (useTargets) { @@ -301,10 +302,12 @@ public abstract class SpellAbilityEffect { } // try sort in APNAP order - int indexAP = resultDuplicate.indexOf(sa.getHostCard().getGame().getPhaseHandler().getPlayerTurn()); - if (indexAP != -1) { - Collections.rotate(resultDuplicate, - indexAP); + Player starter = game.getPhaseHandler().getPlayerTurn(); + if (sa.hasParam("StartingWith")) { + starter = AbilityUtils.getDefinedPlayers(sa.getHostCard(), sa.getParam("StartingWith"), sa).getFirst(); } + PlayerCollection ordered = game.getPlayersInTurnOrder(starter); + resultDuplicate.sort(Comparator.comparingInt(ordered::indexOf)); return resultUnique; } diff --git a/forge-game/src/main/java/forge/game/ability/effects/RepeatEachEffect.java b/forge-game/src/main/java/forge/game/ability/effects/RepeatEachEffect.java index fbc6867964e..60954831ca0 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/RepeatEachEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/RepeatEachEffect.java @@ -56,8 +56,7 @@ public class RepeatEachEffect extends SpellAbilityEffect { } else { zone.add(ZoneType.Battlefield); } - repeatCards = CardLists.getValidCards(game.getCardsIn(zone), - sa.getParam("RepeatCards"), source.getController(), source, sa); + repeatCards = CardLists.getValidCards(game.getCardsIn(zone), sa.getParam("RepeatCards"), source.getController(), source, sa); } else if (sa.hasParam(("RepeatSpellAbilities"))) { repeatSas = Lists.newArrayList(); @@ -167,18 +166,13 @@ public class RepeatEachEffect extends SpellAbilityEffect { } if (sa.hasParam("RepeatPlayers")) { - final FCollection repeatPlayers = AbilityUtils.getDefinedPlayers(source, sa.getParam("RepeatPlayers"), sa); + final FCollection repeatPlayers = getDefinedPlayersOrTargeted(sa, "RepeatPlayers"); if (sa.hasParam("ClearRememberedBeforeLoop")) { source.clearRemembered(); } boolean optional = sa.hasParam("RepeatOptionalForEachPlayer"); boolean nextTurn = sa.hasParam("NextTurnForEachPlayer"); - if (sa.hasParam("StartingWithActivator")) { - int aidx = repeatPlayers.indexOf(activator); - if (aidx != -1) { - Collections.rotate(repeatPlayers, -aidx); - } - } + for (final Player p : repeatPlayers) { if (optional && !p.getController().confirmAction(repeat, null, sa.getParam("RepeatOptionalMessage"), null)) { continue; 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 4c53b7ac2d0..13815bbfd45 100644 --- a/forge-game/src/main/java/forge/game/player/Player.java +++ b/forge-game/src/main/java/forge/game/player/Player.java @@ -300,7 +300,7 @@ public class Player extends GameEntity implements Comparable { * Should keep player relations somewhere in the match structure */ public final PlayerCollection getOpponents() { - return game.getPlayers().filter(PlayerPredicates.isOpponentOf(this)); + return game.getPlayersInTurnOrder(this).filter(PlayerPredicates.isOpponentOf(this)); } public final PlayerCollection getRegisteredOpponents() { diff --git a/forge-gui/res/adventure/common/custom_cards/farmers_tools.txt b/forge-gui/res/adventure/common/custom_cards/farmers_tools.txt index c8a9df1e3c1..f7b586d5cbd 100644 --- a/forge-gui/res/adventure/common/custom_cards/farmers_tools.txt +++ b/forge-gui/res/adventure/common/custom_cards/farmers_tools.txt @@ -1,7 +1,7 @@ Name:Farmer's Tools ManaCost:no cost Types:Artifact -A:AB$ RepeatEach | Cost$ PayShards<2> | ActivationZone$ Command | RepeatSubAbility$ DBChangeZone | RepeatPlayers$ Player | SubAbility$ Eject | StartingWithActivator$ True | SpellDescription$ Starting with you, each player may put a land card from their hand onto the battlefield. Exile Farmer's Tools. +A:AB$ RepeatEach | Cost$ PayShards<2> | ActivationZone$ Command | RepeatSubAbility$ DBChangeZone | RepeatPlayers$ Player | SubAbility$ Eject | StartingWith$ You | SpellDescription$ Starting with you, each player may put a land card from their hand onto the battlefield. Exile Farmer's Tools. SVar:DBChangeZone:DB$ ChangeZone | Origin$ Hand | Destination$ Battlefield | ChangeType$ Land.RememberedPlayerCtrl | DefinedPlayer$ Player.IsRemembered | Chooser$ Player.IsRemembered | ChangeNum$ 1 | Hidden$ True SVar:Eject:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile Oracle:{M}{M}: Starting with you, each player may put a land card from their hand onto the battlefield. Exile Farmer's Tools. diff --git a/forge-gui/res/cardsfolder/a/alliance_of_arms.txt b/forge-gui/res/cardsfolder/a/alliance_of_arms.txt index 4f080fc6977..62eb062936d 100644 --- a/forge-gui/res/cardsfolder/a/alliance_of_arms.txt +++ b/forge-gui/res/cardsfolder/a/alliance_of_arms.txt @@ -1,7 +1,7 @@ Name:Alliance of Arms ManaCost:W Types:Sorcery -A:SP$ RepeatEach | RepeatPlayers$ Player | StartingWithActivator$ True | RepeatSubAbility$ DBPay | SubAbility$ DBToken | StackDescription$ SpellDescription | SpellDescription$ Join forces — Starting with you, each player may pay any amount of mana. Each player creates X 1/1 white Soldier creature tokens, where X is the total amount of mana paid this way. +A:SP$ RepeatEach | RepeatPlayers$ Player | StartingWith$ You | RepeatSubAbility$ DBPay | SubAbility$ DBToken | StackDescription$ SpellDescription | SpellDescription$ Join forces — Starting with you, each player may pay any amount of mana. Each player creates X 1/1 white Soldier creature tokens, where X is the total amount of mana paid this way. SVar:DBPay:DB$ ChooseNumber | Defined$ Player.IsRemembered | ChooseAnyNumber$ True | ListTitle$ amount of mana to pay | SubAbility$ DBStore SVar:DBStore:DB$ StoreSVar | SVar$ JoinForcesAmount | Type$ CountSVar | Expression$ JoinForcesAmount/Plus.Y | UnlessCost$ Y | UnlessPayer$ Player.IsRemembered | UnlessSwitched$ True | UnlessAI$ OnlyOwn SVar:DBToken:DB$ Token | TokenAmount$ JoinForcesAmount | TokenScript$ w_1_1_soldier | TokenOwner$ Player | StackDescription$ None diff --git a/forge-gui/res/cardsfolder/c/collective_voyage.txt b/forge-gui/res/cardsfolder/c/collective_voyage.txt index bac4c81bb2c..29a42406517 100644 --- a/forge-gui/res/cardsfolder/c/collective_voyage.txt +++ b/forge-gui/res/cardsfolder/c/collective_voyage.txt @@ -1,7 +1,7 @@ Name:Collective Voyage ManaCost:G Types:Sorcery -A:SP$ RepeatEach | RepeatPlayers$ Player | StartingWithActivator$ True | RepeatSubAbility$ DBPay | SubAbility$ DBSearch | StackDescription$ SpellDescription | SpellDescription$ Join forces — Starting with you, each player may pay any amount of mana. Each player searches their library for up to X basic land cards, where X is the total amount of mana paid this way, puts them onto the battlefield tapped, then shuffles. +A:SP$ RepeatEach | RepeatPlayers$ Player | StartingWith$ You | RepeatSubAbility$ DBPay | SubAbility$ DBSearch | StackDescription$ SpellDescription | SpellDescription$ Join forces — Starting with you, each player may pay any amount of mana. Each player searches their library for up to X basic land cards, where X is the total amount of mana paid this way, puts them onto the battlefield tapped, then shuffles. SVar:DBPay:DB$ ChooseNumber | Defined$ Player.IsRemembered | ChooseAnyNumber$ True | ListTitle$ amount of mana to pay | SubAbility$ DBStore SVar:DBStore:DB$ StoreSVar | SVar$ JoinForcesAmount | Type$ CountSVar | Expression$ JoinForcesAmount/Plus.Y | UnlessCost$ Y | UnlessPayer$ Player.IsRemembered | UnlessSwitched$ True | UnlessAI$ OnlyOwn SVar:DBSearch:DB$ ChangeZone | DefinedPlayer$ Player | ChangeType$ Land.Basic | ChangeNum$ JoinForcesAmount | Origin$ Library | Destination$ Battlefield | Tapped$ True | SubAbility$ DBReset | StackDescription$ None diff --git a/forge-gui/res/cardsfolder/d/disciple_of_caelus_nin.txt b/forge-gui/res/cardsfolder/d/disciple_of_caelus_nin.txt index 97616968a52..cc3419f16df 100644 --- a/forge-gui/res/cardsfolder/d/disciple_of_caelus_nin.txt +++ b/forge-gui/res/cardsfolder/d/disciple_of_caelus_nin.txt @@ -3,7 +3,7 @@ ManaCost:4 W Types:Creature Human Wizard PT:3/4 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigRepeatEach | TriggerDescription$ When CARDNAME enters, starting with you, each player chooses up to five permanents they control. All permanents other than CARDNAME that weren't chosen this way phase out. -SVar:TrigRepeatEach:DB$ RepeatEach | RepeatPlayers$ Player | StartingWithActivator$ True | RepeatSubAbility$ DBChoosePermanent | SubAbility$ DBPhaseOut +SVar:TrigRepeatEach:DB$ RepeatEach | RepeatPlayers$ Player | StartingWith$ You | RepeatSubAbility$ DBChoosePermanent | SubAbility$ DBPhaseOut SVar:DBChoosePermanent:DB$ ChooseCard | ChoiceTitle$ Choose up to five permanents you control | MinAmount$ 0 | Amount$ 5 | Defined$ Remembered | Choices$ Permanent.RememberedPlayerCtrl | RememberChosen$ True | AILogic$ NotSelf SVar:DBPhaseOut:DB$ Phases | AllValid$ Permanent.Other+IsNotRemembered | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearChosenCard$ True | ClearRemembered$ True diff --git a/forge-gui/res/cardsfolder/d/druid_of_purification.txt b/forge-gui/res/cardsfolder/d/druid_of_purification.txt index 482e53ecac5..7eae6bb131c 100644 --- a/forge-gui/res/cardsfolder/d/druid_of_purification.txt +++ b/forge-gui/res/cardsfolder/d/druid_of_purification.txt @@ -3,9 +3,8 @@ ManaCost:3 G Types:Creature Human Druid PT:2/3 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigChoice | TriggerDescription$ When CARDNAME enters, starting with you, each player may choose an artifact or enchantment you don't control. Destroy each permanent chosen this way. -SVar:TrigChoice:DB$ RepeatEach | RepeatPlayers$ Player | StartingWithActivator$ True | RepeatSubAbility$ DBChoosePermanent | SubAbility$ DBDestroy -SVar:DBChoosePermanent:DB$ ChooseCard | Defined$ Remembered | Choices$ Artifact.YouDontCtrl,Enchantment.YouDontCtrl | Optional$ True | ChoiceTitle$ Choose an artifact or enchantment | RememberChosen$ True -SVar:DBDestroy:DB$ Destroy | Defined$ Remembered | SubAbility$ DBCleanup -SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:TrigChoice:DB$ ChooseCard | Defined$ Player | StartingWith$ You | Choices$ Artifact.YouDontCtrl,Enchantment.YouDontCtrl | Optional$ True | ChoiceTitle$ Choose an artifact or enchantment | SubAbility$ DBDestroy +SVar:DBDestroy:DB$ Destroy | Defined$ ChosenCard | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearChosenCard$ True AI:RemoveDeck:Random Oracle:When Druid of Purification enters, starting with you, each player may choose an artifact or enchantment you don't control. Destroy each permanent chosen this way. diff --git a/forge-gui/res/cardsfolder/e/eureka.txt b/forge-gui/res/cardsfolder/e/eureka.txt index ff6889f5f55..0c5c29572bf 100644 --- a/forge-gui/res/cardsfolder/e/eureka.txt +++ b/forge-gui/res/cardsfolder/e/eureka.txt @@ -3,7 +3,7 @@ ManaCost:2 G G Types:Sorcery A:SP$ Repeat | RepeatSubAbility$ ResetCheck | RepeatCheckSVar$ NumPlayerGiveup | RepeatSVarCompare$ LTTotalPlayer | SubAbility$ FinalReset | StackDescription$ SpellDescription | SpellDescription$ Starting with you, each player may put a permanent card from their hand onto the battlefield. Repeat this process until no one puts a card onto the battlefield. SVar:ResetCheck:DB$ StoreSVar | SVar$ NumPlayerGiveup | Type$ Number | Expression$ 0 | SubAbility$ DBRepeatChoice -SVar:DBRepeatChoice:DB$ RepeatEach | StartingWithActivator$ True | RepeatSubAbility$ DBChoice | RepeatPlayers$ Player +SVar:DBRepeatChoice:DB$ RepeatEach | StartingWith$ You | RepeatSubAbility$ DBChoice | RepeatPlayers$ Player SVar:DBChoice:DB$ GenericChoice | Choices$ DBCheckHand,DBNoChange | Defined$ Player.IsRemembered SVar:DBCheckHand:DB$ StoreSVar | SVar$ NumPlayerGiveup | Type$ CountSVar | Expression$ NumPlayerGiveup/Plus.1 | ConditionCheckSVar$ CheckHand | ConditionSVarCompare$ EQ0 | SubAbility$ DBChoose | SpellDescription$ Choose a permanent to put onto the battlefield SVar:DBChoose:DB$ ChangeZone | DefinedPlayer$ Player.IsRemembered | Origin$ Hand | Destination$ Battlefield | ChangeType$ Permanent | ChangeNum$ 1 | ConditionCheckSVar$ CheckHand | ConditionSVarCompare$ GE1 diff --git a/forge-gui/res/cardsfolder/f/fortunate_few.txt b/forge-gui/res/cardsfolder/f/fortunate_few.txt index d39c590222d..27bb6b1ca43 100644 --- a/forge-gui/res/cardsfolder/f/fortunate_few.txt +++ b/forge-gui/res/cardsfolder/f/fortunate_few.txt @@ -1,7 +1,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. +A:SP$ RepeatEach | StartingWith$ You | 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+!RememberedPlayerCtrl+IsNotRemembered | RememberChosen$ True | ChoiceZone$ Battlefield | AILogic$ WorstCard SVar:DBDestroyAll:DB$ DestroyAll | ValidCards$ Permanent.nonLand+IsNotRemembered | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True diff --git a/forge-gui/res/cardsfolder/h/hypergenesis.txt b/forge-gui/res/cardsfolder/h/hypergenesis.txt index 35ccdfe5310..62dc901958a 100644 --- a/forge-gui/res/cardsfolder/h/hypergenesis.txt +++ b/forge-gui/res/cardsfolder/h/hypergenesis.txt @@ -5,7 +5,7 @@ Types:Sorcery K:Suspend:3:1 G G A:SP$ Repeat | RepeatSubAbility$ ResetCheck | RepeatCheckSVar$ NumPlayerGiveup | RepeatSVarCompare$ LTTotalPlayer | SubAbility$ FinalReset | StackDescription$ SpellDescription | SpellDescription$ Starting with you, each player may put an artifact, creature, enchantment, or land card from their hand onto the battlefield. Repeat this process until no one puts a card onto the battlefield. SVar:ResetCheck:DB$ StoreSVar | SVar$ NumPlayerGiveup | Type$ Number | Expression$ 0 | SubAbility$ DBRepeatChoice -SVar:DBRepeatChoice:DB$ RepeatEach | StartingWithActivator$ True | RepeatSubAbility$ DBChoice | RepeatPlayers$ Player +SVar:DBRepeatChoice:DB$ RepeatEach | StartingWith$ You | RepeatSubAbility$ DBChoice | RepeatPlayers$ Player SVar:DBChoice:DB$ GenericChoice | Choices$ DBCheckHand,DBNoChange | Defined$ Player.IsRemembered SVar:DBCheckHand:DB$ StoreSVar | SVar$ NumPlayerGiveup | Type$ CountSVar | Expression$ NumPlayerGiveup/Plus.1 | ConditionCheckSVar$ CheckHand | ConditionSVarCompare$ EQ0 | SubAbility$ DBChoose | SpellDescription$ Choose an artifact, creature, enchantment, or land card from your hand onto the battlefield SVar:DBChoose:DB$ ChangeZone | DefinedPlayer$ Player.IsRemembered | Origin$ Hand | Destination$ Battlefield | ChangeType$ Artifact,Creature,Enchantment,Land | ChangeNum$ 1 | ConditionCheckSVar$ CheckHand | ConditionSVarCompare$ GE1 diff --git a/forge-gui/res/cardsfolder/l/liege_of_the_hollows.txt b/forge-gui/res/cardsfolder/l/liege_of_the_hollows.txt index 71dd7229cf5..40553ef6370 100644 --- a/forge-gui/res/cardsfolder/l/liege_of_the_hollows.txt +++ b/forge-gui/res/cardsfolder/l/liege_of_the_hollows.txt @@ -3,7 +3,7 @@ ManaCost:2 G G Types:Creature Spirit PT:3/4 T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ RepeatPayment | TriggerDescription$ When CARDNAME dies, each player may pay any amount of mana. Then each player creates a number of 1/1 green Squirrel creature tokens equal to the amount of mana they paid this way. -SVar:RepeatPayment:DB$ RepeatEach | RepeatPlayers$ Player | StartingWithActivator$ True | ChangeZoneTable$ True | RepeatSubAbility$ DBPay | StackDescription$ When CARDNAME dies, each player may pay any amount of mana. Then each player creates a number of 1/1 green Squirrel creature tokens equal to the amount of mana they paid this way. +SVar:RepeatPayment:DB$ RepeatEach | RepeatPlayers$ Player | StartingWith$ You | ChangeZoneTable$ True | RepeatSubAbility$ DBPay | StackDescription$ When CARDNAME dies, each player may pay any amount of mana. Then each player creates a number of 1/1 green Squirrel creature tokens equal to the amount of mana they paid this way. SVar:DBPay:DB$ ChooseNumber | Defined$ Player.IsRemembered | ChooseAnyNumber$ True | ListTitle$ amount of mana to pay | AILogic$ MaxForAnyController | SubAbility$ DBToken # TODO: ideally the tokens should be created simultaneously after all the players have finished paying mana, but that's difficult to implement. SVar:DBToken:DB$ Token | TokenAmount$ X | TokenScript$ g_1_1_squirrel | TokenOwner$ Player.IsRemembered | UnlessCost$ Y | UnlessPayer$ Player.IsRemembered | UnlessSwitched$ True diff --git a/forge-gui/res/cardsfolder/m/mana_charged_dragon.txt b/forge-gui/res/cardsfolder/m/mana_charged_dragon.txt index 25931d10f07..047144bf6b5 100644 --- a/forge-gui/res/cardsfolder/m/mana_charged_dragon.txt +++ b/forge-gui/res/cardsfolder/m/mana_charged_dragon.txt @@ -6,7 +6,7 @@ K:Flying K:Trample T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigJoinForces | TriggerDescription$ Join forces — Whenever CARDNAME attacks or blocks, each player starting with you may pay any amount of mana. CARDNAME gets +X/+0 until end of turn, where X is the total amount of mana paid this way. T:Mode$ Blocks | ValidCard$ Card.Self | Execute$ TrigJoinForces | Secondary$ True | TriggerDescription$ Join forces — Whenever CARDNAME attacks or blocks, each player starting with you may pay any amount of mana. CARDNAME gets +X/+0 until end of turn, where X is the total amount of mana paid this way. -SVar:TrigJoinForces:DB$ RepeatEach | RepeatPlayers$ Player | StartingWithActivator$ True | RepeatSubAbility$ DBPay | SubAbility$ DBPump +SVar:TrigJoinForces:DB$ RepeatEach | RepeatPlayers$ Player | StartingWith$ You | RepeatSubAbility$ DBPay | SubAbility$ DBPump SVar:DBPay:DB$ ChooseNumber | Defined$ Player.IsRemembered | ChooseAnyNumber$ True | ListTitle$ amount of mana to pay | SubAbility$ DBStore SVar:DBStore:DB$ StoreSVar | SVar$ JoinForcesAmount | Type$ CountSVar | Expression$ JoinForcesAmount/Plus.Y | UnlessCost$ Y | UnlessPayer$ Player.IsRemembered | UnlessSwitched$ True | UnlessAI$ OnlyOwn SVar:DBPump:DB$ Pump | Defined$ Self | NumAtt$ JoinForcesAmount | SubAbility$ DBReset diff --git a/forge-gui/res/cardsfolder/m/manifold_insights.txt b/forge-gui/res/cardsfolder/m/manifold_insights.txt index 81a8f98ccdd..0758892e217 100644 --- a/forge-gui/res/cardsfolder/m/manifold_insights.txt +++ b/forge-gui/res/cardsfolder/m/manifold_insights.txt @@ -2,7 +2,7 @@ Name:Manifold Insights ManaCost:2 U Types:Sorcery A:SP$ PeekAndReveal | PeekAmount$ 10 | RevealValid$ Card | RememberRevealed$ True | SubAbility$ ChooseNonLand | SpellDescription$ Reveal the top ten cards of your library. Starting with the next opponent in turn order, each opponent chooses a different nonland card from among them. Put the chosen cards into your hand and the rest on the bottom of your library in a random order. -SVar:ChooseNonLand:DB$ RepeatEach | RepeatPlayers$ Player.Opponent | RepeatSubAbility$ OpponentsChoose | SubAbility$ ShipToBottom +SVar:ChooseNonLand:DB$ RepeatEach | RepeatPlayers$ Player.Opponent | StartingWith$ Opponent | RepeatSubAbility$ OpponentsChoose | SubAbility$ ShipToBottom SVar:OpponentsChoose:DB$ ChooseCard | ChoiceZone$ Library | Choices$ Card.nonLand+IsRemembered | Defined$ Player.IsRemembered | ForgetChosen$ True | SubAbility$ ChosenToHand SVar:ChosenToHand:DB$ ChangeZone | Origin$ Library | Destination$ Hand | Defined$ ChosenCard SVar:ShipToBottom:DB$ ChangeZoneAll | ChangeType$ Card.IsRemembered | Origin$ Library | Destination$ Library | LibraryPosition$ -1 | RandomOrder$ True | SubAbility$ DBCleanup diff --git a/forge-gui/res/cardsfolder/m/minds_aglow.txt b/forge-gui/res/cardsfolder/m/minds_aglow.txt index bda0d93f44a..0c734eb5066 100644 --- a/forge-gui/res/cardsfolder/m/minds_aglow.txt +++ b/forge-gui/res/cardsfolder/m/minds_aglow.txt @@ -1,7 +1,7 @@ Name:Minds Aglow ManaCost:U Types:Sorcery -A:SP$ RepeatEach | RepeatPlayers$ Player | StartingWithActivator$ True | RepeatSubAbility$ DBPay | SubAbility$ DBDraw | StackDescription$ SpellDescription | SpellDescription$ Join forces — Starting with you, each player may pay any amount of mana. Each player draws X cards, where X is the total amount of mana paid this way. +A:SP$ RepeatEach | RepeatPlayers$ Player | StartingWith$ You | RepeatSubAbility$ DBPay | SubAbility$ DBDraw | StackDescription$ SpellDescription | SpellDescription$ Join forces — Starting with you, each player may pay any amount of mana. Each player draws X cards, where X is the total amount of mana paid this way. SVar:DBPay:DB$ ChooseNumber | Defined$ Player.IsRemembered | ChooseAnyNumber$ True | ListTitle$ amount of mana to pay | SubAbility$ DBStore SVar:DBStore:DB$ StoreSVar | SVar$ JoinForcesAmount | Type$ CountSVar | Expression$ JoinForcesAmount/Plus.Y | UnlessCost$ Y | UnlessPayer$ Player.IsRemembered | UnlessSwitched$ True | UnlessAI$ OnlyOwn SVar:DBDraw:DB$ Draw | Defined$ Player | NumCards$ JoinForcesAmount | SubAbility$ DBReset | StackDescription$ None diff --git a/forge-gui/res/cardsfolder/m/morphic_tide.txt b/forge-gui/res/cardsfolder/m/morphic_tide.txt index fe65d16b233..daaf2f8f4ce 100644 --- a/forge-gui/res/cardsfolder/m/morphic_tide.txt +++ b/forge-gui/res/cardsfolder/m/morphic_tide.txt @@ -2,7 +2,7 @@ Name:Morphic Tide ManaCost:no cost Types:Phenomenon T:Mode$ PlaneswalkedTo | ValidCard$ Card.Self | Execute$ TrigPut | TriggerDescription$ When you encounter CARDNAME, each player shuffles all permanents they own into their library, then reveals that many cards from the top of their library. Each player puts all artifact, creature, land, and planeswalker cards revealed this way onto the battlefield, then does the same for enchantment cards, then puts all cards revealed this way that weren't put onto the battlefield on the bottom of their library in any order. (Then planeswalk away from this phenomenon.) -SVar:TrigPut:DB$ RepeatEach | StartingWithActivator$ True | RepeatPlayers$ Player | RepeatSubAbility$ DBShuffle | SubAbility$ ChangePermanent +SVar:TrigPut:DB$ RepeatEach | StartingWith$ You | RepeatPlayers$ Player | RepeatSubAbility$ DBShuffle | SubAbility$ ChangePermanent SVar:DBShuffle:DB$ ChangeZoneAll | ChangeType$ Permanent.RememberedPlayerOwn | Imprint$ True | Origin$ Battlefield | Destination$ Library | Shuffle$ True | SubAbility$ DBReveal SVar:DBReveal:DB$ PeekAndReveal | Defined$ Remembered | PeekAmount$ WarpX | NoPeek$ True | RememberRevealed$ True | SubAbility$ DBCleanImprint SVar:DBCleanImprint:DB$ Cleanup | ClearImprinted$ True diff --git a/forge-gui/res/cardsfolder/p/plague_of_vermin.txt b/forge-gui/res/cardsfolder/p/plague_of_vermin.txt index 6e52ad2ac50..8c4371d78e8 100644 --- a/forge-gui/res/cardsfolder/p/plague_of_vermin.txt +++ b/forge-gui/res/cardsfolder/p/plague_of_vermin.txt @@ -3,7 +3,7 @@ ManaCost:6 B Types:Sorcery A:SP$ Repeat | RepeatSubAbility$ DBResetCheck | RepeatCheckSVar$ NumPlayerGiveup | RepeatSVarCompare$ LTTotalPlayer | SubAbility$ DBRepeatToken | StackDescription$ REP you_{p:You} | SpellDescription$ Starting with you, each player may pay any amount of life. Repeat this process until no one pays life. Each player creates a 1/1 black Rat creature token for each 1 life they paid this way. SVar:DBResetCheck:DB$ StoreSVar | SVar$ NumPlayerGiveup | Type$ Number | Expression$ 0 | SubAbility$ DBRepeatChoice -SVar:DBRepeatChoice:DB$ RepeatEach | StartingWithActivator$ True | RepeatSubAbility$ DBChoice | RepeatPlayers$ Player +SVar:DBRepeatChoice:DB$ RepeatEach | StartingWith$ You | RepeatSubAbility$ DBChoice | RepeatPlayers$ Player SVar:DBChoice:DB$ ChooseNumber | Defined$ Remembered | Max$ LifeTotal | AILogic$ Vermin | ListTitle$ amount of life to pay | SubAbility$ DBCheckPaid SVar:DBCheckPaid:DB$ StoreSVar | SVar$ NumPlayerGiveup | Type$ CountSVar | Expression$ NumPlayerGiveup/Plus.1 | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ0 | SubAbility$ DBStore SVar:DBStore:DB$ StoreSVar | SVar$ EachPlayer | Type$ AdditiveForEach | Expression$ X | ConditionCheckSVar$ X | ConditionSVarCompare$ GE1 | UnlessCost$ PayLife | UnlessPayer$ Remembered | UnlessSwitched$ True | UnlessResolveSubs$ WhenNotPaid | SubAbility$ DBGiveUp | SpellDescription$ Pay the chosen amount of life. diff --git a/forge-gui/res/cardsfolder/p/protection_racket.txt b/forge-gui/res/cardsfolder/p/protection_racket.txt index 20a66c85bd1..2b177e11f52 100644 --- a/forge-gui/res/cardsfolder/p/protection_racket.txt +++ b/forge-gui/res/cardsfolder/p/protection_racket.txt @@ -2,7 +2,7 @@ Name:Protection Racket ManaCost:2 B Types:Enchantment T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigRepeat | TriggerDescription$ At the beginning of your upkeep, repeat the following process for each opponent in turn order. Reveal the top card of your library. That player may pay life equal to that card's mana value. If they do, exile that card. Otherwise, put it into your hand. -SVar:TrigRepeat:DB$ RepeatEach | RepeatPlayers$ Opponent | RepeatSubAbility$ DBReveal +SVar:TrigRepeat:DB$ RepeatEach | RepeatPlayers$ Opponent | StartingWith$ Opponent | RepeatSubAbility$ DBReveal SVar:DBReveal:DB$ PeekAndReveal | PeekAmount$ 1 | NoPeek$ True | RememberRevealed$ True | SubAbility$ DBExile SVar:DBExile:DB$ ChangeZone | UnlessCost$ PayLife | UnlessPayer$ Remembered | UnlessSwitched$ True | Defined$ Remembered | Origin$ Library | Destination$ Exile | ForgetChanged$ True | SubAbility$ DBChangeZone SVar:DBChangeZone:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Hand | ForgetChanged$ True diff --git a/forge-gui/res/cardsfolder/r/reality_shaping.txt b/forge-gui/res/cardsfolder/r/reality_shaping.txt index 745d771e073..88e550b3dd0 100644 --- a/forge-gui/res/cardsfolder/r/reality_shaping.txt +++ b/forge-gui/res/cardsfolder/r/reality_shaping.txt @@ -2,7 +2,7 @@ Name:Reality Shaping ManaCost:no cost Types:Phenomenon T:Mode$ PlaneswalkedTo | ValidCard$ Card.Self | Execute$ TrigPutFromHand | TriggerDescription$ When you encounter CARDNAME, starting with you, each player may put a permanent card from their hand onto the battlefield. (Then planeswalk away from this phenomenon.) -SVar:TrigPutFromHand:DB$ RepeatEach | StartingWithActivator$ True | RepeatPlayers$ Player | RepeatSubAbility$ DBChangeZone | SubAbility$ PWAway +SVar:TrigPutFromHand:DB$ RepeatEach | StartingWith$ You | RepeatPlayers$ Player | RepeatSubAbility$ DBChangeZone | SubAbility$ PWAway SVar:DBChangeZone:DB$ ChangeZone | DefinedPlayer$ Player.IsRemembered | Choser$ Player.IsRemembered | ChangeType$ Permanent | ChangeNum$ 1 | Origin$ Hand | Destination$ Battlefield SVar:PWAway:DB$ Planeswalk Oracle:When you encounter Reality Shaping, starting with you, each player may put a permanent card from their hand onto the battlefield. (Then planeswalk away from this phenomenon.) diff --git a/forge-gui/res/cardsfolder/s/shared_trauma.txt b/forge-gui/res/cardsfolder/s/shared_trauma.txt index 61bae722178..f4b92d126e5 100644 --- a/forge-gui/res/cardsfolder/s/shared_trauma.txt +++ b/forge-gui/res/cardsfolder/s/shared_trauma.txt @@ -1,7 +1,7 @@ Name:Shared Trauma ManaCost:B Types:Sorcery -A:SP$ RepeatEach | RepeatPlayers$ Player | StartingWithActivator$ True | RepeatSubAbility$ DBPay | SubAbility$ DBMill | StackDescription$ SpellDescription | SpellDescription$ Join forces — Starting with you, each player may pay any amount of mana. Each player mills X cards, where X is the total amount of mana paid this way. +A:SP$ RepeatEach | RepeatPlayers$ Player | StartingWith$ You | RepeatSubAbility$ DBPay | SubAbility$ DBMill | StackDescription$ SpellDescription | SpellDescription$ Join forces — Starting with you, each player may pay any amount of mana. Each player mills X cards, where X is the total amount of mana paid this way. SVar:DBPay:DB$ ChooseNumber | Defined$ Player.IsRemembered | ChooseAnyNumber$ True | ListTitle$ amount of mana to pay | SubAbility$ DBStore SVar:DBStore:DB$ StoreSVar | SVar$ JoinForcesAmount | Type$ CountSVar | Expression$ JoinForcesAmount/Plus.Y | UnlessCost$ Y | UnlessPayer$ Player.IsRemembered | UnlessSwitched$ True | UnlessAI$ OnlyOwn SVar:DBMill:DB$ Mill | Defined$ Player | NumCards$ JoinForcesAmount | SubAbility$ DBReset | StackDescription$ None diff --git a/forge-gui/res/cardsfolder/t/the_horus_heresy.txt b/forge-gui/res/cardsfolder/t/the_horus_heresy.txt index 8098a973e8c..8cde2e47372 100644 --- a/forge-gui/res/cardsfolder/t/the_horus_heresy.txt +++ b/forge-gui/res/cardsfolder/t/the_horus_heresy.txt @@ -1,13 +1,12 @@ Name:The Horus Heresy ManaCost:3 U B R Types:Enchantment Saga -K:Chapter:3:GainControl,DBDraw,DBRepeat +K:Chapter:3:GainControl,DBDraw,DBChoose SVar:GainControl:DB$ GainControl | ValidTgts$ Creature.nonLegendary+OppCtrl | LoseControl$ LeavesPlay | TgtPrompt$ Select target nonlegendary creature an opponent controls to gain control of. | TargetMin$ 0 | TargetMax$ OneEach | TargetsForEachPlayer$ True | SpellDescription$ For each opponent, gain control of up to one target nonlegendary creature that player controls for as long as CARDNAME remains on the battlefield. SVar:OneEach:PlayerCountOpponents$Amount SVar:DBDraw:DB$ Draw | Defined$ You | NumCards$ X | SpellDescription$ Draw a card for each creature you control but don't own. SVar:X:Count$Valid Creature.YouDontOwn+YouCtrl -SVar:DBRepeat:DB$ RepeatEach | RepeatPlayers$ Player | StartingWithActivator$ True | RepeatSubAbility$ DBChooseCreature | SubAbility$ DBDestroy | SpellDescription$ Starting with you, each player chooses a creature. Destroy each creature chosen this way. -SVar:DBChooseCreature:DB$ ChooseCard | Defined$ Remembered | Choices$ Creature | ChoiceTitle$ Choose a creature | Mandatory$ True | RememberChosen$ True -SVar:DBDestroy:DB$ Destroy | Defined$ Remembered | SubAbility$ DBCleanup -SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:DBChoose:DB$ ChooseCard | Defined$ Player | StartingWith$ You | Choices$ Creature | ChoiceTitle$ Choose a creature | Mandatory$ True | SpellDescription$ Starting with you, each player chooses a creature. Destroy each creature chosen this way. +SVar:DBDestroy:DB$ Destroy | Defined$ ChosenCard | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearChosenCard$ True Oracle:(As this Saga enters and after your draw step, add a lore counter. Sacrifice after III.)\nI — For each opponent, gain control of up to one target nonlegendary creature that player controls for as long as The Horus Heresy remains on the battlefield.\nII — Draw a card for each creature you control but don't own.\nIII — Starting with you, each player chooses a creature. Destroy each creature chosen this way. diff --git a/forge-gui/res/cardsfolder/t/thieves_auction.txt b/forge-gui/res/cardsfolder/t/thieves_auction.txt index 83361bd43c9..a12f2d7cd08 100644 --- a/forge-gui/res/cardsfolder/t/thieves_auction.txt +++ b/forge-gui/res/cardsfolder/t/thieves_auction.txt @@ -3,7 +3,7 @@ ManaCost:4 R R R Types:Sorcery A:SP$ ChangeZoneAll | ChangeType$ Permanent.nonToken | Origin$ Battlefield | Destination$ Exile | RememberChanged$ True | SubAbility$ DBRepeatChoose | StackDescription$ SpellDescription | SpellDescription$ Exile all nontoken permanents. Starting with you, each player chooses one of the exiled cards and puts it onto the battlefield tapped under their control. Repeat this process until all cards exiled this way have been chosen. SVar:DBRepeatChoose:DB$ Repeat | RepeatSubAbility$ DBRepeat | RepeatDefined$ Remembered | RepeatPresent$ Card | StackDescription$ None -SVar:DBRepeat:DB$ RepeatEach | StartingWithActivator$ True | RepeatPlayers$ Player | RepeatSubAbility$ DBChoose +SVar:DBRepeat:DB$ RepeatEach | StartingWith$ You | RepeatPlayers$ Player | RepeatSubAbility$ DBChoose SVar:DBChoose:DB$ ChooseCard | Defined$ Player.IsRemembered | Choices$ Card.IsRemembered | ForgetChosen$ True | ChoiceZone$ Exile | SubAbility$ DBGainControl SVar:DBGainControl:DB$ ChangeZone | Origin$ Exile | Destination$ Battlefield | Defined$ ChosenCard | GainControl$ Player.IsRemembered | Tapped$ True AI:RemoveDeck:All diff --git a/forge-gui/res/cardsfolder/upcoming/sadistic_shell_game.txt b/forge-gui/res/cardsfolder/upcoming/sadistic_shell_game.txt new file mode 100644 index 00000000000..ffcd3aa97a3 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/sadistic_shell_game.txt @@ -0,0 +1,6 @@ +Name:Sadistic Shell Game +ManaCost:4 B +Types:Sorcery +A:SP$ ChooseCard | Choices$ Creature.YouDontCtrl | Reveal$ True | Defined$ Player | StartingWith$ Opponent | Mandatory$ True | ChoiceTitle$ Choose a creature to destroy | AILogic$ OppPreferred | SubAbility$ DBDestroy | StackDescription$ SpellDescription | SpellDescription$ Starting with the next opponent in turn order, each player chooses a creature you don't control. Destroy the chosen creatures. +SVar:DBDestroy:DB$ DestroyAll | ValidCards$ Card.ChosenCard | StackDescription$ None +Oracle:Starting with the next opponent in turn order, each player chooses a creature you don't control. Destroy the chosen creatures. \ No newline at end of file