summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/acr.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-24 22:38:41 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-24 22:38:41 +0000
commit9304ae6cc3684377e50e6fcbc3d13e80fa092b6a (patch)
treeb0b15e708dbca7e6455bf0e6e3726b75037f937b /crawl-ref/source/acr.cc
parent56b6c4f46ec7516396c1473e9d5bfef7ea79765f (diff)
downloadcrawl-ref-9304ae6cc3684377e50e6fcbc3d13e80fa092b6a.tar.gz
crawl-ref-9304ae6cc3684377e50e6fcbc3d13e80fa092b6a.zip
Cleaned up shop-handling code considerably.
Instead of shops passing around global id_arr arrays, shops use the newly added third argument to item_def::name() which indicates whether to override item ID status. This means that the shop ID SIGHUP protection is now unnecessary; it's been removed. Hopefully I caught all the places where the stash tracker tries to get item names and fixed them, but I might have missed something. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1359 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/acr.cc')
-rw-r--r--crawl-ref/source/acr.cc36
1 files changed, 21 insertions, 15 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 6ccafa14fd..fe5de67155 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -55,6 +55,7 @@
#include <string.h>
#include <fcntl.h>
#include <stdio.h>
+#include <sstream>
#ifdef DOS
#include <dos.h>
@@ -309,24 +310,29 @@ int main( int argc, char *argv[] )
Options.tut_just_triggered = true;
// print stats and everything
prep_input();
- char ch = 'x';
- mpr("Press any key to start the tutorial intro, or Escape to skip it.",
- MSGCH_TUTORIAL);
+ int ch = 'x';
+ mpr("Press any key to start the tutorial intro, "
+ "or Escape to skip it.", MSGCH_TUTORIAL);
ch = c_getch();
-
+
if (ch != ESCAPE)
tut_starting_screen();
- }
+ }
+
+ std::ostringstream notestr;
+ notestr << you.your_name << ", the "
+ << species_name(you.species,you.experience_level) << " "
+ << you.class_name
+ << ", began the quest for the Orb.";
+ take_note(Note(NOTE_USER_NOTE, 0, 0, notestr.str().c_str()));
+
+ notestr.str("");
+ notestr.clear();
- snprintf(info, INFO_SIZE,
- "%s, the %s %s, began the quest for the Orb.",
- you.your_name,
- species_name(you.species,you.experience_level),
- you.class_name);
- take_note(Note(NOTE_USER_NOTE, 0, 0, info));
- snprintf(info, INFO_SIZE, "HP: %d/%d MP: %d/%d",
- you.hp, you.hp_max, you.magic_points, you.max_magic_points);
- take_note(Note(NOTE_XP_LEVEL_CHANGE, you.experience_level, 0, info));
+ notestr << "HP: " << you.hp << "/" << you.hp_max
+ << " MP: " << you.magic_points << "/" << you.max_magic_points;
+ take_note(Note(NOTE_XP_LEVEL_CHANGE, you.experience_level, 0,
+ notestr.str().c_str()));
}
while (true)
@@ -2815,7 +2821,7 @@ static bool initialise(void)
you.colour = LIGHTGREY;
seed_rng();
- clear_ids(); // in itemname.cc
+ get_typeid_array().init(ID_UNKNOWN_TYPE);
init_char_table(Options.char_set);
init_feature_table();