Commit Graph

9744 Commits

Author SHA1 Message Date
Michael Meyer
b662134eba Fix: bill_dummy_obj billed excessively for stacks
Add a way to request that unpaid_cost() produce the cost for a single
item, which is necessary for the price adjustment made in
bill_dummy_object.  Another option would be to simply divide by quan in
bill_dummy_object, but this might be more future-proof in case
unpaid_cost ever involves more than simple multiplication by quan
(e.g. the use of alternate units vs the base price, as are used for
globs).

Fixes #1236
2024-04-27 18:42:50 -07:00
PatR
1f8db3a0f3 pull request #1238 - pit interaction when pool
underneath gets boiled away

Pull request by disperse:  when a water walking hero zaps a wand of
fire downward and it boils away the water, hero should fall into the
resulting pit.

The PR commit didn't handle monsters (who don't zap wands downward
but could be on/in water that's boiled out from under them).  And
while testing it I noticed that the existing code had message
sequencing issues (being enveloped in a cloud of steam before seeing
the water evaporate).  This ended up redoing the fix rather than
using the commit.

Fixes #1238
2024-04-27 18:37:42 -07:00
PatR
f652fdd686 comment typo/thinko/bizarro in engrave.c 2024-04-27 15:15:53 -07:00
Pasi Kallinen
a0256ef5cb Fix monster vs monster breath attacks
The same routine handles both monster-vs-hero and monster-vs-monster
breath attacks, but the code was considering what the attacker knows
about hero's resistances even when attacking another monster.

Also unconditionally prevent the monster breath attack if the monster
knows about hero reflecting - previously the monster could use the breath
if it were just far enough from hero, even when hero had reflection.
2024-04-27 21:18:58 +03:00
nhmall
9ae6f4e77e warning fix if SYSCF is not defined 2024-04-27 10:00:28 -04:00
nhmall
1e6d5317e5 warning bit report.c 2024-04-27 09:08:08 -04:00
RainRat
e7aaf8dc1c fix typos 2024-04-26 08:10:10 -04:00
Pasi Kallinen
26c8cbc931 Fix drawbridge checking outside map 2024-04-26 07:59:42 +03:00
PatR
ec99383b81 engraving with stack of cursed weapons
Fix a FIXME added for issue #1233.  When engraving, if the writing
implement is a stack of cursed weapons which are welded to the hero's
hand, just write in the dust rather than engrave in the floor, in
order to keep the whole stack welded.

Only applies when the stack is actively welded.  Other stacks of
cursed weapons will have one split from the stack to perform the
engraving, otherwise engraving could be used to determine whether a
stack is cursed without the risk of wielding it.
2024-04-25 17:41:06 -07:00
Pasi Kallinen
ab0a98072b Prevent kicking an object accessing out of map location 2024-04-25 22:58:37 +03:00
Pasi Kallinen
5fa6e6bd8d Prevent explosions moving objects out of map 2024-04-25 22:28:21 +03:00
Pasi Kallinen
472cb7f7fa Prevent throwing gold out of the map 2024-04-25 12:39:02 +03:00
Pasi Kallinen
94dd316e80 Make saveoptions save changed autocompletions 2024-04-25 10:13:08 +03:00
Pasi Kallinen
91ecf2b167 Fix level regions accessing outside map 2024-04-24 23:35:55 +03:00
PatR
a6003fd625 resists_blnd() comment update
The only-if part of 'iff' was no longer accurate when the description
was changed to say "due to mundane reason".
2024-04-22 11:10:02 -07:00
Pasi Kallinen
3ec8eb59de Fix off-map monster doing things
m_move could make monster go off-map (by eg. using a trap),
but the return values don't reflect that
2024-04-22 16:38:59 +03:00
Pasi Kallinen
b76a96bf40 Add missing break
A rolling boulder hitting a wall or a tree could keep going,
possibly going out of map bounds
2024-04-22 14:46:18 +03:00
PatR
a49444ea39 fix github issue #1233 - egraving with stacks
Issue reported by NetSysFire:  engraving with a stack of multiple
weapons dulls the whole stack where it ought to only dull one of them.

This was actually trickier than it ought to have been, and will need
a lot more testing.  When engraving with a stack, split one off and
use just that one.  If inventory is full, it will be dropped (after
writing the first 2 characters and becoming duller).  I've avoided
moving it into the overflow slot, otherwise engraving repeatedly with
an arbitrarily large stack could be used to produce an arbitrary
number of overflow items.

Engraving with a weapon of known enchantment us somewhat more verbose
than it used to be.

