Skip to content

Commit 8139666

Browse files
committed
w
1 parent c3df644 commit 8139666

File tree

3 files changed

+50
-4
lines changed

3 files changed

+50
-4
lines changed

source/archipelago/traps/games/APPongTrapState.hx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ class APPongTrapState extends PongGameState {
3838
}
3939

4040
override function create() {
41+
42+
if (!archipelago.APEntryState.inArchipelagoMode)
43+
throw "Error: APPongTrapState can only be used in Archipelago mode!";
44+
4145
super.create();
4246

4347
// Configure trap-specific settings

source/archipelago/traps/games/APUnoTrapState.hx

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package archipelago.traps.games;
22

3+
import archipelago.substates.InfoPanelSubstate;
34
import archipelago.traps.TrapDeathHandler;
45
import flixel.FlxG;
56
import 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
}

source/games/uno/UnoTestState.hx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,11 +473,11 @@ class UnoTestState extends MusicBeatState {
473473
updatePlayerInfoDisplay();
474474

475475
var oneCardLeft:Int = 0;
476-
for (player in unoGame.players) {
477-
if (player.hand.cards.length == 1) {
476+
477+
if (unoGame.gameState.hasPlayerCloseToWinning()) {
478478
oneCardLeft++;
479479
}
480-
}
480+
481481
if (oneCardLeft > 0 && !onLastCard) {
482482
FlxTween.num(1, 0, 1, {ease: FlxEase.sineInOut}, function(value:Float)
483483
{

0 commit comments

Comments
 (0)