123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- #ifndef __SPECIES_H
- #define __SPECIES_H
- #include <string>
- struct Species {
- enum class habitat_t : unsigned int {
- walk,
- floor,
- water,
- corner,
- shoreline
- };
- enum class ai_t : unsigned int {
- none,
- seek,
- random,
- seek_awake,
- magic_none,
- magic_none_awake,
- suicide,
- magic_random
- };
- enum class idle_ai_t : unsigned int {
- none,
- random
- };
- enum class move_t : unsigned int {
- walk,
- floor,
- water,
- corner,
- shoreline
- };
- tag_t tag;
- std::string name;
- skins skin;
- unsigned int level;
- unsigned int count;
- int true_level;
- tag_t genus;
- std::string descr;
- habitat_t habitat;
- ai_t ai;
- idle_ai_t idle_ai;
- move_t move;
- pstats::stats_t stats;
- double digging;
-
- unsigned int range;
- mean_deviation_t clumpsize;
- struct companion_t {
- tag_t tag;
- double chance;
- companion_t(tag_t t = tag_t(), double c = 0.0) : tag(t), chance(c) {}
- };
- std::vector<companion_t> companion;
- struct drop_t {
- tag_t tag;
- double chance;
- unsigned int level;
- tag_t damage_type;
- drop_t(tag_t t = tag_t(), double c = 0.0, unsigned int l = 0) : tag(t), chance(c), level(0) {}
- };
- std::vector<drop_t> drop;
- damage::attacks_t attacks;
- damage::defenses_t defenses;
- struct cloud_t {
- double chance;
- tag_t terraintag;
- unsigned int radius;
- unsigned int turns;
- std::string name;
- cloud_t() : chance(0), radius(0), turns(0) {}
- };
- std::vector<cloud_t> cast_cloud;
- struct summon_t {
- double chance;
- tag_t speciestag;
- unsigned int turns;
- std::string msg;
- summon_t() : chance(0), turns(0) {}
- };
- std::vector<summon_t> summon;
- tag_t death_summon;
- struct spawn_t {
- double chance;
- unsigned int level;
- unsigned int turns;
- std::string msg;
- spawn_t() : chance(0), turns(0) {}
- };
- std::vector<spawn_t> spawns;
- struct flags_t {
- bool undead;
- bool animal;
- bool magic;
- bool plant;
- bool robot;
- bool terrain_immune;
- bool eyeless;
- bool cosmic;
- bool stealthy;
- bool player;
-
- flags_t() :
- undead(false), animal(false), magic(false), plant(false), robot(false),
- terrain_immune(false), eyeless(false), cosmic(false), stealthy(false),
- player(false)
- {}
- };
- flags_t flags;
- struct blast_t {
- double chance;
- unsigned int radius;
- unsigned int range;
- unsigned int turns;
- damage::attacks_t attacks;
- std::string name;
- blast_t() : chance(0), radius(0), range(0), turns(0) {}
- };
- std::vector<blast_t> blast;
- struct trail_t {
- tag_t terrain;
- tag_t stat;
- mean_deviation_t cost;
- };
- trail_t trail;
- tag_t steal;
- struct morph_t {
- tag_t species;
- double chance;
- morph_t() : chance(0) {}
- };
- morph_t morph;
- std::map<tag_t, double> inc_stat;
- tag_t ally;
- struct cost_t {
- tag_t stat;
- double cost;
- cost_t() : cost(0) {}
- };
- cost_t magic_cost;
- Species() : level(0), count(0), true_level(-1), habitat(habitat_t::walk), ai(ai_t::none), idle_ai(idle_ai_t::none),
- move(move_t::walk), digging(0), range(0), clumpsize(), flags() {}
- unsigned int get_computed_level() const {
- return (true_level >= 0 ? true_level : level);
- }
- };
- #endif
|