summaryrefslogtreecommitdiff
path: root/jouer.c
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-01-10 00:52:31 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-01-10 00:52:31 +0100
commita1f75a644e0119fa6e31b0a0c852b71f6fc28410 (patch)
treedd7d67f3e527f9a25168f53c7c1be4975a8844e3 /jouer.c
parent30842cc79c0a3e3566e9da61f2499fa1342c6d52 (diff)
added "cyanmure" magic
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'jouer.c')
-rw-r--r--jouer.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/jouer.c b/jouer.c
index a5f20ad..29365f3 100644
--- a/jouer.c
+++ b/jouer.c
@@ -5,6 +5,8 @@
#include "ai.h"
#include "blits.h"
+#include "character.h"
+
#include "priv_entries.h"
static inline void highlight_current_character(struct team_t *team)
@@ -301,6 +303,19 @@ static enum action_state_t character_play_turn(struct action_params_t *params)
return ACTION_PERFORMED;
}
+static void hook_post_action(struct action_params_t *params)
+{
+ struct character_t *chr = params->src;
+
+ if (chr->alive && chr->poisoned) {
+ damage_target_hp(params->surfaces, params->positions, chr, chr->max_hp / 4);
+
+ SDL_Flip(params->surfaces->screen);
+
+ SDL_Delay(1000);
+ }
+}
+
int Fjouer (SURFACES *surfaces, POSITIONS *positions, struct team_t *t1, struct team_t *t2)
{
struct team_t *playing_team;
@@ -347,6 +362,8 @@ int Fjouer (SURFACES *surfaces, POSITIONS *positions, struct team_t *t1, struct
SDL_Flip(surfaces->Pecran);
+ hook_post_action(&params);
+
update_current_character(t1, t2, &playing_team);
blit_team(surfaces, t1);
blit_team(surfaces, t2);