diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-09-25 17:30:31 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-09-25 17:30:31 +0000 |
commit | 57f3e71ae59d5e4830bdf787d9f2d5e9d5fe8fc8 (patch) | |
tree | 835d7e23d1c0d27e935015288effd8115a949cf0 /crawl-ref/source/ouch.cc | |
parent | 1f9e38751c81744f2e8d4ffb1aea7f3870ba9d5b (diff) | |
download | crawl-ref-57f3e71ae59d5e4830bdf787d9f2d5e9d5fe8fc8.tar.gz crawl-ref-57f3e71ae59d5e4830bdf787d9f2d5e9d5fe8fc8.zip |
In ouch(), use NON_MONSTER instead of 0 as the index for non-monster
attacks, so as to avoid overlap with the first monster on the level.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6985 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/ouch.cc')
-rw-r--r-- | crawl-ref/source/ouch.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 145ee6d316..1556b49e95 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -271,7 +271,7 @@ void splash_with_acid( char acid_strength ) if (post_res_dam < dam) canned_msg(MSG_YOU_RESIST); - ouch( post_res_dam, 0, KILLED_BY_ACID ); + ouch(post_res_dam, NON_MONSTER, KILLED_BY_ACID); } } } // end splash_with_acid() @@ -286,7 +286,7 @@ void weapon_acid( char acid_strength ) if (hand_thing == -1) { msg::stream << "Your " << your_hand(true) << " burn!" << std::endl; - ouch( roll_dice( 1, acid_strength ), 0, KILLED_BY_ACID ); + ouch(roll_dice(1, acid_strength), NON_MONSTER, KILLED_BY_ACID); } else if (x_chance_in_y(acid_strength + 1, 20)) item_corrode( hand_thing ); @@ -621,7 +621,7 @@ void lose_level() // must die straightaway. if (you.experience_level == 1) { - ouch(INSTANT_DEATH, 0, KILLED_BY_DRAINING); + ouch(INSTANT_DEATH, NON_MONSTER, KILLED_BY_DRAINING); // Return in case death was canceled via wizard mode return; } @@ -634,7 +634,7 @@ void lose_level() // Constant value to avoid grape jelly trick... see level_change() for // where these HPs and MPs are given back. -- bwr - ouch( 4, 0, KILLED_BY_DRAINING ); + ouch(4, NON_MONSTER, KILLED_BY_DRAINING); dec_max_hp(4); dec_mp(1); @@ -667,7 +667,7 @@ void drain_exp(bool announce_full) if (you.experience == 0) { - ouch(INSTANT_DEATH, 0, KILLED_BY_DRAINING); + ouch(INSTANT_DEATH, NON_MONSTER, KILLED_BY_DRAINING); // Return in case death was escaped via wizard mode. return; } @@ -736,7 +736,7 @@ static void _xom_checks_damage(kill_method_type death_type, return; } else if (death_type != KILLED_BY_MONSTER && death_type != KILLED_BY_BEAM - || death_source < 0 || death_source >= MAX_MONSTERS) + || invalid_monster_index(death_source)) { return; } @@ -790,9 +790,9 @@ static void _xom_checks_damage(kill_method_type death_type, xom_is_stimulated(amusementvalue); } -// death_source should be set to zero for non-monsters. {dlb} -void ouch( int dam, int death_source, kill_method_type death_type, - const char *aux, bool see_source ) +// death_source should be set to NON_MONSTER for non-monsters. {dlb} +void ouch(int dam, int death_source, kill_method_type death_type, + const char *aux, bool see_source) { ait_hp_loss hpl(dam, death_type); interrupt_activity( AI_HP_LOSS, &hpl ); @@ -806,7 +806,7 @@ void ouch( int dam, int death_source, kill_method_type death_type, return; } - if (dam > -9000) // that is, a "death" caused by hp loss {dlb} + if (dam != INSTANT_DEATH) // that is, a "death" caused by hp loss {dlb} { if (dam >= you.hp && god_protects_from_harm(you.religion)) { @@ -850,7 +850,7 @@ void ouch( int dam, int death_source, kill_method_type death_type, if (you.religion == GOD_YREDELEMNUL && you.duration[DUR_PRAYER] - && death_source != 0 && !invalid_monster_index(death_source)) + && !invalid_monster_index(death_source)) { yred_mirror_injury(&menv[death_source], dam); } |