From a1f75a644e0119fa6e31b0a0c852b71f6fc28410 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sat, 10 Jan 2015 00:52:31 +0100 Subject: added "cyanmure" magic Signed-off-by: Olivier Gayot --- jouer.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'jouer.c') 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(¶ms); + update_current_character(t1, t2, &playing_team); blit_team(surfaces, t1); blit_team(surfaces, t2); -- cgit v1.2.3