Commit Graph

321 Commits

Author SHA1 Message Date
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
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
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
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
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
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
cohrs
a5640e4bc8 H206 - passive fire damage affecting weapons (trunk only)
<email deleted> reported back on 8/31/06 that elven weapons were not
affected when he poked a fire elemental with them.  This is true, but
moreover, there was no code to have passive fire to affect attackers.
Now erode_obj() supports all the same damage types as rust_dmg(), and added
the connecting code to allow passive fire attacks do something.
There probably should be macros for the damage types used by rust_dmg
and erode_obj, and possibly these functions should be combined, but they
are slightly different and dealing with that requires more thought.
2007-03-20 20:08:09 +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
cba99b52c3 re-do the #H260 lava fix
Instead of duplicating the bits of spoteffects() which are relevant
to pools of water and lava when standing still, split spoteffects in two
in order to call the relevant half directly.
2007-03-15 05:24:45 +00:00
nethack.rankin
d302e6252b fix #H260 - escaping lava let you stay there indefinitely
<email deleted>, escaping from being stuck
by lava via jumping--or simply walking--got you out of the lava while being
at the same location.  You could then stay there for as long as you liked
without falling back in.  This makes a lava and water check on turns where
time passes but hero hasn't moved, performing a subset of spoteffects().
I think the water case only matters when using wizard mode to wish for a
pool or moat, which gets created at hero's feet without making him fall in
(unlike wishing for lava, where hero does immediately fall in).
2007-03-13 03:13:09 +00:00
nethack.rankin
f67a4547ac held artifacts evading your grasp (trunk only)
From a bug report, trying
to invoke a wielded artifact after changing alignment resulted in "the
<artifact> evades your grasp" but it remained wielded, contradicting the
message.  This adjusts the message in touch_artifact() if the object is
already in inventory, and adds retouch_object() to handle cases where
failing to be able to touch ought to force unwearing/unwielding.
2007-03-10 05:54:17 +00:00
nethack.rankin
5a874440a0 truncating string copy
The majority of our calls to strncpy are in the form
  (void) strncpy(dst, src, n);
  dst[n] = '\0';
so add a new routine, copynchars, which does that.  A few calls care
about strncpy's return value and at least one relies on it only copying a
substring without also terminating the output, but most don't care about
either and none seem to care that `n' ought to have type size_t instead of
int.  The new routine matches our usage better, but I haven't gone through
to change the existing strncpy calls.
2007-03-06 03:00:05 +00:00
nethack.rankin
4091076bb8 questpgr followup 2007-03-03 04:56:33 +00:00
nethack.rankin
23eb08a462 shop bones
Dying at a shop doorway, or at the free spot one step in, while not
owing the shopkeeper anything would yield "<shk> gratefully inherites all
your possessions" but leave those possesions where the next hero could
just pick them up for free.  Move them all the way inside the shop, as
happens when the hero dies while owing the shk.  Also, if hero has gold
left after shopkeeper takes any payment owed, force it to go into shk's
inventory instead of having it end up in the pile of other stuff.

     finish_paybill() duplicated much of drop_upon_death(), but not the
two-weapon hack to avoid curse() causing hero's secondary weapon to be
dropped while in the midst of removing it from inventory (but unlike the
old 3.4.1 panic for that, this one just triggered a warning about nonzero
worn mask).  It also lacked the named fruit fixup, whatever that does.
Make finish_paybill() call drop_upon_death() instead of copying it.
2007-03-02 03:28:25 +00:00
nethack.rankin
dae9a9de82 directions (trunk only)
Some groundwork useful for the interface code I've been working on.
If we already have some direction to name-of-direction code somewhere, I
couldn't find it.
2007-02-22 05:24:05 +00:00
nethack.rankin
0ceebfc4b5 nethack -X vs normal game (trunk only)
Reported to the beta-testers list by <Someone> last April:
restoring a normal game save file in explore mode let you keep the file,
then after exploring and quitting without saving, you could restore it
again in normal mode and take advantage of whatever information you'd
gained.  This makes nethack -X (or playmode:explore) defer the switch to
explore mode when used while restoring a normal mode save file.  It now
performs a normal restore (with save file deletion) and then acts as if
the user had given the 'X' command interactively, requiring confirmation
to actually switch into explore mode.
2007-02-17 05:43:18 +00:00
nethack.rankin
43f72cc357 yet more wizard mode handling (trunk only)
Reorganize the recent wizard mode control:  move set_playmode() from
xxxmain.c to the core, and have it call new authorize_wizard_mode() to do
the port-specific part.  If the set_playmode() call during startup doesn't
result in running in wizard mode (either because not allowed or user
didn't request it), it will be called again during restore if the save
file is from a wizard mode game.

     For ports which check character name for authorization, players will
have to use `nethack -u whatever -D' (or options for name and playmode) to
restore a wizard mode save file if WIZARD has been changed from "wizard".
plname[] from a wizard mode saved game will always have that value, so if
it's not the right one players will need to get authorized by the startup
code before loading the save file.
2007-02-17 05:25:36 +00:00
nethack.rankin
7c64dbaf83 fix #Q404 - monster wielding cursed corpse
From a bug report, applying a bullwhip
towards a monster to try to steal its weapon would report that a cursed
cockatrice corpse was welded to the monster's hands even though corpses
wielded by the player never become welded.  Code for monsters deciding
what to wield knew that corpses don't weld; everywhere else seems to
assume that they only wield weldable weapons.  Add a routine to check
whether a wielded item is welded, similar to what's done for the hero.  I
fixed a couple of other spots besides use_whip() but didn't hunt all over.
2007-02-10 05:14:22 +00:00
nethack.rankin
128ed0f0be fix #Q117 - vomiting by rodents & more
From a bug report:  you could vomit when polymorphed into a rat but real life
rats can't/don't vomit.  The latter was confirmed by <Someone> and <Someone>.
While testing a fix for this, I discovered a couple of other problems.
Healing magic which cured sickness failed to heal Vomiting (potion or
spell; unicorn horn deals with them separately).  Enlightenment failed to
report Vomiting (it's not shown on the status line).  Most significant was
that vomiting_dialogue() called vomit() twice (also make_confused() and
make_stunned() three times for every once intended).  It was dividing the
remaining turns by 3 and then using that value to decide what to do, but
only message display took into account that the same divided value would
occur on 3 consecutive turns (or just 2 for the final countdown to 0,
because dialog routine gets called before timed-property decrement).
2007-02-06 04:35:50 +00:00
nethack.rankin
5b88c67d97 engraving with empty wand
From a bug report:  if you
attempted to engrave with an empty wand while levitating, it wouldn't use
a turn unless you successfully wrested an extra charge out of the wand.
So you could always get such charge in a single elapsed turn of game time
if you didn't care about zapping in any particular direction; extremely
useful for wishing.

     Noticed when checking this:  when you did wrest the extra charge,
the engraving code accessed freed memory for the wand after it had been
used up.

     Lastly, wands producing certain effects always become discovered,
even when you don't yet know what they look like.  (This part of the patch
is trunk-only since it utilizes the routine which fixes similar case for
zapping.)
2007-01-27 05:50:10 +00:00
nethack.rankin
72abae042b hangup hangup (trunk only)
The last of my intended hangup overhaul.  Once hangup is detected,
replace currently loaded windowing routines with stubs that never do any
terminal I/O.  Real interface routines call their siblings directly rather
than via the windowprocs pointers, so this shouldn't pull the rug out from
under them, but it also can't prevent whatever they have in progress at
the time of hangup from attempting further I/O once the handler returns.
[We might want to change nhwindows_hangup() into winprocs.hangup_nhwindows()
so that each interface has more control over its own fate.]

     This assumes that user input of ESC and menu selection result of -1
