Commit Graph

13500 Commits

Author SHA1 Message Date
PatR
99cacd3105 named fruit vs glob bit
3.7 has a new size prefix for globs that 3.6 didn't.  The code that
decides whether player is naming slime molds after an actual object
needs to know about it.
2022-05-23 11:31:48 -07:00
PatR
4cb397b502 zap.c non-zap buglets
A couple of things I noticed when trying--and failing, so far--to figure
out the revive panic:
1) revive() treated y==0 as out of map bounds (x==0 is out of bounds
   but y==0 isn't);
2) get_mon_location() might yield stale coordinates for steed (but
   moot since that's only used for mobile lights and no light emitting
   monster can wear a saddle; didn't affect light emitting objects
   carried or worn by monsters).
2022-05-23 11:19:38 -07:00
nhmall
9a21e55830 comment update 2022-05-23 13:32:25 -04:00
nhmall
0e9f53a624 oil burning secret door described as spell #771
Closes #771
2022-05-23 13:25:12 -04:00
Patric Mueller
ced5c2a92f Curses: fix clipped map crash due to uninitialized memory 2022-05-23 00:03:15 +02:00
PatR
a962a4f6ea tweak #wizkill
When using 'm #wizkill' to kill monster(s) off without giving the
hero any credit or blame, temporarily force context.mon_moving On
so that collateral damage (other monsters killed by targetted gas
spore's explosion) also don't give the hero any credit or blame.

Make sure that some message identifying the monster is given when
targetted monster is killed even if hero can't see or sense it.
2022-05-22 00:21:58 -07:00
nhmall
05d628752e warning fix 2022-05-21 21:26:21 -04:00
nhmall
7b506c715c Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2022-05-21 21:22:42 -04:00
nhmall
68d7ef440f follow-up (from entrez) 2022-05-21 21:22:20 -04:00
PatR
af55e3d027 add new #wizkill command
Add a way to get rid of specific monsters in wizard mode without
fighting, zapping, &c.  #wizkill command lets you kill creatures by
picking them with getpos().

You can pick multiple monsters by targetting them one after another.
You don't have to be able to see or sense them but if you target a
spot that has no monster, the command ends.

By default, the hero gets credit or blame as if having killed the
targets but #wizkill can be preceded by 'm' prefix to treat their
deaths as if they had been caused by a monster.
2022-05-21 17:40:52 -07:00
PatR
15882c5bee wizard mode wishing bit
I meant to wish for a "wand of cold" and accidentally typed "wand of
ice".  Instead of being told that there's no such thing or receiving
a random wand, the spot I was standing on was changed to ice.

Only check for a terrain-change wish if an object class hasn't been
stripped from the wish text.
2022-05-21 15:19:48 -07:00
nhmall
f19ccde709 make currently unhandled switch cases apparent 2022-05-21 09:13:02 -04:00
nhmall
441840c737 expand info a wee bit on revive() panic 2022-05-21 09:08:23 -04:00
nhmall
35b56fb94b incorporate the later force push on pr767 2022-05-20 19:45:07 -04:00
nhmall
d93f8ebf69 fixes3-7-0.txt entries for pr765 and pr767 2022-05-20 17:59:42 -04:00
nhmall
eb49ca7c5a Merge branch 'pr765-767' into NetHack-3.7 2022-05-20 17:41:18 -04:00
nhmall
69a6e1dd01 Merge branch 'makeplural-gateaux' of https://github.com/entrez/NetHack into pr765-767 2022-05-20 17:40:22 -04:00
nhmall
b72b70ea99 Merge branch 'fix-pray-goto' of https://github.com/argrath/NetHack into pr765-767 2022-05-20 17:40:04 -04:00
Michael Meyer
0c0262eab0 Handle -eaux plurals in makeplural/makesingular
I noticed a comment about -eau pluralizing as -eaux, e.g. "gateau" ->
"gateaux", was not consistent with the actual output of makeplural.
Same thing with "VAX" -> "VAXen" in the line below it; they're very old
comments, so maybe they were originally meant to point out some plurals
makeplural got wrong?  Since they predate the addition of "oxen" and
"geese" to one_off[] (and the array itself), it seems like the other
special cases mentioned in the comments would also have been wrong at
the time they were written.

Address this horrifying pastry-related oversight by adding handling for
'-eaux' plurals to makeplural, with an exception for 'bureau' (plural
'bureaus'; according to the dictionary, 'bureaux' is an acceptable
variant but 'bureaus' is more common, at least in American English).
There's also an exception for 'Bordeaux' (as in a bottle of the wine),
since the singular and plural are the same.

A bit surprised this wasn't already in there, since 'gateau' is a real
food item and seems like a much more likely fruit name than some of the
inedible items makeplural has special rules for.

Also add " au " to compounds[] in singplur_compound, so that 'gateau au
chocolat' will pluralize correctly to 'gateaux au chocolat'.  Without
that change, the result is 'gateau au chocolats'.
2022-05-20 17:37:02 -04:00
SHIRAKATA Kentaro
3baa00bb1e adjust the function name in impossible() 2022-05-21 00:33:53 +09:00
nhmall
95da0beffa fix MSDOS cross-compile
After some Make variables and additional override for CROSS_TO_MSDOS
is required.
2022-05-19 19:53:48 -04:00
nhmall
29236fc22d don't force manual edit of config.h for Lua 5.3.6 and earlier 2022-05-19 19:22:43 -04:00
nhmall
629b5d67a9 fix 'make all' from src directory 2022-05-19 19:00:47 -04:00
PatR
46e34b0826 lua 'index'
Having the preprocessor rename a variable called 'index' to one
called 'strchr' is not the source of any bugs (in execution; it can
cause pain when trying to ask a debugger to display the value and
then be told no such thing exists).  Change the name to 'indx' to
avoid any confusion.

If we switch to strchr() we should still avoid using 'index' as a
variable name.
2022-05-19 14:40:27 -07:00
Pasi Kallinen
c6a3ae5c6c Curses: Obey timed_delay option 2022-05-19 18:40:15 +03:00
nhmall
27119907a7 use updated lua library name in make spotless 2022-05-19 08:18:52 -04:00
nhmall
f57555ae6b differentiate lua object library names by Lua ver 2022-05-19 07:44:29 -04:00
nhkeni
8a6c3d8de5 5.3.5 is not currently compatible with NHL_SANDBOX, but make it compile
with 5.3.5 and !NHL_SANDBOX
2022-05-18 14:11:00 -04:00
SHIRAKATA Kentaro
0315cd876a split fixing curse trouble into separate function 2022-05-19 02:42:31 +09:00
nhkeni
c81dcf6713 Don't sanity check LUA_VERSION for sandbox if no sandbox. 2022-05-18 13:24:13 -04:00
nhmall
fafe54869d tested newer versions of visual studio
Also fixes a missing ')' typo in Makefile.nmake
2022-05-18 12:17:00 -04:00
Pasi Kallinen
8532b8d990 Add missing void 2022-05-18 18:59:01 +03:00
PatR
2ef0291d15 context-sensitive inventory item-action split
When picking an item from inventory and then picking 'I - adjust
inventory by splitting this stack' in the item-action menu,
yn_function("Split off how many?") is used to start getting the
count without needing to wait for <return>.  It includes the response
in message history (so review of history will see that first digit).
The code then uses get_count() to obtain any additional digits.  Tell
the latter to store "Count: N" in message history if N is different
from the first digit.

That's not as good as updating message history to replace the entry
showing the prompt with the first digit with one that shows the full
count but at least it's accurate when the count is 10 or more.
2022-05-18 01:17:14 -07:00
PatR
cab613a3a9 restoring in Gehennom
When a game is restored while hero is Gehennom, give the "It is hot
here.  You smell smoke..." message after the welcome back message.

For both entering Gehennom and restoring there, switch from "smell" to
"sense" in the second part of that message if poly'd into a form that
doesn't have sense of smell.

Some unrelated stuff that got caught up in this diff:
1) move welcome()'s call to l_nhcore_call() to the start of the routine
   instead of placing that after a potential early return;
