Commit Graph

235 Commits

Author SHA1 Message Date
Pasi Kallinen
1f6a7a5eef Init the done variable to false 2020-12-04 09:30:22 +02:00
Pasi Kallinen
4fb370ee79 Remove unused variables 2020-12-04 09:30:21 +02:00
Pasi Kallinen
b797baba7a Make return values use defines 2020-12-04 09:30:21 +02:00
Pasi Kallinen
3ef3b425ad Unify the ad type switches 2020-12-04 09:30:21 +02:00
Pasi Kallinen
88e333a3a8 Unify ad_ssex 2020-12-04 09:30:21 +02:00
Pasi Kallinen
1696019361 Unify ad_sedu 2020-12-04 09:30:21 +02:00
Pasi Kallinen
376593dad5 Unify ad_dise 2020-12-04 09:30:21 +02:00
Pasi Kallinen
4118a7ea44 Unify ad_samu 2020-12-04 09:30:21 +02:00
Pasi Kallinen
e777bd9670 Unify ad_legs 2020-12-04 09:30:20 +02:00
Pasi Kallinen
337e7da049 Unify ad_stun 2020-12-04 09:30:19 +02:00
Pasi Kallinen
12ee144936 Unify ad_heal 2020-12-04 09:30:19 +02:00
Pasi Kallinen
4901c8027c Unify ad_were 2020-12-04 09:30:19 +02:00
Pasi Kallinen
a6a676f720 Unify ad_ston 2020-12-04 09:30:19 +02:00
Pasi Kallinen
20b6ea602b Unify ad_phys 2020-12-04 09:30:19 +02:00
Pasi Kallinen
36bb52466d Unify ad_deth 2020-12-04 09:30:19 +02:00
Pasi Kallinen
2999233332 Unify ad_pest 2020-12-04 09:30:18 +02:00
Pasi Kallinen
cb55d7c30f Unify ad_famn 2020-12-04 09:30:18 +02:00
Pasi Kallinen
618feabd88 Unify ad_poly 2020-12-04 09:30:18 +02:00
Pasi Kallinen
fda63d145b Unify ad_conf 2020-12-04 09:30:18 +02:00
Pasi Kallinen
558ec78b3a Unify ad_slow 2020-12-04 09:30:18 +02:00
Pasi Kallinen
b80c30bcf1 Unify ad_ench 2020-12-04 09:30:18 +02:00
Pasi Kallinen
96a4d14a36 Unify ad_slim 2020-12-04 09:30:17 +02:00
Pasi Kallinen
eb5508ba58 Unify ad_slee 2020-12-04 09:30:17 +02:00
Pasi Kallinen
654220f840 Unify ad_plys 2020-12-04 09:30:17 +02:00
Pasi Kallinen
7914237fbf Unify ad_wrap 2020-12-04 09:30:17 +02:00
Pasi Kallinen
bfb8931188 Unify ad_stck 2020-12-04 09:30:17 +02:00
Pasi Kallinen
b4ed25da46 Unify ad_drin 2020-12-04 09:30:17 +02:00
Pasi Kallinen
1ca0165bb9 Unify ad_drst 2020-12-04 09:30:16 +02:00
Pasi Kallinen
dba9aaf424 Unify ad_curs 2020-12-04 09:30:16 +02:00
Pasi Kallinen
d325e2cc60 Unify ad_blnd 2020-12-04 09:30:16 +02:00
Pasi Kallinen
607d1bcd96 Unify ad_tlpt 2020-12-04 09:30:16 +02:00
Pasi Kallinen
bfe773812e Unify ad_sgld 2020-12-04 09:30:16 +02:00
Pasi Kallinen
b7899ee014 Unify ad_acid 2020-12-04 09:30:15 +02:00
Pasi Kallinen
8a78c49fea Unify ad_elec 2020-12-04 09:30:15 +02:00
Pasi Kallinen
6abfe7e548 Unify ad_cold 2020-12-04 09:30:15 +02:00
Pasi Kallinen
6712876801 Unify ad_fire 2020-12-04 09:30:14 +02:00
Pasi Kallinen
cfd819f1c1 Unify ad_drli 2020-12-04 09:30:14 +02:00
Pasi Kallinen
518798d0d2 Unify ad_dren 2020-12-04 09:30:14 +02:00
Pasi Kallinen
6436ea1532 Unify ad_dcay 2020-12-04 09:30:14 +02:00
Pasi Kallinen
0d445a7a7c Unify monster-hits-monster 2020-12-04 09:30:14 +02:00
PatR
bb9df368af fix github issue #401 - roast/rust/rot in peace
This tries to fix the problem of the extra message when a tame
golem is completely destroyed (paper or straw golem burned, iron
golem rusted, wood or leather golem rotted) being issued at odd
times.  I basically punted on the visibility aspect since the
original logic was strange:  you had to be able to see both the
attacker's and defender's spots and at least one of those two
monsters.  Now mon-attacks-mon visibility requires that you be
able to see one of the two and if you don't see both, the unseen
one will be referred to as "it".  The "may the iron golem rust
in peace" message is independent of that and may be displayed
after "you have a sad feeling", but now that's intentional and
will refer to an unseen pet by name or monster type, not "it".

This needs a lot of testing and hasn't attempted to address
issue #402:  only some attacks that should compeletely destroy
a golem actually do so.  (So a hit by fire elemental against a
paper golem does, but passive fire counterattack when a paper
golem hits a fire elemental doesn't, nor does a wand of fire
or being hit by Firebrand.)

