summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-14 15:27:19 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-14 15:27:19 +0000
commitb50e6f09185bc0bcf40a9a2093ac8f8762886256 (patch)
tree7a18ba4a9533ec5b5938cee74406372ea36671fa /crawl-ref
parent85d6ca986365df62d39e76ded8065a0496089205 (diff)
downloadcrawl-ref-b50e6f09185bc0bcf40a9a2093ac8f8762886256.tar.gz
crawl-ref-b50e6f09185bc0bcf40a9a2093ac8f8762886256.zip
Print "You feel a bit more experienced." also if it was a pet kill as
long as it happened out of sight (which now includes invisibility and being submerged). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6925 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/delay.cc2
-rw-r--r--crawl-ref/source/monstuff.cc24
2 files changed, 19 insertions, 7 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index a060829b02..c88643d66b 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -1713,7 +1713,7 @@ static void _paranoid_option_disable( activity_interrupt_type ai,
const monsters* mon = static_cast<const monsters*>(at.data);
if (mon && !player_monster_visible(mon) && !mons_is_submerged(mon))
{
- // Now that autoprayer has been removed, so the vectors aren't
+ // Now that autoprayer has been removed the vectors aren't
// really needed anymore, but let's keep them "just in case".
std::vector<std::string> deactivatees;
std::vector<std::string> restart;
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 7ac60d1343..161f7269a0 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -440,6 +440,7 @@ static void _give_adjusted_experience(monsters *monster, killer_type killer,
const bool no_xp = monster->has_ench(ENCH_ABJ);
const bool already_got_half_xp = testbits(monster->flags, MF_GOT_HALF_XP);
+ bool need_xp_msg = false;
if (created_friendly || was_neutral || no_xp)
; // No experience if monster was created friendly or summoned.
else if (YOU_KILL(killer))
@@ -450,19 +451,30 @@ static void _give_adjusted_experience(monsters *monster, killer_type killer,
else
gain_exp( experience, exp_gain, avail_gain );
- // Give a message for monsters dying out of sight
- if (exp_gain > 0 && !mons_near(monster)
- && you.experience_level == old_lev)
- {
- mpr("You feel a bit more experienced.");
- }
+ if (old_lev == you.experience_level)
+ need_xp_msg = true;
}
else if (pet_kill && !already_got_half_xp)
+ {
+ int old_lev = you.experience_level;
gain_exp( experience / 2 + 1, exp_gain, avail_gain );
+ if (old_lev == you.experience_level)
+ need_xp_msg = true;
+ }
+
+ // Give a message for monsters dying out of sight.
+ if (need_xp_msg && exp_gain > 0
+ && (!mons_near(monster) || !you.can_see(monster)))
+ {
+ mpr("You feel a bit more experienced.");
+ }
+
if (MON_KILL(killer) && !no_xp)
+ {
_give_monster_experience( monster, killer_index, experience,
created_friendly );
+ }
}
static bool _is_pet_kill(killer_type killer, int i)