Commit Graph

714 Commits

Author SHA1 Message Date
PatR
de12cbe47f rename #wizcheckmdifficulty to #wizmondiff
Shorten the name of the recently added debug command that validates
monster difficulty values.  'wizcheckmdifficulty' was 19 characters
long, the next longest is 14 ('wiztelekinesis').  The extra width
messed up the Qt interface's extended command selection dialog when
wizard mode commands are included.  It sizes the button for every
command to fit the longest name; the increase in size from 14 to 19
made the button grid become too big for the screen.

Add monsters' base difficulty level to the #wizmondiff output.

Add #wizmondiff and #wizdispmacros to 'wizhelp'.
2022-10-14 12:42:12 -07:00
PatR
c2894a422b monk strength
Add a stack of 2 tins of spinach near the leader on the monk quest
start level and another stack of 2 blessed tins of spinach at a
random spot on the monk quest locate level, to compensate for the
inability to gain strength from giant corpses if they adhere to
vegan or vegetarian conduct.  paxed supplied the 'tinplace' magic.

4 tins of spinach aren't nearly enough to get to 18/100, but by
uncursing the first pair, if necessary, and waiting until strength
is at least 18, they can be eaten to add 4..40 (average 22) points
of exceptional strength.  (Players choosing either of those conducts
for other roles or foodless for any role are on their own as far as
boosting Str goes, same as before.)

The special level loader needed to be modified to handle tins of
spinach.  It now accepts "spinach" as a fake monster type for an
object of type "tin".  Also added support for empty tins since it
involved the same code, and use of fake monster type "empty" with
object type "egg" to be able to create generic (unhatchable) eggs.
(Wishing for "egg" produces those by default but it also accepts
explicit "empty egg" by coincidence.)
2022-10-12 13:47:12 -07:00
copperwater
1abdaf1ddb Fix: prevent traps in shops in the Tourist quest
The Tourist locate and goal levels have 2 shops each, and also have
various traps randomly placed on the level. Unfortunately, this does not
account for placing them in the shops, so it was possible to wind up
with a magic trap or falling rock trap or whatever inside the shop,
which the shopkeeper would not clean up.

This commit makes selections that exclude the shop areas, and picks the
traps from those selections, keeping the shop floors trap-free as their
customers expect.
2022-09-22 23:42:01 -07:00
Pasi Kallinen
bb3dc379bc Themerooms: Engraving hints the location of buried treasure
Add two new themeroom functions that are called when generating
the level: pre_themerooms_generate and post_themerooms_generate,
calles before and after themerooms_generate.

Allow the buried treasure -themeroom to put down an engraving
anywhere on the level, hinting at the location of the treasure.

des.object contents function now gets the generated object passed
to it as a parameter.
2022-09-18 12:45:16 +03:00
Pasi Kallinen
3605f18a8e Split themeroom shape from themeroom contents
Previously, the tetris-shaped rooms were always either
normal rooms, or turned into shops or other special rooms
in NetHack core. Now, the themed room lua code first picks
the themed room (which can be a themed or shaped), and some
of those will then pick a random filling (eg. ice floor,
traps, corpses, 3 altars).

Adds a new lua binding to create a selection picking locations
in current room.

The content-function in special level regions now get passed
the room data as a parameter.
2022-09-15 18:09:40 +03:00
Pasi Kallinen
e952f67f2c Add #wizcast command to cast any spell
Wizard-mode command to cast any spell without checks that would
prevent casting, and with no energy use.

Mainly to allow the fuzzer to exercise the spell code paths.
2022-09-06 22:58:28 +03:00
copperwater
d8ada3d768 Fix inaccessible spaces and shop backdoors in Bustling Town
Perennial problem: since Bustling Town consists of a fixed map which was
shorter than the moveable area overlaid onto a cavern fill, sometimes
the cavern fill made spaces above or below the walled edges of the town,
which then got cut off when the town was placed. Since one of the valid
ways to generate a way out of an inaccessible space is to create a door
connecting it to an accessible space, this meant rooms in Minetown,
including shops, could get a second door leading into that tiny space.
And if it was a shop, the shopkeeper could not block exit from the
second door.

