summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ouch.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-02 15:12:44 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-02 15:12:44 +0000
commit974b3abfbeb971f75382fe1e2c7837a4fc8e7d89 (patch)
tree8908758ca4b1ad4dcb8cbac169c15d6f1b7c3115 /crawl-ref/source/ouch.cc
parent6d11b49783c6d9c56851a09291f51bfa321d7694 (diff)
downloadcrawl-ref-974b3abfbeb971f75382fe1e2c7837a4fc8e7d89.tar.gz
crawl-ref-974b3abfbeb971f75382fe1e2c7837a4fc8e7d89.zip
Simplify further.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7081 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/ouch.cc')
-rw-r--r--crawl-ref/source/ouch.cc107
1 files changed, 53 insertions, 54 deletions
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];