Xenochimera Feral Reduction in Darkness OR Belly

Xenochimera will now reduce ferality at a tickrate of 1 per Life tick while inside a belly or in darkness, same as the hunger reduction if they're full.
They will not experience hallucinations and will get safety messages while inside a belly, as well as the status indicator confirming they're safe even in a lit environment.

In total:
If sated, feral will reduce by 1 per Life() tick.
If in darkness _or_ a belly, feral will reduce by 1 per Life() tick.
A feral of 220 will take 110 seconds to clear if satiated, not in a belly, and in light.
Alternatively, it will take 55 seconds to clear if satiated **and** either in a belly _or_ in the darkness.

Upstream port of https://github.com/CHOMPStation2/CHOMPStation2/pull/3823
and
https://github.com/CHOMPStation2/CHOMPStation2/pull/3906
This commit is contained in:
Rykka
2022-03-27 16:27:44 -06:00
parent d4fb27da6f
commit 079c2fd436
2 changed files with 12 additions and 5 deletions
+2
View File
@@ -45,6 +45,8 @@
var/turf/T = get_turf(H)
if(T.get_lumcount() <= 0.1)
to_chat(usr, "<span class='notice'>You are slowly calming down in darkness' safety...</span>")
else if(isbelly(H.loc)) // Safety message for if inside a belly.
to_chat(usr, "<span class='notice'>You are slowly calming down within the darkness of something's belly, listening to their body as it moves around you. ...safe...</span>")
else
to_chat(usr, "<span class='notice'>You are slowly calming down... But safety of darkness is much preferred.</span>")
else
@@ -206,6 +206,11 @@
feral++
else
feral = max(0,--feral)
// Being in a belly or in the darkness decreases stress further. Helps mechanically reward players for staying in darkness + RP'ing appropriately. :9
var/turf/T = get_turf(H)
if(feral && (isbelly(H.loc) || T.get_lumcount() <= 0.1))
feral = max(0,--feral)
//Set our real mob's var to our temp var
H.feral = feral
@@ -222,7 +227,7 @@
H.shock_stage = max(H.shock_stage-(feral/20), 0)
//Handle light/dark areas
var/turf/T = get_turf(H)
// var/turf/T = get_turf(H) // Moved up to before the in-belly/dark combined check, should still safely reach here just fine.
if(!T)
update_xenochimera_hud(H, danger, feral_state)
return //Nullspace
@@ -234,8 +239,8 @@
//This is basically the 'lite' version of the below block.
var/list/nearby = H.living_mobs(world.view)
//Not in the dark and out in the open.
if(!darkish && isturf(H.loc))
//Not in the dark, or a belly, and out in the open.
if(!darkish && isturf(H.loc) && !isbelly(H.loc)) // Added specific check for if in belly
//Always handle feral if nobody's around and not in the dark.
if(!nearby.len)
@@ -249,8 +254,8 @@
update_xenochimera_hud(H, danger, feral_state)
return
// In the darkness or "hidden". No need for custom scene-protection checks as it's just an occational infomessage.
if(darkish || !isturf(H.loc))
// In the darkness, or "hidden", or in a belly. No need for custom scene-protection checks as it's just an occational infomessage.
if(darkish || !isturf(H.loc) || isbelly(H.loc)) // Specific check for if in belly. !isturf should do this, but JUST in case.
// If hurt, tell 'em to heal up
if (shock)
to_chat(H,"<span class='info'>This place seems safe, secure, hidden, a place to lick your wounds and recover...</span>")