jevsnes.git / third-party / c / patches / 0032-glove-gating-general.patch
0032-glove-gating-general.patch27 lines · 1.5 KB · raw
1--- a/third-party/c/zbanks-alttp/ap_plan.c
2+++ b/third-party/c/zbanks-alttp/ap_plan.c
3@@ -156,7 +156,23 @@
4         if (attrs & TILE_ATTR_BONK) {
5             ap_req_require(&goal->req, 0, REQUIREMENT_BOOTS);
6         }
7-        if (node->tile_attr == 0x55) {
8+        // Carried patch (jev): derive the glove requirement from the
9+        // tile's own LFT1/LFT2 bits (ap_snes.h: $52/$55 need the Power
10+        // Glove, $53/$56 the Titan's Mitt - this brain's own
11+        // alttp-ram-map.md, "Liftables, named and gated", agrees byte for
12+        // byte with usdasm's LiftableGloveLevels) instead of one hardcoded
13+        // tile id. `node->tile_attr == 0x55` only ever gated the big grey
14+        // rock: a small grey rock ($52, also LFT1) or EITHER black rock
15+        // ($53/$56, LFT2 - REQUIREMENT_GLOVES_2 already exists in
16+        // ap_req.h/ap_req_update and had no caller anywhere) scored
17+        // satisfiable with no gloves at all, the same
18+        // looks-satisfiable-but-is-not shape as 0013's big chest - the
19+        // user's own report ("the octagonal green stones need the gloves")
20+        // is this same family: impassable until gloves held, liftable
21+        // after. Evidence: research/zbanks-alttp.md, "Glove gating".
22+        if (attrs & TILE_ATTR_LFT2) {
23+            ap_req_require(&goal->req, 0, REQUIREMENT_GLOVES_2);
24+        } else if (attrs & TILE_ATTR_LFT1) {
25             ap_req_require(&goal->req, 0, REQUIREMENT_GLOVES_1);
26         }
27         if (strcmp(node->name, "door 0x24") == 0) {