everywhere in the core will eventually cause active function calls to
unwind their way back to moveloop() rather than to continually re-prompt.
(This assumption is not a new one, just a bit more explicit now.)
2007-01-18 04:16:03 +00:00
nethack.rankin
151dcad8fa hangup revamp (trunk only)
[See cvs log for src/cmd.c for more complete description.]

     This turns clearlocks() into a no-op during the period when the UNIX
port is asking the user to confirm whether to overwrite an existing game.
Also, this removes the duplication of code and function between hangup()
and end_of_input(), and it simplifies the check for whether hangups are
supported by adding new macro HANGUPHANDLING.  (I don't think global.h is
the best place to be defining that but I couldn't figure out where else
it would fit, other than repeating for individual xxxconf.h files.)  And
adds a couple more done_hup checks to try to cope with situations where
rhack() is being bypassed.  Lastly, having readchar() return EOF was
ignored for non-UNIX configs; now everybody gets ESC instead of letting
EOF be seen further inside the core.
2007-01-16 04:54:38 +00:00
nethack.rankin
b6778e36cf !GOLDOBJ gold in inventory during save/restore (trunk only)
Simplify the save/restore handling the !GOLDOBJ config does for gold
to maintain save/bones file compatibility with the GOLDOBJ config.
2007-01-12 04:18:40 +00:00
nethack.rankin
538b91ddc9 hangup() cleanup; SIGXCPU handling (trunk only)
While looking at a bug report from two months ago about how having
hangup take place while at the "destroy old game?" prompt causes an
interrupted game to become unrecoverable, I decided to try to clean up
convoluted hangup() a bit.  Didn't achieve much there, but did notice that
the Unix port was handling SIGXCPU (whatever that is...) inconsistently.
This attempts to fix that, but I have no way to test it.

     The original bug report is still unresolved.

     makedefs ought to add something for SAFERHANGUP and NOSAVEONHANGUP
to the #version output.

[ This is the missing bit from the patch on Monday which accidentally
  included all of extern.h as its log entry message. ]