From the report:
" It would be a great quality of life change if only one item of the
" specified stack was used, as with #forceing open chests.

One person's improved quality of life is another's outrage.  Players
who want to dull a stack of +6 daggers down to +5 in order to have
another try of enchanting to +7 are not going to like this....

Closes #1233
2024-04-20 17:00:04 -07:00
PatR
2afca0fc56 \#force feedback and some reformatting
Failed #force due to wielding wrong implement didn't phrase things
well if current weapon was a stack.

Plus some reformatting split out from a forthcoming #engrave patch.
2024-04-20 16:56:36 -07:00
Pasi Kallinen
a429eed984 Add Garden themeroom
Contains some wood nymphs and fountains, and the room walls are trees.

Adds a new lua hook for themeroom generation, "post_level_generate",
which is called last when generating the level.
2024-04-20 19:27:48 +03:00
PatR
9d71c8e1f4 Sunsword #invoke, directed at self
Give a resistance animation if you #invoke Sunsword while it's
wielded and direct its blinding ray at yourself.  Flashing a camera
at a monster who is wielding it will also produce the animation.
2024-04-19 10:50:46 -07:00
PatR
aaea81c6ac fix analyzer complaint
about testing whether an unsigned value is >= 0.  Since there's no
chance that it might have a value of NON_PM (-1), just comment out
the assertion that was intended to ward off a potential complaint
about that.
2024-04-18 23:14:35 -07:00
PatR
ea8ebea2d3 simplify a couple of monster naming bits 2024-04-18 12:34:03 -07:00
PatR
14c1cafdf8 undo part of "alternate symbol parsing"
Commit fddc966a3e included:
Add S_suit as another alternate for S_armor.

I got fooled by the description "suit or piece of armor" and was
thinking that each of the 7 armor slots had their own symbol that
could be overridden.

There's no need for S_suit when there isn't any S_helm, S_boots, &c.
2024-04-18 12:28:14 -07:00
Pasi Kallinen
4f271c912f Fuzzer vs repeat deaths, again
Even 100 deaths wasn't enough, as the fuzzer was still quitting.
If we're in wizmode, just execute wizmakemap to recreate the level,
getting rid of whatever was blocking hero from teleporting to safety.
2024-04-18 18:10:40 +03:00
Pasi Kallinen
08588a14f8 Prevent error when vault guard fails to relocate monster 2024-04-18 17:12:28 +03:00
Pasi Kallinen
bb3b9b7271 CHANGE_COLOR: Save the palette with #saveoptions 2024-04-18 09:24:34 +03:00
Pasi Kallinen
7db8f7c6a5 Fix mention_map and hiders causing a light source error
Prevent glyph change messages while loading a level file.
Otherwise a monster hiding under an item triggered a vision recalc
before light sources were linked to their sources, leading into
strange errors looking like pointer corruption.

getlev -> hide_monst -> hideunder -> newsym -> show_glyph ->
 pline_xy -> vision_recalc -> do_light_sources -> get_obj_location

Add in_getlev program state variable, analogous to in_mklev
2024-04-18 09:01:11 +03:00
PatR
064523e162 mon name of monster appearing as another monster
When a monster mimicks another monster (traditionally Double Trouble
Wizard, since 3.6.x also pet that eats a mimic corpse), using farlook
or getpos+autodescribe revealed the monster's real identity.  Hard to
believe that nobody ever noticed, but it was obvious when a pet dog
quick-mimicked a cat or vice versa.

Add an extra x_monnam() flag to ignore monst->m_ap_type==M_AP_MONSTER
plus monst->mappearance.  Only the m_monnam() variation of x_monnam()
includes it (via EXACT_NAME); monnam() and the rest will now describe
an M_AP_MONSTER by its appearance rather than as its true self.
2024-04-17 14:40:20 -07:00
PatR
7198981afd quickmimic bit
Improve the feedback for an unnamed pet eating a mimic corpse.
|You see a tripe ration where Rover was.
is ok.
|You see a tripe ration where the dog was.
looks somewhat odd.  Change that to be
|You see a tripe ration where your dog was.
2024-04-16 23:52:29 -07:00
PatR
29b4c47bdf fix #K4142 - camera flash vs mimic
When a camera flash hit a mimic which was posing as something, the
feedback mentioned the mimic but didn't bring it out of hiding.

Change to make light pass over a mimic impersonating an object but
unhide one impersonating furniture.  Ones impersonating some other
monster are woken up but wakeup doesn't force it back to mimic shape.

