summaryrefslogtreecommitdiff
path: root/src/map/pet.c
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-02-13 08:29:47 +0100
committerHaru <haru@dotalux.com>2020-04-05 21:20:35 +0200
commit09e291009156002e83566afe7a10b6509f5463f5 (patch)
treefd1d323198764c61892f9da7962e1442e2a86a1b /src/map/pet.c
parent554e54afebf3eed9d6293a7891c66320af2586a0 (diff)
downloadhercules-09e291009156002e83566afe7a10b6509f5463f5.tar.gz
hercules-09e291009156002e83566afe7a10b6509f5463f5.tar.bz2
hercules-09e291009156002e83566afe7a10b6509f5463f5.tar.xz
hercules-09e291009156002e83566afe7a10b6509f5463f5.zip
Add enum for pet intimacy levels and use its constants
Diffstat (limited to 'src/map/pet.c')
-rw-r--r--src/map/pet.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/map/pet.c b/src/map/pet.c
index 39a502d0f..592a25d3e 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -91,7 +91,7 @@ static void pet_set_intimate(struct pet_data *pd, int value)
status_calc_pc(sd,SCO_NONE);
/* Pet is lost, delete the egg */
- if (value <= 0) {
+ if (value <= PET_INTIMACY_NONE) {
int i;
ARR_FIND(0, sd->status.inventorySize, i, sd->status.inventory[i].card[0] == CARD0_PET &&
@@ -246,7 +246,7 @@ static int pet_hungry(int tid, int64 tick, int id, intptr_t data)
}
pd->pet_hungry_timer = INVALID_TIMER;
- if (pd->pet.intimate <= 0)
+ if (pd->pet.intimate <= PET_INTIMACY_NONE)
return 1; //You lost the pet already, the rest is irrelevant.
pd->pet.hungry--;
@@ -262,9 +262,9 @@ static int pet_hungry(int tid, int64 tick, int id, intptr_t data)
pet_stop_attack(pd);
pd->pet.hungry = PET_HUNGER_STARVING;
pet->set_intimate(pd, pd->pet.intimate - battle_config.pet_hungry_friendly_decrease);
- if( pd->pet.intimate <= 0 )
+ if (pd->pet.intimate <= PET_INTIMACY_NONE)
{
- pd->pet.intimate = 0;
+ pd->pet.intimate = PET_INTIMACY_NONE;
pd->status.speed = pd->db->status.speed;
}
status_calc_pet(pd, SCO_NONE);
@@ -320,9 +320,9 @@ static int pet_performance(struct map_session_data *sd, struct pet_data *pd)
int val;
nullpo_retr(1, pd);
- if (pd->pet.intimate > 900)
+ if (pd->pet.intimate > PET_INTIMACY_LOYAL)
val = (pd->petDB->s_perfor > 0)? 4:3;
- else if(pd->pet.intimate > 750) //TODO: this is way too high
+ else if (pd->pet.intimate > PET_INTIMACY_CORDIAL) //TODO: this is way too high
val = 2;
else
val = 1;
@@ -678,7 +678,7 @@ static int pet_menu(struct map_session_data *sd, int menunum)
return 1;
//You lost the pet already.
- if(!sd->status.pet_id || sd->pd->pet.intimate <= 0 || sd->pd->pet.incubate)
+ if (!sd->status.pet_id || sd->pd->pet.intimate <= PET_INTIMACY_NONE || sd->pd->pet.incubate)
return 1;
egg_id = itemdb->exists(sd->pd->petDB->EggID);
@@ -858,12 +858,12 @@ static int pet_food(struct map_session_data *sd, struct pet_data *pd)
}
pet->set_intimate(pd, pd->pet.intimate + add_intimate);
}
- if (pd->pet.intimate <= 0) {
- pd->pet.intimate = 0;
+ if (pd->pet.intimate <= PET_INTIMACY_NONE) {
+ pd->pet.intimate = PET_INTIMACY_NONE;
pet_stop_attack(pd);
pd->status.speed = pd->db->status.speed;
- } else if (pd->pet.intimate > 1000) {
- pd->pet.intimate = 1000;
+ } else if (pd->pet.intimate > PET_INTIMACY_MAX) {
+ pd->pet.intimate = PET_INTIMACY_MAX;
}
status_calc_pet(pd, SCO_NONE);
pd->pet.hungry += pd->petDB->fullness;
@@ -937,7 +937,7 @@ static int pet_ai_sub_hard(struct pet_data *pd, struct map_session_data *sd, int
if(pd->ud.walktimer != INVALID_TIMER && pd->ud.walkpath.path_pos <= 2)
return 0; //No thinking when you just started to walk.
- if(pd->pet.intimate <= 0) {
+ if (pd->pet.intimate <= PET_INTIMACY_NONE) {
//Pet should just... well, random walk.
pet->randomwalk(pd,tick);
return 0;
@@ -1168,7 +1168,7 @@ static int pet_skill_bonus_timer(int tid, int64 tick, int id, intptr_t data)
if (pd->state.skillbonus && pd->bonus->delay > 0) {
bonus = 0;
duration = pd->bonus->delay*1000; // the duration until pet bonuses will be reactivated again
- } else if (pd->pet.intimate) {
+ } else if (pd->pet.intimate > PET_INTIMACY_NONE) {
bonus = 1;
duration = pd->bonus->duration*1000; // the duration for pet bonuses to be in effect
} else { //Lost pet...