1 /**
2  * @file
3  * @brief Player ghost and random Pandemonium demon handling.
4 **/
5 
6 #pragma once
7 
8 #include <vector>
9 
10 #include "enchant-type.h"
11 #include "enum.h"
12 #include "god-type.h"
13 #include "item-prop-enum.h"
14 #include "job-type.h"
15 #include "mon-enum.h"
16 #include "mutant-beast.h"
17 #include "species-type.h"
18 
19 using std::vector;
20 
21 #define MIRRORED_GHOST_KEY "mirrored_ghost"
22 
23 class ghost_demon
24 {
25 public:
26     string name;
27 
28     species_type species;
29     job_type job;
30     god_type religion;
31     skill_type best_skill;
32     short best_skill_level;
33     short xl;
34 
35     short max_hp, ev, ac, damage, speed, move_energy;
36     bool see_invis, flies;
37     brand_type brand;
38     attack_type att_type;
39     attack_flavour att_flav;
40     resists_t resists;
41     enchant_type cloud_ring_ench;
42 
43     colour_t colour;
44 
45     monster_spells spells;
46 
47 public:
48     ghost_demon();
49     bool has_spells() const;
50     void reset();
51     void init_pandemonium_lord();
52     void init_player_ghost();
53     void init_ugly_thing(bool very_ugly, bool only_mutate = false,
54                          colour_t force_colour = BLACK);
55     void init_dancing_weapon(const item_def& weapon, int power);
56     void init_spectral_weapon(const item_def& weapon);
57 
58     void ugly_thing_to_very_ugly_thing();
59 
60 
61 public:
62     static const vector<ghost_demon> find_ghosts(bool include_player=true);
63     static bool ghost_eligible();
64 
65 
66 private:
67     static void find_extra_ghosts(vector<ghost_demon> &ghosts);
68     static void find_transiting_ghosts(vector<ghost_demon> &gs);
69     static void announce_ghost(const ghost_demon &g);
70 
71 private:
72     void add_spells();
73     spell_type translate_spell(spell_type playerspell) const;
74     void ugly_thing_add_resistance(bool very_ugly,
75                                    attack_flavour u_att_flav);
76     void set_pan_lord_special_attack();
77     void set_pan_lord_cloud_ring();
78 };
79 
80 bool debug_check_ghosts(vector<ghost_demon> &ghosts);
81 bool debug_check_ghost(const ghost_demon &ghost);
82 int ghost_level_to_rank(const int xl);
83 int ghost_rank_to_level(const int rank);
84