mirror of
https://github.com/KabKebab/GS13.git
synced 2026-08-22 20:46:55 +01:00
Fatness Hiding Rework
Fatness hiding has been reworked to allow multiple items that add or reduce a character's fatness value. A thing that wishes to use this system needs to add and remove itself to a character's hiding list (hider_add(), hider_remove()) based on that thing's conditions. Then it needs to have a /proc/fat_hide() that will return the value by which to shift fatness
This commit is contained in:
@@ -227,10 +227,9 @@
|
||||
items_preserved.Cut()
|
||||
owner.update_icons()
|
||||
|
||||
var/mob/living/carbon/predator = owner
|
||||
if(iscarbon(predator))
|
||||
if(digest_mode == DM_FATTEN && predator.fat_hider == src)
|
||||
predator.fat_show()
|
||||
if(iscarbon(owner))
|
||||
var/mob/living/carbon/predator = owner
|
||||
predator.hider_remove(src)
|
||||
|
||||
return count
|
||||
|
||||
@@ -279,16 +278,17 @@
|
||||
owner.visible_message("<font color='green'><b>[owner] expels [M] from their [lowertext(name)]!</b></font>")
|
||||
owner.update_icons()
|
||||
|
||||
var/mob/living/carbon/predator = owner
|
||||
if(iscarbon(predator))
|
||||
if(digest_mode == DM_FATTEN && predator.fat_hider == src)
|
||||
var/preys_fatness = 0
|
||||
for(var/mob/living/carbon/prey in contents)
|
||||
preys_fatness += prey.fatness
|
||||
if(preys_fatness > predator.fatness)
|
||||
predator.fat_hide(preys_fatness, src)
|
||||
else
|
||||
predator.fat_show()
|
||||
if(iscarbon(owner))
|
||||
var/mob/living/carbon/predator = owner
|
||||
var/found = FALSE
|
||||
for(var/prey in contents)
|
||||
if(istype(prey, /mob/living/carbon))
|
||||
found = TRUE
|
||||
if(found)
|
||||
predator.hider_add(src)
|
||||
else
|
||||
predator.hider_remove(src)
|
||||
|
||||
return TRUE
|
||||
|
||||
// Actually perform the mechanics of devouring the tasty prey.
|
||||
@@ -695,3 +695,11 @@
|
||||
for(var/I in emote_lists[K])
|
||||
dupe.emote_lists[K] += I
|
||||
return dupe
|
||||
|
||||
/obj/belly/proc/fat_hide(var/mob/living/carbon/user)
|
||||
var/preys_fatness = 0
|
||||
for(var/prey in contents)
|
||||
if(iscarbon(prey))
|
||||
var/mob/living/carbon/cprey = prey
|
||||
preys_fatness += cprey.fatness
|
||||
return preys_fatness
|
||||
|
||||
@@ -58,6 +58,18 @@
|
||||
var/sound/pred_death = sound(get_sfx("death_pred"))
|
||||
var/turf/source = get_turf(owner)
|
||||
|
||||
////////////////////////// Vore Fatness /////////////////////////////
|
||||
if(iscarbon(owner))
|
||||
var/mob/living/carbon/predator = owner
|
||||
var/found = FALSE
|
||||
for(var/prey in contents)
|
||||
if(istype(prey, /mob/living/carbon))
|
||||
found = TRUE
|
||||
if(found)
|
||||
predator.hider_add(src)
|
||||
else
|
||||
predator.hider_remove(src)
|
||||
|
||||
///////////////////////////// DM_HOLD /////////////////////////////
|
||||
if(digest_mode == DM_HOLD)
|
||||
return SSBELLIES_PROCESSED
|
||||
@@ -65,8 +77,8 @@
|
||||
///////////////////////////// DM_FATTEN /////////////////////////////
|
||||
if(digest_mode == DM_FATTEN)
|
||||
var/preys_fatness = 0
|
||||
var/mob/living/carbon/predator = owner
|
||||
if(iscarbon(predator))
|
||||
if(iscarbon(owner))
|
||||
var/mob/living/carbon/predator = owner
|
||||
for(var/mob/living/M in contents)
|
||||
var/mob/living/carbon/prey = M
|
||||
if(iscarbon(prey) && predator.fatness_real)
|
||||
@@ -77,12 +89,6 @@
|
||||
predator.nutrition -= 3
|
||||
preys_fatness += prey.fatness
|
||||
|
||||
if(!predator.fat_hider || predator.fat_hider == src)
|
||||
if(preys_fatness > predator.fatness)
|
||||
predator.fat_hide(preys_fatness, src)
|
||||
if(predator.fat_hider != src)
|
||||
predator.fat_show()
|
||||
|
||||
//////////////////////////// DM_DIGEST ////////////////////////////
|
||||
else if(digest_mode == DM_DIGEST)
|
||||
if(HAS_TRAIT(owner, TRAIT_PACIFISM)) //obvious.
|
||||
|
||||
Reference in New Issue
Block a user