From 1f9c71b49eeef9cd05b542515c06200b4a25f693 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Thu, 8 Jan 2015 15:04:26 +0100 Subject: use a generic way to navigate through entries entries are actually any action or subaction that can be performed. Attack, White Magic and so on are root actions. Fire, Ice X are subactions of Black Magic. Signed-off-by: Olivier Gayot --- magies.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'magies.c') diff --git a/magies.c b/magies.c index 3740c84..94183e7 100644 --- a/magies.c +++ b/magies.c @@ -5,7 +5,7 @@ #include "constantes.h" #include "prototypes.h" -enum action_state_t Fmagieelement (SURFACES *surfaces,POSITIONS *positions, struct team_t *ally, struct team_t *enemy, enum element_t element) +enum action_state_t Fmagieelement (SURFACES *surfaces,POSITIONS *positions, struct team_t *ally, struct team_t *enemy, void *data) { struct character_t *target; int degats; @@ -13,6 +13,9 @@ enum action_state_t Fmagieelement (SURFACES *surfaces,POSITIONS *positions, stru int clan=ENNEMI; SDL_Event event; SDL_BlitSurface (surfaces->Pfondjeu,&positions->Vpositioncadreactions,surfaces->Pecran,&positions->Vpositioncadreactions); + + enum element_t element = *((enum element_t *)data); + while (!enemy->chrs[selection].alive) selection++; update_selected_target(surfaces,positions, &enemy->chrs[selection]); @@ -61,13 +64,16 @@ enum action_state_t Fmagieelement (SURFACES *surfaces,POSITIONS *positions, stru } } -enum action_state_t Fmagiesoin(SURFACES *surfaces,POSITIONS *positions, struct team_t *ally, struct team_t *enemy) +enum action_state_t Fmagiesoin(SURFACES *surfaces,POSITIONS *positions, struct team_t *ally, struct team_t *enemy, void *data) { struct character_t *target; SDL_Event event; int soins; int clan=ALLIE; int selection=0; + + (void) data; + SDL_BlitSurface (surfaces->Pfondjeu,&positions->Vpositioncadreactions,surfaces->Pecran,&positions->Vpositioncadreactions); while(!ally->chrs[selection].alive) selection++; -- cgit v1.2.3