diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-14 10:15:25 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-14 10:15:25 +0000 |
commit | 014ab7e33a12d7ac74988514e88c6542005f57c8 (patch) | |
tree | 67709657924e92a4c0f7b9033db4b43dc20f4a6d | |
parent | 0a14dac08b6339e154870297c2035567a5197a6a (diff) | |
download | crawl-ref-014ab7e33a12d7ac74988514e88c6542005f57c8.tar.gz crawl-ref-014ab7e33a12d7ac74988514e88c6542005f57c8.zip |
Fix bug where dumping the character to file would turn off note taking for
the rest of the game session.
Make a note if the user starts the game in wizard mode, when wizard mode
is entered, and when death is escaped via wizard mode.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5812 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/acr.cc | 13 | ||||
-rw-r--r-- | crawl-ref/source/ouch.cc | 19 | ||||
-rw-r--r-- | crawl-ref/source/stash.cc | 6 |
3 files changed, 28 insertions, 10 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index d108bbaf07..7f640c8d34 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -392,6 +392,17 @@ static void _take_starting_note() notestr.str(""); notestr.clear(); +#ifdef WIZARD + if (you.wizard) + { + notestr << "You started the game in wizard mode."; + take_note(Note(NOTE_MESSAGE, 0, 0, notestr.str().c_str())); + + notestr.str(""); + notestr.clear(); + } +#endif + notestr << "HP: " << you.hp << "/" << you.hp_max << " MP: " << you.magic_points << "/" << you.max_magic_points; @@ -449,6 +460,8 @@ static void _handle_wizard_command( void ) if (!yesno( "Do you really want to enter wizard mode?", false, 'n' )) return; + take_note(Note(NOTE_MESSAGE, 0, 0, "Entered wizard mode.")); + you.wizard = true; redraw_screen(); diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index cadb9b8372..e722c8169f 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -875,6 +875,9 @@ void ouch( int dam, int death_source, kill_method_type death_type, } // else hp <= 0 } + // construct scorefile entry. + scorefile_entry se(dam, death_source, death_type, aux); + #ifdef WIZARD if (death_type != KILLED_BY_QUITTING && death_type != KILLED_BY_WINNING @@ -882,6 +885,8 @@ void ouch( int dam, int death_source, kill_method_type death_type, { if (you.wizard) { + const std::string death_desc + = se.death_description(scorefile_entry::DDV_VERBOSE); #ifdef USE_OPTIONAL_WIZARD_DEATH #if DEBUG_DIAGNOSTICS @@ -890,6 +895,8 @@ void ouch( int dam, int death_source, kill_method_type death_type, if (!yesno("Die?", false, 'n')) { + take_note(Note( NOTE_DEATH, you.hp, you.hp_max, + death_desc.c_str()), true); set_hp(you.hp_max, false); return; } @@ -897,6 +904,8 @@ void ouch( int dam, int death_source, kill_method_type death_type, mpr("Since you're a debugger, I'll let you live."); mpr("Be more careful next time, okay?"); + take_note(Note( NOTE_DEATH, you.hp, you.hp_max, + death_desc.c_str()), true); set_hp(you.hp_max, false); return; #endif // USE_OPTIONAL_WIZARD_DEATH @@ -909,17 +918,13 @@ void ouch( int dam, int death_source, kill_method_type death_type, crawl_state.need_save = false; crawl_state.updating_scores = true; - take_note( - Note( NOTE_DEATH, you.hp, you.hp_max, - scorefile_entry(dam, death_source, death_type, aux) - .death_description(scorefile_entry::DDV_NORMAL).c_str()), true ); + take_note(Note( NOTE_DEATH, you.hp, you.hp_max, + se.death_description(scorefile_entry::DDV_NORMAL).c_str()), + true); // prevent bogus notes activate_notes(false); - // construct scorefile entry. - scorefile_entry se(dam, death_source, death_type, aux); - #ifdef SCORE_WIZARD_CHARACTERS // add this highscore to the score file. hiscores_new_entry(se); diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc index 7bfcd18ba8..1172c4abd0 100644 --- a/crawl-ref/source/stash.cc +++ b/crawl-ref/source/stash.cc @@ -644,12 +644,12 @@ void Stash::write(std::ostream &os, int refx, int refy, std::string place, bool identify) const { - bool note_status = notes_are_active(); - activate_notes(false); - if (!enabled || (items.size() == 0 && verified)) return; + bool note_status = notes_are_active(); + activate_notes(false); + os << "(" << ((int) x - refx) << ", " << ((int) y - refy) << (place.length()? ", " + place : "") << ")" |