summaryrefslogtreecommitdiff
path: root/src/map/pet.c
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-02-15 05:48:05 +0100
committerHaru <haru@dotalux.com>2020-04-05 21:20:35 +0200
commit0c6263c7605309cc19de6ed4b882bae55d42db1f (patch)
tree3528a6d64f02df60b4ed034bbad96500870ef5b3 /src/map/pet.c
parent70552c6111fef08700693de37ffe2b4beec1809f (diff)
downloadhercules-0c6263c7605309cc19de6ed4b882bae55d42db1f.tar.gz
hercules-0c6263c7605309cc19de6ed4b882bae55d42db1f.tar.bz2
hercules-0c6263c7605309cc19de6ed4b882bae55d42db1f.tar.xz
hercules-0c6263c7605309cc19de6ed4b882bae55d42db1f.zip
Add new field Intimacy.StarvingDecrement to pet DB
Diffstat (limited to 'src/map/pet.c')
-rw-r--r--src/map/pet.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/map/pet.c b/src/map/pet.c
index 649884468..6b1f3176f 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -277,7 +277,7 @@ 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);
+ pet->set_intimate(pd, pd->pet.intimate - pd->petDB->starving_decrement);
if (pd->pet.intimate == PET_INTIMACY_NONE)
pd->status.speed = pd->db->status.speed;
status_calc_pet(pd, SCO_NONE);
@@ -1428,6 +1428,7 @@ static int pet_read_db_sub(struct config_setting_t *it, int n, const char *sourc
pet->db[n].r_full = 100;
pet->db[n].die = 20;
pet->db[n].starving_delay = min(20000, pet->db[n].hungry_delay);
+ pet->db[n].starving_decrement = 20;
if ((t = libconfig->setting_get_member(it, "Intimacy"))) {
if (config_setting_is_group(t)) {
@@ -1570,6 +1571,12 @@ static bool pet_read_db_sub_intimacy(int idx, struct config_setting_t *t)
if (libconfig->setting_lookup_int(t, "StarvingDelay", &i32) == CONFIG_TRUE)
pet->db[idx].starving_delay = cap_value(1000 * i32, 0, pet->db[idx].hungry_delay);
+ if (libconfig->setting_lookup_int(t, "StarvingDecrement", &i32) == CONFIG_TRUE)
+ pet->db[idx].starving_decrement = cap_value(i32, PET_INTIMACY_NONE, PET_INTIMACY_MAX);
+
+ if (pet->db[idx].starving_decrement == PET_INTIMACY_NONE)
+ pet->db[idx].starving_delay = 0;
+
return true;
}