00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef GHOST_H
00010 #define GHOST_H
00011
00012 #include "enum.h"
00013 #include "itemprop.h"
00014 #include "mon-enum.h"
00015 #include "mon_resist_def.h"
00016
00017 mon_attack_flavour ugly_thing_colour_to_flavour(uint8_t u_colour);
00018 mon_resist_def ugly_thing_resists(bool very_ugly, mon_attack_flavour u_att_flav);
00019
00020 #ifdef USE_TILE
00021 int tile_offset_for_labrat_colour(uint8_t l_colour);
00022 #endif
00023 std::string adjective_for_labrat_colour(uint8_t l_colour);
00024 uint8_t colour_for_labrat_adjective(std::string adjective);
00025
00026 class ghost_demon
00027 {
00028 public:
00029 std::string name;
00030
00031 species_type species;
00032 job_type job;
00033 god_type religion;
00034 skill_type best_skill;
00035 short best_skill_level;
00036 short xl;
00037
00038 short max_hp, ev, ac, damage, speed;
00039 bool see_invis;
00040 brand_type brand;
00041 mon_attack_type att_type;
00042 mon_attack_flavour att_flav;
00043 mon_resist_def resists;
00044
00045 bool spellcaster, cycle_colours;
00046 uint8_t colour;
00047 flight_type fly;
00048
00049 monster_spells spells;
00050
00051 public:
00052 ghost_demon();
00053 void reset();
00054 void init_random_demon();
00055 void init_player_ghost();
00056 void init_ugly_thing(bool very_ugly, bool only_mutate = false,
00057 uint8_t force_colour = BLACK);
00058 void init_dancing_weapon(const item_def& weapon, int power);
00059 void init_labrat (uint8_t force_colour = BLACK);
00060 void ugly_thing_to_very_ugly_thing();
00061
00062 public:
00063 static std::vector<ghost_demon> find_ghosts();
00064
00065 private:
00066 static int n_extra_ghosts();
00067 static void find_extra_ghosts(std::vector<ghost_demon> &ghosts, int n);
00068 static void find_transiting_ghosts(std::vector<ghost_demon> &gs, int n);
00069 static void announce_ghost(const ghost_demon &g);
00070
00071 private:
00072 void add_spells();
00073 spell_type translate_spell(spell_type playerspell) const;
00074 void ugly_thing_add_resistance(bool very_ugly,
00075 mon_attack_flavour u_att_flav);
00076 };
00077
00078 bool debug_check_ghosts();
00079 int ghost_level_to_rank(const int xl);
00080
00081 extern std::vector<ghost_demon> ghosts;
00082
00083 #endif