diff options
Diffstat (limited to 'actions.c')
-rw-r--r-- | actions.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -46,7 +46,7 @@ void Fattaquer(SURFACES *surfaces,POSITIONS *positions,PERSONNAGES persos[],int case SDLK_RETURN: case SDLK_f: continuer=0; - max=Fcalculerdegats(persos,Vtourallie,&min,ennemis,selection,clan,TYPE_ATTAQUE); + max=Fcalculerdegats(persos, *Vtourallie,&min,ennemis,selection,clan,TYPE_ATTAQUE); degats=(rand()%(max-min+1))+min; if(degats<0) degats=0; @@ -118,9 +118,11 @@ void Fattaquer(SURFACES *surfaces,POSITIONS *positions,PERSONNAGES persos[],int SDL_Delay(1000); SDL_BlitSurface(surfaces->Pfondjeu,&positions->Vpositiondegats,surfaces->Pecran,&positions->Vpositiondegats); SDL_Flip(surfaces->Pecran); + + return ret; } -int Fcalculerdegats(PERSONNAGES persos[],int *Vtourallie,int *min,ENNEMIS ennemis[],int selection,int camp,int type) +int Fcalculerdegats(PERSONNAGES persos[], int Vtourallie,int *min,ENNEMIS ennemis[],int selection,int camp,int type) { unsigned int degats; int max; @@ -129,16 +131,16 @@ int Fcalculerdegats(PERSONNAGES persos[],int *Vtourallie,int *min,ENNEMIS ennemi if(type==TYPE_ATTAQUE) { if(camp==ENNEMI) - degats=persos[*Vtourallie].force*60-ennemis[selection].defense*50; + degats=persos[Vtourallie].force*60-ennemis[selection].defense*50; else - degats=persos[*Vtourallie].force*60-persos[selection].defense*50; + degats=persos[Vtourallie].force*60-persos[selection].defense*50; } else { if(camp==ENNEMI) - degats=persos[*Vtourallie].magie*60-ennemis[selection].defensemagique*50; + degats=persos[Vtourallie].magie*60-ennemis[selection].defensemagique*50; else - degats=persos[*Vtourallie].magie*60-persos[selection].defensemagique*50; + degats=persos[Vtourallie].magie*60-persos[selection].defensemagique*50; } taux=degats/4; max=degats+taux; |