summaryrefslogtreecommitdiff
path: root/src/game/game.hpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-12-18 17:33:49 +0000
committerPaweł Redman <pawel.redman@gmail.com>2017-12-18 17:33:49 +0000
commitc6489d36f6de7464c555f04d5d4324f50fa6c51f (patch)
treefde3f3d3a0d720a328f8b74ac2d0d14a0d463f02 /src/game/game.hpp
parent41bebb262aa8f346ce6cdaefd854c9077ae84f97 (diff)
Start experimenting with fear.
Diffstat (limited to 'src/game/game.hpp')
-rw-r--r--src/game/game.hpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/game/game.hpp b/src/game/game.hpp
index 0bc2da2..aea381c 100644
--- a/src/game/game.hpp
+++ b/src/game/game.hpp
@@ -31,6 +31,7 @@ namespace game {
typedef struct {
render::oriented_sprite_4M_t head_idle, body_idle;
render::oriented_sprite_4M_t body_aiming, body_firing;
+ render::animated_texture_t body_panic;
render::oriented_sprite_4M2_t legs_idle, legs_walking;
render::animated_texture_t dead;
} soldier_assets_t;
@@ -77,6 +78,7 @@ namespace game {
SAY_BLOCKED,
SAY_READY,
SAY_MOVING,
+ SAY_PANIC,
UNIT_NAME_SPIDER,
UNIT_NAME_SOLDIER,
UNIT_NAME_NEST,
@@ -85,7 +87,10 @@ namespace game {
UNIT_MISS,
UNIT_CRITICAL_MISS,
UNIT_CRITICAL_HIT,
- UNIT_DAMAGE
+ UNIT_DAMAGE,
+ UNIT_SAVING_THROW_WILLPOWER,
+ UNIT_SAVING_THROW_SUCCESS,
+ UNIT_SAVING_THROW_FAILURE
} index_t;
std::string get(index_t index);
@@ -138,6 +143,8 @@ namespace game {
bool controllable = false;
struct {
+ world::cflags_t cflags;
+
bool moving = false;
v2f_t dst;
float angle = 0.0f;
@@ -150,7 +157,7 @@ namespace game {
} move;
bool keep_moving(double speed);
- bool start_moving(v2f_t dst, world::cflags_t cflags);
+ bool start_moving(v2f_t dst);
struct {
size_t armor_class;
@@ -177,13 +184,22 @@ namespace game {
double last_target_time = -INFINITY;
v2f_t last_target_x;
+ double next_fear_test = -INFINITY;
+ size_t willpower_bonus;
+ size_t fear_dc;
+
+ bool panic = false;
+ double panic_end;
+ double panic_turn;
+
+ void check_area(void);
+ void target_and_attack(void);
+
public:
unit_soldier_t(game::state_t *game_);
~unit_soldier_t(void) {};
void render_to(render::state_t *render);
- void target_and_attack(void);
-
void on_think(void);
void on_spawn(void) {};
void on_wake(void) {};