This fixes that issue by expanding the map vertically so that it will
overwrite the whole cavern fill in the town area of the map segment
where it might create cut-off spaces like this. (Not the whole area -
since we now have the 'x' mapchar to leave existing terrain in place,
areas adjoining open space where inaccessible pockets won't get
created can retain any existing fill to keep the town from being exactly
the same every time).
2022-09-01 17:11:50 +03:00
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
PatR
5d90d2250c 'wizhelp' update
After I added '#migratemons' I realized that lots of other, mostly
obscure, wizard mode commands were missing.  Some of the descriptions
are vague because I'm not sure what several of them actually do.
2022-08-26 17:07:38 -07:00
PatR
1766fbe352 make #migratemons unconditional
Make #migratemons command be unconditional.  The show existing
ones part is now always present.  Compile-time DEBUG_MIGRATING_MONS
controls whether the create N new migrators part is available.

Fix creating new ones from the Castle level.  It knew how to find
the next level (Valley) but wouldn't send monsters there because of
its Is_botlevel() check.
2022-08-25 10:36:47 -07:00
Pasi Kallinen
48db75fabc Add some hallu monsters 2022-08-24 18:40:27 +03:00
Pasi Kallinen
50b91bdcfa Make sink symbol match fountain in IBMgraphics 2022-08-23 23:36:41 +03:00
Pasi Kallinen
7bf02ade48 Bigroom 2 can have ice floor in unlit areas 2022-07-18 17:58:45 +03:00
Pasi Kallinen
a4ef5ee533 timed_delay doc bits 2022-07-18 08:33:10 +03:00
Patric Mueller
5863d95837 Typo in opthelp 2022-06-17 16:57:03 +02:00
PatR
6c91f52908 documentation update
Incorporate the diff from entrez describing the travel_debug wizard
mode option and removing obsolete M prefix from the Guidebook.  That
missed a reference to it in the description of '_'.

I put M back in case someone who has used it with earlier versions
tries to use it and gets a no-such-command complaint so goes looking
for it.

Also, make the mention of ^X at the end of the discussion of status
stand out a bit.  The indentation of its paragraph made it line up
with the preceding text instead of making it be distinct from that.

The TeX changes are untested and given the amount of punctuation
characters used, it will be surprising if they all have been quoted
properly.
2022-06-17 03:18:52 -07:00
Patric Mueller
1685b5e16b Fix wrong glyph for tuwall in Enhanced1 symset 2022-06-13 20:52:58 +02:00
copperwater
1a847d0314 Remove pointless lighting statement in Val-strt
The whole level was already lit up, so lighting up a smaller area of it
does nothing.
2022-05-27 21:23:31 -04:00
nhmall
6d15142250 fix one more lua file header 2022-05-10 11:30:30 -04:00
nhmall
0602a3b89f update lua file headers 2022-05-10 11:26:52 -04:00
nhkeni
e5648584b3 update headers on Lua files 2022-05-10 07:44:26 -04:00
nhmall
cb0c21e91d ENHANCED_SYMBOLS
A new feature, enabled by default to maximize testing, but one which can
be disabled by commenting it out in config.h

With this, some additional information is added to the glyphmap entries
in a new optional substructure called u with these fields:
    ucolor          RGB color for use with truecolor terminals/platforms.
                    A ucolor value of zero means "not set." The actual
                    rgb value of 0 has the 0x1000000 bit set.
    u256coloridx    256 color index value for use with 256 color
                    terminals, the closest color match to ucolor.
    utf8str         Custom representation via utf-8 string (can be null).

There is a new symset included in the symbols file, called enhanced1.

Some initial code has been added to parse individual
OPTIONS=glyph:glyphid/R-G-B entries in the config file.

The glyphid can, in theory, either be an individual glyph (G_* glyphid)
for a single glyph, or it can be an existing symbol S_ value
(monster, object, or cmap symbol) to store the custom representation for
all the glyphs that match that symbol.

Examples:
   OPTIONS=glyph:G_fountain/U+03A8/0-150-255

(Your platform/terminal font needs to be able to include/display the
character, of course.)

The NetHack core code does parsing and storing the customized
entries, and adding them to the glyphmap data structure.

Any window port can utilize the additional information in the glyphinfo
that is passed to them, once code is added to do so.

