11package archipelago .traps .games ;
22
3+ import archipelago .substates .InfoPanelSubstate ;
34import archipelago .traps .TrapDeathHandler ;
45import flixel .FlxG ;
56import flixel .text .FlxText ;
@@ -33,6 +34,10 @@ class APUnoTrapState extends UnoTestState {
3334 }
3435
3536 override function create () {
37+
38+ if (! archipelago. APEntryState .inArchipelagoMode )
39+ throw " Error: APUnoTrapState can only be used in Archipelago mode!" ;
40+
3641 super .create ();
3742
3843 // Add trap warning UI
@@ -114,6 +119,10 @@ class APUnoTrapState extends UnoTestState {
114119 }
115120
116121 trace (" AP UNO trap game initialized successfully with randomized rules" );
122+
123+ // Show rules info after setup is complete
124+ showRulesInfoPanel ();
125+
117126 } catch (e : Dynamic ) {
118127 trace (" Error initializing AP UNO trap game: " + e );
119128 updateInstructionText (" Error initializing trap game: " + Std .string (e ));
@@ -124,7 +133,7 @@ class APUnoTrapState extends UnoTestState {
124133 // Randomly enable/disable various UNO rules for challenge
125134 UnoRules .ALLOW_STACKING = FlxG .random .bool (60 ); // 60% chance for stacking
126135 UnoRules .ALLOW_JUMP_IN = FlxG .random .bool (30 ); // 30% chance for jump-in
127- UnoRules .DRAW_UNTIL_PLAYABLE = false ; // 0 % chance because OH MY GOD is this awful sometimes
136+ UnoRules .DRAW_UNTIL_PLAYABLE = FlxG . random . bool ( 1 ) ; // 1 % chance because OH MY GOD is this awful sometimes
128137 UnoRules .PROGRESSIVE_UNO = FlxG .random .bool (20 ); // 20% chance for progressive UNO
129138 UnoRules .SEVEN_ZERO_RULE = FlxG .random .bool (40 ); // 40% chance for 7-0 rule
130139 UnoRules .WILD_DRAW_FOUR_CHALLENGE = FlxG .random .bool (80 ); // 80% chance for challenges
@@ -182,4 +191,37 @@ class APUnoTrapState extends UnoTestState {
182191 updateInstructionText (" TRAP ACTIVE! Win this round with randomized rules or die!" );
183192 }
184193 }
194+
195+ private function showRulesInfoPanel (): Void {
196+ // Build rules information string
197+ var rulesInfo = " RANDOMIZED UNO RULES FOR THIS TRAP:\n\n " ;
198+
199+ rulesInfo + = " • Stacking: " + (UnoRules .ALLOW_STACKING ? " ENABLED" : " DISABLED" ) + " \n " ;
200+ rulesInfo + = " (Play stacking force draw cards.)\n\n " ;
201+
202+ rulesInfo + = " • Jump-In: " + (UnoRules .ALLOW_JUMP_IN ? " ENABLED" : " DISABLED" ) + " \n " ;
203+ rulesInfo + = " (Play identical card out of turn)\n\n " ;
204+
205+ rulesInfo + = " • Draw Until Playable: " + (UnoRules .DRAW_UNTIL_PLAYABLE ? " ENABLED" : " DISABLED" ) + " \n " ;
206+ rulesInfo + = " (Keep drawing until you can play)\n\n " ;
207+
208+ rulesInfo + = " • Progressive UNO: " + (UnoRules .PROGRESSIVE_UNO ? " ENABLED" : " DISABLED" ) + " \n " ;
209+ rulesInfo + = " (Must keep saying 'UNO' when down to one card)\n\n " ;
210+
211+ rulesInfo + = " • Seven-Zero Rule: " + (UnoRules .SEVEN_ZERO_RULE ? " ENABLED" : " DISABLED" ) + " \n " ;
212+ rulesInfo + = " (7=swap hands, 0=rotate hands)\n\n " ;
213+
214+ rulesInfo + = " • Wild Draw Four Challenge: " + (UnoRules .WILD_DRAW_FOUR_CHALLENGE ? " ENABLED" : " DISABLED" ) + " \n " ;
215+ rulesInfo + = " (Challenge illegal Wild Draw Four plays)\n\n " ;
216+
217+ rulesInfo + = " • Any Plus Stacking: " + (UnoRules .ALLOW_ANY_PLUS_STACK ? " ENABLED" : " DISABLED" ) + " \n " ;
218+ rulesInfo + = " (Stack any draw cards together)\n\n " ;
219+
220+ rulesInfo + = " Winning Score: " + UnoRules .WINNING_SCORE + " points\n\n " ;
221+ rulesInfo + = " Remember: You MUST win to survive this trap!" ;
222+
223+ // Create and open the info panel
224+ var infoPanel = new InfoPanelSubstate (" UNO TRAP RULES" , rulesInfo , FlxColor .RED );
225+ openSubState (infoPanel );
226+ }
185227}
0 commit comments