Commit Graph

411 Commits

Author SHA1 Message Date
arromdee
4856f00479 remove duplicate entry
Since this should just be in 34.4
2011-12-19 00:27:17 +00:00
arromdee
2cf8261159 Minor cockatrice fix
PS: Why do we have duplicate fixes__._ files in the branches, since by
definition the same file would have to stay the same in any branch?
2011-12-18 05:16:36 +00:00
arromdee
df317ceb43 Put fruit fix in fix list 2011-12-12 02:18:20 +00:00
nethack.rankin
eaf3819bc2 expanded #terrain command (trunk only; 2nd try...)
Change the post-3.4.3 extended command "#terrain" so that it can be
used in normal play rather than just in wizard mode.  It's inspired by
a command in 'crawl' that lets you view the bare map without monsters,
objects, and traps so that you can see the floor at locations which have
been covered up by those things.

normal play
      redraw map to show the known portion of it without displaying
   monsters, objects, or traps; after player responds to --More--, the
   map returns to normal.

explore mode
      put up a menu so player can choose between the known portion of
   the map as above or the full map.  If the level isn't fully explored
   then the latter provides information to the player that he hasn't
   earned yet, but the _hero_ doesn't learn anything and after --More--
   the map reverts to what it showed before.  (In other words, unlike
   with magic mapping, the unknown portion doesn't become known.)

wizard mode
      put up a menu so player can choose among four alternatives:  the
   two above, the text representation of the map's internal levl[][].typ
   codes, or a legend explaining those codes.  (Originally, I wanted to
   be able to toggle back and forth between these last two, but looking
   at one and dismissing it, then reissuing #terrain to look at the
   other is much simpler to implement and is good enough.)
2011-12-05 09:39:19 +00:00
nethack.rankin
e072ebd3fa mapping/detection hangup handling (trunk only)
Noticed while looking at the magic mapping code:  u.uinwater is
cleared during mapping and detection so that map updating isn't suppressed
due to underwater vision restrictions, and it was possible for a hangup
save to take place before that state field was reset.  After restore, the
hero would end up standing on water, then fall in on the next turn.  This
saves it in struct `u' rather than in a local variable, so that the stored
value is accessible during restore.

     The u.uburied flag was being ignored, but presumeably it would also
impose severe vision restrictions if it ever gets implemented, so it is
now saved, temporarily cleared, and restored along with u.uinwater during
monster/object/gold/trap detection and magic mapping.
2011-11-29 03:28:07 +00:00
nethack.rankin
fdf037a89f autosearch while blind (trunk only)
From a bug report, he was running blind while wielding scissors--
I mean Excalibur--and stopped for no apparent reason.  The autosearch
capability conferred by that artifact (also by ring of searching, or for
some roles or races once they reach a particular level) had found a secret
door and changed it into a normal door, but since he couldn't see at the
time his map display wasn't updated to show that.  This makes the map show
such things even if blind, and also gives a message that the search found
something.
2011-11-24 00:13:24 +00:00
nethack.rankin
897d527837 fix #2495 - light vs gremlins (trunk only)
From a bug report, flashing yourself
with a camera while in gremlin form blinded as with any other form, but
didn't inflict any damage the way that flashing a monster gremlin does.
This fixes that, and also makes light from wand/scroll/spell that hits
you-as-gremlin or monster gremlins do 1d5 damage too.  It happens even
if the target is already in a lit spot, but doesn't continue afterwards:
simply being in a lit spot doesn't cause any damage, nor does lamp light.
2011-10-17 01:32:23 +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
30b3e5a2ea more vault guard (trunk only)
Fix several obscure bugs that can happen when a guard leads someone
out of a vault:
1) non-pit traps created in the temporary corridor would persist inside
   solid rock after the corridor was removed (pits dug by the hero were
   explicitly removed but several other trap types are possible);
2) lighting the corridor with scroll/wand/spell left the affected spots
   flagged as lit after they reverted to rock; tunneling through that
   area, either by digging or by teleporting back to the vault and having
   another guard appear, unearthed lit corridor there;
3) if you became encased in solid rock because you were in the temporary
   corridor when it was removed (which will happen if the guard is killed
   while you're in his corridor), you were only told so if you saw part of
   it revert to rock; when blind, you simply found yourself unable to move;
4) dragging an iron ball in the temporary corridor could result in part
   of that corridor becoming permanent if the guard was killed; in 3.4.3,
   it would only occur if the cause of death took away all the guard's
   hit points (which happens for most but not all deaths); in development
   code after my recent patch, that would be every cause of death.
#4 could also yield "dmonsfree: <N+1> removed doesn't match <N> pending"
warning in 3.4.3 when the fmon list was scanned and a guard at <0,0> with
no hit points was found but hadn't passed through to the end of mondead()
and m_detach().  The previous patch fixed that, I think/hope.  Most guard
deaths won't trigger that; grddead() moves the guard to <0,0> but then
removes the temp corridor on its second try, returns true, and mondead()
finishes normally.
2011-10-13 00:31:13 +00:00
keni
4e5e720334 display version and build info at startup (trunk only)
Tested on the unix port; I've updated as many other ports as I can figure
out but they're not tested.  See window.doc for info on the changed banner
lines.  Also adds the ability to override the generic "Unix" port - used now to get
"MacOSX" into the version line instead of "Unix" (so we don't scare people who don't
know what's going on).
2011-10-11 02:37:31 +00:00
nethack.rankin
bd172eb167 vault guard bug: dropping minvent at <0,0> (trunk only)
From the newsgroup:  after killing a vault guard on a level where
every object had been removed or was held by the hero, object detection
gave feedback about finding something but was unable to show anything.
It was finding the dead guard's inventory at <0,0>, a part of the map
which never gets shown.  A dying guard is sent to that location instead
of being killed and deleted, because the data for his temporary corridor
to/from the vault is kept in the egd structure attached to him.  That's
somewhat obscure but works; dying guards just need to drop inventory
before being transfered there rather than after.

     Depending upon how they're killed, it's possible that the umpteen
places in the code that loop over fmon might have been processing them
as if still in play.  This sets their mhp to 0 so such loops will ignore
them, and teaches dmonsfree() not to release them.  Once the temporary
corridor has been removed, their isgd flag is cleared and they become
ordinary dead monsters and get deleted from the fmon list the next time
it's purged.

     This also lets you throw gold to/at the guard when he tells you to
drop it.  He already would catch it, but now he won't treat the throw as
an attack.  Any gold he carries will eventually disappear when he does,
so dropping it remains a better option for the player.
2011-10-09 02:13:01 +00:00
nethack.rankin
1e65061989 eating tins while poly'd (trunk only)
While testing something, I noticed that I could eat a tin (off the
floor) while polymorphed into a bat.  The code to check whether the hero
could open a tin was testing for limbs, so winged critters passed.  Now
it requires hands instead of limbs, and also that the current form be big
enough to be capable of wielding something (even though you don't need to
be wielding anything to open a tin).

     This means that a hero poly'd into a dog or cat will no longer be
able to serve him-/herself dinner from a tin....
2011-10-02 01:50:23 +00:00
nethack.rankin
2ba506b385 version feedback (trunk only)
Show the 'v' output (full version number plus build date-time) as
the first line of '#version' output (build time configuration settings).
It isn't simple to do that when generating dat/options (there's some
port-specific tweaking going), so do it at run-time by processing that
file one line at a time instead of passing it through a pager routine.

     This also inserts an "About NetHack" entry as the first choice in
the menu for '?', the way that most Windows programs have interactive
help organized.  Picking that gives the same output as using #version.

'make depend' manually updated for Unix and VMS (add dlb.h to version.*).
2011-09-23 07:33:18 +00:00
nethack.rankin
16e81690e3 new command '`' to show discoveries for one class (trunk only)
Use the grave accent (back tick) character as the keystroke for a
new command which prompts for an object class and then shows a subset of
the discovered objects list covering just the selected class.  Similar
to the 'I' variant of 'i' for viewing inventory, and mainly useful once
the '\' discoveries list has grown long.
2011-09-15 04:16:29 +00:00
nethack.rankin
d592b9c4ae sokoban completion (trunk only)
Something I've had in mind for a long time and finally gotten around
to implementing:  when you fill in the last pit or hole of a sokoban level,
it's considered to be completed so luck penalties for unsokobanish things
(breaking a boulder, dropping everything and squeezing onto a boulder's
spot, reading a scroll of earth) stop being assessed and most Sokoban-
specific movement restrictions (against pushing boulders diagonally,
squeezing diagonally between boulders, floating over a pit or hole without
falling in, digging of new holes by monsters) are lifted.  Teleporting,
level teleporting, and phasing through walls are still prohibited when in
the sokoban branch of the dungeon.  (Keeping the non-phasing one in place
prevents taking a shortcut to the final prize in order to bypass the
treasure zoo monsters.)

     This adds level.flags.sokoban_rules, defines Sokoban macro to access
it, and replaces most In_sokoban(&u.uz) tests to check it instead.  It
gets set when a sokoban level is pre-mapped at the end of level creation,
and if it is set then whenever a trap is deleted, the flag gets cleared
if there are no more pits or holes present on the level.
2011-08-30 22:13:27 +00:00
nethack.rankin
0acaa9bc1b wishing tweak: detect X vs X detection (trunk only)
Allow wishing for a "potion of detect objects" to generate a
"potion of object detection", or for a "spellbook of monster detection"
to generate a "spellbook of detect monsters".

     To get a spellbook you'll need to explicitly specify "spellbook"
even when using a name that's unique to books:  asking for "detect food"
will yield a "scroll of food detection" rather than "spellbook of detect
food" because it finds potions and scrolls first.  [That's nothing new
for the case where a spellbook and potion or scroll have the same name,
only new behavior for "detect X" vs "X detection" matches.]

     Wishing for "detect food" used to yield a random food item rather
