summaryrefslogtreecommitdiff
path: root/constantes.h
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-01-08 02:39:16 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-01-08 02:44:56 +0100
commitc68227406beb7bc74a4179fb1b1b70bbeb6ad4a2 (patch)
treeb390ed5f463c28e7d80f5b446eddac6a6eeaf6e9 /constantes.h
parent6d8a9ac6c08e414e8ebb57a6a2ef9b4779d599a7 (diff)
use the new enemy team instead of the old array of ENEMIES
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'constantes.h')
-rw-r--r--constantes.h46
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\
{\