Files
nethack/doc
copperwater f71bff3285 Standardize all core and obj functions with relative coords
This is a large iteration on a previous implementation of making
nh.getmap() parse its coordinates as relative to the last defined map or
room rather than absolute to the entire level. Now, everything in the
nh.* and obj.* functions interprets coords as relative rather than
absolute. (By default; if no map or room has been defined, or if the lua
code is executing after level creation is done, they will interpret the
coordinates as absolute).

The general motivation is basically the same - routines that use
absolute coordinates are difficult to use in level creation routines,
because then the designer has to remember to convert the relative
coordinate to an absolute one (and that was impossible before
nh.abscoord was added, particularly in themed rooms). And once
nh.getmap() takes relative coordinates, it would be very strange to have
all the other functions (setting timers, burying objects, etc) remain
with absolute ones.

In a couple places, code is changed to account for coordinates that are
relative to a *room* (which uses g.coder->croom->[lx,ly] as an offset,
instead of relative to a *map*, which uses [xstart,ystart].
Specifically, selection.iterate did not account for this, and without
this the ice themed room timer was not being started in the proper
place.

All tests are updated to respect the new behavior. Most of the modified
functions are not actually used anywhere in level files; the one
exception is starting a timer in a themed room, and that has been
adjusted.

Documentation updated as well to clarify when various things are tossing
around relative and absolute coordinates, both in comments and in
lua.adoc.
2022-08-31 18:26:05 +03:00
..
2022-06-18 10:29:15 -04:00
2022-01-29 22:57:22 -05:00
2022-01-29 22:57:22 -05:00
2022-01-29 22:57:22 -05:00
2022-08-28 18:48:01 +03:00
2020-02-15 14:42:00 -08:00
2022-08-23 23:27:21 +03:00
2022-08-23 23:27:21 +03:00
2022-08-21 10:20:32 -04:00
2022-02-22 20:14:44 -05:00
2022-02-22 20:14:44 -05:00
2018-11-11 10:29:52 -05:00
2018-11-11 10:29:52 -05:00
2022-02-22 20:14:44 -05:00
2022-02-22 20:14:44 -05:00
2022-02-22 20:14:44 -05:00
2022-02-22 20:14:44 -05:00
2018-09-20 18:02:48 -04:00