Commit Graph

43 Commits

Author SHA1 Message Date
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
kmhugo
e1f5ddd820 sound cleanup
+ Separate the two uses of flags.soundok.
+ Player-settable option is now called "acoustics".
+ Deafness is now handled as a full-fledged attribute.
+ Check for deafness in You_hear(), rather than caller.
+ Check for deafness in caller, rather than verbalize(),
  because gods can speak to characters in spite of deafness.
+ Since changes are being made to prop.h, reorder it to the
  same order as youprop.h and enlightenment.

There are still some extraneous checks and missing checks
for deafness, which will be followed up in a future patch.

Because of the size of this patch and its savefile incompatibilities,
it is only being applied to the trunk code.  Portions of this patch
were written by Michael Allison.
2003-09-28 03:42:50 +00:00
cohrs
929f9ce2c7 various tests of flaming monsters
This change adds a new flaming() macro and uses it in several places
where the list of flaming monsters was tested.  on_fire() didn't list
salamanders as already being on fire, but should have.  A couple other
cases were not updated to include flaming sphere.
2003-09-26 00:37:24 +00:00
cohrs
4375fc7846 killer messages
Incorporate various killer message grammar fixes suggested by <Someone>.
Mostly these deal with using the proper killer_format and prefix ("the" or
no "the") for unique and type_is_pname monsters, or death to to eating
their corpses.
One case is handled by a general fix to name_to_mon to allow it to deal
with "Croesus' corpse".
The pre-3.4.1 topten behavior for "starved to death" messages is also restored.
2003-09-25 16:56:56 +00:00
nethack.allison
22ad303fee victual follow-up
Since context is saved prior to inventory
ensure that the o_id is valid immediately.
2003-09-21 13:25:56 +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
cohrs
5e443536d8 "your" artifacts
This patch introduces a change to yname() and Yname2() that avoids the
possessive "your" for the hero's normal, fully identified artifacts.
Quest artifacts still get the possessive, as do all other objects and all
objects not in the hero's possession.  shk_your()/Shk_Your() are used in
many places with a specific, generalized name for the object, so I didn't
introduce the artifact behavior there, although I did change them to append
a space, which simplified some other code.  Through added use of yname(),
there may be some places that used to just say "corpse" that will now be more
descriptive via yname()'s use of cxname().  I'm sure <Someone> will point
out any such places that are too onerous, although nothing obviously is.

I took the opportunity to inspect many uses of "your" and even Your().  Two
new functions are also introduced, yobjnam() and Yobjnam2(), which work
like aobjnam() and yname() combined, because I found that many uses of
aobjnam() were preceeded by "your" and I couldn't generally provide the
desired behavior for artifacts (or future artifacts) without a combined
function.  In some cases, this change allowed better sharing of code.

rust_dmg() still takes a string as input which is sometimes initialized
from xname() and often prepends "your" to it.  Currently, this isn't a
problem since there currently are no normal, armor artifacts.  If/when any
are introduced, rust_dmg() will need to be addressed.

The patch is for the trunk only.  A lot of research was required and I
didn't feel the upside was there for repeating it in the 3.4.3 branch.
2003-09-18 02:52:40 +00:00
nethack.allison
416412f92b Remove vestiges of old overlay source split
[trunk only]
2003-09-05 02:45:18 +00:00
cohrs
39a0544360 B05001 - eating a tin in a stack on the floor
Make sure to splitobj tin.tin before calling bill_dummy_object.
Avoids charging to all the stacked tins when you eat the 1st one.
2003-07-19 03:29:21 +00:00
cohrs
3862424fa7 choking on non-food
<Someone> (also later forwarded by <Someone>) reported that choking
while eating non-food always resulted in calling it a "quick snack".
lesshungry() depends on an occupation to tell if you are actually eatig or
not, but since non-food is eaten in one turn, no occupation was set.  Took
his suggestion of setting the occupation temporarily to cause lesshungry()
call choke() appropriately in this case.
2003-05-21 18:32:40 +00:00
cohrs
ddb2f60171 message when eating a stalking
As suggested by <Someone> to the mailing list, display a message
when you eat a stalker and notice that you became invisible.
2003-05-17 20:51:11 +00:00
cohrs
b8e61b8c47 B02003 - choking on unique monster corpse
Try harder to use the pronoun "the" when refering to a unique monster's corpse
2003-05-11 04:18:25 +00:00
cohrs
492bdb672b yet another spelling error
"undigestable" -> "indigestible"
2003-04-27 15:10:46 +00:00
cohrs
b53cdee210 U409 - hiding and eating bugs
Three related bug fixed, two reported in U409.
+ If you zapped a wand of cold downward while hiding underwater, the uundetected
flag was not reset (but the monster case was code correctly), resulting in
an impossible error on the next attack
+ If you finished eating something you were hiding under and were attacked,
another impossible would occur
+ While checking the eating gold case, I noticed that several cases would lose
gold on the floor if the attempt to eat it failed

