Commit Graph

99 Commits

Author SHA1 Message Date
Pasi Kallinen
282b2a7bbe Make explosions give feedback message
... even when the explosion doesn't hit anything.
2022-08-24 13:26:44 +03:00
Michael Meyer
66e98e1344 Don't describe sleep explosion as a "ray"
When breaking a wand of sleep, don't print the message "the sleep ray
hits you!" since it produces an area effect/explosion rather than a ray.
For a couple other wands, !ordinary (wand breakage) effects don't
produce a message (I assume because the do_break_wand feedback is
considered sufficient), but I put in an alternative message for the
explosion since I think it's important to inform the player the hero has
fallen asleep.
2022-08-18 15:57:53 -04:00
PatR
b07fe59b3c attack/damage by trapper and lurker above
Change trappers and lurkers above to remove digestion damage.  They
fold themselves around rather than swallow the victim.  There were
are lot of places that assumed that an engulfer which is an animal
would swallow and digest the victim.  In hindsight, it might have
been simpler to take the M1_ANIMAL flag off of trappers and lurkers
above.

This adds a new digests() predicate for creatures with AT_ENGL+AD_DGST
(purple worm) and also enfolds() for AT_ENGL+AD_WRAP (both 't'-class
critters).

There are several minor fixes mixed in with this.  I didn't record
them as I went along but the two I remember are
1) if poly'd into a holder and holding on to a monster, the '<' and
   '>' commands refursed to work; release the held creature first
   and then treat those commands as normal;
2) throwing a non-weapon while engulfed by an ochre jelly reported
   "the <item> vanishes into the ochre jelly's /currents/".

This needs a lot more testing.  I found and fixed multiple minor
details before my own testing burned out.
2022-08-15 04:14:36 -07:00
Pasi Kallinen
e5b8fc86eb Make explosions burn monster armor 2022-08-01 22:30:43 +03:00
nhmall
3004cf2d34 be more consistent with coordinates 2022-07-02 09:10:03 -04:00
nhmall
30b557f7d5 change xchar to other typedefs
One of the drivers of this change was that screen coordinates require a
type that can hold values greater than 127. Parameters to the window
port routines require a large type in order to be able to have values
a fair bit larger than COLNO and ROWNO passed to them, particularly for
their use to the right of the map window.

This splits the uses of xchar into 3 different situations, and adjusts
their type and size:

                        xchar
                          |
               -----------------------
               |          |          |
            coordxy     xint16     xint8

coordxy: Actual x or y coordinates for various things (moved to 16-bits).

xint16:  Same data size as coordxy, but for non-coordinate use (16-bits).

xint8:   There are only a few use cases initially, where it was very
         plain to see that the variable could remain as 8-bits, rather
         than be bumped to 16-bits.  There are probably more such cases
         that could be changed after additional review.

Note: This first changed all xchar variables to coordxy. Some were
reviewed and got changed to xint16 or xint8 when it became apparent that
their usage was not for coordinates.

This increments EDITLEVEL in patchlevel.h
2022-06-30 23:48:18 -04:00
nhmall
be76727265 granular verbose message suppression mechanics
Switch to using a macro invocation Verbos(n, s) in place of the
flags.verbose checks.

Provide the mechanics for individual suppression of any of the
existing messages that were considered verbose.

Mechanics only - this code update does not provide any means of
setting the suppression bits.

iflags.verbose = 0
is still a master suppression of all the verbose messages.

iflags.verbose = 1
turns on the verbose messages only for those whose suppression
bit is 0 (not set).
2022-06-09 13:53:20 -04:00
nhmall
a8f0e91ddf replace leading tabs in several files 2022-05-30 12:09:35 -04:00
PatR
ef9d874c22 more PR #771 - blast vs spell
Add the patch from entrez to describe the tower of flame effect from
a scroll of fire as "the blast" rather than "your spell" if it reveals
a secret door.
2022-05-28 14:09:31 -07:00
PatR
11de1496b1 more github issue #771 - feedback for oil potion \
explosion that reveals a secret door

