Commit Graph

343 Commits

Author SHA1 Message Date
Eevee (Evelyn Woods)
626d146375 Add explicit support in the level for sokoban buttons
Gets a lot of junk out of the sokoban buttons' implementations.

Also, undo closures are gone now!
2024-05-06 14:07:35 -06:00
Eevee (Evelyn Woods)
3c7b8948ae Remove the undo closure for failing the level 2024-05-06 13:41:29 -06:00
Eevee (Evelyn Woods)
d1f0ac4956 Simplify wire phase undo
Turns out we don't really need to store these changes to tile power at
all; they can be rederived from circuit power.

One more undo closure gone.
2024-05-06 13:37:34 -06:00
Eevee (Evelyn Woods)
b891d6f38c Undo inventory changes with tile props
This removes almost all of the remaining undo closures.
2024-05-06 12:57:58 -06:00
Eevee (Evelyn Woods)
20b19c53ff Cut down on some undo closures
If I can get rid of all of these, I can combine multiple undo entries,
and allow undoing backwards in time further (but more coarsely) with the
same memory usage.

This also introduces some actor pooling, which...  reduces memory usage
very slightly on clone-heavy levels, but may not be worth it overall.
2024-05-06 12:40:38 -06:00
Eevee (Evelyn Woods)
c900ec80db Reduce undo memory usage by a third
- Changes to tiles are now stored in a plain object rather than a Map,
  which it turns out takes up a decent bit more space.

- Changes to a tile's type or cell no longer need additional closures to
  perform the cell movement.

- Less impactful, but changes to level properties are now stored as a
  diff, not as a full set every tic.
2024-05-06 11:21:27 -06:00
Eevee (Evelyn Woods)
63da1ff38c Implement the toll gate 2024-05-05 16:20:21 -06:00
Eevee (Evelyn Woods)
3f6278f281 Fix rendering of the moment of death
Finally!  With the help of several mildly unpleasant hacks, the game now
draws as if a monster killing the player were walking onto her.
2024-05-05 15:32:56 -06:00
Eevee (Evelyn Woods)
45a8e0055d Untangle doppelganger movement from the visual is_blocked flag
Also, doppelgangers copy even failed force floor overrides.
2024-05-04 13:05:19 -06:00
Eevee (Evelyn Woods)
037d9d86fb Fix a couple missed spots with actors_move_instantly 2024-04-25 05:24:34 -06:00
Eevee (Evelyn Woods)
0efbefb999 Politely decline to emulate a bug in TW Lynx 2024-04-24 07:52:11 -06:00
Eevee (Evelyn Woods)
097a4b04d8 Move Lynx trap ejection to its own mini-step 2024-04-23 02:58:23 -06:00
Eevee (Evelyn Woods)
c5f2728ad0 Fix the Lynx fake-wall flicking behavior 2024-04-23 00:31:56 -06:00
Eevee (Evelyn Woods)
6c3cf8b4b4 Fix DAT files to not insert implicit button connections 2024-04-22 13:57:31 -06:00
Eevee (Evelyn Woods)
1170c5970e Fix blank circuit blocks? Although they seemed to work already? 2024-04-21 03:51:44 -06:00
Eevee (Evelyn Woods)
04d6b3dddb Refactor circuit-tracing to be more in algorithms
This should make it more usable in the editor.
2024-04-21 00:39:23 -06:00
Eevee (Evelyn Woods)
b360fa3998 Change sand slowdown from 100% to 50%, and give it the gravel sound 2024-04-20 03:34:14 -06:00
Eevee (Evelyn Woods)
06ceb827f3 Don't let the player get stuck in an inactive red teleporter 2024-04-19 21:51:34 -06:00
Eevee (Evelyn Woods)
17f4e77054 Fix force-proof players to still bonk on force floors
Fixes the replay of Chaos to Metastable, my white whale!
2024-04-19 21:41:57 -06:00
Eevee (Evelyn Woods)
939c71aab7 Don't die to a monster that was just hooked
This interaction sounds ridiculous but it is real CC2 nonsense.  Fixes
the Hoopla replay!
2024-04-19 00:24:58 -06:00
Eevee (Evelyn Woods)
3cf81b53ad Improve the connection tool somewhat; show implicit connections
For example, you can now make connections with the connection tool.
Remarkable.

Unfortunately, implicit connections aren't updated as you edit the level
yet.

