summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-07 21:39:26 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-07 21:39:26 +0000
commit356d2e3e4b9ce53e0b205ff6fd5b35a4163a0cc5 (patch)
tree80732c91254feeecfd856e40e92c739519ab061d /crawl-ref/source/player.cc
parent100d0a3c9501882904c8d467bdd91bd43bec2d4f (diff)
downloadcrawl-ref-356d2e3e4b9ce53e0b205ff6fd5b35a4163a0cc5.tar.gz
crawl-ref-356d2e3e4b9ce53e0b205ff6fd5b35a4163a0cc5.zip
Clean up sticky flame handling.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7409 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc55
1 files changed, 55 insertions, 0 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 8e8f8e8ae7..5ce17d6463 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -5077,6 +5077,61 @@ void reduce_poison_player(int amount)
mpr("You feel a little better.", MSGCH_RECOVERY);
}
+bool napalm_player(int amount)
+{
+ if (player_res_sticky_flame() || amount <= 0)
+ return (false);
+
+ const int old_value = you.duration[DUR_LIQUID_FLAMES];
+ you.duration[DUR_LIQUID_FLAMES] += amount;
+
+ if (you.duration[DUR_LIQUID_FLAMES] > 40)
+ you.duration[DUR_LIQUID_FLAMES] = 40;
+
+ if (you.duration[DUR_LIQUID_FLAMES] > old_value)
+ mpr("You are covered in liquid flames!", MSGCH_WARN);
+
+ return (true);
+}
+
+void dec_napalm_player()
+{
+ if (you.duration[DUR_LIQUID_FLAMES] > 1)
+ {
+ you.duration[DUR_LIQUID_FLAMES]--;
+
+ mpr("You are covered in liquid flames!", MSGCH_WARN);
+
+ expose_player_to_element(BEAM_NAPALM, 12);
+
+ const int res_fire = player_res_fire();
+
+ if (res_fire > 0)
+ {
+ ouch((((random2avg(9, 2) + 1) * you.time_taken) /
+ (1 + (res_fire * res_fire))) / 10, NON_MONSTER,
+ KILLED_BY_BURNING);
+ }
+
+ if (res_fire <= 0)
+ {
+ ouch(((random2avg(9, 2) + 1) * you.time_taken) / 10, 0,
+ KILLED_BY_BURNING);
+ }
+
+ if (res_fire < 0)
+ {
+ ouch(((random2avg(9, 2) + 1) * you.time_taken) / 10, 0,
+ KILLED_BY_BURNING);
+ }
+
+ if (you.duration[DUR_CONDENSATION_SHIELD] > 0)
+ remove_condensation_shield();
+ }
+ else if (you.duration[DUR_LIQUID_FLAMES] == 1)
+ you.duration[DUR_LIQUID_FLAMES] = 0;
+}
+
bool confuse_player(int amount, bool resistable)
{
if (amount <= 0)