From 8218792cbbd00da3530826330270a20906fefad5 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Wed, 7 Jan 2015 22:38:45 +0100 Subject: add the warrior gobelin as a real class Signed-off-by: Olivier Gayot --- main.c | 3 +++ menuchoixpersos.c | 4 ++++ players.c | 6 ++++++ structures.h | 2 ++ 4 files changed, 15 insertions(+) diff --git a/main.c b/main.c index 3167cb0..acbd749 100644 --- a/main.c +++ b/main.c @@ -214,6 +214,7 @@ int Fchargerimages (SURFACES *surfaces) int i; LOAD_IMAGE(Pgobelin, "images/gobelin.bmp"); + LOAD_IMAGE(red_warrior_gobelin, "images/gobelin.bmp"); LOAD_IMAGE(Ppaladin, "images/paladin.bmp"); LOAD_IMAGE(Ppretre, "images/pretre.bmp"); LOAD_IMAGE(Pvoleur, "images/voleur.bmp"); @@ -242,6 +243,7 @@ int Fchargerimages (SURFACES *surfaces) //définition de la transparence alpha dans les surfaces SDL_SetColorKey(surfaces->Pgobelin,SDL_SRCCOLORKEY,SDL_MapRGB(surfaces->Pecran->format,0,255,18)); + SDL_SetColorKey(surfaces->red_warrior_gobelin, SDL_SRCCOLORKEY,SDL_MapRGB(surfaces->Pecran->format,0,255,18)); SDL_SetColorKey(surfaces->Ppretre,SDL_SRCCOLORKEY,SDL_MapRGB(surfaces->Pecran->format,39,189,31)); SDL_SetColorKey(surfaces->Ppaladin,SDL_SRCCOLORKEY,SDL_MapRGB(surfaces->Pecran->format,189,31,31)); @@ -266,6 +268,7 @@ void Fdechargerimages (SURFACES *surfaces)//dechargement des surfaces alouées int i; SDL_FreeSurface(surfaces->Pecran); SDL_FreeSurface (surfaces->Pgobelin); + SDL_FreeSurface(surfaces->red_warrior_gobelin); SDL_FreeSurface (surfaces->Ppaladin); SDL_FreeSurface (surfaces->Ppretre); diff --git a/menuchoixpersos.c b/menuchoixpersos.c index 05e1a0a..ef8b8a1 100644 --- a/menuchoixpersos.c +++ b/menuchoixpersos.c @@ -41,6 +41,10 @@ struct team_t *new_ally_team(SURFACES *surfaces, chr->def_surf = surfaces->Pvoleur; chr->red_surf = surfaces->red_thief; break; + case CLASS_WARRIOR_GOBELIN: + chr->def_surf = surfaces->Pgobelin; + chr->red_surf = surfaces->red_warrior_gobelin; + break; default: abort(); } diff --git a/players.c b/players.c index 12aae80..e1d7acc 100644 --- a/players.c +++ b/players.c @@ -22,5 +22,11 @@ struct stats_base_class_t base_stats_g[CLASS_CNT] = { .magic = 11, .defense = 15, .spirit = 15, + }, [CLASS_WARRIOR_GOBELIN] = { + .hp = 1000, + .mp = 0, + .strength = 15, + .magic = 0, + .defense = 10, }, }; diff --git a/structures.h b/structures.h index 1339a5f..b0f5b3b 100644 --- a/structures.h +++ b/structures.h @@ -5,7 +5,9 @@ typedef struct surfaces SURFACES; struct surfaces { SDL_Surface *Pecran; + SDL_Surface *Pgobelin; + SDL_Surface *red_warrior_gobelin; SDL_Surface *Ppaladin; SDL_Surface *Ppretre; -- cgit v1.2.3