summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-28 08:47:30 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-28 08:47:30 +0000
commit20a6609453ee2b51c388c296516c1abc1beab1d2 (patch)
tree201d735a3a4d66471005cb763078a6c05056752c /crawl-ref/source/player.cc
parent7aed4c41d7fa0f9d70df56a82abbe69061e56269 (diff)
downloadcrawl-ref-20a6609453ee2b51c388c296516c1abc1beab1d2.tar.gz
crawl-ref-20a6609453ee2b51c388c296516c1abc1beab1d2.zip
Preliminary integration of Zooko's Xom patch (untested).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1489 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc32
1 files changed, 15 insertions, 17 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index b6eefa1aee..ccb9e67f32 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2792,9 +2792,8 @@ void level_change(void)
you.hp, you.hp_max, you.magic_points, you.max_magic_points);
take_note(Note(NOTE_XP_LEVEL_CHANGE, you.experience_level, 0, buf));
- if (you.religion == GOD_XOM)
- Xom_acts(true, you.experience_level, true);
-
+ xom_is_stimulated(16);
+
learned_something_new(TUT_NEW_LEVEL);
}
@@ -4221,10 +4220,10 @@ void contaminate_player(int change, bool statusOnly)
(change > 0) ? "more" : "less" );
}
-void poison_player( int amount, bool force )
+bool poison_player( int amount, bool force )
{
if ((!force && player_res_poison()) || amount <= 0)
- return;
+ return false;
const int old_value = you.poisoning;
you.poisoning += amount;
@@ -4238,6 +4237,7 @@ void poison_player( int amount, bool force )
mprf("You are %spoisoned.", (old_value > 0) ? "more " : "" );
learned_something_new(TUT_YOU_POISON);
}
+ return true;
}
void reduce_poison_player( int amount )
@@ -4280,6 +4280,8 @@ void confuse_player( int amount, bool resistable )
// XXX: which message channel for this message?
mprf("You are %sconfused.", (old_value > 0) ? "more " : "" );
learned_something_new(TUT_YOU_ENCHANTED);
+
+ xom_is_stimulated(you.conf - old_value);
}
}
@@ -4392,9 +4394,9 @@ void dec_haste_player( void )
}
}
-void disease_player( int amount )
+bool disease_player( int amount )
{
- you.sicken(amount);
+ return you.sicken(amount);
}
void dec_disease_player( void )
@@ -5111,7 +5113,7 @@ void player::blink()
void player::teleport(bool now, bool abyss_shift)
{
if (now)
- you_teleport2(true, abyss_shift);
+ you_teleport_now(true, abyss_shift);
else
you_teleport();
}
@@ -5127,12 +5129,6 @@ void player::hurt(const actor *agent, int amount)
ASSERT(false);
ouch(amount, 0, KILLED_BY_SOMETHING);
}
-
- if (religion == GOD_XOM && hp <= hp_max / 3
- && one_chance_in(10))
- {
- Xom_acts(true, experience_level, false);
- }
}
void player::drain_stat(int stat, int amount)
@@ -5196,16 +5192,18 @@ kill_category player::kill_alignment() const
return (KC_YOU);
}
-void player::sicken(int amount)
+bool player::sicken(int amount)
{
if (is_undead || amount <= 0)
- return;
+ return (false);
mpr( "You feel ill." );
const int tmp = disease + amount;
disease = (tmp > 210) ? 210 : tmp;
- learned_something_new(TUT_YOU_SICK);
+ learned_something_new(TUT_YOU_SICK);
+
+ return (true);
}
bool player::can_see_invisible() const