2007-01-11 03:39:15 +00:00
nethack.rankin
21caf64b86 !GOLDOBJ gold in inventory (trunk only)
Simplify the insertion into and removal from of gold in inventory for
the !GOLDOBJ configuration.  If GOLDOBJ ever becomes unconditional this
will be superfluous, but in the mean time it unclutters the container and
drop code.  Also, tweak a recent getobj() hack so that its purpose might
be a bit clearer.
2007-01-06 04:53:56 +00:00
nethack.rankin
c45ce7a999 container groundwork / splitting welded weapons (trunk only)
Some miscellaneous changes preparatory to enhancing the container
interface.  This also fixes a minor inconsistency in object manipulation:
askchain() wouldn't let you split a stack of welded weapons but getobj()
would, so you couldn't get rid of part of the stack using 'D' or #loot,
but you could with 'd' (and post-3.4.3, with #adjust).  Now getobj() will
behave like askchain(); if you have 3 cursed daggers welded to your hand,
you won't be able to drop 1 or 2 of them anymore.
2007-01-04 05:46:14 +00:00
nethack.rankin
dccedb99ba breaking lock of shop chest (trunk only)
From the newsgroup:  you weren't charged anything if you broke the
lock of a box or chest which was owned by a shop.  Force the hero to pay
for the damaged container; any contents remain owned by the shop and don't
affect the cost of the forced purchase.  This existing entry in fixes35.0
is adequate to cover the fix:

various actions--such as enchanting--performed on an unpaid shop object
	either force the hero to buy the item (when its value is lowered) or
	increase the current bill (when its value is raised)
2007-01-03 03:58:31 +00:00
nethack.rankin
f411d303ea monster ranged attacks (trunk only)
Newsgroup posts mention "boulder forts" from time to time, where the
player surrounds the hero with boulders in order to prevent the majority
of monsters from being able to attack.  Since the hero can shoot or throw
or zap over/around/through boulders, monsters ought to be able to do so
too.  This makes the test for whether a monster is lined up properly for
its ranged attacks try harder when the original line-of-sight check fails.
If there aren't any terrain obstacles found, it allows a chance to attack
based on the number of locations in the path that contain any boulders.
Giants and any monster carrying a boulder-destroying wand of striking get
to ignore boulders, overriding the random chance.
2006-12-28 02:45:38 +00:00
nethack.rankin
212623962e multi-shot throwing for knives & spears (trunk only)
Make all stackable weapons capable of multi-shot volleys when thrown.
Affects knives, spears & javelins, and boomerangs; requires advanced skill
assignment (skilled:  1-2 missiles per throw, expert:  1-3 missiles) or
role-specific bonus (ranger class's general +1 bonus is the only one that
applies to any of these weapon types).  For monsters, prince-caste get 1-3
missiles and lord-caste get 1-2, as before, with fake player monsters now
also getting 1-2; those counts apply to all stackable weapons regardless
of whether the species or role ordinarily uses whatever is being thrown.

     Related changes:  monks now get a role-based +1 count for shuriken,
throwing 1-2 instead of just one (they're only allowed to achieve basic
skill so won't reach any higher volley count).  Monster monks and ninjas
get that too; ninjas now get the same for darts and they're guaranteed
weapons in starting inventory.  Also, fake player rogues now sometimes
get orcish daggers instead of short sword, providing a decent chance to
occasionally have Grimtooth be randomly generated on the Astral level.

     Potentially controversial:  wizards can still become expert in dagger
skill and receive the to-hit and damage bonuses for that when throwing as
well as when wielding, but the number of missiles for them has now been
reduced to 1-2 (in other words, going from skilled to expert no longer
improves the max count for the volley amount for wizard role).  They're
supposed to be spellcasters; being able to throw up to three +7 daggers
at a pop was a big temptation for resorting to brute force, particularly
since they'll already want highest dagger skill for wielding Magicbane.

     To do:  throwing multiple boomerangs either needs to behave as if
they're all in flight before the first returns, or else the volley needs
to be cut short if one comes back and isn't successfully caught.  The
latter is a lot easier to do but the former fits better with what multi-
shot volley is supposed to represent.  Another alternative is to change
them to no longer be stackable, then this sequencing issue goes away.

     To do too:  make worm teeth and crysknives become stackable like the
other knife-skill weapons.
2006-12-17 05:47:17 +00:00
nethack.rankin
0db19f1c96 restore_menu (trunk only)
Move the code to use a nethack menu for restoring a saved game.  It
was inline in tty_askname() but is now a separate routine, restore_menu()
in restore.c.  There was no port-specific code and only a small amount of
tty-specific code; it should be useable by anyone (but Qt doesn't have to
switch over if it doesn't want to).

     The original behaved strangely if there were exactly 26 saved chars;
the "start new game" menu entry ended up using "{" as selection character.
There wasn't any comparable problem at 52; it was limiting the menu to 51
games.  Now it will allow 52 (with "start a new game" bumped into "#" if
there are that many), and adds an explicit quit entry (unless there are
52 or more games so that # is already used by new-game, then quit remains
implicit rather than resort to some other none-of-the-above character).
2006-12-12 04:52:39 +00:00