than a "spellbook of detect food".  That's fixed now, although as
mentioned above it will actually produce a "scroll of food detection".
2011-08-28 20:47:56 +00:00
nethack.rankin
67f3a26e52 shopkeeper inheriting hero's possessions (trunk only)
Fix one of the issues noticed while investigating the report of a
shopkeeper sighing when a hero died without owing anything.  If the death
takes place outside of any shop on a level with multiple shopkeepers, the
first one in the fmon list would be the one who had access to the dying
hero's inventory, even if nothing was owed to that one and something was
owed to another shopkeeper.  Now the one who is owed gets first chance to
take the hero's possessions.

     When dying inside a shop, the keeper of that shop takes control of
the possessions regardless of whether he or anyone else is owed anything.
That hasn't changed, except that if the hero is simutaneoulsy inside
multiple shops (within a wall spot shared by two or more shops) and owes
money to one of them, the one who is owed will take his inventory even if
the other shk is found first.

     This doesn't include any changes to feedback given when the hero dies
in the presence of shopkeepers.
2011-08-28 02:11:12 +00:00
nethack.rankin
4aaf41de10 fix #H2428 - cockatrice nests filled with giant ant statues (trunk only)
From a bug report, if the high scores file
is brand new (empty), statues placed in a cockatrice nest (special room)
end up all being giant ant statues.  Statue creation for that room
suppresses object initialization (to prevent the statues from containing
spellbooks), so statue type is left as 0 by mkobj(), then when 'record'
is empty it never gets overridden with a role value as intended.

     This forces obj->corpsenm to be initialized as NON_PM instead of 0