Make the fix to feedback when an exploding potion of oil reveals a
door and then destroys it not affect other zap_over_floor feedback.
This incorporates the followup comment from entrez.
2022-05-23 17:49:37 -07:00
Pasi Kallinen
d76cf9377d Unhide monster when rolling boulder explodes 2022-03-16 16:43:42 +02:00
Pasi Kallinen
d2efae280a Fix monster trapped in nonexistent trap, pt 2
Monster hiding under an item on a location with a land mine,
a rolling boulder trap launches a boulder which blows up the mine,
and all the items scatter away. If the hider survived that, it
was still hiding.
2022-03-05 13:42:28 +02:00
PatR
20eccf8ead lost objects thrown by monsters
Reported by entrez:  if a monster or explosion kills the hero with an
object that has timers or is a light source, it could trigger a panic
when end of game cleanup can't find it because it has been removed
from the map or monster's inventory and not placed back on the map
yet.  This isn't much different from something thrown by hero which
had a similar situation dealt with a long time ago.  Fix by setting
'thrownobj' for monster-launched and explosion-launched missiles.
That way done_object_cleanup() called from really_done() will place the
missile on the map where saving bones or general cleanup can find it.

It doesn't bother dealing with exploding a lit potion of oil that
kills the hero by missile damage before the potion explodes.  If that
ends up in bones, it should still be lit and might blow up before the
new character reaches it.  (Not verified.)

The code for a hero polymorphed into a unicorn and catching a thrown
gem has been moved into its own routine.  No change in behavior, just
less clutter in the thrown-object-hits-hero section of the monster
throwing routine.
2022-02-24 18:10:52 -08:00
Pasi Kallinen
8e91320d2f Use u_at macro 2022-02-23 20:28:55 +02:00
Pasi Kallinen
91e2d3633e Use macro for a location next to hero 2022-02-12 11:05:10 +02:00
Pasi Kallinen
c722962713 Cancellation explodes magical traps 2022-01-28 08:30:08 +02:00
Pasi Kallinen
8db18275a6 Define engulfing_u, making clearer code 2021-12-31 21:12:21 +02:00
nhmall
9b57784348 rename explosion symbols
Use a slightly more meaningful name for each one rather than
a sequential numerical name.

S_explode1 to S_expl_tl
S_explode2 to S_expl_tc
S_explode3 to S_expl_tr
S_explode4 to S_expl_ml
S_explode5 to S_expl_mc
S_explode6 to S_expl_mr
S_explode7 to S_expl_bl
S_explode8 to S_expl_bc
S_explode9 to S_expl_br
2021-09-18 10:04:25 -04:00
nhmall
ed9647310a deal with gold leaving shop via scatter()
fixes #538
2021-07-10 19:41:55 -04:00
Pasi Kallinen
f25a6e26ee Use enums and defines for directions 2021-06-27 15:46:56 +03:00
Pasi Kallinen
6b60618e0e Exploding spheres cause real explosions
Despite active explosion attacks being called explosions in-game,
they only affected a single target, and were handled differently
from actual explosions. Make them do an actual explosion instead.
This should make spheres more interesting and inspire different
tactics handling them.

Because spheres deal more damage on average and can destroy items
in their explosions, their difficulty has been increased slightly.

Polyselfed hero exploding won't cause elemental damage to their
own gear.

Originally from xNetHack by copperwater <aosdict@gmail.com>.
2021-05-22 13:37:39 +03:00
Pasi Kallinen
2288452278 Monsters can see player resistances
If monsters see you resist something, generally elemental or magical
attack, or if they see you reflect an attack, they learn that and
will adjust their attack accordingly.

Originally from SporkHack, but this version comes via EvilHack with
some minor changes.
2021-05-17 20:01:11 +03:00
PatR
a5410c8bbb explode() arguments
Argument explanation and Formatting.
2021-04-27 12:53:50 -07:00
PatR
5a8c978b1e scatter() vs sinks
Objects shot, thrown, or kicked by the hero or by monsters stop
short if they try to pass over a sink; make objects launched by
an explosion behave similarly.
2021-02-13 15:15:21 -08:00
nhmall
9566752c08 clear some more format-overflow warnings
clear some -Wformat-overflow warnings being experienced with
i586-pc-msdosdjgpp-gcc (GCC) 10.2.0 cross-compiler

--
Warnings log:

