summaryrefslogtreecommitdiff
path: root/src/game/game.hpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2018-04-01 15:03:23 +0200
committerPaweł Redman <pawel.redman@gmail.com>2018-04-01 15:04:02 +0200
commit30c5c419aedd0e5aae92be6e0eee83f0b6690c6e (patch)
treef0e37219c6bfd88e6fab44fbfc6319bab650eeb8 /src/game/game.hpp
parent020e91ca69f35329eae518f3fe92afba2e117d06 (diff)
Add the replicator (not finished).
Placeholder sounds from Tremulous, as usual.
Diffstat (limited to 'src/game/game.hpp')
-rw-r--r--src/game/game.hpp40
1 files changed, 28 insertions, 12 deletions
diff --git a/src/game/game.hpp b/src/game/game.hpp
index 29b3d3b..5cf4494 100644
--- a/src/game/game.hpp
+++ b/src/game/game.hpp
@@ -60,9 +60,9 @@ namespace game {
render::oriented_sprite_4M_t head_idle, body_idle;
render::oriented_sprite_4M_t body_aiming, body_firing;
render::oriented_sprite_4M2_t legs_idle, legs_walking;
- render::animated_texture_t dead;
+ render::animated_texture_t dead, gibbing;
- audio::sound_t fire, step_stone, step_dirt;
+ audio::sound_t fire, step_stone, step_dirt, gib_sound;
} soldier_assets_t;
typedef struct {
@@ -75,6 +75,11 @@ namespace game {
} nest_assets_t;
typedef struct {
+ render::animated_texture_t idle, dead;
+ audio::sound_t sound;
+ } repl_assets_t;
+
+ typedef struct {
render::animated_texture_t blood, flash;
} fx_assets_t;
@@ -87,6 +92,7 @@ namespace game {
extern soldier_assets_t soldier;
extern spider_assets_t spider;
extern nest_assets_t nest;
+ extern repl_assets_t repl;
extern fx_assets_t fx;
extern deco_assets_t deco;
extern audio::ambient_t ambients[AMBIENT_COUNT];
@@ -109,19 +115,15 @@ namespace game {
UNPAUSED,
FOLLOWING_ON,
FOLLOWING_OFF,
- SAY_GROUP,
SAY_NO_PATH,
SAY_READY,
- SAY_READY_GROUP,
SAY_MOVING,
- SAY_MOVING_GROUP,
SAY_STOPPING,
- SAY_STOPPING_GROUP,
SAY_FIRING,
- SAY_FIRING_GROUP,
UNIT_NAME_SPIDER,
UNIT_NAME_SOLDIER,
UNIT_NAME_NEST,
+ UNIT_NAME_REPL,
UNIT_DEATH
} index_t;
@@ -167,9 +169,11 @@ namespace game {
typedef enum {
UNIT_SOLDIER,
UNIT_SPIDER,
- UNIT_NEST
+ UNIT_NEST,
+ UNIT_REPL
} type_t;
+ game::state_t *game;
type_t type;
std::string name;
@@ -214,9 +218,7 @@ namespace game {
};
class unit_soldier_t : public unit_t {
- friend state_t;
-
- protected:
+ public:
double last_target_time = -INFINITY;
v2f_t last_target_x;
@@ -231,7 +233,7 @@ namespace game {
void shoot(v2f_t aim);
void target_and_attack(void);
- public:
+
unit_soldier_t(game::state_t *game_);
~unit_soldier_t(void) {};
void render_to(render::state_t *render);
@@ -273,6 +275,20 @@ namespace game {
void on_wake(void) {};
};
+ class unit_repl_t : public unit_t {
+ public:
+ unit_repl_t(game::state_t *game_);
+ ~unit_repl_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_death(void);
+ void on_wake(void) {};
+ void activate(void);
+ };
+
class effect_t : public game::entity_t {
public:
double ttl = +INFINITY;