From 974b3abfbeb971f75382fe1e2c7837a4fc8e7d89 Mon Sep 17 00:00:00 2001 From: dolorous Date: Thu, 2 Oct 2008 15:12:44 +0000 Subject: Simplify further. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7081 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/ouch.cc | 107 +++++++++++++++++++++++------------------------ 1 file changed, 53 insertions(+), 54 deletions(-) (limited to 'crawl-ref/source/ouch.cc') diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index e9ef6a4da9..120b0f316f 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -723,80 +723,79 @@ void drain_exp(bool announce_full) static void _xom_checks_damage(kill_method_type death_type, int dam, int death_source) { - if (death_type == KILLED_BY_TARGETTING) + if (you.religion == GOD_XOM) { - // Xom thinks the player hurting him/herself is funny. - xom_is_stimulated(255 * dam / (dam + you.hp)); - return; - } - else if (death_type == KILLED_BY_FALLING_DOWN_STAIRS) - { - // Xom thinks falling down the stairs is hilarious. - xom_is_stimulated(255); - return; - } - else if (death_type != KILLED_BY_MONSTER && death_type != KILLED_BY_BEAM - || invalid_monster_index(death_source)) - { - return; - } - - int amusementvalue = 1; - - const monsters *monster = &menv[death_source]; + if (death_type == KILLED_BY_TARGETTING) + { + // Xom thinks the player hurting him/herself is funny. + xom_is_stimulated(255 * dam / (dam + you.hp)); + return; + } + else if (death_type == KILLED_BY_FALLING_DOWN_STAIRS) + { + // Xom thinks falling down the stairs is hilarious. + xom_is_stimulated(255); + return; + } + else if (death_type != KILLED_BY_MONSTER + && death_type != KILLED_BY_BEAM + || invalid_monster_index(death_source)) + { + return; + } - if (!monster->alive()) - return; + int amusementvalue = 1; + const monsters *monster = &menv[death_source]; - if (mons_wont_attack(monster)) - { - // Xom thinks collateral damage is funny. - xom_is_stimulated(255 * dam / (dam + you.hp)); - return; - } + if (!monster->alive()) + return; - int leveldif = monster->hit_dice - you.experience_level; + if (mons_wont_attack(monster)) + { + // Xom thinks collateral damage is funny. + xom_is_stimulated(255 * dam / (dam + you.hp)); + return; + } - if (leveldif == 0) - leveldif = 1; + int leveldif = monster->hit_dice - you.experience_level; + if (leveldif == 0) + leveldif = 1; - // Note that Xom is amused when you are significantly hurt by a - // creature of higher level than yourself, as well as by a creature - // of lower level than yourself. - amusementvalue += leveldif * leveldif * dam; + // Note that Xom is amused when you are significantly hurt by a + // creature of higher level than yourself, as well as by a + // creature of lower level than yourself. + amusementvalue += leveldif * leveldif * dam; - if (!player_monster_visible(monster)) - amusementvalue += 10; + if (!player_monster_visible(monster)) + amusementvalue += 10; - if (monster->speed < (int) player_movement_speed()) - amusementvalue += 8; + if (monster->speed < (int)player_movement_speed()) + amusementvalue += 8; - if (death_type != KILLED_BY_BEAM) - { - if (you.skills[SK_THROWING] <= (you.experience_level / 4)) + if (death_type != KILLED_BY_BEAM + && you.skills[SK_THROWING] <= (you.experience_level / 4)) + { amusementvalue += 2; - } - else - { - if (you.skills[SK_FIGHTING] <= (you.experience_level / 4)) + } + else if (you.skills[SK_FIGHTING] <= (you.experience_level / 4)) amusementvalue += 2; - } - if (player_in_a_dangerous_place()) - amusementvalue += 2; + if (player_in_a_dangerous_place()) + amusementvalue += 2; - amusementvalue /= (you.hp > 0) ? you.hp : 1; + amusementvalue /= (you.hp > 0) ? you.hp : 1; - xom_is_stimulated(amusementvalue); + xom_is_stimulated(amusementvalue); + } } static void _yred_mirrors_injury(int dam, int death_source) { - if (dam <= 0 || invalid_monster_index(death_source)) - return; - if (yred_injury_mirror()) { + if (dam <= 0 || invalid_monster_index(death_source)) + return; + simple_god_message(" mirrors your injury!"); monsters *mon = &menv[death_source]; -- cgit v1.2.3-54-g00ecf