Commit Graph

71 Commits

Author SHA1 Message Date
nethack.rankin
ff16502d67 floor access
A post-3.4.3 change dealing with reaching into pits resulted in "you
sit on the air" if you used the #sit command after escaping a pit trap.
Change can_reach_floor() so that caller explicitly controls whether being
on the brink of a pit is a condition that prevents reaching the floor.
This also splits a fairly common message about not being able to reach the
floor into a separate routine.

     There is still oddness here:  if you're polymorphed into a flyer,
#sit yields "you sit down" followed by "you fly over a pit" (latter occurs
when escaping trap activation).  A ceiling hider behaves similarly, but
the second message is "you escape a pit" and doesn't sound quite as silly.
Perhaps #sit should pass TOOKPLUNGE to dotrap(), or maybe there's some
better way to handle this?
2005-06-04 05:25:28 +00:00
cohrs
c90746c670 polymorphing into a flyer while in a pit
<Someone> reported that if you polymorph into a flying monster while in a
pit, you must take u.utrap turns to first climb out before you can fly.  Of
course, once you're out, you can swoop down into the pit to pick things up
w/o delay.  Rather that have you automatically fly out (e.g. like quaffing
a potion of levitation), I thought it was better to take a turn to fly out,
so that's what I've implemented.

The code to deal with exiting a pit is moved to a new climb_pit function
and the "up" command now lets you climb from a pit too (something I've
found non-intuitive in the past).

