Skip to content
Snippets Groups Projects
Commit d73aaf1a authored by Romain Jegat's avatar Romain Jegat
Browse files

avancement sur les fonctions d'attaques

parent d733b3ff
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -32,7 +32,13 @@ int attaquer(Personnage *attaquant, Attaque *attaque_select, Personnage *cible)
*/
int ajouter_effet_perso(Effet *effet_select, Personnage *cible)
{
int numero_effet = 0;
while((cible->effets[numero_effet].utilise)!=0)
{
numero_effet ++ ;
}
effet_select->utilise = 1;
cible->effets[numero_effet] = *effet_select;
return 0;
}
......@@ -47,8 +53,27 @@ int ajouter_effet_perso(Effet *effet_select, Personnage *cible)
*/
int appliquer_effet(Effet *effet_select, Personnage *cible)
{
(cible->PV) -= (effet_select->valeur_degats);
if((effet_select->nb_tours) != 0)
{
(cible->PV) -= (effet_select->valeur_degats_duree);
(cible->PV) += (effet_select->valeur_soin_duree);
(cible->gele) = (effet_select->paralysie);
}
/* A terminer */
return 0;
}
int declencher_effets_tour(Personnage *liste_perso)
{
int num_perso = 0;
/* */
return 0;
}
......
......@@ -142,6 +142,7 @@ typedef Case Carte[TAILLE_MAX_CARTE];
typedef struct Effet{
char id[TAILLE_ID]; /*!< ID de l'effet de taille TAILLE_ID*/
char nom[TAILLE_NOMS]; /*!< Nom de l'effet de taille TAILLE_NOMS*/
unsigned int utilise;
unsigned int nb_tours;/*!< Le nombre de tours restant avant que l'effet ne s'estompe*/
unsigned int valeur_degats; /*!< Le nombre de degats subis */
unsigned int valeur_soin; /*!< Le nombre PV regeneres */
......@@ -186,7 +187,8 @@ typedef struct Personnage{
unsigned short int PV; /*!< Les PV actuels du personnage*/
unsigned short int mana; /*!< Le mana actuel du personnage*/
Case *position; /*!< La case representant la position actuelle du personnage*/
Effet effets[]; /*!< Un tableau d'effets representant les effets affectant le personnage*/
Effet effets[10]; /*!< Un tableau d'effets representant les effets affectant le personnage*/
int gele;
} Personnage;
/*! \struct Competence structures.h
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment