Commit Graph

694 Commits

Author SHA1 Message Date
nethack.rankin
35493a3545 current_fruit (trunk only)
I almost abandoned this when Michael beat me to it, but besides
handling the fruit rename bug it also moves `current_fruit' into the
context structure to eliminate separate save/restore for that.
2008-07-21 00:03:41 +00:00
keni
b5d05b2bca SHELLERS for SYSCF, MacOS 10.5 hints file (trunk only)
Add SHELLERS - people allowed to use ! command with same syntax as WIZARDS.
Add new hints file for 10.5, since the rules and commands for groups changed
(new commands introduced in 10.4, old ones removed in 10.5; creating a new
user under 10.4 gave you a matching group, in 10.5 it doesn't).  Also move
shared build into roughly right place in file system when being installed
for root - don't use ~root.
Makefile.top - don't remove ./-p unless it exists (that's always annoyed me).
fix error invoking macosx.sh
2008-06-14 20:57:21 +00:00
keni
0b3e8bbd88 macosx hints file consolidation (trunk only)
get macosx down to one hints file (default tty, single user) for
 tty, x11, qt and single or multiple users
preliminary bits that might allow a macosx qt build
2008-04-08 23:17:39 +00:00
keni
97abafd41a add MAXPLAYERS to SYSCF (trunk only)
Add MAXPLAYERS to SYSCF config file; deprecate (but continue to support)
 MAX_NR_OF_PLAYERS in nethack.sh since it is trivially overridden in many
 (all?) cases and isn't useful for ports that don't use nethack.sh.
2008-04-07 22:27:18 +00:00
nethack.rankin
17f63949bc probing while swallowed (trunk only)
Reported recently by <Someone>:  probing feedback while engulfed
shouldn't claim that the monster is not carrying anything when the hero
is inside of it.  The simple case where it's not carrying anything else
was a trivial one line change; handling inventory plus hero was trickier
and I wouldn't have bothered if I'd realized what it was going to take.
But it's done now; trivial case
        The purple worm is not carrying anything besides you.
and harder case
        The purple worm's possessions:
        Weapons
        a - an uncursed dagger
        Swallowed Creature
        > - human archeologist called wizard
2008-03-21 03:12:14 +00:00
nethack.rankin
f2e3953914 vitamin deficiency (trunk only)
Implement something <Someone> suggested a long time ago:  eating a
disenchanter corpse has a chance to remove an intrinsic.  Uses the same
routine as nighttime gremlin attacks, which chooses an intrinsic randomly
and attempts to remove it, so has no effect if it chooses one the hero
lacks.  This can be used to remove "aggravate monster" but is much more
likely to target something the player wants to keep.  [By the way, a lot
of potential candidates are missing:  sleep, shock, and disintegration
resistance and teleport control come immediately to mind.]

     Also, it has been bugging me that you can get both strength and
fire/cold/shock resistance from the same fire/frost/storm giant corpse.
The code prevents mind flayer corpses from conferring both intelligence
and telepathy, so strength handling was inconsistent (even though it
predated mind flayers...).  This causes strength boosting to be treated
as an extra candidate when selecting an intrinsic to confer, so you'll
either get strength or resistance (which might be a no-op) but not both
from those giants.  And it special cases the other giants to have the
same 50% chance for boosting strength, even though the alternative in
their case is to do nothing instead of trying to confer something else.
Lastly, it now gives a message when you succeed in gaining strength.
2008-02-22 01:44:57 +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
da172c5773 identify_pack (trunk only)
Three years ago <email deleted> reported that
stepping off the end of inventory via typing space to go to the next menu
page wasted his identify scroll.  He suggested that some people might do
that because they don't know how to back up in a multi-page menu.  I
pointed out the Guidebook section that describes < and ^ to go back one
page or back to start and left things at that.  However, traditional mode
reprompts if you step through all of inventory without choosing something,
so this changes identify-via-menu to do likewise.  You can dismiss the
menu with ESC to really avoid choosing anything.

     This also makes identification of N items when you're carrying N or
fewer unID'd things behave the same as identify all:  identify everything
without any prompting.
2008-02-16 02:31:34 +00:00
keni
6f0e178368 more SYSCF and related bits - cleanup and features
infrastructure for "system options" - things currently specified at build
 time that should be changeable at install time or run time but not really
 under user control
generalize contact info so it can be localized and it doesn't have to be
 an email address
move recently introduced WIZARDS into sysopt
drop bogus OPTIONS=wizards possibility
new function build_english_list() to comma-ize and add 'or' from a whitespace separated list: A.  A or B.  A, B, or C.
syscf file now handles: WIZARDS SUPPORT RECOVER
 SUPPORT specifies local support information
 RECOVER will eventually supply port-specific and/or localized info on how
  to run recover (or get it run for you).
Note: in sys/msdos I changed sys.o (generated from pcsys.c) to pcsys.o
Note: sys/msdos/Makefile.GCC has 2 rules for sys.o (now pcsys.o)
2008-01-31 00:56:59 +00:00
nethack.rankin
d8a45a57b5 ring discovery (trunk only)
Picking up and putting on a +1 ring of protection while blind
resulted in having a "+1 ring (on {left|right} hand)" in inventory and
having ring of protection show up in the discoveries list.  The problem
is the same as the one for wands which has been previously addressed
(but not 100% fixed...):  when using an item whose effect is observable,
the item's type became discovered based upon that observation even if the
item itself had never been seen.

     The code for removing ring of protection lacked its break statement
and fell into the case for removing ring of protection from shapechangers,
but didn't cause any noticeable problem.
2008-01-29 04:17:03 +00:00
nethack.rankin
fb043c5f01 inventory display after regaining sight (trunk only)
I suspect--but have no way to test--that there is a subtle difference
in game play between perm_invent and !perm_invent involving object merging
or other activity that depends on whether or not object->dknown is set.
For objects pickup up while blind, where object->dknown is left as is,
the perm_invent config would have such items marked as seen sooner (since
there are umpteen places that call update_inventory() which will end up
setting the seen bit while formatting objects).  Non-perm_invent wouldn't
have that done until the user examines invent (or asks to see a list of
objects at the "which object?" prompt for various commands).  This patch
effectively examines inventory whenever blindness ends, so both modes get
dknown set as soon as possible.  And if we ever add an "effect known" flag
for unseen objects which are used while blind, this would be a suitable
place to perform deferred object discovery.
2008-01-27 02:06:18 +00:00
nethack.rankin
c68ffb4607 'T' failure feedback; suit_simple_name() (trunk only)
The post-3.4.3 ring removal bug also applied to suit when wearing a
cloak and shirt when wearing a suit or cloak or both, although it would
never give "you have nothing else to take off" because the covering item
was always present as a likely candidate.  The ring fix also fixed armor.
When testing that fix, I saw "you can't take that off" for trying to take
off a suit while wearing a cloak.  That isn't new or a bug, but it seemed
awfully terse so I've changed it to give "you can't take that off without
taking off your cloak first".  (Likewise, "cloak", "suit", or "cloak and
suit" as appropriate when trying to take off a shirt.)

     This adds new routine `suit_simple_name()', comparable to 3.4.3's