Finally, I noticed that non-moving monsters could still go up/down even
though they couldn't move around.  Added non-moving checks in doup/dodown.
2005-01-18 16:17:27 +00:00
cohrs
c9b11cf989 U1231 - messages ordering when displacing a pet into a trap
move the message so it's before the mintrap test.  newsym's are needed
to ensure the display is correct if a --More-- prompt results.  I left the
"frighten" message alone, except for tense.  As per Pat's suggestion, I
changed the wording to future-proof the message.
2005-01-18 15:23:47 +00:00
nethack.allison
9a3022800b filled trap doors on castle can be re-dug 2005-01-08 14:37:36 +00:00
nethack.allison
5fa8f73af8 housekeeping: mark trunk sources 3.5 (src) 2005-01-02 16:44:46 +00:00
nethack.allison
28a1a41668 shadowed declaration warning
<Someone> complained that his compiler was giving these
warnings:
cmd.c:2119: warning: declaration of `expl' shadows a global declaration
dungeon.c:292: warning: declaration of `rand' shadows a global declaration
exper.c💯 warning: declaration of `exp' shadows a global declaration
files.c:278: warning: declaration of `basename' shadows a global declaration
hack.c:1102: warning: declaration of `expl' shadows a global declaration
pickup.c:2081: warning: declaration of `select' shadows a global declaration
role.c:1060: warning: declaration of `conj' shadows a global declaration
2004-12-16 00:20:54 +00:00
nethack.rankin
7672a2c60b hats vs helms
Something from <Someone>'s list:  some messages have hardcoded references
to "helmet" which sound strange when the character is wearing a hat or cap.
helm_simple_name() is comparable to the existing cloak_simple_name().  It
returns "helm" or "hat" depending upon whether the helmet provides the
same protection that yields the assorted repetitions of "fortunately,
you are wearing a hard helmet".  This choice ends up categorizing elven
leather helm as a hat (which I think is ok given that its undiscovered
description is "leather hat"), contrary to <Someone>'s suggestion that the
distinction be made based on whether the helmet was made of cloth.

     I started on this a year and a half ago but didn't commit it.
Unfortunately I don't remember why and haven't done any significant
additional work now--just recovered from some intervening bit rot and
confirmed that the patch as is seems to be working ok (in the trunk; the
branch side has not been tested).  I suspect that I meant to look for
additional helmet messages which could benefit from conditional headgear
description.  (Those "hard helmet" ones don't need it, although they
should perhaps be moved into a common routine instead of being replicated.)
2004-11-13 04:00:52 +00:00
nethack.rankin
10eea7710d killing pets by displacing them into traps
A user pointed out that you lose pacifism conduct if you kill your
pet by displacing it into a trap but you don't gain any experience in
the process.  Make this consistent with killing monsters in other ways:
if you get blamed for it then you should also get credit for it.

     Probably minliquid() and mintrap() should take another argument so
they can call killed() instead of mondead() when necessary, but I didn't
go to that much effort....
2004-08-17 01:29:47 +00:00
nethack.allison
ce24d4ba09 fire traps on ice
"<Someone>" on January 8, 2004, wrote:
> A Valkyrie on the Quest home level, wearing an
> amulet of magical breathing, enters a fire trap
> out on the ice:
>
>> A tower of flame erupts from the ice!
>> The ice crackles and melts.
>> You fall into the water.  You sink like a rock.
>> But you aren't drowning.  You touch bottom.
>> A cascade of steamy bubbles erupts from the bottom!
>
>Should the trap really be being triggered twice, once on ice and
>once underwater, when I've only moved onto the location once?
2004-06-05 15:50:48 +00:00
cohrs
b661f86e67 U846 - xorns and pits
Change pit behavior to always mark a non-flying poly'd player as trapped in
a pit, even when Passes_walls is set.  This allows players polymorphed into
xorns to descend into pits and pick things up.  In this case, any attempt
to move out of the pit now takes a turn but always succeeds.  Also fixed
a related bug (w/o ID) that a player could become trapped as if in a pit
when leaving xorn form because u.utrap wasn't checked, and simplified the
code since the extra Passes_walls checks are no longer needed.  Also
updated code in sit.c that duplicated uteetering_at_seen_pit.
2004-01-27 19:35:09 +00:00
nethack.rankin
b8991129a8 pit access
Fix the recently reported problem:

" If there is a corpse in a pit, you have to enter the pit in order to pick
" it up, however you are can eat it without being in the pit.

If pit bottoms aren't reachable, then can_reach_floor() needs to know
about it.  I suspect that this change is likely to create some other
bugs though.
2004-01-04 08:54:16 +00:00
nethack.allison
57b1e96238 teetering on edge of pit
- when you're teetering on the edge of a pit you can use '>' to enter the pit
- pull the numerious teetering checks into a new function
2003-12-22 19:09:39 +00:00
nethack.allison
cdf982e478 Half_physical_damage 05
- [fixed in trunk] Jumping/Newton's-Thirding into something solid
- [fixed in trunk] Being hit by Mjollnir on the return
- [fixed in trunk] Contaminated or boiling water from a sink
- [fixed in trunk] Falling on a sink while levitating
- [fixed in trunk, fire only] Any passive attack
- [fixed in trunk] Zapping yourself with a wand, horn or spell
- [fixed in trunk] Burning (un)holy water
- [fixed in trunk] Thrown potion (bottle)
- [fixed in trunk] Bumping head on ceiling by cursed levitation
- [fixed in trunk] Exploding rings and wands (under all circumstances)
- [fixed in trunk] Stinking cloud damage
- [fixed in trunk] Sitting in a spiked pit, in lava
- [fixed in trunk] Exploding spellbooks
- [fixed in trunk] Falling off or failing to mount a steed
- [fixed in trunk] Falling into a (spiked) pit
- [fixed in trunk] Land mine explosion
- [fixed in trunk] Fire traps
2003-10-21 23:45:11 +00:00
cohrs
231b2b16f8 U453 and buglist item - travel command updates
I wrote to the devteam early last week:
> Given my understanding of travel, it's supposed to be somewhat intelligent,
> and "convenient", and should, therefore avoid walking into water, lava,
> traps, or other things that distant movement would avoid, even if you're
> right next it.  Unless...  the travel destination is the "bad" location
> next to you when the travel starts.
To that end...
- add a context (iflags in 3.4.3 to maintain savefile compat) flag to
differenciate the first travel step from later steps, to allow the
detection of the final sentence, above.
- several changes to set/reset the travel1 flag as needed
- add code to findtravelpath to treat the first step specially if it's
the only step, allowing forced travel into a "bad" location
- correct the "don't travel over traps" code, which was getting confused
because hero's starting location was being avoided
- add code to avoid traveling into water and lava, duplicating
checks used for non-travel running
- fix some strange "guess" travel behavior: avoid zigzag paths when there's
a more direct path (even though the number of moves is the same)
- trunk change adds a new DISP_ALL tmp_at type, and uses it in some debug
code for travel, debug changes not added to the 3.4.3 branch
2003-10-21 02:27:43 +00:00
cohrs
b2ffe64968 breaking migrated objects
Allow migrated objects to break on arrival.  Added code to obj_delivery to
cause this, along with a flag to keep breakage from occurring.  The new
flag isn't used yet, because all the current object migration involve
objects that were moving/dropping.  To help make this change, rloco now
returns whether the object was placed or not, so caller can know if an obj
pointer is still valid or not.

Making the breakage messages for MIGR_NEAR_PLAYER objects show up after the
new level is displayed required some effort (rather than while the old level
was still displayed, which was confusing), due to the needs of goto_level.
- obj_delivery now has 2 passes, one for before player arrives, another after,
allowing the two cases to be treated differently
- goto_level calls obj_delivery twice (run_timers is not called twice,
since the run required before the level is displayed will have already run
any timers on migrating object)
- kill_genocided_monsters now kills eggs on the migrating_objs list too
2003-10-18 22:55:42 +00:00
nethack.allison
84f667c5a4 ice Warning (trunk only) 2003-10-13 23:54:41 +00:00
cohrs
8ee1ecd2ea hiding under a cockatrice corpse
Reported a while back, a (stonable) hiding monster will hide at a location
containing only a cockatrice corpse.  While it would be interesting to
allow monsters to try, and stone themselves as a result, I chose the
simpler fix which is to not have monsters hide in such situations.  I found
the hiding code was duplicated in several places, so I moved it into a new
hideunder() function that works for both the hero and monsters.
2003-10-10 23:01:42 +00:00
cohrs
559be58c21 conflicting delayed killers
Introduce a new set of functions to manage delayed killers in the trunk, used
in addressing the various reports of delayed killer confusion.  Since existing
delayed killers are related to player properties, the delayed killers are
keyed by uprop indexes.  I did this to avoid adding yet another set of
similar identifiers.
- the new delayed_killer() is used for stoning, sliming, sickness, and
delayed self-genocide while polymorphed.  Some other timed events don't
use it (and didn't use the old delayed_killer variable) because they
use a fixed message when the timeout occurs.
- A new data structure, struct kinfo, is used to track both delayed and
immediate killers.  This encapsulates all the info involved with
identifying a killer.  The structure contains a buffer, which subsumes the
old killer_buf and several other buffers that didn't/couldn't use killer_buf.
- the killer list is saved and restored as part of the game state.
- the special case of usick_cause was removed and a delayed killer list
entry is now used in its place
- common code dealing with (un)sliming is moved to a new make_slimed function
- attempted to update all make dependencies for new end.c -> lev.h
dependency, sorry if I messed any up
2003-09-29 19:24:20 +00:00
nethack.allison
22ce5ed6f2 trunk only: preserving context (src files)
Pat Rankin wrote:
> collect them all into some new struct and
> save that separately rather than jamming more non-option stuff
> into struct flags.

This patch:
- collects all context/tracking related fields from flags
  into a new structure called "context."
It also adds the following to the new structure:
- stethoscope turn support
- victual support
- tin support
2003-09-21 11:52:54 +00:00
nethack.allison
dae1b81029 #U632: Objects in Pits (game behavior)
<Someone> submitted the following bug report:
> An object and a pit are occupying the same square. I try to kick
> the object out of the square, but "You can't kick something
> that's in a pit!"
>
> I step into the square and escape the pit, but I can pick up the
> object, so maybe it's not in the pit after all.
>

This patch does *not* address this part of the bug report:
> If it's in the pit and it's a cockatrice corpse, should I die
> from landing on it when I fall into the pit?
2003-09-07 17:25:50 +00:00
nethack.allison
416412f92b Remove vestiges of old overlay source split
[trunk only]
2003-09-05 02:45:18 +00:00
cohrs
381f066a65 U550 - grid bug travel redux
Undo the change to test_move and instead, don't even test moving in diagonals.
This opens the possibility for approximating the diagonal while polymorphed
into a grid bug in the future.
2003-08-03 03:11:53 +00:00
cohrs
4566de6ac0 U550 - grid bug travel
when travelling and polymorphed into a grid bug, don't move diagonally.
2003-07-30 06:02:13 +00:00
cohrs
b633b91875 SF patch 536615: travel cache
This is derived from the proposed patch and feedback to it.  This applies
the last-position cache behavior without an option, making the behavior
more like it is for interfaces with a mouse, where holding the mouse still
acts the same way as the travel cache.  The code is not #ifdef'd either.
2003-06-30 04:00:14 +00:00
nethack.rankin
25d6335de9 two land mine bits
Noticed when investigating one of the killer reason bugs recently
reported:  a land mine explosion shouldn't create a concealed pit trap;
make a revealed pit instead.  And while testing that, I noticed that the
"Kaboom" message given when pushing a boulder onto a land mine was given
while the map still showed the boulder at its original location even
though it had actually been moved already.  It's a little odd that you
get hit by shrapnel at your original position--as if you're shoving the
boulder ahead of you and then pausing a moment before stepping into its
former location--but that's trickier to fix; sometimes you won't advance
due to there being multiple boulders present (in that case you evidently
do shove the boulder instead of performing a steady push, so maybe the
current behavior is fine as it is).
2003-05-03 02:08:34 +00:00
cohrs
83ffd8077a U406 - running and mimic mimicking closed doors
If running in a way that stops at closed doors, you should stop when coming
across a mimic mimicking a closed door too.
2003-04-14 05:10:06 +00:00
cohrs
2ae7f10dd9 carrying capacity
As suggested in the newsgroup, re-factor the calculation of carrcap
so that any change in strength or constitution affects your capacity.
The integer division was rounding off the result.
2003-03-22 17:25:09 +00:00
nethack.allison
176d31c980 buried punishment ball
Prevent burying a ball from ending your punishment.

When you bury the ball, internally NetHack Punishment
ceases, but a new trap type of TT_BURIEDBALL  immediately
kicks in (acting similar to TT_INFLOOR in some ways).
You can eventually work the ball free (or teleport, etc.),
but that will just return you back to normal Punishment.
2003-03-11 03:40:17 +00:00
nethack.allison
5122409416 Several things that break savefile compatibility
- Version change from 3.4.x
- timed_delay feature ignore in makedefs
- several flags from iflags to flags
- use offsets from mons array entries in save file rather than storing
  the ptr and calculating the distance from beginning of array
2003-03-05 04:39:47 +00:00
jwalz
6689de0e04 Lint cleanup, nothing significant.
There is one more new complaint that might cause problems:
explode.c(545): warning: conversion from long may lose accuracy
2003-02-19 03:18:49 +00:00
nethack.allison
c2c72d11e7 B18009 animate figurine over water
>More worrying is the fact that applying a figurine over water lets
>the monster wait until its next move before it drowns (giving
>you time to teleport it to safety, or whatever) [...]
>Should there be a minliquid() check as part of make_familiar()?

Applying at the water location next to you was easy. But
applying it at your own location (triggering BY_YOU)  could
end up placing the figurine at the far side of the level if
there was lots of water.

Correcting that required the ability to pass a flag from
make_familiar to makemon() telling it to not rule out
water locations as good positions.  The flag had to
be passed on down to goodpos() and enexto().

The bulk of this patch is just adding an additional
argument to goodpos() in all of the callers.
2003-02-09 05:39:32 +00:00
nethack.rankin
ea400a778d some lint cleanup
Building with an old version of gcc with various warnings enabled
generated a lot of noise.  Most of it was due to not guarding string
literals with `const', but there were a couple of actual problems too.
2003-01-09 09:18:14 +00:00
cohrs
d3e2f53910 B14014: soft hats and piercers
Soft "helmets" don't protect against falling rocks, but did protect against
piercers.  Update the checks so only hard (metallic) helmets provide this
protection.  The same report quibbled about using the word "helmet" for
soft head coverings.  This patch does not address that quibble.
2002-11-21 18:05:48 +00:00
cohrs
2fa61ea7ee B12002 - displacing pets thru narrow openings
Add another check to domove to detect an attempt to displace a pet through
a narrow opening.
2002-10-14 16:08:07 +00:00
nethack.rankin
c42c14e5a6 running across vibrating square
Some newsgroup discussion has reminded me something I've meant
to do for a long time.  Stop running when you get the special message
about the floor vibrating under your feet.  Also vary it when you're
not actually stepping on the ground.
2002-09-20 07:26:12 +00:00
nethack.rankin
dbaba6bcc2 steed name handling
I was about to add a message referring to your steed and discovered
that the name handling for that is somewhat messy.  Simplify it by using
the pet name handling routine.
2002-09-20 07:01:19 +00:00
nethack.rankin
b789a08f94 disclosure after sink fall
From the newsgroup:  if you die from the fall when losing
levitation while moving over a sink, the final attributes still
said you were levitating.
2002-09-14 13:24:22 +00:00
cohrs
5d492abf6f R1049 - various wand of digging bugs
- Breaking wand of digging dug through rock which should be undiggable.
Checks assumed pits would never show up in solid rock.
- Breaking wand of digging near shop walls wouldn't anger the shopkeeper
Checks assumed pits would never show up in walls, also, added a special
case to pay_for_damage to handle the case where you're falling thru and
can't be asked to pay.
- Shop walls wouldn't be restored if there are pits in the way.
Checks assumed pits would never show up in walls.
- If there was a hole outside the shop, you could kick stuff out of the
door into the hole without shopkeeper noticing.  Added the missing check.
2002-08-21 23:06:58 +00:00
cohrs
379ffe2461 B08012 - tweaking travel and closed doors
- when testing travel locations, don't treat diagonal moves thru closed
doors as possible, unless player can go/dig thru door
- treat closed doors and boulders as expensive for travel, preferring open paths
2002-08-19 17:10:34 +00:00
nethack.allison
3c227928f9 function name format
From <Someone>:
[functions that don't start in leftmost column ]

apply.c:int unfixable_trouble_count(is_horn)
artifact.c:void arti_speak(obj)
botl.c:int xlev_to_rank(xlev)
botl.c:int rank_to_xlev(rank)
display.c:void map_location(x,y,show)
hack.c:static void findtravelpath()
hack.c:void unmul(msg_override)
hack.c:long money_cnt(otmp)
mklev.c:CFDECLSPEC do_comp(vx,vy)
pickup.c:long carry_count(obj, container, count, telekinesis, wt_before, wt_after)
pickup.c:boolean mon_beside(x,y)
shk.c:long money2mon(mon, amount)
shk.c:boolean same_price(obj1, obj2)
shk.c:void finish_paybill()
trap.c:boolean delfloortrap(ttmp)
weapon.c:void give_may_advance_msg(skill)
do_name.c:char *coyotename(mtmp, buf)

(This with a pruned 'egrep '^[[:alnum:]]+ .*\(.*\)$' *.c' in src/; I
haven't looked outside that directory, but generally speaking once you
go beyond there you're widening your search anyway.)
2002-08-12 22:24:05 +00:00
cohrs
9d8782eb8f cut trees and dug walls replaced by corridor symbols
- In various places, cutting down a tree would result in a corridor symbol
showing up, although trees are generally found in room-like areas.  Added
the missing checks.
- Trees were diggable except on mazelike levels.  Added the missing check.
- In a cavernous town like minetn-6, digging a wall would result in a
corridor symbol being displayed instead of a doorway.  This looked strange,
especially in the town.  Added a check for this, making use of the new
meaning of in_town(); non-town parts of this level still do CORR
replacement as expected.
2002-08-11 17:40:08 +00:00
cohrs
2d21a12ad5 R06006 - travel command infinite loop
The problem was caused by a test that was added to test_move() to test the
move as a regular move if it was the next step.  This case affected
boulders and closed doors, both of which are handled in later in do_move().
Remove the check.  I think this was something I thought was needed for an
intermediary version of the travel command fix, but turned out to be
detrimental in the current version.
2002-08-04 23:04:56 +00:00
nethack.allison
a849315988 no message 2002-07-29 17:57:57 +00:00
nethack.allison
46721b5a91 flag changes
Several flags added since 3.4.0 were destined for flags
(to be saved with the game) but were placed in iflags for
savefile compatibility.  These include:
 boolean  lootabc;	/* use "a/b/c" rather than "o/i/b" when looting */
 boolean  showrace;	/* show hero glyph by race rather than by role */
 boolean  travelcmd;	/* allow travel command */
 int	 runmode;	/* update screen display during run moves */

This patch has no effect unless you define this in your port's
XXconf.h file.
#define SAVEFILE_340_CONVERT	/* allow moving of some iflags fields to flags
					without destroying savefile compatibility */
Without it, the new flags remain in "iflags."  With it, the flags are moved to
"flags" and the structures are converted when the save file is read. There
is no reverse compatibility.  If you save the game after conversion, you
can't load the savefile on 3.4.0, only 3.4.1.
2002-07-28 16:03:00 +00:00
nethack.rankin
aedd6947d4 runmode option
Provide user control over screen updating for multi-step movement
(run via shift, control, &c and also travel).  [See cvs history for
fixes34.1 for more details.]
2002-07-28 10:45:46 +00:00
cohrs
a21ddbb2bf minetown guards outside the town proper
Pat forwarded a message from the newsgroup in March that the town guards
enforce rules even outside the town proper.  Fix: On room-based town levels,
check if the location is in a room containing subrooms (roomno will often
have a subroom id instead).  On the other levels (e.g. minetn-5), there are
no subrooms, so the whole level is fair game.  Currently, this is valid.
If fancier towns are added in the future, more flags or use of regions may
be required to tell where the town border actually is.  These checks are done
in a new in_town function.
2002-07-15 04:17:13 +00:00
nethack.allison
40940991bb change GOLD_CLASS to COIN_CLASS 2002-07-08 23:25:53 +00:00
cohrs
8a44a437e5 R926 - polymorphed player does not explode at thin air
Reported that player polymorphed into an exploding monster does not explode
when attacking thin air.  Also noticed that if player is Unchanging, they
wouldn't die after exploding in the existing code.  Set u.mh = -1 to ensure
they won't still be around after exploding.
2002-07-04 06:36:37 +00:00
cohrs
9f2f6f6177 boulder display bug
If you first pushed an undiscovered boulder while blind with ESP and
there's a monster behind it, you'd get a message referring to the boulder
but the boulder wasn't displayed.  Move the feel_location test.
Also, improved the grammar of the message a bit.
2002-04-27 23:22:35 +00:00
cohrs
9174a9030a remove prescient travel command behavior followup
- applied an intermediate version of the fix which had a bug in choosing
the intermediate location
2002-04-13 16:27:58 +00:00