diff options
author | jacopograndi <jak.sk8@hotmail.it> | 2021-09-02 10:13:25 +0200 |
---|---|---|
committer | jacopograndi <jak.sk8@hotmail.it> | 2021-09-02 10:13:57 +0200 |
commit | c298eb988874bc2cf3adb39c2532419ec76a24bc (patch) | |
tree | 76e888a3f9c5c789cb0579e490901584c1357897 /game/gst.h | |
parent | 8af1284654a4a5d454a559eca371bf0ac3c79786 (diff) |
all imp sprites + train problems solved
Diffstat (limited to 'game/gst.h')
-rw-r--r-- | game/gst.h | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -7,6 +7,8 @@ #include <vector> #include <functional> +#include <random> // just for picking market trains + #include "ground.h" #include "entity.h" #include "tile.h" @@ -23,13 +25,16 @@ class Bonus { public: Bonus(float amt, int id, bool atk) : amt(amt), id(id), atk(atk) {} float amt; int id; bool atk; - enum Id { ground, type, ability, tech }; + enum Id { ground, type, ability, tech, veteran, on_bld, adjacency }; std::string id_string () { switch (id) { case ground: return "Ground"; case type: return "Class"; case ability: return "Ability"; case tech: return "Tech"; + case veteran: return "Veteran"; + case on_bld: return "On Building"; + case adjacency: return "Adjacency"; } } }; @@ -42,8 +47,9 @@ class BattleResult { }; class Gst { + private: std::default_random_engine engine = std::default_random_engine{}; public: - Gst(int sx, int sy) : ground(sx, sy) {} + Gst(int sx, int sy) : ground(sx, sy) { } std::vector<Tech> techs; std::vector<Ability> abilities; @@ -63,6 +69,7 @@ class Gst { std::vector<float> get_cost (EntityInfo *info, Player &player); float get_trade_rate (Player &player); + int get_vet_level (Entity &ent); float get_type_bonus (Entity &atk, Entity &def); std::vector<Bonus> get_bonuses (Entity &atk, Entity &def); float get_damage (Entity &atk, Entity &def); @@ -73,10 +80,10 @@ class Gst { void clear_dead(); int get_range(Entity &ent); + std::vector<int> get_possible_trains (Entity &ent); std::vector<int> get_possible_builds (Entity &ent); bool check_req_build (Entity &ent, EntityInfo *info); - bool check_req_train (Entity &ent, EntityInfo *info); bool check_req_tech (Tech *tech, Player &player); bool check_req_level (Player &player); bool check_obstructed (Entity &ent); |