cloak_simple_name() and post-3.4.3 helm_simple_name().  No doubt there
are other places besides "without taking off your X first" that could
make use of it but I haven't attempted to track them down.  The "you are
already wearing _some armor_" one doesn't quite fit.  It would need to
adjust "some" to "a"/"an" at times ("some mail" or "some dragon scales"
vs "a suit" or "a jacket").
2008-01-25 03:25:38 +00:00
nethack.rankin
33c14ba523 enlightenment revamp, part I (trunk only)
Groundwork for re-doing ^X so that it'll be more integrated with
enlightenment and display bottom line information without abbreviations
or long-line truncation.  `mode' doesn't do anything yet so may provoke
lint complaints.
2008-01-21 16:40:56 +00:00
keni
f2d37bac2e system-wide configuration file
Add options SYSCF (to add a system-wide configuration file) and SYSCF_FILE
(for a file-based implementation of SYSCF) - this allows a binary distribution
to be configured at install time.  The only option supported at this time is
WIZARDS - a list of usernames which can use -D; currently only for unix-likes
but should be extendable to anything that has a concept of multiple users.
Add mac tty multiuser config using sgid.
2008-01-09 01:57:41 +00:00
nethack.rankin
d0a7d15023 drain energy attack (trunk only)
During some recent newsgroup discussion, <Someone> posted an entry from
his personal bug list:  energy draining damage from ordinary attacks is
implemented even though there are no monsters with that capability and it
was not implemented for engulf attacks even though energy vortices have
the capability.  This implements energy drain engulf attacks against the
hero and also both modes of energy drain attacks for monsters and poly'd
hero against spellcasting monsters.  Since monsters don't have energy,
they lose access to their special abilities (their spells, that is) for a
few turns, same as a post-3.4.3 change done for anti-magic traps.
2007-12-20 23:02:47 +00:00
nethack.allison
d430db0718 remove time_t from struct you (trunk only)
There was an issue reported where save files between different
versions of a manufacturer's compiler were incompatible because the time_t
ubirthday field was changed from 32 bits to 64 bits.

32 bit time_t implementations will break at 19:14:07 on  January 18, 2038.
64 bit time_t implementations will break at 23:59:59 on December 31, 3000.

This removes the dependency on the size of time_t from the save file.
The ubirthday field is no longer embedded in struct you.
This also adds two general purpose routines to hacklib.c, one to convert a time
value to a 14 character char representation and the other to convert that
back to time_t. Those are used by the save/restore routines.

This is a savefile breaking change, so editlevel in patchlevel.h was
incremented.
2007-12-19 03:19:25 +00:00
keni
59e64a1d40 First pass at a hints-based build system to augment (not replace) the existing
build system.

Anyone who wants to do a build from sys/unix and doesn't want to figure this
out just needs to do:
	sh setup.sh hints/unix
instead of:
	sh setup.sh
and then continue on as usual.

New files:
sys/unix/NewInstall.unx - the new directions
sys/unix/hints/* - the hints files.  There will be more later.
sys/unix/mkmkfile.sh - helper for setup.sh

Summary of changes:
see NewInstall.unx for info on the new build system
introduction of various preprocessor symbols to turn options off that
 are defaulted on historically
comment out nethackrc (and similar) entries that still use the old symbol
 syntax.
commenting out of Makefile.* lines that now come from hints/unix
GAMEDIR is replaced with HACKDIR so the Makefiles and the C source agree.
  Note that I have NOT changed the docs and/or Makefiles for be, msdos, os2,
  vms, or winnt.  If port maintainers don't then I will, but I can't test
  those ports.
nethack.sh now handles the font path automatically
2007-12-13 20:17:11 +00:00
nethack.rankin
19d9b34374 jetison old warning code
Get rid of most of the vestiges of the old warning code that was
replaced over 7 years ago.  I left the list of colors which were used for
warning flashes.
2007-12-01 21:07:23 +00:00
nethack.rankin
e2eba2ae9a endgame portal detection (trunk only)
In the newsgroup about three weeks ago someone described trying to
use the Bell of Opening to find the magic portal on the Plane of Water
and not succeeding.  It's supposed to work like a wand of secret door
detection to mark nearby traps as known.  And does, but it turns out
that the wand wasn't working as expected there either.  They both require
line of sight, and since the water outside of the bubbles blocks that
they only found the portal if it was within the same bubble as the hero.
(Clouds on the Plane of Air posed a similar problem, although monster
activity usually reveals the portal on that level so this wasn't much of
an issue there.)  Since the detection magic doesn't require the hero to
see the traps--wand and Bell both work while blind--this patch overrides
the line of sight requirement on the Planes of Water and Air.  As long as
hero is within the detection magic's range, the portals on those levels
will get marked as having been seen and when the hero gets into the right
bubble or out of the clouds the portal traps will be shown on the map.

     The line-of-sight override code is simple-minded and lets players
find traps through boulders when/if those are present (but the found
traps won't be seen yet since vision still controls the map display).
Also, it assumes that only water/air/cloud terrain is present so could
potentially yield strange results if any other terrain gets introduced on
either of those two levels.
2007-11-25 23:03:47 +00:00
nethack.rankin
a675cc6ed7 vms file access
Fix the problem From a bug report.  His system has a logical name "DATA" pointing at some disk, and
when the dlb utility tried to open "data" for inclusion in the library
being built at install time, it attempted to access the wrong thing and
failed.  He then attempted to fix it in a manner which let dlb finish, by
modifying dlb_main.c to append "." to file names that lack a dot, but
then nethack couldn't access "dungeon" in the library because string
comparison didn't match the altered dlb directory entry of "dungeon.".

     NetHack was working around this unintended interaction with the
environment issue in fopen_datafile(), and dlb was doing so for fopen()
but not open().  This moves nethack's fixup out of src/files.c and into
sys/vms/vmsfiles.c, adds another routine there so that both open() and
fopen() are covered, and updates the vms Makefiles so that the various
utility programs all link with vmsfiles.  (The build script vmsbuild.com
puts object files into a library and gets that last bit for free.)
2007-10-28 09:37:56 +00:00
nethack.rankin
4c83db0294 fix #H1232 - hole in ice is described as moat [1 of 2] (trunk only)
From a bug report, when ice on the Valkyrie
quest home level was melted and a boulder filled the resulting pool, that
pool was described as a moat.  This was actually a terrain issue rather
than a formatting glitch, so instead of tweaking waterbody_name() with an
extra special case, extend the level compiler to allow specifying ice as
frozen pool instead of always being frozen moat.  There's no provision
for having both types of ice on the same level, just a level-wide flag to
control which of the two applies for ice on that level.

     This change has a side-effect for the V quest levels:  once ice has
been melted, a second blast of fire will now boil away the pool and leave
a pit.  The unfrozen water locations on the home level already behaved
that way (ie, they are pools rather than moats) so this should be ok.  I
also added <Someone>'s suggestion to make one of the two drawbridges
on the goal level start in random state instead of always being open.
2007-08-03 01:05:50 +00:00
nethack.rankin
aac603a446 more F move (trunk only)
Using F prefix when trying to move into a wall or closed door yielded
"you attack thin air".  Like the recently fixed F-vs-boulder case, give
more appropriate feedback.  Also like F-vs-boulder, initiate digging if
wielding a pick-axe.  (Also handles axes versus trees and closed doors).

     One thing which isn't handled but possibly should be:  F vs closed
door when not wielding a pick or other axe might attempt to force the door.
(Right now it gives "you harmlessly attack the door".)
2007-07-19 08:20:20 +00:00
nethack.rankin
ce018468c4 crossing long worms' tails (trunk only)
This is one of the items from "#Q397: List of Bugs from #nethack" sent
in Janurary by <email deleted> and containing a list
of things collected from the IRC channel associated with nethack.alt.org's
public server.  Moving diagonally between segments of a worm tail is
conceptually passing right through the worm's body.  This patch prevents
moving in such a fashion for both the hero and monsters (it's still
possible to fight in that position though).  It only applies when the two
tail segments are consecutive.

|......  In the diagram here, where tail segments are represented by
|.w1?..  digits indicating relative sequence number, the @ can still
|..@2..  move between segments 2 and 5 to reach !, but can no longer
|.65!3.  move between 1 and 2 to reach ?.  [However, if there is a
|...4..  monster at the ? spot, it can still hit @ and vice versa.]

     Missiles and wand zaps still pass through such diagonals without
noticing or affecting the worm.  I'm not sure whether this ought to be
extended to change that--it might get pretty messy since it would need
to be considered during monsters' targetting as well as during the path
traversal itself.
2007-07-17 00:29:44 +00:00
nethack.rankin
f847518f4a fix #H620 - dangerous/disruptive strings in bones data
It's possible for the player to put escape sequences into strings via
dogname/catname/fruit options (or probably interactively by using "\233"
instead of "\033["--the two character 7-bit version wouldn't work because
its leading ESC gets treated as player's request to abort current input,
but the 8-bit version probably works, I just can't test it because I don't
know how to type such things with this terminal emulator).  Such sequences
can do funny things like clear the screen and say "game over" (or worse
with creative abuse of some terminals' "answer back" capability--when
reproducing the reported situation, I kept things simple and had my dog's
name underlined and fruit name blinking; they displayed correctly but
nethack was confused about how long they were since it doesn't expect to
be given characters which don't advance the cursor).  This fix still lets
users experiment with such stuff during their own games, but it replaces
suspect characters while loading bones data, so if one player creates a
bones file with suspect strings in it, another can--I hope--be able to
use that file safely.

     Monster and object names, engravings, and named fruits are handled.
For the last, if uncensored string matches one already present then it
leaves that alone, so bones data created with same OPTIONS=fruit:whatever
as being used in the current game will continue to keep the same value.
2007-06-29 01:18:51 +00:00
nethack.rankin
acc0aa3ff3 WIZKIT overflow tweak (trunk only)
Redo the $WIZKIT overflow handling from a few days ago.  Instead of
having two migration codes which both mean "with the hero", combine them
and add a mask flag to control scattering at the destination to be able to
get the alternate behavior.
2007-06-19 03:13:20 +00:00
nethack.rankin
d1387f2b6b WIZKIT inventory overflow (trunk only)
Wizard mode's $WIZKIT can specify an unlimited number of items to
add to starting inventory and they'd be put there without regard to the
number of slots in use, potentially resulting in an arbitrary number of
'#' slot items.  Cap at 52 slots, same as when picking up, and put any
excess items at the hero's feet.  It's slightly tricky because the level
hasn't been created yet at the time the wizkit gets processed.
2007-06-16 04:18:14 +00:00
nethack.rankin
2ad3afee05 GOLDOBJ pickup handling (trunk only)
For GOLDOBJ configuration, relax the 52 object limit for inventory
when gold uses the special $ slot instead of a letter.  Takes care of an
old buglist entry from the beta testers.  [It will need to be revisited
if we ever implement multiple coin types that can't all fit in one slot.]

     Also for GOLDOBJ, prevents nymphs and monkeys from stealing coins,
since allowing that made their steal-item attack be a complete superset
of leprechaun's steal-gold attack.
2007-06-16 02:22:01 +00:00
nethack.rankin
283b681072 fix #H348 - "you trip over it" after non-"it" message (trunk only)
Reported to us by <email deleted>:
  'You are beginning to feel hungry.  You trip over it.'
and also recently in the newsgroup by "<Someone>":
  There is ice here.  *You see here an electric eel corpse.*
  Bib hits the electric eel.  Bib misses the electric eel.
  Bib misses the electric eel.  The electric eel misses Bib.
  The electric eel misses Bib.  *You trip over it.*

     slip_or_trip() was oversimplifying things by assuming that if there
is one object at the hero's location, a message about what that object is
has just been given.  Any timeout message which precedes Fumbling (lots
of candiates besides hunger) could intervene, as could monster activity
between the hero's move and timeout handling.  Aside from the reported
cases, that code hadn't been updated to account for the new pile_limit
option which could be set to 1 and force a popup display instead of the
usual "you see <an item> here".  This fix adds a flag that can be used
to track the most recent message.  It is cleared by pline for every
message, so pline's caller sets it _after_ the message of interest has
been displayed.
2007-06-10 03:01:31 +00:00
nethack.rankin
66f95ef37c Heart of Ahriman hack (trunk only)
From a four year old news posting:  hero was levitating via #invoke
on the Heart of Ahriman, then dropping that artifact yielded:
  You drop a gray stone named The Heart of Ahriman.
  You float gently to the floor.
  A gray stone named The Heart of Ahriman hits the floor.
That might be strictly correct, assuming that both hero and stone fall at
the same speed; if the stone was dropped from perhaps waist height then
the hero's feet would touch first.  But it looks strange, like a cartoon
where something hangs in midair until someone notices that it should fall.

     Removing the artifact from inventory causes the #invoke property to
toggle off.  Unfortunately it has to be done here before the object can
be placed at its destination.  Modifying message order seemed unviable;
this fix fiddles with the Levitation property in order to defer hero's
descent until after object handling is finished.  Now same setup gives:
  You drop a gray stone named The Heart of Ahriman.
  A gray stone named The Heart of Ahriman hits the floor.
  You float gently to the floor.
  You see here a gray stone named The Heart of Ahriman.
2007-06-03 01:05:43 +00:00
nethack.rankin
bc4ccd0f44 kick/joust monster positioning (trunk only)
From a 7.5 year old news posting (with a reply by Kevin Hugo speaking
on behalf of slash'em...):  when a monster "nimbly jumps to evade" hero's
kick, it can pass through walls and grid bugs can jump off their grid.
Likewise when a joust or staggering blow knocks a monster back, it could
move grid bugs diagonally.  This fixes both cases.

     Offhand I can't think of any other non-standard movement situations
which might need similar handling, but it wouldn't surprise me if there
are some.  Leashed movement is close but I don't think maybe_mnexto helps.
2007-05-26 05:56:26 +00:00
nethack.rankin
97928335ae C/#name menu, calling old discoveries [1 of 2] (trunk only)
Implement <Someone>'s menu-mode for #name, primarily because it
is the natural place to add [re]naming entries in the discoveries list,
something that was requested in the newsgroup ten or so years ago.  The
latter allows changing the type name of something which has previously
been named and is no longer being carried.

     This also makes the C command become a synonym for #name or vice
versa; one or the other could now be reassigned to something else.

#name
  What do you want to name?
  a - a monster
  b - a particular object in inventory
  c - a type of object in inventory
  d - a type of object on discoveries list

Menu group accelerators provide unseen alternate choices:  C for monster,
y for individual object, n for object type (and d for discoveries, but
that's only interesting if inventory is empty so that usual b & c are
omitted and discoveries entry moves up to b).  These alternates allow
`#name y' and `#name n' to work the same as before, for users who have
trouble retraining their fingers.  Using C to name a monster now takes an
extra keystroke, but using `C C' for it could make that be less annoying.
2007-05-25 02:01:54 +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
876eed4935 #vanquished (trunk only)
Add #vanquished command to show the vanquished monsters list during
play.  At present it's only available in wizard mode.  Slash'em has it as
a regular mode command, and I found it handy sometimes:  when I managed to
kill an unfamiliar monster, I could immediately get an idea of how the game
ranked its difficulty compared to other monsters.  But having this command
available might encourage extinctionism.  On the other hand, it might stop
some existing extinctionists from cycles of save+copy+restore+quit to view
disclosure data for their current game.

     This also makes merging the wizard mode extended commands into other
extended commands be more robust.  It will panic instead of going out of
array bounds if someone adds entries to debug_extcmdlist[] without also
expanding extcmdlist[] to make room.
2007-05-13 02:39:25 +00:00
nethack.rankin
24f3e005f1 howmonseen - monster visibility (trunk only)
Pull some code out of lookat() so that it can be used elsewhere.
howmonseen(mon) returns a bitmask of the ways that hero can see mon.
2007-05-12 01:30:00 +00:00
nethack.rankin
174182f0e4 Sunsword vs shades, take II (trunk only)
From the newsgroup:  Sunsword is ineffective against shades.  It
gets a special bonus of double damage vs undead, but since it's not made
of silver it was only doing 1 point of damage against shades.  Make the
bonus-vs-undead attribute override the silver-required criterion.  (No
comparable handling for flimsy weapons against thick-skinned critters
this time.)
2007-05-10 03:03:46 +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
15e79e99b9 more plural/singular (trunk only)
Extend makeplural/makesingular case-insensitivity to vtense() and to
wizard mode wishing for dungeon features.  And the previous set of fixes
missed one:  makesingular("zombies") was producing "zomby".  Plus a bit of
groundwork for a likely second overhaul of makeplural/makesingular.
2007-05-03 01:17:46 +00:00
nethack.rankin
894e7f0267 makeplural & makesingular overhaul (trunk only)
I stumbled across a copy of an old newsgroup bug report which
complained that wishing for "Gauntlets of Power" didn't work.  I thought
that this was something which had already been fixed, but when I tried it
out, I discovered that you still couldn't wish for that.  It was failing
because case-sensitive makesinglar() didn't recognize that "Gauntlets"
needs special handling.  After the unwanted transformation, the case-
insensitive object matching would fail to find "gauntlet of power".

     Removing case-sensitivity for special cases like "boots" and "gloves"
would have fixed that, but this patch goes further and removes case-
sensitivity entirely for both makesingular and makeplural.  Words which
get their endings modified work when the input is upper or mixed case.
Any modified letters retain the case of the original, so the reason for
case-sensitivity--user specified fruits that aren't lower case--is covered.

     Some makeplural fixes:  the plural for dingo is dingoes (dictionary
says "-es", not "-s") and for roshi is roshi (just guessing here; most of
the Japanese names use same spelling for singular and plural, but we were
producing roshis).  Several words which makesingular leaves in plural form
(boots, gloves, &c) are now recognized by makeplural (avoiding gloveses).

     It also fixes a bunch of incorrect singularizations of plural monster
names:  foxes, *wolves, lynxes, fungi/humunculi/succubi, mumakil, wumpuses,
baluchitheria, Aleaxes, *elves, erinyes, djinn, priestesses, & valkyries.
Some non-monsters that makeplural handles correctly were also not being
singularized right:  feet, hooves, lice/mice, algae, children, nemeses.
2007-05-01 03:59:32 +00:00
nethack.rankin
c59d53049e monsters defending against slime (trunk only)
Like their use of lizard corpses to defeat being turned into stone,
let monsters use wands of fire, fire horns, and scrolls of fire to try to
defeat being turned into slime.  If the scroll is read while confused, it
won't succeed.  Otherwise, monsters who don't resist fire will take some
damage in the process and might end up killing themselves (although with
the testing I've gone I've yet to see that happen--I guess that means
that handling for dying-in-the-process hasn't been adequately tested...).

     So far, they don't know how to jump onto adjacent fire traps, nor
will fire breathing monsters breath at themselves.  I don't know whether
I'll get around to tackling either of those.
2007-04-30 02:47:11 +00:00
nethack.rankin
9870c9aaa3 slime groundwork
New macro slimeproof() to decide whether something is susceptible
to turning into green slime.  Most of this is just making use of existing
cached permonst values in damageum() and mdamagem() and shouldn't affect
anything.  I wanted to avoid mixing that in with the actual slime changes
which are coming.
2007-04-30 02:18:03 +00:00
nethack.rankin
94327317c2 pile_limit option - movement feedback "there are objects here" (trunk only)
Something that pops up in the newsgroup periodically, with <Someone>
inevitably pointing out the bit of code that the user needs to tweak,
about control of feedback when hero is walking across floor objects.
Implement new option ``pile_limit'' which allows user to set the point
at which the game switches from listing the objects to giving "there are
several/many objects here".  Default is 5, same as previous hard-coded
value (1 object gets listed via pline, 2..4 are listed in a corner popup,
5 or more objects yields a pline message instead).  Setting pile_limit
to 0 means no limit, so objects will always be listed regardless of pile
size.  Setting it to 1 effectively forces no listing since any non-empty
pile size is always at least that big, so can produce "there is an object
here" even though that's no briefer than a pline() to show one object.
2007-04-27 02:05:28 +00:00
nethack.rankin
62a33d981a fix #H285 - hiders not hiding while hero is on another level (trunk only)
From a bug report, mimics
which were exposed at the time the hero leaves a level remain unhidden
upon return no matter how long the hero is away.  It was actually expected
behavior since the old level is stuck in stasis and hiders only hide when
it's their turn to move, but it was noticeably odd.  This makes unhidden
hiders attempt to hide when hero returns to a previous level or enters a
bones level.  I reorganized the monster handling in getlev() because the
relevant part was taking place before floor objects got restored, so
hidesunder() monsters had nothing to hide under at the time.
2007-04-22 01:01:22 +00:00
nethack.rankin
933c1846b9 losing saddle while riding
Noticed while looking at something else:  zapping a wand of opening
or spell of knock downwards while riding causes your steed's saddle to
fall off, which in turn causes the hero to fall and take some damage.
If that damage was fatal, the saddle would be left worn in bones data.
This reorganizes mdrop_obj() to defer until last the part that ultimately
makes the hero fall off, and changes bhitm() to call that instead of
handling saddle removal inline, also gives new saddle-off feedback there.
2007-04-17 03:43:17 +00:00
nethack.rankin
2872c27e13 msummon,nasty result counts (trunk only)
Reported in Dec'04 by <email deleted>, the
monster spell "summon nasties" could mistakenly give a message of "a
monster appears" instead of "monsters appear" when more that one monster
gets summoned.  Some of the candidate monsters for nasty() can produce a
group from makemon(), as can ones for msummon() which nasty() sometimes
calls in Gehennom.  Compare the number of monsters before and after the
creation attempt(s) instead of assuming makemon() creates one at a time.

     I don't know whether other routines face the same mis-count issue,
but I suspect there may be several.
2007-04-16 03:58:30 +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
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
985c74513e ice timeout (trunk only)
Zapping cold at an ice location which has a melt timer would set
new timeout to a random value which could actually cause that ice to melt
sooner.  Make sure the new value is always at least as big as the old one.
Also, MAX_ICE_TIMEOUT wasn't actually the maximum ice timeout; now it
is--if the generated value is higher, omit the timer so that that ice is
permanent.  No fixes35.0 entries necessary; this is post-3.4.3 code.
2007-04-04 02:31:14 +00:00
nethack.allison
1b82f097d1 2007 2007-04-01 06:39:50 +00:00
nethack.rankin
e91ff47ff0 revived unicorn horns (trunk only)
Back in Nov'04, <Someone> pointed out that even with only 5%
chance for dropping a horn upon the death of a unicorn which has been
revived from corpse, it's still possible to produce a nearly unlimited
number of them for polypile fodder.  This bumps the chance for a horn up
to 50%, but flags the horn as coming from a revived corpse and makes such
horns be treated by polymoprh as if they're non-magic (which practically
guarantees that they'll poly into mundane tools instead of magic ones).
2007-04-01 01:20:57 +00:00