Commit Graph

45 Commits

Author SHA1 Message Date
PatR
c53565036c fix scatter feedback
Reported directly to devteam (for 3.4.3 but still present in 3.6.0):
an unseen landmine explosion which caused scatter() to break a
boulder or statue would give feedback as if the hero could see the
boulder or statue being destroyed.

Also, a couple of landmine explosion messages didn't take deafness
into account.
2016-03-19 15:46:33 -07:00
PatR
9114a334c9 fix "killed by a died"
Explosion caused by an unseen gas spore resulted in messages about
"explosion" instead of "gas spore's explosion", which is intended, but
followed that with a death reason of "killed by a died" which isn't.
2015-12-23 16:05:45 -08:00
PatR
c09fe294dd formatting: more casts 2015-11-07 20:02:04 -08:00
PatR
b7b9d8faa9 formatting: src/e*.c - l*.c continuation lines
Relatively small number of continuation fixes needed for this subset.

Quite a bit of mangling to engrave.c unrelated to continuation lines,
with three or four coding changes.
2015-10-20 17:55:26 -07:00
Sean Hunt
1c081b1647 Remove stale version control lines. 2015-05-25 09:21:31 +09:00
Sean Hunt
6aaece4ba7 Fix sleep explosion causing impossible().
Also clean up come ternaries while I'm here.

My first attempt to fix was to add AD_SLEE to explode(), but that failed
because do_break_wand() already does the sleeping portion. I don't
generally like the duplication between explode() and do_break_wand as a
result, but I consider that issue a project for another day.
2015-05-24 09:24:11 -04:00
Sean Hunt
97d6fade74 Reformat all C files.
I'll push a formatting guide at some point. There may still be
outstanding changes, but please feel free to resolve those as you arrive
a them.

To the best of my knowledge, there is no changes to the actual code
content, but the formatter does have the occasional bug. If you run into
an issue, please fix it!
2015-05-09 13:43:16 -04:00
karnov
2a907f894e Version number increment 2015-05-06 22:04:27 -04:00
Pasi Kallinen
debdf7ca48 Move some hard-coded string arrays into data files.
Random epitaphs, engravings and hallucinatory monsters now
live in text data files.
2015-03-18 22:05:10 +02:00
Sean Hunt
9e65758947 Make STEED unconditional. 2015-02-27 19:33:01 -05:00
keni
03140969ee Bulk recovery of file CVS headers and addition of NHDT- headers. 2015-02-26 09:19:03 -05:00
nethack.rankin
e8e291b018 fix #H3039 - panic() when trying to drop destroyed items
From a bug report, dropping a lit
(burning) potion of oil while levitating can produce an explosion which can
destroy inventory.  If in the process of dropping multiple items, the ones
after the oil might be gone, resulting in use of stale pointers and possibly
triggering an "extract_nobj: object lost" panic or even a crash.  While
testing my fix, I discovered that being killed by an exploding potion of oil
could produce an "object_is_local" panic if bones are saved  (and reproduced
with unmodified 3.4.3).
2013-11-05 00:57:56 +00:00
nethack.rankin
8f3c74d804 wand/spell/breath zaps hitting secret doors (trunk only)
From a bug report, black dragon breath
destroys closed doors didn't acknowledge hitting secret doors.  bhit()
reveals secret doors, but zap_over_floor() (called by buzz() for ray-type
wands and spells, and for breath attacks) didn't check for hitting those.

     When testing the fix, I noticed that feedback for an explosion caused
