diff options
author | Kenpachi Developer <Kenpachi.Developer@gmx.de> | 2020-02-15 05:48:05 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2020-04-05 21:20:35 +0200 |
commit | 0c6263c7605309cc19de6ed4b882bae55d42db1f (patch) | |
tree | 3528a6d64f02df60b4ed034bbad96500870ef5b3 /src/map | |
parent | 70552c6111fef08700693de37ffe2b4beec1809f (diff) | |
download | hercules-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')
-rw-r--r-- | src/map/pet.c | 9 | ||||
-rw-r--r-- | src/map/pet.h | 1 |
2 files changed, 9 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; } diff --git a/src/map/pet.h b/src/map/pet.h index 98b6f3517..3d3712243 100644 --- a/src/map/pet.h +++ b/src/map/pet.h @@ -59,6 +59,7 @@ struct s_pet_db { int autofeed; int hunger_decrement; int starving_delay; + int starving_decrement; struct script_code *equip_script; struct script_code *pet_script; |