Commit Graph

114 Commits

Author SHA1 Message Date
PatR
c2fb384a5d rehumanizing while Unchanging
When hero poly'd into paper golem "burns completely" he is rehumanized
even if he has the Unchanging attribute.  A comment states that that is
intentional, but there was no explanation given to the player.  Report
that "your amulet of unchanging failed" when rehumanization despite
Unchanging happens.  (Don't ask me how or why it fails; I don't know.)
2017-12-14 16:39:21 -08:00
PatR
b4540086f8 self-genocide's "you feel dead inside"
It seems to me that the reaction to "you feel dead inside" when you're
polymorphed into an undead creature at the time would be "so what else
is new?".  Vary the "dead" when current form is something which gets
reported as "destroyed" rather than "killed" when killed.  That happens
for things flagged as non-living.  Now undead "feel condemned inside"
and golems "feel empty inside".  Neither of those are ideal but they're
more interesting than "feel dead inside".

After becoming dead inside, give a reminder about that during
enlightenment and if you restore a saved game in that condition.  It
was the latter that set this in motion:  I wanted to confirm that
restoring with u.uhp == -1 didn't give "you aren't healthy enough to
survive restoration" when polymorphed.  (It doesn't; the game resumes
and you'll die if/when you rehumanize.)
2017-12-12 17:53:54 -08:00
PatR
5aa1f3aa08 set_uasmon
Noticed while looking at something else, merging status highlighting
changes introduced a redundant call to polysense() in set_uasmon().
2017-10-04 18:18:21 -07:00
Pasi Kallinen
69f7a78dba Hilite Status: Improved
Allow defining multiple stops per field. Add hitpointbar.
2017-09-26 10:04:25 +03:00
PatR
ec7ed1c490 fix #H4761 - misleading polyself message
From end of last December:  turning into a "new man" or "new woman"
used the right gender if the hero was polymorphed at the time, but
always used "new man" if it happened when trying/failing to polymorph
while in original form.
2017-06-14 17:12:44 -07:00
Alex Smith
ee5b488514 Differentiate between monster anger from attacks and from other causes
setmangry() and wakeup() were being used for multiple purposes. Add an
extra parameter to track which. This fixes several minor bugs (e.g.
whether monsters with no eyes were angered by (useless) gaze attacks
against them previously depended on the state of a UI option, and
the Minetown guards would be annoyed if you used a cursed scroll of
tame monster on a shopkeeper). It's also a prerequisite for the
Elbereth changes I'm working on.
2016-10-17 18:19:22 +01:00
Pasi Kallinen
3502cfcc5a Hallucinatory liquids for water, lava, and acid 2016-06-07 20:57:50 +03:00
PatR
a5d57430be obscure polyself message
Hero was poly'd into a hider monster and was swallowed by something.
Attempting to hide via '#monster' gave "You can't hide while you're
being held."  It correctly blocked hiding due to u.ustuck but the
feedback ignored the possibility of u.ustuck+u.uswallow.
2016-06-01 18:45:52 -07:00
PatR
7cf75b707a fix #H4272 - "you turn into a Elvenking"
Polyself with gender change into a creature with fixed gender
would deliver a message containing "a <creature>" regardless of
whether "an" was warranted.

(Into any creature which supports both genders it yielded
"a male <creature>" or "a female <creature>" so "an" was never
needed.  And when no gender change was involved, it used an()
so got "a <creature>" or "an <creature>" as applicable.)
2016-03-09 17:15:32 -08:00
PatR
489445da02 fix part of #H2343 - youmonst.movement vs poly
From a July 2011 report listing multiple movement anomalies, fix one
of the easier ones.  If you polymorph from a fast from into a slow
one, pending movement points can let the slow form get in some moves
it shouldn't.

I've deliberately avoided adjusting pending movement when you change
into a faster form, which will get it's own movement boost on the
next turn.
2016-01-25 18:18:35 -08:00
PatR
fa20ef382d status line update
Adding deafness to the status line spurred me on to something I've
wanted to do for a long time.  This adds 'Stone' and 'Strngl' as
new status conditions, and moves the five fatal ones: "Stone Slime
Strngl FoodPois TermIll" to the front of the status list since
information about them is more important than any of the others.
"Ill" has been renamed "TermIll"; "Df" has been renamed "Deaf";
"Lev", "Fly", and "Ride" are three additional new conditions, with
Lev and Fly being mutually exclusive.  After the fatal ones, the
order of the rest is now
<hunger> <encumbrance> Blind Deaf Stun Conf Hallu Lev Fly Ride

