Skip to content

Commit 1ac8034

Browse files
ampleyflyblkerby
authored andcommitted
Update strats.dm and tests to reflect change in bypassesDoorShell
bypassesDoorShell is changing from an enum with a combination of boolean and string values to one with only string values.
1 parent ec2d574 commit 1ac8034

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

strats.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ In all strats with an `exitCondition`, the `to` node of the strat must be a door
9595

9696
Each of these properties is described in more detail below.
9797

98-
A strat with an exit condition implicitly has a `doorUnlockedAtNode` requirement on its `to` node, unless it has the `bypassesDoorShell` property set to `true` or `"free"`. This means that if the `to` door has a lock on it, it must either be unlocked before the strat can be executed, or the door's requirements under the strat property `unlocksDoors` must be satisfied.
98+
A strat with an exit condition implicitly has a `doorUnlockedAtNode` requirement on its `to` node, unless it has the `bypassesDoorShell` property set to `"yes"` or `"free"`. This means that if the `to` door has a lock on it, it must either be unlocked before the strat can be executed, or the door's requirements under the strat property `unlocksDoors` must be satisfied.
9999

100100
### Leave Normally
101101

@@ -1774,9 +1774,9 @@ A `gModeRegainMobility` object has no properties.
17741774
## Bypasses Door Shell
17751775

17761776
A `bypassesDoorShell` property on a strat indicates that Samus can leave through the door transition in the `to` node
1777-
without first unlocking or opening the door. For this to be valid, the `to` node must have `"nodeType": "door"`. This can be used even for doors that are easy to open (e.g. blue doors), to support randomizers that may alter door colors. A strat with `"bypassesDoorShell": true` may also have an exit condition, but it is not required to have one.
1777+
without first unlocking or opening the door. For this to be valid, the `to` node must have `"nodeType": "door"`. This can be used even for doors that are easy to open (e.g. blue doors), to support randomizers that may alter door colors. A strat with `"bypassesDoorShell": "yes"` may also have an exit condition, but it is not required to have one.
17781778

1779-
A strat with `"bypassesDoorShell": true` has an implicit tech requirement of `canSkipDoorLock`, whereas one with `"bypassesDoorShell": "free"` does not.
1779+
A strat with `"bypassesDoorShell": "yes"` has an implicit tech requirement of `canSkipDoorLock`, whereas one with `"bypassesDoorShell": "free"` does not.
17801780

