diff options
Diffstat (limited to 'constantes.h')
-rw-r--r-- | constantes.h | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/constantes.h b/constantes.h index 7e3d7da..d749d37 100644 --- a/constantes.h +++ b/constantes.h @@ -35,12 +35,25 @@ enum character_class_t { #define MORT 0 //type de sort -#define FEU 0 -#define GLACE 1 -#define EAU 2 -#define TONNERRE 3 -#define CHOC 4 -#define NON_ELEMENTAIRE 4 + +enum element_t { + ELEMENT_FIRE, +#define FEU ELEMENT_FIRE + ELEMENT_ICE, +#define GLACE ELEMENT_ICE + ELEMENT_WATER, +#define EAU ELEMENT_WATER + ELEMENT_THUNDER, +#define TONNERRE ELEMENT_THUNDER + + ELEMENT_COUNT, + + ELEMENT_NONE = ELEMENT_COUNT, +#define NON_ELEMENTAIRE ELEMENT_NONE +#define CHOC ELEMENT_NONE +}; + + #define SOIN 0 //caractéristiques @@ -127,11 +140,11 @@ case SDLK_l: \ if(clan==ALLIE)\ {\ selection=0;\ - while(ennemis[selection].etat==MORT)\ + while(!enemy->chrs[selection].alive) \ selection++;\ inverse_boolean(clan);\ SDL_BlitSurface (surfaces->Pfondjeu,&positions->Vpositioncurseurallies,surfaces->Pecran,&positions->Vpositioncurseurallies);\ - Fchangercurseurennemis (surfaces,positions,selection,ennemis);\ + Fchangercurseurennemis (surfaces,positions, &enemy->chrs[selection]);\ }\ break;\ case SDLK_LEFT:\ @@ -154,15 +167,15 @@ if(clan==ENNEMI)\ if (selection!=0)\ selection--;\ else\ - selection=Vnbennemis;\ - while(ennemis[selection].etat==MORT)\ + selection = enemy->chr_cnt;\ + while(!enemy->chrs[selection].alive) \ {\ if(selection!=0)\ selection--;\ else\ - selection=Vnbennemis;\ + selection = enemy->chr_cnt;\ }\ - Fchangercurseurennemis (surfaces,positions,selection,ennemis);\ + Fchangercurseurennemis (surfaces,positions, &enemy->chrs[selection]);\ }\ else\ {\ @@ -184,18 +197,17 @@ case SDLK_DOWN:\ case SDLK_j:\ if(clan==ENNEMI)\ {\ - if(selection!=Vnbennemis)\ + if (selection != enemy->chr_cnt)\ selection++;\ else\ selection=0;\ - while(ennemis[selection].etat==MORT)\ - {\ - if(selection!=Vnbennemis)\ + while(!enemy->chrs[selection].alive) { \ + if(selection != enemy->chr_cnt) \ selection++;\ else\ selection=0;\ }\ - Fchangercurseurennemis(surfaces,positions,selection,ennemis);\ + Fchangercurseurennemis(surfaces,positions, &enemy->chrs[selection]); \ }\ else\ {\ |