Skip to content

Commit

Permalink
Merge pull request #3648 from MistakeNot4892/devfixes
Browse files Browse the repository at this point in the history
Fixes issues with human Life() processing.
  • Loading branch information
out-of-phaze authored Feb 1, 2024
2 parents 615202c + a9c27f8 commit 221832e
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 50 deletions.
3 changes: 3 additions & 0 deletions code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
var/stamina = 100

/mob/living/carbon/human/handle_living_non_stasis_processes()
. = ..()
if(!.)
return FALSE
last_pain = null // Clear the last cached pain value so further getHalloss() calls won't use an old value.
//Organs and blood
handle_organs()
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
return 1

/mob/living/proc/handle_living_non_stasis_processes()
SHOULD_CALL_PARENT(TRUE)
// hungy
handle_nutrition_and_hydration()
// Breathing, if applicable
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/silicon/ai/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

/mob/living/silicon/ai/handle_living_non_stasis_processes()
. = ..()
if(!.)
return FALSE
// If our powersupply object was destroyed somehow, create new one.
if(!psupply)
create_powersupply()
Expand Down
13 changes: 7 additions & 6 deletions code/modules/mob/living/silicon/robot/life.dm
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/mob/living/silicon/robot/handle_living_non_stasis_processes()
. = ..()
if(.)
use_power()
process_killswitch()
process_locks()
process_queued_alarms()
process_os()
if(!.)
return FALSE
use_power()
process_killswitch()
process_locks()
process_queued_alarms()
process_os()

/mob/living/silicon/robot/proc/use_power()
used_power_this_tick = 0
Expand Down
23 changes: 15 additions & 8 deletions code/modules/mob/living/simple_animal/friendly/farm_animals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@

/mob/living/simple_animal/hostile/retaliate/goat/handle_living_non_stasis_processes()
. = ..()
if(. && stat == CONSCIOUS && udder && prob(5))
if(!.)
return FALSE
if(stat == CONSCIOUS && udder && prob(5))
udder.add_reagent(/decl/material/liquid/drink/milk, rand(5, 10))

/mob/living/simple_animal/hostile/retaliate/goat/Retaliate()
Expand Down Expand Up @@ -141,7 +143,9 @@

/mob/living/simple_animal/cow/handle_living_non_stasis_processes()
. = ..()
if(. && udder && prob(5))
if(!.)
return FALSE
if(udder && prob(5))
udder.add_reagent(/decl/material/liquid/drink/milk, rand(5, 10))

/mob/living/simple_animal/cow/default_disarm_interaction(mob/user)
Expand Down Expand Up @@ -185,11 +189,12 @@

/mob/living/simple_animal/chick/handle_living_non_stasis_processes()
. = ..()
if(.)
amount_grown += rand(1,2)
if(amount_grown >= 100)
new /mob/living/simple_animal/chicken(src.loc)
qdel(src)
if(!.)
return FALSE
amount_grown += rand(1,2)
if(amount_grown >= 100)
new /mob/living/simple_animal/chicken(src.loc)
qdel(src)

var/global/const/MAX_CHICKENS = 50
var/global/chicken_count = 0
Expand Down Expand Up @@ -251,7 +256,9 @@ var/global/chicken_count = 0

/mob/living/simple_animal/chicken/handle_living_non_stasis_processes()
. = ..()
if(. && prob(3) && eggsleft > 0)
if(!.)
return FALSE
if(prob(3) && eggsleft > 0)
visible_message("[src] [pick("lays an egg.","squats down and croons.","begins making a huge racket.","begins clucking raucously.")]")
eggsleft--
var/obj/item/chems/food/egg/E = new(get_turf(src))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@

/mob/living/simple_animal/hostile/commanded/nanomachine/handle_living_non_stasis_processes()
. = ..()
if(.)
regen_time++
if(regen_time == 2 && current_health < get_max_health()) //slow regen
regen_time = 0
heal_overall_damage(1)
if(!.)
return FALSE
regen_time++
if(regen_time == 2 && current_health < get_max_health()) //slow regen
regen_time = 0
heal_overall_damage(1)