17811781
### Example
17821782
```json
@@ -1785,7 +1785,7 @@ A strat with `"bypassesDoorShell": true` has an implicit tech requirement of `ca
17851785
"requires": [
17861786
"canWallIceClip"
17871787
],
1788-
"bypassesDoorShell": true
1788+
"bypassesDoorShell": "yes"
17891789
}
17901790
```
17911791

@@ -1809,7 +1809,7 @@ An `unlocksDoors` array lists possibilities of doors that can be unlocked as par
18091809
- For "gadoraMissiles", the implicit requirement is `{"ammo": {"type": "Missile", "count": 3}}`.
18101810
- For "gadoraSuper", the implicit requirement is `{"ammo": {"type": "Super", "count": 1}}`.
18111811

1812-
In general the `requires` in an `unlocksDoors` object do not need to be satisfied in order to perform the strat; if satisfied, they provide a way to unlock the door. However, if the strat has a [`doorUnlockedAtNode`](logicalRequirements.md#doorunlockedatnode-object) requirement and the door is locked, then these requirements become part of the strat requirements; this applies, in particular, if the strat has an exit condition, in which case there is an implicit `doorUnlockedAtNode` requirement on the destination door except if [`bypassesDoorShell`](strats.md#bypasses-door-shell) is set to `true` or `"free"`.
1812+
In general the `requires` in an `unlocksDoors` object do not need to be satisfied in order to perform the strat; if satisfied, they provide a way to unlock the door. However, if the strat has a [`doorUnlockedAtNode`](logicalRequirements.md#doorunlockedatnode-object) requirement and the door is locked, then these requirements become part of the strat requirements; this applies, in particular, if the strat has an exit condition, in which case there is an implicit `doorUnlockedAtNode` requirement on the destination door except if [`bypassesDoorShell`](strats.md#bypasses-door-shell) is set to `"yes"` or `"free"`.
18131813

18141814
If an `unlocksDoors` property is not specified, then it is assumed to be an empty array. If a strat has any `doorUnlockedAtNode` requirements (including an implicit one based on having an exit condition without a `bypassesDoorShell`), then the `unlocksDoors` property should be specified explicitly and include items for each of the three possible types "missiles", "super", and "powerbomb" (or the catch-all "any") for each applicable node. The only exception is if the strat has no entrance condition then the starting node of the strat does not need to be included in the `unlocksDoors` property; in this case, the door could be unlocked immediately prior to the strat being executed (e.g. by an implicit unlock strat; see below), so generally it would not be necessary to describe how to unlock it as part of the strat. Where applicable, cases should be included for all three main types of door unlock methods, "missiles", "super", and "powerbomb" (or using "ammo" as a catch-all), in order to support randomizers which may modify the door colors. Currently the inclusion of "gadoraMissiles" and "gadoraSuper" are optional, and cross-room strats going through them are not usable unless the door has previously been unlocked.
18151815

tests/asserts/keywords.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,11 @@ def find_door_unlocked_nodes(strat, node_subtype, nodes_without_implicit_unlocks
274274
nodes = find_door_unlocked_nodes_rec(strat["requires"])
275275
from_node = strat["link"][0]
276276
to_node = strat["link"][1]
277-
if "exitCondition" in strat and strat.get("bypassesDoorShell") not in [True, "free"] and node_subtype not in ["elevator", "doorway", "sandpit", "passage"]:
277+
if "exitCondition" in strat and strat.get("bypassesDoorShell") not in ["yes", "free"] and node_subtype not in ["elevator", "doorway", "sandpit", "passage"]:
278278
nodes.add(to_node)
279279
if "entranceCondition" not in strat and from_node in nodes:
280280
nodes.remove(from_node)
281-
if to_node in nodes_without_implicit_unlocks and strat.get("bypassesDoorShell") not in [True, "free"] and "gModeRegainMobility" not in strat:
281+
if to_node in nodes_without_implicit_unlocks and strat.get("bypassesDoorShell") not in ["yes", "free"] and "gModeRegainMobility" not in strat:
282282
nodes.add(to_node)
283283
return nodes
284284

@@ -1133,7 +1133,7 @@ def make_or(reqs):
11331133
# Regain mobility strats also take place entirely in G-mode.
11341134
pass
11351135
elif "comeInWithGrappleTeleport" in strat.get("entranceCondition", []) and \
1136-
strat.get("bypassesDoorShell") in [True, "free"]:
1136+
strat.get("bypassesDoorShell") in ["yes", "free"]:
11371137
# Strats that use a grapple teleport to bypass a door lock can be done without heat damage,
11381138
# since the door transition is touched immediately.
11391139
pass
@@ -1260,7 +1260,7 @@ def speed_err_fn(msg):
12601260
msg = f"🔴ERROR: Door unlocked requirement for node {node}, type {t}, is not covered in `unlocksDoors`:{stratRef}"
12611261
messages["reds"].append(msg)
12621262
messages["counts"]["reds"] += 1
1263-
if strat.get("bypassesDoorShell") in [True, "free"]:
1263+
if strat.get("bypassesDoorShell") in ["yes", "free"]:
12641264
if node_lookup[toNode]["nodeType"] != "door":
12651265
msg = f"🔴ERROR: Strat has bypassesDoorShell but To Node is not door:{stratRef}"
12661266
messages["reds"].append(msg)

0 commit comments

Comments
 (0)