by breaking a wand was worded oddly for zaps like magic missile which don't
damage doors.  "The door absorbs your bolt" didn't make much sense; what
bolt?  That was first changed to "absords your blast", which still sounded
weird, then to "absorbs the blast", which seemed better but was inaccurate.
Next was "absorbs some of the blast" since the explosion continues to hit
adjacent spots, but since it still has full strength that wasn't accurate
either.  It's finally become "The door remains intact."  Unlike with zaps,
there is no additional range being lost, so no reference to absorption.
2009-05-28 14:09:30 +00:00
keni
4eabcee787 Add RCS version lines 2009-05-06 10:50:32 +00:00
nethack.rankin
8c90e9ae7b fatal explosion feedback (trunk only)
From the newsgroup:
    As you read the scroll, it disappears.
    The scroll erupts in a tower of flame!
    Your spellbook of force bolt catches fire and burns!
    [...]
    Your potion of paralysis boils and explodes!
    Something seems to be holding you.
    Do you want your possessions idenified?
This character survived the burning and boiling objects then succumbed
to the initial flame explosion.

     A fatal explosion calls done() without any explanation.  Or rather,
it dated to the time where it would immediately follow "the scroll erupts
in flame" (or "you are caught in <some kind of> explosion") without the
chance for intervening messages.  Then when item destruction was moved
sooner (for bones file purposes), message sequencing was left dangling.
This patch adds a new "it was fatal" message in front of done().
2009-01-05 00:35:39 +00:00
nethack.rankin
6aff1bfad1 explode() while engulfed (trunk only)
For an explosion caused by the player while the hero is engulfed,
skip adjacent monsters.  Also, don't give "you hear a blast" when an
unseen explosion is caused by a scroll of fire (explosion is always unseen
when hero is engulfed, regardless of explosion's cause).  [Offhand I'm
not sure whether something other than the player can trigger an explosion
while the hero is engulfed.]  Lastly, round up instead of down when a
monster takes half damage, so that non-zero can't be reduced to zero.
2007-04-30 04:56:37 +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.allison
71ed473cf6 broken wand of striking vs door (trunk only)
<email deleted> wrote:
> * Doors absorb the blast of a broken wand of striking. What's more, the message
> reads "The door absorbs your bolt!" rather than "blast".

passes wand type to explode() as a negative value for the case
where the wand type isn't mapped to an AD_* explosion type.

Then explode() converts it to a positive and passes it to zap_over_floor().
2006-03-07 03:10:58 +00:00
nethack.rankin
75c4576668 gas spore explosions while hallucinating (trunk only)
From a bug report:  when hallucinating,
messages for affected monsters and/or hero referred to "the gas spore's
explosion" instead of supplying random monster names.  This is a little bit
tricky; since it can be displayed multiple times for one explosion, it needs
to be constructed on the fly in explode().  (Caller couldn't have handled
this anyway since it's using the value for killed-by reason which mustn't
be distorted by hallucination.)
2005-11-13 03:20:20 +00:00
nethack.allison
5fa8f73af8 housekeeping: mark trunk sources 3.5 (src) 2005-01-02 16:44:46 +00:00
nethack.allison
6596b69111 obj->quan bits 2004-12-21 16:40:14 +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.allison
9b3521e503 vampires now shapeshift [trunk only]
- can shift into fog clouds, vampire bats, and vampire lords into wolves
- after being "killed" in shifted form, they transform back rather than get
  destroyed, and you must take them on in vampire form to defeat them
- can deliberately shift into fog clouds to pass under closed doors
2004-06-15 11:52:04 +00:00
nethack.allison
9b9f13aa13 Half_physical_damage 07
It is not physical damage if:
1. it already qualifies for some other special type of damage
   for which a special resistance already exists in the game
   including: cold, fire, shock, and acid. Note that fire is
   extended to include all forms of burning, even boiling water
   since that is already dealt with by fire resistance, and in
   most or all cases is caused by fire.
2. it doesn't leave a mark. Marks include destruction of, or
   damage to, an internal organ (including the brain),
   lacerations, bruises, crushed body parts, bleeding.

