Skip to content

Commit 59ffff8

Browse files
committed
fix useFlashSuit and blueSuitShinecharge to lose both flash and blue
1 parent 5f2e1b5 commit 59ffff8

3 files changed

Lines changed: 97 additions & 3 deletions

File tree

rust/maprando/src/traverse.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,7 +2139,7 @@ fn apply_requirement_simple(
21392139
return SimpleResult::Failure;
21402140
}
21412141
if cx.reverse {
2142-
if local.flash_suit > 0 {
2142+
if local.flash_suit > 0 || local.blue_suit > 0 {
21432143
return SimpleResult::Failure;
21442144
}
21452145
local.flash_suit = 1;
@@ -2149,6 +2149,7 @@ fn apply_requirement_simple(
21492149
SimpleResult::Failure
21502150
} else {
21512151
local.flash_suit = 0;
2152+
local.blue_suit = 0;
21522153
// Set shinecharge frames remaining to the max, to allow `comeInShinecharged`
21532154
// strats to be satisfied by a flash suit.
21542155
// (And at least 1 shinecharge frame is required in order to satisfy a `shinespark` requirement.)
@@ -2210,7 +2211,7 @@ fn apply_requirement_simple(
22102211
return SimpleResult::Failure;
22112212
}
22122213
if cx.reverse {
2213-
if local.blue_suit != 0 {
2214+
if local.blue_suit > 0 || local.flash_suit > 0 {
22142215
return SimpleResult::Failure;
22152216
}
22162217
local.blue_suit = 1;
@@ -2220,6 +2221,7 @@ fn apply_requirement_simple(
22202221
SimpleResult::Failure
22212222
} else {
22222223
local.blue_suit = 0;
2224+
local.flash_suit = 0;
22232225
// Set shinecharge frames remaining to the max, to allow `comeInShinecharged`
22242226
// strats to be satisfied by a blue suit.
22252227
local.shinecharge_frames_remaining =

rust/maprando/tests/scenarios/blue-suit-shinecharge/scenarios.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,52 @@
2121
"endRoomId": 0,
2222
"endNodeId": 2,
2323
"fail": true
24+
},
25+
{
26+
"name": "Cannot Keep Blue Suit",
27+
"startRoomId": 0,
28+
"startNodeId": 1,
29+
"startState": {
30+
"blueSuit": 1
31+
},
32+
"endRoomId": 0,
33+
"endNodeId": 2,
34+
"endState": {
35+
"blueSuit": 1
36+
},
37+
"fail": true
38+
},
39+
{
40+
"name": "Lose Flash Suit",
41+
"startRoomId": 0,
42+
"startNodeId": 1,
43+
"startState": {
44+
"flashSuit": 1,
45+
"blueSuit": 1
46+
},
47+
"endRoomId": 0,
48+
"endNodeId": 2,
49+
"endState": {
50+
"flashSuit": 0,
51+
"blueSuit": 0
52+
},
53+
"reverse": "weak"
54+
},
55+
{
56+
"name": "Cannot Keep Flash Suit",
57+
"startRoomId": 0,
58+
"startNodeId": 1,
59+
"startState": {
60+
"flashSuit": 1,
61+
"blueSuit": 1
62+
},
63+
"endRoomId": 0,
64+
"endNodeId": 2,
65+
"endState": {
66+
"flashSuit": 1,
67+
"blueSuit": 0
68+
},
69+
"fail": true
2470
}
2571
]
2672
}

rust/maprando/tests/scenarios/flash-suit-use/scenarios.json

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,58 @@
1515
}
1616
},
1717
{
18-
"name": "Missing Flash Suit",
18+
"name": "Fail: Missing Flash Suit",
1919
"startRoomId": 0,
2020
"startNodeId": 1,
2121
"endRoomId": 0,
2222
"endNodeId": 2,
2323
"fail": true
24+
},
25+
{
26+
"name": "Fail: Cannot Keep Flash Suit",
27+
"startRoomId": 0,
28+
"startNodeId": 1,
29+
"startState": {
30+
"flashSuit": 1
31+
},
32+
"endRoomId": 0,
33+
"endNodeId": 2,
34+
"endState": {
35+
"flashSuit": 1
36+
},
37+
"fail": true
38+
},
39+
{
40+
"name": "Lose Blue Suit",
41+
"startRoomId": 0,
42+
"startNodeId": 1,
43+
"startState": {
44+
"flashSuit": 1,
45+
"blueSuit": 1
46+
},
47+
"endRoomId": 0,
48+
"endNodeId": 2,
49+
"endState": {
50+
"flashSuit": 0,
51+
"blueSuit": 0
52+
},
53+
"reverse": "weak"
54+
},
55+
{
56+
"name": "Fail: Cannot Keep Blue Suit",
57+
"startRoomId": 0,
58+
"startNodeId": 1,
59+
"startState": {
60+
"flashSuit": 1,
61+
"blueSuit": 1
62+
},
63+
"endRoomId": 0,
64+
"endNodeId": 2,
65+
"endState": {
66+
"flashSuit": 0,
67+
"blueSuit": 1
68+
},
69+
"fail": true
2470
}
2571
]
2672
}

0 commit comments

Comments
 (0)