clone

a browser grid puzzle game where you push words around to rewrite the rules of each level

fix(engine): resolve self win after settled hazards

Dami committed 52483d9
commit
52483d92ecd1c812bcd17de47a76aaf5aceba6d1
parent
c6022a1d7b85d238095f013e94176abc4758a7d6
author
Dami <dami.etoile@gmail.com>
3 files changed, +44 -4
Mdocs/design-backbone.md14+++++++++++---
Msrc/engine.js9++++++++-
Mtests/engine.test.js25+++++++++++++++++++++++++
M docs/design-backbone.md +11 -3
@@ -153,9 +153,13 @@ observable for debugging and deterministic for mods.
153153 a new deterministic substep, then re-run rule and interaction phases if154154 they changed text or occupancy. Cap cascading substeps and report a cycle.155155 9. **Evaluate goals.** Evaluate `WIN` and mod goals against the settled state.156- If both win and defeat occur in a turn, use the explicit goal policy (the157- recommended default is defeat before win unless the level opts into158- “reaching win ends immediately”).156+ A surviving object with both `YOU` and `WIN` satisfies the goal by itself;157+ a `YOU` object and a distinct `WIN` object satisfy it when they share a158+ cell. Evaluate this after `SINK` and `DEFEAT` removals. If both win and159+ defeat occur in a turn, use the explicit goal policy (the recommended160+ default is defeat before win unless the level opts into “reaching win ends161+ immediately”). This self-win behavior is supported by Hempuli's patch note162+ for `EMPTY IS YOU AND WIN AND DEFEAT` ([official patch notes](https://www.hempuli.com/blog/index.php?page=8)).159163 10. **Commit presentation.** Emit a replay event list, sound/effect cues, and160164 text highlighting. Rendering and particles must not mutate simulation161165 state.
@@ -248,3 +252,7 @@ and limited player access to the worst cases, while treating `IF` as not worth
248252 the implementation pain at that stage ([GDC talk PDF](https://media.gdcvault.com/gdc2020/presentations/Reading%20the%20rules_Teikari_Arvi.pdf), pp. 19–21).249253 That is a useful product constraint: keep the grammar deliberately small and250254 make quirky extensions opt-in and testable.255+256+## Sources257+258+- Hempuli, [official Baba Is You patch notes](https://www.hempuli.com/blog/index.php?page=8), documenting the `EMPTY IS YOU AND WIN AND DEFEAT` win-condition fix.
M src/engine.js +8 -1
M tests/engine.test.js +25 -0