The first case is fixed by resetting the flag just like the monster case.
The other cases are fixed by adding code to useupf to deal with this.
eatspecial and floorfood were modified to allow useupf to be called, and
fix the 3rd bug in the process.
2003-04-14 01:09:30 +00:00
cohrs
345ffcfaec B01003 - blindfold vs dust vortex
This started out as a change to address the strange sequence of messages if
you remove a blindfold while engulfed in a dust vortex.  That is addressed
by a new function that can be called in such situations.  Calls to this
function were added in all the cases where the can_blnd() engulfing
conditions end as a result of player action.  There are some other cases
that end ucreamed or usleep, but they happen between turns and shouldn't
need extra handling.

While I was at it, I noticed that a unicorn horn or prayer would cure
blindness even while engulfed in a dust vortex.  This is useless, because
you immediately get blind again the next turn.  So, I added checks to avoid
doing this.  Finally, it didn't make sense for eating a carrot to cure your
blindness in these situations either, only for it to return immediately.
2003-03-26 05:10:22 +00:00
cohrs
d4c5f883d4 post-3.4.1 betabug: mimick
mimicking is correct, mimick is not.
2003-03-05 06:04:08 +00:00
nethack.rankin
4496ca3d85 fix B18012 - Werebane
Make wielding Werebane confer defense against catching lychanthropy
from monster bites.  It doesn't protect against catching that from eating
lycanthrope corpses and might blast the character if wielded at such time.

     Also fix artifact handling to recognize the character as lycanthrope
while in normal human/elf/whatever form--rather than only when in beast
form--just like it does for monsters.
2003-02-14 01:06:08 +00:00
nethack.allison
bd77bb85cc urban legend 2003-01-03 05:56:45 +00:00
nethack.rankin
810386390e eating mimic corpses
Don't mimic gold if you are Unchanging at the time you eat a
mimic corpse.
2002-10-21 08:19:17 +00:00
nethack.allison
4430f8f652 B13001 mild buzz
feel a mild buzz only if energy or maxenergy increased
2002-10-03 00:44:16 +00:00
nethack.rankin
bd6f5b87bf "eye of newt"
Add <Someone>'s "eye of newt" patch, which confers energy
when eating a newt corpse.  Consumed energy is restored by up to 3
points, and if that takes the character past max energy there's a
chance to boost the latter by 1 point.  I introduced randomization
so that level 1 characters can't just kill and eat all the newts on
the first couple of levels to unconditionally boost their initial
mana (22% chance per newt to increase max energy now instead of his
original 100% chance).
2002-09-26 07:13:10 +00:00
nethack.allison
9ac2c2c576 <email deleted>
> I'm working on a Nethack port, and one of the header files a
> library uses has a structure with a member named "red". Since
> includes/decl.h #defines red to something, this totally loses.
>
> Attached is a patch which fixes the color defines.
2002-09-06 00:12:44 +00:00
nethack.allison
98d53c93a8 win32 recover; also a core bit from Yitzhak 2002-09-02 14:10:05 +00:00
arromdee
0247ab5c1c eating rings
Found on the newsgroup: someone pointed out that you don't get a message
when you eat a ring of increase damage.  They thought it was intentional--
it's not.
2002-08-07 05:17:45 +00:00
nethack.allison
40940991bb change GOLD_CLASS to COIN_CLASS 2002-07-08 23:25:53 +00:00
cohrs
e88a6182dd cancellation, polymorphed and unchanging
<Someone> reported that a wand of cancellation would ignore Unchanging,
noting the case of cancelling yourself while polymorphed into a stone golem.
He thought the wand should win, killing the player.  I felt otherwise,
since the case he specified passes the flag allow_cancel_kill == FALSE.
2002-07-07 23:25:43 +00:00
cohrs
1359896784 eating conduct followup
lost the non-EGG case when removing the unnecessary LEATHER, et al, checks.
2002-07-07 15:25:23 +00:00
cohrs
e8dc88c950 rotten food and veggie conduct
<Someone> reported (in April) that eating cursed tripe, for example, did
not violate vegetarian conduct.  This patch moves the various conduct
checks into common code that is executed before the rotten state of food is
determined.
2002-07-07 05:07:53 +00:00
nethack.rankin
3842c87c0f grammar of food warnings
Change "The corpses smell like it could be tainted! Eat it anyway?"
to be "The corpses smell like they could be tainted! Eat one anyway?"
when eating one of multiple stacked food objects.
2002-07-02 02:39:27 +00:00
nethack.rankin
365a76ca28 annoying shop bug
The shop billing code assumes that food marked partly eaten
is worthless, but the eating code was changed to make sure that any
eating attempt will never leave food marked as not partly eaten.
The end result is that non-corpse food which is consumed in a
single byte can be eaten off shop floors for free, and if eaten
from inventory--so already on shop bill--the "Ix" display of used
up goods lists the item as partly eaten (with right price though).

     This fix makes single-byte food be handled the same as other
