diff options
author | Olivier Gayot <duskcoder@gmail.com> | 2015-01-07 21:43:18 +0100 |
---|---|---|
committer | Olivier Gayot <duskcoder@gmail.com> | 2015-01-07 23:29:49 +0100 |
commit | 45d54652a8005ccae2466a0e4757017c7b337e3b (patch) | |
tree | 5d13f930c82edeea16d490c39017973e0a85007c /constantes.h | |
parent | b3295086c84b09353d5e89c6f7c743167b486a49 (diff) |
use a team / character model instead of an array of personnages
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'constantes.h')
-rw-r--r-- | constantes.h | 51 |
1 files changed, 39 insertions, 12 deletions
diff --git a/constantes.h b/constantes.h index 68872ab..1178eca 100644 --- a/constantes.h +++ b/constantes.h @@ -5,10 +5,32 @@ #define QUITTER 2 #define XWIN 1024 #define YWIN 768 -#define PALADIN 0 -#define PRETRE 1 -#define VOLEUR 2 -#define GUERRIER_GOBELIN 10 + +enum character_class_t { + CLASS_INVAL = -1, + + CLASS_PALADIN, +#define PALADIN CLASS_PALADIN + CLASS_PRIEST, +#define PRETRE CLASS_PRIEST + CLASS_THIEF, +#define VOLEUR CLASS_THIEF + /* XXX add new ally classes here + * -> + */ + + CLASS_ALLY_CNT, + + CLASS_WARRIOR_GOBELIN = CLASS_ALLY_CNT, +#define GUERRIER_GOBELIN CLASS_WARRIOR_GOBELIN + /* XXX add new enemy classes here + * -> + */ + + CLASS_CNT, + CLASS_ENEMY_CNT = CLASS_CNT - CLASS_ALLY_CNT, +}; + #define VIE 1 #define MORT 0 @@ -46,8 +68,13 @@ #define SOINS 1 #define ALLIE 1 #define ENNEMI 0 -#define TYPE_ATTAQUE 0 -#define TYPE_MAGIE 1 + +enum damages_type_t { + DAMAGES_PHYSICAL, +#define TYPE_ATTAQUE DAMAGES_PHYSICAL + DAMAGES_MAGICAL, +#define TYPE_MAGIE DAMAGES_MAGICAL +}; enum action_state_t { ACTION_PERFORMED, @@ -104,11 +131,11 @@ if(clan==ENNEMI)\ {\ SDL_BlitSurface (surfaces->Pfondjeu,&positions->Vpositioncadrecible,surfaces->Pecran,&positions->Vpositioncadrecible);\ selection=0;\ - while(persos[selection].etat==MORT)\ + while (!ally->chrs[selection].alive)\ selection++;\ inverse_boolean(clan);\ SDL_BlitSurface(surfaces->Pfondjeu,&positions->Vpositioncurseurennemis,surfaces->Pecran,&positions->Vpositioncurseurennemis);\ - Fchangercurseurpersos(surfaces,positions,selection,persos);\ + Fchangercurseurpersos(surfaces,positions,selection);\ }\ break;\ case SDLK_UP:\ @@ -134,14 +161,14 @@ else\ selection--;\ else\ selection=2;\ - while(persos[selection].etat==MORT)\ + while (!ally->chrs[selection].alive)\ {\ if(selection!=0)\ selection--;\ else\ selection=2;\ }\ - Fchangercurseurpersos(surfaces,positions,selection,persos);\ + Fchangercurseurpersos(surfaces,positions,selection); \ }\ break;\ case SDLK_DOWN:\ @@ -167,14 +194,14 @@ else\ selection++;\ else\ selection=0;\ - while(persos[selection].etat==MORT)\ + while (!ally->chrs[selection].alive) \ {\ if(selection!=2)\ selection++;\ else\ selection=0;\ }\ - Fchangercurseurpersos(surfaces,positions,selection,persos);\ + Fchangercurseurpersos(surfaces,positions,selection); \ }\ break; |