summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-project.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-07-18 02:10:20 +0200
committerAdam Borowski <kilobyte@angband.pl>2012-07-18 02:12:24 +0200
commita82dbc50ce03c713eec49e9cc29137edcca1e2e7 (patch)
tree76efdf2f0b9413c197021d8d2133cfe4dbc96a50 /crawl-ref/source/mon-project.cc
parent50ccef46067d93b57ef11d47b2ec0fdc03950c34 (diff)
downloadcrawl-ref-a82dbc50ce03c713eec49e9cc29137edcca1e2e7.tar.gz
crawl-ref-a82dbc50ce03c713eec49e9cc29137edcca1e2e7.zip
Make being rolled over by a boulder beetle a separate ktyp.
This allows us to make the obituary have a reasonable wording: beams are all about hitting stuff from afar, rolling boulders not so.
Diffstat (limited to 'crawl-ref/source/mon-project.cc')
-rw-r--r--crawl-ref/source/mon-project.cc36
1 files changed, 14 insertions, 22 deletions
diff --git a/crawl-ref/source/mon-project.cc b/crawl-ref/source/mon-project.cc
index 1205996370..4e97304948 100644
--- a/crawl-ref/source/mon-project.cc
+++ b/crawl-ref/source/mon-project.cc
@@ -22,6 +22,7 @@
#include "mon-place.h"
#include "mon-stuff.h"
#include "mon-util.h"
+#include "ouch.h"
#include "shout.h"
#include "stuff.h"
#include "terrain.h"
@@ -593,30 +594,21 @@ static bool _boulder_shielded(monster& mon, actor &victim)
return (pro_block >= con_block);
}
-static bool _boulder_hit(monster& mon, const coord_def &pos)
+static bool _boulder_hit(monster& mon, const coord_def &pos, actor *victim)
{
- bolt beam;
- beam.name = "rolling boulder";
- beam.flavour = BEAM_MISSILE;
- beam.attitude = mon.attitude;
-
- actor *caster = &mon;
- beam.set_agent(caster);
- beam.colour = WHITE;
- beam.glyph = dchar_glyph(DCHAR_FIRED_BURST);
- beam.range = 1;
- beam.source = pos;
- beam.target = pos;
- beam.hit = AUTOMATIC_HIT;
- beam.source_name = mon.name(DESC_PLAIN, true);
-
- beam.damage = dice_def(3, 20);
-
- beam.ex_size = 1;
- beam.loudness = 5;
+ if (victim)
+ {
+ simple_monster_message(&mon, (std::string(" smashes into ")
+ + victim->name(DESC_PLAIN) + "!").c_str());
- beam.fire();
+ int dam = roll_dice(3, 20) - random2(1 + victim->armour_class());
+ if (victim->is_player())
+ ouch(dam, mon.mindex(), KILLED_BY_ROLLING);
+ else
+ victim->hurt(&mon, dam);
+ }
+ noisy(5, pos);
return true;
}
@@ -822,7 +814,7 @@ move_again:
if (victim == &you)
mprf("%s hits you!", mon.name(DESC_THE, true).c_str());
- if (_boulder_hit(mon, pos))
+ if (_boulder_hit(mon, pos, victim))
{
if (victim && victim->alive())
_boulder_stop(mon);