by default, then overrides that for corpses, statues, and figurines even
when mkobj()'s caller requests that initialization be suppressed.  So if
'record' is empty, there will be a sensible fallback statue type.

     obj->corpsenm is overloaded for leashes ('leashmon', mon->m_id),
potions ('fromsink', fountain quaff hack), spellbooks ('spestudied', the
number of times the book has been read), and loadstones (corpsenm hack to
handle singular vs plural for "you can't let go of that/those" message).
If there are any other hidden corpsenm overloads, they may behave
strangely now that corpsenm is defaulting to -1 instead of 0....
2011-08-24 08:17:33 +00:00
nethack.rankin
8f07e5ee39 fix #H2397 - "<Mon> turns to flee" when paralyzed (trunk only)
From a bug report, a
monster incapable of moving could yield the message "<Mon> turns to flee!"
when hit by an attack which scared it.  I thought that something to fix
this had already been done, but that wasn't the case.  Now it will give
"The immobile <mon> seems to flinch" instead.  I'd rather use
  mon->data->mmove == 0 ? "immobile <mon>" :
    mon->paralyzed ? "paralyzed <mon>" : "sleeping <mon>"
but it presently isn't possible to distinguish between sleep, paralysis,
and being busy doning armor because mon->mfrozen is used for all three.
(I'm not going to worry about the busy case, even though "immobile" sounds
inaccurate for it.)

     Also, stethoscope and probing were suppressing "scared" after giving
