Commit Graph

8284 Commits

Author SHA1 Message Date
nhmall
cd3f66dcfc Merge branch 'NetHack-3.6.2' 2019-01-22 06:12:18 -05:00
nhmall
cd43f4b462 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-22 06:12:00 -05:00
PatR
a14752ab47 shielding bashing
Extracted from a larger patch:  the only way to get silver damage
bonus from attacking with a shield of reflection (polished silver
shield) is to throw it or to wield it.  Give different feedback when
hitting something while wielding a shield (or an iron ball; it seemed
appropriate despite having nothing to due with wanting to dish out
silver damage).
2019-01-21 18:54:37 -08:00
PatR
3c7eca5418 hmonas() simulated twoweap
Regular two-weapon requires that both weapons actually be weapons or
at least weapon-tools.  Simulation of that while polymorphed allowed
any one-handed object as the primary weapon.
2019-01-21 18:49:44 -08:00
nhmall
00f2feb83d Merge branch 'NetHack-3.6.2' 2019-01-21 06:47:42 -05:00
nhmall
b5504c27e0 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-21 06:47:20 -05:00
Pasi Kallinen
f6b9dc7d68 Don't try to write a zero-length message
If the message history contains a zero-length message line, skip it,
as trying to write a zero-length string will make bwrite panic.

Happened only on X11. This is post-3.6.1 bug.
2019-01-21 11:56:19 +02:00
Pasi Kallinen
77bc07f579 Make demon gating show a message
This was both an accessibility and comprehensibility issue.
2019-01-20 15:56:44 +02:00
nhmall
a6c290399b Windows warning fix 2019-01-19 11:04:26 -05:00
nhmall
28ac8090f9 Merge branch 'NetHack-3.6.2' 2019-01-18 18:51:12 -05:00
nhmall
affe4a1bc5 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-18 18:50:51 -05:00
PatR
9a39618fb3 fix #H7983 - inconsistent shop 'for sale' behavior
Items on floor in the free spot one step inside a shop's doorway were
showing shop sell prices.  Treat items on that spot as if they were
flagged no_charge as on the floor of other shop squares.

Report stated that sometimes they showed a 'for sale' price and
sometimes they didn't, but I didn't see any cases where they didn't.
2019-01-18 14:13:30 -08:00
PatR
3506c24d39 fix #H7980 - multiple weapon attacks when poly'd
This fixes the weapon related aspects of #H7980:  having an alternate
weapon be used in cases where it shouldn't when polymorphed into a
monster form with multiple weapon attacks.  The most egregious was
using an off-hand artifact, but it would also use off-hand two-handed
weapon, off-hand silver weapon when in silver-hating form, or any
reasonable off-hand weapon when wearing a shield.  That last is iffy
whether or not to allow, since you'll still get the extra attacks
whether it switches to secondary weapon or stays with the primary.
I've made it re-use the primary since two-weapon mode doesn't allow
a shield.  The other oddity was being able to use the secondary
weapon on the second swing even if the first swing was weaponless.
I went with ingoring the secondary weapon if there's no primary one
or if the primary is two-handed.

Report included "cursed secondary doesn't weld" but that has nothing
to do with polymorph attacking.  I've changed that to drop the weapon
if you attack with it when it's cursed, similar to what happens when
secondary weapon becomes cursed while two-weaponing.

