summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ranged_attack.cc
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2014-05-21 11:06:46 -0600
committerSteve Melenchuk <smelenchuk@gmail.com>2014-05-21 11:06:46 -0600
commitf1caba60366a0eaaedb114caef6788cfcbc59421 (patch)
tree71cd78a38344aff99cd892cbb36f756c8574a3c2 /crawl-ref/source/ranged_attack.cc
parente03bf5a60aae380c7f94aa9309767073eec073ab (diff)
downloadcrawl-ref-f1caba60366a0eaaedb114caef6788cfcbc59421.tar.gz
crawl-ref-f1caba60366a0eaaedb114caef6788cfcbc59421.zip
Make needles of sleep do something again (bmfx).
They were alerting the attacker on the impact, making the effect completely useless; thus successfully hitting something with a needle of sleep does not alert them.
Diffstat (limited to 'crawl-ref/source/ranged_attack.cc')
-rw-r--r--crawl-ref/source/ranged_attack.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/crawl-ref/source/ranged_attack.cc b/crawl-ref/source/ranged_attack.cc
index 71fc12240e..842539b80f 100644
--- a/crawl-ref/source/ranged_attack.cc
+++ b/crawl-ref/source/ranged_attack.cc
@@ -29,7 +29,7 @@ ranged_attack::ranged_attack(actor *attk, actor *defn, item_def *proj,
bool tele) :
::attack(attk, defn), range_used(0),
reflected(false), projectile(proj), teleport(tele),
- orig_to_hit(0)
+ orig_to_hit(0), should_alert_defender(true)
{
init_attack(SK_THROWING, 0);
kill_type = KILLED_BY_BEAM;
@@ -139,7 +139,8 @@ bool ranged_attack::attack()
// TODO: adjust_noise
- alert_defender();
+ if (should_alert_defender)
+ alert_defender();
if (!defender->alive())
handle_phase_killed();
@@ -315,7 +316,8 @@ bool ranged_attack::handle_phase_hit()
}
// XXX: unify this with melee_attack's code
- if (attacker->is_player() && defender->is_monster())
+ if (attacker->is_player() && defender->is_monster()
+ && should_alert_defender)
{
behaviour_event(defender->as_monster(), ME_WHACK, attacker,
coord_def(), !stab_attempt);
@@ -767,6 +769,7 @@ bool ranged_attack::apply_missile_brand()
if (!blowgun_check(brand))
break;
defender->put_to_sleep(attacker, damage_done);
+ should_alert_defender = false;
break;
case SPMSL_CONFUSION:
if (!blowgun_check(brand))