"can't move", in order to reduce the chance of wrapping the top line.
This changes it to display both status conditions so that scared state
isn't hidden when the target is paralyzed or asleep (or busy).
2011-08-20 00:22:20 +00:00
nethack.rankin
28ab93325e Sleeping vs Sleepy (trunk only)
While looking at fixing the mfrozen issue for monsters (there's no
way to tell whether it's been caused by sleep or paralysis, necessitating
that some messages be vague or suppressed when actions impact monsters
who can't move), I noticed a drawbridge bug for the hero.  It was using
the misleadingly named Sleeping intrinsic incorrectly.  When that is
nonzero, the hero is prone to falling asleep at random intervals, not
necessarily asleep right now.  I've always intended to rename it to
something that's not misleading, but hadn't ever gotten around to doing
so, until now:  change the SLEEPING property to SLEEPY and the Sleeping
intrinsic/attribute to Sleepy.

     This may be moot for the drawbridge.  I can't remember any hero ever
jumping to safety instead of being crushed by either the bridge or its
portcullis, and I'm sure sleepiness hasn't been a factor.  So I haven't
included any fixes entry about misusing Sleeping when it meant u.usleep
(or better yet, unconscious(); or even better, Unaware [a post-3.4.3
pseudo-property that tests both unconscious() and fainted() when checking
whether hero is incapacitated]).
2011-07-28 04:00:21 +00:00
nethack.rankin
5f5721094b polyself weapon attack (trunk only)
From the newsgroup:  hero poly'd into various monster forms would be
incapable of turning a target to stone when wielding a cockatrice corpse.
Monster forms with a claw attack as their very first attack (second for
incubus and sucubus, handled as a special case) would have that be
converted into a weapon attack.  But some monster forms start with bite
attacks and have their claw attacks later; a hero poly'd into such form
wouldn't use his/her wielded weapon.

     This fixes that, but it's actually academic (or about to become so).
The only monster capable of wielding a weapon which would then be ignored
was jabberwock, and I think leaving NOHANDS off the jabberwock definition
is a bug in itself (next patch...).
2011-07-26 01:26:29 +00:00
nethack.rankin
c98133ac80 calculating shop price adjustments (trunk only)
Fix the second of a couple of minor things I noticed when viewing
that guy's ttyrec about a hidden inventory item which turned out to be
scrolls of scare monster on the used-up items section of his shop bill.

     He had a lot of scroll prices which started as $X00 and were changed
to $Y99 due to integer division roundoff when being hit with a 1/3 price
increase for unID'd items followed by 1/2 price increase for low charisma:
  100  ->  133  ->  199
  200  ->  266  ->  399
Forcing things to round up instead of truncate would help in some cases
but yield $Z01 in others.  Rather than doing that, this accumulates the
adjustment factors and then uses them to make one calculation which gives
a better result:
  100  ->  200
  200  ->  400
Other values and/or other adjustments might not work out so well, but I
don't think they'll ever become prices which look worse than before.
For a single increase of 1/3, 100 still yields 133 but 200 now gives 267
(so ends up differing from the combined price for two 100->133 items).
2011-07-23 03:57:09 +00:00
nethack.rankin
8d5a04a1c0 fix #H2384 - ceiling hiding by poly'd hero (trunk only)
From a bug report, a hero hiding on the
ceiling while poly'd into a piercer or lurker-above could be moved long
distances when a monster attacked his location, because when the attacker
moves into hero's spot, hero's new location is chosen before the attacker
had released its own spot.  If things are crowded, the nearest open space
can be quite far away, including beyond nonpassable walls.  Fix by taking
attacker off the map before choosing hero's destination, so in crowded
conditions they will likely end up trading places.

     This also prevents eels and sharks from moving onto land when the
hero has hidden on the ceiling next to their pool.  They'll miss without
moving into hero's spot, but the hero will become unhidden so they'll be
able to make ordinary water-to-shore attack on their next turn.

     Lastly, when the attacker is a long worm, the spot chosen for hero
might be filled by its tail by the time hero actually moves.  So double
check and possibly re-select target spot after moving a worm's tail.
2011-07-17 09:19:17 +00:00
nethack.rankin
6a53009069 fix shop ownership of saddle dropped by dead pet (trunk only)
From a bug report, you could obtain
a saddle for free if it was dropped (while worn) by a dying pet inside a
shop.  That's intentional, but it was happening even when the hero was
not in the shop, which doesn't seem right.  Change things to only set it
no_charge if hero is within the same shop (including standing in the
doorway or a temporary wall breach, not just when all the way inside) at
the time of the drop.
2011-07-09 02:56:38 +00:00
nethack.rankin
8a66aa38df additional paranoia (trunk only)
A couple of extensions to the paranoid_confirmation option:

1) add paranoid_confirmation:Confirm -- setting this means that any
prompt where the other paranoid_confirm flags have been set to require
a yes response instead of y to confirm also require explicit no rather
than arbitrary non-yes to reject.  It will reprompt if you don't answer
"yes" or "no" (unless you use ESC, which is treated the same as "no").

2) add paranoid_confirmation:bones -- control whether the "save bones?"
prompt in wizard mode requires yes instead of just y.  The original user-
developed paranoid_confirm patch required yes unconditionally here, and
I left that out thinking it was undesireable.  But after testing the
"your body rises from the dead as <undead>..." fix a couple of days ago,
where you now get an extra message and consequent --More-- prompt just
before "save bones?", I've changed my mind about its usefulness, provided
that it's settable rather than unconditional.

     Handling paranoid_confirmation:bones outside of wizard mode is a
bit tricky.  Right now, it can still be seen via 'O' if it has been set
in NETHACKOPTIONS, but it won't show up in the menu if you use 'O' to
interactively change the value of paranoid_confirmation.  I'm not sure
whether that's the right way to go; it might be better to let non-wizard
users uselessly toggle it on and off rather than only partially hide it.
Or maybe it should be hidden from the current value even when it's set.
Or decline to set it in first place, despite external option settings.
2011-04-25 03:29:49 +00:00
nethack.rankin
4151ab500f fix #H2259 - rising from dead message gives away info (trunk only)
From a bug report, receiving the
message "Your body rises from the dead as an <undead>..." gives away
the fact that bones are being created (and its absence when applicable
undead kills the hero gives away the fact that bones aren't being
created).  Not very interesting for single player installations where
5-10 seconds later the player is going to check the playground for new
files, but matters on multi-user installations where players don't have
access to the directory and sometimes race each other to juicy bones,
such as nethack.alt.org.

     At the end of disclosure, give the message whether bones are being