botl.c: In function 'status_hilite_menu_add':
botl.c:3661:38: warning: ' or ' directive writing 4 bytes into a region of size between 1 and 80 [-Wformat-overflow=]
 3661 |                     Sprintf(obuf, "%s or %s",
      |                                      ^~~~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from botl.c:6:
../include/global.h:274:24: note: 'sprintf' output between 5 and 163 bytes into a destination of size 80
  274 | #define Sprintf (void) sprintf
botl.c:3661:21: note: in expansion of macro 'Sprintf'
 3661 |                     Sprintf(obuf, "%s or %s",
      |                     ^~~~~~~

do_name.c: In function 'getpos_menu':
do_name.c:594:37: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
  594 |             Sprintf(fullbuf, "%s%s%s", firstmatch,
      |                                     ^
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from do_name.c:6:
../include/global.h:274:24: note: 'sprintf' output 1 or more bytes (assuming 257) into a destination of size 256
  274 | #define Sprintf (void) sprintf
do_name.c:594:13: note: in expansion of macro 'Sprintf'
  594 |             Sprintf(fullbuf, "%s%s%s", firstmatch,
      |             ^~~~~~~

dungeon.c: In function 'print_dungeon':
dungeon.c:2172:27: warning: '%s' directive writing up to 1407 bytes into a region of size 256 [-Wformat-overflow=]
 2172 |             Sprintf(buf, "%s: %s %d", dptr->dname, descr, dptr->depth_start);
      |                           ^~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from dungeon.c:6:
../include/global.h:274:24: note: 'sprintf' output between 10 and 1427 bytes into a destination of size 256
  274 | #define Sprintf (void) sprintf
dungeon.c:2172:13: note: in expansion of macro 'Sprintf'
 2172 |             Sprintf(buf, "%s: %s %d", dptr->dname, descr, dptr->depth_start);
      |             ^~~~~~~
dungeon.c:2169:27: warning: '%s' directive writing up to 1407 bytes into a region of size 256 [-Wformat-overflow=]
 2169 |             Sprintf(buf, "%s: %s %d to %d", dptr->dname, makeplural(descr),
      |                           ^~
dungeon.c:2169:26: note: directive argument in the range [-2147483647, 2147483646]
 2169 |             Sprintf(buf, "%s: %s %d to %d", dptr->dname, makeplural(descr),
      |                          ^~~~~~~~~~~~~~~~~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from dungeon.c:6:
../include/global.h:274:24: note: 'sprintf' output 10 or more bytes (assuming 1427) into a destination of size 256
  274 | #define Sprintf (void) sprintf
dungeon.c:2169:13: note: in expansion of macro 'Sprintf'
 2169 |             Sprintf(buf, "%s: %s %d to %d", dptr->dname, makeplural(descr),
      |             ^~~~~~~
dungeon.c: In function 'print_mapseen':
dungeon.c:3185:33: warning: '%s' directive writing up to 255 bytes into a region of size 249 [-Wformat-overflow=]
 3185 |         Sprintf(outbuf, " (play %s to open or close drawbridge)", tmp);
      |                                 ^~                                ~~~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from dungeon.c:6:
../include/global.h:274:24: note: 'sprintf' output between 37 and 292 bytes into a destination of size 256
  274 | #define Sprintf (void) sprintf
dungeon.c:3185:9: note: in expansion of macro 'Sprintf'
 3185 |         Sprintf(outbuf, " (play %s to open or close drawbridge)", tmp);
      |         ^~~~~~~
dungeon.c:3350:35: warning: '%s' directive writing up to 255 bytes into a region of size 240 [-Wformat-overflow=]
 3350 |         Sprintf(buf, "%sThe castle%s.", PREFIX, tunesuffix(mptr, tmpbuf));
      |                                   ^~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from dungeon.c:6:
../include/global.h:274:24: note: 'sprintf' output between 18 and 273 bytes into a destination of size 256
  274 | #define Sprintf (void) sprintf
dungeon.c:3350:9: note: in expansion of macro 'Sprintf'
 3350 |         Sprintf(buf, "%sThe castle%s.", PREFIX, tunesuffix(mptr, tmpbuf));
      |         ^~~~~~~

explode.c:541:69: warning: '%s' directive writing up to 255 bytes into a region of size 236 [-Wformat-overflow=]
  541 |                     Sprintf(g.killer.name, "caught %sself in %s own %s", uhim(),
      |                                                                     ^~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from explode.c:5:
../include/global.h:274:24: note: 'sprintf' output 21 or more bytes (assuming 276) into a destination of size 256
  274 | #define Sprintf (void) sprintf
explode.c:541:21: note: in expansion of macro 'Sprintf'
  541 |                     Sprintf(g.killer.name, "caught %sself in %s own %s", uhim(),
      |                     ^~~~~~~

hacklib.c: In function 'yyyymmddhhmmss':
hacklib.c:1034:28: warning: '%02d' directive writing between 2 and 11 bytes into a region of size between 4 and 11 [-Wformat-overflow=]
 1034 |     Sprintf(datestr, "%04ld%02d%02d%02d%02d%02d", datenum, lt->tm_mon + 1,
      |                            ^~~~
hacklib.c:1034:22: note: directive argument in the range [-2147483647, 2147483647]
 1034 |     Sprintf(datestr, "%04ld%02d%02d%02d%02d%02d", datenum, lt->tm_mon + 1,
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from hacklib.c:7:
../include/global.h:274:24: note: 'sprintf' output between 15 and 67 bytes into a destination of size 15
  274 | #define Sprintf (void) sprintf
hacklib.c:1034:5: note: in expansion of macro 'Sprintf'
 1034 |     Sprintf(datestr, "%04ld%02d%02d%02d%02d%02d", datenum, lt->tm_mon + 1,
      |     ^~~~~~~
2021-02-01 16:36:17 -05:00
nhmall
f963c5aca7 switch source tree from k&r to c99 2021-01-26 21:06:16 -05:00
nhmall
0c3b9642e4 pmnames mons gender naming plus a window port interface change
add MALE, FEMALE, and gender-neutral names for individual monster species
to the mons array. The gender-neutral name (NEUTRAL) is mandatory, the
MALE and FEMALE versions are not.

replace code uses of the mname field of permonst with one of the three
potentially-available gender-specific names.

consolidate some separate mons entries that differed only by species into a
single mons entry (caveman, cavewoman and priest,priestess etc.)

consolidate several "* lord" and "* queen/* king" monst entries into
their single species, and allow both genders on some where it makes some
sense (there is probably more work and cleanup to come out of this at some
point, and the chosen gender-neutral name variations are not cast in stone
if someone has better suggestions).

related function or macro additions:
    pmname(pm, gender) to get the gender variation of the permonst name. It
    guards against monsters that haven't got anything except NEUTRAL naming
    and falls back to the NEUTRAL version if FEMALE and MALE versions are
    missing.

    Ugender to obtain the current hero gender.
    Mgender(mtmp) to obtain the gender of a monster

While the code can safely refer directly to pmnames[NEUTRAL] safely in the
code because it always exists, the other two (pmnames[MALE] and
pmnames[FEMALE] may not exist so use:
    pmname(ptr, gidx)
      where -ptr is a permonst *
            -gidx is an index into the pmnames array field of the
             permonst struct
pmname() checks for a valid index and checks for null-pointers for
pmnames[MALE] and pmnames[FEMALE], and will fall back to pmnames[NEUTRAL] if
the pointer requested if the requested variation is unavailable, or if the
gidx is out-of-range.

Allow code to specify makemon flags to request female or male (via MM_MALE
and MM_FEMALE flags respectively)to makedefs, since the species alone doesn't
distinguish male/female anymore. Specifying MM_MALE or MM_FEMALE won't
override the pm M2_MALE and M2_FEMALE flags on a mons[] entry.

male and female tiles have been added to win/share/monsters.txt.
The majority are duplicated placeholders except for those that were
separate mons entries before. Perhaps someone will contribute artwork in the
future to make the male and female variations visually distinguishable.

tilemapping via has the MALE tile indexes in the glyph2tile[]
array produced at build time. If a window port has information that the
FEMALE tile is required, it just has to increment the index returned
from the glyph2tile[] array by 1.

statues already preserved gender of the monster through STATUE_FEMALE
and STATUE_MALE, so ensure that pmnames takes that into consideration.

I expect some refinement will be required after broad play-testing puts it to
the test.

    consolidate caveman,cavewoman and priest,priestess monst.c entries etc

This commit will require a bump of editlevel in patchlevel.h because it alters
the index numbers of the monsters due to the consolidation of some. Those
index numbers are saved in some other structures, even though the mons[] array
itself is not part of the savefile.

Window Port Interface Change

Also add a parameter to print_glyph to convey additional information beyond
the glyph to the window ports. Every single window port was calling back to
mapglyph for the information anyway, so just included it in the interface and
produce the information right in the display core.

The mapglyph() function uses will be eliminated, although there are still some
in the code yet to be dealt with.

win32, tty, x11, Qt, msdos window ports have all had adjustments done to
utilize the new parameter instead of calling mapglyph, but some of those
window ports have not been thoroughly tested since the changes.

Interface change additional info:

    print_glyph(window, x, y, glyph, bkglyph, *glyphmod)
            -- Print the glyph at (x,y) on the given window.  Glyphs are
               integers at the interface, mapped to whatever the window-
               port wants (symbol, font, color, attributes, ...there's
               a 1-1 map between glyphs and distinct things on the map).
            -- bkglyph is a background glyph for potential use by some
               graphical or tiled environments to allow the depiction
               to fall against a background consistent with the grid
               around x,y. If bkglyph is NO_GLYPH, then the parameter
               should be ignored (do nothing with it).
                -- glyphmod provides extended information about the glyph
               that window ports can use to enhance the display in
               various ways.
                    unsigned int glyphmod[NUM_GLYPHMOD]
               where:
                    glyphmod[GM_TTYCHAR]  is the text characters associated
                                          with the original NetHack display.

                    glyphmod[GM_FLAGS]    are the special flags that denote
                                          additional information that window
                                          ports can use.

                    glyphmod[GM_COLOR] is the text character
                                       color associated with the original
                                       NetHack display.

Support for including the glyphmod info in the display glyph buffer
alongside the glyph itself was added and is the default operation.
That can be turned off by defining UNBUFFERED_GLYPHMOD at compile time.
With UNBUFFERED_GLYPHMOD operation, a call will be placed to map_glyphmod()
immediately prior to every print_glyph() call.
2020-12-26 11:23:23 -05:00
Pasi Kallinen
6a35a84c56 Fire sources can ignite candles, lamps, and potions of oil
... on the floor, in monster inventory, and in hero's inventory.

Items in your inventory being ignited produce a message even if you're
blind - you can see the lit-state by viewing inventory anyway, so just
give player the message.

(via xNetHack)
2020-09-30 19:49:10 +03:00
nhmall
ac9ba38449 file header bump from "NetHack 3.6" to "NetHack 3.7" 2020-08-03 22:07:36 -04:00
PatR
1afa961416 fix github issue #343 - scattered objects
landing on water or lava without being affected.

Reported for exploding bag of holding but has been a latent issue
for scatter() for ages.

Fixes #343
2020-05-12 15:26:28 -07:00
nhmall
3ccc6e5308 Merge branch 'NetHack-3.6' 2019-10-17 20:52:10 -04:00
Pasi Kallinen
9e9ee59ca7 Fix hero hiding under a statue shattered by land mine
Trigger a land mine while being polymorphed into a monster that
automatically hides (eg. scorpion). Have the statue on the land mine
shatter and all items on that square scatter away. Avoid falling
into the pit left by the land mine.
2019-10-13 19:30:32 +03:00
nhmall
72fcfadf23 Merge branch 'NetHack-3.6' 2019-10-08 20:27:39 -04:00
Pasi Kallinen
e92445810f Fix ball and chain sanity
Scatter did not consider the ball or chain, and moved them around, causing
ball and chain sanity error.

One way to trigger was being punished, with chain on a land mine and having
a monster trigger the mine. Now the chain will shatter, unpunishing the hero.
2019-10-08 19:47:51 +03:00
Bart House
1c65e6afe0 context to g.context 2018-12-25 07:29:38 -08:00
Bart House
8c1a4d9a97 invent, youmonst, hackdir moved to g. 2018-12-24 21:04:15 -08:00
Bart House
be5cdcf77a killer, level and rooms move to instance globals. 2018-12-24 19:50:08 -08:00
Bart House
572ee347b9 Another round of instance globals changes. 2018-12-24 16:43:50 -08:00
Bart House
576eece500 More globals moved to instance_globals. 2018-12-19 21:26:35 -08:00
Bart House
e4ab048c90 Even more globals moved to instance_globals.c 2018-12-19 20:01:55 -08:00
PatR
011181a6ed make diluted oil less effective than normal oil
Suggested 6.5 years ago...
2018-12-18 17:16:05 -08:00
PatR
e5c488b15e fix github pull request #161 - scatter()
Fixes #161

Report states that scattering objects might leave a 'pile' glyph when
no longer appropriate.  I didn't try to reproduce that, just took it
on faith.  The fix tried to be too efficient and might have missed
fixing the display if breaks() or ohitmon() destroyed the objects
being scattered and left 'total' at 0.
2018-11-24 15:22:33 -08:00
PatR
4f61e9697c fix github issue #134 - display of migrated objects
Fixes #134

An invisible hero (who can't see invisible and doesn't have autopickup
enabled) going down stairs to an object which fell down those stairs
will see the stairs instead of the object on them.  Missing newsym()
in obj_delivery() when objects aren't being passed through scatter().
2018-09-22 15:18:38 -07:00
Pasi Kallinen
d2eba695c8 Use DEADMONSTER instead of checking mhp 2018-08-30 20:05:18 +03:00
PatR
c058826995 fix #H7015 - explosion chain reaction bug
The fix to prevent "crushed by a gas spore's explosion" set killer.name
to an empty string after a gas spore explosion finished, but that made
nested explosions end up with empty killer.name after the innermost
call completed.  explode() shouldn't have been hanging on to a pointer
to a global value that is subject to change while it executes.  Making
a local copy of the current value at the time explode() is called will
solve that (I hope...).

Simply reverting the reset of killer.name wouldn't have been correct.
The innermost explosion would still be clobbering killer.name for any
outer MON_EXPLODE explosions in progress.  When the only exploding
monster is gas spore, that wouldn't be noticeable.  But having other
types of exploding monsters and a chain reaction which affected more
than one type would have exposed that bug.  I think this fixes both
aspects of this problem but don't have a second type of exploding
monster to verify the second part.
2018-03-30 17:05:23 -07:00
PatR
892f210c1e fix #H6610 - completely burnt paper golem
When a monster killed a paper golem with a fire attack, the player was
told that the golem "burns completely" yet it might still leave some
blank scrolls as 'corpse'.  The fix for that was one-line, but several
other death-by-fire situations which didn't report "burns completely"
were also leaving scrolls:  fireball spell or scroll of fire or other
fire explosions (if any), also wand of fire.  Fire trap and poly'd
hero with fire attack were already suppressing 'corpse'.
2017-12-14 16:22:36 -08:00
PatR
1deb8dbcf1 more explosion vs u.ustuck
Fix a FIXME (poly'd hero hit by explosion while holding a monster
which is also hit by that explosion takes double damage even if the
held monster got killed) and an incorrect comment.

Add a FIXME about grabbers (monster or hero) who are outside the
explosion radius but holding someone who is inside.
2017-11-25 17:01:06 -08:00
PatR
4dbfb4abeb fix #H6489 - explosion double damage to ustuck
Report asked why u.ustuck takes double explosion damage, and concocting
a reason uncovered several inconsistencies.  Grabber takes double damage
for reaching into hero's spot, but only when that spot is within the
explosion's radius and only if hero isn't engulfed.  Poly'd hero takes
double damage if holding a monster which is hit by the explosion.

There are still multiple bugs here:  if the hero is grabbing a monster
which gets killed by the explosion, the fact that one was held is
forgotten by the time damage is inflicted upon the hero.  Just a messy
detail that I opted not to get bogged down in.  But much messier is
that grabber might be outside the explosion radius reaching into that
to hold grabbee, in which case no damage is inflicted.  Handling that
for out-of-range monster holding exploded hero shouldn't be very tough,
but handling it for out-of-range hero holding exploded monster could be
hard.  Anyway, it's more headache than I intend to tackle.
2017-11-23 16:37:20 -08:00
Pasi Kallinen
4b7aea0eac Fold invisible glyph unmapping into single function 2017-10-07 16:24:49 +03:00
PatR
719af503e7 fix #H6104 - no potion handling in thitu()
thitu() is mostly used for arrows and darts "thrown" by traps, but
scatter() uses it on items launched by a land mine explosion.  Traps
had no need for potion handling, but scattering does.  Changing thitu()
to call potionhit() required that more information be passed to the
latter in case killer reason was needed, and thitu()'s callers needed
to be updated since it now might use up its missile (only when that's
a potion, so scatter() is only caller which actually needed to care).

Quite a bit of work--especially the testing--for something which will
never be noticed in actual play.  In hindsight, it would have been
much simpler just to make scatter destroy all potions rather than
allow the 1% chance of remaining intact (via obj_resists()), or else
leave any intact ones at the explosion spot instead of launching them.
2017-09-25 10:42:43 -07:00