diff --git a/code/controllers/globals.dm b/code/controllers/globals.dm index 5ceec9978d..c92d42d82a 100644 --- a/code/controllers/globals.dm +++ b/code/controllers/globals.dm @@ -43,19 +43,22 @@ GLOBAL_REAL(GLOB, /datum/controller/global_vars) return FALSE return ..() -/datum/controller/global_vars/Initialize(var/exclude_these) +/datum/controller/global_vars/Initialize() gvars_datum_init_order = list() - gvars_datum_protected_varlist = list("gvars_datum_protected_varlist") - - //See https://github.com/tgstation/tgstation/issues/26954 - for(var/I in typesof(/datum/controller/global_vars/proc)) - var/CLEANBOT_RETURNS = "[I]" - pass(CLEANBOT_RETURNS) - - for(var/I in (vars - gvars_datum_in_built_vars)) + gvars_datum_protected_varlist = list(NAMEOF(src, gvars_datum_protected_varlist) = TRUE) + var/list/global_procs = typesof(/datum/controller/global_vars/proc) + var/expected_len = vars.len - gvars_datum_in_built_vars.len + if(global_procs.len != expected_len) + warning("Unable to detect all global initialization procs! Expected [expected_len] got [global_procs.len]!") + if(global_procs.len) + var/list/expected_global_procs = vars - gvars_datum_in_built_vars + for(var/I in global_procs) + expected_global_procs -= replacetext("[I]", "InitGlobal", "") + var/english_missing = expected_global_procs.Join(", ") + log_world("Missing procs: [english_missing]") + for(var/I in global_procs) var/start_tick = world.time - call(src, "InitGlobal[I]")() + call(src, I)() var/end_tick = world.time if(end_tick - start_tick) - warning("Global [I] slept during initialization!") - QDEL_NULL(exclude_these) \ No newline at end of file + warning("Global [replacetext("[I]", "InitGlobal", "")] slept during initialization!") diff --git a/code/modules/emotes/definitions/exertion.dm b/code/modules/emotes/definitions/exertion.dm index 9d85bbb39a..ac0061cca3 100644 --- a/code/modules/emotes/definitions/exertion.dm +++ b/code/modules/emotes/definitions/exertion.dm @@ -5,7 +5,7 @@ emote_message_3p = "is sweating heavily." /decl/emote/exertion/biological/check_user(mob/living/user) - if(istype(user) && !user.isSynthetic(skip_emote_update = TRUE)) + if(istype(user) && !user.isSynthetic()) return ..() return FALSE @@ -30,7 +30,7 @@ emote_message_3p = "USER's actuators whine with strain." /decl/emote/exertion/synthetic/check_user(mob/living/user) - if(istype(user) && user.isSynthetic(skip_emote_update = TRUE)) + if(istype(user) && user.isSynthetic()) return ..() return FALSE diff --git a/code/modules/emotes/definitions/human.dm b/code/modules/emotes/definitions/human.dm index 182e8df51a..0b4efc811a 100644 --- a/code/modules/emotes/definitions/human.dm +++ b/code/modules/emotes/definitions/human.dm @@ -1,5 +1,11 @@ +/decl/emote/human + key = "vomit" + /decl/emote/human/check_user(var/mob/living/carbon/human/user) - return istype(user) + return (istype(user))//VOREStation Edit - What does a mouth have to do with wagging?? && user.check_has_mouth() && !user.isSynthetic()) + +/decl/emote/human/do_emote(var/mob/living/carbon/human/user) + user.vomit() /decl/emote/human/deathgasp key = "deathgasp" diff --git a/code/modules/emotes/definitions/synthetics.dm b/code/modules/emotes/definitions/synthetics.dm index 659a1eff44..2e31a07f8f 100644 --- a/code/modules/emotes/definitions/synthetics.dm +++ b/code/modules/emotes/definitions/synthetics.dm @@ -4,7 +4,7 @@ emote_sound = 'sound/machines/twobeep.ogg' /decl/emote/audible/synth/check_user(var/mob/living/user) - if(istype(user) && user.isSynthetic(skip_emote_update = TRUE)) + if(istype(user) && user.isSynthetic()) return ..() return FALSE diff --git a/code/modules/emotes/definitions/visible_vomit.dm b/code/modules/emotes/definitions/visible_vomit.dm index f60522eeeb..1ec79dea6a 100644 --- a/code/modules/emotes/definitions/visible_vomit.dm +++ b/code/modules/emotes/definitions/visible_vomit.dm @@ -4,7 +4,7 @@ /decl/emote/visible/vomit/do_emote(var/atom/user, var/extra_params) if(isliving(user)) var/mob/living/M = user - if(!M.isSynthetic(skip_emote_update = TRUE)) + if(!M.isSynthetic()) M.vomit() return to_chat(src, SPAN_WARNING("You are unable to vomit.")) diff --git a/code/modules/emotes/emote_define.dm b/code/modules/emotes/emote_define.dm index 2d311f2ceb..845a5202d3 100644 --- a/code/modules/emotes/emote_define.dm +++ b/code/modules/emotes/emote_define.dm @@ -172,7 +172,7 @@ return key /decl/emote/proc/check_synthetic(var/mob/living/user) - . = istype(user) && user.isSynthetic(skip_emote_update = TRUE) + . = istype(user) && user.isSynthetic() if(!. && ishuman(user) && message_type == AUDIBLE_MESSAGE) var/mob/living/carbon/human/H = user if(H.should_have_organ(O_LUNGS)) diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index 89068554ba..e2ba25cec0 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -456,6 +456,5 @@ else return !D.check_access(ID) // it's a real, air blocking door return 0 - -/mob/living/bot/isSynthetic(var/skip_emote_update) //Robots are synthetic, no? +/mob/living/bot/isSynthetic() //Robots are synthetic, no? return 1 diff --git a/code/modules/mob/living/carbon/brain/brain.dm b/code/modules/mob/living/carbon/brain/brain.dm index fff4159f9b..89ff4151fb 100644 --- a/code/modules/mob/living/carbon/brain/brain.dm +++ b/code/modules/mob/living/carbon/brain/brain.dm @@ -42,7 +42,7 @@ canmove = 0 return canmove -/mob/living/carbon/brain/isSynthetic(var/skip_emote_update) +/mob/living/carbon/brain/isSynthetic() return istype(loc, /obj/item/device/mmi) /mob/living/carbon/brain/set_typing_indicator(var/state) diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index 794f0f1308..a705f03450 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -33,6 +33,7 @@ var/list/_human_default_emotes = list( /decl/emote/audible/grunt, /decl/emote/audible/slap, /decl/emote/audible/crack, + /decl/emote/human, /decl/emote/human/deathgasp, /decl/emote/audible/giggle, /decl/emote/audible/scream, diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index c46e179ac3..20ac966e40 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -97,21 +97,8 @@ // This is the 'mechanical' check for synthetic-ness, not appearance // Returns the company that made the synthetic -/mob/living/carbon/human/isSynthetic(var/skip_emote_update) - if(synthetic) - return synthetic //Your synthetic-ness is not going away - var/obj/item/organ/external/T = organs_by_name[BP_TORSO] - if(T && T.robotic >= ORGAN_ROBOT) - src.verbs += /mob/living/carbon/human/proc/self_diagnostics - src.verbs += /mob/living/carbon/human/proc/setmonitor_state//YWadd, early port, remove comment when it comes from upstream - src.verbs += /mob/living/carbon/human/proc/reagent_purge //VOREStation Add - src.verbs += /mob/living/carbon/human/proc/setmonitor_state - var/datum/robolimb/R = all_robolimbs[T.model] - synthetic = R - if(!skip_emote_update) - update_emotes() - return synthetic - return FALSE +/mob/living/carbon/human/isSynthetic() + return synthetic // Would an onlooker know this person is synthetic? // Based on sort of logical reasoning, 'Look at head, look at torso' diff --git a/code/modules/mob/living/carbon/human/human_powers.dm b/code/modules/mob/living/carbon/human/human_powers.dm index d7c66d5289..33fb57356b 100644 --- a/code/modules/mob/living/carbon/human/human_powers.dm +++ b/code/modules/mob/living/carbon/human/human_powers.dm @@ -217,8 +217,7 @@ if(isSynthetic()) output += "Current Battery Charge: [nutrition]\n" - - if(isSynthetic()) + var/toxDam = getToxLoss() if(toxDam) output += "System Instability: [toxDam > 25 ? "Severe" : "Moderate"]. Seek charging station for cleanup.\n" diff --git a/code/modules/mob/living/simple_mob/subtypes/mechanical/mechanical.dm b/code/modules/mob/living/simple_mob/subtypes/mechanical/mechanical.dm index beba4b35fc..e6c997fc63 100644 --- a/code/modules/mob/living/simple_mob/subtypes/mechanical/mechanical.dm +++ b/code/modules/mob/living/simple_mob/subtypes/mechanical/mechanical.dm @@ -18,8 +18,8 @@ poison_resist = 1.0 shock_resist = -0.5 -/mob/living/simple_mob/mechanical/isSynthetic(var/skip_emote_update) +/mob/living/simple_mob/mechanical/isSynthetic() return TRUE /mob/living/simple_mob/mechanical/speech_bubble_appearance() - return faction != "neutral" ? "synthetic_evil" : "machine" \ No newline at end of file + return faction != "neutral" ? "synthetic_evil" : "machine" diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 7a9ad45242..f21ada00f7 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1073,7 +1073,7 @@ mob/verb/shifteast() if(src.throw_icon) src.throw_icon.icon_state = "act_throw_on" -/mob/proc/isSynthetic(var/skip_emote_update) +/mob/proc/isSynthetic() return 0 /mob/proc/is_muzzled() diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 4679565c60..3df55d2715 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -33,7 +33,7 @@ return L.mob_size <= MOB_MINISCULE return 0 -/mob/living/silicon/isSynthetic(var/skip_emote_update) +/mob/living/silicon/isSynthetic() return 1 /mob/proc/isMonkey() diff --git a/code/modules/organs/internal/stomach.dm b/code/modules/organs/internal/stomach.dm index 2ebfefea61..390a86db44 100644 --- a/code/modules/organs/internal/stomach.dm +++ b/code/modules/organs/internal/stomach.dm @@ -58,6 +58,8 @@ acidtype = "sacid" + organ_verbs = list(/mob/living/carbon/human/proc/reagent_purge) //VOREStation Add + /obj/item/organ/internal/stomach/machine/handle_organ_proc_special() ..() if(owner && owner.stat != DEAD) diff --git a/code/modules/organs/subtypes/nano.dm b/code/modules/organs/subtypes/nano.dm index f00a1763ed..a84573d35f 100644 --- a/code/modules/organs/subtypes/nano.dm +++ b/code/modules/organs/subtypes/nano.dm @@ -89,6 +89,10 @@ organ_tag = O_ORCH parent_organ = BP_TORSO vital = TRUE + organ_verbs = list( + /mob/living/carbon/human/proc/self_diagnostics, + /mob/living/carbon/human/proc/reagent_purge + ) /obj/item/organ/internal/nano/refactory name = "refactory module" diff --git a/code/modules/organs/subtypes/standard.dm b/code/modules/organs/subtypes/standard.dm index 85b6328472..e175a5c920 100644 --- a/code/modules/organs/subtypes/standard.dm +++ b/code/modules/organs/subtypes/standard.dm @@ -24,14 +24,23 @@ base_miss_chance = 10 /obj/item/organ/external/chest/robotize() - if(..() && robotic != ORGAN_NANOFORM) //VOREStation Edit - // Give them fancy new organs. - owner.internal_organs_by_name[O_CELL] = new /obj/item/organ/internal/cell(owner,1) - owner.internal_organs_by_name[O_VOICE] = new /obj/item/organ/internal/voicebox/robot(owner, 1) - owner.internal_organs_by_name[O_PUMP] = new /obj/item/organ/internal/heart/machine(owner,1) - owner.internal_organs_by_name[O_CYCLER] = new /obj/item/organ/internal/stomach/machine(owner,1) - owner.internal_organs_by_name[O_HEATSINK] = new /obj/item/organ/internal/robotic/heatsink(owner,1) - owner.internal_organs_by_name[O_DIAGNOSTIC] = new /obj/item/organ/internal/robotic/diagnostic(owner,1) + if(..() && owner) + if(robotic != ORGAN_NANOFORM) //VOREStation Edit + // Give them fancy new organs. + owner.internal_organs_by_name[O_CELL] = new /obj/item/organ/internal/cell(owner,1) + owner.internal_organs_by_name[O_VOICE] = new /obj/item/organ/internal/voicebox/robot(owner, 1) + owner.internal_organs_by_name[O_PUMP] = new /obj/item/organ/internal/heart/machine(owner,1) + owner.internal_organs_by_name[O_CYCLER] = new /obj/item/organ/internal/stomach/machine(owner,1) + owner.internal_organs_by_name[O_HEATSINK] = new /obj/item/organ/internal/robotic/heatsink(owner,1) + owner.internal_organs_by_name[O_DIAGNOSTIC] = new /obj/item/organ/internal/robotic/diagnostic(owner,1) + + var/datum/robolimb/R = all_robolimbs[model] // company should be set in parent by now + if(!R) + log_error("A torso was robotize() but has no model that can be found: [model]. May affect FBPs.") + owner.synthetic = R + owner.update_emotes() + return FALSE + /obj/item/organ/external/chest/handle_germ_effects() . = ..() //Should return an infection level @@ -279,7 +288,14 @@ return ..() /obj/item/organ/external/head/robotize(var/company, var/skip_prosthetics, var/keep_organs) - return ..(company, skip_prosthetics, 1) + . = ..(company, skip_prosthetics, 1) + if(model) + var/datum/robolimb/robohead = all_robolimbs[model] + if(robohead?.monitor_styles && robohead?.monitor_icon) + LAZYDISTINCTADD(organ_verbs, /mob/living/carbon/human/proc/setmonitor_state) + else + LAZYREMOVE(organ_verbs, /mob/living/carbon/human/proc/setmonitor_state) + handle_organ_mod_special() /obj/item/organ/external/head/removed() if(owner)