/mob/living/simple_animal/hostile/commanded/nanomachine/death(gibbed, deathmessage, show_dead_message)
..(null, "dissipates into thin air", "You have been destroyed.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
/mob/living/simple_animal/hostile/retaliate/malf_drone/handle_living_non_stasis_processes()
. = ..()
if(!.)
return
return FALSE

//emps and lots of damage can temporarily shut us down
if(disabled > 0)
Expand Down
2 changes: 2 additions & 0 deletions mods/content/xenobiology/slime/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@

/mob/living/slime/handle_living_non_stasis_processes()
. = ..()
if(!.)
return FALSE
set_stat(CONSCIOUS)
if(prob(30))
adjustOxyLoss(-1, do_update_health = FALSE)
Expand Down
63 changes: 33 additions & 30 deletions mods/mobs/borers/mob/borer/borer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,41 +97,44 @@

/mob/living/simple_animal/borer/handle_living_non_stasis_processes()
. = ..()
if(!. || !host || host.stat)
if(!.)
return FALSE

if(!host || host.stat)
return
if(host)

if(!stat && !host.stat)
if(prob(host.getBrainLoss()/20))
INVOKE_ASYNC(host, TYPE_PROC_REF(/mob, say), "*[pick(list("blink","blink_r","choke","aflap","drool","twitch","twitch_v","gasp"))]")

if(stat)
return

if(host.reagents.has_reagent(/decl/material/liquid/nutriment/sugar))
if(!docile)
if(controlling)
to_chat(host, SPAN_NOTICE("You feel the soporific flow of sugar in your host's blood, lulling you into docility."))
else
to_chat(src, SPAN_NOTICE("You feel the soporific flow of sugar in your host's blood, lulling you into docility."))
docile = 1
if(host.reagents.has_reagent(/decl/material/liquid/nutriment/sugar))
if(!docile)
if(controlling)
to_chat(host, SPAN_NOTICE("You feel the soporific flow of sugar in your host's blood, lulling you into docility."))
else
if(docile)
if(controlling)
to_chat(host, SPAN_NOTICE("You shake off your lethargy as the sugar leaves your host's blood."))
else
to_chat(src, SPAN_NOTICE("You shake off your lethargy as the sugar leaves your host's blood."))
docile = 0
if(chemicals < 250 && host.nutrition >= (neutered ? 200 : 50))
host.nutrition--
chemicals++
to_chat(src, SPAN_NOTICE("You feel the soporific flow of sugar in your host's blood, lulling you into docility."))
docile = TRUE
else
if(docile)
if(controlling)
if(neutered)
host.release_control()
return
if(docile)
to_chat(host, SPAN_NOTICE("You are feeling far too docile to continue controlling your host..."))
host.release_control()
return
if(prob(5))
host.adjustBrainLoss(0.1)
if(prob(host.getBrainLoss()/20))
INVOKE_ASYNC(host, TYPE_PROC_REF(/mob, say), "*[pick(list("blink","blink_r","choke","aflap","drool","twitch","twitch_v","gasp"))]")
to_chat(host, SPAN_NOTICE("You shake off your lethargy as the sugar leaves your host's blood."))
else
to_chat(src, SPAN_NOTICE("You shake off your lethargy as the sugar leaves your host's blood."))
docile = FALSE

if(chemicals < 250 && host.nutrition >= (neutered ? 200 : 50))
host.nutrition--
chemicals++
if(controlling)
if(neutered || docile)
if(docile)
to_chat(host, SPAN_NOTICE("You are feeling far too docile to continue controlling your host..."))
host.release_control()
return
if(prob(5))
host.adjustBrainLoss(0.1)

/mob/living/simple_animal/borer/Stat()
. = ..()
Expand Down

0 comments on commit 221832e

Please sign in to comment.