From a24acb373d67048daa7e68e72418a5d6ef5841dd Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Wed, 7 Jan 2015 23:38:45 +0100 Subject: added the current user to the team structure the current character is generated randomly at the initialization of the team. Signed-off-by: Olivier Gayot --- magies.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'magies.c') diff --git a/magies.c b/magies.c index 72de556..ae358e5 100644 --- a/magies.c +++ b/magies.c @@ -5,7 +5,7 @@ #include "constantes.h" #include "prototypes.h" -enum action_state_t Fmagieelement (SURFACES *surfaces,POSITIONS *positions, struct team_t *ally, int Vtourallie,ENNEMIS ennemis[],int Vnbennemis, int element) +enum action_state_t Fmagieelement (SURFACES *surfaces,POSITIONS *positions, struct team_t *ally, ENNEMIS ennemis[],int Vnbennemis, int element) { enum action_state_t ret = ACTION_CANCELED; int max; @@ -46,7 +46,7 @@ enum action_state_t Fmagieelement (SURFACES *surfaces,POSITIONS *positions, stru case SDLK_RETURN: case SDLK_f: continuer=0; - max=Fcalculerdegats(ally, Vtourallie,&min,ennemis,selection,clan,TYPE_MAGIE); + max=Fcalculerdegats(ally, &min,ennemis,selection,clan,TYPE_MAGIE); degats=(rand()%(max-min+1))+min; if(degats<0) degats=0; @@ -124,7 +124,7 @@ enum action_state_t Fmagieelement (SURFACES *surfaces,POSITIONS *positions, stru return ret; } -enum action_state_t Fmagiesoin(SURFACES *surfaces,POSITIONS *positions, struct team_t *ally, int Vtourallie,ENNEMIS ennemis[],int Vnbennemis) +enum action_state_t Fmagiesoin(SURFACES *surfaces,POSITIONS *positions, struct team_t *ally, ENNEMIS ennemis[],int Vnbennemis) { enum action_state_t ret = ACTION_CANCELED; unsigned int continuer=1; @@ -163,7 +163,7 @@ enum action_state_t Fmagiesoin(SURFACES *surfaces,POSITIONS *positions, struct t SELECTION_CIBLE() case SDLK_RETURN: case SDLK_f: - max=Fcalculersoins(ally, Vtourallie,&min,ennemis,selection); + max=Fcalculersoins(ally, &min,ennemis,selection); soins=(rand()%(max-min+1))+min; if(soins<0) soins=0; @@ -228,7 +228,7 @@ enum action_state_t Fmagiesoin(SURFACES *surfaces,POSITIONS *positions, struct t return ret; } -int Fcalculersoins(struct team_t *ally, int Vtourallie,int *min,ENNEMIS ennemis[],int selection) +int Fcalculersoins(struct team_t *ally, int *min,ENNEMIS ennemis[],int selection) { unsigned int soins; int max; @@ -238,7 +238,7 @@ int Fcalculersoins(struct team_t *ally, int Vtourallie,int *min,ENNEMIS ennemis[ (void) ennemis; (void) selection; - soins=ally->chrs[Vtourallie].magic*20; + soins=ally->chrs[ally->chr_cur].magic*20; taux=soins/4; max=soins+taux; *min=soins-taux; -- cgit v1.2.3