saved or not (for cases where it would have happened when bones are
created).  Player won't know whether new bones are becoming available.
Also, prevent risen undead-from-hero from being given random monster
inventory, but explicitly give mummy-from-hero a mummy wrapping if the
hero isn't already carrying one.  It will end up being worn; that's
the only armor mummies are allowed to put on.
2011-04-24 02:53:52 +00:00
nethack.rankin
9cad308536 fix #H2247 - lava inconsistencies (trunk only)
From a bug report, if you move into lava, die,
and are life-saved or leave bones, your potions will remain intact,
whereas if you have fire resistance and survive, they'll be subjected to
destroy_item() and usually be destroyed (not always, because stacks of
more than 1 don't always destroy the whole stack).  Also, wooden ring
will be destroyed even if it happens to be ring of fire resistance.
This addresses both of those bugs.

     He also thought that all vulnerable armor should be destroyed rather
than just boots in the case where you have fire resistance and survive,
but I didn't change that.  It is a little odd, but presumeably only your
feet are in lava at first (although later sinking further into lava
doesn't actually burn up any other stuff).
2011-04-21 22:06:06 +00:00
nethack.rankin
2f1813cdd8 altmeta Alt key hack, mainly for unix (trunk only)
Some time ago we received a patch submission which attempted to
handle the Alt key for terminals or emulators which transmit two char
sequence "ESC c" when Alt+c is pressed, but I can't find it.  I don't
remember the details but recall that it had at least once significant
problem (perhaps just that it was unconditional, although it may have
been implemented in a way which interferred with using ESC to cancel).

     This patch reimplements the desired fix, making the new behavior be
conditional on a boolean option:  altmeta.  That option already exists
for the Amiga port, where it deals with low-level keyboard handling but
essentially affects the same thing:  whether Alt+key can be used as a
shortcut for various extended commands.  This one affects how the core
processes commands, and is only available if ALTMETA is defined at
compile time.  I've defined that for Unix and VMS; other ports don't
seem to need it.  (I'm not sure whether "options" created by makedefs
ought to mention it.  So far, it doesn't since this isn't something
users are expected to tweak.  The setting of the non-Amiga altmeta
option doesn't get saved and restored, so won't affect saved data if
someone does toggle ALTMETA and then rebuild.)

     When [non-Amiga] altmeta is set, nethack's core will give special
handling to ESC, but only during top level command processing.  If ESC
is seen while reading a command, it will be consumed and then the next
character seen will have its meta bit set.  This introduces a potential
problem:  typing ESC as a command will result in waiting for another
character instead of reporting that that isn't a valid command.  Since it
isn't a valid command, this shouldn't be a big deal, but starting a count
intended to prefix your next command and then typing ESC after deciding
to abort that count runs into the same situation:  nethack will wait for
another character to complete the two character sequence expected for
"ESC c".  There's not much that can be done with this, other than have
the Guidebook mention that an extra ESC is needed to cancel the pending
count, because digits followed by ESC could actually be a numeric prefix
for Alt+something rather than an attempt to abort the count.
2011-04-19 02:02:11 +00:00
nethack.rankin
8df1e4d6cb fix #2253 - shk dismissing kops from other level (trunk only)
From a bug report, if you rob a shop, let the
angry shopkeeper catch up with you outside his shop, escape to another
level with adjacent shk tagging along, then pacify the shk by paying him
off, he will dismiss kops on the present level and return to his shop
but when you return to his shop level there'll still be kops chasing you
there.  This fix adds an extra flag to the eshk structure so that kops
can be dismissed a second time when the shk migrates back to shop level.
The first dismisal (on the "wrong" level) still takes place in case any
kops are around.  Neither dismissal actually occurs if there happens to
be another angry shk present on the level where dismissal is being done.
2011-04-15 01:55:42 +00:00
nethack.rankin
5bd6ba0d1c magic cancellation and Protection (trunk only)
Magic cancellation comes from some types of worn armor and has a
value of 0 through 3.  A non-zero value guards against some forms of
monster magic attacks (most notably, level drain by vampires and wraiths
and lycanthropy from werecritter bites).  This reduces the effectiveness
of mc a moderate amount (the new values happen to be the same as those
adopted by the Spork variant):
 chance to block various touch effects
  mc  old     new
   1  34.67%  30%
   2  67.33%  60%
   3  98%     90%

    This also makes the Protection intrinsic (strictly speaking, extrinsic)
be the only way to attain an mc factor of 3.  Cloak of protection is the
only way to get mc 3 from a single item.  Otherwise you need an mc 2 item
and a ring of protection (or one of the recently modified quest artifacts).

     Cancellation factor for elven and dwarvish mithril coats and for
robes and oilskin cloaks is reduced from 3 to 2; for elven cloak and
cloak of magic resistance from 3 to 1 (play balance; they're valuable
even without magic cancellation); for dwarven and orcish cloaks and
clocks of invisibility and displacement and for cornuthaum (wizard hat)
from 2 to 1.  Plate mail and crystal plate mail stay at 2.  A variety of
suits which were at 0 are increased to 1; leather jacket and dragon
scales/scale mail stay at 0 (the latter for play balance rather than for
the amount of your body that's covered).

     Having extrinsic protection will increase mc by 1 (unless it's
already 3).  That's obtained by wearing a cloak of protection (where the
increase is redundant), a ring (or two) of protection (even if conferring
a negative AC amount), or wearing the Mitre of Holiness or wielding the
Tsurugi of Muramasa.  Having multiple sources doesn't make the benefit
cumulative; it's just +1.

     Intrinsic protection (bought from priest, gained from prayer, gained
from eating rings of protection while polymorphed into metallivore, or
temporary while spell of protection is active) doesn't increase mc from
armor but does provide minimum mc 1 instead of naked 0 (play balance
again; buying it is too easy to let it increase mc 1 or 2 to 2 or 3).
(Extrinsic protection is a superset; its +1 bonus also increases 0 to 1.)

    TODO: add an amulet of protection so player has another option for
extrinsic protection.
2011-04-07 20:59:40 +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
fa94c173af high level monster spell casting (trunk only)
Mage-spell casters higher than level 23 and cleric-spell casters
higher than level 13 became less and less likely to cast interesting
spells as level went higher, more and more likely to cast the default
psi-bolt or open wounds.  [Level 21 caster had 4.75% chance to cast
touch of death; level 22, 9%; level 23, 13% chance; then level 24, 12.5%;
level 25, 12%; level 30, 10%; level 50 (demon lords/princes), only 6%.]
This oddity in spell selection meant that the Wizard of Yendor gradually
became less likely to use "double trouble" to clone himself as he got
killed off more times and his next incarnation arrived at higher level.
This fix makes high level casters who pick too-high spell usually retry
until they get a valid one instead of just reverting to the default.
Still slightly biased towards psi-bolt and open wounds, since they're
effective even though a bit boring.
2011-03-15 02:25:28 +00:00
nethack.rankin
2ec7b5d2f6 paranoid_confirmation [expanded user patch] (trunk only; 2 of 2)
[Short writeup; see 'cvs log' of flag.h or options.c for the long one.]

     This is a reworking of user contributed patch known as Paranoid_Quit.

     Add a new compound option, paranoid_confirmation, accepting a space
separated list of values "quit die attack pray Remove"; default is "pray".
paranoid:quit   - yes vs y for "really quit?" and "enter explore mode?"
paranoid:die    - yes vs y for "die?" in explore mode or wizard mode
paranoid:attack - yes vs y for "really attack <peacful monster>?"
paranoid:pray   - y to pray; supersedes prayconfirm boolean; on by default
paranoid:Remove - always issue an inventory prompt for 'R' an 'T', even
  when only one applicable item is currently worn.
2011-03-05 10:09:48 +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
df9e4b345d fix #H2200 - disintegration by divine wrath (trunk only)
From a bug report, it you're targetted by
divine wratch while swallowed by a shock-resistant engulfer, the
ineffective lightning is followed by a wide-angle disintegration beam
which "fries <the engulfer> to a crisp"; he felt that being fried was
not appropriate for disintegration.  I agree.  (He also failed to notice
that the exact same terminology is used for killing the hero when not
swallowed.)  I wanted to use "disintegrated into a cloud of dust" here,
but if a suit has just been disintegrated you'll have seen "turns to dust
and falls to the floor" for that, so I settled for "into a pile of dust".
2011-03-01 00:50:13 +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
9e7df53b84 spurious mail daemons (trunk only)
From the newsgroup:  when the special level loader is creating
random '&' class monsters, it can produce mail daemons.  The thread
reports seeing some on the levels holding the Wizard of Yendor's Tower
and they vanish as soon as it's their turn to move.  I didn't reproduce
it, but create_monster() is overriding the NOGEN flag when it calls
mkclass() so getting mail daemons is feasible.  This fixes that by
treating them similar to the human/elf/orc/giant placeholder monsters
that are excluded from random generation.  More or less.
2011-02-28 03:36:08 +00:00
nethack.rankin
f23e87f2b4 fix #H2225 - death by poison after life-saving (trunk only)
From a bug report,
when falling into a spiked pit and being killed and then life-saved, you
could immediately die from fatal poison.  It isn't necessarily a bug and
there are other ways to be killed, life-saved, and re-killed (such as
zaps that bounce off walls or reflecting targets), but it does seem to be
somewhat unfair.  This patch makes life-saving be more effective:  in a
damage-plus-poison situation, if the damage triggers life-saving then the
poison won't deal out any further damage (including its nasty chance for
instant death).  The poison still matters, but it will always target an
attribute stat--which is already one possible random outcome--instead of
maybe doing damage.  [It is actually possible to get damage if stat loss
tries to take hero's strength below 3, but now there's no chance of that
being fatal immediately after savelife() has restored full hit points.]
2011-02-17 03:51:04 +00:00
nethack.rankin
c34efb07bd mimic-as-door stealing key (trunk only)
Suggested by <email deleted> a month ago when he
reported that attempting to unlock a door which was actually a mimic
simply told the player that the door was not locked or that there was
no door.  He thought that mimic should take the key/pick/card away from
the hero.  This gives a 50% chance for the unlocking tool to be stolen
and become part of the mimic's inventory; it will be dropped when mimic
is killed.

     The theft routine has groundwork to be able to be used to take the
hero's wielded or thrown weapon when hitting, but the attack code doesn't
call it so that won't happen (and the theft code hasn't been tested under
that circumstance).  I'm not sure whether mimics should be able to grab
weapons, but g.cubes perhaps should, and if puddings could then "pudding
farming" [using a low damage iron weapon to split puddings, yielding tons
of experience, death drops, and #offer fodder when they're killed and
repeatable for as long as at least one pudding is kept healthy enough to
be split again] would become tougher to accomplish.  [The item drop and
corpse aspects have been toned down quite a bit since 3.4.3, but with
sufficient patience it is still possible to abuse.]
2011-02-03 21:49:36 +00:00
nethack.rankin
72ca745646 purple worms in wall (trunk only)
From a bug report, a purple worm
could swallow a ghost or xorn and end up inside solid rock.  It took a
bunch of tries to reproduce this, but I eventually did.  (I'm not sure
why it didn't happen every time a worm swallowed a target which was in
rock; the code for positioning an engulfer after it digests a target
always puts the engulfer in the target's former spot.)  After this
patch, worms can still swallow ghosts and xorns, but only when they're
in locations the worm could walk onto.
2011-01-11 02:21:10 +00:00
nethack.rankin
3b6c59c7fc more mimic-as-boulder (trunk only)
I started to add handling for doorways containing mimic-as-boulder
to doopen() and doclose() as was done for pick_lock(), but decided that
it was better just to prevent mimics from appearing as boulders at closed
door locations in the first place.  So the most recent pick_lock() change
and its fixes entry go away.

     This also fixes a post-3.4.3 bug.  On the top level of Sokoban I
discovered a boulder over a hole; probing reported it as a mimic with
0 hp.  The special level loading code moves mimic-as-boulder away from
trap spots by using place_monster() to put it on another spot, but it
was missing the corresponding remove_monster() to take it away from the
original location so left a stale pointer on the map.
2011-01-05 01:28:36 +00:00
nethack.rankin
e379b245d4 fix #H2154 - unlocking door blocked by mimic-as-boulder (trunk only)
Reported five months ago by <email deleted>,
the top level of Sokoban has mimics who pose as boulders and if one was
in a doorway (treasure zoo at final destination) you could still unlock
the door there without waking the mimic.  Yesterday's fix for unlocking
a door which was actually a mimic posing as one didn't handle this case.
2011-01-02 01:35:14 +00:00
nethack.rankin
1dcaa1621b fix #H2210 - unlocking a mimic masquerading as a door (trunk only)
From a bug report, attempting to use a key,
lock pick, or credit card on an open doorway that contained a mimic posing
as a closed door reported "that doorway has no door" or "you cannot lock
an open door" as if no monster was present, and failed to find the mimic.
2011-01-01 00:34:19 +00:00
nethack.rankin
3cdc140c72 talking gecko (trunk only)
Suggested by <email deleted>, chatting to a gecko will
give a reference to GEICO's car insurance ads.  I limited it to when
the hero is hallucinating.  Chatting to a gecko monster, or to anything
capable of speaking--except for a couple of previously handled special
cases, like quest leader--which happens to look like a gecko at the time,
or (50:50 chance) to a shopkeeper regardless of appearance, you'll get
"15 minutes can save you 15 zorkmids", parodying "15 minutes can save you
15% or more on car insurance".  (One of my comments says there's a chance
to interfere with shopping, but that's not accurate since using #chat to
get shop price quotes doesn't use the monster-response routine.  I left
that comment in anyway; the "15 minutes" response might interfere afterall
if someone mistakenly thinks they can save gold by waiting that long
before paying their shopping bill.)

     I don't think we ever found a good place to add some reference to