2) remove a redundant glyphmap flags reset line; the routine being
   called starts by setting its flags field to 0 for level change so
   caller doesn't need to do that;
3) look_here() is just a formatting bit.
2022-05-17 16:52:06 -07:00
PatR
03c264f93c some quest message delivery cleanup
Construct a synoposis line if a message flagged for delivery by pline
gets changed to delivery by window and doesn't already have one.

deliver_by_pline(), deliver_by_window(), and deliver_splev_message()
were doing more work than necessary.
2022-05-17 15:52:50 -07:00
PatR
93b972c158 cmap_walls_to_glyph() and a couple of others
I wasted a bunch of time yesterday trying to figure out why a maze
level in Gehennom wasn't being shown with orange walls and ended up
reformatting a few glyph handling macros while hunting for the problem.
It turned out that the wall color choosing was working as intended.
I was looking at a maze bordered by solid stone (pale blue with Qt's
tiles, unlike tty's blank space) rather than by walls.

Anyway, a couple of the macros have had a little bit of common code
factored out rather than just be reformatted so I'm putting this in.

[For future, maybe stone should be given branch-specific coloring
similar to walls?]
2022-05-16 09:46:36 -07:00
PatR
b562c8ac89 fix segfault with #therecmdmenu
The change to add a menu choice for naming an adjacent monster via
\#therecmdmenu was unintentionally requiring that the monster have
monst->mextra.  So it worked on pets (regardless of whether they
were already named) because they have mextra for 'edog' extension,
but not on the majority of monsters.  And when it failed the program
would crash with a 'segmentation fault' error.

Fix the check for whether a target monster already had a name when
deciding to use "name <mon>" or "rename <mon>" in the menu entry.
2022-05-16 09:41:21 -07:00
PatR
6af5555215 fix github issue #764 - misplaced corpses
Reported by jeremyhetzler and confirmed by k2:  dead monsters weren't
leaving corpses at the spot they died.

Don't set a monster's mx,my coordinates to 0,0 when taking it off the
map (unless it is migrating to another level; mx==0 is the bit of data
used to indicate that).  Corpse drop happens after that and expects
the dead monster's former map coordinates to be intact.

Fixes #764
2022-05-16 01:30:00 -07:00
PatR
c8ceeac24e pull request #763 - noxious nemeses
Pull request from vultur-cadens:  some of the quest nemeses death
messages mention releasing noxious gas or noxious fumes so create
a poison gas cloud for them.

Closes #763
2022-05-15 12:20:10 -07:00
vultur-cadens
a18b7ebad9 Make some quest nemeses leave poison clouds when they die.
The Archeologist, Caveman, and Priest quest texts describe the
nemesis's body producing a cloud of noxious fumes/gas when killed.
2022-05-15 12:19:46 -07:00
PatR
4d9c568a8e \#therecmdmenu #name monster
Implement naming an adjacent monster with #therecmdmenu.

Also plug a memory leak using item-action name or call on objects.
2022-05-15 11:01:44 -07:00
PatR
3a0a92764a more wormgone
When wormgone() takes a long worm off the map, clear its stale mx,my
coordinates.  None of its callers need those anymore.

Also a bit of potential long worm clean up that occurred to me when
I looked at object bypass handling.  Expected to be a no-op here.
2022-05-14 18:10:42 -07:00
PatR
ef08773f2b migrating monster fix
The change to zero out a monster's map coordinates when it is taken
off the map yesterday messed up migration between levels inside the
Wizard's tower.  (Didn't apply when accompanying the hero between
levels, so probably unlikely to be noticed.)

