summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ouch.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-21 15:16:15 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-21 15:16:15 +0000
commita0fc101bb8397b81ccd9cf5c1137764e14c57e89 (patch)
tree43de33e541d4274cc6787ad53571730ca8f91224 /crawl-ref/source/ouch.cc
parentd5efde9cb99ea1e17d8e7f80e865dd1cacc37149 (diff)
downloadcrawl-ref-a0fc101bb8397b81ccd9cf5c1137764e14c57e89.tar.gz
crawl-ref-a0fc101bb8397b81ccd9cf5c1137764e14c57e89.zip
Fixed note taking (NOTE_HP_CHANGE) for invisible monsters
(bug 1786776) and in general (wasn't working). Also tweaked tutorial message on burning spellbooks (Bug 1799350). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2174 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/ouch.cc')
-rw-r--r--crawl-ref/source/ouch.cc31
1 files changed, 19 insertions, 12 deletions
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index ed81b0e3bf..b388b4e500 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -732,7 +732,7 @@ static void xom_checks_damage(kill_method_type death_type,
// 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 )
+ const char *aux, bool see_source )
{
ait_hp_loss hpl(dam, death_type);
interrupt_activity( AI_HP_LOSS, &hpl );
@@ -797,18 +797,25 @@ void ouch( int dam, int death_source, kill_method_type death_type,
}
xom_checks_damage(death_type, dam, death_source);
- return;
- }
-
- take_note(
- Note(
- NOTE_HP_CHANGE,
- you.hp,
- you.hp_max,
- scorefile_entry(dam, death_source, death_type, aux, true)
- .death_description(scorefile_entry::DDV_TERSE)
- .c_str()) );
+ // for note taking
+ std::string damage_desc = "";
+ if (!see_source)
+ {
+ snprintf(info, INFO_SIZE, "something (%d)", dam);
+ damage_desc = info;
+ }
+ else
+ {
+ damage_desc = scorefile_entry(dam, death_source, death_type, aux, true)
+ .death_description(scorefile_entry::DDV_TERSE);
+ }
+
+ take_note(
+ Note(NOTE_HP_CHANGE, you.hp, you.hp_max, damage_desc.c_str()) );
+
+ return;
+ } // else hp <= 0
}
#ifdef WIZARD