It also included "marilith's attacks beyond the second don't use any
weapon and can hit cockatrices without touching them".  A marilith has
two weapon attacks and then four claw attacks.  Claw attacks only use
the weapon if it hasn't been used yet, so marilith hits with primary,
secondary (or primary a second time if no secondary), claw, claw,
claw, claw and that's the intended behavior.  It is able to hit
cockatrices if wielding anything at all, same as a monster with just
a single attack.  Since it is impossible to wield six weapons or three
pairs of gloves, that has to be intended behavior too.  Playability
trumps realism even if it is silly to hit without a 3rd through 6th
weapon and be safe from touching the target due to the 1st weapon or
one pair of gloves.  [Situation is different from having no control
over unsafely biting something after making a safe weapon or claw
attack; perhaps a better solution would be to refrain from using the
four claw attacks when attacking something that is fatal to touch.]
2019-01-18 13:22:43 -08:00
nhmall
53cedcfc2f merge NetHack-3.6.2 into master part 2 2019-01-16 20:09:41 -05:00
nhmall
0bb98b4155 Merge branch 'NetHack-3.6.2' 2019-01-16 20:04:59 -05:00
nhmall
f05ce051e3 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-16 20:04:03 -05:00
PatR
b9f38fdd14 fix #H6285 - flooreffects and deltrap panic
Reported 14 months ago, a monster reading a scroll of earth which
dropped a boulder that killed another monster in an adjacent pit
was giving credit/blame to the hero and could also trigger a panic.
If the monster was killed, the pit would be filled and deleted via
m_detach and then when flooreffects tried to delete the same trap,
it accessed freed memory and deltrap could panic.
2019-01-16 15:08:11 -08:00
nhmall
e6f550dc79 Merge branch 'NetHack-3.6.2' 2019-01-14 21:20:42 -05:00
nhmall
60129c524a Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-14 21:20:24 -05:00
PatR
521dbe8f94 potion mixing bit
Noticed when looking at whether alchemy ought to remove user-assigned
name.  Get rid of the potion being dipped into sooner so that it won't
still be present if a perm_invent update takes place.
2019-01-14 18:13:59 -08:00
nhmall
b629085b42 Merge branch 'NetHack-3.6.2' 2019-01-14 21:09:45 -05:00
nhmall
e741157671 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-14 21:09:27 -05:00
PatR
285606d4c6 more explicit enum values 2019-01-14 17:10:46 -08:00
PatR
97b28bd846 level arrival
The check I added to make sure that a monster was at the hero's
coordinates before deciding to move one or the other would have been
confused by a long worm's tail.  Check that they're at that spot but
not by comparing monst.<mx,my> coordinates with <ux,uy>.

Also, don't have wiz_makemap() assume that each level of the Wizard's
Tower has the same boundary coordinates.  Keep track of whether hero
is inside that tower before discarding the old level.
2019-01-14 16:35:19 -08:00
nhmall
c93e9b31dc merge NetHack-3.6.2 part2 2019-01-14 18:22:02 -05:00
nhmall
98acd55fcc Merge branch 'NetHack-3.6.2' 2019-01-14 18:16:19 -05:00
nhmall
c71c64144d Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-14 18:09:26 -05:00
PatR
992f141ab7 \#wizmakemap followup
Both u_on_rndspot() and losedogs() might result in having a monster
and the hero be at the same location.  Have wiz_makemap() use the
same fixup for that as goto_level().
2019-01-14 09:28:10 -08:00
PatR
64821f4ad5 more enums with explicit values
As before, it's an aid to finding things if you're looking for something
by its numeric value.
2019-01-13 17:19:39 -08:00
PatR
d735d04b5b \#wizmakemap update
The need for resetting lock picking when swapping in a new level made
me wonder whether other things should be reset too, and there were a
bunch:  digging, travel destination, polearm target, being in water,
being swallowed or held, hiding.  Hero placement was ignoring arrival
region.  Also, it turned out to be pretty easy to fix the FIXME about
steed.
2019-01-13 15:24:08 -08:00
PatR
355dec4d84 blocking or unblocking levitation or flight
when level teleporting or digging.  Level teleporting while levitation
was blocked due to being inside solid rock didn't notice that it should
be unblocked until you moved from whatever type of terrain you landed
on (room, for instance) to some other type (such as corridor).  Digging
down to make a pit or hole while inside solid rock converts that spot
to floor so should also check whether to unblock levitation/flying, and
not fall if unblocking occurs.
2019-01-13 15:17:40 -08:00
Pasi Kallinen
abcdb713d5 wizmakemap should reset lockpicking 2019-01-13 17:27:17 +02:00
nhmall
090aa4a96d Merge branch 'NetHack-3.6.2' 2019-01-12 21:22:03 -05:00
nhmall
7e511d50c2 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-12 21:21:42 -05:00
PatR
61409fb769 bz 406/#H4298 revisited
Redo the Ft.Ludios entry hack to suppress the lit walls on the left
and top rather than to light the upper-right corner.  Only noticeable
if carrying a lit candle.  Usually, that is.  This simpler hack could
be detected visually from the treasure room side of the walls involved
but normally won't be.
2019-01-12 17:43:52 -08:00
nhmall
034ce7e8bd Merge branch 'NetHack-3.6.2' 2019-01-12 01:09:17 -05:00
nhmall
135b7c5c04 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-12 01:08:58 -05:00
PatR
dec0829ab5 workaround #H4298/bz 406 - vision glitch
The entry chamber for the Fort Ludios level would be completely lit
except for one corner wall if you arrived carrying a lit candle.  The
unlit spot turns out to be correct, it is beyond candle radius, but
spots further away than that were showing up lit.  That's due to them
bordering a lit region on the opposite side and lit regions seem to
be bigger than their specified dimensions.