Current exceptions to the rule (already existing):
- holy water burning chaotic ("it burns like acid") is physical damage.
- unholy water burning lawful is physical damage.
2003-10-22 23:05:24 +00:00
nethack.allison
47e1a6873a Half_physical_damage 2
Another batch of missing Half_physical_damage checks
from the list provided by <Someone>:
- Scrolls of fire (!confused)
- Broken wands
- Splattered burning oil from thrown potion
- Dipping a lit lamp into a potion of oil
- Scrolls of fire (confused, didn't bother with non-confused)
- Being caught in a fireball

Adds a macro Maybe_Half_Phys to assist.
2003-10-21 16:47:59 +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
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
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
416412f92b Remove vestiges of old overlay source split
[trunk only]
2003-09-05 02:45:18 +00:00
nethack.allison
1284e86476 lint follow up
Janet wrote:
>There is one more new complaint that might cause problems:
>explode.c(545): warning: conversion from long may lose accuracy
2003-02-19 05:12:31 +00:00
nethack.rankin
e3b20b8a9f de-sparkling explosions
From the newsgroup:  explosions handle their own shield effect
display for resisting monsters and it was ignoring user's negation
of the sparkle option to suppress shield effect.
2002-11-13 23:08:04 +00:00
warwick
00671608d6 Fix scattering - the splitting code doesn't look right - it will
leave avg 1/2 the object's quantity on the scatter point.
Return count of how many objects actually left the scatter point.
2002-09-09 05:44:32 +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
nethack.allison
186a2ccbcf B01001
<Someone> reported this bug (B01001):
	"Tower of flame" as cause of death _still_ lacks "killed by"
	prefix.
2002-07-03 00:11:22 +00:00
nethack.allison
c49130e5bd boulder/statue/landmine reversal and new fix
This includes a reversal of my earlier
boulder/statue/landmine fix,
and places a check for obj->where==OBJ_FLOOR into
fracture_rock().  I think this is a better approach
because:
- if eliminates the pointless extract/place in
fracture_rock, followed by extract/place in
the caller in the two places causing the crash
- it covers any similar situations that we
might have missed or that someone might add
accidentally (you might not expect the location
of an object to change inside fracture_rock())
- it allows fracturing to take place on the
other object chains if we ever need it (statues
falling down stairs, perhaps?)
- it doesn't move objects from other chains onto
the floor briefly as the current code does
2002-03-30 14:46:31 +00:00
cohrs
4e60c90635 mimic caught in explosion printed message but wasn't discovered
- add seemimic call before printing the "caught" message
2002-03-27 05:08:11 +00:00
cohrs
6cdf92851e half-physical-damage from gas spore explosion should only affect you
- <Someone> noticed the fix for applying half physical damage to gas spore
explosions affected damage to all monsters, not just you
2002-03-27 02:31:21 +00:00
nethack.allison
869e5e7c0c more explode panic()
You could still get a panic. To reproduce:
- wizwish for a statue, and drop it
- wizwish for a landmine, and apply it at same location as statue
- move one square and wish for a boulder, drop it (automatically likely)
- push the boulder on the landmine to trigger it.
- the panic came from the statue this time.
2002-03-23 17:27:52 +00:00
nethack.allison
fba4cbd6af #R650: Game crash (Panic - obj not free)
> <email deleted>
> Oops! [...]
> Suddenly, the dungeon collapses.
> place_object: obj not free
>
> The crash is reproducible in wizmode by wishing for a landmine, arming it and
> pushing a wished-for boulder onto it.
2002-03-23 01:35:59 +00:00
cohrs
e6c317835c /tmp/msg 2002-03-19 04:20:20 +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
nethack.allison
06528d1002 3.3.2 to 3.4.0 2002-02-04 16:06:00 +00:00
cohrs
f73a1879c9 landmines and boulders
Make pushing a boulder onto a landmine share code with the trap case,
resulting in pits, waking sleepers, et al.
Don't leave a boulder suspended over the new pit, fill it.
Make sure any remaining boulder is placed on top of the pile.
If player sets off landmine, monsters killed are credited to/blamed on player.
2002-01-25 06:38:42 +00:00
cohrs
c77073be31 sync changes since last snapshot 2002-01-07 02:12:04 +00:00
jwalz
5f60897f41 *** empty log message *** 2002-01-05 21:05:49 +00:00