summaryrefslogtreecommitdiff
path: root/src/game/game.hpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2018-04-21 16:45:40 +0200
committerPaweł Redman <pawel.redman@gmail.com>2018-04-21 16:45:40 +0200
commitf43f52903f29d010a72183de24ae8f56ab6702bb (patch)
tree3e4ef5c81644086891ad9fb78fce0cb7e5c1858e /src/game/game.hpp
parentb84b39f099e8a1f66fb95d371b60b1546fb3142a (diff)
Add the scientist.
Diffstat (limited to 'src/game/game.hpp')
-rw-r--r--src/game/game.hpp35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/game/game.hpp b/src/game/game.hpp
index 1cd61aa..908d73b 100644
--- a/src/game/game.hpp
+++ b/src/game/game.hpp
@@ -19,6 +19,7 @@ along with Minitrem. If not, see <http://www.gnu.org/licenses/>.
namespace game {
enum {
+ ET_NONE,
ET_UNIT,
ET_EFFECT,
ET_DECO,
@@ -71,6 +72,12 @@ namespace game {
} soldier_assets_t;
typedef struct {
+ render::oriented_sprite_4M_t body_idle, body_walking;
+ render::oriented_sprite_4M_t head_idle;
+ render::animated_texture_t avatar;
+ } scientist_assets_t;
+
+ typedef struct {
render::oriented_sprite_4M_t idle, walking;
render::animated_texture_t dead;
@@ -102,6 +109,7 @@ namespace game {
} deco_assets_t;
extern soldier_assets_t soldier;
+ extern scientist_assets_t scientist;
extern spider_assets_t spider;
extern nest_assets_t nest;
extern repl_assets_t repl;
@@ -182,6 +190,7 @@ namespace game {
typedef enum {
UNIT_SOLDIER,
+ UNIT_SCIENTIST,
UNIT_SPIDER,
UNIT_NEST,
UNIT_REPL
@@ -269,6 +278,30 @@ namespace game {
void on_death(void);
};
+ class unit_scientist_t : public unit_t {
+ public:
+ std::unique_ptr<fx_move_marker_t> move_marker;
+ std::unique_ptr<fx_aim_marker_t> aim_marker;
+
+ sf::Color selection_color;
+
+ void check_area(void);
+ void shoot(v2f_t from, v2f_t at, int damage);
+ void fire_shotgun(v2f_t aim);
+ void target_and_attack(void);
+
+ unit_scientist_t(game::state_t *game_);
+ ~unit_scientist_t(void) {};
+ void render_to(render::state_t *render);
+ void render_late_to(render::state_t *render);
+
+ void on_think(void);
+ void on_spawn(void) {};
+ void on_wake(void) {};
+ void on_damage(unit_t *attacker);
+ void on_death(void);
+ };
+
class unit_spider_t : public unit_t {
public:
unit_spider_t(game::state_t *game_);
@@ -314,7 +347,7 @@ namespace game {
void on_damage(unit_t *attacker);
void on_death(void);
- void activate(void);
+ void activate(unit_t::type_t type);
};
class effect_t : public game::entity_t {