GEICO's other--and more relevant to nethack--slogan, "so easy a caveman
can do it".
2010-12-14 01:14:37 +00:00
nethack.rankin
0c1b96470e fix #H2195 - late discovery for teleport scrolls (trunk only)
I accidentally left this out.  Getting rusty I guess....
2010-12-06 01:44:58 +00:00
nethack.rankin
b0a70e81dd stone-to-flesh vs Heart of Ahriman (trunk only)
From the newsgroup:  a player accidentally cast the stone-to-flesh
spell at himself (I don't recall whether he chose wrong spell or wrong
direction, or tried to cancel and game used last remembered direction)
and the barbarian quest artifact he was carring turned into a meatball.
Artifacts already have a high chance (95%) to resist being polymorphed
but that doesn't apply for the stone-to-flesh transformation.  This
gives stone artifacts a high chance (98%) to resist being turned into
flesh.  Non-artifacts also get a small chance (2%) to resist as well.
2010-08-28 00:15:39 +00:00
nethack.rankin
fefeda5422 fix #H2161 - writing scrolls based on description (trunk only)
From a bug report, you could write scrolls
by type name ("magic mapping") if you had that type of scroll in your
discoveries list via assigning a name to an unknown scroll ("scroll
labeled FOOBIE BLETCH called foo").  Being on that list was enough to
treat the type as known when writing scrolls and books.  And he fealt
that it was abusive to be able to collect and name a lot of unknown
scrolls and then write favorite ones which had good odds of being in the
collected set.

     This changes it to the original intent:  if your discoveries list
has FOOBIE BLETCH on it, you can write a scroll by that label (since we
decided way back when that a scroll's label was its magic, to explain how
a blind hero can read any scroll whose description is known even though
they aren't constructed in braille).  If you have identified the type
("scroll of magic mapping labeled FOOBIE BLETCH") then you can write by
type or by description, but you can no longer write one by type when only
the description is known.  There is a potential can-of-worms bug here:
if you walked across a "scroll labeled YUM YUM" but have not assigned it
any name, you've still learned its magic words and ought to be able to
write a scroll of YUM YUM.  We don't have any mechanism to track items
which have been observed but not been put on the discoveries list.  This
patch plugs one obvious hole, by scanning inventory to treat any seen
scroll labels there as an extension of the discoveries list.  But the
more general case of something once seen but not named or currently held
is ignored.

     This also adds writing scrolls by the user-assigned name, so if
your discoveries list has "scroll labeled FOOBIE BLETCH called foo" you
can write either foo or FOOBIE BLETCH to get the scroll.  I'm not sure
the bug report advocated that--parts of it were a bit confusing, at
least to me--and I'm not completely sure that we want to have it, but it
does work.  Without it, you got "no such thing as \"foo\"", which seems
counter-intuitive when "foo" is there in plain sight on your discoveries
list.  The new code chooses randomly if multiple scrolls have been called
"foo".  And if you've called something by an actual object name, it uses
your knowledge of that object rather than anything you've given its name
to.  In other words, if you have "scroll labeled YUM YUM called magic
mapping" and try to write magic mapping, it will use your knowledge--or
lack of same--about scroll of magic mapping rather than scroll labeled
YUM YUM to decide whether you'll succeed.

     There is also a minor tweak in the chance to write a completely
unknown scroll or book.  Wizards almost never failed once their Luck was
5 or more; using rnl(5) instead of rnl(3) requires Luck 11 rather than
just 5 to get that ~39/40 chance of success.  Non-wizards didn't change.

     Lastly, this fixes an unrelated bug when writing spellbooks.  The
message "the spellbook warps strangely, then turns <new description>"
works okay when <new description> is "red" or even "ragged", but not so
well when it's "vellum".  A handful of book descriptions refer to the
item composition rather than the appearance of the cover, and turning
into a new composition needs different phrasing.  I just tweaked it to
be "turns into vellum", which is probably suboptimal (particularly for
the book description "cloth" :-).
2010-08-14 00:31:59 +00:00
nethack.rankin
0ee120b9b5 forgetting spells due to amnesia (trunk only)
From the newsgroup, losing spells to amnesia always took away the
last 'N' spells after choosing a random N.  That kept casting letters
sane, since letters for lost spells became invalid and those for non-lost
ones stayed the same as they were before amnesia.  But 3.4.x gave the
player the ability to swap pairs of spells, so he could make his favorites
to be the first spells, and only lose them if the random number of spells
being affected was as large as the whole list.  (Also, divine spellbook
gifts give preference to books for unknown spells; in theory, you could
use spell letter manipulation plus deliberate amnesia to make a particular
spell revert to unknown in order to improve the chance of getting a new
spellbook for it.  A bit of cleverness by a determined player but it
makes the game and/or its patron deities seem a bit dumb in the process.)

     I first implemented losing spells throughout the list, with later
spells moved forward to fill any gaps.  But that results in new casting
letters for every spell past the first lost one, potentially wreaking
havoc if a player chooses a casting letter from his own memory of the
pre-amnesia list.  So, instead of losing some spells entirely, either
from the end of the list or spread throughout, I've changed amnesia to
set the retention amount (of N spells from throughout the list) to zero,
the same as happens when it's been 20000 turns since the spell was last
learned.  Letters for all known spells stay unchanged, and forgetting
due to amnesia becomes the same as the other way of forgetting spells.
(So now a different potential clever use of amnesia occurs; a player who's
trying to a make speed ascension could get access to expired spells--to
cast in order to become confused--without waiting for 20000 turns after
reading the first book.)
2010-07-27 03:08:04 +00:00
nethack.rankin
8aecc66204 fix #H2150 - discovering displacement when can't see its effect
From a bug report, when putting on a
cloak of displacement you discovered what it was even if you were invisible
and unable to see invisible, hence couldn't see yourself.  It isn't exactly
clear what the hero sees of himself when displaced, but I think it makes
sense that you shouldn't discover the cloak when you can't see yourself,
which suggests that you shouldn't discover it when blind either.

     Discovering it after regaining sight, becoming able to see your
invisible self, or losing invisibility seemed complex and likely to be
bug-prone, so this patch leaves the cloak undiscovered in that situation.
But it does become discovered when taken off (provided that you can see
yourself by then) rather than waiting all the way 'til put back on again.

     Elven cloaks had a comparable issue.  I assume that stealthiness can
be perceived without being able to see yourself, but it shouldn't become
discovered when you're already stealthy from some other means.  (Elven
boots already behaved this way; now elven cloaks work like them.)

     Rings of stealth would never be auto-discovered.  Now they'll be
like elven cloaks and boots and be discovered if put on when not already
steathy or taken off and losing stealth.  In both cases, the ring has to
have its description known; if picked up when blind and still not seen
yet it won't become discovered even when you notice yourself gaining or
losing stealth.

     Not tested:  feedback given when a worn ring or cloak gets dipped
into a potion of polymorph and changes into or away from a stealth or
displacement conferring item.
2010-07-24 03:53:52 +00:00