From 641af24a2dee9306e67e918c4c827905cb3cabc6 Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Wed, 5 Jul 2017 16:32:22 -0400 Subject: [PATCH] Removes a bunch fo Spawns in Life --- .../mob/living/carbon/alien/humanoid/life.dm | 16 ++++----- .../mob/living/carbon/alien/larva/life.dm | 5 ++- code/modules/mob/living/carbon/carbon.dm | 3 +- code/modules/mob/living/carbon/human/death.dm | 3 +- code/modules/mob/living/carbon/human/life.dm | 4 +-- .../living/carbon/human/species/plasmaman.dm | 9 ++--- .../living/carbon/human/species/species.dm | 18 ++++------ code/modules/mob/living/carbon/life.dm | 35 ++++++++----------- code/modules/mob/living/carbon/slime/slime.dm | 31 +++++++--------- 9 files changed, 48 insertions(+), 76 deletions(-) diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm index e6a2f6567c2..4be2cbdb390 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/life.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm @@ -22,15 +22,13 @@ if(disabilities & COUGHING) if((prob(5) && paralysis <= 1)) drop_item() - spawn( 0 ) - emote("cough") - return + emote("cough") + return if(disabilities & TOURETTES) if((prob(10) && paralysis <= 1)) Stun(10) - spawn( 0 ) - emote("twitch") - return + emote("twitch") + return if(disabilities & NERVOUS) if(prob(10)) stuttering = max(10, stuttering) @@ -68,8 +66,7 @@ //UNCONSCIOUS. NO-ONE IS HOME if((getOxyLoss() > 50) || (config.health_threshold_crit >= health)) if(health <= 20 && prob(1)) - spawn(0) - emote("gasp") + emote("gasp") if(!reagents.has_reagent("epinephrine")) adjustOxyLoss(1) Paralyse(3) @@ -81,8 +78,7 @@ blinded = 1 stat = UNCONSCIOUS if(prob(10) && health) - spawn(0) - emote("hiss") + emote("hiss") //CONSCIOUS else stat = CONSCIOUS diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index 447f65c6744..8366a7d02a8 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -40,9 +40,8 @@ else if(sleeping) blinded = 1 stat = UNCONSCIOUS - if( prob(10) && health ) - spawn(0) - emote("hiss_") + if(prob(10) && health) + emote("hiss_") //CONSCIOUS else stat = CONSCIOUS diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index dd18495cc70..fa6a3f8a92b 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -126,8 +126,7 @@ if(isturf(loc)) I.remove(src) I.forceMove(get_turf(src)) - spawn() - I.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),5) + I.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),5) for(var/mob/M in src) if(M in src.stomach_contents) diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index beaca58d74d..9b035dce404 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -19,8 +19,7 @@ if(isturf(loc)) var/atom/movable/thing = I.remove(src) thing.forceMove(get_turf(src)) - spawn() - thing.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),5) + thing.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),5) for(var/obj/item/organ/external/E in bodyparts) if(istype(E, /obj/item/organ/external/chest)) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index cba5e4eb458..4ddf987b7e7 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -259,7 +259,7 @@ if(losebreath > 0) AdjustLoseBreath(-1) if(prob(10)) - spawn emote("gasp") + emote("gasp") if(istype(loc, /obj/)) var/obj/loc_as_obj = loc loc_as_obj.handle_internal_lifeform(src, 0) @@ -1090,7 +1090,7 @@ // Humans can lack a mind datum, y'know if(H.mind && (H.mind.assigned_role == "Detective" || H.mind.assigned_role == "Coroner")) return //too cool for puke - to_chat(H, "You smell something foul...") + to_chat(H, "You smell something foul...") H.fakevomit() /mob/living/carbon/human/proc/handle_heartbeat() diff --git a/code/modules/mob/living/carbon/human/species/plasmaman.dm b/code/modules/mob/living/carbon/human/species/plasmaman.dm index 4563fb2029f..7e6914b603a 100644 --- a/code/modules/mob/living/carbon/human/species/plasmaman.dm +++ b/code/modules/mob/living/carbon/human/species/plasmaman.dm @@ -166,8 +166,7 @@ if(Toxins_pp < safe_plasma_min) if(prob(20)) - spawn(0) - H.emote("gasp") + H.emote("gasp") if(Toxins_pp > 0) var/ratio = safe_plasma_min/Toxins_pp H.adjustOxyLoss(min(5*ratio, HUMAN_MAX_OXYLOSS)) // Don't fuck them up too fast (space only does HUMAN_MAX_OXYLOSS after all!) @@ -198,8 +197,7 @@ if(world.time - H.co2overloadtime > 300) // They've been in here 30s now, lets start to kill them for their own good! H.adjustOxyLoss(8) if(prob(20)) // Lets give them some chance to know somethings not right though I guess. - spawn(0) - H.emote("cough") + H.emote("cough") else H.co2overloadtime = 0 @@ -213,8 +211,7 @@ H.AdjustSleeping(8, bound_lower = 0, bound_upper = 10) else if(SA_pp > 0.15) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning if(prob(20)) - spawn(0) - H.emote(pick("giggle", "laugh")) + H.emote(pick("giggle", "laugh")) SA.moles = 0 if(abs(310.15 - breath.temperature) > 50) // Hot air hurts :( diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 8f547b7db15..a00e183c10a 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -227,8 +227,7 @@ if(O2_pp < atmos_requirements["min_oxy"]) if(prob(20)) - spawn(0) - H.emote("gasp") + H.emote("gasp") H.failed_last_breath = 1 if(O2_pp > 0) @@ -250,8 +249,7 @@ if(N2_pp < atmos_requirements["min_nitro"]) if(prob(20)) - spawn(0) - H.emote("gasp") + H.emote("gasp") H.failed_last_breath = 1 if(N2_pp > 0) @@ -273,8 +271,7 @@ if(Tox_pp < atmos_requirements["min_tox"]) if(prob(20)) - spawn(0) - H.emote("gasp") + H.emote("gasp") H.failed_last_breath = 1 if(Tox_pp > 0) @@ -297,8 +294,7 @@ if(CO2_pp < atmos_requirements["min_co2"]) if(prob(20)) - spawn(0) - H.emote("gasp") + H.emote("gasp") H.failed_last_breath = 1 if(CO2_pp) @@ -316,8 +312,7 @@ if(world.time - H.co2overloadtime > 300) // They've been in here 30s now, lets start to kill them for their own good! H.adjustOxyLoss(8) if(prob(20)) // Lets give them some chance to know somethings not right though I guess. - spawn(0) - H.emote("cough") + H.emote("cough") else H.clear_alert("co2") H.co2overloadtime = 0 @@ -343,8 +338,7 @@ H.AdjustSleeping(8, bound_lower = 0, bound_upper = 10) else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning if(prob(20)) - spawn(0) - H.emote(pick("giggle", "laugh")) + H.emote(pick("giggle", "laugh")) handle_temperature(breath, H) return 1 diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index cbfc9ddbfdf..b448732fe8c 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -54,7 +54,7 @@ if(losebreath > 0) AdjustLoseBreath(-1) if(prob(10)) - spawn emote("gasp") + emote("gasp") if(istype(loc, /obj/)) var/obj/loc_as_obj = loc loc_as_obj.handle_internal_lifeform(src, 0) @@ -114,8 +114,7 @@ //OXYGEN if(O2_partialpressure < safe_oxy_min) //Not enough oxygen if(prob(20)) - spawn(0) - emote("gasp") + emote("gasp") if(O2_partialpressure > 0) var/ratio = safe_oxy_min/O2_partialpressure adjustOxyLoss(min(5*ratio, 3)) @@ -145,7 +144,7 @@ if(world.time - co2overloadtime > 300) adjustOxyLoss(8) if(prob(20)) - spawn(0) emote("cough") + emote("cough") else co2overloadtime = 0 @@ -168,7 +167,7 @@ AdjustSleeping(2, bound_lower = 0, bound_upper = 10) else if(SA_partialpressure > 0.01) if(prob(20)) - spawn(0) emote(pick("giggle","laugh")) + emote(pick("giggle","laugh")) //BREATH TEMPERATURE handle_breath_temperature(breath) @@ -236,21 +235,18 @@ wetlevel = max(wetlevel - 1,0) /mob/living/carbon/handle_stomach() - spawn(0) - for(var/mob/living/M in stomach_contents) - if(M.loc != src) + for(var/mob/living/M in stomach_contents) + if(M.loc != src) + stomach_contents.Remove(M) + continue + if(stat != DEAD) + if(M.stat == DEAD) stomach_contents.Remove(M) + qdel(M) continue - if(istype(M, /mob/living) && stat != 2) - if(M.stat == 2) - M.death(1) - stomach_contents.Remove(M) - qdel(M) - continue - if(mob_master.current_cycle%3==1) - if(!(M.status_flags & GODMODE)) - M.adjustBruteLoss(5) - nutrition += 10 + if(mob_master.current_cycle%3==1) + M.adjustBruteLoss(5) + nutrition += 10 //This updates the health and status of the mob (conscious, unconscious, dead) /mob/living/carbon/handle_regular_status_updates() @@ -347,8 +343,7 @@ handle_dreams() adjustStaminaLoss(-10) if(prob(10) && health && hal_screwyhud != SCREWYHUD_CRIT) - spawn(0) - emote("snore") + emote("snore") // Keep SSD people asleep if(player_logged) Sleeping(2) diff --git a/code/modules/mob/living/carbon/slime/slime.dm b/code/modules/mob/living/carbon/slime/slime.dm index 94ae7482437..28e457fd128 100644 --- a/code/modules/mob/living/carbon/slime/slime.dm +++ b/code/modules/mob/living/carbon/slime/slime.dm @@ -281,11 +281,9 @@ if(prob(90) && !client) Discipline++ - spawn() - SStun = 1 - sleep(rand(45,60)) - if(src) - SStun = 0 + SStun = 1 + spawn(rand(45,60)) + SStun = 0 Victim = null anchored = 0 @@ -309,11 +307,9 @@ if(Discipline == 1) attacked = 0 - spawn() - SStun = 1 - sleep(rand(55,65)) - if(src) - SStun = 0 + SStun = 1 + spawn(rand(55,65)) + SStun = 0 Victim = null anchored = 0 @@ -439,9 +435,8 @@ if(Discipline == 1) attacked = 0 - spawn() - SStun = 1 - sleep(rand(5,20)) + SStun = 1 + spawn(rand(5,20)) SStun = 0 spawn(0) @@ -491,9 +486,8 @@ Target = null anchored = 0 - spawn() - SStun = 1 - sleep(rand(5,20)) + SStun = 1 + spawn(rand(5,20)) SStun = 0 spawn(0) @@ -513,9 +507,8 @@ Discipline++ if(Discipline == 1) attacked = 0 - spawn() - SStun = 1 - sleep(rand(5,20)) + SStun = 1 + spawn(rand(5,20)) SStun = 0 Victim = null