Also, consolidate some symbol-related code into symbols.c, and remove it from
files.c and options.c
2022-05-07 10:25:13 -04:00
PatR
02207b967a autounlock:untrap
Implement 'untrap' as an 'autounlock' action.  Quite a bit more work
than anticipated.  The new documentation is rather clumsy; too many
if-this and if-not-that clauses have intruded.

I'll be astonished if all the return values are correct....

[A couple of places were checking for (rx != 0 && ry != 0) to decide
whether they were performating an autounlock action at <rx,ry> but
that erroneously excludes the top line of the map if the current
level extends that far.  Just check rx for zero/non-zero.]
2022-05-06 14:44:57 -07:00
PatR
44d5be6eb4 autounlock overhaul
This gives the player more control over what autounlock does.  It is
now a compound option rather than a boolean, and takes values of
  autounlock:none
  !autounlock or noautounlock (shortcuts for none)
  autounlock:untrap + apply-key + kick + force (spaces are optional
    or can be used instead of plus-signs, but can't mix "foo bar+quux")
  autounlock (without a value, shortcut for autounlock:apply-key).
Default is autounlock:apply-key.

Untrap isn't implemented (feel free to jump in) so is suppressed from
the 'O' command's new sub-menu for autounlock.  It's parsed and
accepted from .nethackrc but won't accomplish anything.

[Just musing: it should be feasible to kick in direction '.' to break
open a container or #force to an adjacent spot to break open a door.
If that was done, autounlock:kick+force (or more likely autounlock:
apply-key+kick+force when lacking a key) would resort to force if hero
couldn't kick due to wounded legs or riding.

This changes struct flags so increments EDITLEVEL again.

This includes pull requests #750 from entrez and #751 from FIQ but was
entered from scratch rather than using use their commits.

Closes #750
Closes #751
2022-05-04 19:13:28 -07:00
vultur-cadens
3571934c59 Allow specifying object classes in the object name given to des.object()
and actually do so in the lua files.

Before this, it was not possible to specify (for example) "scroll of
teleportation" in des.object() because there is actually no object
defined in objects.h named "scroll of teleportation", so
find_objtype() failed to find it.  Instead, one had to request
"teleportation", but that is ambiguous, and find_objtype() would find
the first defined item with that name instead (ring of teleportation).

In cases of ambiguity, I referred to the des files from 3.6.6 (before
the lua conversion).
2022-04-24 00:35:25 -07:00
Pasi Kallinen
cb02ce88c5 Revisit the Valkyrie goal level hack
Instead of hardcoding the lava terrain change in core, if the stairs
are created in a fixed location, force the terrain to room floor first.
Move the surrounding lava changing to room floor to the Val-goal lua
file.
2022-04-15 18:52:49 +03:00
PatR
554ebc0f4c temporary? fix for github issue #730 - stairs \
placed on lava spot on Valkyrie goal level

Reported by k2, arriving at the final level of the Valkyrie quest
can issue a recently added impossible
| mkstairs: placing stairs up on molten lava at <68,13>
The report said it was easy to reproduce, but it took me multiple
tries (so not hard to do, but not a sure thing on any given attempt).

The stairs on that level are placed at specific coordinates that
are outside the pre-mapped area, so there's no guarantee that their
spot will be suitable for stairs.  The underlying terrian changes
from lava to stair, but only after the warning about molten lava.

This hack solves that particular level but is not a general solution
for this type of thing.  When about to make stairs on a lava spot,
change that spot to normal floor first.  Plus 50:50 chance to change
each adjacent lava spot to floor too so that there's decent chance
for some elbow room upon arrival.

Also, turn the no-flip attribute off for that level so that 'fixed'
location of the stairs can occur in four different places.

Fixes #730
2022-04-14 10:50:23 -07:00
Pasi Kallinen
a1f2000afd Fix castle engraving and scroll
Fixes #723
2022-04-10 14:30:58 +03:00
Pasi Kallinen
f45e79e1a0 Fix medusa levels
My recent commit broke medusa-3 and medusa-4, so fix those.

Make des.stair and des.ladder also accept hash-coordinate:
  des.stair("up", {8, 10});
2022-04-01 08:53:15 +03:00
Pasi Kallinen
27898340b9 Lua: coordinate tweaking
Make selection rndcoord return a table with x and y keys.
Allow (most) coordinate parameters accept such a table.
Fix selection and des lua tests broken by the above changes and
an earlier change, because selections tried to set terrain
at column 0, and it now causes a complaint.
2022-03-22 09:16:19 +02:00
Pasi Kallinen
38924002e0 Lua: ice theme room and melting ice
Allow the ice theme room to occasionally have melting ice.
Add nh.abscoord() to convert room-relative to map-absolute coords.
2022-03-15 22:05:36 +02:00
zomgreg
c5f435a2f2 corrected spelling of transcription 2022-03-07 14:30:36 -08:00
zomgreg
164c720378 corrected spelling of metaphor 2022-03-07 14:30:35 -08:00
Pasi Kallinen
a1d5464fa7 Knight quest home level has some saddled warhorses
Also, when creating a saddle in a monster inventory in special
level lua code, automatically saddle the monster, if possible.
2022-02-19 11:51:10 +02:00
nhmall
99ffd027ae remove NHAccess symset, github issue #638
Closes #638
2022-02-13 09:07:41 -05:00
nhmall
8499c71fcc update a couple of lagging 3.6 references 2022-02-04 12:47:05 -05:00
nhmall
5d4fc4591d more .gitattributes updates 2022-02-04 11:01:20 -05:00
PatR
11c7643ea7 reformat dat/hh
For
 key name description
reduce the width of the first column from 8 spaces to 6 and increase
the width of the second column from 8 spaces to 10 so that fewer lines
have misaligned third column caused by long name.

Also a small amount of extra verbosity, mostly for I and A/P/R/T/W.
2022-01-29 12:26:22 -08:00
PatR
5f14f0ff57 options help one more time...
Move the help text for the 'O' command from the code into its own file
and allow that to be accessed from the '?' menu as well as by choosing
entry '?' in the 'O' menu.

sys/unix/Makefile.top has been updated to handle new 'optmenu', others
need to catch up.  The game will still build and run without the file
but asking for options menu help won't work until they do.
2022-01-19 14:22:21 -08:00
PatR
bbe83a8f05 yet more help
Add an extra couple of sentences explantion for control and meta.
Noticed an omitted command in the process.
2022-01-13 16:56:32 -08:00
PatR
9d3425917f more user help
A couple of additional things witnessed in between the frequent adds
shown by youtube (top prize goes to the recurring popup ad advertising
popup blocking).

He knew that ^D meant a control character but thought that he had to
type Ctrl+Shift+d instead of just being able to type Ctrl+d.  And he
had no idea what "meta key" meant.  (I don't think I've ever seen a
key labeled that myself.)
2022-01-13 16:32:37 -08:00
Pasi Kallinen
711a12afc3 Add a false rumor 2022-01-04 11:14:12 +02:00
Pasi Kallinen
03b55a6fa0 Make the adventurer ghost asleep 2022-01-04 10:55:09 +02:00
Pasi Kallinen
76381815f3 Add theme room: Ghost of an Adventurer 2022-01-02 19:51:32 +02:00
RojjaCebolla
381ed08366 Correct the genders of DCSS bogusmons
Reference: https://github.com/crawl/crawl/blob/master/crawl-ref/source/mon-data.h
2021-12-30 20:38:15 +02:00
Pasi Kallinen
4b525374d0 Make vrocks emit a poison cloud when they flee 2021-12-25 10:51:20 +02:00
PatR
ec5f7bce16 tribute update: Monstrous Regiment and A Hat Full
of Sky

Add a page citation for Monstrous Regiment passage 1 and add four new
passages, bringing its total to 12.

Add two new passages to A Hat Full of Sky, bringing its total to 13.
2021-11-27 17:40:48 -08:00
PatR
341d1dff13 add a Harry Potter reference
Add three new hallucinatory monsters:  dementor, flying monkey, and
plaid unicorn.
2021-11-24 01:14:08 -08:00
PatR
1f31f1ff81 tribute update: Night Watch and The Wee Free Men
Add a page citation to passage #1 of Night Watch, and add five new
passages, briging the total to 12.

Add four new passages to The Wee Free Men, bringing the total to 13.
2021-10-30 19:16:35 -07:00
nhmall
0c80ef0526 more imp 2021-10-29 13:39:27 -04:00