Commit Graph

12060 Commits

Author SHA1 Message Date
Pasi Kallinen
3ddb2a91c7 Allow some makemon flags in lua monster creation
Also document the des.monster hash parameter values.
2021-06-24 14:38:12 +03:00
Pasi Kallinen
8dfe963652 Allow spiders to spin webs
Revisited this feature, and the chance of a spider spinning a web
depends now on the number of webs already present on the level.

For a giant spider to spin a web in the middle of a room with no
supports, the limit of existing webs is 4, next to one support 9,
next to two supports 14, and so on. Cave spider limits are much lower.
2021-06-23 22:50:57 +03:00
PatR
a9134fd8b9 more "<mon> appears in a cloud of smoke"
Now that the appear message isn't limited to summoning by demon,
seeing "the Angel of <foo> appears in a cloud of smoke" seems
strange.  Angels weren't covered by the vapor/dust/&c change for
elementals.  Make angels appear in a flash of light.
2021-06-21 17:47:51 -07:00
PatR
fa7980c585 monster name formatting
While testing monster summoning by using a debugger to force the
outcome, I saw "the renegade Angel of <foo> appears in a cloud of
smoke" as if only one such creature existed.  Trying to change
that to "a renegate Angel" pointed out some problems:  type names
like Angel, Green-elf, and Uruk-hai fool an() into using "the"
because of their capital letter.  Fixing that was a bit of a hack
and worked for Green-elf and Uruk-hai but not for Angel because
it has the eminion extension so uses priestname() instead of the
guts of x_monnam().  Fixing that involved more hackery and now I
feel unclean, but it seems to be working.

It wasn't as noticeable as it might have been because most of the
time that "the Angel of <foo>" or "the priest of <bar>" was shown,
the caller is requesting "the" rather than "a/an".
2021-06-21 17:44:35 -07:00
nhmall
3af1cc79e6 k-sound follow-up 2021-06-21 15:56:14 -04:00
nhmall
b28e914bc3 revisit k-sounding ch suffix
put k-sounding suffix exception checks into a function
2021-06-21 15:42:49 -04:00
Pasi Kallinen
f84538aa8c Dehardcode number of glass gems 2021-06-21 10:06:46 +03:00
PatR
0bb77f455d "<foo> appears in cloud of smoke."
Have water demons appear in a cloud of vapor rather than a cloud of
smoke.  This adds a few other alternatives but they'll never happen.
Elementals could only be summoned by Angels but Angels never call
msummon() as far as I can tell.  Vortices aren't summoned at all
but the smoke/vapor/&c routine has provisions for them.

