mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 11:07:12 +01:00
global lists global defined
This commit is contained in:
@@ -18,21 +18,21 @@ var/const/INGEST = 2
|
||||
if(!(flags & REAGENT_NOREACT))
|
||||
processing_objects |= src
|
||||
//I dislike having these here but map-objects are initialised before world/New() is called. >_>
|
||||
if(!chemical_reagents_list)
|
||||
if(!GLOB.chemical_reagents_list)
|
||||
//Chemical Reagents - Initialises all /datum/reagent into a list indexed by reagent id
|
||||
var/paths = subtypesof(/datum/reagent)
|
||||
chemical_reagents_list = list()
|
||||
GLOB.chemical_reagents_list = list()
|
||||
for(var/path in paths)
|
||||
var/datum/reagent/D = new path()
|
||||
chemical_reagents_list[D.id] = D
|
||||
if(!chemical_reactions_list)
|
||||
GLOB.chemical_reagents_list[D.id] = D
|
||||
if(!GLOB.chemical_reactions_list)
|
||||
//Chemical Reactions - Initialises all /datum/chemical_reaction into a list
|
||||
// It is filtered into multiple lists within a list.
|
||||
// For example:
|
||||
// chemical_reaction_list["plasma"] is a list of all reactions relating to plasma
|
||||
|
||||
var/paths = subtypesof(/datum/chemical_reaction)
|
||||
chemical_reactions_list = list()
|
||||
GLOB.chemical_reactions_list = list()
|
||||
|
||||
for(var/path in paths)
|
||||
|
||||
@@ -45,9 +45,9 @@ var/const/INGEST = 2
|
||||
|
||||
// Create filters based on each reagent id in the required reagents list
|
||||
for(var/id in reaction_ids)
|
||||
if(!chemical_reactions_list[id])
|
||||
chemical_reactions_list[id] = list()
|
||||
chemical_reactions_list[id] += D
|
||||
if(!GLOB.chemical_reactions_list[id])
|
||||
GLOB.chemical_reactions_list[id] = list()
|
||||
GLOB.chemical_reactions_list[id] += D
|
||||
break // Don't bother adding ourselves to other reagent ids, it is redundant.
|
||||
|
||||
/datum/reagents/proc/remove_any(amount=1)
|
||||
@@ -352,7 +352,7 @@ var/const/INGEST = 2
|
||||
do
|
||||
reaction_occured = 0
|
||||
for(var/datum/reagent/R in reagent_list) // Usually a small list
|
||||
for(var/reaction in chemical_reactions_list[R.id]) // Was a big list but now it should be smaller since we filtered it with our reagent id
|
||||
for(var/reaction in GLOB.chemical_reactions_list[R.id]) // Was a big list but now it should be smaller since we filtered it with our reagent id
|
||||
if(!reaction)
|
||||
continue
|
||||
|
||||
@@ -543,7 +543,7 @@ var/const/INGEST = 2
|
||||
handle_reactions()
|
||||
return 0
|
||||
|
||||
var/datum/reagent/D = chemical_reagents_list[reagent]
|
||||
var/datum/reagent/D = GLOB.chemical_reagents_list[reagent]
|
||||
if(D)
|
||||
|
||||
var/datum/reagent/R = new D.type()
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
|
||||
var/chemicals[0]
|
||||
for(var/re in dispensable_reagents)
|
||||
var/datum/reagent/temp = chemical_reagents_list[re]
|
||||
var/datum/reagent/temp = GLOB.chemical_reagents_list[re]
|
||||
if(temp)
|
||||
chemicals.Add(list(list("title" = temp.name, "id" = temp.id, "commands" = list("dispense" = temp.id)))) // list in a list because Byond merges the first list...
|
||||
data["chemicals"] = chemicals
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
if(archive_diseases[id])
|
||||
var/datum/disease/advance/A = archive_diseases[id]
|
||||
A.AssignName(new_name)
|
||||
for(var/datum/disease/advance/AD in active_diseases)
|
||||
for(var/datum/disease/advance/AD in GLOB.active_diseases)
|
||||
AD.Refresh()
|
||||
updateUsrDialog()
|
||||
|
||||
|
||||
@@ -332,8 +332,8 @@
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/obj/item/organ/external/head/head_organ = H.get_organ("head")
|
||||
var/datum/sprite_accessory/tmp_hair_style = hair_styles_full_list["Very Long Hair"]
|
||||
var/datum/sprite_accessory/tmp_facial_hair_style = facial_hair_styles_list["Very Long Beard"]
|
||||
var/datum/sprite_accessory/tmp_hair_style = GLOB.hair_styles_full_list["Very Long Hair"]
|
||||
var/datum/sprite_accessory/tmp_facial_hair_style = GLOB.facial_hair_styles_list["Very Long Beard"]
|
||||
|
||||
if(head_organ.dna.species.name in tmp_hair_style.species_allowed) //If 'Very Long Hair' is a style the person's species can have, give it to them.
|
||||
head_organ.h_style = "Very Long Hair"
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
|
||||
R.add_reagent(M)
|
||||
if(M.reagents)
|
||||
var/datum/reagent/injected = chemical_reagents_list[reagent_ids[mode]]
|
||||
var/datum/reagent/injected = GLOB.chemical_reagents_list[reagent_ids[mode]]
|
||||
var/contained = injected.name
|
||||
var/trans = R.trans_to(M, amount_per_transfer_from_this)
|
||||
add_attack_logs(M, user, "Injected with [name] containing [contained], transfered [trans] units")
|
||||
@@ -97,7 +97,7 @@
|
||||
mode = 1
|
||||
|
||||
charge_tick = 0 //Prevents wasted chems/cell charge if you're cycling through modes.
|
||||
var/datum/reagent/R = chemical_reagents_list[reagent_ids[mode]]
|
||||
var/datum/reagent/R = GLOB.chemical_reagents_list[reagent_ids[mode]]
|
||||
to_chat(user, "<span class='notice'>Synthesizer is now producing '[R.name]'.</span>")
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user