Fixes #401
2020-11-27 02:38:17 -08: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
00d1e729da more mind flayer vs headless target
Recently combat between monster mind flayer and headless monster was
changed to skip extra tentable-for-drain_intelligence attacks after
hitting with one for no effect.  Do the same for monster mind flayer
against headless poly'd hero and for hero poly'd into mind flayer
versus headless monster.  As before, it only applies to additional
actions during the current attack.  As soon as the attack is over,
the ineffectiveness of intelligence drain upon target is forgotten.
2020-07-29 11:10:01 -07:00
PatR
7d7b98f0ae mhpmax of life-drained monsters
The report about problems after stone-to-flesh on a petrified
long worm included stethoscope feedback of 0(-1) hit points, after
life-draining.  I was unable to reproduce a maximum hp of -1 and hope
that it was a side-effect of the [already fixed] stale mon->wormno
value used when resurrecting the long worm.  Anyway, this changes
life-draining to never take mon->hpmax below mon->m_lev + 1 (the +1
is needed to cope with m_lev==0 monsters).  The same limit is also
applied to monster life-saving but more to avoid replicating the
arbitrary minimum of 10 (four instances) then because it might be
less than m_lev+1 somehow.

Sanity checking now tests whether a monster's max HP is less than
its level + 1 so if there are ways other than life-drain attacks for
it to drop that low, the fuzzer will choke.  The new check also tests
whether a monster's current HP is greater than max HP.

Polymophred hero killing a golem or vortex by vampire bite reported
"<Mon> dies."  Give an alternate message since those aren't alive.
2020-06-27 18:15:19 -07:00
Patric Mueller
9372b35c46 Demons summoning other demons only when near hero
Commit 2fbf9573d5 dropped erroneously the range condition for demons summoning
other demons.
2020-05-20 16:40:40 +02:00
PatR
7817e69c41 two new monsters from slash'em
Adds two monsters originally from slash'em.  I used the slash'em
tiles this time, also its code as a starting point but made various
revisions.  Both the tiles could benefit from some touch-ups.

displacer beast:  blue 'f'.  Attempting a melee hit (ie, trying to
  move to its spot) has a 50:50 chance for it to swap places with you.
  Fairly tough monster to begin with, then half your ordinary attacks
  effectively miss and if you try to face a mob by retreating to a
  corridor or backing into a corner you can end up being drawn back
  into the open.  I added bargethrough capability, and also it won't
  be fooled about hero's location by Displacement.  [It only swaps
  places during combat when contact is initiated by the hero, not
  when attacked by another monster or when attacking.]

genetic engineer:  green 'Q'.  Its attack causes the target to be
  polymorphed unless that target resists.  Hero will almost always
  have magic resistance by the time this monster is encountered, but
  it can make conflict become risky by hitting and polymorphing other
  monsters.  Slash'em flagged it hell-only but I took that flag off;
  I also took away its ability to teleport.  Slash'em polymorphs the
  hero if a genetic engineer corpse is eaten; that's included and I
  introduced that for monsters too.

I added both of these to the list of candidates for monster spell
'summon nasties' and for post-Wizard harassment.

I also gave all the 'f's infravision.  Probably only matters if the
hero polymorphs into a feline.

Displacer beast is originally from AD&D which depicts it as a six-
legged cougar with a pair of tentacles; it has Displacement rather
be able to affect an attacker's location.  I think genetic engineer
is original to slash'em where it expands Q class but seems mainly to
be the base monster for Dr.Frankenstein (a unique monster with a
one-level side-branch lair in slash'em's incarnation of Gehennom).
2020-05-03 14:13:08 -07:00
PatR
4d52332dda add two new types of amulet: flying and guarding
We haven't added any new objects or monsters in a really long time.
This adds two new useful amulets, putting more pressure on the
decision over which type of amulet to wear.

amulet of flying:  idea from slash'em, implemented from scratch.
  Should be self-explanatory.  Polymorphing into a form capable of
  eating amulets and then eating one does not confer intrinsic
  flight.  (I've no idea how slash'em behaves is in that regard.)

amulet of guarding:  adds +2 AC, which is fairly negligible, also
  +2 MC, which is not.  Initially called amulet of protection but MC
  of 2 is referred to as 'guarded' by enlightenment so I changed it.
  (By that reasoning, rings of protection ought to be called rings of
  warding; oh, well.)  Successfully eating one confers +2 AC without
  any MC benefit.  When wearing one of these, rings of protection
  only confer AC, their +1 MC gets superseded rather than combined.

Monsters will wear an amulet of guarding and gain both the AC and
MC benefit, but if not cursed and they acquire one of life-saving or
reflection, they'll swap.  They won't wear an amulet of flying.

I cloned two extra copies of the tile for one of the existing amulets
and ran sys/share/objects.txt through renumtiles.pl.  The result
appears to be ok but on X11 the tiles map ends up looking psychedelic
so something beyond the tile art itself needs to be fixed here.
2020-05-02 02:07:33 -07:00
Patric Mueller
f9f423b385 Allow nurses heal attack when wielding a non-weapon/weaptool
This matches the nurses' hitting behavior with their chatting messages.

Chatting to them suggested that the heal attack would happen but the check in
mhitu.c was just for wielding anything.

This opens up the possibility of a YAFM in MS_NURSE when wielding something
that allos the heal attack to proceed.  But I couldn't come up with a good
one.
2020-04-22 12:00:06 +02:00
PatR
2fbf9573d5 unclutter mattacku a bit
Move demon summoning and were creature summoning out of mattacku()
to a separate routine.  Should be no change in behavior.

Also, redo several comments that came after what they applied to
rather than before, and reorder the file-scope prototypes to be in
the same order as the corresponding functions.
2020-04-14 18:13:32 -07:00