Noticed while moving some replicated code into its own routine.
2022-05-14 03:30:45 -07:00
PatR
87749392b0 more writing novels
Instead of always retaining a blank spellbook when failing to write a
novel, make 2/3 chance to retain and 1/3 chance to destroy.  Same odds
(but separate chance) to attempt to write the Great Yendorian Novel
versus awful fan fiction.
2022-05-13 16:47:00 -07:00
PatR
a1bf4c2786 pull request #761 - writing novels
Pull request by entrez:  don't create a Pratchett novel by writing
"novel" or "paperback book" on a known blank spellbook with a magic
marker.

Blanking a novel produces a blank spellbook; there isn't any blank
novel.  That's intentional.  Writing "novel" on a blank spellbook
and getting a randomly chosen Pratchett one wasn't intentional.

Closes #761
2022-05-13 16:04:02 -07:00
Michael Meyer
92999914c8 Prevent hero from writing Pratchett books
The hero's ability to channel Pratchett and write his books with a magic
marker once she had read or IDed at least one of them seemed strange,
especially cases like an illiterate hero doing it as her first
introduction to the written word.  Block the hero from writing random
novels with a marker.

The image of the hero sitting down in the dungeon to write a novel is
funny, so it feels like a good spot for a funny message.  I'm not
sure if what I have there is perfect, but it can always be changed.
2022-05-13 16:01:04 -07:00
PatR
bb2c1bd115 pull request #760 - kickobjnam
Add pull request by argrath:  only one of the calls to new kick_ouch()
needs to pass 'kickobjnam'.

Closes #760
2022-05-13 15:57:03 -07:00
SHIRAKATA Kentaro
0b00f97766 kickobjnam on dokick() is assigned only kicking object 2022-05-13 15:51:08 -07:00
PatR
1ce457f801 display former possessions of dead monster
Reported directly to devteam by a hardfought player and also by
entrez.  The recent mon_leaving_level() change resulted in objects
dropped by a dying monster not being displayed immediately.

It justed needed the relobj(mon, 0, FALSE) to relobj(mon, 1, FALSE)
change in m_detach() but this does some related cleanup in
mon_leaving_level()'s callers.  wormgone() takes a long worm off the
map but leaves its stale coordinates set because some code relied on
that.  This takes away the need for that but still doesn't actually
clear them.

This adds redundant 'return' statements at the end of a few void
functions that are longer than fits within a typical screen display.
They make searching for the end of the current routine in an editor
or pager easier without resorting to regular expressions and can
also be used to search for the beginning if/when preceding routine
ends in 'return' too.
2022-05-13 14:46:02 -07:00
nhmall
44c225a11e yet more version buf 2022-05-12 20:10:27 -04:00