To handle the longer potential status line, the basic bot2() is now
smarter.  If the line is wider than the map, 'T:moves' is moved from
the middle to the end.  If the line without time is still wider than
the map, then experience (HD if polyd, Xp:M/nnnnnn is showexp is on,
or Exp:M) is moved in front of time at the end.  If the line without
experience and time is still wider than the map, dungeon level plus
gold is moved from the beginning to be in front of experience.  The
fields are just reordered, not truncated, so if the interface code
can display lines wider than the map they'll retain the extra info.
The gist is than health and associated fields (Hp, Pw, Ac) get first
priority, status conditions get second priority, then the rest.  In
the usual case where there aren't many conditions, status display is
the same as it has been in the past.

STATUS_VIA_WINDOWPORT has been updated too, and it builds for tty
and X11.  But the bot2() revision to reorder sections has not been
implemented for that.

win/win32/mswproc.c has been updated but not tested.

STATUS_VIA_WINDOWPORT without STATUS_HILITES had several compile
problems; now fixed for core and tty.  STATUS_VIA_WINDOWPORT with
STATUS_HILITES has not been tested.
2016-01-13 19:13:10 -08:00
PatR
67826ff67b inappropriately sensing humans and elves
Discovered while testing the from-what enhancements to enlightenment.
Polymorphing into a vampire confers the ability to sense humans and
elves without having telepathy or being triggered by blindness.  That
would be taken away if you polymorphed into something else, but was
being left in effect if polymorph just timed out and hero returned to
normal form.

Same thing occurred for sensing shriekers if you poly'd into a purple
worm and then reverted to normal (something much less likely to get
noticed and not really subject to abuse if it ever did).

Bonus fix:  the code involved was using 0 to mean that Warn_of_mon
from polymorph wasn't in effect, but 0 is also giant ant.  This makes
it use NON_PM for that instead.
2015-12-25 14:24:18 -08:00
PatR
dd82c0db89 dog/cat/rat/ape body parts
Another bit prompted by vibrating square testing:
 |You see a strange vibration beneath the little dog's rear claws.

Fix up some body parts:  dog, cat, and yeti-class (includes sasquatch,
monkey and ape, owlbear) already have "paws" instead of "fore claws".
Take away all 'Y' except owlbear from that list and add rodents to it.
Give them "rear paws" instead of "rear claws" for their feet; for legs,
use "foreleg" instead of "forelimb" and "read leg" instead of "rear limb".

