Commit Graph

48 Commits

Author SHA1 Message Date
Pasi Kallinen
1c970b171e Some monsters can eat through iron bars
Any monster with rusting or corrosion attack can eat through
the bars. This includes rust monsters, grey oozes, and black puddings.

Original patch by Malcolm Ryan
2015-04-13 19:41:51 +03:00
Sean Hunt
b066b7c170 Make KOPS unconditional. 2015-02-27 19:33:04 -05:00
Sean Hunt
9e65758947 Make STEED unconditional. 2015-02-27 19:33:01 -05:00
keni
03140969ee Bulk recovery of file CVS headers and addition of NHDT- headers. 2015-02-26 09:19:03 -05:00
nethack.rankin
b5224ab2d0 hobbit tidbit (trunk only)
While testing the need-hands-to-open-tins patch, I tried to polyself
into a halfling and failed.  Add it to the monster name lookup routine as
a variant spelling for hobbit.
2011-10-02 02:18:54 +00:00
nethack.rankin
33d9b71311 Protection groundwork/artifact tweaks (trunk only)
This is mostly groundwork prior to making the Protection intrinsic
become more meaningful.  The Mitre of Holiness (priest quest artifact)
and the Tsurugi of Muramasa (samurai quest artifact) will now confer
Protection when worn/wielded (though at present that effectively does
nothing).  While in there, this also changes the Eye of the Aethiopica
(wizard quest artifact), the Eyes of the Overworld (monk quest artifact),
and the Sceptre of Might (caveman quest artifact) so that they need to
be worn/wielded rather than just carried in order for them to confer
magic resistance.  That way they're a little less attractive for wishing
by other roles and a little more likely to be actively used by their own
roles (not an issues for the Eyes, I'm sure).  This change actually works
to the player's advantage, since it means that monsters who successfully
steal those items won't instantly obtain magic resistance in the process.

     This adds protects() as a predicate routine to check an item for
conferring Protection.  In order to do that, it renames the existing
protects() routine to defends_when_carried(), because that predicate is
actually a variant of defends() for items which aren't worn or wielded.
2011-04-07 18:10:47 +00:00
nethack.rankin
8c6f630a5c more polyself fallout (trunk only)
When testing the change of "you can't polymorph into that" to
"you can't polymorph into <a monster type>" I noticed that specifying
high priestess told me that I couldn't become a priest (role monster),
but specifying high priest told me that I couldn't become a high priest
(monster as-is).  Aligned priestess and high priestess aren't separate
monsters; the user-specific string to monster name code found the latter
as a rank title rather than as a monster and couldn't find the former
at all.  This adds those two special monst types to the list of variant
spellings and whatnot that are used to augment name to type lookup.
Since they aren't viable candidates for polyself or for genocide I doubt
that any players ever noticed, so I haven't added a fixes entry for this.
2011-02-28 10:32:17 +00:00
keni
4eabcee787 Add RCS version lines 2009-05-06 10:50:32 +00:00
keni
5d24f9ab3a warnings cleanup (trunk only)
This covers the warning cleanup bits no one objected to.
2008-02-20 00:27:56 +00:00
nethack.rankin
4be43239a8 fix #332 - strangulation affects headless monsters (trunk only)
From a bug report:  amulet of strangulation
continues to kill hero if he polymorphs into a creature which doesn't
need to breathe or doesn't have a head or even a circulatory system.
Currently, the messages are different when the hero doesn't need to
breathe, but that doesn't seem good enough.  This makes strangulation
stop when you polymorph into something which shouldn't be vulnerable and
restart if you poly into something vulnerable while still wearing the
bad amulet.

     can_be_strangled() is doing more checks that necessary, in case the
strangulation property ever gets conferred by something other than an
amulet.  Its criteria for protection from strangling might need tweaking.
2007-05-18 02:10:39 +00:00
nethack.rankin
4777c898f8 more #U1233 - specifying mon class instead type for polyself (trunk only)
Another item from the Dec'04 report sent in by <email deleted>.  When prompted for a type of monster to polymorph
into, giving a monster class description like "dog or other canine" (or
single letter like 'd'), triggered "I've never heard of such monsters".
Instead of adjusting the message, this chooses a member from the class.

     I put this into the fixes file as a new feature.
2007-04-10 03:39:52 +00:00
nethack.rankin
95d693a84c name_to_monclass (trunk only)
Move the code for determining monster class from user's input string
out of do_class_genocide() and into new routine name_to_monclass().  I'm
planning to use it when name_to_mon fails to match anything for controlled
polymorph (not ready for prime time yet).

     Also, avoid getting stuck in a loop if hangup occurs while prompting
player for class of monster to genocide.  ESC, whether deliberate or fake
input after hangup, will now be the same as specifying "none", throwing
away the genocide opportunity.
2007-04-08 04:35:19 +00:00
nethack.rankin
0b05ca9ee7 fix #Q431 - water elemental caught in beartrap (trunk only)
Reported two months ago by <email deleted>,
having a water elemental become trapped in a bear trap seems pretty
strange.  Fixed by marking water elementals as M1_UNSOLID (like air and
fire elementals), which has a side-effect of making them immune to webs
as well.  Tweaked some unused digging code which checks unsolid(), added
unsolid() to the types allowed to bar through iron bars, and brought the
check for whether a monster is willing to enter a bear trap location up
to date.  That code also needed an update to reflect the change made to
anti-magic traps last year.  Lastly, there was another report which
suggested that being hit by a bear trap should dish out some damage
(along with a suggestion that wand of opening should work to escape such
traps, which has already been done).  This makes bear trap do 2d4 damage
(on entry, not when trying to pull out after becoming stuck).
2007-04-03 05:11:44 +00:00
nethack.rankin
d70d44b67f pets accompanying ascension or dungeon escape
There was a report recently about "<pet> is still eating" coming out
on the console at end of game for player using X11 or Qt.  That happened
because the end-of-game pet handling takes place after the message window
has been closed.  It won't happen with the dev code any more because eating
no longer prevents pets from accompanying on final ascent or escape.  But
a pet carrying the Amulet should still fail to tag along and yield similar
result.  However, levl_follower() was changed (probably by me...) to have
pets not attempt to follow when they carried the Amulet, rendering code
in keepdogs()--which reported them as being confused--unreachable.  This
reverts levl_follower() to have Amulet-carrying monsters other than the
Wizard try to accompany the hero during level changes (and keepdogs still
prevents them from succeeding).  It also reorganizes keepdogs() a bit,
giving trapped followers an extra chance to escape from their trap and
preventing those who fail that chance from tagging along (previously,
non-pets ignored being trapped).

     After doing that, I got tty to behave similarly to the X11/Qt report:
a message behaved strangely.  In my case, it was delivered between a pair
of clearings of the screen and only visible by using terminal emulator's
scrolling buffer.  I think there's a wait_synch() missing somewhere, but
haven't tried to figure out where.  Instead, this makes the end-of-game
call to keepdogs() take place sooner, while pline() still works normally.
2007-03-03 06:20:14 +00:00
cohrs
33fde404e7 gcc compilation warning bits 2007-02-10 17:37:17 +00:00
nethack.rankin
128ed0f0be fix #Q117 - vomiting by rodents & more
From a bug report:  you could vomit when polymorphed into a rat but real life
rats can't/don't vomit.  The latter was confirmed by <Someone> and <Someone>.
While testing a fix for this, I discovered a couple of other problems.
Healing magic which cured sickness failed to heal Vomiting (potion or
spell; unicorn horn deals with them separately).  Enlightenment failed to
report Vomiting (it's not shown on the status line).  Most significant was
that vomiting_dialogue() called vomit() twice (also make_confused() and
make_stunned() three times for every once intended).  It was dividing the
remaining turns by 3 and then using that value to decide what to do, but
only message display took into account that the same divided value would
occur on 3 consecutive turns (or just 2 for the final countdown to 0,
because dialog routine gets called before timed-property decrement).
2007-02-06 04:35:50 +00:00
nethack.rankin
95729beb4a inappropriate resistances
Noticed when examining resists_magm() while working on anti-magic
traps:  if you were polymorphed, you would be granted magic resistance by
keeping a cloak of same or gray dragon scales/mail in your quiver slot,
your alternate weapon slot, or main weapon slot (ie, by wielding it).  And
you obtained light-based blindness resistance regardless of whether you
were polymorphed if you carried a potion of blindness in any of those slots.
2006-11-25 04:57:33 +00:00
nethack.rankin
06e9fa91de Unaware; fix #H202 and extend the fix for #H179 (trunk only)
Turn being unconscious (via several reasons, including fainted from
hunger) into a pseudo-property named `Unaware' and use it in several
places where only being asleep was checked.  #H202 was about a stunned
character who got the recovery message when it timed out while fainted.
This suppresses messages for several difficulties when they begin or end
while hero is Unaware.  Messages about fatal illness, sliming, or
petrification aren't suppressed; they're too important to hide from the
player.  "You feel ..." messages come out as "You dream that you feel ..."
when Unaware; fairly lame but hopefully adequate.
2006-09-02 03:32:18 +00:00
nethack.rankin
1574c6effd fix #H179 - blinding attack while fainted
From a bug report, being hit with a
yellow light explosion while fainted from lack of food caused blindness
but being hit while sleeping did not.  Make being in fainted state become
a protection against light-induced blindness.
2006-08-27 02:09:39 +00:00
nethack.rankin
dbc3abb226 pointer formatting (trunk only)
Hide pointer formatting in alloc.c by eliminating the need for callers
to know how big a buffer is required.  I generally prefer the caller to
pass in its own buffer for this sort of thing, but in this case the usage
is almost entirely for debugging so using static buffers results in less
clutter in the rest of the code.
2006-07-08 03:22:40 +00:00
nethack.allison
3d164b6d02 fmt_ptr (trunk only)
fmt_ptr() is no longer dependant on WIZARD or MONITOR_HEAP,
so that it can be used in panic messages.
2006-07-02 18:43:35 +00:00
nethack.rankin
fe5d79c859 genociding mindflayers
When looking at name_to_mon() to teach it how to cope with possessive
suffices, I discovered that it already knows how.  But while looking at
it, I remembered a newsgroup complaint from a while back by someone who
accidentally committed suicide by attempting to genocide "master mindflayers"
(when he meant "master mind flayers").  name_to_mon() didn't recognize that
misspelling but it did match "master" as a role title.  Unfortunately for
the player, his character was a monk; the game allowed him to genocide his
own role and he died.  That's kind of harsh for such a likely misspelling.
(I don't think a monk is very likely to ever use "master thief" as a mistake
for "master of thieves", but catch that one too just in case.  Conversely,
recognize "master of assassins" as an alternate for "master assassin".)

     Also, wishing for "the <something>" strips off "the" and finds (or not)
<something>, but genociding didn't.  You could specify "a wolf" to wipe out
all wolves, but "the wolf" yielded "such creatures don't exist", and ^G had
similar unfriendly behavior.  This extends name_to_mon() to handle it.
2005-12-31 06:19:04 +00:00
nethack.rankin
a906215720 more monster alignment
Simplify is_lminion(); as a result, several source files no longer
need access to epri.h.  (mondata.c already could have lived without it;
eshk.h as well.)

Makefile dependency changes:
  mondata.{c,o} -- doesn't need epri.h or eshk.h
  monmove.{c,o} -- doesn't need epri.h
  wizard.{c,o}  -- ditto
  pline.{c,o}   -- ditto (yesterday's patch)
2005-10-06 03:45:20 +00:00
nethack.rankin
545239f4b1 fix M167 - hero lycanthrope vulnerable to level drain
From a bug report, player's character inflicted
with lycanthropy doesn't gain level drain resistance when in normal form
even though lycanthrope monsters do have it when in their human form.  The
report claimed that the character didn't gain it when in beast form either,
but the code--and testing--suggests otherwise.

     The same resist_drli() call used for monsters is used for the hero,
but the is_were() check there isn't able to recognize a lychanthrope hero
since youmonst->data doesn't track that when in human/normal form.  This
adds another more specific check to handle that case.
2005-09-02 06:29:15 +00:00
cohrs
f1bf488367 passive damage
As From a bug report, twice.  Change max_passive_dmg to multiply the
result by the number of direct attacks the aggressor can make.  This way, a
tame mind flayer, for example, will avoid pounding on a spotted jelly and
dying as a result of the Nth passive response.
2005-03-14 15:27:53 +00:00
nethack.rankin
d1732e1e8c intelligent pets vs cannibalism (trunk only)
Implement a user suggestion that tame humanoids should avoid eating
corpses of their own species.  Prevent them--except for kobolds, orcs, and
ogres--from doing so unless starving.  Arbitrary:  tame elves won't eat
other elves even when starving.  A polymorphed character will incur the
effects of cannibalism when eating either his/her underlying race _or_
the current one (player orcs and cavemen aren't affected though).
2005-01-30 04:19:01 +00:00
nethack.allison
5fa8f73af8 housekeeping: mark trunk sources 3.5 (src) 2005-01-02 16:44:46 +00:00
nethack.rankin
98ab86c9ec gas spores attempting to attack
From a bug report, but pulls back" while successfully
praying.  Gas spores' only "attack" is to explode when dying, so the code
that checks whether the monster has any attack needs to handle AT_BOOM as
a special case.  Unfortunately this change means that you won't interrupt
an occupation when a gas spore approaches, and a subsequent kill by your
pet might end up causing you harm while still occupied.  The callers of
`noattacks()' are messy enough that I didn't want to try to address that.

     This also moves noattacks() from mhitm.c to somewhere more sensible.
2004-10-22 02:15:33 +00:00
nethack.allison
9b3521e503 vampires now shapeshift [trunk only]
- can shift into fog clouds, vampire bats, and vampire lords into wolves
- after being "killed" in shifted form, they transform back rather than get
  destroyed, and you must take them on in vampire form to defeat them
- can deliberately shift into fog clouds to pass under closed doors
2004-06-15 11:52:04 +00:00
cohrs
6f0fb33e9f general musical instrument use while polymorphed
Extend the previous patch to cover all blown instruments.  Also covers
the case of the player strangling.  The test is moved to a new can_blow
function to keep the test in one place.  It supports any monster, although
all current tests are for the player.
2004-01-27 00:23:31 +00:00
nethack.allison
f2101638db avoid "It turns into it"
<Someone> drew attention to the silly message in the newsgroup

Since I'm not sure if the act of polymorphing has a sound,
I opted to use a new usmellmon() routine to put out a
message based on the smell of the resulting monster
under those circumstances.

Not every monster has a recognizable smell, so no
message at all is given in that case.

olfactory(youmonst.data) will determine whether
you are capable of detecting smells.

There is lots of room for enhancement, and some of the
existing smell-related messages in the source should perhaps
be checking olfactory(youmonst.data) too, but this patch
doesn't go that far.
2004-01-17 20:42:14 +00:00
cohrs
929f9ce2c7 various tests of flaming monsters
This change adds a new flaming() macro and uses it in several places
where the list of flaming monsters was tested.  on_fire() didn't list
salamanders as already being on fire, but should have.  A couple other
cases were not updated to include flaming sphere.
2003-09-26 00:37:24 +00:00
cohrs
4375fc7846 killer messages
Incorporate various killer message grammar fixes suggested by <Someone>.
Mostly these deal with using the proper killer_format and prefix ("the" or
no "the") for unique and type_is_pname monsters, or death to to eating
their corpses.
One case is handled by a general fix to name_to_mon to allow it to deal
with "Croesus' corpse".
The pre-3.4.1 topten behavior for "starved to death" messages is also restored.
2003-09-25 16:56:56 +00:00
nethack.allison
416412f92b Remove vestiges of old overlay source split
[trunk only]
2003-09-05 02:45:18 +00:00
nethack.rankin
974bab3a32 fix B03007 - monster gender handling + level follower tuning
Fix the reported problem of combat messages referring to Orcus as
"it" when the data.base entry uses "he"; extend use of gender-specific
pronouns to named and other unique monsters as well as to humanoids.
If any of those should stay as "it", they'll need to be M2_NEUTERed....

     And prevent level followers from chasing you across levels if they
are fleeing at the time.  It's an old change I've been sitting on which
is not related but happens to be right next to the pronoun code.
2003-06-02 08:05:41 +00:00
nethack.allison
5a7bebf5a6 fix B17002 horns
Asmodeus ought to be in num_horns().
	[devteam] balrog as depicted in LotR movie has horns too.
2003-01-26 03:25:27 +00:00
nethack.rankin
c5e0ecc15a more on_fire handling
Add several more monsters to the special case handling for fire
attacks.
2003-01-15 09:06:57 +00:00
nethack.allison
1b6794d246 flaming attacks
> Bug with flaming attacks...? These monsters should be unaffected,
> IMO.
>
> The fire elemental hits the stone golem. The stone golem is on
> fire!

fixed in patch

> The pyrolisk gazes at the flaming sphere... The flaming sphere is
> on fire!

This was already corrected in CVS.
2003-01-13 11:48:47 +00:00
nethack.rankin
f52b94336f hats vs horns
Some recent newsgroup discussion claiming that a pet ki-rin was
wearing a helmet (I think poster was hallucinating) caused me to look
at some of the hat handling code.  There were a couple of noticeable
problems and one latent one in code added for 3.4.1.  Polymorphing
into a minotaur pushes hard helmets off hero's head, but nothing
prevented you from putting one right back on.  Helmet wearing monsters
who polymorphed into minotaurs weren't affected at all.  And message
handling always assumed multiple horns even though we have some singled
horned monsters, but since all those have no hands they can't wear any
armor and that potential pluralization issue wasn't noticeable.
2003-01-09 01:20:49 +00:00
nethack.allison
bbfd597a80 raceptr()
Add a routine for returning a ptr
to the correct race of monst.
Compensates for polyd and non-polyd player.
2002-12-30 01:42:36 +00:00
nethack.rankin
b90f50075d fire attack messages
Make sure the three instances of special fire effects stay
synchronized in the future by moving the relevant code into its own
routine.

     Shouldn't fire vortices and fire elementals also yield "already
on fire"?  How about ice vortices "melting"?
2002-12-10 10:21:28 +00:00
cohrs
e1ea4460ce B08019 - growup followup
growup entries for all the orc types as <Someone> suggested, since generic orcs
almost never occur.
2002-08-21 05:14:10 +00:00
arromdee
55e58c662e mind flayers growing up into master mind flayers, etc.
While one could argue that giant rats aren't just grown up forms of sewer
rats, we already have bat/giant bat in there.
2002-08-13 03:49:11 +00:00
nethack.rankin
812b53799d multiple iron bars fixes
Can't push boulders through iron bars; traps can't roll such through either;
	likewise for objects thrown by monsters.
Thrown objects susceptible to breaking might do so when they hit iron bars.
Assorted monsters can pass through iron bars; ditto for polymorphed character.
Attempting to dig iron bars will wake nearby monsters instead of yielding
	"you swing your pick-axe through thin air".
Autodig won't accept iron bars as candidate location.
2002-04-07 10:43:59 +00:00
nethack.rankin
e848030571 warning bit
Avoid gcc's inaccurate warning about mattk possibly being
used before being set in do_breathe().
2002-03-25 08:05:27 +00:00
nethack.allison
06528d1002 3.3.2 to 3.4.0 2002-02-04 16:06:00 +00:00
cohrs
52141ce87f medium and large flyers do not flutter 2002-01-30 04:51:40 +00:00
jwalz
01b2d881d3 *** empty log message *** 2002-01-05 21:05:49 +00:00