summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-07 19:29:37 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-07 19:29:37 +0000
commit39bd7b8798e06d472f38351446fa5d0ff89ec377 (patch)
tree8767ec8b544ab8d1920d03cb6b9e5b96680fd4f8 /crawl-ref/source/player.cc
parent7498bf3467a6866d94861d5d083e75ee402d3f5d (diff)
downloadcrawl-ref-39bd7b8798e06d472f38351446fa5d0ff89ec377.tar.gz
crawl-ref-39bd7b8798e06d472f38351446fa5d0ff89ec377.zip
Add poison-related cleanups.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7400 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc36
1 files changed, 30 insertions, 6 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 2acfa1a66b..a67a2f3481 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -34,6 +34,7 @@
#include "itemname.h"
#include "itemprop.h"
#include "items.h"
+#include "it_use2.h"
#include "Kills.h"
#include "macro.h"
#include "message.h"
@@ -5013,7 +5014,29 @@ void contaminate_player(int change, bool controlled, bool status_only)
}
}
-bool poison_player( int amount, bool force )
+void curare_hits_player(int agent, int degree)
+{
+ const bool res_poison = player_res_poison();
+
+ poison_player(degree);
+
+ if (!player_res_asphyx())
+ {
+ int hurted = roll_dice(2, 6);
+ // Note that the hurtage is halved by poison resistance.
+ if (res_poison)
+ hurted /= 2;
+
+ if (hurted)
+ {
+ mpr("You have difficulty breathing.");
+ ouch(hurted, agent, KILLED_BY_CURARE, "curare-induced apnoea");
+ }
+ potion_effect(POT_SLOWING, 2 + random2(4 + degree));
+ }
+}
+
+bool poison_player(int amount, bool force)
{
if (!force && player_res_poison() || amount <= 0)
return (false);
@@ -5027,13 +5050,14 @@ bool poison_player( int amount, bool force )
if (you.duration[DUR_POISONING] > old_value)
{
mprf(MSGCH_WARN, "You are %spoisoned.",
- (old_value > 0) ? "more " : "" );
+ old_value > 0 ? "more " : "");
learned_something_new(TUT_YOU_POISON);
}
+
return (true);
}
-void reduce_poison_player( int amount )
+void reduce_poison_player(int amount)
{
if (you.duration[DUR_POISONING] == 0 || amount <= 0)
return;
@@ -5043,10 +5067,10 @@ void reduce_poison_player( int amount )
if (you.duration[DUR_POISONING] <= 0)
{
you.duration[DUR_POISONING] = 0;
- mpr( "You feel better.", MSGCH_RECOVERY );
+ mpr("You feel better.", MSGCH_RECOVERY);
}
else
- mpr( "You feel a little better.", MSGCH_RECOVERY );
+ mpr("You feel a little better.", MSGCH_RECOVERY);
}
bool confuse_player( int amount, bool resistable )
@@ -6474,7 +6498,7 @@ int player::mons_species() const
}
}
-void player::poison(actor*, int amount)
+void player::poison(actor *agent, int amount)
{
::poison_player(amount);
}