For yeti/sasquatch/monkey/ape/carnivorous-ape, switch from paws to hands
since they have opposable thumbs, and switch to arm, leg, foot instead
of forelimb, rear limb, and rear claw.  I've left "fore claw" for finger.
2015-11-25 16:09:33 -08:00
Pasi Kallinen
739b6708ee Fix enexto complaint when morguemon returned null 2015-11-14 09:59:35 +02:00
PatR
2ddc361adf another batch of formatting
Same sort of stuff as before:  some continuation lines with operator
followed by end of line comment (only a few files with those still to
go...), plus tab replaced by spaces in comments, excess parenthesis
removal for return statements, and force function name to be in column
one in function definitions:
  type name(args) /* comment */
  argtype args;
  {
to
  /* comment */
  type
  name(args)
  argtype args;
  {
I've been spotting those by eye rather than rexexp, so probably missed
some.
2015-11-03 18:28:53 -08:00
Pasi Kallinen
af1c77808b Comment typofixes, pt 4 2015-10-17 18:47:31 +03:00
Sean Hunt
1c081b1647 Remove stale version control lines. 2015-05-25 09:21:31 +09:00
Sean Hunt
26ee7dc370 Convert the vibrating square to a trap
Patch due to ais523 in NetHack 4.

This is not ready to be merged yet; the vibrating square needs a tile
image for tiles builds.
2015-05-25 09:19:20 +09:00
Sean Hunt
97d6fade74 Reformat all C files.
I'll push a formatting guide at some point. There may still be
outstanding changes, but please feel free to resolve those as you arrive
a them.

To the best of my knowledge, there is no changes to the actual code
content, but the formatter does have the occasional bug. If you run into
an issue, please fix it!
2015-05-09 13:43:16 -04:00
karnov
2a907f894e Version number increment 2015-05-06 22:04:27 -04:00
Pasi Kallinen
aea472c0c0 Give honorifics to vampires and elves 2015-04-23 21:46:10 +03:00
Pasi Kallinen
38bdb175cc Prevent divide by zero in newman
...which happened when your max power was 0
2015-04-15 21:05:46 +03:00
Pasi Kallinen
411ee58593 Add more explicit helpless reasons
Instead of just "while helpless", the death reason will tell
more explicitly why the player was helpless.  For example:
"while frozen by a monster's gaze"
2015-03-29 22:12:19 +03:00
Sean Hunt
260f7ea860 Make TOURIST unconditional. 2015-02-27 19:33:12 -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
fec8981102 poly'd hero hiding feedback
When hiding as a monster, say so during the #monster command and
also list being hidden in the status section of enlightenment/^X.

     Also, prevent hiding on the floor or ceiling on the planes of air
and water.  (Didn't apply to monsters, who only hide on ROOM spots.)

     Half the change to dohide() is just revised indentation.
2013-03-16 01:44:28 +00:00
nethack.rankin
0a86304023 flying into pits
In the newsgroup recently, someone mentioned that when polymorphed into
a flying monster, he couldn't retrieve items out of pits, even with the '>'
command.  I thought that we had fixed that, but the fix apparently only
covered walk-through-wall creatures (xorns and earth elementals), not flyers
and ceiling clingers.  Now those can also deliberately enter pits via '>'.

     The fixes entry is in the new features section in order to be next to
the xorn one.  '>' at pit locations is new, but it handles something which
was missing so feels more like a bug fix than a new feature to me....
[Keni, the bug page entry C343-12 about '>' (for xorns?) is general enough
to cover this fix, so we don't need to add a new one for flyers.]
I noticed an unrelated fixes35.0 entry mentioning '>' which was duplicated;
this removes one of the copies.
2013-03-14 01:58:21 +00:00
nethack.allison
e701a68175 rolling boulder trap's boulder can be generated in lava
> On 01/30/2012 08:20 PM, <Someone> wrote:
> The boulder from a rolling boulder trap can be generated on a
> lava pool. mkroll_launch() in trap.c, line 1584 checks only for pools
> of water.
2012-02-01 00:49:16 +00:00
keni
01a44fead4 postcommit.pl 1.84 - first branch info test: polyself.c (on the trunk) 2012-01-03 19:11:34 +00:00
nethack.rankin
282f8e8e70 refine blocked levitation/flight (trunk only)
Levitation side-effects get skipped if Levitation toggles while it
is blocked, so BFlying (the reason Flying is blocked) could become stale
in some situations.  Enlightment feedback about latent flight capability
was the only thing affected.
2011-10-22 23:26:17 +00:00
nethack.rankin
f48de2f336 fix #2242 and #2292 - levitation exceptions (trunk only)
From a bug report.  The first report complained about levitation
allowing you to move through water on the Plane of Water, something that's
come up in the newsgroup lots of times (mostly about how levitation is
the best way to get around, only occasionally wondering why it works:
water walking doesn't work there because there's no surface, so where are
you levitating such that you're kept dry?)  The second report complained
about being told you were floating up if you put on a ring of levitation
while stuck inside a wall (perhaps after being stranded when polymorph
into xorn form ended).

     This implements intrinsic blocking for levitation and also for
flying.  Being inside solid rock (or closed door) anywhere and being in
water on the Plane of Water are the things that do it for levitation;
those two and levitating are what do it for flying.  Entering such
terrain turns off ability to float/fly, and leaving there turns it back
on; starting levitation blocks flight, ending it unblocks (levitation
has always overridden flying's ability to reach the floor).  Being able
to phase through rock doesn't prevent levitation and flight from being
blocked while in rock; you aren't floating or flying in that situation.
2011-10-15 03:00:45 +00:00
nethack.rankin
84f02bd336 intrinsics revamp (trunk only)
Simplify many of the intrinsics macros from
  #define xxx_resistance (Hxxx || Exxx || resists_xxx(&youmonst))
down to
  #define xxx_resistance (Hxxx || Exxx)
by setting or clearing an extra bit in Hxxx during polymorph so that the
resists_xxx() check becomes implicit.

     Unfornately there were lots of places in the code that treat Hxxx
as a timeout number--primarily for Stunned, Confused, and Hallucination;
Stunned happens to be one of the revised macros--rather than as a bit
mask, so this patch needed a lot more changes than originally antipated.
2011-10-01 00:25:57 +00:00
nethack.rankin
cc7d1ff9a8 new man/woman (polyself, inevitably...)
Noticed when testing the [trunk] ^X fix:  polymorphing into human
form (not reverting to original form) reported "you feel like a new man"
when I resumed being a cavewomen.  Like with ^X, it used poly'd hero's
current monster gender instead of the about-to-be-restored role gender.
It's amazing that nobody seems to have ever noticed in all this time.
2011-03-01 13:39:59 +00:00
nethack.rankin
25ca388235 dragon scale mail degraded by polymorphing into dragon (trunk only)
Apparently I lied yesterday when I said that patch was the last
polyself one.  This has been on my agenda for a long time:  when dragon
scale mail merges with your skin during polymorph into the corresponding
dragon, have it revert from mail to scales.  Its enchantment stays the
same when reverting.  So after returning to your original form, using
enchant armor to convert it into scale mail again will eventually risk
its destruction due to over-enchanting.  (Cursed scroll of enchant armor,
spell of drain life, or being hit by a disenchanter can be used to reduce
its enchantment back to a safe-to-enchnat value.  Or cancellation if
you're desperate.  I think those all work on all colors of dragon scales
despite the assorted magical properties that scales confer.)
2011-03-01 12:15:51 +00:00
nethack.rankin
2c22fd0bc6 one last(?) polyself bit: no control while stunned (trunk only)
Teleport_control is disabled while the hero is Stunned; do the same
with Polymorph_control.  Also now disabled while unconscious, but that
is academic since random polymorphs and were-critter transformations are
postponed until multi is non-negative.  I included it for completeness.
(Reverting to original form can occur while unconscious, but control is
not a factor in that situation.  Teleporting handles being unconscious
differently but does negate control then.)

     The fixes entry could just as easily have gone into the new features
section as into the bug fixes one.  The teleport control part actually
belongs in fixes34.4 because it is present in the branch, but I didn't
feel like spreading this across two different files (and the current diff
references ``Unaware'' which doesn't exist in the branch so it isn't
trivial to include this patch there).
2011-02-28 11:29:27 +00:00
nethack.rankin
3de3b8cb2a polyself changes (trunk only)
While making the change to prevent random mail daemons, I noticed
that controlled self-polymorph into a critter specified by class (a post-
3.4.3 feature) rather than by name wasn't excluding NOPOLY monsters so I
checked to see if they were being handled correctly.  Accepting NOPOLY
monsters as candidates was intentional but it had a problem (although
many NOPOLY monsters are NOGEN and vice versa, so the problem wouldn't
show up often).  If I specified A and Archon was randonly chosen, I'd
be told "you can't polymorph into that" but if I retried A and it chose
couatl, the polymorph succeeded.  This changes the way the first case
gets handled:  it skips the message and makes another pick from the
specified class, although that consumes the same retry counter as
reprompting so you might still end up with "you can't" if random picks
come out unfavorably too many times (or if you've typed in some bad
choices first and the counter has already been reduced).

     When doing that, I changed the "you can't" message to say what it
is you can't polymorph into, instead of just "that".

     And I've changed controlled polymorph to accept ESC when prompted
for monster type.  When used, either don't polymorph (for wizard mode
#polyself command) or revert to uncontrolled poly (for all other causes
of polyself) instead of just asking again.  Specifying "*" or "random"
will also produce uncontrolled polymorph.
2011-02-28 05:30:06 +00:00
nethack.rankin
ad1dec0745 poly'd hero mimic hiding vs polymorph
From a bug report, if you were a mimic
who was hiding (via #monster, becoming a strange object) and polymorphed
into some other monster type, you retained the hidden/object form.  That
didn't happen when reverting to normal form, or when polymorphing into a
monster while involuntarily mimicking gold, but handling for the latter
inadvertently blocked dealing with the hiding-voluntarily case.
2009-06-13 02:10:21 +00:00
keni
4eabcee787 Add RCS version lines 2009-05-06 10:50:32 +00:00
nethack.rankin
0ba059f749 Hallucination vs gaze attacks (trunk only)
Suggested by <Someone> in March, 2005 based on newsgroup discussion
at the time:  hallucination protects against touch of death attack by
disrupting how the hero's brain reacts, so why not against gaze attacks
too?  This gives hallucinating hero 75% chance of being unaffected by
gazes.  If unaffected or if the gazer has been cancelled, the gaze will
fail with some feedback.  Previously, all cancelled gazes failed but only
Medusa's gave feedback.

     This will give players another way to defeat Medusa, but since it
isn't foolproof and there are several sure fire ways already, I don't
think it'll hurt play balance there.  It may be useful to avoid getting
repeatedly stunned by Archons though.
2007-05-29 02:00:25 +00:00
nethack.rankin
8cbf547b45 rehumanize bit (trunk only)
Something else from a copy of an old news message:
  You return to human form!
  Do you want your possessions identified?
I don't think that this can actually happen any more because the pieces
of code which subtract hit points should all be polyself aware now, so I
didn't bother with a fixes entry for it.
2007-05-22 01:00:57 +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
6d33acd2af using #monster to breath at self (trunk only)
When testing the monster-breath-at-self patch I noticed that trying
to cure green slime by having hero breathe at self didn't work.  The code
was calling buzz() with arguments that produced an attack directed against
the hero's location, but there was a chance for it to miss outright and
when it didn't, reflection would block it.  This makes breathing at
yourself with `#monster' comparable to zapping a wand or casting a spell
at yourself:  it always hits.
2007-05-05 04:32:19 +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
3c58c3b235 fix #U1233 - controlled polymorph by hero with lycanthropy (trunk only)
<email deleted> reported a long list
of inconsistencies and suggestions.  This attempts to address the ones
about werecritters and vampires.

> Polymorphed player does not get werecreature changes. (intentional?)
> Player in were form does not turn into werehuman form, ever.  (Previous
> bugged behavior was that player turned into a plain human)
> Player afflicted with a were cannot polymorph into werecreature or
> werehuman form.

     The first guess is right; being polymorphed blocks lycanthropy state
changes.  The second is not a bug either; hero is either a <werecritter>
when in beast form or a <role> when in human form, never human werecritter
monster.  The last one feels more like a bug though; it happened because
all lycanthrope monster entries are marked NOPOLY.  This patch extends
an earlier post-3.4.3 change to allow player with polymorph control to
explicitly specify werecritter when in role form or human werecritter when
in beast form to toggle shape.  It also allows closely related monsters
to toggle from role to beast (ie, "giant rat" yields wererat).

> Vampire or Werecreature changing form may change sex.

     Now the three semi-controlled changes--becoming a dragon due to armor,
toggling were form, and vampire into various critters--are prevented from
having the 10% chance of sex change kick in.  For monsters, lycanthropy
didn't apply (sex never toggles) and vampire shifting is now covered but
turning into a dragon due to scales/mail remains susceptible to sex change.

     Also, post-3.4.3 code made polymorphing into a vampire enable the
#monster command but neglected to tell the player.
2007-04-08 01:51:57 +00:00
nethack.rankin
c86f9ff008 worn gear after polymorph alignment change [1 of 2] (trunk only)
Make polymorphing or changing alignment perform a touch check (as is
done when catching lycanthropy) on wielded weapon(s) to see whether the
hero can still use them in his new form.  Part [2 of 2] will update
retouch_equipment() to check all items in use rather than just weapon(s).
(A comment or two in part 1 already refers to expected behavior of part 2.)
2007-03-20 03:58:27 +00:00
nethack.rankin
1e7ace58f7 polyself weapon drop feedback
Don't say "you must drop your weapon" when it doesn't actually get
dropped.  And make "weapon" be more specific, comparable to the handing
for slippery fingers.
2007-02-18 03:33:43 +00:00
nethack.rankin
658c931aad wielded leash, monster bullwhip use
Simplify <Someone>'s patch (the part for the secondary weapon wasn't and
still isn't needed since dual-wielding can only occur when both primary
and alternate weapon slots contain weapons or weapon-tools, but we might
as well keep it).  There was at least one other case where wielded in-use
leash could be removed from inventory without becoming unleashed first:
a bullwhip-wielding monster could snatch it away.

     That lead to some other whip issues:  monsters who select disarming
via bullwhip as miscellaneous strategy had 80% chance of not using it on
any given turn, but had no chance to select another misc strategy on such
turns--they always resorted to ordinary nonMUSE behavior and usually just
attacked.  The adjacency check missed diagonal locations, also would aim
the disarm attempt accurately even when displacement or invisibility made
the hero's precise location unknown.  [I took the easy way out here and
only let them try to disarm when they know the hero's location.  It's
tempting to aim at the guessed location and sometimes accidentally disarm
a nearby monster, but disarming is an action which targets a particular
weapon rather than just a location.]  Lastly, disarming always targetted
hero's primary weapon, never a dual-wielder's secondary one.
2007-02-13 04:54:35 +00:00
cohrs
2fde3bce8e polymorph dropping in-use wielded leash part 2
forgot to handle the twoweapon case, and messed up the test logic (which
appeared to work in previous, incomplete testing)
2007-02-12 21:40:16 +00:00
cohrs
5c3651e055 polymorph dropping in-use wielded leash
From a bug report, if you polymorph into
something, like a killer bee, that causes you to drop your weapon, but the
weapon is a wielded, in-use leash, the leash would be dropped but retain
it's in-use state.  However, the leash was tied to you, so it seems it
should remain attached, just unwielded, just as it would if it hadn't been
wielded.  I've changed the behavior to do this.  I wonder whether one
should be able to wield an in-use leash.
2007-02-12 21:25:52 +00:00