diff options
author | Adam Borowski <kilobyte@angband.pl> | 2011-03-07 19:40:23 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2011-03-07 19:40:23 +0100 |
commit | 15537459ded4cf1a6e5dc2818800d59f6af1dc48 (patch) | |
tree | e21acbadd6750e19a8d56214cf442501d3bfdc28 /crawl-ref/source/spl-util.h | |
parent | 4c1aef9351d8625110220b7d5746a76f01f75565 (diff) | |
download | crawl-ref-15537459ded4cf1a6e5dc2818800d59f6af1dc48.tar.gz crawl-ref-15537459ded4cf1a6e5dc2818800d59f6af1dc48.zip |
New targetting code; for now for reaching and Fire Storm.
directn.cc tried to assume everything is a beam, this make it impossible
to properly visualise spells/effects with different rules, like reaching,
clouds, IOOD, shotgun-targetted spells, cones, etc. This interface lets
every spell come with an object that answers the question: if I aim at X,
will location Y be affected?
There are three levels of aiming effect now:
* tracer only
* might be affected
* will be affected unless you miss
This means we can show spells that have randomized area: Freezing Cloud,
Fire Storm's radius, etc.
TODO: display in tiles.
The old targetter has a great number of special cases, I did not replace
it yet since it would be a large amount of work. The new code allows for
showing explosions and bounces, but I'd start with clouds and such first.
Fire Storm is a good sample.
Also, this commit fixes the targetter not allowing you to reach sqrt(8) via
'f' or '.'; you had to use '!' to do that. A number of places in the code
assumed that, with a special distinction for two modes of reaching.
Diffstat (limited to 'crawl-ref/source/spl-util.h')
-rw-r--r-- | crawl-ref/source/spl-util.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crawl-ref/source/spl-util.h b/crawl-ref/source/spl-util.h index 8431cf28e0..29753d41c5 100644 --- a/crawl-ref/source/spl-util.h +++ b/crawl-ref/source/spl-util.h @@ -9,6 +9,7 @@ #define SPL_UTIL_H #include "enum.h" +#include "target.h" enum spschool_flag_type { @@ -138,7 +139,8 @@ bool spell_direction(dist &spelld, bolt &pbolt, bool may_target_self = false, const char *target_prefix = NULL, const char *prompt = NULL, - bool cancel_at_self = false); + bool cancel_at_self = false, + targetter *hitfunc = NULL); skill_type spell_type2skill (unsigned int which_spelltype); |