Trying to get the messages right brought on more code changes than
antipated.  I changed one of the arguments to mhidden_description()
so had to change its callers; fortunately there aren't very many.
2024-04-16 23:34:26 -07:00
nhmall
141dc9e52e Merge branch 'NetHack-3.7' of https://github.com/RainRat/NetHack into NetHack-3.7 2024-04-14 06:37:30 -04:00
Pasi Kallinen
bad63a0d36 Hallu Banana 2024-04-14 10:14:27 +03:00
RainRat
af3a321acb Merge branch 'NetHack:NetHack-3.7' into NetHack-3.7 2024-04-13 23:45:32 -07:00
nhmall
f2d0dbcc09 revise alt_color_spec() so digit count limits work 2024-04-13 13:06:38 -04:00
RainRat
262c9e763c Merge branch 'NetHack:NetHack-3.7' into NetHack-3.7 2024-04-13 09:15:39 -07:00
nhmall
86cb8dba60 use COLORVAL macro in change_palette() 2024-04-13 12:09:45 -04:00
nhmall
c30dbb2caa alt_color_spec follow-up 2024-04-13 12:00:37 -04:00
nhmall
3364ac7cdb CHANGE_COLOR:allow #rrggbb hex color specification 2024-04-13 09:08:14 -04:00
Pasi Kallinen
3086f16386 Shopkeepers bill you for using their bear trap or land mine 2024-04-13 15:10:15 +03:00
Pasi Kallinen
a57d0e6f4f Curses: add support for the palette config option
Depends on CHANGE_COLOR compile-time option.

Also allow multiple palette-definitions in the config file.
2024-04-13 12:01:43 +03:00
nhmall
ebd200ecc2 follow-up: preprocessor conditional 2024-04-12 21:59:59 -04:00
nhmall
15db874f71 CHANGE_COLOR palette option adjustments
It was too early to call the windowport change_color() routine
while processing the config file. The windowport was not yet
fully operational.

Now the palette option processing will just place the rgb
value into the appropriate ga.altpalette[CLR_MAX] entry.

init_sound_disp_gamewindows(void) [allmain.c] calls
change_palette() [coloratt.c] and it will call the windowport
change_color() function for each ga.altpalette[] entry that
has been set.

Notes:
The rgb values stored in ga.altpalette[] have the NH_ALTPALETTE bit set
so that the rgb value of 0 can be stored and be distinguishable from
a "not set" entry.

The NH_ALTPALETTE bit is cleared from the rgb value in change_palette()
prior to calling the windowport change_color() function.

The syntax for palette is colorname/r-g-b.
For example: palette:black/12-12-12

colorname must be one of the NH_BASIC_COLOR names or a suitable
alias for one of those 16 entries.

Some of the windowport CHANGE_COLOR functions had the wrong parameters,
perhaps due to bitrot. Those have been corrected to match the prototype.
2024-04-12 21:57:27 -04:00
RainRat
6445c97a4e Merge branch 'NetHack:NetHack-3.7' into NetHack-3.7 2024-04-12 09:03:48 -07:00
Pasi Kallinen
00d0700e75 Pit fiends can easily climb out of pits 2024-04-12 11:13:24 +03:00
RainRat
ef7046e9bf Merge branch 'NetHack:NetHack-3.7' into NetHack-3.7 2024-04-11 18:29:38 -07:00
RainRat
7b0ba4a562 Merge branch 'NetHack:NetHack-3.7' into NetHack-3.7 2024-04-11 14:00:18 -07:00
PatR
7da370d74a experimental hitpointbar change
For tty, make hitpointbar blink if current HP falls to the critical
HP threshold.  Doesn't require status highlighting.  Not changed:
when status highlighting is active, use the HP color but force the
attribute to be inverse (plus blink if the criterium is met) rather
than whatever the HP highlight specifies.

For curses, do the same thing.  It used to honor HP attribute for
hitpointbar, now it behaves the same as tty:  always inverse, maybe
combined with blink.  The new code assumes that inverse and color
can be turned off without turning off active blink in the process.

I had intended to make hitpointbar be a full-fledged status field
(which happens to be rendered on top of title) so that it could be
highlighted differently from hit points (mainly so that one could
highlight up and down changes while the other showed percentages).
This is less versatile than that but much simpler.
2024-04-11 11:06:29 -07:00
nhmall
16c693eedf fix lingering error on Windows nmake command line build
src\cmd.c(3453) : warning C4701: potentially uninitialized local variable 'func' used
src\cmd.c(3453) : error C4703: potentially uninitialized local pointer variable 'func' used
2024-04-11 12:23:56 -04:00
Pasi Kallinen
7cf7fe3c9b Init a possibly uninitialized variable 2024-04-11 18:52:51 +03:00