Also came with some refactors for searching a level and whatnot.
2024-04-18 00:56:20 -06:00
Eevee (Evelyn Woods)
c624964b76 Oops! Fix calls to blocks_leaving 2024-04-17 19:46:50 -06:00
Eevee (Evelyn Woods)
e9650db4d8 Hardcode green toggles a bit less, and shrink the undo size 2024-04-17 19:46:29 -06:00
Eevee (Evelyn Woods)
e1e99e73e7 Fix circuit blocks; distinguish floor wiring from black button wiring 2024-04-16 21:09:46 -06:00
Eevee (Evelyn Woods)
a06f53af29 Emit wire pulses in reverse reading order
Fixes the replay for CC2LP1 #67 Before My Very Eyes.
2024-04-12 04:00:37 -06:00
Eevee (Evelyn Woods)
1df89884ed Implement MS-style instant movement for some reason 2024-04-11 03:50:58 -06:00
Eevee (Evelyn Woods)
ebe848ec99 Fix trap timing on Lynx
CC2's goofy `on_stand` on arrival behavior made them extra extra fast,
which is too fast.
2024-04-11 02:24:34 -06:00
Eevee (Evelyn Woods)
9bf418258f Convert several uses of on_begin to on_ready 2024-04-11 02:24:34 -06:00
Eevee (Evelyn Woods)
fd590f8353 Slightly reduce memory usage (?) for undoing transmutation 2024-04-11 02:24:34 -06:00
Eevee (Evelyn Woods)
f417162f6f Refactor bombs to use on_stand instead of on_begin 2024-04-11 02:24:34 -06:00
Eevee (Evelyn Woods)
25cb6f2f05 Outdent the messy push-handling block in can_actor_enter_cell 2024-04-11 02:24:34 -06:00
Eevee (Evelyn Woods)
f422b4b395 Add a compat flag for pushing a sliding block
The default is now what I /think/ is the Lynx behavior: try to push the
block first, and only give it a pending direction if the push fails.
CC2 always uses the pending mechanism.
2024-04-11 02:24:34 -06:00
Eevee (Evelyn Woods)
80edfa1ae9 Clear the pending flags in more sensible places 2024-04-11 02:24:34 -06:00
Eevee (Evelyn Woods)
64ca8f008c Restore standing on arrival
A few CC2LP1 replays desynced, so, I guess this is right actually.
2024-04-11 02:24:34 -06:00
Eevee (Evelyn Woods)
2ee86b50d2 Remove slide_automatically
Since sliding happens either on cell arrival or in the actor's idle
phase, the actor will always have a pending slide by the end of a tic,
so this code doesn't actually do anything.
2024-04-11 02:24:34 -06:00
Eevee (Evelyn Woods)
f140804713 Don't on_stand() on arrival; fix the CC1 force-floor compat flag 2024-04-11 02:24:34 -06:00
Eevee (Evelyn Woods)
a1f357f317 Make sliding be the tiles' responsibility
This seems to simplify things and also explain the CC2 semantics: force
floors activate while being stood on (which happens, I guess, during
idle), so it applies to objects that start the level on force floors.
This was probably done to make force floor flipping work, too.  On the
other hand, ice still only activates when being stepped on.
2024-04-11 02:24:34 -06:00
Eevee (Evelyn Woods)
7ba261c7d9 Fix some style nits; add some comments 2024-04-11 02:24:34 -06:00
Eevee (Evelyn Woods)
7a9e3a6eb1 Check forced movement when stepping on a cell, not during movement
This does simplify things a bit, and it also fixes the replay for CC2LP1
level 160, Sneak Around.  It breaks three Voting replays, unfortunately,
but doesn't break anything else, so I'm inclined to call it better.
2024-04-11 02:24:34 -06:00
Eevee (Evelyn Woods)
15a8be1c15 Play sounds very near the player at full volume, but spatialize chip pickups 2021-12-22 23:58:14 -07:00
Eevee (Evelyn Woods)
1e02c6aa6f Complete the pgchip ice block emulation (fixes #34) 2021-12-22 22:30:59 -07:00
Eevee (Evelyn Woods)
c8de4edfff Add spatial audio and sound effect captions 2021-12-22 20:55:15 -07:00
Eevee (Evelyn Woods)
77afca5799 Fix handling of blocked diagonal movement (fixes #86)
I had it mostly right based on experimentation, but had the conditions
inside-out, which allowed this case to slip through the cracks.  This
makes the Settlement of Arrakis replay sync.
2021-12-03 07:16:59 -07:00
Timothy Stiles
8feb732a8f boulders are pushed in the movement not facing direction (fixes #81) 2021-11-18 20:53:56 +11:00
Timothy Stiles
a87db67d84 lexy w/ skates and cerise now crack but don't slide on cracked ice (fixes #82) 2021-11-18 20:22:00 +11:00
Timothy Stiles
d675cddafb spaceify 2021-11-18 18:40:15 +11:00
Timothy Stiles
2df4dc5829 fix 'blowing up electric floors doesn't remove the wiring' regression 2021-11-18 18:39:46 +11:00
Eevee (Evelyn Woods)
ae8b42e0c9 Merge Lexy/Lynx loops; add compat for separated teleport phase 2021-05-17 19:12:04 -06:00
Eevee (Evelyn Woods)
7ed3d38489 Implement monsters not hurting you at decision time in Lynx 2021-05-11 18:31:16 -06:00
Eevee (Evelyn Woods)
3c00e0ba36 Fix rolling a second RFF direction under Lynx 2021-05-11 17:09:25 -06:00