mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
[MIRROR] code/global.dm => code/_global_vars/ (#10689)
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
a7718c6177
commit
f04f992cfe
@@ -440,7 +440,7 @@
|
||||
/datum/component/overlay_lighting/proc/cast_directional_light()
|
||||
var/final_distance = cast_range
|
||||
|
||||
//Lower the distance by 1 if we're not looking at a cardinal direction, and we're not a short cast
|
||||
//Lower the distance by 1 if we're not looking at a GLOB.cardinal direction, and we're not a short cast
|
||||
if(final_distance > SHORT_CAST && !(ALL_CARDINALS & current_direction))
|
||||
final_distance -= 1
|
||||
var/turf/scanning = get_turf(current_holder)
|
||||
@@ -448,7 +448,7 @@
|
||||
. = 0
|
||||
for(var/i in 1 to final_distance)
|
||||
var/turf/next_turf = get_step(scanning, current_direction)
|
||||
if(isnull(next_turf) || IS_OPAQUE_TURF_DIR(next_turf, reverse_dir[current_direction]))
|
||||
if(isnull(next_turf) || IS_OPAQUE_TURF_DIR(next_turf, GLOB.reverse_dir[current_direction]))
|
||||
break
|
||||
scanning = next_turf
|
||||
.++
|
||||
@@ -460,7 +460,7 @@
|
||||
/datum/component/overlay_lighting/proc/place_directional_light(turf/target)
|
||||
var/final_distance = round(cast_range*2)
|
||||
|
||||
//Lower the distance by 1 if we're not looking at a cardinal direction, and we're not a short cast
|
||||
//Lower the distance by 1 if we're not looking at a GLOB.cardinal direction, and we're not a short cast
|
||||
if(final_distance > SHORT_CAST && !(ALL_CARDINALS & get_dir(GET_PARENT, target)))
|
||||
final_distance -= 1
|
||||
var/turf/scanning = get_turf(GET_PARENT)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
/hook/startup/proc/createDatacore()
|
||||
data_core = new /datum/datacore()
|
||||
GLOB.data_core = new /datum/datacore()
|
||||
return 1
|
||||
|
||||
/datum/datacore
|
||||
@@ -40,12 +40,12 @@
|
||||
.manifest tr.alt td {[monochrome?"border-top-width: 2px":"background-color: [OOC?"#373737; color:white":"#DEF"]"]}
|
||||
</style></head>
|
||||
<table class="manifest" width='350px'>
|
||||
[snowflake?"<tr><th colspan=3 style = \"background-color: #026e6a\"><b>Online players:</b> [TGS_CLIENT_COUNT]</th></tr><tr><th colspan=3 style = \"background-color: #027a76\"><b>Crew members:</b> [data_core.general.len]</th></tr><tr class='head'>":""]
|
||||
[snowflake?"<tr><th colspan=3 style = \"background-color: #026e6a\"><b>Online players:</b> [TGS_CLIENT_COUNT]</th></tr><tr><th colspan=3 style = \"background-color: #027a76\"><b>Crew members:</b> [GLOB.data_core.general.len]</th></tr><tr class='head'>":""]
|
||||
<tr class='head'><th>Name</th><th>Rank</th><th>Activity</th></tr>
|
||||
"} //Also a chompstation edit with the snowflake stuff on line 43
|
||||
var/even = 0
|
||||
// sort mobs
|
||||
for(var/datum/data/record/t in data_core.general)
|
||||
for(var/datum/data/record/t in GLOB.data_core.general)
|
||||
var/name = t.fields["name"]
|
||||
var/rank = t.fields["rank"]
|
||||
var/real_rank = make_list_rank(t.fields["real_rank"])
|
||||
@@ -207,7 +207,7 @@ GLOBAL_LIST_EMPTY(PDA_Manifest)
|
||||
var/list/civ = list()
|
||||
var/list/bot = list()
|
||||
var/list/misc = list()
|
||||
for(var/datum/data/record/t in data_core.general)
|
||||
for(var/datum/data/record/t in GLOB.data_core.general)
|
||||
var/name = sanitize(t.fields["name"])
|
||||
var/rank = sanitize(t.fields["rank"])
|
||||
var/real_rank = make_list_rank(t.fields["real_rank"])
|
||||
@@ -307,7 +307,7 @@ GLOBAL_LIST_EMPTY(PDA_Manifest)
|
||||
var/datum/data/record/foundrecord
|
||||
var/real_title = assignment
|
||||
|
||||
for(var/datum/data/record/t in data_core.general)
|
||||
for(var/datum/data/record/t in GLOB.data_core.general)
|
||||
if (t)
|
||||
if(t.fields["name"] == name)
|
||||
foundrecord = t
|
||||
@@ -540,13 +540,13 @@ GLOBAL_LIST_EMPTY(PDA_Manifest)
|
||||
GLOB.PDA_Manifest.Cut()
|
||||
|
||||
/proc/find_general_record(field, value)
|
||||
return find_record(field, value, data_core.general)
|
||||
return find_record(field, value, GLOB.data_core.general)
|
||||
|
||||
/proc/find_medical_record(field, value)
|
||||
return find_record(field, value, data_core.medical)
|
||||
return find_record(field, value, GLOB.data_core.medical)
|
||||
|
||||
/proc/find_security_record(field, value)
|
||||
return find_record(field, value, data_core.security)
|
||||
return find_record(field, value, GLOB.data_core.security)
|
||||
|
||||
/proc/find_record(field, value, list/L)
|
||||
for(var/datum/data/record/R in L)
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
DD.start_cure_timer()
|
||||
viruses += DD
|
||||
DD.affected_mob = src
|
||||
active_diseases += DD
|
||||
GLOB.active_diseases += DD
|
||||
|
||||
var/list/skipped = list("affected_mob", "holder", "carrier", "stage", "type", "parent_type", "vars", "transformed")
|
||||
if(respect_carrier)
|
||||
|
||||
@@ -46,7 +46,7 @@ GLOBAL_LIST_INIT(diseases, subtypesof(/datum/disease))
|
||||
|
||||
/datum/disease/Destroy()
|
||||
affected_mob = null
|
||||
active_diseases.Remove(src)
|
||||
GLOB.active_diseases.Remove(src)
|
||||
if(processing)
|
||||
End()
|
||||
return ..()
|
||||
|
||||
@@ -376,7 +376,7 @@ GLOBAL_LIST_INIT(advance_cures, list(
|
||||
D.AssignName(new_name)
|
||||
D.Refresh()
|
||||
|
||||
for(var/datum/disease/advance/AD in active_diseases)
|
||||
for(var/datum/disease/advance/AD in GLOB.active_diseases)
|
||||
AD.Refresh()
|
||||
|
||||
H = tgui_input_list(usr, "Choose infectee", "Infectees", human_mob_list)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
/datum/game_master/default/choose_event()
|
||||
log_game_master("Now starting event decision.")
|
||||
|
||||
var/list/most_active_departments = metric.assess_all_departments(3, list(last_department_used))
|
||||
var/list/most_active_departments = GLOB.metric.assess_all_departments(3, list(last_department_used))
|
||||
var/list/best_events = decide_best_events(most_active_departments)
|
||||
|
||||
if(LAZYLEN(best_events))
|
||||
|
||||
@@ -26,21 +26,16 @@
|
||||
// Mostly used for data_core records, but unfortuantely used some other places too. But mostly here, so lets make a good effort.
|
||||
// TODO - Some machines/computers might be holding references to us. Lets look into that, but at least for now lets make sure that the manifest is cleaned up.
|
||||
/datum/data/record/Destroy(var/force)
|
||||
if(data_core.locked.Find(src))
|
||||
if(GLOB.data_core.locked.Find(src))
|
||||
if(!force)
|
||||
stack_trace("Someone tried to qdel a record that was in data_core.locked [log_info_line(src)]")
|
||||
stack_trace("Someone tried to qdel a record that was in GLOB.data_core.locked [log_info_line(src)]")
|
||||
return QDEL_HINT_LETMELIVE
|
||||
data_core.locked -= src
|
||||
data_core.medical -= src
|
||||
data_core.general -= src
|
||||
data_core.security -= src
|
||||
GLOB.data_core.locked -= src
|
||||
GLOB.data_core.medical -= src
|
||||
GLOB.data_core.general -= src
|
||||
GLOB.data_core.security -= src
|
||||
. = ..()
|
||||
|
||||
/datum/data/text
|
||||
name = "text"
|
||||
var/data = null
|
||||
|
||||
|
||||
|
||||
/datum/debug
|
||||
var/list/debuglist
|
||||
|
||||
@@ -21,13 +21,13 @@ var/list/modules = list( // global associative list
|
||||
|
||||
var/type = O.type // the type of the creating object
|
||||
|
||||
var/mneed = mods.inmodlist(type) // find if this type has modules defined
|
||||
var/mneed = GLOB.mods.inmodlist(type) // find if this type has modules defined
|
||||
|
||||
if(!mneed) // not found in module list?
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
var/needed = mods.getbitmask(type) // get a bitmask for the number of modules in this object
|
||||
var/needed = GLOB.mods.getbitmask(type) // get a bitmask for the number of modules in this object
|
||||
status = needed
|
||||
installed = needed
|
||||
|
||||
|
||||
@@ -41,11 +41,11 @@
|
||||
var/obj/item/card/id/I = user.GetIdCard()
|
||||
var/datum/data/record/random_general_record
|
||||
var/datum/data/record/random_medical_record
|
||||
if(data_core.general.len)
|
||||
random_general_record = pick(data_core.general)
|
||||
if(GLOB.data_core.general.len)
|
||||
random_general_record = pick(GLOB.data_core.general)
|
||||
random_medical_record = find_medical_record("id", random_general_record.fields["id"])
|
||||
|
||||
var/datum/data/record/general = data_core.CreateGeneralRecord(user)
|
||||
var/datum/data/record/general = GLOB.data_core.CreateGeneralRecord(user)
|
||||
if(I)
|
||||
general.fields["age"] = I.age
|
||||
general.fields["rank"] = I.assignment
|
||||
@@ -66,8 +66,8 @@
|
||||
general.fields["sex"] = capitalize(user.gender)
|
||||
|
||||
general.fields["species"] = user.get_species()
|
||||
var/datum/data/record/medical = data_core.CreateMedicalRecord(general.fields["name"], general.fields["id"])
|
||||
data_core.CreateSecurityRecord(general.fields["name"], general.fields["id"])
|
||||
var/datum/data/record/medical = GLOB.data_core.CreateMedicalRecord(general.fields["name"], general.fields["id"])
|
||||
GLOB.data_core.CreateSecurityRecord(general.fields["name"], general.fields["id"])
|
||||
|
||||
if(!random_general_record)
|
||||
general.fields["citizenship"] = random_general_record.fields["citizenship"]
|
||||
|
||||
Reference in New Issue
Block a user