Commit Graph

11 Commits

Author SHA1 Message Date
Pasi Kallinen
b34b7e08a4 Fix lua reset_level
The lua des.reset_level() call did not reset the special level
coder, so some values were kept and couldn't be changed.
Adjust the movement tests for this change.
2026-01-28 10:06:58 +02:00
Michael Meyer
93842fbb1b Fix: overwriting stairs in movement tests
Like some of the other coordinates in testmove.lua (addressed in
70008fc), the attempt to overwrite the stairs was targeting a spot
one space to the left of the actual position of the stairs, causing it
to have no effect (discussion suggested this may have been a result of
99715e0).  Update it so the stairs are properly erased and won't
interfere with movement tests by stopping a running/rushing hero early.
2022-08-31 18:24:26 +03:00
Michael Meyer
70008fc684 Fix: movement tests
Movement tests weren't working because terrain was being positioned one
square to the left of where it was expected, and the error message
printed something other than the expected coordinates.

I wasn't able to figure out why they were like this in the first place
(referring to one spot to the left of the hero with <u.ux-2, u.uy>), so
it's quite possible that I am missing some context here, but the test
failed consistently for me before making these changes, and now works.
2022-08-26 18:08:37 +03:00
Pasi Kallinen
1c401960aa Move movement tests
Rushing will go along a snaking corridor.
2021-08-09 16:13:12 +03:00
Pasi Kallinen
f5b617eaca More movement tests
Rush behaves different in ROOM vs CORR; in corridors, it'll
turn 90 degrees, but will not go in the opposite direction
from when it started.
2021-08-08 19:30:59 +03:00
Pasi Kallinen
4f594659dc More movement tests 2021-07-30 18:40:57 +03:00
Pasi Kallinen
78854aeda6 More movement tests 2021-07-30 18:09:28 +03:00
Pasi Kallinen
b080ea12c2 Debug flag allowing overwriting stairs
And using it in the movement tests, so running doesn't stop
at stairs.
2021-07-30 16:35:36 +03:00
Pasi Kallinen
7bfbe0fba9 Lua: Allow setting debug_flags 2021-07-29 07:36:08 +03:00
Pasi Kallinen
19599fa751 Add more movement tests 2021-07-28 20:47:12 +03:00
Pasi Kallinen
65b320de39 Start of movement tests
Adds the following lua functions:

- nh.pushkey("x")
    Pushes a key into the command queue. Support is spotty,
    currently only the keys handled in rhack.
- nh.doturn()
    Runs one turn of main loop, or if optional boolean param
    is true, until g.multi == 0
- nh.monster_generation(false)
    Disable monster generation, and kill off all monsters.

Adds a testmove.lua script to test hero movement. Currently
covers only hjklyubn and HJKLYUBN.
2021-07-28 19:19:40 +03:00