mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
[MIRROR] Conversion many Globals to Managed Globals (Part 1) (#10665)
Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
06f0821bcf
commit
f7219329ca
@@ -529,7 +529,7 @@
|
||||
if(damage_desc)
|
||||
var/fix_verb = (damage_amount > repair_amount) ? "patches" : "finishes patching"
|
||||
if(user == src.owner)
|
||||
var/datum/gender/T = gender_datums[user.get_visible_gender()]
|
||||
var/datum/gender/T = GLOB.gender_datums[user.get_visible_gender()]
|
||||
user.visible_message(span_infoplain(span_bold("\The [user]") + " [fix_verb] [damage_desc] on [T.his] [src.name] with [tool]."))
|
||||
else
|
||||
user.visible_message(span_infoplain(span_bold("\The [user]") + " [fix_verb] [damage_desc] on [owner]'s [src.name] with [tool]."))
|
||||
@@ -1204,9 +1204,9 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
|
||||
if(company)
|
||||
model = company
|
||||
var/datum/robolimb/R = all_robolimbs[company]
|
||||
var/datum/robolimb/R = GLOB.all_robolimbs[company]
|
||||
if(!R || (data.get_species_name() in R.species_cannot_use))
|
||||
R = basic_robolimb
|
||||
R = GLOB.basic_robolimb
|
||||
if(R)
|
||||
force_icon = R.icon
|
||||
brute_mod *= R.robo_brute_mod
|
||||
|
||||
@@ -17,7 +17,7 @@ GLOBAL_LIST_EMPTY(limb_icon_cache)
|
||||
s_col = null
|
||||
h_col = null
|
||||
if(robotic >= ORGAN_ROBOT)
|
||||
var/datum/robolimb/franchise = all_robolimbs[model]
|
||||
var/datum/robolimb/franchise = GLOB.all_robolimbs[model]
|
||||
if(!(franchise && franchise.skin_tone) && !(franchise && franchise.skin_color))
|
||||
if(human.synth_color)
|
||||
s_col = list(human.r_synth, human.g_synth, human.b_synth)
|
||||
@@ -35,7 +35,7 @@ GLOBAL_LIST_EMPTY(limb_icon_cache)
|
||||
s_col = null
|
||||
h_col = null
|
||||
if(robotic >= ORGAN_ROBOT)
|
||||
var/datum/robolimb/franchise = all_robolimbs[model]
|
||||
var/datum/robolimb/franchise = GLOB.all_robolimbs[model]
|
||||
if(!(franchise && franchise.skin_tone) && !(franchise && franchise.skin_color))
|
||||
return
|
||||
if(!isnull(data.skin_tone) && (data.get_species_appearance_flags() & HAS_SKIN_TONE))
|
||||
@@ -281,7 +281,7 @@ var/list/robot_hud_colours = list("#CFCFCF","#AFAFAF","#8F8F8F","#6F6F6F","#4F4F
|
||||
var/b = 0.11 * int
|
||||
temp.color = list(r, r, r, g, g, g, b, b, b)
|
||||
else if(model)
|
||||
var/datum/robolimb/R = all_robolimbs[model]
|
||||
var/datum/robolimb/R = GLOB.all_robolimbs[model]
|
||||
if(istype(R))
|
||||
var/r = 0.30 * R.health_hud_intensity
|
||||
var/g = 0.59 * R.health_hud_intensity
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
var/list/all_robolimbs = list()
|
||||
var/list/robolimb_data = list()
|
||||
var/list/chargen_robolimbs = list()
|
||||
var/datum/robolimb/basic_robolimb
|
||||
GLOBAL_LIST_EMPTY(all_robolimbs)
|
||||
GLOBAL_LIST_EMPTY(robolimb_data)
|
||||
GLOBAL_LIST_EMPTY(chargen_robolimbs)
|
||||
GLOBAL_DATUM(basic_robolimb, /datum/robolimb)
|
||||
var/const/standard_monitor_styles = "blank=ipc_blank;\
|
||||
pink=ipc_pink;\
|
||||
green=ipc_green;\
|
||||
@@ -26,20 +26,20 @@ var/const/standard_monitor_styles = "blank=ipc_blank;\
|
||||
database=ipc_database"
|
||||
|
||||
/proc/populate_robolimb_list()
|
||||
basic_robolimb = new()
|
||||
GLOB.basic_robolimb = new()
|
||||
for(var/limb_type in typesof(/datum/robolimb))
|
||||
var/datum/robolimb/R = new limb_type()
|
||||
all_robolimbs[R.company] = R
|
||||
GLOB.all_robolimbs[R.company] = R
|
||||
if(!R.unavailable_at_chargen)
|
||||
chargen_robolimbs[R.company] = R //List only main brands and solo parts.
|
||||
GLOB.chargen_robolimbs[R.company] = R //List only main brands and solo parts.
|
||||
|
||||
for(var/company in all_robolimbs)
|
||||
var/datum/robolimb/R = all_robolimbs[company]
|
||||
for(var/company in GLOB.all_robolimbs)
|
||||
var/datum/robolimb/R = GLOB.all_robolimbs[company]
|
||||
if(R.species_alternates)
|
||||
for(var/species in R.species_alternates)
|
||||
var/species_company = R.species_alternates[species]
|
||||
if(species_company in all_robolimbs)
|
||||
R.species_alternates[species] = all_robolimbs[species_company]
|
||||
if(species_company in GLOB.all_robolimbs)
|
||||
R.species_alternates[species] = GLOB.all_robolimbs[species_company]
|
||||
|
||||
/datum/robolimb
|
||||
var/company = "Unbranded" // Shown when selecting the limb.
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
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
|
||||
var/datum/robolimb/R = GLOB.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
|
||||
@@ -300,7 +300,7 @@
|
||||
/obj/item/organ/external/head/robotize(var/company, var/skip_prosthetics, var/keep_organs)
|
||||
. = ..(company, skip_prosthetics, 1)
|
||||
if(model)
|
||||
var/datum/robolimb/robohead = all_robolimbs[model]
|
||||
var/datum/robolimb/robohead = GLOB.all_robolimbs[model]
|
||||
if(robohead?.monitor_styles && robohead?.monitor_icon)
|
||||
LAZYDISTINCTADD(organ_verbs, /mob/living/carbon/human/proc/setmonitor_state)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user