diff options
author | Olivier Gayot <duskcoder@gmail.com> | 2015-01-08 02:39:16 +0100 |
---|---|---|
committer | Olivier Gayot <duskcoder@gmail.com> | 2015-01-08 02:44:56 +0100 |
commit | c68227406beb7bc74a4179fb1b1b70bbeb6ad4a2 (patch) | |
tree | b390ed5f463c28e7d80f5b446eddac6a6eeaf6e9 /menuchoixpersos.c | |
parent | 6d8a9ac6c08e414e8ebb57a6a2ef9b4779d599a7 (diff) |
use the new enemy team instead of the old array of ENEMIES
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'menuchoixpersos.c')
-rw-r--r-- | menuchoixpersos.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/menuchoixpersos.c b/menuchoixpersos.c index 7a66c3f..d22ce58 100644 --- a/menuchoixpersos.c +++ b/menuchoixpersos.c @@ -77,6 +77,11 @@ struct team_t *new_ally_team(SURFACES *surfaces, init_team_players(team, true, classes, surfaces); + /* TODO remove when the level is set */ + for (int i = 0; i < team->chr_cnt; ++i) { + team->chrs[i].ally.nv = 0; + } + return team; } @@ -136,7 +141,6 @@ void Fmenuchoixpersos (SURFACES *surfaces, POSITIONS *positions) struct team_t *ally_team; struct team_t *enemy_team; enum character_class_t chr_classes[3]; - ENNEMIS ennemis[5]; SDL_Event event; int Vnbperso = 0; @@ -219,8 +223,8 @@ void Fmenuchoixpersos (SURFACES *surfaces, POSITIONS *positions) TTF_CloseFont (police); SDL_Flip(surfaces->Pecran); ally_team = new_ally_team(surfaces, chr_classes, 3); - Fmap(surfaces,positions, ally_team,ennemis); enemy_team = new_enemy_team(surfaces, ally_team); + Fmap(surfaces,positions, ally_team, enemy_team); } void Fchangersurlignage2 (int Vchoix, SURFACES *surfaces, POSITIONS *positions) @@ -237,22 +241,3 @@ void Fchangersurlignage2 (int Vchoix, SURFACES *surfaces, POSITIONS *positions) SDL_BlitSurface (surfaces->Ptextechoixmenu,NULL,surfaces->Pecran,&positions->Vpositiontextemenu); SDL_Flip (surfaces->Pecran); } - -void Fremplirennemis (SURFACES *surfaces,int Vnbennemis,ENNEMIS ennemis[]) -{ - - int i; - for (i=0;i<=Vnbennemis;i++) - { - if (ennemis[i].classe==GUERRIER_GOBELIN) - surfaces->Tennemi[i]=surfaces->Pgobelin; - } -} - -int Fcalculernbennemis () -{ - int nb; - nb=(rand()%(4-0+1))+0; - return nb; -} - |