00001
00002
00003
00004
00005
00006
00007 #ifndef NOTES_H
00008 #define NOTES_H
00009
00010 #include <string>
00011 #include <vector>
00012 #include <stdio.h>
00013
00014 #define MAX_NOTE_PLACE_LEN 7
00015
00016 class reader;
00017 class writer;
00018
00019 enum NOTE_TYPES
00020 {
00021 NOTE_HP_CHANGE = 0,
00022 NOTE_MAXHP_CHANGE,
00023 NOTE_MP_CHANGE,
00024 NOTE_MAXMP_CHANGE,
00025 NOTE_XP_LEVEL_CHANGE,
00026 NOTE_DUNGEON_LEVEL_CHANGE,
00027 NOTE_LEARN_SPELL,
00028 NOTE_GET_GOD,
00029 NOTE_GOD_GIFT,
00030 NOTE_GOD_POWER,
00031 NOTE_GET_MUTATION,
00032 NOTE_LOSE_MUTATION,
00033 NOTE_ID_ITEM,
00034 NOTE_GET_ITEM,
00035 NOTE_GAIN_SKILL,
00036 NOTE_LOSE_SKILL,
00037 NOTE_SEEN_MONSTER,
00038 NOTE_KILL_MONSTER,
00039 NOTE_POLY_MONSTER,
00040 NOTE_USER_NOTE,
00041 NOTE_MESSAGE,
00042 NOTE_LOSE_GOD,
00043 NOTE_PENANCE,
00044 NOTE_MOLLIFY_GOD,
00045 NOTE_DEATH,
00046 NOTE_BUY_ITEM,
00047 NOTE_DONATE_MONEY,
00048 NOTE_SEEN_FEAT,
00049 NOTE_XOM_EFFECT,
00050 NOTE_XOM_REVIVAL,
00051 NOTE_NUM_TYPES
00052 };
00053
00054 struct Note
00055 {
00056 Note();
00057 Note(NOTE_TYPES t, int f = 0, int s = 0, const char* n = 0,
00058 const char* d = 0);
00059 void save(writer& outf) const;
00060 void load(reader& inf);
00061 std::string describe(bool when = true, bool where = true,
00062 bool what = true) const;
00063 void check_milestone() const;
00064
00065 NOTE_TYPES type;
00066 int first, second;
00067 long turn;
00068 unsigned short packed_place;
00069 std::string place_abbrev;
00070 std::string name;
00071 std::string desc;
00072 };
00073
00074 extern std::vector<Note> note_list;
00075 void activate_notes(bool active);
00076 bool notes_are_active();
00077 void take_note(const Note& note, bool force = false);
00078 void save_notes(writer&);
00079 void load_notes(reader&);
00080 void make_user_note();
00081
00082 #endif