diff options
author | Olivier Gayot <duskcoder@gmail.com> | 2015-01-08 15:04:26 +0100 |
---|---|---|
committer | Olivier Gayot <duskcoder@gmail.com> | 2015-01-08 15:37:48 +0100 |
commit | 1f9c71b49eeef9cd05b542515c06200b4a25f693 (patch) | |
tree | 6a29ab8af1ae447236013cbd78e5089937b72b1f /magies.c | |
parent | adceeb1192fdd1d14e0f55219bbd1bcb14eacc05 (diff) |
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 <duskcoder@gmail.com>
Diffstat (limited to 'magies.c')
-rw-r--r-- | magies.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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++; |