| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
It was very unlikely to ever trigger - caused by a monster somehow being
made to bleed just out of your LOS in the blood sense case, or a monster
being caught in a web while you are in spider form in the web sense case,
and even less likely to actually be useful if it did somehow trigger.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I had to rename distance() (in coord.h) to distance2() because it conflicts
with the STL function to compare 2 iterators. Not a bad change given how it
returns the square of the distance anyway.
I also had to rename the message global variable (in message.cc) to buffer.
I tried to fix and improve the coding style has much as I could, but I
probably missed a few given how huge and tedious it is.
I also didn't touch crawl-gdb.py, and the stuff in prebuilt, rltiles/tool
and util/levcomp.*, because I have no clue about those.
|
| |
|
| |
|
| |
|
|
|
|
| |
All other noise effects are in shout.cc.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now, it flashes a variety of coloured, pretty lights, which have the
same effect of waking up nearby monsters. This is achieved by
"fake_noisy", which generates noise (but no message) regardless of
whether or not the area is silenced.
However, it has just occurred to me that the latter function might cause
weird interactions with mesmerisation and fear. Might be something to
keep in mind if its use is extended to areas where mermaids or other
monsters might be causing fear/mesmerising.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The old noise propagation system alerted all monsters within `loudness' radius
of the noise source, ignoring obstacles between the observer and the noise
source.
The new noise system applies only to monsters; the player is still messaged as
before. This is for two reasons:
1. noisy() must return if the player heard the noise, which forces us to
propagate the noise immediately for each noise, an unacceptable overhead on
busy maps (such as Sprint). Therefore we cheat and use the old noise rules for
the player. This is relatively simple to work around, since not many code paths
rely on the noisy() return code, and these places can be changed to work around
this lack of information.
2. The new noise system allows loud noises to drown out quiet noises. This may
be an unacceptable loss of information for the player.
The new system keeps track of noises produced by noisy(), but does not
act on them immediately. Instead, all noises are processed in world_reacts.
Noises are processed by a simple flood-out from their sources, attenuated by
distance, terrain (such as closed doors, trees), and by twists in the noise's
path (a winding corridor attenuates noise more than a straight line). Noise
propagation and attenuation uses movement geometry, not LOS geometry, *but*
attenuation assumes it is harder for the noise to change direction than to keep
going in its old direction.
To simplify handling of noises, it is assumed that louder noises overwhelm
quieter noises. An actor exposed to both a loud and a quiet noise at the same
distance will hear only the loud noise. However, an actor closer to the quiet
noise than the loud noise will hear first the quiet noise, then the loud noise
(because the floodfill visits points at an increasing radius from each noise
source). Given two equally loud noises, the closer noise will always win.
Multiple quiet noises emitted close together do not combined into a louder
noise.
Monsters hearing a noise at a distance from its source may not correctly guess
the noise's origin if the noise did not travel in a straight line to the
monster.
Noises are currently processed before and after handle_monsters() so that
monsters can react to noises produced by the player and by each other. We could
conceivably drop one of the apply_noises() calls (probably the one after
handle_monsters()) without adverse effects.
Since the new noise system allows closed doors to cut off sound, I've dropped
the Sprint noise attenuation from 1/3 to 1/2.
If Crawl is compiled with DEBUG_NOISE_PROPAGATION, it will write a
noise-grid.html dump file showing noise sources and intensities on the map for
each call to apply_noises that processed a noise.
|
|
|
|
|
|
| |
I did review it manually to find places where they made sense (like some
tables), but for a massive sed job like this there might be places that
I missed.
|
| |
|
| |
|
| |
|
| |
|
|
|