summaryrefslogtreecommitdiff
path: root/actions.c
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-01-08 12:46:36 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-01-08 12:46:36 +0100
commitadceeb1192fdd1d14e0f55219bbd1bcb14eacc05 (patch)
tree459ef1cca58cd8975ded85bba7db639ae76a3528 /actions.c
parent9a98118c3d9a062b33134e8354620be43ecf3786 (diff)
use the objects assigned to the teams instead of a common array
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'actions.c')
-rw-r--r--actions.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/actions.c b/actions.c
index 09fd3af..096fba9 100644
--- a/actions.c
+++ b/actions.c
@@ -117,7 +117,7 @@ enum action_state_t Fselectionnermagienoire(SURFACES *surfaces,POSITIONS *positi
while (continuer)
{
- Fchangeractionselectionnee(surfaces,positions,selection,page,nbactions,MAGIE_NOIRE,NULL);
+ Fchangeractionselectionnee(surfaces,positions,selection,page,nbactions,MAGIE_NOIRE);
SDL_WaitEvent (&event);
switch (event.type)
{
@@ -135,7 +135,7 @@ enum action_state_t Fselectionnermagienoire(SURFACES *surfaces,POSITIONS *positi
else
selection=nbactions-1;
page=selection/3;
- Fchangeractionselectionnee(surfaces,positions,selection,page,nbactions,MAGIE_NOIRE,NULL);
+ Fchangeractionselectionnee(surfaces,positions,selection,page,nbactions,MAGIE_NOIRE);
break;
case SDLK_j:
case SDLK_DOWN:
@@ -144,7 +144,7 @@ enum action_state_t Fselectionnermagienoire(SURFACES *surfaces,POSITIONS *positi
else
selection=0;
page=selection/3;
- Fchangeractionselectionnee(surfaces,positions,selection,page,nbactions,MAGIE_NOIRE,NULL);
+ Fchangeractionselectionnee(surfaces,positions,selection,page,nbactions,MAGIE_NOIRE);
break;
case SDLK_f:
case SDLK_RETURN:
@@ -177,7 +177,7 @@ enum action_state_t Fselectionnermagieblanche(SURFACES *surfaces,POSITIONS *posi
while (continuer)
{
- Fchangeractionselectionnee(surfaces,positions,selection,page,nbactions,MAGIE_BLANCHE,NULL);
+ Fchangeractionselectionnee(surfaces,positions,selection,page,nbactions,MAGIE_BLANCHE);
SDL_WaitEvent (&event);
switch (event.type)
{
@@ -195,7 +195,7 @@ enum action_state_t Fselectionnermagieblanche(SURFACES *surfaces,POSITIONS *posi
else
selection=nbactions-1;
page=selection/3;
- Fchangeractionselectionnee(surfaces,positions,selection,page,nbactions,MAGIE_BLANCHE,NULL);
+ Fchangeractionselectionnee(surfaces,positions,selection,page,nbactions,MAGIE_BLANCHE);
break;
case SDLK_DOWN:
case SDLK_j:
@@ -204,7 +204,7 @@ enum action_state_t Fselectionnermagieblanche(SURFACES *surfaces,POSITIONS *posi
else
selection=0;
page=selection/3;
- Fchangeractionselectionnee(surfaces,positions,selection,page,nbactions,MAGIE_BLANCHE,NULL);
+ Fchangeractionselectionnee(surfaces,positions,selection,page,nbactions,MAGIE_BLANCHE);
break;
case SDLK_f:
case SDLK_RETURN:
@@ -237,7 +237,7 @@ enum action_state_t Fselectionnerobjet(SURFACES *surfaces,POSITIONS *positions,
while (continuer)
{
- Fchangeractionselectionnee(surfaces,positions,selection,page,nbactions,OBJETS, &ally->objects);
+ Fchangeractionselectionnee(surfaces,positions,selection,page,nbactions,OBJETS);
SDL_WaitEvent (&event);
switch (event.type)
{
@@ -255,7 +255,7 @@ enum action_state_t Fselectionnerobjet(SURFACES *surfaces,POSITIONS *positions,
else
selection=nbactions-1;
page=selection/3;
- Fchangeractionselectionnee(surfaces,positions,selection,page,nbactions,OBJETS, &ally->objects);
+ Fchangeractionselectionnee(surfaces,positions,selection,page,nbactions,OBJETS);
break;
case SDLK_DOWN:
case SDLK_j:
@@ -264,7 +264,7 @@ enum action_state_t Fselectionnerobjet(SURFACES *surfaces,POSITIONS *positions,
else
selection=0;
page=selection/3;
- Fchangeractionselectionnee(surfaces,positions,selection,page,nbactions,OBJETS, &ally->objects);
+ Fchangeractionselectionnee(surfaces,positions,selection,page,nbactions,OBJETS);
break;
case SDLK_RETURN:
case SDLK_f:
@@ -273,17 +273,17 @@ enum action_state_t Fselectionnerobjet(SURFACES *surfaces,POSITIONS *positions,
if(page==0)
{
if(selection==POTION)
- ret = Fpotion(surfaces,positions, ally, enemy, &ally->objects,selection);
+ ret = Fpotion(surfaces,positions, ally, enemy, selection);
else if(selection==ETHER)
- ret = Fether(surfaces,positions, ally, enemy, &ally->objects,selection);
+ ret = Fether(surfaces,positions, ally, enemy, selection);
else if(selection==POTIONPLUS)
- ret = Fpotion(surfaces,positions, ally, enemy, &ally->objects,selection);
+ ret = Fpotion(surfaces,positions, ally, enemy, selection);
}
else if(page==1)
{
if(selection==ETHERPLUS)
- ret = Fether(surfaces,positions, ally, enemy, &ally->objects,selection);
+ ret = Fether(surfaces,positions, ally, enemy, selection);
}
if (ret == ACTION_PERFORMED) {
@@ -300,7 +300,7 @@ enum action_state_t Fselectionnerobjet(SURFACES *surfaces,POSITIONS *positions,
return ret;
}
-enum action_state_t Fpotion(SURFACES *surfaces,POSITIONS *positions, struct team_t *ally, struct team_t *enemy, OBJET *objets,int type)
+enum action_state_t Fpotion(SURFACES *surfaces,POSITIONS *positions, struct team_t *ally, struct team_t *enemy, int type)
{
struct character_t *target;
SDL_Event event;
@@ -308,9 +308,9 @@ enum action_state_t Fpotion(SURFACES *surfaces,POSITIONS *positions, struct team
int soins=0;
int clan=ALLIE;
- if(type==POTION&&objets->potions<=0)
+ if (type == POTION && ally->objects.potions <= 0)
return ACTION_ERROR;
- else if(type==POTIONPLUS&&objets->potionsplus<=0)
+ else if(type == POTIONPLUS && ally->objects.potionsplus <= 0)
return ACTION_ERROR;
SDL_BlitSurface (surfaces->Pfondjeu,&positions->Vpositioncadreactions,surfaces->Pecran,&positions->Vpositioncadreactions);
@@ -344,10 +344,10 @@ enum action_state_t Fpotion(SURFACES *surfaces,POSITIONS *positions, struct team
if (type == POTION) {
soins = 1000;
- objets->potions--;
+ ally->objects.potions--;
} else if (type == POTIONPLUS) {
soins = 4000;
- objets->potionsplus--;
+ ally->objects.potionsplus--;
}
cure_target_hp(surfaces, positions, target, soins);
@@ -365,7 +365,7 @@ enum action_state_t Fpotion(SURFACES *surfaces,POSITIONS *positions, struct team
}
}
-enum action_state_t Fether(SURFACES *surfaces,POSITIONS *positions, struct team_t *ally, struct team_t *enemy, OBJET *objets,int type)
+enum action_state_t Fether(SURFACES *surfaces,POSITIONS *positions, struct team_t *ally, struct team_t *enemy, int type)
{
struct character_t *target;
SDL_Event event;
@@ -373,9 +373,9 @@ enum action_state_t Fether(SURFACES *surfaces,POSITIONS *positions, struct team_
int soins=0;
int clan=ALLIE;
- if(type==ETHER&&objets->ethers<=0)
+ if (type == ETHER && ally->objects.ethers <= 0)
return ACTION_ERROR;
- else if(type==ETHERPLUS&&objets->ethersplus<=0)
+ else if (type == ETHERPLUS && ally->objects.ethersplus <= 0)
return ACTION_ERROR;
SDL_BlitSurface (surfaces->Pfondjeu,&positions->Vpositioncadreactions,surfaces->Pecran,&positions->Vpositioncadreactions);
@@ -407,10 +407,10 @@ enum action_state_t Fether(SURFACES *surfaces,POSITIONS *positions, struct team_
if (type == ETHER) {
soins = 10;
- objets->ethers--;
+ ally->objects.ethers--;
} else if (type == ETHERPLUS) {
soins = 40;
- objets->ethersplus--;
+ ally->objects.ethersplus--;
}
cure_target_mp(surfaces, positions, target, soins);