The cloud of smoke message used to be given only when the summoner
is a demon.  Now it will be given if the last--or only--summoned
creature can be seen to arrive, no matter whether summoned by a
demon, a non-demon (which I think isn't possible), or post-Wizard
harassment.
2021-06-20 16:45:42 -07:00
nhmall
429b665379 fix monarch pluralization 2021-06-20 07:51:53 -04:00
PatR
7552a52daa tribute: Jingo
Add two new passages to Jingo, bringing the total to 14.
2021-06-18 14:51:21 -07:00
PatR
0b5a112b0c gender for figurines
Use (obj->spe & CORPSTAT_GENDER) for figurines as well as for
statues and corpses.

Support wishing for
 "{female,male,neuter} {corpse,statue,figurine} [of <monster>]".
and
 "{female,male,neuter} <monster> {corpse,statue,figurine}".
Also
 "{corpse,statue,figurine} of {female,male,neuter} <monster>"
where the qualifier might be in the middle instead of a prefix.
2021-06-17 16:03:45 -07:00
PatR
0aaafd19be fix the "fix obj_pmname() fix"
Avoid using montraits when determining pmname of a corpse or statue.
2021-06-16 14:22:03 -07:00
Pasi Kallinen
26fa915cf3 Silence couple warnings of possibly uninitialized vars 2021-06-16 22:08:04 +03:00
Pasi Kallinen
769bce1199 Minor code reorg: finding longest option name 2021-06-16 14:53:05 +03:00
Pasi Kallinen
76f77ee0cc Add assistance to fire-command
Allows the fire-command to autowield a launcher; it will now
do either swapweapon or wield an appropriate launcher, if you
have ammo quivered.

This assistance can be turned off with the fireassist boolean option.

Adds a rudimentary command queue, which allows the code to add keys
or extended commands into the queue, and they're executed as if
the user did them.  Time passes normally when doing the queue,
and the queue will get cleared if hero is interrupted.
2021-06-16 13:14:32 +03:00
PatR
f6e60c7516 fix bullwhip-induced panic
While testing some corpse/statue name manipulation changes I managed
to trigger a panic during end-of-game cleanup.  Using a bullwhip to
snatch a wielded cockatrice corpse from a monster's inventory into
the hero's inventory and being turned to stone due to lack of gloves
took the corpse out of the monster's inventory but didn't place it
anywhere.  If no life-saving took place, it led to an "obj_is_local"
panic during timer cleanup when freeing the level.

This patch includes some of the stuff I've been testing rather than
just the fix for the panic (which is the very last bit of the diff).
2021-06-15 18:42:30 -07:00
PatR
7088f6a846 fix obj_pmname() fix
The omonst 'data' pointer is always Null so taking mons[].pmname from
saved traits would be skipped all the time.
2021-06-15 14:13:55 -07:00
nhmall
fe4822829c fixes37.0 entry update 2021-06-15 16:30:07 -04:00
nhmall
5ac913e035 null pointer dereference in do_name.c
fixes #534
2021-06-15 15:49:31 -04:00
PatR
57e970b227 mon_pmname(), obj_pmname()
Revive some code from 5 or so years ago that's been sitting in a
defunct local git branch.  There are a couple of references to
figurines having gender; the old, unfinished code did already have
support for that, the current code doesn't.  It probably won't take
much effort to add it in but I want to get this first part out of
the way.

Replace some of the
pmname(mon->data, Mgender[mon]) calls with simpler
mon_pmname(mon) and some
pmname(&mons[statue->corpsenm],
   (statue->spe & CORPSTAT_GENDER) == ... ? ... : ...) with simpler
obj_pmname(obj).  There are other instances of them which haven't
been changed but could be.
2021-06-12 03:07:30 -07:00
PatR
234eceae60 corpse/statue gender fix when wishing
Wishing for "{corpse,statue} of gnome queen" would produce a corpse or
statue of a gnome queen, but wishing for "gnome queen {corpse,statue}"
would produce corpse or statue of a gnome king.  The matching for
gender-specific monster name was only passing back the corresponding
gender when an exact match occurred (which happens for "foo of pmname"
but not for "pmname foo" since 'pmname' through end of string is what
the name_to_mon() matching code is looking at).
2021-06-12 02:25:16 -07:00
nhmall
39a0c5ee38 nethack --showpaths output tweak
Don't display a portable_device_path in --showpaths output if it is
empty or not being used.
2021-06-10 12:14:36 -04:00
PatR
38d2b3afc2 tribute update: Hogfather
Add three new passages for Hogfather, bringing total to 13.
2021-06-09 16:45:37 -07:00
nhmall
3af88b8802 Follow-up to earlier warning correction with Microsoft compiler
The earlier warning is architecture-dependent.

The warning showed up under an x64 build, but not an x86 build.
The __unaligned keyword is not supported under an x86 build.

Refine the preprocessor conditional.
2021-06-08 21:51:55 -04:00
PatR
cfc4f24c8e issue #531 followup
Set gender before creating monster rather than after the fact
to force display to show it correctly.
2021-06-08 16:38:43 -07:00
nhmall
710efe4175 Microsoft compiler warning building tile2bmp.c
..\win\share\tile2bmp.c(234): warning C4366: The result of the unary '&'
operator may be unaligned
2021-06-08 14:38:47 -04:00
nhmall
ca7b1d5df0 another nhsetup.bat tweak 2021-06-08 14:15:36 -04:00
nhmall
e6d9e6be0b no need to check vs version in nhsetup.bat 2021-06-08 13:56:02 -04:00
PatR
04a8ddcce1 fix github issue #531 - genderless corpses
Dead monsters that had traits saved with the corpse would revive as
the same gender, but ordinary corpses revived with random gender so
could be different from before they got killed.

Since corpses of monsters lacked gender, those for monsters with
gender-specific names were described by the neuter name.

This is a fairly big change for a fairly minor problem and needs a
lot more testing.

Fixes #531
2021-06-08 03:43:46 -07:00
PatR
14b2330fd6 curses color cleanup
The color handling changes for curses left a set of variables
unused, so get rid of them.
2021-06-06 15:23:39 -07:00
PatR
e20dd2e760 fix github issue #530 - weapon skill enlightenment
^X feedback and end of game disclosure reported
 Your two weapon skill {is,was} [also] limited by being <skill rating>
 with with <secondary weapon>.
when the skill rating for the secondary weapon is/was less than the
skill rating for two-weapon combat.  The corresponding message for
primary weapon did not duplicate the word "with".

Fixes #530
2021-06-06 13:38:49 -07:00
Pasi Kallinen
97e58a4fdc Change autopickup and color default values
Change the default value of autopickup to off. Having it on is
harmful for new players, making them very easily burdened.
We can't expect new players to know how to configure
pickup_types, pickup_burden, and pickup exceptions.

Change the default value of color to on. We can safely assume
new users have a terminal that supports color, and most people
want color.
2021-06-06 19:25:49 +03:00
PatR
41eecdf6b3 curses menu: support backspace/delete for counts
Have curses call the core get_count() routine instead rolling its
own so that backspace and delete are supported.  That part was
trivial to accomplish.  Unfortunately it brought the disappearing
menu phenomenon back so it became more complicated overall.
2021-06-06 05:54:53 -07:00
PatR
0280006d76 fix #K3357 - curses menu disappears
This fixes the disappearing menu, but not curses menu count entry
failing to honor backspace/delete.  Entering two or more digits
to get a "Count:12" message, followed by non-digit which removes
that, resulted in the menu for apply/loot in-out container operation
vanishing while it was still waiting for a choice.  (Typing a choice
blindly did work.)

The code intended to handle this.  I don't understand why refresh()
wasn't working.  Reordering stuff didn't help until I changed that
from refresh() to wrefresh(win).

The original Count:123 display was limited to 25 characters and
menus to half the main window, so they didn't overlap.  I made the
count display wider--because it is now also used for 'autodescribe'
feedback when moving the cursor around the map--so made something
that originally was impossible become possible.  One line of the
menu does get erased while "Count:" is displayed, but then gets put
back by the wrefresh().
2021-06-05 16:11:50 -07:00
PatR
b8b95718d7 fix pull request #527 - cursed levitation
The stair handling reorganization changed drinking a cursed potion
of levitation to only check whether stairs up existed on the level
instead of whether the hero drank the potion while at their spot.
That resulted in always attempting to go up and then getting "you
can't go up here" when not at stairs instead of the intended "you
hit your head on the ceiling".

Fixes #527
2021-06-05 15:37:03 -07:00
PatR
60cc48890b fix pull request #526 - 'menucolor' help message
being given when it shouldn't be.  A change for perm_invent handling
back in March screwed up the if/then/else logic for code executed
when finishing MENUCOLOR manipulation via the 'O' command.  That
resulted in the reminder to set menucolors to True being given even
when it was already True if perm_invent happened to be False.

I noticed this myself recently, then neglected to investigate it or
even write it down anywhere.

Fixes #526
2021-06-05 15:17:55 -07:00
Patric Mueller
5c15ca1002 curses: remove unnecessary special handling for dark gray
On terminals with at least 16 colors there should be no need for special
handling dark gray.

The curses code uses COLORS < 16, COLORS <= 16, COLORS > 16, or COLORS >= 16
at several places although I'm not sure if they are correct or which could
possibly be off-by-one errors.

But realistically in this case, we only need to distinguish between 8 color
terminals and terminals supporting more than 8 colors as this will mean the
terminal supports at least 256 colors.
2021-06-05 14:38:41 +02:00
Patric Mueller
6e7f1bc1f0 curses: don't change the terminal's default colors
The curses port changed some of the basic 8 terminal colors and all 8 bright
colors on terminals supporting changing colors.
2021-06-05 14:38:13 +02:00
nhmall
70925807f6 nuget restore task 2021-06-04 23:01:49 -04:00
nhmall
0305a14a27 windows substitution error in gcc Makefile 2021-06-04 21:46:03 -04:00
PatR
e7cc458225 a few formatting bits for zap.c 2021-06-04 15:51:36 -07:00
nhmall
7439c8b060 windsys.c name tidbit 2021-06-04 08:51:42 -04:00
nhmall
4c3078041d Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2021-06-04 08:49:47 -04:00
nhmall
631e80c47a msdos Install.dos tidbit 2021-06-04 08:49:20 -04:00
Pasi Kallinen
8849f66dae Don't bind quit to any key by default
Quit is not a commmand you usually need very often, and generally
don't want to use by accident.

Apparently, on Spanish keyboard layout, n-with-tilde is interpreted
by the Windows NetHack as M-q, and the key is next to l. Loot also
asks for confirmation, just like quit.

Prevent stuff like this by not binding the quit command to any key.
2021-06-04 09:13:30 +03:00
nhmall
0fcc151706 cron daily Files update 2021-06-04 00:27:20 -04:00
nhmall
80d3178d25 windows doc update tidbit 2021-06-04 00:24:46 -04:00
nhmall
254c6c55f5 Windows build warning and Makefile update
.\hack.c(2657): warning C4389: '!=': signed/unsigned mismatch
Visual Studio autodetection update for Makefile.msc
2021-06-04 00:14:37 -04:00
nhmall
d27c507c16 pipelines update 2021-06-04 00:01:37 -04:00
nhmall
91ab71f0f9 windows and visual studio follow-up bit 2021-06-03 23:43:32 -04:00