I tried to make the lit walls be unlit but it wasn't working.  (Making
the lit region be smaller would probably work but might have unintended
consequences when populating the zoo room.  I didn't try that.)  This
makes the unlit corner show up if light hits the spot next to it, so
that it behaves like the other lit walls surrounding that entry area.

I haven't marked the bug report closed because I don't think this is
the proper way to fix this.
2019-01-11 19:08:02 -08:00
PatR
8b02e5b32b enum values
Give the enum lists in several header files explicit values.  Adding
or removing new entries will be more tedious, but doing that is rare
and being able to grep the headers for numeric values in addition to
names is very useful.

rm.h also has a bunch of tabs replaced with spaces.
2019-01-11 17:18:48 -08:00
nhmall
47171cbcdc Merge branch 'NetHack-3.6.2' 2019-01-10 22:46:00 -05:00
nhmall
da1d62f9a1 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-10 22:45:41 -05:00
Pasi Kallinen
5e2236a3ef Fix accessing deleted fire trap
melt_ice can delete the fire trap, in the case where the trap
is on ice, and a monster carrying a boulder triggers it, then drowns.

mintrap -> minliquid -> mondead -> ... -> mdrop_obj ->
   flooreffects -> boulder_hits_pool -> delfloortrap
2019-01-10 21:48:20 +02:00
nhmall
cbcb1ea7eb Merge branch 'NetHack-3.6.2' 2019-01-10 09:42:38 -05:00
nhmall
9641864861 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-10 09:26:27 -05:00
PatR
b1782b813f SEDUCE=0
When SEDUCE is disabled, instead of swapping attacks in mons[] once,
do it on the fly in getmattk() whenever needed.  That allows mons[]
to become readonly, although this doesn't declare it 'const' because
doing so will require a zillion 'struct permonst *' updates to match.

This seemed trickier than it should be, but that turned out to be
because the old behavior was broken.  Setting SEDUCE=0 in sysconf or
user's own configuration file resulted in all succubus and incubus
attacks being described as monster smiles engagingly or seductively
rather than hitting (while dishing out physical damage).  I didn't
try rebuilding 3.4.3 to see whether this was already broken before
being migrated to SYSCF.
2019-01-10 03:10:35 -08:00
PatR
79d40658c7 characteristics loss
A hero run by the fuzzer that has characteristics plummet to 3 and
then sometimes hang around there instead of being recovered by restore
ability is happening because loss that tries to reduce the base value
below 3 lowers the max (peak) value instead, and once that also gets
down to 3, restore ability is no longer able to do anything with it.
This changes an attempt to reduce a characteristic by N points below 3
to reduce it by rn2(N + 1) instead.  That's N/2 on average and a 50%
chance to be 0 when N is 1, so the peak value reached doesn't plummet
to 3 quite to quickly.  It can still drop to that though.

There is a pull request dealing with simplifying attribute handling
and part of it affects the code being changed here, but the bit of
simplification included in this patch doesn't use it.
2019-01-09 18:18:11 -08:00
PatR
a637e91f37 miscellaneous formatting
Some minor stuff that's been sitting around for a while.
2019-01-09 18:15:43 -08:00
PatR
bb86fa2bb7 hero infravision
Take a first step towards making the mons[] array be readonly.
The only other place that updates it is when changing succubus and
incubus AD_SSEX attacks to AD_SEDU ones and that can be handled
via existing getmattk(), but so far has proven to be trickier than
anticipated.
2019-01-09 18:10:55 -08:00
nhmall
d4a469a7a6 Merge branch 'NetHack-3.6.2' 2019-01-09 09:22:46 -05:00
nhmall
580a6ab9c1 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-09 09:22:29 -05:00