summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-16 18:20:22 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-16 18:20:22 +0000
commit65ad20dff06c085e329e627ddeebe8a1deca6d04 (patch)
tree8f8328534f6ad696bc01d91d77b63a566340ee02 /crawl-ref/source
parent96c41a695406df7d8bfcb3325447591ca9edba32 (diff)
downloadcrawl-ref-65ad20dff06c085e329e627ddeebe8a1deca6d04.tar.gz
crawl-ref-65ad20dff06c085e329e627ddeebe8a1deca6d04.zip
Add a few more poison-related cleanups.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7449 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/beam.cc9
-rw-r--r--crawl-ref/source/beam.h4
-rw-r--r--crawl-ref/source/fight.cc4
-rw-r--r--crawl-ref/source/player.cc6
4 files changed, 12 insertions, 11 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 9e8d112083..b276e85a25 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -2371,8 +2371,8 @@ static void _beam_petrifies_monster(bolt &pbolt, monsters *monster)
}
}
-bool curare_hits_monster(const bolt &beam, monsters *monster,
- kill_category who, int levels)
+bool curare_hits_monster(actor *agent, monsters *monster, kill_category who,
+ int levels)
{
poison_monster(monster, who, levels, false);
@@ -2391,7 +2391,7 @@ bool curare_hits_monster(const bolt &beam, monsters *monster,
if (hurted)
{
simple_monster_message(monster, " convulses.");
- monster->hurt(beam.agent(), hurted, BEAM_POISON);
+ monster->hurt(agent, hurted, BEAM_POISON);
}
if (monster->alive())
@@ -4492,7 +4492,8 @@ static int _affect_monster(bolt &beam, monsters *mon, item_def *item)
else if (item->special == SPMSL_CURARE)
{
if (beam.ench_power == AUTOMATIC_HIT
- && curare_hits_monster(beam, mon, _whose_kill(beam), 2)
+ && curare_hits_monster(beam.agent(),
+ mon, _whose_kill(beam), 2)
&& !mon->alive())
{
wake_mimic = false;
diff --git a/crawl-ref/source/beam.h b/crawl-ref/source/beam.h
index 9be2ada74c..ab74ec8ce2 100644
--- a/crawl-ref/source/beam.h
+++ b/crawl-ref/source/beam.h
@@ -125,8 +125,8 @@ bool mass_enchantment( enchant_type wh_enchant, int pow, int who,
mon_resist_type mons_ench_f2(monsters *monster, bolt &pbolt);
-bool curare_hits_monster(const bolt &beam, monsters *monster,
- kill_category who, int levels = 1);
+bool curare_hits_monster(actor *agent, monsters *monster, kill_category who,
+ int levels = 1);
bool poison_monster(monsters *monster, kill_category who, int levels = 1,
bool force = false, bool verbose = true);
bool napalm_monster(monsters *monster, kill_category who, int levels = 1,
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 48a8b22f41..cf3174a320 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -3594,9 +3594,9 @@ void melee_attack::mons_apply_attack_flavour(const mon_attack_def &attk)
res = defender->res_poison();
if (res <= 0)
{
- defender->poison( attacker, roll_dice(1,3) );
+ defender->poison(attacker, roll_dice(1, 3));
if (one_chance_in(4))
- defender->drain_stat( STAT_STRENGTH, 1, attacker );
+ defender->drain_stat(STAT_STRENGTH, 1, attacker);
}
break;
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 7a66a9538a..a210328302 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -5048,9 +5048,9 @@ bool confuse_player(int amount, bool resistable)
return (true);
}
-bool curare_hits_player(int agent, int degree)
+bool curare_hits_player(int agent, int amount)
{
- poison_player(degree);
+ poison_player(amount);
const bool res_poison = player_res_poison() > 0;
@@ -5070,7 +5070,7 @@ bool curare_hits_player(int agent, int degree)
ouch(hurted, agent, KILLED_BY_CURARE, "curare-induced apnoea");
}
- potion_effect(POT_SLOWING, 2 + random2(4 + degree));
+ potion_effect(POT_SLOWING, 2 + random2(4 + amount));
}
return (hurted > 0);