summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-09-29 22:08:46 -0500
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-09-29 22:08:46 -0500
commit45001d37f21bc2b39c616d313d01b0039a78734e (patch)
treeb936fe4420d217ca7af2d518c1f48fe892da49a5 /crawl-ref/source/player.cc
parentf3b1dada2312ceb855cf1eabd5d73325cc9c6ed0 (diff)
downloadcrawl-ref-45001d37f21bc2b39c616d313d01b0039a78734e.tar.gz
crawl-ref-45001d37f21bc2b39c616d313d01b0039a78734e.zip
Make miasma and miasma resistance more consistent. It no longer depends
on negative energy resistance, but on rotting resistance.
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc63
1 files changed, 46 insertions, 17 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 13161c94c7..e0b9c41e48 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -1712,6 +1712,17 @@ int player_res_poison(bool calc_unid, bool temp, bool items)
return (rp);
}
+int player_res_rotting()
+{
+ if (you.is_undead
+ && (you.is_undead != US_SEMI_UNDEAD || you.hunger_state < HS_SATIATED))
+ {
+ return (1);
+ }
+
+ return (0);
+}
+
int player_res_asphyx()
{
int ra = 0;
@@ -5039,7 +5050,7 @@ void inc_hp(int hp_gain, bool max_too)
you.redraw_hit_points = true;
}
-void rot_hp( int hp_loss )
+void rot_hp(int hp_loss)
{
you.base_hp -= hp_loss;
calc_hp();
@@ -5050,7 +5061,7 @@ void rot_hp( int hp_loss )
you.redraw_hit_points = true;
}
-void unrot_hp( int hp_recovered )
+void unrot_hp(int hp_recovered)
{
if (hp_recovered >= 5000 - you.base_hp)
you.base_hp = 5000;
@@ -5062,12 +5073,12 @@ void unrot_hp( int hp_recovered )
you.redraw_hit_points = true;
}
-int player_rotted( void )
+int player_rotted()
{
return (5000 - you.base_hp);
}
-void rot_mp( int mp_loss )
+void rot_mp(int mp_loss)
{
you.base_magic_points -= mp_loss;
calc_mp();
@@ -5502,6 +5513,30 @@ void reduce_poison_player(int amount)
}
}
+bool miasma_player()
+{
+ ASSERT(!crawl_state.arena);
+
+ if (player_res_rotting())
+ return (false);
+
+ bool success = poison_player(1);
+
+ if (you.hp_max > 4 && coinflip())
+ {
+ rot_hp(1);
+ success = true;
+ }
+
+ if (one_chance_in(3))
+ {
+ potion_effect(POT_SLOWING, 5);
+ success = true;
+ }
+
+ return (success);
+}
+
bool napalm_player(int amount)
{
ASSERT(!crawl_state.arena);
@@ -5707,7 +5742,7 @@ bool rot_player(int amount)
if (amount <= 0)
return (false);
- if (you.res_rotting() > 0)
+ if (player_res_rotting())
{
mpr("You feel terrible.");
return (false);
@@ -6973,6 +7008,11 @@ int player::res_poison() const
return (player_res_poison());
}
+int player::res_rotting() const
+{
+ return (player_res_rotting());
+}
+
int player::res_sticky_flame() const
{
return (player_res_sticky_flame());
@@ -6997,17 +7037,6 @@ int player::res_negative_energy() const
return (player_prot_life());
}
-int player::res_rotting() const
-{
- if (you.is_undead
- && (you.is_undead != US_SEMI_UNDEAD || you.hunger_state < HS_SATIATED))
- {
- return (1);
- }
-
- return (0);
-}
-
int player::res_torment() const
{
return (player_res_torment());
@@ -7143,7 +7172,7 @@ void player::drain_stat(int stat, int amount, actor *attacker)
bool player::rot(actor *who, int amount, int immediate, bool quiet)
{
- if (res_rotting() > 0 || amount <= 0)
+ if (player_res_rotting() || amount <= 0)
return (false);
if (immediate > 0)