food:  the first byte taken causes the food to be auto-purchased
immediately instead of waiting until it's used up to add it to the
shopping bill.
2002-03-23 06:53:09 +00:00
nethack.allison
416331f4d1 slap against floor while riding
> Greetings! <Someone> suggested I report this bug to you:
> in 3.3.1, riding a horse while blind, I ate a bad carrot (to
> unblind myself) and got the message, "Blecch! Rotten food! The
> world spins and you slap against the floor." Upon regaining
> consciousness, I found I was still safely mounted on my steed,
> raising the question of what part of me could have "slapped
> against the floor." I thought I would have fallen off my
> horse, or at least have slumped against it. <Someone> said in his
> reply to me on rgrn: "Looks like Yet Another message that
> fails to take riding into account; should be easy enough for
> the DevTeam to fix, though, since it's one that's already
> being modified for levitation and the like." Hope this helps.
> Thanks very much! <email deleted>
>
2002-03-07 23:54:15 +00:00
arromdee
e4f694986c french fried food (B7010)
This implements the suggestion in beta bug 7010.
2002-03-02 16:18:39 +00:00
cohrs
924f3cbd37 player eating metal
1) player-as-rust monster should obey same rules for edible metal as monsters.
2) with GOLDOBJ, player-as-xorn couldn't eat gold in inventory
2002-02-12 03:53:05 +00:00
cohrs
e5a5b5253e rotten wraith corpse
sidestep the rotten partly eaten wraith corpse impossible() message by
causing rotten wraith corpses to immediately rot away completely
2002-02-10 20:19:24 +00:00
cohrs
91c5521009 verb agreement
add and use new APIs, Tobjnam, otense and vtense, is_plural
to determine tense/form of verbs and a few pronouns as well
2002-02-09 00:24:49 +00:00
arromdee
9aa253c8ab salamanders
If salamanders are made immune to slime, then all the other places in the
code which check for fire creatures should be modified too.
2002-02-06 05:11:25 +00:00
cohrs
78f59d2046 salamanders immune to sliming
Since salamanders are plane-of-fire creatures, they too should be immune to
fire like fire elementals & vortexes
2002-02-06 04:06:41 +00:00
nethack.allison
06528d1002 3.3.2 to 3.4.0 2002-02-04 16:06:00 +00:00
arromdee
0aa32a65c2 From the beta-testers; the ability to detect bad food should detect slime as
well as cockatrice meat.
2002-02-04 03:35:17 +00:00
cohrs
371bbc2fb8 cost of eating an unpaid tin
The cost of an unpaid tin should be calculated before eating, not after,
so the cost will be based on your pre-eating hunger, not post.
2002-01-21 03:25:50 +00:00
arromdee
f93521e95d wizard #poly and #levelgain
This adds the wizard #poly and #levelgain commands.
2002-01-17 02:47:23 +00:00
cohrs
c77073be31 sync changes since last snapshot 2002-01-07 02:12:04 +00:00
jwalz
bc2a4c5fca *** empty log message *** 2002-01-05 21:05:49 +00:00