summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.cc
diff options
context:
space:
mode:
authorabrahamwl <abrahamwl@gmail.com>2009-10-28 11:02:12 -0700
committerAdam Borowski <kilobyte@angband.pl>2009-10-28 19:07:59 +0100
commit06bf811e45f13eddea2dd1c1f4b3554c68e09553 (patch)
tree5476c6b283ec1cf705ed46041d80f71ba57836fa /crawl-ref/source/beam.cc
parent4e14802376eeb4770861592e171b9b8dcedacb16 (diff)
downloadcrawl-ref-06bf811e45f13eddea2dd1c1f4b3554c68e09553.tar.gz
crawl-ref-06bf811e45f13eddea2dd1c1f4b3554c68e09553.zip
Beams can be assigned custom hit verbs now
If a beam is not, old behavior is default.
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc18
1 files changed, 13 insertions, 5 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 9e2153d18c..fff34b7ecb 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -3953,9 +3953,12 @@ void bolt::affect_player()
if (misses_player())
return;
- const bool engulfs = (is_explosion || is_big_cloud);
- mprf("The %s %s you!",
- name.c_str(), engulfs ? "engulfs" : "hits");
+ const bool engulfs = is_explosion || is_big_cloud;
+ if (hit_verb.empty())
+ {
+ hit_verb = engulfs ? "engulfs" : "hits";
+ }
+ mprf("The %s %s you!", name.c_str(), hit_verb.c_str());
// FIXME: Lots of duplicated code here (compare handling of
// monsters)
@@ -4736,9 +4739,14 @@ void bolt::affect_monster(monsters* mon)
// The beam hit.
if (mons_near(mon))
{
+ if (hit_verb.empty())
+ {
+ hit_verb = (is_explosion || is_big_cloud)
+ ? "engulfs" : "hits";
+ }
mprf("The %s %s %s.",
name.c_str(),
- engulfs ? "engulfs" : "hits",
+ hit_verb.c_str(),
you.can_see(mon) ?
mon->name(DESC_NOCAP_THE).c_str() : "something");
@@ -5788,7 +5796,7 @@ bolt::bolt() : range(-2), type('*'),
flavour(BEAM_MAGIC), real_flavour(BEAM_MAGIC), drop_item(false),
item(NULL), source(), target(), damage(0, 0),
ench_power(0), hit(0), thrower(KILL_MISC), ex_size(0),
- beam_source(MHITNOT), name(), short_name(), is_beam(false),
+ beam_source(MHITNOT), name(), short_name(), hit_verb(), is_beam(false),
is_explosion(false), is_big_cloud(false), aimed_at_spot(false),
aux_source(), affects_nothing(false), affects_items(true),
effect_known(true), draw_delay(15), special_explosion(NULL),