From 97527cbd8214b333559aafa7b161298e70e99730 Mon Sep 17 00:00:00 2001 From: Fox McCloud Date: Mon, 9 Mar 2020 18:15:20 -0400 Subject: [PATCH 01/16] Hypoglycemia --- code/__DEFINES/genetics.dm | 1 + code/datums/diseases/critical.dm | 76 +++++++++++++++++-- .../mob/living/carbon/human/examine.dm | 4 +- code/modules/mob/living/carbon/human/life.dm | 4 + 4 files changed, 78 insertions(+), 7 deletions(-) diff --git a/code/__DEFINES/genetics.dm b/code/__DEFINES/genetics.dm index c8f98c1fbeb..81790096e64 100644 --- a/code/__DEFINES/genetics.dm +++ b/code/__DEFINES/genetics.dm @@ -104,6 +104,7 @@ #define NUTRITION_LEVEL_FED 350 #define NUTRITION_LEVEL_HUNGRY 250 #define NUTRITION_LEVEL_STARVING 150 +#define NUTRITION_LEVEL_HYPOGLYCEMIA 100 #define NUTRITION_LEVEL_CURSED 0 //Used as an upper limit for species that continuously gain nutriment diff --git a/code/datums/diseases/critical.dm b/code/datums/diseases/critical.dm index 37d77687d8c..71b387428c6 100644 --- a/code/datums/diseases/critical.dm +++ b/code/datums/diseases/critical.dm @@ -6,12 +6,17 @@ if(prob(stage_prob)) stage = min(stage + 1, max_stages) + if(has_cure()) + cure() + return FALSE + return TRUE + +/datum/disease/critical/has_cure() for(var/C_id in cures) if(affected_mob.reagents.has_reagent(C_id)) if(prob(cure_chance)) - cure() - return FALSE - return TRUE + return TRUE + return FALSE /datum/disease/critical/shock name = "Shock" @@ -31,7 +36,7 @@ /datum/disease/critical/shock/stage_act() if(..()) - if(affected_mob.health >= 25) + if(affected_mob.health >= 25 && affected_mob.nutrition >= NUTRITION_LEVEL_HYPOGLYCEMIA) to_chat(affected_mob, "You feel better.") cure() return @@ -133,4 +138,65 @@ affected_mob.emote(pick("twitch", "gasp")) if(prob(5) && ishuman(affected_mob)) var/mob/living/carbon/human/H = affected_mob - H.set_heartattack(TRUE) \ No newline at end of file + H.set_heartattack(TRUE) + +/datum/disease/critical/hypoglycemia + name = "Hypoglycemia" + form = "Medical Emergency" + max_stages = 3 + spread_flags = SPECIAL + spread_text = "The patient has low blood sugar." + cure_text = "Eating or glucose treatment" + viable_mobtypes = list(/mob/living/carbon/human) + stage_prob = 1 + severity = DANGEROUS + disease_flags = CURABLE + bypasses_immunity = TRUE + virus_heal_resistant = TRUE + +/datum/disease/critical/hypoglycemia/has_cure() + if(ishuman(affected_mob)) + var/mob/living/carbon/human/H = affected_mob + if(NO_HUNGER in H.dna.species.species_traits) + return TRUE + if(ismachine(H)) + return TRUE + return ..() + +/datum/disease/critical/hypoglycemia/stage_act() + if(..()) + if(affected_mob.nutrition > NUTRITION_LEVEL_HYPOGLYCEMIA) + to_chat(affected_mob, "You feel a lot better!") + cure() + return + switch(stage) + if(1) + if(prob(4)) + to_chat(affected_mob, "You feel hungry!") + if(prob(2)) + to_chat(affected_mob, "You have a headache!") + if(prob(2)) + to_chat(affected_mob, "You feel [pick("anxious", "depressed")]!") + if(2) + if(prob(4)) + to_chat(affected_mob, "You feel like everything is wrong with your life!") + if(prob(5)) + affected_mob.Slowed(rand(4, 16)) + to_chat(affected_mob, "You feel [pick("tired", "exhausted", "sluggish")].") + if(prob(5)) + affected_mob.Weaken(6) + affected_mob.Stuttering(10) + to_chat(affected_mob, "You feel [pick("numb", "confused", "dizzy", "lightheaded")].") + affected_mob.emote("collapse") + if(3) + if(prob(8)) + var/datum/disease/D = new /datum/disease/critical/shock + affected_mob.ForceContractDisease(D) + if(prob(12)) + affected_mob.Weaken(6) + affected_mob.Stuttering(10) + to_chat(affected_mob, "You feel [pick("numb", "confused", "dizzy", "lightheaded")].") + affected_mob.emote("collapse") + if(prob(12)) + to_chat(affected_mob, "You feel [pick("tired", "exhausted", "sluggish")].") + affected_mob.Slowed(rand(4, 16)) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 85bb90a168e..f352f661cd0 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -290,10 +290,10 @@ if(5) msg += "[p_they(TRUE)] looks absolutely soaked.\n" - if(nutrition < NUTRITION_LEVEL_STARVING - 50) + if(nutrition < NUTRITION_LEVEL_HYPOGLYCEMIA) msg += "[p_they(TRUE)] [p_are()] severely malnourished.\n" else if(nutrition >= NUTRITION_LEVEL_FAT) - if(user.nutrition < NUTRITION_LEVEL_STARVING - 50) + if(user.nutrition < NUTRITION_LEVEL_HYPOGLYCEMIA) msg += "[p_they(TRUE)] [p_are()] plump and delicious looking - Like a fat little piggy. A tasty piggy.\n" else msg += "[p_they(TRUE)] [p_are()] quite chubby.\n" diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 2643d1f3102..587d76a78ed 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -631,6 +631,10 @@ else overeatduration -= 2 + if(!ismachine(src) && nutrition < NUTRITION_LEVEL_HYPOGLYCEMIA) //Gosh damn snowflakey IPCs + var/datum/disease/D = new /datum/disease/critical/hypoglycemia + ForceContractDisease(D) + //metabolism change if(nutrition > NUTRITION_LEVEL_FAT) metabolism_efficiency = 1 From e75c926a62398b35a10e18f80f1aabc5cb86e75f Mon Sep 17 00:00:00 2001 From: Fox McCloud Date: Tue, 10 Mar 2020 16:53:55 -0400 Subject: [PATCH 02/16] tweak --- code/datums/diseases/critical.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/diseases/critical.dm b/code/datums/diseases/critical.dm index 71b387428c6..33895132428 100644 --- a/code/datums/diseases/critical.dm +++ b/code/datums/diseases/critical.dm @@ -146,7 +146,7 @@ max_stages = 3 spread_flags = SPECIAL spread_text = "The patient has low blood sugar." - cure_text = "Eating or glucose treatment" + cure_text = "Eating or administration of vitamins or nutrients" viable_mobtypes = list(/mob/living/carbon/human) stage_prob = 1 severity = DANGEROUS From 9148984d4e91be29e1405b66b661096b2300561e Mon Sep 17 00:00:00 2001 From: Kyep Date: Wed, 18 Dec 2019 02:40:27 -0800 Subject: [PATCH 03/16] Prevent ID computer encouraging transfers to Magi/BS/NTR --- code/game/jobs/job/job.dm | 3 +++ code/game/jobs/job/supervisor.dm | 3 +++ 2 files changed, 6 insertions(+) diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 03ac85c8d57..2e1c16f956e 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -53,6 +53,7 @@ var/exp_type = "" var/disabilities_allowed = 1 + var/transfer_allowed = TRUE // If false, ID computer will always discourage transfers to this job, even if player is eligible var/admin_only = 0 var/spawn_ert = 0 @@ -265,6 +266,8 @@ PDA.name = "PDA-[H.real_name] ([PDA.ownjob])" /datum/job/proc/would_accept_job_transfer_from_player(mob/player) + if(!transfer_allowed) + return FALSE if(!guest_jobbans(title)) // actually checks if job is a whitelisted position return TRUE if(!istype(player)) diff --git a/code/game/jobs/job/supervisor.dm b/code/game/jobs/job/supervisor.dm index 4e773d42ad9..a0814a4a86c 100644 --- a/code/game/jobs/job/supervisor.dm +++ b/code/game/jobs/job/supervisor.dm @@ -112,6 +112,7 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 0) selection_color = "#ddddff" req_admin_notify = 1 is_command = 1 + transfer_allowed = FALSE minimal_player_age = 21 access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_COURT, ACCESS_FORENSICS_LOCKERS, ACCESS_MEDICAL, ACCESS_ENGINE, ACCESS_CHANGE_IDS, ACCESS_EVA, ACCESS_HEADS, @@ -155,6 +156,7 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 0) selection_color = "#ddddff" req_admin_notify = 1 is_command = 1 + transfer_allowed = FALSE minimal_player_age = 21 access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_COURT, ACCESS_FORENSICS_LOCKERS, ACCESS_MEDICAL, ACCESS_ENGINE, ACCESS_CHANGE_IDS, ACCESS_EVA, ACCESS_HEADS, @@ -198,6 +200,7 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 0) selection_color = "#ddddff" req_admin_notify = 1 is_legal = 1 + transfer_allowed = FALSE minimal_player_age = 30 access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_COURT, ACCESS_FORENSICS_LOCKERS, ACCESS_MEDICAL, ACCESS_ENGINE, ACCESS_CHANGE_IDS, ACCESS_EVA, ACCESS_HEADS, From 210f8badf474adbd9f710a5f22fc19bccf4516e7 Mon Sep 17 00:00:00 2001 From: AffectedArc07 Date: Sat, 21 Mar 2020 03:56:37 +0000 Subject: [PATCH 04/16] Makes all global variables handled by the GLOB controller (#13152) * Handlers converted, now to fix 3532 compile errors * 3532 compile fixes later, got runtimes on startup * Well the server loads now atleast * Take 2 * Oops --- .gitignore | 3 +- code/ATMOSPHERICS/atmospherics.dm | 8 +- .../components/binary_devices/passive_gate.dm | 2 +- .../components/binary_devices/pump.dm | 4 +- .../components/binary_devices/volume_pump.dm | 4 +- .../components/omni_devices/omni_base.dm | 2 +- .../components/trinary_devices/filter.dm | 4 +- .../components/trinary_devices/mixer.dm | 4 +- code/ATMOSPHERICS/datum_icon_manager.dm | 30 +- code/ATMOSPHERICS/datum_pipeline.dm | 2 +- code/ATMOSPHERICS/pipes/manifold.dm | 4 +- code/ATMOSPHERICS/pipes/manifold4w.dm | 4 +- code/ATMOSPHERICS/pipes/simple/pipe_simple.dm | 4 +- .../pipes/simple/pipe_simple_he.dm | 2 +- code/LINDA/LINDA_fire.dm | 6 +- code/LINDA/LINDA_system.dm | 8 +- code/LINDA/LINDA_turf_tile.dm | 12 +- code/__DEFINES/dna.dm | 57 ++++ code/__DEFINES/is_helpers.dm | 6 +- code/__DEFINES/misc.dm | 8 +- code/__DEFINES/rolebans.dm | 8 +- code/__HELPERS/_logging.dm | 48 ++-- code/__HELPERS/_string_lists.dm | 24 +- code/__HELPERS/files.dm | 4 +- code/__HELPERS/game.dm | 6 +- code/__HELPERS/icon_smoothing.dm | 2 +- code/__HELPERS/icons.dm | 2 +- code/__HELPERS/maths.dm | 10 +- code/__HELPERS/mobs.dm | 12 +- code/__HELPERS/names.dm | 26 +- code/__HELPERS/text.dm | 4 +- code/__HELPERS/unique_ids.dm | 4 +- code/__HELPERS/unsorted.dm | 26 +- code/_globalvars/configuration.dm | 70 ++--- code/_globalvars/database.dm | 11 - code/_globalvars/game_modes.dm | 15 +- code/_globalvars/genetics.dm | 106 +++---- code/_globalvars/lists/devil.dm | 4 +- code/_globalvars/logging.dm | 25 +- code/_globalvars/mapping.dm | 73 ++--- code/_globalvars/misc.dm | 113 ++++---- code/_globalvars/sensitive.dm | 12 + code/_globalvars/unused.dm | 1 - code/_onclick/ai.dm | 6 +- code/controllers/configuration.dm | 22 +- code/controllers/subsystem/air.dm | 30 +- code/controllers/subsystem/events.dm | 32 +-- code/controllers/subsystem/jobs.dm | 14 +- code/controllers/subsystem/mapping.dm | 10 +- code/controllers/subsystem/nightshift.dm | 6 +- code/controllers/subsystem/ticker.dm | 34 +-- code/controllers/subsystem/vote.dm | 20 +- code/controllers/verbs.dm | 6 +- code/datums/cache/air_alarm.dm | 8 +- code/datums/cache/apc.dm | 2 +- code/datums/cache/crew.dm | 2 +- code/datums/cache/powermonitor.dm | 12 +- code/datums/datacore.dm | 58 ++-- code/datums/diseases/_disease.dm | 2 +- code/datums/diseases/advance/advance.dm | 23 +- .../diseases/advance/symptoms/symptoms.dm | 4 +- code/datums/helper_datums/map_template.dm | 26 +- code/datums/hud.dm | 12 +- code/datums/mind.dm | 20 +- code/datums/mixed.dm | 16 +- code/datums/outfits/outfit_admin.dm | 4 +- code/datums/periodic_news.dm | 17 +- code/datums/spawners_menu.dm | 2 +- code/datums/spell.dm | 2 +- code/datums/spells/area_teleport.dm | 6 +- code/datums/spells/banana_touch.dm | 12 +- code/datums/spells/cluwne.dm | 18 +- code/datums/spells/ethereal_jaunt.dm | 2 +- code/datums/spells/knock.dm | 2 +- code/datums/spells/mime_malaise.dm | 6 +- code/datums/spells/rathens.dm | 4 +- code/datums/spells/wizard.dm | 8 +- code/datums/status_effects/buffs.dm | 4 +- code/datums/status_effects/debuffs.dm | 2 +- code/datums/supplypacks.dm | 2 +- .../datums/weather/weather_types/ash_storm.dm | 2 +- .../weather/weather_types/radiation_storm.dm | 6 +- code/datums/wires/nuclearbomb.dm | 2 +- code/datums/wires/wires.dm | 14 +- code/defines/procs/AStar.dm | 2 +- code/defines/procs/announce.dm | 8 +- code/defines/procs/dbcore.dm | 7 - code/defines/procs/radio.dm | 4 +- code/defines/procs/records.dm | 6 +- code/defines/procs/statistics.dm | 26 +- code/defines/vox_sounds.dm | 4 +- code/game/area/Space Station 13 areas.dm | 28 +- code/game/area/areas.dm | 8 +- code/game/atoms.dm | 18 +- code/game/atoms_movable.dm | 4 +- code/game/data_huds.dm | 8 +- code/game/dna/dna2.dm | 70 +---- code/game/dna/dna2_domutcheck.dm | 4 +- code/game/dna/dna2_helpers.dm | 6 +- code/game/dna/genes/disabilities.dm | 26 +- code/game/dna/genes/goon_disabilities.dm | 18 +- code/game/dna/genes/goon_powers.dm | 18 +- code/game/dna/genes/monkey.dm | 2 +- code/game/dna/genes/powers.dm | 26 +- code/game/dna/genes/vg_disabilities.dm | 4 +- code/game/dna/genes/vg_powers.dm | 6 +- code/game/gamemodes/blob/blob.dm | 12 +- code/game/gamemodes/blob/blob_finish.dm | 8 +- code/game/gamemodes/blob/blob_report.dm | 2 +- code/game/gamemodes/blob/blobs/core.dm | 6 +- code/game/gamemodes/blob/blobs/node.dm | 4 +- code/game/gamemodes/blob/powers.dm | 8 +- code/game/gamemodes/blob/theblob.dm | 6 +- code/game/gamemodes/changeling/changeling.dm | 12 +- .../gamemodes/changeling/evolution_menu.dm | 8 +- .../changeling/powers/chameleon_skin.dm | 16 +- .../gamemodes/changeling/powers/humanform.dm | 4 +- code/game/gamemodes/cult/cult.dm | 18 +- code/game/gamemodes/cult/cult_items.dm | 4 +- code/game/gamemodes/cult/cult_objectives.dm | 8 +- code/game/gamemodes/cult/cult_structures.dm | 6 +- code/game/gamemodes/cult/ritual.dm | 10 +- code/game/gamemodes/cult/runes.dm | 16 +- code/game/gamemodes/cult/talisman.dm | 2 +- code/game/gamemodes/devil/devilinfo.dm | 28 +- code/game/gamemodes/devil/game_mode.dm | 18 +- code/game/gamemodes/game_mode.dm | 24 +- code/game/gamemodes/heist/heist.dm | 15 +- .../gamemodes/malfunction/Malf_Modules.dm | 24 +- code/game/gamemodes/meteor/meteor.dm | 4 +- code/game/gamemodes/meteor/meteors.dm | 20 +- .../miniantags/abduction/abduction.dm | 6 +- .../gamemodes/miniantags/abduction/gland.dm | 12 +- .../miniantags/abduction/machinery/camera.dm | 4 +- .../abduction/machinery/experiment.dm | 2 +- .../miniantags/abduction/machinery/pad.dm | 2 +- .../gamemodes/miniantags/borer/borer_event.dm | 2 +- .../gamemodes/miniantags/bot_swarm/swarmer.dm | 2 +- .../miniantags/bot_swarm/swarmer_event.dm | 2 +- .../miniantags/guardian/types/healer.dm | 2 +- code/game/gamemodes/miniantags/morph/morph.dm | 2 +- .../gamemodes/miniantags/morph/morph_event.dm | 4 +- code/game/gamemodes/nuclear/nuclear.dm | 44 +-- .../gamemodes/nuclear/nuclear_challenge.dm | 2 +- code/game/gamemodes/nuclear/nuclearbomb.dm | 20 +- code/game/gamemodes/nuclear/pinpointer.dm | 6 +- code/game/gamemodes/objective.dm | 6 +- code/game/gamemodes/revolution/revolution.dm | 46 +-- code/game/gamemodes/sandbox/h_sandbox.dm | 12 +- code/game/gamemodes/scoreboard.dm | 144 +++++----- code/game/gamemodes/setupgame.dm | 122 ++++---- code/game/gamemodes/shadowling/shadowling.dm | 6 +- .../shadowling/shadowling_abilities.dm | 2 +- .../special_shadowling_abilities.dm | 6 +- code/game/gamemodes/traitor/traitor.dm | 2 +- code/game/gamemodes/vampire/vampire.dm | 4 +- code/game/gamemodes/vampire/vampire_powers.dm | 2 +- code/game/gamemodes/wizard/artefact.dm | 10 +- code/game/gamemodes/wizard/raginmages.dm | 2 +- code/game/gamemodes/wizard/wizard.dm | 8 +- code/game/jobs/job/job.dm | 2 +- code/game/jobs/job/security.dm | 2 +- code/game/jobs/job/silicon.dm | 2 +- code/game/jobs/job/supervisor.dm | 6 +- code/game/jobs/job/support.dm | 18 +- code/game/jobs/job/syndicate.dm | 2 +- code/game/jobs/job_exp.dm | 22 +- code/game/jobs/jobs.dm | 51 ++-- code/game/jobs/whitelist.dm | 20 +- code/game/machinery/Freezer.dm | 4 +- code/game/machinery/alarm.dm | 8 +- code/game/machinery/atmoalter/canister.dm | 25 +- code/game/machinery/atmoalter/pump.dm | 4 +- code/game/machinery/atmoalter/scrubber.dm | 4 +- code/game/machinery/autolathe.dm | 2 +- code/game/machinery/camera/camera.dm | 26 +- code/game/machinery/camera/camera_assembly.dm | 2 +- code/game/machinery/camera/presets.dm | 2 +- code/game/machinery/camera/tracking.dm | 6 +- code/game/machinery/cloning.dm | 2 +- code/game/machinery/computer/Operating.dm | 2 +- code/game/machinery/computer/ai_core.dm | 12 +- code/game/machinery/computer/atmos_alert.dm | 9 +- code/game/machinery/computer/brigcells.dm | 2 +- code/game/machinery/computer/camera.dm | 10 +- .../machinery/computer/camera_advanced.dm | 6 +- code/game/machinery/computer/card.dm | 34 +-- code/game/machinery/computer/cloning.dm | 2 +- .../game/machinery/computer/communications.dm | 22 +- code/game/machinery/computer/medical.dm | 34 +-- code/game/machinery/computer/message.dm | 26 +- .../computer/pod_tracking_console.dm | 2 +- code/game/machinery/computer/power.dm | 6 +- code/game/machinery/computer/robot.dm | 2 +- code/game/machinery/computer/security.dm | 36 +-- code/game/machinery/computer/skills.dm | 38 +-- .../machinery/computer/specops_shuttle.dm | 66 ++--- code/game/machinery/computer/store.dm | 8 +- .../computer/syndicate_specops_shuttle.dm | 44 +-- code/game/machinery/cryo.dm | 4 +- code/game/machinery/cryopod.dm | 12 +- code/game/machinery/dance_machine.dm | 2 +- code/game/machinery/defib_mount.dm | 4 +- code/game/machinery/doors/airlock.dm | 12 +- .../machinery/doors/airlock_electronics.dm | 6 +- code/game/machinery/doors/brigdoors.dm | 6 +- code/game/machinery/doors/door.dm | 4 +- code/game/machinery/doppler_array.dm | 8 +- .../airlock_controllers.dm | 6 +- code/game/machinery/firealarm.dm | 6 +- code/game/machinery/hologram.dm | 12 +- code/game/machinery/machinery.dm | 2 +- code/game/machinery/newscaster.dm | 80 +++--- code/game/machinery/pipe/construction.dm | 4 +- code/game/machinery/poolcontroller.dm | 2 +- code/game/machinery/portable_tag_turret.dm | 2 +- code/game/machinery/portable_turret.dm | 12 +- code/game/machinery/requests_console.dm | 36 +-- code/game/machinery/slotmachine.dm | 8 +- code/game/machinery/telecomms/broadcaster.dm | 74 ++--- code/game/machinery/telecomms/ntsl2.dm | 14 +- .../machinery/telecomms/telecomunications.dm | 10 +- code/game/machinery/teleporter.dm | 2 +- code/game/machinery/turret_control.dm | 2 +- code/game/machinery/vending.dm | 18 +- code/game/magic/Uristrunes.dm | 20 +- code/game/mecha/mech_bay.dm | 4 +- code/game/mecha/mecha.dm | 2 +- code/game/mecha/mecha_control_console.dm | 2 +- code/game/mecha/medical/odysseus.dm | 8 +- code/game/objects/effects/anomalies.dm | 2 +- code/game/objects/effects/bump_teleporter.dm | 8 +- .../objects/effects/decals/Cleanable/fuel.dm | 2 +- .../effects/decals/Cleanable/humans.dm | 2 +- .../effects/decals/Cleanable/tracks.dm | 18 +- code/game/objects/effects/effect_system.dm | 8 +- .../effects/effect_system/effect_system.dm | 8 +- .../effect_system/effects_explosion.dm | 2 +- .../effects/effect_system/effects_foam.dm | 2 +- .../effects/effect_system/effects_other.dm | 6 +- .../effects/effect_system/effects_smoke.dm | 4 +- .../effects/effect_system/effects_water.dm | 8 +- code/game/objects/effects/glowshroom.dm | 4 +- code/game/objects/effects/landmarks.dm | 42 +-- code/game/objects/effects/snowcloud.dm | 2 +- .../objects/effects/spawners/gibspawner.dm | 6 +- .../objects/effects/spawners/windowspawner.dm | 2 +- .../temporary_visuals/miscellaneous.dm | 2 +- .../temporary_visuals/temporary_visual.dm | 2 +- code/game/objects/explosion.dm | 16 +- code/game/objects/items.dm | 5 +- code/game/objects/items/blueprints.dm | 2 +- code/game/objects/items/devices/aicard.dm | 4 +- code/game/objects/items/devices/autopsy.dm | 2 +- code/game/objects/items/devices/camera_bug.dm | 2 +- .../game/objects/items/devices/instruments.dm | 2 +- code/game/objects/items/devices/paicard.dm | 2 +- .../objects/items/devices/pipe_painter.dm | 4 +- .../items/devices/radio/electropack.dm | 2 +- .../objects/items/devices/radio/intercom.dm | 2 +- .../game/objects/items/devices/radio/radio.dm | 22 +- .../objects/items/devices/taperecorder.dm | 2 - .../objects/items/devices/transfer_valve.dm | 2 +- code/game/objects/items/devices/uplinks.dm | 14 +- .../items/mountable_frames/mountables.dm | 2 +- code/game/objects/items/robot/robot_parts.dm | 4 +- code/game/objects/items/stacks/rods.dm | 6 +- .../objects/items/stacks/sheets/leather.dm | 12 +- .../objects/items/stacks/sheets/mineral.dm | 66 ++--- .../items/stacks/sheets/sheet_types.dm | 44 +-- .../items/stacks/tiles/tile_mineral.dm | 24 +- code/game/objects/items/tools/multitool.dm | 6 +- code/game/objects/items/toys.dm | 8 +- code/game/objects/items/weapons/AI_modules.dm | 14 +- code/game/objects/items/weapons/RCD.dm | 8 +- code/game/objects/items/weapons/cards_ids.dm | 12 +- code/game/objects/items/weapons/cosmetics.dm | 2 +- code/game/objects/items/weapons/dice.dm | 4 +- .../objects/items/weapons/dna_injector.dm | 100 +++---- code/game/objects/items/weapons/explosives.dm | 2 + .../items/weapons/grenades/bananade.dm | 2 +- .../items/weapons/grenades/clowngrenade.dm | 2 +- .../objects/items/weapons/holy_weapons.dm | 2 +- .../weapons/implants/implant_death_alarm.dm | 2 +- code/game/objects/items/weapons/rpd.dm | 34 +-- code/game/objects/items/weapons/scrolls.dm | 4 +- .../objects/items/weapons/storage/boxes.dm | 1 + .../objects/items/weapons/storage/firstaid.dm | 1 + .../game/objects/items/weapons/tanks/tanks.dm | 2 +- code/game/objects/items/weapons/weaponry.dm | 4 +- code/game/objects/obj_defense.dm | 4 +- code/game/objects/objs.dm | 2 +- code/game/objects/structures.dm | 4 +- .../structures/crates_lockers/crates.dm | 2 +- code/game/objects/structures/false_walls.dm | 1 + code/game/objects/structures/mirror.dm | 8 +- code/game/objects/structures/misc.dm | 2 +- code/game/objects/structures/musician.dm | 4 +- code/game/objects/structures/safe.dm | 2 +- .../game/objects/structures/tank_dispenser.dm | 2 +- code/game/objects/structures/watercloset.dm | 2 +- code/game/objects/structures/window.dm | 12 +- code/game/turfs/simulated/floor.dm | 6 +- code/game/turfs/simulated/floor/asteroid.dm | 2 +- code/game/turfs/simulated/floor/chasm.dm | 2 +- code/game/turfs/simulated/minerals.dm | 2 +- code/game/turfs/simulated/river.dm | 2 +- code/game/turfs/space/space.dm | 16 +- code/game/turfs/turf.dm | 12 +- code/game/verbs/ooc.dm | 26 +- code/game/world.dm | 94 +++---- code/modules/admin/DB ban/functions.dm | 38 +-- code/modules/admin/IsBanned.dm | 8 +- code/modules/admin/NewBan.dm | 170 +++++------ code/modules/admin/admin.dm | 86 +++--- code/modules/admin/admin_investigate.dm | 6 +- code/modules/admin/admin_memo.dm | 20 +- code/modules/admin/admin_ranks.dm | 23 +- code/modules/admin/admin_verbs.dm | 144 +++++----- code/modules/admin/banappearance.dm | 36 +-- code/modules/admin/banjob.dm | 62 ++-- code/modules/admin/create_mob.dm | 10 +- code/modules/admin/create_object.dm | 18 +- code/modules/admin/create_poll.dm | 24 +- code/modules/admin/create_turf.dm | 10 +- code/modules/admin/holder2.dm | 7 +- code/modules/admin/ipintel.dm | 18 +- .../admin/permissionverbs/permissionedit.dm | 32 +-- code/modules/admin/player_panel.dm | 12 +- code/modules/admin/secrets.dm | 4 +- code/modules/admin/sql_notes.dm | 24 +- code/modules/admin/topic.dm | 265 +++++++++--------- code/modules/admin/verbs/adminhelp.dm | 4 +- code/modules/admin/verbs/adminsay.dm | 8 +- code/modules/admin/verbs/alt_check.dm | 2 +- code/modules/admin/verbs/atmosdebug.dm | 2 +- code/modules/admin/verbs/custom_event.dm | 12 +- code/modules/admin/verbs/debug.dm | 14 +- code/modules/admin/verbs/diagnostics.dm | 8 +- code/modules/admin/verbs/freeze.dm | 12 +- code/modules/admin/verbs/honksquad.dm | 8 +- .../admin/verbs/infiltratorteam_syndicate.dm | 10 +- .../admin/verbs/map_template_loadverb.dm | 6 +- code/modules/admin/verbs/mapping.dm | 24 +- code/modules/admin/verbs/massmodvar.dm | 8 +- code/modules/admin/verbs/modifyvariables.dm | 16 +- code/modules/admin/verbs/one_click_antag.dm | 12 +- code/modules/admin/verbs/onlyone.dm | 4 +- code/modules/admin/verbs/onlyoneteam.dm | 12 +- code/modules/admin/verbs/playsound.dm | 8 +- code/modules/admin/verbs/randomverbs.dm | 24 +- code/modules/admin/verbs/space_transitions.dm | 4 +- code/modules/admin/verbs/striketeam.dm | 10 +- .../admin/verbs/striketeam_syndicate.dm | 12 +- code/modules/admin/verbs/toggledebugverbs.dm | 6 +- code/modules/admin/verbs/vox_raiders.dm | 8 +- code/modules/admin/watchlist.dm | 14 +- code/modules/antagonists/_common/antag_hud.dm | 4 +- .../antagonists/_common/antag_spawner.dm | 2 +- .../antagonists/traitor/datum_mindslave.dm | 4 +- .../antagonists/traitor/datum_traitor.dm | 16 +- .../antagonists/wishgranter/wishgranter.dm | 68 ++--- code/modules/arcade/arcade_prize.dm | 2 +- code/modules/arcade/claw_game.dm | 8 +- code/modules/arcade/mob_hunt/mob_datums.dm | 2 +- code/modules/arcade/prize_counter.dm | 8 +- code/modules/arcade/prize_datums.dm | 5 +- code/modules/assembly/signaler.dm | 2 +- code/modules/atmos_automation/console.dm | 4 +- .../implementation/scrubbers.dm | 6 +- code/modules/atmos_automation/statements.dm | 6 +- code/modules/awaymissions/gateway.dm | 6 +- code/modules/awaymissions/map_rng.dm | 4 +- .../awaymissions/maploader/dmm_suite.dm | 3 +- code/modules/awaymissions/maploader/reader.dm | 28 +- .../awaymissions/mission_code/academy.dm | 8 +- .../mission_code/stationCollision.dm | 18 +- code/modules/awaymissions/zlevel.dm | 34 +-- code/modules/buildmode/bm_mode.dm | 4 +- code/modules/buildmode/submodes/save.dm | 4 +- code/modules/busy_space/air_traffic.dm | 39 ++- code/modules/busy_space/loremaster.dm | 3 +- code/modules/busy_space/organizations.dm | 2 +- code/modules/client/asset_cache.dm | 14 +- code/modules/client/client procs.dm | 48 ++-- .../client/preference/loadout/gear_tweaks.dm | 3 +- .../client/preference/loadout/loadout.dm | 20 +- code/modules/client/preference/preferences.dm | 107 +++---- .../client/preference/preferences_mysql.dm | 20 +- .../preference/preferences_spawnpoints.dm | 14 +- code/modules/clothing/glasses/hud.dm | 4 +- code/modules/clothing/spacesuits/breaches.dm | 14 +- code/modules/clothing/spacesuits/ert.dm | 2 +- .../spacesuits/rig/modules/computer.dm | 4 +- code/modules/clothing/spacesuits/rig/rig.dm | 6 +- code/modules/clothing/under/jobs/civilian.dm | 2 +- code/modules/crafting/craft.dm | 10 +- code/modules/customitems/item_spawning.dm | 2 +- code/modules/detective_work/scanner.dm | 6 +- code/modules/economy/ATM.dm | 10 +- code/modules/economy/Accounts.dm | 58 ++-- code/modules/economy/Accounts_DB.dm | 38 +-- code/modules/economy/EFTPOS.dm | 6 +- code/modules/economy/Economy.dm | 16 +- code/modules/economy/Economy_Events.dm | 8 +- .../modules/economy/Economy_Events_Mundane.dm | 12 +- .../economy/Economy_TradeDestinations.dm | 4 +- code/modules/economy/Job_Departments.dm | 2 +- code/modules/economy/POS.dm | 14 +- code/modules/economy/utils.dm | 6 +- code/modules/error_handler/error_handler.dm | 38 +-- code/modules/error_handler/error_viewer.dm | 8 +- code/modules/events/alien_infestation.dm | 2 +- code/modules/events/anomaly.dm | 2 +- code/modules/events/anomaly_bluespace.dm | 6 +- code/modules/events/anomaly_flux.dm | 2 +- code/modules/events/anomaly_grav.dm | 2 +- code/modules/events/anomaly_pyro.dm | 2 +- code/modules/events/anomaly_vortex.dm | 2 +- code/modules/events/aurora_caelus.dm | 4 +- code/modules/events/blob.dm | 4 +- code/modules/events/brand_intelligence.dm | 2 +- code/modules/events/carp_migration.dm | 2 +- .../modules/events/communications_blackout.dm | 8 +- code/modules/events/disease_outbreak.dm | 2 +- code/modules/events/dust.dm | 2 +- code/modules/events/electrical_storm.dm | 6 +- code/modules/events/event.dm | 2 +- code/modules/events/event_container.dm | 10 +- code/modules/events/event_procs.dm | 4 +- code/modules/events/floorcluwne.dm | 4 +- code/modules/events/grid_check.dm | 8 +- code/modules/events/headcrabs.dm | 6 +- code/modules/events/holidays/Holidays.dm | 3 +- code/modules/events/immovable_rod.dm | 4 +- code/modules/events/infestation.dm | 2 +- code/modules/events/ion_storm.dm | 2 +- code/modules/events/mass_hallucination.dm | 2 +- code/modules/events/meaty_gore.dm | 6 +- code/modules/events/meaty_ops.dm | 6 +- code/modules/events/meaty_ores.dm | 4 +- code/modules/events/meteors.dm | 14 +- code/modules/events/money_hacker.dm | 10 +- code/modules/events/money_lotto.dm | 8 +- code/modules/events/money_spam.dm | 6 +- code/modules/events/prison_break.dm | 2 +- code/modules/events/radiation_storm.dm | 2 +- code/modules/events/rogue_drones.dm | 6 +- code/modules/events/spacevine.dm | 2 +- code/modules/events/spider_infestation.dm | 6 +- code/modules/events/spider_terror.dm | 2 +- code/modules/events/tear.dm | 2 +- code/modules/events/tear_honk.dm | 2 +- code/modules/events/traders.dm | 12 +- code/modules/events/vent_clog.dm | 2 +- code/modules/events/wallrot.dm | 2 +- code/modules/events/wormholes.dm | 4 +- code/modules/ext_scripts/python.dm | 2 +- code/modules/fancytitle/fancytitle.dm | 2 +- code/modules/flufftext/Dreaming.dm | 2 +- code/modules/flufftext/Hallucination.dm | 14 +- .../food_and_drinks/drinks/drinks/bottle.dm | 4 +- .../kitchen_machinery/icecream_vat_2.dm | 8 +- .../kitchen_machinery/smartfridge.dm | 2 +- code/modules/hydroponics/grown/mushrooms.dm | 2 +- code/modules/hydroponics/hydroponics.dm | 6 +- code/modules/hydroponics/sample.dm | 16 +- code/modules/karma/karma.dm | 42 +-- code/modules/library/admin.dm | 4 +- code/modules/library/codex_gigas.dm | 2 +- code/modules/library/computers/base.dm | 6 +- code/modules/library/computers/checkout.dm | 20 +- code/modules/library/computers/public.dm | 8 +- code/modules/library/lib_machines.dm | 12 +- code/modules/library/random_books.dm | 4 +- code/modules/map_fluff/maps.dm | 2 - .../mining/equipment/marker_beacons.dm | 8 +- code/modules/mining/equipment/survival_pod.dm | 2 +- code/modules/mining/laborcamp/laborstacker.dm | 2 +- .../mining/lavaland/loot/colossus_loot.dm | 2 +- .../mining/lavaland/loot/hierophant_loot.dm | 2 +- code/modules/mining/machine_redemption.dm | 2 +- code/modules/mining/ores_coins.dm | 2 +- code/modules/mob/abilities.dm | 5 - code/modules/mob/dead/observer/logout.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 28 +- code/modules/mob/living/carbon/carbon.dm | 10 +- .../mob/living/carbon/human/appearance.dm | 18 +- .../living/carbon/human/body_accessories.dm | 18 +- code/modules/mob/living/carbon/human/death.dm | 2 +- .../mob/living/carbon/human/examine.dm | 8 +- code/modules/mob/living/carbon/human/human.dm | 52 ++-- .../mob/living/carbon/human/human_defines.dm | 2 +- code/modules/mob/living/carbon/human/life.dm | 4 +- code/modules/mob/living/carbon/human/say.dm | 2 +- .../living/carbon/human/species/abductor.dm | 4 +- .../mob/living/carbon/human/species/grey.dm | 6 +- .../living/carbon/human/species/machine.dm | 2 +- .../mob/living/carbon/human/species/monkey.dm | 6 +- .../mob/living/carbon/human/update_icons.dm | 18 +- code/modules/mob/living/living.dm | 4 +- code/modules/mob/living/say.dm | 14 +- code/modules/mob/living/silicon/ai/ai.dm | 32 +-- code/modules/mob/living/silicon/ai/death.dm | 2 +- .../living/silicon/ai/freelook/cameranet.dm | 2 +- .../modules/mob/living/silicon/ai/latejoin.dm | 14 +- .../modules/mob/living/silicon/ai/multicam.dm | 2 +- code/modules/mob/living/silicon/ai/say.dm | 20 +- .../modules/mob/living/silicon/pai/recruit.dm | 6 +- .../mob/living/silicon/pai/software.dm | 32 +-- .../living/silicon/pai/software_modules.dm | 40 +-- .../mob/living/silicon/robot/drone/drone.dm | 2 +- .../modules/mob/living/silicon/robot/robot.dm | 16 +- code/modules/mob/living/silicon/silicon.dm | 18 +- code/modules/mob/living/silicon/subsystems.dm | 18 +- .../mob/living/simple_animal/bot/bot.dm | 8 +- .../living/simple_animal/bot/construction.dm | 5 +- .../mob/living/simple_animal/bot/ed209bot.dm | 4 +- .../mob/living/simple_animal/bot/medbot.dm | 2 +- .../mob/living/simple_animal/bot/secbot.dm | 2 +- .../living/simple_animal/friendly/diona.dm | 2 +- .../simple_animal/friendly/farm_animals.dm | 8 +- .../simple_animal/hostile/floorcluwne.dm | 4 +- .../living/simple_animal/hostile/hostile.dm | 6 +- .../hostile/megafauna/bubblegum.dm | 4 +- .../hostile/megafauna/colossus.dm | 14 +- .../simple_animal/hostile/megafauna/drake.dm | 2 +- .../hostile/megafauna/hierophant.dm | 24 +- .../hostile/megafauna/swarmer.dm | 2 +- .../mob/living/simple_animal/hostile/mimic.dm | 4 +- .../simple_animal/hostile/mining/goliath.dm | 2 +- .../simple_animal/hostile/mining/hivelord.dm | 4 +- .../hostile/terror_spiders/actions.dm | 2 +- .../hostile/terror_spiders/empress.dm | 6 +- .../hostile/terror_spiders/ghost.dm | 2 +- .../hostile/terror_spiders/hive.dm | 10 +- .../hostile/terror_spiders/queen.dm | 4 +- .../hostile/terror_spiders/reproduction.dm | 8 +- .../hostile/terror_spiders/terror_ai.dm | 6 +- .../hostile/terror_spiders/terror_spiders.dm | 38 +-- .../mob/living/simple_animal/parrot.dm | 2 +- .../mob/living/simple_animal/simple_animal.dm | 2 +- .../mob/living/simple_animal/slime/life.dm | 4 +- .../mob/living/simple_animal/tribbles.dm | 8 +- code/modules/mob/living/status_procs.dm | 16 +- code/modules/mob/login.dm | 2 +- code/modules/mob/logout.dm | 4 +- code/modules/mob/mob.dm | 16 +- code/modules/mob/mob_helpers.dm | 4 +- code/modules/mob/mob_movement.dm | 2 +- code/modules/mob/new_player/login.dm | 12 +- code/modules/mob/new_player/new_player.dm | 62 ++-- code/modules/mob/new_player/poll.dm | 90 +++--- .../mob/new_player/preferences_setup.dm | 10 +- code/modules/mob/say.dm | 2 +- code/modules/mob/transform_procs.dm | 4 +- code/modules/mob/typing_indicator.dm | 18 +- .../NTNet/NTNRC/conversation.dm | 14 +- code/modules/modular_computers/NTNet/NTNet.dm | 6 +- .../modular_computers/NTNet/NTNet_relay.dm | 22 +- .../computers/item/computer.dm | 2 +- .../computers/machinery/modular_computer.dm | 4 +- .../file_system/computer_file.dm | 6 +- .../file_system/programs/antagonist/dos.dm | 12 +- .../file_system/programs/command/card.dm | 30 +- .../file_system/programs/command/comms.dm | 12 +- .../programs/engineering/power_monitor.dm | 2 +- .../programs/generic/ntdownloader.dm | 10 +- .../programs/generic/ntnrc_client.dm | 6 +- .../programs/generic/nttransfer.dm | 16 +- .../programs/research/ntmonitor.dm | 50 ++-- .../hardware/network_card.dm | 8 +- .../modular_computers/laptop_vendor.dm | 2 +- code/modules/nano/interaction/admin.dm | 2 +- code/modules/nano/interaction/conscious.dm | 2 +- code/modules/nano/interaction/contained.dm | 2 +- code/modules/nano/interaction/default.dm | 4 +- code/modules/nano/interaction/ghost.dm | 4 +- code/modules/nano/interaction/inventory.dm | 2 +- .../nano/interaction/inventory_deep.dm | 2 +- .../nano/interaction/not_incapacitated.dm | 5 +- code/modules/nano/interaction/physical.dm | 2 +- code/modules/nano/interaction/self.dm | 2 +- code/modules/nano/interaction/zlevel.dm | 2 +- code/modules/nano/modules/alarm_monitor.dm | 6 +- code/modules/nano/modules/atmos_control.dm | 6 +- code/modules/nano/modules/crew_monitor.dm | 6 +- code/modules/nano/modules/ert_manager.dm | 6 +- code/modules/nano/modules/human_appearance.dm | 6 +- code/modules/nano/modules/law_manager.dm | 4 +- code/modules/nano/modules/nano_module.dm | 2 +- code/modules/nano/modules/power_monitor.dm | 8 +- code/modules/nano/nanoexternal.dm | 4 +- code/modules/nano/nanoui.dm | 4 +- code/modules/paperwork/contract.dm | 4 +- code/modules/paperwork/fax.dm | 12 +- code/modules/paperwork/faxmachine.dm | 46 +-- code/modules/paperwork/filingcabinet.dm | 16 +- code/modules/paperwork/paper.dm | 8 +- code/modules/paperwork/photocopier.dm | 12 +- code/modules/paperwork/photography.dm | 6 +- code/modules/pda/PDA.dm | 12 +- code/modules/pda/cart_apps.dm | 18 +- code/modules/pda/core_apps.dm | 4 +- code/modules/pda/messenger.dm | 8 +- code/modules/pda/radio.dm | 2 +- code/modules/power/apc.dm | 8 +- code/modules/power/gravitygenerator.dm | 14 +- code/modules/power/port_gen.dm | 2 +- code/modules/power/power.dm | 4 +- code/modules/power/singularity/collector.dm | 6 +- code/modules/power/singularity/singularity.dm | 6 +- code/modules/power/smes.dm | 4 +- code/modules/power/solar.dm | 2 +- code/modules/power/supermatter/supermatter.dm | 4 +- code/modules/power/tesla/energy_ball.dm | 2 +- code/modules/projectiles/ammunition.dm | 2 +- code/modules/projectiles/projectile/magic.dm | 2 +- code/modules/reagents/chem_splash.dm | 4 +- code/modules/reagents/chemistry/colors.dm | 2 +- .../chemistry/machinery/chem_dispenser.dm | 2 +- .../chemistry/machinery/chem_heater.dm | 2 +- .../chemistry/machinery/chem_master.dm | 2 +- .../reagents/chemistry/machinery/pandemic.dm | 20 +- .../reagents/chemistry/reagents/drugs.dm | 4 +- .../reagents/chemistry/reagents/misc.dm | 6 +- code/modules/recycling/disposal.dm | 8 +- code/modules/research/message_server.dm | 48 ++-- code/modules/research/rdconsole.dm | 2 +- .../research/xenobiology/xenobio_camera.dm | 24 +- code/modules/response_team/ert.dm | 80 +++--- .../ruins/lavalandruin_code/ash_walker_den.dm | 4 +- .../ruins/lavalandruin_code/sin_ruins.dm | 2 +- .../security_levels/keycard authentication.dm | 28 +- .../security_levels/security levels.dm | 50 ++-- code/modules/shuttle/assault_pod.dm | 4 +- code/modules/shuttle/emergency.dm | 22 +- code/modules/shuttle/shuttle.dm | 2 +- code/modules/shuttle/shuttle_manipulator.dm | 8 +- code/modules/shuttle/supply.dm | 8 +- code/modules/space_management/level_check.dm | 2 +- code/modules/space_management/level_traits.dm | 14 +- code/modules/space_management/space_level.dm | 32 +-- .../space_management/space_transition.dm | 6 +- .../space_management/zlevel_manager.dm | 6 +- code/modules/station_goals/bsa.dm | 6 +- code/modules/station_goals/dna_vault.dm | 6 +- code/modules/station_goals/shield.dm | 2 +- code/modules/station_goals/station_goal.dm | 2 +- code/modules/store/store.dm | 4 +- code/modules/surgery/limb_reattach.dm | 2 +- code/modules/surgery/organs/augments_eyes.dm | 6 +- code/modules/surgery/organs/eyes.dm | 8 +- code/modules/surgery/organs/organ_external.dm | 4 +- code/modules/surgery/organs/organ_icon.dm | 2 +- code/modules/surgery/organs/organ_internal.dm | 20 +- code/modules/surgery/organs/robolimbs.dm | 16 +- code/modules/surgery/organs/vocal_cords.dm | 150 +++++----- code/modules/surgery/robotics.dm | 2 +- code/modules/telesci/bscrystal.dm | 4 +- code/modules/telesci/gps.dm | 12 +- code/modules/tram/tram.dm | 10 +- code/modules/tram/tram_floor.dm | 2 +- code/modules/tram/tram_wall.dm | 2 +- interface/interface.dm | 4 +- paradise.dme | 5 +- ...gnTimeResolveAssemblyReferencesInput.cache | Bin 6853 -> 0 bytes 667 files changed, 4243 insertions(+), 4240 deletions(-) create mode 100644 code/__DEFINES/dna.dm delete mode 100644 code/_globalvars/database.dm create mode 100644 code/_globalvars/sensitive.dm delete mode 100644 code/_globalvars/unused.dm delete mode 100644 code/modules/mob/abilities.dm delete mode 100644 tools/midi2piano/midi2piano/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache diff --git a/.gitignore b/.gitignore index 74660294c3b..e76c9f6db1d 100644 --- a/.gitignore +++ b/.gitignore @@ -32,7 +32,6 @@ stddef.dm /tools/dmitool/.project # ignore midi2piano build cache -/tools/midi2piano/obj/* - +/tools/midi2piano/midi2piano/obj/* diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index 0e3c1b78798..507142c0892 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -257,7 +257,7 @@ GLOBAL_DATUM_INIT(pipe_icon_manager, /datum/pipe_icon_manager, new()) #define VENT_SOUND_DELAY 30 /obj/machinery/atmospherics/relaymove(mob/living/user, direction) direction &= initialize_directions - if(!direction || !(direction in cardinal)) //cant go this way. + if(!direction || !(direction in GLOB.cardinal)) //cant go this way. return if(user in buckled_mobs)// fixes buckle ventcrawl edgecase fuck bug @@ -265,7 +265,7 @@ GLOBAL_DATUM_INIT(pipe_icon_manager, /datum/pipe_icon_manager, new()) var/obj/machinery/atmospherics/target_move = findConnecting(direction) if(target_move) - if(is_type_in_list(target_move, ventcrawl_machinery) && target_move.can_crawl_through()) + if(is_type_in_list(target_move, GLOB.ventcrawl_machinery) && target_move.can_crawl_through()) user.remove_ventcrawl() user.forceMove(target_move.loc) //handles entering and so on user.visible_message("You hear something squeezing through the ducts.", "You climb out the ventilation system.") @@ -278,7 +278,7 @@ GLOBAL_DATUM_INIT(pipe_icon_manager, /datum/pipe_icon_manager, new()) user.last_played_vent = world.time playsound(src, 'sound/machines/ventcrawl.ogg', 50, 1, -3) else - if((direction & initialize_directions) || is_type_in_list(src, ventcrawl_machinery)) //if we move in a way the pipe can connect, but doesn't - or we're in a vent + if((direction & initialize_directions) || is_type_in_list(src, GLOB.ventcrawl_machinery)) //if we move in a way the pipe can connect, but doesn't - or we're in a vent user.remove_ventcrawl() user.forceMove(src.loc) user.visible_message("You hear something squeezing through the pipes.", "You climb out the ventilation system.") @@ -287,7 +287,7 @@ GLOBAL_DATUM_INIT(pipe_icon_manager, /datum/pipe_icon_manager, new()) user.canmove = 1 /obj/machinery/atmospherics/AltClick(var/mob/living/L) - if(is_type_in_list(src, ventcrawl_machinery)) + if(is_type_in_list(src, GLOB.ventcrawl_machinery)) L.handle_ventcrawl(src) return ..() diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm index 6eeb382b3d0..87c7c6426c1 100644 --- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm +++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm @@ -142,7 +142,7 @@ /obj/machinery/atmospherics/binary/passive_gate/attack_ghost(mob/user) ui_interact(user) -/obj/machinery/atmospherics/binary/passive_gate/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state) +/obj/machinery/atmospherics/binary/passive_gate/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = GLOB.default_state) user.set_machine(src) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index 92550bb9325..7e02f89c5e2 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -80,7 +80,7 @@ Thus, the two variables affect pump operation are set in New(): /obj/machinery/atmospherics/binary/pump/update_icon() ..() - + if(!powered()) icon_state = "off" else @@ -197,7 +197,7 @@ Thus, the two variables affect pump operation are set in New(): /obj/machinery/atmospherics/binary/pump/attack_ghost(mob/user) ui_interact(user) -/obj/machinery/atmospherics/binary/pump/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state) +/obj/machinery/atmospherics/binary/pump/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = GLOB.default_state) user.set_machine(src) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) diff --git a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm index 558e30d44cc..8741acb47bf 100644 --- a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm @@ -84,7 +84,7 @@ Thus, the two variables affect pump operation are set in New(): /obj/machinery/atmospherics/binary/volume_pump/update_icon() ..() - + if(!powered()) icon_state = "off" else @@ -193,7 +193,7 @@ Thus, the two variables affect pump operation are set in New(): /obj/machinery/atmospherics/binary/volume_pump/attack_ghost(mob/user) ui_interact(user) -/obj/machinery/atmospherics/binary/volume_pump/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state) +/obj/machinery/atmospherics/binary/volume_pump/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = GLOB.default_state) user.set_machine(src) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) diff --git a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm index cde1c9e80b0..d75e2e683c1 100644 --- a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm +++ b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm @@ -31,7 +31,7 @@ icon_state = "base" ports = new() - for(var/d in cardinal) + for(var/d in GLOB.cardinal) var/datum/omni_port/new_port = new(src, d) switch(d) if(NORTH) diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm index 647167800eb..84e212598c8 100755 --- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm @@ -80,7 +80,7 @@ Filter types: /obj/machinery/atmospherics/trinary/filter/update_icon() ..() - + if(flipped) icon_state = "m" else @@ -208,7 +208,7 @@ Filter types: add_fingerprint(user) ui_interact(user) -/obj/machinery/atmospherics/trinary/filter/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state) +/obj/machinery/atmospherics/trinary/filter/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = GLOB.default_state) user.set_machine(src) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm index 18f27fb9a65..6128c1afa33 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm @@ -58,7 +58,7 @@ /obj/machinery/atmospherics/trinary/mixer/update_icon(safety = 0) ..() - + if(flipped) icon_state = "m" else @@ -165,7 +165,7 @@ add_fingerprint(user) ui_interact(user) -/obj/machinery/atmospherics/trinary/mixer/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state) +/obj/machinery/atmospherics/trinary/mixer/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = GLOB.default_state) user.set_machine(src) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) diff --git a/code/ATMOSPHERICS/datum_icon_manager.dm b/code/ATMOSPHERICS/datum_icon_manager.dm index 75cb0fce8ce..23a4dab33da 100644 --- a/code/ATMOSPHERICS/datum_icon_manager.dm +++ b/code/ATMOSPHERICS/datum_icon_manager.dm @@ -14,18 +14,18 @@ #define PIPE_COLOR_YELLOW "#ffcc00" #define PIPE_COLOR_PURPLE "#5c1ec0" -var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_RED, "blue" = PIPE_COLOR_BLUE, "cyan" = PIPE_COLOR_CYAN, "green" = PIPE_COLOR_GREEN, "yellow" = PIPE_COLOR_YELLOW, "purple" = PIPE_COLOR_PURPLE) +GLOBAL_LIST_INIT(pipe_colors, list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_RED, "blue" = PIPE_COLOR_BLUE, "cyan" = PIPE_COLOR_CYAN, "green" = PIPE_COLOR_GREEN, "yellow" = PIPE_COLOR_YELLOW, "purple" = PIPE_COLOR_PURPLE)) /proc/pipe_color_lookup(var/color) - for(var/C in pipe_colors) - if(color == pipe_colors[C]) + for(var/C in GLOB.pipe_colors) + if(color == GLOB.pipe_colors[C]) return "[C]" /proc/pipe_color_check(var/color) if(!color) return 1 - for(var/C in pipe_colors) - if(color == pipe_colors[C]) + for(var/C in GLOB.pipe_colors) + if(color == GLOB.pipe_colors[C]) return 1 return 0 @@ -105,10 +105,10 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_ var/image/I = image('icons/atmos/pipes.dmi', icon_state = state) pipe_icons[cache_name] = I - for(var/pipe_color in pipe_colors) + for(var/pipe_color in GLOB.pipe_colors) I = image('icons/atmos/pipes.dmi', icon_state = state) - I.color = pipe_colors[pipe_color] - pipe_icons[state + "[pipe_colors[pipe_color]]"] = I + I.color = GLOB.pipe_colors[pipe_color] + pipe_icons[state + "[GLOB.pipe_colors[pipe_color]]"] = I pipe = new ('icons/atmos/heat.dmi') for(var/state in pipe.IconStates()) @@ -137,10 +137,10 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_ if(findtext(state, "core") || findtext(state, "4way")) var/image/I = image('icons/atmos/manifold.dmi', icon_state = state) manifold_icons[state] = I - for(var/pipe_color in pipe_colors) + for(var/pipe_color in GLOB.pipe_colors) I = image('icons/atmos/manifold.dmi', icon_state = state) - I.color = pipe_colors[pipe_color] - manifold_icons[state + pipe_colors[pipe_color]] = I + I.color = GLOB.pipe_colors[pipe_color] + manifold_icons[state + GLOB.pipe_colors[pipe_color]] = I /datum/pipe_icon_manager/proc/gen_device_icons() if(!device_icons) @@ -185,10 +185,10 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_ var/cache_name = state - for(var/D in cardinal) + for(var/D in GLOB.cardinal) var/image/I = image(icon('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D)) underlays[cache_name + "[D]"] = I - for(var/pipe_color in pipe_colors) + for(var/pipe_color in GLOB.pipe_colors) I = image(icon('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D)) - I.color = pipe_colors[pipe_color] - underlays[state + "[D]" + "[pipe_colors[pipe_color]]"] = I + I.color = GLOB.pipe_colors[pipe_color] + underlays[state + "[D]" + "[GLOB.pipe_colors[pipe_color]]"] = I diff --git a/code/ATMOSPHERICS/datum_pipeline.dm b/code/ATMOSPHERICS/datum_pipeline.dm index 4d849686851..2cf3edfb275 100644 --- a/code/ATMOSPHERICS/datum_pipeline.dm +++ b/code/ATMOSPHERICS/datum_pipeline.dm @@ -28,7 +28,7 @@ reconcile_air() return -var/pipenetwarnings = 10 +GLOBAL_VAR_INIT(pipenetwarnings, 10) /datum/pipeline/proc/build_pipeline(obj/machinery/atmospherics/base) var/volume = 0 diff --git a/code/ATMOSPHERICS/pipes/manifold.dm b/code/ATMOSPHERICS/pipes/manifold.dm index 13e35d10c7b..2eef5ad74c4 100644 --- a/code/ATMOSPHERICS/pipes/manifold.dm +++ b/code/ATMOSPHERICS/pipes/manifold.dm @@ -33,7 +33,7 @@ /obj/machinery/atmospherics/pipe/manifold/atmos_init() ..() - for(var/D in cardinal) + for(var/D in GLOB.cardinal) if(D == dir) continue for(var/obj/machinery/atmospherics/target in get_step(src, D)) @@ -116,7 +116,7 @@ /obj/machinery/atmospherics/pipe/manifold/update_icon(var/safety = 0) ..() - + if(!check_icon_cache()) return diff --git a/code/ATMOSPHERICS/pipes/manifold4w.dm b/code/ATMOSPHERICS/pipes/manifold4w.dm index d2cee29c0ba..2b384b3684b 100644 --- a/code/ATMOSPHERICS/pipes/manifold4w.dm +++ b/code/ATMOSPHERICS/pipes/manifold4w.dm @@ -90,7 +90,7 @@ /obj/machinery/atmospherics/pipe/manifold4w/update_icon(var/safety = 0) ..() - + if(!check_icon_cache()) return @@ -137,7 +137,7 @@ /obj/machinery/atmospherics/pipe/manifold4w/atmos_init() ..() - for(var/D in cardinal) + for(var/D in GLOB.cardinal) for(var/obj/machinery/atmospherics/target in get_step(src, D)) if(target.initialize_directions & get_dir(target,src)) var/c = check_connect_types(target,src) diff --git a/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm b/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm index b966690733b..94983f62acd 100644 --- a/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm +++ b/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm @@ -48,7 +48,7 @@ if(initPipe) normalize_dir() var/N = 2 - for(var/D in cardinal) + for(var/D in GLOB.cardinal) if(D & initialize_directions) N-- for(var/obj/machinery/atmospherics/target in get_step(src, D)) @@ -138,7 +138,7 @@ /obj/machinery/atmospherics/pipe/simple/update_icon(var/safety = 0) ..() - + if(!check_icon_cache()) return diff --git a/code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm b/code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm index 35df3c60d23..9c6b0da2121 100644 --- a/code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm +++ b/code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm @@ -69,7 +69,7 @@ if(initPipe) normalize_dir() var/N = 2 - for(var/D in cardinal) + for(var/D in GLOB.cardinal) if(D & initialize_directions_he) N-- for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src, D)) diff --git a/code/LINDA/LINDA_fire.dm b/code/LINDA/LINDA_fire.dm index 2fbfb1dff76..6ec505d9f9a 100644 --- a/code/LINDA/LINDA_fire.dm +++ b/code/LINDA/LINDA_fire.dm @@ -66,7 +66,7 @@ if(!fake) SSair.hotspots += src perform_exposure() - dir = pick(cardinal) + dir = pick(GLOB.cardinal) air_update_turf() /obj/effect/hotspot/proc/perform_exposure() @@ -133,7 +133,7 @@ //Possible spread due to radiated heat if(location.air.temperature > FIRE_MINIMUM_TEMPERATURE_TO_SPREAD) var/radiated_temperature = location.air.temperature*FIRE_SPREAD_RADIOSITY_SCALE - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(!(location.atmos_adjacent_turfs & direction)) var/turf/simulated/wall/W = get_step(src, direction) if(istype(W)) @@ -309,7 +309,7 @@ if(dist == max_dist) continue - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) var/turf/link = get_step(T, dir) if (!link) continue diff --git a/code/LINDA/LINDA_system.dm b/code/LINDA/LINDA_system.dm index fd24dcc0c77..c5bc65d3bf7 100644 --- a/code/LINDA/LINDA_system.dm +++ b/code/LINDA/LINDA_system.dm @@ -62,7 +62,7 @@ turf/CanPass(atom/movable/mover, turf/target, height=1.5) /turf/proc/CalculateAdjacentTurfs() atmos_adjacent_turfs_amount = 0 - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) var/turf/T = get_step(src, direction) if(!istype(T)) continue @@ -89,7 +89,7 @@ turf/CanPass(atom/movable/mover, turf/target, height=1.5) var/adjacent_turfs = list() var/turf/simulated/curloc = src - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(!(curloc.atmos_adjacent_turfs & direction)) continue @@ -99,11 +99,11 @@ turf/CanPass(atom/movable/mover, turf/target, height=1.5) if(!alldir) return adjacent_turfs - for(var/direction in diagonals) + for(var/direction in GLOB.diagonals) var/matchingDirections = 0 var/turf/simulated/S = get_step(curloc, direction) - for(var/checkDirection in cardinal) + for(var/checkDirection in GLOB.cardinal) if(!(S.atmos_adjacent_turfs & checkDirection)) continue var/turf/simulated/checkTurf = get_step(S, checkDirection) diff --git a/code/LINDA/LINDA_turf_tile.dm b/code/LINDA/LINDA_turf_tile.dm index b86ad2299ff..72f77d2440f 100644 --- a/code/LINDA/LINDA_turf_tile.dm +++ b/code/LINDA/LINDA_turf_tile.dm @@ -149,7 +149,7 @@ if (planet_atmos) atmos_adjacent_turfs_amount++ - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(!(atmos_adjacent_turfs & direction)) continue @@ -260,9 +260,9 @@ /turf/simulated/proc/get_atmos_overlay_by_name(name) switch(name) if("plasma") - return plmaster + return GLOB.plmaster if("sleeping_agent") - return slmaster + return GLOB.slmaster return null /turf/simulated/proc/tile_graphic() @@ -412,13 +412,13 @@ archive() else //Does particate in air exchange so only consider directions not considered during process_cell() - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(!(atmos_adjacent_turfs & direction) && !(atmos_supeconductivity & direction)) conductivity_directions += direction if(conductivity_directions>0) //Conduct with tiles around me - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(conductivity_directions&direction) var/turf/neighbor = get_step(src,direction) @@ -499,7 +499,7 @@ turf/simulated/proc/radiate_to_spess() //Radiate excess tile heat to space /turf/simulated/Initialize_Atmos(times_fired) ..() update_visuals() - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(!(atmos_adjacent_turfs & direction)) continue var/turf/enemy_tile = get_step(src, direction) diff --git a/code/__DEFINES/dna.dm b/code/__DEFINES/dna.dm new file mode 100644 index 00000000000..7984c1a6dde --- /dev/null +++ b/code/__DEFINES/dna.dm @@ -0,0 +1,57 @@ +// Defines for all genetics/DNA related stuff + +// What each index means: +#define DNA_OFF_LOWERBOUND 1 // changed as lists start at 1 not 0 +#define DNA_OFF_UPPERBOUND 2 +#define DNA_ON_LOWERBOUND 3 +#define DNA_ON_UPPERBOUND 4 + +// Define block bounds (off-low,off-high,on-low,on-high) +// Used in setupgame.dm +#define DNA_DEFAULT_BOUNDS list(1,2049,2050,4095) +#define DNA_HARDER_BOUNDS list(1,3049,3050,4095) +#define DNA_HARD_BOUNDS list(1,3490,3500,4095) + +// UI Indices (can change to mutblock style, if desired) +#define DNA_UI_HAIR_R 1 +#define DNA_UI_HAIR_G 2 +#define DNA_UI_HAIR_B 3 +#define DNA_UI_HAIR2_R 4 +#define DNA_UI_HAIR2_G 5 +#define DNA_UI_HAIR2_B 6 +#define DNA_UI_BEARD_R 7 +#define DNA_UI_BEARD_G 8 +#define DNA_UI_BEARD_B 9 +#define DNA_UI_BEARD2_R 10 +#define DNA_UI_BEARD2_G 11 +#define DNA_UI_BEARD2_B 12 +#define DNA_UI_SKIN_TONE 13 +#define DNA_UI_SKIN_R 14 +#define DNA_UI_SKIN_G 15 +#define DNA_UI_SKIN_B 16 +#define DNA_UI_HACC_R 17 +#define DNA_UI_HACC_G 18 +#define DNA_UI_HACC_B 19 +#define DNA_UI_HEAD_MARK_R 20 +#define DNA_UI_HEAD_MARK_G 21 +#define DNA_UI_HEAD_MARK_B 22 +#define DNA_UI_BODY_MARK_R 23 +#define DNA_UI_BODY_MARK_G 24 +#define DNA_UI_BODY_MARK_B 25 +#define DNA_UI_TAIL_MARK_R 26 +#define DNA_UI_TAIL_MARK_G 27 +#define DNA_UI_TAIL_MARK_B 28 +#define DNA_UI_EYES_R 29 +#define DNA_UI_EYES_G 30 +#define DNA_UI_EYES_B 31 +#define DNA_UI_GENDER 32 +#define DNA_UI_BEARD_STYLE 33 +#define DNA_UI_HAIR_STYLE 34 +/*#define DNA_UI_BACC_STYLE 23*/ +#define DNA_UI_HACC_STYLE 35 +#define DNA_UI_HEAD_MARK_STYLE 36 +#define DNA_UI_BODY_MARK_STYLE 37 +#define DNA_UI_TAIL_MARK_STYLE 38 +#define DNA_UI_LENGTH 38 // Update this when you add something, or you WILL break shit. + +#define DNA_SE_LENGTH 55 // Was STRUCDNASIZE, size 27. 15 new blocks added = 42, plus room to grow. diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index 33ce299c540..671897b612d 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -28,13 +28,13 @@ #define is_pen(W) (istype(W, /obj/item/pen)) -var/list/static/global/pointed_types = typecacheof(list( +GLOBAL_LIST_INIT(pointed_types, typecacheof(list( /obj/item/pen, /obj/item/screwdriver, /obj/item/reagent_containers/syringe, - /obj/item/kitchen/utensil/fork)) + /obj/item/kitchen/utensil/fork))) -#define is_pointed(W) (is_type_in_typecache(W, pointed_types)) +#define is_pointed(W) (is_type_in_typecache(W, GLOB.pointed_types)) GLOBAL_LIST_INIT(glass_sheet_types, typecacheof(list( /obj/item/stack/sheet/glass, diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 346664e0758..7eaaa86747e 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -122,10 +122,10 @@ ) #define FOR_DVIEW(type, range, center, invis_flags) \ - dview_mob.loc = center; \ - dview_mob.see_invisible = invis_flags; \ - for(type in view(range, dview_mob)) -#define END_FOR_DVIEW dview_mob.loc = null + GLOB.dview_mob.loc = center; \ + GLOB.dview_mob.see_invisible = invis_flags; \ + for(type in view(range, GLOB.dview_mob)) +#define END_FOR_DVIEW GLOB.dview_mob.loc = null //Turf locational stuff #define get_turf(A) (get_step(A, 0)) diff --git a/code/__DEFINES/rolebans.dm b/code/__DEFINES/rolebans.dm index d6e54abf14a..ad6f1324afa 100644 --- a/code/__DEFINES/rolebans.dm +++ b/code/__DEFINES/rolebans.dm @@ -1,5 +1,5 @@ // Bannable antag roles -var/global/list/antag_roles = list( +GLOBAL_LIST_INIT(antag_roles, list( ROLE_TRAITOR, ROLE_OPERATIVE, ROLE_CHANGELING, @@ -18,14 +18,14 @@ var/global/list/antag_roles = list( ROLE_GUARDIAN, ROLE_MORPH, ROLE_GSPIDER, -) +)) // Bannable other roles -var/global/list/other_roles = list( +GLOBAL_LIST_INIT(other_roles, list( ROLE_SENTIENT, ROLE_NYMPH, ROLE_ERT, ROLE_GHOST, "AntagHUD", "Records" -) +)) diff --git a/code/__HELPERS/_logging.dm b/code/__HELPERS/_logging.dm index 7a91c3bf9bc..f5d582f5e42 100644 --- a/code/__HELPERS/_logging.dm +++ b/code/__HELPERS/_logging.dm @@ -5,7 +5,7 @@ // will get logs that are one big line if the system is Linux and they are using notepad. This solves it by adding CR to every line ending // in the logs. ascii character 13 = CR -/var/global/log_end = world.system_type == UNIX ? ascii2text(13) : "" +GLOBAL_VAR_INIT(log_end, (world.system_type == UNIX ? ascii2text(13) : "")) #define DIRECT_OUTPUT(A, B) A << B #define SEND_IMAGE(target, image) DIRECT_OUTPUT(target, image) @@ -30,13 +30,13 @@ #endif /proc/log_admin(text) - admin_log.Add(text) + GLOB.admin_log.Add(text) if(config.log_admin) - WRITE_LOG(GLOB.world_game_log, "ADMIN: [text][log_end]") + WRITE_LOG(GLOB.world_game_log, "ADMIN: [text][GLOB.log_end]") /proc/log_debug(text) if(config.log_debug) - WRITE_LOG(GLOB.world_game_log, "DEBUG: [text][log_end]") + WRITE_LOG(GLOB.world_game_log, "DEBUG: [text][GLOB.log_end]") for(var/client/C in GLOB.admins) if(check_rights(R_DEBUG, 0, C.mob) && (C.prefs.toggles & CHAT_DEBUGLOGS)) @@ -44,88 +44,88 @@ /proc/log_game(text) if(config.log_game) - WRITE_LOG(GLOB.world_game_log, "GAME: [text][log_end]") + WRITE_LOG(GLOB.world_game_log, "GAME: [text][GLOB.log_end]") /proc/log_vote(text) if(config.log_vote) - WRITE_LOG(GLOB.world_game_log, "VOTE: [text][log_end]") + WRITE_LOG(GLOB.world_game_log, "VOTE: [text][GLOB.log_end]") /proc/log_access_in(client/new_client) if(config.log_access) var/message = "[key_name(new_client)] - IP:[new_client.address] - CID:[new_client.computer_id] - BYOND v[new_client.byond_version]" - WRITE_LOG(GLOB.world_game_log, "ACCESS IN: [message][log_end]") + WRITE_LOG(GLOB.world_game_log, "ACCESS IN: [message][GLOB.log_end]") /proc/log_access_out(mob/last_mob) if(config.log_access) var/message = "[key_name(last_mob)] - IP:[last_mob.lastKnownIP] - CID:[last_mob.computer_id] - BYOND Logged Out" - WRITE_LOG(GLOB.world_game_log, "ACCESS OUT: [message][log_end]") + WRITE_LOG(GLOB.world_game_log, "ACCESS OUT: [message][GLOB.log_end]") /proc/log_say(text, mob/speaker) if(config.log_say) - WRITE_LOG(GLOB.world_game_log, "SAY: [speaker.simple_info_line()]: [html_decode(text)][log_end]") + WRITE_LOG(GLOB.world_game_log, "SAY: [speaker.simple_info_line()]: [html_decode(text)][GLOB.log_end]") /proc/log_whisper(text, mob/speaker) if(config.log_whisper) - WRITE_LOG(GLOB.world_game_log, "WHISPER: [speaker.simple_info_line()]: [html_decode(text)][log_end]") + WRITE_LOG(GLOB.world_game_log, "WHISPER: [speaker.simple_info_line()]: [html_decode(text)][GLOB.log_end]") /proc/log_ooc(text, client/user) if(config.log_ooc) - WRITE_LOG(GLOB.world_game_log, "OOC: [user.simple_info_line()]: [html_decode(text)][log_end]") + WRITE_LOG(GLOB.world_game_log, "OOC: [user.simple_info_line()]: [html_decode(text)][GLOB.log_end]") /proc/log_aooc(text, client/user) if(config.log_ooc) - WRITE_LOG(GLOB.world_game_log, "AOOC: [user.simple_info_line()]: [html_decode(text)][log_end]") + WRITE_LOG(GLOB.world_game_log, "AOOC: [user.simple_info_line()]: [html_decode(text)][GLOB.log_end]") /proc/log_looc(text, client/user) if(config.log_ooc) - WRITE_LOG(GLOB.world_game_log, "LOOC: [user.simple_info_line()]: [html_decode(text)][log_end]") + WRITE_LOG(GLOB.world_game_log, "LOOC: [user.simple_info_line()]: [html_decode(text)][GLOB.log_end]") /proc/log_emote(text, mob/speaker) if(config.log_emote) - WRITE_LOG(GLOB.world_game_log, "EMOTE: [speaker.simple_info_line()]: [html_decode(text)][log_end]") + WRITE_LOG(GLOB.world_game_log, "EMOTE: [speaker.simple_info_line()]: [html_decode(text)][GLOB.log_end]") /proc/log_attack(attacker, defender, message) if(config.log_attack) - WRITE_LOG(GLOB.world_game_log, "ATTACK: [attacker] against [defender]: [message][log_end]") //Seperate attack logs? Why? + WRITE_LOG(GLOB.world_game_log, "ATTACK: [attacker] against [defender]: [message][GLOB.log_end]") //Seperate attack logs? Why? /proc/log_adminsay(text, mob/speaker) if(config.log_adminchat) - WRITE_LOG(GLOB.world_game_log, "ADMINSAY: [speaker.simple_info_line()]: [html_decode(text)][log_end]") + WRITE_LOG(GLOB.world_game_log, "ADMINSAY: [speaker.simple_info_line()]: [html_decode(text)][GLOB.log_end]") /proc/log_qdel(text) WRITE_LOG(GLOB.world_qdel_log, "QDEL: [text]") /proc/log_mentorsay(text, mob/speaker) if(config.log_adminchat) - WRITE_LOG(GLOB.world_game_log, "MENTORSAY: [speaker.simple_info_line()]: [html_decode(text)][log_end]") + WRITE_LOG(GLOB.world_game_log, "MENTORSAY: [speaker.simple_info_line()]: [html_decode(text)][GLOB.log_end]") /proc/log_ghostsay(text, mob/speaker) if(config.log_say) - WRITE_LOG(GLOB.world_game_log, "DEADCHAT: [speaker.simple_info_line()]: [html_decode(text)][log_end]") + WRITE_LOG(GLOB.world_game_log, "DEADCHAT: [speaker.simple_info_line()]: [html_decode(text)][GLOB.log_end]") /proc/log_ghostemote(text, mob/speaker) if(config.log_emote) - WRITE_LOG(GLOB.world_game_log, "DEADEMOTE: [speaker.simple_info_line()]: [html_decode(text)][log_end]") + WRITE_LOG(GLOB.world_game_log, "DEADEMOTE: [speaker.simple_info_line()]: [html_decode(text)][GLOB.log_end]") /proc/log_adminwarn(text) if(config.log_adminwarn) - WRITE_LOG(GLOB.world_game_log, "ADMINWARN: [html_decode(text)][log_end]") + WRITE_LOG(GLOB.world_game_log, "ADMINWARN: [html_decode(text)][GLOB.log_end]") /proc/log_pda(text, mob/speaker) if(config.log_pda) - WRITE_LOG(GLOB.world_game_log, "PDA: [speaker.simple_info_line()]: [html_decode(text)][log_end]") + WRITE_LOG(GLOB.world_game_log, "PDA: [speaker.simple_info_line()]: [html_decode(text)][GLOB.log_end]") /proc/log_chat(text, mob/speaker) if(config.log_pda) - WRITE_LOG(GLOB.world_game_log, "CHAT: [speaker.simple_info_line()] [html_decode(text)][log_end]") + WRITE_LOG(GLOB.world_game_log, "CHAT: [speaker.simple_info_line()] [html_decode(text)][GLOB.log_end]") /proc/log_misc(text) - WRITE_LOG(GLOB.world_game_log, "MISC: [text][log_end]") + WRITE_LOG(GLOB.world_game_log, "MISC: [text][GLOB.log_end]") /proc/log_world(text) SEND_TEXT(world.log, text) if(config && config.log_world_output) - WRITE_LOG(GLOB.world_game_log, "WORLD: [html_decode(text)][log_end]") + WRITE_LOG(GLOB.world_game_log, "WORLD: [html_decode(text)][GLOB.log_end]") /proc/log_runtime_txt(text) // different from /tg/'s log_runtime because our error handler has a log_runtime proc already that does other stuff WRITE_LOG(GLOB.world_runtime_log, text) diff --git a/code/__HELPERS/_string_lists.dm b/code/__HELPERS/_string_lists.dm index 36aa2f9b6fa..e2f0c6081e7 100644 --- a/code/__HELPERS/_string_lists.dm +++ b/code/__HELPERS/_string_lists.dm @@ -2,15 +2,15 @@ #define pick_list_replacements(FILE, KEY) (strings_replacement(FILE, KEY)) #define json_load(FILE) (json_decode(file2text(FILE))) -var/global/list/string_cache -var/global/list/string_filename_current_key +GLOBAL_LIST_EMPTY(string_cache) +GLOBAL_LIST_EMPTY(string_filename_current_key) /proc/strings_replacement(filename, key) load_strings_file(filename) - if((filename in string_cache) && (key in string_cache[filename])) - var/response = pick(string_cache[filename][key]) + if((filename in GLOB.string_cache) && (key in GLOB.string_cache[filename])) + var/response = pick(GLOB.string_cache[filename][key]) var/regex/r = regex("@pick\\((\\D+?)\\)", "g") response = r.Replace(response, /proc/strings_subkey_lookup) return response @@ -19,23 +19,23 @@ var/global/list/string_filename_current_key /proc/strings(filename as text, key as text) load_strings_file(filename) - if((filename in string_cache) && (key in string_cache[filename])) - return string_cache[filename][key] + if((filename in GLOB.string_cache) && (key in GLOB.string_cache[filename])) + return GLOB.string_cache[filename][key] else CRASH("strings list not found: strings/[filename], index=[key]") /proc/strings_subkey_lookup(match, group1) - return pick_list(string_filename_current_key, group1) + return pick_list(GLOB.string_filename_current_key, group1) /proc/load_strings_file(filename) - string_filename_current_key = filename - if(filename in string_cache) + GLOB.string_filename_current_key = filename + if(filename in GLOB.string_cache) return //no work to do - if(!string_cache) - string_cache = new + if(!GLOB.string_cache) + GLOB.string_cache = new if(fexists("strings/[filename]")) - string_cache[filename] = json_load("strings/[filename]") + GLOB.string_cache[filename] = json_load("strings/[filename]") else CRASH("file not found: strings/[filename]") diff --git a/code/__HELPERS/files.dm b/code/__HELPERS/files.dm index c96357299c2..f8817c2e8e6 100644 --- a/code/__HELPERS/files.dm +++ b/code/__HELPERS/files.dm @@ -51,10 +51,10 @@ PLEASE USE RESPONSIBLY, Some log files canr each sizes of 4MB! */ /client/proc/file_spam_check() - var/time_to_wait = fileaccess_timer - world.time + var/time_to_wait = GLOB.fileaccess_timer - world.time if(time_to_wait > 0) to_chat(src, "Error: file_spam_check(): Spam. Please wait [round(time_to_wait/10)] seconds.") return 1 - fileaccess_timer = world.time + FTPDELAY + GLOB.fileaccess_timer = world.time + FTPDELAY return 0 #undef FTPDELAY diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index f61b6452f22..263f7a9b86f 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -120,7 +120,7 @@ -//var/debug_mob = 0 +//GLOBAL_VAR_INIT(debug_mob, 0) // Will recursively loop through an atom's contents and check for mobs, then it will loop through every atom in that atom's contents. // It will keep doing this until it checks every content possible. This will fix any problems with mobs, that are inside objects, @@ -128,7 +128,7 @@ /proc/recursive_mob_check(var/atom/O, var/list/L = list(), var/recursion_limit = 3, var/client_check = 1, var/sight_check = 1, var/include_radio = 1) - //debug_mob += O.contents.len + //GLOB.debug_mob += O.contents.len if(!recursion_limit) return L for(var/atom/A in O.contents) @@ -273,7 +273,7 @@ /proc/try_move_adjacent(atom/movable/AM) var/turf/T = get_turf(AM) - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(AM.Move(get_step(T, direction))) break diff --git a/code/__HELPERS/icon_smoothing.dm b/code/__HELPERS/icon_smoothing.dm index acf202f0eee..dc256a93478 100644 --- a/code/__HELPERS/icon_smoothing.dm +++ b/code/__HELPERS/icon_smoothing.dm @@ -66,7 +66,7 @@ if(AM.can_be_unanchored && !AM.anchored) return 0 - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) AM = find_type_in_direction(A, direction) if(AM == NULLTURF_BORDER) if((A.smooth & SMOOTH_BORDER)) diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index a434dd75577..fe904e6c2ed 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -15,7 +15,7 @@ CHANGING ICONS Several new procs have been added to the /icon datum to simplify working with icons. To use them, remember you first need to setup an /icon var like so: -var/icon/my_icon = new('iconfile.dmi') + var/icon/my_icon = new('iconfile.dmi') icon/ChangeOpacity(amount = 1) A very common operation in DM is to try to make an icon more or less transparent. Making an icon more diff --git a/code/__HELPERS/maths.dm b/code/__HELPERS/maths.dm index d3deb81d458..76d422e3d82 100644 --- a/code/__HELPERS/maths.dm +++ b/code/__HELPERS/maths.dm @@ -77,13 +77,13 @@ //68% chance that the number is within 1stddev //95% chance that the number is within 2stddev //98% chance that the number is within 3stddev...etc -var/gaussian_next +GLOBAL_VAR(gaussian_next) #define ACCURACY 10000 /proc/gaussian(mean, stddev) var/R1;var/R2;var/working - if(gaussian_next != null) - R1 = gaussian_next - gaussian_next = null + if(GLOB.gaussian_next != null) + R1 = GLOB.gaussian_next + GLOB.gaussian_next = null else do R1 = rand(-ACCURACY,ACCURACY)/ACCURACY @@ -92,7 +92,7 @@ var/gaussian_next while(working >= 1 || working==0) working = sqrt(-2 * log(working) / working) R1 *= working - gaussian_next = R2 * working + GLOB.gaussian_next = R2 * working return (mean + stddev * R1) #undef ACCURACY diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 2dc3057ce19..cdbb969f817 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -59,7 +59,7 @@ proc/random_hair_style(var/gender, species = "Human", var/datum/robolimb/robohea continue if(species == "Machine") //If the user is a species who can have a robotic head... if(!robohead) - robohead = all_robolimbs["Morpheus Cyberkinetics"] + robohead = GLOB.all_robolimbs["Morpheus Cyberkinetics"] if((species in S.species_allowed) && robohead.is_monitor && ((S.models_allowed && (robohead.company in S.models_allowed)) || !S.models_allowed)) //If this is a hair style native to the user's species, check to see if they have a head with an ipc-style screen and that the head's company is in the screen style's allowed models list. valid_hairstyles += hairstyle //Give them their hairstyles if they do. else @@ -88,7 +88,7 @@ proc/random_facial_hair_style(var/gender, species = "Human", var/datum/robolimb/ continue if(species == "Machine") //If the user is a species who can have a robotic head... if(!robohead) - robohead = all_robolimbs["Morpheus Cyberkinetics"] + robohead = GLOB.all_robolimbs["Morpheus Cyberkinetics"] if((species in S.species_allowed) && robohead.is_monitor && ((S.models_allowed && (robohead.company in S.models_allowed)) || !S.models_allowed)) //If this is a facial hair style native to the user's species, check to see if they have a head with an ipc-style screen and that the head's company is in the screen style's allowed models list. valid_facial_hairstyles += facialhairstyle //Give them their facial hairstyles if they do. else @@ -142,7 +142,7 @@ proc/random_marking_style(var/location = "body", species = "Human", var/datum/ro var/datum/sprite_accessory/body_markings/head/M = GLOB.marking_styles_list[S.name] if(species == "Machine")//If the user is a species that can have a robotic head... if(!robohead) - robohead = all_robolimbs["Morpheus Cyberkinetics"] + robohead = GLOB.all_robolimbs["Morpheus Cyberkinetics"] if(!(S.models_allowed && (robohead.company in S.models_allowed))) //Make sure they don't get markings incompatible with their head. continue else if(alt_head && alt_head != "None") //If the user's got an alt head, validate markings for that head. @@ -161,8 +161,8 @@ proc/random_marking_style(var/location = "body", species = "Human", var/datum/ro proc/random_body_accessory(species = "Vulpkanin") var/body_accessory = null var/list/valid_body_accessories = list() - for(var/B in body_accessory_by_name) - var/datum/body_accessory/A = body_accessory_by_name[B] + for(var/B in GLOB.body_accessory_by_name) + var/datum/body_accessory/A = GLOB.body_accessory_by_name[B] if(!istype(A)) valid_body_accessories += "None" //The only null entry should be the "None" option. continue @@ -261,7 +261,7 @@ proc/age2agedescription(age) status = "Released" target_records.fields["criminal"] = status log_admin("[key_name_admin(user)] set secstatus of [their_rank] [their_name] to [status], comment: [comment]") - target_records.fields["comments"] += "Set to [status] by [user.name] ([user_rank]) on [current_date_string] [station_time_timestamp()], comment: [comment]" + target_records.fields["comments"] += "Set to [status] by [user.name] ([user_rank]) on [GLOB.current_date_string] [station_time_timestamp()], comment: [comment]" update_all_mob_security_hud() return 1 diff --git a/code/__HELPERS/names.dm b/code/__HELPERS/names.dm index 2125326852e..d702c073b86 100644 --- a/code/__HELPERS/names.dm +++ b/code/__HELPERS/names.dm @@ -1,7 +1,7 @@ -var/church_name = null +GLOBAL_VAR(church_name) /proc/church_name() - if(church_name) - return church_name + if(GLOB.church_name) + return GLOB.church_name var/name = "" @@ -15,9 +15,9 @@ var/church_name = null return name -var/command_name = null +GLOBAL_VAR(command_name) /proc/command_name() - return using_map.dock_name + return GLOB.using_map.dock_name var/religion_name = null /proc/religion_name() @@ -32,10 +32,10 @@ var/religion_name = null return capitalize(name) /proc/system_name() - return using_map.starsys_name + return GLOB.using_map.starsys_name /proc/station_name() - return using_map.station_name + return GLOB.using_map.station_name /proc/new_station_name() var/random = rand(1,5) @@ -80,10 +80,10 @@ var/religion_name = null new_station_name += pick("13","XIII","Thirteen") return new_station_name -var/syndicate_name = null +GLOBAL_VAR(syndicate_name) /proc/syndicate_name() - if(syndicate_name) - return syndicate_name + if(GLOB.syndicate_name) + return GLOB.syndicate_name var/name = "" @@ -107,7 +107,7 @@ var/syndicate_name = null name += pick("-", "*", "") name += pick("Tech", "Sun", "Co", "Tek", "X", "Inc", "Gen", "Star", "Dyne", "Code", "Hive") - syndicate_name = name + GLOB.syndicate_name = name return name @@ -142,10 +142,10 @@ GLOBAL_VAR(syndicate_code_response) //Code response for traitors. var/safety[] = list(1,2,3)//Tells the proc which options to remove later on. var/nouns[] = list("love","hate","anger","peace","pride","sympathy","bravery","loyalty","honesty","integrity","compassion","charity","success","courage","deceit","skill","beauty","brilliance","pain","misery","beliefs","dreams","justice","truth","faith","liberty","knowledge","thought","information","culture","trust","dedication","progress","education","hospitality","leisure","trouble","friendships", "relaxation") var/drinks[] = list("vodka and tonic","gin fizz","bahama mama","manhattan","black Russian","whiskey soda","long island tea","margarita","Irish coffee"," manly dwarf","Irish cream","doctor's delight","Beepksy Smash","tequila sunrise","brave bull","gargle blaster","bloody mary","whiskey cola","white Russian","vodka martini","martini","Cuba libre","kahlua","vodka","wine","moonshine") - var/locations[] = teleportlocs.len ? teleportlocs : drinks//if null, defaults to drinks instead. + var/locations[] = GLOB.teleportlocs.len ? GLOB.teleportlocs : drinks//if null, defaults to drinks instead. var/names[] = list() - for(var/datum/data/record/t in data_core.general)//Picks from crew manifest. + for(var/datum/data/record/t in GLOB.data_core.general)//Picks from crew manifest. names += t.fields["name"] var/maxwords = words//Extra var to check for duplicates. diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index 289bbbae717..ecbebf813df 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -19,7 +19,7 @@ return null if(!istext(t)) t = "[t]" // Just quietly assume any non-texts are supposed to be text - var/sqltext = dbcon.Quote(t); + var/sqltext = GLOB.dbcon.Quote(t); return copytext(sqltext, 2, length(sqltext));//Quote() adds quotes around input, we already do that /proc/format_table_name(table as text) @@ -207,7 +207,7 @@ proc/checkhtml(var/t) tag = copytext(t,start, p) p++ tag = copytext(t,start+1, p) - if(!(tag in paper_tag_whitelist)) //if it's unkown tag, disarming it + if(!(tag in GLOB.paper_tag_whitelist)) //if it's unkown tag, disarming it t = copytext(t,1,start-1) + "<" + copytext(t,start+1) p = findtext(t,"<",p) return t diff --git a/code/__HELPERS/unique_ids.dm b/code/__HELPERS/unique_ids.dm index a66de0b5a88..549f5c71016 100644 --- a/code/__HELPERS/unique_ids.dm +++ b/code/__HELPERS/unique_ids.dm @@ -14,7 +14,7 @@ // var/myUID = mydatum.UID() // var/datum/D = locateUID(myUID) -var/global/next_unique_datum_id = 1 +GLOBAL_VAR_INIT(next_unique_datum_id, 1) // /client/var/tmp/unique_datum_id = null @@ -22,7 +22,7 @@ var/global/next_unique_datum_id = 1 if(!unique_datum_id) var/tag_backup = tag tag = null // Grab the raw ref, not the tag - unique_datum_id = "\ref[src]_[next_unique_datum_id++]" + unique_datum_id = "\ref[src]_[GLOB.next_unique_datum_id++]" tag = tag_backup return unique_datum_id diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 45283498ebd..c5a77880cf0 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1129,9 +1129,9 @@ proc/get_mob_with_client_list() //For objects that should embed, but make no sense being is_sharp or is_pointed() //e.g: rods -var/list/can_embed_types = typecacheof(list( +GLOBAL_LIST_INIT(can_embed_types, typecacheof(list( /obj/item/stack/rods, - /obj/item/pipe)) + /obj/item/pipe))) /proc/can_embed(obj/item/W) if(is_sharp(W)) @@ -1139,7 +1139,7 @@ var/list/can_embed_types = typecacheof(list( if(is_pointed(W)) return 1 - if(is_type_in_typecache(W, can_embed_types)) + if(is_type_in_typecache(W, GLOB.can_embed_types)) return 1 /proc/is_hot(obj/item/W as obj) @@ -1221,18 +1221,18 @@ var/list/can_embed_types = typecacheof(list( /* Checks if that loc and dir has a item on the wall */ -var/list/static/global/wall_items = typecacheof(list(/obj/machinery/power/apc, /obj/machinery/alarm, +GLOBAL_LIST_INIT(wall_items, typecacheof(list(/obj/machinery/power/apc, /obj/machinery/alarm, /obj/item/radio/intercom, /obj/structure/extinguisher_cabinet, /obj/structure/reagent_dispensers/peppertank, /obj/machinery/status_display, /obj/machinery/requests_console, /obj/machinery/light_switch, /obj/structure/sign, /obj/machinery/newscaster, /obj/machinery/firealarm, /obj/structure/noticeboard, /obj/machinery/door_control, /obj/machinery/computer/security/telescreen, /obj/machinery/embedded_controller/radio/airlock, /obj/item/storage/secure/safe, /obj/machinery/door_timer, /obj/machinery/flasher, /obj/machinery/keycard_auth, /obj/structure/mirror, /obj/structure/closet/fireaxecabinet, /obj/machinery/computer/security/telescreen/entertainment, - /obj/structure/sign)) + /obj/structure/sign))) /proc/gotwallitem(loc, dir) for(var/obj/O in loc) - if(is_type_in_typecache(O, wall_items)) + if(is_type_in_typecache(O, GLOB.wall_items)) //Direction works sometimes if(O.dir == dir) return 1 @@ -1254,7 +1254,7 @@ var/list/static/global/wall_items = typecacheof(list(/obj/machinery/power/apc, / //Some stuff is placed directly on the wallturf (signs) for(var/obj/O in get_step(loc, dir)) - if(is_type_in_typecache(O, wall_items)) + if(is_type_in_typecache(O, GLOB.wall_items)) if(abs(O.pixel_x) <= 10 && abs(O.pixel_y) <= 10) return 1 return 0 @@ -1381,7 +1381,7 @@ atom/proc/GetTypeInAllContents(typepath) var/initial_chance = chance while(steps > 0) if(prob(chance)) - step(AM, pick(alldirs)) + step(AM, pick(GLOB.alldirs)) chance = max(chance - (initial_chance / steps), 0) steps-- @@ -1415,19 +1415,19 @@ atom/proc/GetTypeInAllContents(typepath) return locate(dest_x,dest_y,dest_z) -var/mob/dview/dview_mob = new +GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) //Version of view() which ignores darkness, because BYOND doesn't have it. /proc/dview(var/range = world.view, var/center, var/invis_flags = 0) if(!center) return - dview_mob.loc = center + GLOB.dview_mob.loc = center - dview_mob.see_invisible = invis_flags + GLOB.dview_mob.see_invisible = invis_flags - . = view(range, dview_mob) - dview_mob.loc = null + . = view(range, GLOB.dview_mob) + GLOB.dview_mob.loc = null /mob/dview invisibility = 101 diff --git a/code/_globalvars/configuration.dm b/code/_globalvars/configuration.dm index ee3f6a73a92..5cf36541eeb 100644 --- a/code/_globalvars/configuration.dm +++ b/code/_globalvars/configuration.dm @@ -1,45 +1,45 @@ -var/datum/configuration/config = null +GLOBAL_REAL(config, /datum/configuration) -var/host = null -var/join_motd = null +GLOBAL_VAR(host) +GLOBAL_VAR(join_motd) GLOBAL_VAR(join_tos) -var/game_version = "ParaCode" -var/changelog_hash = md5('html/changelog.html') //used to check if the CL changed -var/game_year = (text2num(time2text(world.realtime, "YYYY")) + 544) +GLOBAL_VAR_INIT(game_version, "ParaCode") +GLOBAL_VAR_INIT(changelog_hash, md5('html/changelog.html')) //used to check if the CL changed +GLOBAL_VAR_INIT(game_year, (text2num(time2text(world.realtime, "YYYY")) + 544)) -var/aliens_allowed = 1 -var/traitor_scaling = 1 -//var/goonsay_allowed = 0 -var/dna_ident = 1 -var/abandon_allowed = 0 -var/enter_allowed = 1 -var/guests_allowed = 1 -var/shuttle_frozen = 0 -var/shuttle_left = 0 -var/tinted_weldhelh = 1 -var/mouse_respawn_time = 5 //Amount of time that must pass between a player dying as a mouse and repawning as a mouse. In minutes. - -// Command to run if shutting down (SHUTDOWN_ON_REBOOT) instead of rebooting -// It's defined here as a global because this is a hilariously bad thing to have on the easily-edited config datum -var/global/shutdown_shell_command - -// Also global to prevent easy edits -var/global/python_path = "" //Path to the python executable. Defaults to "python" on windows and "/usr/bin/env python2" on unix +GLOBAL_VAR_INIT(aliens_allowed, 1) +GLOBAL_VAR_INIT(traitor_scaling, 1) +//GLOBAL_VAR_INIT(goonsay_allowed, 0) +GLOBAL_VAR_INIT(dna_ident, 1) +GLOBAL_VAR_INIT(abandon_allowed, 0) +GLOBAL_VAR_INIT(enter_allowed, 1) +GLOBAL_VAR_INIT(guests_allowed, 1) +GLOBAL_VAR_INIT(shuttle_frozen, 0) +GLOBAL_VAR_INIT(shuttle_left, 0) +GLOBAL_VAR_INIT(tinted_weldhelh, 1) +GLOBAL_VAR_INIT(mouse_respawn_time, 5) //Amount of time that must pass between a player dying as a mouse and repawning as a mouse. In minutes. // Debug is used exactly once (in living.dm) but is commented out in a lot of places. It is not set anywhere and only checked. // Debug2 is used in conjunction with a lot of admin verbs and therefore is actually legit. -var/Debug = 0 // global debug switch -var/Debug2 = 1 // enables detailed job debug file in secrets +GLOBAL_VAR_INIT(debug, 0) // global debug switch +GLOBAL_VAR_INIT(debug2, 1) // enables detailed job debug file in secrets //This was a define, but I changed it to a variable so it can be changed in-game.(kept the all-caps definition because... code...) -Errorage -var/MAX_EX_DEVASTATION_RANGE = 3 -var/MAX_EX_HEAVY_RANGE = 7 -var/MAX_EX_LIGHT_RANGE = 14 -var/MAX_EX_FLASH_RANGE = 14 -var/MAX_EX_FLAME_RANGE = 14 +GLOBAL_VAR_INIT(max_ex_devastation_range, 3) +GLOBAL_VAR_INIT(max_ex_heavy_range, 7) +GLOBAL_VAR_INIT(max_ex_light_range, 14) +GLOBAL_VAR_INIT(max_ex_flash_range, 14) +GLOBAL_VAR_INIT(max_ex_flame_range, 14) //Random event stuff, apparently used -var/eventchance = 10 //% per 5 mins -var/event = 0 -var/hadevent = 0 -var/blobevent = 0 +GLOBAL_VAR_INIT(eventchance, 10) //% per 5 mins +GLOBAL_VAR_INIT(event, 0) +GLOBAL_VAR_INIT(hadevent, 0) +GLOBAL_VAR_INIT(blobevent, 0) + +// These vars are protected because changing them could pose a security risk, though they are fine to be read since they are just system paths +GLOBAL_VAR(shutdown_shell_command) // Command to run if shutting down (SHUTDOWN_ON_REBOOT) instead of rebooting +GLOBAL_PROTECT(shutdown_shell_command) + +GLOBAL_VAR(python_path) //Path to the python executable. Defaults to "python" on windows and "/usr/bin/env python2" on unix +GLOBAL_PROTECT(python_path) diff --git a/code/_globalvars/database.dm b/code/_globalvars/database.dm deleted file mode 100644 index 5c5b4e93f6a..00000000000 --- a/code/_globalvars/database.dm +++ /dev/null @@ -1,11 +0,0 @@ -// MySQL configuration -var/sqladdress = "localhost" -var/sqlport = "3306" -var/sqlfdbkdb = "test" -var/sqlfdbklogin = "root" -var/sqlfdbkpass = "" -var/sqlfdbktableprefix = "erro_" //backwords compatibility with downstream server hosts - -//Database connections -//A connection is established on world creation. Ideally, the connection dies when the server restarts (After feedback logging.). -var/DBConnection/dbcon = new() //Feedback database (New database) diff --git a/code/_globalvars/game_modes.dm b/code/_globalvars/game_modes.dm index 3f8ec321470..3088270579c 100644 --- a/code/_globalvars/game_modes.dm +++ b/code/_globalvars/game_modes.dm @@ -1,10 +1,11 @@ -var/master_mode = "extended"//"extended" -var/secret_force_mode = "secret" // if this is anything but "secret", the secret rotation will forceably choose this mode -var/wavesecret = 0 // meteor mode, delays wave progression, terrible name -var/datum/station_state/start_state = null // Used in round-end report +GLOBAL_VAR_INIT(master_mode, "extended") //"extended" +GLOBAL_VAR_INIT(secret_force_mode, "secret") // if this is anything but "secret", the secret rotation will forceably choose this mode -var/custom_event_msg = null -var/custom_event_admin_msg = null +GLOBAL_VAR_INIT(wavesecret, 0) // meteor mode, delays wave progression, terrible name +GLOBAL_DATUM(start_state, /datum/station_state) // Used in round-end report. Dont ask why it inits as null -var/list/summon_spots = list() +GLOBAL_VAR(custom_event_msg) +GLOBAL_VAR(custom_event_admin_msg) + +GLOBAL_LIST_EMPTY(summon_spots) diff --git a/code/_globalvars/genetics.dm b/code/_globalvars/genetics.dm index 6a4a118f866..1119ac364cc 100644 --- a/code/_globalvars/genetics.dm +++ b/code/_globalvars/genetics.dm @@ -1,68 +1,68 @@ /////////// -var/BLINDBLOCK = 0 -var/COLOURBLINDBLOCK = 0 -var/DEAFBLOCK = 0 -var/HULKBLOCK = 0 -var/TELEBLOCK = 0 -var/FIREBLOCK = 0 -var/XRAYBLOCK = 0 -var/CLUMSYBLOCK = 0 -var/FAKEBLOCK = 0 -var/COUGHBLOCK = 0 -var/GLASSESBLOCK = 0 -var/EPILEPSYBLOCK = 0 -var/TWITCHBLOCK = 0 -var/NERVOUSBLOCK = 0 -var/WINGDINGSBLOCK = 0 -var/MONKEYBLOCK = 50 // Monkey block will always be the DNA_SE_LENGTH +GLOBAL_VAR_INIT(blindblock, 0) +GLOBAL_VAR_INIT(colourblindblock, 0) +GLOBAL_VAR_INIT(deafblock, 0) +GLOBAL_VAR_INIT(hulkblock, 0) +GLOBAL_VAR_INIT(teleblock, 0) +GLOBAL_VAR_INIT(fireblock, 0) +GLOBAL_VAR_INIT(xrayblock, 0) +GLOBAL_VAR_INIT(clumsyblock, 0) +GLOBAL_VAR_INIT(fakeblock, 0) +GLOBAL_VAR_INIT(coughblock, 0) +GLOBAL_VAR_INIT(glassesblock, 0) +GLOBAL_VAR_INIT(epilepsyblock, 0) +GLOBAL_VAR_INIT(twitchblock, 0) +GLOBAL_VAR_INIT(nervousblock, 0) +GLOBAL_VAR_INIT(wingdingsblock, 0) +GLOBAL_VAR_INIT(monkeyblock, DNA_SE_LENGTH) // Monkey block will always be the DNA_SE_LENGTH -var/BLOCKADD = 0 -var/DIFFMUT = 0 +GLOBAL_VAR_INIT(blockadd, 0) +GLOBAL_VAR_INIT(diffmut, 0) -var/BREATHLESSBLOCK = 0 -var/REMOTEVIEWBLOCK = 0 -var/REGENERATEBLOCK = 0 -var/INCREASERUNBLOCK = 0 -var/REMOTETALKBLOCK = 0 -var/MORPHBLOCK = 0 -var/COLDBLOCK = 0 -var/HALLUCINATIONBLOCK = 0 -var/NOPRINTSBLOCK = 0 -var/SHOCKIMMUNITYBLOCK = 0 -var/SMALLSIZEBLOCK = 0 +GLOBAL_VAR_INIT(breathlessblock, 0) +GLOBAL_VAR_INIT(remoteviewblock, 0) +GLOBAL_VAR_INIT(regenerateblock, 0) +GLOBAL_VAR_INIT(increaserunblock, 0) +GLOBAL_VAR_INIT(remotetalkblock, 0) +GLOBAL_VAR_INIT(morphblock, 0) +GLOBAL_VAR_INIT(coldblock, 0) +GLOBAL_VAR_INIT(hallucinationblock, 0) +GLOBAL_VAR_INIT(noprintsblock, 0) +GLOBAL_VAR_INIT(shockimmunityblock, 0) +GLOBAL_VAR_INIT(smallsizeblock, 0) /////////////////////////////// // Goon Stuff /////////////////////////////// // Disabilities -var/LISPBLOCK = 0 -var/MUTEBLOCK = 0 -var/RADBLOCK = 0 -var/FATBLOCK = 0 -var/CHAVBLOCK = 0 -var/SWEDEBLOCK = 0 -var/SCRAMBLEBLOCK = 0 -var/STRONGBLOCK = 0 -var/HORNSBLOCK = 0 -var/COMICBLOCK = 0 +GLOBAL_VAR_INIT(lispblock, 0) +GLOBAL_VAR_INIT(muteblock, 0) +GLOBAL_VAR_INIT(radblock, 0) +GLOBAL_VAR_INIT(fatblock, 0) +GLOBAL_VAR_INIT(chavblock, 0) +GLOBAL_VAR_INIT(swedeblock, 0) +GLOBAL_VAR_INIT(scrambleblock, 0) +GLOBAL_VAR_INIT(strongblock, 0) +GLOBAL_VAR_INIT(hornsblock, 0) +GLOBAL_VAR_INIT(comicblock, 0) // Powers -var/SOBERBLOCK = 0 -var/PSYRESISTBLOCK = 0 -var/SHADOWBLOCK = 0 -var/CHAMELEONBLOCK = 0 -var/CRYOBLOCK = 0 -var/EATBLOCK = 0 -var/JUMPBLOCK = 0 -var/EMPATHBLOCK = 0 -var/IMMOLATEBLOCK = 0 -var/POLYMORPHBLOCK = 0 +GLOBAL_VAR_INIT(soberblock, 0) +GLOBAL_VAR_INIT(psyresistblock, 0) +GLOBAL_VAR_INIT(shadowblock, 0) +GLOBAL_VAR_INIT(chameleonblock, 0) +GLOBAL_VAR_INIT(cryoblock, 0) +GLOBAL_VAR_INIT(eatblock, 0) +GLOBAL_VAR_INIT(jumpblock, 0) +GLOBAL_VAR_INIT(empathblock, 0) +GLOBAL_VAR_INIT(immolateblock, 0) +GLOBAL_VAR_INIT(polymorphblock, 0) /////////////////////////////// // /vg/ Mutations /////////////////////////////// -var/LOUDBLOCK = 0 -var/DIZZYBLOCK = 0 +GLOBAL_VAR_INIT(loudblock, 0) +GLOBAL_VAR_INIT(dizzyblock, 0) -var/list/reg_dna = list( ) //this appears to be a list of UE == real_name correlations -var/list/global_mutations = list() // list of hidden mutation things +GLOBAL_LIST_EMPTY(reg_dna) +GLOBAL_LIST_EMPTY(global_mutations) diff --git a/code/_globalvars/lists/devil.dm b/code/_globalvars/lists/devil.dm index 2c941069fe4..54528709573 100644 --- a/code/_globalvars/lists/devil.dm +++ b/code/_globalvars/lists/devil.dm @@ -1,8 +1,8 @@ //what could possibly go wrong -var/list/devil_machines = typecacheof(/obj/item/circuitboard, TRUE) - list( +GLOBAL_LIST_INIT(devil_machines, typecacheof(/obj/item/circuitboard, TRUE) - list( /obj/item/circuitboard/shuttle, /obj/item/circuitboard/swfdoor, /obj/item/circuitboard/olddoor, /obj/item/circuitboard/computer, /obj/item/circuitboard/machine - ) +)) diff --git a/code/_globalvars/logging.dm b/code/_globalvars/logging.dm index 10c7d74c752..0ea513708a1 100644 --- a/code/_globalvars/logging.dm +++ b/code/_globalvars/logging.dm @@ -1,3 +1,4 @@ +// Everything in this file should be protected GLOBAL_VAR(log_directory) GLOBAL_PROTECT(log_directory) GLOBAL_VAR(world_game_log) @@ -15,14 +16,20 @@ GLOBAL_PROTECT(world_asset_log) GLOBAL_VAR(runtime_summary_log) GLOBAL_PROTECT(runtime_summary_log) -var/list/jobMax = list() -var/list/admin_log = list ( ) -var/list/lastsignalers = list( ) //keeps last 100 signals here in format: "[src] used \ref[src] @ location [src.loc]: [freq]/[code]" -var/list/lawchanges = list( ) //Stores who uploaded laws to which silicon-based lifeform, and what the law was +GLOBAL_LIST_EMPTY(jobMax) +GLOBAL_PROTECT(jobMax) +GLOBAL_LIST_EMPTY(admin_log) +GLOBAL_PROTECT(admin_log) +GLOBAL_LIST_EMPTY(lastsignalers) +GLOBAL_PROTECT(lastsignalers) +GLOBAL_LIST_EMPTY(lawchanges) +GLOBAL_PROTECT(lawchanges) -var/list/combatlog = list() -var/list/IClog = list() -var/list/OOClog = list() -var/list/adminlog = list() +GLOBAL_LIST_EMPTY(combatlog) +GLOBAL_PROTECT(combatlog) +GLOBAL_LIST_EMPTY(IClog) +GLOBAL_PROTECT(IClog) +GLOBAL_LIST_EMPTY(OOClog) +GLOBAL_PROTECT(OOClog) -var/list/investigate_log_subjects = list("notes", "watchlist", "hrefs") +GLOBAL_LIST_INIT(investigate_log_subjects, list("notes", "watchlist", "hrefs")) diff --git a/code/_globalvars/mapping.dm b/code/_globalvars/mapping.dm index 9c54212cbb7..ca1c899e301 100644 --- a/code/_globalvars/mapping.dm +++ b/code/_globalvars/mapping.dm @@ -3,12 +3,14 @@ #define Z_SOUTH 3 #define Z_WEST 4 -var/list/cardinal = list( NORTH, SOUTH, EAST, WEST ) -var/list/alldirs = list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST) -var/list/diagonals = list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST) +GLOBAL_LIST_INIT(cardinal, list( NORTH, SOUTH, EAST, WEST )) +GLOBAL_LIST_INIT(alldirs, list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)) +GLOBAL_LIST_INIT(diagonals, list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)) -var/global/list/global_map = null - //list/global_map = list(list(1,5),list(4,3))//an array of map Z levels. +// This must exist early on or shit breaks bad +GLOBAL_DATUM_INIT(using_map, /datum/map, new USING_MAP_DATUM) + +GLOBAL_LIST(global_map) // This is the array of zlevels | list(list(1,5),list(4,3)) | becomes a 2D array of zlevels //Resulting sector map looks like //|_1_|_4_| //|_5_|_3_| @@ -18,38 +20,37 @@ var/global/list/global_map = null //3 - AI satellite //5 - empty space -var/list/wizardstart = list() -var/list/newplayer_start = list() -var/list/latejoin = list() -var/list/latejoin_gateway = list() -var/list/latejoin_cryo = list() -var/list/latejoin_cyborg = list() -var/list/prisonwarp = list() //prisoners go to these -var/list/xeno_spawn = list()//Aliens spawn at these. -var/list/ertdirector = list() -var/list/emergencyresponseteamspawn = list() -var/list/tdome1 = list() -var/list/tdome2 = list() -var/list/team_alpha = list() -var/list/team_bravo = list() -var/list/tdomeobserve = list() -var/list/tdomeadmin = list() -var/list/aroomwarp = list() -var/list/prisonsecuritywarp = list() //prison security goes to these -var/list/prisonwarped = list() //list of players already warped -var/list/blobstart = list() -var/list/ninjastart = list() -var/list/carplist = list() //list of all carp-spawn landmarks -var/list/syndicateofficer = list() +GLOBAL_LIST_EMPTY(wizardstart) +GLOBAL_LIST_EMPTY(newplayer_start) +GLOBAL_LIST_EMPTY(latejoin) +GLOBAL_LIST_EMPTY(latejoin_gateway) +GLOBAL_LIST_EMPTY(latejoin_cryo) +GLOBAL_LIST_EMPTY(latejoin_cyborg) +GLOBAL_LIST_EMPTY(prisonwarp) //prisoners go to these +GLOBAL_LIST_EMPTY(xeno_spawn)//Aliens spawn at these. +GLOBAL_LIST_EMPTY(ertdirector) +GLOBAL_LIST_EMPTY(emergencyresponseteamspawn) +GLOBAL_LIST_EMPTY(tdome1) +GLOBAL_LIST_EMPTY(tdome2) +GLOBAL_LIST_EMPTY(team_alpha) +GLOBAL_LIST_EMPTY(team_bravo) +GLOBAL_LIST_EMPTY(tdomeobserve) +GLOBAL_LIST_EMPTY(tdomeadmin) +GLOBAL_LIST_EMPTY(aroomwarp) +GLOBAL_LIST_EMPTY(prisonsecuritywarp) //prison security goes to these +GLOBAL_LIST_EMPTY(prisonwarped) //list of players already warped +GLOBAL_LIST_EMPTY(blobstart) +GLOBAL_LIST_EMPTY(ninjastart) +GLOBAL_LIST_EMPTY(carplist) //list of all carp-spawn landmarks +GLOBAL_LIST_EMPTY(syndicateofficer) //away missions -var/list/awaydestinations = list() //a list of landmarks that the warpgate can take you to +GLOBAL_LIST_EMPTY(awaydestinations) //a list of landmarks that the warpgate can take you to //List of preloaded templates -var/list/datum/map_template/map_templates = list() - -var/list/datum/map_template/ruins_templates = list() -var/list/datum/map_template/space_ruins_templates = list() -var/list/datum/map_template/lava_ruins_templates = list() -var/list/datum/map_template/shelter_templates = list() -var/list/datum/map_template/shuttle_templates = list() +GLOBAL_LIST_EMPTY(map_templates) +GLOBAL_LIST_EMPTY(ruins_templates) +GLOBAL_LIST_EMPTY(space_ruins_templates) +GLOBAL_LIST_EMPTY(lava_ruins_templates) +GLOBAL_LIST_EMPTY(shelter_templates) +GLOBAL_LIST_EMPTY(shuttle_templates) diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index 04db7233401..5fd40bf86d9 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -1,93 +1,102 @@ -var/global/obj/effect/overlay/plmaster = null -var/global/obj/effect/overlay/slmaster = null +GLOBAL_DATUM(plmaster, /obj/effect/overlay) +GLOBAL_DATUM(slmaster, /obj/effect/overlay) GLOBAL_VAR_INIT(CELLRATE, 0.002) // conversion ratio between a watt-tick and kilojoule GLOBAL_VAR_INIT(CHARGELEVEL, 0.001) // Cap for how fast cells charge, as a percentage-per-tick (.001 means cellcharge is capped to 1% per second) // Announcer intercom, because too much stuff creates an intercom for one message then hard del()s it. -var/global/obj/item/radio/intercom/global_announcer = create_global_announcer() -var/global/obj/item/radio/intercom/command/command_announcer = create_command_announcer() +GLOBAL_DATUM_INIT(global_announcer, /obj/item/radio/intercom, create_global_announcer()) +GLOBAL_DATUM_INIT(command_announcer, /obj/item/radio/intercom/command, create_command_announcer()) + // Load order issues means this can't be new'd until other code runs // This is probably not the way I should be doing this, but I don't know how to do it right! proc/create_global_announcer() spawn(0) - global_announcer = new(null) + GLOB.global_announcer = new(null) return proc/create_command_announcer() spawn(0) - command_announcer = new(null) + GLOB.command_announcer = new(null) return -var/list/paper_tag_whitelist = list("center","p","div","span","h1","h2","h3","h4","h5","h6","hr","pre", \ +GLOBAL_LIST_INIT(paper_tag_whitelist, list("center","p","div","span","h1","h2","h3","h4","h5","h6","hr","pre", \ "big","small","font","i","u","b","s","sub","sup","tt","br","hr","ol","ul","li","caption","col", \ - "table","td","th","tr") -var/list/paper_blacklist = list("java","onblur","onchange","onclick","ondblclick","onfocus","onkeydown", \ + "table","td","th","tr")) +GLOBAL_LIST_INIT(paper_blacklist, list("java","onblur","onchange","onclick","ondblclick","onfocus","onkeydown", \ "onkeypress","onkeyup","onload","onmousedown","onmousemove","onmouseout","onmouseover", \ - "onmouseup","onreset","onselect","onsubmit","onunload") + "onmouseup","onreset","onselect","onsubmit","onunload")) //Reverse of dir -var/list/reverse_dir = list(2, 1, 3, 8, 10, 9, 11, 4, 6, 5, 7, 12, 14, 13, 15, 32, 34, 33, 35, 40, 42, 41, 43, 36, 38, 37, 39, 44, 46, 45, 47, 16, 18, 17, 19, 24, 26, 25, 27, 20, 22, 21, 23, 28, 30, 29, 31, 48, 50, 49, 51, 56, 58, 57, 59, 52, 54, 53, 55, 60, 62, 61, 63) -var/gravity_is_on = 1 //basically unused, just one admin verb.. +GLOBAL_LIST_INIT(reverse_dir, list(2, 1, 3, 8, 10, 9, 11, 4, 6, 5, 7, 12, 14, 13, 15, 32, 34, 33, 35, 40, 42, 41, 43, 36, 38, 37, 39, 44, 46, 45, 47, 16, 18, 17, 19, 24, 26, 25, 27, 20, 22, 21, 23, 28, 30, 29, 31, 48, 50, 49, 51, 56, 58, 57, 59, 52, 54, 53, 55, 60, 62, 61, 63)) +GLOBAL_VAR_INIT(gravity_is_on, 1) //basically unused, just one admin verb.. // Recall time limit: 2 hours -var/recall_time_limit=72000 //apparently used for the comm console +GLOBAL_VAR_INIT(recall_time_limit, 72000) //apparently used for the comm console //////SCORE STUFF //Goonstyle scoreboard -var/score_crewscore = 0 // this is the overall var/score for the whole round -var/score_stuffshipped = 0 // how many useful items have cargo shipped out? -var/score_stuffharvested = 0 // how many harvests have hydroponics done? -var/score_oremined = 0 // obvious -var/score_researchdone = 0 -var/score_eventsendured = 0 // how many random events did the station survive? -var/score_powerloss = 0 // how many APCs have poor charge? -var/score_escapees = 0 // how many people got out alive? -var/score_deadcrew = 0 // dead bodies on the station, oh no -var/score_mess = 0 // how much poo, puke, gibs, etc went uncleaned -var/score_meals = 0 -var/score_disease = 0 // how many rampant, uncured diseases are on board the station -var/score_deadcommand = 0 // used during rev, how many command staff perished -var/score_arrested = 0 // how many traitors/revs/whatever are alive in the brig -var/score_traitorswon = 0 // how many traitors were successful? -var/score_allarrested = 0 // did the crew catch all the enemies alive? -var/score_opkilled = 0 // used during nuke mode, how many operatives died? -var/score_disc = 0 // is the disc safe and secure? -var/score_nuked = 0 // was the station blown into little bits? -var/score_nuked_penalty = 0 //penalty for getting blown to bits +GLOBAL_VAR_INIT(score_crewscore, 0) // this is the overall var/score for the whole round +GLOBAL_VAR_INIT(score_stuffshipped, 0) // how many useful items have cargo shipped out? +GLOBAL_VAR_INIT(score_stuffharvested, 0) // how many harvests have hydroponics done? +GLOBAL_VAR_INIT(score_oremined, 0) // obvious +GLOBAL_VAR_INIT(score_researchdone, 0) +GLOBAL_VAR_INIT(score_eventsendured, 0) // how many random events did the station survive? +GLOBAL_VAR_INIT(score_powerloss, 0) // how many APCs have poor charge? +GLOBAL_VAR_INIT(score_escapees, 0) // how many people got out alive? +GLOBAL_VAR_INIT(score_deadcrew, 0) // dead bodies on the station, oh no +GLOBAL_VAR_INIT(score_mess, 0) // how much poo, puke, gibs, etc went uncleaned +GLOBAL_VAR_INIT(score_meals, 0) +GLOBAL_VAR_INIT(score_disease, 0) // how many rampant, uncured diseases are on board the station +GLOBAL_VAR_INIT(score_deadcommand, 0) // used during rev, how many command staff perished +GLOBAL_VAR_INIT(score_arrested, 0) // how many traitors/revs/whatever are alive in the brig +GLOBAL_VAR_INIT(score_traitorswon, 0) // how many traitors were successful? +GLOBAL_VAR_INIT(score_allarrested, 0) // did the crew catch all the enemies alive? +GLOBAL_VAR_INIT(score_opkilled, 0) // used during nuke mode, how many operatives died? +GLOBAL_VAR_INIT(score_disc, 0) // is the disc safe and secure? +GLOBAL_VAR_INIT(score_nuked, 0) // was the station blown into little bits? +GLOBAL_VAR_INIT(score_nuked_penalty, 0) //penalty for getting blown to bits // these ones are mainly for the stat panel -var/score_powerbonus = 0 // if all APCs on the station are running optimally, big bonus -var/score_messbonus = 0 // if there are no messes on the station anywhere, huge bonus -var/score_deadaipenalty = 0 // is the AI dead? if so, big penalty -var/score_foodeaten = 0 // nom nom nom -var/score_clownabuse = 0 // how many times a clown was punched, struck or otherwise maligned -var/score_richestname = null // this is all stuff to show who was the richest alive on the shuttle -var/score_richestjob = null // kinda pointless if you dont have a money system i guess -var/score_richestcash = 0 -var/score_richestkey = null -var/score_dmgestname = null // who had the most damage on the shuttle (but was still alive) -var/score_dmgestjob = null -var/score_dmgestdamage = 0 -var/score_dmgestkey = null +GLOBAL_VAR_INIT(score_powerbonus, 0) // if all APCs on the station are running optimally, big bonus +GLOBAL_VAR_INIT(score_messbonus, 0) // if there are no messes on the station anywhere, huge bonus +GLOBAL_VAR_INIT(score_deadaipenalty, 0) // is the AI dead? if so, big penalty +GLOBAL_VAR_INIT(score_foodeaten, 0) // nom nom nom +GLOBAL_VAR_INIT(score_clownabuse, 0) // how many times a clown was punched, struck or otherwise maligned +GLOBAL_VAR(score_richestname) // this is all stuff to show who was the richest alive on the shuttle +GLOBAL_VAR(score_richestjob) // kinda pointless if you dont have a money system i guess +GLOBAL_VAR_INIT(score_richestcash, 0) +GLOBAL_VAR(score_richestkey) +GLOBAL_VAR(score_dmgestname) // who had the most damage on the shuttle (but was still alive) +GLOBAL_VAR(score_dmgestjob) +GLOBAL_VAR_INIT(score_dmgestdamage, 0) +GLOBAL_VAR(score_dmgestkey) -var/TAB = "    " +#define TAB "    " GLOBAL_VAR_INIT(timezoneOffset, 0) // The difference betwen midnight (of the host computer) and 0 world.ticks. // For FTP requests. (i.e. downloading runtime logs.) // However it'd be ok to use for accessing attack logs and such too, which are even laggier. -var/fileaccess_timer = 0 +GLOBAL_VAR_INIT(fileaccess_timer, 0) GLOBAL_VAR_INIT(gametime_offset, 432000) // 12:00 in seconds //printers shutdown if too much shit printed -var/copier_items_printed = 0 -var/copier_max_items = 300 -var/copier_items_printed_logged = FALSE +GLOBAL_VAR_INIT(copier_items_printed, 0) +GLOBAL_VAR_INIT(copier_max_items, 300) +GLOBAL_VAR_INIT(copier_items_printed_logged, FALSE) GLOBAL_VAR(map_name) // Self explanatory -var/global/datum/datacore/data_core = null // Station datacore, manifest, etc +GLOBAL_DATUM(data_core, /datum/datacore) // Station datacore, manifest, etc GLOBAL_VAR_INIT(panic_bunker_enabled, FALSE) // Is the panic bunker enabled + +//Database connections +//A connection is established on world creation. Ideally, the connection dies when the server restarts (After feedback logging.). +// This is a protected datum which means its read only. I hope the reason for protecting this is obvious +GLOBAL_DATUM_INIT(dbcon, /DBConnection, new) //Feedback database (New database) +GLOBAL_PROTECT(dbcon) + +GLOBAL_LIST_EMPTY(ability_verbs) // Create-level abilities diff --git a/code/_globalvars/sensitive.dm b/code/_globalvars/sensitive.dm new file mode 100644 index 00000000000..b1e6751c4dd --- /dev/null +++ b/code/_globalvars/sensitive.dm @@ -0,0 +1,12 @@ +// All global vars in this file require a different handler as we dont want their data to be exposed, not even to admins with permission to view globals +// They write as native BYOND globals, which means they cant be edited at all, and also use a format +// Please only throw absolutely crucial do-not-view shit in here please. -aa07 + +// MySQL configuration +GLOBAL_REAL_VAR(sqladdress) = "localhost" +GLOBAL_REAL_VAR(sqlport) = "3306" +GLOBAL_REAL_VAR(sqlfdbkdb) = "test" +GLOBAL_REAL_VAR(sqlfdbklogin) = "root" +GLOBAL_REAL_VAR(sqlfdbkpass) = "" +GLOBAL_REAL_VAR(sqlfdbktableprefix) = "erro_" + diff --git a/code/_globalvars/unused.dm b/code/_globalvars/unused.dm deleted file mode 100644 index 6e2075559b8..00000000000 --- a/code/_globalvars/unused.dm +++ /dev/null @@ -1 +0,0 @@ -var/going = 1.0 diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm index 7c2214e2287..fbb04d4c021 100644 --- a/code/_onclick/ai.dm +++ b/code/_onclick/ai.dm @@ -42,7 +42,7 @@ if(control_disabled || stat) return - + var/turf/pixel_turf = isturf(A) ? A : get_turf_pixel(A) if(isnull(pixel_turf)) return @@ -57,7 +57,7 @@ var/turf_visible if(pixel_turf) - turf_visible = cameranet.checkTurfVis(pixel_turf) + turf_visible = GLOB.cameranet.checkTurfVis(pixel_turf) if(!turf_visible) if(istype(loc, /obj/item/aicard) && (pixel_turf in view(client.view, loc))) turf_visible = TRUE @@ -228,4 +228,4 @@ // /mob/living/silicon/ai/TurfAdjacent(var/turf/T) - return (cameranet && cameranet.checkTurfVis(T)) + return (GLOB.cameranet && GLOB.cameranet.checkTurfVis(T)) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 3f5785e44ab..2f4811de380 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -502,7 +502,7 @@ config.guest_jobban = 1 if("guest_ban") - guests_allowed = 0 + GLOB.guests_allowed = 0 if("panic_bunker_threshold") config.panic_bunker_threshold = text2num(value) @@ -618,12 +618,12 @@ if("python_path") if(value) - python_path = value + GLOB.python_path = value else if(world.system_type == UNIX) - python_path = "/usr/bin/env python2" + GLOB.python_path = "/usr/bin/env python2" else //probably windows, if not this should work anyway - python_path = "pythonw" + GLOB.python_path = "pythonw" if("assistant_limit") config.assistantlimit = 1 @@ -716,7 +716,7 @@ config.shutdown_on_reboot = 1 if("shutdown_shell_command") - shutdown_shell_command = value + GLOB.shutdown_shell_command = value if("disable_karma") config.disable_karma = 1 @@ -789,11 +789,11 @@ if(BombCap > 128) BombCap = 128 - MAX_EX_DEVASTATION_RANGE = round(BombCap/4) - MAX_EX_HEAVY_RANGE = round(BombCap/2) - MAX_EX_LIGHT_RANGE = BombCap - MAX_EX_FLASH_RANGE = BombCap - MAX_EX_FLAME_RANGE = BombCap + GLOB.max_ex_devastation_range = round(BombCap/4) + GLOB.max_ex_heavy_range = round(BombCap/2) + GLOB.max_ex_light_range = BombCap + GLOB.max_ex_flash_range = BombCap + GLOB.max_ex_flame_range = BombCap if("default_laws") config.default_laws = text2num(value) if("randomize_shift_time") @@ -856,7 +856,7 @@ log_config("WARNING: DB_CONFIG DEFINITION MISMATCH!") spawn(60) if(SSticker.current_state == GAME_STATE_PREGAME) - going = 0 + SSticker.ticker_going = FALSE spawn(600) to_chat(world, "DB_CONFIG MISMATCH, ROUND START DELAYED.
Please check database version for recent upstream changes!
") diff --git a/code/controllers/subsystem/air.dm b/code/controllers/subsystem/air.dm index 04141f6c3ab..6f2a451ef76 100644 --- a/code/controllers/subsystem/air.dm +++ b/code/controllers/subsystem/air.dm @@ -275,7 +275,7 @@ SUBSYSTEM_DEF(air) if(blockchanges && T.excited_group) T.excited_group.garbage_collect() else - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(!(T.atmos_adjacent_turfs & direction)) continue var/turf/simulated/S = get_step(T, direction) @@ -360,21 +360,21 @@ SUBSYSTEM_DEF(air) return count /datum/controller/subsystem/air/proc/setup_overlays() - plmaster = new /obj/effect/overlay() - plmaster.icon = 'icons/effects/tile_effects.dmi' - plmaster.icon_state = "plasma" - plmaster.mouse_opacity = MOUSE_OPACITY_TRANSPARENT - plmaster.anchored = TRUE // should only appear in vis_contents, but to be safe - plmaster.layer = FLY_LAYER - plmaster.appearance_flags = TILE_BOUND + GLOB.plmaster = new /obj/effect/overlay() + GLOB.plmaster.icon = 'icons/effects/tile_effects.dmi' + GLOB.plmaster.icon_state = "plasma" + GLOB.plmaster.mouse_opacity = MOUSE_OPACITY_TRANSPARENT + GLOB.plmaster.anchored = TRUE // should only appear in vis_contents, but to be safe + GLOB.plmaster.layer = FLY_LAYER + GLOB.plmaster.appearance_flags = TILE_BOUND - slmaster = new /obj/effect/overlay() - slmaster.icon = 'icons/effects/tile_effects.dmi' - slmaster.icon_state = "sleeping_agent" - slmaster.mouse_opacity = MOUSE_OPACITY_TRANSPARENT - slmaster.anchored = TRUE // should only appear in vis_contents, but to be safe - slmaster.layer = FLY_LAYER - slmaster.appearance_flags = TILE_BOUND + GLOB.slmaster = new /obj/effect/overlay() + GLOB.slmaster.icon = 'icons/effects/tile_effects.dmi' + GLOB.slmaster.icon_state = "sleeping_agent" + GLOB.slmaster.mouse_opacity = MOUSE_OPACITY_TRANSPARENT + GLOB.slmaster.anchored = TRUE // should only appear in vis_contents, but to be safe + GLOB.slmaster.layer = FLY_LAYER + GLOB.slmaster.appearance_flags = TILE_BOUND #undef SSAIR_PIPENETS #undef SSAIR_ATMOSMACHINERY diff --git a/code/controllers/subsystem/events.dm b/code/controllers/subsystem/events.dm index 0465f47e152..1a7ae8ae81a 100644 --- a/code/controllers/subsystem/events.dm +++ b/code/controllers/subsystem/events.dm @@ -104,7 +104,7 @@ SUBSYSTEM_DEF(events) html += "Back
" html += "Time till start: [round(event_time / 600, 0.1)]
" html += "
" - html += "

Available [severity_to_string[selected_event_container.severity]] Events (queued & running events will not be displayed)

" + html += "

Available [GLOB.severity_to_string[selected_event_container.severity]] Events (queued & running events will not be displayed)

" html += "" html += "Name Weight MinWeight MaxWeight OneShot Enabled CurrWeight Remove" for(var/datum/event_meta/EM in selected_event_container.available_events) @@ -145,7 +145,7 @@ SUBSYSTEM_DEF(events) var/datum/event_container/EC = event_containers[severity] var/next_event_at = max(0, EC.next_event_time - world.time) html += "" - html += "[severity_to_string[severity]]" + html += "[GLOB.severity_to_string[severity]]" html += "[station_time_timestamp("hh:mm:ss", max(EC.next_event_time, world.time))]" html += "[round(next_event_at / 600, 0.1)]" html += "" @@ -172,7 +172,7 @@ SUBSYSTEM_DEF(events) var/datum/event_container/EC = event_containers[severity] var/datum/event_meta/EM = EC.next_event html += "" - html += "[severity_to_string[severity]]" + html += "[GLOB.severity_to_string[severity]]" html += "[EM ? EM.name : "Random"]" html += "View" html += "Clear" @@ -193,7 +193,7 @@ SUBSYSTEM_DEF(events) var/ends_in = max(0, round((ends_at - world.time) / 600, 0.1)) var/no_end = E.noAutoEnd html += "" - html += "[severity_to_string[EM.severity]]" + html += "[GLOB.severity_to_string[EM.severity]]" html += "[EM.name]" html += "[no_end ? "N/A" : station_time_timestamp("hh:mm:ss", ends_at)]" html += "[no_end ? "N/A" : ends_in]" @@ -216,33 +216,33 @@ SUBSYSTEM_DEF(events) var/datum/event_container/EC = locate(href_list["event"]) var/decrease = (60 * RaiseToPower(10, text2num(href_list["dec_timer"]))) EC.next_event_time -= decrease - admin_log_and_message_admins("decreased timer for [severity_to_string[EC.severity]] events by [decrease/600] minute(s).") + admin_log_and_message_admins("decreased timer for [GLOB.severity_to_string[EC.severity]] events by [decrease/600] minute(s).") else if(href_list["inc_timer"]) var/datum/event_container/EC = locate(href_list["event"]) var/increase = (60 * RaiseToPower(10, text2num(href_list["inc_timer"]))) EC.next_event_time += increase - admin_log_and_message_admins("increased timer for [severity_to_string[EC.severity]] events by [increase/600] minute(s).") + admin_log_and_message_admins("increased timer for [GLOB.severity_to_string[EC.severity]] events by [increase/600] minute(s).") else if(href_list["select_event"]) var/datum/event_container/EC = locate(href_list["select_event"]) var/datum/event_meta/EM = EC.SelectEvent() if(EM) - admin_log_and_message_admins("has queued the [severity_to_string[EC.severity]] event '[EM.name]'.") + admin_log_and_message_admins("has queued the [GLOB.severity_to_string[EC.severity]] event '[EM.name]'.") else if(href_list["pause"]) var/datum/event_container/EC = locate(href_list["pause"]) EC.delayed = !EC.delayed - admin_log_and_message_admins("has [EC.delayed ? "paused" : "resumed"] countdown for [severity_to_string[EC.severity]] events.") + admin_log_and_message_admins("has [EC.delayed ? "paused" : "resumed"] countdown for [GLOB.severity_to_string[EC.severity]] events.") else if(href_list["interval"]) var/delay = input("Enter delay modifier. A value less than one means events fire more often, higher than one less often.", "Set Interval Modifier") as num|null if(delay && delay > 0) var/datum/event_container/EC = locate(href_list["interval"]) EC.delay_modifier = delay - admin_log_and_message_admins("has set the interval modifier for [severity_to_string[EC.severity]] events to [EC.delay_modifier].") + admin_log_and_message_admins("has set the interval modifier for [GLOB.severity_to_string[EC.severity]] events to [EC.delay_modifier].") else if(href_list["stop"]) if(alert("Stopping an event may have unintended side-effects. Continue?","Stopping Event!","Yes","No") != "Yes") return var/datum/event/E = locate(href_list["stop"]) var/datum/event_meta/EM = E.event_meta - admin_log_and_message_admins("has stopped the [severity_to_string[EM.severity]] event '[EM.name]'.") + admin_log_and_message_admins("has stopped the [GLOB.severity_to_string[EM.severity]] event '[EM.name]'.") E.kill() else if(href_list["view_events"]) selected_event_container = locate(href_list["view_events"]) @@ -264,23 +264,23 @@ SUBSYSTEM_DEF(events) var/datum/event_meta/EM = locate(href_list["set_weight"]) EM.weight = weight if(EM != new_event) - admin_log_and_message_admins("has changed the weight of the [severity_to_string[EM.severity]] event '[EM.name]' to [EM.weight].") + admin_log_and_message_admins("has changed the weight of the [GLOB.severity_to_string[EM.severity]] event '[EM.name]' to [EM.weight].") else if(href_list["toggle_oneshot"]) var/datum/event_meta/EM = locate(href_list["toggle_oneshot"]) EM.one_shot = !EM.one_shot if(EM != new_event) - admin_log_and_message_admins("has [EM.one_shot ? "set" : "unset"] the oneshot flag for the [severity_to_string[EM.severity]] event '[EM.name]'.") + admin_log_and_message_admins("has [EM.one_shot ? "set" : "unset"] the oneshot flag for the [GLOB.severity_to_string[EM.severity]] event '[EM.name]'.") else if(href_list["toggle_enabled"]) var/datum/event_meta/EM = locate(href_list["toggle_enabled"]) EM.enabled = !EM.enabled - admin_log_and_message_admins("has [EM.enabled ? "enabled" : "disabled"] the [severity_to_string[EM.severity]] event '[EM.name]'.") + admin_log_and_message_admins("has [EM.enabled ? "enabled" : "disabled"] the [GLOB.severity_to_string[EM.severity]] event '[EM.name]'.") else if(href_list["remove"]) if(alert("This will remove the event from rotation. Continue?","Removing Event!","Yes","No") != "Yes") return var/datum/event_meta/EM = locate(href_list["remove"]) var/datum/event_container/EC = locate(href_list["EC"]) EC.available_events -= EM - admin_log_and_message_admins("has removed the [severity_to_string[EM.severity]] event '[EM.name]'.") + admin_log_and_message_admins("has removed the [GLOB.severity_to_string[EM.severity]] event '[EM.name]'.") else if(href_list["add"]) if(!new_event.name || !new_event.event_type) return @@ -288,12 +288,12 @@ SUBSYSTEM_DEF(events) return new_event.severity = selected_event_container.severity selected_event_container.available_events += new_event - admin_log_and_message_admins("has added \a [severity_to_string[new_event.severity]] event '[new_event.name]' of type [new_event.event_type] with weight [new_event.weight].") + admin_log_and_message_admins("has added \a [GLOB.severity_to_string[new_event.severity]] event '[new_event.name]' of type [new_event.event_type] with weight [new_event.weight].") new_event = new else if(href_list["clear"]) var/datum/event_container/EC = locate(href_list["clear"]) if(EC.next_event) - admin_log_and_message_admins("has dequeued the [severity_to_string[EC.severity]] event '[EC.next_event.name]'.") + admin_log_and_message_admins("has dequeued the [GLOB.severity_to_string[EC.severity]] event '[EC.next_event.name]'.") EC.next_event = null Interact(usr) diff --git a/code/controllers/subsystem/jobs.dm b/code/controllers/subsystem/jobs.dm index 29efa85b8a0..b465c65c441 100644 --- a/code/controllers/subsystem/jobs.dm +++ b/code/controllers/subsystem/jobs.dm @@ -49,7 +49,7 @@ SUBSYSTEM_DEF(jobs) /datum/controller/subsystem/jobs/proc/Debug(var/text) - if(!Debug2) + if(!GLOB.debug2) return 0 job_debug.Add(text) return 1 @@ -155,10 +155,10 @@ SUBSYSTEM_DEF(jobs) if(istype(job, GetJob("Civilian"))) // We don't want to give him assistant, that's boring! continue - if(job.title in command_positions) //If you want a command position, select it! + if(job.title in GLOB.command_positions) //If you want a command position, select it! continue - if(job.title in whitelisted_positions) // No random whitelisted job, sorry! + if(job.title in GLOB.whitelisted_positions) // No random whitelisted job, sorry! continue if(job.admin_only) // No admin positions either. @@ -203,7 +203,7 @@ SUBSYSTEM_DEF(jobs) ///This proc is called before the level loop of DivideOccupations() and will try to select a head, ignoring ALL non-head preferences for every level until it locates a head or runs out of levels to check /datum/controller/subsystem/jobs/proc/FillHeadPosition() for(var/level = 1 to 3) - for(var/command_position in command_positions) + for(var/command_position in GLOB.command_positions) var/datum/job/job = GetJob(command_position) if(!job) continue @@ -231,7 +231,7 @@ SUBSYSTEM_DEF(jobs) ///This proc is called at the start of the level loop of DivideOccupations() and will cause head jobs to be checked before any other jobs of the same level /datum/controller/subsystem/jobs/proc/CheckHeadPositions(var/level) - for(var/command_position in command_positions) + for(var/command_position in GLOB.command_positions) var/datum/job/job = GetJob(command_position) if(!job) continue @@ -600,7 +600,7 @@ SUBSYSTEM_DEF(jobs) // If they're head, give them the account info for their department if(job && job.head_position) remembered_info = "" - var/datum/money_account/department_account = department_accounts[job.department] + var/datum/money_account/department_account = GLOB.department_accounts[job.department] if(department_account) remembered_info += "Your department's account number is: #[department_account.account_number]
" @@ -638,7 +638,7 @@ SUBSYSTEM_DEF(jobs) var/datum/job/oldjobdatum = SSjobs.GetJob(oldtitle) var/datum/job/newjobdatum = SSjobs.GetJob(newtitle) if(istype(oldjobdatum) && oldjobdatum.current_positions > 0 && istype(newjobdatum)) - if(!(oldjobdatum.title in command_positions) && !(newjobdatum.title in command_positions)) + if(!(oldjobdatum.title in GLOB.command_positions) && !(newjobdatum.title in GLOB.command_positions)) oldjobdatum.current_positions-- newjobdatum.current_positions++ diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm index af741423526..17174b02468 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -13,21 +13,21 @@ SUBSYSTEM_DEF(mapping) if(!config.disable_space_ruins) var/timer = start_watch() log_startup_progress("Creating random space levels...") - seedRuins(list(level_name_to_num(EMPTY_AREA)), rand(0, 3), /area/space, space_ruins_templates) + seedRuins(list(level_name_to_num(EMPTY_AREA)), rand(0, 3), /area/space, GLOB.space_ruins_templates) log_startup_progress("Loaded random space levels in [stop_watch(timer)]s.") // load in extra levels of space ruins var/num_extra_space = rand(config.extra_space_ruin_levels_min, config.extra_space_ruin_levels_max) for(var/i = 1, i <= num_extra_space, i++) - var/zlev = space_manager.add_new_zlevel("[EMPTY_AREA] #[i]", linkage = CROSSLINKED, traits = list(REACHABLE)) - seedRuins(list(zlev), rand(0, 3), /area/space, space_ruins_templates) + var/zlev = GLOB.space_manager.add_new_zlevel("[EMPTY_AREA] #[i]", linkage = CROSSLINKED, traits = list(REACHABLE)) + seedRuins(list(zlev), rand(0, 3), /area/space, GLOB.space_ruins_templates) // Setup the Z-level linkage - space_manager.do_transition_setup() + GLOB.space_manager.do_transition_setup() // Spawn Lavaland ruins and rivers. - seedRuins(list(level_name_to_num(MINING)), config.lavaland_budget, /area/lavaland/surface/outdoors/unexplored, lava_ruins_templates) + seedRuins(list(level_name_to_num(MINING)), config.lavaland_budget, /area/lavaland/surface/outdoors/unexplored, GLOB.lava_ruins_templates) spawn_rivers(list(level_name_to_num(MINING))) return ..() diff --git a/code/controllers/subsystem/nightshift.dm b/code/controllers/subsystem/nightshift.dm index 4ebe1dceb0e..e13f49fd1c2 100644 --- a/code/controllers/subsystem/nightshift.dm +++ b/code/controllers/subsystem/nightshift.dm @@ -25,12 +25,12 @@ SUBSYSTEM_DEF(nightshift) check_nightshift() /datum/controller/subsystem/nightshift/proc/announce(message) - priority_announcement.Announce(message, new_sound = 'sound/misc/notice2.ogg', new_title = "Automated Lighting System Announcement") + GLOB.priority_announcement.Announce(message, new_sound = 'sound/misc/notice2.ogg', new_title = "Automated Lighting System Announcement") /datum/controller/subsystem/nightshift/proc/check_nightshift(check_canfire=FALSE) if(check_canfire && !can_fire) return - var/emergency = security_level >= SEC_LEVEL_RED + var/emergency = GLOB.security_level >= SEC_LEVEL_RED var/announcing = TRUE var/time = station_time() var/night_time = (time < nightshift_end_time) || (time > nightshift_start_time) @@ -41,7 +41,7 @@ SUBSYSTEM_DEF(nightshift) if(!emergency) announce("Restoring night lighting configuration to normal operation.") else - announce("Disabling night lighting: Station is in a state of emergency.") + announce("Disabling night lighting: Station is in a state of emergency.") if(emergency) night_time = FALSE if(nightshift_active != night_time) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 6366eba7613..bbc73cfed14 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -33,7 +33,8 @@ SUBSYSTEM_DEF(ticker) var/triai = 0//Global holder for Triumvirate var/initialtpass = 0 //holder for inital autotransfer vote timer var/obj/screen/cinematic = null //used for station explosion cinematic - var/round_end_announced = 0 // Spam Prevention. Announce round end only once.\ + var/round_end_announced = 0 // Spam Prevention. Announce round end only once. + var/ticker_going = TRUE // This used to be in the unused globals, but it turns out its actually used in a load of places. Its now a ticker var because its related to round stuff, -aa /datum/controller/subsystem/ticker/Initialize() login_music = pick(\ @@ -42,10 +43,9 @@ SUBSYSTEM_DEF(ticker) 'sound/music/title1.ogg',\ 'sound/music/title2.ogg',\ 'sound/music/title3.ogg',) - // Map name - if(using_map && using_map.name) - GLOB.map_name = "[using_map.name]" + if(GLOB.using_map && GLOB.using_map.name) + GLOB.map_name = "[GLOB.using_map.name]" else GLOB.map_name = "Unknown" @@ -68,12 +68,12 @@ SUBSYSTEM_DEF(ticker) current_state = GAME_STATE_PREGAME fire() // TG says this is a good idea if(GAME_STATE_PREGAME) - if(!going) + if(!SSticker.ticker_going) // This has to be referenced like this, and I dont know why. If you dont put SSticker. it will break return // This is so we dont have sleeps in controllers, because that is a bad, bad thing if(!delay_end) - pregame_timeleft = max(0,round_start_time - world.time) // Normal lobby countdown when roundstart was not delayed + pregame_timeleft = max(0,round_start_time - world.time) // Normal lobby countdown when roundstart was not delayed else pregame_timeleft = max(0,pregame_timeleft - 20) // If roundstart was delayed, we should resume the countdown where it left off @@ -129,20 +129,20 @@ SUBSYSTEM_DEF(ticker) /datum/controller/subsystem/ticker/proc/setup() cultdat = setupcult() //Create and announce mode - if(master_mode=="secret") + if(GLOB.master_mode=="secret") src.hide_mode = 1 var/list/datum/game_mode/runnable_modes - if((master_mode=="random") || (master_mode=="secret")) + if((GLOB.master_mode=="random") || (GLOB.master_mode=="secret")) runnable_modes = config.get_runnable_modes() if(runnable_modes.len==0) current_state = GAME_STATE_PREGAME Master.SetRunLevel(RUNLEVEL_LOBBY) to_chat(world, "Unable to choose playable game mode. Reverting to pre-game lobby.") return 0 - if(secret_force_mode != "secret") - var/datum/game_mode/M = config.pick_mode(secret_force_mode) + if(GLOB.secret_force_mode != "secret") + var/datum/game_mode/M = config.pick_mode(GLOB.secret_force_mode) if(M.can_start()) - src.mode = config.pick_mode(secret_force_mode) + src.mode = config.pick_mode(GLOB.secret_force_mode) SSjobs.ResetOccupations() if(!src.mode) src.mode = pickweight(runnable_modes) @@ -150,7 +150,7 @@ SUBSYSTEM_DEF(ticker) var/mtype = src.mode.type src.mode = new mtype else - src.mode = config.pick_mode(master_mode) + src.mode = config.pick_mode(GLOB.master_mode) if(!src.mode.can_start()) to_chat(world, "Unable to start [mode.name]. Not enough players, [mode.required_players] players needed. Reverting to pre-game lobby.") mode = null @@ -167,7 +167,7 @@ SUBSYSTEM_DEF(ticker) if(!can_continue) qdel(mode) current_state = GAME_STATE_PREGAME - to_chat(world, "Error setting up [master_mode]. Reverting to pre-game lobby.") + to_chat(world, "Error setting up [GLOB.master_mode]. Reverting to pre-game lobby.") SSjobs.ResetOccupations() Master.SetRunLevel(RUNLEVEL_LOBBY) return 0 @@ -186,7 +186,7 @@ SUBSYSTEM_DEF(ticker) populate_spawn_points() collect_minds() equip_characters() - data_core.manifest() + GLOB.data_core.manifest() current_state = GAME_STATE_PLAYING Master.SetRunLevel(RUNLEVEL_GAME) @@ -449,11 +449,11 @@ SUBSYSTEM_DEF(ticker) /datum/controller/subsystem/ticker/proc/declare_completion() - nologevent = 1 //end of round murder and shenanigans are legal; there's no need to jam up attack logs past this point. + GLOB.nologevent = 1 //end of round murder and shenanigans are legal; there's no need to jam up attack logs past this point. //Round statistics report var/datum/station_state/end_state = new /datum/station_state() end_state.count() - var/station_integrity = min(round( 100.0 * start_state.score(end_state), 0.1), 100.0) + var/station_integrity = min(round( 100.0 * GLOB.start_state.score(end_state), 0.1), 100.0) to_chat(world, "
[TAB]Shift Duration: [round(ROUND_TIME / 36000)]:[add_zero("[ROUND_TIME / 600 % 60]", 2)]:[ROUND_TIME / 100 % 6][ROUND_TIME / 100 % 10]") to_chat(world, "
[TAB]Station Integrity: [mode.station_was_nuked ? "Destroyed" : "[station_integrity]%"]") @@ -519,7 +519,7 @@ SUBSYSTEM_DEF(ticker) SSevents.RoundEnd() // Add AntagHUD to everyone, see who was really evil the whole time! - for(var/datum/atom_hud/antag/H in huds) + for(var/datum/atom_hud/antag/H in GLOB.huds) for(var/m in GLOB.player_list) var/mob/M = m H.add_hud_to(M) diff --git a/code/controllers/subsystem/vote.dm b/code/controllers/subsystem/vote.dm index 4cb49e8a3f1..28456c9b5c5 100644 --- a/code/controllers/subsystem/vote.dm +++ b/code/controllers/subsystem/vote.dm @@ -90,10 +90,10 @@ SUBSYSTEM_DEF(vote) if(choices["Continue Playing"] >= greatest_votes) greatest_votes = choices["Continue Playing"] else if(mode == "gamemode") - if(master_mode in choices) - choices[master_mode] += non_voters - if(choices[master_mode] >= greatest_votes) - greatest_votes = choices[master_mode] + if(GLOB.master_mode in choices) + choices[GLOB.master_mode] += non_voters + if(choices[GLOB.master_mode] >= greatest_votes) + greatest_votes = choices[GLOB.master_mode] else if(mode == "crew_transfer") var/factor = 0.5 switch(world.time / (10 * 60)) // minutes @@ -164,14 +164,14 @@ SUBSYSTEM_DEF(vote) if(. == "Restart Round") restart = 1 if("gamemode") - if(master_mode != .) + if(GLOB.master_mode != .) world.save_mode(.) if(SSticker && SSticker.mode) restart = 1 else - master_mode = . - if(!going) - going = 1 + GLOB.master_mode = . + if(!SSticker.ticker_going) + SSticker.ticker_going = TRUE to_chat(world, "The round will start soon.") if("crew_transfer") if(. == "Initiate Crew Transfer") @@ -253,8 +253,8 @@ SUBSYSTEM_DEF(vote) world << sound('sound/ambience/alarm4.ogg') if("custom") world << sound('sound/ambience/alarm4.ogg') - if(mode == "gamemode" && going) - going = 0 + if(mode == "gamemode" && SSticker.ticker_going) + SSticker.ticker_going = FALSE to_chat(world, "Round start has been delayed.") if(mode == "crew_transfer" && config.ooc_allowed) auto_muted = 1 diff --git a/code/controllers/verbs.dm b/code/controllers/verbs.dm index c67e53184a1..3eaed85c303 100644 --- a/code/controllers/verbs.dm +++ b/code/controllers/verbs.dm @@ -53,10 +53,10 @@ debug_variables(config) feedback_add_details("admin_verb","DConf") if("pAI") - debug_variables(paiController) + debug_variables(GLOB.paiController) feedback_add_details("admin_verb","DpAI") if("Cameras") - debug_variables(cameranet) + debug_variables(GLOB.cameranet) feedback_add_details("admin_verb","DCameras") if("Garbage") debug_variables(SSgarbage) @@ -92,7 +92,7 @@ debug_variables(SSweather) feedback_add_details("admin_verb","DWeather") if("Space") - debug_variables(space_manager) + debug_variables(GLOB.space_manager) feedback_add_details("admin_verb","DSpace") if("Mob Hunt Server") debug_variables(SSmob_hunt) diff --git a/code/datums/cache/air_alarm.dm b/code/datums/cache/air_alarm.dm index 662b0958d5c..2edc0792a34 100644 --- a/code/datums/cache/air_alarm.dm +++ b/code/datums/cache/air_alarm.dm @@ -1,4 +1,4 @@ -var/global/datum/repository/air_alarm/air_alarm_repository = new() +GLOBAL_DATUM_INIT(air_alarm_repository, /datum/repository/air_alarm, new()) /datum/repository/air_alarm/proc/air_alarm_data(var/list/monitored_alarms, var/refresh = 0, var/obj/machinery/alarm/passed_alarm) var/alarms[0] @@ -11,13 +11,13 @@ var/global/datum/repository/air_alarm/air_alarm_repository = new() if(!refresh) return cache_entry.data - if(SSticker && SSticker.current_state < GAME_STATE_PLAYING && istype(passed_alarm)) // Generating the list for the first time as the game hasn't started - no need to run through the machines list everything every time + if(SSticker && SSticker.current_state < GAME_STATE_PLAYING && istype(passed_alarm)) // Generating the list for the first time as the game hasn't started - no need to run through the machines list everything every time alarms = cache_entry.data // Don't deleate the list if(is_station_contact(passed_alarm.z) && passed_alarm.remote_control) // Still need sanity checks - alarms[++alarms.len] = passed_alarm.get_nano_data_console() + alarms[++alarms.len] = passed_alarm.get_nano_data_console() else for(var/obj/machinery/alarm/alarm in (monitored_alarms ? monitored_alarms : GLOB.air_alarms)) // Generating the whole list again is a bad habit but I can't be bothered to fix it right now - if(!monitored_alarms && !is_station_contact(alarm.z)) + if(!monitored_alarms && !is_station_contact(alarm.z)) continue if(!alarm.remote_control) continue diff --git a/code/datums/cache/apc.dm b/code/datums/cache/apc.dm index 524a8793415..318fd654fe3 100644 --- a/code/datums/cache/apc.dm +++ b/code/datums/cache/apc.dm @@ -1,4 +1,4 @@ -var/global/datum/repository/apc/apc_repository = new() +GLOBAL_DATUM_INIT(apc_repository, /datum/repository/apc, new()) /datum/repository/apc/proc/apc_data(datum/powernet/powernet) var/apcData[0] diff --git a/code/datums/cache/crew.dm b/code/datums/cache/crew.dm index b30b5c57889..21ec5ebcc79 100644 --- a/code/datums/cache/crew.dm +++ b/code/datums/cache/crew.dm @@ -1,4 +1,4 @@ -var/global/datum/repository/crew/crew_repository = new() +GLOBAL_DATUM_INIT(crew_repository, /datum/repository/crew, new()) /datum/repository/crew/New() cache_data = list() diff --git a/code/datums/cache/powermonitor.dm b/code/datums/cache/powermonitor.dm index 29394195edf..606dd500eda 100644 --- a/code/datums/cache/powermonitor.dm +++ b/code/datums/cache/powermonitor.dm @@ -1,8 +1,8 @@ -var/global/datum/repository/powermonitor/powermonitor_repository = new() +GLOBAL_DATUM_INIT(powermonitor_repository, /datum/repository/powermonitor, new()) /datum/repository/powermonitor/proc/powermonitor_data(var/refresh = 0) var/pMonData[0] - + var/datum/cache_entry/cache_entry = cache_data if(!cache_entry) cache_entry = new/datum/cache_entry @@ -10,15 +10,15 @@ var/global/datum/repository/powermonitor/powermonitor_repository = new() if(!refresh) return cache_entry.data - + for(var/obj/machinery/computer/monitor/pMon in GLOB.power_monitors) if( !(pMon.stat & (NOPOWER|BROKEN)) && !pMon.is_secret_monitor ) pMonData[++pMonData.len] = list ("Name" = pMon.name, "ref" = "\ref[pMon]") cache_entry.timestamp = world.time //+ 30 SECONDS - cache_entry.data = pMonData + cache_entry.data = pMonData return pMonData - + /datum/repository/powermonitor/proc/update_cache() return powermonitor_data(refresh = 1) - + diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index f908685cf09..fa8bb1db9e2 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -1,5 +1,5 @@ /hook/startup/proc/createDatacore() - data_core = new /datum/datacore() + GLOB.data_core = new /datum/datacore() return 1 /datum/datacore @@ -34,7 +34,7 @@ "} 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 = t.fields["real_rank"] @@ -48,28 +48,28 @@ else isactive[name] = t.fields["p_stat"] var/department = 0 - if(real_rank in command_positions) + if(real_rank in GLOB.command_positions) heads[name] = rank department = 1 - if(real_rank in security_positions) + if(real_rank in GLOB.security_positions) sec[name] = rank department = 1 - if(real_rank in engineering_positions) + if(real_rank in GLOB.engineering_positions) eng[name] = rank department = 1 - if(real_rank in medical_positions) + if(real_rank in GLOB.medical_positions) med[name] = rank department = 1 - if(real_rank in science_positions) + if(real_rank in GLOB.science_positions) sci[name] = rank department = 1 - if(real_rank in service_positions) + if(real_rank in GLOB.service_positions) ser[name] = rank department = 1 - if(real_rank in supply_positions) + if(real_rank in GLOB.supply_positions) sup[name] = rank department = 1 - if(real_rank in nonhuman_positions) + if(real_rank in GLOB.nonhuman_positions) bot[name] = rank department = 1 if(!department && !(name in heads)) @@ -133,10 +133,10 @@ we'll only update it when it changes. The PDA_Manifest global list is zeroed ou using /datum/datacore/proc/manifest_inject(), or manifest_insert() */ -var/global/list/PDA_Manifest = list() +GLOBAL_LIST_EMPTY(PDA_Manifest) /datum/datacore/proc/get_manifest_json() - if(PDA_Manifest.len) + if(GLOB.PDA_Manifest.len) return var/heads[0] var/sec[0] @@ -147,7 +147,7 @@ var/global/list/PDA_Manifest = list() var/sup[0] var/bot[0] var/misc[0] - 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 = t.fields["real_rank"] @@ -155,50 +155,50 @@ var/global/list/PDA_Manifest = list() var/isactive = t.fields["p_stat"] var/department = 0 var/depthead = 0 // Department Heads will be placed at the top of their lists. - if(real_rank in command_positions) + if(real_rank in GLOB.command_positions) heads[++heads.len] = list("name" = name, "rank" = rank, "active" = isactive) department = 1 depthead = 1 if(rank == "Captain" && heads.len != 1) heads.Swap(1, heads.len) - if(real_rank in security_positions) + if(real_rank in GLOB.security_positions) sec[++sec.len] = list("name" = name, "rank" = rank, "active" = isactive) department = 1 if(depthead && sec.len != 1) sec.Swap(1, sec.len) - if(real_rank in engineering_positions) + if(real_rank in GLOB.engineering_positions) eng[++eng.len] = list("name" = name, "rank" = rank, "active" = isactive) department = 1 if(depthead && eng.len != 1) eng.Swap(1, eng.len) - if(real_rank in medical_positions) + if(real_rank in GLOB.medical_positions) med[++med.len] = list("name" = name, "rank" = rank, "active" = isactive) department = 1 if(depthead && med.len != 1) med.Swap(1, med.len) - if(real_rank in science_positions) + if(real_rank in GLOB.science_positions) sci[++sci.len] = list("name" = name, "rank" = rank, "active" = isactive) department = 1 if(depthead && sci.len != 1) sci.Swap(1, sci.len) - if(real_rank in service_positions) + if(real_rank in GLOB.service_positions) ser[++ser.len] = list("name" = name, "rank" = rank, "active" = isactive) department = 1 if(depthead && ser.len != 1) ser.Swap(1, ser.len) - if(real_rank in supply_positions) + if(real_rank in GLOB.supply_positions) sup[++sup.len] = list("name" = name, "rank" = rank, "active" = isactive) department = 1 if(depthead && sup.len != 1) sup.Swap(1, sup.len) - if(real_rank in nonhuman_positions) + if(real_rank in GLOB.nonhuman_positions) bot[++bot.len] = list("name" = name, "rank" = rank, "active" = isactive) department = 1 @@ -206,7 +206,7 @@ var/global/list/PDA_Manifest = list() misc[++misc.len] = list("name" = name, "rank" = rank, "active" = isactive) - PDA_Manifest = list(\ + GLOB.PDA_Manifest = list(\ "heads" = heads,\ "sec" = sec,\ "eng" = eng,\ @@ -226,12 +226,12 @@ var/global/list/PDA_Manifest = list() manifest_inject(H) /datum/datacore/proc/manifest_modify(name, assignment) - if(PDA_Manifest.len) - PDA_Manifest.Cut() + if(GLOB.PDA_Manifest.len) + GLOB.PDA_Manifest.Cut() 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 @@ -250,10 +250,10 @@ var/global/list/PDA_Manifest = list() foundrecord.fields["rank"] = assignment foundrecord.fields["real_rank"] = real_title -var/record_id_num = 1001 +GLOBAL_VAR_INIT(record_id_num, 1001) /datum/datacore/proc/manifest_inject(mob/living/carbon/human/H) - if(PDA_Manifest.len) - PDA_Manifest.Cut() + if(GLOB.PDA_Manifest.len) + GLOB.PDA_Manifest.Cut() if(H.mind && (H.mind.assigned_role != H.mind.special_role)) var/assignment @@ -266,7 +266,7 @@ var/record_id_num = 1001 else assignment = "Unassigned" - var/id = num2hex(record_id_num++, 6) + var/id = num2hex(GLOB.record_id_num++, 6) //General Record diff --git a/code/datums/diseases/_disease.dm b/code/datums/diseases/_disease.dm index 84dde0f22e0..6b7c2d89606 100644 --- a/code/datums/diseases/_disease.dm +++ b/code/datums/diseases/_disease.dm @@ -29,7 +29,7 @@ #define BIOHAZARD "BIOHAZARD THREAT!" -var/list/diseases = subtypesof(/datum/disease) +GLOBAL_LIST_INIT(diseases, subtypesof(/datum/disease)) /datum/disease diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index e0711d88e5f..5464bd9f012 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -6,16 +6,15 @@ If you need help with creating new symptoms or expanding the advance disease, ask for Giacom on #coderbus. */ - -var/list/archive_diseases = list() +GLOBAL_LIST_EMPTY(archive_diseases) // The order goes from easy to cure to hard to cure. -var/list/advance_cures = list( +GLOBAL_LIST_INIT(advance_cures, list( "sodiumchloride", "sugar", "orangejuice", "spaceacillin", "salglu_solution", "ethanol", "teporone", "diphenhydramine", "lipolicide", "silver", "gold" - ) +)) /* @@ -132,7 +131,7 @@ var/list/advance_cures = list( // Generate symptoms. By default, we only choose non-deadly symptoms. var/list/possible_symptoms = list() - for(var/symp in list_symptoms) + for(var/symp in GLOB.list_symptoms) var/datum/symptom/S = new symp if(S.level >= level_min && S.level <= level_max) if(!HasSymptom(S)) @@ -158,13 +157,13 @@ var/list/advance_cures = list( AssignProperties(properties) id = null - if(!archive_diseases[GetDiseaseID()]) + if(!GLOB.archive_diseases[GetDiseaseID()]) if(new_name) AssignName() - archive_diseases[GetDiseaseID()] = src // So we don't infinite loop - archive_diseases[GetDiseaseID()] = new /datum/disease/advance(0, src, 1) + GLOB.archive_diseases[GetDiseaseID()] = src // So we don't infinite loop + GLOB.archive_diseases[GetDiseaseID()] = new /datum/disease/advance(0, src, 1) - var/datum/disease/advance/A = archive_diseases[GetDiseaseID()] + var/datum/disease/advance/A = GLOB.archive_diseases[GetDiseaseID()] AssignName(A.name) //Generate disease properties based on the effects. Returns an associated list. @@ -246,9 +245,9 @@ var/list/advance_cures = list( // Will generate a random cure, the less resistance the symptoms have, the harder the cure. /datum/disease/advance/proc/GenerateCure(list/properties = list()) if(properties && properties.len) - var/res = Clamp(properties["resistance"] - (symptoms.len / 2), 1, advance_cures.len) + var/res = Clamp(properties["resistance"] - (symptoms.len / 2), 1, GLOB.advance_cures.len) // to_chat(world, "Res = [res]") - cures = list(advance_cures[res]) + cures = list(GLOB.advance_cures[res]) // Get the cure name from the cure_id var/datum/reagent/D = GLOB.chemical_reagents_list[cures[1]] @@ -371,7 +370,7 @@ var/list/advance_cures = list( var/list/symptoms = list() symptoms += "Done" - symptoms += list_symptoms.Copy() + symptoms += GLOB.list_symptoms.Copy() do if(user) var/symptom = input(user, "Choose a symptom to add ([i] remaining)", "Choose a Symptom") in symptoms diff --git a/code/datums/diseases/advance/symptoms/symptoms.dm b/code/datums/diseases/advance/symptoms/symptoms.dm index f2c5beee400..8f72de7f599 100644 --- a/code/datums/diseases/advance/symptoms/symptoms.dm +++ b/code/datums/diseases/advance/symptoms/symptoms.dm @@ -1,6 +1,6 @@ // Symptoms are the effects that engineered advanced diseases do. -var/list/list_symptoms = subtypesof(/datum/symptom) +GLOBAL_LIST_INIT(list_symptoms, subtypesof(/datum/symptom)) /datum/symptom // Buffs/Debuffs the symptom has to the overall engineered disease. @@ -17,7 +17,7 @@ var/list/list_symptoms = subtypesof(/datum/symptom) var/id = "" /datum/symptom/New() - var/list/S = list_symptoms + var/list/S = GLOB.list_symptoms for(var/i = 1; i <= S.len; i++) if(type == S[i]) id = "[i]" diff --git a/code/datums/helper_datums/map_template.dm b/code/datums/helper_datums/map_template.dm index 8a1e7576e7a..a54707842db 100644 --- a/code/datums/helper_datums/map_template.dm +++ b/code/datums/helper_datums/map_template.dm @@ -17,7 +17,7 @@ name = rename /datum/map_template/proc/preload_size(path) - var/bounds = maploader.load_map(file(path), 1, 1, 1, cropMap = 0, measureOnly = 1) + var/bounds = GLOB.maploader.load_map(file(path), 1, 1, 1, cropMap = 0, measureOnly = 1) if(bounds) width = bounds[MAP_MAXX] // Assumes all templates are rectangular, have a single Z level, and begin at 1,1,1 height = bounds[MAP_MAXY] @@ -48,8 +48,8 @@ // This system will metaphorically snap in half (not postpone init everywhere) // if given a multi-z template // it might need to be adapted for that when that time comes - space_manager.add_dirt(placement.z) - var/list/bounds = maploader.load_map(get_file(), min_x, min_y, placement.z, cropMap = 1) + GLOB.space_manager.add_dirt(placement.z) + var/list/bounds = GLOB.maploader.load_map(get_file(), min_x, min_y, placement.z, cropMap = 1) if(!bounds) return 0 if(bot_left == null || top_right == null) @@ -58,7 +58,7 @@ if(ST_bot_left == null || ST_top_right == null) log_runtime(EXCEPTION("One of the smoothing corners is bust"), src) - space_manager.remove_dirt(placement.z) + GLOB.space_manager.remove_dirt(placement.z) late_setup_level( block(bot_left, top_right), block(ST_bot_left, ST_top_right)) @@ -108,7 +108,7 @@ for(var/map in flist(path)) if(cmptext(copytext(map, length(map) - 3), ".dmm")) var/datum/map_template/T = new(path = "[path][map]", rename = "[map]") - map_templates[T.name] = T + GLOB.map_templates[T.name] = T if(!config.disable_space_ruins) // so we don't unnecessarily clutter start-up preloadRuinTemplates() @@ -134,13 +134,13 @@ if(banned.Find(R.mappath)) continue - map_templates[R.name] = R - ruins_templates[R.name] = R + GLOB.map_templates[R.name] = R + GLOB.ruins_templates[R.name] = R if(istype(R, /datum/map_template/ruin/lavaland)) - lava_ruins_templates[R.name] = R + GLOB.lava_ruins_templates[R.name] = R if(istype(R, /datum/map_template/ruin/space)) - space_ruins_templates[R.name] = R + GLOB.space_ruins_templates[R.name] = R /proc/preloadShelterTemplates() for(var/item in subtypesof(/datum/map_template/shelter)) @@ -149,8 +149,8 @@ continue var/datum/map_template/shelter/S = new shelter_type() - shelter_templates[S.shelter_id] = S - map_templates[S.shelter_id] = S + GLOB.shelter_templates[S.shelter_id] = S + GLOB.map_templates[S.shelter_id] = S /proc/preloadShuttleTemplates() for(var/item in subtypesof(/datum/map_template/shuttle)) @@ -160,5 +160,5 @@ var/datum/map_template/shuttle/S = new shuttle_type() - shuttle_templates[S.shuttle_id] = S - map_templates[S.shuttle_id] = S + GLOB.shuttle_templates[S.shuttle_id] = S + GLOB.map_templates[S.shuttle_id] = S diff --git a/code/datums/hud.dm b/code/datums/hud.dm index f204465d7d6..50152c4873d 100644 --- a/code/datums/hud.dm +++ b/code/datums/hud.dm @@ -1,8 +1,8 @@ /* HUD DATUMS */ -var/global/list/all_huds = list() +GLOBAL_LIST_EMPTY(all_huds) ///GLOBAL HUD LIST -var/datum/atom_hud/huds = list( \ +GLOBAL_LIST_INIT(huds, list( \ DATA_HUD_SECURITY_BASIC = new/datum/atom_hud/data/human/security/basic(), \ DATA_HUD_SECURITY_ADVANCED = new/datum/atom_hud/data/human/security/advanced(), \ DATA_HUD_MEDICAL_BASIC = new/datum/atom_hud/data/human/medical/basic(), \ @@ -24,7 +24,7 @@ var/datum/atom_hud/huds = list( \ ANTAG_HUD_DEVIL = new/datum/atom_hud/antag/hidden(),\ ANTAG_HUD_EVENTMISC = new/datum/atom_hud/antag/hidden(),\ ANTAG_HUD_BLOB = new/datum/atom_hud/antag/hidden()\ - ) +)) /datum/atom_hud var/list/atom/hudatoms = list() //list of all atoms which display this hud @@ -33,14 +33,14 @@ var/datum/atom_hud/huds = list( \ /datum/atom_hud/New() - all_huds += src + GLOB.all_huds += src /datum/atom_hud/Destroy() for(var/v in hudusers) remove_hud_from(v) for(var/v in hudatoms) remove_from_hud(v) - all_huds -= src + GLOB.all_huds -= src return ..() /datum/atom_hud/proc/remove_hud_from(mob/M) @@ -99,7 +99,7 @@ var/datum/atom_hud/huds = list( \ serv_huds += serv.thrallhud - for(var/datum/atom_hud/hud in (all_huds|serv_huds))//|gang_huds)) + for(var/datum/atom_hud/hud in (GLOB.all_huds|serv_huds))//|gang_huds)) if(src in hud.hudusers) hud.add_hud_to(src) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index db2420a1bf8..4f176970a92 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -845,11 +845,11 @@ to_chat(current, "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve [SSticker.cultdat.entity_title2] above all else. Bring It back.") log_admin("[key_name(usr)] has culted [key_name(current)]") message_admins("[key_name_admin(usr)] has culted [key_name_admin(current)]") - if(!summon_spots.len) - while(summon_spots.len < SUMMON_POSSIBILITIES) - var/area/summon = pick(return_sorted_areas() - summon_spots) + if(!GLOB.summon_spots.len) + while(GLOB.summon_spots.len < SUMMON_POSSIBILITIES) + var/area/summon = pick(return_sorted_areas() - GLOB.summon_spots) if(summon && is_station_level(summon.z) && summon.valid_territory) - summon_spots += summon + GLOB.summon_spots += summon if("tome") var/mob/living/carbon/human/H = current if(istype(H)) @@ -902,7 +902,7 @@ log_admin("[key_name(usr)] has wizarded [key_name(current)]") message_admins("[key_name_admin(usr)] has wizarded [key_name_admin(current)]") if("lair") - current.forceMove(pick(wizardstart)) + current.forceMove(pick(GLOB.wizardstart)) log_admin("[key_name(usr)] has moved [key_name(current)] to the wizard's lair") message_admins("[key_name_admin(usr)] has moved [key_name_admin(current)] to the wizard's lair") if("dressup") @@ -1165,7 +1165,7 @@ remove_antag_datum(/datum/antagonist/traitor) log_admin("[key_name(usr)] has de-traitored [key_name(current)]") message_admins("[key_name_admin(usr)] has de-traitored [key_name_admin(current)]") - + if("traitor") if(!(has_antag_datum(/datum/antagonist/traitor))) var/datum/antagonist/traitor/T = new() @@ -1487,11 +1487,11 @@ special_role = SPECIAL_ROLE_WIZARD assigned_role = SPECIAL_ROLE_WIZARD //ticker.mode.learn_basic_spells(current) - if(!wizardstart.len) - current.loc = pick(latejoin) + if(!GLOB.wizardstart.len) + current.loc = pick(GLOB.latejoin) to_chat(current, "HOT INSERTION, GO GO GO") else - current.loc = pick(wizardstart) + current.loc = pick(GLOB.wizardstart) SSticker.mode.equip_wizard(current) for(var/obj/item/spellbook/S in current.contents) @@ -1659,7 +1659,7 @@ SSticker.mode.implanter[missionary.mind] = implanters SSticker.mode.traitors += src - + var/datum/objective/protect/zealot_objective = new zealot_objective.target = missionary.mind zealot_objective.owner = src diff --git a/code/datums/mixed.dm b/code/datums/mixed.dm index 05fb0a99649..a5ff38a26b0 100644 --- a/code/datums/mixed.dm +++ b/code/datums/mixed.dm @@ -22,14 +22,14 @@ var/list/fields = list( ) /datum/data/record/Destroy() - if(src in data_core.medical) - data_core.medical -= src - if(src in data_core.security) - data_core.security -= src - if(src in data_core.general) - data_core.general -= src - if(src in data_core.locked) - data_core.locked -= src + if(src in GLOB.data_core.medical) + GLOB.data_core.medical -= src + if(src in GLOB.data_core.security) + GLOB.data_core.security -= src + if(src in GLOB.data_core.general) + GLOB.data_core.general -= src + if(src in GLOB.data_core.locked) + GLOB.data_core.locked -= src return ..() /datum/data/text diff --git a/code/datums/outfits/outfit_admin.dm b/code/datums/outfits/outfit_admin.dm index d2c19f61bfa..53c755e8822 100644 --- a/code/datums/outfits/outfit_admin.dm +++ b/code/datums/outfits/outfit_admin.dm @@ -1048,8 +1048,8 @@ to_chat(H, "You have gained the ability to shapeshift into lesser hellhound form. This is a combat form with different abilities, tough but not invincible. It can regenerate itself over time by resting.") H.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/raise_vampires) to_chat(H, "You have gained the ability to Raise Vampires. This extremely powerful AOE ability affects all humans near you. Vampires/thralls are healed. Corpses are raised as vampires. Others are stunned, then brain damaged, then killed.") - H.dna.SetSEState(JUMPBLOCK, 1) - genemutcheck(H, JUMPBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.jumpblock, 1) + genemutcheck(H, GLOB.jumpblock, null, MUTCHK_FORCED) H.update_mutations() H.gene_stability = 100 diff --git a/code/datums/periodic_news.dm b/code/datums/periodic_news.dm index 9a09ec4a7ec..d1cb9fc014d 100644 --- a/code/datums/periodic_news.dm +++ b/code/datums/periodic_news.dm @@ -1,6 +1,7 @@ // This system defines news that will be displayed in the course of a round. // Uses BYOND's type system to put everything into a nice format +// THIS ISNT PROPERLY PATHED AND I AM GOING TO FUCKING SCREAM AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA /datum/news_announcement var round_time // time of the round at which this should be announced, in seconds @@ -114,24 +115,24 @@ the riots. More on this at 6."} round_time = 60 * 60 - -var/global/list/newscaster_standard_feeds = list(/datum/news_announcement/bluespace_research, /datum/news_announcement/lotus_tree, /datum/news_announcement/random_junk, /datum/news_announcement/food_riots) +GLOBAL_LIST_INIT(newscaster_standard_feeds, list(/datum/news_announcement/bluespace_research, /datum/news_announcement/lotus_tree, /datum/news_announcement/random_junk, /datum/news_announcement/food_riots)) proc/process_newscaster() check_for_newscaster_updates(SSticker.mode.newscaster_announcements) -var/global/tmp/announced_news_types = list() +GLOBAL_LIST_EMPTY(announced_news_types) + proc/check_for_newscaster_updates(type) for(var/subtype in subtypesof(type)) var/datum/news_announcement/news = new subtype() - if(news.round_time * 10 <= world.time && !(subtype in announced_news_types)) - announced_news_types += subtype + if(news.round_time * 10 <= world.time && !(subtype in GLOB.announced_news_types)) + GLOB.announced_news_types += subtype announce_newscaster_news(news) proc/announce_newscaster_news(datum/news_announcement/news) var/datum/feed_channel/sendto - for(var/datum/feed_channel/FC in news_network.network_channels) + for(var/datum/feed_channel/FC in GLOB.news_network.network_channels) if(FC.channel_name == news.channel_name) sendto = FC break @@ -142,7 +143,7 @@ proc/announce_newscaster_news(datum/news_announcement/news) sendto.author = news.author sendto.locked = 1 sendto.is_admin_channel = 1 - news_network.network_channels += sendto + GLOB.news_network.network_channels += sendto var/datum/feed_message/newMsg = new /datum/feed_message newMsg.author = news.author ? news.author : sendto.author @@ -152,5 +153,5 @@ proc/announce_newscaster_news(datum/news_announcement/news) sendto.messages += newMsg - for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allNewscasters) NEWSCASTER.newsAlert(news.channel_name) diff --git a/code/datums/spawners_menu.dm b/code/datums/spawners_menu.dm index 5cc76721377..a651edbc79c 100644 --- a/code/datums/spawners_menu.dm +++ b/code/datums/spawners_menu.dm @@ -6,7 +6,7 @@ qdel(src) owner = new_owner -/datum/spawners_menu/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = FALSE, datum/topic_state/state = ghost_state, datum/nanoui/master_ui = null) +/datum/spawners_menu/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = FALSE, datum/topic_state/state = GLOB.ghost_state, datum/nanoui/master_ui = null) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "spawners_menu.tmpl", "Spawners Menu", 700, 600, master_ui, state = state) diff --git a/code/datums/spell.dm b/code/datums/spell.dm index 7f1541248d9..6b1865cf73d 100644 --- a/code/datums/spell.dm +++ b/code/datums/spell.dm @@ -13,7 +13,7 @@ /obj/effect/proc_holder/singularity_pull() return -var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin verb for now +GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) /obj/effect/proc_holder/proc/InterceptClickOn(mob/living/user, params, atom/A) if(user.ranged_ability != src) diff --git a/code/datums/spells/area_teleport.dm b/code/datums/spells/area_teleport.dm index fbde291ae98..8a3585febc0 100644 --- a/code/datums/spells/area_teleport.dm +++ b/code/datums/spells/area_teleport.dm @@ -25,14 +25,14 @@ var/A = null if(!randomise_selection) - A = input("Area to teleport to", "Teleport", A) as null|anything in teleportlocs + A = input("Area to teleport to", "Teleport", A) as null|anything in GLOB.teleportlocs else - A = pick(teleportlocs) + A = pick(GLOB.teleportlocs) if(!A) return - var/area/thearea = teleportlocs[A] + var/area/thearea = GLOB.teleportlocs[A] if(thearea.tele_proof && !istype(thearea, /area/wizard_station)) to_chat(usr, "A mysterious force disrupts your arcane spell matrix, and you remain where you are.") diff --git a/code/datums/spells/banana_touch.dm b/code/datums/spells/banana_touch.dm index cbfa158531e..e8b7f27b0da 100644 --- a/code/datums/spells/banana_touch.dm +++ b/code/datums/spells/banana_touch.dm @@ -55,10 +55,10 @@ equip_to_slot_if_possible(new /obj/item/clothing/under/rank/clown/nodrop, slot_w_uniform, TRUE, TRUE) equip_to_slot_if_possible(new /obj/item/clothing/shoes/clown_shoes/nodrop, slot_shoes, TRUE, TRUE) equip_to_slot_if_possible(new /obj/item/clothing/mask/gas/clown_hat/nodrop, slot_wear_mask, TRUE, TRUE) - dna.SetSEState(CLUMSYBLOCK, TRUE, TRUE) - dna.SetSEState(COMICBLOCK, TRUE, TRUE) - genemutcheck(src, CLUMSYBLOCK, null, MUTCHK_FORCED) - genemutcheck(src, COMICBLOCK, null, MUTCHK_FORCED) + dna.SetSEState(GLOB.clumsyblock, TRUE, TRUE) + dna.SetSEState(GLOB.comicblock, TRUE, TRUE) + genemutcheck(src, GLOB.clumsyblock, null, MUTCHK_FORCED) + genemutcheck(src, GLOB.comicblock, null, MUTCHK_FORCED) if(!(iswizard(src) || (mind && mind.special_role == SPECIAL_ROLE_WIZARD_APPRENTICE))) //Mutations are permanent on non-wizards. Can still be removed by genetics fuckery but not mutadone. - dna.default_blocks.Add(CLUMSYBLOCK) - dna.default_blocks.Add(COMICBLOCK) + dna.default_blocks.Add(GLOB.clumsyblock) + dna.default_blocks.Add(GLOB.comicblock) diff --git a/code/datums/spells/cluwne.dm b/code/datums/spells/cluwne.dm index 58a33e31a44..91df261e9c2 100644 --- a/code/datums/spells/cluwne.dm +++ b/code/datums/spells/cluwne.dm @@ -27,8 +27,8 @@ var/obj/item/organ/internal/honktumor/cursed/tumor = new tumor.insert(src) mutations.Add(NERVOUS) - dna.SetSEState(NERVOUSBLOCK, 1, 1) - genemutcheck(src, NERVOUSBLOCK, null, MUTCHK_FORCED) + dna.SetSEState(GLOB.nervousblock, 1, 1) + genemutcheck(src, GLOB.nervousblock, null, MUTCHK_FORCED) rename_character(real_name, "cluwne") unEquip(w_uniform, 1) @@ -56,14 +56,14 @@ tumor.remove(src) else mutations.Remove(CLUMSY) - mutations.Remove(COMICBLOCK) - dna.SetSEState(CLUMSYBLOCK,0) - dna.SetSEState(COMICBLOCK,0) - genemutcheck(src, CLUMSYBLOCK, null, MUTCHK_FORCED) - genemutcheck(src, COMICBLOCK, null, MUTCHK_FORCED) + mutations.Remove(GLOB.comicblock) + dna.SetSEState(GLOB.clumsyblock,0) + dna.SetSEState(GLOB.comicblock,0) + genemutcheck(src, GLOB.clumsyblock, null, MUTCHK_FORCED) + genemutcheck(src, GLOB.comicblock, null, MUTCHK_FORCED) mutations.Remove(NERVOUS) - dna.SetSEState(NERVOUSBLOCK, 0) - genemutcheck(src, NERVOUSBLOCK, null, MUTCHK_FORCED) + dna.SetSEState(GLOB.nervousblock, 0) + genemutcheck(src, GLOB.nervousblock, null, MUTCHK_FORCED) var/obj/item/clothing/under/U = w_uniform unEquip(w_uniform, 1) diff --git a/code/datums/spells/ethereal_jaunt.dm b/code/datums/spells/ethereal_jaunt.dm index 4f2c88b659d..f7d7a9bfb8d 100644 --- a/code/datums/spells/ethereal_jaunt.dm +++ b/code/datums/spells/ethereal_jaunt.dm @@ -56,7 +56,7 @@ qdel(holder) if(!QDELETED(target)) if(mobloc.density) - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) var/turf/T = get_step(mobloc, direction) if(T) if(target.Move(T)) diff --git a/code/datums/spells/knock.dm b/code/datums/spells/knock.dm index 95c16978638..dc2efcc1e91 100644 --- a/code/datums/spells/knock.dm +++ b/code/datums/spells/knock.dm @@ -51,7 +51,7 @@ if(is_station_level(A.z)) A.req_access = list() A.req_one_access = list() - command_announcement.Announce("We have removed all access requirements on your station's airlocks. You can thank us later!", "Greetings!", 'sound/misc/notice2.ogg', , , "Space Wizard Federation Message") + GLOB.command_announcement.Announce("We have removed all access requirements on your station's airlocks. You can thank us later!", "Greetings!", 'sound/misc/notice2.ogg', , , "Space Wizard Federation Message") else ..() return diff --git a/code/datums/spells/mime_malaise.dm b/code/datums/spells/mime_malaise.dm index 1c212c62125..1765b2f5741 100644 --- a/code/datums/spells/mime_malaise.dm +++ b/code/datums/spells/mime_malaise.dm @@ -49,6 +49,6 @@ equip_to_slot_if_possible(new /obj/item/clothing/mask/gas/mime/nodrop, slot_wear_mask, TRUE, TRUE) equip_to_slot_if_possible(new /obj/item/clothing/under/mime/nodrop, slot_w_uniform, TRUE, TRUE) equip_to_slot_if_possible(new /obj/item/clothing/suit/suspenders/nodrop, slot_wear_suit, TRUE, TRUE) - dna.SetSEState(MUTEBLOCK , TRUE, TRUE) - genemutcheck(src, MUTEBLOCK , null, MUTCHK_FORCED) - dna.default_blocks.Add(MUTEBLOCK) + dna.SetSEState(GLOB.muteblock , TRUE, TRUE) + genemutcheck(src, GLOB.muteblock , null, MUTCHK_FORCED) + dna.default_blocks.Add(GLOB.muteblock) diff --git a/code/datums/spells/rathens.dm b/code/datums/spells/rathens.dm index b2d35ff5393..4d98be324b2 100644 --- a/code/datums/spells/rathens.dm +++ b/code/datums/spells/rathens.dm @@ -21,14 +21,14 @@ A.remove(H) A.forceMove(get_turf(H)) spawn() - A.throw_at(get_edge_target_turf(H, pick(alldirs)), rand(1, 10), 5) + A.throw_at(get_edge_target_turf(H, pick(GLOB.alldirs)), rand(1, 10), 5) H.visible_message("[H]'s [A.name] flies out of their body in a magical explosion!",\ "Your [A.name] flies out of your body in a magical explosion!") H.Weaken(2) else var/obj/effect/decal/cleanable/blood/gibs/G = new/obj/effect/decal/cleanable/blood/gibs(get_turf(H)) spawn() - G.throw_at(get_edge_target_turf(H, pick(alldirs)), rand(1, 10), 5) + G.throw_at(get_edge_target_turf(H, pick(GLOB.alldirs)), rand(1, 10), 5) H.apply_damage(10, BRUTE, "chest") to_chat(H, "You have no appendix, but something had to give! Holy shit, what was that?") H.Weaken(3) diff --git a/code/datums/spells/wizard.dm b/code/datums/spells/wizard.dm index fb4b80ff69f..cf7e6fa3217 100644 --- a/code/datums/spells/wizard.dm +++ b/code/datums/spells/wizard.dm @@ -97,11 +97,11 @@ /obj/effect/proc_holder/spell/targeted/genetic/mutate/cast(list/targets, mob/user = usr) for(var/mob/living/target in targets) - target.dna.SetSEState(HULKBLOCK, 1) - genemutcheck(target, HULKBLOCK, null, MUTCHK_FORCED) + target.dna.SetSEState(GLOB.hulkblock, 1) + genemutcheck(target, GLOB.hulkblock, null, MUTCHK_FORCED) spawn(duration) - target.dna.SetSEState(HULKBLOCK, 0) - genemutcheck(target, HULKBLOCK, null, MUTCHK_FORCED) + target.dna.SetSEState(GLOB.hulkblock, 0) + genemutcheck(target, GLOB.hulkblock, null, MUTCHK_FORCED) ..() /obj/effect/proc_holder/spell/targeted/smoke diff --git a/code/datums/status_effects/buffs.dm b/code/datums/status_effects/buffs.dm index 479694de4d7..5ded7fa43a4 100644 --- a/code/datums/status_effects/buffs.dm +++ b/code/datums/status_effects/buffs.dm @@ -113,13 +113,13 @@ /datum/status_effect/hippocraticOath/on_apply() //Makes the user passive, it's in their oath not to harm! ADD_TRAIT(owner, TRAIT_PACIFISM, "hippocraticOath") - var/datum/atom_hud/H = huds[DATA_HUD_MEDICAL_ADVANCED] + var/datum/atom_hud/H = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] H.add_hud_to(owner) return ..() /datum/status_effect/hippocraticOath/on_remove() REMOVE_TRAIT(owner, TRAIT_PACIFISM, "hippocraticOath") - var/datum/atom_hud/H = huds[DATA_HUD_MEDICAL_ADVANCED] + var/datum/atom_hud/H = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] H.remove_hud_from(owner) /datum/status_effect/hippocraticOath/tick() diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index db6aef6ea0e..d8b5e4d9cbe 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -107,7 +107,7 @@ if(needs_to_bleed) var/turf/T = get_turf(owner) new /obj/effect/temp_visual/bleed/explode(T) - for(var/d in alldirs) + for(var/d in GLOB.alldirs) new /obj/effect/temp_visual/dir_setting/bloodsplatter(T, d) playsound(T, "desceration", 200, 1, -1) owner.adjustBruteLoss(bleed_damage) diff --git a/code/datums/supplypacks.dm b/code/datums/supplypacks.dm index f17e9840e4f..91e68da427b 100644 --- a/code/datums/supplypacks.dm +++ b/code/datums/supplypacks.dm @@ -16,7 +16,7 @@ #define SUPPLY_MISC 8 #define SUPPLY_VEND 9 -var/list/all_supply_groups = list(SUPPLY_EMERGENCY,SUPPLY_SECURITY,SUPPLY_ENGINEER,SUPPLY_MEDICAL,SUPPLY_SCIENCE,SUPPLY_ORGANIC,SUPPLY_MATERIALS,SUPPLY_MISC,SUPPLY_VEND) +GLOBAL_LIST_INIT(all_supply_groups, list(SUPPLY_EMERGENCY,SUPPLY_SECURITY,SUPPLY_ENGINEER,SUPPLY_MEDICAL,SUPPLY_SCIENCE,SUPPLY_ORGANIC,SUPPLY_MATERIALS,SUPPLY_MISC,SUPPLY_VEND)) /proc/get_supply_group_name(var/cat) switch(cat) diff --git a/code/datums/weather/weather_types/ash_storm.dm b/code/datums/weather/weather_types/ash_storm.dm index 57d8c11f80b..558669df3c6 100644 --- a/code/datums/weather/weather_types/ash_storm.dm +++ b/code/datums/weather/weather_types/ash_storm.dm @@ -36,7 +36,7 @@ var/list/outside_areas = list() var/list/eligible_areas = list() for(var/z in impacted_z_levels) - eligible_areas += space_manager.areas_in_z["[z]"] + eligible_areas += GLOB.space_manager.areas_in_z["[z]"] for(var/i in 1 to eligible_areas.len) var/area/place = eligible_areas[i] if(place.outdoors) diff --git a/code/datums/weather/weather_types/radiation_storm.dm b/code/datums/weather/weather_types/radiation_storm.dm index 85b8d3fd2af..2bfefa5624e 100644 --- a/code/datums/weather/weather_types/radiation_storm.dm +++ b/code/datums/weather/weather_types/radiation_storm.dm @@ -26,8 +26,8 @@ /datum/weather/rad_storm/telegraph() ..() status_alarm(TRUE) - pre_maint_all_access = maint_all_access - if(!maint_all_access) + pre_maint_all_access = GLOB.maint_all_access + if(!GLOB.maint_all_access) make_maint_all_access() @@ -51,7 +51,7 @@ /datum/weather/rad_storm/end() if(..()) return - priority_announcement.Announce("The radiation threat has passed. Please return to your workplaces.", "Anomaly Alert") + GLOB.priority_announcement.Announce("The radiation threat has passed. Please return to your workplaces.", "Anomaly Alert") status_alarm(FALSE) if(!pre_maint_all_access) revoke_maint_all_access() diff --git a/code/datums/wires/nuclearbomb.dm b/code/datums/wires/nuclearbomb.dm index 63687ad8839..3b8ff5db098 100644 --- a/code/datums/wires/nuclearbomb.dm +++ b/code/datums/wires/nuclearbomb.dm @@ -72,7 +72,7 @@ if(N.icon_state == "nuclearbomb2") N.icon_state = "nuclearbomb1" N.timing = 0 - bomb_set = 0 + GLOB.bomb_set = 0 if(NUCLEARBOMB_WIRE_LIGHT) N.lighthack = !N.lighthack diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm index 07cf919db2d..1a407f2ec50 100644 --- a/code/datums/wires/wires.dm +++ b/code/datums/wires/wires.dm @@ -5,9 +5,9 @@ #define MAX_FLAG 65535 -var/list/same_wires = list() +GLOBAL_LIST_EMPTY(same_wires) // 12 colours, if you're adding more than 12 wires then add more colours here -var/list/wireColours = list("red", "blue", "green", "black", "orange", "brown", "gold", "gray", "cyan", "navy", "purple", "pink") +GLOBAL_LIST_INIT(wireColours, list("red", "blue", "green", "black", "orange", "brown", "gold", "gray", "cyan", "navy", "purple", "pink")) /datum/wires @@ -39,11 +39,11 @@ var/list/wireColours = list("red", "blue", "green", "black", "orange", "brown", // Get the same wires else // We don't have any wires to copy yet, generate some and then copy it. - if(!same_wires[holder_type]) + if(!GLOB.same_wires[holder_type]) GenerateWires() - same_wires[holder_type] = src.wires.Copy() + GLOB.same_wires[holder_type] = src.wires.Copy() else - var/list/wires = same_wires[holder_type] + var/list/wires = GLOB.same_wires[holder_type] src.wires = wires // Reference the wires list. /datum/wires/Destroy() @@ -51,7 +51,7 @@ var/list/wireColours = list("red", "blue", "green", "black", "orange", "brown", return ..() /datum/wires/proc/GenerateWires() - var/list/colours_to_pick = wireColours.Copy() // Get a copy, not a reference. + var/list/colours_to_pick = GLOB.wireColours.Copy() // Get a copy, not a reference. var/list/indexes_to_pick = list() //Generate our indexes for(var/i = 1; i < MAX_FLAG && i < (1 << wire_count); i += i) @@ -81,7 +81,7 @@ var/list/wireColours = list("red", "blue", "green", "black", "orange", "brown", ui = new(user, src, ui_key, "wires.tmpl", holder.name, window_x, window_y) ui.open() -/datum/wires/ui_data(mob/user, ui_key = "main", datum/topic_state/state = physical_state) +/datum/wires/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.physical_state) var/data[0] var/list/replace_colours = null if(ishuman(user)) diff --git a/code/defines/procs/AStar.dm b/code/defines/procs/AStar.dm index e593888c265..1f8c83f5f04 100644 --- a/code/defines/procs/AStar.dm +++ b/code/defines/procs/AStar.dm @@ -155,7 +155,7 @@ Actual Adjacent procs : var/list/L = new() var/turf/simulated/T - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) T = get_step(src,dir) if(!T || (simulated_only && !istype(T))) continue diff --git a/code/defines/procs/announce.dm b/code/defines/procs/announce.dm index 3a70d05029e..a2b80440ecb 100644 --- a/code/defines/procs/announce.dm +++ b/code/defines/procs/announce.dm @@ -1,7 +1,7 @@ -/var/datum/announcement/minor/minor_announcement = new() -/var/datum/announcement/priority/priority_announcement = new(do_log = 0) -/var/datum/announcement/priority/command/command_announcement = new(do_log = 0, do_newscast = 0) -/var/datum/announcement/priority/command/event/event_announcement = new(do_log = 0, do_newscast = 0) +GLOBAL_DATUM_INIT(minor_announcement, /datum/announcement/minor, new()) +GLOBAL_DATUM_INIT(priority_announcement, /datum/announcement/priority, new(do_log = 0)) +GLOBAL_DATUM_INIT(command_announcement, /datum/announcement/priority/command, new(do_log = 0, do_newscast = 0)) +GLOBAL_DATUM_INIT(event_announcement, /datum/announcement/priority/command/event, new(do_log = 0, do_newscast = 0)) /datum/announcement var/title = "Attention" diff --git a/code/defines/procs/dbcore.dm b/code/defines/procs/dbcore.dm index 86862eb9fcc..76e5a1fd0a6 100644 --- a/code/defines/procs/dbcore.dm +++ b/code/defines/procs/dbcore.dm @@ -29,13 +29,6 @@ #define BLOB 14 // TODO: Investigate more recent type additions and see if I can handle them. - Nadrew - -// Deprecated! See global.dm for new configuration vars -/* -var/DB_SERVER = "" // This is the location of your MySQL server (localhost is USUALLY fine) -var/DB_PORT = 3306 // This is the port your MySQL server is running on (3306 is the default) -*/ - DBConnection var/_db_con // This variable contains a reference to the actual database connection. var/dbi // This variable is a string containing the DBI MySQL requires. diff --git a/code/defines/procs/radio.dm b/code/defines/procs/radio.dm index 84d3ddaae78..a3d6647ef41 100644 --- a/code/defines/procs/radio.dm +++ b/code/defines/procs/radio.dm @@ -35,8 +35,8 @@ var/list/receiver_reception = new /proc/get_message_server() - if(message_servers) - for(var/obj/machinery/message_server/MS in message_servers) + if(GLOB.message_servers) + for(var/obj/machinery/message_server/MS in GLOB.message_servers) if(MS.active) return MS return null diff --git a/code/defines/procs/records.dm b/code/defines/procs/records.dm index 256ae51dbf2..a74680ec578 100644 --- a/code/defines/procs/records.dm +++ b/code/defines/procs/records.dm @@ -20,7 +20,7 @@ G.fields["religion"] = "Unknown" G.fields["photo_front"] = front G.fields["photo_side"] = side - data_core.general += G + GLOB.data_core.general += G qdel(dummy) return G @@ -36,11 +36,11 @@ R.fields["ma_crim"] = "None" R.fields["ma_crim_d"] = "No major crime convictions." R.fields["notes"] = "No notes." - data_core.security += R + GLOB.data_core.security += R return R /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) diff --git a/code/defines/procs/statistics.dm b/code/defines/procs/statistics.dm index b2b643541ec..e6e111880fb 100644 --- a/code/defines/procs/statistics.dm +++ b/code/defines/procs/statistics.dm @@ -6,11 +6,11 @@ if(M.client) playercount += 1 establish_db_connection() - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) log_game("SQL ERROR during player polling. Failed to connect.") else var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss") - var/DBQuery/query = dbcon.NewQuery("INSERT INTO [format_table_name("legacy_population")] (playercount, time) VALUES ([playercount], '[sqltime]')") + var/DBQuery/query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("legacy_population")] (playercount, time) VALUES ([playercount], '[sqltime]')") if(!query.Execute()) var/err = query.ErrorMsg() log_game("SQL ERROR during player polling. Error : \[[err]\]\n") @@ -21,11 +21,11 @@ return var/admincount = GLOB.admins.len establish_db_connection() - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) log_game("SQL ERROR during admin polling. Failed to connect.") else var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss") - var/DBQuery/query = dbcon.NewQuery("INSERT INTO [format_table_name("legacy_population")] (admincount, time) VALUES ([admincount], '[sqltime]')") + var/DBQuery/query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("legacy_population")] (admincount, time) VALUES ([admincount], '[sqltime]')") if(!query.Execute()) var/err = query.ErrorMsg() log_game("SQL ERROR during admin polling. Error : \[[err]\]\n") @@ -67,10 +67,10 @@ var/coord = "[H.x], [H.y], [H.z]" // to_chat(world, "INSERT INTO death (name, byondkey, job, special, pod, tod, laname, lakey, gender, bruteloss, fireloss, brainloss, oxyloss) VALUES ('[sqlname]', '[sqlkey]', '[sqljob]', '[sqlspecial]', '[sqlpod]', '[sqltime]', '[laname]', '[lakey]', '[H.gender]', [H.bruteloss], [H.getFireLoss()], [H.getBrainLoss()], [H.getOxyLoss()])") establish_db_connection() - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) log_game("SQL ERROR during death reporting. Failed to connect.") else - var/DBQuery/query = dbcon.NewQuery("INSERT INTO [format_table_name("death")] (name, byondkey, job, special, pod, tod, laname, lakey, gender, bruteloss, fireloss, brainloss, oxyloss, coord) VALUES ('[sqlname]', '[sqlkey]', '[sqljob]', '[sqlspecial]', '[sqlpod]', '[sqltime]', '[laname]', '[lakey]', '[H.gender]', [H.getBruteLoss()], [H.getFireLoss()], [H.getBrainLoss()], [H.getOxyLoss()], '[coord]')") + var/DBQuery/query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("death")] (name, byondkey, job, special, pod, tod, laname, lakey, gender, bruteloss, fireloss, brainloss, oxyloss, coord) VALUES ('[sqlname]', '[sqlkey]', '[sqljob]', '[sqlspecial]', '[sqlpod]', '[sqltime]', '[laname]', '[lakey]', '[H.gender]', [H.getBruteLoss()], [H.getFireLoss()], [H.getBrainLoss()], [H.getOxyLoss()], '[coord]')") if(!query.Execute()) var/err = query.ErrorMsg() log_game("SQL ERROR during death reporting. Error : \[[err]\]\n") @@ -102,10 +102,10 @@ var/coord = "[H.x], [H.y], [H.z]" // to_chat(world, "INSERT INTO death (name, byondkey, job, special, pod, tod, laname, lakey, gender, bruteloss, fireloss, brainloss, oxyloss) VALUES ('[sqlname]', '[sqlkey]', '[sqljob]', '[sqlspecial]', '[sqlpod]', '[sqltime]', '[laname]', '[lakey]', '[H.gender]', [H.bruteloss], [H.getFireLoss()], [H.brainloss], [H.getOxyLoss()])") establish_db_connection() - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) log_game("SQL ERROR during death reporting. Failed to connect.") else - var/DBQuery/query = dbcon.NewQuery("INSERT INTO [format_table_name("death")] (name, byondkey, job, special, pod, tod, laname, lakey, gender, bruteloss, fireloss, brainloss, oxyloss, coord) VALUES ('[sqlname]', '[sqlkey]', '[sqljob]', '[sqlspecial]', '[sqlpod]', '[sqltime]', '[laname]', '[lakey]', '[H.gender]', [H.getBruteLoss()], [H.getFireLoss()], [H.getBrainLoss()], [H.getOxyLoss()], '[coord]')") + var/DBQuery/query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("death")] (name, byondkey, job, special, pod, tod, laname, lakey, gender, bruteloss, fireloss, brainloss, oxyloss, coord) VALUES ('[sqlname]', '[sqlkey]', '[sqljob]', '[sqlspecial]', '[sqlpod]', '[sqltime]', '[laname]', '[lakey]', '[H.gender]', [H.getBruteLoss()], [H.getFireLoss()], [H.getBrainLoss()], [H.getOxyLoss()], '[coord]')") if(!query.Execute()) var/err = query.ErrorMsg() log_game("SQL ERROR during death reporting. Error : \[[err]\]\n") @@ -121,23 +121,23 @@ //This proc is used for feedback. It is executed at round end. /proc/sql_commit_feedback() - if(!blackbox) + if(!GLOB.blackbox) log_game("Round ended without a blackbox recorder. No feedback was sent to the database.") return //content is a list of lists. Each item in the list is a list with two fields, a variable name and a value. Items MUST only have these two values. - var/list/datum/feedback_variable/content = blackbox.get_round_feedback() + var/list/datum/feedback_variable/content = GLOB.blackbox.get_round_feedback() if(!content) log_game("Round ended without any feedback being generated. No feedback was sent to the database.") return establish_db_connection() - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) log_game("SQL ERROR during feedback reporting. Failed to connect.") else - var/DBQuery/max_query = dbcon.NewQuery("SELECT MAX(roundid) AS max_round_id FROM [format_table_name("feedback")]") + var/DBQuery/max_query = GLOB.dbcon.NewQuery("SELECT MAX(roundid) AS max_round_id FROM [format_table_name("feedback")]") max_query.Execute() var/newroundid @@ -157,7 +157,7 @@ var/variable = item.get_variable() var/value = item.get_value() - var/DBQuery/query = dbcon.NewQuery("INSERT INTO [format_table_name("feedback")] (id, roundid, time, variable, value) VALUES (null, [newroundid], Now(), '[variable]', '[value]')") + var/DBQuery/query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("feedback")] (id, roundid, time, variable, value) VALUES (null, [newroundid], Now(), '[variable]', '[value]')") if(!query.Execute()) var/err = query.ErrorMsg() log_game("SQL ERROR during feedback reporting. Error : \[[err]\]\n") diff --git a/code/defines/vox_sounds.dm b/code/defines/vox_sounds.dm index bb155337502..1d7bb9753a0 100644 --- a/code/defines/vox_sounds.dm +++ b/code/defines/vox_sounds.dm @@ -1,7 +1,7 @@ // List is required to compile the resources into the game when it loads. // Dynamically loading it has bad results with sounds overtaking each other, even with the wait variable. -var/list/vox_sounds = list("," = 'sound/vox_fem/,.ogg', +GLOBAL_LIST_INIT(vox_sounds, list("," = 'sound/vox_fem/,.ogg', "." = 'sound/vox_fem/..ogg', "a" = 'sound/vox_fem/a.ogg', "abortions" = 'sound/vox_fem/abortions.ogg', @@ -1267,4 +1267,4 @@ var/list/vox_sounds = list("," = 'sound/vox_fem/,.ogg', "zero" = 'sound/vox_fem/zero.ogg', "zone" = 'sound/vox_fem/zone.ogg', "zulu" = 'sound/vox_fem/zulu.ogg' -) +)) diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm index 97eca30cbfe..bbfcc915c79 100644 --- a/code/game/area/Space Station 13 areas.dm +++ b/code/game/area/Space Station 13 areas.dm @@ -15,30 +15,30 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /*Adding a wizard area teleport list because motherfucking lag -- Urist*/ /*I am far too lazy to make it a proper list of areas so I'll just make it run the usual telepot routine at the start of the game*/ -var/list/teleportlocs = list() +GLOBAL_LIST_EMPTY(teleportlocs) /hook/startup/proc/process_teleport_locs() for(var/area/AR in world) if(AR.no_teleportlocs) continue - if(teleportlocs.Find(AR.name)) continue + if(GLOB.teleportlocs.Find(AR.name)) continue var/turf/picked = safepick(get_area_turfs(AR.type)) if(picked && is_station_level(picked.z)) - teleportlocs += AR.name - teleportlocs[AR.name] = AR + GLOB.teleportlocs += AR.name + GLOB.teleportlocs[AR.name] = AR - teleportlocs = sortAssoc(teleportlocs) + GLOB.teleportlocs = sortAssoc(GLOB.teleportlocs) return 1 -var/list/ghostteleportlocs = list() +GLOBAL_LIST_EMPTY(ghostteleportlocs) /hook/startup/proc/process_ghost_teleport_locs() for(var/area/AR in world) - if(ghostteleportlocs.Find(AR.name)) continue + if(GLOB.ghostteleportlocs.Find(AR.name)) continue var/list/turfs = get_area_turfs(AR.type) if(turfs.len) - ghostteleportlocs += AR.name - ghostteleportlocs[AR.name] = AR + GLOB.ghostteleportlocs += AR.name + GLOB.ghostteleportlocs[AR.name] = AR - ghostteleportlocs = sortAssoc(ghostteleportlocs) + GLOB.ghostteleportlocs = sortAssoc(GLOB.ghostteleportlocs) return 1 @@ -2285,7 +2285,7 @@ var/list/ghostteleportlocs = list() */ // CENTCOM -var/list/centcom_areas = list ( +GLOBAL_LIST_INIT(centcom_areas, list( /area/centcom, /area/shuttle/escape_pod1/centcom, /area/shuttle/escape_pod2/centcom, @@ -2294,10 +2294,10 @@ var/list/centcom_areas = list ( /area/shuttle/transport1, /area/shuttle/administration/centcom, /area/shuttle/specops/centcom, -) +)) //SPACE STATION 13 -var/list/the_station_areas = list ( +GLOBAL_LIST_INIT(the_station_areas, list( /area/shuttle/arrival, /area/shuttle/escape, /area/shuttle/escape_pod1/station, @@ -2344,4 +2344,4 @@ var/list/the_station_areas = list ( /area/turret_protected/ai_upload, //do not try to simplify to "/area/turret_protected" --rastaf0 /area/turret_protected/ai_upload_foyer, /area/turret_protected/ai, -) +)) diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index dbc0a8c567b..6ad45532641 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -110,7 +110,7 @@ /area/proc/reg_in_areas_in_z() if(contents.len) - var/list/areas_in_z = space_manager.areas_in_z + var/list/areas_in_z = GLOB.space_manager.areas_in_z var/z for(var/i in 1 to contents.len) var/atom/thing = contents[i] @@ -155,9 +155,9 @@ for(var/obj/machinery/alarm/AA in src) AA.update_icon() - air_alarm_repository.update_cache(src) + GLOB.air_alarm_repository.update_cache(src) return 1 - air_alarm_repository.update_cache(src) + GLOB.air_alarm_repository.update_cache(src) return 0 /area/proc/air_doors_close() @@ -434,7 +434,7 @@ else // There's a gravity generator on our z level // This would do well when integrated with the z level manager - if(T && gravity_generators["[T.z]"] && length(gravity_generators["[T.z]"])) + if(T && GLOB.gravity_generators["[T.z]"] && length(GLOB.gravity_generators["[T.z]"])) return 1 return 0 diff --git a/code/game/atoms.dm b/code/game/atoms.dm index f9d66372df5..1cb0ee3baad 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -52,8 +52,8 @@ //its inherent color, the colored paint applied on it, special color effect etc... /atom/New(loc, ...) - if(use_preloader && (src.type == _preloader.target_path))//in case the instanciated atom is creating other atoms in New() - _preloader.load(src) + if(GLOB.use_preloader && (src.type == GLOB._preloader.target_path))//in case the instanciated atom is creating other atoms in New() + GLOB._preloader.load(src) . = ..() attempt_init(arglist(args)) @@ -516,7 +516,7 @@ A.fingerprintshidden |= fingerprintshidden.Copy() //admin A.fingerprintslast = fingerprintslast -var/list/blood_splatter_icons = list() +GLOBAL_LIST_EMPTY(blood_splatter_icons) /atom/proc/blood_splatter_index() return "\ref[initial(icon)]-[initial(icon_state)]" @@ -649,13 +649,13 @@ var/list/blood_splatter_icons = list() if(initial(icon) && initial(icon_state)) //try to find a pre-processed blood-splatter. otherwise, make a new one var/index = blood_splatter_index() - var/icon/blood_splatter_icon = blood_splatter_icons[index] + var/icon/blood_splatter_icon = GLOB.blood_splatter_icons[index] if(!blood_splatter_icon) blood_splatter_icon = icon(initial(icon), initial(icon_state), , 1) //we only want to apply blood-splatters to the initial icon_state for each object blood_splatter_icon.Blend("#fff", ICON_ADD) //fills the icon_state with white (except where it's transparent) blood_splatter_icon.Blend(icon('icons/effects/blood.dmi', "itemblood"), ICON_MULTIPLY) //adds blood and the remaining white areas become transparant blood_splatter_icon = fcopy_rsc(blood_splatter_icon) - blood_splatter_icons[index] = blood_splatter_icon + GLOB.blood_splatter_icons[index] = blood_splatter_icon blood_overlay = image(blood_splatter_icon) blood_overlay.color = color @@ -722,12 +722,12 @@ var/list/blood_splatter_icons = list() this.icon_state = "vomittox_[pick(1,4)]" /atom/proc/get_global_map_pos() - if(!islist(global_map) || isemptylist(global_map)) return + if(!islist(GLOB.global_map) || isemptylist(GLOB.global_map)) return var/cur_x = null var/cur_y = null var/list/y_arr = null - for(cur_x=1,cur_x<=global_map.len,cur_x++) - y_arr = global_map[cur_x] + for(cur_x=1,cur_x<=GLOB.global_map.len,cur_x++) + y_arr = GLOB.global_map[cur_x] cur_y = y_arr.Find(src.z) if(cur_y) break @@ -795,7 +795,7 @@ var/list/blood_splatter_icons = list() return /atom/vv_edit_var(var_name, var_value) - if(!Debug2) + if(!GLOB.debug2) admin_spawned = TRUE . = ..() switch(var_name) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 0370fad0367..6b49962bbac 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -36,8 +36,8 @@ /atom/movable/attempt_init(loc, ...) var/turf/T = get_turf(src) - if(T && SSatoms.initialized != INITIALIZATION_INSSATOMS && space_manager.is_zlevel_dirty(T.z)) - space_manager.postpone_init(T.z, src) + if(T && SSatoms.initialized != INITIALIZATION_INSSATOMS && GLOB.space_manager.is_zlevel_dirty(T.z)) + GLOB.space_manager.postpone_init(T.z, src) return . = ..() diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm index 71e6867280c..aff345d2451 100644 --- a/code/game/data_huds.dm +++ b/code/game/data_huds.dm @@ -7,10 +7,10 @@ /* DATA HUD DATUMS */ /atom/proc/add_to_all_human_data_huds() - for(var/datum/atom_hud/data/human/hud in huds) hud.add_to_hud(src) + for(var/datum/atom_hud/data/human/hud in GLOB.huds) hud.add_to_hud(src) /atom/proc/remove_from_all_data_huds() - for(var/datum/atom_hud/data/hud in huds) hud.remove_from_hud(src) + for(var/datum/atom_hud/data/hud in GLOB.huds) hud.remove_from_hud(src) /datum/atom_hud/data @@ -142,7 +142,7 @@ //called when a human changes suit sensors /mob/living/carbon/proc/update_suit_sensors() - var/datum/atom_hud/data/human/medical/basic/B = huds[DATA_HUD_MEDICAL_BASIC] + var/datum/atom_hud/data/human/medical/basic/B = GLOB.huds[DATA_HUD_MEDICAL_BASIC] B.update_suit_sensors(src) @@ -220,7 +220,7 @@ var/perpname = get_visible_name(TRUE) //gets the name of the perp, works if they have an id or if their face is uncovered if(!SSticker) return //wait till the game starts or the monkeys runtime.... if(perpname) - var/datum/data/record/R = find_record("name", perpname, data_core.security) + var/datum/data/record/R = find_record("name", perpname, GLOB.data_core.security) if(R) switch(R.fields["criminal"]) if("*Execute*") diff --git a/code/game/dna/dna2.dm b/code/game/dna/dna2.dm index e6d80529651..ceabae25973 100644 --- a/code/game/dna/dna2.dm +++ b/code/game/dna/dna2.dm @@ -4,76 +4,20 @@ * @author N3X15 */ -// What each index means: -#define DNA_OFF_LOWERBOUND 1 // changed as lists start at 1 not 0 -#define DNA_OFF_UPPERBOUND 2 -#define DNA_ON_LOWERBOUND 3 -#define DNA_ON_UPPERBOUND 4 - -// Define block bounds (off-low,off-high,on-low,on-high) -// Used in setupgame.dm -#define DNA_DEFAULT_BOUNDS list(1,2049,2050,4095) -#define DNA_HARDER_BOUNDS list(1,3049,3050,4095) -#define DNA_HARD_BOUNDS list(1,3490,3500,4095) - -// UI Indices (can change to mutblock style, if desired) -#define DNA_UI_HAIR_R 1 -#define DNA_UI_HAIR_G 2 -#define DNA_UI_HAIR_B 3 -#define DNA_UI_HAIR2_R 4 -#define DNA_UI_HAIR2_G 5 -#define DNA_UI_HAIR2_B 6 -#define DNA_UI_BEARD_R 7 -#define DNA_UI_BEARD_G 8 -#define DNA_UI_BEARD_B 9 -#define DNA_UI_BEARD2_R 10 -#define DNA_UI_BEARD2_G 11 -#define DNA_UI_BEARD2_B 12 -#define DNA_UI_SKIN_TONE 13 -#define DNA_UI_SKIN_R 14 -#define DNA_UI_SKIN_G 15 -#define DNA_UI_SKIN_B 16 -#define DNA_UI_HACC_R 17 -#define DNA_UI_HACC_G 18 -#define DNA_UI_HACC_B 19 -#define DNA_UI_HEAD_MARK_R 20 -#define DNA_UI_HEAD_MARK_G 21 -#define DNA_UI_HEAD_MARK_B 22 -#define DNA_UI_BODY_MARK_R 23 -#define DNA_UI_BODY_MARK_G 24 -#define DNA_UI_BODY_MARK_B 25 -#define DNA_UI_TAIL_MARK_R 26 -#define DNA_UI_TAIL_MARK_G 27 -#define DNA_UI_TAIL_MARK_B 28 -#define DNA_UI_EYES_R 29 -#define DNA_UI_EYES_G 30 -#define DNA_UI_EYES_B 31 -#define DNA_UI_GENDER 32 -#define DNA_UI_BEARD_STYLE 33 -#define DNA_UI_HAIR_STYLE 34 -/*#define DNA_UI_BACC_STYLE 23*/ -#define DNA_UI_HACC_STYLE 35 -#define DNA_UI_HEAD_MARK_STYLE 36 -#define DNA_UI_BODY_MARK_STYLE 37 -#define DNA_UI_TAIL_MARK_STYLE 38 -#define DNA_UI_LENGTH 38 // Update this when you add something, or you WILL break shit. - -#define DNA_SE_LENGTH 55 // Was STRUCDNASIZE, size 27. 15 new blocks added = 42, plus room to grow. - // Defines which values mean "on" or "off". // This is to make some of the more OP superpowers a larger PITA to activate, // and to tell our new DNA datum which values to set in order to turn something // on or off. -var/global/list/dna_activity_bounds[DNA_SE_LENGTH] -var/global/list/assigned_gene_blocks[DNA_SE_LENGTH] +GLOBAL_LIST_INIT(dna_activity_bounds, new(DNA_SE_LENGTH)) +GLOBAL_LIST_INIT(assigned_gene_blocks, new(DNA_SE_LENGTH)) // Used to determine what each block means (admin hax and species stuff on /vg/, mostly) -var/global/list/assigned_blocks[DNA_SE_LENGTH] +GLOBAL_LIST_INIT(assigned_blocks, new(DNA_SE_LENGTH)) -var/global/list/datum/dna/gene/dna_genes[0] +GLOBAL_LIST_EMPTY(dna_genes) -var/global/list/good_blocks[0] -var/global/list/bad_blocks[0] +GLOBAL_LIST_EMPTY(good_blocks) +GLOBAL_LIST_EMPTY(bad_blocks) /datum/dna // READ-ONLY, GETS OVERWRITTEN @@ -413,7 +357,7 @@ var/global/list/bad_blocks[0] SE_original = SE.Copy() unique_enzymes = md5(character.real_name) - reg_dna[unique_enzymes] = character.real_name + GLOB.reg_dna[unique_enzymes] = character.real_name // Hmm, I wonder how to go about this without a huge convention break /datum/dna/serialize() diff --git a/code/game/dna/dna2_domutcheck.dm b/code/game/dna/dna2_domutcheck.dm index 07979f40b7c..0091745c518 100644 --- a/code/game/dna/dna2_domutcheck.dm +++ b/code/game/dna/dna2_domutcheck.dm @@ -4,7 +4,7 @@ // connected: Machine we're in, type unchecked so I doubt it's used beyond monkeying // flags: See below, bitfield. /proc/domutcheck(var/mob/living/M, var/connected=null, var/flags=0) - for(var/datum/dna/gene/gene in dna_genes) + for(var/datum/dna/gene/gene in GLOB.dna_genes) if(!M || !M.dna) return if(!gene.block) @@ -23,7 +23,7 @@ if(block < 0) return - var/datum/dna/gene/gene = assigned_gene_blocks[block] + var/datum/dna/gene/gene = GLOB.assigned_gene_blocks[block] domutation(gene, M, connected, flags) diff --git a/code/game/dna/dna2_helpers.dm b/code/game/dna/dna2_helpers.dm index 9ef5dbfcab0..1857848c2c9 100644 --- a/code/game/dna/dna2_helpers.dm +++ b/code/game/dna/dna2_helpers.dm @@ -15,7 +15,7 @@ // DNA Gene activation boundaries, see dna2.dm. // Returns a list object with 4 numbers. /proc/GetDNABounds(var/block) - var/list/BOUNDS=dna_activity_bounds[block] + var/list/BOUNDS=GLOB.dna_activity_bounds[block] if(!istype(BOUNDS)) return DNA_DEFAULT_BOUNDS return BOUNDS @@ -24,14 +24,14 @@ /proc/randmutb(var/mob/living/M) if(!M || !M.dna) return M.dna.check_integrity() - var/block = pick(bad_blocks) + var/block = pick(GLOB.bad_blocks) M.dna.SetSEState(block, 1) // Give Random Good Mutation to M /proc/randmutg(var/mob/living/M) if(!M || !M.dna) return M.dna.check_integrity() - var/block = pick(good_blocks) + var/block = pick(GLOB.good_blocks) M.dna.SetSEState(block, 1) // Random Appearance Mutation diff --git a/code/game/dna/genes/disabilities.dm b/code/game/dna/genes/disabilities.dm index 15e2a9cfff4..e1af06f2ff4 100644 --- a/code/game/dna/genes/disabilities.dm +++ b/code/game/dna/genes/disabilities.dm @@ -54,7 +54,7 @@ mutation=HALLUCINATE /datum/dna/gene/disability/hallucinate/New() - block=HALLUCINATIONBLOCK + block=GLOB.hallucinationblock /datum/dna/gene/disability/epilepsy name="Epilepsy" @@ -64,7 +64,7 @@ disability=EPILEPSY /datum/dna/gene/disability/epilepsy/New() - block=EPILEPSYBLOCK + block=GLOB.epilepsyblock /datum/dna/gene/disability/cough name="Coughing" @@ -74,7 +74,7 @@ disability=COUGHING /datum/dna/gene/disability/cough/New() - block=COUGHBLOCK + block=GLOB.coughblock /datum/dna/gene/disability/clumsy name="Clumsiness" @@ -84,7 +84,7 @@ mutation=CLUMSY /datum/dna/gene/disability/clumsy/New() - block=CLUMSYBLOCK + block=GLOB.clumsyblock /datum/dna/gene/disability/tourettes name="Tourettes" @@ -94,7 +94,7 @@ disability=TOURETTES /datum/dna/gene/disability/tourettes/New() - block=TWITCHBLOCK + block=GLOB.twitchblock /datum/dna/gene/disability/nervousness name="Nervousness" @@ -103,7 +103,7 @@ disability=NERVOUS /datum/dna/gene/disability/nervousness/New() - block=NERVOUSBLOCK + block=GLOB.nervousblock /datum/dna/gene/disability/blindness @@ -114,7 +114,7 @@ disability = BLIND /datum/dna/gene/disability/blindness/New() - block = BLINDBLOCK + block = GLOB.blindblock /datum/dna/gene/disability/blindness/activate(mob/M, connected, flags) ..() @@ -133,7 +133,7 @@ disability = COLOURBLIND /datum/dna/gene/disability/colourblindness/New() - block=COLOURBLINDBLOCK + block=GLOB.colourblindblock /datum/dna/gene/disability/colourblindness/activate(var/mob/M, var/connected, var/flags) ..() @@ -153,7 +153,7 @@ disability=DEAF /datum/dna/gene/disability/deaf/New() - block=DEAFBLOCK + block=GLOB.deafblock /datum/dna/gene/disability/deaf/activate(var/mob/M, var/connected, var/flags) ..() @@ -167,7 +167,7 @@ disability=NEARSIGHTED /datum/dna/gene/disability/nearsighted/New() - block=GLASSESBLOCK + block=GLOB.glassesblock /datum/dna/gene/disability/nearsighted/activate(mob/living/M, connected, flags) . = ..() @@ -186,7 +186,7 @@ /datum/dna/gene/disability/lisp/New() ..() - block=LISPBLOCK + block=GLOB.lispblock /datum/dna/gene/disability/lisp/OnSay(var/mob/M, var/message) return replacetext(message,"s","th") @@ -199,7 +199,7 @@ mutation=COMIC /datum/dna/gene/disability/comic/New() - block = COMICBLOCK + block = GLOB.comicblock /datum/dna/gene/disability/wingdings name = "Alien Voice" @@ -210,7 +210,7 @@ mutation = WINGDINGS /datum/dna/gene/disability/wingdings/New() - block = WINGDINGSBLOCK + block = GLOB.wingdingsblock /datum/dna/gene/disability/wingdings/OnSay(var/mob/M, var/message) var/list/chars = string2charlist(message) diff --git a/code/game/dna/genes/goon_disabilities.dm b/code/game/dna/genes/goon_disabilities.dm index e6c55f02d11..3d794f1a70d 100644 --- a/code/game/dna/genes/goon_disabilities.dm +++ b/code/game/dna/genes/goon_disabilities.dm @@ -17,7 +17,7 @@ /datum/dna/gene/disability/mute/New() ..() - block=MUTEBLOCK + block=GLOB.muteblock /datum/dna/gene/disability/mute/OnSay(var/mob/M, var/message) return "" @@ -36,7 +36,7 @@ /datum/dna/gene/disability/radioactive/New() ..() - block=RADBLOCK + block=GLOB.radblock /datum/dna/gene/disability/radioactive/can_activate(var/mob/M,var/flags) @@ -76,7 +76,7 @@ /datum/dna/gene/disability/fat/New() ..() - block=FATBLOCK + block=GLOB.fatblock // WAS: /datum/bioEffect/chav /datum/dna/gene/disability/speech/chav @@ -88,7 +88,7 @@ /datum/dna/gene/disability/speech/chav/New() ..() - block=CHAVBLOCK + block=GLOB.chavblock /datum/dna/gene/disability/speech/chav/OnSay(var/mob/M, var/message) // THIS ENTIRE THING BEGS FOR REGEX @@ -127,7 +127,7 @@ /datum/dna/gene/disability/speech/swedish/New() ..() - block=SWEDEBLOCK + block=GLOB.swedeblock /datum/dna/gene/disability/speech/swedish/OnSay(var/mob/M, var/message) // svedish @@ -157,7 +157,7 @@ /datum/dna/gene/disability/unintelligable/New() ..() - block=SCRAMBLEBLOCK + block=GLOB.scrambleblock /datum/dna/gene/disability/unintelligable/OnSay(var/mob/M, var/message) var/prefix=copytext(message,1,2) @@ -197,7 +197,7 @@ /datum/dna/gene/disability/strong/New() ..() - block=STRONGBLOCK + block=GLOB.strongblock // WAS: /datum/bioEffect/horns /datum/dna/gene/disability/horns @@ -209,7 +209,7 @@ /datum/dna/gene/disability/horns/New() ..() - block=HORNSBLOCK + block=GLOB.hornsblock /datum/dna/gene/disability/horns/OnDrawUnderlays(var/mob/M,var/g,var/fat) return "horns_s" @@ -227,7 +227,7 @@ /datum/dna/gene/basic/grant_spell/immolate/New() ..() - block = IMMOLATEBLOCK + block = GLOB.immolateblock /obj/effect/proc_holder/spell/targeted/immolate name = "Incendiary Mitochondria" diff --git a/code/game/dna/genes/goon_powers.dm b/code/game/dna/genes/goon_powers.dm index f49a250b0fa..fd2f300e8fb 100644 --- a/code/game/dna/genes/goon_powers.dm +++ b/code/game/dna/genes/goon_powers.dm @@ -9,7 +9,7 @@ mutation=SOBER /datum/dna/gene/basic/sober/New() - block=SOBERBLOCK + block=GLOB.soberblock //WAS: /datum/bioEffect/psychic_resist /datum/dna/gene/basic/psychic_resist @@ -21,7 +21,7 @@ mutation=PSY_RESIST /datum/dna/gene/basic/psychic_resist/New() - block=PSYRESISTBLOCK + block=GLOB.psyresistblock ///////////////////////// // Stealth Enhancers @@ -51,7 +51,7 @@ mutation = CLOAK /datum/dna/gene/basic/stealth/darkcloak/New() - block=SHADOWBLOCK + block=GLOB.shadowblock /datum/dna/gene/basic/stealth/darkcloak/OnMobLife(var/mob/M) var/turf/simulated/T = get_turf(M) @@ -73,7 +73,7 @@ mutation = CHAMELEON /datum/dna/gene/basic/stealth/chameleon/New() - block=CHAMELEONBLOCK + block=GLOB.chameleonblock /datum/dna/gene/basic/stealth/chameleon/OnMobLife(var/mob/M) if((world.time - M.last_movement) >= 30 && !M.stat && M.canmove && !M.restrained()) @@ -123,7 +123,7 @@ /datum/dna/gene/basic/grant_spell/cryo/New() ..() - block = CRYOBLOCK + block = GLOB.cryoblock /obj/effect/proc_holder/spell/targeted/cryokinesis name = "Cryokinesis" @@ -215,7 +215,7 @@ /datum/dna/gene/basic/grant_spell/mattereater/New() ..() - block = EATBLOCK + block = GLOB.eatblock /obj/effect/proc_holder/spell/targeted/eat name = "Eat" @@ -368,7 +368,7 @@ /datum/dna/gene/basic/grant_spell/jumpy/New() ..() - block = JUMPBLOCK + block = GLOB.jumpblock /obj/effect/proc_holder/spell/targeted/leap name = "Jump" @@ -463,7 +463,7 @@ /datum/dna/gene/basic/grant_spell/polymorph/New() ..() - block = POLYMORPHBLOCK + block = GLOB.polymorphblock /obj/effect/proc_holder/spell/targeted/polymorph name = "Polymorph" @@ -512,7 +512,7 @@ /datum/dna/gene/basic/grant_spell/empath/New() ..() - block = EMPATHBLOCK + block = GLOB.empathblock /obj/effect/proc_holder/spell/targeted/empath name = "Read Mind" diff --git a/code/game/dna/genes/monkey.dm b/code/game/dna/genes/monkey.dm index 9be8256eebe..3b6182ecf63 100644 --- a/code/game/dna/genes/monkey.dm +++ b/code/game/dna/genes/monkey.dm @@ -2,7 +2,7 @@ name="Monkey" /datum/dna/gene/monkey/New() - block=MONKEYBLOCK + block=GLOB.monkeyblock /datum/dna/gene/monkey/can_activate(var/mob/M,var/flags) return ishuman(M) diff --git a/code/game/dna/genes/powers.dm b/code/game/dna/genes/powers.dm index f8b231372dc..b0a99e05ddd 100644 --- a/code/game/dna/genes/powers.dm +++ b/code/game/dna/genes/powers.dm @@ -11,7 +11,7 @@ activation_prob=25 /datum/dna/gene/basic/nobreath/New() - block = BREATHLESSBLOCK + block = GLOB.breathlessblock /datum/dna/gene/basic/regenerate @@ -22,7 +22,7 @@ mutation=REGEN /datum/dna/gene/basic/regenerate/New() - block=REGENERATEBLOCK + block=GLOB.regenerateblock /datum/dna/gene/basic/increaserun name="Super Speed" @@ -32,7 +32,7 @@ mutation=RUN /datum/dna/gene/basic/increaserun/New() - block=INCREASERUNBLOCK + block=GLOB.increaserunblock /datum/dna/gene/basic/increaserun/can_activate(var/mob/M,var/flags) if(!..()) @@ -51,7 +51,7 @@ mutation = HEATRES /datum/dna/gene/basic/heat_resist/New() - block=COLDBLOCK + block=GLOB.coldblock /datum/dna/gene/basic/heat_resist/OnDrawUnderlays(var/mob/M,var/g,var/fat) return "cold[fat]_s" @@ -64,7 +64,7 @@ mutation = COLDRES /datum/dna/gene/basic/cold_resist/New() - block=FIREBLOCK + block=GLOB.fireblock /datum/dna/gene/basic/cold_resist/OnDrawUnderlays(var/mob/M,var/g,var/fat) return "fire[fat]_s" @@ -77,7 +77,7 @@ mutation=FINGERPRINTS /datum/dna/gene/basic/noprints/New() - block=NOPRINTSBLOCK + block=GLOB.noprintsblock /datum/dna/gene/basic/noshock name="Shock Immunity" @@ -87,7 +87,7 @@ mutation=NO_SHOCK /datum/dna/gene/basic/noshock/New() - block=SHOCKIMMUNITYBLOCK + block=GLOB.shockimmunityblock /datum/dna/gene/basic/midget name="Midget" @@ -97,7 +97,7 @@ mutation=DWARF /datum/dna/gene/basic/midget/New() - block=SMALLSIZEBLOCK + block=GLOB.smallsizeblock /datum/dna/gene/basic/midget/activate(var/mob/M, var/connected, var/flags) ..(M,connected,flags) @@ -121,7 +121,7 @@ activation_prob=15 /datum/dna/gene/basic/hulk/New() - block=HULKBLOCK + block=GLOB.hulkblock /datum/dna/gene/basic/hulk/activate(var/mob/M, var/connected, var/flags) ..() @@ -145,8 +145,8 @@ return if((HULK in M.mutations) && M.health <= 0) M.mutations.Remove(HULK) - M.dna.SetSEState(HULKBLOCK,0) - genemutcheck(M, HULKBLOCK,null,MUTCHK_FORCED) + M.dna.SetSEState(GLOB.hulkblock,0) + genemutcheck(M, GLOB.hulkblock,null,MUTCHK_FORCED) M.update_mutations() //update our mutation overlays M.update_body() M.status_flags |= CANSTUN | CANWEAKEN | CANPARALYSE | CANPUSH //temporary fix until the problem can be solved. @@ -161,7 +161,7 @@ activation_prob=15 /datum/dna/gene/basic/xray/New() - block=XRAYBLOCK + block=GLOB.xrayblock /datum/dna/gene/basic/xray/activate(mob/living/M, connected, flags) ..() @@ -182,7 +182,7 @@ activation_prob=15 /datum/dna/gene/basic/tk/New() - block=TELEBLOCK + block=GLOB.teleblock /datum/dna/gene/basic/tk/OnDrawUnderlays(var/mob/M,var/g,var/fat) return "telekinesishead[fat]_s" diff --git a/code/game/dna/genes/vg_disabilities.dm b/code/game/dna/genes/vg_disabilities.dm index 79f1ca16411..d423f0bf89b 100644 --- a/code/game/dna/genes/vg_disabilities.dm +++ b/code/game/dna/genes/vg_disabilities.dm @@ -8,7 +8,7 @@ /datum/dna/gene/disability/speech/loud/New() ..() - block=LOUDBLOCK + block=GLOB.loudblock @@ -28,7 +28,7 @@ /datum/dna/gene/disability/dizzy/New() ..() - block=DIZZYBLOCK + block=GLOB.dizzyblock /datum/dna/gene/disability/dizzy/OnMobLife(var/mob/living/carbon/human/M) diff --git a/code/game/dna/genes/vg_powers.dm b/code/game/dna/genes/vg_powers.dm index 506ef5714f8..5ed6c705a17 100644 --- a/code/game/dna/genes/vg_powers.dm +++ b/code/game/dna/genes/vg_powers.dm @@ -11,7 +11,7 @@ /datum/dna/gene/basic/grant_spell/morph/New() ..() - block = MORPHBLOCK + block = GLOB.morphblock /obj/effect/proc_holder/spell/targeted/morph name = "Morph" @@ -186,7 +186,7 @@ /datum/dna/gene/basic/grant_spell/remotetalk/New() ..() - block=REMOTETALKBLOCK + block=GLOB.remotetalkblock /datum/dna/gene/basic/grant_spell/remotetalk/activate(mob/user) ..() @@ -345,7 +345,7 @@ spelltype =/obj/effect/proc_holder/spell/targeted/remoteview /datum/dna/gene/basic/grant_spell/remoteview/New() - block=REMOTEVIEWBLOCK + block=GLOB.remoteviewblock /obj/effect/proc_holder/spell/targeted/remoteview diff --git a/code/game/gamemodes/blob/blob.dm b/code/game/gamemodes/blob/blob.dm index ab34122ba90..a11e5d922ba 100644 --- a/code/game/gamemodes/blob/blob.dm +++ b/code/game/gamemodes/blob/blob.dm @@ -1,7 +1,7 @@ //Few global vars to track the blob -var/list/blobs = list() -var/list/blob_cores = list() -var/list/blob_nodes = list() +GLOBAL_LIST_EMPTY(blobs) +GLOBAL_LIST_EMPTY(blob_cores) +GLOBAL_LIST_EMPTY(blob_nodes) /datum/game_mode var/list/blob_overminds = list() @@ -196,16 +196,16 @@ var/list/blob_nodes = list() send_intercept(1) declared = 1 if(1) - event_announcement.Announce("Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", 'sound/AI/outbreak5.ogg') + GLOB.event_announcement.Announce("Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", 'sound/AI/outbreak5.ogg') if(2) send_intercept(2) /datum/game_mode/proc/update_blob_icons_added(datum/mind/mob_mind) - var/datum/atom_hud/antag/antaghud = huds[ANTAG_HUD_BLOB] + var/datum/atom_hud/antag/antaghud = GLOB.huds[ANTAG_HUD_BLOB] antaghud.join_hud(mob_mind.current) set_antag_hud(mob_mind.current, "hudblob") /datum/game_mode/proc/update_blob_icons_removed(datum/mind/mob_mind) - var/datum/atom_hud/antag/antaghud = huds[ANTAG_HUD_BLOB] + var/datum/atom_hud/antag/antaghud = GLOB.huds[ANTAG_HUD_BLOB] antaghud.leave_hud(mob_mind.current) set_antag_hud(mob_mind.current, null) diff --git a/code/game/gamemodes/blob/blob_finish.dm b/code/game/gamemodes/blob/blob_finish.dm index 66131cfc9f9..b1ef70f6b4f 100644 --- a/code/game/gamemodes/blob/blob_finish.dm +++ b/code/game/gamemodes/blob/blob_finish.dm @@ -1,15 +1,15 @@ /datum/game_mode/blob/check_finished() if(infected_crew.len > burst)//Some blobs have yet to burst return 0 - if(blobwincount <= blobs.len)//Blob took over + if(blobwincount <= GLOB.blobs.len)//Blob took over return 1 - if(!blob_cores.len) // blob is dead + if(!GLOB.blob_cores.len) // blob is dead return 1 return ..() /datum/game_mode/blob/declare_completion() - if(blobwincount <= blobs.len) + if(blobwincount <= GLOB.blobs.len) feedback_set_details("round_end_result","blob win - blob took over") to_chat(world, "The blob has taken over the station!") to_chat(world, "The entire station was eaten by the Blob") @@ -21,7 +21,7 @@ to_chat(world, "Directive 7-12 has been successfully carried out preventing the Blob from spreading.") log_game("Blob mode completed with a tie (station destroyed).") - else if(!blob_cores.len) + else if(!GLOB.blob_cores.len) feedback_set_details("round_end_result","blob loss - blob eliminated") to_chat(world, "The staff has won!") to_chat(world, "The alien organism has been eradicated from the station") diff --git a/code/game/gamemodes/blob/blob_report.dm b/code/game/gamemodes/blob/blob_report.dm index 4f667c51d61..893c2e0e8ac 100644 --- a/code/game/gamemodes/blob/blob_report.dm +++ b/code/game/gamemodes/blob/blob_report.dm @@ -42,7 +42,7 @@ to_chat(aiPlayer, "Laws Updated: [law]") print_command_report(intercepttext, interceptname) - event_announcement.Announce("A report has been downloaded and printed out at all communications consoles.", "Incoming Classified Message", 'sound/AI/commandreport.ogg', from = "[command_name()] Update") + GLOB.event_announcement.Announce("A report has been downloaded and printed out at all communications consoles.", "Incoming Classified Message", 'sound/AI/commandreport.ogg', from = "[command_name()] Update") /datum/station_state var/floor = 0 diff --git a/code/game/gamemodes/blob/blobs/core.dm b/code/game/gamemodes/blob/blobs/core.dm index 8c3af0be2ca..672ab037cc5 100644 --- a/code/game/gamemodes/blob/blobs/core.dm +++ b/code/game/gamemodes/blob/blobs/core.dm @@ -13,7 +13,7 @@ var/selecting = 0 /obj/structure/blob/core/New(loc, var/h = 200, var/client/new_overmind = null, var/new_rate = 2, offspring) - blob_cores += src + GLOB.blob_cores += src START_PROCESSING(SSobj, src) GLOB.poi_list |= src adjustcolors(color) //so it atleast appears @@ -38,7 +38,7 @@ /obj/structure/blob/core/Destroy() - blob_cores -= src + GLOB.blob_cores -= src if(overmind) overmind.blob_core = null overmind = null @@ -75,7 +75,7 @@ else for(var/i = 1; i < 8; i += i) Pulse(0, i, color) - for(var/b_dir in alldirs) + for(var/b_dir in GLOB.alldirs) if(!prob(5)) continue var/obj/structure/blob/normal/B = locate() in get_step(src, b_dir) diff --git a/code/game/gamemodes/blob/blobs/node.dm b/code/game/gamemodes/blob/blobs/node.dm index b84e0a7a84c..d8fe4943586 100644 --- a/code/game/gamemodes/blob/blobs/node.dm +++ b/code/game/gamemodes/blob/blobs/node.dm @@ -7,7 +7,7 @@ point_return = 18 /obj/structure/blob/node/New(loc, var/h = 100) - blob_nodes += src + GLOB.blob_nodes += src START_PROCESSING(SSobj, src) ..(loc, h) @@ -21,7 +21,7 @@ src.overlays += C /obj/structure/blob/node/Destroy() - blob_nodes -= src + GLOB.blob_nodes -= src STOP_PROCESSING(SSobj, src) return ..() diff --git a/code/game/gamemodes/blob/powers.dm b/code/game/gamemodes/blob/powers.dm index 548f2759ba0..bdbd875a3dc 100644 --- a/code/game/gamemodes/blob/powers.dm +++ b/code/game/gamemodes/blob/powers.dm @@ -22,10 +22,10 @@ set name = "Jump to Node" set desc = "Transport back to a selected node." - if(blob_nodes.len) + if(GLOB.blob_nodes.len) var/list/nodes = list() - for(var/i = 1; i <= blob_nodes.len; i++) - var/obj/structure/blob/node/B = blob_nodes[i] + for(var/i = 1; i <= GLOB.blob_nodes.len; i++) + var/obj/structure/blob/node/B = GLOB.blob_nodes[i] nodes["Blob Node #[i] ([get_location_name(B)])"] = B var/node_name = input(src, "Choose a node to jump to.", "Node Jump") in nodes var/obj/structure/blob/node/chosen_node = nodes[node_name] @@ -463,7 +463,7 @@ color = blob_reagent_datum.complementary_color - for(var/obj/structure/blob/BL in blobs) + for(var/obj/structure/blob/BL in GLOB.blobs) BL.adjustcolors(blob_reagent_datum.color) for(var/mob/living/simple_animal/hostile/blob/BLO) diff --git a/code/game/gamemodes/blob/theblob.dm b/code/game/gamemodes/blob/theblob.dm index b97c8311507..6293fd919c5 100644 --- a/code/game/gamemodes/blob/theblob.dm +++ b/code/game/gamemodes/blob/theblob.dm @@ -18,8 +18,8 @@ /obj/structure/blob/New(loc) ..() - blobs += src - setDir(pick(cardinal)) + GLOB.blobs += src + setDir(pick(GLOB.cardinal)) update_icon() if(atmosblock) air_update_turf(1) @@ -29,7 +29,7 @@ if(atmosblock) atmosblock = FALSE air_update_turf(1) - blobs -= src + GLOB.blobs -= src if(isturf(loc)) //Necessary because Expand() is retarded and spawns a blob and then deletes it playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) return ..() diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index afad318a517..91dd553fe0d 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -2,7 +2,7 @@ #define LING_DEAD_GENETICDAMAGE_HEAL_CAP 50 //The lowest value of geneticdamage handle_changeling() can take it to while dead. #define LING_ABSORB_RECENT_SPEECH 8 //The amount of recent spoken lines to gain on absorbing a mob -var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon","Zeta","Eta","Theta","Iota","Kappa","Lambda","Mu","Nu","Xi","Omicron","Pi","Rho","Sigma","Tau","Upsilon","Phi","Chi","Psi","Omega") +GLOBAL_LIST_INIT(possible_changeling_IDs, list("Alpha","Beta","Gamma","Delta","Epsilon","Zeta","Eta","Theta","Iota","Kappa","Lambda","Mu","Nu","Xi","Omicron","Pi","Rho","Sigma","Tau","Upsilon","Phi","Chi","Psi","Omega")) /datum/game_mode var/list/datum/mind/changelings = list() @@ -162,12 +162,12 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon" update_change_icons_removed(changeling_mind) /datum/game_mode/proc/update_change_icons_added(datum/mind/changeling) - var/datum/atom_hud/antag/linghud = huds[ANTAG_HUD_CHANGELING] + var/datum/atom_hud/antag/linghud = GLOB.huds[ANTAG_HUD_CHANGELING] linghud.join_hud(changeling.current) set_antag_hud(changeling.current, "hudchangeling") /datum/game_mode/proc/update_change_icons_removed(datum/mind/changeling) - var/datum/atom_hud/antag/linghud = huds[ANTAG_HUD_CHANGELING] + var/datum/atom_hud/antag/linghud = GLOB.huds[ANTAG_HUD_CHANGELING] linghud.leave_hud(changeling.current) set_antag_hud(changeling.current, null) @@ -253,9 +253,9 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon" honorific = "Ms." else honorific = "Mr." - if(possible_changeling_IDs.len) - changelingID = pick(possible_changeling_IDs) - possible_changeling_IDs -= changelingID + if(GLOB.possible_changeling_IDs.len) + changelingID = pick(GLOB.possible_changeling_IDs) + GLOB.possible_changeling_IDs -= changelingID changelingID = "[honorific] [changelingID]" else changelingID = "[honorific] [rand(1,999)]" diff --git a/code/game/gamemodes/changeling/evolution_menu.dm b/code/game/gamemodes/changeling/evolution_menu.dm index b6a0213f82f..d2b1cdae519 100644 --- a/code/game/gamemodes/changeling/evolution_menu.dm +++ b/code/game/gamemodes/changeling/evolution_menu.dm @@ -1,4 +1,4 @@ -var/list/sting_paths +GLOBAL_LIST_EMPTY(sting_paths) // totally stolen from the new player panel. YAYY /datum/action/changeling/evolution_menu @@ -12,8 +12,8 @@ var/list/sting_paths return var/datum/changeling/changeling = usr.mind.changeling - if(!sting_paths) - sting_paths = init_subtypes(/datum/action/changeling) + if(!GLOB.sting_paths) + GLOB.sting_paths = init_subtypes(/datum/action/changeling) var/dat = create_menu(changeling) usr << browse(dat, "window=powers;size=600x700")//900x480 @@ -230,7 +230,7 @@ var/list/sting_paths "} var/i = 1 - for(var/datum/action/changeling/cling_power in sting_paths) + for(var/datum/action/changeling/cling_power in GLOB.sting_paths) if(cling_power.dna_cost <= 0) //Let's skip the crap we start with. Keeps the evolution menu uncluttered. continue diff --git a/code/game/gamemodes/changeling/powers/chameleon_skin.dm b/code/game/gamemodes/changeling/powers/chameleon_skin.dm index 7de16801153..4b53e5ce082 100644 --- a/code/game/gamemodes/changeling/powers/chameleon_skin.dm +++ b/code/game/gamemodes/changeling/powers/chameleon_skin.dm @@ -11,19 +11,19 @@ var/mob/living/carbon/human/H = user //SHOULD always be human, because req_human = 1 if(!istype(H)) // req_human could be done in can_sting stuff. return - if(H.dna.GetSEState(CHAMELEONBLOCK)) - H.dna.SetSEState(CHAMELEONBLOCK, 0) - genemutcheck(H, CHAMELEONBLOCK, null, MUTCHK_FORCED) + if(H.dna.GetSEState(GLOB.chameleonblock)) + H.dna.SetSEState(GLOB.chameleonblock, 0) + genemutcheck(H, GLOB.chameleonblock, null, MUTCHK_FORCED) else - H.dna.SetSEState(CHAMELEONBLOCK, 1) - genemutcheck(H, CHAMELEONBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.chameleonblock, 1) + genemutcheck(H, GLOB.chameleonblock, null, MUTCHK_FORCED) feedback_add_details("changeling_powers","CS") return TRUE /datum/action/changeling/chameleon_skin/Remove(mob/user) var/mob/living/carbon/C = user - if(C.dna.GetSEState(CHAMELEONBLOCK)) - C.dna.SetSEState(CHAMELEONBLOCK, 0) - genemutcheck(C, CHAMELEONBLOCK, null, MUTCHK_FORCED) + if(C.dna.GetSEState(GLOB.chameleonblock)) + C.dna.SetSEState(GLOB.chameleonblock, 0) + genemutcheck(C, GLOB.chameleonblock, null, MUTCHK_FORCED) ..() diff --git a/code/game/gamemodes/changeling/powers/humanform.dm b/code/game/gamemodes/changeling/powers/humanform.dm index f9b214c513c..1f90f7eb702 100644 --- a/code/game/gamemodes/changeling/powers/humanform.dm +++ b/code/game/gamemodes/changeling/powers/humanform.dm @@ -24,8 +24,8 @@ if(!user) return 0 to_chat(user, "We transform our appearance.") - user.dna.SetSEState(MONKEYBLOCK,0,1) - genemutcheck(user,MONKEYBLOCK,null,MUTCHK_FORCED) + user.dna.SetSEState(GLOB.monkeyblock,0,1) + genemutcheck(user,GLOB.monkeyblock,null,MUTCHK_FORCED) if(istype(user)) user.set_species(chosen_dna.species.type) user.dna = chosen_dna.Clone() diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index 2a42d531f0f..ffe67595f11 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -1,4 +1,4 @@ -var/global/list/all_cults = list() +GLOBAL_LIST_EMPTY(all_cults) /datum/game_mode var/list/datum/mind/cult = list() @@ -110,11 +110,11 @@ var/global/list/all_cults = list() modePlayer += cult acolytes_needed = acolytes_needed + round((num_players_started() / 10)) - if(!summon_spots.len) - while(summon_spots.len < SUMMON_POSSIBILITIES) - var/area/summon = pick(return_sorted_areas() - summon_spots) + if(!GLOB.summon_spots.len) + while(GLOB.summon_spots.len < SUMMON_POSSIBILITIES) + var/area/summon = pick(return_sorted_areas() - GLOB.summon_spots) if(summon && is_station_level(summon.z) && summon.valid_territory) - summon_spots += summon + GLOB.summon_spots += summon for(var/datum/mind/cult_mind in cult) SEND_SOUND(cult_mind.current, 'sound/ambience/antag/bloodcult.ogg') @@ -146,7 +146,7 @@ var/global/list/all_cults = list() else explanation = "Free objective." if("eldergod") - explanation = "Summon [SSticker.cultdat.entity_name] by invoking the 'Tear Reality' rune.The summoning can only be accomplished in [english_list(summon_spots)] - where the veil is weak enough for the ritual to begin." + explanation = "Summon [SSticker.cultdat.entity_name] by invoking the 'Tear Reality' rune.The summoning can only be accomplished in [english_list(GLOB.summon_spots)] - where the veil is weak enough for the ritual to begin." to_chat(cult_mind.current, "Objective #[obj_count]: [explanation]") cult_mind.memory += "Objective #[obj_count]: [explanation]
" @@ -213,13 +213,13 @@ var/global/list/all_cults = list() /datum/game_mode/proc/update_cult_icons_added(datum/mind/cult_mind) - var/datum/atom_hud/antag/culthud = huds[ANTAG_HUD_CULT] + var/datum/atom_hud/antag/culthud = GLOB.huds[ANTAG_HUD_CULT] culthud.join_hud(cult_mind.current) set_antag_hud(cult_mind.current, "hudcultist") /datum/game_mode/proc/update_cult_icons_removed(datum/mind/cult_mind) - var/datum/atom_hud/antag/culthud = huds[ANTAG_HUD_CULT] + var/datum/atom_hud/antag/culthud = GLOB.huds[ANTAG_HUD_CULT] culthud.leave_hud(cult_mind.current) set_antag_hud(cult_mind.current, null) @@ -262,7 +262,7 @@ var/global/list/all_cults = list() for(var/datum/mind/cult_mind in cult) if(cult_mind.current && cult_mind.current.stat!=2) var/area/A = get_area(cult_mind.current ) - if( is_type_in_list(A, centcom_areas)) + if( is_type_in_list(A, GLOB.centcom_areas)) acolytes_survived++ else if(A == SSshuttle.emergency.areaInstance && SSshuttle.emergency.mode >= SHUTTLE_ESCAPE) //snowflaked into objectives because shitty bay shuttles had areas to auto-determine this acolytes_survived++ diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index f9ee181356d..c0daac2a01a 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -269,7 +269,7 @@ "The shuttle dispatcher was found dead with bloody symbols carved into their flesh. The shuttle will be delayed by two minutes.", "Steve repeatedly touched a lightbulb until his hands fell off. The shuttle will be delayed by two minutes.") var/message = pick(curses) - command_announcement.Announce("[message]", "System Failure", 'sound/misc/notice1.ogg') + GLOB.command_announcement.Announce("[message]", "System Failure", 'sound/misc/notice1.ogg') /obj/item/cult_shift name = "veil shifter" @@ -298,7 +298,7 @@ return if(!iscultist(user)) user.unEquip(src, 1) - step(src, pick(alldirs)) + step(src, pick(GLOB.alldirs)) to_chat(user, "\The [src] flickers out of your hands, too eager to move!") return diff --git a/code/game/gamemodes/cult/cult_objectives.dm b/code/game/gamemodes/cult/cult_objectives.dm index caf607ce010..80b889a5bfb 100644 --- a/code/game/gamemodes/cult/cult_objectives.dm +++ b/code/game/gamemodes/cult/cult_objectives.dm @@ -114,10 +114,10 @@ if(prob(40))//split the chance of this objectives += "eldergod" - explanation = "Summon [SSticker.cultdat.entity_name] on the Station via the use of the Tear Reality rune. The veil is weak enough in [english_list(summon_spots)] for the ritual to begin." + explanation = "Summon [SSticker.cultdat.entity_name] on the Station via the use of the Tear Reality rune. The veil is weak enough in [english_list(GLOB.summon_spots)] for the ritual to begin." else objectives += "slaughter" - explanation = "Bring the Slaughter via the rune 'Bring forth the slaughter'. The veil is weak enough in [english_list(summon_spots)] for the ritual to begin." + explanation = "Bring the Slaughter via the rune 'Bring forth the slaughter'. The veil is weak enough in [english_list(GLOB.summon_spots)] for the ritual to begin." for(var/datum/mind/cult_mind in cult) if(cult_mind) @@ -174,7 +174,7 @@ updated_memory = replacetext("[cult_mind.memory]", "[previous_target]", "[sacrifice_target]") updated_memory = replacetext("[updated_memory]", "[previous_role]", "[sacrifice_target.assigned_role]") cult_mind.memory = updated_memory - + /datum/game_mode/cult/proc/pick_objective() var/list/possible_objectives = list() @@ -254,7 +254,7 @@ for(var/mob/living/L in GLOB.player_list) if(L.stat != DEAD && !(L.mind in cult)) var/area/A = get_area(L) - if(is_type_in_list(A.loc, centcom_areas)) + if(is_type_in_list(A.loc, GLOB.centcom_areas)) escaped_shuttle++ if(!escaped_shuttle) bonus = 1 diff --git a/code/game/gamemodes/cult/cult_structures.dm b/code/game/gamemodes/cult/cult_structures.dm index de8846d292e..618abec4470 100644 --- a/code/game/gamemodes/cult/cult_structures.dm +++ b/code/game/gamemodes/cult/cult_structures.dm @@ -152,7 +152,7 @@ return 1 return ..() -var/list/blacklisted_pylon_turfs = typecacheof(list( +GLOBAL_LIST_INIT(blacklisted_pylon_turfs, typecacheof(list( /turf/simulated/floor/engine/cult, /turf/space, /turf/simulated/floor/plating/lava, @@ -160,7 +160,7 @@ var/list/blacklisted_pylon_turfs = typecacheof(list( /turf/simulated/wall/cult, /turf/simulated/wall/cult/artificer, /turf/unsimulated/wall - )) + ))) /obj/structure/cult/functional/pylon name = "pylon" @@ -214,7 +214,7 @@ var/list/blacklisted_pylon_turfs = typecacheof(list( if(istype(T, /turf/simulated/floor/engine/cult)) cultturfs |= T continue - if(is_type_in_typecache(T, blacklisted_pylon_turfs)) + if(is_type_in_typecache(T, GLOB.blacklisted_pylon_turfs)) continue else validturfs |= T diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index 445050529af..9422ffcc716 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -217,8 +217,8 @@ if(!((CULT_ELDERGOD in cult_mode.objectives) || (CULT_SLAUGHTER in cult_mode.objectives))) to_chat(user, "[SSticker.cultdat.entity_name]'s power does not wish to be unleashed!") return 0 - if(!(A in summon_spots)) - to_chat(user, "[SSticker.cultdat.entity_name] can only be summoned where the veil is weak - in [english_list(summon_spots)]!") + if(!(A in GLOB.summon_spots)) + to_chat(user, "[SSticker.cultdat.entity_name] can only be summoned where the veil is weak - in [english_list(GLOB.summon_spots)]!") return 0 var/confirm_final = alert(user, "This is the FINAL step to summon your deities power, it is a long, painful ritual and the crew will be alerted to your presence", "Are you prepared for the final battle?", "My life for [SSticker.cultdat.entity_name]!", "No") if(confirm_final == "No" || confirm_final == null) @@ -278,10 +278,10 @@ if(ispath(rune_to_scribe, /obj/effect/rune/narsie) || ispath(rune_to_scribe, /obj/effect/rune/slaughter))//may need to change this - Fethas if(finale_runes_ok(user,rune_to_scribe)) A = get_area(src) - if(!(A in summon_spots)) // Check again to make sure they didn't move - to_chat(user, "The ritual can only begin where the veil is weak - in [english_list(summon_spots)]!") + if(!(A in GLOB.summon_spots)) // Check again to make sure they didn't move + to_chat(user, "The ritual can only begin where the veil is weak - in [english_list(GLOB.summon_spots)]!") return - command_announcement.Announce("Figments from an eldritch god are being summoned somewhere on the station from an unknown dimension. Disrupt the ritual at all costs!","Central Command Higher Dimensional Affairs", 'sound/AI/spanomalies.ogg') + GLOB.command_announcement.Announce("Figments from an eldritch god are being summoned somewhere on the station from an unknown dimension. Disrupt the ritual at all costs!","Central Command Higher Dimensional Affairs", 'sound/AI/spanomalies.ogg') for(var/B in spiral_range_turfs(1, user, 1)) var/turf/T = B var/obj/machinery/shield/N = new(T) diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index d918bead0de..290d873bcf3 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -1,5 +1,5 @@ -var/list/sacrificed = list() -var/list/non_revealed_runes = (subtypesof(/obj/effect/rune) - /obj/effect/rune/malformed) +GLOBAL_LIST_EMPTY(sacrificed) +GLOBAL_LIST_INIT(non_revealed_runes, (subtypesof(/obj/effect/rune) - /obj/effect/rune/malformed)) /* This file contains runes. @@ -255,7 +255,7 @@ structure_check() searches for nearby cultist structures required for the invoca qdel(paper_to_imbue) rune_in_use = 0 -var/list/teleport_runes = list() +GLOBAL_LIST_EMPTY(teleport_runes) /obj/effect/rune/teleport cultist_name = "Teleport" cultist_desc = "warps everything above it to another chosen teleport rune." @@ -270,10 +270,10 @@ var/list/teleport_runes = list() var/area/A = get_area(src) var/locname = initial(A.name) listkey = set_keyword ? "[set_keyword] [locname]":"[locname]" - teleport_runes += src + GLOB.teleport_runes += src /obj/effect/rune/teleport/Destroy() - teleport_runes -= src + GLOB.teleport_runes -= src return ..() /obj/effect/rune/teleport/invoke(var/list/invokers) @@ -281,7 +281,7 @@ var/list/teleport_runes = list() var/list/potential_runes = list() var/list/teleportnames = list() var/list/duplicaterunecount = list() - for(var/R in teleport_runes) + for(var/R in GLOB.teleport_runes) var/obj/effect/rune/teleport/T = R var/resultkey = T.listkey if(resultkey in teleportnames) @@ -349,7 +349,7 @@ var/list/teleport_runes = list() req_cultists = 1 allow_excess_invokers = TRUE rune_in_use = FALSE - + /obj/effect/rune/convert/do_invoke_glow() return @@ -410,7 +410,7 @@ var/list/teleport_runes = list() var/sacrifice_fulfilled var/datum/game_mode/cult/cult_mode = SSticker.mode if(offering.mind) - sacrificed.Add(offering.mind) + GLOB.sacrificed.Add(offering.mind) if(is_sacrifice_target(offering.mind)) sacrifice_fulfilled = TRUE new /obj/effect/temp_visual/cult/sac(loc) diff --git a/code/game/gamemodes/cult/talisman.dm b/code/game/gamemodes/cult/talisman.dm index c0c4f7280f5..e7fb06c1b94 100644 --- a/code/game/gamemodes/cult/talisman.dm +++ b/code/game/gamemodes/cult/talisman.dm @@ -132,7 +132,7 @@ var/list/potential_runes = list() var/list/teleportnames = list() var/list/duplicaterunecount = list() - for(var/R in teleport_runes) + for(var/R in GLOB.teleport_runes) var/obj/effect/rune/teleport/T = R var/resultkey = T.listkey if(resultkey in teleportnames) diff --git a/code/game/gamemodes/devil/devilinfo.dm b/code/game/gamemodes/devil/devilinfo.dm index abd90172ee9..ecbeb54f7f7 100644 --- a/code/game/gamemodes/devil/devilinfo.dm +++ b/code/game/gamemodes/devil/devilinfo.dm @@ -13,8 +13,8 @@ #define DEVILRESURRECTTIME 600 -var/global/list/allDevils = list() -var/global/list/lawlorify = list ( +GLOBAL_LIST_EMPTY(allDevils) +GLOBAL_LIST_INIT(lawlorify, list ( LORE = list( OBLIGATION_FOOD = "This devil seems to always offer it's victims food before slaughtering them.", OBLIGATION_FIDDLE = "This devil will never turn down a musical challenge.", @@ -77,7 +77,7 @@ var/global/list/lawlorify = list ( BANISH_DESTRUCTION = "If your corpse is destroyed, you will be unable to resurrect.", BANISH_FUNERAL_GARB = "If your corpse is clad in funeral garments, you will be unable to resurrect." ) - ) + )) /datum/devilinfo var/datum/mind/owner = null @@ -111,11 +111,11 @@ var/global/list/lawlorify = list ( return devil /proc/devilInfo(name, saveDetails = 0) - if(allDevils[lowertext(name)]) - return allDevils[lowertext(name)] + if(GLOB.allDevils[lowertext(name)]) + return GLOB.allDevils[lowertext(name)] else var/datum/devilinfo/devil = randomDevilInfo(name) - allDevils[lowertext(name)] = devil + GLOB.allDevils[lowertext(name)] = devil devil.exists = saveDetails return devil @@ -444,9 +444,9 @@ var/global/list/lawlorify = list ( D.oldform.revive() // Heal the old body too, so the devil doesn't resurrect, then immediately regress into a dead body. if(body.stat == DEAD) // Not sure why this would happen create_new_body() - else if(blobstart.len > 0) + else if(GLOB.blobstart.len > 0) // teleport the body so repeated beatdowns aren't an option) - body.forceMove(get_turf(pick(blobstart))) + body.forceMove(get_turf(pick(GLOB.blobstart))) // give them the devil lawyer outfit in case they got stripped if(ishuman(body)) var/mob/living/carbon/human/H = body @@ -456,8 +456,8 @@ var/global/list/lawlorify = list ( check_regression() /datum/devilinfo/proc/create_new_body() - if(blobstart.len > 0) - var/turf/targetturf = get_turf(pick(blobstart)) + if(GLOB.blobstart.len > 0) + var/turf/targetturf = get_turf(pick(GLOB.blobstart)) var/mob/currentMob = owner.current if(QDELETED(currentMob)) currentMob = owner.get_ghost() @@ -511,10 +511,10 @@ var/global/list/lawlorify = list ( to_chat(owner, "However, your infernal form is not without weaknesses.") to_chat(owner, "You may not use violence to coerce someone into selling their soul.") to_chat(owner, "You may not directly and knowingly physically harm a devil, other than yourself.") - to_chat(owner,lawlorify[LAW][bane]) - to_chat(owner,lawlorify[LAW][ban]) - to_chat(owner,lawlorify[LAW][obligation]) - to_chat(owner,lawlorify[LAW][banish]) + to_chat(owner,GLOB.lawlorify[LAW][bane]) + to_chat(owner,GLOB.lawlorify[LAW][ban]) + to_chat(owner,GLOB.lawlorify[LAW][obligation]) + to_chat(owner,GLOB.lawlorify[LAW][banish]) to_chat(owner, "

Remember, the crew can research your weaknesses if they find out your devil name.
") diff --git a/code/game/gamemodes/devil/game_mode.dm b/code/game/gamemodes/devil/game_mode.dm index f8b980f2dfd..dd67ccc0349 100644 --- a/code/game/gamemodes/devil/game_mode.dm +++ b/code/game/gamemodes/devil/game_mode.dm @@ -34,7 +34,7 @@ var/trueName= randomDevilName() devil_mind.devilinfo = devilInfo(trueName, 1) devil_mind.devilinfo.ascendable = ascendable - devil_mind.store_memory("Your diabolical true name is [devil_mind.devilinfo.truename]
[lawlorify[LAW][devil_mind.devilinfo.ban]]
You may not use violence to coerce someone into selling their soul.
You may not directly and knowingly physically harm a devil, other than yourself.
[lawlorify[LAW][devil_mind.devilinfo.bane]]
[lawlorify[LAW][devil_mind.devilinfo.obligation]]
[lawlorify[LAW][devil_mind.devilinfo.banish]]
") + devil_mind.store_memory("Your diabolical true name is [devil_mind.devilinfo.truename]
[GLOB.lawlorify[LAW][devil_mind.devilinfo.ban]]
You may not use violence to coerce someone into selling their soul.
You may not directly and knowingly physically harm a devil, other than yourself.
[GLOB.lawlorify[LAW][devil_mind.devilinfo.bane]]
[GLOB.lawlorify[LAW][devil_mind.devilinfo.obligation]]
[GLOB.lawlorify[LAW][devil_mind.devilinfo.banish]]
") devil_mind.devilinfo.link_with_mob(devil_mind.current) if(devil_mind.assigned_role == "Clown") to_chat(devil_mind.current, "Your infernal nature allows you to wield weapons without harming yourself.") @@ -47,8 +47,8 @@ var/mob/living/silicon/S = devil_mind.current S.laws.set_sixsixsix_law("You may not use violence to coerce someone into selling their soul.") S.laws.set_sixsixsix_law("You may not directly and knowingly physically harm a devil, other than yourself.") - S.laws.set_sixsixsix_law("[lawlorify[LAW][devil_mind.devilinfo.ban]]") - S.laws.set_sixsixsix_law("[lawlorify[LAW][devil_mind.devilinfo.obligation]]") + S.laws.set_sixsixsix_law("[GLOB.lawlorify[LAW][devil_mind.devilinfo.ban]]") + S.laws.set_sixsixsix_law("[GLOB.lawlorify[LAW][devil_mind.devilinfo.obligation]]") S.laws.set_sixsixsix_law("Accomplish your objectives at all costs.") // unsure about the second "quantity" arg and how it fits with the antag refactor @@ -76,18 +76,18 @@ return "Target is not a devil." var/text = "
The devil's true name is: [ply.devilinfo.truename]
" text += "The devil's bans were:
" - text += " [lawlorify[LORE][ply.devilinfo.ban]]
" - text += " [lawlorify[LORE][ply.devilinfo.bane]]
" - text += " [lawlorify[LORE][ply.devilinfo.obligation]]
" - text += " [lawlorify[LORE][ply.devilinfo.banish]]

" + text += " [GLOB.lawlorify[LORE][ply.devilinfo.ban]]
" + text += " [GLOB.lawlorify[LORE][ply.devilinfo.bane]]
" + text += " [GLOB.lawlorify[LORE][ply.devilinfo.obligation]]
" + text += " [GLOB.lawlorify[LORE][ply.devilinfo.banish]]

" return text /datum/game_mode/proc/update_devil_icons_added(datum/mind/devil_mind) - var/datum/atom_hud/antag/hud = huds[ANTAG_HUD_DEVIL] + var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_DEVIL] hud.join_hud(devil_mind.current) set_antag_hud(devil_mind.current, "huddevil") /datum/game_mode/proc/update_devil_icons_removed(datum/mind/devil_mind) - var/datum/atom_hud/antag/hud = huds[ANTAG_HUD_DEVIL] + var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_DEVIL] hud.leave_hud(devil_mind.current) set_antag_hud(devil_mind.current, null) diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 258d6ea20c6..0981ec72a51 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -80,8 +80,8 @@ // feedback_set_details("revision","[revdata.revision]") feedback_set_details("server_ip","[world.internet_address]:[world.port]") generate_station_goals() - start_state = new /datum/station_state() - start_state.count() + GLOB.start_state = new /datum/station_state() + GLOB.start_state.count() return 1 ///process() @@ -92,15 +92,15 @@ //Called by the gameticker /datum/game_mode/proc/process_job_tasks() var/obj/machinery/message_server/useMS = null - if(message_servers) - for(var/obj/machinery/message_server/MS in message_servers) + if(GLOB.message_servers) + for(var/obj/machinery/message_server/MS in GLOB.message_servers) if(MS.active) useMS = MS break for(var/mob/M in GLOB.player_list) if(M.mind) var/obj/item/pda/P=null - for(var/obj/item/pda/check_pda in PDAs) + for(var/obj/item/pda/check_pda in GLOB.PDAs) if(check_pda.owner==M.name) P=check_pda break @@ -292,7 +292,7 @@ /datum/game_mode/proc/get_living_heads() . = list() for(var/mob/living/carbon/human/player in GLOB.mob_list) - var/list/real_command_positions = command_positions.Copy() - "Nanotrasen Representative" + var/list/real_command_positions = GLOB.command_positions.Copy() - "Nanotrasen Representative" if(player.stat != DEAD && player.mind && (player.mind.assigned_role in real_command_positions)) . |= player.mind @@ -303,7 +303,7 @@ /datum/game_mode/proc/get_all_heads() . = list() for(var/mob/player in GLOB.mob_list) - var/list/real_command_positions = command_positions.Copy() - "Nanotrasen Representative" + var/list/real_command_positions = GLOB.command_positions.Copy() - "Nanotrasen Representative" if(player.mind && (player.mind.assigned_role in real_command_positions)) . |= player.mind @@ -313,7 +313,7 @@ /datum/game_mode/proc/get_living_sec() . = list() for(var/mob/living/carbon/human/player in GLOB.mob_list) - if(player.stat != DEAD && player.mind && (player.mind.assigned_role in security_positions)) + if(player.stat != DEAD && player.mind && (player.mind.assigned_role in GLOB.security_positions)) . |= player.mind //////////////////////////////////////// @@ -322,14 +322,14 @@ /datum/game_mode/proc/get_all_sec() . = list() for(var/mob/living/carbon/human/player in GLOB.mob_list) - if(player.mind && (player.mind.assigned_role in security_positions)) + if(player.mind && (player.mind.assigned_role in GLOB.security_positions)) . |= player.mind /datum/game_mode/proc/check_antagonists_topic(href, href_list[]) return 0 /datum/game_mode/New() - newscaster_announcements = pick(newscaster_standard_feeds) + newscaster_announcements = pick(GLOB.newscaster_standard_feeds) ////////////////////////// //Reports player logouts// @@ -512,11 +512,11 @@ proc/display_roundstart_logout_report() G.print_result() /datum/game_mode/proc/update_eventmisc_icons_added(datum/mind/mob_mind) - var/datum/atom_hud/antag/antaghud = huds[ANTAG_HUD_EVENTMISC] + var/datum/atom_hud/antag/antaghud = GLOB.huds[ANTAG_HUD_EVENTMISC] antaghud.join_hud(mob_mind.current) set_antag_hud(mob_mind.current, "hudevent") /datum/game_mode/proc/update_eventmisc_icons_removed(datum/mind/mob_mind) - var/datum/atom_hud/antag/antaghud = huds[ANTAG_HUD_EVENTMISC] + var/datum/atom_hud/antag/antaghud = GLOB.huds[ANTAG_HUD_EVENTMISC] antaghud.leave_hud(mob_mind.current) set_antag_hud(mob_mind.current, null) diff --git a/code/game/gamemodes/heist/heist.dm b/code/game/gamemodes/heist/heist.dm index 2b4d095b327..142ae33c078 100644 --- a/code/game/gamemodes/heist/heist.dm +++ b/code/game/gamemodes/heist/heist.dm @@ -1,9 +1,8 @@ /* VOX HEIST ROUNDTYPE */ - -var/global/list/raider_spawn = list() -var/global/list/obj/cortical_stacks = list() //Stacks for 'leave nobody behind' objective. Clumsy, rewrite sometime. +GLOBAL_LIST_EMPTY(raider_spawn) +GLOBAL_LIST_EMPTY(cortical_stacks) //Stacks for 'leave nobody behind' objective. Clumsy, rewrite sometime. /datum/game_mode/ var/list/datum/mind/raiders = list() //Antags. @@ -70,10 +69,10 @@ var/global/list/obj/cortical_stacks = list() //Stacks for 'leave nobody behind' //Spawn the vox! for(var/datum/mind/raider in raiders) - if(index > raider_spawn.len) + if(index > GLOB.raider_spawn.len) index = 1 - raider.current.loc = raider_spawn[index] + raider.current.loc = GLOB.raider_spawn[index] index++ create_vox(raider) @@ -128,16 +127,16 @@ var/global/list/obj/cortical_stacks = list() //Stacks for 'leave nobody behind' //Now apply cortical stack. var/obj/item/implant/cortical/I = new(vox) I.implant(vox) - cortical_stacks += I + GLOB.cortical_stacks += I vox.equip_vox_raider() vox.regenerate_icons() /datum/game_mode/proc/is_raider_crew_safe() - if(cortical_stacks.len == 0) + if(GLOB.cortical_stacks.len == 0) return 0 - for(var/obj/stack in cortical_stacks) + for(var/obj/stack in GLOB.cortical_stacks) if(get_area(stack) != locate(/area/shuttle/vox) && get_area(stack) != locate(/area/vox_station)) return 0 //this is stupid as fuck return 1 diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm index 9ca0025a0ab..ad15da69412 100644 --- a/code/game/gamemodes/malfunction/Malf_Modules.dm +++ b/code/game/gamemodes/malfunction/Malf_Modules.dm @@ -224,14 +224,14 @@ /datum/action/innate/ai/nuke_station/proc/set_us_up_the_bomb() to_chat(owner_AI, "Nuclear device armed.") - event_announcement.Announce("Hostile runtimes detected in all station systems, please deactivate your AI to prevent possible damage to its morality core.", "Anomaly Alert", new_sound = 'sound/AI/aimalf.ogg') + GLOB.event_announcement.Announce("Hostile runtimes detected in all station systems, please deactivate your AI to prevent possible damage to its morality core.", "Anomaly Alert", new_sound = 'sound/AI/aimalf.ogg') set_security_level("delta") owner_AI.nuking = TRUE var/obj/machinery/doomsday_device/DOOM = new /obj/machinery/doomsday_device(owner_AI) owner_AI.doomsday_device = DOOM owner_AI.doomsday_device.start() for(var/obj/item/pinpointer/point in GLOB.pinpointer_list) - for(var/mob/living/silicon/ai/A in ai_list) + for(var/mob/living/silicon/ai/A in GLOB.ai_list) if((A.stat != DEAD) && A.nuking) point.the_disk = A //The pinpointer now tracks the AI core qdel(src) @@ -256,7 +256,7 @@ if(SSshuttle.emergency.mode == SHUTTLE_STRANDED) SSshuttle.emergency.mode = SHUTTLE_DOCKED SSshuttle.emergency.timer = world.time - priority_announcement.Announce("Hostile environment resolved. You have 3 minutes to board the Emergency Shuttle.", "Priority Announcement", 'sound/AI/shuttledock.ogg') + GLOB.priority_announcement.Announce("Hostile environment resolved. You have 3 minutes to board the Emergency Shuttle.", "Priority Announcement", 'sound/AI/shuttledock.ogg') return ..() /obj/machinery/doomsday_device/proc/start() @@ -271,12 +271,12 @@ /obj/machinery/doomsday_device/process() var/turf/T = get_turf(src) if(!T || !is_station_level(T.z)) - minor_announcement.Announce("DOOMSDAY DEVICE OUT OF STATION RANGE, ABORTING", "ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4", 'sound/misc/notice1.ogg') + GLOB.minor_announcement.Announce("DOOMSDAY DEVICE OUT OF STATION RANGE, ABORTING", "ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4", 'sound/misc/notice1.ogg') SSshuttle.emergencyNoEscape = 0 if(SSshuttle.emergency.mode == SHUTTLE_STRANDED) SSshuttle.emergency.mode = SHUTTLE_DOCKED SSshuttle.emergency.timer = world.time - priority_announcement.Announce("Hostile environment resolved. You have 3 minutes to board the Emergency Shuttle.", "Priority Announcement", 'sound/AI/shuttledock.ogg') + GLOB.priority_announcement.Announce("Hostile environment resolved. You have 3 minutes to board the Emergency Shuttle.", "Priority Announcement", 'sound/AI/shuttledock.ogg') qdel(src) if(!timing) STOP_PROCESSING(SSfastprocess, src) @@ -289,7 +289,7 @@ else if(!(sec_left % 60) && !announced) var/message = "[sec_left] SECONDS UNTIL DOOMSDAY DEVICE ACTIVATION!" - minor_announcement.Announce(message, "ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4", 'sound/misc/notice1.ogg') + GLOB.minor_announcement.Announce(message, "ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4", 'sound/misc/notice1.ogg') announced = 10 announced = max(0, announced-1) @@ -352,10 +352,10 @@ post_status("alert", "lockdown") - minor_announcement.Announce("Hostile runtime detected in door controllers. Isolation lockdown protocols are now in effect. Please remain calm.", "Network Alert") + GLOB.minor_announcement.Announce("Hostile runtime detected in door controllers. Isolation lockdown protocols are now in effect. Please remain calm.", "Network Alert") to_chat(owner, "Lockdown Initiated. Network reset in 90 seconds.") spawn(900) - minor_announcement.Announce("Automatic system reboot complete. Have a secure day.","Network reset:") + GLOB.minor_announcement.Announce("Automatic system reboot complete. Have a secure day.","Network reset:") //Destroy RCDs: Detonates all non-cyborg RCDs on the station. /datum/AI_Module/large/destroy_rcd @@ -613,7 +613,7 @@ var/turf/T = turfs[n] if(!isfloorturf(T)) success = FALSE - var/datum/camerachunk/C = cameranet.getCameraChunk(T.x, T.y, T.z) + var/datum/camerachunk/C = GLOB.cameranet.getCameraChunk(T.x, T.y, T.z) if(!C.visibleTurfs[T]) alert_msg = "You don't have camera vision of this location!" success = FALSE @@ -689,7 +689,7 @@ /datum/action/innate/ai/reactivate_cameras/Activate() var/fixed_cameras = 0 - for(var/V in cameranet.cameras) + for(var/V in GLOB.cameranet.cameras) if(!uses) break var/obj/machinery/camera/C = V @@ -722,7 +722,7 @@ AI.update_sight() var/upgraded_cameras = 0 - for(var/V in cameranet.cameras) + for(var/V in GLOB.cameranet.cameras) var/obj/machinery/camera/C = V if(C.assembly) var/upgraded = FALSE @@ -730,7 +730,7 @@ if(!C.isXRay()) C.upgradeXRay() //Update what it can see. - cameranet.updateVisibility(C, 0) + GLOB.cameranet.updateVisibility(C, 0) upgraded = TRUE if(!C.isEmpProof()) diff --git a/code/game/gamemodes/meteor/meteor.dm b/code/game/gamemodes/meteor/meteor.dm index f8ac70b31dc..5cd46ca89b5 100644 --- a/code/game/gamemodes/meteor/meteor.dm +++ b/code/game/gamemodes/meteor/meteor.dm @@ -13,7 +13,7 @@ /datum/game_mode/meteor/post_setup() spawn(rand(waittime_l, waittime_h)) - command_announcement.Announce("The station is on the path of an incoming wave of meteors. Reinforce the hull and prepare damage control parties.", "Incoming Meteors", 'sound/effects/siren.ogg') + GLOB.command_announcement.Announce("The station is on the path of an incoming wave of meteors. Reinforce the hull and prepare damage control parties.", "Incoming Meteors", 'sound/effects/siren.ogg') spawn(initialmeteordelay) sendmeteors() ..() @@ -25,7 +25,7 @@ var/waitduration = rand(3000,6000) while(waveduration - world.time > 0) sleep(max(65 - text2num("[wave]0") / 2, 40)) - spawn() spawn_meteors(6, meteors_normal) + spawn() spawn_meteors(6, GLOB.meteors_normal) wave++ sleep(waitduration) sendmeteors() diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm index 507fedddd32..0743a6f686d 100644 --- a/code/game/gamemodes/meteor/meteors.dm +++ b/code/game/gamemodes/meteor/meteors.dm @@ -1,18 +1,18 @@ //Meteors probability of spawning during a given wave -/var/list/meteors_normal = list(/obj/effect/meteor/dust=3, /obj/effect/meteor/medium=8, /obj/effect/meteor/big=3, \ - /obj/effect/meteor/flaming=1, /obj/effect/meteor/irradiated=3) //for normal meteor event +GLOBAL_LIST_INIT(meteors_normal, list(/obj/effect/meteor/dust=3, /obj/effect/meteor/medium=8, /obj/effect/meteor/big=3, \ + /obj/effect/meteor/flaming=1, /obj/effect/meteor/irradiated=3)) //for normal meteor event -/var/list/meteors_threatening = list(/obj/effect/meteor/medium=4, /obj/effect/meteor/big=8, \ - /obj/effect/meteor/flaming=3, /obj/effect/meteor/irradiated=3) //for threatening meteor event +GLOBAL_LIST_INIT(meteors_threatening, list(/obj/effect/meteor/medium=4, /obj/effect/meteor/big=8, \ + /obj/effect/meteor/flaming=3, /obj/effect/meteor/irradiated=3)) //for threatening meteor event -/var/list/meteors_catastrophic = list(/obj/effect/meteor/medium=5, /obj/effect/meteor/big=75, \ - /obj/effect/meteor/flaming=10, /obj/effect/meteor/irradiated=10, /obj/effect/meteor/tunguska = 1) //for catastrophic meteor event +GLOBAL_LIST_INIT(meteors_catastrophic, list(/obj/effect/meteor/medium=5, /obj/effect/meteor/big=75, \ + /obj/effect/meteor/flaming=10, /obj/effect/meteor/irradiated=10, /obj/effect/meteor/tunguska = 1)) //for catastrophic meteor event -/var/list/meteors_dust = list(/obj/effect/meteor/dust) //for space dust event +GLOBAL_LIST_INIT(meteors_dust, list(/obj/effect/meteor/dust)) //for space dust event -/var/list/meteors_gore = list(/obj/effect/meteor/gore) //Meaty Gore +GLOBAL_LIST_INIT(meteors_gore, list(/obj/effect/meteor/gore)) //Meaty Gore -/var/list/meteors_ops = list(/obj/effect/meteor/goreops) //Meaty Ops +GLOBAL_LIST_INIT(meteors_ops, list(/obj/effect/meteor/goreops)) //Meaty Ops /////////////////////////////// @@ -27,7 +27,7 @@ var/turf/pickedgoal var/max_i = 10//number of tries to spawn meteor. while(!istype(pickedstart, /turf/space)) - var/startSide = pick(cardinal) + var/startSide = pick(GLOB.cardinal) pickedstart = spaceDebrisStartLoc(startSide, 1) pickedgoal = spaceDebrisFinishLoc(startSide, 1) max_i-- diff --git a/code/game/gamemodes/miniantags/abduction/abduction.dm b/code/game/gamemodes/miniantags/abduction/abduction.dm index ea22ba9f54e..6914ae55363 100644 --- a/code/game/gamemodes/miniantags/abduction/abduction.dm +++ b/code/game/gamemodes/miniantags/abduction/abduction.dm @@ -47,7 +47,7 @@ /datum/game_mode/abduction/proc/make_abductor_team(team_number,preset_agent=null,preset_scientist=null) //Team Name - team_names[team_number] = "Mothership [pick(possible_changeling_IDs)]" //TODO Ensure unique and actual alieny names + team_names[team_number] = "Mothership [pick(GLOB.possible_changeling_IDs)]" //TODO Ensure unique and actual alieny names //Team Objective var/datum/objective/experiment/team_objective = new team_objective.team = team_number @@ -274,11 +274,11 @@ SSticker.mode.update_abductor_icons_removed(abductor_mind) /datum/game_mode/proc/update_abductor_icons_added(datum/mind/alien_mind) - var/datum/atom_hud/antag/hud = huds[ANTAG_HUD_ABDUCTOR] + var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_ABDUCTOR] hud.join_hud(alien_mind.current) set_antag_hud(alien_mind.current, ((alien_mind in abductors) ? "abductor" : "abductee")) /datum/game_mode/proc/update_abductor_icons_removed(datum/mind/alien_mind) - var/datum/atom_hud/antag/hud = huds[ANTAG_HUD_ABDUCTOR] + var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_ABDUCTOR] hud.leave_hud(alien_mind.current) set_antag_hud(alien_mind.current, null) diff --git a/code/game/gamemodes/miniantags/abduction/gland.dm b/code/game/gamemodes/miniantags/abduction/gland.dm index 23d9792ca4c..e23e37c349e 100644 --- a/code/game/gamemodes/miniantags/abduction/gland.dm +++ b/code/game/gamemodes/miniantags/abduction/gland.dm @@ -69,7 +69,7 @@ active = 0 if(initial(uses) == 1) uses = initial(uses) - var/datum/atom_hud/abductor/hud = huds[DATA_HUD_ABDUCTOR] + var/datum/atom_hud/abductor/hud = GLOB.huds[DATA_HUD_ABDUCTOR] hud.remove_from_hud(owner) clear_mind_control() . = ..() @@ -78,7 +78,7 @@ ..() if(special != 2 && uses) // Special 2 means abductor surgery Start() - var/datum/atom_hud/abductor/hud = huds[DATA_HUD_ABDUCTOR] + var/datum/atom_hud/abductor/hud = GLOB.huds[DATA_HUD_ABDUCTOR] hud.add_to_hud(owner) update_gland_hud() @@ -277,14 +277,14 @@ ..() if(ishuman(owner)) owner.gene_stability += GENE_INSTABILITY_MODERATE // give them this gene for free - owner.dna.SetSEState(SHOCKIMMUNITYBLOCK, TRUE) - genemutcheck(owner, SHOCKIMMUNITYBLOCK, null, MUTCHK_FORCED) + owner.dna.SetSEState(GLOB.shockimmunityblock, TRUE) + genemutcheck(owner, GLOB.shockimmunityblock, null, MUTCHK_FORCED) /obj/item/organ/internal/heart/gland/electric/remove(mob/living/carbon/M, special = 0) if(ishuman(owner)) owner.gene_stability -= GENE_INSTABILITY_MODERATE // but return it to normal once it's removed - owner.dna.SetSEState(SHOCKIMMUNITYBLOCK, FALSE) - genemutcheck(owner, SHOCKIMMUNITYBLOCK, null, MUTCHK_FORCED) + owner.dna.SetSEState(GLOB.shockimmunityblock, FALSE) + genemutcheck(owner, GLOB.shockimmunityblock, null, MUTCHK_FORCED) return ..() /obj/item/organ/internal/heart/gland/electric/activate() diff --git a/code/game/gamemodes/miniantags/abduction/machinery/camera.dm b/code/game/gamemodes/miniantags/abduction/machinery/camera.dm index 951ee6806de..6fb401d31e9 100644 --- a/code/game/gamemodes/miniantags/abduction/machinery/camera.dm +++ b/code/game/gamemodes/miniantags/abduction/machinery/camera.dm @@ -73,7 +73,7 @@ var/mob/camera/aiEye/remote/remote_eye = C.remote_control var/obj/machinery/abductor/pad/P = target - if(cameranet.checkTurfVis(remote_eye.loc)) + if(GLOB.cameranet.checkTurfVis(remote_eye.loc)) P.PadToLoc(remote_eye.loc) /datum/action/innate/teleport_out @@ -98,7 +98,7 @@ var/mob/camera/aiEye/remote/remote_eye = C.remote_control var/obj/machinery/abductor/pad/P = target - if(cameranet.checkTurfVis(remote_eye.loc)) + if(GLOB.cameranet.checkTurfVis(remote_eye.loc)) P.MobToLoc(remote_eye.loc,C) /datum/action/innate/vest_mode_swap diff --git a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm index 04dda244a0c..6e1b4a39d3a 100644 --- a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm +++ b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm @@ -176,7 +176,7 @@ H.uncuff() return //Area not chosen / It's not safe area - teleport to arrivals - H.forceMove(pick(latejoin)) + H.forceMove(pick(GLOB.latejoin)) H.uncuff() return diff --git a/code/game/gamemodes/miniantags/abduction/machinery/pad.dm b/code/game/gamemodes/miniantags/abduction/machinery/pad.dm index 85c120186e4..24e43b6583f 100644 --- a/code/game/gamemodes/miniantags/abduction/machinery/pad.dm +++ b/code/game/gamemodes/miniantags/abduction/machinery/pad.dm @@ -12,7 +12,7 @@ /obj/machinery/abductor/pad/proc/Send() if(teleport_target == null) - teleport_target = teleportlocs[pick(teleportlocs)] + teleport_target = GLOB.teleportlocs[pick(GLOB.teleportlocs)] flick("alien-pad", src) for(var/mob/living/target in loc) target.forceMove(teleport_target) diff --git a/code/game/gamemodes/miniantags/borer/borer_event.dm b/code/game/gamemodes/miniantags/borer/borer_event.dm index f925a59d9fc..245b8fa7b41 100644 --- a/code/game/gamemodes/miniantags/borer/borer_event.dm +++ b/code/game/gamemodes/miniantags/borer/borer_event.dm @@ -12,7 +12,7 @@ /datum/event/borer_infestation/announce() if(successSpawn) - command_announcement.Announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg') + GLOB.command_announcement.Announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg') /datum/event/borer_infestation/start() var/list/vents = list() diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index defa0de633d..65424bf9008 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -119,7 +119,7 @@ ..() add_language("Swarmer", 1) verbs -= /mob/living/verb/pulled - for(var/datum/atom_hud/data/diagnostic/diag_hud in huds) + for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds) diag_hud.add_to_hud(src) updatename() diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer_event.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer_event.dm index 0d5ba13d682..d0be68819ae 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer_event.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer_event.dm @@ -8,7 +8,7 @@ swarmer_report += "

Our long-range sensors have detected an odd signal emanating from your station's gateway. We recommend immediate investigation of your gateway, as something may have come \ through." print_command_report(swarmer_report, "Classified [command_name()] Update") - event_announcement.Announce("A report has been downloaded and printed out at all communications consoles.", "Incoming Classified Message", 'sound/AI/commandreport.ogg') + GLOB.event_announcement.Announce("A report has been downloaded and printed out at all communications consoles.", "Incoming Classified Message", 'sound/AI/commandreport.ogg') /datum/event/spawn_swarmer/start() if(find_swarmer()) diff --git a/code/game/gamemodes/miniantags/guardian/types/healer.dm b/code/game/gamemodes/miniantags/guardian/types/healer.dm index bf2c92ffb28..c59f7f87636 100644 --- a/code/game/gamemodes/miniantags/guardian/types/healer.dm +++ b/code/game/gamemodes/miniantags/guardian/types/healer.dm @@ -33,7 +33,7 @@ /mob/living/simple_animal/hostile/guardian/healer/Life(seconds, times_fired) ..() - var/datum/atom_hud/medsensor = huds[DATA_HUD_MEDICAL_ADVANCED] + var/datum/atom_hud/medsensor = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] medsensor.add_hud_to(src) /mob/living/simple_animal/hostile/guardian/healer/Stat() diff --git a/code/game/gamemodes/miniantags/morph/morph.dm b/code/game/gamemodes/miniantags/morph/morph.dm index ef90f44f4a0..a122351a4bb 100644 --- a/code/game/gamemodes/miniantags/morph/morph.dm +++ b/code/game/gamemodes/miniantags/morph/morph.dm @@ -136,7 +136,7 @@ for(var/atom/movable/AM in src) AM.forceMove(loc) if(prob(90)) - step(AM, pick(alldirs)) + step(AM, pick(GLOB.alldirs)) // Only execute the below if we successfully died if(!.) return FALSE diff --git a/code/game/gamemodes/miniantags/morph/morph_event.dm b/code/game/gamemodes/miniantags/morph/morph_event.dm index 28183e7d22e..e9465492a27 100644 --- a/code/game/gamemodes/miniantags/morph/morph_event.dm +++ b/code/game/gamemodes/miniantags/morph/morph_event.dm @@ -15,9 +15,9 @@ var/datum/mind/player_mind = new /datum/mind(key_of_morph) player_mind.active = 1 - if(!xeno_spawn) + if(!GLOB.xeno_spawn) return kill() - var/mob/living/simple_animal/hostile/morph/S = new /mob/living/simple_animal/hostile/morph(pick(xeno_spawn)) + var/mob/living/simple_animal/hostile/morph/S = new /mob/living/simple_animal/hostile/morph(pick(GLOB.xeno_spawn)) player_mind.transfer_to(S) player_mind.assigned_role = SPECIAL_ROLE_MORPH player_mind.special_role = SPECIAL_ROLE_MORPH diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index bdc5f718ac6..8fd5da01a2c 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -78,12 +78,12 @@ proc/issyndicate(mob/living/M as mob) //////////////////////////////////////////////////////////////////////////////////////// /datum/game_mode/proc/update_synd_icons_added(datum/mind/synd_mind) - var/datum/atom_hud/antag/opshud = huds[ANTAG_HUD_OPS] + var/datum/atom_hud/antag/opshud = GLOB.huds[ANTAG_HUD_OPS] opshud.join_hud(synd_mind.current) set_antag_hud(synd_mind.current, "hudoperative") /datum/game_mode/proc/update_synd_icons_removed(datum/mind/synd_mind) - var/datum/atom_hud/antag/opshud = huds[ANTAG_HUD_OPS] + var/datum/atom_hud/antag/opshud = GLOB.huds[ANTAG_HUD_OPS] opshud.leave_hud(synd_mind.current) set_antag_hud(synd_mind.current, null) @@ -402,7 +402,7 @@ proc/issyndicate(mob/living/M as mob) else text += "body destroyed" text += ")" - for(var/obj/item/uplink/H in world_uplinks) + for(var/obj/item/uplink/H in GLOB.world_uplinks) if(H && H.uplink_owner && H.uplink_owner==syndicate.key) TC_uses += H.used_TC purchases += H.purchase_log @@ -437,17 +437,17 @@ proc/issyndicate(mob/living/M as mob) for(var/datum/mind/M in SSticker.mode.syndicates) foecount++ if(!M || !M.current) - score_opkilled++ + GLOB.score_opkilled++ continue if(M.current.stat == DEAD) - score_opkilled++ + GLOB.score_opkilled++ else if(M.current.restrained()) - score_arrested++ + GLOB.score_arrested++ - if(foecount == score_arrested) - score_allarrested = 1 + if(foecount == GLOB.score_arrested) + GLOB.score_allarrested = 1 for(var/obj/machinery/nuclearbomb/nuke in world) if(nuke.r_code == "Nope") continue @@ -458,25 +458,25 @@ proc/issyndicate(mob/living/M as mob) var/list/fiftythousand_penalty = list(/area/security/main, /area/security/brig, /area/security/armoury, /area/security/checkpoint2) if(is_type_in_list(A, thousand_penalty)) - score_nuked_penalty = 1000 + GLOB.score_nuked_penalty = 1000 else if(is_type_in_list(A, fiftythousand_penalty)) - score_nuked_penalty = 50000 + GLOB.score_nuked_penalty = 50000 else if(istype(A, /area/engine)) - score_nuked_penalty = 100000 + GLOB.score_nuked_penalty = 100000 else - score_nuked_penalty = 10000 + GLOB.score_nuked_penalty = 10000 break - var/killpoints = score_opkilled * 250 - var/arrestpoints = score_arrested * 1000 - score_crewscore += killpoints - score_crewscore += arrestpoints - if(score_nuked) - score_crewscore -= score_nuked_penalty + var/killpoints = GLOB.score_opkilled * 250 + var/arrestpoints = GLOB.score_arrested * 1000 + GLOB.score_crewscore += killpoints + GLOB.score_crewscore += arrestpoints + if(GLOB.score_nuked) + GLOB.score_crewscore -= GLOB.score_nuked_penalty @@ -524,11 +524,11 @@ proc/issyndicate(mob/living/M as mob) dat += "
" - dat += "Operatives Arrested: [score_arrested] ([score_arrested * 1000] Points)
" - dat += "All Operatives Arrested: [score_allarrested ? "Yes" : "No"] (Score tripled)
" + dat += "Operatives Arrested: [GLOB.score_arrested] ([GLOB.score_arrested * 1000] Points)
" + dat += "All Operatives Arrested: [GLOB.score_allarrested ? "Yes" : "No"] (Score tripled)
" - dat += "Operatives Killed: [score_opkilled] ([score_opkilled * 1000] Points)
" - dat += "Station Destroyed: [score_nuked ? "Yes" : "No"] (-[score_nuked_penalty] Points)
" + dat += "Operatives Killed: [GLOB.score_opkilled] ([GLOB.score_opkilled * 1000] Points)
" + dat += "Station Destroyed: [GLOB.score_nuked ? "Yes" : "No"] (-[GLOB.score_nuked_penalty] Points)
" dat += "
" return dat diff --git a/code/game/gamemodes/nuclear/nuclear_challenge.dm b/code/game/gamemodes/nuclear/nuclear_challenge.dm index 35c26408c5b..48116911640 100644 --- a/code/game/gamemodes/nuclear/nuclear_challenge.dm +++ b/code/game/gamemodes/nuclear/nuclear_challenge.dm @@ -48,7 +48,7 @@ if(!check_allowed(user) || !war_declaration) return - event_announcement.Announce(war_declaration, "Declaration of War", 'sound/effects/siren.ogg') + GLOB.event_announcement.Announce(war_declaration, "Declaration of War", 'sound/effects/siren.ogg') to_chat(user, "You've attracted the attention of powerful forces within the syndicate. A bonus bundle of telecrystals has been granted to your team. Great things await you if you complete the mission.") to_chat(user, "Your bonus telecrystals have been split between your team's uplinks.") diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index eec24d0e1ed..1dd254fade7 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -5,7 +5,7 @@ #define NUKE_UNWRENCHED 4 #define NUKE_MOBILE 5 -var/bomb_set +GLOBAL_VAR(bomb_set) /obj/machinery/nuclearbomb name = "\improper Nuclear Fission Explosive" @@ -48,7 +48,7 @@ var/bomb_set /obj/machinery/nuclearbomb/process() if(timing) - bomb_set = 1 //So long as there is one nuke timing, it means one nuke is armed. + GLOB.bomb_set = 1 //So long as there is one nuke timing, it means one nuke is armed. timeleft = max(timeleft - 2, 0) // 2 seconds per process() if(timeleft <= 0) spawn @@ -195,7 +195,7 @@ var/bomb_set /obj/machinery/nuclearbomb/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) - ui = new(user, src, ui_key, "nuclear_bomb.tmpl", "Nuke Control Panel", 450, 550, state = physical_state) + ui = new(user, src, ui_key, "nuclear_bomb.tmpl", "Nuke Control Panel", 450, 550, state = GLOB.physical_state) ui.open() ui.set_auto_update(1) @@ -310,13 +310,13 @@ var/bomb_set message_admins("[key_name_admin(usr)] engaged a nuclear bomb (JMP)") if(!is_syndicate) set_security_level("delta") - bomb_set = 1 //There can still be issues with this resetting when there are multiple bombs. Not a big deal though for Nuke/N + GLOB.bomb_set = 1 //There can still be issues with this resetting when there are multiple bombs. Not a big deal though for Nuke/N else - bomb_set = 0 + GLOB.bomb_set = 0 else if(!is_syndicate) set_security_level(previous_level) - bomb_set = 0 + GLOB.bomb_set = 0 if(!lighthack) icon_state = "nuclearbomb1" if(href_list["safety"]) @@ -325,7 +325,7 @@ var/bomb_set if(!is_syndicate) set_security_level(previous_level) timing = 0 - bomb_set = 0 + GLOB.bomb_set = 0 if(href_list["anchor"]) if(removal_stage == NUKE_MOBILE) anchored = 0 @@ -369,7 +369,7 @@ var/bomb_set SSticker.mode.explosion_in_progress = 1 sleep(100) - enter_allowed = 0 + GLOB.enter_allowed = 0 var/off_station = 0 var/turf/bomb_location = get_turf(src) @@ -453,9 +453,9 @@ var/bomb_set STOP_PROCESSING(SSobj, src) return ..() - if(blobstart.len > 0) + if(GLOB.blobstart.len > 0) GLOB.poi_list.Remove(src) - var/obj/item/disk/nuclear/NEWDISK = new(pick(blobstart)) + var/obj/item/disk/nuclear/NEWDISK = new(pick(GLOB.blobstart)) transfer_fingerprints_to(NEWDISK) message_admins("[src] has been destroyed at ([diskturf.x], [diskturf.y], [diskturf.z] - JMP). Moving it to ([NEWDISK.x], [NEWDISK.y], [NEWDISK.z] - JMP).") log_game("[src] has been destroyed in ([diskturf.x], [diskturf.y], [diskturf.z]). Moving it to ([NEWDISK.x], [NEWDISK.y], [NEWDISK.z]).") diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index f193856b3d9..6e1defaccd7 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -156,7 +156,7 @@ if("Item") var/list/item_names[0] var/list/item_paths[0] - for(var/objective in potential_theft_objectives) + for(var/objective in GLOB.potential_theft_objectives) var/datum/theft_objective/T = objective var/name = initial(T.name) item_names += name @@ -215,7 +215,7 @@ if(mode) //Check in case the mode changes while operating worklocation() return - if(bomb_set) //If the bomb is set, lead to the shuttle + if(GLOB.bomb_set) //If the bomb is set, lead to the shuttle mode = 1 //Ensures worklocation() continues to work worklocation() playsound(loc, 'sound/machines/twobeep.ogg', 50, 1) //Plays a beep @@ -244,7 +244,7 @@ if(!mode) workdisk() return - if(!bomb_set) + if(!GLOB.bomb_set) mode = 0 workdisk() playsound(loc, 'sound/machines/twobeep.ogg', 50, 1) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index eb667d4994d..9974ee8305a 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -1,6 +1,6 @@ GLOBAL_LIST_EMPTY(all_objectives) -var/list/potential_theft_objectives = subtypesof(/datum/theft_objective) - /datum/theft_objective/steal - /datum/theft_objective/number - /datum/theft_objective/unique +GLOBAL_LIST_INIT(potential_theft_objectives, (subtypesof(/datum/theft_objective) - /datum/theft_objective/steal - /datum/theft_objective/number - /datum/theft_objective/unique)) /datum/objective var/datum/mind/owner = null //Who owns the objective. @@ -359,7 +359,7 @@ var/list/potential_theft_objectives = subtypesof(/datum/theft_objective) - /datu var/loop=50 while(!steal_target && loop > 0) loop-- - var/thefttype = pick(potential_theft_objectives) + var/thefttype = pick(GLOB.potential_theft_objectives) var/datum/theft_objective/O = new thefttype if(owner.assigned_role in O.protected_jobs) continue @@ -377,7 +377,7 @@ var/list/potential_theft_objectives = subtypesof(/datum/theft_objective) - /datu /datum/objective/steal/proc/select_target() - var/list/possible_items_all = potential_theft_objectives+"custom" + var/list/possible_items_all = GLOB.potential_theft_objectives+"custom" var/new_target = input("Select target:", "Objective target", null) as null|anything in possible_items_all if(!new_target) return if(new_target == "custom") diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index ac0b3705198..f7da210b4a9 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -218,7 +218,7 @@ if(SSshuttle.emergency.mode == SHUTTLE_STRANDED) SSshuttle.emergency.mode = SHUTTLE_DOCKED SSshuttle.emergency.timer = world.time - command_announcement.Announce("Hostile enviroment resolved. You have 3 minutes to board the Emergency Shuttle.", null, 'sound/AI/shuttledock.ogg') + GLOB.command_announcement.Announce("Hostile enviroment resolved. You have 3 minutes to board the Emergency Shuttle.", null, 'sound/AI/shuttledock.ogg') return ..() if(finished != 0) return TRUE @@ -229,7 +229,7 @@ //Deals with converting players to the revolution// /////////////////////////////////////////////////// /datum/game_mode/proc/add_revolutionary(datum/mind/rev_mind) - if(rev_mind.assigned_role in command_positions) + if(rev_mind.assigned_role in GLOB.command_positions) return 0 var/mob/living/carbon/human/H = rev_mind.current//Check to see if the potential rev is implanted if(ismindshielded(H)) @@ -283,7 +283,7 @@ //Adds the rev hud to a new convert// ///////////////////////////////////// /datum/game_mode/proc/update_rev_icons_added(datum/mind/rev_mind) - var/datum/atom_hud/antag/revhud = huds[ANTAG_HUD_REV] + var/datum/atom_hud/antag/revhud = GLOB.huds[ANTAG_HUD_REV] revhud.join_hud(rev_mind.current) set_antag_hud(rev_mind.current, ((rev_mind in head_revolutionaries) ? "hudheadrevolutionary" : "hudrevolutionary")) @@ -291,7 +291,7 @@ //Removes the hud from deconverted revs// ///////////////////////////////////////// /datum/game_mode/proc/update_rev_icons_removed(datum/mind/rev_mind) - var/datum/atom_hud/antag/revhud = huds[ANTAG_HUD_REV] + var/datum/atom_hud/antag/revhud = GLOB.huds[ANTAG_HUD_REV] revhud.leave_hud(rev_mind.current) set_antag_hud(rev_mind.current, null) @@ -372,35 +372,35 @@ for(var/datum/mind/M in SSticker.mode.head_revolutionaries) foecount++ if(!M || !M.current) - score_opkilled++ + GLOB.score_opkilled++ continue if(M.current.stat == DEAD) - score_opkilled++ + GLOB.score_opkilled++ else if(M.current.restrained()) - score_arrested++ + GLOB.score_arrested++ - if(foecount == score_arrested) - score_allarrested = 1 + if(foecount == GLOB.score_arrested) + GLOB.score_allarrested = 1 for(var/mob/living/carbon/human/player in world) if(player.mind) var/role = player.mind.assigned_role if(role in list("Captain", "Head of Security", "Head of Personnel", "Chief Engineer", "Research Director")) if(player.stat == DEAD) - score_deadcommand++ + GLOB.score_deadcommand++ - var/arrestpoints = score_arrested * 1000 - var/killpoints = score_opkilled * 500 - var/comdeadpts = score_deadcommand * 500 - if(score_traitorswon) - score_crewscore -= 10000 + var/arrestpoints = GLOB.score_arrested * 1000 + var/killpoints = GLOB.score_opkilled * 500 + var/comdeadpts = GLOB.score_deadcommand * 500 + if(GLOB.score_traitorswon) + GLOB.score_crewscore -= 10000 - score_crewscore += arrestpoints - score_crewscore += killpoints - score_crewscore -= comdeadpts + GLOB.score_crewscore += arrestpoints + GLOB.score_crewscore += killpoints + GLOB.score_crewscore -= comdeadpts /datum/game_mode/revolution/get_scoreboard_stats() @@ -438,12 +438,12 @@ dat += "Number of Surviving Loyal Crew: [loycount]
" dat += "
" - dat += "Revolution Heads Arrested: [score_arrested] ([score_arrested * 1000] Points)
" - dat += "All Revolution Heads Arrested: [score_allarrested ? "Yes" : "No"] (Score tripled)
" + dat += "Revolution Heads Arrested: [GLOB.score_arrested] ([GLOB.score_arrested * 1000] Points)
" + dat += "All Revolution Heads Arrested: [GLOB.score_allarrested ? "Yes" : "No"] (Score tripled)
" - dat += "Revolution Heads Slain: [score_opkilled] ([score_opkilled * 500] Points)
" - dat += "Command Staff Slain: [score_deadcommand] (-[score_deadcommand * 500] Points)
" - dat += "Revolution Successful: [score_traitorswon ? "Yes" : "No"] (-[score_traitorswon * 10000] Points)
" + dat += "Revolution Heads Slain: [GLOB.score_opkilled] ([GLOB.score_opkilled * 500] Points)
" + dat += "Command Staff Slain: [GLOB.score_deadcommand] (-[GLOB.score_deadcommand * 500] Points)
" + dat += "Revolution Successful: [GLOB.score_traitorswon ? "Yes" : "No"] (-[GLOB.score_traitorswon * 10000] Points)
" dat += "
" return dat diff --git a/code/game/gamemodes/sandbox/h_sandbox.dm b/code/game/gamemodes/sandbox/h_sandbox.dm index 5dd462296b9..69eaef9051b 100644 --- a/code/game/gamemodes/sandbox/h_sandbox.dm +++ b/code/game/gamemodes/sandbox/h_sandbox.dm @@ -1,8 +1,8 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 -var/hsboxspawn = 1 -var/list - hrefs = list( +// Someone needs to properly path this file, or just delete it since its unticked and was last properly touched >4 years ago +GLOBAL_VAR_INIT(hsboxspawn, 1) +GLOBAL_LIST_INIT(sandbox_hrefs, list( "hsbsuit" = "Suit Up (Space Travel Gear)", "hsbmetal" = "Spawn 50 Metal", "hsbglass" = "Spawn 50 Glass", @@ -13,7 +13,7 @@ var/list "hsbfueltank" = "Spawn Welding Fuel Tank", "hsbwater tank" = "Spawn Water Tank", "hsbtoolbox" = "Spawn Toolbox", - "hsbmedkit" = "Spawn Medical Kit") + "hsbmedkit" = "Spawn Medical Kit")) mob var/datum/hSB/sandbox = null @@ -39,8 +39,8 @@ datum/hSB hsbpanel += "Administration Tools:
" hsbpanel += "- Toggle Object Spawning

" hsbpanel += "Regular Tools:
" - for(var/T in hrefs) - hsbpanel += "- [hrefs[T]]
" + for(var/T in GLOB.sandbox_hrefs) + hsbpanel += "- [GLOB.sandbox_hrefs[T]]
" if(hsboxspawn) hsbpanel += "- Spawn Object

" usr << browse(hsbpanel, "window=hsbpanel") diff --git a/code/game/gamemodes/scoreboard.dm b/code/game/gamemodes/scoreboard.dm index 379b4fbdcd9..e91c0d4f150 100644 --- a/code/game/gamemodes/scoreboard.dm +++ b/code/game/gamemodes/scoreboard.dm @@ -22,12 +22,12 @@ // Who is alive/dead, who escaped for(var/mob/living/silicon/ai/I in GLOB.mob_list) if(I.stat == DEAD && is_station_level(I.z)) - score_deadaipenalty++ - score_deadcrew++ + GLOB.score_deadaipenalty++ + GLOB.score_deadcrew++ for(var/mob/living/carbon/human/I in GLOB.mob_list) if(I.stat == DEAD && is_station_level(I.z)) - score_deadcrew++ + GLOB.score_deadcrew++ if(SSshuttle.emergency.mode >= SHUTTLE_ENDGAME) for(var/mob/living/player in GLOB.mob_list) @@ -36,7 +36,7 @@ var/turf/location = get_turf(player.loc) var/area/escape_zone = locate(/area/shuttle/escape) if(location in escape_zone) - score_escapees++ + GLOB.score_escapees++ @@ -53,18 +53,18 @@ if(E.stat != DEAD && location in escape_zone) // Escapee Scores cash_score = get_score_container_worth(E) - if(cash_score > score_richestcash) - score_richestcash = cash_score - score_richestname = E.real_name - score_richestjob = E.job - score_richestkey = E.key + if(cash_score > GLOB.score_richestcash) + GLOB.score_richestcash = cash_score + GLOB.score_richestname = E.real_name + GLOB.score_richestjob = E.job + GLOB.score_richestkey = E.key dmg_score = E.getBruteLoss() + E.getFireLoss() + E.getToxLoss() + E.getOxyLoss() - if(dmg_score > score_dmgestdamage) - score_dmgestdamage = dmg_score - score_dmgestname = E.real_name - score_dmgestjob = E.job - score_dmgestkey = E.key + if(dmg_score > GLOB.score_dmgestdamage) + GLOB.score_dmgestdamage = dmg_score + GLOB.score_dmgestname = E.real_name + GLOB.score_dmgestjob = E.job + GLOB.score_dmgestkey = E.key if(SSticker && SSticker.mode) SSticker.mode.set_scoreboard_gvars() @@ -75,73 +75,73 @@ if(!is_station_level(A.z)) continue for(var/obj/item/stock_parts/cell/C in A.contents) if(C.charge < 2300) - score_powerloss++ //200 charge leeway + GLOB.score_powerloss++ //200 charge leeway // Check how much uncleaned mess is on the station for(var/obj/effect/decal/cleanable/M in world) if(!is_station_level(M.z)) continue if(istype(M, /obj/effect/decal/cleanable/blood/gibs)) - score_mess += 3 + GLOB.score_mess += 3 if(istype(M, /obj/effect/decal/cleanable/blood)) - score_mess += 1 + GLOB.score_mess += 1 if(istype(M, /obj/effect/decal/cleanable/vomit)) - score_mess += 1 + GLOB.score_mess += 1 // Bonus Modifiers //var/traitorwins = score_traitorswon - var/deathpoints = score_deadcrew * 25 //done - var/researchpoints = score_researchdone * 30 - var/eventpoints = score_eventsendured * 50 - var/escapoints = score_escapees * 25 //done - var/harvests = score_stuffharvested * 5 //done - var/shipping = score_stuffshipped * 5 - var/mining = score_oremined * 2 //done - var/meals = score_meals * 5 //done, but this only counts cooked meals, not drinks served - var/power = score_powerloss * 20 + var/deathpoints = GLOB.score_deadcrew * 25 //done + var/researchpoints = GLOB.score_researchdone * 30 + var/eventpoints = GLOB.score_eventsendured * 50 + var/escapoints = GLOB.score_escapees * 25 //done + var/harvests = GLOB.score_stuffharvested * 5 //done + var/shipping = GLOB.score_stuffshipped * 5 + var/mining = GLOB.score_oremined * 2 //done + var/meals = GLOB.score_meals * 5 //done, but this only counts cooked meals, not drinks served + var/power = GLOB.score_powerloss * 20 var/messpoints - if(score_mess != 0) - messpoints = score_mess //done - var/plaguepoints = score_disease * 30 + if(GLOB.score_mess != 0) + messpoints = GLOB.score_mess //done + var/plaguepoints = GLOB.score_disease * 30 // Good Things - score_crewscore += shipping - score_crewscore += harvests - score_crewscore += mining - score_crewscore += researchpoints - score_crewscore += eventpoints - score_crewscore += escapoints + GLOB.score_crewscore += shipping + GLOB.score_crewscore += harvests + GLOB.score_crewscore += mining + GLOB.score_crewscore += researchpoints + GLOB.score_crewscore += eventpoints + GLOB.score_crewscore += escapoints if(power == 0) - score_crewscore += 2500 - score_powerbonus = 1 + GLOB.score_crewscore += 2500 + GLOB.score_powerbonus = 1 - if(score_mess == 0) - score_crewscore += 3000 - score_messbonus = 1 + if(GLOB.score_mess == 0) + GLOB.score_crewscore += 3000 + GLOB.score_messbonus = 1 - score_crewscore += meals - if(score_allarrested) - score_crewscore *= 3 // This needs to be here for the bonus to be applied properly + GLOB.score_crewscore += meals + if(GLOB.score_allarrested) + GLOB.score_crewscore *= 3 // This needs to be here for the bonus to be applied properly - score_crewscore -= deathpoints - if(score_deadaipenalty) - score_crewscore -= 250 - score_crewscore -= power + GLOB.score_crewscore -= deathpoints + if(GLOB.score_deadaipenalty) + GLOB.score_crewscore -= 250 + GLOB.score_crewscore -= power - score_crewscore -= messpoints - score_crewscore -= plaguepoints + GLOB.score_crewscore -= messpoints + GLOB.score_crewscore -= plaguepoints // Show the score - might add "ranks" later to_chat(world, "The crew's final score is:") - to_chat(world, "[score_crewscore]") + to_chat(world, "[GLOB.score_crewscore]") for(var/mob/E in GLOB.player_list) if(E.client && !E.get_preference(DISABLE_SCOREBOARD)) E.scorestats() @@ -178,30 +178,30 @@ General Statistics
The Good:
- Useful Items Shipped: [score_stuffshipped] ([score_stuffshipped * 5] Points)
- Hydroponics Harvests: [score_stuffharvested] ([score_stuffharvested * 5] Points)
- Ore Mined: [score_oremined] ([score_oremined * 2] Points)
- Refreshments Prepared: [score_meals] ([score_meals * 5] Points)
- Research Completed: [score_researchdone] ([score_researchdone * 30] Points)
"} - if(SSshuttle.emergency.mode == SHUTTLE_ENDGAME) dat += "Shuttle Escapees: [score_escapees] ([score_escapees * 25] Points)
" - dat += {"Random Events Endured: [score_eventsendured] ([score_eventsendured * 50] Points)
- Whole Station Powered: [score_powerbonus ? "Yes" : "No"] ([score_powerbonus * 2500] Points)
- Ultra-Clean Station: [score_mess ? "No" : "Yes"] ([score_messbonus * 3000] Points)

+ Useful Items Shipped: [GLOB.score_stuffshipped] ([GLOB.score_stuffshipped * 5] Points)
+ Hydroponics Harvests: [GLOB.score_stuffharvested] ([GLOB.score_stuffharvested * 5] Points)
+ Ore Mined: [GLOB.score_oremined] ([GLOB.score_oremined * 2] Points)
+ Refreshments Prepared: [GLOB.score_meals] ([GLOB.score_meals * 5] Points)
+ Research Completed: [GLOB.score_researchdone] ([GLOB.score_researchdone * 30] Points)
"} + if(SSshuttle.emergency.mode == SHUTTLE_ENDGAME) dat += "Shuttle Escapees: [GLOB.score_escapees] ([GLOB.score_escapees * 25] Points)
" + dat += {"Random Events Endured: [GLOB.score_eventsendured] ([GLOB.score_eventsendured * 50] Points)
+ Whole Station Powered: [GLOB.score_powerbonus ? "Yes" : "No"] ([GLOB.score_powerbonus * 2500] Points)
+ Ultra-Clean Station: [GLOB.score_mess ? "No" : "Yes"] ([GLOB.score_messbonus * 3000] Points)

The bad:
- Dead bodies on Station: [score_deadcrew] (-[score_deadcrew * 25] Points)
- Uncleaned Messes: [score_mess] (-[score_mess] Points)
- Station Power Issues: [score_powerloss] (-[score_powerloss * 20] Points)
- Rampant Diseases: [score_disease] (-[score_disease * 30] Points)
- AI Destroyed: [score_deadaipenalty ? "Yes" : "No"] (-[score_deadaipenalty * 250] Points)

+ Dead bodies on Station: [GLOB.score_deadcrew] (-[GLOB.score_deadcrew * 25] Points)
+ Uncleaned Messes: [GLOB.score_mess] (-[GLOB.score_mess] Points)
+ Station Power Issues: [GLOB.score_powerloss] (-[GLOB.score_powerloss * 20] Points)
+ Rampant Diseases: [GLOB.score_disease] (-[GLOB.score_disease * 30] Points)
+ AI Destroyed: [GLOB.score_deadaipenalty ? "Yes" : "No"] (-[GLOB.score_deadaipenalty * 250] Points)

The Weird
- Food Eaten: [score_foodeaten] bites/sips
- Times a Clown was Abused: [score_clownabuse]

+ Food Eaten: [GLOB.score_foodeaten] bites/sips
+ Times a Clown was Abused: [GLOB.score_clownabuse]

"} - if(score_escapees) - dat += {"Richest Escapee: [score_richestname], [score_richestjob]: $[num2text(score_richestcash,50)] ([score_richestkey])
- Most Battered Escapee: [score_dmgestname], [score_dmgestjob]: [score_dmgestdamage] damage ([score_dmgestkey])
"} + if(GLOB.score_escapees) + dat += {"Richest Escapee: [GLOB.score_richestname], [GLOB.score_richestjob]: $[num2text(GLOB.score_richestcash,50)] ([GLOB.score_richestkey])
+ Most Battered Escapee: [GLOB.score_dmgestname], [GLOB.score_dmgestjob]: [GLOB.score_dmgestdamage] damage ([GLOB.score_dmgestkey])
"} else if(SSshuttle.emergency.mode <= SHUTTLE_STRANDED) dat += "The station wasn't evacuated!
" @@ -212,11 +212,11 @@ dat += {"

- FINAL SCORE: [score_crewscore]
+ FINAL SCORE: [GLOB.score_crewscore]
"} var/score_rating = "The Aristocrats!" - switch(score_crewscore) + switch(GLOB.score_crewscore) if(-99999 to -50000) score_rating = "Even the Singularity Deserves Better" if(-49999 to -5000) score_rating = "Singularity Fodder" if(-4999 to -1000) score_rating = "You're All Fired" diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm index 507aaec0135..da171113dd0 100644 --- a/code/game/gamemodes/setupgame.dm +++ b/code/game/gamemodes/setupgame.dm @@ -5,11 +5,11 @@ var/assigned = pick(blocksLeft) blocksLeft.Remove(assigned) if(good) - good_blocks += assigned + GLOB.good_blocks += assigned else - bad_blocks += assigned - assigned_blocks[assigned]=name - dna_activity_bounds[assigned]=activity_bounds + GLOB.bad_blocks += assigned + GLOB.assigned_blocks[assigned]=name + GLOB.dna_activity_bounds[assigned]=activity_bounds //Debug message_admins("[name] assigned to block #[assigned].") // testing("[name] assigned to block #[assigned].") return assigned @@ -17,9 +17,9 @@ /proc/setupgenetics() if(prob(50)) - BLOCKADD = rand(-300,300) + GLOB.blockadd = rand(-300,300) if(prob(75)) - DIFFMUT = rand(0,20) + GLOB.diffmut = rand(0,20) //Thanks to nexis for the fancy code @@ -34,70 +34,70 @@ //message_admins("Assigning DNA blocks:") // Standard muts - BLINDBLOCK = getAssignedBlock("BLIND", numsToAssign) - COLOURBLINDBLOCK = getAssignedBlock("COLOURBLIND", numsToAssign) - DEAFBLOCK = getAssignedBlock("DEAF", numsToAssign) - HULKBLOCK = getAssignedBlock("HULK", numsToAssign, DNA_HARD_BOUNDS, good=1) - TELEBLOCK = getAssignedBlock("TELE", numsToAssign, DNA_HARD_BOUNDS, good=1) - FIREBLOCK = getAssignedBlock("FIRE", numsToAssign, DNA_HARDER_BOUNDS, good=1) - XRAYBLOCK = getAssignedBlock("XRAY", numsToAssign, DNA_HARDER_BOUNDS, good=1) - CLUMSYBLOCK = getAssignedBlock("CLUMSY", numsToAssign) - FAKEBLOCK = getAssignedBlock("FAKE", numsToAssign) - COUGHBLOCK = getAssignedBlock("COUGH", numsToAssign) - GLASSESBLOCK = getAssignedBlock("GLASSES", numsToAssign) - EPILEPSYBLOCK = getAssignedBlock("EPILEPSY", numsToAssign) - TWITCHBLOCK = getAssignedBlock("TWITCH", numsToAssign) - NERVOUSBLOCK = getAssignedBlock("NERVOUS", numsToAssign) - WINGDINGSBLOCK = getAssignedBlock("WINGDINGS", numsToAssign) + GLOB.blindblock = getAssignedBlock("BLIND", numsToAssign) + GLOB.colourblindblock = getAssignedBlock("COLOURBLIND", numsToAssign) + GLOB.deafblock = getAssignedBlock("DEAF", numsToAssign) + GLOB.hulkblock = getAssignedBlock("HULK", numsToAssign, DNA_HARD_BOUNDS, good=1) + GLOB.teleblock = getAssignedBlock("TELE", numsToAssign, DNA_HARD_BOUNDS, good=1) + GLOB.fireblock = getAssignedBlock("FIRE", numsToAssign, DNA_HARDER_BOUNDS, good=1) + GLOB.xrayblock = getAssignedBlock("XRAY", numsToAssign, DNA_HARDER_BOUNDS, good=1) + GLOB.clumsyblock = getAssignedBlock("CLUMSY", numsToAssign) + GLOB.fakeblock = getAssignedBlock("FAKE", numsToAssign) + GLOB.coughblock = getAssignedBlock("COUGH", numsToAssign) + GLOB.glassesblock = getAssignedBlock("GLASSES", numsToAssign) + GLOB.epilepsyblock = getAssignedBlock("EPILEPSY", numsToAssign) + GLOB.twitchblock = getAssignedBlock("TWITCH", numsToAssign) + GLOB.nervousblock = getAssignedBlock("NERVOUS", numsToAssign) + GLOB.wingdingsblock = getAssignedBlock("WINGDINGS", numsToAssign) // Bay muts - BREATHLESSBLOCK = getAssignedBlock("BREATHLESS", numsToAssign, DNA_HARD_BOUNDS, good=1) - REMOTEVIEWBLOCK = getAssignedBlock("REMOTEVIEW", numsToAssign, DNA_HARDER_BOUNDS, good=1) - REGENERATEBLOCK = getAssignedBlock("REGENERATE", numsToAssign, DNA_HARDER_BOUNDS, good=1) - INCREASERUNBLOCK = getAssignedBlock("INCREASERUN", numsToAssign, DNA_HARDER_BOUNDS, good=1) - REMOTETALKBLOCK = getAssignedBlock("REMOTETALK", numsToAssign, DNA_HARDER_BOUNDS, good=1) - MORPHBLOCK = getAssignedBlock("MORPH", numsToAssign, DNA_HARDER_BOUNDS, good=1) - COLDBLOCK = getAssignedBlock("COLD", numsToAssign, good=1) - HALLUCINATIONBLOCK = getAssignedBlock("HALLUCINATION", numsToAssign) - NOPRINTSBLOCK = getAssignedBlock("NOPRINTS", numsToAssign, DNA_HARD_BOUNDS, good=1) - SHOCKIMMUNITYBLOCK = getAssignedBlock("SHOCKIMMUNITY", numsToAssign, good=1) - SMALLSIZEBLOCK = getAssignedBlock("SMALLSIZE", numsToAssign, DNA_HARD_BOUNDS, good=1) + GLOB.breathlessblock = getAssignedBlock("BREATHLESS", numsToAssign, DNA_HARD_BOUNDS, good=1) + GLOB.remoteviewblock = getAssignedBlock("REMOTEVIEW", numsToAssign, DNA_HARDER_BOUNDS, good=1) + GLOB.regenerateblock = getAssignedBlock("REGENERATE", numsToAssign, DNA_HARDER_BOUNDS, good=1) + GLOB.increaserunblock = getAssignedBlock("INCREASERUN", numsToAssign, DNA_HARDER_BOUNDS, good=1) + GLOB.remotetalkblock = getAssignedBlock("REMOTETALK", numsToAssign, DNA_HARDER_BOUNDS, good=1) + GLOB.morphblock = getAssignedBlock("MORPH", numsToAssign, DNA_HARDER_BOUNDS, good=1) + GLOB.coldblock = getAssignedBlock("COLD", numsToAssign, good=1) + GLOB.hallucinationblock = getAssignedBlock("HALLUCINATION", numsToAssign) + GLOB.noprintsblock = getAssignedBlock("NOPRINTS", numsToAssign, DNA_HARD_BOUNDS, good=1) + GLOB.shockimmunityblock = getAssignedBlock("SHOCKIMMUNITY", numsToAssign, good=1) + GLOB.smallsizeblock = getAssignedBlock("SMALLSIZE", numsToAssign, DNA_HARD_BOUNDS, good=1) // // Goon muts ///////////////////////////////////////////// // Disabilities - LISPBLOCK = getAssignedBlock("LISP", numsToAssign) - MUTEBLOCK = getAssignedBlock("MUTE", numsToAssign) - RADBLOCK = getAssignedBlock("RAD", numsToAssign) - FATBLOCK = getAssignedBlock("FAT", numsToAssign) - CHAVBLOCK = getAssignedBlock("CHAV", numsToAssign) - SWEDEBLOCK = getAssignedBlock("SWEDE", numsToAssign) - SCRAMBLEBLOCK = getAssignedBlock("SCRAMBLE", numsToAssign) - STRONGBLOCK = getAssignedBlock("STRONG", numsToAssign, good=1) - HORNSBLOCK = getAssignedBlock("HORNS", numsToAssign) - COMICBLOCK = getAssignedBlock("COMIC", numsToAssign) + GLOB.lispblock = getAssignedBlock("LISP", numsToAssign) + GLOB.muteblock = getAssignedBlock("MUTE", numsToAssign) + GLOB.radblock = getAssignedBlock("RAD", numsToAssign) + GLOB.fatblock = getAssignedBlock("FAT", numsToAssign) + GLOB.chavblock = getAssignedBlock("CHAV", numsToAssign) + GLOB.swedeblock = getAssignedBlock("SWEDE", numsToAssign) + GLOB.scrambleblock = getAssignedBlock("SCRAMBLE", numsToAssign) + GLOB.strongblock = getAssignedBlock("STRONG", numsToAssign, good=1) + GLOB.hornsblock = getAssignedBlock("HORNS", numsToAssign) + GLOB.comicblock = getAssignedBlock("COMIC", numsToAssign) // Powers - SOBERBLOCK = getAssignedBlock("SOBER", numsToAssign, good=1) - PSYRESISTBLOCK = getAssignedBlock("PSYRESIST", numsToAssign, DNA_HARD_BOUNDS, good=1) - SHADOWBLOCK = getAssignedBlock("SHADOW", numsToAssign, DNA_HARDER_BOUNDS, good=1) - CHAMELEONBLOCK = getAssignedBlock("CHAMELEON", numsToAssign, DNA_HARDER_BOUNDS, good=1) - CRYOBLOCK = getAssignedBlock("CRYO", numsToAssign, DNA_HARD_BOUNDS, good=1) - EATBLOCK = getAssignedBlock("EAT", numsToAssign, DNA_HARD_BOUNDS, good=1) - JUMPBLOCK = getAssignedBlock("JUMP", numsToAssign, DNA_HARD_BOUNDS, good=1) - IMMOLATEBLOCK = getAssignedBlock("IMMOLATE", numsToAssign) - EMPATHBLOCK = getAssignedBlock("EMPATH", numsToAssign, DNA_HARD_BOUNDS, good=1) - POLYMORPHBLOCK = getAssignedBlock("POLYMORPH", numsToAssign, DNA_HARDER_BOUNDS, good=1) + GLOB.soberblock = getAssignedBlock("SOBER", numsToAssign, good=1) + GLOB.psyresistblock = getAssignedBlock("PSYRESIST", numsToAssign, DNA_HARD_BOUNDS, good=1) + GLOB.shadowblock = getAssignedBlock("SHADOW", numsToAssign, DNA_HARDER_BOUNDS, good=1) + GLOB.chameleonblock = getAssignedBlock("CHAMELEON", numsToAssign, DNA_HARDER_BOUNDS, good=1) + GLOB.cryoblock = getAssignedBlock("CRYO", numsToAssign, DNA_HARD_BOUNDS, good=1) + GLOB.eatblock = getAssignedBlock("EAT", numsToAssign, DNA_HARD_BOUNDS, good=1) + GLOB.jumpblock = getAssignedBlock("JUMP", numsToAssign, DNA_HARD_BOUNDS, good=1) + GLOB.immolateblock = getAssignedBlock("IMMOLATE", numsToAssign) + GLOB.empathblock = getAssignedBlock("EMPATH", numsToAssign, DNA_HARD_BOUNDS, good=1) + GLOB.polymorphblock = getAssignedBlock("POLYMORPH", numsToAssign, DNA_HARDER_BOUNDS, good=1) // // /vg/ Blocks ///////////////////////////////////////////// // Disabilities - LOUDBLOCK = getAssignedBlock("LOUD", numsToAssign) - DIZZYBLOCK = getAssignedBlock("DIZZY", numsToAssign) + GLOB.loudblock = getAssignedBlock("LOUD", numsToAssign) + GLOB.dizzyblock = getAssignedBlock("DIZZY", numsToAssign) // @@ -105,7 +105,7 @@ /////////////////////////////////////////////. // Monkeyblock is always last. - MONKEYBLOCK = DNA_SE_LENGTH + GLOB.monkeyblock = DNA_SE_LENGTH // And the genes that actually do the work. (domutcheck improvements) var/list/blocks_assigned[DNA_SE_LENGTH] @@ -114,7 +114,7 @@ if(G.block) if(G.block in blocks_assigned) warning("DNA2: Gene [G.name] trying to use already-assigned block [G.block] (used by [english_list(blocks_assigned[G.block])])") - dna_genes.Add(G) + GLOB.dna_genes.Add(G) var/list/assignedToBlock[0] if(blocks_assigned[G.block]) assignedToBlock=blocks_assigned[G.block] @@ -124,12 +124,12 @@ // I WILL HAVE A LIST OF GENES THAT MATCHES THE RANDOMIZED BLOCKS GODDAMNIT! for(var/block=1;block<=DNA_SE_LENGTH;block++) - var/name = assigned_blocks[block] - for(var/datum/dna/gene/gene in dna_genes) + var/name = GLOB.assigned_blocks[block] + for(var/datum/dna/gene/gene in GLOB.dna_genes) if(gene.name == name || gene.block == block) - if(gene.block in assigned_gene_blocks) - warning("DNA2: Gene [gene.name] trying to add to already assigned gene block list (used by [english_list(assigned_gene_blocks[block])])") - assigned_gene_blocks[block] = gene + if(gene.block in GLOB.assigned_gene_blocks) + warning("DNA2: Gene [gene.name] trying to add to already assigned gene block list (used by [english_list(GLOB.assigned_gene_blocks[block])])") + GLOB.assigned_gene_blocks[block] = gene //testing("DNA2: [numsToAssign.len] blocks are unused: [english_list(numsToAssign)]") diff --git a/code/game/gamemodes/shadowling/shadowling.dm b/code/game/gamemodes/shadowling/shadowling.dm index b4b4b265711..d190009dbb2 100644 --- a/code/game/gamemodes/shadowling/shadowling.dm +++ b/code/game/gamemodes/shadowling/shadowling.dm @@ -171,7 +171,7 @@ Made by Xhuis replace_jobbanned_player(new_thrall_mind.current, ROLE_SHADOWLING) if(!victory_warning_announced && (length(shadowling_thralls) >= warning_threshold))//are the slings very close to winning? victory_warning_announced = TRUE //then let's give the station a warning - command_announcement.Announce("Large concentration of psychic bluespace energy detected by long-ranged scanners. Shadowling ascension event imminent. Prevent it at all costs!", "Central Command Higher Dimensional Affairs", 'sound/AI/spanomalies.ogg') + GLOB.command_announcement.Announce("Large concentration of psychic bluespace energy detected by long-ranged scanners. Shadowling ascension event imminent. Prevent it at all costs!", "Central Command Higher Dimensional Affairs", 'sound/AI/spanomalies.ogg') return 1 /datum/game_mode/proc/remove_thrall(datum/mind/thrall_mind, var/kill = 0) @@ -322,12 +322,12 @@ Made by Xhuis */ /datum/game_mode/proc/update_shadow_icons_added(datum/mind/shadow_mind) - var/datum/atom_hud/antag/shadow_hud = huds[ANTAG_HUD_SHADOW] + var/datum/atom_hud/antag/shadow_hud = GLOB.huds[ANTAG_HUD_SHADOW] shadow_hud.join_hud(shadow_mind.current) set_antag_hud(shadow_mind.current, ((shadow_mind in shadows) ? "hudshadowling" : "hudshadowlingthrall")) /datum/game_mode/proc/update_shadow_icons_removed(datum/mind/shadow_mind) //This should never actually occur, but it's here anyway. - var/datum/atom_hud/antag/shadow_hud = huds[ANTAG_HUD_SHADOW] + var/datum/atom_hud/antag/shadow_hud = GLOB.huds[ANTAG_HUD_SHADOW] shadow_hud.leave_hud(shadow_mind.current) set_antag_hud(shadow_mind.current, null) diff --git a/code/game/gamemodes/shadowling/shadowling_abilities.dm b/code/game/gamemodes/shadowling/shadowling_abilities.dm index 1671c4a03b0..37f7296bd4e 100644 --- a/code/game/gamemodes/shadowling/shadowling_abilities.dm +++ b/code/game/gamemodes/shadowling/shadowling_abilities.dm @@ -716,7 +716,7 @@ if(SSshuttle.emergency.mode == SHUTTLE_CALL) var/more_minutes = 6000 var/timer = SSshuttle.emergency.timeLeft(1) + more_minutes - event_announcement.Announce("Major system failure aboard the emergency shuttle. This will extend its arrival time by approximately 10 minutes and the shuttle is unable to be recalled.", "System Failure", 'sound/misc/notice1.ogg') + GLOB.event_announcement.Announce("Major system failure aboard the emergency shuttle. This will extend its arrival time by approximately 10 minutes and the shuttle is unable to be recalled.", "System Failure", 'sound/misc/notice1.ogg') SSshuttle.emergency.setTimer(timer) SSshuttle.emergency.canRecall = FALSE user.mind.spell_list.Remove(src) //Can only be used once! diff --git a/code/game/gamemodes/shadowling/special_shadowling_abilities.dm b/code/game/gamemodes/shadowling/special_shadowling_abilities.dm index 514a16174b1..7896a4aab61 100644 --- a/code/game/gamemodes/shadowling/special_shadowling_abilities.dm +++ b/code/game/gamemodes/shadowling/special_shadowling_abilities.dm @@ -1,5 +1,5 @@ //In here: Hatch and Ascendance -var/list/possibleShadowlingNames = list("U'ruan", "Y`shej", "Nex", "Hel-uae", "Noaey'gief", "Mii`mahza", "Amerziox", "Gyrg-mylin", "Kanet'pruunance", "Vigistaezian") //Unpronouncable 2: electric boogalo) +GLOBAL_LIST_INIT(possibleShadowlingNames, list("U'ruan", "Y`shej", "Nex", "Hel-uae", "Noaey'gief", "Mii`mahza", "Amerziox", "Gyrg-mylin", "Kanet'pruunance", "Vigistaezian")) //Unpronouncable 2: electric boogalo) /obj/effect/proc_holder/spell/targeted/shadowling_hatch name = "Hatch" desc = "Casts off your disguise." @@ -66,8 +66,8 @@ var/list/possibleShadowlingNames = list("U'ruan", "Y`shej", "Nex", "Hel-uae", "N H.status_flags = temp_flags sleep(10) playsound(H.loc, 'sound/effects/ghost.ogg', 100, 1) - var/newNameId = pick(possibleShadowlingNames) - possibleShadowlingNames.Remove(newNameId) + var/newNameId = pick(GLOB.possibleShadowlingNames) + GLOB.possibleShadowlingNames.Remove(newNameId) H.real_name = newNameId H.name = user.real_name H.SetStunned(0) diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm index 30f559c7ee2..c7ab4490f48 100644 --- a/code/game/gamemodes/traitor/traitor.dm +++ b/code/game/gamemodes/traitor/traitor.dm @@ -102,7 +102,7 @@ var/TC_uses = 0 var/uplink_true = 0 var/purchases = "" - for(var/obj/item/uplink/H in world_uplinks) + for(var/obj/item/uplink/H in GLOB.world_uplinks) if(H && H.uplink_owner && H.uplink_owner==traitor.key) TC_uses += H.used_TC uplink_true=1 diff --git a/code/game/gamemodes/vampire/vampire.dm b/code/game/gamemodes/vampire/vampire.dm index ac5ddc92f98..e0ea19b2f0a 100644 --- a/code/game/gamemodes/vampire/vampire.dm +++ b/code/game/gamemodes/vampire/vampire.dm @@ -359,12 +359,12 @@ You are weak to holy things and starlight. Don't go into space and avoid the Cha //prepare for copypaste /datum/game_mode/proc/update_vampire_icons_added(datum/mind/vampire_mind) - var/datum/atom_hud/antag/vamp_hud = huds[ANTAG_HUD_VAMPIRE] + var/datum/atom_hud/antag/vamp_hud = GLOB.huds[ANTAG_HUD_VAMPIRE] vamp_hud.join_hud(vampire_mind.current) set_antag_hud(vampire_mind.current, ((vampire_mind in vampires) ? "hudvampire" : "hudvampirethrall")) /datum/game_mode/proc/update_vampire_icons_removed(datum/mind/vampire_mind) - var/datum/atom_hud/antag/vampire_hud = huds[ANTAG_HUD_VAMPIRE] + var/datum/atom_hud/antag/vampire_hud = GLOB.huds[ANTAG_HUD_VAMPIRE] vampire_hud.leave_hud(vampire_mind.current) set_antag_hud(vampire_mind.current, null) diff --git a/code/game/gamemodes/vampire/vampire_powers.dm b/code/game/gamemodes/vampire/vampire_powers.dm index 24e47577c31..032bab0b6e8 100644 --- a/code/game/gamemodes/vampire/vampire_powers.dm +++ b/code/game/gamemodes/vampire/vampire_powers.dm @@ -397,7 +397,7 @@ /obj/effect/proc_holder/spell/vampire/bats/choose_targets(mob/user = usr) var/list/turf/locs = new - for(var/direction in alldirs) //looking for bat spawns + for(var/direction in GLOB.alldirs) //looking for bat spawns if(locs.len == num_bats) //we found 2 locations and thats all we need break var/turf/T = get_step(usr, direction) //getting a loc in that direction diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm index 0068a20f468..da7c6d4e1de 100644 --- a/code/game/gamemodes/wizard/artefact.dm +++ b/code/game/gamemodes/wizard/artefact.dm @@ -226,7 +226,7 @@ user.ghostize(1) /////////////////////Multiverse Blade//////////////////// -var/global/list/multiverse = list() +GLOBAL_LIST_EMPTY(multiverse) /obj/item/multisword name = "multiverse sword" @@ -252,11 +252,11 @@ var/global/list/multiverse = list() /obj/item/multisword/New() ..() - multiverse |= src + GLOB.multiverse |= src /obj/item/multisword/Destroy() - multiverse.Remove(src) + GLOB.multiverse.Remove(src) return ..() /obj/item/multisword/attack(mob/living/M as mob, mob/living/user as mob) //to prevent accidental friendly fire or out and out grief. @@ -303,7 +303,7 @@ var/global/list/multiverse = list() evil = FALSE else cooldown = world.time + cooldown_between_uses - for(var/obj/item/multisword/M in multiverse) + for(var/obj/item/multisword/M in GLOB.multiverse) if(M.assigned == assigned) M.cooldown = cooldown @@ -842,7 +842,7 @@ var/global/list/multiverse = list() user.unset_machine() if("r_leg","l_leg") to_chat(user, "You move the doll's legs around.") - var/turf/T = get_step(target,pick(cardinal)) + var/turf/T = get_step(target,pick(GLOB.cardinal)) target.Move(T) if("r_arm","l_arm") //use active hand on random nearby mob diff --git a/code/game/gamemodes/wizard/raginmages.dm b/code/game/gamemodes/wizard/raginmages.dm index 57a4f4e17de..cc52b431249 100644 --- a/code/game/gamemodes/wizard/raginmages.dm +++ b/code/game/gamemodes/wizard/raginmages.dm @@ -145,7 +145,7 @@ /datum/game_mode/wizard/raginmages/proc/makeBody(var/mob/dead/observer/G) if(!G || !G.key) return // Let's not steal someone's soul here - var/mob/living/carbon/human/new_character = new(pick(latejoin)) + var/mob/living/carbon/human/new_character = new(pick(GLOB.latejoin)) G.client.prefs.copy_to(new_character) new_character.key = G.key return new_character diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm index ba310ed0e8f..84f5b665e4f 100644 --- a/code/game/gamemodes/wizard/wizard.dm +++ b/code/game/gamemodes/wizard/wizard.dm @@ -30,14 +30,14 @@ wizard.assigned_role = SPECIAL_ROLE_WIZARD //So they aren't chosen for other jobs. wizard.special_role = SPECIAL_ROLE_WIZARD wizard.original = wizard.current - if(wizardstart.len == 0) + if(GLOB.wizardstart.len == 0) to_chat(wizard.current, "A starting location for you could not be found, please report this bug!") return 0 return 1 /datum/game_mode/wizard/pre_setup() for(var/datum/mind/wiz in wizards) - wiz.current.loc = pick(wizardstart) + wiz.current.loc = pick(GLOB.wizardstart) ..() return 1 @@ -68,12 +68,12 @@ SSticker.mode.update_wiz_icons_removed(wizard_mind) /datum/game_mode/proc/update_wiz_icons_added(datum/mind/wiz_mind) - var/datum/atom_hud/antag/wizhud = huds[ANTAG_HUD_WIZ] + var/datum/atom_hud/antag/wizhud = GLOB.huds[ANTAG_HUD_WIZ] wizhud.join_hud(wiz_mind.current) set_antag_hud(wiz_mind.current, ((wiz_mind in wizards) ? "hudwizard" : "apprentice")) /datum/game_mode/proc/update_wiz_icons_removed(datum/mind/wiz_mind) - var/datum/atom_hud/antag/wizhud = huds[ANTAG_HUD_WIZ] + var/datum/atom_hud/antag/wizhud = GLOB.huds[ANTAG_HUD_WIZ] wizhud.leave_hud(wiz_mind.current) set_antag_hud(wiz_mind.current, null) diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 2e1c16f956e..ad8f3bf6535 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -174,7 +174,7 @@ if(allow_loadout && H.client && (H.client.prefs.gear && H.client.prefs.gear.len)) for(var/gear in H.client.prefs.gear) - var/datum/gear/G = gear_datums[gear] + var/datum/gear/G = GLOB.gear_datums[gear] if(G) var/permitted = FALSE diff --git a/code/game/jobs/job/security.dm b/code/game/jobs/job/security.dm index 20364b57677..64e69e89765 100644 --- a/code/game/jobs/job/security.dm +++ b/code/game/jobs/job/security.dm @@ -149,7 +149,7 @@ if(visualsOnly) return - H.dna.SetSEState(SOBERBLOCK,1) + H.dna.SetSEState(GLOB.soberblock,1) H.mutations += SOBER H.check_mutations = 1 diff --git a/code/game/jobs/job/silicon.dm b/code/game/jobs/job/silicon.dm index 5325f077f4f..b6321765861 100644 --- a/code/game/jobs/job/silicon.dm +++ b/code/game/jobs/job/silicon.dm @@ -17,7 +17,7 @@ return 0 /datum/job/ai/is_position_available() - return (empty_playable_ai_cores.len != 0) + return (GLOB.empty_playable_ai_cores.len != 0) /datum/job/cyborg diff --git a/code/game/jobs/job/supervisor.dm b/code/game/jobs/job/supervisor.dm index a0814a4a86c..c56d27bb408 100644 --- a/code/game/jobs/job/supervisor.dm +++ b/code/game/jobs/job/supervisor.dm @@ -1,4 +1,4 @@ -var/datum/announcement/minor/captain_announcement = new(do_newscast = 0) +GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new(do_newscast = 0)) // Why the hell are captain announcements minor /datum/job/captain title = "Captain" flag = JOB_CAPTAIN @@ -23,7 +23,7 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 0) /datum/job/captain/announce(mob/living/carbon/human/H) . = ..() - captain_announcement.Announce("All hands, Captain [H.real_name] on deck!") + GLOB.captain_announcement.Announce("All hands, Captain [H.real_name] on deck!") /datum/outfit/job/captain name = "Captain" @@ -233,7 +233,7 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 0) -//var/global/lawyer = 0//Checks for another lawyer //This changed clothes on 2nd lawyer, both IA get the same dreds. +//GLOBAL_VAR_INIT(lawyer, 0) //Checks for another lawyer //This changed clothes on 2nd lawyer, both IA get the same dreds. | This was deprecated back in 2014, and its now 2020 /datum/job/lawyer title = "Internal Affairs Agent" flag = JOB_LAWYER diff --git a/code/game/jobs/job/support.dm b/code/game/jobs/job/support.dm index 7d4f5ccc622..d0064300b62 100644 --- a/code/game/jobs/job/support.dm +++ b/code/game/jobs/job/support.dm @@ -33,9 +33,9 @@ if(visualsOnly) return - H.dna.SetSEState(SOBERBLOCK,1) - genemutcheck(H, SOBERBLOCK, null, MUTCHK_FORCED) - H.dna.default_blocks.Add(SOBERBLOCK) + H.dna.SetSEState(GLOB.soberblock,1) + genemutcheck(H, GLOB.soberblock, null, MUTCHK_FORCED) + H.dna.default_blocks.Add(GLOB.soberblock) H.check_mutations = 1 @@ -286,13 +286,13 @@ var/obj/item/organ/internal/cyberimp/brain/clown_voice/implant = new implant.insert(H) - H.dna.SetSEState(CLUMSYBLOCK, TRUE) - genemutcheck(H, CLUMSYBLOCK, null, MUTCHK_FORCED) - H.dna.default_blocks.Add(CLUMSYBLOCK) + H.dna.SetSEState(GLOB.clumsyblock, TRUE) + genemutcheck(H, GLOB.clumsyblock, null, MUTCHK_FORCED) + H.dna.default_blocks.Add(GLOB.clumsyblock) if(!ismachine(H)) - H.dna.SetSEState(COMICBLOCK, TRUE) - genemutcheck(H, COMICBLOCK, null, MUTCHK_FORCED) - H.dna.default_blocks.Add(COMICBLOCK) + H.dna.SetSEState(GLOB.comicblock, TRUE) + genemutcheck(H, GLOB.comicblock, null, MUTCHK_FORCED) + H.dna.default_blocks.Add(GLOB.comicblock) H.check_mutations = TRUE H.add_language("Clownish") diff --git a/code/game/jobs/job/syndicate.dm b/code/game/jobs/job/syndicate.dm index f7c5659f86c..f1bf52cbc8a 100644 --- a/code/game/jobs/job/syndicate.dm +++ b/code/game/jobs/job/syndicate.dm @@ -51,7 +51,7 @@ U.implant(H) U.hidden_uplink.uses = 500 H.faction += "syndicate" - var/datum/atom_hud/antag/opshud = huds[ANTAG_HUD_OPS] + var/datum/atom_hud/antag/opshud = GLOB.huds[ANTAG_HUD_OPS] opshud.join_hud(H.mind.current) H.mind.offstation_role = TRUE set_antag_hud(H.mind.current, "hudoperative") diff --git a/code/game/jobs/job_exp.dm b/code/game/jobs/job_exp.dm index 7823b4b6f4a..f0e6f9bff42 100644 --- a/code/game/jobs/job_exp.dm +++ b/code/game/jobs/job_exp.dm @@ -1,6 +1,6 @@ // Playtime requirements for special roles (hours) -var/global/list/role_playtime_requirements = list( +GLOBAL_LIST_INIT(role_playtime_requirements, list( // NT ROLES ROLE_PAI = 0, ROLE_POSIBRAIN = 5, // Same as cyborg job. @@ -35,7 +35,7 @@ var/global/list/role_playtime_requirements = list( ROLE_RAIDER = 10, ROLE_ALIEN = 10, ROLE_ABDUCTOR = 10, -) +)) // Client Verbs @@ -113,7 +113,7 @@ var/global/list/role_playtime_requirements = list( var/isexempt = text2num(play_records[EXP_TYPE_EXEMPT]) if(isexempt) return 0 - var/minimal_player_hrs = role_playtime_requirements[role] + var/minimal_player_hrs = GLOB.role_playtime_requirements[role] if(!minimal_player_hrs) return 0 var/req_mins = minimal_player_hrs * 60 @@ -163,7 +163,7 @@ var/global/list/role_playtime_requirements = list( return "[key] has no records." var/return_text = "
    " var/list/exp_data = list() - for(var/category in exp_jobsmap) + for(var/category in GLOB.exp_jobsmap) if(text2num(play_records[category])) exp_data[category] = text2num(play_records[category]) else @@ -238,7 +238,7 @@ var/global/list/role_playtime_requirements = list( /client/proc/update_exp_client(var/minutes, var/announce_changes = 0) if(!src ||!ckey) return - var/DBQuery/exp_read = dbcon.NewQuery("SELECT exp FROM [format_table_name("player")] WHERE ckey='[ckey]'") + var/DBQuery/exp_read = GLOB.dbcon.NewQuery("SELECT exp FROM [format_table_name("player")] WHERE ckey='[ckey]'") if(!exp_read.Execute()) var/err = exp_read.ErrorMsg() log_game("SQL ERROR during exp_update_client read. Error : \[[err]\]\n") @@ -252,7 +252,7 @@ var/global/list/role_playtime_requirements = list( if(!hasread) return var/list/play_records = list() - for(var/rtype in exp_jobsmap) + for(var/rtype in GLOB.exp_jobsmap) if(text2num(read_records[rtype])) play_records[rtype] = text2num(read_records[rtype]) else @@ -270,9 +270,9 @@ var/global/list/role_playtime_requirements = list( added_living += minutes if(announce_changes) to_chat(mob,"You got: [minutes] Living EXP!") - for(var/category in exp_jobsmap) - if(exp_jobsmap[category]["titles"]) - if(myrole in exp_jobsmap[category]["titles"]) + for(var/category in GLOB.exp_jobsmap) + if(GLOB.exp_jobsmap[category]["titles"]) + if(myrole in GLOB.exp_jobsmap[category]["titles"]) play_records[category] += minutes if(announce_changes) to_chat(mob,"You got: [minutes] [category] EXP!") @@ -290,13 +290,13 @@ var/global/list/role_playtime_requirements = list( var/new_exp = list2params(play_records) prefs.exp = new_exp new_exp = sanitizeSQL(new_exp) - var/DBQuery/update_query = dbcon.NewQuery("UPDATE [format_table_name("player")] SET exp = '[new_exp]',lastseen = Now() WHERE ckey='[ckey]'") + var/DBQuery/update_query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("player")] SET exp = '[new_exp]',lastseen = Now() WHERE ckey='[ckey]'") if(!update_query.Execute()) var/err = update_query.ErrorMsg() log_game("SQL ERROR during exp_update_client write 1. Error : \[[err]\]\n") message_admins("SQL ERROR during exp_update_client write 1. Error : \[[err]\]\n") return - var/DBQuery/update_query_history = dbcon.NewQuery("INSERT INTO [format_table_name("playtime_history")] (ckey, date, time_living, time_ghost) VALUES ('[ckey]',CURDATE(),[added_living],[added_ghost]) ON DUPLICATE KEY UPDATE time_living=time_living+VALUES(time_living),time_ghost=time_ghost+VALUES(time_ghost)") + var/DBQuery/update_query_history = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("playtime_history")] (ckey, date, time_living, time_ghost) VALUES ('[ckey]',CURDATE(),[added_living],[added_ghost]) ON DUPLICATE KEY UPDATE time_living=time_living+VALUES(time_living),time_ghost=time_ghost+VALUES(time_ghost)") if(!update_query_history.Execute()) var/err = update_query_history.ErrorMsg() log_game("SQL ERROR during exp_update_client write 2. Error : \[[err]\]\n") diff --git a/code/game/jobs/jobs.dm b/code/game/jobs/jobs.dm index b0d70fb3003..8ff6b58e5c4 100644 --- a/code/game/jobs/jobs.dm +++ b/code/game/jobs/jobs.dm @@ -1,9 +1,8 @@ -var/list/assistant_occupations = list( -) +GLOBAL_LIST_EMPTY(assistant_occupations) -var/list/command_positions = list( +GLOBAL_LIST_INIT(command_positions, list( "Captain", "Head of Personnel", "Head of Security", @@ -11,18 +10,18 @@ var/list/command_positions = list( "Research Director", "Chief Medical Officer", "Nanotrasen Representative" -) +)) -var/list/engineering_positions = list( +GLOBAL_LIST_INIT(engineering_positions, list( "Chief Engineer", "Station Engineer", "Life Support Specialist", "Mechanic" -) +)) -var/list/medical_positions = list( +GLOBAL_LIST_INIT(medical_positions, list( "Chief Medical Officer", "Medical Doctor", "Geneticist", @@ -31,18 +30,18 @@ var/list/medical_positions = list( "Virologist", "Paramedic", "Coroner" -) +)) -var/list/science_positions = list( +GLOBAL_LIST_INIT(science_positions, list( "Research Director", "Scientist", "Geneticist", //Part of both medical and science "Roboticist", -) +)) //BS12 EDIT -var/list/support_positions = list( +GLOBAL_LIST_INIT(support_positions, list( "Head of Personnel", "Bartender", "Botanist", @@ -60,19 +59,19 @@ var/list/support_positions = list( "Magistrate", "Nanotrasen Representative", "Blueshield" -) +)) -var/list/supply_positions = list( +GLOBAL_LIST_INIT(supply_positions, list( "Head of Personnel", "Quartermaster", "Cargo Technician", "Shaft Miner" -) +)) -var/list/service_positions = support_positions - supply_positions + list("Head of Personnel") +GLOBAL_LIST_INIT(service_positions, (support_positions - supply_positions + list("Head of Personnel"))) -var/list/security_positions = list( +GLOBAL_LIST_INIT(security_positions, list( "Head of Security", "Warden", "Detective", @@ -80,21 +79,21 @@ var/list/security_positions = list( "Brig Physician", "Security Pod Pilot", "Magistrate" -) +)) -var/list/civilian_positions = list( +GLOBAL_LIST_INIT(civilian_positions, list( "Civilian" -) +)) -var/list/nonhuman_positions = list( +GLOBAL_LIST_INIT(nonhuman_positions, list( "AI", "Cyborg", "Drone", "pAI" -) +)) -var/list/whitelisted_positions = list( +GLOBAL_LIST_INIT(whitelisted_positions, list( "Blueshield", "Nanotrasen Representative", "Barber", @@ -102,11 +101,11 @@ var/list/whitelisted_positions = list( "Brig Physician", "Magistrate", "Security Pod Pilot", -) +)) /proc/guest_jobbans(var/job) - return (job in whitelisted_positions) + return (job in GLOB.whitelisted_positions) /proc/get_job_datums() var/list/occupations = list() @@ -130,7 +129,7 @@ var/list/whitelisted_positions = list( return titles -var/global/list/exp_jobsmap = list( +GLOBAL_LIST_INIT(exp_jobsmap, list( EXP_TYPE_LIVING = list(), // all living mobs EXP_TYPE_CREW = list(titles = command_positions | engineering_positions | medical_positions | science_positions | support_positions | supply_positions | security_positions | civilian_positions | list("AI","Cyborg") | whitelisted_positions), // crew positions EXP_TYPE_SPECIAL = list(), // antags, ERT, etc @@ -145,4 +144,4 @@ var/global/list/exp_jobsmap = list( EXP_TYPE_SILICON = list(titles = list("AI","Cyborg")), EXP_TYPE_SERVICE = list(titles = service_positions), EXP_TYPE_WHITELIST = list(titles = whitelisted_positions) // karma-locked jobs -) +)) diff --git a/code/game/jobs/whitelist.dm b/code/game/jobs/whitelist.dm index 503dd33258e..ab1bd3b8067 100644 --- a/code/game/jobs/whitelist.dm +++ b/code/game/jobs/whitelist.dm @@ -1,6 +1,6 @@ #define WHITELISTFILE "data/whitelist.txt" -var/list/whitelist = list() +GLOBAL_LIST_EMPTY(whitelist) /hook/startup/proc/loadWhitelist() if(config.usewhitelist) @@ -8,8 +8,8 @@ var/list/whitelist = list() return 1 /proc/load_whitelist() - whitelist = file2list(WHITELISTFILE) - if(!whitelist.len) whitelist = null + GLOB.whitelist = file2list(WHITELISTFILE) + if(!GLOB.whitelist.len) GLOB.whitelist = null /* /proc/check_whitelist(mob/M, var/rank) if(!whitelist) @@ -25,11 +25,11 @@ var/list/whitelist = list() return 1 if(check_rights(R_ADMIN, 0, M)) return 1 - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) to_chat(usr, "Unable to connect to whitelist database. Please try again later.
    ") return 0 else - var/DBQuery/query = dbcon.NewQuery("SELECT job FROM [format_table_name("whitelist")] WHERE ckey='[M.ckey]'") + var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT job FROM [format_table_name("whitelist")] WHERE ckey='[M.ckey]'") query.Execute() @@ -46,7 +46,7 @@ var/list/whitelist = list() -/var/list/alien_whitelist = list() +GLOBAL_LIST_EMPTY(alien_whitelist) /hook/startup/proc/loadAlienWhitelist() if(config.usealienwhitelist) @@ -58,7 +58,7 @@ var/list/whitelist = list() if(!text) log_config("Failed to load config/alienwhitelist.txt\n") else - alien_whitelist = splittext(text, "\n") + GLOB.alien_whitelist = splittext(text, "\n") //todo: admin aliens /proc/is_alien_whitelisted(mob/M, var/species) @@ -70,13 +70,13 @@ var/list/whitelist = list() return 1 if(check_rights(R_ADMIN, 0)) return 1 - if(!alien_whitelist) + if(!GLOB.alien_whitelist) return 0 - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) to_chat(usr, "Unable to connect to whitelist database. Please try again later.
    ") return 0 else - var/DBQuery/query = dbcon.NewQuery("SELECT species FROM [format_table_name("whitelist")] WHERE ckey='[M.ckey]'") + var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT species FROM [format_table_name("whitelist")] WHERE ckey='[M.ckey]'") query.Execute() while(query.NextRow()) diff --git a/code/game/machinery/Freezer.dm b/code/game/machinery/Freezer.dm index 097d2e26da2..d9243005ead 100644 --- a/code/game/machinery/Freezer.dm +++ b/code/game/machinery/Freezer.dm @@ -118,7 +118,7 @@ // auto update every Master Controller tick ui.set_auto_update(1) -/obj/machinery/atmospherics/unary/cold_sink/freezer/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/atmospherics/unary/cold_sink/freezer/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["on"] = on ? 1 : 0 data["gasPressure"] = round(air_contents.return_pressure()) @@ -287,7 +287,7 @@ // auto update every Master Controller tick ui.set_auto_update(1) -/obj/machinery/atmospherics/unary/heat_reservoir/heater/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/atmospherics/unary/heat_reservoir/heater/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["on"] = on ? 1 : 0 data["gasPressure"] = round(air_contents.return_pressure()) diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index a8fabc1fab7..02d95278e30 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -227,7 +227,7 @@ if(SSradio) SSradio.remove_object(src, frequency) radio_connection = null - air_alarm_repository.update_cache(src) + GLOB.air_alarm_repository.update_cache(src) QDEL_NULL(wires) if(alarm_area && alarm_area.master_air_alarm == src) alarm_area.master_air_alarm = null @@ -241,7 +241,7 @@ if(name == "alarm") name = "[alarm_area.name] Air Alarm" apply_preset(1) // Don't cycle. - air_alarm_repository.update_cache(src) + GLOB.air_alarm_repository.update_cache(src) /obj/machinery/alarm/Initialize() ..() @@ -658,7 +658,7 @@ data["danger"] = danger return data -/obj/machinery/alarm/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/alarm/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] var/list/href_list = state.href_list(user) @@ -774,7 +774,7 @@ return thresholds -/obj/machinery/alarm/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state) +/obj/machinery/alarm/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = GLOB.default_state) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "air_alarm.tmpl", name, 570, 410, state = state) diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index efcdada302d..d91fba5fa5c 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -40,8 +40,7 @@ list("name" = "High temperature canister", "icon" = "hot"), list("name" = "Plasma containing canister", "icon" = "plasma") ) - -var/datum/canister_icons/canister_icon_container = new() +GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new()) /obj/machinery/portable_atmospherics/canister name = "canister" @@ -97,19 +96,19 @@ var/datum/canister_icons/canister_icon_container = new() //passed to the ui to render the color lists colorcontainer = list( "prim" = list( - "options" = canister_icon_container.possiblemaincolor, + "options" = GLOB.canister_icon_container.possiblemaincolor, "name" = "Primary color", ), "sec" = list( - "options" = canister_icon_container.possibleseccolor, + "options" = GLOB.canister_icon_container.possibleseccolor, "name" = "Secondary color", ), "ter" = list( - "options" = canister_icon_container.possibletertcolor, + "options" = GLOB.canister_icon_container.possibletertcolor, "name" = "Tertiary color", ), "quart" = list( - "options" = canister_icon_container.possiblequartcolor, + "options" = GLOB.canister_icon_container.possiblequartcolor, "name" = "Quaternary color", ) ) @@ -127,7 +126,7 @@ var/datum/canister_icons/canister_icon_container = new() possibledecals = list() var/i - var/list/L = canister_icon_container.possibledecals + var/list/L = GLOB.canister_icon_container.possibledecals for(i=1;i<=L.len;i++) var/list/LL = L[i] LL = LL.Copy() //make sure we don't edit the datum list @@ -220,25 +219,25 @@ update_flag //template modification exploit prevention, used in Topic() /obj/machinery/portable_atmospherics/canister/proc/is_a_color(var/inputVar, var/checkColor = "all") if(checkColor == "prim" || checkColor == "all") - for(var/list/L in canister_icon_container.possiblemaincolor) + for(var/list/L in GLOB.canister_icon_container.possiblemaincolor) if(L["icon"] == inputVar) return 1 if(checkColor == "sec" || checkColor == "all") - for(var/list/L in canister_icon_container.possibleseccolor) + for(var/list/L in GLOB.canister_icon_container.possibleseccolor) if(L["icon"] == inputVar) return 1 if(checkColor == "ter" || checkColor == "all") - for(var/list/L in canister_icon_container.possibletertcolor) + for(var/list/L in GLOB.canister_icon_container.possibletertcolor) if(L["icon"] == inputVar) return 1 if(checkColor == "quart" || checkColor == "all") - for(var/list/L in canister_icon_container.possiblequartcolor) + for(var/list/L in GLOB.canister_icon_container.possiblequartcolor) if(L["icon"] == inputVar) return 1 return 0 /obj/machinery/portable_atmospherics/canister/proc/is_a_decal(var/inputVar) - for(var/list/L in canister_icon_container.possibledecals) + for(var/list/L in GLOB.canister_icon_container.possibledecals) if(L["icon"] == inputVar) return 1 return 0 @@ -354,7 +353,7 @@ update_flag /obj/machinery/portable_atmospherics/canister/attack_hand(var/mob/user as mob) return src.ui_interact(user) -/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = physical_state) +/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = GLOB.physical_state) if(src.destroyed) return diff --git a/code/game/machinery/atmoalter/pump.dm b/code/game/machinery/atmoalter/pump.dm index e4bdef2f147..0144a7f93c2 100644 --- a/code/game/machinery/atmoalter/pump.dm +++ b/code/game/machinery/atmoalter/pump.dm @@ -115,7 +115,7 @@ /obj/machinery/portable_atmospherics/pump/attack_hand(var/mob/user as mob) ui_interact(user) -/obj/machinery/portable_atmospherics/pump/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = physical_state) +/obj/machinery/portable_atmospherics/pump/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = GLOB.physical_state) // update the ui if it exists, returns null if no ui is passed/found ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) @@ -127,7 +127,7 @@ // auto update every Master Controller tick ui.set_auto_update(1) -/obj/machinery/portable_atmospherics/pump/ui_data(mob/user, ui_key = "main", datum/topic_state/state = physical_state) +/obj/machinery/portable_atmospherics/pump/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.physical_state) var/data[0] data["portConnected"] = connected_port ? 1 : 0 data["tankPressure"] = round(air_contents.return_pressure() > 0 ? air_contents.return_pressure() : 0) diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm index 1016e270f6d..36e340d1a12 100644 --- a/code/game/machinery/atmoalter/scrubber.dm +++ b/code/game/machinery/atmoalter/scrubber.dm @@ -116,7 +116,7 @@ ui_interact(user) return -/obj/machinery/portable_atmospherics/scrubber/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = physical_state) +/obj/machinery/portable_atmospherics/scrubber/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = GLOB.physical_state) // update the ui if it exists, returns null if no ui is passed/found ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) @@ -128,7 +128,7 @@ // auto update every Master Controller tick ui.set_auto_update(1) -/obj/machinery/portable_atmospherics/scrubber/ui_data(mob/user, ui_key = "main", datum/topic_state/state = physical_state) +/obj/machinery/portable_atmospherics/scrubber/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.physical_state) var/data[0] data["portConnected"] = connected_port ? 1 : 0 data["tankPressure"] = round(air_contents.return_pressure() > 0 ? air_contents.return_pressure() : 0) diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 9d9db841b1e..78367327a0c 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -86,7 +86,7 @@ ui = new(user, src, ui_key, "autolathe.tmpl", name, 800, 550) ui.open() -/obj/machinery/autolathe/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/autolathe/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) GET_COMPONENT(materials, /datum/component/material_container) var/data[0] data["screen"] = screen diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index c097a19f4f8..5bc32a0172e 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -43,8 +43,8 @@ assembly.anchored = 1 assembly.update_icon() - cameranet.cameras += src - cameranet.addCamera(src) + GLOB.cameranet.cameras += src + GLOB.cameranet.addCamera(src) /obj/machinery/camera/Initialize() ..() @@ -61,8 +61,8 @@ bug.current = null bug = null QDEL_NULL(wires) - cameranet.removeCamera(src) //Will handle removal from the camera network and the chunks, so we don't need to worry about that - cameranet.cameras -= src + GLOB.cameranet.removeCamera(src) //Will handle removal from the camera network and the chunks, so we don't need to worry about that + GLOB.cameranet.cameras -= src var/area/ai_monitored/A = get_area(src) if(istype(A)) A.motioncamera = null @@ -77,7 +77,7 @@ update_icon() var/list/previous_network = network network = list() - cameranet.removeCamera(src) + GLOB.cameranet.removeCamera(src) stat |= EMPED set_light(0) emped = emped+1 //Increase the number of consecutive EMP's @@ -91,7 +91,7 @@ stat &= ~EMPED update_icon() if(can_use()) - cameranet.addCamera(src) + GLOB.cameranet.addCamera(src) emped = 0 //Resets the consecutive EMP count spawn(100) if(!QDELETED(src)) @@ -116,7 +116,7 @@ /obj/machinery/camera/proc/setViewRange(num = 7) view_range = num - cameranet.updateVisibility(src, 0) + GLOB.cameranet.updateVisibility(src, 0) /obj/machinery/camera/singularity_pull(S, current_size) if (status && current_size >= STAGE_FIVE) // If the singulo is strong enough to pull anchored objects and the camera is still active, turn off the camera as it gets ripped off the wall. @@ -285,11 +285,11 @@ /obj/machinery/camera/proc/toggle_cam(mob/user, displaymessage = TRUE) status = !status if(can_use()) - cameranet.addCamera(src) + GLOB.cameranet.addCamera(src) else set_light(0) - cameranet.removeCamera(src) - cameranet.updateChunk(x, y, z) + GLOB.cameranet.removeCamera(src) + GLOB.cameranet.updateChunk(x, y, z) var/change_msg = "deactivates" if(status) change_msg = "reactivates" @@ -376,7 +376,7 @@ return null /obj/machinery/camera/proc/Togglelight(on = FALSE) - for(var/mob/living/silicon/ai/A in ai_list) + for(var/mob/living/silicon/ai/A in GLOB.ai_list) for(var/obj/machinery/camera/cam in A.lit_cameras) if(cam == src) return @@ -428,6 +428,6 @@ assembly.update_icon() /obj/machinery/camera/portable/process() //Updates whenever the camera is moved. - if(cameranet && get_turf(src) != prev_turf) - cameranet.updatePortableCamera(src) + if(GLOB.cameranet && get_turf(src) != prev_turf) + GLOB.cameranet.updatePortableCamera(src) prev_turf = get_turf(src) diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 98f84cb75ec..c7d95370613 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -92,7 +92,7 @@ C.network = uniquelist(tempnetwork) tempnetwork = difflist(C.network,GLOB.restricted_camera_networks) if(!tempnetwork.len) // Camera isn't on any open network - remove its chunk from AI visibility. - cameranet.removeCamera(C) + GLOB.cameranet.removeCamera(C) C.c_tag = input diff --git a/code/game/machinery/camera/presets.dm b/code/game/machinery/camera/presets.dm index 85b83b88c06..0bd241ee0a0 100644 --- a/code/game/machinery/camera/presets.dm +++ b/code/game/machinery/camera/presets.dm @@ -74,7 +74,7 @@ assembly.upgrades.Add(new /obj/item/analyzer(assembly)) setPowerUsage() //Update what it can see. - cameranet.updateVisibility(src, 0) + GLOB.cameranet.updateVisibility(src, 0) // If you are upgrading Motion, and it isn't in the camera's New(), add it to the machines list. /obj/machinery/camera/proc/upgradeMotion() diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm index 5e6bd1640fb..1c247b23c03 100644 --- a/code/game/machinery/camera/tracking.dm +++ b/code/game/machinery/camera/tracking.dm @@ -17,7 +17,7 @@ return var/list/L = list() - for(var/obj/machinery/camera/C in cameranet.cameras) + for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) L.Add(C) camera_sort(L) @@ -226,9 +226,9 @@ return 0 if(isrobot(M)) var/mob/living/silicon/robot/R = M - if(!(R.camera && R.camera.can_use()) && !cameranet.checkCameraVis(M)) + if(!(R.camera && R.camera.can_use()) && !GLOB.cameranet.checkCameraVis(M)) return 0 - else if(!cameranet.checkCameraVis(M)) + else if(!GLOB.cameranet.checkCameraVis(M)) return 0 return 1 diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 721162c0794..3aef616eb98 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -153,7 +153,7 @@ for(var/i=new_SE.len;i<=DNA_SE_LENGTH;i++) new_SE += rand(1,1024) buf.dna.SE=new_SE - buf.dna.SetSEValueRange(MONKEYBLOCK,0xDAC, 0xFFF) + buf.dna.SetSEValueRange(GLOB.monkeyblock,0xDAC, 0xFFF) //Disk stuff. /obj/item/disk/data/New() diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm index ad11d6fb7c5..21fddce64b7 100644 --- a/code/game/machinery/computer/Operating.dm +++ b/code/game/machinery/computer/Operating.dm @@ -61,7 +61,7 @@ ui.open() ui.set_auto_update(1) -/obj/machinery/computer/operating/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/operating/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] var/mob/living/carbon/human/occupant if(table) diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index d53903857ef..ba139e50855 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -158,7 +158,7 @@ var/open_for_latejoin = alert(user, "Would you like this core to be open for latejoining AIs?", "Latejoin", "Yes", "Yes", "No") == "Yes" var/obj/structure/AIcore/deactivated/D = new(loc) if(open_for_latejoin) - empty_playable_ai_cores += D + GLOB.empty_playable_ai_cores += D else if(brain.brainmob.mind) SSticker.mode.remove_cultist(brain.brainmob.mind, 1) @@ -248,8 +248,8 @@ circuit = new(src) /obj/structure/AIcore/deactivated/Destroy() - if(src in empty_playable_ai_cores) - empty_playable_ai_cores -= src + if(src in GLOB.empty_playable_ai_cores) + GLOB.empty_playable_ai_cores -= src return ..() /client/proc/empty_ai_core_toggle_latejoin() @@ -269,11 +269,11 @@ var/obj/structure/AIcore/deactivated/D = cores[id] if(!D) return - if(D in empty_playable_ai_cores) - empty_playable_ai_cores -= D + if(D in GLOB.empty_playable_ai_cores) + GLOB.empty_playable_ai_cores -= D to_chat(src, "\The [id] is now not available for latejoining AIs.") else - empty_playable_ai_cores += D + GLOB.empty_playable_ai_cores += D to_chat(src, "\The [id] is now available for latejoining AIs.") diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm index f8c2979e043..a8e30eb0979 100644 --- a/code/game/machinery/computer/atmos_alert.dm +++ b/code/game/machinery/computer/atmos_alert.dm @@ -1,5 +1,5 @@ -var/global/list/priority_air_alarms = list() -var/global/list/minor_air_alarms = list() +GLOBAL_LIST_EMPTY(priority_air_alarms) +GLOBAL_LIST_EMPTY(minor_air_alarms) /obj/machinery/computer/atmos_alert @@ -67,12 +67,11 @@ var/global/list/minor_air_alarms = list() var/obj/machinery/alarm/air_alarm = alarm_source.source if(istype(air_alarm)) var/list/new_ref = list("atmos_reset" = 1) - air_alarm.Topic(href, new_ref, state = air_alarm_topic) + air_alarm.Topic(href, new_ref, state = GLOB.air_alarm_topic) update_icon() return 1 - -var/datum/topic_state/air_alarm_topic/air_alarm_topic = new() +GLOBAL_DATUM_INIT(air_alarm_topic, /datum/topic_state/air_alarm_topic, new) /datum/topic_state/air_alarm_topic/href_list(var/mob/user) var/list/extra_href = list() diff --git a/code/game/machinery/computer/brigcells.dm b/code/game/machinery/computer/brigcells.dm index 378c10d9783..a391bfa4021 100644 --- a/code/game/machinery/computer/brigcells.dm +++ b/code/game/machinery/computer/brigcells.dm @@ -30,7 +30,7 @@ ui.open() ui.set_auto_update(1) -/obj/machinery/computer/brigcells/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/brigcells/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] var/list/timers = list() for(var/obj/machinery/door_timer/T in GLOB.celltimers_list) diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index f67158f82b0..c95735507a5 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -113,7 +113,7 @@ access = get_all_accesses() // Assume captain level access when emagged else if(ishuman(user)) access = user.get_access() - else if((isAI(user) || isrobot(user)) && CanUseTopic(user, default_state) == STATUS_INTERACTIVE) + else if((isAI(user) || isrobot(user)) && CanUseTopic(user, GLOB.default_state) == STATUS_INTERACTIVE) access = get_all_accesses() // Assume captain level access when AI else if(user.can_admin_interact()) access = get_all_accesses() @@ -131,11 +131,11 @@ ui.open() -/obj/machinery/computer/security/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/security/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] var/list/cameras = list() - for(var/obj/machinery/camera/C in cameranet.cameras) + for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) if(isCameraFarAway(C)) continue if(!can_access_camera(C, user)) @@ -183,7 +183,7 @@ return 1 if(href_list["switchTo"]) - var/obj/machinery/camera/C = locate(href_list["switchTo"]) in cameranet.cameras + var/obj/machinery/camera/C = locate(href_list["switchTo"]) in GLOB.cameranet.cameras if(!C) return 1 @@ -209,7 +209,7 @@ // Check if camera is accessible when jumping /obj/machinery/computer/security/proc/can_access_camera(var/obj/machinery/camera/C, var/mob/M) - if(CanUseTopic(M, default_state) != STATUS_INTERACTIVE || M.incapacitated() || !M.has_vision()) + if(CanUseTopic(M, GLOB.default_state) != STATUS_INTERACTIVE || M.incapacitated() || !M.has_vision()) return 0 if(isrobot(M)) diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index b70addea909..76242c4a0e4 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -75,7 +75,7 @@ if(!eyeobj.eye_initialized) var/camera_location - for(var/obj/machinery/camera/C in cameranet.cameras) + for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) if(!C.can_use()) continue if(C.network&networks) @@ -139,7 +139,7 @@ T = get_turf(T) loc = T if(use_static) - cameranet.visibility(src, GetViewerClient()) + GLOB.cameranet.visibility(src, GetViewerClient()) if(visible_icon) if(eye_user.client) eye_user.client.images -= user_image @@ -189,7 +189,7 @@ var/list/L = list() - for(var/obj/machinery/camera/cam in cameranet.cameras) + for(var/obj/machinery/camera/cam in GLOB.cameranet.cameras) L.Add(cam) camera_sort(L) diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index 07ab3f5d62b..de85ad842b7 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -1,6 +1,6 @@ //Keeps track of the time for the ID console. Having it as a global variable prevents people from dismantling/reassembling it to //increase the slots of many jobs. -var/time_last_changed_position = 0 +GLOBAL_VAR_INIT(time_last_changed_position, 0) /obj/machinery/computer/card name = "identification computer" @@ -160,7 +160,7 @@ var/time_last_changed_position = 0 if(job) if(!job_blacklisted_full(job) && !job_blacklisted_partial(job) && job_in_department(job, FALSE)) if((job.total_positions <= GLOB.player_list.len * (max_relative_positions / 100))) - var/delta = (world.time / 10) - time_last_changed_position + var/delta = (world.time / 10) - GLOB.time_last_changed_position if((change_position_cooldown < delta) || (opened_positions[job.title] < 0)) return 1 return -2 @@ -172,7 +172,7 @@ var/time_last_changed_position = 0 if(job) if(!job_blacklisted_full(job) && !job_blacklisted_partial(job) && job_in_department(job, FALSE)) if(job.total_positions > job.current_positions && !(job in SSjobs.prioritized_jobs)) - var/delta = (world.time / 10) - time_last_changed_position + var/delta = (world.time / 10) - GLOB.time_last_changed_position if((change_position_cooldown < delta) || (opened_positions[job.title] > 0)) return 1 return -2 @@ -236,13 +236,13 @@ var/time_last_changed_position = 0 ui = new(user, src, ui_key, "identification_computer.tmpl", src.name, 775, 700) ui.open() -/obj/machinery/computer/card/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/card/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["src"] = UID() data["station_name"] = station_name() data["mode"] = mode data["printing"] = printing - data["manifest"] = data_core ? data_core.get_manifest(0) : null + data["manifest"] = GLOB.data_core ? GLOB.data_core.get_manifest(0) : null data["target_name"] = modify ? modify.name : "-----" data["target_owner"] = modify && modify.registered_name ? modify.registered_name : "-----" data["target_rank"] = get_target_rank() @@ -260,19 +260,19 @@ var/time_last_changed_position = 0 var/list/job_formats = SSjobs.format_jobs_for_id_computer(modify) data["top_jobs"] = format_jobs(list("Captain", "Custom"), data["target_rank"], job_formats) - data["engineering_jobs"] = format_jobs(engineering_positions, data["target_rank"], job_formats) - data["medical_jobs"] = format_jobs(medical_positions, data["target_rank"], job_formats) - data["science_jobs"] = format_jobs(science_positions, data["target_rank"], job_formats) - data["security_jobs"] = format_jobs(security_positions, data["target_rank"], job_formats) - data["support_jobs"] = format_jobs(support_positions, data["target_rank"], job_formats) - data["civilian_jobs"] = format_jobs(civilian_positions, data["target_rank"], job_formats) - data["special_jobs"] = format_jobs(whitelisted_positions, data["target_rank"], job_formats) + data["engineering_jobs"] = format_jobs(GLOB.engineering_positions, data["target_rank"], job_formats) + data["medical_jobs"] = format_jobs(GLOB.medical_positions, data["target_rank"], job_formats) + data["science_jobs"] = format_jobs(GLOB.science_positions, data["target_rank"], job_formats) + data["security_jobs"] = format_jobs(GLOB.security_positions, data["target_rank"], job_formats) + data["support_jobs"] = format_jobs(GLOB.support_positions, data["target_rank"], job_formats) + data["civilian_jobs"] = format_jobs(GLOB.civilian_positions, data["target_rank"], job_formats) + data["special_jobs"] = format_jobs(GLOB.whitelisted_positions, data["target_rank"], job_formats) data["centcom_jobs"] = format_jobs(get_all_centcom_jobs(), data["target_rank"], job_formats) data["card_skins"] = format_card_skins(get_station_card_skins()) data["job_slots"] = format_job_slots() - var/time_to_wait = round(change_position_cooldown - ((world.time / 10) - time_last_changed_position), 1) + var/time_to_wait = round(change_position_cooldown - ((world.time / 10) - GLOB.time_last_changed_position), 1) var/mins = round(time_to_wait / 60) var/seconds = time_to_wait - (60*mins) data["cooldown_mins"] = mins @@ -321,7 +321,7 @@ var/time_last_changed_position = 0 switch(href_list["choice"]) if("modify") if(modify) - data_core.manifest_modify(modify.registered_name, modify.assignment) + GLOB.data_core.manifest_modify(modify.registered_name, modify.assignment) modify.name = text("[modify.registered_name]'s ID Card ([modify.assignment])") if(ishuman(usr)) modify.forceMove(get_turf(src)) @@ -480,7 +480,7 @@ var/time_last_changed_position = 0 P.name = "crew manifest ([station_time_timestamp()])" P.info = {"

    Crew Manifest


    - [data_core ? data_core.get_manifest(0) : ""] + [GLOB.data_core ? GLOB.data_core.get_manifest(0) : ""] "} else if(modify && !mode) P.name = "access report" @@ -544,7 +544,7 @@ var/time_last_changed_position = 0 if(can_open_job(j) != 1) return 0 if(opened_positions[edit_job_target] >= 0) - time_last_changed_position = world.time / 10 + GLOB.time_last_changed_position = world.time / 10 j.total_positions++ opened_positions[edit_job_target]++ log_game("[key_name(usr)] has opened a job slot for job \"[j]\".") @@ -564,7 +564,7 @@ var/time_last_changed_position = 0 return 0 //Allow instant closing without cooldown if a position has been opened before if(opened_positions[edit_job_target] <= 0) - time_last_changed_position = world.time / 10 + GLOB.time_last_changed_position = world.time / 10 j.total_positions-- opened_positions[edit_job_target]-- log_game("[key_name(usr)] has closed a job slot for job \"[j]\".") diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index c06cbb32a04..6a8aafb364d 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -129,7 +129,7 @@ ui = new(user, src, ui_key, "cloning_console.tmpl", "Cloning Console UI", 640, 520) ui.open() -/obj/machinery/computer/cloning/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/cloning/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["menu"] = src.menu data["scanner"] = sanitize("[src.scanner]") diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 3b663bbe549..0faaff3af9d 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -54,16 +54,16 @@ /obj/machinery/computer/communications/proc/change_security_level(var/new_level) tmp_alertlevel = new_level - var/old_level = security_level + var/old_level = GLOB.security_level if(!tmp_alertlevel) tmp_alertlevel = SEC_LEVEL_GREEN if(tmp_alertlevel < SEC_LEVEL_GREEN) tmp_alertlevel = SEC_LEVEL_GREEN if(tmp_alertlevel > SEC_LEVEL_BLUE) tmp_alertlevel = SEC_LEVEL_BLUE //Cannot engage delta with this set_security_level(tmp_alertlevel) - if(security_level != old_level) + if(GLOB.security_level != old_level) //Only notify the admins if an actual change happened log_game("[key_name(usr)] has changed the security level to [get_security_level()].") message_admins("[key_name_admin(usr)] has changed the security level to [get_security_level()].") - switch(security_level) + switch(GLOB.security_level) if(SEC_LEVEL_GREEN) feedback_inc("alert_comms_green",1) if(SEC_LEVEL_BLUE) @@ -237,7 +237,7 @@ Nuke_request(input, usr) to_chat(usr, "Request sent.") log_game("[key_name(usr)] has requested the nuclear codes from Centcomm") - priority_announcement.Announce("The codes for the on-station nuclear self-destruct have been requested by [usr]. Confirmation or denial of this request will be sent shortly.", "Nuclear Self Destruct Codes Requested",'sound/AI/commandreport.ogg') + GLOB.priority_announcement.Announce("The codes for the on-station nuclear self-destruct have been requested by [usr]. Confirmation or denial of this request will be sent shortly.", "Nuclear Self Destruct Codes Requested",'sound/AI/commandreport.ogg') centcomm_message_cooldown = 1 spawn(6000)//10 minute cooldown centcomm_message_cooldown = 0 @@ -299,8 +299,8 @@ to_chat(usr, "Nano-Mob Hunter GO! game server is offline for extended maintenance. Contact your Central Command administrators for more info if desired.") if("ToggleATC") - atc.squelched = !atc.squelched - to_chat(usr, "ATC traffic is now: [atc.squelched ? "Disabled" : "Enabled"].") + GLOB.atc.squelched = !GLOB.atc.squelched + to_chat(usr, "ATC traffic is now: [GLOB.atc.squelched ? "Disabled" : "Enabled"].") SSnanoui.update_uis(src) return 1 @@ -337,7 +337,7 @@ // open the new ui window ui.open() -/obj/machinery/computer/communications/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/communications/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["is_ai"] = isAI(user) || isrobot(user) data["menu_state"] = data["is_ai"] ? ai_menu_state : menu_state @@ -364,7 +364,7 @@ ) ) - data["security_level"] = security_level + data["security_level"] = GLOB.security_level data["str_security_level"] = capitalize(get_security_level()) data["levels"] = list( list("id" = SEC_LEVEL_GREEN, "name" = "Green"), @@ -395,7 +395,7 @@ data["shuttle"] = shuttle - data["atcSquelched"] = atc.squelched + data["atcSquelched"] = GLOB.atc.squelched return data @@ -427,7 +427,7 @@ /proc/enable_prison_shuttle(var/mob/user); /proc/call_shuttle_proc(var/mob/user, var/reason) - if(sent_strike_team == 1) + if(GLOB.sent_strike_team == 1) to_chat(user, "Central Command will not allow the shuttle to be called. Consider all contracts terminated.") return @@ -456,7 +456,7 @@ to_chat(user, "Central Command does not currently have a shuttle available in your sector. Please try again later.") return - if(sent_strike_team == 1) + if(GLOB.sent_strike_team == 1) to_chat(user, "Central Command will not allow the shuttle to be called. Consider all contracts terminated.") return diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index a3828af6be1..9464c43b107 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -52,7 +52,7 @@ ui = new(user, src, ui_key, "med_data.tmpl", name, 800, 380) ui.open() -/obj/machinery/computer/med_data/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/med_data/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["temp"] = temp data["scan"] = scan ? scan.name : null @@ -61,15 +61,15 @@ if(authenticated) switch(screen) if(MED_DATA_R_LIST) - if(!isnull(data_core.general)) + if(!isnull(GLOB.data_core.general)) var/list/records = list() data["records"] = records - for(var/datum/data/record/R in sortRecord(data_core.general)) + for(var/datum/data/record/R in sortRecord(GLOB.data_core.general)) records[++records.len] = list("ref" = "\ref[R]", "id" = R.fields["id"], "name" = R.fields["name"]) if(MED_DATA_RECORD) var/list/general = list() data["general"] = general - if(istype(active1, /datum/data/record) && data_core.general.Find(active1)) + if(istype(active1, /datum/data/record) && GLOB.data_core.general.Find(active1)) var/list/fields = list() general["fields"] = fields fields[++fields.len] = list("field" = "Name:", "value" = active1.fields["name"], "edit" = null) @@ -90,7 +90,7 @@ var/list/medical = list() data["medical"] = medical - if(istype(active2, /datum/data/record) && data_core.medical.Find(active2)) + if(istype(active2, /datum/data/record) && GLOB.data_core.medical.Find(active2)) var/list/fields = list() medical["fields"] = fields fields[++fields.len] = list("field" = "Blood Type:", "value" = active2.fields["blood_type"], "edit" = "blood_type", "line_break" = 0) @@ -144,9 +144,9 @@ if(..()) return 1 - if(!data_core.general.Find(active1)) + if(!GLOB.data_core.general.Find(active1)) active1 = null - if(!data_core.medical.Find(active2)) + if(!GLOB.data_core.medical.Find(active2)) active2 = null if(href_list["temp"]) @@ -157,7 +157,7 @@ var/temp_href = splittext(href_list["temp_action"], "=") switch(temp_href[1]) if("del_all2") - for(var/datum/data/record/R in data_core.medical) + for(var/datum/data/record/R in GLOB.data_core.medical) qdel(R) setTemp("

    All records deleted.

    ") if("p_stat") @@ -421,10 +421,10 @@ if(href_list["d_rec"]) var/datum/data/record/R = locate(href_list["d_rec"]) var/datum/data/record/M = locate(href_list["d_rec"]) - if(!data_core.general.Find(R)) + if(!GLOB.data_core.general.Find(R)) setTemp("

    Record not found!

    ") return 1 - for(var/datum/data/record/E in data_core.medical) + for(var/datum/data/record/E in GLOB.data_core.medical) if(E.fields["name"] == R.fields["name"] && E.fields["id"] == R.fields["id"]) M = E active1 = R @@ -448,7 +448,7 @@ R.fields["cdi"] = "None" R.fields["cdi_d"] = "No diseases have been diagnosed at the moment." R.fields["notes"] = "No notes." - data_core.medical += R + GLOB.data_core.medical += R active2 = R screen = MED_DATA_RECORD @@ -459,7 +459,7 @@ var/t1 = copytext(trim(sanitize(input("Add Comment:", "Med. records", null, null) as message)), 1, MAX_MESSAGE_LEN) if(!t1 || ..() || active2 != a2) return 1 - active2.fields["comments"] += "Made by [authenticated] ([rank]) on [current_date_string] [station_time_timestamp()]
    [t1]" + active2.fields["comments"] += "Made by [authenticated] ([rank]) on [GLOB.current_date_string] [station_time_timestamp()]
    [t1]" if(href_list["del_c"]) var/index = min(max(text2num(href_list["del_c"]) + 1, 1), length(active2.fields["comments"])) @@ -473,13 +473,13 @@ active1 = null active2 = null t1 = lowertext(t1) - for(var/datum/data/record/R in data_core.medical) + for(var/datum/data/record/R in GLOB.data_core.medical) if(t1 == lowertext(R.fields["name"]) || t1 == lowertext(R.fields["id"]) || t1 == lowertext(R.fields["b_dna"])) active2 = R if(!active2) setTemp("

    Could not locate record [t1].

    ") else - for(var/datum/data/record/E in data_core.general) + for(var/datum/data/record/E in GLOB.data_core.general) if(E.fields["name"] == active2.fields["name"] && E.fields["id"] == active2.fields["id"]) active1 = E screen = MED_DATA_RECORD @@ -491,7 +491,7 @@ sleep(50) var/obj/item/paper/P = new /obj/item/paper(loc) P.info = "
    Medical Record

    " - if(istype(active1, /datum/data/record) && data_core.general.Find(active1)) + if(istype(active1, /datum/data/record) && GLOB.data_core.general.Find(active1)) P.info += {"Name: [active1.fields["name"]] ID: [active1.fields["id"]]
    \nSex: [active1.fields["sex"]]
    \nAge: [active1.fields["age"]] @@ -500,7 +500,7 @@
    \nMental Status: [active1.fields["m_stat"]]
    "} else P.info += "General Record Lost!
    " - if(istype(active2, /datum/data/record) && data_core.medical.Find(active2)) + if(istype(active2, /datum/data/record) && GLOB.data_core.medical.Find(active2)) P.info += {"
    \n
    Medical Data

    \nBlood Type: [active2.fields["blood_type"]]
    \nDNA: [active2.fields["b_dna"]]
    \n @@ -532,7 +532,7 @@ if(stat & (BROKEN|NOPOWER)) return ..(severity) - for(var/datum/data/record/R in data_core.medical) + for(var/datum/data/record/R in GLOB.data_core.medical) if(prob(10/severity)) switch(rand(1,6)) if(1) diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm index 55107809ce3..7fa1dedf411 100644 --- a/code/game/machinery/computer/message.dm +++ b/code/game/machinery/computer/message.dm @@ -18,7 +18,7 @@ var/noserver = "ALERT: No server detected." var/incorrectkey = "ALERT: Incorrect decryption key!" var/defaultmsg = "Welcome. Please select an option." - var/rebootmsg = "%$&(£: Critical %$$@ Error // !RestArting! - ?pLeaSe wAit!" + var/rebootmsg = "%$&(�: Critical %$$@ Error // !RestArting! - ?pLeaSe wAit!" //Computer properties var/screen = 0 // 0 = Main menu, 1 = Message Logs, 2 = Hacked screen, 3 = Custom Message var/hacking = 0 // Is it being hacked into by the AI/Cyborg @@ -54,7 +54,7 @@ MK.loc = src.loc playsound(loc, 'sound/goonstation/machines/printer_dotmatrix.ogg', 50, 1) // Will help make emagging the console not so easy to get away with. - MK.info += "

    £%@%(*$%&(£&?*(%&£/{}" + MK.info += "

    �%@%(*$%&(�&?*(%&�/{}" update_icon() spawn(100*length(src.linkedServer.decryptkey)) UnmagConsole() @@ -75,8 +75,8 @@ ..() //Is the server isn't linked to a server, and there's a server available, default it to the first one in the list. if(!linkedServer) - if(message_servers && message_servers.len > 0) - linkedServer = message_servers[1] + if(GLOB.message_servers && GLOB.message_servers.len > 0) + linkedServer = GLOB.message_servers[1] return /obj/machinery/computer/message_monitor/attack_hand(var/mob/user as mob) @@ -288,11 +288,11 @@ if(auth) linkedServer.active = !linkedServer.active //Find a server if(href_list["find"]) - if(message_servers && message_servers.len > 1) - src.linkedServer = input(usr,"Please select a server.", "Select a server.", null) as null|anything in message_servers + if(GLOB.message_servers && GLOB.message_servers.len > 1) + src.linkedServer = input(usr,"Please select a server.", "Select a server.", null) as null|anything in GLOB.message_servers message = "NOTICE: Server selected." - else if(message_servers && message_servers.len > 0) - linkedServer = message_servers[1] + else if(GLOB.message_servers && GLOB.message_servers.len > 0) + linkedServer = GLOB.message_servers[1] message = "NOTICE: Only Single Server Detected - Server selected." else message = noserver @@ -396,13 +396,13 @@ if("Recepient") //Get out list of viable PDAs var/list/obj/item/pda/sendPDAs = list() - for(var/obj/item/pda/P in PDAs) + for(var/obj/item/pda/P in GLOB.PDAs) var/datum/data/pda/app/messenger/PM = P.find_program(/datum/data/pda/app/messenger) if(!PM || !PM.can_receive()) continue sendPDAs += P - if(PDAs && PDAs.len > 0) + if(GLOB.PDAs && GLOB.PDAs.len > 0) customrecepient = input(usr, "Select a PDA from the list.") as null|anything in sortAtom(sendPDAs) else customrecepient = null @@ -436,7 +436,7 @@ return src.attack_hand(usr) var/obj/item/pda/PDARec = null - for(var/obj/item/pda/P in PDAs) + for(var/obj/item/pda/P in GLOB.PDAs) var/datum/data/pda/app/messenger/PM = P.find_program(/datum/data/pda/app/messenger) if(!PM || !PM.can_receive()) @@ -486,8 +486,8 @@ /obj/item/paper/monitorkey/New() ..() spawn(10) - if(message_servers) - for(var/obj/machinery/message_server/server in message_servers) + if(GLOB.message_servers) + for(var/obj/machinery/message_server/server in GLOB.message_servers) if(!isnull(server)) if(!isnull(server.decryptkey)) info = "

    Daily Key Reset


    The new message monitor key is '[server.decryptkey]'.
    Please keep this a secret and away from the clown.
    If necessary, change the password to a more secure one." diff --git a/code/game/machinery/computer/pod_tracking_console.dm b/code/game/machinery/computer/pod_tracking_console.dm index cd6450c700c..c4a6d5d440b 100644 --- a/code/game/machinery/computer/pod_tracking_console.dm +++ b/code/game/machinery/computer/pod_tracking_console.dm @@ -20,7 +20,7 @@ ui.open() ui.set_auto_update(1) -/obj/machinery/computer/podtracker/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/podtracker/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] var/list/pods[0] for(var/obj/item/spacepod_equipment/misc/tracker/TR in world) diff --git a/code/game/machinery/computer/power.dm b/code/game/machinery/computer/power.dm index fce315a1db0..bb38e59c800 100644 --- a/code/game/machinery/computer/power.dm +++ b/code/game/machinery/computer/power.dm @@ -26,18 +26,18 @@ /obj/machinery/computer/monitor/Initialize() ..() - powermonitor_repository.update_cache() + GLOB.powermonitor_repository.update_cache() powernet = find_powernet() /obj/machinery/computer/monitor/Destroy() GLOB.power_monitors -= src - powermonitor_repository.update_cache() + GLOB.powermonitor_repository.update_cache() QDEL_NULL(power_monitor) return ..() /obj/machinery/computer/monitor/power_change() ..() - powermonitor_repository.update_cache() + GLOB.powermonitor_repository.update_cache() /obj/machinery/computer/monitor/proc/find_powernet() var/obj/structure/cable/attached = null diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm index 8ecd463bc35..6134860733a 100644 --- a/code/game/machinery/computer/robot.dm +++ b/code/game/machinery/computer/robot.dm @@ -36,7 +36,7 @@ ui.open() ui.set_auto_update(1) -/obj/machinery/computer/robotics/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/robotics/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] var/list/robots = get_cyborgs(user) if(robots.len) diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index cb5e799b89e..e886ac0db89 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -54,7 +54,7 @@ ui = new(user, src, ui_key, "secure_data.tmpl", name, 800, 800) ui.open() -/obj/machinery/computer/secure_data/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/secure_data/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["temp"] = temp data["scan"] = scan ? scan.name : null @@ -63,10 +63,10 @@ if(authenticated) switch(screen) if(SEC_DATA_R_LIST) - if(!isnull(data_core.general)) - for(var/datum/data/record/R in sortRecord(data_core.general, sortBy, order)) + if(!isnull(GLOB.data_core.general)) + for(var/datum/data/record/R in sortRecord(GLOB.data_core.general, sortBy, order)) var/crimstat = "null" - for(var/datum/data/record/E in data_core.security) + for(var/datum/data/record/E in GLOB.data_core.security) if(E.fields["name"] == R.fields["name"] && E.fields["id"] == R.fields["id"]) crimstat = E.fields["criminal"] break @@ -90,7 +90,7 @@ if(SEC_DATA_RECORD) var/list/general = list() data["general"] = general - if(istype(active1, /datum/data/record) && data_core.general.Find(active1)) + if(istype(active1, /datum/data/record) && GLOB.data_core.general.Find(active1)) var/list/fields = list() general["fields"] = fields fields[++fields.len] = list("field" = "Name:", "value" = active1.fields["name"], "edit" = "name") @@ -112,7 +112,7 @@ var/list/security = list() data["security"] = security - if(istype(active2, /datum/data/record) && data_core.security.Find(active2)) + if(istype(active2, /datum/data/record) && GLOB.data_core.security.Find(active2)) var/list/fields = list() security["fields"] = fields fields[++fields.len] = list("field" = "Criminal Status:", "value" = active2.fields["criminal"], "edit" = "criminal", "line_break" = 1) @@ -133,9 +133,9 @@ if(..()) return 1 - if(!data_core.general.Find(active1)) + if(!GLOB.data_core.general.Find(active1)) active1 = null - if(!data_core.security.Find(active2)) + if(!GLOB.data_core.security.Find(active2)) active2 = null if(href_list["temp"]) @@ -145,7 +145,7 @@ var/temp_href = splittext(href_list["temp_action"], "=") switch(temp_href[1]) if("del_all2") - for(var/datum/data/record/R in data_core.security) + for(var/datum/data/record/R in GLOB.data_core.security) qdel(R) update_all_mob_security_hud() setTemp("

    All records deleted.

    ") @@ -161,7 +161,7 @@ update_all_mob_security_hud() if("del_rg2") if(active1) - for(var/datum/data/record/R in data_core.medical) + for(var/datum/data/record/R in GLOB.data_core.medical) if(R.fields["name"] == active1.fields["name"] && R.fields["id"] == active1.fields["id"]) qdel(R) QDEL_NULL(active1) @@ -248,10 +248,10 @@ else if(href_list["d_rec"]) var/datum/data/record/R = locate(href_list["d_rec"]) var/datum/data/record/M = locate(href_list["d_rec"]) - if(!data_core.general.Find(R)) + if(!GLOB.data_core.general.Find(R)) setTemp("

    Record not found!

    ") return 1 - for(var/datum/data/record/E in data_core.security) + for(var/datum/data/record/E in GLOB.data_core.security) if(E.fields["name"] == R.fields["name"] && E.fields["id"] == R.fields["id"]) M = E active1 = R @@ -296,7 +296,7 @@ R.fields["ma_crim"] = "None" R.fields["ma_crim_d"] = "No major crime convictions." R.fields["notes"] = "No notes." - data_core.security += R + GLOB.data_core.security += R active2 = R screen = SEC_DATA_RECORD @@ -312,7 +312,7 @@ G.fields["p_stat"] = "Active" G.fields["m_stat"] = "Stable" G.fields["species"] = "Human" - data_core.general += G + GLOB.data_core.general += G active1 = G active2 = null @@ -323,7 +323,7 @@ sleep(50) var/obj/item/paper/P = new /obj/item/paper(loc) P.info = "
    Security Record

    " - if(istype(active1, /datum/data/record) && data_core.general.Find(active1)) + if(istype(active1, /datum/data/record) && GLOB.data_core.general.Find(active1)) P.info += {"Name: [active1.fields["name"]] ID: [active1.fields["id"]]
    \nSex: [active1.fields["sex"]]
    \nAge: [active1.fields["age"]] @@ -332,7 +332,7 @@
    \nMental Status: [active1.fields["m_stat"]]
    "} else P.info += "General Record Lost!
    " - if(istype(active2, /datum/data/record) && data_core.security.Find(active2)) + if(istype(active2, /datum/data/record) && GLOB.data_core.security.Find(active2)) P.info += {"
    \n
    Security Data

    \nCriminal Status: [active2.fields["criminal"]]
    \n
    \nMinor Crimes: [active2.fields["mi_crim"]] @@ -384,7 +384,7 @@ var/t1 = copytext(trim(sanitize(input("Add Comment:", "Secure. records", null, null) as message)), 1, MAX_MESSAGE_LEN) if(!t1 || ..() || active2 != a2) return 1 - active2.fields["comments"] += "Made by [authenticated] ([rank]) on [current_date_string] [station_time_timestamp()]
    [t1]" + active2.fields["comments"] += "Made by [authenticated] ([rank]) on [GLOB.current_date_string] [station_time_timestamp()]
    [t1]" else if(href_list["del_c"]) var/index = min(max(text2num(href_list["del_c"]) + 1, 1), length(active2.fields["comments"])) @@ -538,7 +538,7 @@ ..(severity) return - for(var/datum/data/record/R in data_core.security) + for(var/datum/data/record/R in GLOB.data_core.security) if(prob(10/severity)) switch(rand(1,6)) if(1) diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm index e3c2918f335..9e07fb43b28 100644 --- a/code/game/machinery/computer/skills.dm +++ b/code/game/machinery/computer/skills.dm @@ -52,7 +52,7 @@ ui = new(user, src, ui_key, "skills_data.tmpl", name, 800, 380) ui.open() -/obj/machinery/computer/skills/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/skills/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["temp"] = temp data["scan"] = scan ? scan.name : null @@ -61,13 +61,13 @@ if(authenticated) switch(screen) if(SKILL_DATA_R_LIST) - if(!isnull(data_core.general)) - for(var/datum/data/record/R in sortRecord(data_core.general, sortBy, order)) + if(!isnull(GLOB.data_core.general)) + for(var/datum/data/record/R in sortRecord(GLOB.data_core.general, sortBy, order)) data["records"] += list(list("ref" = "\ref[R]", "id" = R.fields["id"], "name" = R.fields["name"], "rank" = R.fields["rank"], "fingerprint" = R.fields["fingerprint"])) if(SKILL_DATA_RECORD) var/list/general = list() data["general"] = general - if(istype(active1, /datum/data/record) && data_core.general.Find(active1)) + if(istype(active1, /datum/data/record) && GLOB.data_core.general.Find(active1)) var/list/fields = list() general["fields"] = fields fields[++fields.len] = list("field" = "Name:", "value" = active1.fields["name"], "name" = "name") @@ -93,7 +93,7 @@ if(..()) return 1 - if(!data_core.general.Find(active1)) + if(!GLOB.data_core.general.Find(active1)) active1 = null if(href_list["temp"]) @@ -103,24 +103,24 @@ var/temp_list = splittext(href_list["temp_action"], "=") switch(temp_list[1]) if("del_all2") - if(PDA_Manifest && PDA_Manifest.len) - PDA_Manifest.Cut() - for(var/datum/data/record/R in data_core.security) + if(GLOB.PDA_Manifest && GLOB.PDA_Manifest.len) + GLOB.PDA_Manifest.Cut() + for(var/datum/data/record/R in GLOB.data_core.security) qdel(R) setTemp("

    All employment records deleted.

    ") if("del_rg2") if(active1) - if(PDA_Manifest && PDA_Manifest.len) - PDA_Manifest.Cut() - for(var/datum/data/record/R in data_core.medical) + if(GLOB.PDA_Manifest && GLOB.PDA_Manifest.len) + GLOB.PDA_Manifest.Cut() + for(var/datum/data/record/R in GLOB.data_core.medical) if(R.fields["name"] == active1.fields["name"] && R.fields["id"] == active1.fields["id"]) qdel(R) QDEL_NULL(active1) screen = SKILL_DATA_R_LIST if("rank") if(active1) - if(PDA_Manifest && PDA_Manifest.len) - PDA_Manifest.Cut() + if(GLOB.PDA_Manifest && GLOB.PDA_Manifest.len) + GLOB.PDA_Manifest.Cut() active1.fields["rank"] = temp_list[2] if(temp_list[2] in GLOB.joblist) active1.fields["real_rank"] = temp_list[2] @@ -182,7 +182,7 @@ else if(href_list["d_rec"]) var/datum/data/record/R = locate(href_list["d_rec"]) - if(!data_core.general.Find(R)) + if(!GLOB.data_core.general.Find(R)) setTemp("

    Record not found!

    ") return 1 active1 = R @@ -202,8 +202,8 @@ setTemp("

    Are you sure you wish to delete the record (ALL)?

    ", buttons) else if(href_list["new_g"]) - if(PDA_Manifest.len) - PDA_Manifest.Cut() + if(GLOB.PDA_Manifest.len) + GLOB.PDA_Manifest.Cut() var/datum/data/record/G = new /datum/data/record() G.fields["name"] = "New Record" G.fields["id"] = "[add_zero(num2hex(rand(1, 1.6777215E7)), 6)]" @@ -215,7 +215,7 @@ G.fields["p_stat"] = "Active" G.fields["m_stat"] = "Stable" G.fields["species"] = "Human" - data_core.general += G + GLOB.data_core.general += G active1 = G else if(href_list["print_r"]) @@ -225,7 +225,7 @@ sleep(50) var/obj/item/paper/P = new /obj/item/paper(loc) P.info = "
    Employment Record

    " - if(istype(active1, /datum/data/record) && data_core.general.Find(active1)) + if(istype(active1, /datum/data/record) && GLOB.data_core.general.Find(active1)) P.info += {"Name: [active1.fields["name"]] ID: [active1.fields["id"]]
    \nSex: [active1.fields["sex"]]
    \nAge: [active1.fields["age"]] @@ -300,7 +300,7 @@ ..(severity) return - for(var/datum/data/record/R in data_core.security) + for(var/datum/data/record/R in GLOB.data_core.security) if(prob(10/severity)) switch(rand(1,6)) if(1) diff --git a/code/game/machinery/computer/specops_shuttle.dm b/code/game/machinery/computer/specops_shuttle.dm index 23658a3e939..f509ee42d34 100644 --- a/code/game/machinery/computer/specops_shuttle.dm +++ b/code/game/machinery/computer/specops_shuttle.dm @@ -4,12 +4,12 @@ #define SPECOPS_DOCK_AREATYPE "/area/shuttle/specops/centcom" //Type of the spec ops shuttle area for dock #define SPECOPS_RETURN_DELAY 6000 //Time between the shuttle is capable of moving. -var/specops_shuttle_moving_to_station = 0 -var/specops_shuttle_moving_to_centcom = 0 -var/specops_shuttle_at_station = 0 -var/specops_shuttle_can_send = 1 -var/specops_shuttle_time = 0 -var/specops_shuttle_timeleft = 0 +GLOBAL_VAR_INIT(specops_shuttle_moving_to_station, 0) +GLOBAL_VAR_INIT(specops_shuttle_moving_to_centcom, 0) +GLOBAL_VAR_INIT(specops_shuttle_at_station, 0) +GLOBAL_VAR_INIT(specops_shuttle_can_send, 1) +GLOBAL_VAR_INIT(specops_shuttle_time, 0) +GLOBAL_VAR_INIT(specops_shuttle_timeleft, 0) /obj/machinery/computer/specops_shuttle name = "\improper Spec. Ops. shuttle console" @@ -33,16 +33,16 @@ var/specops_shuttle_timeleft = 0 if(announcer) announcer.autosay(message, "A.L.I.C.E.", "Response Team", list(1,2)) - while(specops_shuttle_time - world.timeofday > 0) - var/ticksleft = specops_shuttle_time - world.timeofday + while(GLOB.specops_shuttle_time - world.timeofday > 0) + var/ticksleft = GLOB.specops_shuttle_time - world.timeofday if(ticksleft > 1e5) - specops_shuttle_time = world.timeofday + 10 // midnight rollover - specops_shuttle_timeleft = (ticksleft / 10) + GLOB.specops_shuttle_time = world.timeofday + 10 // midnight rollover + GLOB.specops_shuttle_timeleft = (ticksleft / 10) //All this does is announce the time before launch. if(announcer) - var/rounded_time_left = round(specops_shuttle_timeleft)//Round time so that it will report only once, not in fractions. + var/rounded_time_left = round(GLOB.specops_shuttle_timeleft)//Round time so that it will report only once, not in fractions. if(rounded_time_left in message_tracker)//If that time is in the list for message announce. message = "\"ALERT: [rounded_time_left] SECOND[(rounded_time_left!=1)?"S":""] REMAIN\"" if(rounded_time_left==0) @@ -53,10 +53,10 @@ var/specops_shuttle_timeleft = 0 sleep(5) - specops_shuttle_moving_to_station = 0 - specops_shuttle_moving_to_centcom = 0 + GLOB.specops_shuttle_moving_to_station = 0 + GLOB.specops_shuttle_moving_to_centcom = 0 - specops_shuttle_at_station = 1 + GLOB.specops_shuttle_at_station = 1 var/area/start_location = locate(/area/shuttle/specops/station) var/area/end_location = locate(/area/shuttle/specops/centcom) @@ -91,7 +91,7 @@ var/specops_shuttle_timeleft = 0 var/mob/M = locate(/mob) in T to_chat(M, "You have arrived at Central Command. Operation has ended!") - specops_shuttle_at_station = 0 + GLOB.specops_shuttle_at_station = 0 for(var/obj/machinery/computer/specops_shuttle/S in world) S.specops_shuttle_timereset = world.time + SPECOPS_RETURN_DELAY @@ -110,16 +110,16 @@ var/specops_shuttle_timeleft = 0 //message = "ARMORED SQUAD TAKE YOUR POSITION ON GRAVITY LAUNCH PAD" //announcer.autosay(message, "A.L.I.C.E.", "Response Team") - while(specops_shuttle_time - world.timeofday > 0) - var/ticksleft = specops_shuttle_time - world.timeofday + while(GLOB.specops_shuttle_time - world.timeofday > 0) + var/ticksleft = GLOB.specops_shuttle_time - world.timeofday if(ticksleft > 1e5) - specops_shuttle_time = world.timeofday + 10 // midnight rollover - specops_shuttle_timeleft = (ticksleft / 10) + GLOB.specops_shuttle_time = world.timeofday + 10 // midnight rollover + GLOB.specops_shuttle_timeleft = (ticksleft / 10) //All this does is announce the time before launch. if(announcer) - var/rounded_time_left = round(specops_shuttle_timeleft)//Round time so that it will report only once, not in fractions. + var/rounded_time_left = round(GLOB.specops_shuttle_timeleft)//Round time so that it will report only once, not in fractions. if(rounded_time_left in message_tracker)//If that time is in the list for message announce. message = "\"ALERT: [rounded_time_left] SECOND[(rounded_time_left!=1)?"S":""] REMAIN\"" if(rounded_time_left==0) @@ -130,11 +130,11 @@ var/specops_shuttle_timeleft = 0 sleep(5) - specops_shuttle_moving_to_station = 0 - specops_shuttle_moving_to_centcom = 0 + GLOB.specops_shuttle_moving_to_station = 0 + GLOB.specops_shuttle_moving_to_centcom = 0 - specops_shuttle_at_station = 1 - if(specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return + GLOB.specops_shuttle_at_station = 1 + if(GLOB.specops_shuttle_moving_to_station || GLOB.specops_shuttle_moving_to_centcom) return if(!specops_can_move()) to_chat(usr, "The Special Operations shuttle is unable to leave.") @@ -239,7 +239,7 @@ var/specops_shuttle_timeleft = 0 qdel(announcer) /proc/specops_can_move() - if(specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) + if(GLOB.specops_shuttle_moving_to_station || GLOB.specops_shuttle_moving_to_centcom) return 0 for(var/obj/machinery/computer/specops_shuttle/S in world) if(world.timeofday <= S.specops_shuttle_timereset) @@ -275,8 +275,8 @@ var/specops_shuttle_timeleft = 0 dat = temp else dat += {"
    Special Operations Shuttle
    - \nLocation: [specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom ? "Departing for [station_name()] in ([specops_shuttle_timeleft] seconds.)":specops_shuttle_at_station ? "Station":"Dock"]
    - [specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom ? "\n*The Special Ops. shuttle is already leaving.*
    \n
    ":specops_shuttle_at_station ? "\nShuttle standing by...
    \n
    ":"\nDepart to [station_name()]
    \n
    "] + \nLocation: [GLOB.specops_shuttle_moving_to_station || GLOB.specops_shuttle_moving_to_centcom ? "Departing for [station_name()] in ([GLOB.specops_shuttle_timeleft] seconds.)":GLOB.specops_shuttle_at_station ? "Station":"Dock"]
    + [GLOB.specops_shuttle_moving_to_station || GLOB.specops_shuttle_moving_to_centcom ? "\n*The Special Ops. shuttle is already leaving.*
    \n
    ":GLOB.specops_shuttle_at_station ? "\nShuttle standing by...
    \n
    ":"\nDepart to [station_name()]
    \n
    "] \nClose"} user << browse(dat, "window=computer;size=575x450") @@ -291,7 +291,7 @@ var/specops_shuttle_timeleft = 0 usr.machine = src if(href_list["sendtodock"]) - if(!specops_shuttle_at_station|| specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return + if(!GLOB.specops_shuttle_at_station|| GLOB.specops_shuttle_moving_to_station || GLOB.specops_shuttle_moving_to_centcom) return if(!specops_can_move()) to_chat(usr, "Central Command will not allow the Special Operations shuttle to return yet.") @@ -306,13 +306,13 @@ var/specops_shuttle_timeleft = 0 temp += "Shuttle departing.

    OK" updateUsrDialog() - specops_shuttle_moving_to_centcom = 1 - specops_shuttle_time = world.timeofday + SPECOPS_MOVETIME + GLOB.specops_shuttle_moving_to_centcom = 1 + GLOB.specops_shuttle_time = world.timeofday + SPECOPS_MOVETIME spawn(0) specops_return() else if(href_list["sendtostation"]) - if(specops_shuttle_at_station || specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return + if(GLOB.specops_shuttle_at_station || GLOB.specops_shuttle_moving_to_station || GLOB.specops_shuttle_moving_to_centcom) return if(!specops_can_move()) to_chat(usr, "The Special Operations shuttle is unable to leave.") @@ -326,9 +326,9 @@ var/specops_shuttle_timeleft = 0 var/area/centcom/specops/special_ops = locate() if(special_ops) special_ops.readyalert()//Trigger alarm for the spec ops area. - specops_shuttle_moving_to_station = 1 + GLOB.specops_shuttle_moving_to_station = 1 - specops_shuttle_time = world.timeofday + SPECOPS_MOVETIME + GLOB.specops_shuttle_time = world.timeofday + SPECOPS_MOVETIME spawn(0) specops_process() diff --git a/code/game/machinery/computer/store.dm b/code/game/machinery/computer/store.dm index f49d91c53b3..856e2322f71 100644 --- a/code/game/machinery/computer/store.dm +++ b/code/game/machinery/computer/store.dm @@ -102,11 +102,11 @@ th.cost.toomuch {background:maroon;}
"} - for(var/datum/storeitem/item in centcomm_store.items) + for(var/datum/storeitem/item in GLOB.centcomm_store.items) var/cost_class="affordable" if(item.cost>balance) cost_class="toomuch" - var/itemID=centcomm_store.items.Find(item) + var/itemID=GLOB.centcomm_store.items.Find(item) var/row_color="light" if(itemID%2 == 0) row_color="dark" @@ -143,7 +143,7 @@ th.cost.toomuch {background:maroon;} if(href_list["buy"]) var/itemID = text2num(href_list["buy"]) - var/datum/storeitem/item = centcomm_store.items[itemID] + var/datum/storeitem/item = GLOB.centcomm_store.items[itemID] var/sure = alert(usr,"Are you sure you wish to purchase [item.name] for $[item.cost]?","You sure?","Yes","No") in list("Yes","No") if(!Adjacent(usr)) to_chat(usr, "You are not close enough to do that.") @@ -151,7 +151,7 @@ th.cost.toomuch {background:maroon;} if(sure=="No") updateUsrDialog() return - if(!centcomm_store.PlaceOrder(usr,itemID)) + if(!GLOB.centcomm_store.PlaceOrder(usr,itemID)) to_chat(usr, "Unable to charge your account.") else to_chat(usr, "You've successfully purchased the item. It should be in your hands or on the floor.") diff --git a/code/game/machinery/computer/syndicate_specops_shuttle.dm b/code/game/machinery/computer/syndicate_specops_shuttle.dm index aefeaaa864b..0a65b6be408 100644 --- a/code/game/machinery/computer/syndicate_specops_shuttle.dm +++ b/code/game/machinery/computer/syndicate_specops_shuttle.dm @@ -3,12 +3,12 @@ #define SYNDICATE_ELITE_STATION_AREATYPE "/area/shuttle/syndicate_elite/station" //Type of the spec ops shuttle area for station #define SYNDICATE_ELITE_DOCK_AREATYPE "/area/shuttle/syndicate_elite/mothership" //Type of the spec ops shuttle area for dock -var/syndicate_elite_shuttle_moving_to_station = 0 -var/syndicate_elite_shuttle_moving_to_mothership = 0 -var/syndicate_elite_shuttle_at_station = 0 -var/syndicate_elite_shuttle_can_send = 1 -var/syndicate_elite_shuttle_time = 0 -var/syndicate_elite_shuttle_timeleft = 0 +GLOBAL_VAR_INIT(syndicate_elite_shuttle_moving_to_station, 0) +GLOBAL_VAR_INIT(syndicate_elite_shuttle_moving_to_mothership, 0) +GLOBAL_VAR_INIT(syndicate_elite_shuttle_at_station, 0) +GLOBAL_VAR_INIT(syndicate_elite_shuttle_can_send, 1) +GLOBAL_VAR_INIT(syndicate_elite_shuttle_time, 0) +GLOBAL_VAR_INIT(syndicate_elite_shuttle_timeleft, 0) /obj/machinery/computer/syndicate_elite_shuttle name = "\improper Elite Syndicate Squad shuttle console" @@ -33,16 +33,16 @@ var/syndicate_elite_shuttle_timeleft = 0 // message = "ARMORED SQUAD TAKE YOUR POSITION ON GRAVITY LAUNCH PAD" // announcer.say(message) - while(syndicate_elite_shuttle_time - world.timeofday > 0) - var/ticksleft = syndicate_elite_shuttle_time - world.timeofday + while(GLOB.syndicate_elite_shuttle_time - world.timeofday > 0) + var/ticksleft = GLOB.syndicate_elite_shuttle_time - world.timeofday if(ticksleft > 1e5) - syndicate_elite_shuttle_time = world.timeofday // midnight rollover - syndicate_elite_shuttle_timeleft = (ticksleft / 10) + GLOB.syndicate_elite_shuttle_time = world.timeofday // midnight rollover + GLOB.syndicate_elite_shuttle_timeleft = (ticksleft / 10) //All this does is announce the time before launch. if(announcer) - var/rounded_time_left = round(syndicate_elite_shuttle_timeleft)//Round time so that it will report only once, not in fractions. + var/rounded_time_left = round(GLOB.syndicate_elite_shuttle_timeleft)//Round time so that it will report only once, not in fractions. if(rounded_time_left in message_tracker)//If that time is in the list for message announce. message = "ALERT: [rounded_time_left] SECOND[(rounded_time_left!=1)?"S":""] REMAIN" if(rounded_time_left==0) @@ -53,11 +53,11 @@ var/syndicate_elite_shuttle_timeleft = 0 sleep(5) - syndicate_elite_shuttle_moving_to_station = 0 - syndicate_elite_shuttle_moving_to_mothership = 0 + GLOB.syndicate_elite_shuttle_moving_to_station = 0 + GLOB.syndicate_elite_shuttle_moving_to_mothership = 0 - syndicate_elite_shuttle_at_station = 1 - if(syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return + GLOB.syndicate_elite_shuttle_at_station = 1 + if(GLOB.syndicate_elite_shuttle_moving_to_station || GLOB.syndicate_elite_shuttle_moving_to_mothership) return if(!syndicate_elite_can_move()) to_chat(usr, "The Syndicate Elite shuttle is unable to leave.") @@ -174,7 +174,7 @@ var/syndicate_elite_shuttle_timeleft = 0 to_chat(M, "You have arrived to [station_name()]. Commence operation!") /proc/syndicate_elite_can_move() - if(syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return 0 + if(GLOB.syndicate_elite_shuttle_moving_to_station || GLOB.syndicate_elite_shuttle_moving_to_mothership) return 0 else return 1 /obj/machinery/computer/syndicate_elite_shuttle/attack_ai(var/mob/user as mob) @@ -205,8 +205,8 @@ var/syndicate_elite_shuttle_timeleft = 0 dat = temp else dat = {"
Special Operations Shuttle
- \nLocation: [syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership ? "Departing for [station_name()] in ([syndicate_elite_shuttle_timeleft] seconds.)":syndicate_elite_shuttle_at_station ? "Station":"Dock"]
- [syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership ? "\n*The Syndicate Elite shuttle is already leaving.*
\n
":syndicate_elite_shuttle_at_station ? "\nShuttle Offline
\n
":"\nDepart to [station_name()]
\n
"] + \nLocation: [GLOB.syndicate_elite_shuttle_moving_to_station || GLOB.syndicate_elite_shuttle_moving_to_mothership ? "Departing for [station_name()] in ([GLOB.syndicate_elite_shuttle_timeleft] seconds.)":GLOB.syndicate_elite_shuttle_at_station ? "Station":"Dock"]
+ [GLOB.syndicate_elite_shuttle_moving_to_station || GLOB.syndicate_elite_shuttle_moving_to_mothership ? "\n*The Syndicate Elite shuttle is already leaving.*
\n
":GLOB.syndicate_elite_shuttle_at_station ? "\nShuttle Offline
\n
":"\nDepart to [station_name()]
\n
"] \nClose"} user << browse(dat, "window=computer;size=575x450") @@ -221,13 +221,13 @@ var/syndicate_elite_shuttle_timeleft = 0 usr.set_machine(src) if(href_list["sendtodock"]) - if(!syndicate_elite_shuttle_at_station|| syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return + if(!GLOB.syndicate_elite_shuttle_at_station|| GLOB.syndicate_elite_shuttle_moving_to_station || GLOB.syndicate_elite_shuttle_moving_to_mothership) return to_chat(usr, "The Syndicate will not allow the Elite Squad shuttle to return.") return else if(href_list["sendtostation"]) - if(syndicate_elite_shuttle_at_station || syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return + if(GLOB.syndicate_elite_shuttle_at_station || GLOB.syndicate_elite_shuttle_moving_to_station || GLOB.syndicate_elite_shuttle_moving_to_mothership) return if(!specops_can_move()) to_chat(usr, "The Syndicate Elite shuttle is unable to leave.") @@ -241,9 +241,9 @@ var/syndicate_elite_shuttle_timeleft = 0 var/area/syndicate_mothership/elite_squad/elite_squad = locate() if(elite_squad) elite_squad.readyalert()//Trigger alarm for the spec ops area. - syndicate_elite_shuttle_moving_to_station = 1 + GLOB.syndicate_elite_shuttle_moving_to_station = 1 - syndicate_elite_shuttle_time = world.timeofday + SYNDICATE_ELITE_MOVETIME + GLOB.syndicate_elite_shuttle_time = world.timeofday + SYNDICATE_ELITE_MOVETIME spawn(0) syndicate_elite_process() diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index 3ce6a8702f5..a99384d364a 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -68,7 +68,7 @@ /obj/machinery/atmospherics/unary/cryo_cell/atmos_init() ..() if(node) return - for(var/cdir in cardinal) + for(var/cdir in GLOB.cardinal) node = findConnecting(cdir) if(node) break @@ -214,7 +214,7 @@ // auto update every Master Controller tick ui.set_auto_update(1) -/obj/machinery/atmospherics/unary/cryo_cell/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/atmospherics/unary/cryo_cell/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["isOperating"] = on data["hasOccupant"] = occupant ? 1 : 0 diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index b1a78f2825f..37d59977f3e 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -40,7 +40,7 @@ /obj/machinery/computer/cryopod/New() ..() - for(var/T in potential_theft_objectives) + for(var/T in GLOB.potential_theft_objectives) theft_cache += new T /obj/machinery/computer/cryopod/attack_ai() @@ -416,15 +416,15 @@ // Delete them from datacore. var/announce_rank = null - if(PDA_Manifest.len) - PDA_Manifest.Cut() - for(var/datum/data/record/R in data_core.medical) + if(GLOB.PDA_Manifest.len) + GLOB.PDA_Manifest.Cut() + for(var/datum/data/record/R in GLOB.data_core.medical) if((R.fields["name"] == occupant.real_name)) qdel(R) - for(var/datum/data/record/T in data_core.security) + for(var/datum/data/record/T in GLOB.data_core.security) if((T.fields["name"] == occupant.real_name)) qdel(T) - for(var/datum/data/record/G in data_core.general) + for(var/datum/data/record/G in GLOB.data_core.general) if((G.fields["name"] == occupant.real_name)) announce_rank = G.fields["rank"] qdel(G) diff --git a/code/game/machinery/dance_machine.dm b/code/game/machinery/dance_machine.dm index 1fb2dfc422d..baf32ab742c 100644 --- a/code/game/machinery/dance_machine.dm +++ b/code/game/machinery/dance_machine.dm @@ -400,7 +400,7 @@ while(time) sleep(speed) for(var/i in 1 to speed) - M.setDir(pick(cardinal)) + M.setDir(pick(GLOB.cardinal)) M.resting = !M.resting M.update_canmove() time-- diff --git a/code/game/machinery/defib_mount.dm b/code/game/machinery/defib_mount.dm index 738fc115734..d669b340436 100644 --- a/code/game/machinery/defib_mount.dm +++ b/code/game/machinery/defib_mount.dm @@ -45,7 +45,7 @@ . = ..() if(defib) . += "There is a defib unit hooked up. Alt-click to remove it." - if(security_level >= SEC_LEVEL_RED) + if(GLOB.security_level >= SEC_LEVEL_RED) . += "Due to a security situation, its locking clamps can be toggled by swiping any ID." else . += "Its locking clamps can be [clamps_locked ? "dis" : ""]engaged by swiping an ID with access." @@ -100,7 +100,7 @@ return var/obj/item/card/id = I.GetID() if(id) - if(check_access(id) || security_level >= SEC_LEVEL_RED) //anyone can toggle the clamps in red alert! + if(check_access(id) || GLOB.security_level >= SEC_LEVEL_RED) //anyone can toggle the clamps in red alert! if(!defib) to_chat(user, "You can't engage the clamps on a defibrillator that isn't there.") return diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 5ba3885faff..cc76c2ab86f 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -38,7 +38,7 @@ #define AIRLOCK_DAMAGE_DEFLECTION_N 21 // Normal airlock damage deflection #define AIRLOCK_DAMAGE_DEFLECTION_R 30 // Reinforced airlock damage deflection -var/list/airlock_overlays = list() +GLOBAL_LIST_EMPTY(airlock_overlays) /obj/machinery/door/airlock name = "airlock" @@ -483,10 +483,10 @@ About the new airlock wires panel: /proc/get_airlock_overlay(icon_state, icon_file) var/iconkey = "[icon_state][icon_file]" - if(airlock_overlays[iconkey]) - return airlock_overlays[iconkey] - airlock_overlays[iconkey] = image(icon_file, icon_state) - return airlock_overlays[iconkey] + if(GLOB.airlock_overlays[iconkey]) + return GLOB.airlock_overlays[iconkey] + GLOB.airlock_overlays[iconkey] = image(icon_file, icon_state) + return GLOB.airlock_overlays[iconkey] /obj/machinery/door/airlock/do_animate(animation) switch(animation) @@ -550,7 +550,7 @@ About the new airlock wires panel: ui.open() ui.set_auto_update(1) -/obj/machinery/door/airlock/ui_data(mob/user, datum/topic_state/state = default_state) +/obj/machinery/door/airlock/ui_data(mob/user, datum/topic_state/state = GLOB.default_state) var/data[0] data["main_power_loss"] = round(main_power_lost_until > 0 ? max(main_power_lost_until - world.time, 0) / 10 : main_power_lost_until, 1) diff --git a/code/game/machinery/doors/airlock_electronics.dm b/code/game/machinery/doors/airlock_electronics.dm index 260d26493c0..660c6df683e 100644 --- a/code/game/machinery/doors/airlock_electronics.dm +++ b/code/game/machinery/doors/airlock_electronics.dm @@ -29,12 +29,12 @@ t1 += " Unrestricted Access Settings
" var/list/Directions = list("North","South",,"East",,,,"West") - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if (unres_direction && unres_direction == direction) t1 += "[Directions[direction]]
" else t1 += "[Directions[direction]]
" - + t1 += "
" t1 += "Access requirement is set to " t1 += one_access ? "ONE
" : "ALL
" @@ -74,7 +74,7 @@ if(href_list["access"]) toggle_access(href_list["access"]) - + if(href_list["unres_direction"]) unres_direction = text2num(href_list["unres_direction"]) if (unres_sides == unres_direction) diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index dbc76ade250..29549a05630 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -71,7 +71,7 @@ playsound(C.loc, "sound/goonstation/machines/printer_dotmatrix.ogg", 50, 1) GLOB.cell_logs += P - var/datum/data/record/G = find_record("name", logname, data_core.general) + var/datum/data/record/G = find_record("name", logname, GLOB.data_core.general) var/prisoner_drank = "unknown" var/prisoner_trank = "unknown" if(G) @@ -99,7 +99,7 @@ rank = I.assignment if(!R.fields["comments"] || !islist(R.fields["comments"])) //copied from security computer code because apparently these need to be initialized R.fields["comments"] = list() - R.fields["comments"] += "Autogenerated by [name] on [current_date_string] [station_time_timestamp()]
Sentenced to [timetoset/10] seconds for the charges of \"[logcharges]\" by [rank] [usr.name]." + R.fields["comments"] += "Autogenerated by [name] on [GLOB.current_date_string] [station_time_timestamp()]
Sentenced to [timetoset/10] seconds for the charges of \"[logcharges]\" by [rank] [usr.name]." update_all_mob_security_hud() return 1 @@ -118,7 +118,7 @@ var/boss_title = brigged_job.department_head[1] var/obj/item/pda/target_pda - for(var/obj/item/pda/check_pda in PDAs) + for(var/obj/item/pda/check_pda in GLOB.PDAs) if(check_pda.ownrank == boss_title) target_pda = check_pda if(!target_pda) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 718efdb414c..fbbe0201d31 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -352,8 +352,8 @@ addtimer(CALLBACK(src, .proc/autoclose), wait, TIMER_UNIQUE | TIMER_NO_HASH_WAIT | TIMER_OVERRIDE) /obj/machinery/door/proc/update_freelook_sight() - if(!glass && cameranet) - cameranet.updateVisibility(src, 0) + if(!glass && GLOB.cameranet) + GLOB.cameranet.updateVisibility(src, 0) /obj/machinery/door/BlockSuperconductivity() // All non-glass airlocks block heat, this is intended. if(opacity || heat_proof) diff --git a/code/game/machinery/doppler_array.dm b/code/game/machinery/doppler_array.dm index 7af8ebe88f3..0a0873a2605 100644 --- a/code/game/machinery/doppler_array.dm +++ b/code/game/machinery/doppler_array.dm @@ -1,4 +1,4 @@ -var/list/doppler_arrays = list() +GLOBAL_LIST_EMPTY(doppler_arrays) /obj/machinery/doppler_array name = "tachyon-doppler array" @@ -28,12 +28,12 @@ var/list/doppler_arrays = list() /obj/machinery/doppler_array/New() ..() - doppler_arrays += src + GLOB.doppler_arrays += src explosion_target = rand(8, 20) toxins_tech = new /datum/tech/toxins(src) /obj/machinery/doppler_array/Destroy() - doppler_arrays -= src + GLOB.doppler_arrays -= src logged_explosions.Cut() return ..() @@ -183,7 +183,7 @@ var/list/doppler_arrays = list() ui.open() ui.set_auto_update(1) -/obj/machinery/doppler_array/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/doppler_array/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] var/list/explosion_data = list() for(var/D in logged_explosions) diff --git a/code/game/machinery/embedded_controller/airlock_controllers.dm b/code/game/machinery/embedded_controller/airlock_controllers.dm index b1a6f96e2eb..32924690d97 100644 --- a/code/game/machinery/embedded_controller/airlock_controllers.dm +++ b/code/game/machinery/embedded_controller/airlock_controllers.dm @@ -27,7 +27,7 @@ ui.open() ui.set_auto_update(1) -/obj/machinery/embedded_controller/radio/airlock/advanced_airlock_controller/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/embedded_controller/radio/airlock/advanced_airlock_controller/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data = list( @@ -98,7 +98,7 @@ ui.open() ui.set_auto_update(1) -/obj/machinery/embedded_controller/radio/airlock/airlock_controller/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/embedded_controller/radio/airlock/airlock_controller/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data = list( @@ -160,7 +160,7 @@ ui.open() ui.set_auto_update(1) -/obj/machinery/embedded_controller/radio/airlock/access_controller/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/embedded_controller/radio/airlock/access_controller/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data = list( diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index 7ae268fca46..9beba3f4789 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -236,14 +236,14 @@ FIRE ALARM ui_interact(user) -/obj/machinery/firealarm/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state) +/obj/machinery/firealarm/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = GLOB.default_state) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "firealarm.tmpl", name, 400, 400, state = state) ui.open() ui.set_auto_update(1) -/obj/machinery/firealarm/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/firealarm/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] var/area/A = get_area(src) @@ -318,7 +318,7 @@ FIRE ALARM pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0 if(is_station_contact(z) && show_alert_level) - if(security_level) + if(GLOB.security_level) overlays += image('icons/obj/monitors.dmi', "overlay_[get_security_level()]") else overlays += image('icons/obj/monitors.dmi', "overlay_green") diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 03b28423830..fcd6de4020c 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -33,7 +33,7 @@ Possible to do for anyone motivated enough: #define HOLOPAD_MODE RANGE_BASED -var/list/holopads = list() +GLOBAL_LIST_EMPTY(holopads) /obj/machinery/hologram/holopad name = "holopad" @@ -61,7 +61,7 @@ var/list/holopads = list() /obj/machinery/hologram/holopad/New() ..() - holopads += src + GLOB.holopads += src component_parts = list() component_parts += new /obj/item/circuitboard/holopad(null) component_parts += new /obj/item/stock_parts/capacitor(null) @@ -77,7 +77,7 @@ var/list/holopads = list() for(var/I in masters) clear_holo(I) - holopads -= src + GLOB.holopads -= src return ..() /obj/machinery/hologram/holopad/power_change() @@ -192,7 +192,7 @@ var/list/holopads = list() temp = "You requested an AI's presence.
" temp += "Main Menu" var/area/area = get_area(src) - for(var/mob/living/silicon/ai/AI in ai_list) + for(var/mob/living/silicon/ai/AI in GLOB.ai_list) if(!AI.client) continue to_chat(AI, "Your presence is requested at \the [area].") @@ -210,7 +210,7 @@ var/list/holopads = list() temp += "Main Menu" if(usr.loc == loc) var/list/callnames = list() - for(var/I in holopads) + for(var/I in GLOB.holopads) var/area/A = get_area(I) if(A) LAZYADD(callnames[A], I) @@ -297,7 +297,7 @@ var/list/holopads = list() /obj/machinery/hologram/holopad/proc/transfer_to_nearby_pad(turf/T, mob/holo_owner) if(!isAI(holo_owner)) return - for(var/pad in holopads) + for(var/pad in GLOB.holopads) var/obj/machinery/hologram/holopad/another = pad if(another == src) continue diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index bb6889769b8..8d8cabed341 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -290,7 +290,7 @@ Class Procs: update_multitool_menu(usr) return TRUE -/obj/machinery/Topic(href, href_list, var/nowindow = 0, var/datum/topic_state/state = default_state) +/obj/machinery/Topic(href, href_list, var/nowindow = 0, var/datum/topic_state/state = GLOB.default_state) if(..(href, href_list, nowindow, state)) return 1 diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 61d96602343..c2396ab1d9f 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -55,9 +55,9 @@ var/list/datum/feed_channel/network_channels = list() var/datum/feed_message/wanted_issue -var/datum/feed_network/news_network = new /datum/feed_network //The global news-network, which is coincidentally a global list. +GLOBAL_DATUM_INIT(news_network, /datum/feed_network, new()) //The global news-network, which is coincidentally a global list. -var/list/obj/machinery/newscaster/allCasters = list() //Global list that will contain reference to all newscasters in existence. +GLOBAL_LIST_EMPTY(allNewscasters) //Global list that will contain reference to all newscasters in existence. #define NEWSCASTER_MAIN 0 // Main menu #define NEWSCASTER_FC_LIST 1 // Feed channel list @@ -128,13 +128,13 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co securityCaster = 1 /obj/machinery/newscaster/New() - allCasters += src - unit_no = allCasters.len + GLOB.allNewscasters += src + unit_no = GLOB.allNewscasters.len update_icon() //for any custom ones on the map... ..() /obj/machinery/newscaster/Destroy() - allCasters -= src + GLOB.allNewscasters -= src viewing_channel = null QDEL_NULL(photo) return ..() @@ -144,7 +144,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co if(inoperable()) icon_state = "newscaster_off" else - if(!news_network.wanted_issue) //wanted icon state, there can be no overlays on it as it's a priority message + if(!GLOB.news_network.wanted_issue) //wanted icon state, there can be no overlays on it as it's a priority message icon_state = "newscaster_normal" if(alert) //new message alert overlay add_overlay("newscaster_alert") @@ -194,7 +194,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co switch(screen) if(0) - data["wanted_issue"] = news_network.wanted_issue ? 1 : 0 + data["wanted_issue"] = GLOB.news_network.wanted_issue ? 1 : 0 data["silence"] = silence data["securityCaster"] = securityCaster if(securityCaster) @@ -202,7 +202,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co if(1, 6, 7) var/list/channels = list() data["channels"] = channels - for(var/datum/feed_channel/C in news_network.network_channels) + for(var/datum/feed_channel/C in GLOB.news_network.network_channels) channels[++channels.len] = list("name" = C.channel_name, "ref" = "\ref[C]", "censored" = C.censored, "admin" = C.is_admin_channel) if(2) data["scanned_user"] = scanned_user @@ -215,10 +215,10 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co data["msg"] = msg data["photo"] = photo ? 1 : 0 if(4) - var/total_num = length(news_network.network_channels) + var/total_num = length(GLOB.news_network.network_channels) var/active_num = total_num var/message_num=0 - for(var/datum/feed_channel/FC in news_network.network_channels) + for(var/datum/feed_channel/FC in GLOB.news_network.network_channels) if(!FC.censored) message_num += length(FC.messages) else @@ -254,7 +254,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co if(10) var/wanted_already = 0 var/end_param = 1 - if(news_network.wanted_issue) + if(GLOB.news_network.wanted_issue) wanted_already = 1 end_param = 2 data["wanted_already"] = wanted_already @@ -263,16 +263,16 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co data["msg"] = msg data["photo"] = photo ? 1 : 0 if(wanted_already) - data["author"] = news_network.wanted_issue.backup_author + data["author"] = GLOB.news_network.wanted_issue.backup_author else data["scanned_user"] = scanned_user if(11) - data["author"] = news_network.wanted_issue.backup_author - data["criminal"] = news_network.wanted_issue.author - data["description"] = news_network.wanted_issue.body - if(news_network.wanted_issue.img) - user << browse_rsc(news_network.wanted_issue.img, "tmp_photow.png") - data["photo"] = news_network.wanted_issue.img ? news_network.wanted_issue.img : 0 + data["author"] = GLOB.news_network.wanted_issue.backup_author + data["criminal"] = GLOB.news_network.wanted_issue.author + data["description"] = GLOB.news_network.wanted_issue.body + if(GLOB.news_network.wanted_issue.img) + user << browse_rsc(GLOB.news_network.wanted_issue.img, "tmp_photow.png") + data["photo"] = GLOB.news_network.wanted_issue.img ? GLOB.news_network.wanted_issue.img : 0 if(12) var/list/jobs = list() data["jobs"] = jobs @@ -295,13 +295,13 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co else if(href_list["submit_new_channel"]) var/list/existing_authors = list() - for(var/datum/feed_channel/FC in news_network.network_channels) + for(var/datum/feed_channel/FC in GLOB.news_network.network_channels) if(FC.author == REDACTED) existing_authors += FC.backup_author else existing_authors += FC.author var/check = 0 - for(var/datum/feed_channel/FC in news_network.network_channels) + for(var/datum/feed_channel/FC in GLOB.news_network.network_channels) if(FC.channel_name == channel_name) check = 1 break @@ -325,13 +325,13 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co newChannel.author = scanned_user newChannel.locked = c_locked feedback_inc("newscaster_channels", 1) - news_network.network_channels += newChannel //Adding channel to the global network + GLOB.news_network.network_channels += newChannel //Adding channel to the global network temp = "Feed channel '[channel_name]' created successfully." temp_back_screen = NEWSCASTER_MAIN else if(href_list["set_channel_receiving"]) var/list/available_channels = list() - for(var/datum/feed_channel/F in news_network.network_channels) + for(var/datum/feed_channel/F in GLOB.news_network.network_channels) if((!F.locked || F.author == scanned_user) && !F.censored) available_channels += F.channel_name channel_name = strip_html_simple(input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels) @@ -366,14 +366,14 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co newMsg.img = photo.img feedback_inc("newscaster_stories",1) var/announcement = "" - for(var/datum/feed_channel/FC in news_network.network_channels) + for(var/datum/feed_channel/FC in GLOB.news_network.network_channels) if(FC.channel_name == channel_name) FC.messages += newMsg //Adding message to the network's appropriate feed_channel announcement = FC.announce_news(msg_title) break temp = "Feed story successfully submitted to [channel_name]." temp_back_screen = NEWSCASTER_MAIN - for(var/obj/machinery/newscaster/NC in allCasters) + for(var/obj/machinery/newscaster/NC in GLOB.allNewscasters) NC.newsAlert(announcement) else if(href_list["create_channel"]) @@ -405,12 +405,12 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co else if(href_list["menu_wanted"]) var/already_wanted = 0 - if(news_network.wanted_issue) + if(GLOB.news_network.wanted_issue) already_wanted = 1 if(already_wanted) - channel_name = news_network.wanted_issue.author - msg = news_network.wanted_issue.body + channel_name = GLOB.news_network.wanted_issue.author + msg = GLOB.news_network.wanted_issue.body screen = NEWSCASTER_W_ISSUE_H else if(href_list["set_wanted_name"]) @@ -441,32 +441,32 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co W.backup_author = scanned_user //I know, a bit wacky if(photo) W.img = photo.img - news_network.wanted_issue = W - for(var/obj/machinery/newscaster/NS in allCasters) + GLOB.news_network.wanted_issue = W + for(var/obj/machinery/newscaster/NS in GLOB.allNewscasters) NS.newsAlert() NS.update_icon() temp = "Wanted issue for [channel_name] is now in Network Circulation." temp_back_screen = NEWSCASTER_MAIN else - if(news_network.wanted_issue.is_admin_message) + if(GLOB.news_network.wanted_issue.is_admin_message) alert("The wanted issue has been distributed by a Nanotrasen higherup. You cannot edit it.","Ok") return - news_network.wanted_issue.author = channel_name - news_network.wanted_issue.body = msg - news_network.wanted_issue.backup_author = scanned_user + GLOB.news_network.wanted_issue.author = channel_name + GLOB.news_network.wanted_issue.body = msg + GLOB.news_network.wanted_issue.backup_author = scanned_user if(photo) - news_network.wanted_issue.img = photo.img + GLOB.news_network.wanted_issue.img = photo.img temp = "Wanted issue for [channel_name] successfully edited." temp_back_screen = NEWSCASTER_MAIN else if(href_list["cancel_wanted"]) - if(news_network.wanted_issue.is_admin_message) + if(GLOB.news_network.wanted_issue.is_admin_message) alert("The wanted issue has been distributed by a Nanotrasen higherup. You cannot take it down.", "Ok") return var/choice = alert("Please confirm wanted issue removal", "Network Security Handler", "Confirm", "Cancel") if(choice == "Confirm") - news_network.wanted_issue = null - for(var/obj/machinery/newscaster/NC in allCasters) + GLOB.news_network.wanted_issue = null + for(var/obj/machinery/newscaster/NC in GLOB.allNewscasters) NC.update_icon() temp = "Wanted Issue successfully deleted from Circulation" temp_back_screen = NEWSCASTER_MAIN @@ -826,10 +826,10 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co /obj/machinery/newscaster/proc/print_paper() feedback_inc("newscaster_newspapers_printed",1) var/obj/item/newspaper/NEWSPAPER = new /obj/item/newspaper - for(var/datum/feed_channel/FC in news_network.network_channels) + for(var/datum/feed_channel/FC in GLOB.news_network.network_channels) NEWSPAPER.news_content += FC - if(news_network.wanted_issue) - NEWSPAPER.important_message = news_network.wanted_issue + if(GLOB.news_network.wanted_issue) + NEWSPAPER.important_message = GLOB.news_network.wanted_issue NEWSPAPER.loc = get_turf(src) paper_remaining-- return diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 13ad44215bb..42452a9f8e2 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -216,7 +216,7 @@ /obj/item/pipe/Move() ..() if(is_bent_pipe() \ - && (src.dir in cardinal)) + && (src.dir in GLOB.cardinal)) src.dir = src.dir|turn(src.dir, 90) else if(pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_UNIVERSAL, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE, PIPE_DVALVE)) if(dir==2) @@ -305,7 +305,7 @@ return 0 /obj/item/pipe/proc/unflip(var/direction) - if(!(direction in cardinal)) + if(!(direction in GLOB.cardinal)) return turn(direction, 45) return direction diff --git a/code/game/machinery/poolcontroller.dm b/code/game/machinery/poolcontroller.dm index 53dd0135c54..b910b1272ff 100644 --- a/code/game/machinery/poolcontroller.dm +++ b/code/game/machinery/poolcontroller.dm @@ -157,7 +157,7 @@ ui = new(user, src, ui_key, "poolcontroller.tmpl", "Pool Controller Interface", 520, 410) ui.open() -/obj/machinery/poolcontroller/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/poolcontroller/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] var/currenttemp switch(temperature) //So we can output nice things like "Cool" to nanoUI diff --git a/code/game/machinery/portable_tag_turret.dm b/code/game/machinery/portable_tag_turret.dm index 0bd368bd75b..5d6dc185c83 100644 --- a/code/game/machinery/portable_tag_turret.dm +++ b/code/game/machinery/portable_tag_turret.dm @@ -49,7 +49,7 @@ ui.open() ui.set_auto_update(1) -/obj/machinery/porta_turret/tag/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/porta_turret/tag/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["access"] = !isLocked(user) data["locked"] = locked diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index a77cbe6c184..b35af581af8 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -161,14 +161,14 @@ eprojectile = /obj/item/projectile/beam/pulse eshot_sound = 'sound/weapons/pulse.ogg' -var/list/turret_icons +GLOBAL_LIST_EMPTY(turret_icons) /obj/machinery/porta_turret/update_icon() - if(!turret_icons) - turret_icons = list() - turret_icons["open"] = image(icon, "openTurretCover") + if(!GLOB.turret_icons) + GLOB.turret_icons = list() + GLOB.turret_icons["open"] = image(icon, "openTurretCover") underlays.Cut() - underlays += turret_icons["open"] + underlays += GLOB.turret_icons["open"] if(stat & BROKEN) icon_state = "destroyed_target_prism" @@ -218,7 +218,7 @@ var/list/turret_icons ui.open() ui.set_auto_update(1) -/obj/machinery/porta_turret/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/porta_turret/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["access"] = !isLocked(user) data["screen"] = screen diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index db913f171c3..095b2e7d56e 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -27,10 +27,10 @@ #define COM_ROLES list("Blueshield","NT Representative","Head of Personnel's Desk","Captain's Desk","Bridge") #define SCI_ROLES list("Robotics","Science","Research Director's Desk") -var/req_console_assistance = list() -var/req_console_supplies = list() -var/req_console_information = list() -var/list/obj/machinery/requests_console/allConsoles = list() +GLOBAL_LIST_EMPTY(req_console_assistance) +GLOBAL_LIST_EMPTY(req_console_supplies) +GLOBAL_LIST_EMPTY(req_console_information) +GLOBAL_LIST_EMPTY(allRequestConsoles) /obj/machinery/requests_console name = "Requests Console" @@ -93,30 +93,30 @@ var/list/obj/machinery/requests_console/allConsoles = list() announcement.newscast = 0 name = "[department] Requests Console" - allConsoles += src + GLOB.allRequestConsoles += src if(departmentType & RC_ASSIST) - req_console_assistance |= department + GLOB.req_console_assistance |= department if(departmentType & RC_SUPPLY) - req_console_supplies |= department + GLOB.req_console_supplies |= department if(departmentType & RC_INFO) - req_console_information |= department + GLOB.req_console_information |= department set_light(1) /obj/machinery/requests_console/Destroy() - allConsoles -= src + GLOB.allRequestConsoles -= src var/lastDeptRC = 1 - for(var/obj/machinery/requests_console/Console in allConsoles) + for(var/obj/machinery/requests_console/Console in GLOB.allRequestConsoles) if(Console.department == department) lastDeptRC = 0 break if(lastDeptRC) if(departmentType & RC_ASSIST) - req_console_assistance -= department + GLOB.req_console_assistance -= department if(departmentType & RC_SUPPLY) - req_console_supplies -= department + GLOB.req_console_supplies -= department if(departmentType & RC_INFO) - req_console_information -= department + GLOB.req_console_information -= department QDEL_NULL(Radio) return ..() @@ -138,7 +138,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() ui.open() ui.set_auto_update(1) -/obj/machinery/requests_console/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/requests_console/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["department"] = department @@ -148,9 +148,9 @@ var/list/obj/machinery/requests_console/allConsoles = list() data["silent"] = silent data["announcementConsole"] = announcementConsole - data["assist_dept"] = req_console_assistance - data["supply_dept"] = req_console_supplies - data["info_dept"] = req_console_information + data["assist_dept"] = GLOB.req_console_assistance + data["supply_dept"] = GLOB.req_console_supplies + data["info_dept"] = GLOB.req_console_information data["ship_dept"] = GLOB.TAGGERLOCATIONS data["message"] = message @@ -233,7 +233,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() if(tempScreen == RCS_ANNOUNCE && !announcementConsole) return if(tempScreen == RCS_VIEWMSGS) - for(var/obj/machinery/requests_console/Console in allConsoles) + for(var/obj/machinery/requests_console/Console in GLOB.allRequestConsoles) if(Console.department == department) Console.newmessagepriority = 0 Console.icon_state = "req_comp0" diff --git a/code/game/machinery/slotmachine.dm b/code/game/machinery/slotmachine.dm index adbc3d67605..d0cf38a272d 100644 --- a/code/game/machinery/slotmachine.dm +++ b/code/game/machinery/slotmachine.dm @@ -27,7 +27,7 @@ ui.open() ui.set_auto_update(1) -/obj/machinery/slot_machine/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/slot_machine/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["working"] = working data["money"] = account ? account.money : null @@ -52,18 +52,18 @@ icon_state = "slots-on" playsound(src.loc, 'sound/machines/ding.ogg', 50, 1) addtimer(CALLBACK(src, .proc/spin_slots, usr.name), 25) - + /obj/machinery/slot_machine/proc/spin_slots(userName) switch(rand(1,4050)) if(1) // .02% atom_say("JACKPOT! [userName] has won a MILLION CREDITS!") - event_announcement.Announce("Congratulations to [userName] on winning the Jackpot of ONE MILLION CREDITS!", "Jackpot Winner") + GLOB.event_announcement.Announce("Congratulations to [userName] on winning the Jackpot of ONE MILLION CREDITS!", "Jackpot Winner") result = "JACKPOT! You win one million credits!" resultlvl = "highlight" win_money(1000000, 'sound/goonstation/misc/airraid_loop.ogg') if(2 to 5) // .07% atom_say("Big Winner! [userName] has won a hundred thousand credits!") - event_announcement.Announce("Congratulations to [userName] on winning a hundred thousand credits!", "Big Winner") + GLOB.event_announcement.Announce("Congratulations to [userName] on winning a hundred thousand credits!", "Big Winner") result = "Big Winner! You win a hundred thousand credits!" resultlvl = "good" win_money(100000, 'sound/goonstation/misc/klaxon.ogg') diff --git a/code/game/machinery/telecomms/broadcaster.dm b/code/game/machinery/telecomms/broadcaster.dm index 8cd285c994a..f19bc0fd43b 100644 --- a/code/game/machinery/telecomms/broadcaster.dm +++ b/code/game/machinery/telecomms/broadcaster.dm @@ -5,8 +5,8 @@ They receive their message from a server after the message has been logged. */ -var/list/recentmessages = list() // global list of recent messages broadcasted : used to circumvent massive radio spam -var/message_delay = 0 // To make sure restarting the recentmessages list is kept in sync +GLOBAL_LIST_EMPTY(recentmessages) // global list of recent messages broadcasted : used to circumvent massive radio spam +GLOBAL_VAR_INIT(message_delay, 0) // To make sure restarting the recentmessages list is kept in sync /obj/machinery/telecomms/broadcaster name = "Subspace Broadcaster" @@ -37,9 +37,9 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept original.data["level"] = signal.data["level"] var/signal_message = "[signal.frequency]:[signal.data["message"]]:[signal.data["realname"]]" - if(signal_message in recentmessages) + if(signal_message in GLOB.recentmessages) return - recentmessages.Add(signal_message) + GLOB.recentmessages.Add(signal_message) if(signal.data["slow"] > 0) sleep(signal.data["slow"]) // simulate the network lag if necessary @@ -85,19 +85,19 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept signal.data["realname"], signal.data["vname"], 4, signal.data["compression"], signal.data["level"], signal.frequency, signal.data["verb"]) - if(!message_delay) - message_delay = 1 + if(!GLOB.message_delay) + GLOB.message_delay = 1 spawn(10) - message_delay = 0 - recentmessages = list() + GLOB.message_delay = 0 + GLOB.recentmessages = list() /* --- Do a snazzy animation! --- */ flick("broadcaster_send", src) /obj/machinery/telecomms/broadcaster/Destroy() // In case message_delay is left on 1, otherwise it won't reset the list and people can't say the same thing twice anymore. - if(message_delay) - message_delay = 0 + if(GLOB.message_delay) + GLOB.message_delay = 0 return ..() @@ -377,32 +377,32 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept //var/blackbox_admin_msg = "[part_a][M.name] (Real name: [M.real_name])[part_blackbox_b][quotedmsg][part_c]" //BR.messages_admin += blackbox_admin_msg - if(istype(blackbox)) + if(istype(GLOB.blackbox)) switch(display_freq) if(PUB_FREQ) - blackbox.msg_common += blackbox_msg + GLOB.blackbox.msg_common += blackbox_msg if(SCI_FREQ) - blackbox.msg_science += blackbox_msg + GLOB.blackbox.msg_science += blackbox_msg if(COMM_FREQ) - blackbox.msg_command += blackbox_msg + GLOB.blackbox.msg_command += blackbox_msg if(MED_FREQ) - blackbox.msg_medical += blackbox_msg + GLOB.blackbox.msg_medical += blackbox_msg if(ENG_FREQ) - blackbox.msg_engineering += blackbox_msg + GLOB.blackbox.msg_engineering += blackbox_msg if(SEC_FREQ) - blackbox.msg_security += blackbox_msg + GLOB.blackbox.msg_security += blackbox_msg if(DTH_FREQ) - blackbox.msg_deathsquad += blackbox_msg + GLOB.blackbox.msg_deathsquad += blackbox_msg if(SYND_FREQ) - blackbox.msg_syndicate += blackbox_msg + GLOB.blackbox.msg_syndicate += blackbox_msg if(SYNDTEAM_FREQ) - blackbox.msg_syndteam += blackbox_msg + GLOB.blackbox.msg_syndteam += blackbox_msg if(SUP_FREQ) - blackbox.msg_cargo += blackbox_msg + GLOB.blackbox.msg_cargo += blackbox_msg if(SRV_FREQ) - blackbox.msg_service += blackbox_msg + GLOB.blackbox.msg_service += blackbox_msg else - blackbox.messages += blackbox_msg + GLOB.blackbox.messages += blackbox_msg //End of research and feedback code. @@ -561,32 +561,32 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept var/blackbox_msg = "[part_a][source][part_blackbox_b]\"[text]\"[part_c]" //BR.messages_admin += blackbox_admin_msg - if(istype(blackbox)) + if(istype(GLOB.blackbox)) switch(display_freq) if(PUB_FREQ) - blackbox.msg_common += blackbox_msg + GLOB.blackbox.msg_common += blackbox_msg if(SCI_FREQ) - blackbox.msg_science += blackbox_msg + GLOB.blackbox.msg_science += blackbox_msg if(COMM_FREQ) - blackbox.msg_command += blackbox_msg + GLOB.blackbox.msg_command += blackbox_msg if(MED_FREQ) - blackbox.msg_medical += blackbox_msg + GLOB.blackbox.msg_medical += blackbox_msg if(ENG_FREQ) - blackbox.msg_engineering += blackbox_msg + GLOB.blackbox.msg_engineering += blackbox_msg if(SEC_FREQ) - blackbox.msg_security += blackbox_msg + GLOB.blackbox.msg_security += blackbox_msg if(DTH_FREQ) - blackbox.msg_deathsquad += blackbox_msg + GLOB.blackbox.msg_deathsquad += blackbox_msg if(SYND_FREQ) - blackbox.msg_syndicate += blackbox_msg + GLOB.blackbox.msg_syndicate += blackbox_msg if(SYNDTEAM_FREQ) - blackbox.msg_syndteam += blackbox_msg + GLOB.blackbox.msg_syndteam += blackbox_msg if(SUP_FREQ) - blackbox.msg_cargo += blackbox_msg + GLOB.blackbox.msg_cargo += blackbox_msg if(SRV_FREQ) - blackbox.msg_service += blackbox_msg + GLOB.blackbox.msg_service += blackbox_msg else - blackbox.messages += blackbox_msg + GLOB.blackbox.messages += blackbox_msg //End of research and feedback code. @@ -653,7 +653,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept signal.frequency = PUB_FREQ// Common channel //#### Sending the signal to all subspace receivers ####// - for(var/obj/machinery/telecomms/receiver/R in telecomms_list) + for(var/obj/machinery/telecomms/receiver/R in GLOB.telecomms_list) spawn(0) R.receive_signal(signal) diff --git a/code/game/machinery/telecomms/ntsl2.dm b/code/game/machinery/telecomms/ntsl2.dm index c8501d8181e..ef3db72a6a2 100644 --- a/code/game/machinery/telecomms/ntsl2.dm +++ b/code/game/machinery/telecomms/ntsl2.dm @@ -5,7 +5,7 @@ GLOBAL_DATUM_INIT(nttc_config, /datum/nttc_configuration, new()) // Custom Implementations for NTTC /* NTTC Configuration Datum - * This is an abstract handler for the configuration loadout. It's set up like this both for ease of transfering in and out of the UI + * This is an abstract handler for the configuration loadout. It's set up like this both for ease of transfering in and out of the UI * as well as allowing users to save and load configurations. */ /datum/nttc_configuration @@ -206,7 +206,7 @@ GLOBAL_DATUM_INIT(nttc_config, /datum/nttc_configuration, new()) /* Tables */ // regex = list() - /* Arrays */ + /* Arrays */ firewall = list() @@ -223,7 +223,7 @@ GLOBAL_DATUM_INIT(nttc_config, /datum/nttc_configuration, new()) for(var/variable in to_serialize) .[variable] = vars[variable] . = json_encode(.) - + // This loads a configuration from a JSON string. // Fucking broken as shit, someone help me fix this. /datum/nttc_configuration/proc/nttc_deserialize(text, obj/machinery/computer/telecomms/traffic/source, var/ckey) @@ -272,17 +272,17 @@ GLOBAL_DATUM_INIT(nttc_config, /datum/nttc_configuration, new()) signal.data["reject"] = TRUE return - // Firewall + // Firewall // This must happen before anything else modifies the signal ["name"]. if(islist(firewall) && firewall.len > 0) if(firewall.Find(signal.data["name"])) signal.data["reject"] = 1 - // All job and coloring shit + // All job and coloring shit if(toggle_job_color || toggle_name_color) var/job = signal.data["job"] job_class = all_jobs[job] - + if(toggle_name_color) var/new_name = "" + signal.data["name"] + "" signal.data["name"] = new_name @@ -440,7 +440,7 @@ GLOBAL_DATUM_INIT(nttc_config, /datum/nttc_configuration, new()) if(requires_unlock[href_list["array"]] && !source.unlocked) return var/new_value = clean_input(user, "Provide a value for the new index.", "New Index") - if(new_value == null) + if(new_value == null) return var/list/array = vars[href_list["array"]] array.Add(new_value) diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm index 06eacdd8da1..82baea0e054 100644 --- a/code/game/machinery/telecomms/telecomunications.dm +++ b/code/game/machinery/telecomms/telecomunications.dm @@ -11,7 +11,7 @@ Look at radio.dm for the prequel to this code. */ -var/global/list/obj/machinery/telecomms/telecomms_list = list() +GLOBAL_LIST_EMPTY(telecomms_list) /obj/machinery/telecomms var/list/links = list() // list of machines this machine is linked to @@ -106,7 +106,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list() /obj/machinery/telecomms/New() - telecomms_list += src + GLOB.telecomms_list += src ..() //Set the listening_level if there's none. @@ -124,13 +124,13 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list() for(var/obj/machinery/telecomms/T in orange(20, src)) add_link(T) else - for(var/obj/machinery/telecomms/T in telecomms_list) + for(var/obj/machinery/telecomms/T in GLOB.telecomms_list) add_link(T) /obj/machinery/telecomms/Destroy() - telecomms_list -= src - for(var/obj/machinery/telecomms/comm in telecomms_list) + GLOB.telecomms_list -= src + for(var/obj/machinery/telecomms/comm in GLOB.telecomms_list) comm.links -= src links.Cut() return ..() diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index 04803286db1..b92e3c78bb8 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -76,7 +76,7 @@ ui = new(user, src, ui_key, "teleporter_console.tmpl", "Teleporter Console UI", 400, 400) ui.open() -/obj/machinery/computer/teleporter/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/teleporter/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["powerstation"] = power_station if(power_station) diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm index 2876188baa2..9dda3b193bb 100644 --- a/code/game/machinery/turret_control.dm +++ b/code/game/machinery/turret_control.dm @@ -147,7 +147,7 @@ ui.open() ui.set_auto_update(1) -/obj/machinery/turretid/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/turretid/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["access"] = !isLocked(user) data["locked"] = locked diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 738fb3a5318..e3b1322f34b 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -222,7 +222,7 @@ ..() /obj/machinery/vending/attackby(obj/item/I, mob/user, params) - if(currently_vending && vendor_account && !vendor_account.suspended) + if(currently_vending && GLOB.vendor_account && !GLOB.vendor_account.suspended) var/paid = 0 var/handled = 0 if(istype(I, /obj/item/card/id)) @@ -452,8 +452,8 @@ return 0 else // Okay to move the money at this point - var/paid = customer_account.charge(currently_vending.price, vendor_account, - "Purchase of [currently_vending.name]", name, vendor_account.owner_name, + var/paid = customer_account.charge(currently_vending.price, GLOB.vendor_account, + "Purchase of [currently_vending.name]", name, GLOB.vendor_account.owner_name, "Sale of [currently_vending.name]", customer_account.owner_name) if(paid) @@ -469,8 +469,8 @@ * Called after the money has already been taken from the customer. */ /obj/machinery/vending/proc/credit_purchase(var/target as text) - vendor_account.money += currently_vending.price - vendor_account.credit(currently_vending.price, "Sale of [currently_vending.name]", + GLOB.vendor_account.money += currently_vending.price + GLOB.vendor_account.credit(currently_vending.price, "Sale of [currently_vending.name]", name, target) /obj/machinery/vending/attack_ai(mob/user) @@ -503,7 +503,7 @@ ui = new(user, src, ui_key, "vending_machine.tmpl", src.name, 440, 600) ui.open() -/obj/machinery/vending/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/vending/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/list/data = list() if(currently_vending) data["mode"] = 1 @@ -573,7 +573,7 @@ eject_item(usr) if(href_list["pay"]) - if(currently_vending && vendor_account && !vendor_account.suspended) + if(currently_vending && GLOB.vendor_account && !GLOB.vendor_account.suspended) var/paid = 0 var/handled = 0 var/datum/money_account/A = usr.get_worn_id_account() @@ -621,7 +621,7 @@ vend(R, usr) else currently_vending = R - if(!vendor_account || vendor_account.suspended) + if(!GLOB.vendor_account || GLOB.vendor_account.suspended) status_message = "This machine is currently unable to process payments due to problems with the associated account." status_error = 1 else @@ -770,7 +770,7 @@ continue var/obj/O = new dump_path(loc) - step(O, pick(alldirs)) + step(O, pick(GLOB.alldirs)) found_anything = TRUE dump_amount++ if(dump_amount >= 16) diff --git a/code/game/magic/Uristrunes.dm b/code/game/magic/Uristrunes.dm index e0621db3d9b..11ca1467918 100644 --- a/code/game/magic/Uristrunes.dm +++ b/code/game/magic/Uristrunes.dm @@ -11,29 +11,29 @@ return get_rune(bits, animated) -var/list/rune_cache = list() -var/runetype = "rune" +GLOBAL_LIST_EMPTY(cult_rune_cache) +GLOBAL_VAR_INIT(cult_rune_style, "rune") // Style of run the cult is using (fire, death, regular, etc) /proc/get_rune(symbol_bits, animated = 0) var/lookup = "[symbol_bits]-[animated]" if(!SSticker.mode)//work around for maps with runes and cultdat is not loaded all the way - runetype = "rune" + GLOB.cult_rune_style = "rune" else if(SSticker.cultdat.theme == "fire") - runetype = "fire-rune" + GLOB.cult_rune_style = "fire-rune" else if(SSticker.cultdat.theme == "death") - runetype = "death-rune" + GLOB.cult_rune_style = "death-rune" - if(lookup in rune_cache) - return rune_cache[lookup] + if(lookup in GLOB.cult_rune_cache) + return GLOB.cult_rune_cache[lookup] - var/icon/I = icon('icons/effects/uristrunes.dmi', "[runetype]-179") + var/icon/I = icon('icons/effects/uristrunes.dmi', "[GLOB.cult_rune_style]-179") for(var/i = 0, i < 10, i++) if(symbol_bits & (1 << i)) - I.Blend(icon('icons/effects/uristrunes.dmi', "[runetype]-[1 << i]"), ICON_OVERLAY) + I.Blend(icon('icons/effects/uristrunes.dmi', "[GLOB.cult_rune_style]-[1 << i]"), ICON_OVERLAY) I.SwapColor(rgb(0, 0, 0, 100), rgb(100, 0, 0, 200))//TO DO COMMENT:NEED TO ADJUST FOR DIFFRNET CULTS @@ -90,6 +90,6 @@ var/runetype = "rune" result.Insert(I3, "", frame = 7, delay = 2) result.Insert(I2, "", frame = 8, delay = 2) - rune_cache[lookup] = result + GLOB.cult_rune_cache[lookup] = result return result diff --git a/code/game/mecha/mech_bay.dm b/code/game/mecha/mech_bay.dm index 0c9ae020a1e..04322c63093 100644 --- a/code/game/mecha/mech_bay.dm +++ b/code/game/mecha/mech_bay.dm @@ -134,7 +134,7 @@ return recharge_port = locate(/obj/machinery/mech_bay_recharge_port) in range(1) if(!recharge_port) - for(var/D in cardinal) + for(var/D in GLOB.cardinal) var/turf/A = get_step(src, D) A = get_step(A, D) recharge_port = locate(/obj/machinery/mech_bay_recharge_port) in A @@ -171,7 +171,7 @@ // auto update every Master Controller tick ui.set_auto_update(1) -/obj/machinery/computer/mech_bay_power_console/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/mech_bay_power_console/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] if(!recharge_port) reconnect() diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 69ba9941303..cc58d7efe7e 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -112,7 +112,7 @@ log_message("[src] created.") GLOB.mechas_list += src //global mech list prepare_huds() - for(var/datum/atom_hud/data/diagnostic/diag_hud in huds) + for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds) diag_hud.add_to_hud(src) diag_hud_set_mechhealth() diag_hud_set_mechcell() diff --git a/code/game/mecha/mecha_control_console.dm b/code/game/mecha/mecha_control_console.dm index 0313397a809..9a3dffb0c3b 100644 --- a/code/game/mecha/mecha_control_console.dm +++ b/code/game/mecha/mecha_control_console.dm @@ -23,7 +23,7 @@ ui.open() ui.set_auto_update(1) -/obj/machinery/computer/mecha/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/mecha/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["screen"] = screen if(screen == 0) diff --git a/code/game/mecha/medical/odysseus.dm b/code/game/mecha/medical/odysseus.dm index 2cef4d49dd3..93003258008 100644 --- a/code/game/mecha/medical/odysseus.dm +++ b/code/game/mecha/medical/odysseus.dm @@ -19,7 +19,7 @@ if(istype(H.glasses, /obj/item/clothing/glasses/hud)) occupant_message("[H.glasses] prevent you from using the built-in medical hud.") else - var/datum/atom_hud/data/human/medical/advanced/A = huds[DATA_HUD_MEDICAL_ADVANCED] + var/datum/atom_hud/data/human/medical/advanced/A = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] A.add_hud_to(H) builtin_hud_user = 1 @@ -27,19 +27,19 @@ . = ..() if(.) if(occupant.client) - var/datum/atom_hud/A = huds[DATA_HUD_MEDICAL_ADVANCED] + var/datum/atom_hud/A = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] A.add_hud_to(occupant) builtin_hud_user = 1 /obj/mecha/medical/odysseus/go_out() if(ishuman(occupant) && builtin_hud_user) var/mob/living/carbon/human/H = occupant - var/datum/atom_hud/data/human/medical/advanced/A = huds[DATA_HUD_MEDICAL_ADVANCED] + var/datum/atom_hud/data/human/medical/advanced/A = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] A.remove_hud_from(H) builtin_hud_user = 0 else if((isbrain(occupant) || pilot_is_mmi()) && builtin_hud_user) var/mob/living/carbon/brain/H = occupant - var/datum/atom_hud/A = huds[DATA_HUD_MEDICAL_ADVANCED] + var/datum/atom_hud/A = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] A.remove_hud_from(H) builtin_hud_user = 0 diff --git a/code/game/objects/effects/anomalies.dm b/code/game/objects/effects/anomalies.dm index cc2100d568f..8b9e5e92319 100644 --- a/code/game/objects/effects/anomalies.dm +++ b/code/game/objects/effects/anomalies.dm @@ -26,7 +26,7 @@ /obj/effect/anomaly/proc/anomalyEffect() if(prob(50)) - step(src,pick(alldirs)) + step(src,pick(GLOB.alldirs)) /obj/effect/anomaly/proc/anomalyNeutralize() diff --git a/code/game/objects/effects/bump_teleporter.dm b/code/game/objects/effects/bump_teleporter.dm index be8acfc80bc..f2ba7d03ee0 100644 --- a/code/game/objects/effects/bump_teleporter.dm +++ b/code/game/objects/effects/bump_teleporter.dm @@ -1,4 +1,4 @@ -var/list/obj/effect/bump_teleporter/BUMP_TELEPORTERS = list() +GLOBAL_LIST_EMPTY(bump_teleporters) /obj/effect/bump_teleporter name = "bump-teleporter" @@ -13,10 +13,10 @@ var/list/obj/effect/bump_teleporter/BUMP_TELEPORTERS = list() /obj/effect/bump_teleporter/New() ..() - BUMP_TELEPORTERS += src + GLOB.bump_teleporters += src /obj/effect/bump_teleporter/Destroy() - BUMP_TELEPORTERS -= src + GLOB.bump_teleporters -= src return ..() /obj/effect/bump_teleporter/singularity_act() @@ -34,7 +34,7 @@ var/list/obj/effect/bump_teleporter/BUMP_TELEPORTERS = list() //user.loc = src.loc //Stop at teleporter location, there is nowhere to teleport to. return - for(var/obj/effect/bump_teleporter/BT in BUMP_TELEPORTERS) + for(var/obj/effect/bump_teleporter/BT in GLOB.bump_teleporters) if(BT.id == src.id_target) usr.loc = BT.loc //Teleport to location with correct id. return diff --git a/code/game/objects/effects/decals/Cleanable/fuel.dm b/code/game/objects/effects/decals/Cleanable/fuel.dm index 6c7ea8f3247..cc728919079 100644 --- a/code/game/objects/effects/decals/Cleanable/fuel.dm +++ b/code/game/objects/effects/decals/Cleanable/fuel.dm @@ -26,7 +26,7 @@ var/turf/simulated/S = loc if(!istype(S)) return - for(var/d in cardinal) + for(var/d in GLOB.cardinal) if(rand(25)) var/turf/simulated/target = get_step(src, d) var/turf/simulated/origin = get_turf(src) diff --git a/code/game/objects/effects/decals/Cleanable/humans.dm b/code/game/objects/effects/decals/Cleanable/humans.dm index fd7ce125089..7e626584780 100644 --- a/code/game/objects/effects/decals/Cleanable/humans.dm +++ b/code/game/objects/effects/decals/Cleanable/humans.dm @@ -1,6 +1,6 @@ #define DRYING_TIME 5 * 60 * 10 //for 1 unit of depth in puddle (amount var) -var/global/list/image/splatter_cache = list() +GLOBAL_LIST_EMPTY(splatter_cache) /obj/effect/decal/cleanable/blood name = "blood" diff --git a/code/game/objects/effects/decals/Cleanable/tracks.dm b/code/game/objects/effects/decals/Cleanable/tracks.dm index 52109a5ae86..832a66a93ba 100644 --- a/code/game/objects/effects/decals/Cleanable/tracks.dm +++ b/code/game/objects/effects/decals/Cleanable/tracks.dm @@ -2,7 +2,7 @@ #define TRACKS_CRUSTIFY_TIME 50 // color-dir-dry -var/global/list/image/fluidtrack_cache = list() +GLOBAL_LIST_EMPTY(fluidtrack_cache) // Footprints, tire trails... /obj/effect/decal/cleanable/blood/tracks @@ -55,7 +55,7 @@ var/global/list/image/fluidtrack_cache = list() if(!(entered_dirs & H.dir)) entered_dirs |= H.dir update_icon() - + /obj/effect/decal/cleanable/blood/footprints/Uncrossed(atom/movable/O) ..() if(ishuman(O)) @@ -87,24 +87,24 @@ var/global/list/image/fluidtrack_cache = list() /obj/effect/decal/cleanable/blood/footprints/update_icon() overlays.Cut() - for(var/Ddir in cardinal) + for(var/Ddir in GLOB.cardinal) if(entered_dirs & Ddir) var/image/I - if(fluidtrack_cache["entered-[blood_state]-[Ddir]"]) - I = fluidtrack_cache["entered-[blood_state]-[Ddir]"] + if(GLOB.fluidtrack_cache["entered-[blood_state]-[Ddir]"]) + I = GLOB.fluidtrack_cache["entered-[blood_state]-[Ddir]"] else I = image(icon,"[blood_state]1",dir = Ddir) - fluidtrack_cache["entered-[blood_state]-[Ddir]"] = I + GLOB.fluidtrack_cache["entered-[blood_state]-[Ddir]"] = I if(I) I.color = basecolor overlays += I if(exited_dirs & Ddir) var/image/I - if(fluidtrack_cache["exited-[blood_state]-[Ddir]"]) - I = fluidtrack_cache["exited-[blood_state]-[Ddir]"] + if(GLOB.fluidtrack_cache["exited-[blood_state]-[Ddir]"]) + I = GLOB.fluidtrack_cache["exited-[blood_state]-[Ddir]"] else I = image(icon,"[blood_state]2",dir = Ddir) - fluidtrack_cache["exited-[blood_state]-[Ddir]"] = I + GLOB.fluidtrack_cache["exited-[blood_state]-[Ddir]"] = I if(I) I.color = basecolor overlays += I diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm index 7301eb2df03..9907e903970 100644 --- a/code/game/objects/effects/effect_system.dm +++ b/code/game/objects/effects/effect_system.dm @@ -118,10 +118,10 @@ would spawn and follow the beaker, even if it is carried or thrown. // will always spawn at the items location, even if it's moved. /* Example: -var/datum/effect/system/steam_spread/steam = new /datum/effect/system/steam_spread() -- creates new system -steam.set_up(5, 0, mob.loc) -- sets up variables -OPTIONAL: steam.attach(mob) -steam.start() -- spawns the effect + var/datum/effect/system/steam_spread/steam = new /datum/effect/system/steam_spread() -- creates new system + steam.set_up(5, 0, mob.loc) -- sets up variables + OPTIONAL: steam.attach(mob) + steam.start() -- spawns the effect */ ///////////////////////////////////////////// /obj/effect/effect/steam diff --git a/code/game/objects/effects/effect_system/effect_system.dm b/code/game/objects/effects/effect_system/effect_system.dm index 0884e97687b..5ae6b0c6860 100644 --- a/code/game/objects/effects/effect_system/effect_system.dm +++ b/code/game/objects/effects/effect_system/effect_system.dm @@ -14,11 +14,11 @@ would spawn and follow the beaker, even if it is carried or thrown. /obj/effect/particle_effect/New() ..() if(SSticker) - cameranet.updateVisibility(src) + GLOB.cameranet.updateVisibility(src) /obj/effect/particle_effect/Destroy() if(SSticker) - cameranet.updateVisibility(src) + GLOB.cameranet.updateVisibility(src) return ..() /datum/effect_system @@ -61,9 +61,9 @@ would spawn and follow the beaker, even if it is carried or thrown. total_effects++ var/direction if(cardinals) - direction = pick(cardinal) + direction = pick(GLOB.cardinal) else - direction = pick(alldirs) + direction = pick(GLOB.alldirs) var/steps_amt = pick(1,2,3) for(var/j in 1 to steps_amt) sleep(5) diff --git a/code/game/objects/effects/effect_system/effects_explosion.dm b/code/game/objects/effects/effect_system/effects_explosion.dm index 1080f975135..40fda513099 100644 --- a/code/game/objects/effects/effect_system/effects_explosion.dm +++ b/code/game/objects/effects/effect_system/effects_explosion.dm @@ -15,7 +15,7 @@ for(var/i in 1 to number) spawn(0) var/obj/effect/particle_effect/expl_particles/expl = new /obj/effect/particle_effect/expl_particles(location) - var/direct = pick(alldirs) + var/direct = pick(GLOB.alldirs) var/steps_amt = pick(1;25,2;50,3,4;200) for(var/j in 1 to steps_amt) sleep(1) diff --git a/code/game/objects/effects/effect_system/effects_foam.dm b/code/game/objects/effects/effect_system/effects_foam.dm index 10efb534af2..8ee47d266e8 100644 --- a/code/game/objects/effects/effect_system/effects_foam.dm +++ b/code/game/objects/effects/effect_system/effects_foam.dm @@ -60,7 +60,7 @@ if(--amount < 0) return - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) var/turf/T = get_step(src,direction) if(!T) diff --git a/code/game/objects/effects/effect_system/effects_other.dm b/code/game/objects/effects/effect_system/effects_other.dm index cec70ad90e6..ddd85f6027d 100644 --- a/code/game/objects/effects/effect_system/effects_other.dm +++ b/code/game/objects/effects/effect_system/effects_other.dm @@ -172,13 +172,13 @@ // Clamp all values to MAX_EXPLOSION_RANGE if(round(amount/12) > 0) - devastation = min (MAX_EX_DEVASTATION_RANGE, devastation + round(amount/12)) + devastation = min (GLOB.max_ex_devastation_range, devastation + round(amount/12)) if(round(amount/6) > 0) - heavy = min (MAX_EX_HEAVY_RANGE, heavy + round(amount/6)) + heavy = min (GLOB.max_ex_heavy_range, heavy + round(amount/6)) if(round(amount/3) > 0) - light = min (MAX_EX_LIGHT_RANGE, light + round(amount/3)) + light = min (GLOB.max_ex_light_range, light + round(amount/3)) if(flashing && flashing_factor) flash += (round(amount/4) * flashing_factor) diff --git a/code/game/objects/effects/effect_system/effects_smoke.dm b/code/game/objects/effects/effect_system/effects_smoke.dm index 93ab0c8e51b..a8d442bbbb4 100644 --- a/code/game/objects/effects/effect_system/effects_smoke.dm +++ b/code/game/objects/effects/effect_system/effects_smoke.dm @@ -97,9 +97,9 @@ var/obj/effect/particle_effect/smoke/S = new effect_type(location) if(!direction) if(cardinals) - S.direction = pick(cardinal) + S.direction = pick(GLOB.cardinal) else - S.direction = pick(alldirs) + S.direction = pick(GLOB.alldirs) else S.direction = direction S.steps = pick(0,1,1,1,2,2,2,3) diff --git a/code/game/objects/effects/effect_system/effects_water.dm b/code/game/objects/effects/effect_system/effects_water.dm index 12fc9732bb5..4e3b5863dd5 100644 --- a/code/game/objects/effects/effect_system/effects_water.dm +++ b/code/game/objects/effects/effect_system/effects_water.dm @@ -33,10 +33,10 @@ // will always spawn at the items location, even if it's moved. /* Example: -var/datum/effect_system/steam_spread/steam = new /datum/effect_system/steam_spread() -- creates new system -steam.set_up(5, 0, mob.loc) -- sets up variables -OPTIONAL: steam.attach(mob) -steam.start() -- spawns the effect + var/datum/effect_system/steam_spread/steam = new /datum/effect_system/steam_spread() -- creates new system + steam.set_up(5, 0, mob.loc) -- sets up variables + OPTIONAL: steam.attach(mob) + steam.start() -- spawns the effect */ ///////////////////////////////////////////// /obj/effect/particle_effect/steam diff --git a/code/game/objects/effects/glowshroom.dm b/code/game/objects/effects/glowshroom.dm index dc12f91c618..b520648a599 100644 --- a/code/game/objects/effects/glowshroom.dm +++ b/code/game/objects/effects/glowshroom.dm @@ -102,7 +102,7 @@ var/placeCount = 1 for(var/obj/structure/glowshroom/shroom in newLoc) shroomCount++ - for(var/wallDir in cardinal) + for(var/wallDir in GLOB.cardinal) var/turf/isWall = get_step(newLoc,wallDir) if(isWall.density) placeCount++ @@ -123,7 +123,7 @@ /obj/structure/glowshroom/proc/CalcDir(turf/location = loc) var/direction = 16 - for(var/wallDir in cardinal) + for(var/wallDir in GLOB.cardinal) var/turf/newTurf = get_step(location,wallDir) if(newTurf.density) direction |= wallDir diff --git a/code/game/objects/effects/landmarks.dm b/code/game/objects/effects/landmarks.dm index 51eab134ac1..24bd5ce6e58 100644 --- a/code/game/objects/effects/landmarks.dm +++ b/code/game/objects/effects/landmarks.dm @@ -13,80 +13,80 @@ switch(name) //some of these are probably obsolete if("start") - newplayer_start += loc + GLOB.newplayer_start += loc qdel(src) if("wizard") - wizardstart += loc + GLOB.wizardstart += loc qdel(src) if("JoinLate") - latejoin += loc + GLOB.latejoin += loc qdel(src) if("JoinLateGateway") - latejoin_gateway += loc + GLOB.latejoin_gateway += loc qdel(src) if("JoinLateCryo") - latejoin_cryo += loc + GLOB.latejoin_cryo += loc qdel(src) if("JoinLateCyborg") - latejoin_cyborg += loc + GLOB.latejoin_cyborg += loc qdel(src) if("prisonwarp") - prisonwarp += loc + GLOB.prisonwarp += loc qdel(src) if("prisonsecuritywarp") - prisonsecuritywarp += loc + GLOB.prisonsecuritywarp += loc qdel(src) if("tdome1") - tdome1 += loc + GLOB.tdome1 += loc if("tdome2") - tdome2 += loc + GLOB.tdome2 += loc if("tdomeadmin") - tdomeadmin += loc + GLOB.tdomeadmin += loc if("tdomeobserve") - tdomeobserve += loc + GLOB.tdomeobserve += loc if("aroomwarp") - aroomwarp += loc + GLOB.aroomwarp += loc if("blobstart") - blobstart += loc + GLOB.blobstart += loc qdel(src) if("xeno_spawn") - xeno_spawn += loc + GLOB.xeno_spawn += loc qdel(src) if("ninjastart") - ninjastart += loc + GLOB.ninjastart += loc qdel(src) if("carpspawn") - carplist += loc + GLOB.carplist += loc if("voxstart") - raider_spawn += loc + GLOB.raider_spawn += loc if("ERT Director") - ertdirector += loc + GLOB.ertdirector += loc qdel(src) if("Response Team") - emergencyresponseteamspawn += loc + GLOB.emergencyresponseteamspawn += loc qdel(src) if("Syndicate Officer") - syndicateofficer += loc + GLOB.syndicateofficer += loc qdel(src) GLOB.landmarks_list += src diff --git a/code/game/objects/effects/snowcloud.dm b/code/game/objects/effects/snowcloud.dm index 5723b66bc04..66535adc856 100644 --- a/code/game/objects/effects/snowcloud.dm +++ b/code/game/objects/effects/snowcloud.dm @@ -52,7 +52,7 @@ /obj/effect/snowcloud/proc/try_to_spread_cloud() if(prob(95 - parent_machine.cooling_speed * 5)) //10 / 15 / 20 / 25% chance to spawn a new cloud return - var/list/random_dirs = shuffle(cardinal) + var/list/random_dirs = shuffle(GLOB.cardinal) for(var/potential in random_dirs) var/turf/T = get_turf(get_step(src, potential)) if(isspaceturf(T) || T.density) diff --git a/code/game/objects/effects/spawners/gibspawner.dm b/code/game/objects/effects/spawners/gibspawner.dm index 1678f67e8d6..998fb4a2868 100644 --- a/code/game/objects/effects/spawners/gibspawner.dm +++ b/code/game/objects/effects/spawners/gibspawner.dm @@ -11,7 +11,7 @@ gibamounts = list(1,1,1,1,1,1,1) /obj/effect/gibspawner/human/New() - gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), alldirs, alldirs, list()) + gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, GLOB.alldirs, list()) gibamounts[6] = pick(0,1,2) ..() @@ -20,7 +20,7 @@ gibamounts = list(1,1,1,1,1,1,1) /obj/effect/gibspawner/xeno/New() - gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), alldirs, alldirs, list()) + gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, GLOB.alldirs, list()) gibamounts[6] = pick(0,1,2) ..() @@ -30,6 +30,6 @@ gibamounts = list(1,1,1,1,1,1) /obj/effect/gibspawner/robot/New() - gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), alldirs, alldirs) + gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, GLOB.alldirs) gibamounts[6] = pick(0,1,2) ..() diff --git a/code/game/objects/effects/spawners/windowspawner.dm b/code/game/objects/effects/spawners/windowspawner.dm index e19aa54fd7d..cf29d86a450 100644 --- a/code/game/objects/effects/spawners/windowspawner.dm +++ b/code/game/objects/effects/spawners/windowspawner.dm @@ -16,7 +16,7 @@ qdel(G) //just in case mappers don't know what they are doing if(!useFull) - for(var/cdir in cardinal) + for(var/cdir in GLOB.cardinal) for(var/obj/effect/spawner/window/WS in get_step(src,cdir)) cdir = null break diff --git a/code/game/objects/effects/temporary_visuals/miscellaneous.dm b/code/game/objects/effects/temporary_visuals/miscellaneous.dm index e2f137cafa4..27d5eafb677 100644 --- a/code/game/objects/effects/temporary_visuals/miscellaneous.dm +++ b/code/game/objects/effects/temporary_visuals/miscellaneous.dm @@ -18,7 +18,7 @@ /obj/effect/temp_visual/dir_setting/bloodsplatter/New(loc, set_dir, blood_color) if(blood_color) color = blood_color - if(set_dir in diagonals) + if(set_dir in GLOB.diagonals) icon_state = "[splatter_type][pick(1, 2, 6)]" else icon_state = "[splatter_type][pick(3, 4, 5)]" diff --git a/code/game/objects/effects/temporary_visuals/temporary_visual.dm b/code/game/objects/effects/temporary_visuals/temporary_visual.dm index 23b1aaa0d2e..d09acce7255 100644 --- a/code/game/objects/effects/temporary_visuals/temporary_visual.dm +++ b/code/game/objects/effects/temporary_visuals/temporary_visual.dm @@ -11,7 +11,7 @@ /obj/effect/temp_visual/Initialize(mapload) . = ..() if(randomdir) - setDir(pick(cardinal)) + setDir(pick(GLOB.cardinal)) timerid = QDEL_IN(src, duration) diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index 7e17b58a3a4..b10a072389a 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -11,11 +11,11 @@ if(!ignorecap) // Clamp all values to MAX_EXPLOSION_RANGE - devastation_range = min (MAX_EX_DEVASTATION_RANGE, devastation_range) - heavy_impact_range = min (MAX_EX_HEAVY_RANGE, heavy_impact_range) - light_impact_range = min (MAX_EX_LIGHT_RANGE, light_impact_range) - flash_range = min (MAX_EX_FLASH_RANGE, flash_range) - flame_range = min (MAX_EX_FLAME_RANGE, flame_range) + devastation_range = min (GLOB.max_ex_devastation_range, devastation_range) + heavy_impact_range = min (GLOB.max_ex_heavy_range, heavy_impact_range) + light_impact_range = min (GLOB.max_ex_light_range, light_impact_range) + flash_range = min (GLOB.max_ex_flash_range, flash_range) + flame_range = min (GLOB.max_ex_flame_range, flame_range) spawn(0) var/watch = start_watch() @@ -153,12 +153,12 @@ */ var/took = stop_watch(watch) //You need to press the DebugGame verb to see these now....they were getting annoying and we've collected a fair bit of data. Just -test- changes to explosion code using this please so we can compare - if(Debug2) + if(GLOB.debug2) log_world("## DEBUG: Explosion([x0],[y0],[z0])(d[devastation_range],h[heavy_impact_range],l[light_impact_range]): Took [took] seconds.") //Machines which report explosions. - for(var/i,i<=doppler_arrays.len,i++) - var/obj/machinery/doppler_array/Array = doppler_arrays[i] + for(var/i,i<=GLOB.doppler_arrays.len,i++) + var/obj/machinery/doppler_array/Array = GLOB.doppler_arrays[i] if(Array) Array.sense_explosion(x0,y0,z0,devastation_range,heavy_impact_range,light_impact_range,took,orig_dev_range,orig_heavy_range,orig_light_range) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 200034b4b46..d530d0d71d6 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -1,5 +1,4 @@ -var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.dmi', "icon_state" = "fire") - +GLOBAL_DATUM_INIT(fire_overlay, /image, image("icon" = 'icons/goonstation/effects/fire.dmi', "icon_state" = "fire")) /obj/item name = "item" icon = 'icons/obj/items.dmi' @@ -361,7 +360,7 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d //Generic refill proc. Transfers something (e.g. fuel, charge) from an atom to our tool. returns TRUE if it was successful, FALSE otherwise //Not sure if there should be an argument that indicates what exactly is being refilled -/obj/item/proc/refill(mob/user, atom/A, amount) +/obj/item/proc/refill(mob/user, atom/A, amount) return FALSE /obj/item/proc/talk_into(mob/M, var/text, var/channel=null) diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm index 79cc221ee7f..d552b3c7d8f 100644 --- a/code/game/objects/items/blueprints.dm +++ b/code/game/objects/items/blueprints.dm @@ -294,7 +294,7 @@ return ROOM_ERR_TOOLARGE var/turf/T = pending[1] //why byond havent list::pop()? pending -= T - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) var/skip = 0 for(var/obj/structure/window/W in T) if(dir == W.dir || (W.dir in list(NORTHEAST,SOUTHEAST,NORTHWEST,SOUTHWEST))) diff --git a/code/game/objects/items/devices/aicard.dm b/code/game/objects/items/devices/aicard.dm index 60c005de0ed..093f28692ec 100644 --- a/code/game/objects/items/devices/aicard.dm +++ b/code/game/objects/items/devices/aicard.dm @@ -40,7 +40,7 @@ ui_interact(user) -/obj/item/aicard/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = inventory_state) +/obj/item/aicard/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = GLOB.inventory_state) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "aicard.tmpl", "[name]", 600, 400, state = state) @@ -48,7 +48,7 @@ ui.set_auto_update(1) -/obj/item/aicard/ui_data(mob/user, ui_key = "main", datum/topic_state/state = inventory_state) +/obj/item/aicard/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.inventory_state) var/data[0] var/mob/living/silicon/ai/AI = locate() in src diff --git a/code/game/objects/items/devices/autopsy.dm b/code/game/objects/items/devices/autopsy.dm index fc329011d14..c96e935432c 100644 --- a/code/game/objects/items/devices/autopsy.dm +++ b/code/game/objects/items/devices/autopsy.dm @@ -74,7 +74,7 @@ var/dead_notes = input("Insert any relevant notes") var/obj/item/paper/R = new(user.loc) R.name = "Official Coroner's Report - [dead_name]" - R.info = "Nanotrasen Science Station [using_map.station_short] - Coroner's Report

Name of Deceased: [dead_name]

Rank of Deceased: [dead_rank]

Time of Death: [dead_tod]

Cause of Death: [dead_cause]

Trace Chemicals: [dead_chems]

Additional Coroner's Notes: [dead_notes]

Coroner's Signature: " + R.info = "Nanotrasen Science Station [GLOB.using_map.station_short] - Coroner's Report

Name of Deceased: [dead_name]

Rank of Deceased: [dead_rank]

Time of Death: [dead_tod]

Cause of Death: [dead_cause]

Trace Chemicals: [dead_chems]

Additional Coroner's Notes: [dead_notes]

Coroner's Signature: " playsound(loc, 'sound/goonstation/machines/printer_thermal.ogg', 50, 1) sleep(10) user.put_in_hands(R) diff --git a/code/game/objects/items/devices/camera_bug.dm b/code/game/objects/items/devices/camera_bug.dm index 3ca37a3f662..7acf6b61a6d 100644 --- a/code/game/objects/items/devices/camera_bug.dm +++ b/code/game/objects/items/devices/camera_bug.dm @@ -73,7 +73,7 @@ /obj/item/camera_bug/proc/get_cameras() if(world.time > (last_net_update + 100)) bugged_cameras = list() - for(var/obj/machinery/camera/camera in cameranet.cameras) + for(var/obj/machinery/camera/camera in GLOB.cameranet.cameras) if(camera.stat || !camera.can_use()) continue if(length(list("SS13","MINE")&camera.network)) diff --git a/code/game/objects/items/devices/instruments.dm b/code/game/objects/items/devices/instruments.dm index a296e465a59..53ead129836 100644 --- a/code/game/objects/items/devices/instruments.dm +++ b/code/game/objects/items/devices/instruments.dm @@ -35,7 +35,7 @@ song.ui_interact(user, ui_key, ui, force_open) -/obj/item/instrument/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/item/instrument/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) return song.ui_data(user, ui_key, state) /obj/item/instrument/Topic(href, href_list) diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm index 5f987bdce45..b3695229790 100644 --- a/code/game/objects/items/devices/paicard.dm +++ b/code/game/objects/items/devices/paicard.dm @@ -264,7 +264,7 @@ return last_request = world.time / 10 looking_for_personality = 1 - paiController.findPAI(src, usr) + GLOB.paiController.findPAI(src, usr) if(href_list["wipe"]) var/confirm = input("Are you CERTAIN you wish to delete the current personality? This action cannot be undone.", "Personality Wipe") in list("Yes", "No") if(confirm == "Yes") diff --git a/code/game/objects/items/devices/pipe_painter.dm b/code/game/objects/items/devices/pipe_painter.dm index 69beb04f67c..842a96c2af2 100644 --- a/code/game/objects/items/devices/pipe_painter.dm +++ b/code/game/objects/items/devices/pipe_painter.dm @@ -9,7 +9,7 @@ /obj/item/pipe_painter/New() ..() modes = new() - for(var/C in pipe_colors) + for(var/C in GLOB.pipe_colors) modes += "[C]" mode = pick(modes) @@ -23,7 +23,7 @@ to_chat(user, "You must remove the plating first.") return - P.change_color(pipe_colors[mode]) + P.change_color(GLOB.pipe_colors[mode]) /obj/item/pipe_painter/attack_self(mob/user as mob) mode = input("Which colour do you want to use?", "Pipe Painter", mode) in modes diff --git a/code/game/objects/items/devices/radio/electropack.dm b/code/game/objects/items/devices/radio/electropack.dm index 4b5716d73eb..083720f0e22 100644 --- a/code/game/objects/items/devices/radio/electropack.dm +++ b/code/game/objects/items/devices/radio/electropack.dm @@ -103,7 +103,7 @@ ui.open() ui.set_auto_update(1) -/obj/item/radio/electropack/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/item/radio/electropack/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["power"] = on diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index fbfe984d35f..13c97f26730 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -63,7 +63,7 @@ /obj/item/radio/intercom/department/medbay/New() ..() - internal_channels = default_medbay_channels.Copy() + internal_channels = GLOB.default_medbay_channels.Copy() /obj/item/radio/intercom/department/security/New() ..() diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 23d897d491f..900b3449b27 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -1,4 +1,4 @@ -var/global/list/default_internal_channels = list( +GLOBAL_LIST_INIT(default_internal_channels, list( num2text(PUB_FREQ) = list(), num2text(AI_FREQ) = list(ACCESS_CAPTAIN), num2text(ERT_FREQ) = list(ACCESS_CENT_SPECOPS), @@ -11,13 +11,13 @@ var/global/list/default_internal_channels = list( num2text(SCI_FREQ) = list(ACCESS_RESEARCH), num2text(SUP_FREQ) = list(ACCESS_CARGO), num2text(SRV_FREQ) = list(ACCESS_HOP, ACCESS_BAR, ACCESS_KITCHEN, ACCESS_HYDROPONICS, ACCESS_JANITOR, ACCESS_CLOWN, ACCESS_MIME) -) +)) -var/global/list/default_medbay_channels = list( +GLOBAL_LIST_INIT(default_medbay_channels, list( num2text(PUB_FREQ) = list(), num2text(MED_FREQ) = list(ACCESS_MEDICAL), num2text(MED_I_FREQ) = list(ACCESS_MEDICAL) -) +)) /obj/item/radio icon = 'icons/obj/radio.dmi' @@ -69,7 +69,7 @@ var/global/list/default_medbay_channels = list( ..() wires = new(src) - internal_channels = default_internal_channels.Copy() + internal_channels = GLOB.default_internal_channels.Copy() GLOB.global_radios |= src /obj/item/radio/Destroy() @@ -116,7 +116,7 @@ var/global/list/default_medbay_channels = list( ui.open() ui.set_auto_update(1) -/obj/item/radio/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/item/radio/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["mic_status"] = broadcasting @@ -448,12 +448,12 @@ var/global/list/default_medbay_channels = list( //#### Sending the signal to all subspace receivers ####// - for(var/obj/machinery/telecomms/receiver/R in telecomms_list) + for(var/obj/machinery/telecomms/receiver/R in GLOB.telecomms_list) spawn(0) R.receive_signal(signal) // Allinone can act as receivers. - for(var/obj/machinery/telecomms/allinone/R in telecomms_list) + for(var/obj/machinery/telecomms/allinone/R in GLOB.telecomms_list) spawn(0) R.receive_signal(signal) @@ -503,7 +503,7 @@ var/global/list/default_medbay_channels = list( ) signal.frequency = connection.frequency // Quick frequency set - for(var/obj/machinery/telecomms/receiver/R in telecomms_list) + for(var/obj/machinery/telecomms/receiver/R in GLOB.telecomms_list) spawn(0) R.receive_signal(signal) @@ -812,7 +812,7 @@ var/global/list/default_medbay_channels = list( ui.open() ui.set_auto_update(1) -/obj/item/radio/borg/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/item/radio/borg/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["mic_status"] = broadcasting @@ -863,4 +863,4 @@ var/global/list/default_medbay_channels = list( /obj/item/radio/phone/medbay/New() ..() - internal_channels = default_medbay_channels.Copy() + internal_channels = GLOB.default_medbay_channels.Copy() diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm index 7a8766ebb3c..3eeb992c87e 100644 --- a/code/game/objects/items/devices/taperecorder.dm +++ b/code/game/objects/items/devices/taperecorder.dm @@ -194,13 +194,11 @@ if(mytape.storedinfo.len < i + 1) playsleepseconds = 1 sleep(10) - T = get_turf(src) atom_say("End of recording.") else playsleepseconds = mytape.timestamp[i + 1] - mytape.timestamp[i] if(playsleepseconds > 14) sleep(10) - T = get_turf(src) atom_say("Skipping [playsleepseconds] seconds of silence.") playsleepseconds = 1 i++ diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index 40eea3a9856..acba0087caf 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -100,7 +100,7 @@ // auto update every Master Controller tick //ui.set_auto_update(1) -/obj/item/transfer_valve/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/item/transfer_valve/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["attachmentOne"] = tank_one ? tank_one.name : null diff --git a/code/game/objects/items/devices/uplinks.dm b/code/game/objects/items/devices/uplinks.dm index ab4387a988e..4aa5c4532f1 100644 --- a/code/game/objects/items/devices/uplinks.dm +++ b/code/game/objects/items/devices/uplinks.dm @@ -6,7 +6,7 @@ A list of items and costs is stored under the datum of every game mode, alongsid */ -var/list/world_uplinks = list() +GLOBAL_LIST_EMPTY(world_uplinks) /obj/item/uplink var/welcome // Welcoming menu message @@ -35,10 +35,10 @@ var/list/world_uplinks = list() uses = SSticker.mode.uplink_uses uplink_items = get_uplink_items() - world_uplinks += src + GLOB.world_uplinks += src /obj/item/uplink/Destroy() - world_uplinks -= src + GLOB.world_uplinks -= src return ..() /obj/item/uplink/proc/generate_items(mob/user as mob) @@ -216,7 +216,7 @@ var/list/world_uplinks = list() /* NANO UI FOR UPLINK WOOP WOOP */ -/obj/item/uplink/hidden/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = inventory_state) +/obj/item/uplink/hidden/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = GLOB.inventory_state) var/title = "Remote Uplink" // update the ui if it exists, returns null if no ui is passed/found ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) @@ -227,7 +227,7 @@ var/list/world_uplinks = list() // open the new ui window ui.open() -/obj/item/uplink/hidden/ui_data(mob/user, ui_key = "main", datum/topic_state/state = inventory_state) +/obj/item/uplink/hidden/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.inventory_state) var/data[0] data["welcome"] = welcome @@ -277,14 +277,14 @@ var/list/world_uplinks = list() /obj/item/uplink/hidden/proc/update_nano_data(var/id) if(nanoui_menu == 1) var/permanentData[0] - for(var/datum/data/record/L in sortRecord(data_core.general)) + for(var/datum/data/record/L in sortRecord(GLOB.data_core.general)) permanentData[++permanentData.len] = list(Name = sanitize(L.fields["name"]),"id" = L.fields["id"]) nanoui_data["exploit_records"] = permanentData if(nanoui_menu == 11) nanoui_data["exploit_exists"] = 0 - for(var/datum/data/record/L in data_core.general) + for(var/datum/data/record/L in GLOB.data_core.general) if(L.fields["id"] == id) nanoui_data["exploit"] = list() // Setting this to equal L.fields passes it's variables that are lists as reference instead of value. nanoui_data["exploit"]["name"] = html_encode(L.fields["name"]) diff --git a/code/game/objects/items/mountable_frames/mountables.dm b/code/game/objects/items/mountable_frames/mountables.dm index 7120f8c880d..cfb4d18473c 100644 --- a/code/game/objects/items/mountable_frames/mountables.dm +++ b/code/game/objects/items/mountable_frames/mountables.dm @@ -20,7 +20,7 @@ return if(proximity_flag != 1) //if we aren't next to the wall return - if(!( get_dir(on_wall,user) in cardinal)) + if(!( get_dir(on_wall,user) in GLOB.cardinal)) to_chat(user, "You need to be standing next to a wall to place \the [src].") return diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 6ce10294940..46bc15a2ffe 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -14,7 +14,7 @@ ..(newloc) if(model_info && model) model_info = model - var/datum/robolimb/R = all_robolimbs[model] + var/datum/robolimb/R = GLOB.all_robolimbs[model] if(R) name = "[R.company] [initial(name)]" desc = "[R.desc]" @@ -24,7 +24,7 @@ name = "robot [initial(name)]" /obj/item/robot_parts/attack_self(mob/user) - var/choice = input(user, "Select the company appearance for this limb.", "Limb Company Selection") as null|anything in selectable_robolimbs + var/choice = input(user, "Select the company appearance for this limb.", "Limb Company Selection") as null|anything in GLOB.selectable_robolimbs if(!choice) return if(loc != user) diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index 3b214f87940..3911ab51cc7 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -1,7 +1,7 @@ -var/global/list/datum/stack_recipe/rod_recipes = list ( \ +GLOBAL_LIST_INIT(rod_recipes, list ( \ new/datum/stack_recipe("grille", /obj/structure/grille, 2, time = 10, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("table frame", /obj/structure/table_frame, 2, time = 10, one_per_turf = 1, on_floor = 1), \ - ) + )) /obj/item/stack/rods name = "metal rod" @@ -36,7 +36,7 @@ var/global/list/datum/stack_recipe/rod_recipes = list ( \ /obj/item/stack/rods/New(loc, amount=null) ..() - recipes = rod_recipes + recipes = GLOB.rod_recipes update_icon() /obj/item/stack/rods/update_icon() diff --git a/code/game/objects/items/stacks/sheets/leather.dm b/code/game/objects/items/stacks/sheets/leather.dm index d79c31467bf..c8e194bfb00 100644 --- a/code/game/objects/items/stacks/sheets/leather.dm +++ b/code/game/objects/items/stacks/sheets/leather.dm @@ -9,13 +9,13 @@ singular_name = "human skin piece" icon_state = "sheet-hide" -var/global/list/datum/stack_recipe/human_recipes = list( \ +GLOBAL_LIST_INIT(human_recipes, list( \ new/datum/stack_recipe("bloated human costume", /obj/item/clothing/suit/bloated_human, 5, on_floor = 1), \ new/datum/stack_recipe("bloated human costume head", /obj/item/clothing/head/human_head, 5, on_floor = 1), \ - ) + )) /obj/item/stack/sheet/animalhide/human/New(var/loc, var/amount=null) - recipes = human_recipes + recipes = GLOB.human_recipes return ..() /obj/item/stack/sheet/animalhide/generic @@ -132,12 +132,12 @@ GLOBAL_LIST_INIT(leather_recipes, list ( icon_state = "sinew" origin_tech = "biotech=4" -var/global/list/datum/stack_recipe/sinew_recipes = list ( \ +GLOBAL_LIST_INIT(sinew_recipes, list ( \ new/datum/stack_recipe("sinew restraints", /obj/item/restraints/handcuffs/sinew, 1, on_floor = 1), \ - ) + )) /obj/item/stack/sheet/sinew/New(var/loc, var/amount=null) - recipes = sinew_recipes + recipes = GLOB.sinew_recipes return ..() /obj/item/stack/sheet/animalhide/goliath_hide diff --git a/code/game/objects/items/stacks/sheets/mineral.dm b/code/game/objects/items/stacks/sheets/mineral.dm index 0791bb760dc..b8fd23e78cb 100644 --- a/code/game/objects/items/stacks/sheets/mineral.dm +++ b/code/game/objects/items/stacks/sheets/mineral.dm @@ -15,16 +15,16 @@ Mineral Sheets - Adamantine */ -var/global/list/datum/stack_recipe/sandstone_recipes = list ( \ +GLOBAL_LIST_INIT(sandstone_recipes, list ( \ new/datum/stack_recipe("pile of dirt", /obj/machinery/hydroponics/soil, 3, time = 10, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("sandstone door", /obj/structure/mineral_door/sandstone, 10, one_per_turf = 1, on_floor = 1), \ null, \ new/datum/stack_recipe("Assistant Statue", /obj/structure/statue/sandstone/assistant, 5, one_per_turf = 1, on_floor = 1), \ null, \ new/datum/stack_recipe("Breakdown into sand", /obj/item/stack/ore/glass, 1, one_per_turf = 0, on_floor = 1), \ - ) + )) -var/global/list/datum/stack_recipe/silver_recipes = list ( \ +GLOBAL_LIST_INIT(silver_recipes, list ( \ new/datum/stack_recipe("silver door", /obj/structure/mineral_door/silver, 10, one_per_turf = 1, on_floor = 1), \ null, \ new/datum/stack_recipe("silver tile", /obj/item/stack/tile/mineral/silver, 1, 4, 20), \ @@ -34,9 +34,9 @@ var/global/list/datum/stack_recipe/silver_recipes = list ( \ new/datum/stack_recipe("Sec Borg Statue", /obj/structure/statue/silver/secborg, 5, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("Med Doctor Statue", /obj/structure/statue/silver/md, 5, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("Med Borg Statue", /obj/structure/statue/silver/medborg, 5, one_per_turf = 1, on_floor = 1), \ - ) + )) -var/global/list/datum/stack_recipe/diamond_recipes = list ( \ +GLOBAL_LIST_INIT(diamond_recipes, list ( \ new/datum/stack_recipe("diamond door", /obj/structure/mineral_door/transparent/diamond, 10, one_per_turf = 1, on_floor = 1), \ null, \ new/datum/stack_recipe("diamond tile", /obj/item/stack/tile/mineral/diamond, 1, 4, 20), \ @@ -44,18 +44,18 @@ var/global/list/datum/stack_recipe/diamond_recipes = list ( \ new/datum/stack_recipe("Captain Statue", /obj/structure/statue/diamond/captain, 5, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("AI Hologram Statue", /obj/structure/statue/diamond/ai1, 5, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("AI Core Statue", /obj/structure/statue/diamond/ai2, 5, one_per_turf = 1, on_floor = 1), \ - ) + )) -var/global/list/datum/stack_recipe/uranium_recipes = list ( \ +GLOBAL_LIST_INIT(uranium_recipes, list ( \ new/datum/stack_recipe("uranium door", /obj/structure/mineral_door/uranium, 10, one_per_turf = 1, on_floor = 1), \ null, \ new/datum/stack_recipe("uranium tile", /obj/item/stack/tile/mineral/uranium, 1, 4, 20), \ null, \ new/datum/stack_recipe("Nuke Statue", /obj/structure/statue/uranium/nuke, 5, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("Engineer Statue", /obj/structure/statue/uranium/eng, 5, one_per_turf = 1, on_floor = 1), \ - ) + )) -var/global/list/datum/stack_recipe/gold_recipes = list ( \ +GLOBAL_LIST_INIT(gold_recipes, list ( \ new/datum/stack_recipe("golden door", /obj/structure/mineral_door/gold, 10, one_per_turf = 1, on_floor = 1), \ null, \ new/datum/stack_recipe("gold tile", /obj/item/stack/tile/mineral/gold, 1, 4, 20), \ @@ -67,51 +67,51 @@ var/global/list/datum/stack_recipe/gold_recipes = list ( \ new/datum/stack_recipe("CMO Statue", /obj/structure/statue/gold/cmo, 5, one_per_turf = 1, on_floor = 1), \ null, \ new/datum/stack_recipe("Simple Crown", /obj/item/clothing/head/crown, 5), \ - ) + )) -var/global/list/datum/stack_recipe/plasma_recipes = list ( \ +GLOBAL_LIST_INIT(plasma_recipes, list ( \ new/datum/stack_recipe/dangerous("plasma door", /obj/structure/mineral_door/transparent/plasma, 10, one_per_turf = 1, on_floor = 1), \ null, \ new/datum/stack_recipe/dangerous("plasma tile", /obj/item/stack/tile/mineral/plasma, 1, 4, 20), \ null, \ new/datum/stack_recipe/dangerous("Scientist Statue", /obj/structure/statue/plasma/scientist, 5, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe/dangerous("Xenomorph Statue", /obj/structure/statue/plasma/xeno, 5, one_per_turf = 1, on_floor = 1), \ - ) + )) -var/global/list/datum/stack_recipe/bananium_recipes = list ( \ +GLOBAL_LIST_INIT(bananium_recipes, list ( \ new/datum/stack_recipe("bananium tile", /obj/item/stack/tile/mineral/bananium, 1, 4, 20), \ null, \ new/datum/stack_recipe("Clown Statue", /obj/structure/statue/bananium/clown, 5, one_per_turf = 1, on_floor = 1), \ null, \ new/datum/stack_recipe("bananium computer frame", /obj/structure/computerframe/HONKputer, 50, time = 25, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("bananium grenade casing", /obj/item/grenade/bananade/casing, 4, on_floor = 1), \ - ) + )) -var/global/list/datum/stack_recipe/tranquillite_recipes = list ( \ +GLOBAL_LIST_INIT(tranquillite_recipes, list ( \ new/datum/stack_recipe("invisible wall", /obj/structure/barricade/mime, 5, one_per_turf = 1, on_floor = 1, time = 50), \ null, \ new/datum/stack_recipe("silent tile", /obj/item/stack/tile/mineral/tranquillite, 1, 4, 20), \ null, \ new/datum/stack_recipe("Mime Statue", /obj/structure/statue/tranquillite/mime, 5, one_per_turf = 1, on_floor = 1), \ - ) + )) -var/global/list/datum/stack_recipe/abductor_recipes = list ( \ +GLOBAL_LIST_INIT(abductor_recipes, list ( \ new/datum/stack_recipe("alien bed", /obj/structure/bed/abductor, 2, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("alien locker", /obj/structure/closet/abductor, 1, time = 15, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("alien table frame", /obj/structure/table_frame/abductor, 1, time = 15, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("alien airlock assembly", /obj/structure/door_assembly/door_assembly_abductor, 4, time = 20, one_per_turf = 1, on_floor = 1), \ null, \ new/datum/stack_recipe("alien floor tile", /obj/item/stack/tile/mineral/abductor, 1, 4, 20), \ - ) + )) -var/global/list/datum/stack_recipe/adamantine_recipes = list( +GLOBAL_LIST_INIT(adamantine_recipes, list( new /datum/stack_recipe("incomplete servant golem shell", /obj/item/golem_shell/servant, req_amount = 1, res_amount = 1), \ - ) + )) -var/global/list/datum/stack_recipe/snow_recipes = list( +GLOBAL_LIST_INIT(snow_recipes, list( new/datum/stack_recipe("snowman", /obj/structure/snowman, 5, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("Snowball", /obj/item/snowball, 1) - ) + )) /obj/item/stack/sheet/mineral force = 5 @@ -135,7 +135,7 @@ var/global/list/datum/stack_recipe/snow_recipes = list( /obj/item/stack/sheet/mineral/sandstone/New() ..() - recipes = sandstone_recipes + recipes = GLOB.sandstone_recipes /* * Sandbags @@ -186,7 +186,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \ /obj/item/stack/sheet/mineral/diamond/New() ..() - recipes = diamond_recipes + recipes = GLOB.diamond_recipes /obj/item/stack/sheet/mineral/uranium name = "uranium" @@ -199,7 +199,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \ /obj/item/stack/sheet/mineral/uranium/New() ..() - recipes = uranium_recipes + recipes = GLOB.uranium_recipes /obj/item/stack/sheet/mineral/plasma name = "solid plasma" @@ -214,7 +214,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \ /obj/item/stack/sheet/mineral/plasma/New() ..() - recipes = plasma_recipes + recipes = GLOB.plasma_recipes /obj/item/stack/sheet/mineral/plasma/welder_act(mob/user, obj/item/I) if(I.use_tool(src, user, volume = I.tool_volume)) @@ -239,7 +239,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \ /obj/item/stack/sheet/mineral/gold/New() ..() - recipes = gold_recipes + recipes = GLOB.gold_recipes /obj/item/stack/sheet/mineral/silver name = "silver" @@ -252,7 +252,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \ /obj/item/stack/sheet/mineral/silver/New() ..() - recipes = silver_recipes + recipes = GLOB.silver_recipes /obj/item/stack/sheet/mineral/bananium name = "bananium" @@ -265,7 +265,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \ /obj/item/stack/sheet/mineral/bananium/New(loc, amount=null) ..() - recipes = bananium_recipes + recipes = GLOB.bananium_recipes /obj/item/stack/sheet/mineral/tranquillite name = "tranquillite" @@ -279,7 +279,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \ /obj/item/stack/sheet/mineral/tranquillite/New(loc, amount=null) ..() - recipes = tranquillite_recipes + recipes = GLOB.tranquillite_recipes /* * Titanium @@ -356,7 +356,7 @@ var/global/list/datum/stack_recipe/plastitanium_recipes = list ( sheettype = "abductor" /obj/item/stack/sheet/mineral/abductor/New(loc, amount=null) - recipes = abductor_recipes + recipes = GLOB.abductor_recipes ..() /obj/item/stack/sheet/mineral/adamantine @@ -369,7 +369,7 @@ var/global/list/datum/stack_recipe/plastitanium_recipes = list ( wall_allowed = FALSE /obj/item/stack/sheet/mineral/adamantine/New(loc, amount = null) - recipes = adamantine_recipes + recipes = GLOB.adamantine_recipes ..() /* @@ -385,5 +385,5 @@ var/global/list/datum/stack_recipe/plastitanium_recipes = list ( merge_type = /obj/item/stack/sheet/mineral/snow /obj/item/stack/sheet/mineral/snow/New(loc, amount = null) - recipes = snow_recipes + recipes = GLOB.snow_recipes ..() diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 30085f8dad2..ac635eebef7 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -13,7 +13,7 @@ /* * Metal */ -var/global/list/datum/stack_recipe/metal_recipes = list( +GLOBAL_LIST_INIT(metal_recipes, list( new /datum/stack_recipe("stool", /obj/structure/chair/stool, one_per_turf = 1, on_floor = 1), new /datum/stack_recipe("chair", /obj/structure/chair, one_per_turf = 1, on_floor = 1), new /datum/stack_recipe("shuttle seat", /obj/structure/chair/comfy/shuttle, 2, one_per_turf = 1, on_floor = 1), @@ -94,7 +94,7 @@ var/global/list/datum/stack_recipe/metal_recipes = list( new /datum/stack_recipe("intercom frame", /obj/item/mounted/frame/intercom, 2), new /datum/stack_recipe("extinguisher cabinet frame", /obj/item/mounted/frame/extinguisher, 2), null -) +)) /obj/item/stack/sheet/metal name = "metal" @@ -124,13 +124,13 @@ var/global/list/datum/stack_recipe/metal_recipes = list( qdel(src) /obj/item/stack/sheet/metal/New(var/loc, var/amount=null) - recipes = metal_recipes + recipes = GLOB.metal_recipes return ..() /* * Plasteel */ -var/global/list/datum/stack_recipe/plasteel_recipes = list( +GLOBAL_LIST_INIT(plasteel_recipes, list( new /datum/stack_recipe("AI core", /obj/structure/AIcore, 4, time = 50, one_per_turf = 1), new /datum/stack_recipe("bomb assembly", /obj/machinery/syndicatebomb/empty, 3, time = 50), new /datum/stack_recipe("Surgery Table", /obj/machinery/optable, 5, time = 50, one_per_turf = 1, on_floor = 1), @@ -141,7 +141,7 @@ var/global/list/datum/stack_recipe/plasteel_recipes = list( new /datum/stack_recipe("high security airlock assembly", /obj/structure/door_assembly/door_assembly_highsecurity, 6, time = 50, one_per_turf = 1, on_floor = 1), new /datum/stack_recipe("vault door assembly", /obj/structure/door_assembly/door_assembly_vault, 8, time = 50, one_per_turf = 1, on_floor = 1), )), -) +)) /obj/item/stack/sheet/plasteel name = "plasteel" @@ -159,13 +159,13 @@ var/global/list/datum/stack_recipe/plasteel_recipes = list( point_value = 23 /obj/item/stack/sheet/plasteel/New(var/loc, var/amount=null) - recipes = plasteel_recipes + recipes = GLOB.plasteel_recipes return ..() /* * Wood */ -var/global/list/datum/stack_recipe/wood_recipes = list( +GLOBAL_LIST_INIT(wood_recipes, list( new /datum/stack_recipe("wooden sandals", /obj/item/clothing/shoes/sandal, 1), new /datum/stack_recipe("wood floor tile", /obj/item/stack/tile/wood, 1, 4, 20), new /datum/stack_recipe("wood table frame", /obj/structure/table_frame/wood, 2, time = 10), \ @@ -178,7 +178,7 @@ var/global/list/datum/stack_recipe/wood_recipes = list( new /datum/stack_recipe("rifle stock", /obj/item/weaponcrafting/stock, 10, time = 40), new /datum/stack_recipe("wooden door", /obj/structure/mineral_door/wood, 10, time = 20, one_per_turf = 1, on_floor = 1), new /datum/stack_recipe("coffin", /obj/structure/closet/coffin, 5, time = 15, one_per_turf = 1, on_floor = 1), - new/datum/stack_recipe("display case chassis", /obj/structure/displaycase_chassis, 5, one_per_turf = TRUE, on_floor = TRUE), + new /datum/stack_recipe("display case chassis", /obj/structure/displaycase_chassis, 5, one_per_turf = TRUE, on_floor = TRUE), new /datum/stack_recipe("wooden buckler", /obj/item/shield/riot/buckler, 20, time = 40), new /datum/stack_recipe("apiary", /obj/structure/beebox, 40, time = 50), new /datum/stack_recipe("honey frame", /obj/item/honey_frame, 5, time = 10), @@ -189,7 +189,7 @@ var/global/list/datum/stack_recipe/wood_recipes = list( new /datum/stack_recipe("loom", /obj/structure/loom, 10, time = 15, one_per_turf = TRUE, on_floor = TRUE), \ new /datum/stack_recipe("fermenting barrel", /obj/structure/fermenting_barrel, 30, time = 50), new /datum/stack_recipe("firebrand", /obj/item/match/firebrand, 2, time = 100) -) +)) /obj/item/stack/sheet/wood name = "wooden planks" @@ -203,13 +203,13 @@ var/global/list/datum/stack_recipe/wood_recipes = list( merge_type = /obj/item/stack/sheet/wood /obj/item/stack/sheet/wood/New(var/loc, var/amount=null) - recipes = wood_recipes + recipes = GLOB.wood_recipes return ..() /* * Cloth */ -var/global/list/datum/stack_recipe/cloth_recipes = list ( \ +GLOBAL_LIST_INIT(cloth_recipes, list ( \ new/datum/stack_recipe("white jumpsuit", /obj/item/clothing/under/color/white, 3), \ new/datum/stack_recipe("white shoes", /obj/item/clothing/shoes/white, 2), \ new/datum/stack_recipe("white scarf", /obj/item/clothing/accessory/scarf/white, 1), \ @@ -234,7 +234,7 @@ var/global/list/datum/stack_recipe/cloth_recipes = list ( \ new/datum/stack_recipe("white beanie", /obj/item/clothing/head/beanie, 2), \ null, \ new/datum/stack_recipe("blindfold", /obj/item/clothing/glasses/sunglasses/blindfold, 3), \ - ) + )) /obj/item/stack/sheet/cloth name = "cloth" @@ -248,7 +248,7 @@ var/global/list/datum/stack_recipe/cloth_recipes = list ( \ merge_type = /obj/item/stack/sheet/cloth /obj/item/stack/sheet/cloth/New(loc, amount=null) - recipes = cloth_recipes + recipes = GLOB.cloth_recipes ..() /obj/item/stack/sheet/cloth/ten @@ -300,7 +300,7 @@ GLOBAL_LIST_INIT(durathread_recipes, list ( \ /* * Cardboard */ -var/global/list/datum/stack_recipe/cardboard_recipes = list ( +GLOBAL_LIST_INIT(cardboard_recipes, list ( new /datum/stack_recipe("box", /obj/item/storage/box), new /datum/stack_recipe("large box", /obj/item/storage/box/large, 4), new /datum/stack_recipe("patch pack", /obj/item/storage/pill_bottle/patch_pack, 2), @@ -314,7 +314,7 @@ var/global/list/datum/stack_recipe/cardboard_recipes = list ( new /datum/stack_recipe("cardboard tube", /obj/item/c_tube), new /datum/stack_recipe("cardboard box", /obj/structure/closet/cardboard, 4), new/datum/stack_recipe("cardboard cutout", /obj/item/cardboard_cutout, 5), -) +)) /obj/item/stack/sheet/cardboard/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/stamp/clown) && !istype(loc, /obj/item/storage)) @@ -336,21 +336,21 @@ var/global/list/datum/stack_recipe/cardboard_recipes = list ( merge_type = /obj/item/stack/sheet/cardboard /obj/item/stack/sheet/cardboard/New(var/loc, var/amt = null) - recipes = cardboard_recipes + recipes = GLOB.cardboard_recipes return ..() /* * Runed Metal */ -var/global/list/datum/stack_recipe/cult = list ( \ +GLOBAL_LIST_INIT(cult_recipes, list ( \ new/datum/stack_recipe/cult("runed door", /obj/machinery/door/airlock/cult, 1, time = 50, one_per_turf = 1, on_floor = 1), new/datum/stack_recipe/cult("runed girder", /obj/structure/girder/cult, 1, time = 50, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe/cult("pylon", /obj/structure/cult/functional/pylon, 3, time = 40, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe/cult("forge", /obj/structure/cult/functional/forge, 5, time = 40, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe/cult("archives", /obj/structure/cult/functional/archives, 2, time = 40, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe/cult("altar", /obj/structure/cult/functional/altar, 5, time = 40, one_per_turf = 1, on_floor = 1), \ - ) + )) /obj/item/stack/sheet/runed_metal name = "runed metal" @@ -393,13 +393,13 @@ var/global/list/datum/stack_recipe/cult = list ( \ amount = 50 /obj/item/stack/sheet/runed_metal/New(var/loc, var/amount=null) - recipes = cult + recipes = GLOB.cult_recipes return ..() /* * Brass */ -var/global/list/datum/stack_recipe/brass_recipes = list (\ +GLOBAL_LIST_INIT(brass_recipes, list (\ new/datum/stack_recipe("wall gear", /obj/structure/clockwork/wall_gear, 3, time = 10, one_per_turf = TRUE, on_floor = TRUE), \ null, new/datum/stack_recipe/window("brass windoor", /obj/machinery/door/window/clockwork, 2, time = 30, on_floor = TRUE, window_checks = TRUE), \ @@ -408,7 +408,7 @@ var/global/list/datum/stack_recipe/brass_recipes = list (\ new/datum/stack_recipe/window("fulltile brass window", /obj/structure/window/reinforced/clockwork/fulltile, 2, time = 0, on_floor = TRUE, window_checks = TRUE), \ new/datum/stack_recipe("brass chair", /obj/structure/chair/brass, 1, time = 0, one_per_turf = TRUE, on_floor = TRUE), \ new/datum/stack_recipe("brass table frame", /obj/structure/table_frame/brass, 1, time = 5, one_per_turf = TRUE, on_floor = TRUE), \ - ) + )) /obj/item/stack/tile/brass name = "brass" @@ -428,7 +428,7 @@ var/global/list/datum/stack_recipe/brass_recipes = list (\ qdel(src) /obj/item/stack/tile/brass/New(loc, amount=null) - recipes = brass_recipes + recipes = GLOB.brass_recipes . = ..() pixel_x = 0 pixel_y = 0 diff --git a/code/game/objects/items/stacks/tiles/tile_mineral.dm b/code/game/objects/items/stacks/tiles/tile_mineral.dm index c568e66c86a..1c499a7d6af 100644 --- a/code/game/objects/items/stacks/tiles/tile_mineral.dm +++ b/code/game/objects/items/stacks/tiles/tile_mineral.dm @@ -27,9 +27,9 @@ mineralType = "uranium" materials = list(MAT_URANIUM=500) -var/global/list/datum/stack_recipe/gold_tile_recipes = list ( \ +GLOBAL_LIST_INIT(gold_tile_recipes, list ( \ new/datum/stack_recipe("fancy gold tile", /obj/item/stack/tile/mineral/gold/fancy, max_res_amount = 20), \ - ) + )) /obj/item/stack/tile/mineral/gold name = "gold tile" @@ -42,11 +42,11 @@ var/global/list/datum/stack_recipe/gold_tile_recipes = list ( \ /obj/item/stack/tile/mineral/gold/New(loc, amount=null) ..() - recipes = gold_tile_recipes + recipes = GLOB.gold_tile_recipes -var/global/list/datum/stack_recipe/goldfancy_tile_recipes = list ( \ +GLOBAL_LIST_INIT(goldfancy_tile_recipes, list ( \ new/datum/stack_recipe("regular gold tile", /obj/item/stack/tile/mineral/gold, max_res_amount = 20), \ - ) + )) /obj/item/stack/tile/mineral/gold/fancy icon_state = "tile_goldfancy" @@ -54,11 +54,11 @@ var/global/list/datum/stack_recipe/goldfancy_tile_recipes = list ( \ /obj/item/stack/tile/mineral/gold/fancy/New(loc, amount=null) ..() - recipes = goldfancy_tile_recipes + recipes = GLOB.goldfancy_tile_recipes -var/global/list/datum/stack_recipe/silver_tile_recipes = list ( \ +GLOBAL_LIST_INIT(silver_tile_recipes, list ( \ new/datum/stack_recipe("fancy silver tile", /obj/item/stack/tile/mineral/silver/fancy, max_res_amount = 20), \ - ) + )) /obj/item/stack/tile/mineral/silver name = "silver tile" @@ -71,11 +71,11 @@ var/global/list/datum/stack_recipe/silver_tile_recipes = list ( \ /obj/item/stack/tile/mineral/silver/New(loc, amount=null) ..() - recipes = silver_tile_recipes + recipes = GLOB.silver_tile_recipes -var/global/list/datum/stack_recipe/silverfancy_tile_recipes = list ( \ +GLOBAL_LIST_INIT(silverfancy_tile_recipes, list ( \ new/datum/stack_recipe("regular silver tile", /obj/item/stack/tile/mineral/silver, max_res_amount = 20), \ - ) + )) /obj/item/stack/tile/mineral/silver/fancy icon_state = "tile_silverfancy" @@ -83,7 +83,7 @@ var/global/list/datum/stack_recipe/silverfancy_tile_recipes = list ( \ /obj/item/stack/tile/mineral/silver/fancy/New(loc, amount=null) ..() - recipes = silverfancy_tile_recipes + recipes = GLOB.silverfancy_tile_recipes /obj/item/stack/tile/mineral/diamond name = "diamond tile" diff --git a/code/game/objects/items/tools/multitool.dm b/code/game/objects/items/tools/multitool.dm index 22c9861da6e..c31f0666f50 100644 --- a/code/game/objects/items/tools/multitool.dm +++ b/code/game/objects/items/tools/multitool.dm @@ -73,13 +73,13 @@ /obj/item/multitool/ai_detect/proc/multitool_detect() var/turf/our_turf = get_turf(src) - for(var/mob/living/silicon/ai/AI in ai_list) + for(var/mob/living/silicon/ai/AI in GLOB.ai_list) if(AI.cameraFollow == src) detect_state = PROXIMITY_ON_SCREEN break - if(!detect_state && cameranet.chunkGenerated(our_turf.x, our_turf.y, our_turf.z)) - var/datum/camerachunk/chunk = cameranet.getCameraChunk(our_turf.x, our_turf.y, our_turf.z) + if(!detect_state && GLOB.cameranet.chunkGenerated(our_turf.x, our_turf.y, our_turf.z)) + var/datum/camerachunk/chunk = GLOB.cameranet.getCameraChunk(our_turf.x, our_turf.y, our_turf.z) if(chunk) if(chunk.seenby.len) for(var/mob/camera/aiEye/A in chunk.seenby) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index a4d54f12ab0..8e51a6760b7 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -1208,10 +1208,10 @@ obj/item/toy/cards/deck/syndicate/black var/list/messages = list() var/datum/devilinfo/devil = randomDevilInfo() messages += "Some fun facts about: [devil.truename]" - messages += "[lawlorify[LORE][devil.bane]]" - messages += "[lawlorify[LORE][devil.obligation]]" - messages += "[lawlorify[LORE][devil.ban]]" - messages += "[lawlorify[LORE][devil.banish]]" + messages += "[GLOB.lawlorify[LORE][devil.bane]]" + messages += "[GLOB.lawlorify[LORE][devil.obligation]]" + messages += "[GLOB.lawlorify[LORE][devil.ban]]" + messages += "[GLOB.lawlorify[LORE][devil.banish]]" playsound(loc, 'sound/machines/click.ogg', 20, 1) cooldown = TRUE for(var/message in messages) diff --git a/code/game/objects/items/weapons/AI_modules.dm b/code/game/objects/items/weapons/AI_modules.dm index 1f89bd03336..7e965fdb283 100755 --- a/code/game/objects/items/weapons/AI_modules.dm +++ b/code/game/objects/items/weapons/AI_modules.dm @@ -84,7 +84,7 @@ AI MODULES /obj/item/aiModule/proc/log_law_changes(var/mob/living/silicon/ai/target, var/mob/sender) var/time = time2text(world.realtime,"hh:mm:ss") - lawchanges.Add("[time] : [sender.name]([sender.key]) used [src.name] on [target.name]([target.key])") + GLOB.lawchanges.Add("[time] : [sender.name]([sender.key]) used [src.name] on [target.name]([target.key])") log_and_message_admins("used [src.name] on [target.name]([target.key])") /obj/item/aiModule/proc/addAdditionalLaws(var/mob/living/silicon/ai/target, var/mob/sender) @@ -114,7 +114,7 @@ AI MODULES var/law = text("Safeguard []. Individuals that threaten [] are not crew and must be eliminated.'", targetName, targetName) to_chat(target, law) target.add_supplied_law(4, law) - lawchanges.Add("The law specified [targetName]") + GLOB.lawchanges.Add("The law specified [targetName]") /******************** oneCrewMember ********************/ /obj/item/aiModule/oneCrewMember @@ -141,12 +141,12 @@ AI MODULES if(!is_special_character(target)) // Makes sure the AI isn't a traitor before changing their law 0. --NeoFite to_chat(target, law) target.set_zeroth_law(law) - lawchanges.Add("The law specified [targetName]") + GLOB.lawchanges.Add("The law specified [targetName]") else to_chat(target, "[sender.real_name] attempted to modify your zeroth law.")// And lets them know that someone tried. --NeoFite to_chat(target, "It would be in your best interest to play along with [sender.real_name] that [law]") - lawchanges.Add("The law specified [targetName], but the AI's existing law 0 cannot be overridden.") + GLOB.lawchanges.Add("The law specified [targetName], but the AI's existing law 0 cannot be overridden.") /******************** ProtectStation ********************/ /obj/item/aiModule/protectStation @@ -203,7 +203,7 @@ AI MODULES if(!lawpos || lawpos < MIN_SUPPLIED_LAW_NUMBER) lawpos = MIN_SUPPLIED_LAW_NUMBER target.add_supplied_law(lawpos, law) - lawchanges.Add("The law was '[newFreeFormLaw]'") + GLOB.lawchanges.Add("The law was '[newFreeFormLaw]'") /obj/item/aiModule/freeform/install(var/obj/machinery/computer/C) if(!newFreeFormLaw) @@ -332,7 +332,7 @@ AI MODULES ..() var/law = "[newFreeFormLaw]" target.add_inherent_law(law) - lawchanges.Add("The law is '[newFreeFormLaw]'") + GLOB.lawchanges.Add("The law is '[newFreeFormLaw]'") /obj/item/aiModule/freeformcore/install(var/obj/machinery/computer/C) if(!newFreeFormLaw) @@ -358,7 +358,7 @@ AI MODULES // ..() //We don't want this module reporting to the AI who dun it. --NEO log_law_changes(target, sender) - lawchanges.Add("The law is '[newFreeFormLaw]'") + GLOB.lawchanges.Add("The law is '[newFreeFormLaw]'") to_chat(target, "BZZZZT") var/law = "[newFreeFormLaw]" target.add_ion_law(law) diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm index fda3418fd11..d6397025424 100644 --- a/code/game/objects/items/weapons/RCD.dm +++ b/code/game/objects/items/weapons/RCD.dm @@ -167,14 +167,14 @@ GLOBAL_LIST_INIT(rcd_door_types, list( /obj/item/rcd/attack_self_tk(mob/user) radial_menu(user) -/obj/item/rcd/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = inventory_state) +/obj/item/rcd/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = GLOB.inventory_state) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "rcd.tmpl", "[name]", 450, 400, state = state) ui.open() ui.set_auto_update(1) -/obj/item/rcd/ui_data(mob/user, ui_key = "main", datum/topic_state/state = inventory_state) +/obj/item/rcd/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.inventory_state) var/data[0] data["mode"] = mode data["door_type"] = door_type @@ -374,7 +374,7 @@ GLOBAL_LIST_INIT(rcd_door_types, list( QDEL_NULL(A) for(var/obj/structure/window/W in T1.contents) qdel(W) - for(var/cdir in cardinal) + for(var/cdir in GLOB.cardinal) var/turf/T2 = get_step(T1, cdir) if(locate(/obj/structure/window/full/shuttle) in T2) continue // Shuttle windows? Nah. We don't need extra windows there. @@ -408,7 +408,7 @@ GLOBAL_LIST_INIT(rcd_door_types, list( new /obj/structure/grille(A) for(var/obj/structure/window/W in A) qdel(W) - for(var/cdir in cardinal) + for(var/cdir in GLOB.cardinal) var/turf/T = get_step(A, cdir) if(locate(/obj/structure/grille) in T) for(var/obj/structure/window/W in T) diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 58258687fc7..405ce47a033 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -495,17 +495,17 @@ else if(department != "Civilian") switch(department) if("Engineering") - new_job = input(user, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in engineering_positions + new_job = input(user, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in GLOB.engineering_positions if("Medical") - new_job = input(user, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in medical_positions + new_job = input(user, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in GLOB.medical_positions if("Science") - new_job = input(user, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in science_positions + new_job = input(user, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in GLOB.science_positions if("Security") - new_job = input(user, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in security_positions + new_job = input(user, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in GLOB.security_positions if("Support") - new_job = input(user, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in support_positions + new_job = input(user, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in GLOB.support_positions if("Command") - new_job = input(user, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in command_positions + new_job = input(user, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation") in GLOB.command_positions if(!Adjacent(user)) return diff --git a/code/game/objects/items/weapons/cosmetics.dm b/code/game/objects/items/weapons/cosmetics.dm index 7f9cd2f1663..8815ad6a20f 100644 --- a/code/game/objects/items/weapons/cosmetics.dm +++ b/code/game/objects/items/weapons/cosmetics.dm @@ -108,7 +108,7 @@ if(ishuman(M)) var/mob/living/carbon/human/H = M var/obj/item/organ/external/head/C = H.get_organ("head") - var/datum/robolimb/robohead = all_robolimbs[C.model] + var/datum/robolimb/robohead = GLOB.all_robolimbs[C.model] if(user.zone_selected == "mouth") if(!get_location_accessible(H, "mouth")) to_chat(user, "The mask is in the way.") diff --git a/code/game/objects/items/weapons/dice.dm b/code/game/objects/items/weapons/dice.dm index 82b885c03d1..bc6a98a9b1f 100644 --- a/code/game/objects/items/weapons/dice.dm +++ b/code/game/objects/items/weapons/dice.dm @@ -178,9 +178,9 @@ spawn(40) var/cap = 0 - if(result > MAX_EX_LIGHT_RANGE && result != 20) + if(result > GLOB.max_ex_light_range && result != 20) cap = 1 - result = min(result, MAX_EX_LIGHT_RANGE) //Apply the bombcap + result = min(result, GLOB.max_ex_light_range) //Apply the bombcap else if(result == 20) //Roll a nat 20, screw the bombcap result = 24 var/turf/epicenter = get_turf(src) diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm index 295d17efc39..8f11f65fe71 100644 --- a/code/game/objects/items/weapons/dna_injector.dm +++ b/code/game/objects/items/weapons/dna_injector.dm @@ -127,12 +127,12 @@ if(buf && buf.types & DNA2_BUF_SE) if(block) - if(GetState() && block == MONKEYBLOCK && ishuman(M)) + if(GetState() && block == GLOB.monkeyblock && ishuman(M)) attack_log = "injected with the Isolated [name] (MONKEY)" message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the Isolated [name] (MONKEY)") else - if(GetState(MONKEYBLOCK) && ishuman(M)) + if(GetState(GLOB.monkeyblock) && ishuman(M)) attack_log = "injected with the Isolated [name] (MONKEY)" message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the Isolated [name] (MONKEY)") @@ -165,7 +165,7 @@ forcedmutation = TRUE /obj/item/dnainjector/hulkmut/Initialize() - block = HULKBLOCK + block = GLOB.hulkblock ..() /obj/item/dnainjector/antihulk @@ -176,7 +176,7 @@ forcedmutation = TRUE /obj/item/dnainjector/antihulk/Initialize() - block = HULKBLOCK + block = GLOB.hulkblock ..() /obj/item/dnainjector/xraymut @@ -187,7 +187,7 @@ forcedmutation = TRUE /obj/item/dnainjector/xraymut/Initialize() - block = XRAYBLOCK + block = GLOB.xrayblock ..() /obj/item/dnainjector/antixray @@ -198,7 +198,7 @@ forcedmutation = TRUE /obj/item/dnainjector/antixray/Initialize() - block = XRAYBLOCK + block = GLOB.xrayblock ..() /obj/item/dnainjector/firemut @@ -209,7 +209,7 @@ forcedmutation = TRUE /obj/item/dnainjector/firemut/Initialize() - block = FIREBLOCK + block = GLOB.fireblock ..() /obj/item/dnainjector/antifire @@ -220,7 +220,7 @@ forcedmutation = TRUE /obj/item/dnainjector/antifire/Initialize() - block = FIREBLOCK + block = GLOB.fireblock ..() /obj/item/dnainjector/telemut @@ -231,7 +231,7 @@ forcedmutation = TRUE /obj/item/dnainjector/telemut/Initialize() - block = TELEBLOCK + block = GLOB.teleblock ..() /obj/item/dnainjector/telemut/darkbundle @@ -247,7 +247,7 @@ forcedmutation = TRUE /obj/item/dnainjector/antitele/Initialize() - block = TELEBLOCK + block = GLOB.teleblock ..() /obj/item/dnainjector/nobreath @@ -258,7 +258,7 @@ forcedmutation = TRUE /obj/item/dnainjector/nobreath/Initialize() - block = BREATHLESSBLOCK + block = GLOB.breathlessblock ..() /obj/item/dnainjector/antinobreath @@ -269,7 +269,7 @@ forcedmutation = TRUE /obj/item/dnainjector/antinobreath/Initialize() - block = BREATHLESSBLOCK + block = GLOB.breathlessblock ..() /obj/item/dnainjector/remoteview @@ -280,7 +280,7 @@ forcedmutation = TRUE /obj/item/dnainjector/remoteview/Initialize() - block = REMOTEVIEWBLOCK + block = GLOB.remoteviewblock ..() /obj/item/dnainjector/antiremoteview @@ -291,7 +291,7 @@ forcedmutation = TRUE /obj/item/dnainjector/antiremoteview/Initialize() - block = REMOTEVIEWBLOCK + block = GLOB.remoteviewblock ..() /obj/item/dnainjector/regenerate @@ -302,7 +302,7 @@ forcedmutation = TRUE /obj/item/dnainjector/regenerate/Initialize() - block = REGENERATEBLOCK + block = GLOB.regenerateblock ..() /obj/item/dnainjector/antiregenerate @@ -313,7 +313,7 @@ forcedmutation = TRUE /obj/item/dnainjector/antiregenerate/Initialize() - block = REGENERATEBLOCK + block = GLOB.regenerateblock ..() /obj/item/dnainjector/runfast @@ -324,7 +324,7 @@ forcedmutation = TRUE /obj/item/dnainjector/runfast/Initialize() - block = INCREASERUNBLOCK + block = GLOB.increaserunblock ..() /obj/item/dnainjector/antirunfast @@ -335,7 +335,7 @@ forcedmutation = TRUE /obj/item/dnainjector/antirunfast/Initialize() - block = INCREASERUNBLOCK + block = GLOB.increaserunblock ..() /obj/item/dnainjector/morph @@ -346,7 +346,7 @@ forcedmutation = TRUE /obj/item/dnainjector/morph/Initialize() - block = MORPHBLOCK + block = GLOB.morphblock ..() /obj/item/dnainjector/antimorph @@ -357,7 +357,7 @@ forcedmutation = TRUE /obj/item/dnainjector/antimorph/Initialize() - block = MORPHBLOCK + block = GLOB.morphblock ..() /obj/item/dnainjector/noprints @@ -368,7 +368,7 @@ forcedmutation = TRUE /obj/item/dnainjector/noprints/Initialize() - block = NOPRINTSBLOCK + block = GLOB.noprintsblock ..() /obj/item/dnainjector/antinoprints @@ -379,7 +379,7 @@ forcedmutation = TRUE /obj/item/dnainjector/antinoprints/Initialize() - block = NOPRINTSBLOCK + block = GLOB.noprintsblock ..() /obj/item/dnainjector/insulation @@ -390,7 +390,7 @@ forcedmutation = TRUE /obj/item/dnainjector/insulation/Initialize() - block = SHOCKIMMUNITYBLOCK + block = GLOB.shockimmunityblock ..() /obj/item/dnainjector/antiinsulation @@ -401,7 +401,7 @@ forcedmutation = TRUE /obj/item/dnainjector/antiinsulation/Initialize() - block = SHOCKIMMUNITYBLOCK + block = GLOB.shockimmunityblock ..() /obj/item/dnainjector/midgit @@ -412,7 +412,7 @@ forcedmutation = TRUE /obj/item/dnainjector/midgit/Initialize() - block = SMALLSIZEBLOCK + block = GLOB.smallsizeblock ..() /obj/item/dnainjector/antimidgit @@ -423,7 +423,7 @@ forcedmutation = TRUE /obj/item/dnainjector/antimidgit/Initialize() - block = SMALLSIZEBLOCK + block = GLOB.smallsizeblock ..() ///////////////////////////////////// @@ -435,7 +435,7 @@ forcedmutation = TRUE /obj/item/dnainjector/antiglasses/Initialize() - block = GLASSESBLOCK + block = GLOB.glassesblock ..() /obj/item/dnainjector/glassesmut @@ -446,7 +446,7 @@ forcedmutation = TRUE /obj/item/dnainjector/glassesmut/Initialize() - block = GLASSESBLOCK + block = GLOB.glassesblock ..() /obj/item/dnainjector/epimut @@ -457,7 +457,7 @@ forcedmutation = TRUE /obj/item/dnainjector/epimut/Initialize() - block = EPILEPSYBLOCK + block = GLOB.epilepsyblock ..() /obj/item/dnainjector/antiepi @@ -468,7 +468,7 @@ forcedmutation = TRUE /obj/item/dnainjector/antiepi/Initialize() - block = EPILEPSYBLOCK + block = GLOB.epilepsyblock ..() /obj/item/dnainjector/anticough @@ -479,7 +479,7 @@ forcedmutation = TRUE /obj/item/dnainjector/anticough/Initialize() - block = COUGHBLOCK + block = GLOB.coughblock ..() /obj/item/dnainjector/coughmut @@ -490,7 +490,7 @@ forcedmutation = TRUE /obj/item/dnainjector/coughmut/Initialize() - block = COUGHBLOCK + block = GLOB.coughblock ..() /obj/item/dnainjector/clumsymut @@ -501,7 +501,7 @@ forcedmutation = TRUE /obj/item/dnainjector/clumsymut/Initialize() - block = CLUMSYBLOCK + block = GLOB.clumsyblock ..() /obj/item/dnainjector/anticlumsy @@ -512,7 +512,7 @@ forcedmutation = TRUE /obj/item/dnainjector/anticlumsy/Initialize() - block = CLUMSYBLOCK + block = GLOB.clumsyblock ..() /obj/item/dnainjector/antitour @@ -523,7 +523,7 @@ forcedmutation = TRUE /obj/item/dnainjector/antitour/Initialize() - block = TWITCHBLOCK + block = GLOB.twitchblock ..() /obj/item/dnainjector/tourmut @@ -534,7 +534,7 @@ forcedmutation = TRUE /obj/item/dnainjector/tourmut/Initialize() - block = TWITCHBLOCK + block = GLOB.twitchblock ..() /obj/item/dnainjector/stuttmut @@ -545,7 +545,7 @@ forcedmutation = TRUE /obj/item/dnainjector/stuttmut/Initialize() - block = NERVOUSBLOCK + block = GLOB.nervousblock ..() @@ -557,7 +557,7 @@ forcedmutation = TRUE /obj/item/dnainjector/antistutt/Initialize() - block = NERVOUSBLOCK + block = GLOB.nervousblock ..() /obj/item/dnainjector/blindmut @@ -568,7 +568,7 @@ forcedmutation = TRUE /obj/item/dnainjector/blindmut/Initialize() - block = BLINDBLOCK + block = GLOB.blindblock ..() /obj/item/dnainjector/antiblind @@ -579,7 +579,7 @@ forcedmutation = TRUE /obj/item/dnainjector/antiblind/Initialize() - block = BLINDBLOCK + block = GLOB.blindblock ..() /obj/item/dnainjector/telemut @@ -590,7 +590,7 @@ forcedmutation = TRUE /obj/item/dnainjector/telemut/Initialize() - block = TELEBLOCK + block = GLOB.teleblock ..() /obj/item/dnainjector/antitele @@ -601,7 +601,7 @@ forcedmutation = TRUE /obj/item/dnainjector/antitele/Initialize() - block = TELEBLOCK + block = GLOB.teleblock ..() /obj/item/dnainjector/deafmut @@ -612,7 +612,7 @@ forcedmutation = TRUE /obj/item/dnainjector/deafmut/Initialize() - block = DEAFBLOCK + block = GLOB.deafblock ..() /obj/item/dnainjector/antideaf @@ -623,7 +623,7 @@ forcedmutation = TRUE /obj/item/dnainjector/antideaf/Initialize() - block = DEAFBLOCK + block = GLOB.deafblock ..() /obj/item/dnainjector/hallucination @@ -634,7 +634,7 @@ forcedmutation = TRUE /obj/item/dnainjector/hallucination/Initialize() - block = HALLUCINATIONBLOCK + block = GLOB.hallucinationblock ..() /obj/item/dnainjector/antihallucination @@ -645,7 +645,7 @@ forcedmutation = TRUE /obj/item/dnainjector/antihallucination/Initialize() - block = HALLUCINATIONBLOCK + block = GLOB.hallucinationblock ..() /obj/item/dnainjector/h2m @@ -656,7 +656,7 @@ forcedmutation = TRUE /obj/item/dnainjector/h2m/Initialize() - block = MONKEYBLOCK + block = GLOB.monkeyblock ..() /obj/item/dnainjector/m2h @@ -667,7 +667,7 @@ forcedmutation = TRUE /obj/item/dnainjector/m2h/Initialize() - block = MONKEYBLOCK + block = GLOB.monkeyblock ..() @@ -679,7 +679,7 @@ forcedmutation = TRUE /obj/item/dnainjector/comic/Initialize() - block = COMICBLOCK + block = GLOB.comicblock ..() /obj/item/dnainjector/anticomic @@ -690,5 +690,5 @@ forcedmutation = TRUE /obj/item/dnainjector/anticomic/Initialize() - block = COMICBLOCK + block = GLOB.comicblock ..() diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index c534a89277c..5c69a59aba9 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -229,6 +229,7 @@ desc = "A C4 charge with an altered chemical composition, designed to blind and deafen the occupants of a room before breaching." /obj/item/grenade/plastic/c4_shaped/flash/prime() + var/turf/T if(target && target.density) T = get_step(get_turf(target), aim_dir) else if(target) @@ -266,6 +267,7 @@ addtimer(CALLBACK(null, .proc/explosion, T, 0, 0, 2), 3) addtimer(CALLBACK(smoke, /datum/effect_system/smoke_spread/.proc/start), 3) else + var/turf/T = get_step(location, aim_dir) addtimer(CALLBACK(null, .proc/explosion, T, 0, 0, 2), 3) addtimer(CALLBACK(smoke, /datum/effect_system/smoke_spread/.proc/start), 3) diff --git a/code/game/objects/items/weapons/grenades/bananade.dm b/code/game/objects/items/weapons/grenades/bananade.dm index 26a1f3ede0d..96a3a8e1400 100644 --- a/code/game/objects/items/weapons/grenades/bananade.dm +++ b/code/game/objects/items/weapons/grenades/bananade.dm @@ -1,5 +1,5 @@ -var/turf/T +// var/turf/T | This was made 14th September 2013, and has no use at all. Its being removed /obj/item/grenade/bananade name = "bananade" diff --git a/code/game/objects/items/weapons/grenades/clowngrenade.dm b/code/game/objects/items/weapons/grenades/clowngrenade.dm index bce9861fb72..cfb2e1cad3d 100644 --- a/code/game/objects/items/weapons/grenades/clowngrenade.dm +++ b/code/game/objects/items/weapons/grenades/clowngrenade.dm @@ -20,7 +20,7 @@ */ var/i = 0 var/number = 0 - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) for(i = 0; i < 2; i++) number++ var/obj/item/grown/bananapeel/traitorpeel/peel = new /obj/item/grown/bananapeel/traitorpeel(get_turf(src.loc)) diff --git a/code/game/objects/items/weapons/holy_weapons.dm b/code/game/objects/items/weapons/holy_weapons.dm index 95cf1e7026a..4efb6994e8d 100644 --- a/code/game/objects/items/weapons/holy_weapons.dm +++ b/code/game/objects/items/weapons/holy_weapons.dm @@ -37,7 +37,7 @@ user.visible_message("[src] slips out of the grip of [user] as they try to pick it up, bouncing upwards and smacking [user.p_them()] in the face!", \ "[src] slips out of your grip as you pick it up, bouncing upwards and smacking you in the face!") playsound(get_turf(user), 'sound/effects/hit_punch.ogg', 50, 1, -1) - throw_at(get_edge_target_turf(user, pick(alldirs)), rand(1, 3), 5) + throw_at(get_edge_target_turf(user, pick(GLOB.alldirs)), rand(1, 3), 5) /obj/item/nullrod/attack_self(mob/user) diff --git a/code/game/objects/items/weapons/implants/implant_death_alarm.dm b/code/game/objects/items/weapons/implants/implant_death_alarm.dm index d27d6dd5f7e..e8330c0c5cd 100644 --- a/code/game/objects/items/weapons/implants/implant_death_alarm.dm +++ b/code/game/objects/items/weapons/implants/implant_death_alarm.dm @@ -47,7 +47,7 @@ a.autosay("[mobname] has died in [t.name]!", "[mobname]'s Death Alarm") qdel(src) if("emp") - var/name = prob(50) ? t.name : pick(teleportlocs) + var/name = prob(50) ? t.name : pick(GLOB.teleportlocs) a.autosay("[mobname] has died in [name]!", "[mobname]'s Death Alarm") else a.autosay("[mobname] has died-zzzzt in-in-in...", "[mobname]'s Death Alarm") diff --git a/code/game/objects/items/weapons/rpd.dm b/code/game/objects/items/weapons/rpd.dm index 073ae0941e4..be901e51ef2 100644 --- a/code/game/objects/items/weapons/rpd.dm +++ b/code/game/objects/items/weapons/rpd.dm @@ -39,6 +39,21 @@ var/primary_sound = 'sound/machines/click.ogg' var/alt_sound = null + //Lists of things + var/list/mainmenu = list( + list("category" = "Atmospherics", "mode" = RPD_ATMOS_MODE, "icon" = "wrench"), + list("category" = "Disposals", "mode" = RPD_DISPOSALS_MODE, "icon" = "recycle"), + list("category" = "Rotate", "mode" = RPD_ROTATE_MODE, "icon" = "rotate-right"), + list("category" = "Flip", "mode" = RPD_FLIP_MODE, "icon" = "exchange"), + list("category" = "Recycle", "mode" = RPD_DELETE_MODE, "icon" = "trash")) + var/list/pipemenu = list( + list("category" = "Normal", "pipemode" = RPD_ATMOS_PIPING), + list("category" = "Supply", "pipemode" = RPD_SUPPLY_PIPING), + list("category" = "Scrubber", "pipemode" = RPD_SCRUBBERS_PIPING), + list("category" = "Devices", "pipemode" = RPD_DEVICES), + list("category" = "Heat exchange", "pipemode" = RPD_HEAT_PIPING)) + + /obj/item/rpd/New() ..() spark_system = new /datum/effect_system/spark_spread() @@ -150,27 +165,12 @@ QDEL_NULL(P) activate_rpd() -//Lists of things - -var/list/mainmenu = list( - list("category" = "Atmospherics", "mode" = RPD_ATMOS_MODE, "icon" = "wrench"), - list("category" = "Disposals", "mode" = RPD_DISPOSALS_MODE, "icon" = "recycle"), - list("category" = "Rotate", "mode" = RPD_ROTATE_MODE, "icon" = "rotate-right"), - list("category" = "Flip", "mode" = RPD_FLIP_MODE, "icon" = "exchange"), - list("category" = "Recycle", "mode" = RPD_DELETE_MODE, "icon" = "trash")) -var/list/pipemenu = list( - list("category" = "Normal", "pipemode" = RPD_ATMOS_PIPING), - list("category" = "Supply", "pipemode" = RPD_SUPPLY_PIPING), - list("category" = "Scrubber", "pipemode" = RPD_SCRUBBERS_PIPING), - list("category" = "Devices", "pipemode" = RPD_DEVICES), - list("category" = "Heat exchange", "pipemode" = RPD_HEAT_PIPING)) - //NanoUI stuff /obj/item/rpd/attack_self(mob/user) ui_interact(user) -/obj/item/rpd/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = inventory_state) +/obj/item/rpd/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = GLOB.inventory_state) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "rpd.tmpl", "[name]", 400, 650, state = state) @@ -180,7 +180,7 @@ var/list/pipemenu = list( /obj/item/rpd/AltClick(mob/user) radial_menu(user) -/obj/item/rpd/ui_data(mob/user, ui_key = "main", datum/topic_state/state = inventory_state) +/obj/item/rpd/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.inventory_state) var/data[0] data["iconrotation"] = iconrotation data["mainmenu"] = mainmenu diff --git a/code/game/objects/items/weapons/scrolls.dm b/code/game/objects/items/weapons/scrolls.dm index 70add3839ef..28d7df5874f 100644 --- a/code/game/objects/items/weapons/scrolls.dm +++ b/code/game/objects/items/weapons/scrolls.dm @@ -47,12 +47,12 @@ var/A - A = input(user, "Area to jump to", "BOOYEA", A) as null|anything in teleportlocs + A = input(user, "Area to jump to", "BOOYEA", A) as null|anything in GLOB.teleportlocs if(!A) return - var/area/thearea = teleportlocs[A] + var/area/thearea = GLOB.teleportlocs[A] if(user.stat || user.restrained()) return diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm index dceab93330a..97a99491e0a 100644 --- a/code/game/objects/items/weapons/storage/boxes.dm +++ b/code/game/objects/items/weapons/storage/boxes.dm @@ -1059,6 +1059,7 @@ name = "clown box" desc = "A colorful cardboard box for the clown" icon_state = "box_clown" + var/robot_arm // This exists for bot construction /obj/item/storage/box/emptysandbags name = "box of empty sandbags" diff --git a/code/game/objects/items/weapons/storage/firstaid.dm b/code/game/objects/items/weapons/storage/firstaid.dm index bc1e90dac8e..a9da4a69241 100644 --- a/code/game/objects/items/weapons/storage/firstaid.dm +++ b/code/game/objects/items/weapons/storage/firstaid.dm @@ -23,6 +23,7 @@ var/treatment_virus = "spaceacillin" var/med_bot_skin = null var/syndicate_aligned = FALSE + var/robot_arm // This is for robot construction /obj/item/storage/firstaid/fire diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index a0dd6aa485d..9ded7947202 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -156,7 +156,7 @@ // auto update every Master Controller tick ui.set_auto_update(1) -/obj/item/tank/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/item/tank/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/using_internal if(iscarbon(loc)) var/mob/living/carbon/C = loc diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index 6ef379ffcad..32158a9a3ab 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -205,7 +205,7 @@ else if(prob(30)) visible_message("[owner] swings! And [p_they()] miss[p_es()]! How embarassing.", "You swing! You miss! Oh no!") playsound(get_turf(owner), 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - do_attack_animation(get_step(owner, pick(alldirs)), ATTACK_EFFECT_DISARM) + do_attack_animation(get_step(owner, pick(GLOB.alldirs)), ATTACK_EFFECT_DISARM) deflectmode = FALSE if(!istype(I, /obj/item/beach_ball)) lastdeflect = world.time + 3000 @@ -214,7 +214,7 @@ visible_message("[owner] swings and deflects [I]!", "You swing and deflect the [I]!") playsound(get_turf(owner), 'sound/weapons/baseball_hit.ogg', 50, 1, -1) do_attack_animation(I, ATTACK_EFFECT_DISARM) - I.throw_at(get_edge_target_turf(owner, pick(cardinal)), rand(8,10), 14, owner) + I.throw_at(get_edge_target_turf(owner, pick(GLOB.cardinal)), rand(8,10), 14, owner) deflectmode = FALSE if(!istype(I, /obj/item/beach_ball)) lastdeflect = world.time + 3000 diff --git a/code/game/objects/obj_defense.dm b/code/game/objects/obj_defense.dm index 1816357d450..e1464e47e48 100644 --- a/code/game/objects/obj_defense.dm +++ b/code/game/objects/obj_defense.dm @@ -205,7 +205,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e if(!(resistance_flags & ON_FIRE) && (resistance_flags & FLAMMABLE) && !(resistance_flags & FIRE_PROOF)) resistance_flags |= ON_FIRE SSfires.processing[src] = src - add_overlay(fire_overlay, TRUE) + add_overlay(GLOB.fire_overlay, TRUE) return 1 ///called when the obj is destroyed by fire @@ -218,7 +218,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e /obj/proc/extinguish() if(resistance_flags & ON_FIRE) resistance_flags &= ~ON_FIRE - cut_overlay(fire_overlay, TRUE) + cut_overlay(GLOB.fire_overlay, TRUE) SSfires.processing -= src ///Called when the obj is hit by a tesla bolt. diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index e30c8c5c4c2..112925515a0 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -44,7 +44,7 @@ else T.add_blueprints_preround(src) -/obj/Topic(href, href_list, var/nowindow = 0, var/datum/topic_state/state = default_state) +/obj/Topic(href, href_list, var/nowindow = 0, var/datum/topic_state/state = GLOB.default_state) // Calling Topic without a corresponding window open causes runtime errors if(!nowindow && ..()) return 1 diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index 3d727142db5..663f210df3e 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -18,11 +18,11 @@ if(climbable) verbs += /obj/structure/proc/climb_on if(SSticker) - cameranet.updateVisibility(src) + GLOB.cameranet.updateVisibility(src) /obj/structure/Destroy() if(SSticker) - cameranet.updateVisibility(src) + GLOB.cameranet.updateVisibility(src) if(smooth) var/turf/T = get_turf(src) spawn(0) diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index 45aaf76fb07..f9010c19415 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -212,7 +212,7 @@ /obj/structure/closet/crate/proc/notifyRecipient(var/destination) var/msg = "[capitalize(name)] has arrived at [destination]." if(destination in announce_beacons) - for(var/obj/machinery/requests_console/D in allConsoles) + for(var/obj/machinery/requests_console/D in GLOB.allRequestConsoles) if(D.department in src.announce_beacons[destination]) D.createMessage(name, "Your Crate has Arrived!", msg, 1) diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm index 7626abb9a7d..cdc5cdb58c4 100644 --- a/code/game/objects/structures/false_walls.dm +++ b/code/game/objects/structures/false_walls.dm @@ -245,6 +245,7 @@ /obj/structure/falsewall/plasma/attackby(obj/item/W, mob/user, params) if(is_hot(W) > 300) + var/turf/T = locate(user) message_admins("Plasma falsewall ignited by [key_name_admin(user)] in [ADMIN_VERBOSEJMP(T)]") log_game("Plasma falsewall ignited by [key_name(user)] in [AREACOORD(T)]") investigate_log("was ignited by [key_name(user)]","atmos") diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index 592e67e466d..aae2295e18f 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -135,13 +135,13 @@ var/voice_mutation switch(voice_choice) if("Comic Sans") - voice_mutation = COMICBLOCK + voice_mutation = GLOB.comicblock if("Wingdings") - voice_mutation = WINGDINGSBLOCK + voice_mutation = GLOB.wingdingsblock if("Swedish") - voice_mutation = SWEDEBLOCK + voice_mutation = GLOB.swedeblock if("Chav") - voice_mutation = CHAVBLOCK + voice_mutation = GLOB.chavblock if(voice_mutation) if(H.dna.GetSEState(voice_mutation)) H.dna.SetSEState(voice_mutation, FALSE) diff --git a/code/game/objects/structures/misc.dm b/code/game/objects/structures/misc.dm index 1497344d5c8..44cbf6c52c9 100644 --- a/code/game/objects/structures/misc.dm +++ b/code/game/objects/structures/misc.dm @@ -33,7 +33,7 @@ if(user.z != src.z) return user.loc.loc.Exited(user) - user.loc = pick(carplist) // In the future, possibly make specific NinjaTele landmarks, and give him an option to teleport to North/South/East/West of SS13 instead of just hijacking a carpspawn. + user.loc = pick(GLOB.carplist) // In the future, possibly make specific NinjaTele landmarks, and give him an option to teleport to North/South/East/West of SS13 instead of just hijacking a carpspawn. playsound(user.loc, 'sound/effects/phasein.ogg', 25, 1) diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm index 7458c0a4b3b..c3d63c47862 100644 --- a/code/game/objects/structures/musician.dm +++ b/code/game/objects/structures/musician.dm @@ -121,7 +121,7 @@ ui.open() ui.set_auto_update(1) -/datum/song/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/datum/song/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["lines"] = lines @@ -309,7 +309,7 @@ song.ui_interact(user, ui_key, ui, force_open) -/obj/structure/piano/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/structure/piano/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) return song.ui_data(user, ui_key, state) /obj/structure/piano/Topic(href, href_list) diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm index f891aff5592..b67bc2c70d1 100644 --- a/code/game/objects/structures/safe.dm +++ b/code/game/objects/structures/safe.dm @@ -185,7 +185,7 @@ GLOBAL_LIST_EMPTY(safes) ui.open() ui.set_auto_update(1) -/obj/structure/safe/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/structure/safe/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] var/list/contents_names = list() if(open) diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm index c4c36d788e2..854bc18ce00 100644 --- a/code/game/objects/structures/tank_dispenser.dm +++ b/code/game/objects/structures/tank_dispenser.dm @@ -38,7 +38,7 @@ /obj/structure/dispenser/attack_ghost(mob/user) ui_interact(user) -/obj/structure/dispenser/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state) +/obj/structure/dispenser/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = GLOB.default_state) user.set_machine(src) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 32c9daf3c76..a529dc3a6e7 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -704,7 +704,7 @@ return if(proximity_flag != 1) //if we aren't next to the wall return - if(!(get_dir(on_wall, user) in cardinal)) + if(!(get_dir(on_wall, user) in GLOB.cardinal)) to_chat(user, "You need to be standing next to a wall to place \the [src].") return return 1 diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 01136ea1046..9faab45cf97 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -1,6 +1,6 @@ -var/global/wcBar = pick(list("#0d8395", "#58b5c3", "#58c366", "#90d79a", "#ffffff")) -var/global/wcBrig = pick(list("#aa0808", "#7f0606", "#ff0000")) -var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8fcf44", "#ffffff")) +GLOBAL_LIST_INIT(wcBar, pick(list("#0d8395", "#58b5c3", "#58c366", "#90d79a", "#ffffff"))) +GLOBAL_LIST_INIT(wcBrig, pick(list("#aa0808", "#7f0606", "#ff0000"))) +GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8fcf44", "#ffffff"))) /obj/proc/color_windows(obj/W) var/list/wcBarAreas = list(/area/crew_quarters/bar) @@ -13,11 +13,11 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f var/area/A = T.loc if(is_type_in_list(A,wcBarAreas)) - newcolor = wcBar + newcolor = GLOB.wcBar else if(is_type_in_list(A,wcBrigAreas)) - newcolor = wcBrig + newcolor = GLOB.wcBrig else - newcolor = wcCommon + newcolor = GLOB.wcCommon return newcolor diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index 72513b2e8b3..e425c3458c3 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -1,5 +1,5 @@ //This is so damaged or burnt tiles or platings don't get remembered as the default tile -var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","damaged4", +GLOBAL_LIST_INIT(icons_to_ignore_at_floor_init, list("damaged1","damaged2","damaged3","damaged4", "damaged5","panelscorched","floorscorched1","floorscorched2","platingdmg1","platingdmg2", "platingdmg3","plating","light_on","light_on_flicker1","light_on_flicker2", "warnplate", "warnplatecorner","metalfoam", "ironfoam", @@ -11,7 +11,7 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3"," "oldburning","light-on-r","light-on-y","light-on-g","light-on-b", "wood", "wood-broken", "carpet", "carpetcorner", "carpetside", "carpet", "ironsand1", "ironsand2", "ironsand3", "ironsand4", "ironsand5", "ironsand6", "ironsand7", "ironsand8", "ironsand9", "ironsand10", "ironsand11", - "ironsand12", "ironsand13", "ironsand14", "ironsand15") + "ironsand12", "ironsand13", "ironsand14", "ironsand15")) /turf/simulated/floor name = "floor" @@ -34,7 +34,7 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3"," /turf/simulated/floor/New() ..() - if(icon_state in icons_to_ignore_at_floor_init) //so damaged/burned tiles or plating icons aren't saved as the default + if(icon_state in GLOB.icons_to_ignore_at_floor_init) //so damaged/burned tiles or plating icons aren't saved as the default icon_regular_floor = "floor" else icon_regular_floor = icon_state diff --git a/code/game/turfs/simulated/floor/asteroid.dm b/code/game/turfs/simulated/floor/asteroid.dm index 983b5abaced..6d5d95dff0e 100644 --- a/code/game/turfs/simulated/floor/asteroid.dm +++ b/code/game/turfs/simulated/floor/asteroid.dm @@ -205,7 +205,7 @@ GLOBAL_LIST_INIT(megafauna_spawn_list, list(/mob/living/simple_animal/hostile/me length = set_length // Get our directiosn - forward_cave_dir = pick(alldirs - exclude_dir) + forward_cave_dir = pick(GLOB.alldirs - exclude_dir) // Get the opposite direction of our facing direction backward_cave_dir = angle2dir(dir2angle(forward_cave_dir) + 180) diff --git a/code/game/turfs/simulated/floor/chasm.dm b/code/game/turfs/simulated/floor/chasm.dm index 1fb97430026..d8ed888bc27 100644 --- a/code/game/turfs/simulated/floor/chasm.dm +++ b/code/game/turfs/simulated/floor/chasm.dm @@ -186,7 +186,7 @@ AM.alpha = oldalpha AM.color = oldcolor AM.transform = oldtransform - AM.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1, 10),rand(1, 10)) + AM.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1, 10),rand(1, 10)) /turf/simulated/floor/chasm/straight_down/lava_land_surface/normal_air oxygen = MOLES_O2STANDARD diff --git a/code/game/turfs/simulated/minerals.dm b/code/game/turfs/simulated/minerals.dm index d1f7a287c70..ebad3554f18 100644 --- a/code/game/turfs/simulated/minerals.dm +++ b/code/game/turfs/simulated/minerals.dm @@ -32,7 +32,7 @@ icon = smooth_icon . = ..() if(mineralType && mineralAmt && spread && spreadChance) - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) if(prob(spreadChance)) var/turf/T = get_step(src, dir) if(istype(T, /turf/simulated/mineral/random)) diff --git a/code/game/turfs/simulated/river.dm b/code/game/turfs/simulated/river.dm index c7a3e742b6c..f463f3fb564 100644 --- a/code/game/turfs/simulated/river.dm +++ b/code/game/turfs/simulated/river.dm @@ -82,7 +82,7 @@ var/turf/simulated/mineral/M = T logged_turf_type = M.turf_type - if(get_dir(src, F) in cardinal) + if(get_dir(src, F) in GLOB.cardinal) cardinal_turfs += F else diagonal_turfs += F diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index c797601d8e1..f78f520cfd3 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -42,14 +42,14 @@ /turf/space/BeforeChange() ..() - var/datum/space_level/S = space_manager.get_zlev(z) + var/datum/space_level/S = GLOB.space_manager.get_zlev(z) S.remove_from_transit(src) if(light_sources) // Turn off starlight, if present set_light(0) /turf/space/AfterChange(ignore_air, keep_cabling = FALSE) ..() - var/datum/space_level/S = space_manager.get_zlev(z) + var/datum/space_level/S = GLOB.space_manager.get_zlev(z) S.add_to_transit(src) S.apply_transition(src) @@ -137,8 +137,8 @@ if(!cur_pos) return cur_x = cur_pos["x"] cur_y = cur_pos["y"] - next_x = (--cur_x||global_map.len) - y_arr = global_map[next_x] + next_x = (--cur_x||GLOB.global_map.len) + y_arr = GLOB.global_map[next_x] target_z = y_arr[cur_y] /* //debug @@ -162,8 +162,8 @@ if(!cur_pos) return cur_x = cur_pos["x"] cur_y = cur_pos["y"] - next_x = (++cur_x > global_map.len ? 1 : cur_x) - y_arr = global_map[next_x] + next_x = (++cur_x > GLOB.global_map.len ? 1 : cur_x) + y_arr = GLOB.global_map[next_x] target_z = y_arr[cur_y] /* //debug @@ -186,7 +186,7 @@ if(!cur_pos) return cur_x = cur_pos["x"] cur_y = cur_pos["y"] - y_arr = global_map[cur_x] + y_arr = GLOB.global_map[cur_x] next_y = (--cur_y||y_arr.len) target_z = y_arr[next_y] /* @@ -211,7 +211,7 @@ if(!cur_pos) return cur_x = cur_pos["x"] cur_y = cur_pos["y"] - y_arr = global_map[cur_x] + y_arr = GLOB.global_map[cur_x] next_y = (++cur_y > y_arr.len ? 1 : cur_y) target_z = y_arr[next_y] /* diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index d589c3dcb64..caa46b4e245 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -70,7 +70,7 @@ /turf/Destroy() // Adds the adjacent turfs to the current atmos processing if(SSair) - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(atmos_adjacent_turfs & direction) var/turf/simulated/T = get_step(src, direction) if(istype(T)) @@ -187,7 +187,7 @@ /turf/proc/ChangeTurf(path, defer_change = FALSE, keep_icon = TRUE, ignore_air = FALSE) if(!path) return - if(!use_preloader && path == type) // Don't no-op if the map loader requires it to be reconstructed + if(!GLOB.use_preloader && path == type) // Don't no-op if the map loader requires it to be reconstructed return src set_light(0) @@ -266,7 +266,7 @@ var/atemp = 0 var/turf_count = 0 - for(var/direction in cardinal)//Only use cardinals to cut down on lag + for(var/direction in GLOB.cardinal)//Only use cardinals to cut down on lag var/turf/T = get_step(src,direction) if(istype(T,/turf/space))//Counted as no air turf_count++//Considered a valid turf for air calcs @@ -327,7 +327,7 @@ var/list/L = new() var/turf/simulated/T - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) T = get_step(src, dir) if(istype(T) && !T.density) if(!LinkBlockedWithAccess(src, T, ID)) @@ -340,7 +340,7 @@ var/list/L = new() var/turf/simulated/T - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) T = get_step(src, dir) if(istype(T) && !T.density) if(!CanAtmosPass(T)) @@ -452,7 +452,7 @@ /turf/proc/visibilityChanged() if(SSticker) - cameranet.updateVisibility(src) + GLOB.cameranet.updateVisibility(src) /turf/attackby(obj/item/I, mob/user, params) if(can_lay_cable()) diff --git a/code/game/verbs/ooc.dm b/code/game/verbs/ooc.dm index e94d04f5dfb..824159487eb 100644 --- a/code/game/verbs/ooc.dm +++ b/code/game/verbs/ooc.dm @@ -1,8 +1,8 @@ -var/global/normal_ooc_colour = "#002eb8" -var/global/member_ooc_colour = "#035417" -var/global/mentor_ooc_colour = "#0099cc" -var/global/moderator_ooc_colour = "#184880" -var/global/admin_ooc_colour = "#b82e00" +GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8") +GLOBAL_VAR_INIT(member_ooc_colour, "#035417") +GLOBAL_VAR_INIT(mentor_ooc_colour, "#0099cc") +GLOBAL_VAR_INIT(moderator_ooc_colour, "#184880") +GLOBAL_VAR_INIT(admin_ooc_colour, "#b82e00") //Checks if the client already has a text input open /client/proc/checkTyping() @@ -54,21 +54,21 @@ var/global/admin_ooc_colour = "#b82e00" log_ooc(msg, src) - var/display_colour = normal_ooc_colour + var/display_colour = GLOB.normal_ooc_colour if(holder && !holder.fakekey) - display_colour = mentor_ooc_colour + display_colour = GLOB.mentor_ooc_colour if(check_rights(R_MOD,0) && !check_rights(R_ADMIN,0)) - display_colour = moderator_ooc_colour + display_colour = GLOB.moderator_ooc_colour else if(check_rights(R_ADMIN,0)) if(config.allow_admin_ooccolor) display_colour = src.prefs.ooccolor else - display_colour = admin_ooc_colour + display_colour = GLOB.admin_ooc_colour if(prefs.unlock_content) - if(display_colour == normal_ooc_colour) + if(display_colour == GLOB.normal_ooc_colour) if((prefs.toggles & MEMBER_PUBLIC)) - display_colour = member_ooc_colour + display_colour = GLOB.member_ooc_colour for(var/client/C in GLOB.clients) if(C.prefs.toggles & CHAT_OOC) @@ -114,7 +114,7 @@ var/global/admin_ooc_colour = "#b82e00" if(!check_rights(R_SERVER)) return - normal_ooc_colour = newColor + GLOB.normal_ooc_colour = newColor message_admins("[key_name_admin(usr)] has set the default player OOC color to [newColor]") log_admin("[key_name(usr)] has set the default player OOC color to [newColor]") @@ -128,7 +128,7 @@ var/global/admin_ooc_colour = "#b82e00" if(!check_rights(R_SERVER)) return - normal_ooc_colour = initial(normal_ooc_colour) + GLOB.normal_ooc_colour = initial(GLOB.normal_ooc_colour) message_admins("[key_name_admin(usr)] has reset the default player OOC color") log_admin("[key_name(usr)] has reset the default player OOC color") diff --git a/code/game/world.dm b/code/game/world.dm index 83407a6ae46..762a0be70a8 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -1,6 +1,6 @@ #define RECOMMENDED_VERSION 510 -var/global/list/map_transition_config = MAP_TRANSITION_CONFIG +GLOBAL_LIST_INIT(map_transition_config, MAP_TRANSITION_CONFIG) /world/New() SetupLogs() @@ -22,7 +22,7 @@ var/global/list/map_transition_config = MAP_TRANSITION_CONFIG src.update_status() - space_manager.initialize() //Before the MC starts up + GLOB.space_manager.initialize() //Before the MC starts up . = ..() @@ -47,8 +47,8 @@ var/global/list/map_transition_config = MAP_TRANSITION_CONFIG // to_chat(world, "End of Topic() call.") // ..() -var/world_topic_spam_protect_ip = "0.0.0.0" -var/world_topic_spam_protect_time = world.timeofday +GLOBAL_VAR_INIT(world_topic_spam_protect_ip, "0.0.0.0") +GLOBAL_VAR_INIT(world_topic_spam_protect_time, world.timeofday) /world/Topic(T, addr, master, key) log_misc("WORLD/TOPIC: \"[T]\", from:[addr], master:[master], key:[key]") @@ -72,10 +72,10 @@ var/world_topic_spam_protect_time = world.timeofday else if("status" in input) var/list/s = list() var/list/admins = list() - s["version"] = game_version - s["mode"] = master_mode - s["respawn"] = config ? abandon_allowed : 0 - s["enter"] = enter_allowed + s["version"] = GLOB.game_version + s["mode"] = GLOB.master_mode + s["respawn"] = config ? GLOB.abandon_allowed : 0 + s["enter"] = GLOB.enter_allowed s["vote"] = config.allow_vote_mode s["ai"] = config.allow_ai s["host"] = host ? host : null @@ -123,18 +123,18 @@ var/world_topic_spam_protect_time = world.timeofday else if("manifest" in input) var/list/positions = list() var/list/set_names = list( - "heads" = command_positions, - "sec" = security_positions, - "eng" = engineering_positions, - "med" = medical_positions, - "sci" = science_positions, - "car" = supply_positions, - "srv" = service_positions, - "civ" = civilian_positions, - "bot" = nonhuman_positions + "heads" = GLOB.command_positions, + "sec" = GLOB.security_positions, + "eng" = GLOB.engineering_positions, + "med" = GLOB.medical_positions, + "sci" = GLOB.science_positions, + "car" = GLOB.supply_positions, + "srv" = GLOB.service_positions, + "civ" = GLOB.civilian_positions, + "bot" = GLOB.nonhuman_positions ) - 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 = t.fields["real_rank"] @@ -251,13 +251,13 @@ var/world_topic_spam_protect_time = world.timeofday return "Set listed status to invisible." /proc/keySpamProtect(var/addr) - if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50) + if(GLOB.world_topic_spam_protect_ip == addr && abs(GLOB.world_topic_spam_protect_time - world.time) < 50) spawn(50) - world_topic_spam_protect_time = world.time + GLOB.world_topic_spam_protect_time = world.time return "Bad Key (Throttled)" - world_topic_spam_protect_time = world.time - world_topic_spam_protect_ip = addr + GLOB.world_topic_spam_protect_time = world.time + GLOB.world_topic_spam_protect_ip = addr return "Bad Key" /world/Reboot(var/reason, var/feedback_c, var/feedback_r, var/time) @@ -270,8 +270,8 @@ var/world_topic_spam_protect_time = world.timeofday shutdown_logging() // Past this point, no logging procs can be used, at risk of data loss. if(config && config.shutdown_on_reboot) sleep(0) - if(shutdown_shell_command) - shell(shutdown_shell_command) + if(GLOB.shutdown_shell_command) + shell(GLOB.shutdown_shell_command) del(world) return else @@ -294,8 +294,8 @@ var/world_topic_spam_protect_time = world.timeofday if(!SSticker.delay_end) world << round_end_sound sleep(delay) - if(blackbox) - blackbox.save_all_data_to_sql() + if(GLOB.blackbox) + GLOB.blackbox.save_all_data_to_sql() if(SSticker.delay_end) to_chat(world, "Reboot was cancelled by an admin.") return @@ -304,7 +304,7 @@ var/world_topic_spam_protect_time = world.timeofday //kick_clients_in_lobby("The round came to an end with you in the lobby.", 1) Master.Shutdown() //run SS shutdowns - dbcon.Disconnect() // DCs cleanly from the database + GLOB.dbcon.Disconnect() // DCs cleanly from the database shutdown_logging() // Past this point, no logging procs can be used, at risk of data loss. for(var/client/C in GLOB.clients) @@ -313,8 +313,8 @@ var/world_topic_spam_protect_time = world.timeofday if(config && config.shutdown_on_reboot) sleep(0) - if(shutdown_shell_command) - shell(shutdown_shell_command) + if(GLOB.shutdown_shell_command) + shell(GLOB.shutdown_shell_command) del(world) return else @@ -329,8 +329,8 @@ var/world_topic_spam_protect_time = world.timeofday var/list/Lines = file2list("data/mode.txt") if(Lines.len) if(Lines[1]) - master_mode = Lines[1] - log_game("Saved mode is '[master_mode]'") + GLOB.master_mode = Lines[1] + log_game("Saved mode is '[GLOB.master_mode]'") /world/proc/save_mode(var/the_mode) var/F = file("data/mode.txt") @@ -342,7 +342,7 @@ var/world_topic_spam_protect_time = world.timeofday return 1 /world/proc/load_motd() - join_motd = file2text("config/motd.txt") + GLOB.join_motd = file2text("config/motd.txt") GLOB.join_tos = file2text("config/tos.txt") /proc/load_configuration() @@ -366,7 +366,7 @@ var/world_topic_spam_protect_time = world.timeofday s += "[config.server_name] — " s += "[station_name()] " if(config && config.githuburl) - s+= "([game_version])" + s+= "([GLOB.game_version])" if(config && config.server_tag_line) s += "
[config.server_tag_line]" @@ -379,7 +379,7 @@ var/world_topic_spam_protect_time = world.timeofday s += "
" var/list/features = list() - if(!enter_allowed) + if(!GLOB.enter_allowed) features += "closed" if(config && config.server_extra_features) @@ -391,7 +391,7 @@ var/world_topic_spam_protect_time = world.timeofday if(config && config.wikiurl) features += "Wiki" - if(abandon_allowed) + if(GLOB.abandon_allowed) features += "respawn" if(features) @@ -400,8 +400,8 @@ var/world_topic_spam_protect_time = world.timeofday return s #define FAILED_DB_CONNECTION_CUTOFF 5 -var/failed_db_connections = 0 -var/failed_old_db_connections = 0 +GLOBAL_VAR_INIT(failed_db_connections, 0) +GLOBAL_VAR_INIT(failed_old_db_connections, 0) /world/proc/SetupLogs() GLOB.log_directory = "data/logs/[time2text(world.realtime, "YYYY/MM-Month/DD-Day")]" @@ -436,11 +436,11 @@ var/failed_old_db_connections = 0 /proc/setup_database_connection() - if(failed_db_connections > FAILED_DB_CONNECTION_CUTOFF) //If it failed to establish a connection more than 5 times in a row, don't bother attempting to conenct anymore. + if(GLOB.failed_db_connections > FAILED_DB_CONNECTION_CUTOFF) //If it failed to establish a connection more than 5 times in a row, don't bother attempting to conenct anymore. return 0 - if(!dbcon) - dbcon = new() + if(!GLOB.dbcon) + GLOB.dbcon = new() var/user = sqlfdbklogin var/pass = sqlfdbkpass @@ -448,22 +448,22 @@ var/failed_old_db_connections = 0 var/address = sqladdress var/port = sqlport - dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]") - . = dbcon.IsConnected() + GLOB.dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]") + . = GLOB.dbcon.IsConnected() if( . ) - failed_db_connections = 0 //If this connection succeeded, reset the failed connections counter. + GLOB.failed_db_connections = 0 //If this connection succeeded, reset the failed connections counter. else - failed_db_connections++ //If it failed, increase the failed connections counter. - log_world(dbcon.ErrorMsg()) + GLOB.failed_db_connections++ //If it failed, increase the failed connections counter. + log_world(GLOB.dbcon.ErrorMsg()) return . //This proc ensures that the connection to the feedback database (global variable dbcon) is established proc/establish_db_connection() - if(failed_db_connections > FAILED_DB_CONNECTION_CUTOFF) + if(GLOB.failed_db_connections > FAILED_DB_CONNECTION_CUTOFF) return 0 - if(!dbcon || !dbcon.IsConnected()) + if(!GLOB.dbcon || !GLOB.dbcon.IsConnected()) return setup_database_connection() else return 1 diff --git a/code/modules/admin/DB ban/functions.dm b/code/modules/admin/DB ban/functions.dm index 8168583e6fa..21b59586bfd 100644 --- a/code/modules/admin/DB ban/functions.dm +++ b/code/modules/admin/DB ban/functions.dm @@ -5,7 +5,7 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = if(!check_rights(R_BAN)) return establish_db_connection() - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) return var/serverip = "[world.internet_address]:[world.port]" @@ -86,7 +86,7 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = message_admins("[key_name_admin(usr)] attempted to add a ban based on a non-existent mob, with no ckey provided. Report this bug.",1) return - var/DBQuery/query = dbcon.NewQuery("SELECT id FROM [format_table_name("player")] WHERE ckey = '[ckey]'") + var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("player")] WHERE ckey = '[ckey]'") query.Execute() var/validckey = 0 if(query.NextRow()) @@ -127,7 +127,7 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = reason = sanitizeSQL(reason) if(maxadminbancheck) - var/DBQuery/adm_query = dbcon.NewQuery("SELECT count(id) AS num FROM [format_table_name("ban")] WHERE (a_ckey = '[a_ckey]') AND (bantype = 'ADMIN_PERMABAN' OR (bantype = 'ADMIN_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)") + var/DBQuery/adm_query = GLOB.dbcon.NewQuery("SELECT count(id) AS num FROM [format_table_name("ban")] WHERE (a_ckey = '[a_ckey]') AND (bantype = 'ADMIN_PERMABAN' OR (bantype = 'ADMIN_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)") adm_query.Execute() if(adm_query.NextRow()) var/adm_bans = text2num(adm_query.item[1]) @@ -136,7 +136,7 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = return var/sql = "INSERT INTO [format_table_name("ban")] (`id`,`bantime`,`serverip`,`bantype`,`reason`,`job`,`duration`,`rounds`,`expiration_time`,`ckey`,`computerid`,`ip`,`a_ckey`,`a_computerid`,`a_ip`,`who`,`adminwho`,`edits`,`unbanned`,`unbanned_datetime`,`unbanned_ckey`,`unbanned_computerid`,`unbanned_ip`) VALUES (null, Now(), '[serverip]', '[bantype_str]', '[reason]', '[job]', [(duration)?"[duration]":"0"], [(rounds)?"[rounds]":"0"], Now() + INTERVAL [(duration>0) ? duration : 0] MINUTE, '[ckey]', '[computerid]', '[ip]', '[a_ckey]', '[a_computerid]', '[a_ip]', '[who]', '[adminwho]', '', null, null, null, null, null)" - var/DBQuery/query_insert = dbcon.NewQuery(sql) + var/DBQuery/query_insert = GLOB.dbcon.NewQuery(sql) query_insert.Execute() to_chat(usr, "Ban saved to database.") message_admins("[key_name_admin(usr)] has added a [bantype_str] for [ckey] [(job)?"([job])":""] [(duration > 0)?"([duration] minutes)":""] with the reason: \"[reason]\" to the ban database.",1) @@ -201,13 +201,13 @@ datum/admins/proc/DB_ban_unban(var/ckey, var/bantype, var/job = "") sql += " AND job = '[job]'" establish_db_connection() - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) return var/ban_id var/ban_number = 0 //failsafe - var/DBQuery/query = dbcon.NewQuery(sql) + var/DBQuery/query = GLOB.dbcon.NewQuery(sql) query.Execute() while(query.NextRow()) ban_id = query.item[1] @@ -241,7 +241,7 @@ datum/admins/proc/DB_ban_edit(var/banid = null, var/param = null) to_chat(usr, "Cancelled") return - var/DBQuery/query = dbcon.NewQuery("SELECT ckey, duration, reason, job FROM [format_table_name("ban")] WHERE id = [banid]") + var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT ckey, duration, reason, job FROM [format_table_name("ban")] WHERE id = [banid]") query.Execute() var/eckey = usr.ckey //Editing admin ckey @@ -271,7 +271,7 @@ datum/admins/proc/DB_ban_edit(var/banid = null, var/param = null) to_chat(usr, "Cancelled") return - var/DBQuery/update_query = dbcon.NewQuery("UPDATE [format_table_name("ban")] SET reason = '[value]', edits = CONCAT(edits,'- [eckey] changed ban reason from \\\"[reason]\\\" to \\\"[value]\\\"
') WHERE id = [banid]") + var/DBQuery/update_query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("ban")] SET reason = '[value]', edits = CONCAT(edits,'- [eckey] changed ban reason from \\\"[reason]\\\" to \\\"[value]\\\"
') WHERE id = [banid]") update_query.Execute() message_admins("[key_name_admin(usr)] has edited a ban for [pckey]'s reason from [reason] to [value]",1) if("duration") @@ -281,7 +281,7 @@ datum/admins/proc/DB_ban_edit(var/banid = null, var/param = null) to_chat(usr, "Cancelled") return - var/DBQuery/update_query = dbcon.NewQuery("UPDATE [format_table_name("ban")] SET duration = [value], edits = CONCAT(edits,'- [eckey] changed ban duration from [duration] to [value]
'), expiration_time = DATE_ADD(bantime, INTERVAL [value] MINUTE) WHERE id = [banid]") + var/DBQuery/update_query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("ban")] SET duration = [value], edits = CONCAT(edits,'- [eckey] changed ban duration from [duration] to [value]
'), expiration_time = DATE_ADD(bantime, INTERVAL [value] MINUTE) WHERE id = [banid]") message_admins("[key_name_admin(usr)] has edited a ban for [pckey]'s duration from [duration] to [value]",1) update_query.Execute() if("unban") @@ -304,13 +304,13 @@ datum/admins/proc/DB_ban_unban_by_id(var/id) var/sql = "SELECT ckey FROM [format_table_name("ban")] WHERE id = [id]" establish_db_connection() - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) return var/ban_number = 0 //failsafe var/pckey - var/DBQuery/query = dbcon.NewQuery(sql) + var/DBQuery/query = GLOB.dbcon.NewQuery(sql) query.Execute() while(query.NextRow()) pckey = query.item[1] @@ -334,7 +334,7 @@ datum/admins/proc/DB_ban_unban_by_id(var/id) var/sql_update = "UPDATE [format_table_name("ban")] SET unbanned = 1, unbanned_datetime = Now(), unbanned_ckey = '[unban_ckey]', unbanned_computerid = '[unban_computerid]', unbanned_ip = '[unban_ip]' WHERE id = [id]" message_admins("[key_name_admin(usr)] has lifted [pckey]'s ban.",1) - var/DBQuery/query_update = dbcon.NewQuery(sql_update) + var/DBQuery/query_update = GLOB.dbcon.NewQuery(sql_update) query_update.Execute() flag_account_for_forum_sync(pckey) @@ -359,7 +359,7 @@ datum/admins/proc/DB_ban_unban_by_id(var/id) if(!check_rights(R_BAN)) return establish_db_connection() - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) to_chat(usr, "Failed to establish database connection") return @@ -392,13 +392,13 @@ datum/admins/proc/DB_ban_unban_by_id(var/id) output += "" for(var/j in get_all_jobs()) output += "" - for(var/j in nonhuman_positions) + for(var/j in GLOB.nonhuman_positions) output += "" - for(var/j in other_roles) + for(var/j in GLOB.other_roles) output += "" for(var/j in list("commanddept","securitydept","engineeringdept","medicaldept","sciencedept","supportdept","nonhumandept")) output += "" - for(var/j in list("Syndicate") + antag_roles) + for(var/j in list("Syndicate") + GLOB.antag_roles) output += "" output += "
" output += "Reason:

" @@ -498,7 +498,7 @@ datum/admins/proc/DB_ban_unban_by_id(var/id) bantypesearch += "'PERMABAN' " - var/DBQuery/select_query = dbcon.NewQuery("SELECT id, bantime, bantype, reason, job, duration, expiration_time, ckey, a_ckey, unbanned, unbanned_ckey, unbanned_datetime, edits, ip, computerid FROM [format_table_name("ban")] WHERE 1 [playersearch] [adminsearch] [ipsearch] [cidsearch] [bantypesearch] ORDER BY bantime DESC LIMIT 100") + var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT id, bantime, bantype, reason, job, duration, expiration_time, ckey, a_ckey, unbanned, unbanned_ckey, unbanned_datetime, edits, ip, computerid FROM [format_table_name("ban")] WHERE 1 [playersearch] [adminsearch] [ipsearch] [cidsearch] [bantypesearch] ORDER BY bantime DESC LIMIT 100") select_query.Execute() while(select_query.NextRow()) @@ -575,9 +575,9 @@ datum/admins/proc/DB_ban_unban_by_id(var/id) usr << browse(output,"window=lookupbans;size=900x700") /proc/flag_account_for_forum_sync(ckey) - if(!dbcon) + if(!GLOB.dbcon) return var/skey = sanitizeSQL(ckey) var/sql = "UPDATE [format_table_name("player")] SET fupdate = 1 WHERE ckey = '[skey]'" - var/DBQuery/adm_query = dbcon.NewQuery(sql) + var/DBQuery/adm_query = GLOB.dbcon.NewQuery(sql) adm_query.Execute() diff --git a/code/modules/admin/IsBanned.dm b/code/modules/admin/IsBanned.dm index d776b4a2095..c7f2baac4ef 100644 --- a/code/modules/admin/IsBanned.dm +++ b/code/modules/admin/IsBanned.dm @@ -25,13 +25,13 @@ world/IsBanned(key, address, computer_id, type, check_ipintel = TRUE) if (C && ckey == C.ckey && computer_id == C.computer_id && address == C.address) return //don't recheck connected clients. - if((ckey in admin_datums) || (ckey in GLOB.deadmins)) - var/datum/admins/A = admin_datums[ckey] + if((ckey in GLOB.admin_datums) || (ckey in GLOB.deadmins)) + var/datum/admins/A = GLOB.admin_datums[ckey] if(A && (A.rights & R_ADMIN)) admin = 1 //Guest Checking - if(!guests_allowed && IsGuestKey(key)) + if(!GLOB.guests_allowed && IsGuestKey(key)) log_adminwarn("Failed Login: [key] [computer_id] [address] - Guests not allowed") // message_admins("Failed Login: [key] - Guests not allowed") return list("reason"="guest", "desc"="\nReason: Guests not allowed. Please sign in with a BYOND account.") @@ -82,7 +82,7 @@ world/IsBanned(key, address, computer_id, type, check_ipintel = TRUE) if(computer_id) cidquery = " OR computerid = '[computer_id]' " - var/DBQuery/query = dbcon.NewQuery("SELECT ckey, ip, computerid, a_ckey, reason, expiration_time, duration, bantime, bantype FROM [format_table_name("ban")] WHERE (ckey = '[ckeytext]' [ipquery] [cidquery]) AND (bantype = 'PERMABAN' OR bantype = 'ADMIN_PERMABAN' OR ((bantype = 'TEMPBAN' OR bantype = 'ADMIN_TEMPBAN') AND expiration_time > Now())) AND isnull(unbanned)") + var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT ckey, ip, computerid, a_ckey, reason, expiration_time, duration, bantime, bantype FROM [format_table_name("ban")] WHERE (ckey = '[ckeytext]' [ipquery] [cidquery]) AND (bantype = 'PERMABAN' OR bantype = 'ADMIN_PERMABAN' OR ((bantype = 'TEMPBAN' OR bantype = 'ADMIN_TEMPBAN') AND expiration_time > Now())) AND isnull(unbanned)") query.Execute() diff --git a/code/modules/admin/NewBan.dm b/code/modules/admin/NewBan.dm index 222fc036db2..7b9a9330704 100644 --- a/code/modules/admin/NewBan.dm +++ b/code/modules/admin/NewBan.dm @@ -1,61 +1,61 @@ -var/CMinutes = null -var/savefile/Banlist - +GLOBAL_VAR(CMinutes) +GLOBAL_DATUM(banlist_savefile, /savefile) +GLOBAL_PROTECT(banlist_savefile) // Obvious reasons /proc/CheckBan(var/ckey, var/id, var/address) - if(!Banlist) // if Banlist cannot be located for some reason + if(!GLOB.banlist_savefile) // if banlist_savefile cannot be located for some reason LoadBans() // try to load the bans - if(!Banlist) // uh oh, can't find bans! + if(!GLOB.banlist_savefile) // uh oh, can't find bans! return 0 // ABORT ABORT ABORT . = list() var/appeal if(config && config.banappeals) appeal = "\nFor more information on your ban, or to appeal, head to [config.banappeals]" - Banlist.cd = "/base" - if( "[ckey][id]" in Banlist.dir ) - Banlist.cd = "[ckey][id]" - if(Banlist["temp"]) - if(!GetExp(Banlist["minutes"])) + GLOB.banlist_savefile.cd = "/base" + if( "[ckey][id]" in GLOB.banlist_savefile.dir ) + GLOB.banlist_savefile.cd = "[ckey][id]" + if(GLOB.banlist_savefile["temp"]) + if(!GetExp(GLOB.banlist_savefile["minutes"])) ClearTempbans() return 0 else - .["desc"] = "\nReason: [Banlist["reason"]]\nExpires: [GetExp(Banlist["minutes"])]\nBy: [Banlist["bannedby"]][appeal]" + .["desc"] = "\nReason: [GLOB.banlist_savefile["reason"]]\nExpires: [GetExp(GLOB.banlist_savefile["minutes"])]\nBy: [GLOB.banlist_savefile["bannedby"]][appeal]" else - Banlist.cd = "/base/[ckey][id]" - .["desc"] = "\nReason: [Banlist["reason"]]\nExpires: PERMENANT\nBy: [Banlist["bannedby"]][appeal]" + GLOB.banlist_savefile.cd = "/base/[ckey][id]" + .["desc"] = "\nReason: [GLOB.banlist_savefile["reason"]]\nExpires: PERMENANT\nBy: [GLOB.banlist_savefile["bannedby"]][appeal]" .["reason"] = "ckey/id" return . else - for(var/A in Banlist.dir) - Banlist.cd = "/base/[A]" + for(var/A in GLOB.banlist_savefile.dir) + GLOB.banlist_savefile.cd = "/base/[A]" var/matches - if( ckey == Banlist["key"] ) + if( ckey == GLOB.banlist_savefile["key"] ) matches += "ckey" - if( id == Banlist["id"] ) + if( id == GLOB.banlist_savefile["id"] ) if(matches) matches += "/" matches += "id" - if( address == Banlist["ip"] ) + if( address == GLOB.banlist_savefile["ip"] ) if(matches) matches += "/" matches += "ip" if(matches) - if(Banlist["temp"]) - if(!GetExp(Banlist["minutes"])) + if(GLOB.banlist_savefile["temp"]) + if(!GetExp(GLOB.banlist_savefile["minutes"])) ClearTempbans() return 0 else - .["desc"] = "\nReason: [Banlist["reason"]]\nExpires: [GetExp(Banlist["minutes"])]\nBy: [Banlist["bannedby"]][appeal]" + .["desc"] = "\nReason: [GLOB.banlist_savefile["reason"]]\nExpires: [GetExp(GLOB.banlist_savefile["minutes"])]\nBy: [GLOB.banlist_savefile["bannedby"]][appeal]" else - .["desc"] = "\nReason: [Banlist["reason"]]\nExpires: PERMENANT\nBy: [Banlist["bannedby"]][appeal]" + .["desc"] = "\nReason: [GLOB.banlist_savefile["reason"]]\nExpires: PERMENANT\nBy: [GLOB.banlist_savefile["bannedby"]][appeal]" .["reason"] = matches return . return 0 /proc/UpdateTime() //No idea why i made this a proc. - CMinutes = (world.realtime / 10) / 60 + GLOB.CMinutes = (world.realtime / 10) / 60 return 1 /hook/startup/proc/loadBans() @@ -63,17 +63,17 @@ var/savefile/Banlist /proc/LoadBans() - Banlist = new("data/banlist.bdb") + GLOB.banlist_savefile = new("data/banlist.bdb") log_admin("Loading Banlist") - if(!length(Banlist.dir)) log_admin("Banlist is empty.") + if(!length(GLOB.banlist_savefile.dir)) log_admin("Banlist is empty.") - if(!Banlist.dir.Find("base")) + if(!GLOB.banlist_savefile.dir.Find("base")) log_admin("Banlist missing base dir.") - Banlist.dir.Add("base") - Banlist.cd = "/base" - else if(Banlist.dir.Find("base")) - Banlist.cd = "/base" + GLOB.banlist_savefile.dir.Add("base") + GLOB.banlist_savefile.cd = "/base" + else if(GLOB.banlist_savefile.dir.Find("base")) + GLOB.banlist_savefile.cd = "/base" ClearTempbans() return 1 @@ -81,17 +81,17 @@ var/savefile/Banlist /proc/ClearTempbans() UpdateTime() - Banlist.cd = "/base" - for(var/A in Banlist.dir) - Banlist.cd = "/base/[A]" - if(!Banlist["key"] || !Banlist["id"]) + GLOB.banlist_savefile.cd = "/base" + for(var/A in GLOB.banlist_savefile.dir) + GLOB.banlist_savefile.cd = "/base/[A]" + if(!GLOB.banlist_savefile["key"] || !GLOB.banlist_savefile["id"]) RemoveBan(A) log_admin("Invalid Ban.") message_admins("Invalid Ban.") continue - if(!Banlist["temp"]) continue - if(CMinutes >= Banlist["minutes"]) RemoveBan(A) + if(!GLOB.banlist_savefile["temp"]) continue + if(GLOB.CMinutes >= GLOB.banlist_savefile["minutes"]) RemoveBan(A) return 1 @@ -102,23 +102,23 @@ var/savefile/Banlist if(temp) UpdateTime() - bantimestamp = CMinutes + minutes + bantimestamp = GLOB.CMinutes + minutes - Banlist.cd = "/base" - if( Banlist.dir.Find("[ckey][computerid]") ) + GLOB.banlist_savefile.cd = "/base" + if( GLOB.banlist_savefile.dir.Find("[ckey][computerid]") ) to_chat(usr, "Ban already exists.") return 0 else - Banlist.dir.Add("[ckey][computerid]") - Banlist.cd = "/base/[ckey][computerid]" - Banlist["key"] << ckey - Banlist["id"] << computerid - Banlist["ip"] << address - Banlist["reason"] << reason - Banlist["bannedby"] << bannedby - Banlist["temp"] << temp + GLOB.banlist_savefile.dir.Add("[ckey][computerid]") + GLOB.banlist_savefile.cd = "/base/[ckey][computerid]" + GLOB.banlist_savefile["key"] << ckey + GLOB.banlist_savefile["id"] << computerid + GLOB.banlist_savefile["ip"] << address + GLOB.banlist_savefile["reason"] << reason + GLOB.banlist_savefile["bannedby"] << bannedby + GLOB.banlist_savefile["temp"] << temp if(temp) - Banlist["minutes"] << bantimestamp + GLOB.banlist_savefile["minutes"] << bantimestamp if(!temp) add_note(ckey, "Permanently banned - [reason]", null, bannedby, 0) else @@ -129,12 +129,12 @@ var/savefile/Banlist var/key var/id - Banlist.cd = "/base/[foldername]" - Banlist["key"] >> key - Banlist["id"] >> id - Banlist.cd = "/base" + GLOB.banlist_savefile.cd = "/base/[foldername]" + GLOB.banlist_savefile["key"] >> key + GLOB.banlist_savefile["id"] >> id + GLOB.banlist_savefile.cd = "/base" - if(!Banlist.dir.Remove(foldername)) return 0 + if(!GLOB.banlist_savefile.dir.Remove(foldername)) return 0 if(!usr) log_admin("Ban Expired: [key]") @@ -145,18 +145,18 @@ var/savefile/Banlist message_admins("[key_name_admin(usr)] unbanned: [key]") feedback_inc("ban_unban",1) usr.client.holder.DB_ban_unban( ckey(key), BANTYPE_ANY_FULLBAN) - for(var/A in Banlist.dir) - Banlist.cd = "/base/[A]" - if(key == Banlist["key"] /*|| id == Banlist["id"]*/) - Banlist.cd = "/base" - Banlist.dir.Remove(A) + for(var/A in GLOB.banlist_savefile.dir) + GLOB.banlist_savefile.cd = "/base/[A]" + if(key == GLOB.banlist_savefile["key"] /*|| id == GLOB.banlist_savefile["id"]*/) + GLOB.banlist_savefile.cd = "/base" + GLOB.banlist_savefile.dir.Remove(A) continue return 1 /proc/GetExp(minutes as num) UpdateTime() - var/exp = minutes - CMinutes + var/exp = minutes - GLOB.CMinutes if(exp <= 0) return 0 else @@ -172,19 +172,19 @@ var/savefile/Banlist /datum/admins/proc/unbanpanel() var/count = 0 var/dat - Banlist.cd = "/base" - for(var/A in Banlist.dir) + GLOB.banlist_savefile.cd = "/base" + for(var/A in GLOB.banlist_savefile.dir) count++ - Banlist.cd = "/base/[A]" + GLOB.banlist_savefile.cd = "/base/[A]" var/ref = UID() - var/key = Banlist["key"] - var/id = Banlist["id"] - var/ip = Banlist["ip"] - var/reason = Banlist["reason"] - var/by = Banlist["bannedby"] + var/key = GLOB.banlist_savefile["key"] + var/id = GLOB.banlist_savefile["id"] + var/ip = GLOB.banlist_savefile["ip"] + var/reason = GLOB.banlist_savefile["reason"] + var/by = GLOB.banlist_savefile["bannedby"] var/expiry - if(Banlist["temp"]) - expiry = GetExp(Banlist["minutes"]) + if(GLOB.banlist_savefile["temp"]) + expiry = GetExp(GLOB.banlist_savefile["minutes"]) if(!expiry) expiry = "Removal Pending" else expiry = "Permaban" @@ -207,26 +207,26 @@ var/savefile/Banlist var/a = pick(1,0) var/b = pick(1,0) if(b) - Banlist.cd = "/base" - Banlist.dir.Add("trash[i]trashid[i]") - Banlist.cd = "/base/trash[i]trashid[i]" - Banlist["key"] << "trash[i]" + GLOB.banlist_savefile.cd = "/base" + GLOB.banlist_savefile.dir.Add("trash[i]trashid[i]") + GLOB.banlist_savefile.cd = "/base/trash[i]trashid[i]" + GLOB.banlist_savefile["key"] << "trash[i]" else - Banlist.cd = "/base" - Banlist.dir.Add("[last]trashid[i]") - Banlist.cd = "/base/[last]trashid[i]" - Banlist["key"] << last - Banlist["id"] << "trashid[i]" - Banlist["reason"] << "Trashban[i]." - Banlist["temp"] << a - Banlist["minutes"] << CMinutes + rand(1,2000) - Banlist["bannedby"] << "trashmin" + GLOB.banlist_savefile.cd = "/base" + GLOB.banlist_savefile.dir.Add("[last]trashid[i]") + GLOB.banlist_savefile.cd = "/base/[last]trashid[i]" + GLOB.banlist_savefile["key"] << last + GLOB.banlist_savefile["id"] << "trashid[i]" + GLOB.banlist_savefile["reason"] << "Trashban[i]." + GLOB.banlist_savefile["temp"] << a + GLOB.banlist_savefile["minutes"] << GLOB.CMinutes + rand(1,2000) + GLOB.banlist_savefile["bannedby"] << "trashmin" last = "trash[i]" - Banlist.cd = "/base" + GLOB.banlist_savefile.cd = "/base" /proc/ClearAllBans() - Banlist.cd = "/base" - for(var/A in Banlist.dir) + GLOB.banlist_savefile.cd = "/base" + for(var/A in GLOB.banlist_savefile.dir) RemoveBan(A) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 31aa6d5bc4c..df156c5b0df 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1,5 +1,5 @@ -var/global/BSACooldown = 0 -var/global/nologevent = 0 +GLOBAL_VAR_INIT(BSACooldown, 0) +GLOBAL_VAR_INIT(nologevent, 0) //////////////////////////////// /proc/message_admins(var/msg) @@ -10,7 +10,7 @@ var/global/nologevent = 0 to_chat(C, msg) /proc/msg_admin_attack(var/text, var/loglevel) - if(!nologevent) + if(!GLOB.nologevent) var/rendered = "ATTACK: [text]" for(var/client/C in GLOB.admins) if(R_ADMIN & C.holder.rights) @@ -197,7 +197,7 @@ var/global/nologevent = 0 for(var/block=1;block<=DNA_SE_LENGTH;block++) if(((block-1)%5)==0) body += "[block-1]" - bname = assigned_blocks[block] + bname = GLOB.assigned_blocks[block] body += "" if(bname) var/bstate=M.dna.GetSEState(block) @@ -306,7 +306,7 @@ var/global/nologevent = 0
Feed channels and stories entered through here will be uneditable and handled as official news by the rest of the units.
Note that this panel allows full freedom over the news network, there are no constrictions except the few basic ones. Don't break things!
"} - if(news_network.wanted_issue) + if(GLOB.news_network.wanted_issue) dat+= "
Read Wanted Issue" dat+= {"

Create Feed Channel @@ -316,7 +316,7 @@ var/global/nologevent = 0 "} var/wanted_already = 0 - if(news_network.wanted_issue) + if(GLOB.news_network.wanted_issue) wanted_already = 1 dat+={"
Feed Security functions:
@@ -327,10 +327,10 @@ var/global/nologevent = 0 "} if(1) dat+= "Station Feed Channels
" - if( isemptylist(news_network.network_channels) ) + if( isemptylist(GLOB.news_network.network_channels) ) dat+="No active channels found..." else - for(var/datum/feed_channel/CHANNEL in news_network.network_channels) + for(var/datum/feed_channel/CHANNEL in GLOB.news_network.network_channels) if(CHANNEL.is_admin_channel) dat+="[CHANNEL.channel_name]
" else @@ -377,7 +377,7 @@ var/global/nologevent = 0 if(src.admincaster_feed_channel.channel_name =="" || src.admincaster_feed_channel.channel_name == "\[REDACTED\]") dat+="•Invalid channel name.
" var/check = 0 - for(var/datum/feed_channel/FC in news_network.network_channels) + for(var/datum/feed_channel/FC in GLOB.news_network.network_channels) if(FC.channel_name == src.admincaster_feed_channel.channel_name) check = 1 break @@ -414,10 +414,10 @@ var/global/nologevent = 0 Keep in mind that users attempting to view a censored feed will instead see the \[REDACTED\] tag above it.
Select Feed channel to get Stories from:
"} - if(isemptylist(news_network.network_channels)) + if(isemptylist(GLOB.news_network.network_channels)) dat+="No feed channels found active...
" else - for(var/datum/feed_channel/CHANNEL in news_network.network_channels) + for(var/datum/feed_channel/CHANNEL in GLOB.news_network.network_channels) dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? ("***") : ""]
" dat+="
Cancel" if(11) @@ -427,10 +427,10 @@ var/global/nologevent = 0 morale, integrity or disciplinary behaviour. A D-Notice will render a channel unable to be updated by anyone, without deleting any feed stories it might contain at the time. You can lift a D-Notice if you have the required access at any time.
"} - if(isemptylist(news_network.network_channels)) + if(isemptylist(GLOB.news_network.network_channels)) dat+="No feed channels found active...
" else - for(var/datum/feed_channel/CHANNEL in news_network.network_channels) + for(var/datum/feed_channel/CHANNEL in GLOB.news_network.network_channels) dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? ("***") : ""]
" dat+="
Back" @@ -470,7 +470,7 @@ var/global/nologevent = 0 dat+="Wanted Issue Handler:" var/wanted_already = 0 var/end_param = 1 - if(news_network.wanted_issue) + if(GLOB.news_network.wanted_issue) wanted_already = 1 end_param = 2 if(wanted_already) @@ -481,7 +481,7 @@ var/global/nologevent = 0 Description: [src.admincaster_feed_message.body]
"} if(wanted_already) - dat+="Wanted Issue created by: [news_network.wanted_issue.backup_author]
" + dat+="Wanted Issue created by: [GLOB.news_network.wanted_issue.backup_author]
" else dat+="Wanted Issue will be created under prosecutor: [src.admincaster_signature]
" dat+="
[(wanted_already) ? ("Edit Issue") : ("Submit")]" @@ -507,13 +507,13 @@ var/global/nologevent = 0 "} if(18) dat+={" - -- STATIONWIDE WANTED ISSUE --
\[Submitted by: [news_network.wanted_issue.backup_author]\]
- Criminal: [news_network.wanted_issue.author]
- Description: [news_network.wanted_issue.body]
+ -- STATIONWIDE WANTED ISSUE --
\[Submitted by: [GLOB.news_network.wanted_issue.backup_author]\]
+ Criminal: [GLOB.news_network.wanted_issue.author]
+ Description: [GLOB.news_network.wanted_issue.body]
Photo:: "} - if(news_network.wanted_issue.img) - usr << browse_rsc(news_network.wanted_issue.img, "tmp_photow.png") + if(GLOB.news_network.wanted_issue.img) + usr << browse_rsc(GLOB.news_network.wanted_issue.img, "tmp_photow.png") dat+="
" else dat+="None" @@ -536,7 +536,7 @@ var/global/nologevent = 0 return var/dat = "Job Bans!
" - for(var/t in jobban_keylist) + for(var/t in GLOB.jobban_keylist) var/r = t if( findtext(r,"##") ) r = copytext( r, 1, findtext(r,"##") )//removes the description @@ -552,7 +552,7 @@ var/global/nologevent = 0
Game Panel

\n Change Game Mode
"} - if(master_mode == "secret") + if(GLOB.master_mode == "secret") dat += "(Force Secret Mode)
" dat += {" @@ -714,8 +714,8 @@ var/global/nologevent = 0 if(!check_rights(R_SERVER)) return - enter_allowed = !( enter_allowed ) - if(!( enter_allowed )) + GLOB.enter_allowed = !( GLOB.enter_allowed ) + if(!( GLOB.enter_allowed )) to_chat(world, "New players may no longer enter the game.") else to_chat(world, "New players may now enter the game.") @@ -750,13 +750,13 @@ var/global/nologevent = 0 if(!check_rights(R_SERVER)) return - abandon_allowed = !( abandon_allowed ) - if(abandon_allowed) + GLOB.abandon_allowed = !( GLOB.abandon_allowed ) + if(GLOB.abandon_allowed) to_chat(world, "You may now respawn.") else to_chat(world, "You may no longer respawn :(") - message_admins("[key_name_admin(usr)] toggled respawn to [abandon_allowed ? "On" : "Off"].", 1) - log_admin("[key_name(usr)] toggled respawn to [abandon_allowed ? "On" : "Off"].") + message_admins("[key_name_admin(usr)] toggled respawn to [GLOB.abandon_allowed ? "On" : "Off"].", 1) + log_admin("[key_name(usr)] toggled respawn to [GLOB.abandon_allowed ? "On" : "Off"].") world.update_status() feedback_add_details("admin_verb","TR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -768,9 +768,9 @@ var/global/nologevent = 0 if(!check_rights(R_EVENT)) return - aliens_allowed = !aliens_allowed - log_admin("[key_name(usr)] toggled aliens to [aliens_allowed].") - message_admins("[key_name_admin(usr)] toggled aliens [aliens_allowed ? "on" : "off"].") + GLOB.aliens_allowed = !GLOB.aliens_allowed + log_admin("[key_name(usr)] toggled aliens to [GLOB.aliens_allowed].") + message_admins("[key_name_admin(usr)] toggled aliens [GLOB.aliens_allowed ? "on" : "off"].") feedback_add_details("admin_verb","TA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /datum/admins/proc/delay() @@ -786,13 +786,13 @@ var/global/nologevent = 0 log_admin("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].") message_admins("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].", 1) return //alert("Round end delayed", null, null, null, null, null) - if(going) - going = FALSE + if(SSticker.ticker_going) + SSticker.ticker_going = FALSE SSticker.delay_end = TRUE to_chat(world, "The game start has been delayed.") log_admin("[key_name(usr)] delayed the game.") else - going = TRUE + SSticker.ticker_going = TRUE to_chat(world, "The game will start soon.") log_admin("[key_name(usr)] removed the delay.") feedback_add_details("admin_verb","DELAY") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -899,13 +899,13 @@ var/global/nologevent = 0 if(!check_rights(R_SERVER)) return - guests_allowed = !( guests_allowed ) - if(!( guests_allowed )) + GLOB.guests_allowed = !( GLOB.guests_allowed ) + if(!( GLOB.guests_allowed )) to_chat(world, "Guests may no longer enter the game.") else to_chat(world, "Guests may now enter the game.") - log_admin("[key_name(usr)] toggled guests game entering [guests_allowed ? "" : "dis"]allowed.") - message_admins("[key_name_admin(usr)] toggled guests game entering [guests_allowed ? "" : "dis"]allowed.", 1) + log_admin("[key_name(usr)] toggled guests game entering [GLOB.guests_allowed ? "" : "dis"]allowed.") + message_admins("[key_name_admin(usr)] toggled guests game entering [GLOB.guests_allowed ? "" : "dis"]allowed.", 1) feedback_add_details("admin_verb","TGU") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /datum/admins/proc/output_ai_laws() @@ -954,12 +954,12 @@ var/global/nologevent = 0 //ALL DONE //********************************************************************************************************* -var/gamma_ship_location = 1 // 0 = station , 1 = space +GLOBAL_VAR_INIT(gamma_ship_location, 1) // 0 = station , 1 = space /proc/move_gamma_ship() var/area/fromArea var/area/toArea - if(gamma_ship_location == 1) + if(GLOB.gamma_ship_location == 1) fromArea = locate(/area/shuttle/gamma/space) toArea = locate(/area/shuttle/gamma/station) else @@ -970,10 +970,10 @@ var/gamma_ship_location = 1 // 0 = station , 1 = space for(var/obj/machinery/mech_bay_recharge_port/P in toArea) P.update_recharge_turf() - if(gamma_ship_location) - gamma_ship_location = 0 + if(GLOB.gamma_ship_location) + GLOB.gamma_ship_location = 0 else - gamma_ship_location = 1 + GLOB.gamma_ship_location = 1 return /proc/formatJumpTo(var/location,var/where="") diff --git a/code/modules/admin/admin_investigate.dm b/code/modules/admin/admin_investigate.dm index 49b2f06d003..13b786c5174 100644 --- a/code/modules/admin/admin_investigate.dm +++ b/code/modules/admin/admin_investigate.dm @@ -23,18 +23,18 @@ if(!message) return var/F = investigate_subject2file(subject) if(!F) return - investigate_log_subjects |= subject + GLOB.investigate_log_subjects |= subject F << "[time_stamp()] \ref[src] ([x],[y],[z]) || [src] [message]
" /proc/log_investigate(message, subject) if(!message) return var/F = investigate_subject2file(subject) if(!F) return - investigate_log_subjects |= subject + GLOB.investigate_log_subjects |= subject F << "[time_stamp()] || [message]
" //ADMINVERBS -/client/proc/investigate_show( subject in investigate_log_subjects ) +/client/proc/investigate_show( subject in GLOB.investigate_log_subjects ) set name = "Investigate" set category = "Admin" if(!holder) return diff --git a/code/modules/admin/admin_memo.dm b/code/modules/admin/admin_memo.dm index 530b9e7958e..455b38e1e0f 100644 --- a/code/modules/admin/admin_memo.dm +++ b/code/modules/admin/admin_memo.dm @@ -3,7 +3,7 @@ set category = "Server" if(!check_rights(R_SERVER)) return - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) to_chat(src, "Failed to establish database connection.") return var/memotask = input(usr,"Choose task.","Memo") in list("Show","Write","Edit","Remove") @@ -16,13 +16,13 @@ return if(!task) return - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) to_chat(src, "Failed to establish database connection.") return var/sql_ckey = sanitizeSQL(src.ckey) switch(task) if("Write") - var/DBQuery/query_memocheck = dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")] WHERE ckey = '[sql_ckey]'") + var/DBQuery/query_memocheck = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")] WHERE ckey = '[sql_ckey]'") if(!query_memocheck.Execute()) var/err = query_memocheck.ErrorMsg() log_game("SQL ERROR obtaining ckey from memo table. Error : \[[err]\]\n") @@ -35,7 +35,7 @@ return memotext = sanitizeSQL(memotext) var/timestamp = SQLtime() - var/DBQuery/query_memoadd = dbcon.NewQuery("INSERT INTO [format_table_name("memo")] (ckey, memotext, timestamp) VALUES ('[sql_ckey]', '[memotext]', '[timestamp]')") + var/DBQuery/query_memoadd = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("memo")] (ckey, memotext, timestamp) VALUES ('[sql_ckey]', '[memotext]', '[timestamp]')") if(!query_memoadd.Execute()) var/err = query_memoadd.ErrorMsg() log_game("SQL ERROR adding new memo. Error : \[[err]\]\n") @@ -43,7 +43,7 @@ log_admin("[key_name(src)] has set a memo: [memotext]") message_admins("[key_name_admin(src)] has set a memo:
[memotext]") if("Edit") - var/DBQuery/query_memolist = dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")]") + var/DBQuery/query_memolist = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")]") if(!query_memolist.Execute()) var/err = query_memolist.ErrorMsg() log_game("SQL ERROR obtaining ckey from memo table. Error : \[[err]\]\n") @@ -59,7 +59,7 @@ if(!target_ckey) return var/target_sql_ckey = sanitizeSQL(target_ckey) - var/DBQuery/query_memofind = dbcon.NewQuery("SELECT memotext FROM [format_table_name("memo")] WHERE ckey = '[target_sql_ckey]'") + var/DBQuery/query_memofind = GLOB.dbcon.NewQuery("SELECT memotext FROM [format_table_name("memo")] WHERE ckey = '[target_sql_ckey]'") if(!query_memofind.Execute()) var/err = query_memofind.ErrorMsg() log_game("SQL ERROR obtaining memotext from memo table. Error : \[[err]\]\n") @@ -72,7 +72,7 @@ new_memo = sanitizeSQL(new_memo) var/edit_text = "Edited by [sql_ckey] on [SQLtime()] from
[old_memo]
to
[new_memo]
" edit_text = sanitizeSQL(edit_text) - var/DBQuery/update_query = dbcon.NewQuery("UPDATE [format_table_name("memo")] SET memotext = '[new_memo]', last_editor = '[sql_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE ckey = '[target_sql_ckey]'") + var/DBQuery/update_query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("memo")] SET memotext = '[new_memo]', last_editor = '[sql_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE ckey = '[target_sql_ckey]'") if(!update_query.Execute()) var/err = update_query.ErrorMsg() log_game("SQL ERROR editing memo. Error : \[[err]\]\n") @@ -84,7 +84,7 @@ log_admin("[key_name(src)] has edited [target_sql_ckey]'s memo from \"[old_memo]\" to \"[new_memo]\"") message_admins("[key_name_admin(src)] has edited [target_sql_ckey]'s memo from \"[old_memo]\" to \"[new_memo]\"") if("Show") - var/DBQuery/query_memoshow = dbcon.NewQuery("SELECT ckey, memotext, timestamp, last_editor FROM [format_table_name("memo")]") + var/DBQuery/query_memoshow = GLOB.dbcon.NewQuery("SELECT ckey, memotext, timestamp, last_editor FROM [format_table_name("memo")]") if(!query_memoshow.Execute()) var/err = query_memoshow.ErrorMsg() log_game("SQL ERROR obtaining ckey, memotext, timestamp, last_editor from memo table. Error : \[[err]\]\n") @@ -104,7 +104,7 @@ else if(!silent) to_chat(src, "No memos found in database.") if("Remove") - var/DBQuery/query_memodellist = dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")]") + var/DBQuery/query_memodellist = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("memo")]") if(!query_memodellist.Execute()) var/err = query_memodellist.ErrorMsg() log_game("SQL ERROR obtaining ckey from memo table. Error : \[[err]\]\n") @@ -120,7 +120,7 @@ if(!target_ckey) return var/target_sql_ckey = sanitizeSQL(target_ckey) - var/DBQuery/query_memodel = dbcon.NewQuery("DELETE FROM [format_table_name("memo")] WHERE ckey = '[target_sql_ckey]'") + var/DBQuery/query_memodel = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("memo")] WHERE ckey = '[target_sql_ckey]'") if(!query_memodel.Execute()) var/err = query_memodel.ErrorMsg() log_game("SQL ERROR removing memo. Error : \[[err]\]\n") diff --git a/code/modules/admin/admin_ranks.dm b/code/modules/admin/admin_ranks.dm index 82f82d3dabe..f8a31f885ed 100644 --- a/code/modules/admin/admin_ranks.dm +++ b/code/modules/admin/admin_ranks.dm @@ -1,8 +1,9 @@ -var/list/admin_ranks = list() //list of all ranks with associated rights +GLOBAL_LIST_EMPTY(admin_ranks) //list of all ranks with associated rights +GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons //load our rank - > rights associations /proc/load_admin_ranks() - admin_ranks.Cut() + GLOB.admin_ranks.Cut() var/previous_rights = 0 @@ -44,13 +45,13 @@ var/list/admin_ranks = list() //list of all ranks with associated rights if("mentor") rights |= R_MENTOR if("proccall") rights |= R_PROCCALL - admin_ranks[rank] = rights + GLOB.admin_ranks[rank] = rights previous_rights = rights #ifdef TESTING var/msg = "Permission Sets Built:\n" for(var/rank in admin_ranks) - msg += "\t[rank] - [admin_ranks[rank]]\n" + msg += "\t[rank] - [GLOB.admin_ranks[rank]]\n" testing(msg) #endif @@ -60,7 +61,7 @@ var/list/admin_ranks = list() //list of all ranks with associated rights /proc/load_admins() //clear the datums references - admin_datums.Cut() + GLOB.admin_datums.Cut() for(var/client/C in GLOB.admins) C.remove_admin_verbs() C.holder = null @@ -91,7 +92,7 @@ var/list/admin_ranks = list() //list of all ranks with associated rights rank = ckeyEx(List[2]) //load permissions associated with this rank - var/rights = admin_ranks[rank] + var/rights = GLOB.admin_ranks[rank] //create the admin datum and store it for later use var/datum/admins/D = new /datum/admins(rank, rights, ckey) @@ -103,13 +104,13 @@ var/list/admin_ranks = list() //list of all ranks with associated rights //The current admin system uses SQL establish_db_connection() - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) log_world("Failed to connect to database in load_admins(). Reverting to legacy system.") config.admin_legacy_system = 1 load_admins() return - var/DBQuery/query = dbcon.NewQuery("SELECT ckey, rank, level, flags FROM [format_table_name("admin")]") + var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT ckey, rank, level, flags FROM [format_table_name("admin")]") query.Execute() while(query.NextRow()) var/ckey = query.item[1] @@ -122,7 +123,7 @@ var/list/admin_ranks = list() //list of all ranks with associated rights //find the client for a ckey if they are connected and associate them with the new admin datum D.associate(GLOB.directory[ckey]) - if(!admin_datums) + if(!GLOB.admin_datums) log_world("The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system.") config.admin_legacy_system = 1 load_admins() @@ -130,9 +131,9 @@ var/list/admin_ranks = list() //list of all ranks with associated rights #ifdef TESTING var/msg = "Admins Built:\n" - for(var/ckey in admin_datums) + for(var/ckey in GLOB.admin_datums) var/rank - var/datum/admins/D = admin_datums[ckey] + var/datum/admins/D = GLOB.admin_datums[ckey] if(D) rank = D.rank msg += "\t[ckey] - [rank]\n" testing(msg) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 9a60d41aa66..ec197c61651 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -1,13 +1,13 @@ //admin verb groups - They can overlap if you so wish. Only one of each verb will exist in the verbs list regardless -var/list/admin_verbs_default = list( +GLOBAL_LIST_INIT(admin_verbs_default, list( /client/proc/deadmin_self, /*destroys our own admin datum so we can play as a regular player*/ /client/proc/hide_verbs, /*hides all our adminverbs*/ /client/proc/toggleadminhelpsound, /client/proc/togglementorhelpsound, /client/proc/cmd_mentor_check_new_players, /client/proc/cmd_mentor_check_player_exp /* shows players by playtime */ - ) -var/list/admin_verbs_admin = list( + )) +GLOBAL_LIST_INIT(admin_verbs_admin, list( /client/proc/check_antagonists, /*shows all antags*/ /datum/admins/proc/show_player_panel, /client/proc/player_panel, /*shows an interface for all players, with links to various panels (old style)*/ @@ -79,20 +79,20 @@ var/list/admin_verbs_admin = list( /client/proc/list_ssds_afks, /client/proc/cmd_admin_headset_message, /client/proc/spawn_floor_cluwne -) -var/list/admin_verbs_ban = list( +)) +GLOBAL_LIST_INIT(admin_verbs_ban, list( /client/proc/unban_panel, /client/proc/jobbans, /client/proc/stickybanpanel - ) -var/list/admin_verbs_sounds = list( + )) +GLOBAL_LIST_INIT(admin_verbs_sounds, list( /client/proc/play_local_sound, /client/proc/play_sound, /client/proc/play_server_sound, /client/proc/play_intercomm_sound, /client/proc/stop_global_admin_sounds - ) -var/list/admin_verbs_event = list( + )) +GLOBAL_LIST_INIT(admin_verbs_event, list( /client/proc/object_talk, /client/proc/cmd_admin_dress, /client/proc/cmd_admin_gib_self, @@ -117,14 +117,14 @@ var/list/admin_verbs_event = list( /client/proc/event_manager_panel, /client/proc/modify_goals, /client/proc/outfit_manager - ) + )) -var/list/admin_verbs_spawn = list( +GLOBAL_LIST_INIT(admin_verbs_spawn, list( /datum/admins/proc/spawn_atom, /*allows us to spawn instances*/ /client/proc/respawn_character, /client/proc/admin_deserialize - ) -var/list/admin_verbs_server = list( + )) +GLOBAL_LIST_INIT(admin_verbs_server, list( /client/proc/ToRban, /client/proc/Set_Holiday, /datum/admins/proc/startnow, @@ -144,8 +144,8 @@ var/list/admin_verbs_server = list( /client/proc/toggle_antagHUD_restrictions, /client/proc/set_ooc, /client/proc/reset_ooc - ) -var/list/admin_verbs_debug = list( + )) +GLOBAL_LIST_INIT(admin_verbs_debug, list( /client/proc/cmd_admin_list_open_jobs, /client/proc/Debug2, /client/proc/cmd_debug_make_powernets, @@ -172,21 +172,21 @@ var/list/admin_verbs_debug = list( /client/proc/admin_serialize, /client/proc/jump_to_ruin, /client/proc/toggle_medal_disable, - ) -var/list/admin_verbs_possess = list( + )) +GLOBAL_LIST_INIT(admin_verbs_possess, list( /proc/possess, /proc/release - ) -var/list/admin_verbs_permissions = list( + )) +GLOBAL_LIST_INIT(admin_verbs_permissions, list( /client/proc/edit_admin_permissions, /client/proc/create_poll, /client/proc/big_brother - ) -var/list/admin_verbs_rejuv = list( + )) +GLOBAL_LIST_INIT(admin_verbs_rejuv, list( /client/proc/respawn_character, /client/proc/cmd_admin_rejuvenate - ) -var/list/admin_verbs_mod = list( + )) +GLOBAL_LIST_INIT(admin_verbs_mod, list( /client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/ /client/proc/cmd_admin_pm_panel, /*admin-pm list*/ /client/proc/cmd_admin_pm_by_key_panel, /*admin-pm list by key*/ @@ -199,8 +199,8 @@ var/list/admin_verbs_mod = list( /datum/admins/proc/show_player_panel, /client/proc/jobbans, /client/proc/debug_variables /*allows us to -see- the variables of any instance in the game. +VAREDIT needed to modify*/ -) -var/list/admin_verbs_mentor = list( +)) +GLOBAL_LIST_INIT(admin_verbs_mentor, list( /client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/ /client/proc/cmd_admin_pm_panel, /*admin-pm list*/ /client/proc/cmd_admin_pm_by_key_panel, /*admin-pm list by key*/ @@ -208,20 +208,20 @@ var/list/admin_verbs_mentor = list( /client/proc/toggleMentorTicketLogs, /client/proc/cmd_mentor_say /* mentor say*/ // cmd_mentor_say is added/removed by the toggle_mentor_chat verb -) -var/list/admin_verbs_proccall = list( +)) +GLOBAL_LIST_INIT(admin_verbs_proccall, list( /client/proc/callproc, /client/proc/callproc_datum, /client/proc/SDQL2_query -) -var/list/admin_verbs_ticket = list( +)) +GLOBAL_LIST_INIT(admin_verbs_ticket, list( /client/proc/openAdminTicketUI, /client/proc/toggleticketlogs, /client/proc/openMentorTicketUI, /client/proc/toggleMentorTicketLogs, /client/proc/resolveAllAdminTickets, /client/proc/resolveAllMentorTickets -) +)) /client/proc/on_holder_add() if(chatOutput && chatOutput.loaded) @@ -229,62 +229,62 @@ var/list/admin_verbs_ticket = list( /client/proc/add_admin_verbs() if(holder) - verbs += admin_verbs_default + verbs += GLOB.admin_verbs_default if(holder.rights & R_BUILDMODE) verbs += /client/proc/togglebuildmodeself if(holder.rights & R_ADMIN) - verbs += admin_verbs_admin - verbs += admin_verbs_ticket + verbs += GLOB.admin_verbs_admin + verbs += GLOB.admin_verbs_ticket spawn(1) control_freak = 0 if(holder.rights & R_BAN) - verbs += admin_verbs_ban + verbs += GLOB.admin_verbs_ban if(holder.rights & R_EVENT) - verbs += admin_verbs_event + verbs += GLOB.admin_verbs_event if(holder.rights & R_SERVER) - verbs += admin_verbs_server + verbs += GLOB.admin_verbs_server if(holder.rights & R_DEBUG) - verbs += admin_verbs_debug + verbs += GLOB.admin_verbs_debug if(holder.rights & R_POSSESS) - verbs += admin_verbs_possess + verbs += GLOB.admin_verbs_possess if(holder.rights & R_PERMISSIONS) - verbs += admin_verbs_permissions + verbs += GLOB.admin_verbs_permissions if(holder.rights & R_STEALTH) verbs += /client/proc/stealth if(holder.rights & R_REJUVINATE) - verbs += admin_verbs_rejuv + verbs += GLOB.admin_verbs_rejuv if(holder.rights & R_SOUNDS) - verbs += admin_verbs_sounds + verbs += GLOB.admin_verbs_sounds if(holder.rights & R_SPAWN) - verbs += admin_verbs_spawn + verbs += GLOB.admin_verbs_spawn if(holder.rights & R_MOD) - verbs += admin_verbs_mod + verbs += GLOB.admin_verbs_mod if(holder.rights & R_MENTOR) - verbs += admin_verbs_mentor + verbs += GLOB.admin_verbs_mentor if(holder.rights & R_PROCCALL) - verbs += admin_verbs_proccall + verbs += GLOB.admin_verbs_proccall /client/proc/remove_admin_verbs() verbs.Remove( - admin_verbs_default, + GLOB.admin_verbs_default, /client/proc/togglebuildmodeself, - admin_verbs_admin, - admin_verbs_ban, - admin_verbs_event, - admin_verbs_server, - admin_verbs_debug, - admin_verbs_possess, - admin_verbs_permissions, + GLOB.admin_verbs_admin, + GLOB.admin_verbs_ban, + GLOB.admin_verbs_event, + GLOB.admin_verbs_server, + GLOB.admin_verbs_debug, + GLOB.admin_verbs_possess, + GLOB.admin_verbs_permissions, /client/proc/stealth, - admin_verbs_rejuv, - admin_verbs_sounds, - admin_verbs_spawn, - admin_verbs_mod, - admin_verbs_mentor, - admin_verbs_proccall, - admin_verbs_show_debug_verbs, + GLOB.admin_verbs_rejuv, + GLOB.admin_verbs_sounds, + GLOB.admin_verbs_spawn, + GLOB.admin_verbs_mod, + GLOB.admin_verbs_mentor, + GLOB.admin_verbs_proccall, + GLOB.admin_verbs_show_debug_verbs, /client/proc/readmin, - admin_verbs_ticket + GLOB.admin_verbs_ticket ) /client/proc/hide_verbs() @@ -514,14 +514,14 @@ var/list/admin_verbs_ticket = list( return if(!warned_ckey || !istext(warned_ckey)) return - if(warned_ckey in admin_datums) + if(warned_ckey in GLOB.admin_datums) to_chat(usr, "Error: warn(): You can't warn admins.") return var/datum/preferences/D var/client/C = GLOB.directory[warned_ckey] if(C) D = C.prefs - else D = preferences_datums[warned_ckey] + else D = GLOB.preferences_datums[warned_ckey] if(!D) to_chat(src, "Error: warn(): No such ckey found.") @@ -601,7 +601,7 @@ var/list/admin_verbs_ticket = list( var/list/spell_list = list() var/type_length = length("/obj/effect/proc_holder/spell") + 2 - for(var/A in spells) + for(var/A in GLOB.spells) spell_list[copytext("[A]", type_length)] = A var/obj/effect/proc_holder/spell/S = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in spell_list if(!S) @@ -620,7 +620,7 @@ var/list/admin_verbs_ticket = list( set category = "Event" set name = "Give Disease" set desc = "Gives a Disease to a mob." - var/datum/disease/D = input("Choose the disease to give to that guy", "ACHOO") as null|anything in diseases + var/datum/disease/D = input("Choose the disease to give to that guy", "ACHOO") as null|anything in GLOB.diseases if(!D) return T.ForceContractDisease(new D) feedback_add_details("admin_verb","GD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -694,7 +694,7 @@ var/list/admin_verbs_ticket = list( set category = "Admin" set desc = "Regain your admin powers." - var/datum/admins/D = admin_datums[ckey] + var/datum/admins/D = GLOB.admin_datums[ckey] var/rank = null if(config.admin_legacy_system) //load text from file @@ -707,26 +707,26 @@ var/list/admin_verbs_ticket = list( break continue else - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) message_admins("Warning, MySQL database is not connected.") to_chat(src, "Warning, MYSQL database is not connected.") return var/sql_ckey = sanitizeSQL(ckey) - var/DBQuery/query = dbcon.NewQuery("SELECT rank FROM [format_table_name("admin")] WHERE ckey = '[sql_ckey]'") + var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT rank FROM [format_table_name("admin")] WHERE ckey = '[sql_ckey]'") query.Execute() while(query.NextRow()) rank = ckeyEx(query.item[1]) if(!D) if(config.admin_legacy_system) - if(admin_ranks[rank] == null) + if(GLOB.admin_ranks[rank] == null) error("Error while re-adminning [src], admin rank ([rank]) does not exist.") to_chat(src, "Error while re-adminning, admin rank ([rank]) does not exist.") return - D = new(rank, admin_ranks[rank], ckey) + D = new(rank, GLOB.admin_ranks[rank], ckey) else var/sql_ckey = sanitizeSQL(ckey) - var/DBQuery/query = dbcon.NewQuery("SELECT ckey, rank, flags FROM [format_table_name("admin")] WHERE ckey = '[sql_ckey]'") + var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT ckey, rank, flags FROM [format_table_name("admin")] WHERE ckey = '[sql_ckey]'") query.Execute() while(query.NextRow()) var/admin_ckey = query.item[1] @@ -791,7 +791,7 @@ var/list/admin_verbs_ticket = list( if(!S) return var/datum/nano_module/law_manager/L = new(S) - L.ui_interact(usr, state = admin_state) + L.ui_interact(usr, state = GLOB.admin_state) log_and_message_admins("has opened [S]'s law manager.") feedback_add_details("admin_verb","MSL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/banappearance.dm b/code/modules/admin/banappearance.dm index ff461c0f333..b561e0169ff 100644 --- a/code/modules/admin/banappearance.dm +++ b/code/modules/admin/banappearance.dm @@ -1,22 +1,22 @@ //ban people from using custom names and appearances. that'll show 'em. -var/appearanceban_runonce //Updates legacy bans with new info -var/appearance_keylist[0] //to store the keys +GLOBAL_VAR(appearanceban_runonce) //Updates legacy bans with new info +GLOBAL_LIST_EMPTY(appearance_keylist) //to store the keys /proc/appearance_fullban(mob/M, reason) if(!M || !M.key) return - appearance_keylist.Add(text("[M.ckey] ## [reason]")) + GLOB.appearance_keylist.Add(text("[M.ckey] ## [reason]")) appearance_savebanfile() /proc/appearance_client_fullban(ckey) if(!ckey) return - appearance_keylist.Add(text("[ckey]")) + GLOB.appearance_keylist.Add(text("[ckey]")) appearance_savebanfile() //returns a reason if M is banned, returns 0 otherwise /proc/appearance_isbanned(mob/M) if(M) - for(var/s in appearance_keylist) + for(var/s in GLOB.appearance_keylist) if(findtext(s, "[M.ckey]") == 1) var/startpos = findtext(s, "## ") + 3 if(startpos && startpos < length(s)) @@ -43,12 +43,12 @@ DEBUG /proc/appearance_loadbanfile() if(config.ban_legacy_system) var/savefile/S=new("data/appearance_full.ban") - S["keys[0]"] >> appearance_keylist + S["keys[0]"] >> GLOB.appearance_keylist log_admin("Loading appearance_rank") - S["runonce"] >> appearanceban_runonce + S["runonce"] >> GLOB.appearanceban_runonce - if(!length(appearance_keylist)) - appearance_keylist=list() + if(!length(GLOB.appearance_keylist)) + GLOB.appearance_keylist=list() log_admin("appearance_keylist was empty") else if(!establish_db_connection()) @@ -58,17 +58,17 @@ DEBUG return //appearance bans - var/DBQuery/query = dbcon.NewQuery("SELECT ckey FROM [format_table_name("ban")] WHERE bantype = 'APPEARANCE_BAN' AND NOT unbanned = 1") + var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("ban")] WHERE bantype = 'APPEARANCE_BAN' AND NOT unbanned = 1") query.Execute() while(query.NextRow()) var/ckey = query.item[1] - appearance_keylist.Add("[ckey]") + GLOB.appearance_keylist.Add("[ckey]") /proc/appearance_savebanfile() var/savefile/S=new("data/appearance_full.ban") - to_chat(S["keys[0]"], appearance_keylist) + to_chat(S["keys[0]"], GLOB.appearance_keylist) /proc/appearance_unban(mob/M) appearance_remove("[M.ckey]") @@ -76,18 +76,18 @@ DEBUG /proc/appearance_updatelegacybans() - if(!appearanceban_runonce) + if(!GLOB.appearanceban_runonce) log_admin("Updating appearancefile!") // Updates bans.. Or fixes them. Either way. - for(var/T in appearance_keylist) + for(var/T in GLOB.appearance_keylist) if(!T) continue - appearanceban_runonce++ //don't run this update again + GLOB.appearanceban_runonce++ //don't run this update again /proc/appearance_remove(X) - for(var/i = 1; i <= length(appearance_keylist); i++) - if( findtext(appearance_keylist[i], "[X]") ) - appearance_keylist.Remove(appearance_keylist[i]) + for(var/i = 1; i <= length(GLOB.appearance_keylist); i++) + if( findtext(GLOB.appearance_keylist[i], "[X]") ) + GLOB.appearance_keylist.Remove(GLOB.appearance_keylist[i]) appearance_savebanfile() return 1 return 0 diff --git a/code/modules/admin/banjob.dm b/code/modules/admin/banjob.dm index 81060503f06..9efc4c9ce88 100644 --- a/code/modules/admin/banjob.dm +++ b/code/modules/admin/banjob.dm @@ -1,21 +1,21 @@ -var/jobban_runonce // Updates legacy bans with new info -var/jobban_keylist[0] // Linear list of jobban strings, kept around for the legacy system -var/jobban_assoclist[0] // Associative list, for efficiency +GLOBAL_VAR(jobban_runonce) // Updates legacy bans with new info +GLOBAL_LIST_INIT(jobban_keylist, new()) // Linear list of jobban strings, kept around for the legacy system +GLOBAL_LIST_INIT(jobban_assoclist, new()) // Associative list, for efficiency // Matches string-based jobbans into ckey, rank, and reason groups -var/regex/jobban_regex = regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## (.+))?") +GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## (.+))?")) /proc/jobban_assoc_insert(ckey, rank, reason) if(!ckey || !rank) return - if(!jobban_assoclist[ckey]) - jobban_assoclist[ckey] = list() - jobban_assoclist[ckey][rank] = reason || "Reason Unspecified" + if(!GLOB.jobban_assoclist[ckey]) + GLOB.jobban_assoclist[ckey] = list() + GLOB.jobban_assoclist[ckey][rank] = reason || "Reason Unspecified" /proc/jobban_fullban(mob/M, rank, reason) if(!M || !M.key) return - jobban_keylist.Add(text("[M.ckey] - [rank] ## [reason]")) + GLOB.jobban_keylist.Add(text("[M.ckey] - [rank] ## [reason]")) jobban_assoc_insert(M.ckey, rank, reason) if(config.ban_legacy_system) jobban_savebanfile() @@ -23,7 +23,7 @@ var/regex/jobban_regex = regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## (.+))?") /proc/jobban_client_fullban(ckey, rank) if(!ckey || !rank) return - jobban_keylist.Add(text("[ckey] - [rank]")) + GLOB.jobban_keylist.Add(text("[ckey] - [rank]")) jobban_assoc_insert(ckey, rank) if(config.ban_legacy_system) jobban_savebanfile() @@ -37,8 +37,8 @@ var/regex/jobban_regex = regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## (.+))?") if(IsGuestKey(M.key)) return "Guest Job-ban" - if(jobban_assoclist[M.ckey]) - return jobban_assoclist[M.ckey][rank] + if(GLOB.jobban_assoclist[M.ckey]) + return GLOB.jobban_assoclist[M.ckey][rank] else return 0 @@ -63,17 +63,17 @@ DEBUG /proc/jobban_loadbanfile() if(config.ban_legacy_system) var/savefile/S=new("data/job_full.ban") - S["keys[0]"] >> jobban_keylist + S["keys[0]"] >> GLOB.jobban_keylist log_admin("Loading jobban_rank") - S["runonce"] >> jobban_runonce + S["runonce"] >> GLOB.jobban_runonce - if(!length(jobban_keylist)) - jobban_keylist=list() + if(!length(GLOB.jobban_keylist)) + GLOB.jobban_keylist=list() log_admin("jobban_keylist was empty") - for(var/s in jobban_keylist) - if(jobban_regex.Find(s)) - jobban_assoc_insert(jobban_regex.group[1], jobban_regex.group[2], jobban_regex.group[3]) + for(var/s in GLOB.jobban_keylist) + if(GLOB.jobban_regex.Find(s)) + jobban_assoc_insert(GLOB.jobban_regex.group[1], GLOB.jobban_regex.group[2], GLOB.jobban_regex.group[3]) else log_runtime(EXCEPTION("Skipping malformed job ban: [s]")) else @@ -84,10 +84,10 @@ DEBUG return //Job permabans - var/DBQuery/permabans = dbcon.NewQuery("SELECT ckey, job FROM [format_table_name("ban")] WHERE bantype = 'JOB_PERMABAN' AND isnull(unbanned)") + var/DBQuery/permabans = GLOB.dbcon.NewQuery("SELECT ckey, job FROM [format_table_name("ban")] WHERE bantype = 'JOB_PERMABAN' AND isnull(unbanned)") permabans.Execute() // Job tempbans - var/DBQuery/tempbans = dbcon.NewQuery("SELECT ckey, job FROM [format_table_name("ban")] WHERE bantype = 'JOB_TEMPBAN' AND isnull(unbanned) AND expiration_time > Now()") + var/DBQuery/tempbans = GLOB.dbcon.NewQuery("SELECT ckey, job FROM [format_table_name("ban")] WHERE bantype = 'JOB_TEMPBAN' AND isnull(unbanned) AND expiration_time > Now()") tempbans.Execute() while(TRUE) @@ -102,12 +102,12 @@ DEBUG else break - jobban_keylist.Add("[ckey] - [job]") + GLOB.jobban_keylist.Add("[ckey] - [job]") jobban_assoc_insert(ckey, job) /proc/jobban_savebanfile() var/savefile/S=new("data/job_full.ban") - S["keys[0]"] << jobban_keylist + S["keys[0]"] << GLOB.jobban_keylist /proc/jobban_unban(mob/M, rank) jobban_remove("[M.ckey] - [rank]") @@ -120,19 +120,19 @@ DEBUG /proc/jobban_remove(X) - for(var/i = 1; i <= length(jobban_keylist); i++) - if( findtext(jobban_keylist[i], "[X]") ) + for(var/i = 1; i <= length(GLOB.jobban_keylist); i++) + if( findtext(GLOB.jobban_keylist[i], "[X]") ) // This need to be here, instead of jobban_unban, due to direct calls to jobban_remove - if(jobban_regex.Find(X)) - var/ckey = jobban_regex.group[1] - var/rank = jobban_regex.group[2] - if(jobban_assoclist[ckey] && jobban_assoclist[ckey][rank]) - jobban_assoclist[ckey] -= rank + if(GLOB.jobban_regex.Find(X)) + var/ckey = GLOB.jobban_regex.group[1] + var/rank = GLOB.jobban_regex.group[2] + if(GLOB.jobban_assoclist[ckey] && GLOB.jobban_assoclist[ckey][rank]) + GLOB.jobban_assoclist[ckey] -= rank else log_runtime(EXCEPTION("Attempted to remove non-existent job ban: [X]")) else log_runtime(EXCEPTION("Failed to remove malformed job ban from associative list: [X]")) - jobban_keylist.Remove(jobban_keylist[i]) + GLOB.jobban_keylist.Remove(GLOB.jobban_keylist[i]) if(config.ban_legacy_system) jobban_savebanfile() return 1 @@ -152,7 +152,7 @@ DEBUG else //using the SQL ban system var/is_actually_banned = FALSE - var/DBQuery/select_query = dbcon.NewQuery("SELECT bantime, bantype, reason, job, duration, expiration_time, a_ckey FROM [format_table_name("ban")] WHERE ckey like '[ckey]' AND ((bantype like 'JOB_TEMPBAN' AND expiration_time > Now()) OR (bantype like 'JOB_PERMABAN')) AND isnull(unbanned) ORDER BY bantime DESC LIMIT 100") + var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT bantime, bantype, reason, job, duration, expiration_time, a_ckey FROM [format_table_name("ban")] WHERE ckey like '[ckey]' AND ((bantype like 'JOB_TEMPBAN' AND expiration_time > Now()) OR (bantype like 'JOB_PERMABAN')) AND isnull(unbanned) ORDER BY bantime DESC LIMIT 100") select_query.Execute() while(select_query.NextRow()) diff --git a/code/modules/admin/create_mob.dm b/code/modules/admin/create_mob.dm index e6148c7f554..616d5aa9ee8 100644 --- a/code/modules/admin/create_mob.dm +++ b/code/modules/admin/create_mob.dm @@ -1,9 +1,9 @@ -/var/create_mob_html = null +GLOBAL_VAR(create_mob_html) /datum/admins/proc/create_mob(var/mob/user) - if(!create_mob_html) + if(!GLOB.create_mob_html) var/mobjs = null mobjs = jointext(typesof(/mob), ";") - create_mob_html = file2text('html/create_object.html') - create_mob_html = replacetext(create_mob_html, "null /* object types */", "\"[mobjs]\"") + GLOB.create_mob_html = file2text('html/create_object.html') + GLOB.create_mob_html = replacetext(GLOB.create_mob_html, "null /* object types */", "\"[mobjs]\"") - user << browse(replacetext(create_mob_html, "/* ref src */", UID()), "window=create_mob;size=425x475") + user << browse(replacetext(GLOB.create_mob_html, "/* ref src */", UID()), "window=create_mob;size=425x475") diff --git a/code/modules/admin/create_object.dm b/code/modules/admin/create_object.dm index e3a930058bd..c311be0d017 100644 --- a/code/modules/admin/create_object.dm +++ b/code/modules/admin/create_object.dm @@ -1,23 +1,23 @@ -var/create_object_html = null -var/list/create_object_forms = list(/obj, /obj/structure, /obj/machinery, /obj/effect, /obj/item, /obj/mecha, /obj/item/clothing, /obj/item/stack, /obj/item/reagent_containers, /obj/item/gun) +GLOBAL_VAR(create_object_html) +GLOBAL_LIST_INIT(create_object_forms, list(/obj, /obj/structure, /obj/machinery, /obj/effect, /obj/item, /obj/mecha, /obj/item/clothing, /obj/item/stack, /obj/item/reagent_containers, /obj/item/gun)) /datum/admins/proc/create_object(var/mob/user) - if(!create_object_html) + if(!GLOB.create_object_html) var/objectjs = null objectjs = jointext(typesof(/obj), ";") - create_object_html = file2text('html/create_object.html') - create_object_html = replacetext(create_object_html, "null /* object types */", "\"[objectjs]\"") + GLOB.create_object_html = file2text('html/create_object.html') + GLOB.create_object_html = replacetext(GLOB.create_object_html, "null /* object types */", "\"[objectjs]\"") - user << browse(replacetext(create_object_html, "/* ref src */", UID()), "window=create_object;size=425x475") + user << browse(replacetext(GLOB.create_object_html, "/* ref src */", UID()), "window=create_object;size=425x475") /datum/admins/proc/quick_create_object(var/mob/user) - var/path = input("Select the path of the object you wish to create.", "Path", /obj) in create_object_forms - var/html_form = create_object_forms[path] + var/path = input("Select the path of the object you wish to create.", "Path", /obj) in GLOB.create_object_forms + var/html_form = GLOB.create_object_forms[path] if(!html_form) var/objectjs = jointext(typesof(path), ";") html_form = file2text('html/create_object.html') html_form = replacetext(html_form, "null /* object types */", "\"[objectjs]\"") - create_object_forms[path] = html_form + GLOB.create_object_forms[path] = html_form user << browse(replacetext(html_form, "/* ref src */", UID()), "window=qco[path];size=425x475") diff --git a/code/modules/admin/create_poll.dm b/code/modules/admin/create_poll.dm index a1c6de98d93..63592663469 100644 --- a/code/modules/admin/create_poll.dm +++ b/code/modules/admin/create_poll.dm @@ -1,15 +1,15 @@ /client/proc/create_poll() set name = "Create Server Poll" set category = "Server" - if(!check_rights(R_SERVER)) + if(!check_rights(R_SERVER)) return - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) to_chat(src, "Failed to establish database connection.") return create_poll_window() /client/proc/create_poll_window(var/errormessage = "") - if(!check_rights(R_SERVER)) + if(!check_rights(R_SERVER)) return var/output={" @@ -75,7 +75,7 @@ function onload() {
"} - for(var/adm_ckey in admin_datums) - var/datum/admins/D = admin_datums[adm_ckey] + for(var/adm_ckey in GLOB.admin_datums) + var/datum/admins/D = GLOB.admin_datums[adm_ckey] if(!D) continue var/rank = D.rank ? D.rank : "*none*" var/rights = rights2text(D.rights," ") @@ -62,7 +62,7 @@ establish_db_connection() - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) to_chat(usr, "Failed to establish database connection") return @@ -77,7 +77,7 @@ if(!istext(adm_ckey) || !istext(new_rank)) return - var/DBQuery/select_query = dbcon.NewQuery("SELECT id FROM [format_table_name("admin")] WHERE ckey = '[adm_ckey]'") + var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("admin")] WHERE ckey = '[adm_ckey]'") select_query.Execute() var/new_admin = 1 @@ -88,16 +88,16 @@ flag_account_for_forum_sync(adm_ckey) if(new_admin) - var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO [format_table_name("admin")] (`id`, `ckey`, `rank`, `level`, `flags`) VALUES (null, '[adm_ckey]', '[new_rank]', -1, 0)") + var/DBQuery/insert_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("admin")] (`id`, `ckey`, `rank`, `level`, `flags`) VALUES (null, '[adm_ckey]', '[new_rank]', -1, 0)") insert_query.Execute() - var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Added new admin [adm_ckey] to rank [new_rank]');") + var/DBQuery/log_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Added new admin [adm_ckey] to rank [new_rank]');") log_query.Execute() to_chat(usr, "New admin added.") else if(!isnull(admin_id) && isnum(admin_id)) - var/DBQuery/insert_query = dbcon.NewQuery("UPDATE [format_table_name("admin")] SET rank = '[new_rank]' WHERE id = [admin_id]") + var/DBQuery/insert_query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("admin")] SET rank = '[new_rank]' WHERE id = [admin_id]") insert_query.Execute() - var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Edited the rank of [adm_ckey] to [new_rank]');") + var/DBQuery/log_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Edited the rank of [adm_ckey] to [new_rank]');") log_query.Execute() to_chat(usr, "Admin rank changed.") @@ -112,7 +112,7 @@ return establish_db_connection() - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) to_chat(usr, "Failed to establish database connection") return @@ -130,7 +130,7 @@ if(!istext(adm_ckey) || !isnum(new_permission)) return - var/DBQuery/select_query = dbcon.NewQuery("SELECT id, flags FROM [format_table_name("admin")] WHERE ckey = '[adm_ckey]'") + var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT id, flags FROM [format_table_name("admin")] WHERE ckey = '[adm_ckey]'") select_query.Execute() var/admin_id @@ -144,27 +144,27 @@ flag_account_for_forum_sync(adm_ckey) if(admin_rights & new_permission) //This admin already has this permission, so we are removing it. - var/DBQuery/insert_query = dbcon.NewQuery("UPDATE [format_table_name("admin")] SET flags = [admin_rights & ~new_permission] WHERE id = [admin_id]") + var/DBQuery/insert_query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("admin")] SET flags = [admin_rights & ~new_permission] WHERE id = [admin_id]") insert_query.Execute() - var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Removed permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]');") + var/DBQuery/log_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Removed permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]');") log_query.Execute() to_chat(usr, "Permission removed.") else //This admin doesn't have this permission, so we are adding it. - var/DBQuery/insert_query = dbcon.NewQuery("UPDATE [format_table_name("admin")] SET flags = '[admin_rights | new_permission]' WHERE id = [admin_id]") + var/DBQuery/insert_query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("admin")] SET flags = '[admin_rights | new_permission]' WHERE id = [admin_id]") insert_query.Execute() - var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Added permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]')") + var/DBQuery/log_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("admin_log")] (`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (Now() , '[usr.ckey]', '[usr.client.address]', 'Added permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]')") log_query.Execute() to_chat(usr, "Permission added.") /datum/admins/proc/updateranktodb(ckey,newrank) establish_db_connection() - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) return if(!check_rights(R_PERMISSIONS)) return var/sql_ckey = sanitizeSQL(ckey) var/sql_admin_rank = sanitizeSQL(newrank) - var/DBQuery/query_update = dbcon.NewQuery("UPDATE [format_table_name("player")] SET lastadminrank = '[sql_admin_rank]' WHERE ckey = '[sql_ckey]'") + var/DBQuery/query_update = GLOB.dbcon.NewQuery("UPDATE [format_table_name("player")] SET lastadminrank = '[sql_admin_rank]' WHERE ckey = '[sql_ckey]'") query_update.Execute() flag_account_for_forum_sync(sql_ckey) diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index 9ed6f0cd997..c4313354ff1 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -465,7 +465,7 @@ if(GAMEMODE_IS_BLOB) var/datum/game_mode/blob/mode = SSticker.mode dat += "
- +
@@ -99,7 +99,7 @@ function onload() { src << browse(output, "window=createplayerpoll;size=950x500") /client/proc/create_poll_function(href_list) - if(!check_rights(R_SERVER)) + if(!check_rights(R_SERVER)) return var/polltype = href_list["createpoll"] if(polltype != POLLTYPE_OPTION && polltype != POLLTYPE_TEXT && polltype != POLLTYPE_RATING && polltype != POLLTYPE_MULTI) @@ -122,15 +122,15 @@ function onload() { create_poll_window("Question cannot be blank.") return question = sanitizeSQL(question) - + var/starttime var/endtime - var/DBQuery/query = dbcon.NewQuery("SELECT Now() AS starttime, ADDDATE(Now(), INTERVAL [poll_len] DAY) AS endtime") + var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT Now() AS starttime, ADDDATE(Now(), INTERVAL [poll_len] DAY) AS endtime") query.Execute() while(query.NextRow()) starttime = query.item[1] endtime = query.item[2] - + var/pollquery = "INSERT INTO [format_table_name("poll_question")] (polltype, starttime, endtime, question, adminonly, multiplechoiceoptions, createdby_ckey, createdby_ip) VALUES ('[polltype]', '[starttime]', '[endtime]', '[question]', '[adminonly]', '[choice_amount]', '[sql_ckey]', '[address]')" var/idquery = "SELECT id FROM [format_table_name("poll_question")] WHERE question = '[question]' AND starttime = '[starttime]' AND endtime = '[endtime]' AND createdby_ckey = '[sql_ckey]' AND createdby_ip = '[address]'" var/list/option_queries = list() @@ -175,15 +175,15 @@ function onload() { if(descmax) descmax = sanitizeSQL(descmax) option_queries += "INSERT INTO [format_table_name("poll_option")] (pollid, text, percentagecalc, minval, maxval, descmin, descmid, descmax) VALUES ('{POLLID}', '[option]', '[percentagecalc]', '[minval]', '[maxval]', '[descmin]', '[descmid]', '[descmax]')" - - query = dbcon.NewQuery(pollquery) + + query = GLOB.dbcon.NewQuery(pollquery) if(!query.Execute()) var/err = query.ErrorMsg() create_poll_window("An SQL error has occured while creating your poll") log_game("SQL ERROR adding new poll question to table. Error : \[[err]\]\n") return var/pollid = 0 - query = dbcon.NewQuery(idquery) + query = GLOB.dbcon.NewQuery(idquery) if(!query.Execute()) var/err = query.ErrorMsg() create_poll_window("An SQL error has occured while creating your poll") @@ -192,7 +192,7 @@ function onload() { if(query.NextRow()) pollid = text2num(query.item[1]) for(var/querytext in option_queries) - query = dbcon.NewQuery(replacetext(idquery, "{POLLID}", pollid)) + query = GLOB.dbcon.NewQuery(replacetext(idquery, "{POLLID}", pollid)) if(!query.Execute()) var/err = query.ErrorMsg() create_poll_window("An SQL error has occured while creating your poll") diff --git a/code/modules/admin/create_turf.dm b/code/modules/admin/create_turf.dm index b895032d374..c65c7b22b1a 100644 --- a/code/modules/admin/create_turf.dm +++ b/code/modules/admin/create_turf.dm @@ -1,9 +1,9 @@ -/var/create_turf_html = null +GLOBAL_VAR(create_turf_html) /datum/admins/proc/create_turf(var/mob/user) - if(!create_turf_html) + if(!GLOB.create_turf_html) var/turfjs = null turfjs = jointext(typesof(/turf), ";") - create_turf_html = file2text('html/create_object.html') - create_turf_html = replacetext(create_turf_html, "null /* object types */", "\"[turfjs]\"") + GLOB.create_turf_html = file2text('html/create_object.html') + GLOB.create_turf_html = replacetext(GLOB.create_turf_html, "null /* object types */", "\"[turfjs]\"") - user << browse(replacetext(create_turf_html, "/* ref src */", UID()), "window=create_turf;size=425x475") + user << browse(replacetext(GLOB.create_turf_html, "/* ref src */", UID()), "window=create_turf;size=425x475") diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm index 33654c7e341..740d182f3f2 100644 --- a/code/modules/admin/holder2.dm +++ b/code/modules/admin/holder2.dm @@ -1,4 +1,5 @@ -var/list/admin_datums = list() +GLOBAL_LIST_EMPTY(admin_datums) +GLOBAL_PROTECT(admin_datums) // This is protected because we dont want people making their own admin ranks, for obvious reasons /datum/admins var/rank = "Temporary Admin" @@ -22,7 +23,7 @@ var/list/admin_datums = list() admincaster_signature = "Nanotrasen Officer #[rand(0,9)][rand(0,9)][rand(0,9)]" rank = initial_rank rights = initial_rights - admin_datums[ckey] = src + GLOB.admin_datums[ckey] = src /datum/admins/Destroy() ..() @@ -87,7 +88,7 @@ you will have to do something like if(client.holder.rights & R_ADMIN) yourself. return 0 /client/proc/deadmin() - admin_datums -= ckey + GLOB.admin_datums -= ckey if(holder) holder.disassociate() qdel(holder) diff --git a/code/modules/admin/ipintel.dm b/code/modules/admin/ipintel.dm index 8f9cba102fe..8bfce6c05f0 100644 --- a/code/modules/admin/ipintel.dm +++ b/code/modules/admin/ipintel.dm @@ -34,9 +34,9 @@ cachedintel.cache = TRUE return cachedintel - if(dbcon.IsConnected()) + if(GLOB.dbcon.IsConnected()) var/rating_bad = config.ipintel_rating_bad - var/DBQuery/query_get_ip_intel = dbcon.NewQuery({" + var/DBQuery/query_get_ip_intel = GLOB.dbcon.NewQuery({" SELECT date, intel, TIMESTAMPDIFF(MINUTE,date,NOW()) FROM [format_table_name("ipintel")] WHERE @@ -67,8 +67,8 @@ res.intel = ip_intel_query(ip) if(updatecache && res.intel >= 0) SSipintel.cache[ip] = res - if(dbcon.IsConnected()) - var/DBQuery/query_add_ip_intel = dbcon.NewQuery("INSERT INTO [format_table_name("ipintel")] (ip, intel) VALUES (INET_ATON('[ip]'), [res.intel]) ON DUPLICATE KEY UPDATE intel = VALUES(intel), date = NOW()") + if(GLOB.dbcon.IsConnected()) + var/DBQuery/query_add_ip_intel = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("ipintel")] (ip, intel) VALUES (INET_ATON('[ip]'), [res.intel]) ON DUPLICATE KEY UPDATE intel = VALUES(intel), date = NOW()") query_add_ip_intel.Execute() qdel(query_add_ip_intel) @@ -139,7 +139,7 @@ return FALSE if(!config.ipintel_whitelist) return FALSE - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) return FALSE if(!ipintel_badip_check(t_ip)) return FALSE @@ -160,7 +160,7 @@ rating_bad = sanitizeSQL(rating_bad) valid_hours = sanitizeSQL(valid_hours) var/check_sql = {"SELECT * FROM [format_table_name("ipintel")] WHERE ip = INET_ATON('[target_ip]') AND intel >= [rating_bad] AND (date + INTERVAL [valid_hours] HOUR) > NOW()"} - var/DBQuery/query_get_ip_intel = dbcon.NewQuery(check_sql) + var/DBQuery/query_get_ip_intel = GLOB.dbcon.NewQuery(check_sql) if(!query_get_ip_intel.Execute()) log_debug("ipintel_badip_check reports failed query execution") qdel(query_get_ip_intel) @@ -175,7 +175,7 @@ if(!config.ipintel_whitelist) return FALSE var/target_sql_ckey = ckey(target_ckey) - var/DBQuery/query_whitelist_check = dbcon.NewQuery("SELECT * FROM [format_table_name("vpn_whitelist")] WHERE ckey = '[target_sql_ckey]'") + var/DBQuery/query_whitelist_check = GLOB.dbcon.NewQuery("SELECT * FROM [format_table_name("vpn_whitelist")] WHERE ckey = '[target_sql_ckey]'") if(!query_whitelist_check.Execute()) var/err = query_whitelist_check.ErrorMsg() log_debug("SQL ERROR on proc/vpn_whitelist_check for ckey '[target_sql_ckey]'. Error : \[[err]\]\n") @@ -190,7 +190,7 @@ if(!reason_string) return FALSE reason_string = sanitizeSQL(reason_string) - var/DBQuery/query_whitelist_add = dbcon.NewQuery("INSERT INTO [format_table_name("vpn_whitelist")] (ckey,reason) VALUES ('[target_sql_ckey]','[reason_string]')") + var/DBQuery/query_whitelist_add = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("vpn_whitelist")] (ckey,reason) VALUES ('[target_sql_ckey]','[reason_string]')") if(!query_whitelist_add.Execute()) var/err = query_whitelist_add.ErrorMsg() log_debug("SQL ERROR on proc/vpn_whitelist_add for ckey '[target_sql_ckey]'. Error : \[[err]\]\n") @@ -199,7 +199,7 @@ /proc/vpn_whitelist_remove(target_ckey) var/target_sql_ckey = ckey(target_ckey) - var/DBQuery/query_whitelist_remove = dbcon.NewQuery("DELETE FROM [format_table_name("vpn_whitelist")] WHERE ckey = '[target_sql_ckey]'") + var/DBQuery/query_whitelist_remove = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("vpn_whitelist")] WHERE ckey = '[target_sql_ckey]'") if(!query_whitelist_remove.Execute()) var/err = query_whitelist_remove.ErrorMsg() log_debug("SQL ERROR on proc/vpn_whitelist_remove for ckey '[target_sql_ckey]'. Error : \[[err]\]\n") diff --git a/code/modules/admin/permissionverbs/permissionedit.dm b/code/modules/admin/permissionverbs/permissionedit.dm index 5a3f38afc86..795538c7c33 100644 --- a/code/modules/admin/permissionverbs/permissionedit.dm +++ b/code/modules/admin/permissionverbs/permissionedit.dm @@ -25,8 +25,8 @@
" - dat += "" + dat += "" for(var/datum/mind/blob in mode.infected_crew) var/mob/M = blob.current @@ -475,7 +475,7 @@ else dat += "" dat += "
Blob
Progress: [blobs.len]/[mode.blobwincount]
Progress: [GLOB.blobs.len]/[mode.blobwincount]
Blob not found!
" - + if(SSticker.mode.blob_overminds.len) dat += check_role_table("Blob Overminds", SSticker.mode.blob_overminds) @@ -541,9 +541,9 @@ if(SSticker.mode.eventmiscs.len) dat += check_role_table("Event Roles", SSticker.mode.eventmiscs) - if(ts_spiderlist.len) + if(GLOB.ts_spiderlist.len) var/list/spider_minds = list() - for(var/mob/living/simple_animal/hostile/poison/terror_spider/S in ts_spiderlist) + for(var/mob/living/simple_animal/hostile/poison/terror_spider/S in GLOB.ts_spiderlist) if(S.ckey) spider_minds += S.mind if(spider_minds.len) @@ -551,10 +551,10 @@ var/count_eggs = 0 var/count_spiderlings = 0 - for(var/obj/structure/spider/eggcluster/terror_eggcluster/E in ts_egg_list) + for(var/obj/structure/spider/eggcluster/terror_eggcluster/E in GLOB.ts_egg_list) if(is_station_level(E.z)) count_eggs += E.spiderling_number - for(var/obj/structure/spider/spiderling/terror_spiderling/L in ts_spiderling_list) + for(var/obj/structure/spider/spiderling/terror_spiderling/L in GLOB.ts_spiderling_list) if(!L.stillborn && is_station_level(L.z)) count_spiderlings += 1 dat += "
Growing TS on-station: [count_eggs] egg[count_eggs != 1 ? "s" : ""], [count_spiderlings] spiderling[count_spiderlings != 1 ? "s" : ""].
" diff --git a/code/modules/admin/secrets.dm b/code/modules/admin/secrets.dm index 4e2fe2d7ae2..e4c889ec309 100644 --- a/code/modules/admin/secrets.dm +++ b/code/modules/admin/secrets.dm @@ -27,8 +27,8 @@ Bombs
[check_rights(R_SERVER, 0) ? "  Toggle bomb cap
" : "
"] Lists
- Show last [length(lastsignalers)] signalers   - Show last [length(lawchanges)] law changes
+ Show last [length(GLOB.lastsignalers)] signalers   + Show last [length(GLOB.lawchanges)] law changes
List DNA (Blood)   List Fingerprints
Power
diff --git a/code/modules/admin/sql_notes.dm b/code/modules/admin/sql_notes.dm index a6ac31a4114..238c380f417 100644 --- a/code/modules/admin/sql_notes.dm +++ b/code/modules/admin/sql_notes.dm @@ -1,7 +1,7 @@ /proc/add_note(target_ckey, notetext, timestamp, adminckey, logged = 1, server, checkrights = 1) if(checkrights && !check_rights(R_ADMIN|R_MOD)) return - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) to_chat(usr, "Failed to establish database connection.") return @@ -13,7 +13,7 @@ else target_ckey = ckey(target_ckey) - var/DBQuery/query_find_ckey = dbcon.NewQuery("SELECT ckey, exp FROM [format_table_name("player")] WHERE ckey = '[target_ckey]'") + var/DBQuery/query_find_ckey = GLOB.dbcon.NewQuery("SELECT ckey, exp FROM [format_table_name("player")] WHERE ckey = '[target_ckey]'") if(!query_find_ckey.Execute()) var/err = query_find_ckey.ErrorMsg() log_game("SQL ERROR obtaining ckey from player table. Error : \[[err]\]\n") @@ -46,7 +46,7 @@ if(config && config.server_name) server = config.server_name server = sanitizeSQL(server) - var/DBQuery/query_noteadd = dbcon.NewQuery("INSERT INTO [format_table_name("notes")] (ckey, timestamp, notetext, adminckey, server, crew_playtime) VALUES ('[target_ckey]', '[timestamp]', '[notetext]', '[admin_sql_ckey]', '[server]', '[crew_number]')") + var/DBQuery/query_noteadd = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("notes")] (ckey, timestamp, notetext, adminckey, server, crew_playtime) VALUES ('[target_ckey]', '[timestamp]', '[notetext]', '[admin_sql_ckey]', '[server]', '[crew_number]')") if(!query_noteadd.Execute()) var/err = query_noteadd.ErrorMsg() log_game("SQL ERROR adding new note to table. Error : \[[err]\]\n") @@ -62,13 +62,13 @@ var/ckey var/notetext var/adminckey - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) to_chat(usr, "Failed to establish database connection.") return if(!note_id) return note_id = text2num(note_id) - var/DBQuery/query_find_note_del = dbcon.NewQuery("SELECT ckey, notetext, adminckey FROM [format_table_name("notes")] WHERE id = [note_id]") + var/DBQuery/query_find_note_del = GLOB.dbcon.NewQuery("SELECT ckey, notetext, adminckey FROM [format_table_name("notes")] WHERE id = [note_id]") if(!query_find_note_del.Execute()) var/err = query_find_note_del.ErrorMsg() log_game("SQL ERROR obtaining ckey, notetext, adminckey from player table. Error : \[[err]\]\n") @@ -77,7 +77,7 @@ ckey = query_find_note_del.item[1] notetext = query_find_note_del.item[2] adminckey = query_find_note_del.item[3] - var/DBQuery/query_del_note = dbcon.NewQuery("DELETE FROM [format_table_name("notes")] WHERE id = [note_id]") + var/DBQuery/query_del_note = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("notes")] WHERE id = [note_id]") if(!query_del_note.Execute()) var/err = query_del_note.ErrorMsg() log_game("SQL ERROR removing note from table. Error : \[[err]\]\n") @@ -89,7 +89,7 @@ /proc/edit_note(note_id) if(!check_rights(R_ADMIN|R_MOD)) return - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) to_chat(usr, "Failed to establish database connection.") return if(!note_id) @@ -97,7 +97,7 @@ note_id = text2num(note_id) var/target_ckey var/sql_ckey = usr.ckey - var/DBQuery/query_find_note_edit = dbcon.NewQuery("SELECT ckey, notetext, adminckey FROM [format_table_name("notes")] WHERE id = [note_id]") + var/DBQuery/query_find_note_edit = GLOB.dbcon.NewQuery("SELECT ckey, notetext, adminckey FROM [format_table_name("notes")] WHERE id = [note_id]") if(!query_find_note_edit.Execute()) var/err = query_find_note_edit.ErrorMsg() log_game("SQL ERROR obtaining notetext from notes table. Error : \[[err]\]\n") @@ -112,7 +112,7 @@ new_note = sanitizeSQL(new_note) var/edit_text = "Edited by [sql_ckey] on [SQLtime()] from \"[old_note]\" to \"[new_note]\"
" edit_text = sanitizeSQL(edit_text) - var/DBQuery/query_update_note = dbcon.NewQuery("UPDATE [format_table_name("notes")] SET notetext = '[new_note]', last_editor = '[sql_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE id = [note_id]") + var/DBQuery/query_update_note = GLOB.dbcon.NewQuery("UPDATE [format_table_name("notes")] SET notetext = '[new_note]', last_editor = '[sql_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE id = [note_id]") if(!query_update_note.Execute()) var/err = query_update_note.ErrorMsg() log_game("SQL ERROR editing note. Error : \[[err]\]\n") @@ -139,7 +139,7 @@ output = navbar if(target_ckey) var/target_sql_ckey = ckey(target_ckey) - var/DBQuery/query_get_notes = dbcon.NewQuery("SELECT id, timestamp, notetext, adminckey, last_editor, server, crew_playtime FROM [format_table_name("notes")] WHERE ckey = '[target_sql_ckey]' ORDER BY timestamp") + var/DBQuery/query_get_notes = GLOB.dbcon.NewQuery("SELECT id, timestamp, notetext, adminckey, last_editor, server, crew_playtime FROM [format_table_name("notes")] WHERE ckey = '[target_sql_ckey]' ORDER BY timestamp") if(!query_get_notes.Execute()) var/err = query_get_notes.ErrorMsg() log_game("SQL ERROR obtaining ckey, notetext, adminckey, last_editor, server, crew_playtime from notes table. Error : \[[err]\]\n") @@ -181,7 +181,7 @@ search = "^\[^\[:alpha:\]\]" else search = "^[index]" - var/DBQuery/query_list_notes = dbcon.NewQuery("SELECT DISTINCT ckey FROM [format_table_name("notes")] WHERE ckey REGEXP '[search]' ORDER BY ckey") + var/DBQuery/query_list_notes = GLOB.dbcon.NewQuery("SELECT DISTINCT ckey FROM [format_table_name("notes")] WHERE ckey REGEXP '[search]' ORDER BY ckey") if(!query_list_notes.Execute()) var/err = query_list_notes.ErrorMsg() log_game("SQL ERROR obtaining ckey from notes table. Error : \[[err]\]\n") @@ -196,7 +196,7 @@ /proc/show_player_info_irc(var/key as text) var/target_sql_ckey = ckey(key) - var/DBQuery/query_get_notes = dbcon.NewQuery("SELECT timestamp, notetext, adminckey, server, crew_playtime FROM [format_table_name("notes")] WHERE ckey = '[target_sql_ckey]' ORDER BY timestamp") + var/DBQuery/query_get_notes = GLOB.dbcon.NewQuery("SELECT timestamp, notetext, adminckey, server, crew_playtime FROM [format_table_name("notes")] WHERE ckey = '[target_sql_ckey]' ORDER BY timestamp") if(!query_get_notes.Execute()) var/err = query_get_notes.ErrorMsg() log_game("SQL ERROR obtaining timestamp, notetext, adminckey, server, crew_playtime from notes table. Error : \[[err]\]\n") diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 60156930408..07dbffe827c 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -183,7 +183,7 @@ if(task == "add") var/new_ckey = ckey(clean_input("New admin's ckey","Admin ckey", null)) if(!new_ckey) return - if(new_ckey in admin_datums) + if(new_ckey in GLOB.admin_datums) to_chat(usr, "Error: Topic 'editrights': [new_ckey] is already an admin") return adm_ckey = new_ckey @@ -194,12 +194,12 @@ to_chat(usr, "Error: Topic 'editrights': No valid ckey") return - var/datum/admins/D = admin_datums[adm_ckey] + var/datum/admins/D = GLOB.admin_datums[adm_ckey] if(task == "remove") if(alert("Are you sure you want to remove [adm_ckey]?","Message","Yes","Cancel") == "Yes") if(!D) return - admin_datums -= adm_ckey + GLOB.admin_datums -= adm_ckey D.disassociate() updateranktodb(adm_ckey, "player") @@ -209,8 +209,8 @@ else if(task == "rank") var/new_rank - if(admin_ranks.len) - new_rank = input("Please select a rank", "New rank", null, null) as null|anything in (admin_ranks|"*New Rank*") + if(GLOB.admin_ranks.len) + new_rank = input("Please select a rank", "New rank", null, null) as null|anything in (GLOB.admin_ranks|"*New Rank*") else new_rank = input("Please select a rank", "New rank", null, null) as null|anything in list("Mentor", "Trial Admin", "Game Admin", "*New Rank*") @@ -227,15 +227,15 @@ to_chat(usr, "Error: Topic 'editrights': Invalid rank") return if(config.admin_legacy_system) - if(admin_ranks.len) - if(new_rank in admin_ranks) - rights = admin_ranks[new_rank] //we typed a rank which already exists, use its rights + if(GLOB.admin_ranks.len) + if(new_rank in GLOB.admin_ranks) + rights = GLOB.admin_ranks[new_rank] //we typed a rank which already exists, use its rights else - admin_ranks[new_rank] = 0 //add the new rank to admin_ranks + GLOB.admin_ranks[new_rank] = 0 //add the new rank to admin_ranks else if(config.admin_legacy_system) new_rank = ckeyEx(new_rank) - rights = admin_ranks[new_rank] //we input an existing rank, use its rights + rights = GLOB.admin_ranks[new_rank] //we input an existing rank, use its rights if(D) D.disassociate() //remove adminverbs and unlink from client @@ -308,7 +308,7 @@ var/timer = input("Enter new shuttle duration (seconds):","Edit Shuttle Timeleft", SSshuttle.emergency.timeLeft() ) as num SSshuttle.emergency.setTimer(timer*10) log_admin("[key_name(usr)] edited the Emergency Shuttle's timeleft to [timer] seconds") - minor_announcement.Announce("The emergency shuttle will reach its destination in [round(SSshuttle.emergency.timeLeft(600))] minutes.") + GLOB.minor_announcement.Announce("The emergency shuttle will reach its destination in [round(SSshuttle.emergency.timeLeft(600))] minutes.") message_admins("[key_name_admin(usr)] edited the Emergency Shuttle's timeleft to [timer] seconds") href_list["secrets"] = "check_antagonist" @@ -369,8 +369,8 @@ if(!check_rights(R_BAN)) return var/banfolder = href_list["unbanf"] - Banlist.cd = "/base/[banfolder]" - var/key = Banlist["key"] + GLOB.banlist_savefile.cd = "/base/[banfolder]" + var/key = GLOB.banlist_savefile["key"] if(alert(usr, "Are you sure you want to unban [key]?", "Confirmation", "Yes", "No") == "Yes") if(RemoveBan(banfolder)) unbanpanel() @@ -388,14 +388,14 @@ var/reason var/banfolder = href_list["unbane"] - Banlist.cd = "/base/[banfolder]" - var/reason2 = Banlist["reason"] - var/temp = Banlist["temp"] + GLOB.banlist_savefile.cd = "/base/[banfolder]" + var/reason2 = GLOB.banlist_savefile["reason"] + var/temp = GLOB.banlist_savefile["temp"] - var/minutes = Banlist["minutes"] + var/minutes = GLOB.banlist_savefile["minutes"] - var/banned_key = Banlist["key"] - Banlist.cd = "/base" + var/banned_key = GLOB.banlist_savefile["key"] + GLOB.banlist_savefile.cd = "/base" var/duration @@ -403,12 +403,12 @@ if("Yes") temp = 1 var/mins = 0 - if(minutes > CMinutes) - mins = minutes - CMinutes + if(minutes > GLOB.CMinutes) + mins = minutes - GLOB.CMinutes mins = input(usr,"How long (in minutes)? (Default: 1440)","Ban time",mins ? mins : 1440) as num|null if(!mins) return mins = min(525599,mins) - minutes = CMinutes + mins + minutes = GLOB.CMinutes + mins duration = GetExp(minutes) reason = input(usr,"Please state the reason","Reason",reason2) as message|null if(!reason) return @@ -421,12 +421,12 @@ log_admin("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]") ban_unban_log_save("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]") message_admins("[key_name_admin(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]", 1) - Banlist.cd = "/base/[banfolder]" - to_chat(Banlist["reason"], reason) - to_chat(Banlist["temp"], temp) - to_chat(Banlist["minutes"], minutes) - to_chat(Banlist["bannedby"], usr.ckey) - Banlist.cd = "/base" + GLOB.banlist_savefile.cd = "/base/[banfolder]" + to_chat(GLOB.banlist_savefile["reason"], reason) + to_chat(GLOB.banlist_savefile["temp"], temp) + to_chat(GLOB.banlist_savefile["minutes"], minutes) + to_chat(GLOB.banlist_savefile["bannedby"], usr.ckey) + GLOB.banlist_savefile.cd = "/base" feedback_inc("ban_edit",1) unbanpanel() @@ -512,8 +512,8 @@ //Regular jobs //Command (Blue) jobs += "" - jobs += "" - for(var/jobPos in command_positions) + jobs += "" + for(var/jobPos in GLOB.command_positions) if(!jobPos) continue var/datum/job/job = SSjobs.GetJob(jobPos) if(!job) continue @@ -533,8 +533,8 @@ //Security (Red) counter = 0 jobs += "
Command Positions
Command Positions
" - jobs += "" - for(var/jobPos in security_positions) + jobs += "" + for(var/jobPos in GLOB.security_positions) if(!jobPos) continue var/datum/job/job = SSjobs.GetJob(jobPos) if(!job) continue @@ -554,8 +554,8 @@ //Engineering (Yellow) counter = 0 jobs += "
Security Positions
Security Positions
" - jobs += "" - for(var/jobPos in engineering_positions) + jobs += "" + for(var/jobPos in GLOB.engineering_positions) if(!jobPos) continue var/datum/job/job = SSjobs.GetJob(jobPos) if(!job) continue @@ -575,8 +575,8 @@ //Medical (White) counter = 0 jobs += "
Engineering Positions
Engineering Positions
" - jobs += "" - for(var/jobPos in medical_positions) + jobs += "" + for(var/jobPos in GLOB.medical_positions) if(!jobPos) continue var/datum/job/job = SSjobs.GetJob(jobPos) if(!job) continue @@ -596,8 +596,8 @@ //Science (Purple) counter = 0 jobs += "
Medical Positions
Medical Positions
" - jobs += "" - for(var/jobPos in science_positions) + jobs += "" + for(var/jobPos in GLOB.science_positions) if(!jobPos) continue var/datum/job/job = SSjobs.GetJob(jobPos) if(!job) continue @@ -617,8 +617,8 @@ //Support (Grey) counter = 0 jobs += "
Science Positions
Science Positions
" - jobs += "" - for(var/jobPos in support_positions) + jobs += "" + for(var/jobPos in GLOB.support_positions) if(!jobPos) continue var/datum/job/job = SSjobs.GetJob(jobPos) if(!job) continue @@ -638,8 +638,8 @@ //Non-Human (Green) counter = 0 jobs += "
Support Positions
Support Positions
" - jobs += "" - for(var/jobPos in nonhuman_positions) + jobs += "" + for(var/jobPos in GLOB.nonhuman_positions) if(!jobPos) continue var/datum/job/job = SSjobs.GetJob(jobPos) if(!job) continue @@ -675,7 +675,7 @@ jobs += "" counter = 0 - for(var/role in antag_roles) + for(var/role in GLOB.antag_roles) if(jobban_isbanned(M, role) || isbanned_dept) jobs += "" else @@ -692,7 +692,7 @@ jobs += "" counter = 0 - for(var/role in other_roles) + for(var/role in GLOB.other_roles) if(jobban_isbanned(M, role) || isbanned_dept) jobs += "" else @@ -707,8 +707,8 @@ //Whitelisted positions counter = 0 jobs += "
Non-human Positions
Non-human Positions
Antagonist Positions
[replacetext(role, " ", " ")]
Other
[replacetext(role, " ", " ")]
" - jobs += "" - for(var/jobPos in whitelisted_positions) + jobs += "" + for(var/jobPos in GLOB.whitelisted_positions) if(!jobPos) continue var/datum/job/job = SSjobs.GetJob(jobPos) if(!job) continue @@ -754,50 +754,50 @@ var/list/joblist = list() switch(href_list["jobban3"]) if("commanddept") - for(var/jobPos in command_positions) + for(var/jobPos in GLOB.command_positions) if(!jobPos) continue var/datum/job/temp = SSjobs.GetJob(jobPos) if(!temp) continue joblist += temp.title if("securitydept") - for(var/jobPos in security_positions) + for(var/jobPos in GLOB.security_positions) if(!jobPos) continue var/datum/job/temp = SSjobs.GetJob(jobPos) if(!temp) continue joblist += temp.title if("engineeringdept") - for(var/jobPos in engineering_positions) + for(var/jobPos in GLOB.engineering_positions) if(!jobPos) continue var/datum/job/temp = SSjobs.GetJob(jobPos) if(!temp) continue joblist += temp.title if("medicaldept") - for(var/jobPos in medical_positions) + for(var/jobPos in GLOB.medical_positions) if(!jobPos) continue var/datum/job/temp = SSjobs.GetJob(jobPos) if(!temp) continue joblist += temp.title if("sciencedept") - for(var/jobPos in science_positions) + for(var/jobPos in GLOB.science_positions) if(!jobPos) continue var/datum/job/temp = SSjobs.GetJob(jobPos) if(!temp) continue joblist += temp.title if("supportdept") - for(var/jobPos in support_positions) + for(var/jobPos in GLOB.support_positions) if(!jobPos) continue var/datum/job/temp = SSjobs.GetJob(jobPos) if(!temp) continue joblist += temp.title if("nonhumandept") joblist += "pAI" - for(var/jobPos in nonhuman_positions) + for(var/jobPos in GLOB.nonhuman_positions) if(!jobPos) continue var/datum/job/temp = SSjobs.GetJob(jobPos) if(!temp) continue joblist += temp.title if("whitelistdept") - for(var/jobPos in whitelisted_positions) + for(var/jobPos in GLOB.whitelisted_positions) if(!jobPos) continue var/datum/job/temp = SSjobs.GetJob(jobPos) if(!temp) continue @@ -953,7 +953,7 @@ else if(href_list["noteedits"]) var/note_id = sanitizeSQL("[href_list["noteedits"]]") - var/DBQuery/query_noteedits = dbcon.NewQuery("SELECT edits FROM [format_table_name("notes")] WHERE id = '[note_id]'") + var/DBQuery/query_noteedits = GLOB.dbcon.NewQuery("SELECT edits FROM [format_table_name("notes")] WHERE id = '[note_id]'") if(!query_noteedits.Execute()) var/err = query_noteedits.ErrorMsg() log_game("SQL ERROR obtaining edits from notes table. Error : \[[err]\]\n") @@ -1073,7 +1073,7 @@ else if(href_list["watcheditlog"]) var/target_ckey = sanitizeSQL("[href_list["watcheditlog"]]") - var/DBQuery/query_watchedits = dbcon.NewQuery("SELECT edits FROM [format_table_name("watch")] WHERE ckey = '[target_ckey]'") + var/DBQuery/query_watchedits = GLOB.dbcon.NewQuery("SELECT edits FROM [format_table_name("watch")] WHERE ckey = '[target_ckey]'") if(!query_watchedits.Execute()) var/err = query_watchedits.ErrorMsg() log_game("SQL ERROR obtaining edits from watch table. Error : \[[err]\]\n") @@ -1106,7 +1106,7 @@ dat += {"[config.mode_names[mode]]
"} dat += {"Secret
"} dat += {"Random
"} - dat += {"Now: [master_mode]"} + dat += {"Now: [GLOB.master_mode]"} usr << browse(dat, "window=c_mode") else if(href_list["f_secret"]) @@ -1114,13 +1114,13 @@ if(SSticker && SSticker.mode) return alert(usr, "The game has already started.", null, null, null, null) - if(master_mode != "secret") + if(GLOB.master_mode != "secret") return alert(usr, "The game mode has to be secret!", null, null, null, null) var/dat = {"What game mode do you want to force secret to be? Use this if you want to change the game mode, but want the players to believe it's secret. This will only work if the current game mode is secret.
"} for(var/mode in config.modes) dat += {"[config.mode_names[mode]]
"} dat += {"Random (default)
"} - dat += {"Now: [secret_force_mode]"} + dat += {"Now: [GLOB.secret_force_mode]"} usr << browse(dat, "window=f_secret") else if(href_list["c_mode2"]) @@ -1128,12 +1128,12 @@ if(SSticker && SSticker.mode) return alert(usr, "The game has already started.", null, null, null, null) - master_mode = href_list["c_mode2"] - log_admin("[key_name(usr)] set the mode as [master_mode].") - message_admins("[key_name_admin(usr)] set the mode as [master_mode].", 1) - to_chat(world, "The mode is now: [master_mode]") + GLOB.master_mode = href_list["c_mode2"] + log_admin("[key_name(usr)] set the mode as [GLOB.master_mode].") + message_admins("[key_name_admin(usr)] set the mode as [GLOB.master_mode].", 1) + to_chat(world, "The mode is now: [GLOB.master_mode]") Game() // updates the main game menu - world.save_mode(master_mode) + world.save_mode(GLOB.master_mode) .(href, list("c_mode"=1)) else if(href_list["f_secret2"]) @@ -1141,11 +1141,11 @@ if(SSticker && SSticker.mode) return alert(usr, "The game has already started.", null, null, null, null) - if(master_mode != "secret") + if(GLOB.master_mode != "secret") return alert(usr, "The game mode has to be secret!", null, null, null, null) - secret_force_mode = href_list["f_secret2"] - log_admin("[key_name(usr)] set the forced secret mode as [secret_force_mode].") - message_admins("[key_name_admin(usr)] set the forced secret mode as [secret_force_mode].", 1) + GLOB.secret_force_mode = href_list["f_secret2"] + log_admin("[key_name(usr)] set the forced secret mode as [GLOB.secret_force_mode].") + message_admins("[key_name_admin(usr)] set the forced secret mode as [GLOB.secret_force_mode].", 1) Game() // updates the main game menu .(href, list("f_secret"=1)) @@ -1231,7 +1231,7 @@ to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai") return - var/turf/prison_cell = pick(prisonwarp) + var/turf/prison_cell = pick(GLOB.prisonwarp) if(!prison_cell) return var/obj/structure/closet/secure_closet/brig/locker = new /obj/structure/closet/secure_closet/brig(prison_cell) @@ -1311,7 +1311,7 @@ M.Paralyse(5) sleep(5) - M.loc = pick(tdome1) + M.loc = pick(GLOB.tdome1) spawn(50) to_chat(M, "You have been sent to the Thunderdome.") log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 1)") @@ -1341,7 +1341,7 @@ M.Paralyse(5) sleep(5) - M.loc = pick(tdome2) + M.loc = pick(GLOB.tdome2) spawn(50) to_chat(M, "You have been sent to the Thunderdome.") log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 2)") @@ -1363,7 +1363,7 @@ M.Paralyse(5) sleep(5) - M.loc = pick(tdomeadmin) + M.loc = pick(GLOB.tdomeadmin) spawn(50) to_chat(M, "You have been sent to the Thunderdome.") log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Admin.)") @@ -1397,7 +1397,7 @@ observer.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(observer), slot_shoes) M.Paralyse(5) sleep(5) - M.loc = pick(tdomeobserve) + M.loc = pick(GLOB.tdomeobserve) spawn(50) to_chat(M, "You have been sent to the Thunderdome.") log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Observer.)") @@ -1419,7 +1419,7 @@ M.Paralyse(5) sleep(5) - M.loc = pick(aroomwarp) + M.loc = pick(GLOB.aroomwarp) spawn(50) to_chat(M, "You have been sent to the Admin Room!.") log_admin("[key_name(usr)] has sent [key_name(M)] to the Admin Room") @@ -1667,13 +1667,13 @@ if(alert(owner, "Are you sure you wish to hit [key_name(M)] with Bluespace Artillery?", "Confirm Firing?" , "Yes" , "No") != "Yes") return - if(BSACooldown) + if(GLOB.BSACooldown) to_chat(owner, "Standby. Reload cycle in progress. Gunnery crews ready in five seconds!") return - BSACooldown = 1 + GLOB.BSACooldown = 1 spawn(50) - BSACooldown = 0 + GLOB.BSACooldown = 0 to_chat(M, "You've been hit by bluespace artillery!") log_admin("[key_name(M)] has been hit by Bluespace Artillery fired by [key_name(owner)]") @@ -1787,7 +1787,7 @@ var/logmsg = null switch(blessing) if("To Arrivals") - M.forceMove(pick(latejoin)) + M.forceMove(pick(GLOB.latejoin)) to_chat(M, "You are abruptly pulled through space!") logmsg = "a teleport to arrivals." if("Moderate Heal") @@ -1803,13 +1803,13 @@ H.reagents.add_reagent("spaceacillin", 20) logmsg = "a heal over time." if("Permanent Regeneration") - H.dna.SetSEState(REGENERATEBLOCK, 1) - genemutcheck(H, REGENERATEBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.regenerateblock, 1) + genemutcheck(H, GLOB.regenerateblock, null, MUTCHK_FORCED) H.update_mutations() H.gene_stability = 100 logmsg = "permanent regeneration." if("Super Powers") - var/list/default_genes = list(REGENERATEBLOCK, BREATHLESSBLOCK, COLDBLOCK) + var/list/default_genes = list(GLOB.regenerateblock, GLOB.breathlessblock, GLOB.coldblock) for(var/gene in default_genes) H.dna.SetSEState(gene, 1) genemutcheck(H, gene, null, MUTCHK_FORCED) @@ -2056,7 +2056,7 @@ P.name = "Central Command - paper" var/stypes = list("Handle it yourselves!","Illegible fax","Fax not signed","Not Right Now","You are wasting our time", "Keep up the good work", "ERT Instructions") var/stype = input(src.owner, "Which type of standard reply do you wish to send to [H]?","Choose your paperwork", "") as null|anything in stypes - var/tmsg = "



Nanotrasen Science Station [using_map.station_short]


NAS Trurl Communications Department Report


" + var/tmsg = "



Nanotrasen Science Station [GLOB.using_map.station_short]


NAS Trurl Communications Department Report


" if(stype == "Handle it yourselves!") tmsg += "Greetings, esteemed crewmember. Your fax has been DECLINED automatically by NAS Trurl Fax Registration.

Please proceed in accordance with Standard Operating Procedure and/or Space Law. You are fully trained to handle this situation without Central Command intervention.

This is an automatic message." else if(stype == "Illegible fax") @@ -2134,7 +2134,7 @@ var/input = input(src.owner, "Please enter a reason for denying [key_name(H)]'s ERT request.","Outgoing message from CentComm", "") if(!input) return - ert_request_answered = TRUE + GLOB.ert_request_answered = TRUE to_chat(src.owner, "You sent [input] to [H] via a secure channel.") log_admin("[src.owner] denied [key_name(H)]'s ERT request with the message [input].") to_chat(H, "Incoming priority transmission from Central Command. Message as follows, Your ERT request has been denied for the following reasons: [input].") @@ -2198,13 +2198,13 @@ var/obj/item/paper/P = new /obj/item/paper(null) //hopefully the null loc won't cause trouble for us if(!fax) - var/list/departmentoptions = alldepartments + hidden_departments + "All Departments" + var/list/departmentoptions = GLOB.alldepartments + GLOB.hidden_departments + "All Departments" destination = input(usr, "To which department?", "Choose a department", "") as null|anything in departmentoptions if(!destination) qdel(P) return - for(var/obj/machinery/photocopier/faxmachine/F in allfaxes) + for(var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes) if(destination != "All Departments" && F.department == destination) fax = F @@ -2300,7 +2300,7 @@ to_chat(src.owner, "Message transmission failed.") return else - for(var/obj/machinery/photocopier/faxmachine/F in allfaxes) + for(var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes) if(is_station_level(F.z)) spawn(0) if(!F.receivefax(P)) @@ -2541,7 +2541,7 @@ else if(href_list["memoeditlist"]) if(!check_rights(R_SERVER)) return var/sql_key = sanitizeSQL("[href_list["memoeditlist"]]") - var/DBQuery/query_memoedits = dbcon.NewQuery("SELECT edits FROM [format_table_name("memo")] WHERE (ckey = '[sql_key]')") + var/DBQuery/query_memoedits = GLOB.dbcon.NewQuery("SELECT edits FROM [format_table_name("memo")] WHERE (ckey = '[sql_key]')") if(!query_memoedits.Execute()) var/err = query_memoedits.ErrorMsg() log_game("SQL ERROR obtaining edits from memo table. Error : \[[err]\]\n") @@ -2616,19 +2616,19 @@ if(!(SSticker && SSticker.mode)) to_chat(usr, "Please wait until the game starts! Not sure how it will work otherwise.") return - gravity_is_on = !gravity_is_on + GLOB.gravity_is_on = !GLOB.gravity_is_on for(var/area/A in world) - A.gravitychange(gravity_is_on,A) + A.gravitychange(GLOB.gravity_is_on,A) feedback_inc("admin_secrets_fun_used",1) feedback_add_details("admin_secrets_fun_used","Grav") - if(gravity_is_on) + if(GLOB.gravity_is_on) log_admin("[key_name(usr)] toggled gravity on.", 1) message_admins("[key_name_admin(usr)] toggled gravity on.", 1) - event_announcement.Announce("Gravity generators are again functioning within normal parameters. Sorry for any inconvenience.") + GLOB.event_announcement.Announce("Gravity generators are again functioning within normal parameters. Sorry for any inconvenience.") else log_admin("[key_name(usr)] toggled gravity off.", 1) message_admins("[key_name_admin(usr)] toggled gravity off.", 1) - event_announcement.Announce("Feedback surge detected in mass-distributions systems. Artifical gravity has been disabled whilst the system reinitializes. Further failures may result in a gravitational collapse and formation of blackholes. Have a nice day.") + GLOB.event_announcement.Announce("Feedback surge detected in mass-distributions systems. Artifical gravity has been disabled whilst the system reinitializes. Further failures may result in a gravitational collapse and formation of blackholes. Have a nice day.") if("power") feedback_inc("admin_secrets_fun_used",1) @@ -2658,7 +2658,7 @@ for(var/mob/living/carbon/human/H in GLOB.mob_list) var/turf/loc = find_loc(H) var/security = 0 - if(!is_station_level(loc.z) || prisonwarped.Find(H)) + if(!is_station_level(loc.z) || GLOB.prisonwarped.Find(H)) //don't warp them if they aren't ready or are already there continue @@ -2683,13 +2683,13 @@ W.layer = initial(W.layer) W.plane = initial(W.plane) //teleport person to cell - H.loc = pick(prisonwarp) + H.loc = pick(GLOB.prisonwarp) H.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(H), slot_w_uniform) H.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(H), slot_shoes) else //teleport security person - H.loc = pick(prisonsecuritywarp) - prisonwarped += H + H.loc = pick(GLOB.prisonsecuritywarp) + GLOB.prisonwarped += H if("traitor_all") if(!SSticker) alert("The game hasn't started yet!") @@ -2716,21 +2716,21 @@ feedback_inc("admin_secrets_fun_used",1) feedback_add_details("admin_secrets_fun_used","BC") - var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be between 4 and 128)", "New Bomb Cap", MAX_EX_LIGHT_RANGE) as num|null + var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be between 4 and 128)", "New Bomb Cap", GLOB.max_ex_light_range) as num|null if(newBombCap < 4) return if(newBombCap > 128) newBombCap = 128 - MAX_EX_DEVASTATION_RANGE = round(newBombCap/4) - MAX_EX_HEAVY_RANGE = round(newBombCap/2) - MAX_EX_LIGHT_RANGE = newBombCap + GLOB.max_ex_devastation_range = round(newBombCap/4) + GLOB.max_ex_heavy_range = round(newBombCap/2) + GLOB.max_ex_light_range = newBombCap //I don't know why these are their own variables, but fuck it, they are. - MAX_EX_FLASH_RANGE = newBombCap - MAX_EX_FLAME_RANGE = newBombCap + GLOB.max_ex_flash_range = newBombCap + GLOB.max_ex_flame_range = newBombCap - message_admins("[key_name_admin(usr)] changed the bomb cap to [MAX_EX_DEVASTATION_RANGE], [MAX_EX_HEAVY_RANGE], [MAX_EX_LIGHT_RANGE]") - log_admin("[key_name(usr)] changed the bomb cap to [MAX_EX_DEVASTATION_RANGE], [MAX_EX_HEAVY_RANGE], [MAX_EX_LIGHT_RANGE]") + message_admins("[key_name_admin(usr)] changed the bomb cap to [GLOB.max_ex_devastation_range], [GLOB.max_ex_heavy_range], [GLOB.max_ex_light_range]") + log_admin("[key_name(usr)] changed the bomb cap to [GLOB.max_ex_devastation_range], [GLOB.max_ex_heavy_range], [GLOB.max_ex_light_range]") if("flicklights") feedback_inc("admin_secrets_fun_used",1) @@ -2838,7 +2838,7 @@ if(is_station_level(W.z) && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison)) W.req_access = list() message_admins("[key_name_admin(usr)] activated Egalitarian Station mode") - event_announcement.Announce("Centcomm airlock control override activated. Please take this time to get acquainted with your coworkers.", new_sound = 'sound/AI/commandreport.ogg') + GLOB.event_announcement.Announce("Centcomm airlock control override activated. Please take this time to get acquainted with your coworkers.", new_sound = 'sound/AI/commandreport.ogg') if("onlyone") feedback_inc("admin_secrets_fun_used",1) feedback_add_details("admin_secrets_fun_used","OO") @@ -2958,13 +2958,13 @@ var/ok = 0 switch(href_list["secretsadmin"]) if("list_signalers") - var/dat = "Showing last [length(lastsignalers)] signalers.
" - for(var/sig in lastsignalers) + var/dat = "Showing last [length(GLOB.lastsignalers)] signalers.
" + for(var/sig in GLOB.lastsignalers) dat += "[sig]
" usr << browse(dat, "window=lastsignalers;size=800x500") if("list_lawchanges") - var/dat = "Showing last [length(lawchanges)] law changes.
" - for(var/sig in lawchanges) + var/dat = "Showing last [length(GLOB.lawchanges)] law changes.
" + for(var/sig in GLOB.lawchanges) dat += "[sig]
" usr << browse(dat, "window=lawchanges;size=800x500") if("list_job_debug") @@ -3046,9 +3046,9 @@ switch(href_list["secretscoder"]) if("spawn_objects") var/dat = "Admin Log
" - for(var/l in admin_log) + for(var/l in GLOB.admin_log) dat += "
  • [l]
  • " - if(!admin_log.len) + if(!GLOB.admin_log.len) dat += "No-one has done anything this round!" usr << browse(dat, "window=admin_log") if("maint_ACCESS_BRIG") @@ -3085,7 +3085,7 @@ else if(href_list["ac_submit_new_channel"]) var/check = 0 - for(var/datum/feed_channel/FC in news_network.network_channels) + for(var/datum/feed_channel/FC in GLOB.news_network.network_channels) if(FC.channel_name == src.admincaster_feed_channel.channel_name) check = 1 break @@ -3100,14 +3100,14 @@ newChannel.locked = src.admincaster_feed_channel.locked newChannel.is_admin_channel = 1 feedback_inc("newscaster_channels",1) - news_network.network_channels += newChannel //Adding channel to the global network + GLOB.news_network.network_channels += newChannel //Adding channel to the global network log_admin("[key_name_admin(usr)] created command feed channel: [src.admincaster_feed_channel.channel_name]!") src.admincaster_screen=5 src.access_news_network() else if(href_list["ac_set_channel_receiving"]) var/list/available_channels = list() - for(var/datum/feed_channel/F in news_network.network_channels) + for(var/datum/feed_channel/F in GLOB.news_network.network_channels) available_channels += F.channel_name src.admincaster_feed_channel.channel_name = adminscrub(input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels ) src.access_news_network() @@ -3127,13 +3127,13 @@ newMsg.body = src.admincaster_feed_message.body newMsg.is_admin_message = 1 feedback_inc("newscaster_stories",1) - for(var/datum/feed_channel/FC in news_network.network_channels) + for(var/datum/feed_channel/FC in GLOB.news_network.network_channels) if(FC.channel_name == src.admincaster_feed_channel.channel_name) FC.messages += newMsg //Adding message to the network's appropriate feed_channel break src.admincaster_screen=4 - for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allNewscasters) NEWSCASTER.newsAlert(src.admincaster_feed_channel.channel_name) log_admin("[key_name_admin(usr)] submitted a feed story to channel: [src.admincaster_feed_channel.channel_name]!") @@ -3157,12 +3157,12 @@ else if(href_list["ac_menu_wanted"]) var/already_wanted = 0 - if(news_network.wanted_issue) + if(GLOB.news_network.wanted_issue) already_wanted = 1 if(already_wanted) - src.admincaster_feed_message.author = news_network.wanted_issue.author - src.admincaster_feed_message.body = news_network.wanted_issue.body + src.admincaster_feed_message.author = GLOB.news_network.wanted_issue.author + src.admincaster_feed_message.body = GLOB.news_network.wanted_issue.body src.admincaster_screen = 14 src.access_news_network() @@ -3191,15 +3191,15 @@ WANTED.body = src.admincaster_feed_message.body //Wanted desc WANTED.backup_author = src.admincaster_signature //Submitted by WANTED.is_admin_message = 1 - news_network.wanted_issue = WANTED - for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + GLOB.news_network.wanted_issue = WANTED + for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allNewscasters) NEWSCASTER.newsAlert() NEWSCASTER.update_icon() src.admincaster_screen = 15 else - news_network.wanted_issue.author = src.admincaster_feed_message.author - news_network.wanted_issue.body = src.admincaster_feed_message.body - news_network.wanted_issue.backup_author = src.admincaster_feed_message.backup_author + GLOB.news_network.wanted_issue.author = src.admincaster_feed_message.author + GLOB.news_network.wanted_issue.body = src.admincaster_feed_message.body + GLOB.news_network.wanted_issue.backup_author = src.admincaster_feed_message.backup_author src.admincaster_screen = 19 log_admin("[key_name_admin(usr)] issued a Station-wide Wanted Notification for [src.admincaster_feed_message.author]!") src.access_news_network() @@ -3207,8 +3207,8 @@ else if(href_list["ac_cancel_wanted"]) var/choice = alert("Please confirm Wanted Issue removal","Network Security Handler","Confirm","Cancel") if(choice=="Confirm") - news_network.wanted_issue = null - for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + GLOB.news_network.wanted_issue = null + for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allNewscasters) NEWSCASTER.update_icon() src.admincaster_screen=17 src.access_news_network() @@ -3333,7 +3333,7 @@ var/isbn = sanitizeSQL(href_list["library_book_id"]) if(href_list["view_library_book"]) - var/DBQuery/query_view_book = dbcon.NewQuery("SELECT content, title FROM [format_table_name("library")] WHERE id=[isbn]") + var/DBQuery/query_view_book = GLOB.dbcon.NewQuery("SELECT content, title FROM [format_table_name("library")] WHERE id=[isbn]") if(!query_view_book.Execute()) var/err = query_view_book.ErrorMsg() log_game("SQL ERROR viewing book. Error : \[[err]\]\n") @@ -3358,7 +3358,7 @@ return else if(href_list["unflag_library_book"]) - var/DBQuery/query_unflag_book = dbcon.NewQuery("UPDATE [format_table_name("library")] SET flagged = 0 WHERE id=[isbn]") + var/DBQuery/query_unflag_book = GLOB.dbcon.NewQuery("UPDATE [format_table_name("library")] SET flagged = 0 WHERE id=[isbn]") if(!query_unflag_book.Execute()) var/err = query_unflag_book.ErrorMsg() log_game("SQL ERROR unflagging book. Error : \[[err]\]\n") @@ -3368,7 +3368,7 @@ message_admins("[key_name_admin(usr)] has unflagged the book [isbn].") else if(href_list["delete_library_book"]) - var/DBQuery/query_delbook = dbcon.NewQuery("DELETE FROM [format_table_name("library")] WHERE id=[isbn]") + var/DBQuery/query_delbook = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("library")] WHERE id=[isbn]") if(!query_delbook.Execute()) var/err = query_delbook.ErrorMsg() log_game("SQL ERROR deleting book. Error : \[[err]\]\n") @@ -3381,11 +3381,12 @@ src.view_flagged_books() // Force unlink a discord key + // TODO: Delete this else if(href_list["force_discord_unlink"]) if(!check_rights(R_ADMIN)) return var/target_ckey = href_list["force_discord_unlink"] - var/DBQuery/admin_unlink_discord_id = dbcon.NewQuery("DELETE FROM [format_table_name("discord")] WHERE ckey = '[target_ckey]'") + var/DBQuery/admin_unlink_discord_id = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("discord")] WHERE ckey = '[target_ckey]'") if(!admin_unlink_discord_id.Execute()) var/err = admin_unlink_discord_id.ErrorMsg() log_game("SQL ERROR while admin-unlinking discord account. Error : \[[err]\]\n") @@ -3441,7 +3442,7 @@ return var/datum/mind/hunter_mind = new /datum/mind(key_of_hunter) hunter_mind.active = 1 - var/mob/living/carbon/human/hunter_mob = new /mob/living/carbon/human(pick(latejoin)) + var/mob/living/carbon/human/hunter_mob = new /mob/living/carbon/human(pick(GLOB.latejoin)) hunter_mind.transfer_to(hunter_mob) hunter_mob.equipOutfit(O, FALSE) var/obj/item/pinpointer/advpinpointer/N = new /obj/item/pinpointer/advpinpointer(hunter_mob) @@ -3471,7 +3472,7 @@ if(killthem) to_chat(hunter_mob, "If you kill [H.p_them()], [H.p_they()] cannot be revived."); hunter_mob.mind.special_role = SPECIAL_ROLE_TRAITOR - var/datum/atom_hud/antag/tatorhud = huds[ANTAG_HUD_TRAITOR] + var/datum/atom_hud/antag/tatorhud = GLOB.huds[ANTAG_HUD_TRAITOR] tatorhud.join_hud(hunter_mob) set_antag_hud(hunter_mob, "hudsyndicate") diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 1a13539c520..8ac9c4fd2b0 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -1,7 +1,7 @@ //This is a list of words which are ignored by the parser when comparing message contents for names. MUST BE IN LOWER CASE! -var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","alien","as") +GLOBAL_LIST_INIT(adminhelp_ignored_words, list("unknown","the","a","an","of","monkey","alien","as")) /client/verb/adminhelp() set category = "Admin" @@ -66,7 +66,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey"," for(var/original_word in msglist) var/word = ckey(original_word) if(word) - if(!(word in adminhelp_ignored_words)) + if(!(word in GLOB.adminhelp_ignored_words)) if(word == "ai") ai_found = 1 else diff --git a/code/modules/admin/verbs/adminsay.dm b/code/modules/admin/verbs/adminsay.dm index 74eeff49692..a0e8b4b9088 100644 --- a/code/modules/admin/verbs/adminsay.dm +++ b/code/modules/admin/verbs/adminsay.dm @@ -20,7 +20,7 @@ /client/proc/get_admin_say() var/msg = input(src, null, "asay \"text\"") as text|null cmd_admin_say(msg) - + /client/proc/cmd_mentor_say(msg as text) set category = "Admin" set name = "Msay" @@ -59,12 +59,12 @@ var/enabling var/msay = /client/proc/cmd_mentor_say - if(msay in admin_verbs_mentor) + if(msay in GLOB.admin_verbs_mentor) enabling = FALSE - admin_verbs_mentor -= msay + GLOB.admin_verbs_mentor -= msay else enabling = TRUE - admin_verbs_mentor += msay + GLOB.admin_verbs_mentor += msay for(var/client/C in GLOB.admins) if(check_rights(R_ADMIN|R_MOD, 0, C.mob)) diff --git a/code/modules/admin/verbs/alt_check.dm b/code/modules/admin/verbs/alt_check.dm index d5118d4eb8f..c8060f22036 100644 --- a/code/modules/admin/verbs/alt_check.dm +++ b/code/modules/admin/verbs/alt_check.dm @@ -6,7 +6,7 @@
    Additionally make an attempt to introduce new players to the server
    "} - if(dbcon.IsConnected()) + if(GLOB.dbcon.IsConnected()) for(var/client/C in GLOB.clients) dat += "

    [C.ckey] (Player Age: [C.player_age]) - [C.computer_id] / [C.address]
    " if(C.related_accounts_cid.len) diff --git a/code/modules/admin/verbs/atmosdebug.dm b/code/modules/admin/verbs/atmosdebug.dm index 0624e4d1909..087a90eebe6 100644 --- a/code/modules/admin/verbs/atmosdebug.dm +++ b/code/modules/admin/verbs/atmosdebug.dm @@ -28,7 +28,7 @@ to_chat(usr, "Checking for overlapping pipes...") for(var/turf/T in world) - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) var/list/check = list(0, 0, 0) var/done = 0 for(var/obj/machinery/atmospherics/pipe in T) diff --git a/code/modules/admin/verbs/custom_event.dm b/code/modules/admin/verbs/custom_event.dm index 68d3301b11e..b3d1543aedc 100644 --- a/code/modules/admin/verbs/custom_event.dm +++ b/code/modules/admin/verbs/custom_event.dm @@ -7,9 +7,9 @@ to_chat(src, "Only administrators may use this command.") return - var/input = input(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", custom_event_msg) as message|null + var/input = input(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", GLOB.custom_event_msg) as message|null if(!input || input == "") - custom_event_msg = null + GLOB.custom_event_msg = null log_admin("[key_name(usr)] has cleared the custom event text.") message_admins("[key_name_admin(usr)] has cleared the custom event text.") return @@ -17,11 +17,11 @@ log_admin("[key_name(usr)] has changed the custom event text.") message_admins("[key_name_admin(usr)] has changed the custom event text.") - custom_event_msg = input + GLOB.custom_event_msg = input to_chat(world, "

    Custom Event

    ") to_chat(world, "

    A custom event is starting. OOC Info:

    ") - to_chat(world, "[html_encode(custom_event_msg)]") + to_chat(world, "[html_encode(GLOB.custom_event_msg)]") to_chat(world, "
    ") // normal verb for players to view info @@ -29,12 +29,12 @@ set category = "OOC" set name = "Custom Event Info" - if(!custom_event_msg || custom_event_msg == "") + if(!GLOB.custom_event_msg || GLOB.custom_event_msg == "") to_chat(src, "There currently is no known custom event taking place.") to_chat(src, "Keep in mind: it is possible that an admin has not properly set this.") return to_chat(src, "

    Custom Event

    ") to_chat(src, "

    A custom event is taking place. OOC Info:

    ") - to_chat(src, "[html_encode(custom_event_msg)]") + to_chat(src, "[html_encode(GLOB.custom_event_msg)]") to_chat(src, "
    ") diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index ad3a0403e87..5ec8ecde253 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -5,12 +5,12 @@ if(!check_rights(R_DEBUG)) return - if(Debug2) - Debug2 = 0 + if(GLOB.debug2) + GLOB.debug2 = 0 message_admins("[key_name_admin(src)] toggled debugging off.") log_admin("[key_name(src)] toggled debugging off.") else - Debug2 = 1 + GLOB.debug2 = 1 message_admins("[key_name_admin(src)] toggled debugging on.") log_admin("[key_name(src)] toggled debugging on.") @@ -291,9 +291,9 @@ GLOBAL_PROTECT(AdminProcCaller) pai.real_name = pai.name pai.key = choice.key card.setPersonality(pai) - for(var/datum/paiCandidate/candidate in paiController.pai_candidates) + for(var/datum/paiCandidate/candidate in GLOB.paiController.pai_candidates) if(candidate.key == choice.key) - paiController.pai_candidates.Remove(candidate) + GLOB.paiController.pai_candidates.Remove(candidate) feedback_add_details("admin_verb","MPAI") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_alienize(var/mob/M in GLOB.mob_list) @@ -806,7 +806,7 @@ GLOBAL_PROTECT(AdminProcCaller) genemutcheck(M,block,null,MUTCHK_FORCED) M.update_mutations() var/state="[M.dna.GetSEState(block)?"on":"off"]" - var/blockname=assigned_blocks[block] + var/blockname=GLOB.assigned_blocks[block] message_admins("[key_name_admin(src)] has toggled [M.key]'s [blockname] block [state]!") log_admin("[key_name(src)] has toggled [M.key]'s [blockname] block [state]!") else @@ -835,7 +835,7 @@ GLOBAL_PROTECT(AdminProcCaller) if(!check_rights(R_DEBUG)) return - error_cache.showTo(usr) + GLOB.error_cache.showTo(usr) /client/proc/jump_to_ruin() set category = "Debug" diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index 6770ca114aa..92bcfa25c3a 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -19,8 +19,8 @@ for(var/datum/gas/trace_gas in GM.trace_gases) to_chat(usr, "[trace_gas.type]: [trace_gas.moles]") - message_admins("[key_name_admin(usr)] has checked the air status of [T]") - log_admin("[key_name(usr)] has checked the air status of [T]") + message_admins("[key_name_admin(usr)] has checked the air status of [target]") + log_admin("[key_name(usr)] has checked the air status of [target]") feedback_add_details("admin_verb","DAST") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -131,7 +131,7 @@ return to_chat(usr, "Jobbans active in this round.") - for(var/t in jobban_keylist) + for(var/t in GLOB.jobban_keylist) to_chat(usr, "[t]") message_admins("[key_name_admin(usr)] has printed the jobban log") @@ -150,7 +150,7 @@ return to_chat(usr, "Jobbans active in this round.") - for(var/t in jobban_keylist) + for(var/t in GLOB.jobban_keylist) if(findtext(t, filter)) to_chat(usr, "[t]") diff --git a/code/modules/admin/verbs/freeze.dm b/code/modules/admin/verbs/freeze.dm index 9b01e94846c..f775ba0e917 100644 --- a/code/modules/admin/verbs/freeze.dm +++ b/code/modules/admin/verbs/freeze.dm @@ -5,7 +5,7 @@ //////Allows admin's to right click on any mob/mech and freeze them in place./// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// -var/global/list/frozen_mob_list = list() +GLOBAL_LIST_EMPTY(frozen_mob_list) /client/proc/freeze(var/mob/living/M as mob in GLOB.mob_list) set name = "Freeze" set category = null @@ -16,7 +16,7 @@ var/global/list/frozen_mob_list = list() if(!istype(M)) return - if(M in frozen_mob_list) + if(M in GLOB.frozen_mob_list) M.admin_unFreeze(src) else M.admin_Freeze(src) @@ -41,8 +41,8 @@ var/global/list/frozen_mob_list = list() admin_prev_sleeping = sleeping AdjustSleeping(20000) frozen = AO - if(!(src in frozen_mob_list)) - frozen_mob_list += src + if(!(src in GLOB.frozen_mob_list)) + GLOB.frozen_mob_list += src /mob/living/proc/admin_unFreeze(client/admin, skip_overlays = FALSE) if(istype(admin)) @@ -58,8 +58,8 @@ var/global/list/frozen_mob_list = list() frozen = null SetSleeping(admin_prev_sleeping) admin_prev_sleeping = null - if(src in frozen_mob_list) - frozen_mob_list -= src + if(src in GLOB.frozen_mob_list) + GLOB.frozen_mob_list -= src update_icons() diff --git a/code/modules/admin/verbs/honksquad.dm b/code/modules/admin/verbs/honksquad.dm index 238706c1038..8c8d46ec97b 100644 --- a/code/modules/admin/verbs/honksquad.dm +++ b/code/modules/admin/verbs/honksquad.dm @@ -1,7 +1,7 @@ //HONKsquad #define HONKSQUAD_POSSIBLE 6 //if more Commandos are needed in the future -var/global/sent_honksquad = 0 +GLOBAL_VAR_INIT(sent_honksquad, 0) /client/proc/honksquad() if(!SSticker) @@ -10,7 +10,7 @@ var/global/sent_honksquad = 0 if(world.time < 6000) to_chat(usr, "There are [(6000-world.time)/10] seconds remaining before it may be called.") return - if(sent_honksquad == 1) + if(GLOB.sent_honksquad == 1) to_chat(usr, "Clown Planet has already dispatched a HONKsquad.") return if(alert("Do you want to send in the HONKsquad? Once enabled, this is irreversible.",,"Yes","No")!="Yes") @@ -24,11 +24,11 @@ var/global/sent_honksquad = 0 if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes") return - if(sent_honksquad) + if(GLOB.sent_honksquad) to_chat(usr, "Looks like someone beat you to it. HONK.") return - sent_honksquad = 1 + GLOB.sent_honksquad = 1 var/honksquad_number = HONKSQUAD_POSSIBLE //for selecting a leader diff --git a/code/modules/admin/verbs/infiltratorteam_syndicate.dm b/code/modules/admin/verbs/infiltratorteam_syndicate.dm index 4cea0538520..459f2b8fb4b 100644 --- a/code/modules/admin/verbs/infiltratorteam_syndicate.dm +++ b/code/modules/admin/verbs/infiltratorteam_syndicate.dm @@ -1,7 +1,7 @@ // Syndicate Infiltration Team (SIT) // A little like Syndicate Strike Team (SST) but geared towards stealthy team missions rather than murderbone. -var/global/sent_syndicate_infiltration_team = 0 +GLOBAL_VAR_INIT(sent_syndicate_infiltration_team, 0) /client/proc/syndicate_infiltration_team() set category = "Event" @@ -35,7 +35,7 @@ var/global/sent_syndicate_infiltration_team = 0 var/tctext = input(src, "How much TC do you want to give each team member? Suggested: 20-30. They cannot trade TC.") as num var/tcamount = text2num(tctext) tcamount = between(0, tcamount, 1000) - if(sent_syndicate_infiltration_team == 1) + if(GLOB.sent_syndicate_infiltration_team == 1) if(alert("A Syndicate Infiltration Team has already been sent. Sure you want to send another?",,"Yes","No")=="No") return @@ -61,7 +61,7 @@ var/global/sent_syndicate_infiltration_team = 0 to_chat(src, "Nobody volunteered.") return 0 - sent_syndicate_infiltration_team = 1 + GLOB.sent_syndicate_infiltration_team = 1 var/list/sit_spawns = list() var/list/sit_spawns_leader = list() @@ -90,7 +90,7 @@ var/global/sent_syndicate_infiltration_team = 0 to_chat(new_syndicate_infiltrator, "You are a [!syndicate_leader_selected?"Infiltrator":"Lead Infiltrator"] in the service of the Syndicate. \nYour current mission is: [input]") to_chat(new_syndicate_infiltrator, "You are equipped with an uplink implant to help you achieve your objectives. ((activate it via button in top left of screen))") new_syndicate_infiltrator.faction += "syndicate" - data_core.manifest_inject(new_syndicate_infiltrator) + GLOB.data_core.manifest_inject(new_syndicate_infiltrator) if(syndicate_leader_selected) var/obj/effect/landmark/warpto = pick(sit_spawns_leader) new_syndicate_infiltrator.loc = warpto.loc @@ -104,7 +104,7 @@ var/global/sent_syndicate_infiltration_team = 0 new_syndicate_infiltrator.mind.store_memory("Mission: [input] ") new_syndicate_infiltrator.mind.store_memory("Team Leader: [team_leader] ") new_syndicate_infiltrator.mind.store_memory("Starting Equipment:
    - Syndicate Headset ((.h for your radio))
    - Chameleon Jumpsuit ((right click to Change Color))
    - Agent ID card ((disguise as another job))
    - Uplink Implant ((top left of screen))
    - Dust Implant ((destroys your body on death))
    - Combat Gloves ((insulated, disguised as black gloves))
    - Anything bought with your uplink implant") - var/datum/atom_hud/antag/opshud = huds[ANTAG_HUD_OPS] + var/datum/atom_hud/antag/opshud = GLOB.huds[ANTAG_HUD_OPS] opshud.join_hud(new_syndicate_infiltrator.mind.current) set_antag_hud(new_syndicate_infiltrator.mind.current, "hudoperative") new_syndicate_infiltrator.regenerate_icons() diff --git a/code/modules/admin/verbs/map_template_loadverb.dm b/code/modules/admin/verbs/map_template_loadverb.dm index f447810d860..edbca5a842f 100644 --- a/code/modules/admin/verbs/map_template_loadverb.dm +++ b/code/modules/admin/verbs/map_template_loadverb.dm @@ -6,10 +6,10 @@ return var/datum/map_template/template - var/map = input(usr, "Choose a Map Template to place at your CURRENT LOCATION","Place Map Template") as null|anything in map_templates + var/map = input(usr, "Choose a Map Template to place at your CURRENT LOCATION","Place Map Template") as null|anything in GLOB.map_templates if(!map) return - template = map_templates[map] + template = GLOB.map_templates[map] var/turf/T = get_turf(mob) if(!T) @@ -48,7 +48,7 @@ var/datum/map_template/M = new(map=map, rename="[map]") if(M.preload_size(map)) to_chat(usr, "Map template '[map]' ready to place ([M.width]x[M.height])") - map_templates[M.name] = M + GLOB.map_templates[M.name] = M message_admins("[key_name_admin(usr)] has uploaded a map template ([map]). Took [stop_watch(timer)]s.") else to_chat(usr, "Map template '[map]' failed to load properly") diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 61356f46027..10ad31ef410 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -19,8 +19,8 @@ //- Identify how hard it is to break into the area and where the weak points are //- Check if the area has too much empty space. If so, make it smaller and replace the rest with maintenance tunnels. -var/camera_range_display_status = 0 -var/intercom_range_display_status = 0 +GLOBAL_VAR_INIT(camera_range_display_status, 0) +GLOBAL_VAR_INIT(intercom_range_display_status, 0) /obj/effect/debugging/camera_range icon = 'icons/480x480.dmi' @@ -50,16 +50,16 @@ var/intercom_range_display_status = 0 if(!check_rights(R_DEBUG)) return - if(camera_range_display_status) - camera_range_display_status = 0 + if(GLOB.camera_range_display_status) + GLOB.camera_range_display_status = 0 else - camera_range_display_status = 1 + GLOB.camera_range_display_status = 1 for(var/obj/effect/debugging/camera_range/C in world) qdel(C) - if(camera_range_display_status) - for(var/obj/machinery/camera/C in cameranet.cameras) + if(GLOB.camera_range_display_status) + for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) new/obj/effect/debugging/camera_range(C.loc) feedback_add_details("admin_verb","mCRD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -72,7 +72,7 @@ var/intercom_range_display_status = 0 var/list/obj/machinery/camera/CL = list() - for(var/obj/machinery/camera/C in cameranet.cameras) + for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) CL += C var/output = {"CAMERA ANOMALIES REPORT
    @@ -109,15 +109,15 @@ var/intercom_range_display_status = 0 if(!check_rights(R_DEBUG)) return - if(intercom_range_display_status) - intercom_range_display_status = 0 + if(GLOB.intercom_range_display_status) + GLOB.intercom_range_display_status = 0 else - intercom_range_display_status = 1 + GLOB.intercom_range_display_status = 1 for(var/obj/effect/debugging/marker/M in world) qdel(M) - if(intercom_range_display_status) + if(GLOB.intercom_range_display_status) for(var/obj/item/radio/intercom/I in world) for(var/turf/T in orange(7,I)) var/obj/effect/debugging/marker/F = new/obj/effect/debugging/marker(T) diff --git a/code/modules/admin/verbs/massmodvar.dm b/code/modules/admin/verbs/massmodvar.dm index 50c329f17d2..50629d5a1cc 100644 --- a/code/modules/admin/verbs/massmodvar.dm +++ b/code/modules/admin/verbs/massmodvar.dm @@ -45,16 +45,16 @@ var/default var/var_value = O.vars[variable] - if(variable in VVckey_edit) + if(variable in GLOB.VVckey_edit) to_chat(src, "It's forbidden to mass-modify ckeys. It'll crash everyone's client you dummy.") return - if(variable in VVlocked) + if(variable in GLOB.VVlocked) if(!check_rights(R_DEBUG)) return - if(variable in VVicon_edit_lock) + if(variable in GLOB.VVicon_edit_lock) if(!check_rights(R_EVENT | R_DEBUG)) return - if(variable in VVpixelmovement) + if(variable in GLOB.VVpixelmovement) if(!check_rights(R_DEBUG)) return var/prompt = alert(src, "Editing this var may irreparably break tile gliding for the rest of the round. THIS CAN'T BE UNDONE", "DANGER", "ABORT ", "Continue", " ABORT") diff --git a/code/modules/admin/verbs/modifyvariables.dm b/code/modules/admin/verbs/modifyvariables.dm index bd0624bcdff..6a1efba4c93 100644 --- a/code/modules/admin/verbs/modifyvariables.dm +++ b/code/modules/admin/verbs/modifyvariables.dm @@ -1,7 +1,7 @@ -var/list/VVlocked = list("vars", "var_edited", "client", "firemut", "ishulk", "telekinesis", "xray", "ka", "virus", "viruses", "cuffed", "last_eaten", "unlock_content") // R_DEBUG -var/list/VVicon_edit_lock = list("icon", "icon_state", "overlays", "underlays", "resize") // R_EVENT | R_DEBUG -var/list/VVckey_edit = list("key", "ckey") // R_EVENT | R_DEBUG -var/list/VVpixelmovement = list("step_x", "step_y", "step_size", "bound_height", "bound_width", "bound_x", "bound_y") // R_DEBUG + warning +GLOBAL_LIST_INIT(VVlocked, list("vars", "var_edited", "client", "firemut", "ishulk", "telekinesis", "xray", "ka", "virus", "viruses", "cuffed", "last_eaten", "unlock_content")) // R_DEBUG +GLOBAL_LIST_INIT(VVicon_edit_lock, list("icon", "icon_state", "overlays", "underlays", "resize")) // R_EVENT | R_DEBUG +GLOBAL_LIST_INIT(VVckey_edit, list("key", "ckey")) // R_EVENT | R_DEBUG +GLOBAL_LIST_INIT(VVpixelmovement, list("step_x", "step_y", "step_size", "bound_height", "bound_width", "bound_x", "bound_y")) // R_DEBUG + warning /client/proc/vv_get_class(var/var_value) if(isnull(var_value)) . = VV_NULL @@ -517,16 +517,16 @@ var/list/VVpixelmovement = list("step_x", "step_y", "step_size", "bound_height", message_admins("[key_name_admin(src)] modified [original_name]'s varlist [objectvar]: [original_var]=[new_var]") /proc/vv_varname_lockcheck(param_var_name) - if(param_var_name in VVlocked) + if(param_var_name in GLOB.VVlocked) if(!check_rights(R_DEBUG)) return FALSE - if(param_var_name in VVckey_edit) + if(param_var_name in GLOB.VVckey_edit) if(!check_rights(R_EVENT | R_DEBUG)) return FALSE - if(param_var_name in VVicon_edit_lock) + if(param_var_name in GLOB.VVicon_edit_lock) if(!check_rights(R_EVENT | R_DEBUG)) return FALSE - if(param_var_name in VVpixelmovement) + if(param_var_name in GLOB.VVpixelmovement) if(!check_rights(R_DEBUG)) return FALSE var/prompt = alert(usr, "Editing this var may irreparably break tile gliding for the rest of the round. THIS CAN'T BE UNDONE", "DANGER", "ABORT ", "Continue", " ABORT") diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index f1a8d9990c5..57f7cad31c4 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -177,11 +177,11 @@ client/proc/one_click_antag() H = pick(candidates) SSticker.mode.add_cultist(H.mind) candidates.Remove(H) - if(!summon_spots.len) - while(summon_spots.len < SUMMON_POSSIBILITIES) - var/area/summon = pick(return_sorted_areas() - summon_spots) + if(!GLOB.summon_spots.len) + while(GLOB.summon_spots.len < SUMMON_POSSIBILITIES) + var/area/summon = pick(return_sorted_areas() - GLOB.summon_spots) if(summon && is_station_level(summon.z) && summon.valid_territory) - summon_spots += summon + GLOB.summon_spots += summon return 1 return 0 @@ -379,7 +379,7 @@ client/proc/one_click_antag() if(!G_found || !G_found.key) return //First we spawn a dude. - var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned. + var/mob/living/carbon/human/new_character = new(pick(GLOB.latejoin))//The mob being spawned. var/datum/preferences/A = new(G_found.client) A.copy_to(new_character) @@ -513,7 +513,7 @@ client/proc/one_click_antag() //Now apply cortical stack. var/obj/item/implant/cortical/I = new(new_vox) I.implant(new_vox) - cortical_stacks += I + GLOB.cortical_stacks += I new_vox.equip_vox_raider() new_vox.regenerate_icons() diff --git a/code/modules/admin/verbs/onlyone.dm b/code/modules/admin/verbs/onlyone.dm index c3299c212ad..e51f6da991a 100644 --- a/code/modules/admin/verbs/onlyone.dm +++ b/code/modules/admin/verbs/onlyone.dm @@ -54,7 +54,7 @@ message_admins("[key_name_admin(usr)] used THERE CAN BE ONLY ONE! -NO ATTACK LOGS WILL BE SENT TO ADMINS FROM THIS POINT FORTH-", 1) log_admin("[key_name(usr)] used there can be only one.") - nologevent = 1 + GLOB.nologevent = 1 world << sound('sound/music/thunderdome.ogg') /client/proc/only_me() @@ -100,5 +100,5 @@ message_admins("[key_name_admin(usr)] used THERE CAN BE ONLY ME! -NO ATTACK LOGS WILL BE SENT TO ADMINS FROM THIS POINT FORTH-", 1) log_admin("[key_name(usr)] used there can be only me.") - nologevent = 1 + GLOB.nologevent = 1 world << sound('sound/music/thunderdome.ogg') diff --git a/code/modules/admin/verbs/onlyoneteam.dm b/code/modules/admin/verbs/onlyoneteam.dm index 846a77c508a..c0847d6ff7e 100644 --- a/code/modules/admin/verbs/onlyoneteam.dm +++ b/code/modules/admin/verbs/onlyoneteam.dm @@ -29,7 +29,7 @@ H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes) if(!team_toggle) - team_alpha += H + GLOB.team_alpha += H H.equip_to_slot_or_del(new /obj/item/clothing/under/color/red/dodgeball(H), slot_w_uniform) var/obj/item/card/id/W = new(H) @@ -42,7 +42,7 @@ H.equip_to_slot_or_del(W, slot_wear_id) else - team_bravo += H + GLOB.team_bravo += H H.equip_to_slot_or_del(new /obj/item/clothing/under/color/blue/dodgeball(H), slot_w_uniform) var/obj/item/card/id/W = new(H) @@ -60,7 +60,7 @@ message_admins("[key_name_admin(usr)] used DODGEBAWWWWWWWL! -NO ATTACK LOGS WILL BE SENT TO ADMINS FROM THIS POINT FORTH-", 1) log_admin("[key_name(usr)] used dodgeball.") - nologevent = 1 + GLOB.nologevent = 1 /obj/item/beach_ball/dodgeball name = "dodgeball" @@ -76,13 +76,13 @@ if(H.r_hand == src) return if(H.l_hand == src) return var/mob/A = H.LAssailant - if((H in team_alpha) && (A in team_alpha)) + if((H in GLOB.team_alpha) && (A in GLOB.team_alpha)) to_chat(A, "He's on your team!") return - else if((H in team_bravo) && (A in team_bravo)) + else if((H in GLOB.team_bravo) && (A in GLOB.team_bravo)) to_chat(A, "He's on your team!") return - else if(!A in team_alpha && !A in team_bravo) + else if(!A in GLOB.team_alpha && !A in GLOB.team_bravo) to_chat(A, "You're not part of the dodgeball game, sorry!") return else diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index 4717ba67f65..6ec103cccc9 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -1,4 +1,4 @@ -var/list/sounds_cache = list() +GLOBAL_LIST_EMPTY(sounds_cache) /client/proc/stop_global_admin_sounds() set category = "Event" @@ -21,7 +21,7 @@ var/list/sounds_cache = list() var/sound/uploaded_sound = sound(S, repeat = 0, wait = 1, channel = CHANNEL_ADMIN) uploaded_sound.priority = 250 - sounds_cache += S + GLOB.sounds_cache += S if(alert("Are you sure?\nSong: [S]\nNow you can also play this sound using \"Play Server Sound\".", "Confirmation request" ,"Play", "Cancel") == "Cancel") return @@ -54,7 +54,7 @@ var/list/sounds_cache = list() if(!check_rights(R_SOUNDS)) return var/list/sounds = file2list("sound/serversound_list.txt"); - sounds += sounds_cache + sounds += GLOB.sounds_cache var/melody = input("Select a sound from the server to play", "Server sound list") as null|anything in sounds if(!melody) return @@ -72,7 +72,7 @@ var/list/sounds_cache = list() if(A != "Yep") return var/list/sounds = file2list("sound/serversound_list.txt"); - sounds += sounds_cache + sounds += GLOB.sounds_cache var/melody = input("Select a sound from the server to play", "Server sound list") as null|anything in sounds if(!melody) return diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index cc13601e23b..8c68d73a390 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -33,7 +33,7 @@ //teleport person to cell M.Paralyse(5) sleep(5) //so they black out before warping - M.loc = pick(prisonwarp) + M.loc = pick(GLOB.prisonwarp) if(istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/prisoner = M prisoner.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(prisoner), slot_w_uniform) @@ -361,8 +361,8 @@ Traitors and the like can also be revived with the previous role mostly intact. if(G_found.mind.assigned_role=="Alien") if(alert("This character appears to have been an alien. Would you like to respawn them as such?",,"Yes","No")=="Yes") var/turf/T - if(xeno_spawn.len) T = pick(xeno_spawn) - else T = pick(latejoin) + if(GLOB.xeno_spawn.len) T = pick(GLOB.xeno_spawn) + else T = pick(GLOB.latejoin) var/mob/living/carbon/alien/new_xeno switch(G_found.mind.special_role)//If they have a mind, we can determine which caste they were. @@ -381,14 +381,14 @@ Traitors and the like can also be revived with the previous role mostly intact. message_admins("[key_name_admin(usr)] has respawned [new_xeno.key] as a filthy xeno.", 1) return //all done. The ghost is auto-deleted - var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned. + var/mob/living/carbon/human/new_character = new(pick(GLOB.latejoin))//The mob being spawned. var/datum/data/record/record_found //Referenced to later to either randomize or not randomize the character. if(G_found.mind && !G_found.mind.active) //mind isn't currently in use by someone/something /*Try and locate a record for the person being respawned through data_core. This isn't an exact science but it does the trick more often than not.*/ var/id = md5("[G_found.real_name][G_found.mind.assigned_role]") - for(var/datum/data/record/t in data_core.locked) + for(var/datum/data/record/t in GLOB.data_core.locked) if(t.fields["id"]==id) record_found = t//We shall now reference the record. break @@ -446,7 +446,7 @@ Traitors and the like can also be revived with the previous role mostly intact. else new_character.mind.add_antag_datum(/datum/antagonist/traitor) if("Wizard") - new_character.loc = pick(wizardstart) + new_character.loc = pick(GLOB.wizardstart) //ticker.mode.learn_basic_spells(new_character) SSticker.mode.equip_wizard(new_character) if("Syndicate") @@ -481,7 +481,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!record_found && new_character.mind.assigned_role != new_character.mind.special_role)//If there are no records for them. If they have a record, this info is already in there. Offstation special characters announced anyway. //Power to the user! if(alert(new_character,"Warning: No data core entry detected. Would you like to announce the arrival of this character by adding them to various databases, such as medical records?",,"No","Yes")=="Yes") - data_core.manifest_inject(new_character) + GLOB.data_core.manifest_inject(new_character) if(alert(new_character,"Would you like an active AI to announce this character?",,"No","Yes")=="Yes") call(/mob/new_player/proc/AnnounceArrival)(new_character, new_character.mind.assigned_role) @@ -511,7 +511,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!istext(ckey)) return 0 var/alien_caste = input(usr, "Please choose which caste to spawn.","Pick a caste",null) as null|anything in list("Queen","Hunter","Sentinel","Drone","Larva") - var/obj/effect/landmark/spawn_here = xeno_spawn.len ? pick(xeno_spawn) : pick(latejoin) + var/obj/effect/landmark/spawn_here = GLOB.xeno_spawn.len ? pick(GLOB.xeno_spawn) : pick(GLOB.latejoin) var/mob/living/carbon/alien/new_xeno switch(alien_caste) if("Queen") new_xeno = new /mob/living/carbon/alien/humanoid/queen/large(spawn_here) @@ -623,11 +623,11 @@ Traitors and the like can also be revived with the previous role mostly intact. if("Yes") var/beepsound = input(usr, "What sound should the announcement make?", "Announcement Sound", "") as anything in MsgSound - command_announcement.Announce(input, customname, MsgSound[beepsound], , , type) + GLOB.command_announcement.Announce(input, customname, MsgSound[beepsound], , , type) print_command_report(input, "[command_name()] Update") if("No") //same thing as the blob stuff - it's not public, so it's classified, dammit - command_announcer.autosay("A classified message has been printed out at all communication consoles."); + GLOB.command_announcer.autosay("A classified message has been printed out at all communication consoles."); print_command_report(input, "Classified [command_name()] Update") else return @@ -986,7 +986,7 @@ Traitors and the like can also be revived with the previous role mostly intact. else job_string = "-" key_string = H.key - if(job_string in command_positions) + if(job_string in GLOB.command_positions) job_string = "" + job_string + "" role_string = "-" obj_count = 0 @@ -1025,7 +1025,7 @@ Traitors and the like can also be revived with the previous role mostly intact. else job_string = "-" key_string = H.key - if(job_string in command_positions) + if(job_string in GLOB.command_positions) job_string = "" + job_string + "" role_string = "-" obj_count = 0 diff --git a/code/modules/admin/verbs/space_transitions.dm b/code/modules/admin/verbs/space_transitions.dm index eda17996c65..4589e5354b5 100644 --- a/code/modules/admin/verbs/space_transitions.dm +++ b/code/modules/admin/verbs/space_transitions.dm @@ -13,7 +13,7 @@ message_admins("[key_name_admin(usr)] re-assigned all space transitions") - space_manager.do_transition_setup() + GLOB.space_manager.do_transition_setup() log_admin("[key_name(usr)] re-assigned all space transitions") feedback_add_details("admin_verb","SPCRST") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -37,5 +37,5 @@ message_admins("[key_name_admin(usr)] made a space map") - space_manager.map_as_turfs(get_turf(usr)) + GLOB.space_manager.map_as_turfs(get_turf(usr)) log_admin("[key_name(usr)] made a space map") diff --git a/code/modules/admin/verbs/striketeam.dm b/code/modules/admin/verbs/striketeam.dm index a040d1cc8c3..25874d03360 100644 --- a/code/modules/admin/verbs/striketeam.dm +++ b/code/modules/admin/verbs/striketeam.dm @@ -1,13 +1,13 @@ //STRIKE TEAMS #define COMMANDOS_POSSIBLE 6 //if more Commandos are needed in the future -var/global/sent_strike_team = 0 +GLOBAL_VAR_INIT(sent_strike_team, 0) /client/proc/strike_team() if(!SSticker) to_chat(usr, "The game hasn't started yet!") return - if(sent_strike_team == 1) + if(GLOB.sent_strike_team == 1) to_chat(usr, "CentComm is already sending a team.") return if(alert("Do you want to send in the CentComm death squad? Once enabled, this is irreversible.",,"Yes","No")!="Yes") @@ -23,7 +23,7 @@ var/global/sent_strike_team = 0 if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes") return - if(sent_strike_team) + if(GLOB.sent_strike_team) to_chat(usr, "Looks like someone beat you to it.") return @@ -37,12 +37,12 @@ var/global/sent_strike_team = 0 break // Find ghosts willing to be DS - var/list/commando_ghosts = pollCandidatesWithVeto(src, usr, COMMANDOS_POSSIBLE, "Join the DeathSquad?",, 21, 600, 1, role_playtime_requirements[ROLE_DEATHSQUAD], TRUE, FALSE) + var/list/commando_ghosts = pollCandidatesWithVeto(src, usr, COMMANDOS_POSSIBLE, "Join the DeathSquad?",, 21, 600, 1, GLOB.role_playtime_requirements[ROLE_DEATHSQUAD], TRUE, FALSE) if(!commando_ghosts.len) to_chat(usr, "Nobody volunteered to join the DeathSquad.") return - sent_strike_team = 1 + GLOB.sent_strike_team = 1 // Spawns commandos and equips them. var/commando_number = COMMANDOS_POSSIBLE //for selecting a leader diff --git a/code/modules/admin/verbs/striketeam_syndicate.dm b/code/modules/admin/verbs/striketeam_syndicate.dm index 8dc2881911c..73ee5edb82d 100644 --- a/code/modules/admin/verbs/striketeam_syndicate.dm +++ b/code/modules/admin/verbs/striketeam_syndicate.dm @@ -1,7 +1,7 @@ //STRIKE TEAMS #define SYNDICATE_COMMANDOS_POSSIBLE 6 //if more Commandos are needed in the future -var/global/sent_syndicate_strike_team = 0 +GLOBAL_VAR_INIT(sent_syndicate_strike_team, 0) /client/proc/syndicate_strike_team() set category = "Event" set name = "Spawn Syndicate Strike Team" @@ -12,7 +12,7 @@ var/global/sent_syndicate_strike_team = 0 if(!SSticker) alert("The game hasn't started yet!") return - if(sent_syndicate_strike_team == 1) + if(GLOB.sent_syndicate_strike_team == 1) alert("The Syndicate are already sending a team, Mr. Dumbass.") return if(alert("Do you want to send in the Syndicate Strike Team? Once enabled, this is irreversible.",,"Yes","No")=="No") @@ -28,7 +28,7 @@ var/global/sent_syndicate_strike_team = 0 if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes") return - if(sent_syndicate_strike_team) + if(GLOB.sent_syndicate_strike_team) to_chat(src, "Looks like someone beat you to it.") return @@ -45,12 +45,12 @@ var/global/sent_syndicate_strike_team = 0 break // Find ghosts willing to be SST - var/list/commando_ghosts = pollCandidatesWithVeto(src, usr, SYNDICATE_COMMANDOS_POSSIBLE, "Join the Syndicate Strike Team?",, 21, 600, 1, role_playtime_requirements[ROLE_DEATHSQUAD], TRUE, FALSE) + var/list/commando_ghosts = pollCandidatesWithVeto(src, usr, SYNDICATE_COMMANDOS_POSSIBLE, "Join the Syndicate Strike Team?",, 21, 600, 1, GLOB.role_playtime_requirements[ROLE_DEATHSQUAD], TRUE, FALSE) if(!commando_ghosts.len) to_chat(usr, "Nobody volunteered to join the SST.") return - sent_syndicate_strike_team = 1 + GLOB.sent_syndicate_strike_team = 1 //Spawns commandos and equips them. for(var/obj/effect/landmark/L in GLOB.landmarks_list) @@ -85,7 +85,7 @@ var/global/sent_syndicate_strike_team = 0 to_chat(new_syndicate_commando, "You are an Elite Syndicate [is_leader ? "TEAM LEADER" : "commando"] in the service of the Syndicate. \nYour current mission is: [input]") new_syndicate_commando.faction += "syndicate" - var/datum/atom_hud/antag/opshud = huds[ANTAG_HUD_OPS] + var/datum/atom_hud/antag/opshud = GLOB.huds[ANTAG_HUD_OPS] opshud.join_hud(new_syndicate_commando.mind.current) set_antag_hud(new_syndicate_commando.mind.current, "hudoperative") new_syndicate_commando.regenerate_icons() diff --git a/code/modules/admin/verbs/toggledebugverbs.dm b/code/modules/admin/verbs/toggledebugverbs.dm index 85c61ac978f..216f5c3e4b0 100644 --- a/code/modules/admin/verbs/toggledebugverbs.dm +++ b/code/modules/admin/verbs/toggledebugverbs.dm @@ -1,4 +1,4 @@ -var/list/admin_verbs_show_debug_verbs = list( +GLOBAL_LIST_INIT(admin_verbs_show_debug_verbs, list( /client/proc/camera_view, /client/proc/sec_camera_report, /client/proc/intercom_view, @@ -22,7 +22,7 @@ var/list/admin_verbs_show_debug_verbs = list( /client/proc/admin_redo_space_transitions, /client/proc/make_turf_space_map, /client/proc/vv_by_ref -) +)) // Would be nice to make this a permanent admin pref so we don't need to click it each time /client/proc/enable_debug_verbs() @@ -32,6 +32,6 @@ var/list/admin_verbs_show_debug_verbs = list( if(!check_rights(R_DEBUG)) return - verbs += admin_verbs_show_debug_verbs + verbs += GLOB.admin_verbs_show_debug_verbs feedback_add_details("admin_verb","mDV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/vox_raiders.dm b/code/modules/admin/verbs/vox_raiders.dm index 3e42ebe65fb..048939a7c6d 100644 --- a/code/modules/admin/verbs/vox_raiders.dm +++ b/code/modules/admin/verbs/vox_raiders.dm @@ -1,4 +1,4 @@ -var/global/vox_tick = 1 +GLOBAL_VAR_INIT(vox_tick, 1) /mob/living/carbon/human/proc/equip_vox_raider() @@ -10,7 +10,7 @@ var/global/vox_tick = 1 equip_to_slot_or_del(new /obj/item/clothing/shoes/magboots/vox(src), slot_shoes) // REPLACE THESE WITH CODED VOX ALTERNATIVES. equip_to_slot_or_del(new /obj/item/clothing/gloves/color/yellow/vox(src), slot_gloves) // AS ABOVE. - switch(vox_tick) + switch(GLOB.vox_tick) if(1) // Vox raider! equip_to_slot_or_del(new /obj/item/clothing/suit/space/vox/carapace(src), slot_wear_suit) equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/vox/carapace(src), slot_head) @@ -59,7 +59,7 @@ var/global/vox_tick = 1 W.registered_user = src equip_to_slot_or_del(W, slot_wear_id) - vox_tick++ - if(vox_tick > 4) vox_tick = 1 + GLOB.vox_tick++ + if(GLOB.vox_tick > 4) GLOB.vox_tick = 1 return 1 diff --git a/code/modules/admin/watchlist.dm b/code/modules/admin/watchlist.dm index a908c2c264b..002a3b7ffe4 100644 --- a/code/modules/admin/watchlist.dm +++ b/code/modules/admin/watchlist.dm @@ -6,7 +6,7 @@ if(!new_ckey) return new_ckey = sanitizeSQL(new_ckey) - var/DBQuery/query_watchfind = dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE ckey = '[new_ckey]'") + var/DBQuery/query_watchfind = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE ckey = '[new_ckey]'") if(!query_watchfind.Execute()) var/err = query_watchfind.ErrorMsg() log_game("SQL ERROR obtaining ckey from player table. Error : \[[err]\]\n") @@ -29,7 +29,7 @@ if(!adminckey) return var/admin_sql_ckey = sanitizeSQL(adminckey) - var/DBQuery/query_watchadd = dbcon.NewQuery("INSERT INTO [format_table_name("watch")] (ckey, reason, adminckey, timestamp) VALUES ('[target_sql_ckey]', '[reason]', '[admin_sql_ckey]', '[timestamp]')") + var/DBQuery/query_watchadd = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("watch")] (ckey, reason, adminckey, timestamp) VALUES ('[target_sql_ckey]', '[reason]', '[admin_sql_ckey]', '[timestamp]')") if(!query_watchadd.Execute()) var/err = query_watchadd.ErrorMsg() log_game("SQL ERROR during adding new watch entry. Error : \[[err]\]\n") @@ -43,7 +43,7 @@ if(!check_rights(R_ADMIN)) return var/target_sql_ckey = sanitizeSQL(target_ckey) - var/DBQuery/query_watchdel = dbcon.NewQuery("DELETE FROM [format_table_name("watch")] WHERE ckey = '[target_sql_ckey]'") + var/DBQuery/query_watchdel = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("watch")] WHERE ckey = '[target_sql_ckey]'") if(!query_watchdel.Execute()) var/err = query_watchdel.ErrorMsg() log_game("SQL ERROR during removing watch entry. Error : \[[err]\]\n") @@ -57,7 +57,7 @@ if(!check_rights(R_ADMIN)) return var/target_sql_ckey = sanitizeSQL(target_ckey) - var/DBQuery/query_watchreason = dbcon.NewQuery("SELECT reason FROM [format_table_name("watch")] WHERE ckey = '[target_sql_ckey]'") + var/DBQuery/query_watchreason = GLOB.dbcon.NewQuery("SELECT reason FROM [format_table_name("watch")] WHERE ckey = '[target_sql_ckey]'") if(!query_watchreason.Execute()) var/err = query_watchreason.ErrorMsg() log_game("SQL ERROR obtaining reason from watch table. Error : \[[err]\]\n") @@ -71,7 +71,7 @@ var/sql_ckey = sanitizeSQL(usr.ckey) var/edit_text = "Edited by [sql_ckey] on [SQLtime()] from \"[watch_reason]\" to \"[new_reason]\"" edit_text = sanitizeSQL(edit_text) - var/DBQuery/query_watchupdate = dbcon.NewQuery("UPDATE [format_table_name("watch")] SET reason = '[new_reason]', last_editor = '[sql_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE ckey = '[target_sql_ckey]'") + var/DBQuery/query_watchupdate = GLOB.dbcon.NewQuery("UPDATE [format_table_name("watch")] SET reason = '[new_reason]', last_editor = '[sql_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE ckey = '[target_sql_ckey]'") if(!query_watchupdate.Execute()) var/err = query_watchupdate.ErrorMsg() log_game("SQL ERROR editing watchlist reason. Error : \[[err]\]\n") @@ -96,7 +96,7 @@ else search = "^." search = sanitizeSQL(search) - var/DBQuery/query_watchlist = dbcon.NewQuery("SELECT ckey, reason, adminckey, timestamp, last_editor FROM [format_table_name("watch")] WHERE ckey REGEXP '[search]' ORDER BY ckey") + var/DBQuery/query_watchlist = GLOB.dbcon.NewQuery("SELECT ckey, reason, adminckey, timestamp, last_editor FROM [format_table_name("watch")] WHERE ckey REGEXP '[search]' ORDER BY ckey") if(!query_watchlist.Execute()) var/err = query_watchlist.ErrorMsg() log_game("SQL ERROR obtaining ckey, reason, adminckey, timestamp, last_editor from watch table. Error : \[[err]\]\n") @@ -115,7 +115,7 @@ /proc/check_watchlist(target_ckey) var/target_sql_ckey = sanitizeSQL(target_ckey) - var/DBQuery/query_watch = dbcon.NewQuery("SELECT reason FROM [format_table_name("watch")] WHERE ckey = '[target_sql_ckey]'") + var/DBQuery/query_watch = GLOB.dbcon.NewQuery("SELECT reason FROM [format_table_name("watch")] WHERE ckey = '[target_sql_ckey]'") if(!query_watch.Execute()) var/err = query_watch.ErrorMsg() log_game("SQL ERROR obtaining reason from watch table. Error : \[[err]\]\n") diff --git a/code/modules/antagonists/_common/antag_hud.dm b/code/modules/antagonists/_common/antag_hud.dm index 178f84387ac..0cb800aa38d 100644 --- a/code/modules/antagonists/_common/antag_hud.dm +++ b/code/modules/antagonists/_common/antag_hud.dm @@ -47,11 +47,11 @@ newhud.join_hud(current) /datum/mind/proc/leave_all_huds() - for(var/datum/atom_hud/antag/hud in huds) + for(var/datum/atom_hud/antag/hud in GLOB.huds) if(current in hud.hudusers) hud.leave_hud(current) - for(var/datum/atom_hud/data/hud in huds) + for(var/datum/atom_hud/data/hud in GLOB.huds) if(current in hud.hudusers) hud.remove_hud_from(current) diff --git a/code/modules/antagonists/_common/antag_spawner.dm b/code/modules/antagonists/_common/antag_spawner.dm index d57c3124f61..beefc41735b 100644 --- a/code/modules/antagonists/_common/antag_spawner.dm +++ b/code/modules/antagonists/_common/antag_spawner.dm @@ -266,7 +266,7 @@ to_chat(user, "The sludge does not respond to your attempt to awake it. Perhaps you should try again later.") /obj/item/antag_spawner/morph/spawn_antag(client/C, turf/T, type = "", mob/user) - var/mob/living/simple_animal/hostile/morph/wizard/M = new /mob/living/simple_animal/hostile/morph/wizard(pick(xeno_spawn)) + var/mob/living/simple_animal/hostile/morph/wizard/M = new /mob/living/simple_animal/hostile/morph/wizard(pick(GLOB.xeno_spawn)) M.key = C.key M.mind.assigned_role = SPECIAL_ROLE_MORPH M.mind.special_role = SPECIAL_ROLE_MORPH diff --git a/code/modules/antagonists/traitor/datum_mindslave.dm b/code/modules/antagonists/traitor/datum_mindslave.dm index 5efd35715ad..6fcb4bac63a 100644 --- a/code/modules/antagonists/traitor/datum_mindslave.dm +++ b/code/modules/antagonists/traitor/datum_mindslave.dm @@ -44,10 +44,10 @@ owner.objectives -= O /datum/antagonist/mindslave/proc/update_mindslave_icons_added() - var/datum/atom_hud/antag/traitorhud = huds[ANTAG_HUD_TRAITOR] + var/datum/atom_hud/antag/traitorhud = GLOB.huds[ANTAG_HUD_TRAITOR] traitorhud.join_hud(owner.current, null) set_antag_hud(owner.current, "hudmindslave") /datum/antagonist/mindslave/proc/update_mindslave_icons_removed() - var/datum/atom_hud/antag/traitorhud = huds[ANTAG_HUD_TRAITOR] + var/datum/atom_hud/antag/traitorhud = GLOB.huds[ANTAG_HUD_TRAITOR] traitorhud.leave_hud(owner.current, null) diff --git a/code/modules/antagonists/traitor/datum_traitor.dm b/code/modules/antagonists/traitor/datum_traitor.dm index 3cd7998edd8..e13fb701317 100644 --- a/code/modules/antagonists/traitor/datum_traitor.dm +++ b/code/modules/antagonists/traitor/datum_traitor.dm @@ -118,7 +118,7 @@ var/objective_amount = config.traitor_objectives_amount - + if(is_hijacker && objective_count <= objective_amount) //Don't assign hijack if it would exceed the number of objectives set in config.traitor_objectives_amount if (!(locate(/datum/objective/hijack) in objectives)) var/datum/objective/hijack/hijack_objective = new @@ -187,7 +187,7 @@ destroy_objective.owner = owner destroy_objective.find_target() if("[destroy_objective]" in assigned_targets) // Is this target already in their list of assigned targets? If so, don't add this objective and return - return 0 + return 0 else if(destroy_objective.target) // Is the target a real one and not null? If so, add it to our list of targets to avoid duplicate targets assigned_targets.Add("[destroy_objective.target]") // This logic is applied to all traitor objectives including steal objectives add_objective(destroy_objective) @@ -221,7 +221,7 @@ else if(kill_objective.target) assigned_targets.Add("[kill_objective.target]") add_objective(kill_objective) - + else var/datum/objective/steal/steal_objective = new steal_objective.owner = owner @@ -231,7 +231,7 @@ else if(steal_objective.steal_target) assigned_targets.Add("[steal_objective.steal_target]") add_objective(steal_objective) - + /datum/antagonist/traitor/proc/forge_single_AI_objective() . = 1 @@ -251,13 +251,13 @@ /datum/antagonist/traitor/proc/update_traitor_icons_added(datum/mind/traitor_mind) - var/datum/atom_hud/antag/traitorhud = huds[ANTAG_HUD_TRAITOR] + var/datum/atom_hud/antag/traitorhud = GLOB.huds[ANTAG_HUD_TRAITOR] traitorhud.join_hud(owner.current, null) set_antag_hud(owner.current, "hudsyndicate") /datum/antagonist/traitor/proc/update_traitor_icons_removed(datum/mind/traitor_mind) - var/datum/atom_hud/antag/traitorhud = huds[ANTAG_HUD_TRAITOR] + var/datum/atom_hud/antag/traitorhud = GLOB.huds[ANTAG_HUD_TRAITOR] traitorhud.leave_hud(owner.current, null) set_antag_hud(owner.current, null) @@ -273,7 +273,7 @@ if(should_equip) equip_traitor() owner.current.playsound_local(get_turf(owner.current), 'sound/ambience/antag/tatoralert.ogg', 100, FALSE, pressure_affected = FALSE) - + /datum/antagonist/traitor/proc/give_codewords() if(!owner.current) @@ -309,7 +309,7 @@ if(traitor_kind == TRAITOR_HUMAN) var/mob/living/carbon/human/traitor_mob = owner.current - + // find a radio! toolbox(es), backpack, belt, headset var/obj/item/R = locate(/obj/item/pda) in traitor_mob.contents //Hide the uplink in a PDA if available, otherwise radio if(!R) diff --git a/code/modules/antagonists/wishgranter/wishgranter.dm b/code/modules/antagonists/wishgranter/wishgranter.dm index b5414df33bf..cb6fad39d34 100644 --- a/code/modules/antagonists/wishgranter/wishgranter.dm +++ b/code/modules/antagonists/wishgranter/wishgranter.dm @@ -22,56 +22,56 @@ if(!istype(H)) return H.ignore_gene_stability = TRUE - H.dna.SetSEState(HULKBLOCK, TRUE) - genemutcheck(H, HULKBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.hulkblock, TRUE) + genemutcheck(H, GLOB.hulkblock, null, MUTCHK_FORCED) - H.dna.SetSEState(XRAYBLOCK, TRUE) - genemutcheck(H, XRAYBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.xrayblock, TRUE) + genemutcheck(H, GLOB.xrayblock, null, MUTCHK_FORCED) - H.dna.SetSEState(FIREBLOCK, TRUE) - genemutcheck(H, FIREBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.fireblock, TRUE) + genemutcheck(H, GLOB.fireblock, null, MUTCHK_FORCED) - H.dna.SetSEState(COLDBLOCK, TRUE) - genemutcheck(H, COLDBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.coldblock, TRUE) + genemutcheck(H, GLOB.coldblock, null, MUTCHK_FORCED) - H.dna.SetSEState(TELEBLOCK, TRUE) - genemutcheck(H, TELEBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.teleblock, TRUE) + genemutcheck(H, GLOB.teleblock, null, MUTCHK_FORCED) - H.dna.SetSEState(INCREASERUNBLOCK, TRUE) - genemutcheck(H, INCREASERUNBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.increaserunblock, TRUE) + genemutcheck(H, GLOB.increaserunblock, null, MUTCHK_FORCED) - H.dna.SetSEState(BREATHLESSBLOCK, TRUE) - genemutcheck(H, BREATHLESSBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.breathlessblock, TRUE) + genemutcheck(H, GLOB.breathlessblock, null, MUTCHK_FORCED) - H.dna.SetSEState(REGENERATEBLOCK, TRUE) - genemutcheck(H, REGENERATEBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.regenerateblock, TRUE) + genemutcheck(H, GLOB.regenerateblock, null, MUTCHK_FORCED) - H.dna.SetSEState(SHOCKIMMUNITYBLOCK, TRUE) - genemutcheck(H, SHOCKIMMUNITYBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.shockimmunityblock, TRUE) + genemutcheck(H, GLOB.shockimmunityblock, null, MUTCHK_FORCED) - H.dna.SetSEState(SMALLSIZEBLOCK, TRUE) - genemutcheck(H, SMALLSIZEBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.smallsizeblock, TRUE) + genemutcheck(H, GLOB.smallsizeblock, null, MUTCHK_FORCED) - H.dna.SetSEState(SOBERBLOCK, TRUE) - genemutcheck(H, SOBERBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.soberblock, TRUE) + genemutcheck(H, GLOB.soberblock, null, MUTCHK_FORCED) - H.dna.SetSEState(PSYRESISTBLOCK, TRUE) - genemutcheck(H, PSYRESISTBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.psyresistblock, TRUE) + genemutcheck(H, GLOB.psyresistblock, null, MUTCHK_FORCED) - H.dna.SetSEState(SHADOWBLOCK, TRUE) - genemutcheck(H, SHADOWBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.shadowblock, TRUE) + genemutcheck(H, GLOB.shadowblock, null, MUTCHK_FORCED) - H.dna.SetSEState(CRYOBLOCK, TRUE) - genemutcheck(H, CRYOBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.cryoblock, TRUE) + genemutcheck(H, GLOB.cryoblock, null, MUTCHK_FORCED) - H.dna.SetSEState(EATBLOCK, TRUE) - genemutcheck(H, EATBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.eatblock, TRUE) + genemutcheck(H, GLOB.eatblock, null, MUTCHK_FORCED) - H.dna.SetSEState(JUMPBLOCK, TRUE) - genemutcheck(H, JUMPBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.jumpblock, TRUE) + genemutcheck(H, GLOB.jumpblock, null, MUTCHK_FORCED) - H.dna.SetSEState(IMMOLATEBLOCK, TRUE) - genemutcheck(H, IMMOLATEBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.immolateblock, TRUE) + genemutcheck(H, GLOB.immolateblock, null, MUTCHK_FORCED) H.mutations.Add(LASER) H.update_mutations() diff --git a/code/modules/arcade/arcade_prize.dm b/code/modules/arcade/arcade_prize.dm index 47b0ac97bf8..832d1c46649 100644 --- a/code/modules/arcade/arcade_prize.dm +++ b/code/modules/arcade/arcade_prize.dm @@ -20,7 +20,7 @@ opening = 1 playsound(src.loc, 'sound/items/bubblewrap.ogg', 30, 1, extrarange = -4, falloff = 10) icon_state = "prizeconfetti" - src.color = pick(random_color_list) + src.color = pick(GLOB.random_color_list) var/prize_inside = pick(possible_contents) spawn(10) user.unEquip(src) diff --git a/code/modules/arcade/claw_game.dm b/code/modules/arcade/claw_game.dm index 904adaffeb5..822011be3f6 100644 --- a/code/modules/arcade/claw_game.dm +++ b/code/modules/arcade/claw_game.dm @@ -1,4 +1,4 @@ -/var/claw_game_html = null +GLOBAL_VAR(claw_game_html) /obj/machinery/arcade/claw name = "Claw Game" @@ -30,8 +30,8 @@ component_parts += new /obj/item/stack/sheet/glass(null, 1) RefreshParts() - if(!claw_game_html) - claw_game_html = file2text('code/modules/arcade/crane.html') + if(!GLOB.claw_game_html) + GLOB.claw_game_html = file2text('code/modules/arcade/crane.html') /obj/machinery/arcade/claw/RefreshParts() var/bin_upgrades = 0 @@ -65,7 +65,7 @@ user << browse_rsc('page.css') for(var/i in 1 to img_resources.len) user << browse_rsc(img_resources[i]) - var/my_game_html = replacetext(claw_game_html, "/* ref src */", UID()) + var/my_game_html = replacetext(GLOB.claw_game_html, "/* ref src */", UID()) user << browse(my_game_html, "window=[window_name];size=915x600;can_resize=0") /obj/machinery/arcade/claw/Topic(href, list/href_list) diff --git a/code/modules/arcade/mob_hunt/mob_datums.dm b/code/modules/arcade/mob_hunt/mob_datums.dm index d9fc1220a79..a50fab183e6 100644 --- a/code/modules/arcade/mob_hunt/mob_datums.dm +++ b/code/modules/arcade/mob_hunt/mob_datums.dm @@ -108,7 +108,7 @@ /datum/mob_hunt/proc/get_possible_areas() var/list/possible_areas = list() //setup, sets all station areas (and subtypes) to weight 1 - for(var/A in the_station_areas) + for(var/A in GLOB.the_station_areas) if(A == /area/holodeck) //don't allow holodeck areas as possible spawns since it will allow it to spawn in the holodeck rooms on z2 as well continue if(A in possible_areas) diff --git a/code/modules/arcade/prize_counter.dm b/code/modules/arcade/prize_counter.dm index 4d1d6973909..9c8a4dea685 100644 --- a/code/modules/arcade/prize_counter.dm +++ b/code/modules/arcade/prize_counter.dm @@ -140,11 +140,11 @@ th.cost.toomuch {background:maroon;}
    "} - for(var/datum/prize_item/item in global_prizes.prizes) + for(var/datum/prize_item/item in GLOB.global_prizes.prizes) var/cost_class="affordable" if(item.cost>tickets) cost_class="toomuch" - var/itemID = global_prizes.prizes.Find(item) + var/itemID = GLOB.global_prizes.prizes.Find(item) var/row_color="light" if(itemID%2 == 0) row_color="dark" @@ -185,12 +185,12 @@ th.cost.toomuch {background:maroon;} if(href_list["buy"]) var/itemID = text2num(href_list["buy"]) - var/datum/prize_item/item = global_prizes.prizes[itemID] + var/datum/prize_item/item = GLOB.global_prizes.prizes[itemID] var/sure = alert(usr,"Are you sure you wish to purchase [item.name] for [item.cost] tickets?","You sure?","Yes","No") in list("Yes","No") if(sure=="No") updateUsrDialog() return - if(!global_prizes.PlaceOrder(src, itemID)) + if(!GLOB.global_prizes.PlaceOrder(src, itemID)) to_chat(usr, "Unable to complete the exchange.") else to_chat(usr, "You've successfully purchased the item.") diff --git a/code/modules/arcade/prize_datums.dm b/code/modules/arcade/prize_datums.dm index 8a3d598bb3d..1edad36b8f3 100644 --- a/code/modules/arcade/prize_datums.dm +++ b/code/modules/arcade/prize_datums.dm @@ -1,5 +1,4 @@ - -var/global/datum/prizes/global_prizes = new +GLOBAL_DATUM_INIT(global_prizes, /datum/prizes, new()) /datum/prizes var/list/prizes = list() @@ -14,7 +13,7 @@ var/global/datum/prizes/global_prizes = new return if(!prize_counter) return 0 - var/datum/prize_item/item = global_prizes.prizes[itemID] + var/datum/prize_item/item = GLOB.global_prizes.prizes[itemID] if(!item) return 0 if(prize_counter.tickets >= item.cost) diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm index 93db1674fa7..f774d28921f 100644 --- a/code/modules/assembly/signaler.dm +++ b/code/modules/assembly/signaler.dm @@ -127,7 +127,7 @@ var/time = time2text(world.realtime,"hh:mm:ss") var/turf/T = get_turf(src) if(usr) - lastsignalers.Add("[time] : [usr.key] used [src] @ location ([T.x],[T.y],[T.z]) : [format_frequency(frequency)]/[code]") + GLOB.lastsignalers.Add("[time] : [usr.key] used [src] @ location ([T.x],[T.y],[T.z]) : [format_frequency(frequency)]/[code]") /obj/item/assembly/signaler/pulse(var/radio = FALSE) if(connected && wires) diff --git a/code/modules/atmos_automation/console.dm b/code/modules/atmos_automation/console.dm index a810d3b08c5..8d23bb390aa 100644 --- a/code/modules/atmos_automation/console.dm +++ b/code/modules/atmos_automation/console.dm @@ -54,7 +54,7 @@ /obj/machinery/computer/general_air_control/atmos_automation/proc/selectValidChildFor(datum/automation/parent, mob/user, list/valid_returntypes) var/list/choices=list() - for(var/childtype in automation_types) + for(var/childtype in GLOB.automation_types) var/datum/automation/A = new childtype(src) if(A.returntype == null) continue @@ -217,7 +217,7 @@ testing("AAC: Null cData in root JS array.") continue var/Atype=text2path(cData["type"]) - if(!(Atype in automation_types)) + if(!(Atype in GLOB.automation_types)) testing("AAC: Unrecognized Atype [Atype].") continue var/datum/automation/A = new Atype(src) diff --git a/code/modules/atmos_automation/implementation/scrubbers.dm b/code/modules/atmos_automation/implementation/scrubbers.dm index 5be0967d9a8..54829d01cea 100644 --- a/code/modules/atmos_automation/implementation/scrubbers.dm +++ b/code/modules/atmos_automation/implementation/scrubbers.dm @@ -84,13 +84,13 @@ parent.updateUsrDialog() return 1 -var/global/list/gas_labels=list( +GLOBAL_LIST_INIT(gas_labels, list( "co2" = "CO2", "tox" = "Plasma", "n2o" = "N2O", "o2" = "O2", "n2" = "N2" -) +)) /datum/automation/set_scrubber_gasses name="Scrubber: Gasses" @@ -131,7 +131,7 @@ var/global/list/gas_labels=list( GetText() var/txt = "Set Scrubber [fmtString(scrubber)] to scrub " for(var/gas in gasses) - txt += " [gas_labels[gas]] ([gasses[gas] ? "on" : "off"])," + txt += " [GLOB.gas_labels[gas]] ([gasses[gas] ? "on" : "off"])," return txt Topic(href,href_list) diff --git a/code/modules/atmos_automation/statements.dm b/code/modules/atmos_automation/statements.dm index 1e92fcab493..3f5ed0fb6a7 100644 --- a/code/modules/atmos_automation/statements.dm +++ b/code/modules/atmos_automation/statements.dm @@ -1,4 +1,4 @@ -var/global/automation_types = subtypesof(/datum/automation) +GLOBAL_LIST_INIT(automation_types, subtypesof(/datum/automation)) #define AUTOM_RT_NULL 0 #define AUTOM_RT_NUM 1 @@ -56,7 +56,7 @@ var/global/automation_types = subtypesof(/datum/automation) if(isnull(cData) || !("type" in cData)) return null var/Atype=text2path(cData["type"]) - if(!(Atype in automation_types)) + if(!(Atype in GLOB.automation_types)) return null var/datum/automation/A = new Atype(parent) A.Import(cData) @@ -70,7 +70,7 @@ var/global/automation_types = subtypesof(/datum/automation) . += null continue var/Atype=text2path(cData["type"]) - if(!(Atype in automation_types)) + if(!(Atype in GLOB.automation_types)) continue var/datum/automation/A = new Atype(parent) A.Import(cData) diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm index 76e3fed2ebf..fc268c3ba35 100644 --- a/code/modules/awaymissions/gateway.dm +++ b/code/modules/awaymissions/gateway.dm @@ -79,7 +79,7 @@ var/obj/machinery/gateway/centerstation/the_gateway = null linked = list() //clear the list var/turf/T = loc - for(var/i in alldirs) + for(var/i in GLOB.alldirs) T = get_step(loc, i) var/obj/machinery/gateway/G = locate(/obj/machinery/gateway) in T if(G) @@ -150,7 +150,7 @@ var/obj/machinery/gateway/centerstation/the_gateway = null M.dir = SOUTH return else - var/obj/effect/landmark/dest = pick(awaydestinations) + var/obj/effect/landmark/dest = pick(GLOB.awaydestinations) if(dest) M.forceMove(dest.loc) M.dir = SOUTH @@ -197,7 +197,7 @@ var/obj/machinery/gateway/centerstation/the_gateway = null linked = list() //clear the list var/turf/T = loc - for(var/i in alldirs) + for(var/i in GLOB.alldirs) T = get_step(loc, i) var/obj/machinery/gateway/G = locate(/obj/machinery/gateway) in T if(G) diff --git a/code/modules/awaymissions/map_rng.dm b/code/modules/awaymissions/map_rng.dm index 77954eafb9f..0c1d776fa7b 100644 --- a/code/modules/awaymissions/map_rng.dm +++ b/code/modules/awaymissions/map_rng.dm @@ -17,7 +17,7 @@ if(tname) template_name = tname if(template_name) - template = map_templates[template_name] + template = GLOB.map_templates[template_name] /obj/effect/landmark/map_loader/Initialize() . = ..() @@ -47,5 +47,5 @@ ..() if(template_list) template_name = safepick(splittext(template_list, ";")) - template = map_templates[template_name] + template = GLOB.map_templates[template_name] load(template) diff --git a/code/modules/awaymissions/maploader/dmm_suite.dm b/code/modules/awaymissions/maploader/dmm_suite.dm index a4da02b4170..1eee3d8fc34 100644 --- a/code/modules/awaymissions/maploader/dmm_suite.dm +++ b/code/modules/awaymissions/maploader/dmm_suite.dm @@ -1,5 +1,4 @@ -var/global/dmm_suite/maploader = new - +GLOBAL_DATUM_INIT(maploader, /dmm_suite, new()) dmm_suite{ /* diff --git a/code/modules/awaymissions/maploader/reader.dm b/code/modules/awaymissions/maploader/reader.dm index 4d5d464e136..9a7cf6b6405 100644 --- a/code/modules/awaymissions/maploader/reader.dm +++ b/code/modules/awaymissions/maploader/reader.dm @@ -4,8 +4,8 @@ //As of 3.6.2016 //global datum that will preload variables on atoms instanciation -var/global/use_preloader = FALSE -var/global/dmm_suite/preloader/_preloader = new +GLOBAL_VAR_INIT(use_preloader, FALSE) +GLOBAL_DATUM_INIT(_preloader, /dmm_suite/preloader, new()) /dmm_suite // These regexes are global - meaning that starting the maploader again mid-load will @@ -96,7 +96,7 @@ var/global/dmm_suite/preloader/_preloader = new if(cropMap) continue else - space_manager.increase_max_zlevel_to(zcrd) //create a new z_level if needed + GLOB.space_manager.increase_max_zlevel_to(zcrd) //create a new z_level if needed bounds[MAP_MINX] = min(bounds[MAP_MINX], xcrdStart) bounds[MAP_MINZ] = min(bounds[MAP_MINZ], zcrd) @@ -156,10 +156,10 @@ var/global/dmm_suite/preloader/_preloader = new CHECK_TICK catch(var/exception/e) - _preloader.reset() + GLOB._preloader.reset() throw e - _preloader.reset() + GLOB._preloader.reset() log_debug("Loaded map in [stop_watch(watch)]s.") qdel(LM) if(bounds[MAP_MINX] == 1.#INF) // Shouldn't need to check every item @@ -271,14 +271,14 @@ var/global/dmm_suite/preloader/_preloader = new throw EXCEPTION("Oh no, I thought this was an area!") var/atom/instance - _preloader.setup(members_attributes[index])//preloader for assigning set variables on atom creation + GLOB._preloader.setup(members_attributes[index])//preloader for assigning set variables on atom creation instance = LM.area_path_to_real_area(members[index]) if(crds) instance.contents.Add(crds) - if(use_preloader && instance) - _preloader.load(instance) + if(GLOB.use_preloader && instance) + GLOB._preloader.load(instance) //then instance the /turf and, if multiple tiles are presents, simulates the DMM underlays piling effect @@ -316,7 +316,7 @@ var/global/dmm_suite/preloader/_preloader = new //Instance an atom at (x,y,z) and gives it the variables in attributes /dmm_suite/proc/instance_atom(path,list/attributes, x, y, z) var/atom/instance - _preloader.setup(attributes, path) + GLOB._preloader.setup(attributes, path) var/turf/T = locate(x,y,z) if(T) @@ -328,8 +328,8 @@ var/global/dmm_suite/preloader/_preloader = new else instance = new path (T)//first preloader pass - if(use_preloader && instance)//second preloader pass, for those atoms that don't ..() in New() - _preloader.load(instance) + if(GLOB.use_preloader && instance)//second preloader pass, for those atoms that don't ..() in New() + GLOB._preloader.load(instance) return instance @@ -439,7 +439,7 @@ var/global/dmm_suite/preloader/_preloader = new json_ready = 0 if("map_json_data" in the_attributes) json_ready = 1 - use_preloader = TRUE + GLOB.use_preloader = TRUE attributes = the_attributes target_path = path @@ -458,11 +458,11 @@ var/global/dmm_suite/preloader/_preloader = new if(islist(value)) value = deepCopyList(value) what.vars[attribute] = value - use_preloader = FALSE + GLOB.use_preloader = FALSE // If the map loader fails, make this safe /dmm_suite/preloader/proc/reset() - use_preloader = FALSE + GLOB.use_preloader = FALSE attributes = list() target_path = null diff --git a/code/modules/awaymissions/mission_code/academy.dm b/code/modules/awaymissions/mission_code/academy.dm index f8d66058199..7cddddd8b08 100644 --- a/code/modules/awaymissions/mission_code/academy.dm +++ b/code/modules/awaymissions/mission_code/academy.dm @@ -108,7 +108,7 @@ if(3) //Swarm of creatures T.visible_message("A swarm of creatures surround [user]!") - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) new /mob/living/simple_animal/hostile/netherworld(get_step(get_turf(user),direction)) if(4) //Destroy Equipment @@ -131,7 +131,7 @@ T.visible_message("Unseen forces throw [user]!") user.Stun(6) user.adjustBruteLoss(50) - var/throw_dir = cardinal + var/throw_dir = GLOB.cardinal var/atom/throw_target = get_edge_target_turf(user, throw_dir) user.throw_at(throw_target, 200, 4) if(8) @@ -160,7 +160,7 @@ //Mad Dosh T.visible_message("Mad dosh shoots out of [src]!") var/turf/Start = get_turf(src) - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) var/turf/dirturf = get_step(Start,direction) if(rand(0,1)) new /obj/item/stack/spacecash/c1000(dirturf) @@ -255,7 +255,7 @@ if(!target_mob) return var/turf/Start = get_turf(user) - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) var/turf/T = get_step(Start,direction) if(!T.density) target_mob.Move(T) diff --git a/code/modules/awaymissions/mission_code/stationCollision.dm b/code/modules/awaymissions/mission_code/stationCollision.dm index deab7570d3a..1beba373724 100644 --- a/code/modules/awaymissions/mission_code/stationCollision.dm +++ b/code/modules/awaymissions/mission_code/stationCollision.dm @@ -94,11 +94,11 @@ obj/item/gun/energy/laser/retro/sc_retro */ //These vars hold the code itself, they'll be generated at round-start -var/sc_safecode1 = "[rand(0,9)]" -var/sc_safecode2 = "[rand(0,9)]" -var/sc_safecode3 = "[rand(0,9)]" -var/sc_safecode4 = "[rand(0,9)]" -var/sc_safecode5 = "[rand(0,9)]" +GLOBAL_VAR_INIT(sc_safecode1, "[rand(0,9)]") // Do these even need to be strings? Probably for the best +GLOBAL_VAR_INIT(sc_safecode2, "[rand(0,9)]") +GLOBAL_VAR_INIT(sc_safecode3, "[rand(0,9)]") +GLOBAL_VAR_INIT(sc_safecode4, "[rand(0,9)]") +GLOBAL_VAR_INIT(sc_safecode5, "[rand(0,9)]") //Pieces of paper actually containing the hints /obj/item/paper/sc_safehint_paper_prison @@ -106,13 +106,13 @@ var/sc_safecode5 = "[rand(0,9)]" /obj/item/paper/sc_safehint_paper_prison/New() ..() - info = "The ink is smudged, you can only make out a couple numbers: '[sc_safecode1]**[sc_safecode4]*'" + info = "The ink is smudged, you can only make out a couple numbers: '[GLOB.sc_safecode1]**[GLOB.sc_safecode4]*'" /obj/item/paper/sc_safehint_paper_hydro name = "shredded paper" /obj/item/paper/sc_safehint_paper_hydro/New() ..() - info = "Although the paper is shredded, you can clearly see the number: '[sc_safecode2]'" + info = "Although the paper is shredded, you can clearly see the number: '[GLOB.sc_safecode2]'" /obj/item/paper/sc_safehint_paper_caf name = "blood-soaked paper" @@ -124,7 +124,7 @@ var/sc_safecode5 = "[rand(0,9)]" /obj/item/paper/sc_safehint_paper_bible/New() ..() info = {"It would appear that the pen hidden with the paper had leaked ink over the paper. - However you can make out the last three digits:'[sc_safecode3][sc_safecode4][sc_safecode5]' + However you can make out the last three digits:'[GLOB.sc_safecode3][GLOB.sc_safecode4][GLOB.sc_safecode5]' "} /obj/item/paper/sc_safehint_paper_shuttle @@ -148,7 +148,7 @@ var/sc_safecode5 = "[rand(0,9)]" /obj/item/storage/secure/safe/sc_ssafe/New() ..() - l_code = "[sc_safecode1][sc_safecode2][sc_safecode3][sc_safecode4][sc_safecode5]" + l_code = "[GLOB.sc_safecode1][GLOB.sc_safecode2][GLOB.sc_safecode3][GLOB.sc_safecode4][GLOB.sc_safecode5]" l_set = 1 new /obj/item/gun/energy/mindflayer(src) new /obj/item/soulstone(src) diff --git a/code/modules/awaymissions/zlevel.dm b/code/modules/awaymissions/zlevel.dm index c406a76cb73..96c5f080a14 100644 --- a/code/modules/awaymissions/zlevel.dm +++ b/code/modules/awaymissions/zlevel.dm @@ -1,4 +1,4 @@ -var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away_mission_config.txt") +GLOBAL_LIST_INIT(potentialRandomZlevels, generateMapList(filename = "config/away_mission_config.txt")) // Call this before you remove the last dirt on a z level - that way, all objects // will have proper atmos and other important enviro things @@ -39,27 +39,27 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away T.ChangeTurf(T.baseturf) /proc/createRandomZlevel() - if(awaydestinations.len) //crude, but it saves another var! + if(GLOB.awaydestinations.len) //crude, but it saves another var! return - if(potentialRandomZlevels && potentialRandomZlevels.len) + if(GLOB.potentialRandomZlevels && GLOB.potentialRandomZlevels.len) var/watch = start_watch() log_startup_progress("Loading away mission...") - var/map = pick(potentialRandomZlevels) + var/map = pick(GLOB.potentialRandomZlevels) var/file = file(map) if(isfile(file)) - var/zlev = space_manager.add_new_zlevel(AWAY_MISSION, linkage = UNAFFECTED, traits = list(AWAY_LEVEL,BLOCK_TELEPORT)) - space_manager.add_dirt(zlev) - maploader.load_map(file, z_offset = zlev) + var/zlev = GLOB.space_manager.add_new_zlevel(AWAY_MISSION, linkage = UNAFFECTED, traits = list(AWAY_LEVEL,BLOCK_TELEPORT)) + GLOB.space_manager.add_dirt(zlev) + GLOB.maploader.load_map(file, z_offset = zlev) late_setup_level(block(locate(1, 1, zlev), locate(world.maxx, world.maxy, zlev))) - space_manager.remove_dirt(zlev) + GLOB.space_manager.remove_dirt(zlev) log_world(" Away mission loaded: [map]") for(var/obj/effect/landmark/L in GLOB.landmarks_list) if(L.name != "awaystart") continue - awaydestinations.Add(L) + GLOB.awaydestinations.Add(L) log_startup_progress(" Away mission loaded in [stop_watch(watch)]s.") @@ -69,22 +69,22 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away /proc/createALLZlevels() - if(awaydestinations.len) //crude, but it saves another var! + if(GLOB.awaydestinations.len) //crude, but it saves another var! return - if(potentialRandomZlevels && potentialRandomZlevels.len) + if(GLOB.potentialRandomZlevels && GLOB.potentialRandomZlevels.len) var/watch = start_watch() log_startup_progress("Loading away missions...") - for(var/map in potentialRandomZlevels) + for(var/map in GLOB.potentialRandomZlevels) var/file = file(map) if(isfile(file)) log_startup_progress("Loading away mission: [map]") - var/zlev = space_manager.add_new_zlevel() - space_manager.add_dirt(zlev) - maploader.load_map(file, z_offset = zlev) + var/zlev = GLOB.space_manager.add_new_zlevel() + GLOB.space_manager.add_dirt(zlev) + GLOB.maploader.load_map(file, z_offset = zlev) late_setup_level(block(locate(1, 1, zlev), locate(world.maxx, world.maxy, zlev))) - space_manager.remove_dirt(zlev) + GLOB.space_manager.remove_dirt(zlev) log_world(" Away mission loaded: [map]") //map_transition_config.Add(AWAY_MISSION_LIST) @@ -92,7 +92,7 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away for(var/obj/effect/landmark/L in GLOB.landmarks_list) if(L.name != "awaystart") continue - awaydestinations.Add(L) + GLOB.awaydestinations.Add(L) log_startup_progress(" Away mission loaded in [stop_watch(watch)]s.") watch = start_watch() diff --git a/code/modules/buildmode/bm_mode.dm b/code/modules/buildmode/bm_mode.dm index 1ce23555e3e..0169df7cd62 100644 --- a/code/modules/buildmode/bm_mode.dm +++ b/code/modules/buildmode/bm_mode.dm @@ -47,11 +47,11 @@ overlaystate = "blueOverlay" preview += image('icons/turf/overlays.dmi', T, overlaystate) BM.holder.images += preview - return T + return T /datum/buildmode_mode/proc/highlight_region(region) BM.holder.images -= preview - for(var/t in region) + for(var/T in region) preview += image('icons/turf/overlays.dmi', T, "redOverlay") BM.holder.images += preview diff --git a/code/modules/buildmode/submodes/save.dm b/code/modules/buildmode/submodes/save.dm index 43a1f9af174..34a57e1f7e4 100644 --- a/code/modules/buildmode/submodes/save.dm +++ b/code/modules/buildmode/submodes/save.dm @@ -3,7 +3,7 @@ use_corner_selection = TRUE var/use_json = TRUE - + /datum/buildmode_mode/save/show_help(mob/user) to_chat(user, "***********************************************************") to_chat(user, "Left Mouse Button on turf/obj/mob = Select corner") @@ -23,6 +23,6 @@ if(use_json) map_flags = 32 // Magic number defined in `writer.dm` that I can't use directly // because #defines are for some reason our coding standard - var/our_map = maploader.save_map(cornerA, cornerB, map_name, map_flags) + var/our_map = GLOB.maploader.save_map(cornerA, cornerB, map_name, map_flags) user << ftp(our_map) // send the map they've made! Or are stealing, whatever to_chat(user, "Map saving complete! [our_map]") diff --git a/code/modules/busy_space/air_traffic.dm b/code/modules/busy_space/air_traffic.dm index a7f28f49fb6..e21414e8ed3 100644 --- a/code/modules/busy_space/air_traffic.dm +++ b/code/modules/busy_space/air_traffic.dm @@ -1,6 +1,5 @@ //Cactus, Speedbird, Dynasty, oh my - -var/datum/lore/atc_controller/atc = new/datum/lore/atc_controller +GLOBAL_DATUM_INIT(atc, /datum/lore/atc_controller, new) /datum/lore/atc_controller var/delay_max = 10 MINUTES //Maximum amount of tiem between ATC messages. Default is 10 mins. @@ -30,29 +29,29 @@ var/datum/lore/atc_controller/atc = new/datum/lore/atc_controller /datum/lore/atc_controller/proc/msg(var/message,var/sender) ASSERT(message) - global_announcer.autosay("[message]", sender ? sender : "[using_map.station_short] Space Control") + GLOB.global_announcer.autosay("[message]", sender ? sender : "[GLOB.using_map.station_short] Space Control") /datum/lore/atc_controller/proc/reroute_traffic(var/yes = 1) if(yes) if(!squelched) - msg("Rerouting traffic away from [using_map.station_name].") + msg("Rerouting traffic away from [GLOB.using_map.station_name].") squelched = TRUE else if(squelched) - msg("Resuming normal traffic routing around [using_map.station_name].") + msg("Resuming normal traffic routing around [GLOB.using_map.station_name].") squelched = FALSE /datum/lore/atc_controller/proc/shift_ending(var/evac = 0) - msg("Automated Shuttle departing [using_map.station_name] for [using_map.dock_name] on routine transfer route.", "NT Automated Shuttle") + msg("Automated Shuttle departing [GLOB.using_map.station_name] for [GLOB.using_map.dock_name] on routine transfer route.", "NT Automated Shuttle") sleep(5 SECONDS) - msg("Automated Shuttle, cleared to complete routine transfer from [using_map.station_name] to [using_map.dock_name].") + msg("Automated Shuttle, cleared to complete routine transfer from [GLOB.using_map.station_name] to [GLOB.using_map.dock_name].") /datum/lore/atc_controller/proc/random_convo() - var/one = pick(loremaster.organizations) //These will pick an index, not an instance - var/two = pick(loremaster.organizations) + var/one = pick(GLOB.loremaster.organizations) //These will pick an index, not an instance + var/two = pick(GLOB.loremaster.organizations) - var/datum/lore/organization/source = loremaster.organizations[one] //Resolve to the instances - var/datum/lore/organization/dest = loremaster.organizations[two] + var/datum/lore/organization/source = GLOB.loremaster.organizations[one] //Resolve to the instances + var/datum/lore/organization/dest = GLOB.loremaster.organizations[two] //Let's get some mission parameters var/owner = source.short_name //Use the short name @@ -62,13 +61,13 @@ var/datum/lore/atc_controller/atc = new/datum/lore/atc_controller var/destname = pick(dest.destination_names) //Pick a random holding from the destination var/combined_name = "[owner] [prefix] [shipname]" - var/alt_atc_names = list("[using_map.station_short] TraCon", "[using_map.station_short] Control", "[using_map.station_short] STC", "[using_map.station_short] Airspace") - var/wrong_atc_names = list("Sol Command", "Orion Control", "[using_map.dock_name]") + var/alt_atc_names = list("[GLOB.using_map.station_short] TraCon", "[GLOB.using_map.station_short] Control", "[GLOB.using_map.station_short] STC", "[GLOB.using_map.station_short] Airspace") + var/wrong_atc_names = list("Sol Command", "Orion Control", "[GLOB.using_map.dock_name]") var/mission_noun = list("flight", "mission", "route") var/request_verb = list("requesting", "calling for", "asking for") //First response is 'yes', second is 'no' - var/requests = list("[using_map.station_short] transit clearance" = list("cleared to transit", "unable to approve, contact regional on 953.5"), + var/requests = list("[GLOB.using_map.station_short] transit clearance" = list("cleared to transit", "unable to approve, contact regional on 953.5"), "planetary flight rules" = list("cleared planetary flight rules", "unable to approve planetary flight rules due to traffic"), "special flight rules" = list("cleared special flight rules", "unable to approve special flight rules for your traffic class"), "current solar weather info" = list("sending you the relevant information via tightbeam", "cannot fulfill your request at the moment"), @@ -104,20 +103,20 @@ var/datum/lore/atc_controller/atc = new/datum/lore/atc_controller if("wrong_freq") callname = pick(wrong_atc_names) full_request = "[callname], this is [combined_name] on a [mission] [pick(mission_noun)] to [destname], [pick(request_verb)] [request]." - full_response = "[combined_name], this is [using_map.station_short] TraCon, wrong frequency. Switch to [rand(700,999)].[rand(1,9)]." - full_closure = "[using_map.station_short] TraCon, copy, apologies." + full_response = "[combined_name], this is [GLOB.using_map.station_short] TraCon, wrong frequency. Switch to [rand(700,999)].[rand(1,9)]." + full_closure = "[GLOB.using_map.station_short] TraCon, copy, apologies." if("wrong_lang") //Can't implement this until autosay has language support if("emerg") var/problem = pick("hull breaches on multiple decks","unknown life forms on board","a drive about to go critical","asteroids impacting the hull","a total loss of engine power","people trying to board the ship") full_request = "Mayday, mayday, mayday, this is [combined_name] declaring an emergency! We have [problem]!" var/rand_freq = "[rand(700,999)].[rand(1,9)]" - full_response = "[combined_name], this is [using_map.station_short] TraCon, copy. Switch to emergency responder channel [rand_freq]." - full_closure = "Roger, [using_map.station_short] TraCon, contacting [rand_freq]." + full_response = "[combined_name], this is [GLOB.using_map.station_short] TraCon, copy. Switch to emergency responder channel [rand_freq]." + full_closure = "Roger, [GLOB.using_map.station_short] TraCon, contacting [rand_freq]." else full_request = "[callname], this is [combined_name] on a [mission] [pick(mission_noun)] to [destname], [pick(request_verb)] [request]." - full_response = "[combined_name], this is [using_map.station_short] TraCon, [response]." //Station TraCon always calls themselves TraCon - full_closure = "[using_map.station_short] TraCon, [yes ? "thank you" : "copy"], good day." //They always copy what TraCon called themselves in the end when they realize they said it wrong + full_response = "[combined_name], this is [GLOB.using_map.station_short] TraCon, [response]." //Station TraCon always calls themselves TraCon + full_closure = "[GLOB.using_map.station_short] TraCon, [yes ? "thank you" : "copy"], good day." //They always copy what TraCon called themselves in the end when they realize they said it wrong //Ship sends request to ATC msg(full_request,"[prefix] [shipname]") diff --git a/code/modules/busy_space/loremaster.dm b/code/modules/busy_space/loremaster.dm index 28dca0055b0..77b8a8ed53d 100644 --- a/code/modules/busy_space/loremaster.dm +++ b/code/modules/busy_space/loremaster.dm @@ -1,6 +1,5 @@ //I AM THE LOREMASTER, ARE YOU THE GATEKEEPER? - -var/datum/lore/loremaster/loremaster = new/datum/lore/loremaster +GLOBAL_DATUM_INIT(loremaster, /datum/lore/loremaster, new) /datum/lore/loremaster var/list/organizations = list() diff --git a/code/modules/busy_space/organizations.dm b/code/modules/busy_space/organizations.dm index df86aefd75e..c39e92ea49e 100644 --- a/code/modules/busy_space/organizations.dm +++ b/code/modules/busy_space/organizations.dm @@ -123,7 +123,7 @@ ..() spawn(1) // BYOND shenanigans means using_map is not initialized yet. Wait a tick. // Get rid of the current map from the list, so ships flying in don't say they're coming to the current map. - var/string_to_test = "[using_map.station_name] in [using_map.starsys_name]" + var/string_to_test = "[GLOB.using_map.station_name] in [GLOB.using_map.starsys_name]" if(string_to_test in destination_names) destination_names.Remove(string_to_test) diff --git a/code/modules/client/asset_cache.dm b/code/modules/client/asset_cache.dm index 57a6df32ab6..b29482a73cc 100644 --- a/code/modules/client/asset_cache.dm +++ b/code/modules/client/asset_cache.dm @@ -147,16 +147,16 @@ You can set verify to TRUE if you want send() to sleep until the client has the //These datums are used to populate the asset cache, the proc "register()" does this. //all of our asset datums, used for referring to these later -/var/global/list/asset_datums = list() +GLOBAL_LIST_EMPTY(asset_datums) //get a assetdatum or make a new one /proc/get_asset_datum(var/type) - if(!(type in asset_datums)) + if(!(type in GLOB.asset_datums)) return new type() - return asset_datums[type] + return GLOB.asset_datums[type] /datum/asset/New() - asset_datums[type] = src + GLOB.asset_datums[type] = src /datum/asset/proc/register() return @@ -313,14 +313,14 @@ You can set verify to TRUE if you want send() to sleep until the client has the if(!(state in list("cap", "connector", "dtvalve", "dual-port vent", "dvalve", "filter", "he", "heunary", "injector", "junction", "manifold", "mixer", "tvalve", "mvalve", "passive vent", "passivegate", "pump", "scrubber", "simple", "universal", "uvent", "volumepump"))) //Basically all the pipes we want sprites for continue if(state in list("he", "simple")) - for(var/D in alldirs) + for(var/D in GLOB.alldirs) assets["[state]-[dir2text(D)].png"] = icon('icons/obj/pipe-item.dmi', state, D) - for(var/D in cardinal) + for(var/D in GLOB.cardinal) assets["[state]-[dir2text(D)].png"] = icon('icons/obj/pipe-item.dmi', state, D) for(var/state in icon_states('icons/obj/pipes/disposal.dmi')) if(!(state in list("pipe-c", "pipe-j1", "pipe-s", "pipe-t", "pipe-y", "intake", "outlet", "pipe-j1s"))) //Pipes we want sprites for continue - for(var/D in cardinal) + for(var/D in GLOB.cardinal) assets["[state]-[dir2text(D)].png"] = icon('icons/obj/pipes/disposal.dmi', state, D) for(var/asset_name in assets) register_asset(asset_name, assets[asset_name]) diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index e504a796052..efe609a8a56 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -319,16 +319,16 @@ if(!config.disable_localhost_admin) if(is_connecting_from_localhost()) new /datum/admins("!LOCALHOST!", R_HOST, ckey) // Makes localhost rank - holder = admin_datums[ckey] + holder = GLOB.admin_datums[ckey] if(holder) GLOB.admins += src holder.owner = src //preferences datum - also holds some persistant data for the client (because we may as well keep these datums to a minimum) - prefs = preferences_datums[ckey] + prefs = GLOB.preferences_datums[ckey] if(!prefs) prefs = new /datum/preferences(src) - preferences_datums[ckey] = prefs + GLOB.preferences_datums[ckey] = prefs else prefs.parent = src prefs.last_ip = address //these are gonna be used for banning @@ -339,8 +339,8 @@ spawn() // Goonchat does some non-instant checks in start() chatOutput.start() - if( (world.address == address || !address) && !host ) - host = key + if( (world.address == address || !address) && !GLOB.host ) + GLOB.host = key world.update_status() if(holder) @@ -376,7 +376,7 @@ if(establish_db_connection()) activate_darkmode() - if(prefs.lastchangelog != changelog_hash) //bolds the changelog button on the interface so we know there are updates. -CP + if(prefs.lastchangelog != GLOB.changelog_hash) //bolds the changelog button on the interface so we know there are updates. -CP if(establish_db_connection()) to_chat(src, "Changelog has changed since your last visit.") update_changelog_button() @@ -393,10 +393,10 @@ check_forum_link() - if(custom_event_msg && custom_event_msg != "") + if(GLOB.custom_event_msg && GLOB.custom_event_msg != "") to_chat(src, "

    Custom Event

    ") to_chat(src, "

    A custom event is taking place. OOC Info:

    ") - to_chat(src, "[html_encode(custom_event_msg)]") + to_chat(src, "[html_encode(GLOB.custom_event_msg)]") to_chat(src, "
    ") if(!winexists(src, "asset_cache_browser")) // The client is using a custom skin, tell them. @@ -452,7 +452,7 @@ return establish_db_connection() - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) return if(check_rights(R_ADMIN, 0, mob)) // Yes, the mob is required, regardless of other examples in this file, it won't work otherwise @@ -461,7 +461,7 @@ return //Donator stuff. - var/DBQuery/query_donor_select = dbcon.NewQuery("SELECT ckey, tier, active FROM `[format_table_name("donators")]` WHERE ckey = '[ckey]'") + var/DBQuery/query_donor_select = GLOB.dbcon.NewQuery("SELECT ckey, tier, active FROM `[format_table_name("donators")]` WHERE ckey = '[ckey]'") query_donor_select.Execute() while(query_donor_select.NextRow()) if(!text2num(query_donor_select.item[3])) @@ -482,11 +482,11 @@ establish_db_connection() - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) return - var/DBQuery/query = dbcon.NewQuery("SELECT id, datediff(Now(),firstseen) as age FROM [format_table_name("player")] WHERE ckey = '[ckey]'") + var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT id, datediff(Now(),firstseen) as age FROM [format_table_name("player")] WHERE ckey = '[ckey]'") query.Execute() var/sql_id = 0 player_age = 0 // New players won't have an entry so knowing we have a connection we set this to zero to be updated if there is a record. @@ -496,7 +496,7 @@ break - var/DBQuery/query_ip = dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE ip = '[address]'") + var/DBQuery/query_ip = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE ip = '[address]'") query_ip.Execute() related_accounts_ip = list() while(query_ip.NextRow()) @@ -504,7 +504,7 @@ related_accounts_ip.Add("[query_ip.item[1]]") - var/DBQuery/query_cid = dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE computerid = '[computer_id]'") + var/DBQuery/query_cid = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE computerid = '[computer_id]'") query_cid.Execute() related_accounts_cid = list() while(query_cid.NextRow()) @@ -546,7 +546,7 @@ if(sql_id) //Player already identified previously, we need to just update the 'lastseen', 'ip' and 'computer_id' variables - var/DBQuery/query_update = dbcon.NewQuery("UPDATE [format_table_name("player")] SET lastseen = Now(), ip = '[sql_ip]', computerid = '[sql_computerid]', lastadminrank = '[sql_admin_rank]' WHERE id = [sql_id]") + var/DBQuery/query_update = GLOB.dbcon.NewQuery("UPDATE [format_table_name("player")] SET lastseen = Now(), ip = '[sql_ip]', computerid = '[sql_computerid]', lastadminrank = '[sql_admin_rank]' WHERE id = [sql_id]") if(!query_update.Execute()) var/err = query_update.ErrorMsg() log_game("SQL ERROR during log_client_to_db (update). Error : \[[err]\]\n") @@ -561,14 +561,14 @@ del(src) return // Dont insert or they can just go in again - var/DBQuery/query_insert = dbcon.NewQuery("INSERT INTO [format_table_name("player")] (id, ckey, firstseen, lastseen, ip, computerid, lastadminrank) VALUES (null, '[ckey]', Now(), Now(), '[sql_ip]', '[sql_computerid]', '[sql_admin_rank]')") + var/DBQuery/query_insert = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("player")] (id, ckey, firstseen, lastseen, ip, computerid, lastadminrank) VALUES (null, '[ckey]', Now(), Now(), '[sql_ip]', '[sql_computerid]', '[sql_admin_rank]')") if(!query_insert.Execute()) var/err = query_insert.ErrorMsg() log_game("SQL ERROR during log_client_to_db (insert). Error : \[[err]\]\n") message_admins("SQL ERROR during log_client_to_db (insert). Error : \[[err]\]\n") // Log player connections to DB - var/DBQuery/query_accesslog = dbcon.NewQuery("INSERT INTO `[format_table_name("connection_log")]`(`datetime`,`ckey`,`ip`,`computerid`) VALUES(Now(),'[ckey]','[sql_ip]','[sql_computerid]');") + var/DBQuery/query_accesslog = GLOB.dbcon.NewQuery("INSERT INTO `[format_table_name("connection_log")]`(`datetime`,`ckey`,`ip`,`computerid`) VALUES(Now(),'[ckey]','[sql_ip]','[sql_computerid]');") query_accesslog.Execute() /client/proc/check_ip_intel() @@ -616,14 +616,14 @@ to_chat(src, "You have no verified forum account. VERIFY FORUM ACCOUNT") /client/proc/create_oauth_token() - var/DBQuery/query_find_token = dbcon.NewQuery("SELECT token FROM [format_table_name("oauth_tokens")] WHERE ckey = '[ckey]' limit 1") + var/DBQuery/query_find_token = GLOB.dbcon.NewQuery("SELECT token FROM [format_table_name("oauth_tokens")] WHERE ckey = '[ckey]' limit 1") if(!query_find_token.Execute()) log_debug("create_oauth_token: failed db read") return if(query_find_token.NextRow()) return query_find_token.item[1] var/tokenstr = md5("[ckey][rand()]") - var/DBQuery/query_insert_token = dbcon.NewQuery("INSERT INTO [format_table_name("oauth_tokens")] (ckey, token) VALUES('[ckey]','[tokenstr]')") + var/DBQuery/query_insert_token = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("oauth_tokens")] (ckey, token) VALUES('[ckey]','[tokenstr]')") if(!query_insert_token.Execute()) return return tokenstr @@ -638,7 +638,7 @@ if(!fromban) to_chat(src, "Your forum account is already set.") return - var/DBQuery/query_find_link = dbcon.NewQuery("SELECT fuid FROM [format_table_name("player")] WHERE ckey = '[ckey]' limit 1") + var/DBQuery/query_find_link = GLOB.dbcon.NewQuery("SELECT fuid FROM [format_table_name("player")] WHERE ckey = '[ckey]' limit 1") if(!query_find_link.Execute()) log_debug("link_forum_account: failed db read") return @@ -682,7 +682,7 @@ var/oldcid = cidcheck[ckey] if(!oldcid) - var/DBQuery/query_cidcheck = dbcon.NewQuery("SELECT computerid FROM [format_table_name("player")] WHERE ckey = '[ckey]'") + var/DBQuery/query_cidcheck = GLOB.dbcon.NewQuery("SELECT computerid FROM [format_table_name("player")] WHERE ckey = '[ckey]'") query_cidcheck.Execute() var/lastcid = computer_id @@ -747,7 +747,7 @@ var/const/adminckey = "CID-Error" // Check for notes in the last day - only 1 note per 24 hours - var/DBQuery/query_get_notes = dbcon.NewQuery("SELECT id from [format_table_name("notes")] WHERE ckey = '[ckey]' AND adminckey = '[adminckey]' AND timestamp + INTERVAL 1 DAY < NOW()") + var/DBQuery/query_get_notes = GLOB.dbcon.NewQuery("SELECT id from [format_table_name("notes")] WHERE ckey = '[ckey]' AND adminckey = '[adminckey]' AND timestamp + INTERVAL 1 DAY < NOW()") if(!query_get_notes.Execute()) var/err = query_get_notes.ErrorMsg() log_game("SQL ERROR obtaining id from notes table. Error : \[[err]\]\n") @@ -756,7 +756,7 @@ return // Only add a note if their most recent note isn't from the randomizer blocker, either - query_get_notes = dbcon.NewQuery("SELECT adminckey FROM [format_table_name("notes")] WHERE ckey = '[ckey]' ORDER BY timestamp DESC LIMIT 1") + query_get_notes = GLOB.dbcon.NewQuery("SELECT adminckey FROM [format_table_name("notes")] WHERE ckey = '[ckey]' ORDER BY timestamp DESC LIMIT 1") if(!query_get_notes.Execute()) var/err = query_get_notes.ErrorMsg() log_game("SQL ERROR obtaining adminckey from notes table. Error : \[[err]\]\n") @@ -890,7 +890,7 @@ // Better changelog button handling /client/proc/update_changelog_button() if(establish_db_connection()) - if(prefs.lastchangelog != changelog_hash) + if(prefs.lastchangelog != GLOB.changelog_hash) winset(src, "rpane.changelog", "background-color=#bb7700;text-color=#FFFFFF;font-style=bold") else if(prefs.toggles & UI_DARKMODE) diff --git a/code/modules/client/preference/loadout/gear_tweaks.dm b/code/modules/client/preference/loadout/gear_tweaks.dm index 6458a51b9a3..9446008b762 100644 --- a/code/modules/client/preference/loadout/gear_tweaks.dm +++ b/code/modules/client/preference/loadout/gear_tweaks.dm @@ -16,8 +16,7 @@ /* * Color adjustment */ - -var/datum/gear_tweak/color/gear_tweak_free_color_choice = new() +GLOBAL_DATUM_INIT(gear_tweak_free_color_choice, /datum/gear_tweak/color, new()) /datum/gear_tweak/color var/list/valid_colors diff --git a/code/modules/client/preference/loadout/loadout.dm b/code/modules/client/preference/loadout/loadout.dm index 63825cc1237..1091b38a11c 100644 --- a/code/modules/client/preference/loadout/loadout.dm +++ b/code/modules/client/preference/loadout/loadout.dm @@ -1,5 +1,5 @@ -var/list/loadout_categories = list() -var/list/gear_datums = list() +GLOBAL_LIST_EMPTY(loadout_categories) +GLOBAL_LIST_EMPTY(gear_datums) /datum/loadout_category var/category = "" @@ -30,15 +30,15 @@ var/list/gear_datums = list() error("Loadout - Missing path definition: [G]") continue - if(!loadout_categories[use_category]) - loadout_categories[use_category] = new /datum/loadout_category(use_category) - var/datum/loadout_category/LC = loadout_categories[use_category] - gear_datums[use_name] = new geartype - LC.gear[use_name] = gear_datums[use_name] + if(!GLOB.loadout_categories[use_category]) + GLOB.loadout_categories[use_category] = new /datum/loadout_category(use_category) + var/datum/loadout_category/LC = GLOB.loadout_categories[use_category] + GLOB.gear_datums[use_name] = new geartype + LC.gear[use_name] = GLOB.gear_datums[use_name] - loadout_categories = sortAssoc(loadout_categories) - for(var/loadout_category in loadout_categories) - var/datum/loadout_category/LC = loadout_categories[loadout_category] + GLOB.loadout_categories = sortAssoc(GLOB.loadout_categories) + for(var/loadout_category in GLOB.loadout_categories) + var/datum/loadout_category/LC = GLOB.loadout_categories[loadout_category] LC.gear = sortAssoc(LC.gear) return 1 diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index 4e8ef94aeec..ff3a5168868 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -1,6 +1,7 @@ -var/list/preferences_datums = list() +GLOBAL_LIST_EMPTY(preferences_datums) +GLOBAL_PROTECT(preferences_datums) // These feel like something that shouldnt be fucked with -var/global/list/special_role_times = list( //minimum age (in days) for accounts to play these roles +GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts to play these roles ROLE_PAI = 0, ROLE_POSIBRAIN = 0, ROLE_GUARDIAN = 0, @@ -24,7 +25,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts ROLE_GSPIDER = 21, ROLE_ABDUCTOR = 30, ROLE_DEVIL = 14 -) +)) /proc/player_old_enough_antag(client/C, role) if(available_in_days_antag(C, role)) @@ -42,7 +43,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts return 0 if(!isnum(C.player_age)) return 0 //This is only a number if the db connection is established, otherwise it is text: "Requires database", meaning these restrictions cannot be enforced - var/minimal_player_age_antag = special_role_times[num2text(role)] + var/minimal_player_age_antag = GLOB.special_role_times[num2text(role)] if(!isnum(minimal_player_age_antag)) return 0 @@ -343,11 +344,11 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts dat += "Eyes: " dat += "Color [color_square(e_colour)]
    " - if((S.bodyflags & HAS_SKIN_COLOR) || body_accessory_by_species[species] || check_rights(R_ADMIN, 0, user)) //admins can always fuck with this, because they are admins + if((S.bodyflags & HAS_SKIN_COLOR) || GLOB.body_accessory_by_species[species] || check_rights(R_ADMIN, 0, user)) //admins can always fuck with this, because they are admins dat += "Body Color: " dat += "Color [color_square(s_colour)]
    " - if(body_accessory_by_species[species] || check_rights(R_ADMIN, 0, user)) + if(GLOB.body_accessory_by_species[species] || check_rights(R_ADMIN, 0, user)) dat += "Body Accessory: " dat += "[body_accessory ? "[body_accessory]" : "None"]
    " @@ -413,10 +414,10 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts switch(status) if("cyborg") var/datum/robolimb/R - if(rlimb_data[name] && all_robolimbs[rlimb_data[name]]) - R = all_robolimbs[rlimb_data[name]] + if(rlimb_data[name] && GLOB.all_robolimbs[rlimb_data[name]]) + R = GLOB.all_robolimbs[rlimb_data[name]] else - R = basic_robolimb + R = GLOB.basic_robolimb dat += "\t[R.company] [organ_name] prosthesis" if("amputated") dat += "\tAmputated [organ_name]" @@ -461,7 +462,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts dat += "Ghost Sight: [(toggles & CHAT_GHOSTSIGHT) ? "All Emotes" : "Nearest Creatures"]
    " dat += "Ghost PDA: [(toggles & CHAT_GHOSTPDA) ? "All PDA Messages" : "No PDA Messages"]
    " if(check_rights(R_ADMIN,0)) - dat += "OOC Color:     Change
    " + dat += "OOC Color:     Change
    " if(config.allow_Metadata) dat += "OOC Notes: Edit
    " dat += "Parallax (Fancy Space): " @@ -509,7 +510,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts var/list/type_blacklist = list() if(gear && gear.len) for(var/i = 1, i <= gear.len, i++) - var/datum/gear/G = gear_datums[gear[i]] + var/datum/gear/G = GLOB.gear_datums[gear[i]] if(G) if(!G.subtype_cost_overlap) if(G.subtype_path in type_blacklist) @@ -525,7 +526,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts dat += "
    " - var/datum/loadout_category/LC = loadout_categories[gear_tab] + var/datum/loadout_category/LC = GLOB.loadout_categories[gear_tab] dat += "" dat += "" dat += "" @@ -654,7 +655,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if((job_support_low & JOB_CIVILIAN) && (rank != "Civilian")) HTML += "[rank]" continue - if((rank in command_positions) || (rank == "AI"))//Bold head jobs + if((rank in GLOB.command_positions) || (rank == "AI"))//Bold head jobs HTML += "[rank]" else HTML += "[rank]" @@ -1160,7 +1161,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if(href_list["preference"] == "gear") if(href_list["toggle_gear"]) - var/datum/gear/TG = gear_datums[href_list["toggle_gear"]] + var/datum/gear/TG = GLOB.gear_datums[href_list["toggle_gear"]] if(TG.display_name in gear) gear -= TG.display_name else @@ -1170,7 +1171,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts var/total_cost = 0 var/list/type_blacklist = list() for(var/gear_name in gear) - var/datum/gear/G = gear_datums[gear_name] + var/datum/gear/G = GLOB.gear_datums[gear_name] if(istype(G)) if(!G.subtype_cost_overlap) if(G.subtype_path in type_blacklist) @@ -1182,7 +1183,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts gear += TG.display_name else if(href_list["gear"] && href_list["tweak"]) - var/datum/gear/gear = gear_datums[href_list["gear"]] + var/datum/gear/gear = GLOB.gear_datums[href_list["gear"]] var/datum/gear_tweak/tweak = locate(href_list["tweak"]) if(!tweak || !istype(gear) || !(tweak in gear.gear_tweaks)) return @@ -1203,7 +1204,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts var/datum/robolimb/robohead if(S.bodyflags & ALL_RPARTS) var/head_model = "[!rlimb_data["head"] ? "Morpheus Cyberkinetics" : rlimb_data["head"]]" - robohead = all_robolimbs[head_model] + robohead = GLOB.all_robolimbs[head_model] switch(href_list["preference"]) if("name") real_name = random_name(gender,species) @@ -1320,7 +1321,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts var/datum/robolimb/robohead if(NS.bodyflags & ALL_RPARTS) var/head_model = "[!rlimb_data["head"] ? "Morpheus Cyberkinetics" : rlimb_data["head"]]" - robohead = all_robolimbs[head_model] + robohead = GLOB.all_robolimbs[head_model] //grab one of the valid hair styles for the newly chosen species h_style = random_hair_style(gender, species, robohead) @@ -1453,7 +1454,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts head_model = "Morpheus Cyberkinetics" else head_model = rlimb_data["head"] - var/datum/robolimb/robohead = all_robolimbs[head_model] + var/datum/robolimb/robohead = GLOB.all_robolimbs[head_model] if((species in SA.species_allowed) && robohead.is_monitor && ((SA.models_allowed && (robohead.company in SA.models_allowed)) || !SA.models_allowed)) //If this is a hair style native to the user's species, check to see if they have a head with an ipc-style screen and that the head's company is in the screen style's allowed models list. valid_hairstyles += hairstyle //Give them their hairstyles if they do. else @@ -1536,7 +1537,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts head_model = "Morpheus Cyberkinetics" else head_model = rlimb_data["head"] - var/datum/robolimb/robohead = all_robolimbs[head_model] + var/datum/robolimb/robohead = GLOB.all_robolimbs[head_model] if(robohead.is_monitor && M.name != "None") //If the character can have prosthetic heads and they have the default Morpheus head (or another monitor-head), no optic markings. continue else if(!robohead.is_monitor && M.name != "None") //Otherwise, if they DON'T have the default head and the head's not a monitor but the head's not in the style's list of allowed models, skip. @@ -1613,10 +1614,10 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if("body_accessory") var/list/possible_body_accessories = list() if(check_rights(R_ADMIN, 1, user)) - possible_body_accessories = body_accessory_by_name.Copy() + possible_body_accessories = GLOB.body_accessory_by_name.Copy() else - for(var/B in body_accessory_by_name) - var/datum/body_accessory/accessory = body_accessory_by_name[B] + for(var/B in GLOB.body_accessory_by_name) + var/datum/body_accessory/accessory = GLOB.body_accessory_by_name[B] if(!istype(accessory)) possible_body_accessories += "None" //the only null entry should be the "None" option continue @@ -1660,7 +1661,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts head_model = "Morpheus Cyberkinetics" else head_model = rlimb_data["head"] - var/datum/robolimb/robohead = all_robolimbs[head_model] + var/datum/robolimb/robohead = GLOB.all_robolimbs[head_model] if((species in SA.species_allowed) && robohead.is_monitor && ((SA.models_allowed && (robohead.company in SA.models_allowed)) || !SA.models_allowed)) //If this is a facial hair style native to the user's species, check to see if they have a head with an ipc-style screen and that the head's company is in the screen style's allowed models list. valid_facial_hairstyles += facialhairstyle //Give them their facial hairstyles if they do. else @@ -1750,7 +1751,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts s_tone = max(min(round(skin_c), S.icon_skin_tones.len), 1) if("skin") - if((S.bodyflags & HAS_SKIN_COLOR) || body_accessory_by_species[species] || check_rights(R_ADMIN, 0, user)) + if((S.bodyflags & HAS_SKIN_COLOR) || GLOB.body_accessory_by_species[species] || check_rights(R_ADMIN, 0, user)) var/new_skin = input(user, "Choose your character's skin colour: ", "Character Preference", s_colour) as color|null if(new_skin) s_colour = new_skin @@ -1869,7 +1870,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if(!choice) return R.company = choice - R = all_robolimbs[R.company] + R = GLOB.all_robolimbs[R.company] if(R.has_subtypes == 1) //If the company the user selected provides more than just one base model, lets handle it. var/list/robolimb_models = list() for(var/limb_type in typesof(R)) //Handling the different models of parts that manufacturers can provide. @@ -2208,7 +2209,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts character.m_styles = m_styles if(body_accessory) - character.body_accessory = body_accessory_by_name["[body_accessory]"] + character.body_accessory = GLOB.body_accessory_by_name["[body_accessory]"] character.backbag = backbag @@ -2221,53 +2222,53 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts character.change_eye_color(e_colour) if(disabilities & DISABILITY_FLAG_FAT && (CAN_BE_FAT in character.dna.species.species_traits)) - character.dna.SetSEState(FATBLOCK, TRUE, TRUE) + character.dna.SetSEState(GLOB.fatblock, TRUE, TRUE) character.overeatduration = 600 - character.dna.default_blocks.Add(FATBLOCK) + character.dna.default_blocks.Add(GLOB.fatblock) if(disabilities & DISABILITY_FLAG_NEARSIGHTED) - character.dna.SetSEState(GLASSESBLOCK, TRUE, TRUE) - character.dna.default_blocks.Add(GLASSESBLOCK) + character.dna.SetSEState(GLOB.glassesblock, TRUE, TRUE) + character.dna.default_blocks.Add(GLOB.glassesblock) if(disabilities & DISABILITY_FLAG_BLIND) - character.dna.SetSEState(BLINDBLOCK, TRUE, TRUE) - character.dna.default_blocks.Add(BLINDBLOCK) + character.dna.SetSEState(GLOB.blindblock, TRUE, TRUE) + character.dna.default_blocks.Add(GLOB.blindblock) if(disabilities & DISABILITY_FLAG_DEAF) - character.dna.SetSEState(DEAFBLOCK, TRUE, TRUE) - character.dna.default_blocks.Add(DEAFBLOCK) + character.dna.SetSEState(GLOB.deafblock, TRUE, TRUE) + character.dna.default_blocks.Add(GLOB.deafblock) if(disabilities & DISABILITY_FLAG_COLOURBLIND) - character.dna.SetSEState(COLOURBLINDBLOCK, TRUE, TRUE) - character.dna.default_blocks.Add(COLOURBLINDBLOCK) + character.dna.SetSEState(GLOB.colourblindblock, TRUE, TRUE) + character.dna.default_blocks.Add(GLOB.colourblindblock) if(disabilities & DISABILITY_FLAG_MUTE) - character.dna.SetSEState(MUTEBLOCK, TRUE, TRUE) - character.dna.default_blocks.Add(MUTEBLOCK) + character.dna.SetSEState(GLOB.muteblock, TRUE, TRUE) + character.dna.default_blocks.Add(GLOB.muteblock) if(disabilities & DISABILITY_FLAG_NERVOUS) - character.dna.SetSEState(NERVOUSBLOCK, TRUE, TRUE) - character.dna.default_blocks.Add(NERVOUSBLOCK) + character.dna.SetSEState(GLOB.nervousblock, TRUE, TRUE) + character.dna.default_blocks.Add(GLOB.nervousblock) if(disabilities & DISABILITY_FLAG_SWEDISH) - character.dna.SetSEState(SWEDEBLOCK, TRUE, TRUE) - character.dna.default_blocks.Add(SWEDEBLOCK) + character.dna.SetSEState(GLOB.swedeblock, TRUE, TRUE) + character.dna.default_blocks.Add(GLOB.swedeblock) if(disabilities & DISABILITY_FLAG_CHAV) - character.dna.SetSEState(CHAVBLOCK, TRUE, TRUE) - character.dna.default_blocks.Add(CHAVBLOCK) + character.dna.SetSEState(GLOB.chavblock, TRUE, TRUE) + character.dna.default_blocks.Add(GLOB.chavblock) if(disabilities & DISABILITY_FLAG_LISP) - character.dna.SetSEState(LISPBLOCK, TRUE, TRUE) - character.dna.default_blocks.Add(LISPBLOCK) + character.dna.SetSEState(GLOB.lispblock, TRUE, TRUE) + character.dna.default_blocks.Add(GLOB.lispblock) if(disabilities & DISABILITY_FLAG_DIZZY) - character.dna.SetSEState(DIZZYBLOCK, TRUE, TRUE) - character.dna.default_blocks.Add(DIZZYBLOCK) + character.dna.SetSEState(GLOB.dizzyblock, TRUE, TRUE) + character.dna.default_blocks.Add(GLOB.dizzyblock) if(disabilities & DISABILITY_FLAG_WINGDINGS && (CAN_WINGDINGS in character.dna.species.species_traits)) - character.dna.SetSEState(WINGDINGSBLOCK, TRUE, TRUE) - character.dna.default_blocks.Add(WINGDINGSBLOCK) + character.dna.SetSEState(GLOB.wingdingsblock, TRUE, TRUE) + character.dna.default_blocks.Add(GLOB.wingdingsblock) character.dna.species.handle_dna(character) @@ -2286,7 +2287,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts /datum/preferences/proc/open_load_dialog(mob/user) - var/DBQuery/query = dbcon.NewQuery("SELECT slot,real_name FROM [format_table_name("characters")] WHERE ckey='[user.ckey]' ORDER BY slot") + var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT slot,real_name FROM [format_table_name("characters")] WHERE ckey='[user.ckey]' ORDER BY slot") var/list/slotnames[max_save_slots] if(!query.Execute()) diff --git a/code/modules/client/preference/preferences_mysql.dm b/code/modules/client/preference/preferences_mysql.dm index 6090538f2b3..ce2917373bf 100644 --- a/code/modules/client/preference/preferences_mysql.dm +++ b/code/modules/client/preference/preferences_mysql.dm @@ -1,6 +1,6 @@ /datum/preferences/proc/load_preferences(client/C) - var/DBQuery/query = dbcon.NewQuery({"SELECT + var/DBQuery/query = GLOB.dbcon.NewQuery({"SELECT ooccolor, UI_style, UI_style_color, @@ -88,7 +88,7 @@ log_runtime(EXCEPTION("[C.key] had a malformed role entry: '[role]'. Removing!"), src) be_special -= role - var/DBQuery/query = dbcon.NewQuery({"UPDATE [format_table_name("player")] + var/DBQuery/query = GLOB.dbcon.NewQuery({"UPDATE [format_table_name("player")] SET ooccolor='[ooccolor]', UI_style='[UI_style]', @@ -126,11 +126,11 @@ slot = sanitize_integer(slot, 1, max_save_slots, initial(default_slot)) if(slot != default_slot) default_slot = slot - var/DBQuery/firstquery = dbcon.NewQuery("UPDATE [format_table_name("player")] SET default_slot=[slot] WHERE ckey='[C.ckey]'") + var/DBQuery/firstquery = GLOB.dbcon.NewQuery("UPDATE [format_table_name("player")] SET default_slot=[slot] WHERE ckey='[C.ckey]'") firstquery.Execute() // Let's not have this explode if you sneeze on the DB - var/DBQuery/query = dbcon.NewQuery({"SELECT + var/DBQuery/query = GLOB.dbcon.NewQuery({"SELECT OOC_Notes, real_name, name_is_always_random, @@ -339,11 +339,11 @@ if(!isemptylist(gear)) gearlist = list2params(gear) - var/DBQuery/firstquery = dbcon.NewQuery("SELECT slot FROM [format_table_name("characters")] WHERE ckey='[C.ckey]' ORDER BY slot") + var/DBQuery/firstquery = GLOB.dbcon.NewQuery("SELECT slot FROM [format_table_name("characters")] WHERE ckey='[C.ckey]' ORDER BY slot") firstquery.Execute() while(firstquery.NextRow()) if(text2num(firstquery.item[1]) == default_slot) - var/DBQuery/query = dbcon.NewQuery({"UPDATE [format_table_name("characters")] SET OOC_Notes='[sanitizeSQL(metadata)]', + var/DBQuery/query = GLOB.dbcon.NewQuery({"UPDATE [format_table_name("characters")] SET OOC_Notes='[sanitizeSQL(metadata)]', real_name='[sanitizeSQL(real_name)]', name_is_always_random='[be_random_name]', gender='[gender]', @@ -406,7 +406,7 @@ return return 1 - var/DBQuery/query = dbcon.NewQuery({" + var/DBQuery/query = GLOB.dbcon.NewQuery({" INSERT INTO [format_table_name("characters")] (ckey, slot, OOC_Notes, real_name, name_is_always_random, gender, age, species, language, hair_colour, secondary_hair_colour, @@ -473,7 +473,7 @@ return 1 /datum/preferences/proc/load_random_character_slot(client/C) - var/DBQuery/query = dbcon.NewQuery("SELECT slot FROM [format_table_name("characters")] WHERE ckey='[C.ckey]' ORDER BY slot") + var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT slot FROM [format_table_name("characters")] WHERE ckey='[C.ckey]' ORDER BY slot") var/list/saves = list() if(!query.Execute()) @@ -493,11 +493,11 @@ /datum/preferences/proc/SetChangelog(client/C,hash) lastchangelog=hash - if(preferences_datums[C.ckey].toggles & UI_DARKMODE) + if(GLOB.preferences_datums[C.ckey].toggles & UI_DARKMODE) winset(C, "rpane.changelog", "background-color=#40628a;font-color=#ffffff;font-style=none") else winset(C, "rpane.changelog", "background-color=none;font-style=none") - var/DBQuery/query = dbcon.NewQuery("UPDATE [format_table_name("player")] SET lastchangelog='[lastchangelog]' WHERE ckey='[C.ckey]'") + var/DBQuery/query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("player")] SET lastchangelog='[lastchangelog]' WHERE ckey='[C.ckey]'") if(!query.Execute()) var/err = query.ErrorMsg() log_game("SQL ERROR during lastchangelog updating. Error : \[[err]\]\n") diff --git a/code/modules/client/preference/preferences_spawnpoints.dm b/code/modules/client/preference/preferences_spawnpoints.dm index 38b6b87ef43..5708567130e 100644 --- a/code/modules/client/preference/preferences_spawnpoints.dm +++ b/code/modules/client/preference/preferences_spawnpoints.dm @@ -1,10 +1,10 @@ -var/list/spawntypes = list() +GLOBAL_LIST_EMPTY(spawntypes) /proc/populate_spawn_points() - spawntypes = list() + // GLOB.spawntypes = list() | This is already done, is it not for(var/type in subtypesof(/datum/spawnpoint)) var/datum/spawnpoint/S = new type() - spawntypes[S.display_name] = S + GLOB.spawntypes[S.display_name] = S /datum/spawnpoint var/msg //Message to display on the arrivals computer. @@ -28,7 +28,7 @@ var/list/spawntypes = list() /datum/spawnpoint/arrivals/New() ..() - turfs = latejoin + turfs = GLOB.latejoin /datum/spawnpoint/gateway display_name = "Gateway" @@ -36,7 +36,7 @@ var/list/spawntypes = list() /datum/spawnpoint/gateway/New() ..() - turfs = latejoin_gateway + turfs = GLOB.latejoin_gateway /datum/spawnpoint/cryo display_name = "Cryogenic Storage" @@ -45,7 +45,7 @@ var/list/spawntypes = list() /datum/spawnpoint/cryo/New() ..() - turfs = latejoin_cryo + turfs = GLOB.latejoin_cryo /datum/spawnpoint/cyborg display_name = "Cyborg Storage" @@ -54,4 +54,4 @@ var/list/spawntypes = list() /datum/spawnpoint/cyborg/New() ..() - turfs = latejoin_cyborg + turfs = GLOB.latejoin_cyborg diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index feee4845a9c..4d2255a09ab 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -11,13 +11,13 @@ /obj/item/clothing/glasses/hud/equipped(mob/living/carbon/human/user, slot) ..() if(HUDType && slot == slot_glasses) - var/datum/atom_hud/H = huds[HUDType] + var/datum/atom_hud/H = GLOB.huds[HUDType] H.add_hud_to(user) /obj/item/clothing/glasses/hud/dropped(mob/living/carbon/human/user) ..() if(HUDType && istype(user) && user.glasses == src) - var/datum/atom_hud/H = huds[HUDType] + var/datum/atom_hud/H = GLOB.huds[HUDType] H.remove_hud_from(user) /obj/item/clothing/glasses/hud/emp_act(severity) diff --git a/code/modules/clothing/spacesuits/breaches.dm b/code/modules/clothing/spacesuits/breaches.dm index 483c122fd80..899cb8e8d46 100644 --- a/code/modules/clothing/spacesuits/breaches.dm +++ b/code/modules/clothing/spacesuits/breaches.dm @@ -23,23 +23,23 @@ ..() base_name = "[name]" -//Some simple descriptors for breaches. Global because lazy, TODO: work out a better way to do this. +//Some simple descriptors for breaches. Global because lazy, TODO: work out a better way to do this. | 6 years late, but atleast they are proper globals now -var/global/list/breach_brute_descriptors = list( +GLOBAL_LIST_INIT(breach_brute_descriptors, list( "tiny puncture", "ragged tear", "large split", "huge tear", "gaping wound" - ) + )) -var/global/list/breach_burn_descriptors = list( +GLOBAL_LIST_INIT(breach_burn_descriptors, list( "small burn", "melted patch", "sizable burn", "large scorched area", "huge scorched area" - ) + )) /datum/breach/proc/update_descriptor() @@ -47,9 +47,9 @@ var/global/list/breach_burn_descriptors = list( class = max(1,min(class,5)) //Apply the correct descriptor. if(damtype == BURN) - descriptor = breach_burn_descriptors[class] + descriptor = GLOB.breach_burn_descriptors[class] else if(damtype == BRUTE) - descriptor = breach_brute_descriptors[class] + descriptor = GLOB.breach_brute_descriptors[class] //Repair a certain amount of brute or burn damage to the suit. /obj/item/clothing/suit/space/proc/repair_breaches(var/damtype, var/amount, var/mob/user) diff --git a/code/modules/clothing/spacesuits/ert.dm b/code/modules/clothing/spacesuits/ert.dm index 225b32e59fe..c412bb40f7d 100644 --- a/code/modules/clothing/spacesuits/ert.dm +++ b/code/modules/clothing/spacesuits/ert.dm @@ -22,7 +22,7 @@ else camera = new /obj/machinery/camera(src) camera.network = list("ERT") - cameranet.removeCamera(camera) + GLOB.cameranet.removeCamera(camera) camera.c_tag = user.name to_chat(user, "User scanned as [camera.c_tag]. Camera activated.") diff --git a/code/modules/clothing/spacesuits/rig/modules/computer.dm b/code/modules/clothing/spacesuits/rig/modules/computer.dm index 74af696e76e..dfcf80f1303 100644 --- a/code/modules/clothing/spacesuits/rig/modules/computer.dm +++ b/code/modules/clothing/spacesuits/rig/modules/computer.dm @@ -23,7 +23,7 @@ to_chat(usr, "Your module is not installed in a hardsuit.") return - module.holder.ui_interact(usr, nano_state = contained_state) + module.holder.ui_interact(usr, nano_state = GLOB.contained_state) /obj/item/rig_module/ai_container @@ -139,7 +139,7 @@ if(!target) if(ai_card) if(istype(ai_card,/obj/item/aicard)) - ai_card.ui_interact(H, state = deep_inventory_state) + ai_card.ui_interact(H, state = GLOB.deep_inventory_state) else eject_ai(H) update_verb_holder() diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm index 3167e68ca6f..3608ee85164 100644 --- a/code/modules/clothing/spacesuits/rig/rig.dm +++ b/code/modules/clothing/spacesuits/rig/rig.dm @@ -522,7 +522,7 @@ cell.use(cost*10) return 1 -/obj/item/rig/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = inventory_state) +/obj/item/rig/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = GLOB.inventory_state) if(!user) return @@ -532,7 +532,7 @@ ui.open() ui.set_auto_update(1) -/obj/item/rig/ui_data(mob/user, ui_key = "main", datum/topic_state/state = inventory_state) +/obj/item/rig/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.inventory_state) var/data[0] data["primarysystem"] = null @@ -982,7 +982,7 @@ return 0 if(malfunctioning) - direction = pick(cardinal) + direction = pick(GLOB.cardinal) // Inside an object, tell it we moved. if(isobj(wearer.loc) || ismob(wearer.loc)) diff --git a/code/modules/clothing/under/jobs/civilian.dm b/code/modules/clothing/under/jobs/civilian.dm index 3850ce559df..cb429b79fbe 100644 --- a/code/modules/clothing/under/jobs/civilian.dm +++ b/code/modules/clothing/under/jobs/civilian.dm @@ -78,7 +78,7 @@ if(ishuman(loc)) var/mob/living/carbon/human/H = loc if(H.mind && H.mind.assigned_role == "Clown") - score_clownabuse++ + GLOB.score_clownabuse++ return ..() /obj/item/clothing/under/rank/clown/sexy diff --git a/code/modules/crafting/craft.dm b/code/modules/crafting/craft.dm index 40a8fe5f893..ee2c9e5ba2c 100644 --- a/code/modules/crafting/craft.dm +++ b/code/modules/crafting/craft.dm @@ -103,7 +103,7 @@ if(RC.is_drainable()) for(var/datum/reagent/A in RC.reagents.reagent_list) .["other"][A.type] += A.volume - .["other"][I.type] += 1 + .["other"][I.type] += 1 .["toolsother"][I] += 1 /datum/personal_crafting/proc/check_tools(mob/user, datum/crafting_recipe/R, list/contents) @@ -135,13 +135,13 @@ /datum/personal_crafting/proc/check_pathtools(mob/user, datum/crafting_recipe/R, list/contents) if(!R.pathtools.len) //does not run if no tools are needed return TRUE - var/list/other_possible_tools = list() + var/list/other_possible_tools = list() for(var/obj/item/I in user.contents) // searchs the inventory of the mob if(istype(I, /obj/item/storage)) for(var/obj/item/SI in I.contents) other_possible_tools += SI.type // filters type paths other_possible_tools += I.type - + other_possible_tools |= contents["other"] // this adds contents to the other_possible_tools main_loop: // checks if all tools found are usable with the recipe for(var/A in R.pathtools) @@ -151,7 +151,7 @@ return FALSE return TRUE -/datum/personal_crafting/proc/construct_item(mob/user, datum/crafting_recipe/R) +/datum/personal_crafting/proc/construct_item(mob/user, datum/crafting_recipe/R) var/list/contents = get_surroundings(user) var/send_feedback = 1 if(check_contents(R, contents)) @@ -297,7 +297,7 @@ Deletion.Cut(Deletion.len) qdel(DL) -/datum/personal_crafting/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, datum/topic_state/state = not_incapacitated_turf_state) +/datum/personal_crafting/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, datum/topic_state/state = GLOB.not_incapacitated_turf_state) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "personal_crafting.tmpl", "Crafting Menu", 700, 800, state = state) diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm index 5c1250ed355..c1491d5c0de 100644 --- a/code/modules/customitems/item_spawning.dm +++ b/code/modules/customitems/item_spawning.dm @@ -3,7 +3,7 @@ return // Grab the info we want. - var/DBQuery/query = dbcon.NewQuery("SELECT cuiPath, cuiPropAdjust, cuiJobMask, cuiDescription, cuiItemName FROM [format_table_name("customuseritems")] WHERE cuiCKey='[M.ckey]' AND (cuiRealName='[sanitizeSQL(M.real_name)]' OR cuiRealName='*')") + var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT cuiPath, cuiPropAdjust, cuiJobMask, cuiDescription, cuiItemName FROM [format_table_name("customuseritems")] WHERE cuiCKey='[M.ckey]' AND (cuiRealName='[sanitizeSQL(M.real_name)]' OR cuiRealName='*')") query.Execute() while(query.NextRow()) diff --git a/code/modules/detective_work/scanner.dm b/code/modules/detective_work/scanner.dm index 64318877847..dea08c602f9 100644 --- a/code/modules/detective_work/scanner.dm +++ b/code/modules/detective_work/scanner.dm @@ -30,21 +30,21 @@ // I really, really wish I didn't have to split this into two seperate loops. But the datacore is awful. - for(var/record in data_core.general) + for(var/record in GLOB.data_core.general) var/datum/data/record/S = record if(S && (search == lowertext(S.fields["fingerprint"]) || search == lowertext(S.fields["name"]))) name = S.fields["name"] fingerprint = S.fields["fingerprint"] continue - for(var/record in data_core.medical) + for(var/record in GLOB.data_core.medical) var/datum/data/record/M = record if(M && ( search == lowertext(M.fields["b_dna"]) || name == M.fields["name"]) ) dna = M.fields["b_dna"] if(fingerprint == "FINGERPRINT NOT FOUND") // We have searched by DNA, and do not have the relevant information from the fingerprint records. name = M.fields["name"] - for(var/gen_record in data_core.general) + for(var/gen_record in GLOB.data_core.general) var/datum/data/record/S = gen_record if(S && (name == S.fields["name"])) fingerprint = S.fields["fingerprint"] diff --git a/code/modules/economy/ATM.dm b/code/modules/economy/ATM.dm index df542964163..ea0cd53a6c7 100644 --- a/code/modules/economy/ATM.dm +++ b/code/modules/economy/ATM.dm @@ -36,7 +36,7 @@ log transactions /obj/machinery/atm/New() ..() - machine_id = "[station_name()] RT #[num_financial_terminals++]" + machine_id = "[station_name()] RT #[GLOB.num_financial_terminals++]" /obj/machinery/atm/Initialize() ..() @@ -127,7 +127,7 @@ log transactions ui = new(user, src, ui_key, "atm.tmpl", name, 550, 650) ui.open() -/obj/machinery/atm/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/atm/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["src"] = UID() data["view_screen"] = view_screen @@ -203,7 +203,7 @@ log transactions T.target_name = failed_account.owner_name T.purpose = "Unauthorised login attempt" T.source_terminal = machine_id - T.date = current_date_string + T.date = GLOB.current_date_string T.time = station_time_timestamp() failed_account.transaction_log.Add(T) else @@ -223,7 +223,7 @@ log transactions T.target_name = authenticated_account.owner_name T.purpose = "Remote terminal access" T.source_terminal = machine_id - T.date = current_date_string + T.date = GLOB.current_date_string T.time = station_time_timestamp() authenticated_account.transaction_log.Add(T) to_chat(usr, "[bicon(src)]Access granted. Welcome user '[authenticated_account.owner_name].'") @@ -257,7 +257,7 @@ log transactions Account holder: [authenticated_account.owner_name]
    Account number: [authenticated_account.account_number]
    Balance: $[authenticated_account.money]
    - Date and time: [station_time_timestamp()], [current_date_string]

    + Date and time: [station_time_timestamp()], [GLOB.current_date_string]

    Service terminal ID: [machine_id]
    "} //stamp the paper diff --git a/code/modules/economy/Accounts.dm b/code/modules/economy/Accounts.dm index 6001cf3f84e..0a2b500a0d3 100644 --- a/code/modules/economy/Accounts.dm +++ b/code/modules/economy/Accounts.dm @@ -4,33 +4,33 @@ #define STATION_SOURCE_TERMINAL "Biesel GalaxyNet Terminal #227" #define DEPARTMENT_START_CASH 5000 -var/global/num_financial_terminals = 1 -var/global/datum/money_account/station_account -var/global/list/datum/money_account/department_accounts = list() -var/global/next_account_number = 0 -var/global/obj/machinery/computer/account_database/centcomm_account_db -var/global/datum/money_account/vendor_account -var/global/list/all_money_accounts = list() +GLOBAL_VAR_INIT(num_financial_terminals, 1) +GLOBAL_DATUM(station_account, /datum/money_account) +GLOBAL_LIST_EMPTY(department_accounts) +GLOBAL_VAR_INIT(next_account_number, 0) +GLOBAL_DATUM(centcomm_account_db, /obj/machinery/computer/account_database) // this being an object hurts me deeply on the inside +GLOBAL_DATUM(vendor_account, /datum/money_account) +GLOBAL_LIST_EMPTY(all_money_accounts) /proc/create_station_account() - if(!station_account) - next_account_number = rand(111111, 999999) + if(!GLOB.station_account) + GLOB.next_account_number = rand(111111, 999999) - station_account = new() - station_account.owner_name = "[station_name()] Station Account" - station_account.account_number = rand(111111, 999999) - station_account.remote_access_pin = rand(1111, 111111) - station_account.money = STATION_START_CASH + GLOB.station_account = new() + GLOB.station_account.owner_name = "[station_name()] Station Account" + GLOB.station_account.account_number = rand(111111, 999999) + GLOB.station_account.remote_access_pin = rand(1111, 111111) + GLOB.station_account.money = STATION_START_CASH //create an entry in the account transaction log for when it was created - station_account.makeTransactionLog(STATION_START_CASH, "Account Creation", STATION_SOURCE_TERMINAL, station_account.owner_name, FALSE, + GLOB.station_account.makeTransactionLog(STATION_START_CASH, "Account Creation", STATION_SOURCE_TERMINAL, GLOB.station_account.owner_name, FALSE, STATION_CREATION_DATE, STATION_CREATION_TIME) //add the account - all_money_accounts.Add(station_account) + GLOB.all_money_accounts.Add(GLOB.station_account) /proc/create_department_account(department) - next_account_number = rand(111111, 999999) + GLOB.next_account_number = rand(111111, 999999) var/datum/money_account/department_account = new() department_account.owner_name = "[department] Account" @@ -43,9 +43,9 @@ var/global/list/all_money_accounts = list() STATION_CREATION_DATE, STATION_CREATION_TIME) //add the account - all_money_accounts.Add(department_account) + GLOB.all_money_accounts.Add(department_account) - department_accounts[department] = department_account + GLOB.department_accounts[department] = department_account //the current ingame time (hh:mm:ss) can be obtained by calling: //station_time_timestamp("hh:mm:ss") @@ -65,18 +65,18 @@ var/global/list/all_money_accounts = list() T.amount = starting_funds if(!source_db) //set a random date, time and location some time over the past few decades - T.date = "[num2text(rand(1,31))] [pick(GLOB.month_names)], [rand(game_year - 20,game_year - 1)]" + T.date = "[num2text(rand(1,31))] [pick(GLOB.month_names)], [rand(GLOB.game_year - 20,GLOB.game_year - 1)]" T.time = "[rand(0,23)]:[rand(0,59)]:[rand(0,59)]" T.source_terminal = "NTGalaxyNet Terminal #[rand(111,1111)]" M.account_number = rand(111111, 999999) else - T.date = current_date_string + T.date = GLOB.current_date_string T.time = station_time_timestamp() T.source_terminal = source_db.machine_id - M.account_number = next_account_number - next_account_number += rand(1,25) + M.account_number = GLOB.next_account_number + GLOB.next_account_number += rand(1,25) //create a sealed package containing the account details var/obj/item/smallDelivery/P = new /obj/item/smallDelivery(source_db.loc) @@ -94,7 +94,7 @@ var/global/list/all_money_accounts = list() Account number: [M.account_number]
    Account pin: [M.remote_access_pin]
    Starting balance: $[M.money]
    - Date and time: [station_time_timestamp()], [current_date_string]

    + Date and time: [station_time_timestamp()], [GLOB.current_date_string]

    Creation terminal ID: [source_db.machine_id]
    Authorised NT officer overseeing creation: [overseer]
    "} @@ -109,7 +109,7 @@ var/global/list/all_money_accounts = list() //add the account M.transaction_log.Add(T) - all_money_accounts.Add(M) + GLOB.all_money_accounts.Add(M) return M @@ -138,7 +138,7 @@ var/global/list/all_money_accounts = list() /obj/machinery/computer/account_database/proc/charge_to_account(attempt_account_number, datum/money_account/source, purpose, terminal_id, amount) if(!activated) return 0 - for(var/datum/money_account/D in all_money_accounts) + for(var/datum/money_account/D in GLOB.all_money_accounts) if(D.account_number == attempt_account_number && !D.suspended) source.charge(amount, D, purpose, terminal_id, "Account #[D.account_number]", "Transfer from [source.owner_name]", "[D.owner_name]") @@ -148,18 +148,18 @@ var/global/list/all_money_accounts = list() //this returns the first account datum that matches the supplied accnum/pin combination, it returns null if the combination did not match any account /proc/attempt_account_access(var/attempt_account_number, var/attempt_pin_number, var/security_level_passed = 0,var/pin_needed=1) - for(var/datum/money_account/D in all_money_accounts) + for(var/datum/money_account/D in GLOB.all_money_accounts) if(D.account_number == attempt_account_number) if( D.security_level <= security_level_passed && (!D.security_level || D.remote_access_pin == attempt_pin_number || !pin_needed) ) return D /obj/machinery/computer/account_database/proc/get_account(var/account_number) - for(var/datum/money_account/D in all_money_accounts) + for(var/datum/money_account/D in GLOB.all_money_accounts) if(D.account_number == account_number) return D /proc/attempt_account_access_nosec(var/attempt_account_number) - for(var/datum/money_account/D in all_money_accounts) + for(var/datum/money_account/D in GLOB.all_money_accounts) if(D.account_number == attempt_account_number) return D diff --git a/code/modules/economy/Accounts_DB.dm b/code/modules/economy/Accounts_DB.dm index afb5fbff79a..3065ba1c0fd 100644 --- a/code/modules/economy/Accounts_DB.dm +++ b/code/modules/economy/Accounts_DB.dm @@ -1,4 +1,4 @@ -var/global/current_date_string +GLOBAL_VAR(current_date_string) /obj/machinery/computer/account_database name = "Accounts Uplink Terminal" @@ -17,20 +17,20 @@ var/global/current_date_string light_color = LIGHT_COLOR_GREEN /obj/machinery/computer/account_database/New() - if(!station_account) + if(!GLOB.station_account) create_station_account() - if(department_accounts.len == 0) - for(var/department in station_departments) + if(GLOB.department_accounts.len == 0) + for(var/department in GLOB.station_departments) create_department_account(department) - if(!vendor_account) + if(!GLOB.vendor_account) create_department_account("Vendor") - vendor_account = department_accounts["Vendor"] + GLOB.vendor_account = GLOB.department_accounts["Vendor"] - if(!current_date_string) - current_date_string = "[time2text(world.timeofday, "DD Month")], [game_year]" + if(!GLOB.current_date_string) + GLOB.current_date_string = "[time2text(world.timeofday, "DD Month")], [GLOB.game_year]" - machine_id = "[station_name()] Acc. DB #[num_financial_terminals++]" + machine_id = "[station_name()] Acc. DB #[GLOB.num_financial_terminals++]" ..() /obj/machinery/computer/account_database/proc/get_access_level(var/mob/user) @@ -74,7 +74,7 @@ var/global/current_date_string ui = new(user, src, ui_key, "accounts_terminal.tmpl", src.name, 400, 640) ui.open() -/obj/machinery/computer/account_database/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/account_database/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["src"] = UID() @@ -84,7 +84,7 @@ var/global/current_date_string data["machine_id"] = machine_id data["creating_new_account"] = creating_new_account data["detailed_account_view"] = !!detailed_account_view - data["station_account_number"] = station_account.account_number + data["station_account_number"] = GLOB.station_account.account_number data["transactions"] = null data["accounts"] = null @@ -108,8 +108,8 @@ var/global/current_date_string data["transactions"] = trx var/list/accounts[0] - for(var/i=1, i<=all_money_accounts.len, i++) - var/datum/money_account/D = all_money_accounts[i] + for(var/i=1, i<=GLOB.all_money_accounts.len, i++) + var/datum/money_account/D = GLOB.all_money_accounts[i] accounts.Add(list(list(\ "account_number"=D.account_number,\ "owner_name"=D.owner_name,\ @@ -159,12 +159,12 @@ var/global/current_date_string var/account_name = href_list["holder_name"] var/starting_funds = max(text2num(href_list["starting_funds"]), 0) - starting_funds = Clamp(starting_funds, 0, station_account.money) // Not authorized to put the station in debt. + starting_funds = Clamp(starting_funds, 0, GLOB.station_account.money) // Not authorized to put the station in debt. starting_funds = min(starting_funds, fund_cap) // Not authorized to give more than the fund cap. var/datum/money_account/M = create_account(account_name, starting_funds, src) if(starting_funds > 0) - station_account.charge(starting_funds, null, "New account activation", + GLOB.station_account.charge(starting_funds, null, "New account activation", "", "New account activation", M.owner_name) creating_new_account = 0 @@ -174,8 +174,8 @@ var/global/current_date_string if("view_account_detail") var/index = text2num(href_list["account_index"]) - if(index && index <= all_money_accounts.len) - detailed_account_view = all_money_accounts[index] + if(index && index <= GLOB.all_money_accounts.len) + detailed_account_view = GLOB.all_money_accounts[index] if("view_accounts_list") detailed_account_view = null @@ -240,8 +240,8 @@ var/global/current_date_string
    "} - for(var/i=1, i<=all_money_accounts.len, i++) - var/datum/money_account/D = all_money_accounts[i] + for(var/i=1, i<=GLOB.all_money_accounts.len, i++) + var/datum/money_account/D = GLOB.all_money_accounts[i] text += {" diff --git a/code/modules/economy/EFTPOS.dm b/code/modules/economy/EFTPOS.dm index 9a5faf8aa36..2622d06411f 100644 --- a/code/modules/economy/EFTPOS.dm +++ b/code/modules/economy/EFTPOS.dm @@ -14,7 +14,7 @@ /obj/item/eftpos/New() ..() - machine_name = "[station_name()] EFTPOS #[num_financial_terminals++]" + machine_name = "[station_name()] EFTPOS #[GLOB.num_financial_terminals++]" access_code = rand(1111,111111) reconnect_database() spawn(0) @@ -22,7 +22,7 @@ //by default, connect to the station account //the user of the EFTPOS device can change the target account though, and no-one will be the wiser (except whoever's being charged) - linked_account = station_account + linked_account = GLOB.station_account /obj/item/eftpos/proc/print_reference() playsound(loc, 'sound/goonstation/machines/printer_thermal.ogg', 50, 1) @@ -79,7 +79,7 @@ ui = new(user, src, ui_key, "eftpos.tmpl", name, 790, 310) ui.open() -/obj/item/eftpos/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/item/eftpos/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["machine_name"] = machine_name data["transaction_locked"] = transaction_locked diff --git a/code/modules/economy/Economy.dm b/code/modules/economy/Economy.dm index eca0e08e359..8f06db02f34 100644 --- a/code/modules/economy/Economy.dm +++ b/code/modules/economy/Economy.dm @@ -63,9 +63,9 @@ //Destroyers are medium sized vessels, often used for escorting larger ships but able to go toe-to-toe with them if need be. //Frigates are medium sized vessels, often used for escorting larger ships. They will rapidly find themselves outclassed if forced to face heavy warships head on. -var/setup_economy = 0 +GLOBAL_VAR_INIT(setup_economy, 0) /proc/setup_economy() - if(setup_economy) + if(GLOB.setup_economy) return var/datum/feed_channel/newChannel = new /datum/feed_channel @@ -73,25 +73,25 @@ var/setup_economy = 0 newChannel.author = "Automated Announcement Listing" newChannel.locked = 1 newChannel.is_admin_channel = 1 - news_network.network_channels += newChannel + GLOB.news_network.network_channels += newChannel newChannel = new /datum/feed_channel newChannel.channel_name = "Nyx Daily" newChannel.author = "CentComm Minister of Information" newChannel.locked = 1 newChannel.is_admin_channel = 1 - news_network.network_channels += newChannel + GLOB.news_network.network_channels += newChannel newChannel = new /datum/feed_channel newChannel.channel_name = "The Gibson Gazette" newChannel.author = "Editor Mike Hammers" newChannel.locked = 1 newChannel.is_admin_channel = 1 - news_network.network_channels += newChannel + GLOB.news_network.network_channels += newChannel for(var/loc_type in subtypesof(/datum/trade_destination)) var/datum/trade_destination/D = new loc_type - weighted_randomevent_locations[D] = D.viable_random_events.len - weighted_mundaneevent_locations[D] = D.viable_mundane_events.len + GLOB.weighted_randomevent_locations[D] = D.viable_random_events.len + GLOB.weighted_mundaneevent_locations[D] = D.viable_mundane_events.len - setup_economy = 1 + GLOB.setup_economy = 1 diff --git a/code/modules/economy/Economy_Events.dm b/code/modules/economy/Economy_Events.dm index 10e0d574f98..d7754f122ea 100644 --- a/code/modules/economy/Economy_Events.dm +++ b/code/modules/economy/Economy_Events.dm @@ -8,10 +8,10 @@ var/datum/trade_destination/affected_dest /datum/event/economic_event/start() - if(!setup_economy) + if(!GLOB.setup_economy) setup_economy() - affected_dest = pickweight(weighted_randomevent_locations) + affected_dest = pickweight(GLOB.weighted_randomevent_locations) if(affected_dest.viable_random_events.len) endWhen = rand(60,300) event_type = pick(affected_dest.viable_random_events) @@ -94,11 +94,11 @@ if(FESTIVAL) newMsg.body = "A [pick("festival","week long celebration","day of revelry","planet-wide holiday")] has been declared on [affected_dest.name] by [pick("Governor","Commissioner","General","Commandant","Administrator")] [random_name(pick(MALE,FEMALE))] to celebrate [pick("the birth of their [pick("son","daughter")]","coming of age of their [pick("son","daughter")]","the pacification of rogue military cell","the apprehension of a violent criminal who had been terrorising the planet")]. Massive stocks of food and meat have been bought driving up prices across the planet." - for(var/datum/feed_channel/FC in news_network.network_channels) + for(var/datum/feed_channel/FC in GLOB.news_network.network_channels) if(FC.channel_name == "Nyx Daily") FC.messages += newMsg break - for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allNewscasters) NEWSCASTER.newsAlert("Nyx Daily") /datum/event/economic_event/end() diff --git a/code/modules/economy/Economy_Events_Mundane.dm b/code/modules/economy/Economy_Events_Mundane.dm index 1b5467a3a1c..cfabd6cdbe7 100644 --- a/code/modules/economy/Economy_Events_Mundane.dm +++ b/code/modules/economy/Economy_Events_Mundane.dm @@ -3,7 +3,7 @@ endWhen = 10 /datum/event/mundane_news/announce() - var/datum/trade_destination/affected_dest = pickweight(weighted_mundaneevent_locations) + var/datum/trade_destination/affected_dest = pickweight(GLOB.weighted_mundaneevent_locations) var/event_type = 0 if(affected_dest.viable_mundane_events.len) event_type = pick(affected_dest.viable_mundane_events) @@ -126,11 +126,11 @@ Nyx Daily is offering discount tickets for two to see [random_name(pick(MALE,FEMALE))] live in return for eyewitness reports and up to the minute coverage." - for(var/datum/feed_channel/FC in news_network.network_channels) + for(var/datum/feed_channel/FC in GLOB.news_network.network_channels) if(FC.channel_name == "Nyx Daily") FC.messages += newMsg break - for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allNewscasters) NEWSCASTER.newsAlert("Nyx Daily") /datum/event/trivial_news @@ -141,13 +141,13 @@ var/datum/feed_message/newMsg = new /datum/feed_message newMsg.author = "Editor Mike Hammers" //newMsg.is_admin_message = 1 - var/datum/trade_destination/affected_dest = pick(weighted_mundaneevent_locations) + var/datum/trade_destination/affected_dest = pick(GLOB.weighted_mundaneevent_locations) newMsg.body = pick(file2list("config/news/trivial.txt")) newMsg.body = replacetext(newMsg.body,"{{AFFECTED}}",affected_dest.name) - for(var/datum/feed_channel/FC in news_network.network_channels) + for(var/datum/feed_channel/FC in GLOB.news_network.network_channels) if(FC.channel_name == "The Gibson Gazette") FC.messages += newMsg break - for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allNewscasters) NEWSCASTER.newsAlert("The Gibson Gazette") diff --git a/code/modules/economy/Economy_TradeDestinations.dm b/code/modules/economy/Economy_TradeDestinations.dm index 09bbabdab37..74d005e3b3b 100644 --- a/code/modules/economy/Economy_TradeDestinations.dm +++ b/code/modules/economy/Economy_TradeDestinations.dm @@ -1,6 +1,6 @@ -var/list/weighted_randomevent_locations = list() -var/list/weighted_mundaneevent_locations = list() +GLOBAL_LIST_EMPTY(weighted_randomevent_locations) +GLOBAL_LIST_EMPTY(weighted_mundaneevent_locations) /datum/trade_destination var/name = "" diff --git a/code/modules/economy/Job_Departments.dm b/code/modules/economy/Job_Departments.dm index 77a938486dd..f2accab8541 100644 --- a/code/modules/economy/Job_Departments.dm +++ b/code/modules/economy/Job_Departments.dm @@ -1,4 +1,4 @@ -var/list/station_departments = list("Command", "Medical", "Engineering", "Science", "Security", "Cargo", "Support", "Civilian") +GLOBAL_LIST_INIT(station_departments, list("Command", "Medical", "Engineering", "Science", "Security", "Cargo", "Support", "Civilian")) // The department the job belongs to. /datum/job/var/department = null diff --git a/code/modules/economy/POS.dm b/code/modules/economy/POS.dm index cbf708f64ea..60b774a2a3d 100644 --- a/code/modules/economy/POS.dm +++ b/code/modules/economy/POS.dm @@ -11,8 +11,8 @@ var/price = 0 // Per unit var/units = 0 -var/global/current_pos_id = 1 -var/global/pos_sales = 0 +GLOBAL_VAR_INIT(current_pos_id, 1) +GLOBAL_VAR_INIT(pos_sales, 0) #define RECEIPT_HEADER {" @@ -142,11 +142,11 @@ var/global/pos_sales = 0 /obj/machinery/pos/New() ..() - id = current_pos_id++ + id = GLOB.current_pos_id++ if(department) - linked_account = department_accounts[department] + linked_account = GLOB.department_accounts[department] else - linked_account = station_account + linked_account = GLOB.station_account update_icon() /obj/machinery/pos/proc/AddToOrder(var/name, var/units) @@ -173,7 +173,7 @@ var/global/pos_sales = 0 receipt += myArea.name receipt += "" receipt += {"
    -
    [station_time_timestamp()], [current_date_string]
    +
    [station_time_timestamp()], [GLOB.current_date_string]
    Whitelisted Positions
    Whitelisted Positions
    " var/firstcat = 1 - for(var/category in loadout_categories) + for(var/category in GLOB.loadout_categories) if(firstcat) firstcat = 0 else @@ -536,7 +537,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts dat += " [category] " dat += "

    [LC.category]

    #[D.account_number]
    @@ -369,7 +369,7 @@ var/global/pos_sales = 0 logindata={"[logged_in.name]"} var/dat = POS_HEADER + {"
    Item
    " - var/DBQuery/query = dbcon.NewQuery("SELECT id, title, flagged FROM [format_table_name("library")] WHERE flagged > 0 ORDER BY flagged DESC") + var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT id, title, flagged FROM [format_table_name("library")] WHERE flagged > 0 ORDER BY flagged DESC") if(!query.Execute()) var/err = query.ErrorMsg() log_game("SQL ERROR getting flagged books. Error : \[[err]\]\n") diff --git a/code/modules/library/codex_gigas.dm b/code/modules/library/codex_gigas.dm index e908f35b60b..3e6ed79b040 100644 --- a/code/modules/library/codex_gigas.dm +++ b/code/modules/library/codex_gigas.dm @@ -45,7 +45,7 @@ if(!prob(correctness)) usedName += "x" var/datum/devilinfo/devil = devilInfo(usedName, 0) - user << browse("Information on [devilName]


    [lawlorify[LORE][devil.ban]]
    [lawlorify[LORE][devil.bane]]
    [lawlorify[LORE][devil.obligation]]
    [lawlorify[LORE][devil.banish]]", "window=book") + user << browse("Information on [devilName]


    [GLOB.lawlorify[LORE][devil.ban]]
    [GLOB.lawlorify[LORE][devil.bane]]
    [GLOB.lawlorify[LORE][devil.obligation]]
    [GLOB.lawlorify[LORE][devil.banish]]", "window=book") inUse = 0 sleep(10) if(!prob(willpower)) diff --git a/code/modules/library/computers/base.dm b/code/modules/library/computers/base.dm index 2b4bcd9f5a7..ff1e9bcb94f 100644 --- a/code/modules/library/computers/base.dm +++ b/code/modules/library/computers/base.dm @@ -47,7 +47,7 @@ var/sql = "SELECT id, author, title, category, ckey, flagged FROM [format_table_name("library")] [searchquery] LIMIT [(page_num - 1) * LIBRARY_BOOKS_PER_PAGE], [LIBRARY_BOOKS_PER_PAGE]" // Pagination - var/DBQuery/_query = dbcon.NewQuery(sql) + var/DBQuery/_query = GLOB.dbcon.NewQuery(sql) _query.Execute() if(_query.ErrorMsg()) log_world(_query.ErrorMsg()) @@ -69,7 +69,7 @@ /obj/machinery/computer/library/proc/get_num_results() var/sql = "SELECT COUNT(*) FROM [format_table_name("library")]" - var/DBQuery/_query = dbcon.NewQuery(sql) + var/DBQuery/_query = GLOB.dbcon.NewQuery(sql) _query.Execute() while(_query.NextRow()) return text2num(_query.item[1]) @@ -90,4 +90,4 @@ return pagelist /obj/machinery/computer/library/proc/getBookByID(var/id as text) - return library_catalog.getBookByID(id) + return GLOB.library_catalog.getBookByID(id) diff --git a/code/modules/library/computers/checkout.dm b/code/modules/library/computers/checkout.dm index e59c71392d3..99f7e2cb8fe 100644 --- a/code/modules/library/computers/checkout.dm +++ b/code/modules/library/computers/checkout.dm @@ -91,7 +91,7 @@ (Return to main menu)
    "} if(4) dat += "

    External Archive

    " - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) dat += "ERROR: Unable to contact External Archive. Please contact your system administrator for assistance." else num_results = src.get_num_results() @@ -237,7 +237,7 @@ else query.title = null if(href_list["setcategory"]) - var/newcategory = input("Choose a category to search for:") in (list("Any") + library_section_names) + var/newcategory = input("Choose a category to search for:") in (list("Any") + GLOB.library_section_names) if(newcategory == "Any") query.category = null else if(newcategory) @@ -261,7 +261,7 @@ var/datum/cachedbook/target = getBookByID(href_list["del"]) // Sanitized in getBookByID var/ans = alert(usr, "Are you sure you wish to delete \"[target.title]\", by [target.author]? This cannot be undone.", "Library System", "Yes", "No") if(ans=="Yes") - var/DBQuery/query = dbcon.NewQuery("DELETE FROM [format_table_name("library")] WHERE id=[target.id]") + var/DBQuery/query = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("library")] WHERE id=[target.id]") var/response = query.Execute() if(!response) to_chat(usr, query.ErrorMsg()) @@ -277,7 +277,7 @@ var/tckey = ckey(href_list["delbyckey"]) var/ans = alert(usr,"Are you sure you wish to delete all books by [tckey]? This cannot be undone.", "Library System", "Yes", "No") if(ans=="Yes") - var/DBQuery/query = dbcon.NewQuery("DELETE FROM [format_table_name("library")] WHERE ckey='[sanitizeSQL(tckey)]'") + var/DBQuery/query = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("library")] WHERE ckey='[sanitizeSQL(tckey)]'") var/response = query.Execute() if(!response) to_chat(usr, query.ErrorMsg()) @@ -292,7 +292,7 @@ return if(href_list["flag"]) - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) alert("Connection to Archive has been severed. Aborting.") return var/id = href_list["flag"] @@ -300,7 +300,7 @@ var/datum/cachedbook/B = getBookByID(id) if(B) if((input(usr, "Are you sure you want to flag [B.title] as having inappropriate content?", "Flag Book #[B.id]") in list("Yes", "No")) == "Yes") - library_catalog.flag_book_by_id(usr, id) + GLOB.library_catalog.flag_book_by_id(usr, id) if(href_list["switchscreen"]) switch(href_list["switchscreen"]) @@ -378,14 +378,14 @@ var/choice = input("Are you certain you wish to upload this title to the Archive?") in list("Confirm", "Abort") if(choice == "Confirm") establish_db_connection() - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) alert("Connection to Archive has been severed. Aborting.") else var/sqltitle = sanitizeSQL(scanner.cache.name) var/sqlauthor = sanitizeSQL(scanner.cache.author) var/sqlcontent = sanitizeSQL(scanner.cache.dat) var/sqlcategory = sanitizeSQL(upload_category) - var/DBQuery/query = dbcon.NewQuery("INSERT INTO [format_table_name("library")] (author, title, content, category, ckey, flagged) VALUES ('[sqlauthor]', '[sqltitle]', '[sqlcontent]', '[sqlcategory]', '[ckey(usr.key)]', 0)") + var/DBQuery/query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("library")] (author, title, content, category, ckey, flagged) VALUES ('[sqlauthor]', '[sqltitle]', '[sqlcontent]', '[sqlcategory]', '[ckey(usr.key)]', 0)") var/response = query.Execute() if(!response) to_chat(usr, query.ErrorMsg()) @@ -399,7 +399,7 @@ if(!href_list["id"]) return - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) alert("Connection to Archive has been severed. Aborting.") return @@ -422,7 +422,7 @@ if(!href_list["manual"]) return var/bookid = href_list["manual"] - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) alert("Connection to Archive has been severed. Aborting.") return diff --git a/code/modules/library/computers/public.dm b/code/modules/library/computers/public.dm index 7793c9bb6f3..f94369b11b7 100644 --- a/code/modules/library/computers/public.dm +++ b/code/modules/library/computers/public.dm @@ -27,7 +27,7 @@ \[Start Search\]
    "} if(1) establish_db_connection() - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) dat += "ERROR: Unable to contact External Archive. Please contact your system administrator for assistance.
    " else if(num_results == 0) dat += "No results found." @@ -84,7 +84,7 @@ else query.title = null if(href_list["setcategory"]) - var/newcategory = input("Choose a category to search for:") in (list("Any") + library_section_names) + var/newcategory = input("Choose a category to search for:") in (list("Any") + GLOB.library_section_names) if(newcategory == "Any") query.category = null else if(newcategory) @@ -113,7 +113,7 @@ screenstate = 0 if(href_list["flag"]) - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) alert("Connection to Archive has been severed. Aborting.") return var/id = href_list["flag"] @@ -121,7 +121,7 @@ var/datum/cachedbook/B = getBookByID(id) if(B) if((input(usr, "Are you sure you want to flag [B.title] as having inappropriate content?", "Flag Book #[B.id]") in list("Yes", "No")) == "Yes") - library_catalog.flag_book_by_id(usr, id) + GLOB.library_catalog.flag_book_by_id(usr, id) add_fingerprint(usr) updateUsrDialog() diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index 5729d3d7fa5..65fadaa9b45 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -1,11 +1,11 @@ #define LIBRARY_BOOKS_PER_PAGE 25 -var/global/datum/library_catalog/library_catalog = new() -var/global/list/library_section_names = list("Any", "Fiction", "Non-Fiction", "Adult", "Reference", "Religion") +GLOBAL_DATUM_INIT(library_catalog, /datum/library_catalog, new()) +GLOBAL_LIST_INIT(library_section_names, list("Any", "Fiction", "Non-Fiction", "Adult", "Reference", "Religion")) /hook/startup/proc/load_manuals() - library_catalog.initialize() + GLOB.library_catalog.initialize() return 1 /* @@ -98,7 +98,7 @@ var/global/list/library_section_names = list("Any", "Fiction", "Non-Fiction", "A var/sqlid = text2num(id) if(!sqlid) return - var/DBQuery/query = dbcon.NewQuery("UPDATE [format_table_name("library")] SET flagged = flagged + 1 WHERE id=[sqlid]") + var/DBQuery/query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("library")] SET flagged = flagged + 1 WHERE id=[sqlid]") query.Execute() /datum/library_catalog/proc/rmBookByID(mob/user, id) @@ -111,7 +111,7 @@ var/global/list/library_section_names = list("Any", "Fiction", "Non-Fiction", "A var/sqlid = text2num(id) if(!sqlid) return - var/DBQuery/query = dbcon.NewQuery("DELETE FROM [format_table_name("library")] WHERE id=[sqlid]") + var/DBQuery/query = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("library")] WHERE id=[sqlid]") query.Execute() /datum/library_catalog/proc/getBookByID(id) @@ -121,7 +121,7 @@ var/global/list/library_section_names = list("Any", "Fiction", "Non-Fiction", "A var/sqlid = text2num(id) if(!sqlid) return - var/DBQuery/query = dbcon.NewQuery("SELECT id, author, title, category, content, ckey, flagged FROM [format_table_name("library")] WHERE id=[sqlid]") + var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT id, author, title, category, content, ckey, flagged FROM [format_table_name("library")] WHERE id=[sqlid]") query.Execute() var/list/results=list() diff --git a/code/modules/library/random_books.dm b/code/modules/library/random_books.dm index 31d49489561..f571b3438e1 100644 --- a/code/modules/library/random_books.dm +++ b/code/modules/library/random_books.dm @@ -40,7 +40,7 @@ . = list() if(!isnum(amount) || amount<1) return - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) if(fail_loud || prob(5)) var/obj/item/paper/P = new(location) P.info = "There once was a book from Nantucket
    But the database failed us, so f*$! it.
    I tried to be good to you
    Now this is an I.O.U
    If you're feeling entitled, well, stuff it!

    ~" @@ -49,7 +49,7 @@ if(prob(25)) category = null var/c = category? " AND category='[sanitizeSQL(category)]'" :"" - var/DBQuery/query_get_random_books = dbcon.NewQuery("SELECT * FROM [format_table_name("library")] WHERE (isnull(flagged) OR flagged = 0)[c] GROUP BY title ORDER BY rand() LIMIT [amount];") + var/DBQuery/query_get_random_books = GLOB.dbcon.NewQuery("SELECT * FROM [format_table_name("library")] WHERE (isnull(flagged) OR flagged = 0)[c] GROUP BY title ORDER BY rand() LIMIT [amount];") query_get_random_books.Execute() while(query_get_random_books.NextRow()) var/obj/item/book/B = new(location) diff --git a/code/modules/map_fluff/maps.dm b/code/modules/map_fluff/maps.dm index b74ed7c9f3b..e2684d5c735 100644 --- a/code/modules/map_fluff/maps.dm +++ b/code/modules/map_fluff/maps.dm @@ -1,5 +1,3 @@ -var/datum/map/using_map = new USING_MAP_DATUM - /datum/map var/name = "Unnamed Map" var/full_name = "Unnamed Map" diff --git a/code/modules/mining/equipment/marker_beacons.dm b/code/modules/mining/equipment/marker_beacons.dm index e1456c475de..3df1699c7c1 100644 --- a/code/modules/mining/equipment/marker_beacons.dm +++ b/code/modules/mining/equipment/marker_beacons.dm @@ -58,10 +58,10 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list( transfer_fingerprints_to(M) /obj/item/stack/marker_beacon/AltClick(mob/living/user) - if(!istype(user) || CanUseTopic(user, physical_state) != STATUS_INTERACTIVE) + if(!istype(user) || CanUseTopic(user, GLOB.physical_state) != STATUS_INTERACTIVE) return var/input_color = input(user, "Choose a color.", "Beacon Color") as null|anything in GLOB.marker_beacon_colors - if(!istype(user) || CanUseTopic(user, physical_state) != STATUS_INTERACTIVE) + if(!istype(user) || CanUseTopic(user, GLOB.physical_state) != STATUS_INTERACTIVE) return if(input_color) picked_color = input_color @@ -130,10 +130,10 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list( /obj/structure/marker_beacon/AltClick(mob/living/user) ..() - if(!istype(user) || CanUseTopic(user, physical_state) != STATUS_INTERACTIVE) + if(!istype(user) || CanUseTopic(user, GLOB.physical_state) != STATUS_INTERACTIVE) return var/input_color = input(user, "Choose a color.", "Beacon Color") as null|anything in GLOB.marker_beacon_colors - if(!istype(user) || CanUseTopic(user, physical_state) != STATUS_INTERACTIVE) + if(!istype(user) || CanUseTopic(user, GLOB.physical_state) != STATUS_INTERACTIVE) return if(input_color) picked_color = input_color diff --git a/code/modules/mining/equipment/survival_pod.dm b/code/modules/mining/equipment/survival_pod.dm index bb2ce3a68f8..0c7b836b322 100644 --- a/code/modules/mining/equipment/survival_pod.dm +++ b/code/modules/mining/equipment/survival_pod.dm @@ -19,7 +19,7 @@ /obj/item/survivalcapsule/proc/get_template() if(template) return - template = shelter_templates[template_id] + template = GLOB.shelter_templates[template_id] if(!template) log_runtime("Shelter template ([template_id]) not found!", src) qdel(src) diff --git a/code/modules/mining/laborcamp/laborstacker.dm b/code/modules/mining/laborcamp/laborstacker.dm index e9d04cc406b..0b32b6aedde 100644 --- a/code/modules/mining/laborcamp/laborstacker.dm +++ b/code/modules/mining/laborcamp/laborstacker.dm @@ -58,7 +58,7 @@ GLOBAL_LIST(labor_sheet_values) /obj/machinery/mineral/labor_claim_console/attack_ghost(mob/user) attack_hand(user) -/obj/machinery/mineral/labor_claim_console/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state) +/obj/machinery/mineral/labor_claim_console/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = GLOB.default_state) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "labor_claim_console.tmpl", name, 450, 625, state) diff --git a/code/modules/mining/lavaland/loot/colossus_loot.dm b/code/modules/mining/lavaland/loot/colossus_loot.dm index 7b321474880..ac4d6a1e551 100644 --- a/code/modules/mining/lavaland/loot/colossus_loot.dm +++ b/code/modules/mining/lavaland/loot/colossus_loot.dm @@ -374,7 +374,7 @@ ..() verbs -= /mob/living/verb/pulled verbs -= /mob/verb/me_verb - var/datum/atom_hud/medsensor = huds[DATA_HUD_MEDICAL_ADVANCED] + var/datum/atom_hud/medsensor = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] medsensor.add_hud_to(src) /mob/living/simple_animal/hostile/lightgeist/AttackingTarget() diff --git a/code/modules/mining/lavaland/loot/hierophant_loot.dm b/code/modules/mining/lavaland/loot/hierophant_loot.dm index bd06e2fe47a..a3f6e738380 100644 --- a/code/modules/mining/lavaland/loot/hierophant_loot.dm +++ b/code/modules/mining/lavaland/loot/hierophant_loot.dm @@ -254,7 +254,7 @@ var/obj/effect/temp_visual/hierophant/blast/B = new(T, user, friendly_fire_check) B.damage = HIEROPHANT_CLUB_CARDINAL_DAMAGE B.monster_damage_boost = FALSE - for(var/d in cardinal) + for(var/d in GLOB.cardinal) INVOKE_ASYNC(src, .proc/blast_wall, T, d, user) /obj/item/hierophant_club/proc/blast_wall(turf/T, dir, mob/living/user) //make a wall of blasts blast_range tiles long diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm index 20189c2793b..ed955efda2c 100644 --- a/code/modules/mining/machine_redemption.dm +++ b/code/modules/mining/machine_redemption.dm @@ -159,7 +159,7 @@ if(!has_minerals) return - for(var/obj/machinery/requests_console/D in allConsoles) + for(var/obj/machinery/requests_console/D in GLOB.allRequestConsoles) if(D.department in src.supply_consoles) if(supply_consoles[D.department] == null || (mineral_name in supply_consoles[D.department])) D.createMessage("Ore Redemption Machine", "New Minerals Available!", msg, 1) diff --git a/code/modules/mining/ores_coins.dm b/code/modules/mining/ores_coins.dm index 6f9572a8a0c..49dec671301 100644 --- a/code/modules/mining/ores_coins.dm +++ b/code/modules/mining/ores_coins.dm @@ -19,7 +19,7 @@ pixel_x = rand(0, 16) - 8 pixel_y = rand(0, 8) - 8 if(is_mining_level(z)) - score_oremined++ //When ore spawns, increment score. Only include ore spawned on mining level (No Clown Planet) + GLOB.score_oremined++ //When ore spawns, increment score. Only include ore spawned on mining level (No Clown Planet) /obj/item/stack/ore/welder_act(mob/user, obj/item/I) . = TRUE diff --git a/code/modules/mob/abilities.dm b/code/modules/mob/abilities.dm deleted file mode 100644 index 8c4aabc4fc8..00000000000 --- a/code/modules/mob/abilities.dm +++ /dev/null @@ -1,5 +0,0 @@ -/* -Creature-level abilities. -*/ - -/var/global/list/ability_verbs = list( ) diff --git a/code/modules/mob/dead/observer/logout.dm b/code/modules/mob/dead/observer/logout.dm index a28bef6be5d..8622ba7c845 100644 --- a/code/modules/mob/dead/observer/logout.dm +++ b/code/modules/mob/dead/observer/logout.dm @@ -1,6 +1,6 @@ /mob/dead/observer/Logout() if(client) - client.images -= ghost_images + client.images -= GLOB.ghost_images ..() spawn(0) if(src && !key) //we've transferred to another mob. This ghost should be deleted. diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 98dcebdae49..0c283c60a7f 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -1,7 +1,7 @@ #define GHOST_CAN_REENTER 1 #define GHOST_IS_OBSERVER 2 -var/list/image/ghost_images = list() +GLOBAL_LIST_EMPTY(ghost_images) GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) @@ -75,10 +75,10 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) ghostimage.appearance_flags |= KEEP_TOGETHER ghostimage.alpha = alpha appearance_flags |= KEEP_TOGETHER - ghost_images |= ghostimage + GLOB.ghost_images |= ghostimage updateallghostimages() - if(!T) - T = pick(latejoin) //Safety in case we cannot find the body's position + if(!T) + T = pick(GLOB.latejoin) //Safety in case we cannot find the body's position forceMove(T) if(!name) //To prevent nameless ghosts @@ -95,7 +95,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) M.following_mobs -= src following = null if(ghostimage) - ghost_images -= ghostimage + GLOB.ghost_images -= ghostimage QDEL_NULL(ghostimage) updateallghostimages() return ..() @@ -319,11 +319,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp src << sound(sound) /mob/dead/observer/proc/show_me_the_hud(hud_index) - var/datum/atom_hud/H = huds[hud_index] + var/datum/atom_hud/H = GLOB.huds[hud_index] H.add_hud_to(src) /mob/dead/observer/proc/remove_the_hud(hud_index) //remove old huds - var/datum/atom_hud/H = huds[hud_index] + var/datum/atom_hud/H = GLOB.huds[hud_index] H.remove_hud_from(src) /mob/dead/observer/verb/toggle_medHUD() @@ -340,7 +340,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp show_me_the_hud(DATA_HUD_SECURITY_ADVANCED) show_me_the_hud(DATA_HUD_MEDICAL_ADVANCED) to_chat(src, "All HUDs enabled.") - if(DATA_HUD_DIAGNOSTIC + DATA_HUD_SECURITY_ADVANCED + DATA_HUD_MEDICAL_ADVANCED) + if(DATA_HUD_DIAGNOSTIC + DATA_HUD_SECURITY_ADVANCED + DATA_HUD_MEDICAL_ADVANCED) data_hud_seen = DATA_HUD_SECURITY_ADVANCED remove_the_hud(DATA_HUD_DIAGNOSTIC) remove_the_hud(DATA_HUD_MEDICAL_ADVANCED) @@ -386,7 +386,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp //var/datum/atom_hud/A = huds[DATA_HUD_SECURITY_ADVANCED] //var/adding_hud = (usr in A.hudusers) ? 0 : 1 - for(var/datum/atom_hud/antag/H in (huds)) + for(var/datum/atom_hud/antag/H in (GLOB.huds)) if(!M.antagHUD) H.add_hud_to(usr) else @@ -407,7 +407,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp to_chat(usr, "Not when you're not dead!") return - var/datum/async_input/A = input_autocomplete_async(usr, "Area to jump to: ", ghostteleportlocs) + var/datum/async_input/A = input_autocomplete_async(usr, "Area to jump to: ", GLOB.ghostteleportlocs) A.on_close(CALLBACK(src, .proc/teleport)) /mob/dead/observer/proc/teleport(area/thearea) @@ -505,7 +505,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set name = "Jump to Mob" set desc = "Teleport to a mob" - if(isobserver(usr)) //Make sure they're an observer! + if(isobserver(usr)) //Make sure they're an observer! var/list/dest = getpois(mobs_only=1) //Fill list, prompt user with list var/datum/async_input/A = input_autocomplete_async(usr, "Enter a mob name: ", dest) A.on_close(CALLBACK(src, .proc/jump_to_mob)) @@ -616,7 +616,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp var/dat dat += "

    Crew Manifest

    " - dat += data_core.get_manifest() + dat += GLOB.data_core.get_manifest() src << browse(dat, "window=manifest;size=370x420;can_close=1") @@ -743,10 +743,10 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(!client) return if(seedarkness || !ghostvision) - client.images -= ghost_images + client.images -= GLOB.ghost_images else //add images for the 60inv things ghosts can normally see when darkness is enabled so they can see them now - client.images |= ghost_images + client.images |= GLOB.ghost_images if(ghostimage) client.images -= ghostimage //remove ourself diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 598a533d2fa..980a9b72c52 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -126,7 +126,7 @@ if(isturf(loc)) I.remove(src) I.forceMove(get_turf(src)) - I.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),5) + I.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5) for(var/mob/M in src) if(M in src.stomach_contents) @@ -388,7 +388,7 @@ dna = newDNA -var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, /obj/machinery/atmospherics/unary/vent_scrubber) +GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/vent_pump, /obj/machinery/atmospherics/unary/vent_scrubber)) /mob/living/handle_ventcrawl(var/atom/clicked_on) // -- TLE -- Merged by Carn if(!Adjacent(clicked_on)) @@ -432,7 +432,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, if(!vent_found) for(var/obj/machinery/atmospherics/machine in range(1,src)) - if(is_type_in_list(machine, ventcrawl_machinery)) + if(is_type_in_list(machine, GLOB.ventcrawl_machinery)) vent_found = machine if(!vent_found.can_crawl_through()) @@ -1016,7 +1016,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, if(!forceFed(toEat, user, fullness)) return 0 consume(toEat, bitesize_override, can_taste_container = toEat.can_taste) - score_foodeaten++ + GLOB.score_foodeaten++ return 1 /mob/living/carbon/proc/selfFeed(var/obj/item/reagent_containers/food/toEat, fullness) @@ -1103,7 +1103,7 @@ so that different stomachs can handle things in different ways VB*/ //to recalculate and update the mob's total tint from tinted equipment it's wearing. /mob/living/carbon/proc/update_tint() - if(!tinted_weldhelh) + if(!GLOB.tinted_weldhelh) return var/tinttotal = get_total_tint() if(tinttotal >= TINT_BLIND) diff --git a/code/modules/mob/living/carbon/human/appearance.dm b/code/modules/mob/living/carbon/human/appearance.dm index a0fd10e0610..bc4b5b43b1c 100644 --- a/code/modules/mob/living/carbon/human/appearance.dm +++ b/code/modules/mob/living/carbon/human/appearance.dm @@ -1,4 +1,4 @@ -/mob/living/carbon/human/proc/change_appearance(var/flags = APPEARANCE_ALL_HAIR, var/location = src, var/mob/user = src, var/check_species_whitelist = 1, var/list/species_whitelist = list(), var/list/species_blacklist = list(), var/datum/topic_state/state = default_state) +/mob/living/carbon/human/proc/change_appearance(var/flags = APPEARANCE_ALL_HAIR, var/location = src, var/mob/user = src, var/check_species_whitelist = 1, var/list/species_whitelist = list(), var/list/species_blacklist = list(), var/datum/topic_state/state = GLOB.default_state) var/datum/nano_module/appearance_changer/AC = new(location, src, check_species_whitelist, species_whitelist, species_blacklist) AC.flags = flags AC.ui_interact(user, state = state) @@ -104,9 +104,9 @@ if(!body_accessory_style || (body_accessory && body_accessory.name == body_accessory_style)) return - for(var/B in body_accessory_by_name) + for(var/B in GLOB.body_accessory_by_name) if(B == body_accessory_style) - body_accessory = body_accessory_by_name[body_accessory_style] + body_accessory = GLOB.body_accessory_by_name[body_accessory_style] found = 1 if(!found) @@ -340,7 +340,7 @@ if((H.gender == MALE && S.gender == FEMALE) || (H.gender == FEMALE && S.gender == MALE)) continue if(H.dna.species.bodyflags & ALL_RPARTS) //If the user is a species who can have a robotic head... - var/datum/robolimb/robohead = all_robolimbs[H.model] + var/datum/robolimb/robohead = GLOB.all_robolimbs[H.model] if((H.dna.species.name in S.species_allowed) && robohead.is_monitor && ((S.models_allowed && (robohead.company in S.models_allowed)) || !S.models_allowed)) //If this is a hair style native to the user's species, check to see if they have a head with an ipc-style screen and that the head's company is in the screen style's allowed models list. valid_hairstyles += hairstyle //Give them their hairstyles if they do. else @@ -368,7 +368,7 @@ if((H.gender == MALE && S.gender == FEMALE) || (H.gender == FEMALE && S.gender == MALE)) continue if(H.dna.species.bodyflags & ALL_RPARTS) //If the user is a species who can have a robotic head... - var/datum/robolimb/robohead = all_robolimbs[H.model] + var/datum/robolimb/robohead = GLOB.all_robolimbs[H.model] if(H.dna.species.name in S.species_allowed) //If this is a facial hair style native to the user's species... if((H.dna.species.name in S.species_allowed) && robohead.is_monitor && ((S.models_allowed && (robohead.company in S.models_allowed)) || !S.models_allowed)) //If this is a facial hair style native to the user's species, check to see if they have a head with an ipc-style screen and that the head's company is in the screen style's allowed models list. valid_facial_hairstyles += facialhairstyle //Give them their facial hairstyles if they do. @@ -422,7 +422,7 @@ if(location == "head") var/datum/sprite_accessory/body_markings/head/M = GLOB.marking_styles_list[S.name] if(H.dna.species.bodyflags & ALL_RPARTS) //If the user is a species that can have a robotic head... - var/datum/robolimb/robohead = all_robolimbs[H.model] + var/datum/robolimb/robohead = GLOB.all_robolimbs[H.model] if(!(S.models_allowed && (robohead.company in S.models_allowed))) //Make sure they don't get markings incompatible with their head. continue else if(H.alt_head && H.alt_head != "None") //If the user's got an alt head, validate markings for that head. @@ -437,10 +437,10 @@ /mob/living/carbon/human/proc/generate_valid_body_accessories() var/list/valid_body_accessories = new() - for(var/B in body_accessory_by_name) - var/datum/body_accessory/A = body_accessory_by_name[B] + for(var/B in GLOB.body_accessory_by_name) + var/datum/body_accessory/A = GLOB.body_accessory_by_name[B] if(check_rights(R_ADMIN, 0, src)) - valid_body_accessories = body_accessory_by_name.Copy() + valid_body_accessories = GLOB.body_accessory_by_name.Copy() else if(!istype(A)) valid_body_accessories["None"] = "None" //The only null entry should be the "None" option. diff --git a/code/modules/mob/living/carbon/human/body_accessories.dm b/code/modules/mob/living/carbon/human/body_accessories.dm index 9c677444eb5..e214f6068bb 100644 --- a/code/modules/mob/living/carbon/human/body_accessories.dm +++ b/code/modules/mob/living/carbon/human/body_accessories.dm @@ -1,29 +1,29 @@ -var/global/list/body_accessory_by_name = list("None" = null) +GLOBAL_LIST_INIT(body_accessory_by_name, list("None" = null)) /hook/startup/proc/initalize_body_accessories() __init_body_accessory(/datum/body_accessory/body) __init_body_accessory(/datum/body_accessory/tail) - if(body_accessory_by_name.len) + if(GLOB.body_accessory_by_name.len) if(initialize_body_accessory_by_species()) return TRUE return FALSE //fail if no bodies are found -var/global/list/body_accessory_by_species = list("None" = null) +GLOBAL_LIST_INIT(body_accessory_by_species, list("None" = null)) /proc/initialize_body_accessory_by_species() - for(var/B in body_accessory_by_name) - var/datum/body_accessory/accessory = body_accessory_by_name[B] + for(var/B in GLOB.body_accessory_by_name) + var/datum/body_accessory/accessory = GLOB.body_accessory_by_name[B] if(!istype(accessory)) continue for(var/species in accessory.allowed_species) - if(!body_accessory_by_species["[species]"]) body_accessory_by_species["[species]"] = list() - body_accessory_by_species["[species]"] += accessory + if(!GLOB.body_accessory_by_species["[species]"]) GLOB.body_accessory_by_species["[species]"] = list() + GLOB.body_accessory_by_species["[species]"] += accessory - if(body_accessory_by_species.len) + if(GLOB.body_accessory_by_species.len) return TRUE return FALSE @@ -34,7 +34,7 @@ var/global/list/body_accessory_by_species = list("None" = null) for(var/A in subtypesof(ba_path)) var/datum/body_accessory/B = new A if(istype(B)) - body_accessory_by_name[B.name] += B + GLOB.body_accessory_by_name[B.name] += B ++_added_counter if(_added_counter) diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 2037f713c56..aa8643173f4 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -21,7 +21,7 @@ var/atom/movable/thing = I.remove(src) if(thing) thing.forceMove(get_turf(src)) - thing.throw_at(get_edge_target_turf(src, pick(alldirs)), rand(1,3), 5) + thing.throw_at(get_edge_target_turf(src, pick(GLOB.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/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index af689940d97..d8b948fc865 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -345,9 +345,9 @@ var/criminal = "None" if(perpname) - for(var/datum/data/record/E in data_core.general) + for(var/datum/data/record/E in GLOB.data_core.general) if(E.fields["name"] == perpname) - for(var/datum/data/record/R in data_core.security) + for(var/datum/data/record/R in GLOB.data_core.security) if(R.fields["id"] == E.fields["id"]) criminal = R.fields["criminal"] var/criminal_status = hasHUD(user, "read_only_security") ? "\[[criminal]\]" : "\[[criminal]\]" @@ -358,9 +358,9 @@ var/perpname = get_visible_name(TRUE) var/medical = "None" - for(var/datum/data/record/E in data_core.general) + for(var/datum/data/record/E in GLOB.data_core.general) if(E.fields["name"] == perpname) - for(var/datum/data/record/R in data_core.general) + for(var/datum/data/record/R in GLOB.data_core.general) if(R.fields["id"] == E.fields["id"]) medical = R.fields["p_stat"] diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 73b40652888..59285ba88e3 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -30,7 +30,7 @@ create_reagents(330) - martial_art = default_martial_art + martial_art = GLOB.default_martial_art handcrafting = new() @@ -710,9 +710,9 @@ var/perpname = get_visible_name(TRUE) if(perpname != "Unknown") - for(var/datum/data/record/E in data_core.general) + for(var/datum/data/record/E in GLOB.data_core.general) if(E.fields["name"] == perpname) - for(var/datum/data/record/R in data_core.security) + for(var/datum/data/record/R in GLOB.data_core.security) if(R.fields["id"] == E.fields["id"]) var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", R.fields["criminal"]) in list("None", "*Arrest*", "Incarcerated", "Parolled", "Released", "Cancel") @@ -749,9 +749,9 @@ var/perpname = get_visible_name(TRUE) var/read = 0 - for(var/datum/data/record/E in data_core.general) + for(var/datum/data/record/E in GLOB.data_core.general) if(E.fields["name"] == perpname) - for(var/datum/data/record/R in data_core.security) + for(var/datum/data/record/R in GLOB.data_core.security) if(R.fields["id"] == E.fields["id"]) if(hasHUD(usr,"security")) to_chat(usr, "Name: [R.fields["name"]] Criminal Status: [R.fields["criminal"]]") @@ -773,9 +773,9 @@ var/perpname = get_visible_name(TRUE) var/read = 0 - for(var/datum/data/record/E in data_core.general) + for(var/datum/data/record/E in GLOB.data_core.general) if(E.fields["name"] == perpname) - for(var/datum/data/record/R in data_core.security) + for(var/datum/data/record/R in GLOB.data_core.security) if(R.fields["id"] == E.fields["id"]) if(hasHUD(usr,"security")) read = 1 @@ -795,9 +795,9 @@ return var/perpname = get_visible_name(TRUE) - for(var/datum/data/record/E in data_core.general) + for(var/datum/data/record/E in GLOB.data_core.general) if(E.fields["name"] == perpname) - for(var/datum/data/record/R in data_core.security) + for(var/datum/data/record/R in GLOB.data_core.security) if(R.fields["id"] == E.fields["id"]) if(hasHUD(usr,"security")) var/t1 = copytext(trim(sanitize(input("Add Comment:", "Sec. records", null, null) as message)), 1, MAX_MESSAGE_LEN) @@ -805,13 +805,13 @@ return if(ishuman(usr)) var/mob/living/carbon/human/U = usr - R.fields["comments"] += "Made by [U.get_authentification_name()] ([U.get_assignment()]) on [current_date_string] [station_time_timestamp()]
    [t1]" + R.fields["comments"] += "Made by [U.get_authentification_name()] ([U.get_assignment()]) on [GLOB.current_date_string] [station_time_timestamp()]
    [t1]" if(isrobot(usr)) var/mob/living/silicon/robot/U = usr - R.fields["comments"] += "Made by [U.name] ([U.modtype] [U.braintype]) on [current_date_string] [station_time_timestamp()]
    [t1]" + R.fields["comments"] += "Made by [U.name] ([U.modtype] [U.braintype]) on [GLOB.current_date_string] [station_time_timestamp()]
    [t1]" if(isAI(usr)) var/mob/living/silicon/ai/U = usr - R.fields["comments"] += "Made by [U.name] (artificial intelligence) on [current_date_string] [station_time_timestamp()]
    [t1]" + R.fields["comments"] += "Made by [U.name] (artificial intelligence) on [GLOB.current_date_string] [station_time_timestamp()]
    [t1]" if(href_list["medical"]) if(hasHUD(usr,"medical")) @@ -820,9 +820,9 @@ var/modified = 0 var/perpname = get_visible_name(TRUE) - for(var/datum/data/record/E in data_core.general) + for(var/datum/data/record/E in GLOB.data_core.general) if(E.fields["name"] == perpname) - for(var/datum/data/record/R in data_core.general) + for(var/datum/data/record/R in GLOB.data_core.general) if(R.fields["id"] == E.fields["id"]) var/setmedical = input(usr, "Specify a new medical status for this person.", "Medical HUD", R.fields["p_stat"]) in list("*SSD*", "*Deceased*", "Physically Unfit", "Active", "Disabled", "Cancel") @@ -830,8 +830,8 @@ if(setmedical != "Cancel") R.fields["p_stat"] = setmedical modified = 1 - if(PDA_Manifest.len) - PDA_Manifest.Cut() + if(GLOB.PDA_Manifest.len) + GLOB.PDA_Manifest.Cut() spawn() sec_hud_set_security_status() @@ -846,9 +846,9 @@ var/read = 0 var/perpname = get_visible_name(TRUE) - for(var/datum/data/record/E in data_core.general) + for(var/datum/data/record/E in GLOB.data_core.general) if(E.fields["name"] == perpname) - for(var/datum/data/record/R in data_core.medical) + for(var/datum/data/record/R in GLOB.data_core.medical) if(R.fields["id"] == E.fields["id"]) if(hasHUD(usr,"medical")) to_chat(usr, "Name: [R.fields["name"]] Blood Type: [R.fields["b_type"]]") @@ -871,9 +871,9 @@ var/perpname = get_visible_name(TRUE) var/read = 0 - for(var/datum/data/record/E in data_core.general) + for(var/datum/data/record/E in GLOB.data_core.general) if(E.fields["name"] == perpname) - for(var/datum/data/record/R in data_core.medical) + for(var/datum/data/record/R in GLOB.data_core.medical) if(R.fields["id"] == E.fields["id"]) if(hasHUD(usr,"medical")) read = 1 @@ -892,9 +892,9 @@ if(usr.incapacitated()) return var/perpname = get_visible_name(TRUE) - for(var/datum/data/record/E in data_core.general) + for(var/datum/data/record/E in GLOB.data_core.general) if(E.fields["name"] == perpname) - for(var/datum/data/record/R in data_core.medical) + for(var/datum/data/record/R in GLOB.data_core.medical) if(R.fields["id"] == E.fields["id"]) if(hasHUD(usr,"medical")) var/t1 = copytext(trim(sanitize(input("Add Comment:", "Med. records", null, null) as message)), 1, MAX_MESSAGE_LEN) @@ -902,13 +902,13 @@ return if(ishuman(usr)) var/mob/living/carbon/human/U = usr - R.fields["comments"] += "Made by [U.get_authentification_name()] ([U.get_assignment()]) on [current_date_string] [station_time_timestamp()]
    [t1]" + R.fields["comments"] += "Made by [U.get_authentification_name()] ([U.get_assignment()]) on [GLOB.current_date_string] [station_time_timestamp()]
    [t1]" if(isrobot(usr)) var/mob/living/silicon/robot/U = usr - R.fields["comments"] += "Made by [U.name] ([U.modtype] [U.braintype]) on [current_date_string] [station_time_timestamp()]
    [t1]" + R.fields["comments"] += "Made by [U.name] ([U.modtype] [U.braintype]) on [GLOB.current_date_string] [station_time_timestamp()]
    [t1]" if(isAI(usr)) var/mob/living/silicon/ai/U = usr - R.fields["comments"] += "Made by [U.name] (artificial intelligence) on [current_date_string] [station_time_timestamp()]
    [t1]" + R.fields["comments"] += "Made by [U.name] (artificial intelligence) on [GLOB.current_date_string] [station_time_timestamp()]
    [t1]" if(href_list["lookitem"]) var/obj/item/I = locate(href_list["lookitem"]) @@ -1551,7 +1551,7 @@ Eyes need to have significantly high darksight to shine unless the mob has the X //Check for arrest warrant if(judgebot.check_records) var/perpname = get_visible_name(TRUE) - var/datum/data/record/R = find_record("name", perpname, data_core.security) + var/datum/data/record/R = find_record("name", perpname, GLOB.data_core.security) if(R && R.fields["criminal"]) switch(R.fields["criminal"]) if("*Execute*") diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index c0d937a8118..b0bc9e610f3 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -1,4 +1,4 @@ -var/global/default_martial_art = new/datum/martial_art +GLOBAL_DATUM_INIT(default_martial_art, /datum/martial_art, new()) /mob/living/carbon/human hud_possible = list(HEALTH_HUD,STATUS_HUD,ID_HUD,WANTED_HUD,IMPMINDSHIELD_HUD,IMPCHEM_HUD,IMPTRACK_HUD,SPECIALROLE_HUD,GLAND_HUD) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 4ce3f266fed..d1b0935a6b3 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -87,7 +87,7 @@ Jitter(1000) // If we have the gene for being crazy, have random events. - if(dna.GetSEState(HALLUCINATIONBLOCK)) + if(dna.GetSEState(GLOB.hallucinationblock)) if(prob(1)) Hallucinate(20) @@ -167,7 +167,7 @@ emote("drool") /mob/living/carbon/human/handle_mutations_and_radiation() - for(var/datum/dna/gene/gene in dna_genes) + for(var/datum/dna/gene/gene in GLOB.dna_genes) if(!gene.block) continue if(gene.is_active(src)) diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index 40638a2110c..b53fa03cebf 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -161,7 +161,7 @@ verb = pick("whinnies", "neighs", "says") if(dna) - for(var/datum/dna/gene/gene in dna_genes) + for(var/datum/dna/gene/gene in GLOB.dna_genes) if(!gene.block) continue if(gene.is_active(src)) diff --git a/code/modules/mob/living/carbon/human/species/abductor.dm b/code/modules/mob/living/carbon/human/species/abductor.dm index 9571040fcec..d7220d3a3e9 100644 --- a/code/modules/mob/living/carbon/human/species/abductor.dm +++ b/code/modules/mob/living/carbon/human/species/abductor.dm @@ -37,10 +37,10 @@ H.gender = NEUTER H.languages.Cut() //Under no condition should you be able to speak any language H.add_language("Abductor Mindlink") //other than over the abductor's own mindlink - var/datum/atom_hud/abductor_hud = huds[DATA_HUD_ABDUCTOR] + var/datum/atom_hud/abductor_hud = GLOB.huds[DATA_HUD_ABDUCTOR] abductor_hud.add_hud_to(H) /datum/species/abductor/on_species_loss(mob/living/carbon/human/H) ..() - var/datum/atom_hud/abductor_hud = huds[DATA_HUD_ABDUCTOR] + var/datum/atom_hud/abductor_hud = GLOB.huds[DATA_HUD_ABDUCTOR] abductor_hud.remove_hud_from(H) diff --git a/code/modules/mob/living/carbon/human/species/grey.dm b/code/modules/mob/living/carbon/human/species/grey.dm index 502ce1a4ac0..720a13a7d55 100644 --- a/code/modules/mob/living/carbon/human/species/grey.dm +++ b/code/modules/mob/living/carbon/human/species/grey.dm @@ -32,9 +32,9 @@ /datum/species/grey/handle_dna(mob/living/carbon/human/H, remove) ..() - H.dna.SetSEState(REMOTETALKBLOCK, !remove, 1) - genemutcheck(H, REMOTETALKBLOCK, null, MUTCHK_FORCED) - H.dna.default_blocks.Add(REMOTETALKBLOCK) + H.dna.SetSEState(GLOB.remotetalkblock, !remove, 1) + genemutcheck(H, GLOB.remotetalkblock, null, MUTCHK_FORCED) + H.dna.default_blocks.Add(GLOB.remotetalkblock) /datum/species/grey/water_act(mob/living/carbon/human/H, volume, temperature, source, method = REAGENT_TOUCH) . = ..() diff --git a/code/modules/mob/living/carbon/human/species/machine.dm b/code/modules/mob/living/carbon/human/species/machine.dm index e920cc38b90..fdc7c6c4c46 100644 --- a/code/modules/mob/living/carbon/human/species/machine.dm +++ b/code/modules/mob/living/carbon/human/species/machine.dm @@ -116,7 +116,7 @@ to_chat(H, "Where's your head at? Can't change your monitor/display without one.") return - var/datum/robolimb/robohead = all_robolimbs[head_organ.model] + var/datum/robolimb/robohead = GLOB.all_robolimbs[head_organ.model] if(!head_organ) return if(!robohead.is_monitor) //If they've got a prosthetic head and it isn't a monitor, they've no screen to adjust. Instead, let them change the colour of their optics! diff --git a/code/modules/mob/living/carbon/human/species/monkey.dm b/code/modules/mob/living/carbon/human/species/monkey.dm index b357d2c5345..6a478c00f55 100644 --- a/code/modules/mob/living/carbon/human/species/monkey.dm +++ b/code/modules/mob/living/carbon/human/species/monkey.dm @@ -41,7 +41,7 @@ if(H.stat != CONSCIOUS) return if(prob(33) && H.canmove && isturf(H.loc) && !H.pulledby) //won't move if being pulled - step(H, pick(cardinal)) + step(H, pick(GLOB.cardinal)) if(prob(1)) H.emote(pick("scratch","jump","roll","tail")) @@ -57,8 +57,8 @@ /datum/species/monkey/handle_dna(mob/living/carbon/human/H, remove) ..() if(!remove) - H.dna.SetSEState(MONKEYBLOCK, TRUE) - genemutcheck(H, MONKEYBLOCK, null, MUTCHK_FORCED) + H.dna.SetSEState(GLOB.monkeyblock, TRUE) + genemutcheck(H, GLOB.monkeyblock, null, MUTCHK_FORCED) /datum/species/monkey/tajaran name = "Farwa" diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 2ca0f47f7a7..6139bed100f 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -4,7 +4,7 @@ TODO: Proper documentation icon_key is [species.race_key][g][husk][fat][hulk][skeleton][s_tone] */ -var/global/list/human_icon_cache = list() +GLOBAL_LIST_EMPTY(human_icon_cache) /////////////////////// //UPDATE_ICONS SYSTEM// @@ -120,7 +120,7 @@ Please contact me on #coderbus IRC. ~Carn x overlays_standing[cache_index] = null -var/global/list/damage_icon_parts = list() +GLOBAL_LIST_EMPTY(damage_icon_parts) //DAMAGE OVERLAYS //constructs damage icon for each organ from mask * damage field and saves it in our overlays_ lists @@ -151,13 +151,13 @@ var/global/list/damage_icon_parts = list() var/icon/DI var/cache_index = "[E.damage_state]/[E.icon_name]/[dna.species.blood_color]/[dna.species.name]" - if(damage_icon_parts[cache_index] == null) + if(GLOB.damage_icon_parts[cache_index] == null) DI = new /icon(dna.species.damage_overlays, E.damage_state) // the damage icon for whole human DI.Blend(new /icon(dna.species.damage_mask, E.icon_name), ICON_MULTIPLY) // mask with this organ's pixels DI.Blend(dna.species.blood_color, ICON_MULTIPLY) - damage_icon_parts[cache_index] = DI + GLOB.damage_icon_parts[cache_index] = DI else - DI = damage_icon_parts[cache_index] + DI = GLOB.damage_icon_parts[cache_index] damage_overlay.overlays += DI apply_overlay(H_DAMAGE_LAYER) @@ -191,8 +191,8 @@ var/global/list/damage_icon_parts = list() var/icon_key = generate_icon_render_key() var/mutable_appearance/base - if(human_icon_cache[icon_key] && !rebuild_base) - base = human_icon_cache[icon_key] + if(GLOB.human_icon_cache[icon_key] && !rebuild_base) + base = GLOB.human_icon_cache[icon_key] standing += base else var/icon/base_icon @@ -241,7 +241,7 @@ var/global/list/damage_icon_parts = list() base_icon.Blend(husk_over, ICON_OVERLAY) var/mutable_appearance/new_base = mutable_appearance(base_icon, layer = -LIMBS_LAYER) - human_icon_cache[icon_key] = new_base + GLOB.human_icon_cache[icon_key] = new_base standing += new_base //END CACHED ICON GENERATION. @@ -459,7 +459,7 @@ var/global/list/damage_icon_parts = list() if(gender == FEMALE) g = "f" // DNA2 - Drawing underlays. - for(var/datum/dna/gene/gene in dna_genes) + for(var/datum/dna/gene/gene in GLOB.dna_genes) if(!gene.block) continue if(gene.is_active(src)) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index b35556903f2..0f6ba5df181 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1,6 +1,6 @@ /mob/living/Initialize() . = ..() - var/datum/atom_hud/data/human/medical/advanced/medhud = huds[DATA_HUD_MEDICAL_ADVANCED] + var/datum/atom_hud/data/human/medical/advanced/medhud = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] medhud.add_to_hud(src) faction += "\ref[src]" @@ -580,7 +580,7 @@ newdir = NORTH else if(newdir == 12) //E + W newdir = EAST - if((newdir in cardinal) && (prob(50))) + if((newdir in GLOB.cardinal) && (prob(50))) newdir = turn(get_dir(T, loc), 180) if(!blood_exists) new /obj/effect/decal/cleanable/trail_holder(loc) diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 73ad5eabaca..782808f2190 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -1,4 +1,4 @@ -var/list/department_radio_keys = list( +GLOBAL_LIST_INIT(department_radio_keys, list( ":r" = "right ear", "#r" = "right ear", ".r" = "right ear", ":l" = "left ear", "#l" = "left ear", ".l" = "left ear", ":i" = "intercom", "#i" = "intercom", ".i" = "intercom", @@ -34,20 +34,20 @@ var/list/department_radio_keys = list( ":-" = "Special Ops", "#-" = "Special Ops", ".-" = "Special Ops", ":_" = "SyndTeam", "#_" = "SyndTeam", "._" = "SyndTeam", ":X" = "cords", "#X" = "cords", ".X" = "cords" -) +)) +GLOBAL_LIST_EMPTY(channel_to_radio_key) -var/list/channel_to_radio_key = new proc/get_radio_key_from_channel(var/channel) - var/key = channel_to_radio_key[channel] + var/key = GLOB.channel_to_radio_key[channel] if(!key) - for(var/radio_key in department_radio_keys) - if(department_radio_keys[radio_key] == channel) + for(var/radio_key in GLOB.department_radio_keys) + if(GLOB.department_radio_keys[radio_key] == channel) key = radio_key break if(!key) key = "" - channel_to_radio_key[channel] = key + GLOB.channel_to_radio_key[channel] = key return key diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 41de195a9e0..ddc96a7948f 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -1,5 +1,5 @@ -var/list/ai_list = list() -var/list/ai_verbs_default = list( +GLOBAL_LIST_EMPTY(ai_list) +GLOBAL_LIST_INIT(ai_verbs_default, list( /mob/living/silicon/ai/proc/announcement, /mob/living/silicon/ai/proc/ai_announcement_text, /mob/living/silicon/ai/proc/ai_call_shuttle, @@ -21,13 +21,13 @@ var/list/ai_verbs_default = list( /mob/living/silicon/ai/proc/toggle_camera_light, /mob/living/silicon/ai/proc/botcall, /mob/living/silicon/ai/proc/change_arrival_message -) +)) //Not sure why this is necessary... /proc/AutoUpdateAI(obj/subject) var/is_in_use = 0 if(subject!=null) - for(var/A in ai_list) + for(var/A in GLOB.ai_list) var/mob/living/silicon/ai/M = A if((M.client && M.machine == subject)) is_in_use = 1 @@ -112,11 +112,11 @@ var/list/ai_verbs_default = list( var/max_multicams = 6 /mob/living/silicon/ai/proc/add_ai_verbs() - verbs |= ai_verbs_default + verbs |= GLOB.ai_verbs_default verbs |= silicon_subsystems /mob/living/silicon/ai/proc/remove_ai_verbs() - verbs -= ai_verbs_default + verbs -= GLOB.ai_verbs_default verbs -= silicon_subsystems /mob/living/silicon/ai/New(loc, var/datum/ai_laws/L, var/obj/item/mmi/B, var/safety = 0) @@ -206,7 +206,7 @@ var/list/ai_verbs_default = list( builtInCamera.c_tag = name builtInCamera.network = list("SS13") - ai_list += src + GLOB.ai_list += src GLOB.shuttle_caller_list += src ..() @@ -271,7 +271,7 @@ var/list/ai_verbs_default = list( return TRUE /mob/living/silicon/ai/Destroy() - ai_list -= src + GLOB.ai_list -= src GLOB.shuttle_caller_list -= src SSshuttle.autoEvac() QDEL_NULL(eyeobj) // No AI, no Eye @@ -607,7 +607,7 @@ var/list/ai_verbs_default = list( unset_machine() src << browse(null, t1) if(href_list["switchcamera"]) - switchCamera(locate(href_list["switchcamera"])) in cameranet.cameras + switchCamera(locate(href_list["switchcamera"])) in GLOB.cameranet.cameras if(href_list["showalerts"]) subsystem_alarm_monitor() if(href_list["show_paper"]) @@ -679,7 +679,7 @@ var/list/ai_verbs_default = list( if(controlled_mech) to_chat(src, "You are already loaded into an onboard computer!") return - if(!cameranet.checkCameraVis(M)) + if(!GLOB.cameranet.checkCameraVis(M)) to_chat(src, "Exosuit is no longer near active cameras.") return if(lacks_power()) @@ -768,7 +768,7 @@ var/list/ai_verbs_default = list( //The target must be in view of a camera or near the core. if(turf_check in range(get_turf(src))) call_bot(turf_check) - else if(cameranet && cameranet.checkTurfVis(turf_check)) + else if(GLOB.cameranet && GLOB.cameranet.checkTurfVis(turf_check)) call_bot(turf_check) else to_chat(src, "Selected location is not visible.") @@ -819,7 +819,7 @@ var/list/ai_verbs_default = list( var/mob/living/silicon/ai/U = usr - for(var/obj/machinery/camera/C in cameranet.cameras) + for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) if(!C.can_use()) continue @@ -840,7 +840,7 @@ var/list/ai_verbs_default = list( if(isnull(network)) network = old_network // If nothing is selected else - for(var/obj/machinery/camera/C in cameranet.cameras) + for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) if(!C.can_use()) continue if(network in C.network) @@ -916,7 +916,7 @@ var/list/ai_verbs_default = list( if("Crew Member") var/personnel_list[] = list() - for(var/datum/data/record/t in data_core.locked)//Look in data core locked. + for(var/datum/data/record/t in GLOB.data_core.locked)//Look in data core locked. personnel_list["[t.fields["name"]]: [t.fields["rank"]]"] = t.fields["image"]//Pull names, rank, and image. if(personnel_list.len) @@ -1203,7 +1203,7 @@ var/list/ai_verbs_default = list( //get_turf_pixel() is because APCs in maint aren't actually in view of the inner camera //apc_override is needed here because AIs use their own APC when depowered var/turf/T = isturf(A) ? A : get_turf_pixel(A) - return (cameranet && cameranet.checkTurfVis(T)) || apc_override + return (GLOB.cameranet && GLOB.cameranet.checkTurfVis(T)) || apc_override //AI is carded/shunted //view(src) returns nothing for carded/shunted AIs and they have x-ray vision so just use get_dist var/list/viewscale = getviewsize(client.view) @@ -1280,7 +1280,7 @@ var/list/ai_verbs_default = list( to_chat(src, "Target is not on or near any active cameras on the station.") /mob/living/silicon/ai/proc/camera_visibility(mob/camera/aiEye/moved_eye) - cameranet.visibility(moved_eye, client, all_eyes) + GLOB.cameranet.visibility(moved_eye, client, all_eyes) /mob/living/silicon/ai/forceMove(atom/destination) . = ..() diff --git a/code/modules/mob/living/silicon/ai/death.dm b/code/modules/mob/living/silicon/ai/death.dm index 2e35c437d45..641b1a2af0f 100644 --- a/code/modules/mob/living/silicon/ai/death.dm +++ b/code/modules/mob/living/silicon/ai/death.dm @@ -27,7 +27,7 @@ if(SSshuttle.emergency.mode == SHUTTLE_STRANDED) SSshuttle.emergency.mode = SHUTTLE_DOCKED SSshuttle.emergency.timer = world.time - priority_announcement.Announce("Hostile environment resolved. You have 3 minutes to board the Emergency Shuttle.", "Priority Announcement", 'sound/AI/shuttledock.ogg') + GLOB.priority_announcement.Announce("Hostile environment resolved. You have 3 minutes to board the Emergency Shuttle.", "Priority Announcement", 'sound/AI/shuttledock.ogg') qdel(doomsday_device) if(explosive) diff --git a/code/modules/mob/living/silicon/ai/freelook/cameranet.dm b/code/modules/mob/living/silicon/ai/freelook/cameranet.dm index fac6e3b518b..d9f4af600af 100644 --- a/code/modules/mob/living/silicon/ai/freelook/cameranet.dm +++ b/code/modules/mob/living/silicon/ai/freelook/cameranet.dm @@ -4,7 +4,7 @@ #define CHUNK_SIZE 16 // Only chunk sizes that are to the power of 2. E.g: 2, 4, 8, 16, etc.. -var/datum/cameranet/cameranet = new() +GLOBAL_DATUM_INIT(cameranet, /datum/cameranet, new()) /datum/cameranet var/name = "Camera Net" // Name to show for VV and stat() diff --git a/code/modules/mob/living/silicon/ai/latejoin.dm b/code/modules/mob/living/silicon/ai/latejoin.dm index 513b26ee558..75e8854b45c 100644 --- a/code/modules/mob/living/silicon/ai/latejoin.dm +++ b/code/modules/mob/living/silicon/ai/latejoin.dm @@ -1,4 +1,4 @@ -var/global/list/empty_playable_ai_cores = list() +GLOBAL_LIST_EMPTY(empty_playable_ai_cores) /hook/roundstart/proc/spawn_empty_ai() for(var/obj/effect/landmark/start/S in GLOB.landmarks_list) @@ -6,7 +6,7 @@ var/global/list/empty_playable_ai_cores = list() continue if(locate(/mob/living) in S.loc) continue - empty_playable_ai_cores += new /obj/structure/AIcore/deactivated(get_turf(S)) + GLOB.empty_playable_ai_cores += new /obj/structure/AIcore/deactivated(get_turf(S)) return 1 @@ -21,8 +21,8 @@ var/global/list/empty_playable_ai_cores = list() return // We warned you. - empty_playable_ai_cores += new /obj/structure/AIcore/deactivated(loc) - global_announcer.autosay("[src] has been moved to intelligence storage.", "Artificial Intelligence Oversight") + GLOB.empty_playable_ai_cores += new /obj/structure/AIcore/deactivated(loc) + GLOB.global_announcer.autosay("[src] has been moved to intelligence storage.", "Artificial Intelligence Oversight") //Handle job slot/tater cleanup. var/job = mind.assigned_role @@ -68,13 +68,13 @@ var/global/list/empty_playable_ai_cores = list() // Before calling this, make sure an empty core exists, or this will no-op /mob/living/silicon/ai/proc/moveToEmptyCore() - if(!empty_playable_ai_cores.len) + if(!GLOB.empty_playable_ai_cores.len) log_runtime(EXCEPTION("moveToEmptyCore called without any available cores"), src) return // IsJobAvailable for AI checks that there is an empty core available in this list - var/obj/structure/AIcore/deactivated/C = empty_playable_ai_cores[1] - empty_playable_ai_cores -= C + var/obj/structure/AIcore/deactivated/C = GLOB.empty_playable_ai_cores[1] + GLOB.empty_playable_ai_cores -= C forceMove(C.loc) view_core() diff --git a/code/modules/mob/living/silicon/ai/multicam.dm b/code/modules/mob/living/silicon/ai/multicam.dm index 254d5a9b794..d33e57ea971 100644 --- a/code/modules/mob/living/silicon/ai/multicam.dm +++ b/code/modules/mob/living/silicon/ai/multicam.dm @@ -135,7 +135,7 @@ GLOBAL_DATUM(ai_camera_room_landmark, /obj/effect/landmark/ai_multicam_room) if(screen && screen.ai) screen.ai.camera_visibility(src) else - cameranet.visibility(src) + GLOB.cameranet.visibility(src) update_camera_telegraphing() /mob/camera/aiEye/pic_in_pic/proc/update_camera_telegraphing() diff --git a/code/modules/mob/living/silicon/ai/say.dm b/code/modules/mob/living/silicon/ai/say.dm index 406b232681d..599063c2724 100644 --- a/code/modules/mob/living/silicon/ai/say.dm +++ b/code/modules/mob/living/silicon/ai/say.dm @@ -65,7 +65,7 @@ * AI VOX Announcements */ -var/announcing_vox = 0 // Stores the time of the last announcement +GLOBAL_VAR_INIT(announcing_vox, 0) // Stores the time of the last announcement #define VOX_DELAY 100 #define VOX_PATH "sound/vox_fem/" @@ -81,10 +81,10 @@ var/announcing_vox = 0 // Stores the time of the last announcement WARNING:
    Misuse of the announcement system will get you job banned.
    " var/index = 0 - for(var/word in vox_sounds) + for(var/word in GLOB.vox_sounds) index++ dat += "[capitalize(word)]" - if(index != vox_sounds.len) + if(index != GLOB.vox_sounds.len) dat += " / " var/datum/browser/popup = new(src, "announce_help", "Announcement Help", 500, 400) @@ -95,8 +95,8 @@ var/announcing_vox = 0 // Stores the time of the last announcement if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO)) return - if(announcing_vox > world.time) - to_chat(src, "Please wait [round((announcing_vox - world.time) / 10)] seconds.") + if(GLOB.announcing_vox > world.time) + to_chat(src, "Please wait [round((GLOB.announcing_vox - world.time) / 10)] seconds.") return var/message = clean_input("WARNING: Misuse of this verb can result in you being job banned. More help is available in 'Announcement Help'", "Announcement", last_announcement, src) @@ -106,7 +106,7 @@ var/announcing_vox = 0 // Stores the time of the last announcement if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO)) return - if(!message || announcing_vox > world.time) + if(!message || GLOB.announcing_vox > world.time) return var/list/words = splittext(trim(message), " ") @@ -120,14 +120,14 @@ var/announcing_vox = 0 // Stores the time of the last announcement if(!word) words -= word continue - if(!vox_sounds[word]) + if(!GLOB.vox_sounds[word]) incorrect_words += word if(incorrect_words.len) to_chat(src, "These words are not available on the announcement system: [english_list(incorrect_words)].") return - announcing_vox = world.time + VOX_DELAY + GLOB.announcing_vox = world.time + VOX_DELAY log_game("[key_name(src)] made a vocal announcement: [message].") message_admins("[key_name_admin(src)] made a vocal announcement: [message].") @@ -156,9 +156,9 @@ var/announcing_vox = 0 // Stores the time of the last announcement word = lowertext(word) - if(vox_sounds[word]) + if(GLOB.vox_sounds[word]) - var/sound_file = vox_sounds[word] + var/sound_file = GLOB.vox_sounds[word] var/sound/voice = sound(sound_file, wait = 1, channel = CHANNEL_VOX) voice.status = SOUND_STREAM diff --git a/code/modules/mob/living/silicon/pai/recruit.dm b/code/modules/mob/living/silicon/pai/recruit.dm index fd4f04e8ec4..f52da9942e4 100644 --- a/code/modules/mob/living/silicon/pai/recruit.dm +++ b/code/modules/mob/living/silicon/pai/recruit.dm @@ -1,6 +1,6 @@ // Recruiting observers to play as pAIs -var/datum/paiController/paiController // Global handler for pAI candidates +GLOBAL_DATUM(paiController, /datum/paiController) // Global handler for pAI candidates /datum/paiCandidate var/name @@ -12,7 +12,7 @@ var/datum/paiController/paiController // Global handler for pAI candidates /hook/startup/proc/paiControllerSetup() - paiController = new /datum/paiController() + GLOB.paiController = new /datum/paiController() return 1 @@ -252,7 +252,7 @@ var/datum/paiController/paiController // Global handler for pAI candidates /datum/paiController/proc/findPAI(var/obj/item/paicard/p, var/mob/user) requestRecruits(p, user) var/list/available = list() - for(var/datum/paiCandidate/c in paiController.pai_candidates) + for(var/datum/paiCandidate/c in GLOB.paiController.pai_candidates) if(c.ready) var/found = 0 for(var/mob/o in GLOB.respawnable_list) diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index 70117b4558c..3b51048452e 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -1,4 +1,4 @@ -var/list/pai_emotions = list( +GLOBAL_LIST_INIT(pai_emotions, list( "Happy" = 1, "Cat" = 2, "Extremely Happy" = 3, @@ -8,28 +8,28 @@ var/list/pai_emotions = list( "Sad" = 7, "Angry" = 8, "What" = 9 - ) +)) -var/global/list/pai_software_by_key = list() -var/global/list/default_pai_software = list() +GLOBAL_LIST_EMPTY(pai_software_by_key) +GLOBAL_LIST_EMPTY(default_pai_software) /hook/startup/proc/populate_pai_software_list() var/r = 1 // I would use ., but it'd sacrifice runtime detection for(var/type in subtypesof(/datum/pai_software)) var/datum/pai_software/P = new type() - if(pai_software_by_key[P.id]) - var/datum/pai_software/O = pai_software_by_key[P.id] + if(GLOB.pai_software_by_key[P.id]) + var/datum/pai_software/O = GLOB.pai_software_by_key[P.id] to_chat(world, "pAI software module [P.name] has the same key as [O.name]!") r = 0 continue - pai_software_by_key[P.id] = P + GLOB.pai_software_by_key[P.id] = P if(P.default) - default_pai_software[P.id] = P + GLOB.default_pai_software[P.id] = P return r /mob/living/silicon/pai/New() ..() - software = default_pai_software.Copy() + software = GLOB.default_pai_software.Copy() /mob/living/silicon/pai/verb/paiInterface() set category = "pAI Commands" @@ -37,7 +37,7 @@ var/global/list/default_pai_software = list() ui_interact(src) -/mob/living/silicon/pai/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, datum/topic_state/state = self_state) +/mob/living/silicon/pai/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, datum/topic_state/state = GLOB.self_state) if(ui_key != "main") var/datum/pai_software/S = software[ui_key] if(S && !S.toggle) @@ -58,7 +58,7 @@ var/global/list/default_pai_software = list() ui.open() ui.set_auto_update(1) -/mob/living/silicon/pai/ui_data(mob/user, ui_key = "main", datum/topic_state/state = self_state) +/mob/living/silicon/pai/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.self_state) var/data[0] if(ui_key != "main") @@ -72,8 +72,8 @@ var/global/list/default_pai_software = list() // Software we have not bought var/not_bought_software[0] - for(var/key in pai_software_by_key) - var/datum/pai_software/S = pai_software_by_key[key] + for(var/key in GLOB.pai_software_by_key) + var/datum/pai_software/S = GLOB.pai_software_by_key[key] var/software_data[0] software_data["name"] = S.name software_data["id"] = S.id @@ -90,10 +90,10 @@ var/global/list/default_pai_software = list() // Emotions var/emotions[0] - for(var/name in pai_emotions) + for(var/name in GLOB.pai_emotions) var/emote[0] emote["name"] = name - emote["id"] = pai_emotions[name] + emote["id"] = GLOB.pai_emotions[name] emotions[++emotions.len] = emote data["emotions"] = emotions @@ -122,7 +122,7 @@ var/global/list/default_pai_software = list() else if(href_list["purchase"]) var/soft = href_list["purchase"] - var/datum/pai_software/S = pai_software_by_key[soft] + var/datum/pai_software/S = GLOB.pai_software_by_key[soft] if(S && (ram >= S.ram_cost)) ram -= S.ram_cost software[S.id] = S diff --git a/code/modules/mob/living/silicon/pai/software_modules.dm b/code/modules/mob/living/silicon/pai/software_modules.dm index 84c467b1549..5bdea06e18e 100644 --- a/code/modules/mob/living/silicon/pai/software_modules.dm +++ b/code/modules/mob/living/silicon/pai/software_modules.dm @@ -19,7 +19,7 @@ var/ui_width = 450 var/ui_height = 600 -/datum/pai_software/proc/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state) +/datum/pai_software/proc/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state) return list() /datum/pai_software/proc/toggle(mob/living/silicon/pai/user) @@ -39,7 +39,7 @@ ui_title = "pAI Directives" autoupdate = 1 -/datum/pai_software/directives/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state) +/datum/pai_software/directives/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state) var/data[0] data["master"] = user.master @@ -94,7 +94,7 @@ ui_width = 300 ui_height = 150 -/datum/pai_software/radio_config/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state) +/datum/pai_software/radio_config/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state) var/data[0] data["listening"] = user.radio.broadcasting @@ -129,11 +129,11 @@ template_file = "pai_manifest.tmpl" ui_title = "Crew Manifest" -/datum/pai_software/crew_manifest/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state) +/datum/pai_software/crew_manifest/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state) var/data[0] - data_core.get_manifest_json() - data["manifest"] = PDA_Manifest + GLOB.data_core.get_manifest_json() + data["manifest"] = GLOB.PDA_Manifest return data @@ -147,7 +147,7 @@ template_file = "pai_messenger.tmpl" ui_title = "Digital Messenger" -/datum/pai_software/messenger/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state) +/datum/pai_software/messenger/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state) var/data[0] if(!user.pda) @@ -165,7 +165,7 @@ var/pdas[0] if(!M.toff) - for(var/obj/item/pda/P in PDAs) + for(var/obj/item/pda/P in GLOB.PDAs) var/datum/data/pda/app/messenger/PM = P.find_program(/datum/data/pda/app/messenger) if(P == user.pda || !PM || !PM.can_receive()) @@ -237,11 +237,11 @@ ui_title = "Medical Records" -/datum/pai_software/med_records/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state) +/datum/pai_software/med_records/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state) var/data[0] var/records[0] - for(var/datum/data/record/general in sortRecord(data_core.general)) + for(var/datum/data/record/general in sortRecord(GLOB.data_core.general)) var/record[0] record["name"] = general.fields["name"] record["ref"] = "\ref[general]" @@ -266,11 +266,11 @@ if(record) var/datum/data/record/R = record var/datum/data/record/M = null - if(!( data_core.general.Find(R) )) + if(!( GLOB.data_core.general.Find(R) )) P.medical_cannotfind = 1 else P.medical_cannotfind = 0 - for(var/datum/data/record/E in data_core.medical) + for(var/datum/data/record/E in GLOB.data_core.medical) if((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"])) M = E P.medicalActive1 = R @@ -290,11 +290,11 @@ ui_title = "Security Records" -/datum/pai_software/sec_records/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state) +/datum/pai_software/sec_records/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state) var/data[0] var/records[0] - for(var/datum/data/record/general in sortRecord(data_core.general)) + for(var/datum/data/record/general in sortRecord(GLOB.data_core.general)) var/record[0] record["name"] = general.fields["name"] record["ref"] = "\ref[general]" @@ -319,13 +319,13 @@ if(record) var/datum/data/record/R = record var/datum/data/record/S = null - if(!( data_core.general.Find(R) )) + if(!( GLOB.data_core.general.Find(R) )) P.securityActive1 = null P.securityActive2 = null P.security_cannotfind = 1 else P.security_cannotfind = 0 - for(var/datum/data/record/E in data_core.security) + for(var/datum/data/record/E in GLOB.data_core.security) if((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"])) S = E P.securityActive1 = R @@ -348,7 +348,7 @@ ui_width = 300 ui_height = 150 -/datum/pai_software/door_jack/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state) +/datum/pai_software/door_jack/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state) var/data[0] data["cable"] = user.cable != null @@ -424,7 +424,7 @@ ui_height = 300 -/datum/pai_software/atmosphere_sensor/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state) +/datum/pai_software/atmosphere_sensor/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state) var/data[0] var/turf/T = get_turf_or_move(user.loc) @@ -543,7 +543,7 @@ ui_width = 320 ui_height = 150 -/datum/pai_software/signaller/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state) +/datum/pai_software/signaller/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state) var/data[0] data["frequency"] = format_frequency(user.sradio.frequency) @@ -586,7 +586,7 @@ ui_width = 400 ui_height = 350 -/datum/pai_software/host_scan/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state) +/datum/pai_software/host_scan/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state) var/data[0] var/mob/living/held = user.loc var/count = 0 diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index 7802f4c77d5..48f1acd80fa 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -188,7 +188,7 @@ message_admins("[key_name_admin(user)] emagged drone [key_name_admin(src)]. Laws overridden.") log_game("[key_name(user)] emagged drone [key_name(src)]. Laws overridden.") var/time = time2text(world.realtime,"hh:mm:ss") - lawchanges.Add("[time] : [H.name]([H.key]) emagged [name]([key])") + GLOB.lawchanges.Add("[time] : [H.name]([H.key]) emagged [name]([key])") emagged_time = world.time emagged = 1 diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index f0a49b47af1..a8bad5ebc03 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -1,6 +1,6 @@ -var/list/robot_verbs_default = list( +GLOBAL_LIST_INIT(robot_verbs_default, list( /mob/living/silicon/robot/proc/sensor_mode, -) +)) /mob/living/silicon/robot name = "Cyborg" @@ -144,7 +144,7 @@ var/list/robot_verbs_default = list( if(!cell) // Make sure a new cell gets created *before* executing initialize_components(). The cell component needs an existing cell for it to get set up properly cell = new /obj/item/stock_parts/cell/high(src) - + initialize_components() //if(!unfinished) // Create all the robot parts. @@ -290,7 +290,7 @@ var/list/robot_verbs_default = list( var/list/modules = list("Standard", "Engineering", "Medical", "Miner", "Janitor", "Service", "Security") if(islist(force_modules) && force_modules.len) modules = force_modules.Copy() - if(security_level == (SEC_LEVEL_GAMMA || SEC_LEVEL_EPSILON) || crisis) + if(GLOB.security_level == (SEC_LEVEL_GAMMA || SEC_LEVEL_EPSILON) || crisis) to_chat(src, "Crisis mode active. The combat module is now available.") modules += "Combat" if(mmi != null && mmi.alien) @@ -512,11 +512,11 @@ var/list/robot_verbs_default = list( toggle_sensor_mode() /mob/living/silicon/robot/proc/add_robot_verbs() - src.verbs |= robot_verbs_default + src.verbs |= GLOB.robot_verbs_default src.verbs |= silicon_subsystems /mob/living/silicon/robot/proc/remove_robot_verbs() - src.verbs -= robot_verbs_default + src.verbs -= GLOB.robot_verbs_default src.verbs -= silicon_subsystems /mob/living/silicon/robot/proc/ionpulse() @@ -852,7 +852,7 @@ var/list/robot_verbs_default = list( clear_inherent_laws() laws = new /datum/ai_laws/syndicate_override var/time = time2text(world.realtime,"hh:mm:ss") - lawchanges.Add("[time] : [M.name]([M.key]) emagged [name]([key])") + GLOB.lawchanges.Add("[time] : [M.name]([M.key]) emagged [name]([key])") set_zeroth_law("Only [M.real_name] and people [M.p_they()] designate[M.p_s()] as being such are Syndicate Agents.") to_chat(src, "ALERT: Foreign software detected.") sleep(5) @@ -1134,7 +1134,7 @@ var/list/robot_verbs_default = list( updating = 1 spawn(BORG_CAMERA_BUFFER) if(oldLoc != src.loc) - cameranet.updatePortableCamera(src.camera) + GLOB.cameranet.updatePortableCamera(src.camera) updating = 0 if(module) if(module.type == /obj/item/robot_module/janitor) diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index ffbc375be04..a62f5f9d358 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -38,7 +38,7 @@ /mob/living/silicon/New() GLOB.silicon_mob_list |= src ..() - var/datum/atom_hud/data/diagnostic/diag_hud = huds[DATA_HUD_DIAGNOSTIC] + var/datum/atom_hud/data/diagnostic/diag_hud = GLOB.huds[DATA_HUD_DIAGNOSTIC] diag_hud.add_to_hud(src) diag_hud_set_status() diag_hud_set_health() @@ -217,8 +217,8 @@ /mob/living/silicon/proc/show_station_manifest() var/dat dat += "

    Crew Manifest

    " - if(data_core) - dat += data_core.get_manifest(1) // make it monochrome + if(GLOB.data_core) + dat += GLOB.data_core.get_manifest(1) // make it monochrome dat += "
    " src << browse(dat, "window=airoster") onclose(src, "airoster") @@ -244,24 +244,24 @@ return 1 /mob/living/silicon/proc/remove_med_sec_hud() - var/datum/atom_hud/secsensor = huds[sec_hud] - var/datum/atom_hud/medsensor = huds[med_hud] - for(var/datum/atom_hud/data/diagnostic/diagsensor in huds) + var/datum/atom_hud/secsensor = GLOB.huds[sec_hud] + var/datum/atom_hud/medsensor = GLOB.huds[med_hud] + for(var/datum/atom_hud/data/diagnostic/diagsensor in GLOB.huds) diagsensor.remove_hud_from(src) secsensor.remove_hud_from(src) medsensor.remove_hud_from(src) /mob/living/silicon/proc/add_sec_hud() - var/datum/atom_hud/secsensor = huds[sec_hud] + var/datum/atom_hud/secsensor = GLOB.huds[sec_hud] secsensor.add_hud_to(src) /mob/living/silicon/proc/add_med_hud() - var/datum/atom_hud/medsensor = huds[med_hud] + var/datum/atom_hud/medsensor = GLOB.huds[med_hud] medsensor.add_hud_to(src) /mob/living/silicon/proc/add_diag_hud() - for(var/datum/atom_hud/data/diagnostic/diagsensor in huds) + for(var/datum/atom_hud/data/diagnostic/diagsensor in GLOB.huds) diagsensor.add_hud_to(src) diff --git a/code/modules/mob/living/silicon/subsystems.dm b/code/modules/mob/living/silicon/subsystems.dm index 8f7c2316768..5f00beff1e4 100644 --- a/code/modules/mob/living/silicon/subsystems.dm +++ b/code/modules/mob/living/silicon/subsystems.dm @@ -20,7 +20,7 @@ /mob/living/silicon/proc/subsystem_law_manager, /mob/living/silicon/proc/subsystem_power_monitor ) - + /mob/living/silicon/robot/drone silicon_subsystems = list( /mob/living/silicon/proc/subsystem_alarm_monitor, @@ -54,8 +54,8 @@ set name = "Alarm Monitor" set category = "Subsystems" - alarm_monitor.ui_interact(usr, state = self_state) - + alarm_monitor.ui_interact(usr, state = GLOB.self_state) + /******************** * Atmos Control * ********************/ @@ -63,7 +63,7 @@ set category = "Subsystems" set name = "Atmospherics Control" - atmos_control.ui_interact(usr, state = self_state) + atmos_control.ui_interact(usr, state = GLOB.self_state) /******************** * Crew Monitor * @@ -72,8 +72,8 @@ set category = "Subsystems" set name = "Crew Monitor" - crew_monitor.ui_interact(usr, state = self_state) - + crew_monitor.ui_interact(usr, state = GLOB.self_state) + /**************** * Law Manager * ****************/ @@ -81,8 +81,8 @@ set name = "Law Manager" set category = "Subsystems" - law_manager.ui_interact(usr, state = conscious_state) - + law_manager.ui_interact(usr, state = GLOB.conscious_state) + /******************** * Power Monitor * ********************/ @@ -90,5 +90,5 @@ set category = "Subsystems" set name = "Power Monitor" - power_monitor.ui_interact(usr, state = self_state) + power_monitor.ui_interact(usr, state = GLOB.self_state) diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 98f5a3555f4..ede055dac43 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -160,7 +160,7 @@ SSradio.add_object(bot_core, control_freq, bot_filter) prepare_huds() - for(var/datum/atom_hud/data/diagnostic/diag_hud in huds) + for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds) diag_hud.add_to_hud(src) diag_hud.add_hud_to(src) permanent_huds |= diag_hud @@ -391,7 +391,7 @@ pulse2.icon_state = "empdisable" pulse2.name = "emp sparks" pulse2.anchored = 1 - pulse2.dir = pick(cardinal) + pulse2.dir = pick(GLOB.cardinal) QDEL_IN(pulse2, 10) if(paicard) @@ -1051,7 +1051,7 @@ Pass a positive integer as an argument to override a bot's default speed. path = newpath ? newpath : list() if(!path_hud) return - var/list/path_huds_watching_me = list(huds[DATA_HUD_DIAGNOSTIC_ADVANCED]) + var/list/path_huds_watching_me = list(GLOB.huds[DATA_HUD_DIAGNOSTIC_ADVANCED]) if(path_hud) path_huds_watching_me += path_hud for(var/V in path_huds_watching_me) @@ -1072,7 +1072,7 @@ Pass a positive integer as an argument to override a bot's default speed. var/turf/prevprevT = path[i - 2] var/prevDir = get_dir(prevprevT, prevT) var/mixDir = direction|prevDir - if(mixDir in diagonals) + if(mixDir in GLOB.diagonals) prevI.dir = mixDir if(prevDir & (NORTH|SOUTH)) var/matrix/ntransform = matrix() diff --git a/code/modules/mob/living/simple_animal/bot/construction.dm b/code/modules/mob/living/simple_animal/bot/construction.dm index 27ecd8e1569..024e2b5f304 100644 --- a/code/modules/mob/living/simple_animal/bot/construction.dm +++ b/code/modules/mob/living/simple_animal/bot/construction.dm @@ -1,5 +1,4 @@ //Bot Construction -var/robot_arm = /obj/item/robot_parts/l_arm //Cleanbot assembly /obj/item/bucket_sensor @@ -13,6 +12,7 @@ var/robot_arm = /obj/item/robot_parts/l_arm throw_range = 5 w_class = WEIGHT_CLASS_NORMAL var/created_name = "Cleanbot" + var/robot_arm = /obj/item/robot_parts/l_arm /obj/item/bucket_sensor/attackby(obj/item/W, mob/user as mob, params) ..() @@ -350,6 +350,7 @@ var/robot_arm = /obj/item/robot_parts/l_arm var/treatment_fire = "salglu_solution" var/treatment_tox = "charcoal" var/treatment_virus = "spaceacillin" + var/robot_arm = /obj/item/robot_parts/l_arm /obj/item/firstaid_arm_assembly/New(loc, new_skin) ..() @@ -419,6 +420,7 @@ var/robot_arm = /obj/item/robot_parts/l_arm item_state = "helmet" var/created_name = "Securitron" //To preserve the name if it's a unique securitron I guess var/build_step = 0 + var/robot_arm = /obj/item/robot_parts/l_arm /obj/item/clothing/head/helmet/attackby(obj/item/assembly/signaler/S, mob/user, params) ..() @@ -596,6 +598,7 @@ var/robot_arm = /obj/item/robot_parts/l_arm req_one_access = list(ACCESS_CLOWN, ACCESS_ROBOTICS, ACCESS_MIME) var/build_step = 0 var/created_name = "Honkbot" //To preserve the name if it's a unique medbot I guess + var/robot_arm = /obj/item/robot_parts/l_arm /obj/item/honkbot_arm_assembly/attackby(obj/item/W, mob/user, params) ..() diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm index 410f9715325..faaa65a46c4 100644 --- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm +++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm @@ -68,7 +68,7 @@ name = pick("RED RAMPAGE","RED ROVER","RED KILLDEATH MURDERBOT") //SECHUD - var/datum/atom_hud/secsensor = huds[DATA_HUD_SECURITY_ADVANCED] + var/datum/atom_hud/secsensor = GLOB.huds[DATA_HUD_SECURITY_ADVANCED] secsensor.add_hud_to(src) permanent_huds |= secsensor @@ -473,7 +473,7 @@ pulse2.icon_state = "empdisable" pulse2.name = "emp sparks" pulse2.anchored = 1 - pulse2.dir = pick(cardinal) + pulse2.dir = pick(GLOB.cardinal) spawn(10) qdel(pulse2) var/list/mob/living/carbon/targets = new diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm index b7696236e38..5246a536d92 100644 --- a/code/modules/mob/living/simple_animal/bot/medbot.dm +++ b/code/modules/mob/living/simple_animal/bot/medbot.dm @@ -123,7 +123,7 @@ prev_access = access_card.access qdel(J) - var/datum/atom_hud/medsensor = huds[DATA_HUD_MEDICAL_ADVANCED] + var/datum/atom_hud/medsensor = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] medsensor.add_hud_to(src) permanent_huds |= medsensor diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index eb629680a61..ecdb8e3f0fe 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -90,7 +90,7 @@ prev_access = access_card.access //SECHUD - var/datum/atom_hud/secsensor = huds[DATA_HUD_SECURITY_ADVANCED] + var/datum/atom_hud/secsensor = GLOB.huds[DATA_HUD_SECURITY_ADVANCED] secsensor.add_hud_to(src) permanent_huds |= secsensor diff --git a/code/modules/mob/living/simple_animal/friendly/diona.dm b/code/modules/mob/living/simple_animal/friendly/diona.dm index b4872c9ff87..e8c108a11de 100644 --- a/code/modules/mob/living/simple_animal/friendly/diona.dm +++ b/code/modules/mob/living/simple_animal/friendly/diona.dm @@ -145,7 +145,7 @@ if((stat != CONSCIOUS) || !isdiona(loc)) return FALSE var/mob/living/carbon/human/D = loc - T = get_turf(src) + var/turf/T = get_turf(src) if(!T) return FALSE to_chat(loc, "You feel a pang of loss as [src] splits away from your biomass.") diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm index 77c2edbdd53..ea8e949f1c7 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -210,7 +210,7 @@ qdel(src) #define MAX_CHICKENS 50 -var/global/chicken_count = 0 +GLOBAL_VAR_INIT(chicken_count, 0) /mob/living/simple_animal/chicken name = "\improper chicken" @@ -258,14 +258,14 @@ var/global/chicken_count = 0 icon_dead = "[icon_prefix]_[body_color]_dead" pixel_x = rand(-6, 6) pixel_y = rand(0, 10) - chicken_count += 1 + GLOB.chicken_count += 1 /mob/living/simple_animal/chicken/death(gibbed) // Only execute the below if we successfully died . = ..(gibbed) if(!.) return - chicken_count -= 1 + GLOB.chicken_count -= 1 /mob/living/simple_animal/chicken/attackby(obj/item/O, mob/user, params) if(istype(O, food_type)) //feedin' dem chickens @@ -290,7 +290,7 @@ var/global/chicken_count = 0 E.pixel_x = rand(-6,6) E.pixel_y = rand(-6,6) if(eggsFertile) - if(chicken_count < MAX_CHICKENS && prob(25)) + if(GLOB.chicken_count < MAX_CHICKENS && prob(25)) START_PROCESSING(SSobj, E) /obj/item/reagent_containers/food/snacks/egg/var/amount_grown = 0 diff --git a/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm b/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm index 77d6807e086..c0dfa097f16 100644 --- a/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm +++ b/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm @@ -78,8 +78,8 @@ pixel_y = 8 if(is_type_in_typecache(get_area(loc), invalid_area_typecache)) - var/area = pick(teleportlocs) - var/area/tp = teleportlocs[area] + var/area = pick(GLOB.teleportlocs) + var/area/tp = GLOB.teleportlocs[area] forceMove(pick(get_area_turfs(tp.type))) if((!current_victim && !admincluwne) || QDELETED(current_victim)) diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 2881a5945bb..d539721817a 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -455,8 +455,8 @@ EscapeConfinement() var/dir_to_target = get_dir(targets_from, target) var/dir_list = list() - if(dir_to_target in diagonals) //it's diagonal, so we need two directions to hit - for(var/direction in cardinal) + if(dir_to_target in GLOB.diagonals) //it's diagonal, so we need two directions to hit + for(var/direction in GLOB.cardinal) if(direction & dir_to_target) dir_list += direction else @@ -467,7 +467,7 @@ /mob/living/simple_animal/hostile/proc/DestroySurroundings() // for use with megafauna destroying everything around them if(environment_smash) EscapeConfinement() - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) DestroyObjectsInDirection(dir) /mob/living/simple_animal/hostile/proc/EscapeConfinement() diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm index 9fa5abe4695..6cde07d0b8d 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm @@ -396,9 +396,9 @@ Difficulty: Hard if(. > 0 && prob(25)) var/obj/effect/decal/cleanable/blood/gibs/bubblegum/B = new /obj/effect/decal/cleanable/blood/gibs/bubblegum(loc) if(prob(40)) - step(B, pick(cardinal)) + step(B, pick(GLOB.cardinal)) else - B.setDir(pick(cardinal)) + B.setDir(pick(GLOB.cardinal)) /obj/effect/decal/cleanable/blood/gibs/bubblegum name = "thick blood" diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm index 8eed750804f..7f1b3942d94 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm @@ -103,7 +103,7 @@ Difficulty: Very Hard visible_message("\"You can't dodge.\"") ranged_cooldown = world.time + 30 telegraph() - dir_shots(alldirs) + dir_shots(GLOB.alldirs) move_to_delay = 3 return else @@ -127,13 +127,13 @@ Difficulty: Very Hard /mob/living/simple_animal/hostile/megafauna/colossus/proc/alternating_dir_shots() ranged_cooldown = world.time + 40 - dir_shots(diagonals) + dir_shots(GLOB.diagonals) SLEEP_CHECK_DEATH(10) - dir_shots(cardinal) + dir_shots(GLOB.cardinal) SLEEP_CHECK_DEATH(10) - dir_shots(diagonals) + dir_shots(GLOB.diagonals) SLEEP_CHECK_DEATH(10) - dir_shots(cardinal) + dir_shots(GLOB.cardinal) /mob/living/simple_animal/hostile/megafauna/colossus/proc/select_spiral_attack() telegraph() @@ -150,7 +150,7 @@ Difficulty: Very Hard INVOKE_ASYNC(src, .proc/spiral_shoot, TRUE) /mob/living/simple_animal/hostile/megafauna/colossus/proc/spiral_shoot(negative = pick(TRUE, FALSE), counter_start = 8) - var/turf/start_turf = get_step(src, pick(alldirs)) + var/turf/start_turf = get_step(src, pick(GLOB.alldirs)) var/counter = counter_start for(var/i in 1 to 80) if(negative) @@ -198,7 +198,7 @@ Difficulty: Very Hard /mob/living/simple_animal/hostile/megafauna/colossus/proc/dir_shots(list/dirs) if(!islist(dirs)) - dirs = alldirs.Copy() + dirs = GLOB.alldirs.Copy() playsound(src, 'sound/magic/clockwork/invoke_general.ogg', 200, TRUE, 2) for(var/d in dirs) var/turf/E = get_step(src, d) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm index e810222e1c4..e97b7671b67 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm @@ -366,7 +366,7 @@ Difficulty: Medium if(L && !QDELETED(L)) // Some mobs are deleted on death var/throw_dir = get_dir(src, L) if(L.loc == loc) - throw_dir = pick(alldirs) + throw_dir = pick(GLOB.alldirs) var/throwtarget = get_edge_target_turf(src, throw_dir) L.throw_at(throwtarget, 3) visible_message("[L] is thrown clear of [src]!") diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index 24ee584b378..716f5436223 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -179,18 +179,18 @@ Difficulty: Hard if((prob(anger_modifier) || target.Adjacent(src)) && target != src) var/obj/effect/temp_visual/hierophant/chaser/OC = new(loc, src, target, chaser_speed * 1.5, FALSE) OC.moving = 4 - OC.moving_dir = pick(cardinal - C.moving_dir) + OC.moving_dir = pick(GLOB.cardinal - C.moving_dir) else if(prob(10 + (anger_modifier * 0.5)) && get_dist(src, target) > 2) blink(target) else if(prob(70 - anger_modifier)) //a cross blast of some type if(prob(anger_modifier * (2 / target_slowness)) && health < maxHealth * 0.5) //we're super angry do it at all dirs - INVOKE_ASYNC(src, .proc/blasts, target, alldirs) + INVOKE_ASYNC(src, .proc/blasts, target, GLOB.alldirs) else if(prob(60)) - INVOKE_ASYNC(src, .proc/blasts, target, cardinal) + INVOKE_ASYNC(src, .proc/blasts, target, GLOB.cardinal) else - INVOKE_ASYNC(src, .proc/blasts, target, diagonals) + INVOKE_ASYNC(src, .proc/blasts, target, GLOB.diagonals) else //just release a burst of power INVOKE_ASYNC(src, .proc/burst, get_turf(src)) @@ -226,9 +226,9 @@ Difficulty: Hard while(!QDELETED(target) && cross_counter) cross_counter-- if(prob(60)) - INVOKE_ASYNC(src, .proc/blasts, target, cardinal) + INVOKE_ASYNC(src, .proc/blasts, target, GLOB.cardinal) else - INVOKE_ASYNC(src, .proc/blasts, target, diagonals) + INVOKE_ASYNC(src, .proc/blasts, target, GLOB.diagonals) SLEEP_CHECK_DEATH(6 + target_slowness) animate(src, color = oldcolor, time = 8) addtimer(CALLBACK(src, /atom/proc/update_atom_colour), 8) @@ -244,7 +244,7 @@ Difficulty: Hard animate(src, color = "#660099", time = 6) SLEEP_CHECK_DEATH(6) var/list/targets = ListTargets() - var/list/cardinal_copy = cardinal.Copy() + var/list/cardinal_copy = GLOB.cardinal.Copy() while(targets.len && cardinal_copy.len) var/mob/living/pickedtarget = pick(targets) if(targets.len >= cardinal_copy.len) @@ -263,13 +263,13 @@ Difficulty: Hard SLEEP_CHECK_DEATH(8) blinking = FALSE -/mob/living/simple_animal/hostile/megafauna/hierophant/proc/blasts(mob/victim, var/list/directions = cardinal) //fires cross blasts with a delay +/mob/living/simple_animal/hostile/megafauna/hierophant/proc/blasts(mob/victim, var/list/directions = GLOB.cardinal) //fires cross blasts with a delay var/turf/T = get_turf(victim) if(!T) return - if(directions == cardinal) + if(directions == GLOB.cardinal) new /obj/effect/temp_visual/hierophant/telegraph/cardinal(T, src) - else if(directions == diagonals) + else if(directions == GLOB.diagonals) new /obj/effect/temp_visual/hierophant/telegraph/diagonal(T, src) else new /obj/effect/temp_visual/hierophant/telegraph(T, src) @@ -295,7 +295,7 @@ Difficulty: Hard if((istype(get_area(T), /area/ruin/unpowered/hierophant) || istype(get_area(src), /area/ruin/unpowered/hierophant)) && victim != src) return arena_cooldown = world.time + initial(arena_cooldown) - for(var/d in cardinal) + for(var/d in GLOB.cardinal) INVOKE_ASYNC(src, .proc/arena_squares, T, d) for(var/t in RANGE_TURFS(11, T)) if(t && get_dist(t, T) == 11) @@ -565,7 +565,7 @@ Difficulty: Hard /obj/effect/temp_visual/hierophant/chaser/proc/get_target_dir() . = get_cardinal_dir(src, targetturf) if((. != previous_moving_dir && . == more_previouser_moving_dir) || . == 0) //we're alternating, recalculate - var/list/cardinal_copy = cardinal.Copy() + var/list/cardinal_copy = GLOB.cardinal.Copy() cardinal_copy -= more_previouser_moving_dir . = pick(cardinal_copy) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/swarmer.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/swarmer.dm index 696c692a5dc..2515da9dff9 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/swarmer.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/swarmer.dm @@ -66,7 +66,7 @@ GLOBAL_LIST_INIT(AISwarmerCapsByType, list(/mob/living/simple_animal/hostile/swa /mob/living/simple_animal/hostile/megafauna/swarmer_swarm_beacon/Initialize(mapload) . = ..() swarmer_caps = GLOB.AISwarmerCapsByType //for admin-edits - for(var/ddir in cardinal) + for(var/ddir in GLOB.cardinal) new /obj/structure/swarmer/blockade (get_step(src, ddir)) var/mob/living/simple_animal/hostile/swarmer/ai/resource/R = new(loc) step(R, ddir) //Step the swarmers, instead of spawning them there, incase the turf is solid diff --git a/code/modules/mob/living/simple_animal/hostile/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm index 53f384aee0c..848a285abf4 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm @@ -101,7 +101,7 @@ // due to `del_on_death` return ..() -var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/cable, /obj/structure/window) +GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/cable, /obj/structure/window)) /mob/living/simple_animal/hostile/mimic/copy health = 100 @@ -141,7 +141,7 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca faction |= "\ref[owner]" /mob/living/simple_animal/hostile/mimic/copy/proc/CheckObject(var/obj/O) - if((istype(O, /obj/item) || istype(O, /obj/structure)) && !is_type_in_list(O, protected_objects)) + if((istype(O, /obj/item) || istype(O, /obj/structure)) && !is_type_in_list(O, GLOB.protected_objects)) return 1 return 0 diff --git a/code/modules/mob/living/simple_animal/hostile/mining/goliath.dm b/code/modules/mob/living/simple_animal/hostile/mining/goliath.dm index 490e056e62f..288d45c9b1a 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining/goliath.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining/goliath.dm @@ -164,7 +164,7 @@ /obj/effect/temp_visual/goliath_tentacle/original/Initialize(mapload, new_spawner) . = ..() - var/list/directions = cardinal.Copy() + var/list/directions = GLOB.cardinal.Copy() for(var/i in 1 to 3) var/spawndir = pick_n_take(directions) var/turf/T = get_step(src, spawndir) diff --git a/code/modules/mob/living/simple_animal/hostile/mining/hivelord.dm b/code/modules/mob/living/simple_animal/hostile/mining/hivelord.dm index 3d7da9d0fcc..ca9b632e06a 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining/hivelord.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining/hivelord.dm @@ -327,9 +327,9 @@ /obj/effect/mob_spawn/human/corpse/damaged/legioninfested/dwarf/equip(mob/living/carbon/human/H) . = ..() - H.dna.SetSEState(SMALLSIZEBLOCK, 1, 1) + H.dna.SetSEState(GLOB.smallsizeblock, 1, 1) H.mutations.Add(DWARF) - genemutcheck(H, SMALLSIZEBLOCK, null, MUTCHK_FORCED) + genemutcheck(H, GLOB.smallsizeblock, null, MUTCHK_FORCED) H.update_mutations() /obj/effect/mob_spawn/human/corpse/damaged/legioninfested/Initialize(mapload) diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/actions.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/actions.dm index 637c1833a89..2b15e584922 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/actions.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/actions.dm @@ -58,7 +58,7 @@ if(feedings_left > 0) to_chat(user, "You must wrap [feedings_left] more humanoid prey before you can do this!") return - for(var/mob/living/simple_animal/hostile/poison/terror_spider/queen/Q in ts_spiderlist) + for(var/mob/living/simple_animal/hostile/poison/terror_spider/queen/Q in GLOB.ts_spiderlist) if(Q.spider_awaymission == user.spider_awaymission) to_chat(user, "The presence of another Queen in the area is preventing you from maturing.") return diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/empress.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/empress.dm index f6dffb79642..137d6739466 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/empress.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/empress.dm @@ -96,13 +96,13 @@ S.amount_grown = 250 /mob/living/simple_animal/hostile/poison/terror_spider/queen/empress/proc/EraseBrood() - for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in ts_spiderlist) + for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in GLOB.ts_spiderlist) if(T.spider_tier < spider_tier) T.degenerate = 1 to_chat(T, "Through the hivemind, the raw power of [src] floods into your body, burning it from the inside out!") - for(var/obj/structure/spider/eggcluster/terror_eggcluster/T in ts_egg_list) + for(var/obj/structure/spider/eggcluster/terror_eggcluster/T in GLOB.ts_egg_list) qdel(T) - for(var/obj/structure/spider/spiderling/terror_spiderling/T in ts_spiderling_list) + for(var/obj/structure/spider/spiderling/terror_spiderling/T in GLOB.ts_spiderling_list) qdel(T) to_chat(src, "All Terror Spiders, except yourself, will die off shortly.") diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/ghost.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/ghost.dm index 24e8012b5ee..daed363b8d9 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/ghost.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/ghost.dm @@ -14,7 +14,7 @@ var/error_on_humanize = "" var/humanize_prompt = "Take direct control of [src]?" humanize_prompt += " Role: [spider_role_summary]" - if(user.ckey in ts_ckey_blacklist) + if(user.ckey in GLOB.ts_ckey_blacklist) error_on_humanize = "You are not able to control any terror spider this round." else if(cannotPossess(user)) error_on_humanize = "You have enabled antag HUD and are unable to re-enter the round." diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/hive.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/hive.dm index aec7d9bb5ff..245ae95c5e9 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/hive.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/hive.dm @@ -4,7 +4,7 @@ /mob/living/simple_animal/hostile/poison/terror_spider/proc/DoHiveSense() var/hsline = "" to_chat(src, "Your Brood: ") - for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in ts_spiderlist) + for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in GLOB.ts_spiderlist) if(T.spider_awaymission != spider_awaymission) continue hsline = "* [T] in [get_area(T)], " @@ -20,21 +20,21 @@ /mob/living/simple_animal/hostile/poison/terror_spider/proc/CountSpiders() var/numspiders = 0 - for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in ts_spiderlist) + for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in GLOB.ts_spiderlist) if(T.stat != DEAD && !T.spider_placed && spider_awaymission == T.spider_awaymission) numspiders += 1 return numspiders /mob/living/simple_animal/hostile/poison/terror_spider/proc/CountSpidersType(specific_type) var/numspiders = 0 - for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in ts_spiderlist) + for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in GLOB.ts_spiderlist) if(T.stat != DEAD && !T.spider_placed && spider_awaymission == T.spider_awaymission) if(T.type == specific_type) numspiders += 1 - for(var/obj/structure/spider/eggcluster/terror_eggcluster/E in ts_egg_list) + for(var/obj/structure/spider/eggcluster/terror_eggcluster/E in GLOB.ts_egg_list) if(E.spiderling_type == specific_type && E.z == z) numspiders += E.spiderling_number - for(var/obj/structure/spider/spiderling/terror_spiderling/L in ts_spiderling_list) + for(var/obj/structure/spider/spiderling/terror_spiderling/L in GLOB.ts_spiderling_list) if(!L.stillborn && L.grow_as == specific_type && L.z == z) numspiders += 1 return numspiders diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen.dm index cd5322a58a1..241cceb3d2c 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen.dm @@ -88,7 +88,7 @@ if(spider_uo71) UnlockBlastDoors("UO71_Caves") // When a queen dies, so do her player-controlled purple-type guardians. Intended as a motivator for purples to ensure they guard her. - for(var/mob/living/simple_animal/hostile/poison/terror_spider/purple/P in ts_spiderlist) + for(var/mob/living/simple_animal/hostile/poison/terror_spider/purple/P in GLOB.ts_spiderlist) if(ckey) P.visible_message("\The [src] writhes in pain!") to_chat(P,"\The [src] has died. Without her hivemind link, purple terrors like yourself cannot survive more than a few minutes!") @@ -97,7 +97,7 @@ /mob/living/simple_animal/hostile/poison/terror_spider/queen/Retaliate() ..() - for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in ts_spiderlist) + for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in GLOB.ts_spiderlist) T.enemies |= enemies /mob/living/simple_animal/hostile/poison/terror_spider/queen/proc/ai_nest_is_full() diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/reproduction.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/reproduction.dm index 0cf8355e06e..a889bc6d328 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/reproduction.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/reproduction.dm @@ -23,12 +23,12 @@ /obj/structure/spider/spiderling/terror_spiderling/New() ..() - ts_spiderling_list += src + GLOB.ts_spiderling_list += src if(is_away_level(z)) spider_awaymission = TRUE /obj/structure/spider/spiderling/terror_spiderling/Destroy() - ts_spiderling_list -= src + GLOB.ts_spiderling_list -= src return ..() /obj/structure/spider/spiderling/terror_spiderling/Bump(obj/O) @@ -205,7 +205,7 @@ /obj/structure/spider/eggcluster/terror_eggcluster/New() ..() - ts_egg_list += src + GLOB.ts_egg_list += src spawn(50) if(spiderling_type == /mob/living/simple_animal/hostile/poison/terror_spider/red) name = "red terror eggs" @@ -227,7 +227,7 @@ name = "queen of terror eggs" /obj/structure/spider/eggcluster/terror_eggcluster/Destroy() - ts_egg_list -= src + GLOB.ts_egg_list -= src return ..() /obj/structure/spider/eggcluster/terror_eggcluster/process() diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_ai.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_ai.dm index 8d18471b1cb..11e4cac3e4a 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_ai.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_ai.dm @@ -103,8 +103,8 @@ return if(!target) var/my_ventcrawl_freq = freq_ventcrawl_idle - if(ts_count_dead > 0) - if(world.time < (ts_death_last + ts_death_window)) + if(GLOB.ts_count_dead > 0) + if(world.time < (GLOB.ts_death_last + GLOB.ts_death_window)) my_ventcrawl_freq = freq_ventcrawl_combat // First, check for general actions that any spider could take. if(path_to_vent) @@ -267,7 +267,7 @@ /mob/living/simple_animal/hostile/poison/terror_spider/proc/ClearObstacle(turf/target_turf) var/list/valid_obstacles = list(/obj/structure/window, /obj/structure/closet, /obj/structure/table, /obj/structure/grille, /obj/structure/rack, /obj/machinery/door/window) - for(var/dir in cardinal) // North, South, East, West + for(var/dir in GLOB.cardinal) // North, South, East, West var/obj/structure/obstacle = locate(/obj/structure, get_step(src, dir)) if(is_type_in_list(obstacle, valid_obstacles)) obstacle.attack_animal(src) diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_spiders.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_spiders.dm index d6d64096ff1..520143d71d0 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_spiders.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_spiders.dm @@ -1,12 +1,12 @@ -var/global/list/ts_ckey_blacklist = list() -var/global/ts_count_dead = 0 -var/global/ts_count_alive_awaymission = 0 -var/global/ts_count_alive_station = 0 -var/global/ts_death_last = 0 -var/global/ts_death_window = 9000 // 15 minutes -var/global/list/ts_spiderlist = list() -var/global/list/ts_egg_list = list() -var/global/list/ts_spiderling_list = list() +GLOBAL_LIST_EMPTY(ts_ckey_blacklist) +GLOBAL_VAR_INIT(ts_count_dead, 0) +GLOBAL_VAR_INIT(ts_count_alive_awaymission, 0) +GLOBAL_VAR_INIT(ts_count_alive_station, 0) +GLOBAL_VAR_INIT(ts_death_last, 0) +GLOBAL_VAR_INIT(ts_death_window, 9000) // 15 minutes +GLOBAL_LIST_EMPTY(ts_spiderlist) +GLOBAL_LIST_EMPTY(ts_egg_list) +GLOBAL_LIST_EMPTY(ts_spiderling_list) // -------------------------------------------------------------------------------- // --------------------- TERROR SPIDERS: DEFAULTS --------------------------------- @@ -245,7 +245,7 @@ var/global/list/ts_spiderling_list = list() /mob/living/simple_animal/hostile/poison/terror_spider/New() ..() - ts_spiderlist += src + GLOB.ts_spiderlist += src add_language("Spider Hivemind") if(spider_tier >= TS_TIER_2) add_language("Galactic Common") @@ -262,7 +262,7 @@ var/global/list/ts_spiderling_list = list() msg_terrorspiders("[src] has grown in [get_area(src)].") if(is_away_level(z)) spider_awaymission = 1 - ts_count_alive_awaymission++ + GLOB.ts_count_alive_awaymission++ if(spider_tier >= 3) ai_ventcrawls = FALSE // means that pre-spawned bosses on away maps won't ventcrawl. Necessary to keep prince/mother in one place. if(istype(get_area(src), /area/awaymission/UO71)) // if we are playing the away mission with our special spiders... @@ -272,11 +272,11 @@ var/global/list/ts_spiderling_list = list() ai_ventcrawls = FALSE spider_placed = 1 else - ts_count_alive_station++ + GLOB.ts_count_alive_station++ // after 3 seconds, assuming nobody took control of it yet, offer it to ghosts. addtimer(CALLBACK(src, .proc/CheckFaction), 20) addtimer(CALLBACK(src, .proc/announcetoghosts), 30) - var/datum/atom_hud/U = huds[DATA_HUD_MEDICAL_ADVANCED] + var/datum/atom_hud/U = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] U.add_hud_to(src) /mob/living/simple_animal/hostile/poison/terror_spider/proc/announcetoghosts() @@ -292,7 +292,7 @@ var/global/list/ts_spiderling_list = list() notify_ghosts("[src] has appeared in [get_area(src)].", enter_link = "(Click to control)", source = src, alert_overlay = alert_overlay, action = NOTIFY_ATTACK) /mob/living/simple_animal/hostile/poison/terror_spider/Destroy() - ts_spiderlist -= src + GLOB.ts_spiderlist -= src handle_dying() return ..() @@ -322,12 +322,12 @@ var/global/list/ts_spiderling_list = list() /mob/living/simple_animal/hostile/poison/terror_spider/proc/handle_dying() if(!hasdied) hasdied = 1 - ts_count_dead++ - ts_death_last = world.time + GLOB.ts_count_dead++ + GLOB.ts_death_last = world.time if(spider_awaymission) - ts_count_alive_awaymission-- + GLOB.ts_count_alive_awaymission-- else - ts_count_alive_station-- + GLOB.ts_count_alive_station-- /mob/living/simple_animal/hostile/poison/terror_spider/death(gibbed) if(can_die()) @@ -352,7 +352,7 @@ var/global/list/ts_spiderling_list = list() . = ..() /mob/living/simple_animal/hostile/poison/terror_spider/proc/msg_terrorspiders(msgtext) - for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in ts_spiderlist) + for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in GLOB.ts_spiderlist) if(T.stat != DEAD) to_chat(T, "TerrorSense: [msgtext]") diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index d159f8160c6..49c63b59ab5 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -357,7 +357,7 @@ //Wander around aimlessly. This will help keep the loops from searches down //and possibly move the mob into a new are in view of something they can use if(prob(90)) - step(src, pick(cardinal)) + step(src, pick(GLOB.cardinal)) return if(!held_item && !parrot_perch) //If we've got nothing to do.. look for something to do. diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 7665d20f932..b740c783ac7 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -184,7 +184,7 @@ turns_since_move++ if(turns_since_move >= turns_per_move) if(!(stop_automated_movement_when_pulled && pulledby)) //Soma animals don't move when pulled - var/anydir = pick(cardinal) + var/anydir = pick(GLOB.cardinal) if(Process_Spacemove(anydir)) Move(get_step(src,anydir), anydir) turns_since_move = 0 diff --git a/code/modules/mob/living/simple_animal/slime/life.dm b/code/modules/mob/living/simple_animal/slime/life.dm index deb9981645f..d03e7ada419 100644 --- a/code/modules/mob/living/simple_animal/slime/life.dm +++ b/code/modules/mob/living/simple_animal/slime/life.dm @@ -368,7 +368,7 @@ if (holding_still) holding_still = max(holding_still - hungry, 0) else if(canmove && isturf(loc) && prob(50)) - step(src, pick(cardinal)) + step(src, pick(GLOB.cardinal)) else if(holding_still) @@ -376,7 +376,7 @@ else if (docile && pulledby) holding_still = 10 else if(canmove && isturf(loc) && prob(33)) - step(src, pick(cardinal)) + step(src, pick(GLOB.cardinal)) else if(!AIproc) INVOKE_ASYNC(src, .proc/AIprocess) diff --git a/code/modules/mob/living/simple_animal/tribbles.dm b/code/modules/mob/living/simple_animal/tribbles.dm index b916fa801f0..d5f130324bb 100644 --- a/code/modules/mob/living/simple_animal/tribbles.dm +++ b/code/modules/mob/living/simple_animal/tribbles.dm @@ -1,4 +1,4 @@ -var/global/totaltribbles = 0 //global variable so it updates for all tribbles, not just the new one being made. +GLOBAL_VAR_INIT(totaltribbles, 0) //global variable so it updates for all tribbles, not just the new one being made. /mob/living/simple_animal/tribble @@ -35,7 +35,7 @@ var/global/totaltribbles = 0 //global variable so it updates for all tribbles, //random pixel offsets so they cover the floor src.pixel_x = rand(-5.0, 5) src.pixel_y = rand(-5.0, 5) - totaltribbles += 1 + GLOB.totaltribbles += 1 /mob/living/simple_animal/tribble/attack_hand(mob/user as mob) @@ -61,7 +61,7 @@ var/global/totaltribbles = 0 //global variable so it updates for all tribbles, /mob/living/simple_animal/tribble/proc/procreate() ..() - if(totaltribbles <= maxtribbles) + if(GLOB.totaltribbles <= maxtribbles) for(var/mob/living/simple_animal/tribble/F in src.loc) if(!F || F == src) new /mob/living/simple_animal/tribble(src.loc) @@ -84,7 +84,7 @@ var/global/totaltribbles = 0 //global variable so it updates for all tribbles, . = ..(gibbed) if(!.) return FALSE - totaltribbles -= 1 + GLOB.totaltribbles -= 1 //||Item version of the trible || diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index 2e5c6e66137..b2871038155 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -478,7 +478,7 @@ . = val_change ? STATUS_UPDATE_BLIND : STATUS_UPDATE_NONE disabilities &= ~BLIND if(val_change && updating) - CureIfHasDisability(BLINDBLOCK) + CureIfHasDisability(GLOB.blindblock) update_blind_effects() // Coughing @@ -488,7 +488,7 @@ /mob/living/proc/CureCoughing() disabilities &= ~COUGHING - CureIfHasDisability(COUGHBLOCK) + CureIfHasDisability(GLOB.coughblock) // Deaf @@ -497,7 +497,7 @@ /mob/living/proc/CureDeaf() disabilities &= ~DEAF - CureIfHasDisability(DEAFBLOCK) + CureIfHasDisability(GLOB.deafblock) // Epilepsy @@ -506,7 +506,7 @@ /mob/living/proc/CureEpilepsy() disabilities &= ~EPILEPSY - CureIfHasDisability(EPILEPSYBLOCK) + CureIfHasDisability(GLOB.epilepsyblock) // Mute @@ -515,7 +515,7 @@ /mob/living/proc/CureMute() disabilities &= ~MUTE - CureIfHasDisability(MUTEBLOCK) + CureIfHasDisability(GLOB.muteblock) // Nearsighted @@ -531,7 +531,7 @@ . = val_change ? STATUS_UPDATE_NEARSIGHTED : STATUS_UPDATE_NONE disabilities &= ~NEARSIGHTED if(val_change && updating) - CureIfHasDisability(GLASSESBLOCK) + CureIfHasDisability(GLOB.glassesblock) update_nearsighted_effects() // Nervous @@ -541,7 +541,7 @@ /mob/living/proc/CureNervous() disabilities &= ~NERVOUS - CureIfHasDisability(NERVOUSBLOCK) + CureIfHasDisability(GLOB.nervousblock) // Tourettes @@ -550,7 +550,7 @@ /mob/living/proc/CureTourettes() disabilities &= ~TOURETTES - CureIfHasDisability(TWITCHBLOCK) + CureIfHasDisability(GLOB.twitchblock) /mob/living/proc/CureIfHasDisability(block) if(dna && dna.GetSEState(block)) diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index ada7669a520..04dfa081be1 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -51,7 +51,7 @@ verbs += /client/proc/readmin //Clear ability list and update from mob. - client.verbs -= ability_verbs + client.verbs -= GLOB.ability_verbs if(abilities) client.verbs |= abilities diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index 1e019d16529..bbf477fa1a0 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -6,8 +6,8 @@ create_attack_log("Logged out at [atom_loc_line(get_turf(src))]") // `holder` is nil'd out by now, so we check the `admin_datums` array directly //Only report this stuff if we are currently playing. - if(admin_datums[ckey] && SSticker && SSticker.current_state == GAME_STATE_PLAYING) - var/datum/admins/temp_admin = admin_datums[ckey] + if(GLOB.admin_datums[ckey] && SSticker && SSticker.current_state == GAME_STATE_PLAYING) + var/datum/admins/temp_admin = GLOB.admin_datums[ckey] // Triggers on people with banhammer power only - no mentors tripping the alarm if(temp_admin.rights & R_BAN) message_admins("Admin logout: [key_name_admin(src)]") diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 65d2cb4788e..7d1edef93cf 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -261,7 +261,7 @@ //The list of slots by priority. equip_to_appropriate_slot() uses this list. Doesn't matter if a mob type doesn't have a slot. -var/list/slot_equipment_priority = list( \ +GLOBAL_LIST_INIT(slot_equipment_priority, list( \ slot_back,\ slot_wear_pda,\ slot_wear_id,\ @@ -279,14 +279,14 @@ var/list/slot_equipment_priority = list( \ slot_tie,\ slot_l_store,\ slot_r_store\ - ) + )) //puts the item "W" into an appropriate slot in a human's inventory //returns 0 if it cannot, 1 if successful /mob/proc/equip_to_appropriate_slot(obj/item/W) if(!istype(W)) return 0 - for(var/slot in slot_equipment_priority) + for(var/slot in GLOB.slot_equipment_priority) if(istype(W,/obj/item/storage/) && slot == slot_head) // Storage items should be put on the belt before the head continue if(equip_to_slot_if_possible(W, slot, 0, 1, 1)) //del_on_fail = 0; disable_warning = 0; redraw_mob = 1 @@ -297,7 +297,7 @@ var/list/slot_equipment_priority = list( \ /mob/proc/check_for_open_slot(obj/item/W) if(!istype(W)) return 0 var/openslot = 0 - for(var/slot in slot_equipment_priority) + for(var/slot in GLOB.slot_equipment_priority) if(W.mob_check_equip(src, slot, 1) == 1) openslot = 1 break @@ -741,7 +741,7 @@ var/list/slot_equipment_priority = list( \ set name = "Respawn" set category = "OOC" - if(!abandon_allowed) + if(!GLOB.abandon_allowed) to_chat(usr, "Respawning is disabled.") return @@ -1118,10 +1118,10 @@ var/list/slot_equipment_priority = list( \ /mob/proc/become_mouse() var/timedifference = world.time - client.time_died_as_mouse - if(client.time_died_as_mouse && timedifference <= mouse_respawn_time * 600) + if(client.time_died_as_mouse && timedifference <= GLOB.mouse_respawn_time * 600) var/timedifference_text - timedifference_text = time2text(mouse_respawn_time * 600 - timedifference,"mm:ss") - to_chat(src, "You may only spawn again as a mouse more than [mouse_respawn_time] minutes after your death. You have [timedifference_text] left.") + timedifference_text = time2text(GLOB.mouse_respawn_time * 600 - timedifference,"mm:ss") + to_chat(src, "You may only spawn again as a mouse more than [GLOB.mouse_respawn_time] minutes after your death. You have [timedifference_text] left.") return //find a viable mouse candidate diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index a894ad7cd07..1e0f31ac6fe 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -358,7 +358,7 @@ proc/muffledspeech(phrase) return 0 //converts intent-strings into numbers and back -var/list/intents = list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM) +GLOBAL_LIST_INIT(intents, list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM)) /proc/intent_numeric(argument) if(istext(argument)) switch(argument) @@ -539,7 +539,7 @@ var/list/intents = list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM) if(oldname) //update the datacore records! This is goig to be a bit costly. - for(var/list/L in list(data_core.general,data_core.medical,data_core.security,data_core.locked)) + for(var/list/L in list(GLOB.data_core.general, GLOB.data_core.medical, GLOB.data_core.security, GLOB.data_core.locked)) for(var/datum/data/record/R in L) if(R.fields["name"] == oldname) R.fields["name"] = newname diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 48f149fa096..8fb7568cefd 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -178,7 +178,7 @@ else if(mob.confused) var/newdir = 0 if(mob.confused > 40) - newdir = pick(alldirs) + newdir = pick(GLOB.alldirs) else if(prob(mob.confused * 1.5)) newdir = angle2dir(dir2angle(direct) + pick(90, -90)) else if(prob(mob.confused * 3)) diff --git a/code/modules/mob/new_player/login.dm b/code/modules/mob/new_player/login.dm index d8e6a239a9a..7a0462fd00f 100644 --- a/code/modules/mob/new_player/login.dm +++ b/code/modules/mob/new_player/login.dm @@ -1,15 +1,15 @@ /mob/new_player/Login() update_Login_details() //handles setting lastKnownIP and computer_id for use by the ban systems as well as checking for multikeying - if(join_motd) - to_chat(src, "
    [join_motd]
    ") + if(GLOB.join_motd) + to_chat(src, "
    [GLOB.join_motd]
    ") if(!mind) mind = new /datum/mind(key) mind.active = 1 mind.current = src - if(length(newplayer_start)) - loc = pick(newplayer_start) + if(length(GLOB.newplayer_start)) + loc = pick(GLOB.newplayer_start) else loc = locate(1,1,1) lastarea = loc @@ -29,11 +29,11 @@ spawn(30) // Annoy the player with polls. establish_db_connection() - if(dbcon.IsConnected() && client && client.can_vote()) + if(GLOB.dbcon.IsConnected() && client && client.can_vote()) var/isadmin = 0 if(client && client.holder) isadmin = 1 - var/DBQuery/query = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_question")] WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM [format_table_name("poll_vote")] WHERE ckey = \"[ckey]\") AND id NOT IN (SELECT pollid FROM [format_table_name("poll_textreply")] WHERE ckey = \"[ckey]\")") + var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_question")] WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM [format_table_name("poll_vote")] WHERE ckey = \"[ckey]\") AND id NOT IN (SELECT pollid FROM [format_table_name("poll_textreply")] WHERE ckey = \"[ckey]\")") query.Execute() var/newpoll = 0 while(query.NextRow()) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 6c9c04fded8..89e6ce953f5 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -27,11 +27,11 @@ return TRUE establish_db_connection() - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) tos_consent = TRUE return TRUE - var/DBQuery/query = dbcon.NewQuery("SELECT * FROM [format_table_name("privacy")] WHERE ckey='[src.ckey]' AND consent=1") + var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT * FROM [format_table_name("privacy")] WHERE ckey='[src.ckey]' AND consent=1") query.Execute() while(query.NextRow()) tos_consent = TRUE @@ -80,11 +80,11 @@ if(!IsGuestKey(src.key)) establish_db_connection() - if(dbcon.IsConnected() && client.can_vote()) + if(GLOB.dbcon.IsConnected() && client.can_vote()) var/isadmin = 0 if(src.client && src.client.holder) isadmin = 1 - var/DBQuery/query = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_question")] WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM [format_table_name("poll_vote")] WHERE ckey = \"[ckey]\") AND id NOT IN (SELECT pollid FROM [format_table_name("poll_textreply")] WHERE ckey = \"[ckey]\")") + var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_question")] WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM [format_table_name("poll_vote")] WHERE ckey = \"[ckey]\") AND id NOT IN (SELECT pollid FROM [format_table_name("poll_textreply")] WHERE ckey = \"[ckey]\")") query.Execute() var/newpoll = 0 while(query.NextRow()) @@ -111,13 +111,13 @@ stat("Game Mode:", "Secret") else if(SSticker.hide_mode == 0) - stat("Game Mode:", "[master_mode]") // Old setting for showing the game mode + stat("Game Mode:", "[GLOB.master_mode]") // Old setting for showing the game mode else stat("Game Mode: ", "Secret") - if((SSticker.current_state == GAME_STATE_PREGAME) && going) + if((SSticker.current_state == GAME_STATE_PREGAME) && SSticker.ticker_going) stat("Time To Start:", round(SSticker.pregame_timeleft/10)) - if((SSticker.current_state == GAME_STATE_PREGAME) && !going) + if((SSticker.current_state == GAME_STATE_PREGAME) && !SSticker.ticker_going) stat("Time To Start:", "DELAYED") if(SSticker.current_state == GAME_STATE_PREGAME) @@ -143,7 +143,7 @@ if(href_list["consent_signed"]) var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss") - var/DBQuery/query = dbcon.NewQuery("REPLACE INTO [format_table_name("privacy")] (ckey, datetime, consent) VALUES ('[ckey]', '[sqltime]', 1)") + var/DBQuery/query = GLOB.dbcon.NewQuery("REPLACE INTO [format_table_name("privacy")] (ckey, datetime, consent) VALUES ('[ckey]', '[sqltime]', 1)") query.Execute() src << browse(null, "window=privacy_consent") tos_consent = 1 @@ -152,7 +152,7 @@ tos_consent = 0 to_chat(usr, "You must consent to the terms of service before you can join!") var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss") - var/DBQuery/query = dbcon.NewQuery("REPLACE INTO [format_table_name("privacy")] (ckey, datetime, consent) VALUES ('[ckey]', '[sqltime]', 0)") + var/DBQuery/query = GLOB.dbcon.NewQuery("REPLACE INTO [format_table_name("privacy")] (ckey, datetime, consent) VALUES ('[ckey]', '[sqltime]', 0)") query.Execute() if(href_list["show_preferences"]) @@ -232,7 +232,7 @@ if(href_list["SelectedJob"]) - if(!enter_allowed) + if(!GLOB.enter_allowed) to_chat(usr, "There is an administrative lock on entering the game!") return @@ -304,7 +304,7 @@ if(!SSticker || SSticker.current_state != GAME_STATE_PLAYING) to_chat(usr, "The round is either not ready, or has already finished...") return 0 - if(!enter_allowed) + if(!GLOB.enter_allowed) to_chat(usr, "There is an administrative lock on entering the game!") return 0 if(!IsJobAvailable(rank)) @@ -338,25 +338,25 @@ if(IsAdminJob(rank)) if(IsERTSpawnJob(rank)) - character.loc = pick(ertdirector) + character.loc = pick(GLOB.ertdirector) else if(IsSyndicateCommand(rank)) - character.loc = pick(syndicateofficer) + character.loc = pick(GLOB.syndicateofficer) else - character.forceMove(pick(aroomwarp)) + character.forceMove(pick(GLOB.aroomwarp)) join_message = "has arrived" else if(spawning_at) - S = spawntypes[spawning_at] + S = GLOB.spawntypes[spawning_at] if(S && istype(S)) if(S.check_job_spawning(rank)) character.forceMove(pick(S.turfs)) join_message = S.msg else to_chat(character, "Your chosen spawnpoint ([S.display_name]) is unavailable for your chosen job. Spawning you at the Arrivals shuttle instead.") - character.forceMove(pick(latejoin)) + character.forceMove(pick(GLOB.latejoin)) join_message = "has arrived on the station" else - character.forceMove(pick(latejoin)) + character.forceMove(pick(GLOB.latejoin)) join_message = "has arrived on the station" character.lastarea = get_area(loc) @@ -375,7 +375,7 @@ else SSticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn if(!IsAdminJob(rank)) - data_core.manifest_inject(character) + GLOB.data_core.manifest_inject(character) AnnounceArrival(character, rank, join_message) AddEmploymentContract(character) @@ -412,11 +412,11 @@ if((character.mind.assigned_role != "Cyborg") && (character.mind.assigned_role != character.mind.special_role)) if(character.mind.role_alt_title) rank = character.mind.role_alt_title - global_announcer.autosay("[character.real_name],[rank ? " [rank]," : " visitor," ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer") + GLOB.global_announcer.autosay("[character.real_name],[rank ? " [rank]," : " visitor," ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer") /mob/new_player/proc/AddEmploymentContract(mob/living/carbon/human/employee) spawn(30) - for(var/C in employmentCabinets) + for(var/C in GLOB.employmentCabinets) var/obj/structure/filingcabinet/employment/employmentCabinet = C if(!employmentCabinet.virgin) employmentCabinet.addFile(employee) @@ -436,7 +436,7 @@ if(character.mind) if(character.mind.assigned_role != character.mind.special_role) // can't use their name here, since cyborg namepicking is done post-spawn, so we'll just say "A new Cyborg has arrived"/"A new Android has arrived"/etc. - global_announcer.autosay("A new[rank ? " [rank]" : " visitor" ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer") + GLOB.global_announcer.autosay("A new[rank ? " [rank]" : " visitor" ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer") /mob/new_player/proc/LateChoices() var/mills = ROUND_TIME // 1/10 of a second, not real milliseconds but whatever @@ -467,15 +467,15 @@ var/num_jobs_available = 0 var/list/activePlayers = list() var/list/categorizedJobs = list( - "Command" = list(jobs = list(), titles = command_positions, color = "#aac1ee"), - "Engineering" = list(jobs = list(), titles = engineering_positions, color = "#ffd699"), - "Security" = list(jobs = list(), titles = security_positions, color = "#ff9999"), + "Command" = list(jobs = list(), titles = GLOB.command_positions, color = "#aac1ee"), + "Engineering" = list(jobs = list(), titles = GLOB.engineering_positions, color = "#ffd699"), + "Security" = list(jobs = list(), titles = GLOB.security_positions, color = "#ff9999"), "Miscellaneous" = list(jobs = list(), titles = list(), color = "#ffffff", colBreak = 1), - "Synthetic" = list(jobs = list(), titles = nonhuman_positions, color = "#ccffcc"), - "Support / Service" = list(jobs = list(), titles = service_positions, color = "#cccccc"), - "Medical" = list(jobs = list(), titles = medical_positions, color = "#99ffe6", colBreak = 1), - "Science" = list(jobs = list(), titles = science_positions, color = "#e6b3e6"), - "Supply" = list(jobs = list(), titles = supply_positions, color = "#ead4ae"), + "Synthetic" = list(jobs = list(), titles = GLOB.nonhuman_positions, color = "#ccffcc"), + "Support / Service" = list(jobs = list(), titles = GLOB.service_positions, color = "#cccccc"), + "Medical" = list(jobs = list(), titles = GLOB.medical_positions, color = "#99ffe6", colBreak = 1), + "Science" = list(jobs = list(), titles = GLOB.science_positions, color = "#e6b3e6"), + "Supply" = list(jobs = list(), titles = GLOB.supply_positions, color = "#ead4ae"), ) for(var/datum/job/job in SSjobs.occupations) if(job && IsJobAvailable(job.title) && !job.barred_by_disability(client)) @@ -495,7 +495,7 @@ else jobs += job else // Put heads at top of non-command jobs - if(job.title in command_positions) + if(job.title in GLOB.command_positions) jobs.Insert(1, job) else jobs += job @@ -584,7 +584,7 @@ /mob/new_player/proc/ViewManifest() var/dat = "" dat += "

    Crew Manifest

    " - dat += data_core.get_manifest(OOC = 1) + dat += GLOB.data_core.get_manifest(OOC = 1) src << browse(dat, "window=manifest;size=370x420;can_close=1") diff --git a/code/modules/mob/new_player/poll.dm b/code/modules/mob/new_player/poll.dm index ad73451b645..8a9b71426b8 100644 --- a/code/modules/mob/new_player/poll.dm +++ b/code/modules/mob/new_player/poll.dm @@ -12,12 +12,12 @@ /client/proc/handle_player_polling() establish_db_connection() - if(dbcon.IsConnected()) + if(GLOB.dbcon.IsConnected()) var/isadmin = 0 if(holder) isadmin = 1 - var/DBQuery/select_query = dbcon.NewQuery("SELECT id, question, (id IN (SELECT pollid FROM [format_table_name("poll_vote")] WHERE ckey = '[ckey]') OR id IN (SELECT pollid FROM [format_table_name("poll_textreply")] WHERE ckey = '[ckey]')) AS voted FROM [format_table_name("poll_question")] WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime") + var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT id, question, (id IN (SELECT pollid FROM [format_table_name("poll_vote")] WHERE ckey = '[ckey]') OR id IN (SELECT pollid FROM [format_table_name("poll_textreply")] WHERE ckey = '[ckey]')) AS voted FROM [format_table_name("poll_question")] WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime") select_query.Execute() var/output = "
    Player polls" @@ -29,7 +29,7 @@ var/color1 = "#ececec" var/color2 = "#e2e2e2" var/i = 0 - + output += "
    " while(select_query.NextRow()) var/pollid = select_query.item[1] @@ -39,14 +39,14 @@ if(can_vote() && !voted) output += "" i++ - - // Show expired polls. Non admins can view admin polls at this stage + + // Show expired polls. Non admins can view admin polls at this stage // (just like tgstation's web interface so don't complain) // (Also why was there no ingame interface tg not having an ingame // interface is retarded because it cucks downstreams) - select_query = dbcon.NewQuery("SELECT id, question FROM [format_table_name("poll_question")] WHERE Now() > endtime ORDER BY id DESC") + select_query = GLOB.dbcon.NewQuery("SELECT id, question FROM [format_table_name("poll_question")] WHERE Now() > endtime ORDER BY id DESC") select_query.Execute() - + output += "" while(select_query.NextRow()) var/pollid = select_query.item[1] @@ -61,9 +61,9 @@ if(pollid == -1) return establish_db_connection() - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) return - var/DBQuery/select_query = dbcon.NewQuery("SELECT polltype, question, adminonly, multiplechoiceoptions, starttime, endtime FROM [format_table_name("poll_question")] WHERE id = [pollid] AND endtime < Now()") + var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT polltype, question, adminonly, multiplechoiceoptions, starttime, endtime FROM [format_table_name("poll_question")] WHERE id = [pollid] AND endtime < Now()") select_query.Execute() var/question = "" var/polltype = "" @@ -84,15 +84,15 @@ if(!found) to_chat(src, "Poll question details not found. (Maybe the poll isn't expired yet?)") return - + if(polltype == POLLTYPE_MULTI) question += " (Choose up to [multiplechoiceoptions] options)" if(adminonly) question = "(Admin only poll) " + question - + var output = "" if(polltype == POLLTYPE_MULTI || polltype == POLLTYPE_OPTION) - select_query = dbcon.NewQuery("SELECT text, percentagecalc, (SELECT COUNT(optionid) FROM [format_table_name("poll_vote")] WHERE optionid = poll_option.id GROUP BY optionid) AS votecount FROM [format_table_name("poll_option")] WHERE pollid = [pollid]"); + select_query = GLOB.dbcon.NewQuery("SELECT text, percentagecalc, (SELECT COUNT(optionid) FROM [format_table_name("poll_vote")] WHERE optionid = poll_option.id GROUP BY optionid) AS votecount FROM [format_table_name("poll_option")] WHERE pollid = [pollid]"); select_query.Execute() var/list/options = list() var/total_votes = 1 @@ -140,7 +140,7 @@ "} - select_query = dbcon.NewQuery("SELECT id, text, (SELECT AVG(rating) FROM [format_table_name("poll_vote")] WHERE optionid = poll_option.id AND rating != 'abstain') AS avgrating, (SELECT COUNT(rating) FROM [format_table_name("poll_vote")] WHERE optionid = poll_option.id AND rating != 'abstain') AS countvotes, minval, maxval FROM [format_table_name("poll_option")] WHERE pollid = [pollid]") + select_query = GLOB.dbcon.NewQuery("SELECT id, text, (SELECT AVG(rating) FROM [format_table_name("poll_vote")] WHERE optionid = poll_option.id AND rating != 'abstain') AS avgrating, (SELECT COUNT(rating) FROM [format_table_name("poll_vote")] WHERE optionid = poll_option.id AND rating != 'abstain') AS countvotes, minval, maxval FROM [format_table_name("poll_option")] WHERE pollid = [pollid]") select_query.Execute() while(select_query.NextRow()) output += {" @@ -156,7 +156,7 @@ var/maxvote = 1 var/list/votecounts = list() for(var/I in minval to maxval) - var/DBQuery/rating_query = dbcon.NewQuery("SELECT COUNT(rating) AS countrating FROM [format_table_name("poll_vote")] WHERE optionid = [optionid] AND rating = [I] GROUP BY rating") + var/DBQuery/rating_query = GLOB.dbcon.NewQuery("SELECT COUNT(rating) AS countrating FROM [format_table_name("poll_vote")] WHERE optionid = [optionid] AND rating = [I] GROUP BY rating") rating_query.Execute() var/votecount = 0 while(rating_query.NextRow()) @@ -177,7 +177,7 @@ output += "
    ISBNTitleTotal FlagsOptions
    Active Polls
    [poll_player(pollid, 1)]
    Expired Polls
    [question]
    [starttime] - [endtime]
    " output += "" if(polltype == POLLTYPE_TEXT) - select_query = dbcon.NewQuery("SELECT replytext, COUNT(replytext) AS countresponse, GROUP_CONCAT(DISTINCT ckey SEPARATOR ', ') as ckeys FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] GROUP BY replytext ORDER BY countresponse DESC"); + select_query = GLOB.dbcon.NewQuery("SELECT replytext, COUNT(replytext) AS countresponse, GROUP_CONCAT(DISTINCT ckey SEPARATOR ', ') as ckeys FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] GROUP BY replytext ORDER BY countresponse DESC"); select_query.Execute() output += {" @@ -195,15 +195,15 @@ "} output += "
    " output += "" - + src << browse(output,"window=pollresults;size=950x500") /client/proc/poll_player(var/pollid = -1, var/inline = 0) if(pollid == -1) return establish_db_connection() - if(dbcon.IsConnected()) + if(GLOB.dbcon.IsConnected()) - var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime [holder ? "AND adminonly = 0" : ""]") + var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime [holder ? "AND adminonly = 0" : ""]") select_query.Execute() var/pollstarttime = "" @@ -229,7 +229,7 @@ switch(polltype) //Polls that have enumerated options if(POLLTYPE_OPTION) - var/DBQuery/voted_query = dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'") + var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'") voted_query.Execute() var/voted = 0 // If the can't vote then consider them voted @@ -241,21 +241,21 @@ var/list/datum/polloption/options = list() - var/DBQuery/options_query = dbcon.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]") + var/DBQuery/options_query = GLOB.dbcon.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]") options_query.Execute() while(options_query.NextRow()) var/datum/polloption/PO = new() PO.optionid = text2num(options_query.item[1]) PO.optiontext = options_query.item[2] options += PO - + var/output if(!inline) output += "
    Player poll" output +="
    " output += "Question: [pollquestion]
    " output += "Poll runs from [pollstarttime] until [pollendtime]

    " - + if(canvote && !voted) //Only make this a form if we have not voted yet output += "" output += "" @@ -278,7 +278,7 @@ output += "" output += "

    " - + if(inline) return output else @@ -286,7 +286,7 @@ //Polls with a text input if(POLLTYPE_TEXT) - var/DBQuery/voted_query = dbcon.NewQuery("SELECT replytext FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] AND ckey = '[ckey]'") + var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT replytext FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] AND ckey = '[ckey]'") voted_query.Execute() var/voted = 0 @@ -296,7 +296,7 @@ voted = 1 break - + var/output if(!inline) output += "
    Player poll" @@ -323,7 +323,7 @@ output += "" else output += "[vote_text]" - + if(inline) return output else @@ -331,9 +331,9 @@ //Polls with a text input if(POLLTYPE_RATING) - var/DBQuery/voted_query = dbcon.NewQuery("SELECT o.text, v.rating FROM [format_table_name("poll_option")] o, erro_poll_vote v WHERE o.pollid = [pollid] AND v.ckey = '[ckey]' AND o.id = v.optionid") + var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT o.text, v.rating FROM [format_table_name("poll_option")] o, erro_poll_vote v WHERE o.pollid = [pollid] AND v.ckey = '[ckey]' AND o.id = v.optionid") voted_query.Execute() - + var/output if(!inline) output += "
    Player poll" @@ -358,7 +358,7 @@ var/minid = 999999 var/maxid = 0 - var/DBQuery/option_query = dbcon.NewQuery("SELECT id, text, minval, maxval, descmin, descmid, descmax FROM [format_table_name("poll_option")] WHERE pollid = [pollid]") + var/DBQuery/option_query = GLOB.dbcon.NewQuery("SELECT id, text, minval, maxval, descmin, descmid, descmax FROM [format_table_name("poll_option")] WHERE pollid = [pollid]") option_query.Execute() while(option_query.NextRow()) var/optionid = text2num(option_query.item[1]) @@ -404,7 +404,7 @@ else src << browse(output,"window=playerpoll;size=500x500") if(POLLTYPE_MULTI) - var/DBQuery/voted_query = dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'") + var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'") voted_query.Execute() var/list/votedfor = list() @@ -417,7 +417,7 @@ var/maxoptionid = 0 var/minoptionid = 0 - var/DBQuery/options_query = dbcon.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]") + var/DBQuery/options_query = GLOB.dbcon.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]") options_query.Execute() while(options_query.NextRow()) var/datum/polloption/PO = new() @@ -478,9 +478,9 @@ if(!isnum(pollid) || !isnum(optionid)) return establish_db_connection() - if(dbcon.IsConnected()) + if(GLOB.dbcon.IsConnected()) - var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime [holder ? "AND adminonly = 0" : ""]") + var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime [holder ? "AND adminonly = 0" : ""]") select_query.Execute() var/validpoll = 0 @@ -498,7 +498,7 @@ to_chat(usr, "Poll is not valid.") return - var/DBQuery/select_query2 = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_option")] WHERE id = [optionid] AND pollid = [pollid]") + var/DBQuery/select_query2 = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_option")] WHERE id = [optionid] AND pollid = [pollid]") select_query2.Execute() var/validoption = 0 @@ -513,7 +513,7 @@ var/alreadyvoted = 0 - var/DBQuery/voted_query = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'") + var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'") voted_query.Execute() while(voted_query.NextRow()) @@ -534,7 +534,7 @@ adminrank = usr.client.holder.rank - var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank) VALUES (null, Now(), [pollid], [optionid], '[ckey]', '[usr.client.address]', '[adminrank]')") + var/DBQuery/insert_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank) VALUES (null, Now(), [pollid], [optionid], '[ckey]', '[usr.client.address]', '[adminrank]')") insert_query.Execute() to_chat(usr, "Vote successful.") @@ -548,9 +548,9 @@ if(!isnum(pollid) || !istext(replytext)) return establish_db_connection() - if(dbcon.IsConnected()) + if(GLOB.dbcon.IsConnected()) - var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime [holder ? "AND adminonly = 0" : ""]") + var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime [holder ? "AND adminonly = 0" : ""]") select_query.Execute() var/validpoll = 0 @@ -567,7 +567,7 @@ var/alreadyvoted = 0 - var/DBQuery/voted_query = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] AND ckey = '[ckey]'") + var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] AND ckey = '[ckey]'") voted_query.Execute() while(voted_query.NextRow()) @@ -592,7 +592,7 @@ to_chat(usr, "The text you entered was blank, contained illegal characters or was too long. Please correct the text and submit again.") return - var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO [format_table_name("poll_textreply")] (id ,datetime ,pollid ,ckey ,ip ,replytext ,adminrank) VALUES (null, Now(), [pollid], '[ckey]', '[usr.client.address]', '[replytext]', '[adminrank]')") + var/DBQuery/insert_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("poll_textreply")] (id ,datetime ,pollid ,ckey ,ip ,replytext ,adminrank) VALUES (null, Now(), [pollid], '[ckey]', '[usr.client.address]', '[replytext]', '[adminrank]')") insert_query.Execute() to_chat(usr, "Feedback logging successful.") @@ -606,9 +606,9 @@ if(!isnum(pollid) || !isnum(optionid)) return establish_db_connection() - if(dbcon.IsConnected()) + if(GLOB.dbcon.IsConnected()) - var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime [holder ? "AND adminonly = 0" : ""]") + var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime [holder ? "AND adminonly = 0" : ""]") select_query.Execute() var/validpoll = 0 @@ -623,7 +623,7 @@ to_chat(usr, "Poll is not valid.") return - var/DBQuery/select_query2 = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_option")] WHERE id = [optionid] AND pollid = [pollid]") + var/DBQuery/select_query2 = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_option")] WHERE id = [optionid] AND pollid = [pollid]") select_query2.Execute() var/validoption = 0 @@ -638,7 +638,7 @@ var/alreadyvoted = 0 - var/DBQuery/voted_query = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_vote")] WHERE optionid = [optionid] AND ckey = '[ckey]'") + var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_vote")] WHERE optionid = [optionid] AND ckey = '[ckey]'") voted_query.Execute() while(voted_query.NextRow()) @@ -654,7 +654,7 @@ adminrank = usr.client.holder.rank - var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank, rating) VALUES (null, Now(), [pollid], [optionid], '[ckey]', '[usr.client.address]', '[adminrank]', [(isnull(rating)) ? "null" : rating])") + var/DBQuery/insert_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank, rating) VALUES (null, Now(), [pollid], [optionid], '[ckey]', '[usr.client.address]', '[adminrank]', [(isnull(rating)) ? "null" : rating])") insert_query.Execute() to_chat(usr, "Vote successful.") diff --git a/code/modules/mob/new_player/preferences_setup.dm b/code/modules/mob/new_player/preferences_setup.dm index 3489e56be54..8324ef87212 100644 --- a/code/modules/mob/new_player/preferences_setup.dm +++ b/code/modules/mob/new_player/preferences_setup.dm @@ -9,7 +9,7 @@ if(S.bodyflags & ALL_RPARTS) var/head_model = "[!rlimb_data["head"] ? "Morpheus Cyberkinetics" : rlimb_data["head"]]" - robohead = all_robolimbs[head_model] + robohead = GLOB.all_robolimbs[head_model] if(gender_override) gender = gender_override else @@ -17,7 +17,7 @@ underwear = random_underwear(gender, species) undershirt = random_undershirt(gender, species) socks = random_socks(gender, species) - if(body_accessory_by_species[species]) + if(GLOB.body_accessory_by_species[species]) body_accessory = random_body_accessory(species) if(body_accessory == "None") //Required to prevent a bug where the information/icons in the character preferences screen wouldn't update despite the data being changed. body_accessory = null @@ -253,8 +253,8 @@ if(organ_data[name] == "amputated") continue if(organ_data[name] == "cyborg") var/datum/robolimb/R - if(rlimb_data[name]) R = all_robolimbs[rlimb_data[name]] - if(!R) R = basic_robolimb + if(rlimb_data[name]) R = GLOB.all_robolimbs[rlimb_data[name]] + if(!R) R = GLOB.basic_robolimb if(name == "chest") name = "torso" preview_icon.Blend(icon(R.icon, "[name]"), ICON_OVERLAY) // This doesn't check gendered_icon. Not an issue while only limbs can be robotic. @@ -281,7 +281,7 @@ var/blend_mode = ICON_ADD if(body_accessory) - var/datum/body_accessory/accessory = body_accessory_by_name[body_accessory] + var/datum/body_accessory/accessory = GLOB.body_accessory_by_name[body_accessory] tail_icon = accessory.icon tail_icon_state = accessory.icon_state if(accessory.blend_mode) diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index e218ce3c25d..3b3f34fdb13 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -131,7 +131,7 @@ if(length(message) >= 2) var/channel_prefix = copytext(message, 1 ,3) - return department_radio_keys[channel_prefix] + return GLOB.department_radio_keys[channel_prefix] return null diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index fe19d366550..2ee4a9d2a9c 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -1,7 +1,7 @@ /mob/living/carbon/human/proc/monkeyize() var/mob/H = src - H.dna.SetSEState(MONKEYBLOCK,1) - genemutcheck(H,MONKEYBLOCK,null,MUTCHK_FORCED) + H.dna.SetSEState(GLOB.monkeyblock,1) + genemutcheck(H,GLOB.monkeyblock,null,MUTCHK_FORCED) /mob/new_player/AIize() spawning = 1 diff --git a/code/modules/mob/typing_indicator.dm b/code/modules/mob/typing_indicator.dm index 1dd4c9f8ccb..7b13ab68229 100644 --- a/code/modules/mob/typing_indicator.dm +++ b/code/modules/mob/typing_indicator.dm @@ -5,31 +5,31 @@ mob/var/typing mob/var/last_typed mob/var/last_typed_time -var/global/image/typing_indicator +GLOBAL_DATUM(typing_indicator, /image) /mob/proc/set_typing_indicator(var/state) - if(!typing_indicator) - typing_indicator = image('icons/mob/talk.dmi', null, "typing", MOB_LAYER + 1) - typing_indicator.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA + if(!GLOB.typing_indicator) + GLOB.typing_indicator = image('icons/mob/talk.dmi', null, "typing", MOB_LAYER + 1) + GLOB.typing_indicator.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA if(ishuman(src)) var/mob/living/carbon/human/H = src if(H.disabilities & MUTE || H.silent) - overlays -= typing_indicator + overlays -= GLOB.typing_indicator return if(client) if((client.prefs.toggles & SHOW_TYPING) || stat != CONSCIOUS || is_muzzled()) - overlays -= typing_indicator + overlays -= GLOB.typing_indicator else if(state) if(!typing) - overlays += typing_indicator + overlays += GLOB.typing_indicator typing = 1 else if(typing) - overlays -= typing_indicator + overlays -= GLOB.typing_indicator typing = 0 return state @@ -49,7 +49,7 @@ var/global/image/typing_indicator set name = ".Me" set hidden = 1 - + set_typing_indicator(1) hud_typing = 1 var/message = typing_input(src, "", "me (text)") diff --git a/code/modules/modular_computers/NTNet/NTNRC/conversation.dm b/code/modules/modular_computers/NTNet/NTNRC/conversation.dm index 33a94cc31a5..948824fa32e 100644 --- a/code/modules/modular_computers/NTNet/NTNRC/conversation.dm +++ b/code/modules/modular_computers/NTNet/NTNRC/conversation.dm @@ -1,4 +1,4 @@ -var/global/static/ntnrc_uid = 0 +GLOBAL_VAR_INIT(ntnrc_uid, 0) /datum/ntnet_conversation var/id = null @@ -9,15 +9,15 @@ var/global/static/ntnrc_uid = 0 var/password /datum/ntnet_conversation/New() - id = ntnrc_uid - ntnrc_uid++ - if(ntnet_global) - ntnet_global.chat_channels.Add(src) + id = GLOB.ntnrc_uid + GLOB.ntnrc_uid++ + if(GLOB.ntnet_global) + GLOB.ntnet_global.chat_channels.Add(src) ..() /datum/ntnet_conversation/Destroy() - if(ntnet_global) - ntnet_global.chat_channels.Remove(src) + if(GLOB.ntnet_global) + GLOB.ntnet_global.chat_channels.Remove(src) return ..() /datum/ntnet_conversation/proc/add_message(message, username) diff --git a/code/modules/modular_computers/NTNet/NTNet.dm b/code/modules/modular_computers/NTNet/NTNet.dm index 000131d6c03..2f9aa3f2e7d 100644 --- a/code/modules/modular_computers/NTNet/NTNet.dm +++ b/code/modules/modular_computers/NTNet/NTNet.dm @@ -1,4 +1,4 @@ -var/global/datum/ntnet/ntnet_global = new() +GLOBAL_DATUM_INIT(ntnet_global, /datum/ntnet, new()) // This is the NTNet datum. There can be only one NTNet datum in game at once. Modular computers read data from this. @@ -26,8 +26,8 @@ var/global/datum/ntnet/ntnet_global = new() // If new NTNet datum is spawned, it replaces the old one. /datum/ntnet/New() - if(ntnet_global && (ntnet_global != src)) - ntnet_global = src // There can be only one. + if(GLOB.ntnet_global && (GLOB.ntnet_global != src)) + GLOB.ntnet_global = src // There can be only one. for(var/obj/machinery/ntnet_relay/R in GLOB.machines) relays.Add(R) R.NTNet = src diff --git a/code/modules/modular_computers/NTNet/NTNet_relay.dm b/code/modules/modular_computers/NTNet/NTNet_relay.dm index 436070470ea..c0cc534ea0b 100644 --- a/code/modules/modular_computers/NTNet/NTNet_relay.dm +++ b/code/modules/modular_computers/NTNet/NTNet_relay.dm @@ -51,12 +51,12 @@ if((dos_overload > dos_capacity) && !dos_failure) dos_failure = 1 update_icon() - ntnet_global.add_log("Quantum relay switched from normal operation mode to overload recovery mode.") + GLOB.ntnet_global.add_log("Quantum relay switched from normal operation mode to overload recovery mode.") // If the DoS buffer reaches 0 again, restart. if((dos_overload == 0) && dos_failure) dos_failure = 0 update_icon() - ntnet_global.add_log("Quantum relay switched from overload recovery mode to normal operation mode.") + GLOB.ntnet_global.add_log("Quantum relay switched from overload recovery mode to normal operation mode.") ..() /obj/machinery/ntnet_relay/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) @@ -82,10 +82,10 @@ dos_overload = 0 dos_failure = 0 update_icon() - ntnet_global.add_log("Quantum relay manually restarted from overload recovery mode to normal operation mode.") + GLOB.ntnet_global.add_log("Quantum relay manually restarted from overload recovery mode to normal operation mode.") if("toggle") enabled = !enabled - ntnet_global.add_log("Quantum relay manually [enabled ? "enabled" : "disabled"].") + GLOB.ntnet_global.add_log("Quantum relay manually [enabled ? "enabled" : "disabled"].") update_icon() return 1 @@ -101,16 +101,16 @@ component_parts += new /obj/item/stack/cable_coil(null, 2) component_parts += new /obj/item/stock_parts/subspace/filter(null) - if(ntnet_global) - ntnet_global.relays.Add(src) - NTNet = ntnet_global - ntnet_global.add_log("New quantum relay activated. Current amount of linked relays: [NTNet.relays.len]") + if(GLOB.ntnet_global) + GLOB.ntnet_global.relays.Add(src) + NTNet = GLOB.ntnet_global + GLOB.ntnet_global.add_log("New quantum relay activated. Current amount of linked relays: [NTNet.relays.len]") ..() /obj/machinery/ntnet_relay/Destroy() - if(ntnet_global) - ntnet_global.relays.Remove(src) - ntnet_global.add_log("Quantum relay connection severed. Current amount of linked relays: [NTNet.relays.len]") + if(GLOB.ntnet_global) + GLOB.ntnet_global.relays.Remove(src) + GLOB.ntnet_global.add_log("Quantum relay connection severed. Current amount of linked relays: [NTNet.relays.len]") NTNet = null for(var/datum/computer_file/program/ntnet_dos/D in dos_sources) diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm index 1e43884df9a..1dd45a33603 100644 --- a/code/modules/modular_computers/computers/item/computer.dm +++ b/code/modules/modular_computers/computers/item/computer.dm @@ -289,7 +289,7 @@ if(!get_ntnet_status()) return FALSE var/obj/item/computer_hardware/network_card/network_card = all_components[MC_NET] - return ntnet_global.add_log(text, network_card) + return GLOB.ntnet_global.add_log(text, network_card) /obj/item/modular_computer/proc/shutdown_computer(loud = 1) if(enabled) diff --git a/code/modules/modular_computers/computers/machinery/modular_computer.dm b/code/modules/modular_computers/computers/machinery/modular_computer.dm index 61e26ed9899..391396a7d75 100644 --- a/code/modules/modular_computers/computers/machinery/modular_computer.dm +++ b/code/modules/modular_computers/computers/machinery/modular_computer.dm @@ -1,5 +1,5 @@ // Global var to track modular computers -var/list/global_modular_computers = list() +GLOBAL_LIST_EMPTY(global_modular_computers) // Modular Computer - device that runs various programs and operates with hardware // DO NOT SPAWN THIS TYPE. Use /laptop/ or /console/ instead. @@ -34,7 +34,7 @@ var/list/global_modular_computers = list() ..() cpu = new(src) cpu.physical = src - global_modular_computers.Add(src) + GLOB.global_modular_computers.Add(src) /obj/machinery/modular_computer/Destroy() QDEL_NULL(cpu) diff --git a/code/modules/modular_computers/file_system/computer_file.dm b/code/modules/modular_computers/file_system/computer_file.dm index a93aaf2412e..b3f8064b72a 100644 --- a/code/modules/modular_computers/file_system/computer_file.dm +++ b/code/modules/modular_computers/file_system/computer_file.dm @@ -1,4 +1,4 @@ -var/global/file_uid = 0 +GLOBAL_VAR_INIT(file_uid, 0) /datum/computer_file var/filename = "NewFile" // Placeholder. No spacebars @@ -12,8 +12,8 @@ var/global/file_uid = 0 /datum/computer_file/New() ..() - uid = file_uid - file_uid++ + uid = GLOB.file_uid + GLOB.file_uid++ /datum/computer_file/Destroy() if(!holder) diff --git a/code/modules/modular_computers/file_system/programs/antagonist/dos.dm b/code/modules/modular_computers/file_system/programs/antagonist/dos.dm index 22b0fa1a511..f6bc293db7d 100644 --- a/code/modules/modular_computers/file_system/programs/antagonist/dos.dm +++ b/code/modules/modular_computers/file_system/programs/antagonist/dos.dm @@ -51,7 +51,7 @@ return 1 switch(href_list["action"]) if("PRG_target_relay") - for(var/obj/machinery/ntnet_relay/R in ntnet_global.relays) + for(var/obj/machinery/ntnet_relay/R in GLOB.ntnet_global.relays) if("[R.uid]" == href_list["targid"]) target = R return 1 @@ -66,14 +66,14 @@ if(target) executed = 1 target.dos_sources.Add(src) - if(ntnet_global.intrusion_detection_enabled) + if(GLOB.ntnet_global.intrusion_detection_enabled) var/obj/item/computer_hardware/network_card/network_card = computer.all_components[MC_NET] - ntnet_global.add_log("IDS WARNING - Excess traffic flood targeting relay [target.uid] detected from device: [network_card.get_network_tag()]") - ntnet_global.intrusion_detection_alarm = 1 + GLOB.ntnet_global.add_log("IDS WARNING - Excess traffic flood targeting relay [target.uid] detected from device: [network_card.get_network_tag()]") + GLOB.ntnet_global.intrusion_detection_alarm = 1 return 1 /datum/computer_file/program/ntnet_dos/ui_data(mob/user) - if(!ntnet_global) + if(!GLOB.ntnet_global) return var/list/data = get_header_data() @@ -96,7 +96,7 @@ data["dos_strings"] += list(list("nums" = string)) else data["relays"] = list() - for(var/obj/machinery/ntnet_relay/R in ntnet_global.relays) + for(var/obj/machinery/ntnet_relay/R in GLOB.ntnet_global.relays) data["relays"] += list(list("id" = R.uid)) data["focus"] = target ? target.uid : null diff --git a/code/modules/modular_computers/file_system/programs/command/card.dm b/code/modules/modular_computers/file_system/programs/command/card.dm index f211ee6fd49..9067a345d4e 100644 --- a/code/modules/modular_computers/file_system/programs/command/card.dm +++ b/code/modules/modular_computers/file_system/programs/command/card.dm @@ -105,7 +105,7 @@ if(job) if(!job_blacklisted(job)) if((job.total_positions <= GLOB.player_list.len * (max_relative_positions / 100))) - var/delta = (world.time / 10) - time_last_changed_position + var/delta = (world.time / 10) - GLOB.time_last_changed_position if((change_position_cooldown < delta) || (opened_positions[job.title] < 0)) return 1 return -2 @@ -117,7 +117,7 @@ if(job) if(!job_blacklisted(job)) if(job.total_positions > job.current_positions) - var/delta = (world.time / 10) - time_last_changed_position + var/delta = (world.time / 10) - GLOB.time_last_changed_position if((change_position_cooldown < delta) || (opened_positions[job.title] > 0)) return 1 return -2 @@ -180,7 +180,7 @@ switch(href_list["action"]) if("PRG_modify") if(modify) - data_core.manifest_modify(modify.registered_name, modify.assignment) + GLOB.data_core.manifest_modify(modify.registered_name, modify.assignment) modify.name = "[modify.registered_name]'s ID Card ([modify.assignment])" card_slot.try_eject(1, user) else @@ -302,7 +302,7 @@ var/content if(mode == 2) title = "crew manifest ([station_time_timestamp()])" - content = "

    Crew Manifest


    [data_core ? data_core.get_manifest(0) : ""]" + content = "

    Crew Manifest


    [GLOB.data_core ? GLOB.data_core.get_manifest(0) : ""]" else if(modify && !mode) title = "access report" content = {"

    Access Report

    @@ -346,7 +346,7 @@ if(can_open_job(j) != 1) return 1 if(opened_positions[edit_job_target] >= 0) - time_last_changed_position = world.time / 10 + GLOB.time_last_changed_position = world.time / 10 j.total_positions++ opened_positions[edit_job_target]++ log_game("[key_name(usr)] has opened a job slot for job \"[j]\".") @@ -362,7 +362,7 @@ return 1 //Allow instant closing without cooldown if a position has been opened before if(opened_positions[edit_job_target] <= 0) - time_last_changed_position = world.time / 10 + GLOB.time_last_changed_position = world.time / 10 j.total_positions-- opened_positions[edit_job_target]-- log_game("[key_name(usr)] has closed a job slot for job \"[j]\".") @@ -413,7 +413,7 @@ data["mode"] = mode data["printing"] = printing data["printer"] = printer ? TRUE : FALSE - data["manifest"] = data_core ? data_core.get_manifest(0) : null + data["manifest"] = GLOB.data_core ? GLOB.data_core.get_manifest(0) : null data["target_name"] = modify ? modify.name : "-----" data["target_owner"] = modify && modify.registered_name ? modify.registered_name : "-----" data["target_rank"] = get_target_rank() @@ -429,19 +429,19 @@ var/list/job_formats = SSjobs.format_jobs_for_id_computer(modify) data["top_jobs"] = format_jobs(list("Captain", "Custom"), data["target_rank"], job_formats) - data["engineering_jobs"] = format_jobs(engineering_positions, data["target_rank"], job_formats) - data["medical_jobs"] = format_jobs(medical_positions, data["target_rank"], job_formats) - data["science_jobs"] = format_jobs(science_positions, data["target_rank"], job_formats) - data["security_jobs"] = format_jobs(security_positions, data["target_rank"], job_formats) - data["support_jobs"] = format_jobs(support_positions, data["target_rank"], job_formats) - data["civilian_jobs"] = format_jobs(civilian_positions, data["target_rank"], job_formats) - data["special_jobs"] = format_jobs(whitelisted_positions, data["target_rank"], job_formats) + data["engineering_jobs"] = format_jobs(GLOB.engineering_positions, data["target_rank"], job_formats) + data["medical_jobs"] = format_jobs(GLOB.medical_positions, data["target_rank"], job_formats) + data["science_jobs"] = format_jobs(GLOB.science_positions, data["target_rank"], job_formats) + data["security_jobs"] = format_jobs(GLOB.security_positions, data["target_rank"], job_formats) + data["support_jobs"] = format_jobs(GLOB.support_positions, data["target_rank"], job_formats) + data["civilian_jobs"] = format_jobs(GLOB.civilian_positions, data["target_rank"], job_formats) + data["special_jobs"] = format_jobs(GLOB.whitelisted_positions, data["target_rank"], job_formats) data["centcom_jobs"] = format_jobs(get_all_centcom_jobs(), data["target_rank"], job_formats) data["card_skins"] = format_card_skins(get_station_card_skins()) data["job_slots"] = format_job_slots() - var/time_to_wait = round(change_position_cooldown - ((world.time / 10) - time_last_changed_position), 1) + var/time_to_wait = round(change_position_cooldown - ((world.time / 10) - GLOB.time_last_changed_position), 1) var/mins = round(time_to_wait / 60) var/seconds = time_to_wait - (60*mins) data["cooldown_mins"] = mins diff --git a/code/modules/modular_computers/file_system/programs/command/comms.dm b/code/modules/modular_computers/file_system/programs/command/comms.dm index eb6f079d078..c23f0c9e3c7 100644 --- a/code/modules/modular_computers/file_system/programs/command/comms.dm +++ b/code/modules/modular_computers/file_system/programs/command/comms.dm @@ -50,7 +50,7 @@ /datum/computer_file/program/comm/proc/change_security_level(mob/user, new_level) tmp_alertlevel = new_level - var/old_level = security_level + var/old_level = GLOB.security_level if(!tmp_alertlevel) tmp_alertlevel = SEC_LEVEL_GREEN if(tmp_alertlevel < SEC_LEVEL_GREEN) @@ -58,10 +58,10 @@ if(tmp_alertlevel > SEC_LEVEL_BLUE) tmp_alertlevel = SEC_LEVEL_BLUE //Cannot engage delta with this set_security_level(tmp_alertlevel) - if(security_level != old_level) + if(GLOB.security_level != old_level) log_game("[key_name(user)] has changed the security level to [get_security_level()].") message_admins("[key_name_admin(user)] has changed the security level to [get_security_level()].") - switch(security_level) + switch(GLOB.security_level) if(SEC_LEVEL_GREEN) feedback_inc("alert_comms_green", 1) if(SEC_LEVEL_BLUE) @@ -101,7 +101,7 @@ ui.set_layout_key("program") ui.open() -/datum/computer_file/program/comm/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/datum/computer_file/program/comm/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/list/data = get_header_data() data["is_ai"] = isAI(user) || isrobot(user) data["menu_state"] = data["is_ai"] ? ai_menu_state : menu_state @@ -128,7 +128,7 @@ ) ) - data["security_level"] = security_level + data["security_level"] = GLOB.security_level data["str_security_level"] = capitalize(get_security_level()) data["levels"] = list( list("id" = SEC_LEVEL_GREEN, "name" = "Green"), @@ -326,7 +326,7 @@ Nuke_request(input, usr) to_chat(usr, "Request sent.") log_game("[key_name(usr)] has requested the nuclear codes from Centcomm") - priority_announcement.Announce("The codes for the on-station nuclear self-destruct have been requested by [usr]. Confirmation or denial of this request will be sent shortly.", "Nuclear Self Destruct Codes Requested",'sound/AI/commandreport.ogg') + GLOB.priority_announcement.Announce("The codes for the on-station nuclear self-destruct have been requested by [usr]. Confirmation or denial of this request will be sent shortly.", "Nuclear Self Destruct Codes Requested",'sound/AI/commandreport.ogg') centcomm_message_cooldown = 1 spawn(6000)//10 minute cooldown centcomm_message_cooldown = 0 diff --git a/code/modules/modular_computers/file_system/programs/engineering/power_monitor.dm b/code/modules/modular_computers/file_system/programs/engineering/power_monitor.dm index 0695c496541..0763d527345 100644 --- a/code/modules/modular_computers/file_system/programs/engineering/power_monitor.dm +++ b/code/modules/modular_computers/file_system/programs/engineering/power_monitor.dm @@ -43,6 +43,6 @@ data["poweravail"] = powernet.avail data["powerload"] = powernet.viewload data["powerdemand"] = powernet.load - data["apcs"] = apc_repository.apc_data(powernet) + data["apcs"] = GLOB.apc_repository.apc_data(powernet) return data diff --git a/code/modules/modular_computers/file_system/programs/generic/ntdownloader.dm b/code/modules/modular_computers/file_system/programs/generic/ntdownloader.dm index c0447b591bf..b4e5ab4674c 100644 --- a/code/modules/modular_computers/file_system/programs/generic/ntdownloader.dm +++ b/code/modules/modular_computers/file_system/programs/generic/ntdownloader.dm @@ -21,7 +21,7 @@ if(downloaded_file) return 0 - var/datum/computer_file/program/PRG = ntnet_global.find_ntnet_file_by_name(filename) + var/datum/computer_file/program/PRG = GLOB.ntnet_global.find_ntnet_file_by_name(filename) if(!PRG || !istype(PRG)) return 0 @@ -37,10 +37,10 @@ ui_header = "downloader_running.gif" - if(PRG in ntnet_global.available_station_software) + if(PRG in GLOB.ntnet_global.available_station_software) generate_network_log("Began downloading file [PRG.filename].[PRG.filetype] from NTNet Software Repository.") hacked_download = 0 - else if(PRG in ntnet_global.available_antag_software) + else if(PRG in GLOB.ntnet_global.available_antag_software) generate_network_log("Began downloading file **ENCRYPTED**.[PRG.filetype] from unspecified server.") hacked_download = 1 else @@ -135,7 +135,7 @@ data["disk_size"] = hard_drive.max_capacity data["disk_used"] = hard_drive.used_capacity var/list/all_entries[0] - for(var/A in ntnet_global.available_station_software) + for(var/A in GLOB.ntnet_global.available_station_software) var/datum/computer_file/program/P = A // Only those programs our user can run will show in the list if(!P.can_run(user,transfer = 1)) @@ -151,7 +151,7 @@ data["hackedavailable"] = 0 if(computer.emagged) // If we are running on emagged computer we have access to some "bonus" software var/list/hacked_programs[0] - for(var/S in ntnet_global.available_antag_software) + for(var/S in GLOB.ntnet_global.available_antag_software) var/datum/computer_file/program/P = S data["hackedavailable"] = 1 hacked_programs.Add(list(list( diff --git a/code/modules/modular_computers/file_system/programs/generic/ntnrc_client.dm b/code/modules/modular_computers/file_system/programs/generic/ntnrc_client.dm index 5a6affbb0a0..517c8f99ebe 100644 --- a/code/modules/modular_computers/file_system/programs/generic/ntnrc_client.dm +++ b/code/modules/modular_computers/file_system/programs/generic/ntnrc_client.dm @@ -52,7 +52,7 @@ /datum/computer_file/program/chatclient/ui_data(mob/user) - if(!ntnet_global || !ntnet_global.chat_channels) + if(!GLOB.ntnet_global || !GLOB.ntnet_global.chat_channels) return var/list/data = get_header_data() @@ -78,7 +78,7 @@ else // Channel selection screen var/list/all_channels[0] - for(var/C in ntnet_global.chat_channels) + for(var/C in GLOB.ntnet_global.chat_channels) var/datum/ntnet_conversation/conv = C if(conv && conv.title) all_channels.Add(list(list( @@ -108,7 +108,7 @@ if("PRG_joinchannel") . = 1 var/datum/ntnet_conversation/C - for(var/datum/ntnet_conversation/chan in ntnet_global.chat_channels) + for(var/datum/ntnet_conversation/chan in GLOB.ntnet_global.chat_channels) if(chan.id == text2num(href_list["id"])) C = chan break diff --git a/code/modules/modular_computers/file_system/programs/generic/nttransfer.dm b/code/modules/modular_computers/file_system/programs/generic/nttransfer.dm index 184b2cf300f..1ccefa9311a 100644 --- a/code/modules/modular_computers/file_system/programs/generic/nttransfer.dm +++ b/code/modules/modular_computers/file_system/programs/generic/nttransfer.dm @@ -1,4 +1,4 @@ -var/global/nttransfer_uid = 0 +GLOBAL_VAR_INIT(nttransfer_uid, 0) /datum/computer_file/program/nttransfer filename = "nttransfer" @@ -24,8 +24,8 @@ var/global/nttransfer_uid = 0 var/upload_menu = 0 // Whether we show the program list and upload menu /datum/computer_file/program/nttransfer/New() - unique_token = nttransfer_uid - nttransfer_uid++ + unique_token = GLOB.nttransfer_uid + GLOB.nttransfer_uid++ ..() /datum/computer_file/program/nttransfer/process_tick() @@ -100,7 +100,7 @@ var/global/nttransfer_uid = 0 return 1 switch(href_list["action"]) if("PRG_downloadfile") - for(var/datum/computer_file/program/nttransfer/P in ntnet_global.fileservers) + for(var/datum/computer_file/program/nttransfer/P in GLOB.ntnet_global.fileservers) if("[P.unique_token]" == href_list["id"]) remote = P break @@ -118,8 +118,8 @@ var/global/nttransfer_uid = 0 error = "" upload_menu = 0 finalize_download() - if(src in ntnet_global.fileservers) - ntnet_global.fileservers.Remove(src) + if(src in GLOB.ntnet_global.fileservers) + GLOB.ntnet_global.fileservers.Remove(src) for(var/datum/computer_file/program/nttransfer/T in connected_clients) T.crash_download("Remote server has forcibly closed the connection") provided_file = null @@ -145,7 +145,7 @@ var/global/nttransfer_uid = 0 if(!P.can_run(usr,transfer = 1)) error = "Access Error: Insufficient rights to upload file." provided_file = F - ntnet_global.fileservers.Add(src) + GLOB.ntnet_global.fileservers.Add(src) return error = "I/O Error: Unable to locate file on hard drive." return 1 @@ -183,7 +183,7 @@ var/global/nttransfer_uid = 0 data["upload_filelist"] = all_files else var/list/all_servers[0] - for(var/datum/computer_file/program/nttransfer/P in ntnet_global.fileservers) + for(var/datum/computer_file/program/nttransfer/P in GLOB.ntnet_global.fileservers) all_servers.Add(list(list( "uid" = P.unique_token, "filename" = "[P.provided_file.filename].[P.provided_file.filetype]", diff --git a/code/modules/modular_computers/file_system/programs/research/ntmonitor.dm b/code/modules/modular_computers/file_system/programs/research/ntmonitor.dm index 6f3f41df272..0a839a6d13f 100644 --- a/code/modules/modular_computers/file_system/programs/research/ntmonitor.dm +++ b/code/modules/modular_computers/file_system/programs/research/ntmonitor.dm @@ -24,22 +24,22 @@ switch(href_list["action"]) if("resetIDS") . = 1 - if(ntnet_global) - ntnet_global.resetIDS() + if(GLOB.ntnet_global) + GLOB.ntnet_global.resetIDS() return 1 if("toggleIDS") . = 1 - if(ntnet_global) - ntnet_global.toggleIDS() + if(GLOB.ntnet_global) + GLOB.ntnet_global.toggleIDS() return 1 if("toggleWireless") . = 1 - if(!ntnet_global) + if(!GLOB.ntnet_global) return 1 // NTNet is disabled. Enabling can be done without user prompt - if(ntnet_global.setting_disabled) - ntnet_global.setting_disabled = 0 + if(GLOB.ntnet_global.setting_disabled) + GLOB.ntnet_global.setting_disabled = 0 return 1 // NTNet is enabled and user is about to shut it down. Let's ask them if they really want to do it, as wirelessly connected computers won't connect without NTNet being enabled (which may prevent people from turning it back on) @@ -48,43 +48,43 @@ return 1 var/response = alert(user, "Really disable NTNet wireless? If your computer is connected wirelessly you won't be able to turn it back on! This will affect all connected wireless devices.", "NTNet shutdown", "Yes", "No") if(response == "Yes") - ntnet_global.setting_disabled = 1 + GLOB.ntnet_global.setting_disabled = 1 return 1 if("purgelogs") . = 1 - if(ntnet_global) - ntnet_global.purge_logs() + if(GLOB.ntnet_global) + GLOB.ntnet_global.purge_logs() if("updatemaxlogs") . = 1 var/mob/user = usr var/logcount = text2num(input(user,"Enter amount of logs to keep in memory ([MIN_NTNET_LOGS]-[MAX_NTNET_LOGS]):")) - if(ntnet_global) - ntnet_global.update_max_log_count(logcount) + if(GLOB.ntnet_global) + GLOB.ntnet_global.update_max_log_count(logcount) if("toggle_function") . = 1 - if(!ntnet_global) + if(!GLOB.ntnet_global) return 1 - ntnet_global.toggle_function(text2num(href_list["id"])) + GLOB.ntnet_global.toggle_function(text2num(href_list["id"])) /datum/computer_file/program/ntnetmonitor/ui_data(mob/user) - if(!ntnet_global) + if(!GLOB.ntnet_global) return var/list/data = get_header_data() - data["ntnetstatus"] = ntnet_global.check_function() - data["ntnetrelays"] = ntnet_global.relays.len - data["idsstatus"] = ntnet_global.intrusion_detection_enabled - data["idsalarm"] = ntnet_global.intrusion_detection_alarm + data["ntnetstatus"] = GLOB.ntnet_global.check_function() + data["ntnetrelays"] = GLOB.ntnet_global.relays.len + data["idsstatus"] = GLOB.ntnet_global.intrusion_detection_enabled + data["idsalarm"] = GLOB.ntnet_global.intrusion_detection_alarm - data["config_softwaredownload"] = ntnet_global.setting_softwaredownload - data["config_peertopeer"] = ntnet_global.setting_peertopeer - data["config_communication"] = ntnet_global.setting_communication - data["config_systemcontrol"] = ntnet_global.setting_systemcontrol + data["config_softwaredownload"] = GLOB.ntnet_global.setting_softwaredownload + data["config_peertopeer"] = GLOB.ntnet_global.setting_peertopeer + data["config_communication"] = GLOB.ntnet_global.setting_communication + data["config_systemcontrol"] = GLOB.ntnet_global.setting_systemcontrol data["ntnetlogs"] = list() - for(var/i in ntnet_global.logs) + for(var/i in GLOB.ntnet_global.logs) data["ntnetlogs"] += list(list("entry" = i)) - data["ntnetmaxlogs"] = ntnet_global.setting_maxlogcount + data["ntnetmaxlogs"] = GLOB.ntnet_global.setting_maxlogcount return data diff --git a/code/modules/modular_computers/hardware/network_card.dm b/code/modules/modular_computers/hardware/network_card.dm index 4768a63b9cb..3e5409b5d61 100644 --- a/code/modules/modular_computers/hardware/network_card.dm +++ b/code/modules/modular_computers/hardware/network_card.dm @@ -1,4 +1,4 @@ -var/global/ntnet_card_uid = 1 +GLOBAL_VAR_INIT(ntnet_card_uid, 1) /obj/item/computer_hardware/network_card name = "network card" @@ -26,8 +26,8 @@ var/global/ntnet_card_uid = 1 /obj/item/computer_hardware/network_card/New(var/l) ..(l) - identification_id = ntnet_card_uid - ntnet_card_uid++ + identification_id = GLOB.ntnet_card_uid + GLOB.ntnet_card_uid++ // Returns a string identifier of this network card /obj/item/computer_hardware/network_card/proc/get_network_tag() @@ -44,7 +44,7 @@ var/global/ntnet_card_uid = 1 if(ethernet) // Computer is connected via wired connection. return 3 - if(!ntnet_global || !ntnet_global.check_function(specific_action)) // NTNet is down and we are not connected via wired connection. No signal. + if(!GLOB.ntnet_global || !GLOB.ntnet_global.check_function(specific_action)) // NTNet is down and we are not connected via wired connection. No signal. return 0 if(holder) diff --git a/code/modules/modular_computers/laptop_vendor.dm b/code/modules/modular_computers/laptop_vendor.dm index b2066285dea..aa69b85b1df 100644 --- a/code/modules/modular_computers/laptop_vendor.dm +++ b/code/modules/modular_computers/laptop_vendor.dm @@ -283,7 +283,7 @@ obj/machinery/lapvend/attackby(obj/item/I, mob/user) atom_say("Insufficient funds in account.") return 0 else - customer_account.charge(total_price, vendor_account, + customer_account.charge(total_price, GLOB.vendor_account, "Purchase of [(devtype == 1) ? "laptop computer" : "tablet microcomputer"].", name, customer_account.owner_name, "Sale of [(devtype == 1) ? "laptop computer" : "tablet microcomputer"].", customer_account.owner_name) diff --git a/code/modules/nano/interaction/admin.dm b/code/modules/nano/interaction/admin.dm index 412ebbc1260..9223e1e0763 100644 --- a/code/modules/nano/interaction/admin.dm +++ b/code/modules/nano/interaction/admin.dm @@ -1,7 +1,7 @@ /* This state checks that the user is an admin, end of story */ -/var/global/datum/topic_state/admin_state/admin_state = new() +GLOBAL_DATUM_INIT(admin_state, /datum/topic_state/admin_state, new()) /datum/topic_state/admin_state/can_use_topic(var/src_object, var/mob/user) return check_rights(R_ADMIN, 0, user) ? STATUS_INTERACTIVE : STATUS_CLOSE diff --git a/code/modules/nano/interaction/conscious.dm b/code/modules/nano/interaction/conscious.dm index 143bc24956f..e4b478dced6 100644 --- a/code/modules/nano/interaction/conscious.dm +++ b/code/modules/nano/interaction/conscious.dm @@ -1,7 +1,7 @@ /* This state only checks if user is conscious. */ -/var/global/datum/topic_state/conscious_state/conscious_state = new() +GLOBAL_DATUM_INIT(conscious_state, /datum/topic_state/conscious_state, new()) /datum/topic_state/conscious_state/can_use_topic(var/src_object, var/mob/user) return user.stat == CONSCIOUS ? STATUS_INTERACTIVE : STATUS_CLOSE diff --git a/code/modules/nano/interaction/contained.dm b/code/modules/nano/interaction/contained.dm index 3c84734104a..03ac30d07ad 100644 --- a/code/modules/nano/interaction/contained.dm +++ b/code/modules/nano/interaction/contained.dm @@ -1,7 +1,7 @@ /* This state checks if user is somewhere within src_object, as well as the default NanoUI interaction. */ -/var/global/datum/topic_state/contained_state/contained_state = new() +GLOBAL_DATUM_INIT(contained_state, /datum/topic_state/contained_state, new()) /datum/topic_state/contained_state/can_use_topic(var/atom/src_object, var/mob/user) if(!src_object.contains(user)) diff --git a/code/modules/nano/interaction/default.dm b/code/modules/nano/interaction/default.dm index e5062bc0b12..ca42220204d 100644 --- a/code/modules/nano/interaction/default.dm +++ b/code/modules/nano/interaction/default.dm @@ -1,4 +1,4 @@ -/var/global/datum/topic_state/default/default_state = new() +GLOBAL_DATUM_INIT(default_state, /datum/topic_state/default, new()) /datum/topic_state/default/href_list(var/mob/user) return list() @@ -51,7 +51,7 @@ // If we're installed in a chassi, rather than transfered to an inteliCard or other container, then check if we have camera view if(is_in_chassis()) //stop AIs from leaving windows open and using then after they lose vision - if(cameranet && !cameranet.checkTurfVis(get_turf(src_object))) + if(GLOB.cameranet && !GLOB.cameranet.checkTurfVis(get_turf(src_object))) return STATUS_CLOSE return STATUS_INTERACTIVE else if(get_dist(src_object, src) <= client.view) // View does not return what one would expect while installed in an inteliCard diff --git a/code/modules/nano/interaction/ghost.dm b/code/modules/nano/interaction/ghost.dm index 6b0aa3db1ca..bb435b33896 100644 --- a/code/modules/nano/interaction/ghost.dm +++ b/code/modules/nano/interaction/ghost.dm @@ -1,9 +1,9 @@ /* - This checks that the user is a ghost or alternatively an admin. Used for the mob spawner. + This checks that the user is a ghost or alternatively an admin. Used for the mob spawner. We don't want any living people somehow getting the menu open and reincarnating while alive */ -/var/global/datum/topic_state/ghost_state/ghost_state = new() +GLOBAL_DATUM_INIT(ghost_state, /datum/topic_state/ghost_state, new()) /datum/topic_state/ghost_state/can_use_topic(var/src_object, var/mob/user) if(user.stat == DEAD) diff --git a/code/modules/nano/interaction/inventory.dm b/code/modules/nano/interaction/inventory.dm index cbe5165e5ff..bd0e12ea5a1 100644 --- a/code/modules/nano/interaction/inventory.dm +++ b/code/modules/nano/interaction/inventory.dm @@ -1,7 +1,7 @@ /* This state checks that the src_object is somewhere in the user's first-level inventory (in hands, on ear, etc.), but not further down (such as in bags). */ -/var/global/datum/topic_state/inventory_state/inventory_state = new() +GLOBAL_DATUM_INIT(inventory_state, /datum/topic_state/inventory_state, new()) /datum/topic_state/inventory_state/can_use_topic(var/src_object, var/mob/user) if(!((src_object in user) || user.is_in_active_hand(src_object) || user.is_in_inactive_hand(src_object))) diff --git a/code/modules/nano/interaction/inventory_deep.dm b/code/modules/nano/interaction/inventory_deep.dm index 98078c02c1d..6d6e3667675 100644 --- a/code/modules/nano/interaction/inventory_deep.dm +++ b/code/modules/nano/interaction/inventory_deep.dm @@ -1,7 +1,7 @@ /* This state checks if src_object is contained anywhere in the user's inventory, including bags, etc. */ -/var/global/datum/topic_state/deep_inventory_state/deep_inventory_state = new() +GLOBAL_DATUM_INIT(deep_inventory_state, /datum/topic_state/deep_inventory_state, new()) /datum/topic_state/deep_inventory_state/can_use_topic(var/src_object, var/mob/user) if(!user.contains(src_object)) diff --git a/code/modules/nano/interaction/not_incapacitated.dm b/code/modules/nano/interaction/not_incapacitated.dm index db12edf3119..8539315f3c6 100644 --- a/code/modules/nano/interaction/not_incapacitated.dm +++ b/code/modules/nano/interaction/not_incapacitated.dm @@ -2,13 +2,12 @@ * This state only checks if the user isn't incapacitated **/ -/var/global/datum/topic_state/not_incapacitated_state/not_incapacitated_state = new() +GLOBAL_DATUM_INIT(not_incapacitated_state, /datum/topic_state/not_incapacitated_state, new()) /** * This state checks if the user isn't incapacitated and that their loc is a turf **/ - -/var/global/datum/topic_state/not_incapacitated_state/not_incapacitated_turf_state = new(no_turfs = TRUE) +GLOBAL_DATUM_INIT(not_incapacitated_turf_state, /datum/topic_state/not_incapacitated_state, new(no_turfs = TRUE)) /datum/topic_state/not_incapacitated_state var/turf_check = FALSE diff --git a/code/modules/nano/interaction/physical.dm b/code/modules/nano/interaction/physical.dm index 424ea3a6304..193f8c094c1 100644 --- a/code/modules/nano/interaction/physical.dm +++ b/code/modules/nano/interaction/physical.dm @@ -1,4 +1,4 @@ -/var/global/datum/topic_state/physical/physical_state = new() +GLOBAL_DATUM_INIT(physical_state, /datum/topic_state/physical, new()) /datum/topic_state/physical/can_use_topic(var/src_object, var/mob/user) . = user.shared_nano_interaction(src_object) diff --git a/code/modules/nano/interaction/self.dm b/code/modules/nano/interaction/self.dm index a4ae5050347..a3d94457135 100644 --- a/code/modules/nano/interaction/self.dm +++ b/code/modules/nano/interaction/self.dm @@ -1,7 +1,7 @@ /* This state checks that the src_object is the same the as user */ -/var/global/datum/topic_state/self_state/self_state = new() +GLOBAL_DATUM_INIT(self_state, /datum/topic_state/self_state, new()) /datum/topic_state/self_state/can_use_topic(var/src_object, var/mob/user) if(src_object != user) diff --git a/code/modules/nano/interaction/zlevel.dm b/code/modules/nano/interaction/zlevel.dm index 15052bc6636..feeb617cd49 100644 --- a/code/modules/nano/interaction/zlevel.dm +++ b/code/modules/nano/interaction/zlevel.dm @@ -2,7 +2,7 @@ This state checks that the user is on the same Z-level as src_object */ -/var/global/datum/topic_state/z_state/z_state = new() +GLOBAL_DATUM_INIT(z_state, /datum/topic_state/z_state, new()) /datum/topic_state/z_state/can_use_topic(var/src_object, var/mob/user) var/turf/turf_obj = get_turf(src_object) diff --git a/code/modules/nano/modules/alarm_monitor.dm b/code/modules/nano/modules/alarm_monitor.dm index dc52841a367..cee3820b102 100644 --- a/code/modules/nano/modules/alarm_monitor.dm +++ b/code/modules/nano/modules/alarm_monitor.dm @@ -48,21 +48,21 @@ if(..()) return 1 if(href_list["switchTo"]) - var/obj/machinery/camera/C = locate(href_list["switchTo"]) in cameranet.cameras + var/obj/machinery/camera/C = locate(href_list["switchTo"]) in GLOB.cameranet.cameras if(!C || !isAI(usr)) return usr.switch_to_camera(C) return 1 -/datum/nano_module/alarm_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) +/datum/nano_module/alarm_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = GLOB.default_state) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "alarm_monitor.tmpl", "Alarm Monitoring Console", 800, 800, state = state) ui.open() ui.set_auto_update(1) -/datum/nano_module/alarm_monitor/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/datum/nano_module/alarm_monitor/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] var/categories[0] diff --git a/code/modules/nano/modules/atmos_control.dm b/code/modules/nano/modules/atmos_control.dm index 3b61ea0f557..76d14bb3e00 100644 --- a/code/modules/nano/modules/atmos_control.dm +++ b/code/modules/nano/modules/atmos_control.dm @@ -28,7 +28,7 @@ var/datum/topic_state/air_alarm/TS = generate_state(alarm) alarm.ui_interact(usr, master_ui = ui_ref, state = TS) -/datum/nano_module/atmos_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state) +/datum/nano_module/atmos_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/master_ui = null, var/datum/topic_state/state = GLOB.default_state) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "atmos_control.tmpl", src.name, 900, 800, state = state) @@ -39,9 +39,9 @@ ui.set_auto_update(1) ui_ref = ui -/datum/nano_module/atmos_control/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/datum/nano_module/atmos_control/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] - data["alarms"] = air_alarm_repository.air_alarm_data(monitored_alarms) + data["alarms"] = GLOB.air_alarm_repository.air_alarm_data(monitored_alarms) return data diff --git a/code/modules/nano/modules/crew_monitor.dm b/code/modules/nano/modules/crew_monitor.dm index 755009ac0be..4ed7fc03de1 100644 --- a/code/modules/nano/modules/crew_monitor.dm +++ b/code/modules/nano/modules/crew_monitor.dm @@ -16,7 +16,7 @@ AI.ai_actual_track(H) return 1 -/datum/nano_module/crew_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) +/datum/nano_module/crew_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = GLOB.default_state) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "crew_monitor.tmpl", "Crew Monitoring Computer", 900, 800) @@ -31,11 +31,11 @@ // should make the UI auto-update; doesn't seem to? ui.set_auto_update(1) -/datum/nano_module/crew_monitor/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/datum/nano_module/crew_monitor/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] var/turf/T = get_turf(nano_host()) data["isAI"] = isAI(user) - data["crewmembers"] = crew_repository.health_data(T) + data["crewmembers"] = GLOB.crew_repository.health_data(T) return data diff --git a/code/modules/nano/modules/ert_manager.dm b/code/modules/nano/modules/ert_manager.dm index e218ad2ae68..98a3e19d052 100644 --- a/code/modules/nano/modules/ert_manager.dm +++ b/code/modules/nano/modules/ert_manager.dm @@ -11,7 +11,7 @@ var/autoclose = 0 -/datum/nano_module/ert_manager/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = admin_state) +/datum/nano_module/ert_manager/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = GLOB.admin_state) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(ui && autoclose) ui.close() @@ -50,7 +50,7 @@ cyborg_slots = text2num(href_list["set_cyb"]) if(href_list["dispatch_ert"]) - ert_request_answered = TRUE + GLOB.ert_request_answered = TRUE var/slots_list = list() if(commander_slots > 0) slots_list += "commander: [commander_slots]" @@ -70,7 +70,7 @@ notify_ghosts("An ERT is being dispatched. Open positions: [slot_text]") message_admins("[key_name_admin(usr)] dispatched a [ert_type] ERT. Slots: [slot_text]", 1) log_admin("[key_name(usr)] dispatched a [ert_type] ERT. Slots: [slot_text]") - event_announcement.Announce("Attention, [station_name()]. We are attempting to assemble an ERT. Standby.", "ERT Protocol Activated") + GLOB.event_announcement.Announce("Attention, [station_name()]. We are attempting to assemble an ERT. Standby.", "ERT Protocol Activated") autoclose = 1 ui_interact(usr) trigger_armed_response_team(convert_ert_string(ert_type), commander_slots, security_slots, medical_slots, engineering_slots, janitor_slots, paranormal_slots, cyborg_slots) diff --git a/code/modules/nano/modules/human_appearance.dm b/code/modules/nano/modules/human_appearance.dm index 07810eb92a0..485fee0acb8 100644 --- a/code/modules/nano/modules/human_appearance.dm +++ b/code/modules/nano/modules/human_appearance.dm @@ -25,7 +25,7 @@ src.whitelist = species_whitelist src.blacklist = species_blacklist -/datum/nano_module/appearance_changer/Topic(ref, href_list, var/nowindow, var/datum/topic_state/state = default_state) +/datum/nano_module/appearance_changer/Topic(ref, href_list, var/nowindow, var/datum/topic_state/state = GLOB.default_state) if(..()) return 1 @@ -173,14 +173,14 @@ return 0 -/datum/nano_module/appearance_changer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) +/datum/nano_module/appearance_changer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = GLOB.default_state) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "appearance_changer.tmpl", "[src]", 800, 450, state = state) ui.open() ui.set_auto_update(1) -/datum/nano_module/appearance_changer/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/datum/nano_module/appearance_changer/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) generate_data(check_whitelist, whitelist, blacklist) var/data[0] diff --git a/code/modules/nano/modules/law_manager.dm b/code/modules/nano/modules/law_manager.dm index a8a8d5e688a..f2423e57c2f 100644 --- a/code/modules/nano/modules/law_manager.dm +++ b/code/modules/nano/modules/law_manager.dm @@ -152,14 +152,14 @@ return 0 -/datum/nano_module/law_manager/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) +/datum/nano_module/law_manager/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = GLOB.default_state) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "law_manager.tmpl", sanitize("[src] - [owner.name]"), 800, is_malf(user) ? 600 : 400, state = state) ui.open() ui.set_auto_update(1) -/datum/nano_module/law_manager/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/datum/nano_module/law_manager/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] owner.lawsync() diff --git a/code/modules/nano/modules/nano_module.dm b/code/modules/nano/modules/nano_module.dm index c62067bfaf8..a9afc94f69b 100644 --- a/code/modules/nano/modules/nano_module.dm +++ b/code/modules/nano/modules/nano_module.dm @@ -12,5 +12,5 @@ if(host) host.on_ui_close(user) -/datum/nano_module/proc/can_still_topic(var/datum/topic_state/state = default_state) +/datum/nano_module/proc/can_still_topic(var/datum/topic_state/state = GLOB.default_state) return CanUseTopic(usr, state) == STATUS_INTERACTIVE diff --git a/code/modules/nano/modules/power_monitor.dm b/code/modules/nano/modules/power_monitor.dm index 00dcf9819ec..66948243035 100644 --- a/code/modules/nano/modules/power_monitor.dm +++ b/code/modules/nano/modules/power_monitor.dm @@ -11,20 +11,20 @@ if(!select_monitor) powermonitor = nano_host() -/datum/nano_module/power_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) +/datum/nano_module/power_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = GLOB.default_state) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "power_monitor.tmpl", "Power Monitoring Console", 800, 700, state = state) ui.open() ui.set_auto_update(1) -/datum/nano_module/power_monitor/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/datum/nano_module/power_monitor/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["powermonitor"] = powermonitor if(select_monitor) data["select_monitor"] = 1 - data["powermonitors"] = powermonitor_repository.powermonitor_data() + data["powermonitors"] = GLOB.powermonitor_repository.powermonitor_data() if(powermonitor && !isnull(powermonitor.powernet)) if(select_monitor && (powermonitor.stat & (NOPOWER|BROKEN))) @@ -33,7 +33,7 @@ data["poweravail"] = powermonitor.powernet.avail data["powerload"] = powermonitor.powernet.viewload data["powerdemand"] = powermonitor.powernet.load - data["apcs"] = apc_repository.apc_data(powermonitor.powernet) + data["apcs"] = GLOB.apc_repository.apc_data(powermonitor.powernet) return data diff --git a/code/modules/nano/nanoexternal.dm b/code/modules/nano/nanoexternal.dm index 8e7269972fd..602a46dbfa3 100644 --- a/code/modules/nano/nanoexternal.dm +++ b/code/modules/nano/nanoexternal.dm @@ -37,7 +37,7 @@ * * @return nothing */ -/datum/proc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/nano_ui/master_ui = null, var/datum/topic_state/state = default_state) +/datum/proc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/nano_ui/master_ui = null, var/datum/topic_state/state = GLOB.default_state) return /** @@ -57,7 +57,7 @@ * * @return list() */ -/datum/proc/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/datum/proc/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) return list() // Used by the Nano UI Manager (/datum/nanomanager) to track UIs opened by this mob diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index 0df04d27928..526ca1ffe04 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -71,7 +71,7 @@ nanoui is used to open and update nano browser uis * * @return /nanoui new nanoui object */ -/datum/nanoui/New(nuser, nsrc_object, nui_key, ntemplate_filename, ntitle = 0, nwidth = 0, nheight = 0, var/atom/nref = null, var/datum/nanoui/master_ui = null, var/datum/topic_state/state = default_state) +/datum/nanoui/New(nuser, nsrc_object, nui_key, ntemplate_filename, ntitle = 0, nwidth = 0, nheight = 0, var/atom/nref = null, var/datum/nanoui/master_ui = null, var/datum/topic_state/state = GLOB.default_state) user = nuser src_object = nsrc_object ui_key = nui_key @@ -176,7 +176,7 @@ nanoui is used to open and update nano browser uis var/name = "[src_object]" var/list/config_data = list( "title" = title, - "map" = (using_map && using_map.name) ? using_map.name : "Unknown", + "map" = (GLOB.using_map && GLOB.using_map.name) ? GLOB.using_map.name : "Unknown", "srcObject" = list("name" = name), "stateKey" = state_key, "status" = status, diff --git a/code/modules/paperwork/contract.dm b/code/modules/paperwork/contract.dm index 25e72610237..b1fe71db72e 100644 --- a/code/modules/paperwork/contract.dm +++ b/code/modules/paperwork/contract.dm @@ -265,8 +265,8 @@ /obj/item/paper/contract/infernal/power/FulfillContract(mob/living/carbon/human/user = target.current, blood = 0) if(!user.dna) return -1 - user.dna.SetSEState(HULKBLOCK,1) - genemutcheck(user, HULKBLOCK,null,MUTCHK_FORCED) + user.dna.SetSEState(GLOB.hulkblock,1) + genemutcheck(user, GLOB.hulkblock,null,MUTCHK_FORCED) // Demonic power gives you consequenceless hulk user.gene_stability += GENE_INSTABILITY_MAJOR if(ishuman(user)) diff --git a/code/modules/paperwork/fax.dm b/code/modules/paperwork/fax.dm index 4b8d4f9db6e..360b5a78500 100644 --- a/code/modules/paperwork/fax.dm +++ b/code/modules/paperwork/fax.dm @@ -1,6 +1,6 @@ // Fax datum - holds all faxes sent during the round -var/list/faxes = list() -var/list/adminfaxes = list() +GLOBAL_LIST_EMPTY(faxes) +GLOBAL_LIST_EMPTY(adminfaxes) /datum/fax var/name = "fax" @@ -12,13 +12,13 @@ var/list/adminfaxes = list() var/sent_at = null /datum/fax/New() - faxes += src + GLOB.faxes += src /datum/fax/admin var/list/reply_to = null /datum/fax/admin/New() - adminfaxes += src + GLOB.adminfaxes += src // Fax panel - lets admins check all faxes sent during the round /client/proc/fax_panel() @@ -37,7 +37,7 @@ var/list/adminfaxes = list() html += "

    Admin Faxes

    " html += "" html += "" - for(var/datum/fax/admin/A in adminfaxes) + for(var/datum/fax/admin/A in GLOB.adminfaxes) html += "" html += "" html += "" @@ -66,7 +66,7 @@ var/list/adminfaxes = list() html += "

    Departmental Faxes

    " html += "
    NameFrom DepartmentTo DepartmentSent AtSent ByViewReplyReplied To
    [A.name][A.from_department]
    " html += "" - for(var/datum/fax/F in faxes) + for(var/datum/fax/F in GLOB.faxes) html += "" html += "" html += "" diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm index 2f3088c5484..09858073142 100644 --- a/code/modules/paperwork/faxmachine.dm +++ b/code/modules/paperwork/faxmachine.dm @@ -1,9 +1,9 @@ -var/list/obj/machinery/photocopier/faxmachine/allfaxes = list() -var/list/admin_departments = list("Central Command") -var/list/hidden_admin_departments = list("Syndicate") -var/list/alldepartments = list() -var/list/hidden_departments = list() -var/global/list/fax_blacklist = list() +GLOBAL_LIST_EMPTY(allfaxes) +GLOBAL_LIST_INIT(admin_departments, list("Central Command")) +GLOBAL_LIST_INIT(hidden_admin_departments, list("Syndicate")) +GLOBAL_LIST_EMPTY(alldepartments) +GLOBAL_LIST_EMPTY(hidden_departments) +GLOBAL_LIST_EMPTY(fax_blacklist) /obj/machinery/photocopier/faxmachine name = "fax machine" @@ -33,13 +33,13 @@ var/global/list/fax_blacklist = list() /obj/machinery/photocopier/faxmachine/New() ..() - allfaxes += src + GLOB.allfaxes += src update_network() /obj/machinery/photocopier/faxmachine/proc/update_network() if(department != "Unknown") - if(!(("[department]" in alldepartments) || ("[department]" in hidden_departments) || ("[department]" in admin_departments) || ("[department]" in hidden_admin_departments))) - alldepartments |= department + if(!(("[department]" in GLOB.alldepartments) || ("[department]" in GLOB.hidden_departments) || ("[department]" in GLOB.admin_departments) || ("[department]" in GLOB.hidden_admin_departments))) + GLOB.alldepartments |= department /obj/machinery/photocopier/faxmachine/longrange name = "long range fax machine" @@ -55,7 +55,7 @@ var/global/list/fax_blacklist = list() /obj/machinery/photocopier/faxmachine/longrange/syndie/update_network() if(department != "Unknown") - hidden_departments |= department + GLOB.hidden_departments |= department /obj/machinery/photocopier/faxmachine/attack_hand(mob/user) ui_interact(user) @@ -86,7 +86,7 @@ var/global/list/fax_blacklist = list() ui = new(user, src, ui_key, "faxmachine.tmpl", "Fax Machine UI", 540, 450) ui.open() -/obj/machinery/photocopier/faxmachine/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/photocopier/faxmachine/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] var/is_authenticated = is_authenticated(user) @@ -109,7 +109,7 @@ var/global/list/fax_blacklist = list() data["paperinserted"] = 0 data["destination"] = destination data["cooldown"] = sendcooldown - if((destination in admin_departments) || (destination in hidden_admin_departments)) + if((destination in GLOB.admin_departments) || (destination in GLOB.hidden_admin_departments)) data["respectcooldown"] = 1 else data["respectcooldown"] = 0 @@ -130,7 +130,7 @@ var/global/list/fax_blacklist = list() var/is_authenticated = is_authenticated(usr) if(href_list["send"]) if(copyitem && is_authenticated) - if((destination in admin_departments) || (destination in hidden_admin_departments)) + if((destination in GLOB.admin_departments) || (destination in GLOB.hidden_admin_departments)) send_admin_fax(usr, destination) else sendfax(destination, usr) @@ -163,18 +163,18 @@ var/global/list/fax_blacklist = list() if(href_list["dept"]) if(is_authenticated) var/lastdestination = destination - var/list/combineddepartments = alldepartments.Copy() + var/list/combineddepartments = GLOB.alldepartments.Copy() if(long_range_enabled) - combineddepartments += admin_departments.Copy() + combineddepartments += GLOB.admin_departments.Copy() if(emagged) - combineddepartments += hidden_admin_departments.Copy() - combineddepartments += hidden_departments.Copy() + combineddepartments += GLOB.hidden_admin_departments.Copy() + combineddepartments += GLOB.hidden_departments.Copy() if(syndie_restricted) - combineddepartments = hidden_admin_departments.Copy() - combineddepartments += hidden_departments.Copy() - for(var/obj/machinery/photocopier/faxmachine/F in allfaxes) + combineddepartments = GLOB.hidden_admin_departments.Copy() + combineddepartments += GLOB.hidden_departments.Copy() + for(var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes) if(F.emagged)//we can contact emagged faxes on the station combineddepartments |= F.department @@ -184,7 +184,7 @@ var/global/list/fax_blacklist = list() if(href_list["auth"]) if(!is_authenticated && scan) - if(scan.registered_name in fax_blacklist) + if(scan.registered_name in GLOB.fax_blacklist) playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, 0) else if(check_access(scan)) authenticated = 1 @@ -252,7 +252,7 @@ var/global/list/fax_blacklist = list() use_power(200) var/success = 0 - for(var/obj/machinery/photocopier/faxmachine/F in allfaxes) + for(var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes) if(F.department == destination) success = F.receivefax(copyitem) @@ -324,7 +324,7 @@ var/global/list/fax_blacklist = list() message_admins(sender, "CENTCOM FAX", destination, copyitem, "#006100") if("Syndicate") message_admins(sender, "SYNDICATE FAX", destination, copyitem, "#DC143C") - for(var/obj/machinery/photocopier/faxmachine/F in allfaxes) + for(var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes) if(F.department == destination) F.receivefax(copyitem) sendcooldown = cooldown_time diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index 7d6144bee1b..626a3d99e59 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -119,9 +119,9 @@ /obj/structure/filingcabinet/security/proc/populate() if(virgin) - for(var/datum/data/record/G in data_core.general) + for(var/datum/data/record/G in GLOB.data_core.general) var/datum/data/record/S - for(var/datum/data/record/R in data_core.security) + for(var/datum/data/record/R in GLOB.data_core.security) if(R.fields["name"] == G.fields["name"] || R.fields["id"] == G.fields["id"]) S = R break @@ -153,9 +153,9 @@ /obj/structure/filingcabinet/medical/proc/populate() if(virgin) - for(var/datum/data/record/G in data_core.general) + for(var/datum/data/record/G in GLOB.data_core.general) var/datum/data/record/M - for(var/datum/data/record/R in data_core.medical) + for(var/datum/data/record/R in GLOB.data_core.medical) if(R.fields["name"] == G.fields["name"] || R.fields["id"] == G.fields["id"]) M = R break @@ -183,7 +183,7 @@ * Employment contract Cabinets */ -var/list/employmentCabinets = list() +GLOBAL_LIST_EMPTY(employmentCabinets) /obj/structure/filingcabinet/employment var/cooldown = 0 @@ -191,16 +191,16 @@ var/list/employmentCabinets = list() var/virgin = 1 /obj/structure/filingcabinet/employment/New() - employmentCabinets += src + GLOB.employmentCabinets += src return ..() /obj/structure/filingcabinet/employment/Destroy() - employmentCabinets -= src + GLOB.employmentCabinets -= src return ..() /obj/structure/filingcabinet/employment/proc/fillCurrent() //This proc fills the cabinet with the current crew. - for(var/record in data_core.locked) + for(var/record in GLOB.data_core.locked) var/datum/data/record/G = record if(!G) continue diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 46376c1828d..57bdc94b08c 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -677,10 +677,10 @@ to_chat(H, "You feel surrounded by sadness. Sadness... and HONKS!") H.makeCluwne() else if(myeffect == "Demote") - event_announcement.Announce("[target.real_name] is hereby demoted to the rank of Civilian. Process this demotion immediately. Failure to comply with these orders is grounds for termination.","CC Demotion Order") + GLOB.event_announcement.Announce("[target.real_name] is hereby demoted to the rank of Civilian. Process this demotion immediately. Failure to comply with these orders is grounds for termination.","CC Demotion Order") else if(myeffect == "Demote with Bot") - event_announcement.Announce("[target.real_name] is hereby demoted to the rank of Civilian. Process this demotion immediately. Failure to comply with these orders is grounds for termination.","CC Demotion Order") - for(var/datum/data/record/R in sortRecord(data_core.security)) + GLOB.event_announcement.Announce("[target.real_name] is hereby demoted to the rank of Civilian. Process this demotion immediately. Failure to comply with these orders is grounds for termination.","CC Demotion Order") + for(var/datum/data/record/R in sortRecord(GLOB.data_core.security)) if(R.fields["name"] == target.real_name) R.fields["criminal"] = "*Arrest*" update_all_mob_security_hud() @@ -689,7 +689,7 @@ new /obj/effect/portal(T) new /mob/living/simple_animal/bot/secbot(T) else if(myeffect == "Revoke Fax Access") - fax_blacklist += target.real_name + GLOB.fax_blacklist += target.real_name if(fax) fax.authenticated = 0 else if(myeffect == "Angry Fax Machine") diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index 0954127b00a..aa1fe064626 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -64,14 +64,14 @@ if(toner <= 0) break - if(copier_items_printed >= copier_max_items) //global vars defined in misc.dm + if(GLOB.copier_items_printed >= GLOB.copier_max_items) //global vars defined in misc.dm if(prob(10)) visible_message("The printer screen reads \"PC LOAD LETTER\".") else visible_message("The printer screen reads \"PHOTOCOPIER NETWORK OFFLINE, PLEASE CONTACT SYSTEM ADMINISTRATOR\".") - if(!copier_items_printed_logged) - message_admins("Photocopier cap of [copier_max_items] papers reached, all photocopiers are now disabled. This may be the cause of any lag.") - copier_items_printed_logged = TRUE + if(!GLOB.copier_items_printed_logged) + message_admins("Photocopier cap of [GLOB.copier_max_items] papers reached, all photocopiers are now disabled. This may be the cause of any lag.") + GLOB.copier_items_printed_logged = TRUE break if(emag_cooldown > world.time) @@ -98,7 +98,7 @@ else to_chat(usr, "\The [copyitem] can't be copied by \the [src].") break - copier_items_printed++ + GLOB.copier_items_printed++ use_power(active_power_usage) updateUsrDialog() else if(href_list["remove"]) @@ -184,7 +184,7 @@ /obj/machinery/photocopier/wrench_act(mob/user, obj/item/I) . = TRUE default_unfasten_wrench(user, I) - + /obj/machinery/photocopier/proc/copy(var/obj/item/paper/copy) var/obj/item/paper/c = new /obj/item/paper (loc) c.info = copy.info diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index 159b224e384..30e8cbd9541 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -179,7 +179,7 @@ qdel(C) -var/list/SpookyGhosts = list("ghost","shade","shade2","ghost-narsie","horror","shadow","ghostian2") +GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","horror","shadow","ghostian2")) /obj/item/camera/spooky name = "camera obscura" @@ -240,7 +240,7 @@ var/list/SpookyGhosts = list("ghost","shade","shade2","ghost-narsie","horror","s if(O.following) continue if(user.mind && !(user.mind.assigned_role == "Chaplain")) - atoms.Add(image('icons/mob/mob.dmi', O.loc, pick(SpookyGhosts), 4, SOUTH)) + atoms.Add(image('icons/mob/mob.dmi', O.loc, pick(GLOB.SpookyGhosts), 4, SOUTH)) else atoms.Add(image('icons/mob/mob.dmi', O.loc, "ghost", 4, SOUTH)) else//its not a ghost @@ -544,7 +544,7 @@ var/list/SpookyGhosts = list("ghost","shade","shade2","ghost-narsie","horror","s src.icon_state = icon_on camera = new /obj/machinery/camera(src) camera.network = list("news") - cameranet.removeCamera(camera) + GLOB.cameranet.removeCamera(camera) camera.c_tag = user.name to_chat(user, "You switch the camera [on ? "on" : "off"].") diff --git a/code/modules/pda/PDA.dm b/code/modules/pda/PDA.dm index 4030924a8ac..f17666af19d 100755 --- a/code/modules/pda/PDA.dm +++ b/code/modules/pda/PDA.dm @@ -1,7 +1,7 @@ //The advanced pea-green monochrome lcd of tomorrow. -var/global/list/obj/item/pda/PDAs = list() +GLOBAL_LIST_EMPTY(PDAs) /obj/item/pda @@ -66,8 +66,8 @@ var/global/list/obj/item/pda/PDAs = list() */ /obj/item/pda/Initialize(mapload) . = ..() - PDAs += src - PDAs = sortAtom(PDAs) + GLOB.PDAs += src + GLOB.PDAs = sortAtom(GLOB.PDAs) update_programs() if(default_cartridge) cartridge = new default_cartridge(src) @@ -101,7 +101,7 @@ var/global/list/obj/item/pda/PDAs = list() if((!istype(over_object, /obj/screen)) && can_use()) return attack_self(M) -/obj/item/pda/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = inventory_state) +/obj/item/pda/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = GLOB.inventory_state) ui_tick++ var/datum/nanoui/old_ui = SSnanoui.get_open_ui(user, src, "main") var/auto_update = 1 @@ -131,7 +131,7 @@ var/global/list/obj/item/pda/PDAs = list() // auto update every Master Controller tick ui.set_auto_update(auto_update) -/obj/item/pda/ui_data(mob/user, ui_key = "main", datum/topic_state/state = inventory_state) +/obj/item/pda/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.inventory_state) var/data[0] data["owner"] = owner // Who is your daddy... @@ -467,7 +467,7 @@ var/global/list/obj/item/pda/PDAs = list() return /obj/item/pda/Destroy() - PDAs -= src + GLOB.PDAs -= src var/T = get_turf(loc) if(id) id.forceMove(T) diff --git a/code/modules/pda/cart_apps.dm b/code/modules/pda/cart_apps.dm index 4ca5b4af427..6c03241a096 100644 --- a/code/modules/pda/cart_apps.dm +++ b/code/modules/pda/cart_apps.dm @@ -103,12 +103,12 @@ "poweravail" = powmonitor.powernet.avail, "powerload" = num2text(powmonitor.powernet.viewload, 10), "powerdemand" = powmonitor.powernet.load, - "apcs" = apc_repository.apc_data(powmonitor.powernet)) + "apcs" = GLOB.apc_repository.apc_data(powmonitor.powernet)) has_back = 1 else data["records"] = list( "powerconnected" = 0, - "powermonitors" = powermonitor_repository.powermonitor_data()) + "powermonitors" = GLOB.powermonitor_repository.powermonitor_data()) has_back = 0 /datum/data/pda/app/power/Topic(href, list/href_list) @@ -127,12 +127,12 @@ /datum/data/pda/app/crew_records/update_ui(mob/user as mob, list/data) var/list/records[0] - if(general_records && (general_records in data_core.general)) + if(general_records && (general_records in GLOB.data_core.general)) data["records"] = records records["general"] = general_records.fields return records else - for(var/A in sortRecord(data_core.general)) + for(var/A in sortRecord(GLOB.data_core.general)) var/datum/data/record/R = A if(R) records += list(list(Name = R.fields["name"], "ref" = "\ref[R]")) @@ -143,7 +143,7 @@ switch(href_list["choice"]) if("Records") var/datum/data/record/R = locate(href_list["target"]) - if(R && (R in data_core.general)) + if(R && (R in GLOB.data_core.general)) load_records(R) if("Back") general_records = null @@ -166,14 +166,14 @@ if(!records) return - if(medical_records && (medical_records in data_core.medical)) + if(medical_records && (medical_records in GLOB.data_core.medical)) records["medical"] = medical_records.fields return records /datum/data/pda/app/crew_records/medical/load_records(datum/data/record/R) ..(R) - for(var/A in data_core.medical) + for(var/A in GLOB.data_core.medical) var/datum/data/record/E = A if(E && (E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"])) medical_records = E @@ -192,14 +192,14 @@ if(!records) return - if(security_records && (security_records in data_core.security)) + if(security_records && (security_records in GLOB.data_core.security)) records["security"] = security_records.fields return records /datum/data/pda/app/crew_records/security/load_records(datum/data/record/R) ..(R) - for(var/A in data_core.security) + for(var/A in GLOB.data_core.security) var/datum/data/record/E = A if(E && (E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"])) security_records = E diff --git a/code/modules/pda/core_apps.dm b/code/modules/pda/core_apps.dm index cd86e620970..41f9f994420 100644 --- a/code/modules/pda/core_apps.dm +++ b/code/modules/pda/core_apps.dm @@ -71,8 +71,8 @@ update = PDA_APP_UPDATE_SLOW /datum/data/pda/app/manifest/update_ui(mob/user as mob, list/data) - data_core.get_manifest_json() - data["manifest"] = PDA_Manifest + GLOB.data_core.get_manifest_json() + data["manifest"] = GLOB.PDA_Manifest /datum/data/pda/app/manifest/Topic(href, list/href_list) diff --git a/code/modules/pda/messenger.dm b/code/modules/pda/messenger.dm index ab97c956d85..066db440cc8 100644 --- a/code/modules/pda/messenger.dm +++ b/code/modules/pda/messenger.dm @@ -39,7 +39,7 @@ else var/convopdas[0] var/pdas[0] - for(var/A in PDAs) + for(var/A in GLOB.PDAs) var/obj/item/pda/P = A var/datum/data/pda/app/messenger/PM = P.find_program(/datum/data/pda/app/messenger) @@ -143,8 +143,8 @@ // check if telecomms I/O route 1459 is stable //var/telecomms_intact = telecomms_process(P.owner, owner, t) var/obj/machinery/message_server/useMS = null - if(message_servers) - for(var/A in message_servers) + if(GLOB.message_servers) + for(var/A in GLOB.message_servers) var/obj/machinery/message_server/MS = A //PDAs are now dependent on the Message Server. if(MS.active) @@ -201,7 +201,7 @@ to_chat(usr, "Turn on your receiver in order to send messages.") return - for(var/A in PDAs) + for(var/A in GLOB.PDAs) var/obj/item/pda/P = A var/datum/data/pda/app/messenger/PM = P.find_program(/datum/data/pda/app/messenger) diff --git a/code/modules/pda/radio.dm b/code/modules/pda/radio.dm index 3a2f4901caa..f214e705268 100644 --- a/code/modules/pda/radio.dm +++ b/code/modules/pda/radio.dm @@ -197,7 +197,7 @@ var/time = time2text(world.realtime,"hh:mm:ss") var/turf/T = get_turf(src) - lastsignalers.Add("[time] : [usr.key] used [src] @ location ([T.x],[T.y],[T.z]) : [format_frequency(frequency)]/[code]") + GLOB.lastsignalers.Add("[time] : [usr.key] used [src] @ location ([T.x],[T.y],[T.z]) : [format_frequency(frequency)]/[code]") var/datum/signal/signal = new signal.source = src diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 3757d7e8cd1..ca2f1e13ff7 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -765,11 +765,11 @@ /obj/machinery/power/apc/proc/get_malf_status(mob/living/silicon/ai/malf) if(!istype(malf)) return FALSE - + // Only if they're a traitor OR they have the malf picker from the combat module if(!malf.mind.has_antag_datum(/datum/antagonist/traitor) && !malf.malf_picker) return FALSE - + if(malfai == (malf.parent || malf)) if(occupier == malf) return APC_MALF_SHUNTED_HERE @@ -793,7 +793,7 @@ // Auto update every Master Controller tick ui.set_auto_update(1) -/obj/machinery/power/apc/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/power/apc/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["locked"] = is_locked(user) data["isOperating"] = operating @@ -1079,7 +1079,7 @@ qdel(occupier) if(seclevel2num(get_security_level()) == SEC_LEVEL_DELTA) for(var/obj/item/pinpointer/point in GLOB.pinpointer_list) - for(var/mob/living/silicon/ai/A in ai_list) + for(var/mob/living/silicon/ai/A in GLOB.ai_list) if((A.stat != DEAD) && A.nuking) point.the_disk = A //The pinpointer tracks the AI back into its core. else diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm index a5b83d8472c..cf04c8a66f8 100644 --- a/code/modules/power/gravitygenerator.dm +++ b/code/modules/power/gravitygenerator.dm @@ -3,7 +3,7 @@ // Gravity Generator // -var/list/gravity_generators = list() // We will keep track of this by adding new gravity generators to the list, and keying it with the z level. +GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding new gravity generators to the list, and keying it with the z level. #define GRAV_POWER_IDLE 0 #define GRAV_POWER_UP 1 @@ -388,19 +388,19 @@ var/list/gravity_generators = list() // We will keep track of this by adding new var/turf/T = get_turf(src) if(!T) return 0 - if(gravity_generators["[T.z]"]) - return length(gravity_generators["[T.z]"]) + if(GLOB.gravity_generators["[T.z]"]) + return length(GLOB.gravity_generators["[T.z]"]) return 0 /obj/machinery/gravity_generator/main/proc/update_list() var/turf/T = get_turf(src.loc) if(T) - if(!gravity_generators["[T.z]"]) - gravity_generators["[T.z]"] = list() + if(!GLOB.gravity_generators["[T.z]"]) + GLOB.gravity_generators["[T.z]"] = list() if(on) - gravity_generators["[T.z]"] |= src + GLOB.gravity_generators["[T.z]"] |= src else - gravity_generators["[T.z]"] -= src + GLOB.gravity_generators["[T.z]"] -= src // Misc diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm index 54b81cb9272..b534fbbfda4 100644 --- a/code/modules/power/port_gen.dm +++ b/code/modules/power/port_gen.dm @@ -333,7 +333,7 @@ ui.open() ui.set_auto_update(1) -/obj/machinery/power/port_gen/pacman/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/power/port_gen/pacman/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["active"] = active diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index 7b43291b5a2..c74f9cc0007 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -162,7 +162,7 @@ var/cdir var/turf/T - for(var/card in cardinal) + for(var/card in GLOB.cardinal) T = get_step(loc,card) cdir = get_dir(T,loc) @@ -182,7 +182,7 @@ var/cdir var/turf/T - for(var/card in cardinal) + for(var/card in GLOB.cardinal) T = get_step(loc,card) cdir = get_dir(T,loc) diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm index 870a42a1f7c..e6a933c4458 100644 --- a/code/modules/power/singularity/collector.dm +++ b/code/modules/power/singularity/collector.dm @@ -1,4 +1,4 @@ -var/global/list/rad_collectors = list() +GLOBAL_LIST_EMPTY(rad_collectors) /obj/machinery/power/rad_collector name = "Radiation Collector Array" @@ -19,10 +19,10 @@ var/global/list/rad_collectors = list() /obj/machinery/power/rad_collector/Initialize(mapload) . = ..() - rad_collectors += src + GLOB.rad_collectors += src /obj/machinery/power/rad_collector/Destroy() - rad_collectors -= src + GLOB.rad_collectors -= src return ..() /obj/machinery/power/rad_collector/process() diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index fcc37bf943b..61e1d786490 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -113,7 +113,7 @@ if(allowed_size >= STAGE_TWO) // Start moving even before we reach "true" stage two. // If we are stage one and are sufficiently energetic to be allowed to 2, - // it might mean we are stuck in a corner somewere. So move around to try to expand. + // it might mean we are stuck in a corner somewere. So move around to try to expand. move() if(current_size >= STAGE_TWO) pulse() @@ -287,7 +287,7 @@ if(!move_self) return 0 - var/movement_dir = pick(alldirs - last_failed_movement) + var/movement_dir = pick(GLOB.alldirs - last_failed_movement) if(force_move) movement_dir = force_move @@ -431,7 +431,7 @@ /obj/singularity/proc/pulse() - for(var/obj/machinery/power/rad_collector/R in rad_collectors) + for(var/obj/machinery/power/rad_collector/R in GLOB.rad_collectors) if(R.z == z && get_dist(R, src) <= 15) // Better than using orange() every process R.receive_pulse(energy) diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 05451033703..f2e8fa53a8d 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -51,7 +51,7 @@ RefreshParts() dir_loop: - for(var/d in cardinal) + for(var/d in GLOB.cardinal) var/turf/T = get_step(src, d) for(var/obj/machinery/power/terminal/term in T) if(term && term.dir == turn(d, 180)) @@ -371,7 +371,7 @@ // auto update every Master Controller tick ui.set_auto_update(1) -/obj/machinery/power/smes/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/power/smes/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["nameTag"] = name_tag diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index 3a1f13bd10e..945cc286b31 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -379,7 +379,7 @@ ui.open() ui.set_auto_update(1) -/obj/machinery/power/solar_control/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/power/solar_control/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["generated"] = round(lastgen) diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index 463121a7bdf..f8c23a696fa 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -344,7 +344,7 @@ ui.open() ui.set_auto_update(1) -/obj/machinery/power/supermatter_shard/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/power/supermatter_shard/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["integrity_percentage"] = round(get_integrity()) @@ -366,7 +366,7 @@ return data /obj/machinery/power/supermatter_shard/proc/transfer_energy() - for(var/obj/machinery/power/rad_collector/R in rad_collectors) + for(var/obj/machinery/power/rad_collector/R in GLOB.rad_collectors) if(get_dist(R, src) <= 15) // Better than using orange() every process R.receive_pulse(power/10) return diff --git a/code/modules/power/tesla/energy_ball.dm b/code/modules/power/tesla/energy_ball.dm index a3a8bb42ec6..60b2a30dc34 100644 --- a/code/modules/power/tesla/energy_ball.dm +++ b/code/modules/power/tesla/energy_ball.dm @@ -67,7 +67,7 @@ //we face the last thing we zapped, so this lets us favor that direction a bit var/first_move = dir for(var/i in 0 to move_amount) - var/move_dir = pick(alldirs + first_move) //give the first move direction a bit of favoring. + var/move_dir = pick(GLOB.alldirs + first_move) //give the first move direction a bit of favoring. if(target && prob(60)) move_dir = get_dir(src,target) var/turf/T = get_step(src, move_dir) diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm index f8b13b47874..8536a0195e3 100644 --- a/code/modules/projectiles/ammunition.dm +++ b/code/modules/projectiles/ammunition.dm @@ -25,7 +25,7 @@ BB = new projectile_type(src) pixel_x = rand(-10.0, 10) pixel_y = rand(-10.0, 10) - dir = pick(alldirs) + dir = pick(GLOB.alldirs) update_icon() /obj/item/ammo_casing/update_icon() diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm index 01503fb16b7..d15e6c1375d 100644 --- a/code/modules/projectiles/projectile/magic.dm +++ b/code/modules/projectiles/projectile/magic.dm @@ -283,7 +283,7 @@ /obj/item/projectile/magic/animate/Bump(var/atom/change) ..() - if(istype(change, /obj/item) || istype(change, /obj/structure) && !is_type_in_list(change, protected_objects)) + if(istype(change, /obj/item) || istype(change, /obj/structure) && !is_type_in_list(change, GLOB.protected_objects)) if(istype(change, /obj/structure/closet/statue)) for(var/mob/living/carbon/human/H in change.contents) var/mob/living/simple_animal/hostile/statue/S = new /mob/living/simple_animal/hostile/statue(change.loc, firer) diff --git a/code/modules/reagents/chem_splash.dm b/code/modules/reagents/chem_splash.dm index 6ad51779965..9b15b6dca5d 100644 --- a/code/modules/reagents/chem_splash.dm +++ b/code/modules/reagents/chem_splash.dm @@ -41,7 +41,7 @@ for(var/turf/T in (orange(i, epicenter) - orange(i-1, epicenter))) turflist |= T for(var/turf/T in turflist) - if( !(get_dir(T,epicenter) in cardinal) && (abs(T.x - epicenter.x) == abs(T.y - epicenter.y) )) + if( !(get_dir(T,epicenter) in GLOB.cardinal) && (abs(T.x - epicenter.x) == abs(T.y - epicenter.y) )) turflist.Remove(T) turflist.Add(T) // we move the purely diagonal turfs to the end of the list. for(var/turf/T in turflist) @@ -51,7 +51,7 @@ var/turf/NT = thing if(!(NT in accessible)) continue - if(!(get_dir(T,NT) in cardinal)) + if(!(get_dir(T,NT) in GLOB.cardinal)) continue accessible[T] = 1 break diff --git a/code/modules/reagents/chemistry/colors.dm b/code/modules/reagents/chemistry/colors.dm index e9ced2ecfbe..f5f4f252a01 100644 --- a/code/modules/reagents/chemistry/colors.dm +++ b/code/modules/reagents/chemistry/colors.dm @@ -2,7 +2,7 @@ * Returns: * #RRGGBB(AA) on success, null on failure */ -var/list/random_color_list = list("#00aedb","#a200ff","#f47835","#d41243","#d11141","#00b159","#00aedb","#f37735","#ffc425","#008744","#0057e7","#d62d20","#ffa700") +GLOBAL_LIST_INIT(random_color_list, list("#00aedb","#a200ff","#f47835","#d41243","#d11141","#00b159","#00aedb","#f37735","#ffc425","#008744","#0057e7","#d62d20","#ffa700")) /proc/mix_color_from_reagents(const/list/reagent_list) if(!istype(reagent_list)) diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index cca429276dd..2de854eff88 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -155,7 +155,7 @@ // open the new ui window ui.open() -/obj/machinery/chem_dispenser/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/chem_dispenser/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["amount"] = amount diff --git a/code/modules/reagents/chemistry/machinery/chem_heater.dm b/code/modules/reagents/chemistry/machinery/chem_heater.dm index 169b668250c..79fc47d61a8 100644 --- a/code/modules/reagents/chemistry/machinery/chem_heater.dm +++ b/code/modules/reagents/chemistry/machinery/chem_heater.dm @@ -140,7 +140,7 @@ ui = new(user, src, ui_key, "chem_heater.tmpl", "ChemHeater", 350, 270) ui.open() -/obj/machinery/chem_heater/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/chem_heater/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["targetTemp"] = desired_temp diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index 39d491bf192..435a253bed5 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -445,7 +445,7 @@ ui = new(user, src, ui_key, "chem_master.tmpl", name, 575, 500) ui.open() -/obj/machinery/chem_master/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/chem_master/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["condi"] = condi diff --git a/code/modules/reagents/chemistry/machinery/pandemic.dm b/code/modules/reagents/chemistry/machinery/pandemic.dm index ced53381c9f..c748df2a8e4 100644 --- a/code/modules/reagents/chemistry/machinery/pandemic.dm +++ b/code/modules/reagents/chemistry/machinery/pandemic.dm @@ -84,8 +84,8 @@ var/vaccine_name = "Unknown" if(!ispath(vaccine_type)) - if(archive_diseases[path]) - var/datum/disease/D = archive_diseases[path] + if(GLOB.archive_diseases[path]) + var/datum/disease/D = GLOB.archive_diseases[path] if(D) vaccine_name = D.name vaccine_type = path @@ -109,11 +109,11 @@ var/datum/disease/D = null if(!ispath(type)) D = GetVirusByIndex(text2num(href_list["create_virus_culture"])) - var/datum/disease/advance/A = archive_diseases[D.GetDiseaseID()] + var/datum/disease/advance/A = GLOB.archive_diseases[D.GetDiseaseID()] if(A) D = new A.type(0, A) else if(type) - if(type in diseases) // Make sure this is a disease + if(type in GLOB.diseases) // Make sure this is a disease D = new type(0, null) if(!D) return @@ -154,15 +154,15 @@ if(..()) return var/id = GetVirusTypeByIndex(text2num(href_list["name_disease"])) - if(archive_diseases[id]) - var/datum/disease/advance/A = archive_diseases[id] + if(GLOB.archive_diseases[id]) + var/datum/disease/advance/A = GLOB.archive_diseases[id] A.AssignName(new_name) for(var/datum/disease/advance/AD in GLOB.active_diseases) AD.Refresh() updateUsrDialog() else if(href_list["print_form"]) var/datum/disease/D = GetVirusByIndex(text2num(href_list["print_form"])) - D = archive_diseases[D.GetDiseaseID()]//We know it's advanced no need to check + D = GLOB.archive_diseases[D.GetDiseaseID()]//We know it's advanced no need to check print_form(D, usr) @@ -180,7 +180,7 @@ //Prints a nice virus release form. Props to Urbanliner for the layout /obj/machinery/computer/pandemic/proc/print_form(var/datum/disease/advance/D, mob/living/user) - D = archive_diseases[D.GetDiseaseID()] + D = GLOB.archive_diseases[D.GetDiseaseID()] if(!(printing) && D) var/reason = input(user,"Enter a reason for the release", "Write", null) as message reason += "" @@ -260,7 +260,7 @@ if(istype(D, /datum/disease/advance)) var/datum/disease/advance/A = D - D = archive_diseases[A.GetDiseaseID()] + D = GLOB.archive_diseases[A.GetDiseaseID()] if(D) if(D.name == "Unknown") dat += "Name Disease
    " @@ -300,7 +300,7 @@ var/disease_name = "Unknown" if(!ispath(type)) - var/datum/disease/advance/A = archive_diseases[type] + var/datum/disease/advance/A = GLOB.archive_diseases[type] if(A) disease_name = A.name else diff --git a/code/modules/reagents/chemistry/reagents/drugs.dm b/code/modules/reagents/chemistry/reagents/drugs.dm index a9f5d8a9cb5..10cd5b2acce 100644 --- a/code/modules/reagents/chemistry/reagents/drugs.dm +++ b/code/modules/reagents/chemistry/reagents/drugs.dm @@ -9,7 +9,7 @@ /datum/reagent/lithium/on_mob_life(mob/living/M) if(isturf(M.loc) && !istype(M.loc, /turf/space)) if(M.canmove && !M.restrained()) - step(M, pick(cardinal)) + step(M, pick(GLOB.cardinal)) if(prob(5)) M.emote(pick("twitch","drool","moan")) return ..() @@ -45,7 +45,7 @@ update_flags |= M.Druggy(15, FALSE) if(isturf(M.loc) && !istype(M.loc, /turf/space)) if(M.canmove && !M.restrained()) - step(M, pick(cardinal)) + step(M, pick(GLOB.cardinal)) if(prob(7)) M.emote(pick("twitch","drool","moan","giggle")) return ..() | update_flags diff --git a/code/modules/reagents/chemistry/reagents/misc.dm b/code/modules/reagents/chemistry/reagents/misc.dm index eb6be801434..d84ed59e6de 100644 --- a/code/modules/reagents/chemistry/reagents/misc.dm +++ b/code/modules/reagents/chemistry/reagents/misc.dm @@ -310,14 +310,14 @@ /datum/reagent/colorful_reagent/reaction_mob(mob/living/simple_animal/M, method=REAGENT_TOUCH, volume) if(isanimal(M)) - M.color = pick(random_color_list) + M.color = pick(GLOB.random_color_list) ..() /datum/reagent/colorful_reagent/reaction_obj(obj/O, volume) - O.color = pick(random_color_list) + O.color = pick(GLOB.random_color_list) /datum/reagent/colorful_reagent/reaction_turf(turf/T, volume) - T.color = pick(random_color_list) + T.color = pick(GLOB.random_color_list) /datum/reagent/hair_dye name = "Quantum Hair Dye" diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 906d1136ebc..e16ce4a0824 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -269,7 +269,7 @@ ui.open() ui.set_auto_update(1) -/obj/machinery/disposal/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/disposal/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] var/pressure = Clamp(100* air_contents.return_pressure() / (SEND_PRESSURE), 0, 100) @@ -837,7 +837,7 @@ // remains : set to leave broken pipe pieces in place /obj/structure/disposalpipe/proc/broken(remains = 0) if(remains) - for(var/D in cardinal) + for(var/D in GLOB.cardinal) if(D & dpdir) var/obj/structure/disposalpipe/broken/P = new(src.loc) P.setDir(D) @@ -1370,7 +1370,7 @@ if(direction) dirs = list( direction, turn(direction, -45), turn(direction, 45)) else - dirs = alldirs.Copy() + dirs = GLOB.alldirs.Copy() src.streak(dirs) @@ -1379,6 +1379,6 @@ if(direction) dirs = list( direction, turn(direction, -45), turn(direction, 45)) else - dirs = alldirs.Copy() + dirs = GLOB.alldirs.Copy() src.streak(dirs) diff --git a/code/modules/research/message_server.dm b/code/modules/research/message_server.dm index 2a0e201ac54..22b18534dbc 100644 --- a/code/modules/research/message_server.dm +++ b/code/modules/research/message_server.dm @@ -1,4 +1,4 @@ -var/global/list/obj/machinery/message_server/message_servers = list() +GLOBAL_LIST_EMPTY(message_servers) /datum/data_pda_msg var/recipient = "Unspecified" //name of the person @@ -60,14 +60,14 @@ var/global/list/obj/machinery/message_server/message_servers = list() var/decryptkey = "password" /obj/machinery/message_server/New() - message_servers += src + GLOB.message_servers += src decryptkey = GenerateKey() send_pda_message("System Administrator", "system", "This is an automated message. The messaging system is functioning correctly.") ..() return /obj/machinery/message_server/Destroy() - message_servers -= src + GLOB.message_servers -= src return ..() /obj/machinery/message_server/process() @@ -91,7 +91,7 @@ var/global/list/obj/machinery/message_server/message_servers = list() authmsg += "[id_auth]
    " if(stamp) authmsg += "[stamp]
    " - for(var/obj/machinery/requests_console/Console in allConsoles) + for(var/obj/machinery/requests_console/Console in GLOB.allRequestConsoles) if(ckey(Console.department) == ckey(recipient)) if(Console.inoperable()) Console.message_log += "Message lost due to console failure.
    Please contact [station_name()] system adminsitrator or AI for technical assistance.
    " @@ -190,7 +190,7 @@ var/global/list/obj/machinery/message_server/message_servers = list() /datum/feedback_variable/proc/get_parsed() return list(variable,value,details) -var/obj/machinery/blackbox_recorder/blackbox +GLOBAL_DATUM(blackbox, /obj/machinery/blackbox_recorder) //TODO: kill whoever designed this cancer /obj/machinery/blackbox_recorder @@ -222,15 +222,15 @@ var/obj/machinery/blackbox_recorder/blackbox //Only one can exsist in the world! /obj/machinery/blackbox_recorder/New() - if(blackbox) - if(istype(blackbox,/obj/machinery/blackbox_recorder)) + if(GLOB.blackbox) + if(istype(GLOB.blackbox,/obj/machinery/blackbox_recorder)) qdel(src) - blackbox = src + GLOB.blackbox = src /obj/machinery/blackbox_recorder/Destroy() var/turf/T = locate(1,1,2) if(T) - blackbox = null + GLOB.blackbox = null var/obj/machinery/blackbox_recorder/BR = new/obj/machinery/blackbox_recorder(T) BR.msg_common = msg_common BR.msg_science = msg_science @@ -247,8 +247,8 @@ var/obj/machinery/blackbox_recorder/blackbox BR.feedback = feedback BR.messages = messages BR.messages_admin = messages_admin - if(blackbox != BR) - blackbox = BR + if(GLOB.blackbox != BR) + GLOB.blackbox = BR return ..() /obj/machinery/blackbox_recorder/proc/find_feedback_datum(var/variable) @@ -301,10 +301,10 @@ var/obj/machinery/blackbox_recorder/blackbox round_end_data_gathering() //round_end time logging and some other data processing establish_db_connection() - if(!dbcon.IsConnected()) return + if(!GLOB.dbcon.IsConnected()) return var/round_id - var/DBQuery/query = dbcon.NewQuery("SELECT MAX(round_id) AS round_id FROM [format_table_name("feedback")]") + var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT MAX(round_id) AS round_id FROM [format_table_name("feedback")]") query.Execute() while(query.NextRow()) round_id = query.item[1] @@ -315,7 +315,7 @@ var/obj/machinery/blackbox_recorder/blackbox for(var/datum/feedback_variable/FV in feedback) var/sql = "INSERT INTO [format_table_name("feedback")] VALUES (null, Now(), [round_id], \"[FV.get_variable()]\", [FV.get_value()], \"[FV.get_details()]\")" - var/DBQuery/query_insert = dbcon.NewQuery(sql) + var/DBQuery/query_insert = GLOB.dbcon.NewQuery(sql) query_insert.Execute() /obj/machinery/blackbox_recorder/vv_edit_var(var_name, var_value) @@ -323,57 +323,57 @@ var/obj/machinery/blackbox_recorder/blackbox proc/feedback_set(var/variable,var/value) - if(!blackbox) return + if(!GLOB.blackbox) return variable = sanitizeSQL(variable) - var/datum/feedback_variable/FV = blackbox.find_feedback_datum(variable) + var/datum/feedback_variable/FV = GLOB.blackbox.find_feedback_datum(variable) if(!FV) return FV.set_value(value) proc/feedback_inc(var/variable,var/value) - if(!blackbox) return + if(!GLOB.blackbox) return variable = sanitizeSQL(variable) - var/datum/feedback_variable/FV = blackbox.find_feedback_datum(variable) + var/datum/feedback_variable/FV = GLOB.blackbox.find_feedback_datum(variable) if(!FV) return FV.inc(value) proc/feedback_dec(var/variable,var/value) - if(!blackbox) return + if(!GLOB.blackbox) return variable = sanitizeSQL(variable) - var/datum/feedback_variable/FV = blackbox.find_feedback_datum(variable) + var/datum/feedback_variable/FV = GLOB.blackbox.find_feedback_datum(variable) if(!FV) return FV.dec(value) proc/feedback_set_details(var/variable,var/details) - if(!blackbox) return + if(!GLOB.blackbox) return variable = sanitizeSQL(variable) details = sanitizeSQL(details) - var/datum/feedback_variable/FV = blackbox.find_feedback_datum(variable) + var/datum/feedback_variable/FV = GLOB.blackbox.find_feedback_datum(variable) if(!FV) return FV.set_details(details) proc/feedback_add_details(var/variable,var/details) - if(!blackbox) return + if(!GLOB.blackbox) return variable = sanitizeSQL(variable) details = sanitizeSQL(details) - var/datum/feedback_variable/FV = blackbox.find_feedback_datum(variable) + var/datum/feedback_variable/FV = GLOB.blackbox.find_feedback_datum(variable) if(!FV) return diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index d4132bf3f4b..d7bf071a8eb 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -645,7 +645,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, ui = new(user, src, ui_key, "r_n_d.tmpl", src.name, 800, 550) ui.open() -/obj/machinery/computer/rdconsole/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/rdconsole/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] files.RefreshResearch() diff --git a/code/modules/research/xenobiology/xenobio_camera.dm b/code/modules/research/xenobiology/xenobio_camera.dm index 746e0ece0e8..84f15745df6 100644 --- a/code/modules/research/xenobiology/xenobio_camera.dm +++ b/code/modules/research/xenobiology/xenobio_camera.dm @@ -188,7 +188,7 @@ var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control var/obj/machinery/computer/camera_advanced/xenobio/X = target - if(cameranet.checkTurfVis(remote_eye.loc)) + if(GLOB.cameranet.checkTurfVis(remote_eye.loc)) for(var/mob/living/simple_animal/slime/S in X.stored_slimes) S.forceMove(remote_eye.loc) S.visible_message("[S] warps in!") @@ -207,7 +207,7 @@ var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control var/obj/machinery/computer/camera_advanced/xenobio/X = target - if(cameranet.checkTurfVis(remote_eye.loc)) + if(GLOB.cameranet.checkTurfVis(remote_eye.loc)) for(var/mob/living/simple_animal/slime/S in remote_eye.loc) if(X.stored_slimes.len >= X.max_slimes) break @@ -231,7 +231,7 @@ var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control var/obj/machinery/computer/camera_advanced/xenobio/X = target - if(cameranet.checkTurfVis(remote_eye.loc)) + if(GLOB.cameranet.checkTurfVis(remote_eye.loc)) if(LAZYLEN(SSmobs.cubemonkeys) >= config.cubemonkeycap) to_chat(owner, "Bluespace harmonics prevent the spawning of more than [config.cubemonkeycap] monkeys on the station at one time!") return @@ -259,7 +259,7 @@ if(!recycler) to_chat(owner, "There is no connected monkey recycler. Use a multitool to link one.") return - if(cameranet.checkTurfVis(remote_eye.loc)) + if(GLOB.cameranet.checkTurfVis(remote_eye.loc)) for(var/mob/living/carbon/human/M in remote_eye.loc) if(issmall(M) && M.stat) M.visible_message("[M] vanishes as [M.p_theyre()] reclaimed for recycling!") @@ -279,7 +279,7 @@ var/mob/living/C = owner var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control - if(cameranet.checkTurfVis(remote_eye.loc)) + if(GLOB.cameranet.checkTurfVis(remote_eye.loc)) for(var/mob/living/simple_animal/slime/S in remote_eye.loc) slime_scan(S, C) else @@ -301,7 +301,7 @@ to_chat(owner, "No potion loaded.") return - if(cameranet.checkTurfVis(remote_eye.loc)) + if(GLOB.cameranet.checkTurfVis(remote_eye.loc)) for(var/mob/living/simple_animal/slime/S in remote_eye.loc) X.current_potion.attack(S, C) break @@ -357,7 +357,7 @@ // Scans slime /obj/machinery/computer/camera_advanced/xenobio/proc/XenoSlimeClickCtrl(mob/living/user, mob/living/simple_animal/slime/S) - if(!cameranet.checkTurfVis(S.loc)) + if(!GLOB.cameranet.checkTurfVis(S.loc)) to_chat(user, "Target is not near a camera. Cannot proceed.") return var/mob/living/C = user @@ -368,7 +368,7 @@ //Feeds a potion to slime /obj/machinery/computer/camera_advanced/xenobio/proc/XenoSlimeClickAlt(mob/living/user, mob/living/simple_animal/slime/S) - if(!cameranet.checkTurfVis(S.loc)) + if(!GLOB.cameranet.checkTurfVis(S.loc)) to_chat(user, "Target is not near a camera. Cannot proceed.") return var/mob/living/C = user @@ -383,7 +383,7 @@ //Picks up slime /obj/machinery/computer/camera_advanced/xenobio/proc/XenoSlimeClickShift(mob/living/user, mob/living/simple_animal/slime/S) - if(!cameranet.checkTurfVis(S.loc)) + if(!GLOB.cameranet.checkTurfVis(S.loc)) to_chat(user, "Target is not near a camera. Cannot proceed.") return var/mob/living/C = user @@ -405,7 +405,7 @@ //Place slimes /obj/machinery/computer/camera_advanced/xenobio/proc/XenoTurfClickShift(mob/living/user, turf/T) - if(!cameranet.checkTurfVis(T)) + if(!GLOB.cameranet.checkTurfVis(T)) to_chat(user, "Target is not near a camera. Cannot proceed.") return var/mob/living/C = user @@ -420,7 +420,7 @@ //Place monkey /obj/machinery/computer/camera_advanced/xenobio/proc/XenoTurfClickCtrl(mob/living/user, turf/T) - if(!cameranet.checkTurfVis(T)) + if(!GLOB.cameranet.checkTurfVis(T)) to_chat(user, "Target is not near a camera. Cannot proceed.") return var/mob/living/C = user @@ -438,7 +438,7 @@ //Pick up monkey /obj/machinery/computer/camera_advanced/xenobio/proc/XenoMonkeyClickCtrl(mob/living/user, mob/living/carbon/human/M) - if(!cameranet.checkTurfVis(M.loc)) + if(!GLOB.cameranet.checkTurfVis(M.loc)) to_chat(user, "Target is not near a camera. Cannot proceed.") return var/mob/living/C = user diff --git a/code/modules/response_team/ert.dm b/code/modules/response_team/ert.dm index 9c8d963fdcd..513344cc5a6 100644 --- a/code/modules/response_team/ert.dm +++ b/code/modules/response_team/ert.dm @@ -7,11 +7,11 @@ /datum/game_mode var/list/datum/mind/ert = list() -var/list/response_team_members = list() -var/responseteam_age = 21 // Minimum account age to play as an ERT member -var/datum/response_team/active_team = null -var/send_emergency_team = FALSE -var/ert_request_answered = FALSE +GLOBAL_LIST_EMPTY(response_team_members) +GLOBAL_VAR_INIT(responseteam_age, 21) // Minimum account age to play as an ERT member +GLOBAL_DATUM(active_team, /datum/response_team) +GLOBAL_VAR_INIT(send_emergency_team, FALSE) +GLOBAL_VAR_INIT(ert_request_answered, FALSE) /client/proc/response_team() set name = "Dispatch CentComm Response Team" @@ -29,7 +29,7 @@ var/ert_request_answered = FALSE to_chat(usr, "The round hasn't started yet!") return - if(send_emergency_team) + if(GLOB.send_emergency_team) to_chat(usr, "Central Command has already dispatched an emergency response team!") return @@ -38,7 +38,7 @@ var/ert_request_answered = FALSE /mob/dead/observer/proc/JoinResponseTeam() - if(!send_emergency_team) + if(!GLOB.send_emergency_team) to_chat(src, "No emergency response team is currently being sent.") return 0 @@ -46,7 +46,7 @@ var/ert_request_answered = FALSE to_chat(src, "You are jobbanned from playing on an emergency response team!") return 0 - var/player_age_check = check_client_age(client, responseteam_age) + var/player_age_check = check_client_age(client, GLOB.responseteam_age) if(player_age_check && config.use_age_restriction_for_antags) to_chat(src, "This role is not yet available to you. You need to wait another [player_age_check] days.") return 0 @@ -58,15 +58,15 @@ var/ert_request_answered = FALSE return 1 /proc/trigger_armed_response_team(datum/response_team/response_team_type, commander_slots, security_slots, medical_slots, engineering_slots, janitor_slots, paranormal_slots, cyborg_slots) - response_team_members = list() - active_team = response_team_type - active_team.setSlots(commander_slots, security_slots, medical_slots, engineering_slots, janitor_slots, paranormal_slots, cyborg_slots) + GLOB.response_team_members = list() + GLOB.active_team = response_team_type + GLOB.active_team.setSlots(commander_slots, security_slots, medical_slots, engineering_slots, janitor_slots, paranormal_slots, cyborg_slots) - send_emergency_team = TRUE - var/list/ert_candidates = shuffle(pollCandidates("Join the Emergency Response Team?",, responseteam_age, 600, 1, role_playtime_requirements[ROLE_ERT])) + GLOB.send_emergency_team = TRUE + var/list/ert_candidates = shuffle(pollCandidates("Join the Emergency Response Team?",, GLOB.responseteam_age, 600, 1, GLOB.role_playtime_requirements[ROLE_ERT])) if(!ert_candidates.len) - active_team.cannot_send_team() - send_emergency_team = FALSE + GLOB.active_team.cannot_send_team() + GLOB.send_emergency_team = FALSE return // Respawnable players get first dibs @@ -74,37 +74,37 @@ var/ert_request_answered = FALSE if(jobban_isbanned(M, ROLE_TRAITOR) || jobban_isbanned(M, "Security Officer") || jobban_isbanned(M, "Captain") || jobban_isbanned(M, "Cyborg")) continue if((M in GLOB.respawnable_list) && M.JoinResponseTeam()) - response_team_members |= M + GLOB.response_team_members |= M // If there's still open slots, non-respawnable players can fill them for(var/mob/dead/observer/M in (ert_candidates - GLOB.respawnable_list)) if(M.JoinResponseTeam()) - response_team_members |= M + GLOB.response_team_members |= M - if(!response_team_members.len) - active_team.cannot_send_team() - send_emergency_team = FALSE + if(!GLOB.response_team_members.len) + GLOB.active_team.cannot_send_team() + GLOB.send_emergency_team = FALSE return var/list/ert_gender_prefs = list() - for(var/mob/M in response_team_members) + for(var/mob/M in GLOB.response_team_members) ert_gender_prefs.Add(input_async(M, "Please select a gender (10 seconds):", list("Male", "Female"))) - addtimer(CALLBACK(GLOBAL_PROC, .proc/get_ert_role_prefs, response_team_members, ert_gender_prefs), 100) + addtimer(CALLBACK(GLOBAL_PROC, .proc/get_ert_role_prefs, GLOB.response_team_members, ert_gender_prefs), 100) -/proc/get_ert_role_prefs(list/response_team_members, list/ert_gender_prefs) +/proc/get_ert_role_prefs(list/response_team_members, list/ert_gender_prefs) // Why the FUCK is this variable the EXACT SAME as the global one var/list/ert_role_prefs = list() for(var/datum/async_input/A in ert_gender_prefs) A.close() for(var/mob/M in response_team_members) - ert_role_prefs.Add(input_ranked_async(M, "Please order ERT roles from most to least preferred (20 seconds):", active_team.get_slot_list())) + ert_role_prefs.Add(input_ranked_async(M, "Please order ERT roles from most to least preferred (20 seconds):", GLOB.active_team.get_slot_list())) addtimer(CALLBACK(GLOBAL_PROC, .proc/dispatch_response_team, response_team_members, ert_gender_prefs, ert_role_prefs), 200) /proc/dispatch_response_team(list/response_team_members, list/ert_gender_prefs, list/ert_role_prefs) var/spawn_index = 1 for(var/i = 1, i <= response_team_members.len, i++) - if(spawn_index > emergencyresponseteamspawn.len) + if(spawn_index > GLOB.emergencyresponseteamspawn.len) break - if(!active_team.get_slot_list().len) + if(!GLOB.active_team.get_slot_list().len) break var/gender_pref = ert_gender_prefs[i].result var/role_pref = ert_role_prefs[i].close() @@ -115,9 +115,9 @@ var/ert_request_answered = FALSE // Player was afk and did not select continue for(var/role in role_pref) - if(active_team.check_slot_available(role)) - var/mob/living/new_commando = M.client.create_response_team(gender_pref, role, emergencyresponseteamspawn[spawn_index]) - active_team.reduceSlots(role) + if(GLOB.active_team.check_slot_available(role)) + var/mob/living/new_commando = M.client.create_response_team(gender_pref, role, GLOB.emergencyresponseteamspawn[spawn_index]) + GLOB.active_team.reduceSlots(role) spawn_index++ if(!M || !new_commando) break @@ -125,17 +125,17 @@ var/ert_request_answered = FALSE new_commando.key = M.key new_commando.update_icons() break - send_emergency_team = FALSE + GLOB.send_emergency_team = FALSE - if(active_team.count) - active_team.announce_team() + if(GLOB.active_team.count) + GLOB.active_team.announce_team() return // Everyone who said yes was afk - active_team.cannot_send_team() + GLOB.active_team.cannot_send_team() /client/proc/create_response_team(new_gender, role, turf/spawn_location) if(role == "Cyborg") - var/cyborg_unlock = active_team.getCyborgUnlock() + var/cyborg_unlock = GLOB.active_team.getCyborgUnlock() var/mob/living/silicon/robot/ert/R = new /mob/living/silicon/robot/ert(spawn_location, cyborg_unlock) return R @@ -185,7 +185,7 @@ var/ert_request_answered = FALSE SSjobs.CreateMoneyAccount(M, role, null) - active_team.equip_officer(role, M) + GLOB.active_team.equip_officer(role, M) return M @@ -257,10 +257,10 @@ var/ert_request_answered = FALSE M.equipOutfit(command_outfit) /datum/response_team/proc/cannot_send_team() - event_announcement.Announce("[station_name()], we are unfortunately unable to send you an Emergency Response Team at this time.", "ERT Unavailable") + GLOB.event_announcement.Announce("[station_name()], we are unfortunately unable to send you an Emergency Response Team at this time.", "ERT Unavailable") /datum/response_team/proc/announce_team() - event_announcement.Announce("Attention, [station_name()]. We are sending a team of highly trained assistants to aid(?) you. Standby.", "ERT En-Route") + GLOB.event_announcement.Announce("Attention, [station_name()]. We are sending a team of highly trained assistants to aid(?) you. Standby.", "ERT En-Route") // -- AMBER TEAM -- @@ -273,7 +273,7 @@ var/ert_request_answered = FALSE paranormal_outfit = /datum/outfit/job/centcom/response_team/paranormal/amber /datum/response_team/amber/announce_team() - event_announcement.Announce("Attention, [station_name()]. We are sending a code AMBER light Emergency Response Team. Standby.", "ERT En-Route") + GLOB.event_announcement.Announce("Attention, [station_name()]. We are sending a code AMBER light Emergency Response Team. Standby.", "ERT En-Route") // -- RED TEAM -- @@ -286,7 +286,7 @@ var/ert_request_answered = FALSE paranormal_outfit = /datum/outfit/job/centcom/response_team/paranormal/red /datum/response_team/red/announce_team() - event_announcement.Announce("Attention, [station_name()]. We are sending a code RED Emergency Response Team. Standby.", "ERT En-Route") + GLOB.event_announcement.Announce("Attention, [station_name()]. We are sending a code RED Emergency Response Team. Standby.", "ERT En-Route") // -- GAMMA TEAM -- @@ -300,7 +300,7 @@ var/ert_request_answered = FALSE cyborg_unlock = 1 /datum/response_team/gamma/announce_team() - event_announcement.Announce("Attention, [station_name()]. We are sending a code GAMMA elite Emergency Response Team. Standby.", "ERT En-Route") + GLOB.event_announcement.Announce("Attention, [station_name()]. We are sending a code GAMMA elite Emergency Response Team. Standby.", "ERT En-Route") /datum/outfit/job/centcom/response_team name = "Response team" diff --git a/code/modules/ruins/lavalandruin_code/ash_walker_den.dm b/code/modules/ruins/lavalandruin_code/ash_walker_den.dm index c0b8e0f5555..62b2343f10a 100644 --- a/code/modules/ruins/lavalandruin_code/ash_walker_den.dm +++ b/code/modules/ruins/lavalandruin_code/ash_walker_den.dm @@ -25,7 +25,7 @@ STOP_PROCESSING(SSprocessing, src) /obj/structure/lavaland/ash_walker/deconstruct(disassembled) - new /obj/item/assembly/signaler/anomaly(get_step(loc, pick(alldirs))) + new /obj/item/assembly/signaler/anomaly(get_step(loc, pick(GLOB.alldirs))) new /obj/effect/collapse(loc) return ..() @@ -50,7 +50,7 @@ /obj/structure/lavaland/ash_walker/proc/spawn_mob() if(meat_counter >= ASH_WALKER_SPAWN_THRESHOLD) - new /obj/effect/mob_spawn/human/ash_walker(get_step(loc, pick(alldirs))) + new /obj/effect/mob_spawn/human/ash_walker(get_step(loc, pick(GLOB.alldirs))) visible_message("One of the eggs swells to an unnatural size and tumbles free. It's ready to hatch!") meat_counter -= ASH_WALKER_SPAWN_THRESHOLD diff --git a/code/modules/ruins/lavalandruin_code/sin_ruins.dm b/code/modules/ruins/lavalandruin_code/sin_ruins.dm index 82fbd410ea1..8e3876f7d2f 100644 --- a/code/modules/ruins/lavalandruin_code/sin_ruins.dm +++ b/code/modules/ruins/lavalandruin_code/sin_ruins.dm @@ -111,7 +111,7 @@ "Perfect. Much better! Now nobody will be able to resist yo-") var/turf/T = get_turf(user) - var/list/levels = space_manager.z_list.Copy() + var/list/levels = GLOB.space_manager.z_list.Copy() for(var/level in levels) if(!is_teleport_allowed(level)) levels -= level diff --git a/code/modules/security_levels/keycard authentication.dm b/code/modules/security_levels/keycard authentication.dm index 99a04205117..06ebfaa3374 100644 --- a/code/modules/security_levels/keycard authentication.dm +++ b/code/modules/security_levels/keycard authentication.dm @@ -78,7 +78,7 @@ ui = new(user, src, ui_key, "keycard_auth.tmpl", "Keycard Authentication Device UI", 540, 320) ui.open() -/obj/machinery/keycard_auth/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/keycard_auth/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["screen"] = screen data["event"] = event @@ -168,7 +168,7 @@ atom_say("All Emergency Response Teams are dispatched and can not be called at this time.") return atom_say("ERT request transmitted!") - command_announcer.autosay("ERT request transmitted. Reason: [ert_reason]", name) + GLOB.command_announcer.autosay("ERT request transmitted. Reason: [ert_reason]", name) print_centcom_report(ert_reason, station_time_timestamp() + " ERT Request") var/fullmin_count = 0 @@ -176,12 +176,12 @@ if(check_rights(R_EVENT, 0, C.mob)) fullmin_count++ if(fullmin_count) - ert_request_answered = TRUE + GLOB.ert_request_answered = TRUE ERT_Announce(ert_reason , event_triggered_by, 0) ert_reason = "Reason for ERT" feedback_inc("alert_keycard_auth_ert",1) spawn(3000) - if(!ert_request_answered) + if(!GLOB.ert_request_answered) ERT_Announce(ert_reason , event_triggered_by, 1) else trigger_armed_response_team(new /datum/response_team/amber) // No admins? No problem. Automatically send a code amber ERT. @@ -189,37 +189,37 @@ /obj/machinery/keycard_auth/proc/is_ert_blocked() return SSticker.mode && SSticker.mode.ert_disabled -var/global/maint_all_access = 0 -var/global/station_all_access = 0 +GLOBAL_VAR_INIT(maint_all_access, 0) +GLOBAL_VAR_INIT(station_all_access, 0) /proc/make_maint_all_access() for(var/area/maintenance/A in world) for(var/obj/machinery/door/airlock/D in A) D.emergency = 1 D.update_icon(0) - minor_announcement.Announce("Access restrictions on maintenance and external airlocks have been removed.") - maint_all_access = 1 + GLOB.minor_announcement.Announce("Access restrictions on maintenance and external airlocks have been removed.") + GLOB.maint_all_access = 1 /proc/revoke_maint_all_access() for(var/area/maintenance/A in world) for(var/obj/machinery/door/airlock/D in A) D.emergency = 0 D.update_icon(0) - minor_announcement.Announce("Access restrictions on maintenance and external airlocks have been re-added.") - maint_all_access = 0 + GLOB.minor_announcement.Announce("Access restrictions on maintenance and external airlocks have been re-added.") + GLOB.maint_all_access = 0 /proc/make_station_all_access() for(var/obj/machinery/door/airlock/D in GLOB.airlocks) if(is_station_level(D.z)) D.emergency = 1 D.update_icon(0) - minor_announcement.Announce("Access restrictions on all station airlocks have been removed due to an ongoing crisis. Trespassing laws still apply unless ordered otherwise by Command staff.") - station_all_access = 1 + GLOB.minor_announcement.Announce("Access restrictions on all station airlocks have been removed due to an ongoing crisis. Trespassing laws still apply unless ordered otherwise by Command staff.") + GLOB.station_all_access = 1 /proc/revoke_station_all_access() for(var/obj/machinery/door/airlock/D in GLOB.airlocks) if(is_station_level(D.z)) D.emergency = 0 D.update_icon(0) - minor_announcement.Announce("Access restrictions on all station airlocks have been re-added. Seek station AI or a colleague's assistance if you are stuck.") - station_all_access = 0 + GLOB.minor_announcement.Announce("Access restrictions on all station airlocks have been re-added. Seek station AI or a colleague's assistance if you are stuck.") + GLOB.station_all_access = 0 diff --git a/code/modules/security_levels/security levels.dm b/code/modules/security_levels/security levels.dm index effaae3f0ad..0f07107a00b 100644 --- a/code/modules/security_levels/security levels.dm +++ b/code/modules/security_levels/security levels.dm @@ -1,4 +1,4 @@ -/var/security_level = 0 +GLOBAL_VAR_INIT(security_level, 0) //0 = code green //1 = code blue //2 = code red @@ -7,8 +7,8 @@ //5 = code delta //config.alert_desc_blue_downto -/var/datum/announcement/priority/security/security_announcement_up = new(do_log = 0, do_newscast = 0, new_sound = sound('sound/misc/notice1.ogg')) -/var/datum/announcement/priority/security/security_announcement_down = new(do_log = 0, do_newscast = 0) +GLOBAL_DATUM_INIT(security_announcement_up, /datum/announcement/priority/security, new(do_log = 0, do_newscast = 0, new_sound = sound('sound/misc/notice1.ogg'))) +GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/security, new(do_log = 0, do_newscast = 0)) /proc/set_security_level(var/level) switch(level) @@ -26,8 +26,8 @@ level = SEC_LEVEL_DELTA //Will not be announced if you try to set to the same level as it already is - if(level >= SEC_LEVEL_GREEN && level <= SEC_LEVEL_DELTA && level != security_level) - if(level >= SEC_LEVEL_RED && security_level < SEC_LEVEL_RED) + if(level >= SEC_LEVEL_GREEN && level <= SEC_LEVEL_DELTA && level != GLOB.security_level) + if(level >= SEC_LEVEL_RED && GLOB.security_level < SEC_LEVEL_RED) // Mark down this time to prevent shuttle cheese SSshuttle.emergency_sec_level_time = world.time @@ -42,8 +42,8 @@ switch(level) if(SEC_LEVEL_GREEN) - security_announcement_down.Announce("All threats to the station have passed. All weapons need to be holstered and privacy laws are once again fully enforced.","Attention! Security level lowered to green.") - security_level = SEC_LEVEL_GREEN + GLOB.security_announcement_down.Announce("All threats to the station have passed. All weapons need to be holstered and privacy laws are once again fully enforced.","Attention! Security level lowered to green.") + GLOB.security_level = SEC_LEVEL_GREEN post_status("alert", "outline") @@ -53,11 +53,11 @@ FA.overlays += image('icons/obj/monitors.dmi', "overlay_green") if(SEC_LEVEL_BLUE) - if(security_level < SEC_LEVEL_BLUE) - security_announcement_up.Announce("The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible and random searches are permitted.","Attention! Security level elevated to blue.") + if(GLOB.security_level < SEC_LEVEL_BLUE) + GLOB.security_announcement_up.Announce("The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible and random searches are permitted.","Attention! Security level elevated to blue.") else - security_announcement_down.Announce("The immediate threat has passed. Security may no longer have weapons drawn at all times, but may continue to have them visible. Random searches are still allowed.","Attention! Security level lowered to blue.") - security_level = SEC_LEVEL_BLUE + GLOB.security_announcement_down.Announce("The immediate threat has passed. Security may no longer have weapons drawn at all times, but may continue to have them visible. Random searches are still allowed.","Attention! Security level lowered to blue.") + GLOB.security_level = SEC_LEVEL_BLUE post_status("alert", "outline") @@ -67,11 +67,11 @@ FA.overlays += image('icons/obj/monitors.dmi', "overlay_blue") if(SEC_LEVEL_RED) - if(security_level < SEC_LEVEL_RED) - security_announcement_up.Announce("There is an immediate and serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised.","Attention! Code Red!") + if(GLOB.security_level < SEC_LEVEL_RED) + GLOB.security_announcement_up.Announce("There is an immediate and serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised.","Attention! Code Red!") else - security_announcement_down.Announce("The station's self-destruct mechanism has been deactivated, but there is still an immediate and serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised.","Attention! Code Red!") - security_level = SEC_LEVEL_RED + GLOB.security_announcement_down.Announce("The station's self-destruct mechanism has been deactivated, but there is still an immediate and serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised.","Attention! Code Red!") + GLOB.security_level = SEC_LEVEL_RED var/obj/machinery/door/airlock/highsecurity/red/R = locate(/obj/machinery/door/airlock/highsecurity/red) in GLOB.airlocks if(R && is_station_level(R.z)) @@ -86,12 +86,12 @@ FA.overlays += image('icons/obj/monitors.dmi', "overlay_red") if(SEC_LEVEL_GAMMA) - security_announcement_up.Announce("Central Command has ordered the Gamma security level on the station. Security is to have weapons equipped at all times, and all civilians are to immediately seek their nearest head for transportation to a secure location. The station's Gamma armory has been unlocked and is ready for use.","Attention! Gamma security level activated!", new_sound = sound('sound/effects/new_siren.ogg')) - security_level = SEC_LEVEL_GAMMA + GLOB.security_announcement_up.Announce("Central Command has ordered the Gamma security level on the station. Security is to have weapons equipped at all times, and all civilians are to immediately seek their nearest head for transportation to a secure location. The station's Gamma armory has been unlocked and is ready for use.","Attention! Gamma security level activated!", new_sound = sound('sound/effects/new_siren.ogg')) + GLOB.security_level = SEC_LEVEL_GAMMA move_gamma_ship() - if(security_level < SEC_LEVEL_RED) + if(GLOB.security_level < SEC_LEVEL_RED) for(var/obj/machinery/door/airlock/highsecurity/red/R in GLOB.airlocks) if(is_station_level(R.z)) R.locked = 0 @@ -111,8 +111,8 @@ FA.update_icon() if(SEC_LEVEL_EPSILON) - security_announcement_up.Announce("Central Command has ordered the Epsilon security level on the station. Consider all contracts terminated.","Attention! Epsilon security level activated!", new_sound = sound('sound/effects/purge_siren.ogg')) - security_level = SEC_LEVEL_EPSILON + GLOB.security_announcement_up.Announce("Central Command has ordered the Epsilon security level on the station. Consider all contracts terminated.","Attention! Epsilon security level activated!", new_sound = sound('sound/effects/purge_siren.ogg')) + GLOB.security_level = SEC_LEVEL_EPSILON post_status("alert", "epsilonalert") @@ -122,8 +122,8 @@ FA.overlays += image('icons/obj/monitors.dmi', "overlay_epsilon") if(SEC_LEVEL_DELTA) - security_announcement_up.Announce("The station's self-destruct mechanism has been engaged. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill.","Attention! Delta security level reached!", new_sound = sound('sound/effects/deltaalarm.ogg')) - security_level = SEC_LEVEL_DELTA + GLOB.security_announcement_up.Announce("The station's self-destruct mechanism has been engaged. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill.","Attention! Delta security level reached!", new_sound = sound('sound/effects/deltaalarm.ogg')) + GLOB.security_level = SEC_LEVEL_DELTA post_status("alert", "deltaalert") @@ -133,16 +133,16 @@ FA.overlays += image('icons/obj/monitors.dmi', "overlay_delta") if(level >= SEC_LEVEL_RED) - atc.reroute_traffic(yes = TRUE) // Tell them fuck off we're busy. + GLOB.atc.reroute_traffic(yes = TRUE) // Tell them fuck off we're busy. else - atc.reroute_traffic(yes = FALSE) + GLOB.atc.reroute_traffic(yes = FALSE) SSnightshift.check_nightshift(TRUE) else return /proc/get_security_level() - switch(security_level) + switch(GLOB.security_level) if(SEC_LEVEL_GREEN) return "green" if(SEC_LEVEL_BLUE) diff --git a/code/modules/shuttle/assault_pod.dm b/code/modules/shuttle/assault_pod.dm index 0d2953017c8..9505ac475e2 100644 --- a/code/modules/shuttle/assault_pod.dm +++ b/code/modules/shuttle/assault_pod.dm @@ -33,8 +33,8 @@ /obj/item/assault_pod/attack_self(mob/living/user) var/target_area - target_area = input("Area to land", "Select a Landing Zone", target_area) in teleportlocs - var/area/picked_area = teleportlocs[target_area] + target_area = input("Area to land", "Select a Landing Zone", target_area) in GLOB.teleportlocs + var/area/picked_area = GLOB.teleportlocs[target_area] if(!src || QDELETED(src)) return diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 7f9eddc0df4..f82598b1e14 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -49,20 +49,20 @@ if(auth_need - authorized.len > 0) message_admins("[key_name_admin(user)] has authorized early shuttle launch.") log_game("[key_name(user)] has authorized early shuttle launch in ([x], [y], [z]).") - minor_announcement.Announce("[auth_need - authorized.len] more authorization(s) needed until shuttle is launched early") + GLOB.minor_announcement.Announce("[auth_need - authorized.len] more authorization(s) needed until shuttle is launched early") else message_admins("[key_name_admin(user)] has launched the emergency shuttle [seconds] seconds before launch.") log_game("[key_name(user)] has launched the emergency shuttle in ([x], [y], [z]) [seconds] seconds before launch.") - minor_announcement.Announce("The emergency shuttle will launch in 10 seconds") + GLOB.minor_announcement.Announce("The emergency shuttle will launch in 10 seconds") SSshuttle.emergency.setTimer(100) if("Repeal") if(authorized.Remove(W:registered_name)) - minor_announcement.Announce("[auth_need - authorized.len] authorizations needed until shuttle is launched early") + GLOB.minor_announcement.Announce("[auth_need - authorized.len] authorizations needed until shuttle is launched early") if("Abort") if(authorized.len) - minor_announcement.Announce("All authorizations to launch the shuttle early have been revoked.") + GLOB.minor_announcement.Announce("All authorizations to launch the shuttle early have been revoked.") authorized.Cut() /obj/machinery/computer/emergency_shuttle/emag_act(mob/user) @@ -70,7 +70,7 @@ var/time = SSshuttle.emergency.timeLeft() message_admins("[key_name_admin(user)] has emagged the emergency shuttle: [time] seconds before launch.") log_game("[key_name(user)] has emagged the emergency shuttle in ([x], [y], [z]): [time] seconds before launch.") - minor_announcement.Announce("The emergency shuttle will launch in 10 seconds", "SYSTEM ERROR:") + GLOB.minor_announcement.Announce("The emergency shuttle will launch in 10 seconds", "SYSTEM ERROR:") SSshuttle.emergency.setTimer(100) emagged = 1 @@ -151,9 +151,9 @@ emergency_shuttle_called.Announce("The emergency shuttle has been called. [redAlert ? "Red Alert state confirmed: Dispatching priority shuttle. " : "" ]It will arrive in [timeLeft(600)] minutes.[reason][SSshuttle.emergencyLastCallLoc ? "\n\nCall signal traced. Results can be viewed on any communications console." : "" ]") if(reason == "Automatic Crew Transfer" && signalOrigin == null) // Best way we have to check that it's actually a crew transfer and not just a player using the same message- any other calls to this proc should have a signalOrigin. - atc.shift_ending() + GLOB.atc.shift_ending() else // Emergency shuttle call (probably) - atc.reroute_traffic(yes = TRUE) + GLOB.atc.reroute_traffic(yes = TRUE) /obj/docking_port/mobile/emergency/cancel(area/signalOrigin) @@ -252,7 +252,7 @@ if(SHUTTLE_DOCKED) if(time_left <= 0 && SSshuttle.emergencyNoEscape) - priority_announcement.Announce("Hostile environment detected. Departure has been postponed indefinitely pending conflict resolution.") + GLOB.priority_announcement.Announce("Hostile environment detected. Departure has been postponed indefinitely pending conflict resolution.") sound_played = 0 mode = SHUTTLE_STRANDED @@ -272,9 +272,9 @@ enterTransit() mode = SHUTTLE_ESCAPE timer = world.time - priority_announcement.Announce("The Emergency Shuttle has left the station. Estimate [timeLeft(600)] minutes until the shuttle docks at Central Command.") + GLOB.priority_announcement.Announce("The Emergency Shuttle has left the station. Estimate [timeLeft(600)] minutes until the shuttle docks at Central Command.") for(var/mob/M in GLOB.player_list) - if(!isnewplayer(M) && !M.client.karma_spent && !(M.client.ckey in karma_spenders) && !M.get_preference(DISABLE_KARMA_REMINDER)) + if(!isnewplayer(M) && !M.client.karma_spent && !(M.client.ckey in GLOB.karma_spenders) && !M.get_preference(DISABLE_KARMA_REMINDER)) to_chat(M, "You have not yet spent your karma for the round; was there a player worthy of receiving your reward? Look under Special Verbs tab, Award Karma.") if(SHUTTLE_ESCAPE) @@ -291,7 +291,7 @@ var/destination_dock = "emergency_away" if(is_hijacked()) destination_dock = "emergency_syndicate" - priority_announcement.Announce("Corruption detected in shuttle navigation protocols. Please contact your supervisor.") + GLOB.priority_announcement.Announce("Corruption detected in shuttle navigation protocols. Please contact your supervisor.") dock_id(destination_dock) diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 36ad93eb28e..6441d0f9cb5 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -774,7 +774,7 @@ ui = new(user, src, ui_key, "shuttle_console.tmpl", M ? M.name : "shuttle", 300, 200) ui.open() -/obj/machinery/computer/shuttle/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/shuttle/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] var/obj/docking_port/mobile/M = SSshuttle.getShuttle(shuttleId) data["status"] = M ? M.getStatusText() : null diff --git a/code/modules/shuttle/shuttle_manipulator.dm b/code/modules/shuttle/shuttle_manipulator.dm index 0e67b74de67..c9184b2a484 100644 --- a/code/modules/shuttle/shuttle_manipulator.dm +++ b/code/modules/shuttle/shuttle_manipulator.dm @@ -64,7 +64,7 @@ if(!ui) // the ui does not exist, so we'll create a new() one // for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm - ui = new(user, src, ui_key, "shuttle_manipulator.tmpl", "Shuttle Manipulator", 660, 700, null, null, admin_state) + ui = new(user, src, ui_key, "shuttle_manipulator.tmpl", "Shuttle Manipulator", 660, 700, null, null, GLOB.admin_state) // when the ui is first opened this is the data it will use // open the new ui window ui.open() @@ -80,8 +80,8 @@ data["templates_tabs"] = list() data["selected"] = null - for(var/shuttle_id in shuttle_templates) - var/datum/map_template/shuttle/S = shuttle_templates[shuttle_id] + for(var/shuttle_id in GLOB.shuttle_templates) + var/datum/map_template/shuttle/S = GLOB.shuttle_templates[shuttle_id] if(!templates[S.port_id]) data["templates_tabs"] += S.port_id @@ -138,7 +138,7 @@ // Preload some common parameters var/shuttle_id = href_list["shuttle_id"] - var/datum/map_template/shuttle/S = shuttle_templates[shuttle_id] + var/datum/map_template/shuttle/S = GLOB.shuttle_templates[shuttle_id] if(href_list["selectMenuKey"]) diff --git a/code/modules/shuttle/supply.dm b/code/modules/shuttle/supply.dm index 80094c876df..b20a82e7b30 100644 --- a/code/modules/shuttle/supply.dm +++ b/code/modules/shuttle/supply.dm @@ -413,12 +413,12 @@ ui = new(user, src, ui_key, "order_console.tmpl", name, ORDER_SCREEN_WIDTH, ORDER_SCREEN_HEIGHT) ui.open() -/obj/machinery/computer/ordercomp/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/ordercomp/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["last_viewed_group"] = last_viewed_group var/category_list[0] - for(var/category in all_supply_groups) + for(var/category in GLOB.all_supply_groups) category_list.Add(list(list("name" = get_supply_group_name(category), "category" = category))) data["categories"] = category_list var/cat = text2num(last_viewed_group) @@ -559,12 +559,12 @@ ui = new(user, src, ui_key, "supply_console.tmpl", name, SUPPLY_SCREEN_WIDTH, SUPPLY_SCREEN_HEIGHT) ui.open() -/obj/machinery/computer/supplycomp/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/supplycomp/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/data[0] data["last_viewed_group"] = last_viewed_group var/category_list[0] - for(var/category in all_supply_groups) + for(var/category in GLOB.all_supply_groups) category_list.Add(list(list("name" = get_supply_group_name(category), "category" = category))) data["categories"] = category_list diff --git a/code/modules/space_management/level_check.dm b/code/modules/space_management/level_check.dm index a9abdaa5472..c49843cd7ea 100644 --- a/code/modules/space_management/level_check.dm +++ b/code/modules/space_management/level_check.dm @@ -1,5 +1,5 @@ /proc/is_on_level_name(atom/A,name) - var/datum/space_level/S = space_manager.get_zlev_by_name(name) + var/datum/space_level/S = GLOB.space_manager.get_zlev_by_name(name) return A.z == S.zpos // For expansion later diff --git a/code/modules/space_management/level_traits.dm b/code/modules/space_management/level_traits.dm index 6fcd267105f..1d88f70454f 100644 --- a/code/modules/space_management/level_traits.dm +++ b/code/modules/space_management/level_traits.dm @@ -36,28 +36,28 @@ secure = (z == level_name_to_num(CENTCOMM)) return secure -var/list/default_map_traits = MAP_TRANSITION_CONFIG +GLOBAL_LIST_INIT(default_map_traits, MAP_TRANSITION_CONFIG) /proc/check_level_trait(z, trait) if(!z) return 0 // If you're nowhere, you have no traits var/list/trait_list - if(space_manager.initialized) - var/datum/space_level/S = space_manager.get_zlev(z) + if(GLOB.space_manager.initialized) + var/datum/space_level/S = GLOB.space_manager.get_zlev(z) trait_list = S.flags else - trait_list = default_map_traits[z] + trait_list = GLOB.default_map_traits[z] trait_list = trait_list["attributes"] return (trait in trait_list) /proc/levels_by_trait(trait) var/list/result = list() - for(var/A in space_manager.z_list) - var/datum/space_level/S = space_manager.z_list[A] + for(var/A in GLOB.space_manager.z_list) + var/datum/space_level/S = GLOB.space_manager.z_list[A] if(trait in S.flags) result |= S.zpos return result /proc/level_name_to_num(name) - var/datum/space_level/S = space_manager.get_zlev_by_name(name) + var/datum/space_level/S = GLOB.space_manager.get_zlev_by_name(name) return S.zpos diff --git a/code/modules/space_management/space_level.dm b/code/modules/space_management/space_level.dm index 8443951d1d3..44c692363af 100644 --- a/code/modules/space_management/space_level.dm +++ b/code/modules/space_management/space_level.dm @@ -31,11 +31,11 @@ /datum/space_level/Destroy() if(linkage == CROSSLINKED) - if(space_manager.linkage_map) - remove_from_space_network(space_manager.linkage_map) + if(GLOB.space_manager.linkage_map) + remove_from_space_network(GLOB.space_manager.linkage_map) - space_manager.unbuilt_space_transitions -= src - space_manager.z_list -= "[zpos]" + GLOB.space_manager.unbuilt_space_transitions -= src + GLOB.space_manager.z_list -= "[zpos]" return ..() /datum/space_level/proc/build_space_destination_arrays() @@ -95,7 +95,7 @@ transit_east -= S /datum/space_level/proc/apply_transition(turf/space/S) - if(src in space_manager.unbuilt_space_transitions) + if(src in GLOB.space_manager.unbuilt_space_transitions) return // Let the space manager handle this one switch(linkage) if(UNAFFECTED) @@ -124,10 +124,10 @@ return // Remove ourselves from the linkage map if we were cross-linked if(linkage == CROSSLINKED) - if(space_manager.linkage_map) - remove_from_space_network(space_manager.linkage_map) + if(GLOB.space_manager.linkage_map) + remove_from_space_network(GLOB.space_manager.linkage_map) - space_manager.unbuilt_space_transitions |= src + GLOB.space_manager.unbuilt_space_transitions |= src linkage = transition_type switch(transition_type) if(UNAFFECTED) @@ -143,9 +143,9 @@ D.register() D.forceMove(locate(200, 200, zpos)) -var/list/atmos_machine_typecache = typecacheof(/obj/machinery/atmospherics) -var/list/cable_typecache = typecacheof(/obj/structure/cable) -var/list/maploader_typecache = typecacheof(/obj/effect/landmark/map_loader) +GLOBAL_LIST_INIT(atmos_machine_typecache, typecacheof(/obj/machinery/atmospherics)) +GLOBAL_LIST_INIT(cable_typecache, typecacheof(/obj/structure/cable)) +GLOBAL_LIST_INIT(maploader_typecache, typecacheof(/obj/effect/landmark/map_loader)) /datum/space_level/proc/resume_init() if(dirt_count > 0) @@ -156,9 +156,9 @@ var/list/maploader_typecache = typecacheof(/obj/effect/landmark/map_loader) init_list = list() var/watch = start_watch() listclearnulls(our_atoms) - var/list/late_maps = typecache_filter_list(our_atoms, maploader_typecache) - var/list/pipes = typecache_filter_list(our_atoms, atmos_machine_typecache) - var/list/cables = typecache_filter_list(our_atoms, cable_typecache) + var/list/late_maps = typecache_filter_list(our_atoms, GLOB.maploader_typecache) + var/list/pipes = typecache_filter_list(our_atoms, GLOB.atmos_machine_typecache) + var/list/cables = typecache_filter_list(our_atoms, GLOB.cable_typecache) // If we don't carefully add dirt around the map templates, bad stuff happens // so we separate them out here our_atoms -= late_maps @@ -193,9 +193,9 @@ var/list/maploader_typecache = typecacheof(/obj/effect/landmark/map_loader) /datum/space_level/proc/do_late_maps(list/late_maps) var/watch = start_watch() log_debug("Loading map templates on z-level '[zpos]'!") - space_manager.add_dirt(zpos) // Let's not repeatedly resume init for each template + GLOB.space_manager.add_dirt(zpos) // Let's not repeatedly resume init for each template for(var/atom/movable/AM in late_maps) AM.Initialize() late_maps.Cut() - space_manager.remove_dirt(zpos) + GLOB.space_manager.remove_dirt(zpos) log_debug("Took [stop_watch(watch)]s") diff --git a/code/modules/space_management/space_transition.dm b/code/modules/space_management/space_transition.dm index f432d9733a5..5312938d588 100644 --- a/code/modules/space_management/space_transition.dm +++ b/code/modules/space_management/space_transition.dm @@ -63,8 +63,8 @@ var/oppose = get_opposite_direction(direction) neighbors[direction] = S S.neighbors[oppose] = src - space_manager.unbuilt_space_transitions |= src - space_manager.unbuilt_space_transitions |= S + GLOB.space_manager.unbuilt_space_transitions |= src + GLOB.space_manager.unbuilt_space_transitions |= S /datum/space_level/proc/get_connection(direction) @@ -169,7 +169,7 @@ var/datum/space_level/S = spl.neighbors[direction] var/oppose = get_opposite_direction(direction) S.neighbors.Remove(oppose) - space_manager.unbuilt_space_transitions |= S + GLOB.space_manager.unbuilt_space_transitions |= S spl.reset_connections() spl = initial(spl) diff --git a/code/modules/space_management/zlevel_manager.dm b/code/modules/space_management/zlevel_manager.dm index e45aff76078..eb84206eea3 100644 --- a/code/modules/space_management/zlevel_manager.dm +++ b/code/modules/space_management/zlevel_manager.dm @@ -1,4 +1,4 @@ -var/global/datum/zlev_manager/space_manager = new +GLOBAL_DATUM_INIT(space_manager, /datum/zlev_manager, new()) /datum/zlev_manager // A list of z-levels @@ -17,11 +17,11 @@ var/global/datum/zlev_manager/space_manager = new // Populate our space level list // and prepare space transitions /datum/zlev_manager/proc/initialize() - var/num_official_z_levels = map_transition_config.len + var/num_official_z_levels = GLOB.map_transition_config.len var/k = 1 // First take care of "Official" z levels, without visiting levels outside of the list - for(var/list/features in map_transition_config) + for(var/list/features in GLOB.map_transition_config) if(k > world.maxz) CRASH("More map attributes pre-defined than existent z levels - [num_official_z_levels]") var/name = features["name"] diff --git a/code/modules/station_goals/bsa.dm b/code/modules/station_goals/bsa.dm index bc0576c9d52..3e45877ec29 100644 --- a/code/modules/station_goals/bsa.dm +++ b/code/modules/station_goals/bsa.dm @@ -313,7 +313,7 @@ ui.open() ui.set_auto_update(1) -/obj/machinery/computer/bsa_control/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/bsa_control/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/list/data = list() data["connected"] = cannon data["notice"] = notice @@ -352,12 +352,12 @@ /obj/machinery/computer/bsa_control/proc/calibrate(mob/user) var/list/gps_locators = list() - for(var/obj/item/gps/G in GPS_list) //nulls on the list somehow + for(var/obj/item/gps/G in GLOB.GPS_list) //nulls on the list somehow gps_locators[G.gpstag] = G var/list/options = gps_locators if(area_aim) - options += target_all_areas ? ghostteleportlocs : teleportlocs + options += target_all_areas ? GLOB.ghostteleportlocs : GLOB.teleportlocs var/V = input(user,"Select target", "Select target",null) in options|null target = options[V] diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm index 5b07d27361e..db801fa5d0f 100644 --- a/code/modules/station_goals/dna_vault.dm +++ b/code/modules/station_goals/dna_vault.dm @@ -74,7 +74,7 @@ plants = list() dna = list() -var/list/non_simple_animals = typecacheof(list(/mob/living/carbon/human/monkey,/mob/living/carbon/alien)) +GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/monkey,/mob/living/carbon/alien))) /obj/item/dna_probe/afterattack(atom/target, mob/user, proximity) ..() @@ -95,7 +95,7 @@ var/list/non_simple_animals = typecacheof(list(/mob/living/carbon/human/monkey,/ to_chat(user, "Plant data added to local storage.") //animals - if(isanimal(target) || is_type_in_typecache(target, non_simple_animals)) + if(isanimal(target) || is_type_in_typecache(target, GLOB.non_simple_animals)) if(isanimal(target)) var/mob/living/simple_animal/A = target if(!A.healable)//simple approximation of being animal not a robot or similar @@ -220,7 +220,7 @@ var/list/non_simple_animals = typecacheof(list(/mob/living/carbon/human/monkey,/ L += pick_n_take(possible_powers) power_lottery[user] = L -/obj/machinery/dna_vault/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) //TODO Make it % bars maybe +/obj/machinery/dna_vault/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) //TODO Make it % bars maybe var/list/data = list() data["plants"] = plants.len data["plants_max"] = plants_max diff --git a/code/modules/station_goals/shield.dm b/code/modules/station_goals/shield.dm index 9995528c9b5..42bd3b2a10a 100644 --- a/code/modules/station_goals/shield.dm +++ b/code/modules/station_goals/shield.dm @@ -71,7 +71,7 @@ if(S.id == id && atoms_share_level(src, S)) S.toggle() -/obj/machinery/computer/sat_control/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) +/obj/machinery/computer/sat_control/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) var/list/data = list() data["satellites"] = list() diff --git a/code/modules/station_goals/station_goal.dm b/code/modules/station_goals/station_goal.dm index d6be4540a01..47f65ea2553 100644 --- a/code/modules/station_goals/station_goal.dm +++ b/code/modules/station_goals/station_goal.dm @@ -12,7 +12,7 @@ var/report_message = "Complete this goal." /datum/station_goal/proc/send_report() - priority_announcement.Announce("Priority Nanotrasen directive received. Project \"[name]\" details inbound.", "Incoming Priority Message", 'sound/AI/commandreport.ogg') + GLOB.priority_announcement.Announce("Priority Nanotrasen directive received. Project \"[name]\" details inbound.", "Incoming Priority Message", 'sound/AI/commandreport.ogg') print_command_report(get_report(), "Nanotrasen Directive [pick(GLOB.phonetic_alphabet)] \Roman[rand(1,50)]") on_report() diff --git a/code/modules/store/store.dm b/code/modules/store/store.dm index 84c85fea29e..2557008def0 100644 --- a/code/modules/store/store.dm +++ b/code/modules/store/store.dm @@ -16,7 +16,7 @@ job objectives = good stock market, shitty job objective completion = shitty eco Goal for now is to get the store itself working, however. */ -var/global/datum/store/centcomm_store=new +GLOBAL_DATUM_INIT(centcomm_store, /datum/store, new()) /datum/store var/list/datum/storeitem/items=list() @@ -40,7 +40,7 @@ var/global/datum/store/centcomm_store=new T.target_name = "[command_name()] Merchandising" T.purpose = "Purchase of [item.name]" T.amount = -amount - T.date = current_date_string + T.date = GLOB.current_date_string T.time = station_time_timestamp() T.source_terminal = "\[CLASSIFIED\] Terminal #[rand(111,333)]" mind.initial_account.transaction_log.Add(T) diff --git a/code/modules/surgery/limb_reattach.dm b/code/modules/surgery/limb_reattach.dm index 11ceaaeb0fb..db1ad04aef3 100644 --- a/code/modules/surgery/limb_reattach.dm +++ b/code/modules/surgery/limb_reattach.dm @@ -160,7 +160,7 @@ ..() if(E.limb_name == "head") var/obj/item/organ/external/head/H = target.get_organ("head") - var/datum/robolimb/robohead = all_robolimbs[H.model] + var/datum/robolimb/robohead = GLOB.all_robolimbs[H.model] if(robohead.is_monitor) //Ensures that if an IPC gets a head that's got a human hair wig attached to their body, the hair won't wipe. H.h_style = "Bald" H.f_style = "Shaved" diff --git a/code/modules/surgery/organs/augments_eyes.dm b/code/modules/surgery/organs/augments_eyes.dm index 80dceea5048..53907e86d79 100644 --- a/code/modules/surgery/organs/augments_eyes.dm +++ b/code/modules/surgery/organs/augments_eyes.dm @@ -11,7 +11,7 @@ var/see_in_dark = 0 var/see_invisible = 0 var/lighting_alpha - + var/eye_colour = "#000000" // Should never be null var/old_eye_colour = "#000000" var/flash_protect = 0 @@ -88,14 +88,14 @@ /obj/item/organ/internal/cyberimp/eyes/hud/insert(var/mob/living/carbon/M, var/special = 0) ..() if(HUD_type) - var/datum/atom_hud/H = huds[HUD_type] + var/datum/atom_hud/H = GLOB.huds[HUD_type] H.add_hud_to(M) M.permanent_huds |= H /obj/item/organ/internal/cyberimp/eyes/hud/remove(var/mob/living/carbon/M, var/special = 0) . = ..() if(HUD_type) - var/datum/atom_hud/H = huds[HUD_type] + var/datum/atom_hud/H = GLOB.huds[HUD_type] M.permanent_huds ^= H H.remove_hud_from(M) diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm index 60f4c22743d..7491bfbad19 100644 --- a/code/modules/surgery/organs/eyes.dm +++ b/code/modules/surgery/organs/eyes.dm @@ -46,8 +46,8 @@ if(!(M.disabilities & COLOURBLIND) && (dependent_disabilities & COLOURBLIND)) //If the eyes are colourblind and we're not, carry over the gene. dependent_disabilities &= ~COLOURBLIND - M.dna.SetSEState(COLOURBLINDBLOCK,1) - genemutcheck(M,COLOURBLINDBLOCK,null,MUTCHK_FORCED) + M.dna.SetSEState(GLOB.colourblindblock,1) + genemutcheck(M,GLOB.colourblindblock,null,MUTCHK_FORCED) else M.update_client_colour() //If we're here, that means the mob acquired the colourblindness gene while they didn't have eyes. Better handle it. @@ -55,8 +55,8 @@ if(!special && (M.disabilities & COLOURBLIND)) //If special is set, that means these eyes are getting deleted (i.e. during set_species()) if(!(dependent_disabilities & COLOURBLIND)) //We only want to change COLOURBLINDBLOCK and such it the eyes are being surgically removed. dependent_disabilities |= COLOURBLIND - M.dna.SetSEState(COLOURBLINDBLOCK,0) - genemutcheck(M,COLOURBLINDBLOCK,null,MUTCHK_FORCED) + M.dna.SetSEState(GLOB.colourblindblock,0) + genemutcheck(M,GLOB.colourblindblock,null,MUTCHK_FORCED) . = ..() /obj/item/organ/internal/eyes/surgeryize() diff --git a/code/modules/surgery/organs/organ_external.dm b/code/modules/surgery/organs/organ_external.dm index 305c08ff17e..607944e4b6a 100644 --- a/code/modules/surgery/organs/organ_external.dm +++ b/code/modules/surgery/organs/organ_external.dm @@ -515,7 +515,7 @@ Note that amputating the affected organ does in fact remove the infection from t if(!clean) // Throw limb around. if(src && istype(loc,/turf)) - dropped_part.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30) + dropped_part.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),30) dir = 2 brute_dam = 0 burn_dam = 0 //Reset the damage on the limb; the damage should have transferred to the parent; we don't want extra damage being re-applied when then limb is re-attached @@ -663,7 +663,7 @@ Note that amputating the affected organ does in fact remove the infection from t /obj/item/organ/external/proc/set_company(var/company) model = company - var/datum/robolimb/R = all_robolimbs[company] + var/datum/robolimb/R = GLOB.all_robolimbs[company] if(R) force_icon = R.icon name = "[R.company] [initial(name)]" diff --git a/code/modules/surgery/organs/organ_icon.dm b/code/modules/surgery/organs/organ_icon.dm index ef2f729811c..20146b75a0b 100644 --- a/code/modules/surgery/organs/organ_icon.dm +++ b/code/modules/surgery/organs/organ_icon.dm @@ -1,4 +1,4 @@ -var/global/list/limb_icon_cache = list() +GLOBAL_LIST_EMPTY(limb_icon_cache) /obj/item/organ/external/proc/compile_icon() // I do this so the head's overlays don't get obliterated diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 25f87d71104..7f5e520c88a 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -231,11 +231,11 @@ /obj/item/organ/internal/honktumor/insert(mob/living/carbon/M, special = 0) ..() M.mutations.Add(CLUMSY) - M.mutations.Add(COMICBLOCK) - M.dna.SetSEState(CLUMSYBLOCK,1,1) - M.dna.SetSEState(COMICBLOCK,1,1) - genemutcheck(M,CLUMSYBLOCK,null,MUTCHK_FORCED) - genemutcheck(M,COMICBLOCK,null,MUTCHK_FORCED) + M.mutations.Add(GLOB.comicblock) + M.dna.SetSEState(GLOB.clumsyblock,1,1) + M.dna.SetSEState(GLOB.comicblock,1,1) + genemutcheck(M,GLOB.clumsyblock,null,MUTCHK_FORCED) + genemutcheck(M,GLOB.comicblock,null,MUTCHK_FORCED) organhonked = world.time waddle = M.AddComponent(/datum/component/waddling) squeak = M.AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg' = 1), 50) @@ -244,11 +244,11 @@ . = ..() M.mutations.Remove(CLUMSY) - M.mutations.Remove(COMICBLOCK) - M.dna.SetSEState(CLUMSYBLOCK,0) - M.dna.SetSEState(COMICBLOCK,0) - genemutcheck(M,CLUMSYBLOCK,null,MUTCHK_FORCED) - genemutcheck(M,COMICBLOCK,null,MUTCHK_FORCED) + M.mutations.Remove(GLOB.comicblock) + M.dna.SetSEState(GLOB.clumsyblock,0) + M.dna.SetSEState(GLOB.comicblock,0) + genemutcheck(M,GLOB.clumsyblock,null,MUTCHK_FORCED) + genemutcheck(M,GLOB.comicblock,null,MUTCHK_FORCED) QDEL_NULL(waddle) QDEL_NULL(squeak) qdel(src) diff --git a/code/modules/surgery/organs/robolimbs.dm b/code/modules/surgery/organs/robolimbs.dm index 2e25a1c1998..eb40fa40994 100644 --- a/code/modules/surgery/organs/robolimbs.dm +++ b/code/modules/surgery/organs/robolimbs.dm @@ -1,19 +1,19 @@ -var/global/list/all_robolimbs = list() -var/global/list/chargen_robolimbs = list() -var/global/list/selectable_robolimbs = list() -var/global/datum/robolimb/basic_robolimb +GLOBAL_LIST_EMPTY(all_robolimbs) +GLOBAL_LIST_EMPTY(chargen_robolimbs) +GLOBAL_LIST_EMPTY(selectable_robolimbs) +GLOBAL_DATUM(basic_robolimb, /datum/robolimb) /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) if(R != "head" && R != "chest" && R != "groin" ) //Part of the method that ensures only IPCs can access head, chest and groin prosthetics. if(R.has_subtypes) //Ensures solos get added to the list as well be incorporating has_subtypes == 1 and has_subtypes == 2. - 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. if(R.selectable) - selectable_robolimbs[R.company] = R + GLOB.selectable_robolimbs[R.company] = R /datum/robolimb var/company = "Unbranded" // Shown when selecting the limb. diff --git a/code/modules/surgery/organs/vocal_cords.dm b/code/modules/surgery/organs/vocal_cords.dm index 9d91682f057..c82a0e899f7 100644 --- a/code/modules/surgery/organs/vocal_cords.dm +++ b/code/modules/surgery/organs/vocal_cords.dm @@ -1,39 +1,39 @@ -var/static/regex/stun_words = regex("stop|wait|stand still|hold on|halt") -var/static/regex/weaken_words = regex("drop|fall|trip") -var/static/regex/sleep_words = regex("sleep|slumber") -var/static/regex/vomit_words = regex("vomit|throw up") -var/static/regex/silence_words = regex("shut up|silence|ssh|quiet|hush") -var/static/regex/hallucinate_words = regex("see the truth|hallucinate") -var/static/regex/wakeup_words = regex("wake up|awaken") -var/static/regex/heal_words = regex("live|heal|survive|mend|heroes never die") -var/static/regex/hurt_words = regex("die|suffer") -var/static/regex/bleed_words = regex("bleed") -var/static/regex/burn_words = regex("burn|ignite") -var/static/regex/repulse_words = regex("shoo|go away|leave me alone|begone|flee|fus ro dah") -var/static/regex/whoareyou_words = regex("who are you|say your name|state your name|identify") -var/static/regex/saymyname_words = regex("say my name") -var/static/regex/knockknock_words = regex("knock knock") -var/static/regex/statelaws_words = regex("state laws|state your laws") -var/static/regex/move_words = regex("move") -var/static/regex/walk_words = regex("walk|slow down") -var/static/regex/run_words = regex("run") -var/static/regex/helpintent_words = regex("help") -var/static/regex/disarmintent_words = regex("disarm") -var/static/regex/grabintent_words = regex("grab") -var/static/regex/harmintent_words = regex("harm|fight") -var/static/regex/throwmode_words = regex("throw|catch") -var/static/regex/flip_words = regex("flip|rotate|revolve|roll|somersault") -var/static/regex/rest_words = regex("rest") -var/static/regex/getup_words = regex("get up") -var/static/regex/sit_words = regex("sit") -var/static/regex/stand_words = regex("stand") -var/static/regex/dance_words = regex("dance") -var/static/regex/jump_words = regex("jump") -var/static/regex/salute_words = regex("salute") -var/static/regex/deathgasp_words = regex("play dead") -var/static/regex/clap_words = regex("clap|applaud") -var/static/regex/honk_words = regex("ho+nk") //hooooooonk -var/static/regex/multispin_words = regex("like a record baby") +GLOBAL_DATUM_INIT(stun_words, /regex, regex("stop|wait|stand still|hold on|halt")) +GLOBAL_DATUM_INIT(weaken_words, /regex, regex("drop|fall|trip")) +GLOBAL_DATUM_INIT(sleep_words, /regex, regex("sleep|slumber")) +GLOBAL_DATUM_INIT(vomit_words, /regex, regex("vomit|throw up")) +GLOBAL_DATUM_INIT(silence_words, /regex, regex("shut up|silence|ssh|quiet|hush")) +GLOBAL_DATUM_INIT(hallucinate_words, /regex, regex("see the truth|hallucinate")) +GLOBAL_DATUM_INIT(wakeup_words, /regex, regex("wake up|awaken")) +GLOBAL_DATUM_INIT(heal_words, /regex, regex("live|heal|survive|mend|heroes never die")) +GLOBAL_DATUM_INIT(hurt_words, /regex, regex("die|suffer")) +GLOBAL_DATUM_INIT(bleed_words, /regex, regex("bleed")) +GLOBAL_DATUM_INIT(burn_words, /regex, regex("burn|ignite")) +GLOBAL_DATUM_INIT(repulse_words, /regex, regex("shoo|go away|leave me alone|begone|flee|fus ro dah")) +GLOBAL_DATUM_INIT(whoareyou_words, /regex, regex("who are you|say your name|state your name|identify")) +GLOBAL_DATUM_INIT(saymyname_words, /regex, regex("say my name")) +GLOBAL_DATUM_INIT(knockknock_words, /regex, regex("knock knock")) +GLOBAL_DATUM_INIT(statelaws_words, /regex, regex("state laws|state your laws")) +GLOBAL_DATUM_INIT(move_words, /regex, regex("move")) +GLOBAL_DATUM_INIT(walk_words, /regex, regex("walk|slow down")) +GLOBAL_DATUM_INIT(run_words, /regex, regex("run")) +GLOBAL_DATUM_INIT(helpintent_words, /regex, regex("help")) +GLOBAL_DATUM_INIT(disarmintent_words, /regex, regex("disarm")) +GLOBAL_DATUM_INIT(grabintent_words, /regex, regex("grab")) +GLOBAL_DATUM_INIT(harmintent_words, /regex, regex("harm|fight")) +GLOBAL_DATUM_INIT(throwmode_words, /regex, regex("throw|catch")) +GLOBAL_DATUM_INIT(flip_words, /regex, regex("flip|rotate|revolve|roll|somersault")) +GLOBAL_DATUM_INIT(rest_words, /regex, regex("rest")) +GLOBAL_DATUM_INIT(getup_words, /regex, regex("get up")) +GLOBAL_DATUM_INIT(sit_words, /regex, regex("sit")) +GLOBAL_DATUM_INIT(stand_words, /regex, regex("stand")) +GLOBAL_DATUM_INIT(dance_words, /regex, regex("dance")) +GLOBAL_DATUM_INIT(jump_words, /regex, regex("jump")) +GLOBAL_DATUM_INIT(salute_words, /regex, regex("salute")) +GLOBAL_DATUM_INIT(deathgasp_words, /regex, regex("play dead")) +GLOBAL_DATUM_INIT(clap_words, /regex, regex("clap|applaud")) +GLOBAL_DATUM_INIT(honk_words, /regex, regex("ho+nk")) //hooooooonk +GLOBAL_DATUM_INIT(multispin_words, /regex, regex("like a record baby")) /obj/item/organ/internal/vocal_cords //organs that are activated through speech with the :x channel name = "vocal cords" @@ -127,7 +127,7 @@ var/static/regex/multispin_words = regex("like a record baby") /obj/item/organ/internal/vocal_cords/colossus/prepare_eat() return - + /obj/item/organ/internal/vocal_cords/colossus/can_speak_with() if(world.time < next_command) to_chat(owner, "You must wait [(next_command - world.time)/10] seconds before Speaking again.") @@ -172,7 +172,7 @@ var/static/regex/multispin_words = regex("like a record baby") if(owner.mind.isholy) power_multiplier *= 2 //Command staff has authority - if(owner.mind.assigned_role in command_positions) + if(owner.mind.assigned_role in GLOB.command_positions) power_multiplier *= 1.4 //Why are you speaking if(owner.mind.assigned_role == "Mime") @@ -210,34 +210,34 @@ var/static/regex/multispin_words = regex("like a record baby") message = copytext(message, 0, 1)+copytext(message, 1 + length(found_string), length(message) + 1) //STUN - if(findtext(message, stun_words)) + if(findtext(message, GLOB.stun_words)) for(var/V in listeners) var/mob/living/L = V L.Stun(3 * power_multiplier) next_command = world.time + cooldown_stun //WEAKEN - else if(findtext(message, weaken_words)) + else if(findtext(message, GLOB.weaken_words)) for(var/V in listeners) var/mob/living/L = V L.Weaken(3 * power_multiplier) next_command = world.time + cooldown_stun //SLEEP - else if((findtext(message, sleep_words))) + else if((findtext(message, GLOB.sleep_words))) for(var/V in listeners) var/mob/living/L = V L.Sleeping(2 * power_multiplier) next_command = world.time + cooldown_stun //VOMIT - else if((findtext(message, vomit_words))) + else if((findtext(message, GLOB.vomit_words))) for(var/mob/living/carbon/C in listeners) C.vomit(10 * power_multiplier) next_command = world.time + cooldown_stun //SILENCE - else if((findtext(message, silence_words))) + else if((findtext(message, GLOB.silence_words))) for(var/mob/living/carbon/C in listeners) if(owner.mind && (owner.mind.assigned_role == "Librarian" || owner.mind.assigned_role == "Mime")) power_multiplier *= 3 @@ -245,41 +245,41 @@ var/static/regex/multispin_words = regex("like a record baby") next_command = world.time + cooldown_stun //HALLUCINATE - else if((findtext(message, hallucinate_words))) + else if((findtext(message, GLOB.hallucinate_words))) for(var/V in listeners) var/mob/living/L = V new /obj/effect/hallucination/delusion(get_turf(L),L,duration=150 * power_multiplier,skip_nearby=0) next_command = world.time + cooldown_meme //WAKE UP - else if((findtext(message, wakeup_words))) + else if((findtext(message, GLOB.wakeup_words))) for(var/V in listeners) var/mob/living/L = V L.SetSleeping(0) next_command = world.time + cooldown_damage //HEAL - else if((findtext(message, heal_words))) + else if((findtext(message, GLOB.heal_words))) for(var/V in listeners) var/mob/living/L = V L.heal_overall_damage(10 * power_multiplier, 10 * power_multiplier, TRUE, 0, 0) next_command = world.time + cooldown_damage //BRUTE DAMAGE - else if((findtext(message, hurt_words))) + else if((findtext(message, GLOB.hurt_words))) for(var/V in listeners) var/mob/living/L = V L.apply_damage(15 * power_multiplier, def_zone = "chest") next_command = world.time + cooldown_damage //BLEED - else if((findtext(message, bleed_words))) + else if((findtext(message, GLOB.bleed_words))) for(var/mob/living/carbon/human/H in listeners) H.bleed_rate += (5 * power_multiplier) next_command = world.time + cooldown_damage //FIRE - else if((findtext(message, burn_words))) + else if((findtext(message, GLOB.burn_words))) for(var/V in listeners) var/mob/living/L = V L.adjust_fire_stacks(1 * power_multiplier) @@ -287,7 +287,7 @@ var/static/regex/multispin_words = regex("like a record baby") next_command = world.time + cooldown_damage //REPULSE - else if((findtext(message, repulse_words))) + else if((findtext(message, GLOB.repulse_words))) for(var/V in listeners) var/mob/living/L = V var/throwtarget = get_edge_target_turf(owner, get_dir(owner, get_step_away(L, owner))) @@ -295,7 +295,7 @@ var/static/regex/multispin_words = regex("like a record baby") next_command = world.time + cooldown_damage //WHO ARE YOU? - else if((findtext(message, whoareyou_words))) + else if((findtext(message, GLOB.whoareyou_words))) for(var/V in listeners) var/mob/living/L = V /*if(L.mind && L.mind.devilinfo) @@ -305,34 +305,34 @@ var/static/regex/multispin_words = regex("like a record baby") next_command = world.time + cooldown_meme //SAY MY NAME - else if((findtext(message, saymyname_words))) + else if((findtext(message, GLOB.saymyname_words))) for(var/V in listeners) var/mob/living/L = V L.say("[owner.name]!") //"Unknown!" next_command = world.time + cooldown_meme //KNOCK KNOCK - else if((findtext(message, knockknock_words))) + else if((findtext(message, GLOB.knockknock_words))) for(var/V in listeners) var/mob/living/L = V L.say("Who's there?") next_command = world.time + cooldown_meme //STATE LAWS - else if((findtext(message, statelaws_words))) + else if((findtext(message, GLOB.statelaws_words))) for(var/mob/living/silicon/S in listeners) S.statelaws(S.laws) next_command = world.time + cooldown_stun //MOVE - else if((findtext(message, move_words))) + else if((findtext(message, GLOB.move_words))) for(var/V in listeners) var/mob/living/L = V - step(L, pick(cardinal)) + step(L, pick(GLOB.cardinal)) next_command = world.time + cooldown_meme //WALK - else if((findtext(message, walk_words))) + else if((findtext(message, GLOB.walk_words))) for(var/V in listeners) var/mob/living/L = V if(L.m_intent != MOVE_INTENT_WALK) @@ -342,7 +342,7 @@ var/static/regex/multispin_words = regex("like a record baby") next_command = world.time + cooldown_meme //RUN - else if((findtext(message, run_words))) + else if((findtext(message, GLOB.run_words))) for(var/V in listeners) var/mob/living/L = V if(L.m_intent != MOVE_INTENT_RUN) @@ -352,44 +352,44 @@ var/static/regex/multispin_words = regex("like a record baby") next_command = world.time + cooldown_meme //HELP INTENT - else if((findtext(message, helpintent_words))) + else if((findtext(message, GLOB.helpintent_words))) for(var/mob/living/carbon/human/H in listeners) H.a_intent_change(INTENT_HELP) next_command = world.time + cooldown_meme //DISARM INTENT - else if((findtext(message, disarmintent_words))) + else if((findtext(message, GLOB.disarmintent_words))) for(var/mob/living/carbon/human/H in listeners) H.a_intent_change(INTENT_DISARM) next_command = world.time + cooldown_meme //GRAB INTENT - else if((findtext(message, grabintent_words))) + else if((findtext(message, GLOB.grabintent_words))) for(var/mob/living/carbon/human/H in listeners) H.a_intent_change(INTENT_GRAB) next_command = world.time + cooldown_meme //HARM INTENT - else if((findtext(message, harmintent_words))) + else if((findtext(message, GLOB.harmintent_words))) for(var/mob/living/carbon/human/H in listeners) H.a_intent_change(INTENT_HARM) next_command = world.time + cooldown_meme //THROW/CATCH - else if((findtext(message, throwmode_words))) + else if((findtext(message, GLOB.throwmode_words))) for(var/mob/living/carbon/C in listeners) C.throw_mode_on() next_command = world.time + cooldown_meme //FLIP - else if((findtext(message, flip_words))) + else if((findtext(message, GLOB.flip_words))) for(var/V in listeners) var/mob/living/L = V L.emote("flip") next_command = world.time + cooldown_meme //REST - else if((findtext(message, rest_words))) + else if((findtext(message, GLOB.rest_words))) for(var/V in listeners) var/mob/living/L = V if(!L.resting) @@ -397,7 +397,7 @@ var/static/regex/multispin_words = regex("like a record baby") next_command = world.time + cooldown_meme //GET UP - else if((findtext(message, getup_words))) + else if((findtext(message, GLOB.getup_words))) for(var/V in listeners) var/mob/living/L = V if(L.resting) @@ -408,7 +408,7 @@ var/static/regex/multispin_words = regex("like a record baby") next_command = world.time + cooldown_damage //SIT - else if((findtext(message, sit_words))) + else if((findtext(message, GLOB.sit_words))) for(var/V in listeners) var/mob/living/L = V for(var/obj/structure/chair/chair in get_turf(L)) @@ -417,7 +417,7 @@ var/static/regex/multispin_words = regex("like a record baby") next_command = world.time + cooldown_meme //STAND UP - else if((findtext(message, stand_words))) + else if((findtext(message, GLOB.stand_words))) for(var/V in listeners) var/mob/living/L = V if(L.buckled && istype(L.buckled, /obj/structure/chair)) @@ -425,14 +425,14 @@ var/static/regex/multispin_words = regex("like a record baby") next_command = world.time + cooldown_meme //DANCE - else if((findtext(message, dance_words))) + else if((findtext(message, GLOB.dance_words))) for(var/V in listeners) var/mob/living/L = V L.emote("dance") next_command = world.time + cooldown_meme //JUMP - else if((findtext(message, jump_words))) + else if((findtext(message, GLOB.jump_words))) for(var/V in listeners) var/mob/living/L = V L.say("HOW HIGH?!!") @@ -440,28 +440,28 @@ var/static/regex/multispin_words = regex("like a record baby") next_command = world.time + cooldown_meme //SALUTE - else if((findtext(message, salute_words))) + else if((findtext(message, GLOB.salute_words))) for(var/V in listeners) var/mob/living/L = V L.emote("salute") next_command = world.time + cooldown_meme //PLAY DEAD - else if((findtext(message, deathgasp_words))) + else if((findtext(message, GLOB.deathgasp_words))) for(var/V in listeners) var/mob/living/L = V L.emote("deathgasp") next_command = world.time + cooldown_meme //PLEASE CLAP - else if((findtext(message, clap_words))) + else if((findtext(message, GLOB.clap_words))) for(var/V in listeners) var/mob/living/L = V L.emote("clap") next_command = world.time + cooldown_meme //HONK - else if((findtext(message, honk_words))) + else if((findtext(message, GLOB.honk_words))) spawn(25) playsound(get_turf(owner), 'sound/items/bikehorn.ogg', 300, 1) if(owner.mind && owner.mind.assigned_role == "Clown") @@ -472,7 +472,7 @@ var/static/regex/multispin_words = regex("like a record baby") next_command = world.time + cooldown_meme //RIGHT ROUND - else if((findtext(message, multispin_words))) + else if((findtext(message, GLOB.multispin_words))) for(var/V in listeners) var/mob/living/L = V L.SpinAnimation(speed = 10, loops = 5) diff --git a/code/modules/surgery/robotics.dm b/code/modules/surgery/robotics.dm index 31164aaf54e..62efb298006 100644 --- a/code/modules/surgery/robotics.dm +++ b/code/modules/surgery/robotics.dm @@ -575,7 +575,7 @@ ..() /datum/surgery_step/robotics/external/customize_appearance/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery) - var/chosen_appearance = input(user, "Select the company appearance for this limb.", "Limb Company Selection") as null|anything in selectable_robolimbs + var/chosen_appearance = input(user, "Select the company appearance for this limb.", "Limb Company Selection") as null|anything in GLOB.selectable_robolimbs if(!chosen_appearance) return FALSE var/obj/item/organ/external/affected = target.get_organ(target_zone) diff --git a/code/modules/telesci/bscrystal.dm b/code/modules/telesci/bscrystal.dm index b0b2941b3d2..0f9b205f391 100644 --- a/code/modules/telesci/bscrystal.dm +++ b/code/modules/telesci/bscrystal.dm @@ -54,7 +54,7 @@ // Polycrystals, aka stacks -var/global/list/datum/stack_recipe/bluespace_crystal_recipes = list(new/datum/stack_recipe("Breakdown into bluespace crystal", /obj/item/stack/ore/bluespace_crystal/refined, 1)) +GLOBAL_LIST_INIT(bluespace_crystal_recipes, list(new/datum/stack_recipe("Breakdown into bluespace crystal", /obj/item/stack/ore/bluespace_crystal/refined, 1))) /obj/item/stack/sheet/bluespace_crystal name = "bluespace polycrystal" @@ -70,6 +70,6 @@ var/global/list/datum/stack_recipe/bluespace_crystal_recipes = list(new/datum/st /obj/item/stack/sheet/bluespace_crystal/New() ..() - recipes = bluespace_crystal_recipes + recipes = GLOB.bluespace_crystal_recipes pixel_x = rand(0,4)-4 pixel_y = rand(0,4)-4 diff --git a/code/modules/telesci/gps.dm b/code/modules/telesci/gps.dm index 00999b47f7a..94920587b54 100644 --- a/code/modules/telesci/gps.dm +++ b/code/modules/telesci/gps.dm @@ -1,4 +1,4 @@ -var/list/GPS_list = list() +GLOBAL_LIST_EMPTY(GPS_list) /obj/item/gps name = "global positioning system" desc = "Helping lost spacemen find their way through the planets since 2016." @@ -15,12 +15,12 @@ var/list/GPS_list = list() /obj/item/gps/New() ..() - GPS_list.Add(src) + GLOB.GPS_list.Add(src) name = "global positioning system ([gpstag])" overlays += "working" /obj/item/gps/Destroy() - GPS_list.Remove(src) + GLOB.GPS_list.Remove(src) return ..() /obj/item/gps/emp_act(severity) @@ -35,7 +35,7 @@ var/list/GPS_list = list() overlays += "working" /obj/item/gps/AltClick(mob/user) - if(CanUseTopic(user, inventory_state) != STATUS_INTERACTIVE) + if(CanUseTopic(user, GLOB.inventory_state) != STATUS_INTERACTIVE) return 1 //user not valid to use gps if(emped) to_chat(user, "It's busted!") @@ -54,7 +54,7 @@ var/list/GPS_list = list() return var/obj/item/gps/t = "" - var/gps_window_height = 110 + GPS_list.len * 20 // Variable window height, depending on how many GPS units there are to show + var/gps_window_height = 110 + GLOB.GPS_list.len * 20 // Variable window height, depending on how many GPS units there are to show if(emped) t += "ERROR" else @@ -66,7 +66,7 @@ var/list/GPS_list = list() var/turf/own_pos = get_turf(src) var/own_z = own_pos.z - for(var/obj/item/gps/G in GPS_list) + for(var/obj/item/gps/G in GLOB.GPS_list) var/turf/pos = get_turf(G) var/area/gps_area = get_area(G) var/tracked_gpstag = G.gpstag diff --git a/code/modules/tram/tram.dm b/code/modules/tram/tram.dm index 6ef45b8cc44..109e820345b 100644 --- a/code/modules/tram/tram.dm +++ b/code/modules/tram/tram.dm @@ -84,7 +84,7 @@ last_played_rail = RT return stored_rail = RT - for(var/cdir in cardinal) + for(var/cdir in GLOB.cardinal) for(var/obj/tram/rail/R in get_step(src,cdir)) if(!istype(R)) continue if(R != last_played_rail) @@ -99,7 +99,7 @@ if(!T) return var/obj/tram/floor/TTF = locate(/obj/tram/floor) in T if(istype(TTF)) add_floor(TTF) //Find and link floor on controller turf - for(var/cdir in cardinal) + for(var/cdir in GLOB.cardinal) var/turf/T2 = get_step(T,cdir) var/obj/tram/floor/TF = locate(/obj/tram/floor) in T2 if(istype(TF)) @@ -115,7 +115,7 @@ var/obj/tram/floor/TTW = locate(/obj/tram/wall) in T //Find and link wall on controller turf if(istype(TTW)) add_wall(TTW) for(var/obj/tram/floor/TF in tram_floors) - for(var/cdir in cardinal) + for(var/cdir in GLOB.cardinal) var/obj/tram/wall/TW = locate(/obj/tram/wall) in get_step(TF,cdir) if(istype(TW)) if(TW in tram_walls) continue @@ -201,7 +201,7 @@ collide_list.Cut() var/list/collisions = list() for(var/obj/tram/wall/W in tram_walls) - for(var/cdir in cardinal) + for(var/cdir in GLOB.cardinal) var/turf/T = get_step(W, cdir) if(istype(T)) if(T.density) @@ -212,7 +212,7 @@ if(tram.Find(A)) continue collisions += cdir for(var/obj/tram/floor/F in tram_floors) - for(var/cdir in cardinal) + for(var/cdir in GLOB.cardinal) var/turf/T = get_step(F, cdir) if(istype(T)) if(T.density) diff --git a/code/modules/tram/tram_floor.dm b/code/modules/tram/tram_floor.dm index a5c3ec2a3a0..ede3013567b 100644 --- a/code/modules/tram/tram_floor.dm +++ b/code/modules/tram/tram_floor.dm @@ -11,7 +11,7 @@ var/turf/T = get_turf(src) if(!T) return if(!controller) return - for(var/cdir in cardinal) + for(var/cdir in GLOB.cardinal) var/turf/T2 = get_step(T,cdir) var/obj/tram/floor/TF = locate(/obj/tram/floor) in T2 if(istype(TF)) diff --git a/code/modules/tram/tram_wall.dm b/code/modules/tram/tram_wall.dm index 73c278f0ca0..b39417f5f85 100644 --- a/code/modules/tram/tram_wall.dm +++ b/code/modules/tram/tram_wall.dm @@ -12,7 +12,7 @@ var/turf/T = get_turf(src) if(!T) return if(!controller) return - for(var/cdir in cardinal) + for(var/cdir in GLOB.cardinal) var/turf/T2 = get_step(T,cdir) var/obj/tram/wall/TW = locate(/obj/tram/wall) in T2 if(istype(TW)) diff --git a/interface/interface.dm b/interface/interface.dm index 4a140769f18..e0c90e31efc 100644 --- a/interface/interface.dm +++ b/interface/interface.dm @@ -39,8 +39,8 @@ ) src << browse('html/changelog.html', "window=changes;size=675x650") update_changelog_button() - if(prefs.lastchangelog != changelog_hash) //if it's already opened, no need to tell them they have unread changes - prefs.SetChangelog(src,changelog_hash) + if(prefs.lastchangelog != GLOB.changelog_hash) //if it's already opened, no need to tell them they have unread changes + prefs.SetChangelog(src, GLOB.changelog_hash) /client/verb/forum() set name = "forum" diff --git a/paradise.dme b/paradise.dme index 01420a30169..952567f4894 100644 --- a/paradise.dme +++ b/paradise.dme @@ -31,6 +31,7 @@ #include "code\__DEFINES\construction.dm" #include "code\__DEFINES\contracts.dm" #include "code\__DEFINES\crafting.dm" +#include "code\__DEFINES\dna.dm" #include "code\__DEFINES\error_handler.dm" #include "code\__DEFINES\flags.dm" #include "code\__DEFINES\game.dm" @@ -106,14 +107,13 @@ #include "code\_DATASTRUCTURES\heap.dm" #include "code\_DATASTRUCTURES\stacks.dm" #include "code\_globalvars\configuration.dm" -#include "code\_globalvars\database.dm" #include "code\_globalvars\game_modes.dm" #include "code\_globalvars\genetics.dm" #include "code\_globalvars\logging.dm" #include "code\_globalvars\mapping.dm" #include "code\_globalvars\misc.dm" +#include "code\_globalvars\sensitive.dm" #include "code\_globalvars\traits.dm" -#include "code\_globalvars\unused.dm" #include "code\_globalvars\lists\flavor_misc.dm" #include "code\_globalvars\lists\fortunes.dm" #include "code\_globalvars\lists\misc.dm" @@ -1714,7 +1714,6 @@ #include "code\modules\mining\lavaland\loot\hierophant_loot.dm" #include "code\modules\mining\lavaland\loot\legion_loot.dm" #include "code\modules\mining\lavaland\loot\tendril_loot.dm" -#include "code\modules\mob\abilities.dm" #include "code\modules\mob\death.dm" #include "code\modules\mob\emote.dm" #include "code\modules\mob\hear_say.dm" diff --git a/tools/midi2piano/midi2piano/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/tools/midi2piano/midi2piano/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache deleted file mode 100644 index c1f743de53acb69dc05c2c6ee7e04ab64b94163e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6853 zcmeHMTTdHD6t=-^FoYJJNL>aH-C0Fih|Y@DD5glq>Yv51U!$7agzj59Nf zaS;70{RLHjVtdZ|f-!{l!M1qtT0S1;_MO}AeshRKBaz5IaN#drcZWc@Tg;I{iITQ< znF@%P*MZA~l@`7)_-1A!Y3@>~nBeQF1#2EZNi!XII*@do(?Cn&CC#0n=rQM4S}TZS z%GZnYi>2k#N-33cm*>eM89~U^FCe`MnCBwiCf8Jo%AO>Z3YAul$W2}ew7L(A9}>?K zRqDQ0iuy&bwsEQ{N3GNZ%uWklV&yFJ=(Iz)%Uq&qb0+qx*;3$nSxJ0a74o<_R3Jqd zyLV|UD?AtMeTyFO zKD&O4M_2mWSD7BzsdR^$878Ttg=ADsR$NVFo)YOC?GSyWCd(Zi;}t1N;32eXO42e@ zTGlQW#KAC4(Sd+_4x;90Oe5

    +o1d;<*=JK62AiienwHmQH-G&2Qg;c1!<%`M!7a7p#A17*C0i&^1zX+ zL{huOV{L1DqtK#<$rE_ZC!5@|!6P?L&yBBOpFh&C><PtIAi$NKr0*+Y#9+aa>cqc8=o1-Nv zDF^;!Im9`l@vqUYNf2|Fb#8L|PjEYfQnU7_K(H zfz~kSX553u7=erTm#H^gqTwNQ;2z$|ttRC&Tn zLb}!#oDd*FE+f_!#5Ba21)NX4x2?rtB@JP}>nm)AXcEFc0$8ta)?zw621MOA#Ec}6 z&*jk8CxBe(8}c^QA*up34Jp}j>8nG-CWTVL0Ln7a`__cClC+L($`jq&yD9WI(7DragC+Ytb~Fz+&SmQ9Q4ne6|OIT*3OL= zFy4)0!q2eJ#95A1k?3N1^xQ~7*9Y)yH%<;k#@kK~2|N&l&iw@%r2En9pxFsL1mJZi aj2t54HT>7$DfD0eOBp+s From fb9a10a6812fbe85418e964a03918809a7ceed96 Mon Sep 17 00:00:00 2001 From: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com> Date: Fri, 20 Mar 2020 23:03:27 -0500 Subject: [PATCH 05/16] More storage alt-click storage fixes (#13145) * fix not being able to open secure wall safes * add fingerprint handling and bag-opening sound Co-authored-by: SteelSlayer --- code/game/objects/items/weapons/storage/secure.dm | 1 + code/game/objects/items/weapons/storage/storage.dm | 2 ++ 2 files changed, 3 insertions(+) diff --git a/code/game/objects/items/weapons/storage/secure.dm b/code/game/objects/items/weapons/storage/secure.dm index d38c3c97dac..357cb043ca4 100644 --- a/code/game/objects/items/weapons/storage/secure.dm +++ b/code/game/objects/items/weapons/storage/secure.dm @@ -98,6 +98,7 @@ add_fingerprint(usr) to_chat(usr, "It's locked!") return FALSE + return TRUE /obj/item/storage/secure/attack_self(mob/user as mob) user.set_machine(src) diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index d79a121e685..1ff2b2f2c56 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -88,6 +88,8 @@ if(user.s_active) user.s_active.close(user) show_to(user) + playsound(loc, "rustle", 50, 1, -5) + add_fingerprint(user) /obj/item/storage/proc/return_inv() From c146265863f6e64e0755edcbaa46f44c148ec2bc Mon Sep 17 00:00:00 2001 From: Kyep <16434066+Kyep@users.noreply.github.com> Date: Sat, 21 Mar 2020 04:04:37 +0000 Subject: [PATCH 06/16] Fixes #13149, tweaks hunter pinpointers, adds dust smite option (#13153) Co-authored-by: Kyep --- code/game/gamemodes/nuclear/pinpointer.dm | 5 +++++ code/modules/admin/topic.dm | 23 +++++++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index 6e1defaccd7..e8f4c22e377 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -88,6 +88,7 @@ name = "advanced pinpointer" desc = "A larger version of the normal pinpointer, this unit features a helpful quantum entanglement detection system to locate various objects that do not broadcast a locator signal." var/mode = 0 // Mode 0 locates disk, mode 1 locates coordinates. + var/modelocked = FALSE // If true, user cannot change mode. var/turf/location = null var/obj/target = null @@ -121,6 +122,10 @@ if(usr.stat || usr.restrained()) return + if(modelocked) + to_chat(usr, "[src] is locked. It can only track one specific target.") + return + active = 0 icon_state = icon_off target = null diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 07dbffe827c..340acc52ef7 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1905,11 +1905,13 @@ ptypes += "Crew Traitor" ptypes += "Floor Cluwne" ptypes += "Shamebrero" + ptypes += "Dust" var/punishment = input(owner, "How would you like to smite [M]?", "Its good to be baaaad...", "") as null|anything in ptypes if(!(punishment in ptypes)) return var/logmsg = null switch(punishment) + // These smiting types are valid for all living mobs if("Lightning bolt") M.electrocute_act(5, "Lightning Bolt", safety = TRUE, override = TRUE) playsound(get_turf(M), 'sound/magic/lightningshock.ogg', 50, 1, -1) @@ -1927,6 +1929,7 @@ M.gib(FALSE) logmsg = "gibbed." + // These smiting types are only valid for ishuman() mobs if("Brain Damage") H.adjustBrainLoss(75) logmsg = "75 brain damage." @@ -1974,38 +1977,34 @@ logmsg = "hunter." if("Crew Traitor") if(!H.mind) - to_chat(usr, "This mob has no mind!") + to_chat(usr, "ERROR: This mob ([H]) has no mind!") return - var/list/possible_traitors = list() for(var/mob/living/player in GLOB.living_mob_list) if(player.client && player.mind && player.stat != DEAD && player != H) if(ishuman(player) && !player.mind.special_role) if(player.client && (ROLE_TRAITOR in player.client.prefs.be_special) && !jobban_isbanned(player, ROLE_TRAITOR) && !jobban_isbanned(player, "Syndicate")) possible_traitors += player.mind - for(var/datum/mind/player in possible_traitors) if(player.current) if(ismindshielded(player.current)) possible_traitors -= player - if(possible_traitors.len) var/datum/mind/newtraitormind = pick(possible_traitors) var/datum/objective/assassinate/kill_objective = new() kill_objective.target = H.mind kill_objective.owner = newtraitormind - kill_objective.explanation_text = "Assassinate [H.mind], the [H.mind.assigned_role]" - H.mind.objectives += kill_objective + kill_objective.explanation_text = "Assassinate [H.mind.name], the [H.mind.assigned_role]" + newtraitormind.objectives += kill_objective var/datum/antagonist/traitor/T = new() T.give_objectives = FALSE - to_chat(newtraitormind, "ATTENTION: It is time to pay your debt to the Syndicate...") - to_chat(newtraitormind, "Goal: KILL [H.real_name], currently in [get_area(H.loc)]") + to_chat(newtraitormind.current, "ATTENTION: It is time to pay your debt to the Syndicate...") + to_chat(newtraitormind.current, "Goal: KILL [H.real_name], currently in [get_area(H.loc)]") newtraitormind.add_antag_datum(T) else - to_chat(usr, "ERROR: Failed to create a traitor.") + to_chat(usr, "ERROR: Unable to find any valid candidate to send after [H].") return logmsg = "crew traitor." - if("Floor Cluwne") var/turf/T = get_turf(M) var/mob/living/simple_animal/hostile/floor_cluwne/FC = new /mob/living/simple_animal/hostile/floor_cluwne(T) @@ -2018,6 +2017,9 @@ var/obj/item/clothing/head/sombrero/shamebrero/S = new(H.loc) H.equip_to_slot_or_del(S, slot_head) logmsg = "shamebrero" + if("Dust") + H.dust() + logmsg = "dust" if(logmsg) log_admin("[key_name(owner)] smited [key_name(M)] with: [logmsg]") message_admins("[key_name_admin(owner)] smited [key_name_admin(M)] with: [logmsg]") @@ -3451,6 +3453,7 @@ N.mode = 2 N.target = H N.point_at(N.target) + N.modelocked = TRUE if(!locate(/obj/item/implant/dust, hunter_mob)) var/obj/item/implant/dust/D = new /obj/item/implant/dust(hunter_mob) D.implant(hunter_mob) From d64b50f550300d3a172a1ae1fcbd38567ede4459 Mon Sep 17 00:00:00 2001 From: farie82 Date: Sat, 21 Mar 2020 16:54:38 +0100 Subject: [PATCH 07/16] Fixes cling sting types not initialising (#13159) * Fixes cling sting types not initialising * syntax change --- code/game/gamemodes/changeling/evolution_menu.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/gamemodes/changeling/evolution_menu.dm b/code/game/gamemodes/changeling/evolution_menu.dm index d2b1cdae519..9c33ffaaca5 100644 --- a/code/game/gamemodes/changeling/evolution_menu.dm +++ b/code/game/gamemodes/changeling/evolution_menu.dm @@ -12,7 +12,7 @@ GLOBAL_LIST_EMPTY(sting_paths) return var/datum/changeling/changeling = usr.mind.changeling - if(!GLOB.sting_paths) + if(!GLOB.sting_paths || !GLOB.sting_paths.len) GLOB.sting_paths = init_subtypes(/datum/action/changeling) var/dat = create_menu(changeling) From aa441ebf65755b7ebe68e1e1cc8d80047f6c0cf7 Mon Sep 17 00:00:00 2001 From: AffectedArc07 Date: Sat, 21 Mar 2020 16:53:27 +0000 Subject: [PATCH 08/16] Fixes pipes not rendering (#13160) --- code/ATMOSPHERICS/datum_icon_manager.dm | 10 ---------- code/__DEFINES/colors.dm | 9 +++++++++ code/_globalvars/misc.dm | 1 + 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/code/ATMOSPHERICS/datum_icon_manager.dm b/code/ATMOSPHERICS/datum_icon_manager.dm index 23a4dab33da..2286b3523a0 100644 --- a/code/ATMOSPHERICS/datum_icon_manager.dm +++ b/code/ATMOSPHERICS/datum_icon_manager.dm @@ -6,16 +6,6 @@ // atmospherics devices. //-------------------------------------------- -#define PIPE_COLOR_GREY "#ffffff" //yes white is grey -#define PIPE_COLOR_RED "#ff0000" -#define PIPE_COLOR_BLUE "#0000ff" -#define PIPE_COLOR_CYAN "#00ffff" -#define PIPE_COLOR_GREEN "#00ff00" -#define PIPE_COLOR_YELLOW "#ffcc00" -#define PIPE_COLOR_PURPLE "#5c1ec0" - -GLOBAL_LIST_INIT(pipe_colors, list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_RED, "blue" = PIPE_COLOR_BLUE, "cyan" = PIPE_COLOR_CYAN, "green" = PIPE_COLOR_GREEN, "yellow" = PIPE_COLOR_YELLOW, "purple" = PIPE_COLOR_PURPLE)) - /proc/pipe_color_lookup(var/color) for(var/C in GLOB.pipe_colors) if(color == GLOB.pipe_colors[C]) diff --git a/code/__DEFINES/colors.dm b/code/__DEFINES/colors.dm index 13f7777d386..2bb53c91ce4 100644 --- a/code/__DEFINES/colors.dm +++ b/code/__DEFINES/colors.dm @@ -99,3 +99,12 @@ #define COLOR_ASSEMBLY_LBLUE "#5D99BE" #define COLOR_ASSEMBLY_BLUE "#38559E" #define COLOR_ASSEMBLY_PURPLE "#6F6192" + +// Pipe colours +#define PIPE_COLOR_GREY "#ffffff" //yes white is grey +#define PIPE_COLOR_RED "#ff0000" +#define PIPE_COLOR_BLUE "#0000ff" +#define PIPE_COLOR_CYAN "#00ffff" +#define PIPE_COLOR_GREEN "#00ff00" +#define PIPE_COLOR_YELLOW "#ffcc00" +#define PIPE_COLOR_PURPLE "#5c1ec0" diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index 5fd40bf86d9..32d6370f3d0 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -100,3 +100,4 @@ GLOBAL_DATUM_INIT(dbcon, /DBConnection, new) //Feedback database (New database) GLOBAL_PROTECT(dbcon) GLOBAL_LIST_EMPTY(ability_verbs) // Create-level abilities +GLOBAL_LIST_INIT(pipe_colors, list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_RED, "blue" = PIPE_COLOR_BLUE, "cyan" = PIPE_COLOR_CYAN, "green" = PIPE_COLOR_GREEN, "yellow" = PIPE_COLOR_YELLOW, "purple" = PIPE_COLOR_PURPLE)) From 284b7584323ec2223cf01e41bebcea61c7a12a03 Mon Sep 17 00:00:00 2001 From: datlo Date: Sat, 21 Mar 2020 17:56:54 +0100 Subject: [PATCH 09/16] Fix grey telepathy (#13142) --- code/modules/mob/say.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index 3b3f34fdb13..81d22e40a0b 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -1,5 +1,5 @@ -#define ILLEGAL_CHARACTERS_LIST list("<" = "", ">" = "", "^" = "", \ +#define ILLEGAL_CHARACTERS_LIST list("<" = "", ">" = "", \ "\[" = "", "]" = "", "{" = "", "}" = "") /mob/proc/say() From 5cb95359566434031fa78b5d757cd782d9759ad0 Mon Sep 17 00:00:00 2001 From: Aquilar <20759278+Aquilar@users.noreply.github.com> Date: Sun, 22 Mar 2020 01:00:57 +0800 Subject: [PATCH 10/16] Adds inhand sprites for the jaws of life and hand drill (#13124) --- icons/mob/inhands/items_lefthand.dmi | Bin 151695 -> 152689 bytes icons/mob/inhands/items_righthand.dmi | Bin 151143 -> 152133 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/icons/mob/inhands/items_lefthand.dmi b/icons/mob/inhands/items_lefthand.dmi index 3d02cfd7a58a3e738a9d13721d557f18640634d5..26cd5a1337b8bfedfdb65a1642fb166aae208e8f 100644 GIT binary patch delta 7526 zcmb_;Wmr^Q7xsW)fP!>~(v5UTDBTj$2ueu|-E~0aK|s2MK~Q?=96D6GyNB+fYk&df z8z0~Iy{_-a_wU=+IoDo$t$p^|=f2lkd&m5Ea8&RhmRWq-PtVXp-rC*L&CbQc&e;hB z@=0$_pNpmuCH|*OO6v)8ZTvD-Ox$kA{O&9b&NOYgZ?K}U5qy9s&WsTl<7>Tbxwx1s z6Q!A4W9FtOM>;RUn`R^+VI99$Zr}ru5Hp#zZ3YhA4a_(!2DrZMGnbifs?Z!;dFu+C zBUSDQcQc1o%3n}dkw$Znj+pD!d zP-FA^$=-d9>oaUX+|XL}(Ywj?BFk5dt-!mIj}js!Y$ll^x$Tw+q$hvhV5q*^xojCr zBz}xzB`Bd8Z{bK1r{PA#!@GhapPa{+kGN2Zp^hx(+0;~Vu53tJ_b!%5iFoar?J%La z^2M>2?}&t4)etc?j+MagYg67HVa8aVIU#<=6&|MMvo|6@`cAq7)>|+<4f2B2F!_?{ ztm8@RJgvD{AwJdD3ZIt+iBNRRpC)gy1w&V^DTnQX1?OMD1wSMT0m0>8gdc?jLn8NUCp; zbw_%w7snkn2j#t9qfc^959L@SKUpr7^53biFWq-)X<6V!2aITCfp6;Qdm4lf_xEm& z;d7{yJl;v+3fDm9EmLYO4)HMy(VC-b2BNAlpS)n8JJh>^Oh;BA2SG_`NL#+Ta&3=@ zJ$SqcnWTsn^2a9EPIvaRzN@W`CnXlL_0r6m#8gla1 z`tiCC+Cvf zOlhipor)aI=c)}h4res)Ch+1Q675a>k>{)` zdV0RSt_&qVkMulRYbnELL*Dq~G$?&1^z0VI9ZAG>>7A+S;lvuYzDIhzm(9F>@bNxs z`y!G5umeJ95%^3ZpM%6g#{5xfw-Y;M+ue(3@)Gj4Q@_sKQe4eqd|xZZ=wmvb%3YgP z!m=(Yto=Q*alHG49vP#VFEqbd-ba!AjY{pa8 z&4``Mk;vLdE^dBD$#RyeX3K9rW{FJ6{!AP71QigeXgo?B0O4faWrgq$ZenSQ6MQ?~ z{PlAeadq52SkR9u%L++ZNSk~7PLnVzyy61=05=caKPh}$9-|YQzRW5peAi_cfKy6^ zK4j4~rQdRgE?&i0P2P!ODj$eRe`2!PR$>f1l4@82<({hsFa;Zf9_7|lk?L46($;wW zxM%jBd!mA%l;ODgt*4z-KH|6`S)>I2aka4;BXzn?K_AkXG}ciocn@Ls#n7-%cf(9= z;ZDQY3H#f1xS@Ff;YLO?exM)~&;z2;RXi?GdiAst#PaorowWgr5{#gDmvY9o&5G8{ z1$~QS@k$55`Q@1XY%g_M39mF-Is*9O|Q=1`|c~BK(6yO!RPCi|LL-h?y z6PGdzzeyu5w(eEzb4EPL?y&@0M<%(WH@UoV<&BSfN{mNZcqvKh9k4b9fp`aPT2oEwkfpUJjj zCjAYiCB$IF3zSv2l5AUoD{ZCEc1TE++Jo3AtHgI)I-8A=@Zy<8=%MV&cc5lx z^l58t=>~T>YSV@t8tBAHTpI3fH0e}Z&M>k~o`uA&jILe(Ll*vvwW6A(y;1E$u?_QY zE=EnrQz|D#jwcEDz`!JKf%}qzLWKHQ<(-#T{gZpepJtyvz@x}7s8-rdN__BHCtux+ zjSg3oSnrwNdyBgT`&;sNc$cwYA51ApB>8>Y1vRK1=;W$5ctM@$EVMIm>d&E{2K&gx zRZO%QJ0P$uuUq?cE+%CYZApLs=INbK|LqR1gtMD8J53f!K|t+Dij2~Z!2%+b5kBAna)E^~@$7Cw3Lh?r#=@7Of4OUH*3A6L98=j%ir?0aICaoU6Vd9=ZM zspU3Sh=&#fbbw30e2^QFvII4r*J2LOJAJxLCJTk$dz75Ybb7x^Q@{AN7q3}hvItJ{ zIAdD1yqGAQK6AL$4VnoRoEMyW^bZM|FNb;Q6B>&B+;1mI+-l)T2Z@OFP6Jt`?+`yT zd3Iv#j7XQLc(7wEz8#l6u3>^;gVRe>c2=Ly6#g=+d4MU`=xPX#{i$bW`I?Kz%)@V6 z4M7m;Y+0(`=%R*f3g?QhIz^UTeHhoSLa$+f7mYsS)7YLev#qyqLs*DL>Yned>X%CE zy~j$+K0baIr_U1}J^gI!adR4Qrq8Ru3buB95mTE~fvYZd{*Yr+?sDC4l=dpQvg0@jPs;m0c(`nDQi1yXf8X%5z$E zGn~wxf9}L$%Pjx2CbO#1)QGjeU~iL;#LA}*gjK)OO~+4b$AD#!gY01U~2%dvtuY?%f4|LHfJk} znA=|hZ}QD}nxHAl{eD`L|KhkhD0sXgl($l8mX3A%`3gfzfm@Jiz}3y_%Bpkg!Zo3& zbz#sU*Z1EaQFvh}Jgiz29yX0A&`20vsCpuH+ZfR#7EMXTBww9F$*d4YoE~K$H{QtuLm`K2db;bn{FMU z96UVMH4(&_gvWbeLAP9vZ{VMsa5!8=Tx-BwXs3}de$k0}O5+$ZETc=tG^1m5t)VkuJ8IzW31@CST0yd;Vf!#Xb}=?K)-yBP zt9NbxrFdk%Q*ZyhrF0P3-rDW|I-m3Ls^=`4J~rrT(xk!r+_A(&KfQXs(V%k;+&8u} zlKtAu3@nB$ADG3F)zFA?1%AbJQ4cAmTj3ALWnDdgMFZ`fV4;W}|M|P?gG`F4*r@K2 zfJ)B15Nuc7vljG_=m%~m=8w|iAiWDdN?CYq+vx{WnR}_#KGlHFq>=m4`y=kv77?Ss zDzK_8WWyP4DlRTwSW==fD|Rc5QiV4QJ#xxNUl*%Zgt9 z+)DZQ@vwLGnfcYRzfP8tu**w^EDsxHYy#&i;#pWWE&8t#gZ8hg-d!FS;4ken%QiUQ zBkh~M7vKGW*c<4hnsaS_I=Sbu6EiN^q5(-yPA1G_zJaq{wd&6~ChoQHhckkDzN zk-i>g&Vq+vpm<201<(8#7Sll{sPjBxUh0>-;EFAPKemFxVssy$oJ>nkryW?l^)1Un zzDn-Kc9Ga7G6y$?Mxkb55vP}gc8rhtlai7YLDBG}auag|jyFXtoRlgUyAvpt9 zA_ksok>kbh`vhH&O^t3|12Adm9&Y3wJxBaKnHX}E;5(nIbhH)4iX59s)8UPGiDApU zhlf|E9*7VJTT{u__Gv>B>Cu-!Mi`s&hfwsQns4iXZpfnZ6_S93qgBX1m!bW>~P7Bhx_IBVe`uNnBZUv&qajZgza5lei- zlVU4YS%;=~WH~Paq%V65g=&r+=%zkG_ceRZNQ3#3iS<5fD7G;0WLRhTIuV+RG=5rY>3McsEN7)B|U4#vdK%ydhvx&Bz_)yWW-tQyXK=2uJ;#a`oU=$ur{$JY4JnyJHyh zxNbKawe10m#t*MJk9nyWov*mvG9kp#h>{IS{U3{HpUCCyi<_yhXQNZ@39~sVE$C7o z{H1XA3^ui_2y`h1=)|NXBWTz-1JoN&&*C)r^soq(w0Xi&W*G(;6Q09c>hlk!Onqm6 z?ATMONK917ZGJ&PmK=T^EWX0z{at^pFc!7sudb_|+j=s4gq`?mssnOrgV&N}xw#6y z(wX!Nt>%8Rqe@bi(HwPGLA>zvx(=T?WZ5BjcAPC^F6?kfR;XSxk)~7sD|)xMav@B< zL&G-CjToF!3TH{le@jOJh$5^@B91%4VG(aYm1;z6*Dt4duL}t;Pw+ezNp{I1hv$WJzaC9sZtrY z!Rm6lv?%mOV*sJKx=bsjJ@JEL2w8OG5=~9GX-L&4N9d$&w)(T~-JilOK3P{VWIIZS zN)vXVt))CTxg^&A#K*H&kCZboNO5x;T-!XC+>{7+^e#`6HgWb=i+G0cY+8-VDJzbC z&8ZJ8(;xUST}GWV`DBQpRaWayfGd>qdb;cFy|vtvgGwWiR_$JJ{4?LTRZ)LRbmPRp zZxpi63``Hz@D^@pByKrda;d4V-qPzL__i}W!gh|SRX-lpfWlK<66zUMnal06(Sc zin5tX@MIu{i<@LMH8reFk0D7(WJodMqyu^UJ>+DG2@BMq)okBOrO|5-kN#v-Y#v4Y z(1Yd0g>R+nKAa5gG$Nz(hIqt@dwx$M+PVXfGlf(LBu%-sUuyA|t$#krG)>LOuB;Rg zblNrKF|B52>Y^wk>r0_AspmKZP#S^X;6vI*MyWlGYx1U{Hy+ESy;|#Hx-((d_`Mpx z%Lu9a~~uWN&$^=703zsk?blig7FLkB##Y z*ACUYwUi78b=k`uw4vnLmOScnpP!NDNNCw|NhBwqld9)yKt#5(0FR4g&i%q2kNEDF z#d`s4vorf4uM7;gc?MkL7?e&W?6Liqo$|m z4{n0TAKY2aiWOt>-ve8vnW?D&iVdT(C z%QdgmD>%szf}D>X5b#Yo`{KV|c+p80l~m;Cw)O@W#H{P{<5~6NZKuf5@$sDV^K-1) zGiY(KP#jF}K@5ZwbLw>RR3h0%LJc98nmPOXPGgv>%BJf5?S2u(eZ$Ji%Jf^98YegR z!%o$Jvb~<(UN^@KRIXZz#K+X(3OFwa1YKL8{7RE~zPdE`JG&u z-D&lS&1-Sj*@Nd7cl42BI-#>~3Gq3iWsA9(m&`NcD+mO_$Kd>od5)mQPdl~8wc$_q zAh1p~1_RFh02TQcdg;5Aav=uCLa#KRX%FsevRvchXw_!ukY6kGRvB)$F|`ozouCSf3slGUzV(o&&f}& zwxeP|NMp28H90&N0UM~6f)k;BuYAx$Fi=4KBj$}nGudEsMVD{I6O**X_0*Mfi|e2k zO=qmc^z&W{tFFM@P_VCo=?uab0kjP15?it#>SWyIRBbHUj1lG)Fj+v17k5pHmC2ac zJ2ko%&(29sEG#TIAIZG#82EWUl++*88Gm4PrV+tIL0W+YlC4u;l#`|pk!^Ez#+C$b z1CBrCI5;6VWQPJ4ZTC8x1s9Qau0)cwpB$V7jRC(%X73_qQS`?SG7zX3=xyAstH}yP zq%e)z_|rgEqyL$5t40sk5;3qzcD{<$^fj)si4tToz~fOI@^g%;T5r}I=sw%%1H%C9ZD~fd& zWLSma%GDsRb{}O*$Ops(O+-gg%3=9pV^#v?^b$gxgyK)PtC1_Wtpx*ysT*M$qG_(R zHw9A_(L4+aNn9`xHptN0l8YL4Lq&Ux^XDsNTu6r>9{L95G3y@*Z)UXbL!^FdaOtpAg{W!3*D$AMUY#6;W_GRLu{cyd)sg&>@E>4;lX!wRfB{H8l`x-L zJgo}a|LQ_fMP|C8Ly_b@QQ85~+SHhcuC z)!^GP(K|RencZ@F`6aWsxkvppvuHWnS#Yj(CcfM~aBpj_KipMEZck&QDa-rgUgD6X zR&GtLa#D~xYP8|YZ7~*xe@wHm&}RkdmzqM|R0QqcO!8^cPINA3uQ}N1IXRW?AP``o zkjFnR&(peYf=&<(EumdiWWO?fueO&W*84hRrqadTubNt0>)xE+X+m=%yVO5W1 zj-nP;)zPAV8s*Hm9iN>UgH~@%zpT%3*PV$<^sQW`=1O1~sRj&Qdu&{a6GWo_GUW14 z(u3gR&8z24FE~UWy;osI;-7kK_~f*L$3wcWNtl>T~}+TtMh@Px;KAwNR|%+ z)%iZWD2hgO2cDKv>O%;1XuLeg?D=1#mlevau$L&L{Dn|9(e>UbosNsM;X@v{6fXq-$nM zIesHKam&IWCByg1uIeC?&*OAUyTqiHw-7r}NZc=IL{%eAs7FXxIM<4J={(nSuxA!h zOqzwZd|MSABS0%t+AQYz@n-^|fItoL&^Z2Zuk=!{Lw4gv4FG%Uj|;B$wXl%W0TV4}q5pn;zSfhboSgREnJT5SrsD_# zFHgJm!q@RRhlbFFSyplu78XSv^-%Po*vB4igD(jWVXyU0i&bMb6|4UwzW!ppMA?>E zepc46PZSN!TeqkK(fa!RHKm|mS98O|7CSpT)&58)Oi+qU55D%tA3*ZDRR^qxzgS;5 zKmu%qk$)@9A&AQWqzvVgCKP_tkDS39a(dFl`;ureFtg-ceabYoTEqJL@d9mEGBnGX zU#tJY{W6nAuM%Bt?Y9JurLo5d;>p2~0kWMdkyZl?lKQuODk>3@$iHiMKb&L*1y@n2 z|C~iAfcY4e7Hln#Eg5V1N<7_Rd~fDAITfm delta 6525 zcmc(BcQl+^)b|jQi-hPAEhdOAAwn1>jNW@ULP7{8YV?QX5?%D@BuexWMrU-RmoPff zOLSu}j8E>m_gmke-}~3Q*E(nY&VGJp@4fck=Q-!#J4tjl$!GTGgWh^ZZqV1R)-HDM z-0a{^AdqKTQ`$@vqbOBynQexwk`qU}Fw4WK@VcpL(Z9-{TONTT?JMh3>0-k2n^Esc5+c!3YCCf}N@%5dLTxC@?FQ;N zq(3%a$+jiE?+c$`NbyS?e()fUVQt+-xs)K#VJa_>fD+EIS%R(n1?a7tk^S{{dt&zX zS7c>BYk?s7+3MP9o3?omGNO}OHdoDD)aS0#O%%6^1w>%i-vYlZJDi^<+`a63n}dFr zpg&ne*4dVeAT_&kZP?N(3%tCbJT9VI1b$fQS$QXz@UV%)mHpKnGB?Gl&SJ?*Piky8 zVB=Im_S1{eoTxeP4L}i@J`kW?JRn|MDph6YVn-06U|>HzdgD#GJ2RZ?9rYH@W%0hy zl%vhsSpu!={B-VZz7n=-URz4?x+k|2e&3A>Y-qc^vQ}T;a(V9EaB(Cr9g4s#d$Vs( zAZJ7=`fA`TgQ@jK=#DN-OqQ!1BzHyak#&R+t7@(i;G*BWyeJ-`Ov~)&B zg&!4_$TiEQ!A)Q?qrXXvpw7*k2@Ftq?&C$GuVn5CjvZ$T492eOsXL28V&@r6N&HA} z!mQ6tIJ3LCY;2DX9@J%X5r0;r)MP7DOV^u15FLv-s~5!wJoL?y)%?{(wH)s`dX8lpk|oJ zVly@+R+#re3-zs1Ovi^u%Q7GP-h}cO6=hoY#eYI-vA4RcPb*D$-!wQ+D>dCrlt3pg zZY9;Yqk{UIM$5L zove5`eeU8oyjE9I>E}3Rk=*{4vHR;ti~q!mEUznKGf4ho?ecIZ72DUaI(Lly)gp*r zu)B@;IV5i7O1<2?OYOXX?u^4V3#83r_wH^G1kR(`hG?L=bVzR7As4tLs62Yefyl)dxiIa?)|iRK|{}HCbSt)ZwePlx}3f64lliYVkgR411}_sb-g!OK95d1Es71?uYTgd^+!q#E0y9K5&m|s1?kl zq`xsw!ju*P3WD>`kf_a0Q}Re|_aL7;Vbf+eh~KK939=N}MMSio-MAZa|BFMLSmrIU zRWY~TOtM=)%C`HcCB6xJiNsys#_S6il5ww&GtqlCAE1Q>UqL5WSx9EXd^O4mDF!J1m(x4+ZB}Zk#B^( zA5l#yDG`HH)<(n!Zdm+XlmF)UHp4!UNmf8e9H?S52i3{4S3}j;)8-u$ovPVy)$2v( zIuj|ZXuiI2pRQM#aAll3pU-AaCYf4W*8=1`eN<<~g@ z_Y?0E2OPgmsDhoZ}{hgMgl#b=VLSD^oE> z>(S%{{w(#TPe;uBdQ^NImN!?Ui0uUKYpv)=xp5D}C;ecstI<{&+o%;_w&8Lb;269g`NF%B! z$_J89wq%Fylylso8m3b`4Aa=wr%|MNgbs+znED}(!W6Ke&at+)PMM55YAV}*w>*rv zXQTLR=VM8COw`ji!mqU#F;F^@8?mYaBgAAAZ_+9Zlk6NwYOPwm8pVR9MEzB`18<~N z^l+`~>XIW*)Qp5H-EWq!kpp5jVClNQ*qQGTH^4{fo)kq5QI>;OZ``KMA?JCCR#T9) zGH`i}Ji+Xe{H5u@VKfl}jn>?N)%_g$$*`NeeX~9Eie886UE7r&0gEK2mq}>v^Abs_ zkoz3zRHN-Zs&H+U9*5NBR3@2cJwa8p)r7?;26It10UByZM|e}Fvo26dyLli(C~{t} zY2+eS?+~ovX5ONnsht(^>q>uaB)n$Q+U#4b4(|-@3HUXiRKp$KyOcdEXo2H$C%zeE zUjGRM;82*V^a%O(4g!(%_0B-ur0fu`_xEo0=1l^}A%qZF-7~$Dgq%!1!SP4g7cQmK z`ziTBDkE&kHr%1DS-^b9iIUJ8*@{~N+?6PCTk-y_deoe{u^SQ7X3u=fzR+6!7?-r* zUgG;c6oYu&Z5?@*#m|K+Pixi9ZP^H8T$>)MV|3XX{3wW29u>d9$sNLIQq*K3yn4Uu zKVdQUA4sk2wdQv*ZvemYsj>la!PjBSW_y6Zk| zR1lhS|fWhMuq2d5lS|1GBCKr!Q=6^TjXR z^0$8fepMY-n@MrF15cd@o6TV4hYYPBWu)cnUfoNKw!k#c>FnBv^Q>oL!hThI(_L+k zIC19geWqq&mLE4>dWk>4?%G81@QXGeq*QC9T`@!iZ#T4^mYU9IzD&RDg8F;L@mjmQN| zIYXhc&bu#DDo6qX0||10uxLZZAt+PX^P@$B%)V;vGP4q+dZ<7IjOU`*sJ_GS;6sj{ zQ}9^+_8dQm?C&2)Pah|}XC)=J@Qd~m!gmkXarl_xwPK7r z@HCS=oi#XXNpd=_nzK?p)UNi&Ali;n3_DtC)Kd)R(2wO8f0DpwT-Ro{5vts2k8S|O z%90s^{+ptauK0y5Y*mwN#oQzL!?yJiOCW_#bnpyYe|Im<;h-H0lPCvTde>a^X_1aI zh|0P&#<@c%zqMfZF_Cii{*`OYzGfR$sKU5|{2COTow2ifoC9(!jJ(F+k?*8e>}It| zALgxFV#N@SrsCL5H*b>*+lD#7wAf`0k4w1Dbo-p&b;1n{4U;;dAT{GxJj16QQ2Fkn zNc3N`yEwCh?c|zpRym-ZI){gW0Kd$v(@ zad?Yh(rN={S7T0{HULiJTyS?=zL|ArvKWs$aIah$yd3jy=~#9K#z#lNV6e5db;u>nD$|)LD79S>(m1PA#q5 zqR}Xj$|~Bz+A^rflfc8|^YsyL_Hg9r{Jc|r9pMZ@|5`a~ZP{)s&98ZUF^BQ!bEdn} zg=4~>!c$ihR)JiNkYbo0|8CJ9diY6n@zsZ(BH#!ykf)DDt@2WYG_E=}-nCo4` z*Pe~zJw`0}U2TT@&04wGYK)x_60m}r^8qL2ibj}#Eo|TSwR`ne1u53$gm{lJUH%uu84pMs)l<1^Z#V zBD5!rK#)ZOY{+@y2L)s4LV-o4$sdE3=9kyNM#y&TV=)T#1Z?iPSl|d zJNi8|E_E($fspK+1U8CJi}Zg&OfLz#w;wtz9 zKr+x3i3WkbsK0yU7`u8~Jjp2>@5M2P7I^w&SFBC-PS*;Yu~ND-wY(#^e!VE*SRWLS z6h;;~D4R1+$C03-%o)esP@)N8G0a8iaYva7USBGkV4TCOKu1b{P3qxUWAFNraOvN7 z>kyGKEUK=qKSX9cly`P^f{b>t(`jpKHhn8~3k~nfL^4U3$94!oTAJrw$k|gj&h%7; z86J|>IFx3u5^iC&vtcM6H~=6eK4;RgD9!uf^fbvAImOp2F!*q3&UWRRpqKWD69hsA z#Jo?Tdo`nR3)`Vrl#uk%$Ex>ia{C@xAnZ`DbmKeO89zV&54zm+JY$bb5Qr#88Tvv` zGzqg@2-se&wGYS^hx#@QOi7#1zNf>7=^{gdj5a_T^x*rk#kLw@e+LoC zg(XZ@`E)Wrvcn$mDhUaJj7#$1PK}1j1+!NQc1PNdd|)K{Y5DSb62z7-aSIuoUYALR zHEmwy=VC)G6W~#iwbZ2(--|}oQYV5Hbsq`Vw*_Y^WMgfa_3qP0F|KelN0;nkJ|uxx zWqbT6DH!|x8_?}qd3GSRy+4+|l@ZCy5r?`iKyvjdtZZq`7nkofHDrIdqrU(x>?4+U z0D-jlHhg-}Z3suz1tLUIQ8=X4HD4j0bofsfcr4Ffhlh$Yo&1$GS)k2vX;`B)YRa*B zF+^_&0zKyOJ$h{|kGoFgeH$OfxaHEn7hK%%z|t)aRv%_-wl_Ht3?C!DCo$_4H>+8qOZ%hj!Sob^4fFXq-4`= zr8q4rE#1RGs+Qz22>Io@PAX+;tk1CsNM*~Rz67TgAJGa4=vuS{GnF0nz+iYOAZ>AU zC9mE^nlhC0tWY28>oi^Qdj!qfOKS=u07VE@(B7HB_fvQg{@M2PBg#rL=xVB|4qwZm zC|bzS&4Z-<^Wh&Mx{Lh}f*u5X`G0WjEhHg*q{8+b@xRIdvf6(PfbK|=(rB>wg1Wl8 zTKRueo5w-~<$gGisi*tAl#~_Fl?B6SR;n0H776>WBw}Jmb5Q^P{Bqo@BY6jhmt7#N zi$X$tk9t3W!Bi>~^epXswtxEPAK~ikAwmwOOQ^B{TfwUUXWO?B;e{9_=w>%ie?_2w zc;{bU0CD#@)md2QtqmhKGUAF*2faZetNU zw)1{i^FF0_{gylnBX52x{Z|6nqqkN$BMGN2DDVx^27fD%A;Qi diff --git a/icons/mob/inhands/items_righthand.dmi b/icons/mob/inhands/items_righthand.dmi index 265230ad36988ef55e4ee7370183db01bf45bf37..78aa94f2907e719eef10903e284c12ead3275d73 100644 GIT binary patch delta 7055 zcmZX1by$>L(DwpTl8S`Vl8S^e5Uzr!W)k8J()67dw_6KO5F%u;DlkJk3+ren|_; zs4;tfm1?~~)S3VWHeL_;A$p7TinYhjU9;>YQwW#op}!TR-Slxl5)*yfv+7xDhn6)F z&J|s#G1U}l8J2y}d@bHB zV%}GR@zFyv2_&m}YJGjf2@W1`z7`F8(0{NLa2w-`%a}OANS9#&(F~1m7;}N(+v{fa z5SeJl@Az@j>G+79bz*&$<=g5GDbxwnTe4(i&xm}?_?&DXA(i=s zsXsZ~2y`QczBIRyOBrP0aTNKOMt)~uJ&^X1T?ow;Ncoi$32qJLS3S2N9%@hl$OA)? zjtY10VJ{cT^_><;Ae4G)fQM#lB+)tcK`tAA*u59h-t2;S{fUp)6};IGwFycE!E!H9 zU(l#{X$^N?VM3WKo;yvqK-DBEozj-N6EFClW(uubGa0~XtQ96-ZkL4n^H<9zf?8%O zTh5-rpOeKHty%Aa3)s%f`ZVgQB5LyT&-`oXe(DxCCnex>+SFMHVwiZCQvY))sa9Bl zINC{D)S1dH{kq#*e56uAD$Qg$!*m!re<$Wkb?13t#$hL0bB%lYz4zE0NvM-|&qAQB zEfQ7(+r!P_e1Zdy@y96U3#>d@;0AM3Mt-EbrLROS7PHtBY{{&%jjy5biicn~^sJ&B z>I4_ifQOZl7Ef+(oZvFk-iLDz{)z*9C+o{e_CLamQQlP1dt7WmXR{oSAS@hqv>bZ3 z1l&IM+K|pXK{=X-`$kuvrIdEm{^`11p2JJmV&wIb`n_wsRWOlUxfz9+wI#JnH&#%# zh5ndI_<07%bBl7Ke)Zvx>%H9&$dYKKAg-2$0yu`r(=XT|L#9En0A@it;f{JZmUx9* z9Sp+U5TsMB+LrMO-P60F-;z~d=;G$%;C(isX><`|@zymYY2-807-XoS5Ca;#4o|xI zwU#Jij#^9cm6;$(rX#EDk}iW0uQr`Zt9Ca&oHLkC z0R2A|?HR9kX}@q_qbG;oCygTg1y;YgK4Q>30*24fO2oBD0n5ZD57b;n!VrUUq;V{- zzdCj3_eF-X^geq@Cp%<(3S-UZ{PhBg+4X`>@HrGY&+9;VZHp3L(|_e42@nC&Bj30U#- zxT@di9nbs3-FI$;7H4!1NNfnwCisZ$Gx`riCirQNKA^CgR6RSD5vxvgzuH?=FQ{4MRU|~_0H$%mC z0l_M8T^X3TBd`-QT+a2FhQB>xqvJ#Jq{jo|aW;vyBuL~4uewpoN;YxF@L@zzGVw}c zI<4^nq%Oj-uv9Q^J&aR-u+jL6+Z3_Iub!t?-7M!4i8u8OZI`RHZcz_ipuH{gbti(m6MG3H!_v$#!t69>WWxgJ4 zyz2m=0iJl0z}2(hDs)VeX5U3i9Y0Xk#Yi0BaKO`o(=hN&7#(_g(*q{Ik1(?>@r&S|t>v$nl)z5E)r3e835{${pL- zY+>#ff5dTiX&ZJM#B_b$GmCu}R6P|rJ7BHQFVao-yV~N_S3-WjuXlOtG|xaC+3{8X z-e$%~FFiy`{blx8BeA2$qluDOJDn&>jztG7^DMVa)V?2YXu8LY-Mx&AyxNcYGvlr! z0yn-=9|Me9`?ur|L8ED_vm1@A^QtlWf)%ew-jKg`vqpd%Ym)}AMxbU`5t z$bDCUH_PNsMki!WGMYYMXY!tF6(3M_z7n+E&TZzeu{+|Q3>3Rg)L`DCytr>#hshsu zi3|HDn48;i6F<>t;^{rm{}_+wh$!UvPPRn{b$Q}+mFUm9a(!{sPWQN{m-n@x+pKYr zaa@eroq}$MtPHM|C4q6wyHi+8T`R3RV3$Es;V$A7GJ#I6%coCg>h85{qhUH0W}}j^ zB6_n=a*V^c1pDqe48oIA38dxl%fZ&n!HlQT7g=ewLN0E)>&w!7O7>5=+9OJI%Fz7! zr_R^by_&B;DJh$LUgX%_RsWVd*4HTCJMVj0XLD zhV-#5>kKQETt=#CfE385%C{Kmgo(J%A?0FLeZRkPoTky(>2oA#jPX!xZu}7dqI5JJ zYn6#PFP@bzy(HB`hw&F%y-Y| z%fst$2d;(>TqUX*xJtY(3B3JWij|LRenuMiCcG~DnqD!RfQNPhMJHwsy&31jNPZ(F z?crU6gvckutb8d+vXBrl2TfJ<%_hmDP^Qg(8(JYI8L?kZ1&i(l>Tohqy{&lA6unD? zAaUgQ@3Zot2|lou@7@{Aw>e|&Rannz#`2y&pqRsJZHdCdkS!2xK%`kWKJ`2$8G+b- z`XFq?6OKT9X&jbJH-l-J2ec@qNSk2eYbgjs#_X&a^r@Pf z+NR%Wd5Vxx_Ce5}{dpVP9?xd&4gYq`Z^n#3&4NP5WgZgP_RgR6$bd~9sBA952K}fI z5Hw)UpBC_@H5cG5tge2hIj&;x&^u`JRYylhL2fQ2KR>@3th+IV{gv|6)HGvydfLFm z#2%OKDkmA#_=wcbXF}+Mm~KP7%ve(JRsOzc1()?yiMCK3T9?7^tQJXTv?^3#8V%-~ zWgkuNK4g#zbU(|IaO%r4X+FOtEgDeqXbQiVGs^h)-HS+Is&e5l+0rGo$M~ZC`}tc| z4A_l9KxfnY-u1|RfBB>-Lu`8_17oBLPGNhr@!=c{2$8` z`g`&B&;FNQ74myYA^>`x@%s+kGrrGV~KhHHf>;_C}l1? z=~$`+mI?fAE0_ol1hW_E8>OH}4Q*~ozKD9P{b3lhM~HfKXy{{DSeP;W?4GgijBmA& z+gv_$jA1^|AYQRTVP&U%29Gx0I`b;FIC~5sY+~inNco)$c6Mqq!U=sz`?1=Agl$fi zZ>+EDxtDw5_f5|C9StJYUj; z)RP?n?P7YlDgVtnrr`eQFx?j|E}vb0~c#rP-II9*Us&*^3)Hh@xM5m!}273Ki@tg0--B| zo+SF`epl`f4=*ftPJX6fnY7c4O%=WSK);j2=zPUIph|J#@ZZqtuK~EO@IDKw%&g+M z-aR;l&}*01uM=)GEso=iD?+X6O^kS%Z``03e5X5+S$iLqm6cUcU0scem%E9R+cFE> zC4bwRw<XnpO+00rf9P640>y)*gHM zD#GFp`spjIQ3GICeA?Tv@1~yqY=T>0JNK`f`n3K;euXNnM7CbDYA2O|@`CWn%1Y<- zGhRjO)JBFYK0ZFTiliK=pV3=dSh&Dx9*@Wf$jHbbj};fY#u1B)FU5T}C-d4+nVD>a ze3y8-e;4o9Y9%Jssb!8u8cPxoD|YenfjKaHfu;VsfDg7O`*kxYWZCa_2ssGUvM?Ov zXI!tTu2DH(>V^1YA}TB-`6_s*25zljVf-X*hdVQ=D$w6zpsW5@Ls_m&HsX!3rlDa< zS#9m)^6Dx-W1C%DCNFCXzg*|BVlfx8IX+PJG?J>JhFoL9%+Hwy#5HoQg#-lRdX+5v zYmDSQz>XH-;VVmC?_-h}sLYB>y6$qA0jwC>HKAs4YDT!KxBo1M+r@cy*b*Ay*!VbX zAa_cL$O`a&&fR#U>B-7r*4Ei}N>-#NT-~xK=Kh#sYbk{Y?m{*Xhbx}GGT)jb0Q9%dU=(mX+HJfX5Pp5RoHd20YuTdpmPIx* z!PXilv_N!eCWsp-@G|s&WC29%cc}oE54IMLzn5>aSO{0b_H}|L7U4!Je`&fDTCU5J z`A1rauKY9e^2fsv5XZk(5Qv=q|9HL}VuOI_{+kj)Lh(O<5dDAW!2k9RKjk^&pOdT= zX6R}JlQFFgUPAG2IcZTB6f5BPP5c~BC!2#efy!reL z_SuMS`xS`j0%$%gK2%lwjr0BwM#34z0^gXq{@REHluwb+jlOnI|Mm4&eg7mKHiP4jd zwilLpP39l<1dBTPp&#|SRiLTS|6$S^6Zo%vNhtp-$Ql7G`AaJ(sGT1JF@Iqo+S? z+kEr-utyoXiYL5>=X?mWPxZ3M9A5ihK=Pf(FLgkE`dswtzLW$6EGkc_7P|VA2%pmJ zYcGs)ya-W-xEK8%9)2oryZ>6)yt;3swQVEnDucc2k=e0JPpbF#<0E`*!2zIJT?HWZ z%bvPLF$PIXNh%R^KUcGhBTi1Ev={0r$tx{hgRb z%uauvod$z1zMNRPF1-ZwoqZ}9%GQiC($lSjIcskQnR?EQj^@GP*DY;q^07mVhR9#P zG*C#B9}jSWWNBqpRfZ)cB@QkwaSD$|6M58vrsM^rW71vtV-k^H>pF}>eF`$f9#22# z5VN798LFuGSW&cHvJ$Gewy@Y~YM#bigZn3AznCQt8?n#k0xzT+`GX0>-r@SX5zlJf zxH)0fvdYTQ5#7^FTIDR-~gK4y-oQ#`CaS=U3q)-UrZE~?nu z+pYXN$c=uHRV7+?FfQ6W^mDlF;$hxtqkJKHv)aPqi4%wUlazfk!l9s77&}(q+@BD- z9{IW>it!FmhLAkZe&sFXg{|XXlRZhQv59t;oRbJBKk>$=$26yp_Q>KLW`y?OQT@u{ zT^xAcV4u|;WzX%Aw{(ghQqv#w+lkvje{IY7e}jFCW0xyPLyPb}s#!7rx|nV{HZ;V2 zA-zF9J3qb~a)L?}H!$2!rEO=w__WF-&h7RwEG`{znLmQb^AmbcFjVD{0T?+~jv~6; z&-yO)1Id~X+^SgX73?h)1$>`)d2^Xa^WxS1EIGsh83+U!R~HUJj1suYfb8|*L1FuM z4Z#8KtkGkPjGZOIrnBjsHMsIO4tH*S)8w-YmJis}0+p00umAdW{?@(dF!+aUTBEQj zK&ZowJjVdQVouUqF)LxW+Ubc6=avdy%VP7&V@?6`>o%k)^z6%m!b0COmoax-d(Pat zZA)hH54)K$QAOLU2(xu#04>#kPk#RVc_nrlBSBE5=-5l8*Ji&|IZk{lFTX#xViV(( zlO&BjgMiOdq+#b-UZL1c&jsBvUBJ+}rAZPXY~J{dDU{3YkJzNpkdr45_iFagWdpIS z(&<0LX*=dEcYksgNH7V^plaPe+bj6#!M!#{?`(nHAY)@=t5`lmO&pl6@3Moqi9pH! ze(`KWh7E)ab+LNMcFln!=C*%F7b~E$ws}kst+9oK+*!d$+a1zl*@16gJV@(p{_HG$ zV}&@AP-c+dG9aW$At3|vmfj^FY>?OBMc7PiH*|{+HjnB?4n&X7WpfNx(MA+my(5Sq z{iDtKF^r#yiOIOdR-v(Wy?ToA)$UDk#pkU@ zQuZ`4xVg^bL+395)s~n>6tbCwfhHKy%gTMaTiXS&Q+yzWpQ{ZY?=0~_e}=1Bj{R_7 zdYrU5wxUZ$+}U%uHjstMkn?rf#L#id=B20Kf(}aqCuO+ai=d$(_ft=Hv%l7l%P#9| zFekY*M1bPAmdmW$SZoM5D>Jj9o*LMNiJ*h{)a!AjKvR{fZ)44*`Y@US{gq2nI@YJu zw#YdevC3y6AX=}7)e$y`L(a$9ZcSIED+KxkP-%WnVmAMZno}HE4m!yvT#v;1A}3sI zp9f=UX*j(@?~YH;xLn3rol34X*Q2ChF34zM?}}d=J`S{BnO7>QLm{OI!8TwUp`s$D zKv7W{a#}({!g}+l4K?eZ6!z?*oBF1tl5#dK+oBPl!w2n66=5Gt6(J=hUG2aH#1;#B z<^@C3!2t56Vo+@hiPA)%0}!4OtrB zjjMG`$Ut{f4lcta6i&(XTxU4J%Lwp*IcHg-m*+}wKi32pgB;;o&e(=3Rk&AIpnrBc z!a#m!h^WbH?20!v`?uL`moq$gHn;K6$9cX{#<9j!CZ|4kd3w|KVNl>)+u=L z9XX6?bO|+GS{BoEp?b0S=XsVaN3gu7&7`#ckivrV7B7+G_+(&nq>3`i1jx#&cbX7k zWMs5I!yWjfS{3C?0C~bPGVnYA|5rIULCz2^;d&m#zO_F1O%}XJJ?I+HWdO=q)JXseu(4khz;TFHt=mkd|6R7 zCvaHqSn^L(>+IN-DVXy3adkkqNiZ6rdjA`N%?znx0U0% z)sDDBhAk=rl)rb0{W1|FMBs!-S(NkO2lNOpbcVxWT+O~z;2J?my-`xPH%C_3f~-Co zryg-V1K_;crTAx?lVv}SQt3gX7aYew!|4FuARwql=bg3ZI%a>e!hf6K8q`2wlMqhD zyOZdV!wl`sa`J~Jp4NB{?b3{K%!e#)a02vM$@7)SoWSUb4N}7Vkk&TB)pW$11k^%u zUj1kFN2$ueuSf!$StKP6^+H_Ec=Ya)2UBvp{mW$42mT}Hf|u)sIH~*(o_fxSODQT6 S#}?~fjzLv*R7#bs-uyq_d%-^d delta 6057 zcmcImhc{enw4XtQAc)?3^yo$>k?18#NHSUwC0Ydq6C%N~n_5Oi();j0g?dCYSyPxw{ZVzjGCT% z?OV`qC5CrLiPk1|UnIh~j;V-d5o`^Cbxf;_;*q(mrK((LDrCvXco|TrlbF%Y4wCmm z*U&Q#z-+rV3I1ngexXjbvhrkIzg{h)RRmEX8g-ldts$>bvA=JMb4Pr3N3)EC^joWm z*s{;9#&F&=x>@y$K*maz=aW}nN^wMMMYE?rptHyk5aXYQaaD3 zuM8?u;*BXjSrg*LC<6>e5oHS`t^|Ld=@7BGp0o4!k&UY?BHsjcTgMH?G#!{AcJ$Ed zxS`P~f5Y_0p!~$R4F3(VETN&upB^2J4_5S{Li098zC=8=wyI093Muq+MDTGg&@|y( zM8cj^x&%QI#QgkV`*;ETX+P7MJYt^a1$AX8NGOH-{mr|sE@F>}b+(1pNpy;y6Zn0!Af5~n~=V3Yfli^EGj2{3T!Bue<&_*Yj(XP4vNadpL$(e ze&cs)g|U?v4fP>4KcQ?MfclyVyR%%pHl0Yw&S~rz3v`lV*=x@++=yzEdB-FD%Q0}f z!0=bFon4{Cdc!&vo$UX{w1u|GF*-6ZUtkbg7Zt=0Oza-A784m*EtzjzM;b5I{U#Ip zBG*(S-s-B?O0_L`E&Z{)U8j)?TT$wFnVc!s6P(8soA2q|ch@iU&A=Fc)u=!?E02{=TbZmD_OUmo7*Fc){ z5;ZO!L_M{FR@jWC9z8KWVsKo`z=yRZdv0LcEvgO%nq!Y@?{*+hoZo-d4i;Oa@NX3^p=CJ~k)5hr7f}Ltn?pDR+^S z+h0cVIMzFl@_D((TCBPu`)pqMWZ!0(PveD1$iWO#G6&E1z1$QQiuCs;b_8R0YXCwW zRq#NE9THjMt--GIonDAh=z{xcuCdvf(S?qu@_+)-^l2i6V>dh6kj>@}j$Xk&H}4CB zv6LXGy%;oFb?vUh?uo}+gwTG{*z$T(x&Da7^w;bVogNFmL2j+8TcJ=njRPWZopY|# z6O(L>NG|9#@PKEic3dX6L-1~RJ8^S*T=JbO;($sum#`kk*+-tc;P`>)GOqU~SYDNl zw`gYYFZwqcV}_2-tbX)Yb(EP2Z@%_NCj{t^NR!!3+&eo}l&nkizV@x=R^qN?5j>1u z{wrN~(E}`YQ6?EFK2H!xisOsL>XhZ^8S-ad9{@!=$~>Eq9$WrM_k33{$&goO=Vu&U zbRK|xn;f9E{*Wf0l+OMx-rhjZU6BRsc0FTXH@DsOMuF(Ok8!BIYhe2Wz0f@!!>eM? zbFJEI%`NG*U$h~GU2MdN>fON-%Z|d5j+8(~7v)D08K3E!iC_UeEt`#lq(SG_3rWlI z_!X5nK1p66%RjfoE=%qXXOj1=jXJ8gOOhgUa>U8nr6h4MNs$mGDSYd>E7^^cn_v^h z;Y8kNB2y!E?g*dhhOw@iisV#M4qz@YnS(85tjQh3z^KCZ?S(A{6~id8!O`tvvzNx^ zJ4qz6T<;EQ$nGB}>#lWz2@%sg?c0>UFUeC)p<|;;?T8q@>XJn4JE>5RJ0i87z&lhLf$>#xO=D8Pd=Rv)o7`9gfRJ6?B^dWQT!_sPz; zay+T%ij=A*Hq$umvP!sba?26gjnCwY8FcKT?Kj&D+fGcbu_V5c{jy>uwc>lBBYdv( zxPxu|S*hsZ(5Qd)(=*lKEDC^@F=er0gy&aNMvH}hU??ZAJA5TvcM}cv$LSEgS-#tx zI}D%vM&8jaZug1ly8DMhwNbi97w5boSQB&2Qe;|5Kp1V~X8VffZ~Q=iG-+??2hx!p zCOHUq^oX$TZ#$E=D<_K$uT;S(DFtMy*~1_Sr?)Z+tyf}VeH7)E$lQVcSUJ8x?~nyp zyObNDnx7lFDn!ssK74(}U*t`v-czKcd6Ht<_fDs}3tEb|`NVY~)BFM_aBia)79rXQikA&X9FrF%Azc-P=zHkhi|K)H(6466Y@w?3`sgo-ZLG46NB>#Ogg^zRC2E7tf{%9)t*@ci@YP zuxOj`PRgO5u7Ww{R1>N2Wc$HL{I~(x0-t`?_3AQOVTS>X&@|ar!Acs7hM?Dw&6>^1ah!l8 zbmInm>mMFm33o}D1s`OblPI`*rJcmwA^Xw%xPYt=aZ{8+Vo18L-2Htj=!e3YmK$=ASrk+gYx@KNVII|2+GJ{5@TA zFG|wov`_LVs~QnvFu`owxQVa|KH56lIIC!xIi-$ep(>fmFXsrKxE3{W4UC$&Mzkge zI82x0RN`AGANb}oBxGAmRpzACyNN1#R6otWN&4kMwimbEQ}c}xaV6eQG#>>$93}D8 zdQ(LiM&tRxjxzO?ScJ+S z3U3a<+HBnFNgG0~K%@`SeYk(#tgg#l0pL2hh$(98fKpC(uw_Qkab`bHsW+#rgCS>Zj#;ASR&z_51Ujk+7c?1_y5iMof)) z6BGF3Vq;x8o3rGD)+suW_}{RJf4n2i4dqpyPpFMv*V7`IM)as`! zb#Q_;#ZNc-ZK^`~(8Ws!+lxzsqDd(anSX6PsSR2d=w8yOaj1IH)3&Qsp~E5b#Fu#$ zQd%#*i$^0k{*^;4e}>q@)Wki6)PJGQNVP-@Yul=5>~ zgp*ntwP9WR?41vKCaco}-*IrfYI+{_VT=00q5XK(mFGc5sTvAP1+`^doa8$9*oCd- z1=~`0;D(2k^s%rQTh%IW@m4F5&wH~~6+4)gySyfpSHt^yM}OEH7W~cv`V{0x`wK}!n7tr^f4Z%&9?^#*@Pp9gPjEteRH5VzeTk00uYo*C=fL&j?(PTAm8>A|{ zW*aN)w`iYfWaT~_18J{yur(6ARX2KeF&KUK&Y+9=p~uE8L@*SZSyWUsGVI{>9^q_N zvU8_QQ&Te$O$a`2Hv(WNnhf%Vphv;bs6m;wAFDRPq)~Ohd@CNR0s_sSL!8f@U0)q@ zsmjdk>~rZB4_i?9{A4o@8g@S_2B=TD(!Er64fhudsu(ReCj61>gl>SOncCCgoFeVQ z&f$D^!M%9VJe7VMSX=A$?H9S>1^#fH==R-D8ATfH&%s`wEzC)`|9==**2#3%L5U^Jt1q3`jv>F}%6 z8G8xn+FH5F;54k#j7sX~oVPdub!q7j;?TN>*xKq~qxD*nm!72$;KS|YRc>1j$5!SW zF)~K-neU*0=wc}g>Mh+@^__5@@s-|5_@a+nfX(Yc|K2B?x=sHCeC}xpy!_UVu)hJF zpIB3;NuYi)yqaHctqUw`k^I2qKtjHcJ7d26&uO4KDd=c@y%Uv&b59#;Zxmf>$sjHivE<71PbCI*zCdUDtJBi!6l$u|gTvtlP$<-J!OP9fjXzO`xuo((vpH{~kd4Fr z)y5meE0?{$n^7=T(RqBjrzo*{kh3`o#8ZGi8VV5wfIuMG)JyPBZ{^*LgzqC#X&?9F z3^M9;7C!SUB2mj{?(9e8l@iaC*0WOC+yU#pmVa=@=U$AJw@(GUN%Oft$L4 zpjf$-_yv+(-(VFnJuj>JCe;MnCbDUEkj4OQD=`SfElJ?CExLqguQ9gaD=<)+F7C3K zHI2-?VG}=nZi%wSpSMq{!==mF+{ZXqn$7q2WK>tS<9@#DHR@xNjS>K5l^O{~q+XLS zfBAc~Tk-J6b$jDaETt)KWw6*vmjX91s2-=(LUCCSNYC)=H1BGMdfSJyv9F`KQx!P@ zirdOeYGp?Xl>a#gTB%?0YTIUyG`Y#*L~vS?va%m{QmyE2k#h+sTK6c>1|3iaS z{u6^3E3c{mAdrjFZomxg#$Tyn2*b|*svl~AsQ;rwu8{mci7(^-ah_za@9-VR`jxTW zO^u^9F-fG^X_LT1in=g9WQy9VUb$hCY02AeLnD!7BW?FcoF~cYAcHT$Q@P#F|u)YQ~OK88!Pp3&1ls6b- zI(i~0nBL$pLHoTw9FGu51$gW@oA8WkbmtNx^)mDy{E6^ac0?NsQBi*Gx>LjI4K0M* zGXZi=(&@6IDH7vm%CJ|`51(&xFiWDly9Xk1@mlFuwJ)#cqwhAuWZ(I5T~4803|$Zs ziPTRT#i88dFz0B|42717eb#}8_El+$ej6iYOKxLj`>qwrJRBSv+m7gCtPa?x$lviauAARC+aEZ zfK5?;cGm$&#q;tV^F#`RKb7Jw^O^sIcX1V zIa8J|l5fc`zU$v333xgzEI;$EAS{h47~L0VxZ_uH_zB4r-%Bz;kd5GE&r)WFJ%d>| zI^TL)Fj}oHQLRKbC?E_!sw5T7DwcHGdIOOZnPLB!LKk#`9tsW$@;|c~^*$cDcq!Er zHd$7EI-`D^ic6MCY;9vVK=&tY(2Aum2tdnmuw=)xWwWFdPxtr4ZY>8q`Q=XT5E#qtb+wv? zZk4Ijx+Q&5Gsyp=P5-qQod<^)ODAxxIKR7%%Y9WfwQ@&k*VB5QWtEd}*eZzFmW-Fx z6xS5acN)NZoouUX7c}2j*K|=+Z#b5~&sU8*ap166x2e&&3J>@|(AJKAr1NIG{mMYk zuG2R8-=xM($FBv1?bz)tUa@QlEw-5uuLG1MS8)9r{A@et!~omL^^+Wv z*(CTklGRT?1QQ5WU@F}I&!ME}PvQ}`t%`HY$#vt?TlpfFhiu|eIKsPAS9JBfgF`T8 z^}3nu#%?Z;p%mOkm0?q((~t3sx+y5=w>FUH26%^m_}BGF`8J?BPs`qSJ|Q3O zEkT6f*16I0m`|55SdOZ3Uc$Ic!-8*pycTGx)y8K#z$Heq^M|a^jsXXy5loR)RaIT# zoi?K7M=jOA>Wu}C<8%IId|#R9h;(3j+D-0shj;#J*v9#IJ{+z;hm-y!ePF@E)^vgY zh?VGi4EJ3103H%dD|}b`c9knA|83J;dH37lZW~)$aWu{OlLi;?nxmtxHaay6)26>0 zbz5|}I9%pHu!-el_(A92fFMc8<+Rhd(t-<+`;gCOxa& Date: Sat, 21 Mar 2020 21:35:42 +0000 Subject: [PATCH 11/16] Automatic merge conflict labeling (#13162) --- .github/workflows/label_merge_conflicts.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/label_merge_conflicts.yml diff --git a/.github/workflows/label_merge_conflicts.yml b/.github/workflows/label_merge_conflicts.yml new file mode 100644 index 00000000000..d2a56e2ef3d --- /dev/null +++ b/.github/workflows/label_merge_conflicts.yml @@ -0,0 +1,13 @@ +name: 'Merge Conflict Detection' +on: + push: + branches: + - master +jobs: + triage: + runs-on: ubuntu-latest + steps: + - uses: mschilde/auto-label-merge-conflicts@master + with: + CONFLICT_LABEL_NAME: 'Merge Conflict' + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From de09a6011ec2e71f26e2210c950be84f67009a84 Mon Sep 17 00:00:00 2001 From: Shawn Hind Date: Sat, 21 Mar 2020 19:03:54 -0400 Subject: [PATCH 12/16] Update cloning scan messages (#13094) * Update cloning scan messages Clarifies cloning scan messages to make them more clear for new players. * Change null subject, not human, no dna message back to original. * add xenomorph condition * Update no ghost cloning message --- code/game/machinery/computer/cloning.dm | 28 +++++++++++++------------ 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 6a8aafb364d..14a8e2b6ddc 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -358,35 +358,37 @@ return if(scan_brain && !can_brainscan()) return - if((isnull(subject)) || (!(ishuman(subject))) || (!subject.dna) || (NO_SCAN in subject.dna.species.species_traits)) - scantemp = "Error: Unable to locate valid genetic data." - SSnanoui.update_uis(src) - return + if(isnull(subject) || (!(ishuman(subject))) || (!subject.dna)) + if(isalien(subject)) + scantemp = "Error: Xenomorphs are not scannable." + SSnanoui.update_uis(src) + return + // can add more conditions for specific non-human messages here + else + scantemp = "Error: Subject species is not scannable." + SSnanoui.update_uis(src) + return if(subject.get_int_organ(/obj/item/organ/internal/brain)) var/obj/item/organ/internal/brain/Brn = subject.get_int_organ(/obj/item/organ/internal/brain) if(istype(Brn)) if(NO_SCAN in Brn.dna.species.species_traits) - scantemp = "Error: Subject's brain is incompatible." + scantemp = "Error: [subject.dna.species.name_plural] are not scannable." SSnanoui.update_uis(src) return if(!subject.get_int_organ(/obj/item/organ/internal/brain)) - scantemp = "Error: No signs of intelligence detected." + scantemp = "Error: No brain detected in subject." SSnanoui.update_uis(src) return if(subject.suiciding) - scantemp = "Error: Subject's brain is not responding to scanning stimuli." + scantemp = "Error: Subject has committed suicide and is not scannable." SSnanoui.update_uis(src) return if((!subject.ckey) || (!subject.client)) - scantemp = "Error: Mental interface failure." + scantemp = "Error: Subject's brain is not responding. Further attempts after a short delay may succeed." SSnanoui.update_uis(src) return if((NOCLONE in subject.mutations) && src.scanner.scan_level < 2) - scantemp = "Error: Mental interface failure." - SSnanoui.update_uis(src) - return - if(scan_brain && !subject.get_int_organ(/obj/item/organ/internal/brain)) - scantemp = "Error: No brain found." + scantemp = "Error: Subject has incompatible genetic mutations." SSnanoui.update_uis(src) return if(!isnull(find_record(subject.ckey))) From e691ea2b36b37422b57cc0f3a943740503dc6bf6 Mon Sep 17 00:00:00 2001 From: Ty-Omaha Date: Sat, 21 Mar 2020 19:17:03 -0400 Subject: [PATCH 13/16] Paper Letterhead (#13155) * fax letterhead 1 need to add correct paperbins on map and resize logos * tweaks * syndicate paper on syndicate base * code improvements --- .../lavaland_surface_syndicate_base1.dmm | 6 +-- _maps/map_files/cyberiad/cyberiad.dmm | 49 ++++-------------- code/modules/admin/topic.dm | 12 +++-- code/modules/client/asset_cache.dm | 3 +- code/modules/paperwork/paper.dm | 23 +++++++- code/modules/paperwork/paperbin.dm | 18 ++++++- code/modules/paperwork/photocopier.dm | 2 + icons/paper_icons/ntlogo.png | Bin 9990 -> 6673 bytes icons/paper_icons/syndielogo.png | Bin 0 -> 7734 bytes 9 files changed, 64 insertions(+), 49 deletions(-) create mode 100644 icons/paper_icons/syndielogo.png diff --git a/_maps/map_files/RandomRuins/LavaRuins/lavaland_surface_syndicate_base1.dmm b/_maps/map_files/RandomRuins/LavaRuins/lavaland_surface_syndicate_base1.dmm index 279afa9713d..e00aedc8100 100644 --- a/_maps/map_files/RandomRuins/LavaRuins/lavaland_surface_syndicate_base1.dmm +++ b/_maps/map_files/RandomRuins/LavaRuins/lavaland_surface_syndicate_base1.dmm @@ -1789,7 +1789,6 @@ /area/ruin/unpowered/syndicate_lava_base/cargo) "ed" = ( /obj/structure/table, -/obj/item/paper_bin, /obj/item/pen, /obj/effect/decal/cleanable/dirt, /obj/effect/decal/cleanable/dirt, @@ -1803,6 +1802,7 @@ /obj/effect/turf_decal/tile/neutral{ dir = 8 }, +/obj/item/paper_bin/syndicate, /turf/simulated/floor/plasteel/dark, /area/ruin/unpowered/syndicate_lava_base/cargo) "ef" = ( @@ -1898,7 +1898,6 @@ "ep" = ( /obj/structure/table/reinforced, /obj/effect/decal/cleanable/dirt, -/obj/item/paper_bin, /obj/item/pen, /obj/machinery/atmospherics/pipe/simple/hidden/supply, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers, @@ -1912,6 +1911,7 @@ /obj/effect/turf_decal/tile/neutral{ dir = 8 }, +/obj/item/paper_bin/syndicate, /turf/simulated/floor/plasteel/dark, /area/ruin/unpowered/syndicate_lava_base/testlab) "eq" = ( @@ -6790,8 +6790,8 @@ /area/ruin/unpowered/syndicate_lava_base/telecomms) "ov" = ( /obj/structure/table/reinforced, -/obj/item/paper_bin, /obj/item/pen, +/obj/item/paper_bin/syndicate, /turf/simulated/floor/plasteel/dark, /area/ruin/unpowered/syndicate_lava_base/telecomms) "ox" = ( diff --git a/_maps/map_files/cyberiad/cyberiad.dmm b/_maps/map_files/cyberiad/cyberiad.dmm index 74e179255ce..7cf27593f6f 100644 --- a/_maps/map_files/cyberiad/cyberiad.dmm +++ b/_maps/map_files/cyberiad/cyberiad.dmm @@ -1619,15 +1619,12 @@ /area/security/range) "adH" = ( /obj/structure/table/wood, -/obj/item/paper_bin{ - pixel_x = -3; - pixel_y = 7 - }, /obj/item/pen/multi, /obj/machinery/light{ dir = 1; on = 1 }, +/obj/item/paper_bin/nanotrasen, /turf/simulated/floor/plasteel{ icon_state = "dark" }, @@ -16077,16 +16074,13 @@ /area/lawoffice) "aAI" = ( /obj/structure/table/reinforced, -/obj/item/paper_bin{ - pixel_x = -3; - pixel_y = 7 - }, /obj/item/pen, /obj/machinery/alarm{ dir = 8; pixel_x = 25; pixel_y = 0 }, +/obj/item/paper_bin/nanotrasen, /turf/simulated/floor/plasteel{ tag = "icon-cult"; icon_state = "cult"; @@ -16863,11 +16857,8 @@ /area/magistrateoffice) "aCj" = ( /obj/structure/table/reinforced, -/obj/item/paper_bin{ - pixel_x = -3; - pixel_y = 7 - }, /obj/item/stamp/magistrate, +/obj/item/paper_bin/nanotrasen, /turf/simulated/floor/carpet, /area/magistrateoffice) "aCk" = ( @@ -21875,11 +21866,8 @@ /area/maintenance/fpmaint2) "aMO" = ( /obj/structure/table/reinforced, -/obj/item/paper_bin{ - pixel_x = -3; - pixel_y = 7 - }, /obj/item/pen, +/obj/item/paper_bin/nanotrasen, /turf/simulated/floor/plasteel{ tag = "icon-cult"; icon_state = "cult"; @@ -27795,16 +27783,13 @@ /obj/item/folder/yellow, /obj/item/stamp/ce, /obj/item/book/manual/sop_engineering, -/obj/item/paper_bin{ - pixel_x = -3; - pixel_y = 7 - }, /obj/item/storage/fancy/cigarettes, /obj/item/lighter/zippo, /obj/item/pen/multi, /obj/item/enginepicker{ layer = 3.1 }, +/obj/item/paper_bin/nanotrasen, /turf/simulated/floor/plasteel{ dir = 8; icon_state = "neutralfull" @@ -43355,12 +43340,9 @@ }, /area/hallway/primary/central/west) "bCG" = ( -/obj/item/paper_bin{ - pixel_x = -3; - pixel_y = 7 - }, /obj/item/pen, /obj/structure/table/wood, +/obj/item/paper_bin/nanotrasen, /turf/simulated/floor/carpet, /area/bridge/meeting_room) "bCH" = ( @@ -47113,10 +47095,6 @@ /area/shuttle/constructionsite) "bJN" = ( /obj/structure/table/wood, -/obj/item/paper_bin{ - pixel_x = -3; - pixel_y = 10 - }, /obj/item/pen/multi/fountain, /obj/machinery/door_control{ id = "captainofficedoor"; @@ -47129,6 +47107,7 @@ /obj/item/radio/intercom{ pixel_x = -28 }, +/obj/item/paper_bin/nanotrasen, /turf/simulated/floor/wood, /area/crew_quarters/captain) "bJO" = ( @@ -50576,15 +50555,12 @@ }, /area/toxins/lab) "bPE" = ( -/obj/item/paper_bin{ - pixel_x = 1; - pixel_y = 9 - }, /obj/structure/table/glass, /obj/item/pen/multi, /obj/item/book/manual/sop_science{ pixel_y = -14 }, +/obj/item/paper_bin/nanotrasen, /turf/simulated/floor/plasteel{ dir = 2; icon_state = "cafeteria"; @@ -54151,10 +54127,6 @@ /area/hallway/primary/central/se) "bVy" = ( /obj/structure/table, -/obj/item/paper_bin{ - pixel_x = -3; - pixel_y = 7 - }, /obj/item/pen/multi, /obj/item/pen/multi, /obj/item/megaphone, @@ -55112,6 +55084,7 @@ /obj/item/book/manual/sop_service, /obj/item/book/manual/sop_supply, /obj/item/book/manual/sop_command, +/obj/item/paper_bin/nanotrasen, /turf/simulated/floor/plasteel, /area/crew_quarters/heads) "bXa" = ( @@ -60880,7 +60853,6 @@ /area/medical/cmo) "cfW" = ( /obj/structure/table/glass, -/obj/item/paper_bin, /obj/item/pen/multi, /obj/item/folder/white{ pixel_y = 7 @@ -60890,6 +60862,7 @@ pixel_x = 32; pixel_y = 0 }, +/obj/item/paper_bin/nanotrasen, /turf/simulated/floor/plasteel{ dir = 4; icon_state = "darkblue" @@ -67468,12 +67441,12 @@ /area/blueshield) "cqS" = ( /obj/structure/table/wood, -/obj/item/paper_bin, /obj/item/flashlight/lamp/green{ pixel_x = -5; pixel_y = 12 }, /obj/item/paper/ntrep, +/obj/item/paper_bin/nanotrasen, /turf/simulated/floor/carpet, /area/ntrep) "cqT" = ( diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 340acc52ef7..03b5cb09720 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -2196,9 +2196,15 @@ var/reply_to = locate(href_list["replyto"]) var/destination var/notify - - var/obj/item/paper/P = new /obj/item/paper(null) //hopefully the null loc won't cause trouble for us - + var/obj/item/paper/P + var/use_letterheard = alert("Use letterhead? If so, do not add your own header or a footer. Type and format only your actual message.",,"Nanotrasen","Syndicate", "No") + switch(use_letterheard) + if("Nanotrasen") + P = new /obj/item/paper/central_command(null) + if("Syndicate") + P = new /obj/item/paper/syndicate(null) + if("No") + P = new /obj/item/paper(null) if(!fax) var/list/departmentoptions = GLOB.alldepartments + GLOB.hidden_departments + "All Departments" destination = input(usr, "To which department?", "Choose a department", "") as null|anything in departmentoptions diff --git a/code/modules/client/asset_cache.dm b/code/modules/client/asset_cache.dm index b29482a73cc..e1e68bd0617 100644 --- a/code/modules/client/asset_cache.dm +++ b/code/modules/client/asset_cache.dm @@ -195,7 +195,8 @@ GLOBAL_LIST_EMPTY(asset_datums) "large_stamp-rep.png" = 'icons/paper_icons/large_stamp-rep.png', "large_stamp-magistrate.png"= 'icons/paper_icons/large_stamp-magistrate.png', "talisman.png" = 'icons/paper_icons/talisman.png', - "ntlogo.png" = 'icons/paper_icons/ntlogo.png' + "ntlogo.png" = 'icons/paper_icons/ntlogo.png', + "syndielogo.png" ='icons/paper_icons/syndielogo.png' ) /datum/asset/simple/chess diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 57bdc94b08c..34acdcf0983 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -21,7 +21,9 @@ max_integrity = 50 attack_verb = list("bapped") dog_fashion = /datum/dog_fashion/head + var/header //Above the main body, displayed at the top var/info //What's actually written on the paper. + var/footer //The bottom stuff before the stamp but after the body var/info_links //A different version of the paper which includes html links at fields and EOF var/stamps //The (text for the) stamps on the paper. var/fields //Amount of user created fields @@ -76,9 +78,9 @@ var/data var/stars = (!user.say_understands(null, GLOB.all_languages["Galactic Common"]) && !forceshow) || forcestars if(stars) //assuming all paper is written in common is better than hardcoded type checks - data = "[stars(info)][stamps]" + data = "[header][stars(info)][footer][stamps]" else - data = "

    [infolinks ? info_links : info]
    [stamps]" + data = "[header]
    [infolinks ? info_links : info]
    [footer][stamps]" if(view) var/datum/browser/popup = new(user, "Paper[UID()]", , paper_width, paper_height) popup.stylesheets = list() @@ -587,6 +589,23 @@ /obj/item/paper/crumpled name = "paper scrap" icon_state = "scrap" + +/obj/item/paper/syndicate + name = "paper" + header = "


    " + info = "" + +/obj/item/paper/nanotrasen + name = "paper" + header = "


    " + info = "" + +/obj/item/paper/central_command + name = "paper" + header ="


    Nanotrasen Central Command

    Official Expedited Memorandum


    " + info = "" + footer = "

    Failure to adhere appropriately to orders that may be contained herein is in violation of Space Law, and punishments may be administered appropriately upon return to Central Command.
    The recipient(s) of this memorandum acknowledge by reading it that they are liable for any and all damages to crew or station that may arise from ignoring suggestions or advice given herein.

    " + /obj/item/paper/crumpled/update_icon() return diff --git a/code/modules/paperwork/paperbin.dm b/code/modules/paperwork/paperbin.dm index 68afe9fbd12..d76765b61a7 100644 --- a/code/modules/paperwork/paperbin.dm +++ b/code/modules/paperwork/paperbin.dm @@ -10,7 +10,8 @@ pressure_resistance = 8 var/amount = 30 //How much paper is in the bin. var/list/papers = list() //List of papers put in the bin for reference. - + var/letterhead_type + /obj/item/paper_bin/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE) if(amount) amount = 0 @@ -71,7 +72,10 @@ P = papers[papers.len] papers.Remove(P) else - P = new /obj/item/paper + if(letterhead_type && alert("Choose a style",,"Letterhead","Blank")=="Letterhead") + P = new letterhead_type + else + P = new /obj/item/paper if(SSholiday.holidays && SSholiday.holidays[APRIL_FOOLS]) if(prob(30)) P.info = "HONK HONK HONK HONK HONK HONK HONK
    HOOOOOOOOOOOOOOOOOOOOOONK
    APRIL FOOLS
    " @@ -139,3 +143,13 @@ add_fingerprint(user) return + + +/obj/item/paper_bin/nanotrasen + name = "nanotrasen paper bin" + letterhead_type = /obj/item/paper/nanotrasen + +/obj/item/paper_bin/syndicate + name = "syndicate paper bin" + letterhead_type = /obj/item/paper/syndicate + diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index aa1fe064626..5ca53396253 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -187,7 +187,9 @@ /obj/machinery/photocopier/proc/copy(var/obj/item/paper/copy) var/obj/item/paper/c = new /obj/item/paper (loc) + c.header = copy.header c.info = copy.info + c.footer = copy.footer c.name = copy.name // -- Doohl c.fields = copy.fields c.stamps = copy.stamps diff --git a/icons/paper_icons/ntlogo.png b/icons/paper_icons/ntlogo.png index d5614a964eef8109b40fbe3540e494c404abb2aa..3aeae313238eca7244ca10677586d299bc27a782 100644 GIT binary patch literal 6673 zcmZ`;cT`hPuntwK(xi)Y2sIL#bdcT&N^dGX0Ya1BAt+V4fQVq|5(u4WKu|!s^b)Ex z0qN4)%kTa7{&?q}y>srKo%wdZyE8kx`^MN%i<*L!0ssI|>u9S(@Ny1c;>k$y?=X6q zM!X<)Q8iEn0MMzFSIE-{R#a0N@V-0Ja<@NZQ}z?56Xxc|e2TsL=cWXI+#?npTnS0L!(F(oj>S_FC`JIhA0u;! zw20!|J^LM8jYXEoKc+s?l@ZcG^g0uWfye^^fu_}kBrzRYO#u5JlyZ3qmJ6;wGA=Kp zus@|)TG))Fn!>YH0@oMjOs7uEbrHAR>5x?*C8h)ws_9tUHqlA%?Nxn$9+Ev5_>F z)pE>K{?Vkw@z}pKKIaNn+wR5lNit6_oE7;DSwtOO~#la!~N1sbjmA?xtBW8 z{Dj_}nED@eeqfd)I0hnnM>bx_Nxqz?gWgDS&_%qUXDlKZ@dIhd-cu1sL;B>?Qu0)w zmVCdN7qR60kxP;Wrf+ji%;6CqZT#>faA0ElHG;p#`!QZWCRJhR&hQOgMDThI?=1cO zIu@$r_(|3hse_?c+0_d_=C;jpB$6b@&X$5NJMFZh)xsJipl=sQ2?~Nrv;n9Kn)` zYp)r%nQg}WGfQ8;oN2S@%7iS*ip6tC##O|#Cv9V#+mS_lf_gG7rAKr?$m_}neOdlSEowXtIDUh`IdYRi$2@id4QFHKMdL(T^rcV+OPH3)Q=|W++-(I(YDOwyM(JGw#>DmG%?51H( ze*^QKu^K^PnHI?RXFWCk&>@LX+M#qhfs8fNvi8DUCVd`rc&*1RPtrf0`%l4(h zzcDTHU%pJuP?iXBg@X{rZ z8#ta4*~gB##(EsAnntLTse)WXY=e~aZH3ScDrAp}wbjUMN@Q>AA8yb;l+7w8gcAC; zpjbu95wPCH!jPzpVc8s}fE|8jsxz?y8p0m`-0_(qk})Oe{cg}gjj@TUN@x3rh&1{3 z5M^$&`7RLa1N&HCTMgbchyJNO@BT({bTOqzzS3uODgf2Q;9AdljOalFcen#qG=A4z5KT z>d;LF!JB^=vkl3j zwgq80=Xrl~iPrjp7iibgYy&le4Ph%VTy3M-{+ElQ{SoUjP*cRusZ&McdeqroWU!7i7GXrqYVJjlxn^x$~iaz!iL0g023)<?t?qc793*`M%CE@-T_xVNxfdjFk6D6^hFx1o{b>Lt-Sg*T&lD>! znRvVDROKQr3fvrCwUFJWOHp2?My9)om=;2{w+^2jaThd~S~q%v>lqtQ@`mIir?}|I z(I*(;H$BBILuY%wlKKk%Kz1qv{R>^g-vO&uL;yeym3-i zx8D6=O}`*m@H})u9Yb2oWd|HI-gFif5`d`p>j;$a7W5wU@sy5Y;bMkG7TaGO%cBuA zcXdaz>T+VB7;QagaSz;!0Q&?tm#?YfAC7cJv0+k=Gkc8{sd?C`2JKLG?Tsb$KsDX; z83lW6apH>IDXWB(mxWXk0ud5Ndbv4k;Xh`EVQeb(gODA@aTn~6Pl~igM?L^iS5d2c zC%=<5(=TmSv#2&zye68fjTTM((8jQ*bUtXKgdMMSFSfBAtF19yldheR@o<_fUTbJ} z;O?s9#a4*q*!pmkeYlW@T#=`hU|+NTlC+r_o%( zsgE}yE;`q05=f2bNDm2{?i+~fw-O7n^t4dieaF+fn;>>L^PU!E=oYx_;L7cEjKIA^ z!!7&yAYUP>d6Z=Zy)MIY^H2+^l4#5)U~CM<<}A*l{zlqa1cp^lpn2PS|4*AcqgMOj zeMfNV^Tq|&O7l+=A+65Wj2OmjdSKFR9B_*U$TwpX6(Ju;AD0@xnv)#Nut-yyf{&YOPr|YbF(f{J(z28bzDd(lR(ZiW25j$T^ zjL&y>S$607<0H4k9(V%2F^B7xp0Rti35tJqp*v4>(E+EpsHN+r_f(Lz!$1F2Ei&6_ zq_7X(xt+R}*P0^{a%27`prL&=p@uZVZI;ZuTQ~)(*1;)%`ftAzrT9<4RP?~pUJ2)O zaXuz{{e4f0y2@W=jM7{aYVfUzeEL;CHKur_&S%8tt~{*L&7%5|=& z)=0dO(@bZptVY>nKt+igaCwVdS)3Pd?$Gq%<7CQV#eT`plQcXw)HG@|$+2Pc1Ux0Y zS)%akuPk48k9*P#a}g6(4j;S=(MaB`q5U(ja3e|f6VcHi>MD|1`bU#C0VGAnG)}B$ zVLfCUGK4VP`e=||;6-jbT`D3>*l0Ri!z&^$0K1kvkRQ%vIaa$Rzdm!qQX-iKf4vc~ z`(m=wlb97q5ASNbtcqi!ay@Ipn44p`aH>~u0ZdqgV<1dy~ zx{t&no+W3dOHB=}ECDls3>4a2$-YVsu~h_w@GS1PuhEWcn&CHRdw*bw=S`G9>Ugg= zMS8G@+9-QahML&k@yWZjx!9MnRkT*nT9LXL5ip~Tkx&5_O>I~eEh#K<{@Sf=e-r%f zq<2gwJD}*DpiB|-viobF`v-wZ_O}3Y2LgfeCoQjw}7fqTD4(+9o=1BY+6gNoDMdL2K;HBHaw|9-M3_eR_{ zl;g|kKkkz9Tt78kidOcT$LoUGV(;ES5<-i9NnY9~!~G*63C6Mmi-p&Bd>O?B7^u$V zmPGq;aXxGRCq+t?WWae6~)#Sv4|4xpN*3PF)1R2pHx1{aNKEEIyXr%g5^`py+j0Qfs z(2yhDb^Z3YenQERO0Hoyx33{{t1T!!ZrY9I_=sMAsAmb!?w$$FG4o>>j^AD|eaLas z?pIg06D7KYH)Bw04l_h%9^ax%>!w$GRa*V`Z1WaW!Ly5-thxAx3r5foQGbW%HcbAP zON=z6dJpex%Z6?h@m^+7PvBf)tDf``=>s*UCS+=T1MV$507~4ICyo-+et!=5QRL|2 zl^*cnpL6)X>cOwq)jb(=V~I{u-TwiW36_xca9a0 z2d6c8qzyUJcD~p?j0-)^Yh9((pon{6n{yZcCsQW#90Y%^>17|qyL{lIh3+0ncGX6l z#yRQOluVBmIxm!Lpu@%_@Vg@tKX*<)IIP25$N9>`;+U=GuDSbo zb*DV8?&k*O>Y+yVP+^CtFe5&YWmKhdx6-1b@L_>9@o<&C{pC&awre6HzezfPvt9+r z$2vWc^E-MtG&97j{SD8}j+4I$uS};DGiqDvv*%p!oq&Z~9{$FjP^iT*J+AI8-*)%! z4>W|hLovg1RK~)Od(DfTK!HNzqyJC{fHI$ltXeYLua6$vvzf6`U%TAppvkjvMCPJa#Mk`c?( zD>6n}#QbMj6>oXLfB3X@v&lo>{ix=-eF^hxPW9aP<3)9)xXALAI>MDCnxMEzfDbxJyN|XnVjDMZ%4DY8^GF{MAMa09oDHaz=Bnu=nSA{ z3u)P0?ZqFSRJ7v+|Ln^fTXx46Bl@eD@g~uWbl`6^^Wtp7`^R80-U7pwmfhG_>1@k+ zfGPhs4bAAobzIA>K&nJ5IjfmRzu1~SznB#+TcgdGH>-C(4X1H)qh|cipV1p&L<$S~EPf4Fk5FZGu~Gx7qOC`Qtu*^ajz81h`~p z;q5;rG5ppT4X-Vdr%>0Z`4)Ry4M_{dyJmCY8EN=gwYBWpDm~VJUbY4w^bFKnpC51I z_MH1qLfA0RCz?DK^%AoRR!<{5L^ldA-6UEM6d9(-rX2CH3Gu`xXon*FHpj&cn#Y@< z9H?=~jzSFfqt+=4Saxg3nVbz$@knF z>%lVz>Pu6Bk`Ae}H{T;wE_BU=sMC?7tQ*tf!_SE`baOgbPkSU0sU{|@`;7xvWZlZv z?o+$V<7})1u}@S*I9bV4LkJqKhBh&%X8w2II*^Usb-XkB*_%gROFaP#x*-aPDu07i zc0swjkY<}Ka0_oVh zIdd6OXiqeM7{+_9hA!=Nt0pHQx>~O&Lw{e+nWP~3D0Qw@Bzf)rxpCtL)cK4vGM*!h z-MoU_S~*ijgd~Q*{sN63OD7jc*p27;3_PfQhX@Z#dos5MZ)+4N-iyTwsd-O@n^VoTtJPXNa zCrka@@f1EpxIIB-sMG4G{5!~kuiXA8HHXyw@KQfFX;W`ygqCIX0m_D#_(WD*xSR8R z`Q-}o98_nNgwxn6t#_TY zG|y>`yXd3LE4@x~uGgB}CH~biaSft6B8cE012}#z(QI3HvneRzfvRuUHYEc#O z`pd|b+nA8Ou*hGlhVLPhy$;MWx?$l(#=nkW(?7*>V3ARj?^h3l{7_%jPS*3YzC7tG zbn;y=q0I8_yLlS?>nCKi`x%9#MUxcLSA{GJpQ1a{7GFdMKI;UoIlXH_*$iw@XuML` zr+G7UQmP=;XKdXt+2Yv+=a8=JsufRe7+`TrmK`0ov$a zYGqmK%$PVbM3pH{4ZU?~d#pB)o(@B)fM`}zlJ$ZX-S$AEEP1S43d<11uz?TWwDXjh zKRV7|)eW89tvy@;AzJJvi(6Wy=Kkjr=AYqf0AKQD|V6!)=cxJql75r#d=__Y_ReMH;Em6dc7 z#y5ju@*5c|Jdqoz%JBI4!bhcrLtI~|a_*~h7U~ZjRdxw@Oz+7{(_GG6aILdmh!l3q z(KOQ5hmu)@GSiFC>|(AY;g5?YV{0h>z~{#UHq7||Uk-XDD&94JJjyH?{k_8hAg)?0 zg-@Gu6|cE58^aDp65#BgrICPN%Bv>?!Rah-m}W`|gd<}PkX1tZttf6f3J5&mzZ1~E zXA49$6cW4gD%1$_qK1qa?|0yBy6hB1)!$1b_3=?g0C7Tms*Mq052Q695FiX7ikHyb zEKZ}j?q!gP*s*q$uoS6!Y)B+6DWgV45l5)S;mv#-gwIyMmR?oU(~cnwvJa*WDhwBM zUqgWGfj+I@$iFEjnaGteG}KEsY9PykHi4sTspNr^%P>#pMH zJU2->zURlcfv!lYNQppCn^NoU%{auq`tUq$NNj$IfDb~2;4k^x$rBjmcJJ~n^~tDm zGt;Kww~SpU=1nR@pA?QIFwH|d+L8ApFM39cd(BQC32u;fn&Eg3XKl5gaZrBn`BJz>h^iGIAi0=&@<;|55Ppa&&VJ`u`Pd%D3_NH~@f-hM_u2%^~`K0Jwe3 AHvj+t literal 9990 zcmYj%WmH>T*KKeM?k>gMo#O5q+}%onB83)rg1ZNbyO$!xy?Bx0R%mgTBKJJ+_vik| z$r&Tb-aG3onQN{YqotvUiB5(N0)a4@^;~MR{qSb-Qu8AxOAwNkwTfQ#;{PC>g>$I(6S<<5 zHGEl~5>BM3ZW&s1ca7&H{DS0Vp0_Mg5*tHFYo+Kr<5A>}F2vz+&-1PZ7{g)Y zIe3NM2G*F&aQNYj)Khs_#^#Oc4BHOrgT@mgYqnFi6$Mz+}i@JNqnyO*x~6tV4`zBNa+Q zfcsg;$$wq!6O1p2VbWjM-TlO=OfSQ63~A0AdHoOwmgTFMUpZ+C&hB?6xuqH`EP@)k zvYOfshiOokHBq&!7KpC9R74WdF%y3be}&8XVQ!lRR-TB4qRK zq{WT>;kN0FloW58X{5BFunM>@B*H|YbnKDLHMu3rw#>j9A?xnb&Y&F=wiimNo!6^~ z6<1^saBN3@GT>^+o>BAN%7|!SVBo&1om$t6M{RQMs4N*#9|$8k2zwQCl>;-PJoCP| z@li&@P;uz`M#Av$aLWio=V?d?9ALFB*C*QO*PF)b3Aw)lRG?skeT_i|GD2)!{k&L` zNM#-@r~*RgI#%a;0t`kAoWJC5LL^=zvu1_4jzFK_2j3vRv`l?`na66uZ~fPT3^d0E z_7I*S%jT7t+1cb<;i!S+``ufvzWr1y>jciMI1Lna7Hnv&VuT=7^RjDO`1>z$`V?3w zkN^J7K1X1bOr;1w-R#FPM@HFcwhku`o8`3$6D8kNB2QLb9o^j2Rjsh15U4+`K{sIBjK2*I(&`cQ z380LNGPo^jQu7%MEvwa5?W?-BG!spSXJ;ej5(hjd8CJhIWQBFQTy1(hJ~|3Z^lr(+ z9rTd(10T-Xu7=*;`ow5+gAtln;!UEWF8VI`NJvr-)F~mMtg$Hxb^m#S{B}8S&iE?Z zp#V=yI|zHN9slIyM5|IS=FBidUQ-kM<#HoR`2Auc7t`K(BV-!i7M=^IA&!9Yw`06I zGB=M8)^QiPzP>)%nZi7ORaKQ`^CEm6!qu_P1~Tor_|parYH-onwMzt5kaoPZ%i6Op zs53r&-`_tHc>?cr({1pMYJ~}HR5(G_!h(9^^W7VYGoRfFG!dEY9R@%27?1G&1qQOz zDbTRO6r6a}__)f9_Zn%n9&1ZmTd~UYz(ICoW@#_R3ba#B!^USE0f#^R@V1NOHvc!e z$nWBrL1*UTQqIt*yS6^}cGb7Oo$L2oVfgn0M+1iv(?m8|5CSs?&h6x=vW9>=x0okH z(DI2-#ZTwFL-DZYgNPdQ;$=N;kLe^X`59g~-&VNI*HZ~c_lzoNT^;AsW2x^&r)0ta z4Q@~1d6*AS*Z$@fPg^ES-irV95QkmkJPNZZJZeUTb!XUv7zL$ZwX*& zSBDL3=Z9|s7+QLp*f;!kIl9g#nh%dJX(ults5bQF`5BAu#N)gWQj20RK7262YYdlx z^)A+8&Wx^SW#>*G(#9$iA_*b4e!iFcN8Cs>hG9Qp_DpVLw(3q)IM%S%IP$^WxnfDdTX|NdC1fN*gOrh$IlHMnFr}Z+;X&0pVwxz`L-=2N(wD|I0_z*$DAN~@&{5dEW zj5jvqvgeZLKIsbotzZ_)n}TWW8kd_|)D!jVnKODYo- zB>D2tv3u|A3e(Em#L3Fp#sN?E8ox_IOmA%!@R$Z$|HZ?Lsnkh_pNezG!BNodIr5m< z>^|*?{XibpaXQlKyjxHbp7ab#Qp5EzK}%|jjuxxq2+uwB>5@+@LW;GudNB+Y_4BM16%k@BA>aOLyFpJQ}FlH?uL^=7Pd$#cC+BCO}dvSXv+A2H${ghtNjhhG1pX;`Te!BpHSqC7vJ z>Tg-Y63bF|zs z`nUzNy&c`F!(@!$L7L1gJ$yaUERuWt$f-A#g=4ldTvES)FDy6Cvl=b@?G!&8XT<~x zrDgjn{`HnmCy%&zytYFi;kzNbn-f~wft=g!3NO#Gs>%E{t0?;2hK-Dg z7vU*jw!yoz?mMbS#SA8m8wrZXe z?-sxZ^~n|tLNtz$_sbZ z%mGFZbc4KU`NoTrgr%idU%6d5!e^$rLu#Nh{Ogf*VO3DIOPY5$Dj$Hh$0sv3OH1uL zize@oaInb|sU;JpqwHdg+8y~LXZ!x>ZzhqG!gCd=)vD27JV~QFf5Z~Z<)B>=AjABf zCrd(MA>&62U)qF7cH;TWEU#U`|3`YBz|cpV1yx1?Eyr*C4}D38=oQ^hAdF4@&_p?) zi)Fkm?d?oGN2jO5d!~9#r{`r5L-Ld}6JZ&v(Z=YIkdQ$Kz!jjFjQmEs@AD38A^oOq zgSTy>6$|6>cxiJ>)a*hgg^v*UIW!sXpK1*5D^5RFP?WnIN8BY`1xeTh*fotVe3H3Ac(Onc4B|PYGT-B2*pp-U2{Y$Lrok?Ex zd56*cT1ei8bl~qs5)m*c&E+Zkt#q&rgOHt!Fa;d3Iebzf&lj-+mAecu08Mj$WGwMe zb~fJyZzzr4*%1~hGwLS?_5ewjrk7R_t0dS?D0v#`(<$gzn@hvp1}l*1>4N}xo#yHE z!K=)RkxA2_-@V<&&(ARBv%0UENgR==+pHL_8NQ)EwNrMmiW&PpY2YVC7SUff6$@`l zs+8Uq-XDidOdMU7#sZLw>Q`;l%35BVcE&Qtern$Yh7Df@Dv%if_lws{KBnZovBODR zv74q8b48@rjnJ9eZ7V~q;vjVT2We!-08j;njVj65OpQH*JSY>|C-9xj$Ue^Z z=c{s!o$L2!qL!8xTh{`+_SJ1~QLARm-RU6mk@8P}HeDmFX4cm+%jdHjITF_0N0Q$t zHnkl!uDCk7bZ9mFgwQEkRG)uCaI9b(I9UxbYd?{3ad8>88M;NH_JQuKMbog9sVm}2 z&GoOkRuww|e`V#>a_X~!lb>WBiqkRqr-~xu# zHawqB%Fg3`E!Mik(npsF4b|Q6&z54hr|X?nQ$A!+{L}Ta*itE3E*lR7aMi-`4=h-)UnyD8VzS!TG`zOpn-a_O}?YHSx_jn zVq-0=?W9LQ=oU4~X2}**si)=m%Q)juxx;{&0NvH4CL%8$L8%ngGJ=P`8a?Dnw%%q@ z07UcBtDc@cU;I!JxwvTH{o#Y%jSgTL-FX+GNQa2%?FSV#5n^3tcqQFG^xqOq`7ElX+wy{%oJSEGd4)}is~Q_| z({smr7nqmCr(6g{-K-AO=Cl!$hDqe^`s~Kc3CSL+B3)UWFT^QN2mx3fDGNN!Ig+pn zR(rDuKID<1p_0)FM;8>KMm@cnJpaLQAX?Mk4y+ zj5Zeox4cDpj>bP>X$$O$GUoc?q#AV|f74IAG9IppGx>mj?d>5eZm}pvwwEv7PMVJ=dS1q0kdc!&e@udkc0Xs@*cdgpcFg?z z8Id@3|Fm-3F`hL*Sh-WW85A)!H6?(#wcKcPe--fXif{?V@GNZ{`f~ye=aaa)pI+KD zn~z)B+)T`Ty+;~mB>M3C8}*XCC}#;zwBB|WcsG3s<>L3O?;+z3T>upplYOF2 z4Ahgs9l#QL5abW{dH_-MoO9}0zeMpnct_05&!Ragr%Qlk`=~z59LKcq89jKT0#1FR zmlOV75J9-j<-29$^30Y>d>(%O@adkcfqzVEE*qzsHR+>*-TBi5es7(Qk8puUx(&(q zFcnW&J^r*j`zuYyVh2D^!hyK>Ui^%|cUCshONg*OA~!N`8W{PWXLvWtD%jv~Fn6@k zQozptB*BLfhgIC~P&j6TKwJH)S$XG{=ha$$w}BMYh2zFgb8~Z{K%Hw~&*jl~Xfs|BM_0Li_TXitKaUOIb}IlOhypoMI^z8$MMBDG3TJo6`_4&p8J zBPyA~`}*{UcqwjL2Pa9;UC9M(okXi6$GKNEXodm!6jPTh3@$+Z`7DGh;4J443H*gZ-#H zuEo1OEm%5Hp+P!XtPU)&%z>)&c*Q0vu&h_e`Ix4-#4IskT?I5J67OAIH~4j%S6^u- zlEB8WlFp!iLg#*QV--KW1K_L@;_B;n3sXpoeJiRb%!OS58fJ5o%LyYX9$LjN$1PBL zf7|{&|Er>VJ2@Anh9nZLjyzCn*!1Pm)%S{{9ph>6j5O#;!I3pXY)26!Vz#O+(XDA6 zWxZbN;b!$(tSm8*csV-5aXcB@V)PiEy<$`lDm#v{R=F0lC4UC7n>F*~1qlV(K6~ts zau2~Jx#gQ!j-PXwYYz7Iy_~jnMAKhb>A#OE$~R!>sa(5rlk_gsxVvosEV^o`r>UYX zjA=N+RD<%CzD==P$s116&{z7LoERHDjG9-MwATmFb=)Sg5Um|-xmhtB!*=IU2fE{r zVU;?`O$)Psycus_r^3DUlJDi;63~X46>VLxSEDqqnCeY~YNo_&2NbTb)YK~n`8+71 zR137GFfHe`<@-qtQXMamnU&Wp`N_1qjj-p-c92pYK1Ky%*b2t_HW*DXsJPhMGnPX@ zbGq_7kZNUq^{HW<@dlDeX_JY^iH>Gki?gJoADhe@u(2u`U7PMbzVi8)vFx=KC7N_r zX3Gx*a3G-JI^Ys!z?NqhVq?6#z_oP*XsRyKnFnW zYiv#>XL7l!(UzGut*?J5ceGfUkGp=-^B}jcLV*wrGq5OF5;4$0LaIri3-*(g_U~Y^ z+g7!)+5K=pSqI@an$Tgk_VXiAe>NbwW!A;P*cV1(vWQrD=K9oLivRM3c zZ0bT5fYPM-&AZ?hR%<7G#L5m5_P?apC=k!S$r`Ay`yTQBTaf0ZL&qYt2FZ;hC(WMn zO$k0}c|9Mke;r+cAOWHz>MSOvshsTm?>vrOIkir^6cM=h1x2+(xsCqA9~UWN&rynz zL^NqV1cv(-nBTvCYFBDX07$u#RE+51ONjT?3l4>KAvK+FMfL?TWABw4eE3wbWVlx$ zbWeiv@Ab^#(JO1|hZD|#i@A9rIPVt77qzc9cXu|nqOSpO|9EUqY`kyu+Ki*nJjsNU zn%R_~zV_)hEpxe(?M0wk694LfXl!OQoN!5J-AGc?N;cLO@cBEjsc>*#a_&C^A~H27 zp5)^;r}E?gfKz({h;%bOxn?kth~ICoA&S@eOW{1h_aQXDnSK^M7W<)GaJ{zd^-2_% zEGTu@&3`n~F|ELTHr*p|(P9$WTo}mtaID}m;meRb#dZzwlGdDe-38g6yMbqZT_noA zvkg)_z)B3ERcVfI_9P`B#hq9BIZ~u?mz|tuoK6!9kQ`#vVpWPZLp`*!BArTr#&Z0K z8}=qHT7GFW=7cf0(Tg&b-{-ym=Jb;eSX;L0Oca zZVL@gg^~rY!T&V8q|g3fFA$#O%k{nho%Y-jmQ)ExglWM?ZE7}z7&U9fqqe~^68mOS zzWD(f70Rxc(I21Km*CQkV-`(ZE@}fXzn+o%GM)0^ShV`=G%F2vpw^28Uv=*SgawV% zA-(u(@A2}L6N7;PCEm4U6OSqO z{=F*}JeL%xpn%fe%I)&tget}ozw*$QrFhCYT)rI5t0 zGjpbe6?`>SRs9T^_%NKfhzj(`aZh%{ftZbXp=46toc=aSuv!MXAy`{H@U?Bw97gwY zdCHUbH;zG2m6+!Y+v+?I0qzwZ1QQ}Ep~@l;xNXf_n)LOM-u&|xdYS-1ifxhaSDnn8 zkJCw~YYf5z-6Ozzm%cTuUHo6i$$3EYR0HBPZtAkovD_}p90hf2hn=|HXjSfrt!}id zh6S9RB+bbF$B21an>O9x<7CE{gw0#$-CAdrWBCmiW{)0xt5$);;OUt)lEZU(`K8GiCo_j^o<)r*l~h%sOPMma$qff}zIb4~tMeUo zM86Tla6VE8eg*K|0c?FeQ9Wq2J|berKAji83KMoGV)hYr1;?`PZkBitfkBzF{sX|V zZH3@;R$P7k4f~lc&B+yG;%uwX1Z&qQACQTb7xqSL-uU`qVxNKAXy-W-US#hG3aYIG zuljH^FID0f3h=4kzxbXdFR%eg)_3zC+uPGPhS1?`79j=Xa$Gd7n3To=iO1ura@!?a zaIYO&)uxwWT9Mb3-(!auBmgY;@B2MVW@QuOE(i8DuZ9<}uW zrHFH>m)bDY_%zeeI?`&(H*sLsMC}-g2~sJg$W{BuE?+Efl>ea?;H0cq6O2jNN+l|Q z{*dZXLBjp}v(MOptgNix^U3u4S^Xx~u`I4dJ22fi_=JW=5)=&3V43!xqR&0UJCf*0 zkwBQ3n9<>kTUozxVmKB1oZ5~#250JwvZ^o}1og|+(2W6yyOc6h88HPixzNVn!E)kg zIbL|b_da_aBTdS~f!a7WsQ#Ui{ExRxQqi8N%27i|SX2;DDj%*#9yw+!@}c+pqjD#* z|F+>2=JsM?U%A8qspzBY8L{Gk+1-`Ua@a{BQ~!V-x8W@Jh9we6BQLw7tM^-as0aTT zIaL)vp<9KdpH2%xp|x5}I*?;`y6_fY_*l`L(}zsd_eebRx-YKhiJe21EhnWs&)??m zCWR)6aA1lGYq%~`YCB$+!s9pMt&>wVLre?`!uB~`V|mEi6@Gd+xjP>x*S+_o=~-`y zFB_DbtCqG{GKnCw0C?apv4EXgZ_2`TvhI*)eLqu$7b^2a4-YF;?0;4h=}sY$30EN3 z)I)lL9T|t#rNy(&>JayBN;WYu814yUz3aLlDtNu~`YJre*friIM6$^kjH(&cWroDI z$DRcMY}~kuar6>oPk&_@7C#B;z>Nb{9#k4Cy}x>K=O2I5v&tf>Pt>`f@h4itWAfF!x3P3`F_qB`Si#r7s@Nunb*Bdj>LC z?IBm%@bzo>X|tCTW^q{=^3O6}L~$FB2RoKO`ZS!aC3C10({3V zYEjNIY+XbA8t#u??+WktRR_)+d14^hJ%V^;C#$#z%Xb;hr zuy7mjv8q?9Pu%2?I9C@ty41-iDk}c^tP3FUvmg(6uICpvIXmM8?sU?6LUhiZHHQ-G z;!0+-IgC@%;5EHuFfew1e)c+~J`c{PRz#zeRab}ZkpMmV@89--y^6{XXx>l|iO?xK z%(t*#Xw`*FS1hOi5(L%ccwmswX21pOuBE^ZIx;_A>)scyu%{@jZz8`|~a$ zeB6b&T${?ZwJxF-{j`?d^VnPT1?`9?M2pq*SKc;9e&lKqa6lXpB_$00Yp)#l?6V;_kkHk#c}d zbSRy(4g7463NW(b_s?E$rY$6gK{W}i1~U413ag7GSsb~*Aei^`;TY)j#l^t@-(}=W zV4e}0S&9S2yElYO#Ui#ZM_)?Og0V~6Oc142s=}5AwP4%Ym5H#rGI;PnuYI$ftK?`C zyQrAh#kS&``!Da{_VvrUAa!PFv7n~w1amILEoL~ZulCOs&2>{GL>Xzq7ygL3k!4yz zeK7!EyL@t+#-9K6OmO5qz$RP_8?a*}j)eL9pl#G52MU-Yk5phJjI{=!wP#XWBGc*&yH1kITBO@$03jo8;Nqaspvh39F;^L*pz4@y{@sojw zS#C0uwj%p>6{rREc* zfedG+!>1!i=6ydEW7b(&Y^U zl&FCSJ_%hw*x}gp&GH?&($^!`Kn|IbSpwUG<#ZA{^t}UeY+Qy|0lh$Nigy=Lgy?5e?p)IW@Ny4;Sib=pQ=~gmtKroG|CUht}EX- z#Z|%rgcvu39LBP*4co_0{)|Rx@tf%*VuxwZ-%r(p3id!eQYE6mB2c^7k*L|igrq{u zzTiNIxp{?=3Ip8!c^nK976I!O0GU44I$x4#f14zGs7n&jMOR>1UbK-eI|FT|LVTub z4X7L{gzzf+59KwP))xhtvn0}%A(qK+P!+#;AACRo7SvyG`T(~VQ=Bi3CVvMWiu`YA znWU`0X8^R|C26>V_KTc2E0W@BIe=$ z-+<%)WHu{;*xlw0R`GBk)+4M98SQ>;nO-0h80HGrtIm}Td>M#fiBf&qBpwj=|0Q%g z`E6pM9?6y21_b*5ghDz8xQnqK!lA%CAhWXo^>YC#O00mQM{C1&ytG{U4bwm75DH{k z(b_s!eY0Z&Yy0v1qGX`M0VYr5gHLee1G`nM=cZ0@Kwpq;)_Kzl{R;Ao@j z_N&Z}T$}fI963NN)}$4UIbA|o0o;b^00sd%E`K3JPhq3bkL$;g>G2Ocfar;a%9J(6 zgM{7*r5*EsUvvS}{ZBe2RS*n9VbaoEbKIaIeWf<2m%(Re5n=`OZ6IZN4Y@iQ%h3M^ D^Z3ue diff --git a/icons/paper_icons/syndielogo.png b/icons/paper_icons/syndielogo.png new file mode 100644 index 0000000000000000000000000000000000000000..6b0c4966541b5254cee30995b02ead93f22f121a GIT binary patch literal 7734 zcmZ`;byOQ)untg)7uRAfP=bZvTA(dXk>CW1QzS?rxI?kxP^7rKQ{1Ikai_QxD^74J zFTeNS`{SKGcjxTf`_0VGoV#cCeqYs8;60dNqMjMeK3^dVPFotLmnD zE%M~Omr_<%cE6C3k&&{x)LGiW@cHDzIZL8bV)tQOsYWiERs`LjM;2C*fv~SCva%}X zg2K`fi_ilAy~m%pw?0NkSCY}v7;1_hjEQmEE~fnaw2XP;|5m{G3?HXw zNaLI?23EowIW|<{M;+>+GI~keALIWV+c&-(6J?>HDU>Oi9$GrOBG24iSv$G*A!d{H zTZ(eFBtMq^T{q`TCKFtLC8H3(+}zy!yLOI3b7#1mG%sfZ0P*MRzk$JEkFKqcxMm|h zdP%oq&7YLqWdHMn*IVs8)(%#PZxs|0TI%(*)kw4zPKNhWwKp^*)h!*B)y-Y+dK`=F zx@xsACvrkz+~K)XBG(Vh3KG8u=io2$D(dYKh#wiuL#!Ey@tEA=8K_t5ZLP=(gKWW4 z^{6%!W)#ajWGN^pxM^Zl8&|PmAoDd$X`27k=gD&%DM1;s@xemx&R^faAbUB--6Em89)@Hx z+tuc+2n2$!VJ@0Wzpkk(^$I?9LBl`74P_Jjq%gNceN8q-l{YsxH)WFC-L9AP7Ua2) z_V9;QGH1npD;>Eh42sBghjgwz&Gh%n3ag~qX$EKx)2))ZHhE^tlkfF6hlu=S3&WJ4 z#}T6bV(Sv{){PSet5{lCutLkSsfTjMFV2~Kfq*_EB0xe!^7Z$+xiAQ!Op$FkelgQaSV z)`USzzqTx3R>h>LrTMLbAU zcze!`{>0H&-o0Pc_iHSOi8D1tMHS7g^Tpzs>OWcy`Zzo;7l%vk9p{ zTWW&J%=LGUx=H2_)dewi3vS(*AM&%rJ#$xhTY7=(HdTF+bW+y+l#Mx=*z5WOa$n+O zmdMW0yv81TKO%gWcQ8t$;`m~6#37>OZcUCdCNXwVE{|RmDrjd;p+cBS2Gf)c7t}j9 z;>W|`*_;q-ZRISwtw5I~$0yG&zPeN1_pY(cxDy{s?RXBnz7HJJ;&J9S$t5oraoz1* zxqDc-#{@70LaHN7LTMJ%;mStY^*>Lz@%FXd#>YKXd#u?NKzzjW7I0_oS~SKmb*-Or zN5`_N(rm$D)$J?W(POydhlILFbVc)>lwOF18b**}&L^LG4XH}wt_OKmDgVtlr!GG` zoOXMG2b%=eE7vcxZqi2;R{UK_AqTwfT@g3vD_bguNoRp?HmMHz4EV-$ceZfEfH#s~ zBK3Q|yHQ4~kAw6h73-+FaP$>#Y($L3PKnL>TPO8+ybB8gv*>j*3)`CG#}Lu_uQzhu zh2V$uk`BnPJxav0pTtl)tmz~;B@yQC*(3V|vc_MxC4~LMFHO?IFx(IsXsp}fD_r-= z+^mW~D|xAQ$jtXK$A{>~fQ0+hL0$LMdpQzD^uj9VhEv4or@C{ar7PF{==J^I&@_Re zu@{XXE@XL~@vOVX5j)(U5I=oe@YCs;lyK^yl)4lox7cB~lU>o5Drk9wWA(52osBEE zPLAR(!&0EWnN025tBaK8>`IT^aL*kP$zS*0K=>Y;_6n_**XDPw+lqF1o0U(oBY8E|P)&;{@Enkd8vyI@j40nk&-`(3iP z3hwKa5&5JakCjzqUw=Fl>E0+#4%oY}4WGMzYmlvIm|iPF*j|%LOsO9>kvKfR-u72p zm!Lky)Kb54E%hHLC$(gl(G~_s6A{-M#-Ot5@RP);not^`0X+t@_-S9TwJ!Bq&2PMC zlliTB>l=qC1L2sr^oTG@p9z`X%0K(9QUw*rR(V&fq2{m=l5p$KVBzy`f}>`Pe&Iwo zJ8HA6-!a(%(w_e-NMQU~ktrE5$n)*-iy*8O|LtIJRA`kLLg)z;Q8;Rib)r3L+R2Ay{kr= zKTuNbzPRY1Bg(nSNm!=9?Qh=%)A<=lB6u^~Y?ssFA--{t=X%_ox zZcY^1Fz@BoPIrtORHZQ`+O?jb4X$Qs^k5;h^f_FIYqG?wt)b$N$CjGfRjuFtu}IQ7 zWPy*CfUV!1_vo{$h=ZjDRjQib>do0I)_uSTqY!0ug~v2_4++cPg@U4BZ0Qn5IYhgI ztxFFIz=sL)pQIyHxbV!-gX{5>siU81$(+0T7GncZeLq}td9jH&`Uq_W!Wd8NnZ|M; zMLw%8`APFWcPjebXcmxDwWQN5jA0c$6=$TVk&RZ$9bG1x0iaxW<{gP-=_12tEj(Wcsp!cv2g`sh?K~`7H zU4!3OROR)~UP}*???a0|W8!7TBtFK}Uj$$Q9s5raKL-^LBFE=wMjPYlty9ND6|SW1 zf?n3A)bX?_LB+d8!+%7bA!1*qlo6kVq9ty7^UOzEIu1Py;2L`3jq zDHJDZ-@qz7e(Wvu}SQCupl~_{-1!^?p#c!|EPl{^_)MmWfEJ5X^j5k_fZo->&n)T%q_px zK#I$w?-Eut8&_eX|Hd!;<{?LOA`YQiYN7*AO0Mn>N;h8-d?~LCv25lEgokFZENP0 z&S)+|C4~ifotHEl{p-^EhRL||m=W&786{c;vQs{Yd#V!{ho>U8Rel);$^~zHWfghV zkyzy^bUM*qx81wiD`D*gm(MP?CSQ`{s&&v3)E{w^J8F-=aACW9y(a01Z&u%8UMF zkjzgtG)N<%5+2>X!$XhH-wAWNlli(PFOm0WxLv{mXN&em z0tugmKkaRsTQIGNPhkta9?*Aw9}XxMMK#NL%ZwxCWH7;d0R3oPLnfJGR$hpYW~0#mxq5*+y~LBSR(VyW>1VYm zpAj-|{$ke->-;oS$Qq{n0hdnRs|%Fc+B&C&z>KhoHSu3`E$iBA8;K1mO@bIUl3PoV zsy-V}8pBQWbLQP%4vve424G>`a1p*z%hH_o*WNH4!k`Xc=aT0p9hS7TAt`_ADaO#a z0{rjfSI z-3?i*Wo9={=kID(%{!iM6)w71{89weB44SYM$@d#AOB!t3vh*xza<_!A z^&SeH-P6pD&9w$G?+S5T*A8?Jw9?X{kx7B0L?~`i0PW2!`oH%1%_>nIiOUjobSq*{ zj0H%zTJOud_axlsH7~%*`_l4)G3Olu!LH#PS|hDaF%I16l0w#{#YxZFy4XOV;K;j> zc^I2PJ&u?yhr1J-!HBncWP5hVOT{a##FTXH2k6>l)RK1x#&$x%OJ*DfU0o>_AH%oMe*aUw{JEHa`BR=p&Hqpd17O_|?Zw}MROdhEyw{R-I zW0RP$CuL?EzceFx#&;ksDg&KOf#P8$S|Q`vuDlp9f>_44=&aun%ZN_|bSLCv4Bq)X zyXopd_l-ZlZV!_{CJr4yYoopw)rs#?D;s~h^tP8LA3uK|ICi0pjxl)ea?jU6(Ad~8b0S5L2}X(#D7rZ#5^ z?mOG*Pwdz_U|0yT!!i~Ao>87Wy)8*P={7OGbcX&g%R(Ss!lQ)b^8R@Tg>wdztzwJM zB(~5l6(jM6weL@dq*rotbHscFP2~VZlY6$cVG?^@5otvQ0F`{&Yc|X2Fd+ zsh5{7bwUO78Iv@eVmL+@L4;l`Ew-CUTT|FNq@@KkWSx8X4nt%dWo6UfUH~)lggql$ zF*eLP@>Xo)1Sq250`D+dhGGbF^eLc=9zT=p)OCn3OAt#I_jyO!T0D)-WIB9;X=Vs~StJsi;=n<0fDn zXfKbs@)z!B%{G0}&HD)gifn^e-lIF>*-ZZetnNxnBr?Kfo2J+Osrm|1w%gw+I3Dhmb6eXJmr&3u z#s_&Ny$21`wy;l@z(ucQWIW{5idX=;c=M!rNECiTqmbIh_@|SCe9Ki2 z_4Q5V@5u-bm~0dLg7*bG5J24Bz05E@c9?fmb=T+bu!#2g`Meqy&BmBN`t#S~LwN2k zmAbl6)c0$YE6=8&KB+=jYTo^5@Jl}NF(*}a=&Abd8TxLHn3A&2w6&UlKK16a+59QC zk_z~=w-%D&msi5?TqlDY#Si6bt z(Oe9V2Khw7e_tXsFB2UC_FZgmLIa+}2sTmf4W7`tpZn}DW6Q;OMLhG&64!Sn)Tk!%V(x$yCu`7^$AAs@ zHpMDnp2Egd$%Ug76Use7-ziGu>t_A+a1U~rAnQC6$Wykc-R+Tk(-ClD{&w*E$5TSZ zRJ+RT@M8Uj^fN7}vo(a3E^j>2C7q$(11W`+-qKLXc7AE%FWt)>w$Z1ZN3mF6zDP^e zE4XYpC5;x0t;#RqKyNh`0i`+^yGyrF6l>;1)>BLGw?#G`3og}$GfMe<7IJ(yc_N}8 z6(C9*DxqPFCS7X+ud0Cj&68N_cfiuC4bp@S9lkIMO7NW;%eJodYyY`a;Am;`8rAM# z)J|gX&hIz=;BpH#*EcV;Ks^1`wM{=SF-A*y5}e?z?lz2Cr{3t9mI9vPd=HA@d%BX$$Rkungl?^+Rh`CQwSr}%IL*irmIKb_|)00yI zor5+_rp+8c&q>kRRXQJ9F^Ifi`w3QLwDxbA>sa$Iuo1nd-!?p$g7@jkN&Xp z^fWQ01cksRJ)I6#|3GcpALhYDH?PJA>9{FkkddmMUGLas$iKHVT--#+pIvH49u#Si zkE0Ev`z@<43orEBy9|hq>wZZlH;%D$+zMxO422EE+4J+8;7fDNE#b9E1P{8KWAS*y zKJtSBpn+Y5<`2+ag1jUb&~E7gB}@;f1R~4QWpm1t-(H_Kgd~FE&fGtJzJ+)NFj!JY z-oIWlTSZ98tzYRnPG?8Foud=Gk7ij0-Y=MavWKEwF=oVVl&bTtMswhvCMP%N@{7ye z+cJ&lce#_*dka2)?$lG{A}eK`&cI7#68e`~QrhUuyNg}a`}dW_gG*+6tua%hOh z_~GX8w*-PKp0}0;`<^uE)Pn8TB#!F6PYfaAa#(Gmv&t~5Eg^3q4$E(O$RAE&)TW7VM7*K!EcAcLQNfVd$viPgt#=!J2 z_@6=I=N`xAF?4jSif%|8mX)C?oLPg~dGdR_gJ_xwZ;H zgS<%dR-dfeuVIXvD5m6nqdumdIKZz7H}R}(fhw=OeoLuw#JT`uAybMRM!|t6G(s58 z4o*~NBu!ub=ND<~LD?$cI`pQW%0iqwM2>D6fS1YYkBjVfo7dLCg2H;~TdAUz8fUk6 z+J=v6a+zYXIIZ5m`D+D$Z@wkVM!soqeZ!PC4Na?`oqhM6umi6+$86RCWaOOFBrf#t z8+Qu_@QBiT&F@ocVP;t5UCVU>5op+>D-;-h^BZkIE?P(qF>-)b4TS3}o&9?pE}WmA zAHM488NS3+ZJWIE>@TleIPRC#DxghZp*b{0Oh-gDH_qC$+xqxCPNPoca}Z-Sp;u4E z`3QZjOZ9qDgSTq=rBJ()9FtWzu4%v$#>P%t#Gz3`8w#^bg)nMq-bdTcE^iRi0I2@u z+*;(4hT*$I$P(ukhrcm5|HnPhH|+O^L!=|{%B=~71~%?Po>!2iRWctOMS9^{MnX_T zk9F&cZ!pi!D(A2`UV+n#j0=yZ)=Mjwv%xr~n14-kzEmN>h~qwmcyCh_#o{^^#r5e! z@2dgpirKq6&qe!2qmuf6Sst19W6fI}mJ;WKOkD~`KjNHwiI0702l}e>TVW^|jhyJ^ zO_sIQca46UNB(#&SmTlowb`-q^bA%wgm6h-P?(K<@!(R|z(CwLx0dq}jPJMZv5HD` zr|+_qBFdk|%x8|pqbqKYOgE#{!j3TUO7oYFP)8Nu(SvrGR)WQCAhW_THEZnD1RPt0 zp3%B-i5n??f_U_OYO-aG5ZtWW@>K;MrPt5l1+KpuM;>4MJhgBR2NveTghL%s^i@a4 zsskz}Dl>^Jixk$^Ea`@V3l?nK=^Q^ek#%!f|IJlaRIv0@jjryl3GmO*Sw>Exa;Jcz zjMQO|x2W9h8Z@VIXVnLZig;4XKujupCaZ_DEh@N*f7)&SBM7CIVM*(3XqaON`FAp0 zdzdge$d~b_JRP`#W7k6YM#0Igap`SiQn8J2(Y~{&2g+;@vh7~g_DA<`i!X2Mx>e%G zBDR`FkPp1;`J9HPC`s>*1@KJZ8XgBIA1#^M Date: Sun, 22 Mar 2020 00:28:20 +0100 Subject: [PATCH 14/16] Adds a new logging system and a logging view (#13115) * Super early initial commit * Why do I keep comitting this * in between * In between * Sort fix. Transfer fix. HTML and more * Scrolling + define values change * Search fixes and time input fixes * Minor tweaks. Fuel tank inclusion. Fixes * derp * Extra logging to fuel tank * minor stuff * add the message to admins for fueltanks * Don't keep mob/atom references + fixes * line fixes? * Review improvements * pois comment --- code/__DEFINES/logs.dm | 6 + code/__HELPERS/mobs.dm | 35 ++- code/__HELPERS/time.dm | 16 +- code/__HELPERS/unsorted.dm | 13 +- code/datums/datumvars.dm | 2 +- code/datums/log_record.dm | 37 +++ code/datums/log_viewer.dm | 232 ++++++++++++++++++ code/datums/mind.dm | 8 + code/datums/spell.dm | 2 +- code/datums/spells/mime.dm | 3 +- code/game/gamemodes/cult/cult.dm | 1 + .../miniantags/abduction/abduction.dm | 3 +- code/game/gamemodes/nuclear/nuclear.dm | 1 + code/game/gamemodes/revolution/revolution.dm | 3 +- code/game/gamemodes/shadowling/shadowling.dm | 3 + code/game/gamemodes/vampire/vampire.dm | 1 + code/game/gamemodes/wizard/rightandwrong.dm | 4 +- code/game/gamemodes/wizard/soulstone.dm | 5 +- code/game/gamemodes/wizard/spellbook.dm | 1 + code/game/gamemodes/wizard/wizard.dm | 1 + code/game/machinery/doors/airlock.dm | 3 + code/game/mecha/mecha.dm | 1 + .../objects/items/devices/laserpointer.dm | 1 + code/modules/admin/admin_verbs.dm | 1 + code/modules/admin/verbs/logging_view.dm | 10 + code/modules/admin/verbs/randomverbs.dm | 2 +- .../kitchen_machinery/gibber.dm | 1 + code/modules/mob/dead/observer/observer.dm | 7 +- code/modules/mob/emote.dm | 1 + code/modules/mob/living/living.dm | 1 + code/modules/mob/living/say.dm | 2 + .../mob/living/silicon/robot/update_status.dm | 1 + code/modules/mob/living/stat_states.dm | 5 +- code/modules/mob/login.dm | 1 + code/modules/mob/logout.dm | 1 + code/modules/mob/mob.dm | 13 +- code/modules/mob/mob_defines.dm | 7 +- code/modules/projectiles/guns/magic/wand.dm | 1 + code/modules/projectiles/projectile/magic.dm | 6 +- code/modules/reagents/reagent_dispenser.dm | 12 +- code/modules/recycling/sortingmachinery.dm | 1 + code/modules/spacepods/spacepod.dm | 1 + code/modules/tram/tram.dm | 1 + paradise.dme | 4 + 44 files changed, 419 insertions(+), 42 deletions(-) create mode 100644 code/__DEFINES/logs.dm create mode 100644 code/datums/log_record.dm create mode 100644 code/datums/log_viewer.dm create mode 100644 code/modules/admin/verbs/logging_view.dm diff --git a/code/__DEFINES/logs.dm b/code/__DEFINES/logs.dm new file mode 100644 index 00000000000..a8a4a457c7c --- /dev/null +++ b/code/__DEFINES/logs.dm @@ -0,0 +1,6 @@ +#define ATTACK_LOG "Attack" +#define DEFENSE_LOG "Defense" +#define CONVERSION_LOG "Conversion" +#define SAY_LOG "Say" +#define EMOTE_LOG "Emote" +#define MISC_LOG "Misc" \ No newline at end of file diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index cdbb969f817..6be2b411376 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -274,7 +274,7 @@ Proc for attack log creation, because really why not This is always put in the attack log. */ -/proc/add_attack_logs(mob/user, mob/target, what_done, custom_level) +/proc/add_attack_logs(atom/user, target, what_done, custom_level) if(islist(target)) // Multi-victim adding var/list/targets = target for(var/mob/M in targets) @@ -282,24 +282,33 @@ This is always put in the attack log. return var/user_str = key_name_log(user) + COORD(user) - var/target_str = key_name_log(target) + COORD(target) - - if(istype(user)) - user.create_attack_log("Attacked [target_str]: [what_done]") - if(istype(target)) - target.create_attack_log("Attacked by [user_str]: [what_done]") + var/target_str + if(isatom(target)) + var/atom/AT = target + target_str = key_name_log(AT) + COORD(AT) + else + target_str = target + var/mob/MU = user + var/mob/MT = target + if(istype(MU)) + MU.create_log(ATTACK_LOG, what_done, target, get_turf(user)) + MU.create_attack_log("Attacked [target_str]: [what_done]") + if(istype(MT)) + MT.create_log(DEFENSE_LOG, what_done, user, get_turf(MT)) + MT.create_attack_log("Attacked by [user_str]: [what_done]") log_attack(user_str, target_str, what_done) var/loglevel = ATKLOG_MOST if(!isnull(custom_level)) loglevel = custom_level - else if(istype(target)) - if(istype(user) && !user.ckey && !target.ckey) // Attacks between NPCs are only shown to admins with ATKLOG_ALL - loglevel = ATKLOG_ALL - else if(!user.ckey || !target.ckey || (user.ckey == target.ckey)) // Player v NPC combat is de-prioritized. Also no self-harm, nobody cares - loglevel = ATKLOG_ALMOSTALL + else if(istype(MT)) + if(istype(MU)) + if(!MU.ckey && !MT.ckey) // Attacks between NPCs are only shown to admins with ATKLOG_ALL + loglevel = ATKLOG_ALL + else if(!MU.ckey || !MT.ckey || (MU.ckey == MT.ckey)) // Player v NPC combat is de-prioritized. Also no self-harm, nobody cares + loglevel = ATKLOG_ALMOSTALL else - var/area/A = get_area(target) + var/area/A = get_area(MT) if(A && A.hide_attacklogs) loglevel = ATKLOG_ALMOSTALL if(isLivingSSD(target)) // Attacks on SSDs are shown to admins with any log level except ATKLOG_NONE. Overrides custom level diff --git a/code/__HELPERS/time.dm b/code/__HELPERS/time.dm index d13bf08c58b..340d7a3b134 100644 --- a/code/__HELPERS/time.dm +++ b/code/__HELPERS/time.dm @@ -50,10 +50,24 @@ return "[date_portion]T[time_portion]" /proc/gameTimestamp(format = "hh:mm:ss", wtime=null) - if(!wtime) + if(wtime == null) wtime = world.time return time2text(wtime - GLOB.timezoneOffset, format) +// max hh:mm:ss supported +/proc/timeStampToNum(timestamp) + var/list/splits = text2numlist(timestamp, ":") + . = 0 + var/split_len = length(splits) + for(var/i = 1 to length(splits)) + switch(split_len - i) + if(2) + . += splits[i] HOURS + if(1) + . += splits[i] MINUTES + if(0) + . += splits[i] SECONDS + /* This is used for displaying the "station time" equivelent of a world.time value Calling it with no args will give you the current time, but you can specify a world.time-based value as an argument - You can use this, for example, to do "This will expire at [station_time_at(world.time + 500)]" to display a "station time" expiration date diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index c5a77880cf0..aedc16c4162 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1895,8 +1895,15 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) #undef DELTA_CALC -// This proc gets a list of all "points of interest" (poi's) that can be used by admins to track valuable mobs or atoms (such as the nuke disk). -/proc/getpois(mobs_only=0,skip_mindless=0) +/* + * This proc gets a list of all "points of interest" (poi's) that can be used by admins to track valuable mobs or atoms (such as the nuke disk). + * @param mobs_only if set to TRUE it won't include locations to the returned list + * @param skip_mindless if set to TRUE it will skip mindless mobs + * @param force_include_bots if set to TRUE it will include bots even if skip_mindless is set to TRUE + * @param force_include_cameras if set to TRUE it will include camera eyes even if skip_mindless is set to TRUE + * @return returns a list with the found points of interest +*/ +/proc/getpois(mobs_only = FALSE, skip_mindless = FALSE, force_include_bots = FALSE, force_include_cameras = FALSE) var/list/mobs = sortmobs() var/list/names = list() var/list/pois = list() @@ -1904,7 +1911,7 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) for(var/mob/M in mobs) if(skip_mindless && (!M.mind && !M.ckey)) - if(!isbot(M) && !istype(M, /mob/camera/)) + if(!(force_include_bots && isbot(M)) && !(force_include_cameras && istype(M, /mob/camera))) continue if(M.client && M.client.holder && M.client.holder.fakekey) //stealthmins continue diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 1defb9a6afa..b2b09003934 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -31,7 +31,7 @@ /datum/proc/vv_get_var(var_name) switch(var_name) - if("attack_log", "debug_log") + if("attack_log_old", "debug_log") return debug_variable(var_name, vars[var_name], 0, src, sanitize = FALSE) if("vars") return debug_variable(var_name, list(), 0, src) diff --git a/code/datums/log_record.dm b/code/datums/log_record.dm new file mode 100644 index 00000000000..9b7d52b5390 --- /dev/null +++ b/code/datums/log_record.dm @@ -0,0 +1,37 @@ +/datum/log_record + var/log_type // Type of log + var/raw_time // When did this happen? + var/what // What happened + var/who // Who did it + var/target // Who/what was targeted (can be a string) + var/turf/where // Where did it happen + +/datum/log_record/New(_log_type, _who, _what, _target, _where, _raw_time) + log_type = _log_type + + who = get_subject_text(_who) + what = _what + target = get_subject_text(_target) + if(!_where) + _where = get_turf(_who) + where = _where + if(!_raw_time) + _raw_time = world.time + raw_time = _raw_time + +/datum/log_record/proc/get_subject_text(subject) + if(ismob(subject) || isclient(subject) || istype(subject, /datum/mind)) + return key_name_admin(subject) + if(isatom(subject)) + var/atom/A = subject + return A.name + if(istype(subject, /datum)) + var/datum/D = subject + return D.type + return subject + +/proc/compare_log_record(datum/log_record/A, datum/log_record/B) + var/time_diff = A.raw_time - B.raw_time + if(!time_diff) // Same time + return cmp_text_asc(A.log_type, B.log_type) + return time_diff diff --git a/code/datums/log_viewer.dm b/code/datums/log_viewer.dm new file mode 100644 index 00000000000..70f7d832924 --- /dev/null +++ b/code/datums/log_viewer.dm @@ -0,0 +1,232 @@ +#define ALL_LOGS list(ATTACK_LOG, DEFENSE_LOG, CONVERSION_LOG, SAY_LOG, EMOTE_LOG, MISC_LOG) + +/datum/log_viewer + var/time_from = 0 + var/time_to = 4 HOURS // 4 Hours should be enough. INFINITY would screw the UI up + var/list/selected_mobs = list() // The mobs in question + var/list/selected_log_types = list() // The log types being searched for + + var/list/log_records = list() // Found and sorted records + +/datum/log_viewer/proc/clear_all() + selected_mobs.Cut() + selected_log_types.Cut() + time_from = initial(time_from) + time_to = initial(time_to) + log_records.Cut() + return + +/datum/log_viewer/proc/search() + log_records.Cut() // Empty the old results + var/list/invalid_mobs = list() + for(var/i in selected_mobs) + var/mob/M = i + if(!M || QDELETED(M)) + invalid_mobs |= M + continue + for(var/log_type in selected_log_types) + var/list/logs = M.logs[log_type] + var/len_logs = length(logs) + if(len_logs) + var/start_index = get_earliest_log_index(logs) + if(!start_index) // No log found that matches the starting time criteria + continue + var/end_index = get_latest_log_index(logs) + if(!end_index) // No log found that matches the end time criteria + continue + log_records.Add(logs.Copy(start_index, end_index + 1)) + + if(invalid_mobs.len) + to_chat(usr, "The search criteria contained invalid mobs. They have been removed from the criteria.") + for(var/i in invalid_mobs) + selected_mobs -= i // Cleanup + + log_records = sortTim(log_records, /proc/compare_log_record) + +/** Binary search like implementation to find the earliest log + * Returns the index of the earliest log using the time_from value for the given list of logs. + * It will return 0 if no log after time_from is found +*/ +/datum/log_viewer/proc/get_earliest_log_index(list/logs) + if(!time_from) + return 1 + var/start = 1 + var/end = length(logs) + var/mid + do + mid = round_down((end + start) / 2) + var/datum/log_record/L = logs[mid] + if(L.raw_time >= time_from) + end = mid + else + start = mid + while(end - start > 1) + var/datum/log_record/L = logs[end] + if(L.raw_time >= time_from) // Check if there is atleast one valid log + return end + return 0 + +/** Binary search like implementation to find the latest log + * Returns the index of the latest log using the time_to value (1 second is added to prevent rounding weirdness) for the given list of logs. + * It will return 0 if no log before time_to + 10 is found +*/ +/datum/log_viewer/proc/get_latest_log_index(list/logs) + if(world.time < time_to) + return length(logs) + + var/end = length(logs) + var/start = 1 + var/mid + var/max_time = time_to + 10 + do + mid = round((end + start) / 2 + 0.5) + var/datum/log_record/L = logs[mid] + if(L.raw_time >= max_time) + end = mid + else + start = mid + while(end - start > 1) + var/datum/log_record/L = logs[start] + if(L.raw_time < max_time) // Check if there is atleast one valid log + return start + return 0 + +/datum/log_viewer/proc/add_mob(mob/user, mob/M) + if(!M || !user) + return + selected_mobs |= M + + show_ui(user) + +/datum/log_viewer/proc/show_ui(mob/user) + var/all_log_types = ALL_LOGS + var/trStyleTop = "border-top:2px solid; border-bottom:2px solid; padding-top: 5px; padding-bottom: 5px;" + var/trStyle = "border-top:1px solid; border-bottom:1px solid; padding-top: 5px; padding-bottom: 5px;" + var/dat + dat += "" + dat += "
    " + dat += "Time Search Range: [gameTimestamp(wtime = time_from)]" + dat += " To: [gameTimestamp(wtime = time_to)]" + dat += "
    " + + dat += "Mobs being used:" + for(var/i in selected_mobs) + var/mob/M = i + dat += "[M.name]" + dat += "Add Mob" + dat += "Clear All Mobs" + dat += "
    " + + dat += "Log Types:" + for(var/i in all_log_types) + var/log_type = i + var/enabled = (log_type in selected_log_types) + var/text + var/style + if(enabled) + text = "[log_type]" + style = "background: [get_logtype_color(i)]" + else + text = log_type + + dat += "[text]" + + dat += "
    " + dat += "Clear All Settings" + dat += "Search" + dat += "
    " + + // Search results + var/tdStyleTime = "width:80px; text-align:center;" + var/tdStyleType = "width:80px; text-align:center;" + var/tdStyleWho = "width:300px; text-align:center;" + var/tdStyleWhere = "width:150px; text-align:center;" + dat += "
    " + dat += "
    NameFrom DepartmentTo DepartmentSent AtSent ByView
    [F.name][F.from_department]
    " + dat += "" + for(var/i in log_records) + var/datum/log_record/L = i + var/time = gameTimestamp(wtime = L.raw_time - 9.99) // The time rounds up for some reason. Will result in weird filtering results + + dat +="\ + \ + " + + dat += "
    WhenTypeWhoWhatTargetWhere
    [time][L.log_type][L.who][L.what][L.target][ADMIN_COORDJMP(L.where)]
    " + dat += "
    " + + var/datum/browser/popup = new(user, "Log viewer", "Log viewer", 1400, 600) + popup.set_content(dat) + popup.open() + +/datum/log_viewer/Topic(href, href_list) + if(href_list["start_time"]) + var/input = input(usr, "hh:mm:ss", "Start time", "00:00:00") as text|null + if(!input) + return + var/res = timeStampToNum(input) + if(res < 0) + to_chat(usr, "'[input]' is an invalid input value.") + return + time_from = res + show_ui(usr) + return + if(href_list["end_time"]) + var/input = input(usr, "hh:mm:ss", "End time", "04:00:00") as text|null + if(!input) + return + var/res = timeStampToNum(input) + if(res < 0) + to_chat(usr, "'[input]' is an invalid input value.") + return + time_to = res + + show_ui(usr) + return + if(href_list["search"]) + search(usr) + show_ui(usr) + return + if(href_list["clear_all"]) + clear_all(usr) + show_ui(usr) + return + if(href_list["clear_mobs"]) + selected_mobs.Cut() + show_ui(usr) + return + if(href_list["add_mob"]) + var/list/mobs = getpois(TRUE, TRUE) + var/datum/async_input/A = input_autocomplete_async(usr, "Please, select a mob: ", mobs) + A.on_close(CALLBACK(src, .proc/add_mob, usr)) + return + if(href_list["remove_mob"]) + var/mob/M = locate(href_list["remove_mob"]) + if(M) + selected_mobs -= M + show_ui(usr) + return + if(href_list["toggle_log_type"]) + var/log_type = href_list["toggle_log_type"] + if(log_type in selected_log_types) + selected_log_types -= log_type + else + selected_log_types += log_type + show_ui(usr) + return + +/datum/log_viewer/proc/get_logtype_color(log_type) + switch(log_type) + if(ATTACK_LOG) + return "darkred" + if(DEFENSE_LOG) + return "chocolate" + if(CONVERSION_LOG) + return "indigo" + if(SAY_LOG) + return "teal" + if(EMOTE_LOG) + return "deepskyblue" + if(MISC_LOG) + return "gray" + return "slategray" diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 4f176970a92..135114c11f9 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -105,6 +105,14 @@ current.mind = null leave_all_huds() //leave all the huds in the old body, so it won't get huds if somebody else enters it + for(var/log_type in current.logs) // Copy the old logs + var/list/logs = current.logs[log_type] + if(new_character.logs[log_type]) + new_character.logs[log_type] += logs.Copy() // Append the old ones + new_character.logs[log_type] = sortTim(new_character.logs[log_type], /proc/compare_log_record) // Sort them on time + else + new_character.logs[log_type] = logs.Copy() // Just copy them + SSnanoui.user_transferred(current, new_character) if(new_character.mind) //remove any mind currently in our new body's mind variable diff --git a/code/datums/spell.dm b/code/datums/spell.dm index 6b1865cf73d..30347d1e796 100644 --- a/code/datums/spell.dm +++ b/code/datums/spell.dm @@ -241,7 +241,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) before_cast(targets) invocation() if(user && user.ckey) - user.create_attack_log("[key_name(user)] cast the spell [name].") + add_attack_logs(user, null, "cast the spell [name]") spawn(0) if(charge_type == "recharge" && recharge) start_recharge() diff --git a/code/datums/spells/mime.dm b/code/datums/spells/mime.dm index 31066001270..d0c052649d9 100644 --- a/code/datums/spells/mime.dm +++ b/code/datums/spells/mime.dm @@ -141,6 +141,7 @@ else user.mind.AddSpell(S) to_chat(user, "You flip through the pages. Your understanding of the boundaries of reality increases. You can cast [spellname]!") + user.create_log(MISC_LOG, "learned the spell [spellname] ([S])") user.create_attack_log("[key_name(user)] learned the spell [spellname] ([S]).") onlearned(user) @@ -164,4 +165,4 @@ /obj/item/spellbook/oneuse/mime/greaterwall spell = /obj/effect/proc_holder/spell/targeted/forcewall/mime spellname = "Invisible Greater Wall" - desc = "It contains illustrations of the great walls of human history." + desc = "It contains illustrations of the great walls of human history." \ No newline at end of file diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index ffe67595f11..1a9dd15c65e 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -189,6 +189,7 @@ GLOBAL_LIST_EMPTY(all_cults) C.Grant(cult_mind.current) SEND_SOUND(cult_mind.current, 'sound/ambience/antag/bloodcult.ogg') cult_mind.current.create_attack_log("Has been converted to the cult!") + cult_mind.current.create_log(CONVERSION_LOG, "converted to the cult") if(jobban_isbanned(cult_mind.current, ROLE_CULTIST) || jobban_isbanned(cult_mind.current, ROLE_SYNDICATE)) replace_jobbanned_player(cult_mind.current, ROLE_CULTIST) update_cult_icons_added(cult_mind) diff --git a/code/game/gamemodes/miniantags/abduction/abduction.dm b/code/game/gamemodes/miniantags/abduction/abduction.dm index 6914ae55363..1888d0e4a1d 100644 --- a/code/game/gamemodes/miniantags/abduction/abduction.dm +++ b/code/game/gamemodes/miniantags/abduction/abduction.dm @@ -267,6 +267,7 @@ SSticker.mode.abductors -= abductor_mind abductor_mind.special_role = null abductor_mind.current.create_attack_log("No longer abductor") + abductor_mind.current.create_log(CONVERSION_LOG, "No longer abductor") if(issilicon(abductor_mind.current)) to_chat(abductor_mind.current, "You have been turned into a robot! You are no longer an abductor.") else @@ -281,4 +282,4 @@ /datum/game_mode/proc/update_abductor_icons_removed(datum/mind/alien_mind) var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_ABDUCTOR] hud.leave_hud(alien_mind.current) - set_antag_hud(alien_mind.current, null) + set_antag_hud(alien_mind.current, null) \ No newline at end of file diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index 8fd5da01a2c..ad1146c0bc8 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -68,6 +68,7 @@ proc/issyndicate(mob/living/M as mob) for(var/datum/objective/nuclear/O in operative_mind.objectives) operative_mind.objectives -= O operative_mind.current.create_attack_log("No longer nuclear operative") + operative_mind.current.create_log(CONVERSION_LOG, "No longer nuclear operative") if(issilicon(operative_mind.current)) to_chat(operative_mind.current, "You have been turned into a robot! You are no longer a Syndicate operative.") else diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index f7da210b4a9..00ce24b6c46 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -244,6 +244,7 @@ rev_mind.current.Stun(5) to_chat(rev_mind.current, " You are now a revolutionary! Help your cause. Do not harm your fellow freedom fighters. You can identify your comrades by the red \"R\" icons, and your leaders by the blue \"R\" icons. Help them kill the heads to win the revolution!") rev_mind.current.create_attack_log("Has been converted to the revolution!") + rev_mind.current.create_log(CONVERSION_LOG, "converted to the revolution") rev_mind.special_role = SPECIAL_ROLE_REV update_rev_icons_added(rev_mind) if(jobban_isbanned(rev_mind.current, ROLE_REV) || jobban_isbanned(rev_mind.current, ROLE_SYNDICATE)) @@ -262,7 +263,7 @@ revolutionaries -= rev_mind rev_mind.special_role = null rev_mind.current.create_attack_log("Has renounced the revolution!") - + rev_mind.current.create_log(CONVERSION_LOG, "renounced the revolution") if(beingborged) to_chat(rev_mind.current, "The frame's firmware detects and deletes your neural reprogramming! You remember nothing[remove_head ? "." : " but the name of the one who flashed you."]") message_admins("[key_name_admin(rev_mind.current)] [ADMIN_QUE(rev_mind.current,"?")] ([ADMIN_FLW(rev_mind.current,"FLW")]) has been borged while being a [remove_head ? "leader" : " member"] of the revolution.") diff --git a/code/game/gamemodes/shadowling/shadowling.dm b/code/game/gamemodes/shadowling/shadowling.dm index d190009dbb2..9cd91817af4 100644 --- a/code/game/gamemodes/shadowling/shadowling.dm +++ b/code/game/gamemodes/shadowling/shadowling.dm @@ -158,6 +158,7 @@ Made by Xhuis new_thrall_mind.special_role = SPECIAL_ROLE_SHADOWLING_THRALL update_shadow_icons_added(new_thrall_mind) new_thrall_mind.current.create_attack_log("Became a thrall") + new_thrall_mind.current.create_log(CONVERSION_LOG, "Became a thrall") new_thrall_mind.current.add_language("Shadowling Hivemind") new_thrall_mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/lesser_shadow_walk(null)) new_thrall_mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadow_vision/thrall(null)) @@ -179,6 +180,7 @@ Made by Xhuis return 0 //If there is no mind, the mind isn't a thrall, or the mind's mob isn't alive, return shadowling_thralls.Remove(thrall_mind) thrall_mind.current.create_attack_log("Dethralled") + thrall_mind.current.create_log(CONVERSION_LOG, "Dethralled") thrall_mind.special_role = null update_shadow_icons_removed(thrall_mind) for(var/obj/effect/proc_holder/spell/S in thrall_mind.spell_list) @@ -236,6 +238,7 @@ Made by Xhuis update_shadow_icons_removed(ling_mind) shadows.Remove(ling_mind) ling_mind.current.create_attack_log("Deshadowlinged") + ling_mind.current.create_log(CONVERSION_LOG, "Deshadowlinged") ling_mind.special_role = null for(var/obj/effect/proc_holder/spell/S in ling_mind.spell_list) ling_mind.RemoveSpell(S) diff --git a/code/game/gamemodes/vampire/vampire.dm b/code/game/gamemodes/vampire/vampire.dm index e0ea19b2f0a..6c22313ef6e 100644 --- a/code/game/gamemodes/vampire/vampire.dm +++ b/code/game/gamemodes/vampire/vampire.dm @@ -348,6 +348,7 @@ You are weak to holy things and starlight. Don't go into space and avoid the Cha SSticker.mode.vampires -= vampire_mind vampire_mind.special_role = null vampire_mind.current.create_attack_log("De-vampired") + vampire_mind.current.create_log(CONVERSION_LOG, "De-vampired") if(vampire_mind.vampire) vampire_mind.vampire.remove_vampire_powers() QDEL_NULL(vampire_mind.vampire) diff --git a/code/game/gamemodes/wizard/rightandwrong.dm b/code/game/gamemodes/wizard/rightandwrong.dm index 4f2d20b373a..3dbd9211399 100644 --- a/code/game/gamemodes/wizard/rightandwrong.dm +++ b/code/game/gamemodes/wizard/rightandwrong.dm @@ -109,6 +109,7 @@ GLOBAL_VAR_INIT(summon_magic_triggered, FALSE) H.mind.add_antag_datum(/datum/antagonist/survivalist/guns) H.create_attack_log("was made into a survivalist, and trusts no one!") + H.create_log(CONVERSION_LOG, "was made into a survivalist") var/gun_type = pick(GLOB.summoned_guns) var/obj/item/gun/G = new gun_type(get_turf(H)) @@ -130,6 +131,7 @@ GLOBAL_VAR_INIT(summon_magic_triggered, FALSE) H.mind.add_antag_datum(/datum/antagonist/survivalist/magic) H.create_attack_log("was made into a survivalist, and trusts no one!") + H.create_log(CONVERSION_LOG, "was made into a survivalist") var/magic_type = pick(GLOB.summoned_magic) var/lucky = FALSE @@ -166,4 +168,4 @@ GLOBAL_VAR_INIT(summon_magic_triggered, FALSE) if(summon_type == SUMMON_MAGIC) give_magic(H) else - give_guns(H) + give_guns(H) \ No newline at end of file diff --git a/code/game/gamemodes/wizard/soulstone.dm b/code/game/gamemodes/wizard/soulstone.dm index cf0ce4843f0..634fc8f5a38 100644 --- a/code/game/gamemodes/wizard/soulstone.dm +++ b/code/game/gamemodes/wizard/soulstone.dm @@ -69,9 +69,6 @@ to_chat(user, "\"Come now, do not capture your fellow's soul.\"") return ..() - M.create_attack_log("Has had their soul captured with [src.name] by [key_name(user)]") - user.create_attack_log("Used the [src.name] to capture the soul of [key_name(M)]") - if(optional) if(!M.ckey) to_chat(user, "They have no soul!") @@ -353,7 +350,7 @@ /obj/item/soulstone/proc/get_shade_type() return /mob/living/simple_animal/shade/cult - + /obj/item/soulstone/anybody/get_shade_type() return /mob/living/simple_animal/shade diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm index f97f14a9975..0dffc0e6159 100644 --- a/code/game/gamemodes/wizard/spellbook.dm +++ b/code/game/gamemodes/wizard/spellbook.dm @@ -837,6 +837,7 @@ else user.mind.AddSpell(S) to_chat(user, "you rapidly read through the arcane book. Suddenly you realize you understand [spellname]!") + user.create_log(MISC_LOG, "learned the spell [spellname] ([S])") user.create_attack_log("[key_name(user)] learned the spell [spellname] ([S]).") onlearned(user) diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm index 84f5b665e4f..3d07ae173db 100644 --- a/code/game/gamemodes/wizard/wizard.dm +++ b/code/game/gamemodes/wizard/wizard.dm @@ -59,6 +59,7 @@ SSticker.mode.wizards -= wizard_mind wizard_mind.special_role = null wizard_mind.current.create_attack_log("De-wizarded") + wizard_mind.current.create_log(CONVERSION_LOG, "De-wizarded") wizard_mind.current.spellremove(wizard_mind.current) wizard_mind.current.faction = list("Station") if(issilicon(wizard_mind.current)) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index cc76c2ab86f..bf83e6c5d49 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -276,6 +276,7 @@ About the new airlock wires panel: if(usr) shockedby += text("\[[time_stamp()]\] - [usr](ckey:[usr.ckey])") usr.create_attack_log("Electrified the [name] at [x] [y] [z]") + add_attack_logs(usr, src, "Electrified") else shockedby += text("\[[time_stamp()]\] - EMP)") message = "The door is now electrified [duration == -1 ? "permanently" : "for [duration] second\s"]." @@ -763,6 +764,7 @@ About the new airlock wires panel: else if(activate) //electrify door for 30 seconds shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])") usr.create_attack_log("Electrified the [name] at [x] [y] [z]") + add_attack_logs(usr, src, "Electrified") to_chat(usr, "The door is now electrified for thirty seconds.") electrify(30) if("electrify_permanently") @@ -774,6 +776,7 @@ About the new airlock wires panel: else if(activate) shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])") usr.create_attack_log("Electrified the [name] at [x] [y] [z]") + add_attack_logs(usr, src, "Electrified") to_chat(usr, "The door is now electrified.") electrify(-1) if("open") diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index cc58d7efe7e..ec6f2c6456e 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -559,6 +559,7 @@ animal_damage = user.obj_damage animal_damage = min(animal_damage, 20*user.environment_smash) user.create_attack_log("attacked [name]") + add_attack_logs(user, src, "Attacked") attack_generic(user, animal_damage, user.melee_damage_type, "melee", play_soundeffect) return TRUE diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm index 21b71e7668c..095b1ea9456 100644 --- a/code/game/objects/items/devices/laserpointer.dm +++ b/code/game/objects/items/devices/laserpointer.dm @@ -138,6 +138,7 @@ log_admin("[key_name(user)] EMPd a camera with a laser pointer") user.create_attack_log("[key_name(user)] EMPd a camera with a laser pointer") + add_attack_logs(user, C, "EMPd with [src]") else outmsg = "You missed the lens of [C] with [src]." diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index ec197c61651..34929b52f53 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -26,6 +26,7 @@ GLOBAL_LIST_INIT(admin_verbs_admin, list( /client/proc/cmd_admin_subtle_message, /*send an message to somebody as a 'voice in their head'*/ /client/proc/cmd_admin_delete, /*delete an instance/object/mob/etc*/ /client/proc/cmd_admin_check_contents, /*displays the contents of an instance*/ + /client/proc/cmd_admin_open_logging_view, /client/proc/getserverlogs, /*allows us to fetch server logs (diary) for other days*/ /client/proc/jumptocoord, /*we ghost and jump to a coordinate*/ /client/proc/Getmob, /*teleports a mob to our location*/ diff --git a/code/modules/admin/verbs/logging_view.dm b/code/modules/admin/verbs/logging_view.dm new file mode 100644 index 00000000000..2a222e21dbd --- /dev/null +++ b/code/modules/admin/verbs/logging_view.dm @@ -0,0 +1,10 @@ +GLOBAL_LIST_INIT(open_logging_views, list()) + +/client/proc/cmd_admin_open_logging_view() + set category = "Admin" + set name = "Open Logging View" + set desc = "Opens the detailed logging viewer" + + if(!GLOB.open_logging_views[usr.client.ckey]) + GLOB.open_logging_views[usr.client.ckey] = new /datum/log_viewer() + GLOB.open_logging_views[usr.client.ckey].show_ui(usr) \ No newline at end of file diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 8c68d73a390..a8136655d8f 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -885,7 +885,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return to_chat(usr, text("Attack Log for []", mob)) - for(var/t in M.attack_log) + for(var/t in M.attack_log_old) to_chat(usr, t) feedback_add_details("admin_verb","ATTL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm index e0f456facec..7d17ac07720 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm @@ -285,6 +285,7 @@ else //this looks ugly but it's better than a copy-pasted startgibbing proc override occupant.create_attack_log("Was gibbed by an autogibber (\the [src])") + add_attack_logs(src, occupant, "gibbed") occupant.emote("scream") playsound(get_turf(src), 'sound/goonstation/effects/gib.ogg', 50, 1) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 0c283c60a7f..548d22a3fa3 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -53,7 +53,8 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) var/turf/T if(ismob(body)) T = get_turf(body) //Where is the body located? - attack_log = body.attack_log //preserve our attack logs by copying them to our ghost + attack_log_old = body.attack_log_old //preserve our attack logs by copying them to our ghost + logs = body.logs.Copy() var/mutable_appearance/MA = copy_appearance(body) if(body.mind && body.mind.name) @@ -431,7 +432,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set name = "Orbit" // "Haunt" set desc = "Follow and orbit a mob." - var/list/mobs = getpois(skip_mindless=1) + var/list/mobs = getpois(FALSE, TRUE, TRUE, TRUE) var/datum/async_input/A = input_autocomplete_async(usr, "Please, select a mob: ", mobs) A.on_close(CALLBACK(src, .proc/ManualFollow)) @@ -506,7 +507,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set desc = "Teleport to a mob" if(isobserver(usr)) //Make sure they're an observer! - var/list/dest = getpois(mobs_only=1) //Fill list, prompt user with list + var/list/dest = getpois(mobs_only=TRUE) //Fill list, prompt user with list var/datum/async_input/A = input_autocomplete_async(usr, "Enter a mob name: ", dest) A.on_close(CALLBACK(src, .proc/jump_to_mob)) diff --git a/code/modules/mob/emote.dm b/code/modules/mob/emote.dm index 57232d74f44..5f18a27adc9 100644 --- a/code/modules/mob/emote.dm +++ b/code/modules/mob/emote.dm @@ -59,6 +59,7 @@ var/mob/living/L = src L.say_log += "EMOTE: [input]" //say log too so it is easier on admins instead of having to merge the two with timestamps etc L.emote_log += input //emote only log if an admin wants to search just for emotes they don't have to sift through the say + create_log(EMOTE_LOG, input) // TODO after #13047: Include the channel // Hearing gasp and such every five seconds is not good emotes were not global for a reason. // Maybe some people are okay with that. for(var/mob/M in GLOB.player_list) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 0f6ba5df181..30e10553d3e 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -247,6 +247,7 @@ set hidden = 1 if(InCritical()) create_attack_log("[src] has ["succumbed to death"] with [round(health, 0.1)] points of health!") + create_log(MISC_LOG, "has succumbed to death with [round(health, 0.1)] points of health") adjustOxyLoss(health - HEALTH_THRESHOLD_DEAD) // super check for weird mobs, including ones that adjust hp // we don't want to go overboard and gib them, though diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 782808f2190..eeaed10b9c5 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -276,6 +276,7 @@ proc/get_radio_key_from_channel(var/channel) //Log of what we've said, plain message, no spans or junk say_log += message + create_log(SAY_LOG, message) // TODO after #13047: Include the channel log_say(message, src) return 1 @@ -361,6 +362,7 @@ proc/get_radio_key_from_channel(var/channel) say_log += "whisper: [message]" log_whisper(message, src) + create_log(SAY_LOG, "WHISPER: [message]") var/message_range = 1 var/eavesdropping_range = 2 var/watching_range = 5 diff --git a/code/modules/mob/living/silicon/robot/update_status.dm b/code/modules/mob/living/silicon/robot/update_status.dm index 63c13f97d24..5f1519395c7 100644 --- a/code/modules/mob/living/silicon/robot/update_status.dm +++ b/code/modules/mob/living/silicon/robot/update_status.dm @@ -30,6 +30,7 @@ to_chat(ghost, "Your cyborg shell has been repaired, re-enter if you want to continue! (Verbs -> Ghost -> Re-enter corpse)") ghost << sound('sound/effects/genetics.ogg') create_attack_log("revived, trigger reason: [reason]") + create_log(MISC_LOG, "revived, trigger reason: [reason]") // diag_hud_set_status() // diag_hud_set_health() // update_health_hud() diff --git a/code/modules/mob/living/stat_states.dm b/code/modules/mob/living/stat_states.dm index 57fd6e17cbc..9ff67107abd 100644 --- a/code/modules/mob/living/stat_states.dm +++ b/code/modules/mob/living/stat_states.dm @@ -7,6 +7,7 @@ else if(stat == UNCONSCIOUS) return 0 create_attack_log("Fallen unconscious at [atom_loc_line(get_turf(src))]") + add_attack_logs(src, null, "Fallen unconscious") log_game("[key_name(src)] fell unconscious at [atom_loc_line(get_turf(src))]") stat = UNCONSCIOUS if(updating) @@ -22,6 +23,7 @@ else if(stat == CONSCIOUS) return 0 create_attack_log("Woken up at [atom_loc_line(get_turf(src))]") + add_attack_logs(src, null, "Woken up") log_game("[key_name(src)] woke up at [atom_loc_line(get_turf(src))]") stat = CONSCIOUS if(updating) @@ -45,6 +47,7 @@ if(!can_be_revived()) return 0 create_attack_log("Came back to life at [atom_loc_line(get_turf(src))]") + add_attack_logs(src, null, "Came back to life") log_game("[key_name(src)] came back to life at [atom_loc_line(get_turf(src))]") stat = CONSCIOUS GLOB.dead_mob_list -= src @@ -73,4 +76,4 @@ return 1 /mob/living/proc/check_death_method() - return TRUE + return TRUE \ No newline at end of file diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 04dfa081be1..5345bda5b94 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -5,6 +5,7 @@ computer_id = client.computer_id log_access_in(client) create_attack_log("Logged in at [atom_loc_line(get_turf(src))]") + create_log(MISC_LOG, "Logged in") if(config.log_access) for(var/mob/M in GLOB.player_list) if(M == src) continue diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index bbf477fa1a0..8bdb0d89332 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -4,6 +4,7 @@ GLOB.player_list -= src log_access_out(src) create_attack_log("Logged out at [atom_loc_line(get_turf(src))]") + create_log(MISC_LOG, "Logged out") // `holder` is nil'd out by now, so we check the `admin_datums` array directly //Only report this stuff if we are currently playing. if(GLOB.admin_datums[ckey] && SSticker && SSticker.current_state == GAME_STATE_PLAYING) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 7d1edef93cf..d93b2723024 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -22,6 +22,7 @@ for(var/datum/alternate_appearance/AA in viewing_alternate_appearances) AA.viewers -= src viewing_alternate_appearances = null + logs.Cut() ..() return QDEL_HINT_HARDDEL @@ -1257,14 +1258,20 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ return list() //must return list or IGNORE_ACCESS /mob/proc/create_attack_log(text, collapse = TRUE) - LAZYINITLIST(attack_log) - create_log_in_list(attack_log, text, collapse, last_log) + LAZYINITLIST(attack_log_old) + create_log_in_list(attack_log_old, text, collapse, last_log) last_log = world.timeofday /mob/proc/create_debug_log(text, collapse = TRUE) LAZYINITLIST(debug_log) create_log_in_list(debug_log, text, collapse, world.timeofday) +/mob/proc/create_log(log_type, what, target = null, turf/where = get_turf(src)) + LAZYINITLIST(logs[log_type]) + var/list/log_list = logs[log_type] + var/datum/log_record/record = new(log_type, src, what, target, where, world.time) + log_list.Add(record) + /proc/create_log_in_list(list/target, text, collapse = TRUE, last_log)//forgive me code gods for this shitcode proc //this proc enables lovely stuff like an attack log that looks like this: "[18:20:29-18:20:45]21x John Smith attacked Andrew Jackson with a crowbar." //That makes the logs easier to read, but because all of this is stored in strings, weird things have to be used to get it all out. @@ -1406,4 +1413,4 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ ///Force set the mob nutrition /mob/proc/set_nutrition(change) - nutrition = max(0, change) + nutrition = max(0, change) \ No newline at end of file diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 5d63b7b4ad9..2f074aeaa9f 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -33,8 +33,11 @@ var/computer_id = null var/lastattacker = null var/lastattacked = null - var/list/attack_log = list( ) + var/list/attack_log_old = list( ) var/list/debug_log = null + + var/list/logs = list() // Logs for each log type defined in __DEFINES/logs.dm + var/last_log = 0 var/obj/machinery/machine = null var/other_mobs = null @@ -208,4 +211,4 @@ var/list/tkgrabbed_objects = list() // Assoc list of items to TK grabs var/forced_look = null // This can either be a numerical direction or a soft object reference (UID). It makes the mob always face towards the selected thing. - var/registered_z + var/registered_z \ No newline at end of file diff --git a/code/modules/projectiles/guns/magic/wand.dm b/code/modules/projectiles/guns/magic/wand.dm index 544ca67a361..68a7e7275a7 100644 --- a/code/modules/projectiles/guns/magic/wand.dm +++ b/code/modules/projectiles/guns/magic/wand.dm @@ -51,6 +51,7 @@ user.visible_message("[user] zaps [user.p_them()]self with [src].") playsound(user, fire_sound, 50, 1) user.create_attack_log("[key_name(user)] zapped [user.p_them()]self with a [src]") + add_attack_logs(null, user, "zapped [user.p_them()]self with a [src]") ///////////////////////////////////// //WAND OF DEATH diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm index d15e6c1375d..6c464a9dca1 100644 --- a/code/modules/projectiles/projectile/magic.dm +++ b/code/modules/projectiles/projectile/magic.dm @@ -263,12 +263,14 @@ return M.create_attack_log("[key_name(M)] became [new_mob.real_name].") - new_mob.attack_log = M.attack_log + add_attack_logs(null, M, "became [new_mob.real_name]") new_mob.a_intent = INTENT_HARM if(M.mind) M.mind.transfer_to(new_mob) else + new_mob.attack_log_old = M.attack_log_old.Copy() + new_mob.logs = M.logs.Copy() new_mob.key = M.key to_chat(new_mob, "Your form morphs into that of a [randomize].") @@ -344,4 +346,4 @@ to_chat(target, "You get splatted by [src].") M.Weaken(slip_weaken) M.Stun(slip_stun) - . = ..() + . = ..() \ No newline at end of file diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm index 194675a21d8..48c35415387 100644 --- a/code/modules/reagents/reagent_dispenser.dm +++ b/code/modules/reagents/reagent_dispenser.dm @@ -16,7 +16,7 @@ . = ..() if(. && obj_integrity > 0) if(tank_volume && (damage_flag == "bullet" || damage_flag == "laser")) - boom() + boom(FALSE, TRUE) /obj/structure/reagent_dispensers/attackby(obj/item/I, mob/user, params) if(I.is_refillable()) @@ -43,7 +43,7 @@ /obj/structure/reagent_dispensers/deconstruct(disassembled = TRUE) if(!(flags & NODECONSTRUCT)) if(!disassembled) - boom() + boom(FALSE, TRUE) else qdel(src) @@ -85,15 +85,19 @@ if(!QDELETED(src)) //wasn't deleted by the projectile's effects. if(!P.nodamage && ((P.damage_type == BURN) || (P.damage_type == BRUTE))) message_admins("[key_name_admin(P.firer)] triggered a fueltank explosion with [P.name] at [COORD(loc)] ") + add_attack_logs(P.firer, src, "shot with [P.name]") log_game("[key_name(P.firer)] triggered a fueltank explosion with [P.name] at [COORD(loc)]") investigate_log("[key_name(P.firer)] triggered a fueltank explosion with [P.name] at [COORD(loc)]", INVESTIGATE_BOMB) boom() -/obj/structure/reagent_dispensers/fueltank/boom(rigtrigger = FALSE) // Prevent case where someone who rigged the tank is blamed for the explosion when the rig isn't what triggered the explosion +/obj/structure/reagent_dispensers/fueltank/boom(rigtrigger = FALSE, log_attack = FALSE) // Prevent case where someone who rigged the tank is blamed for the explosion when the rig isn't what triggered the explosion if(rigtrigger) // If the explosion is triggered by an assembly holder message_admins("A fueltank, last rigged by [lastrigger], was triggered at [COORD(loc)]") // Then admin is informed of the last person who rigged the fuel tank log_game("A fueltank, last rigged by [lastrigger], triggered at [COORD(loc)]") + add_attack_logs(lastrigger, src, "rigged fuel tank exploded") investigate_log("A fueltank, last rigged by [lastrigger], triggered at [COORD(loc)]", INVESTIGATE_BOMB) + if(log_attack) + add_attack_logs(usr, src, "blew up", ATKLOG_FEW) if(reagents) reagents.set_reagent_temp(1000) //uh-oh qdel(src) @@ -140,6 +144,7 @@ if(istype(H.a_left, /obj/item/assembly/igniter) || istype(H.a_right, /obj/item/assembly/igniter)) msg_admin_attack("[key_name_admin(user)] rigged [src.name] with [I.name] for explosion (JMP)", ATKLOG_FEW) log_game("[key_name(user)] rigged [src.name] with [I.name] for explosion at [COORD(loc)]") + add_attack_logs(user, src, "rigged fuel tank") investigate_log("[key_name(user)] rigged [src.name] with [I.name] for explosion at [COORD(loc)]", INVESTIGATE_BOMB) lastrigger = "[key_name(user)]" @@ -163,6 +168,7 @@ obj/structure/reagent_dispensers/fueltank/welder_act(mob/user, obj/item/I) user.visible_message("[user] catastrophically fails at refilling [user.p_their()] [I]!", "That was stupid of you.") message_admins("[key_name_admin(user)] triggered a fueltank explosion at [COORD(loc)]") log_game("[key_name(user)] triggered a fueltank explosion at [COORD(loc)]") + add_attack_logs(user, src, "hit with lit welder") investigate_log("[key_name(user)] triggered a fueltank explosion at [COORD(loc)]", INVESTIGATE_BOMB) boom() else diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index 7d2be6953c6..92245d83acb 100755 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -221,6 +221,7 @@ user.visible_message("[user] wraps [target].") user.create_attack_log("Has used [name] on [target]") + add_attack_logs(user, target, "used [name]") if(amount <= 0 && !src.loc) //if we used our last wrapping paper, drop a cardboard tube new /obj/item/c_tube( get_turf(user) ) diff --git a/code/modules/spacepods/spacepod.dm b/code/modules/spacepods/spacepod.dm index 5b0be539578..7b154ef2a25 100644 --- a/code/modules/spacepods/spacepod.dm +++ b/code/modules/spacepods/spacepod.dm @@ -216,6 +216,7 @@ deal_damage(damage) visible_message("[user] [user.attacktext] [src]!") user.create_attack_log("attacked [src.name]") + add_attack_logs(user, src, "attacked") return TRUE /obj/spacepod/attack_alien(mob/user) diff --git a/code/modules/tram/tram.dm b/code/modules/tram/tram.dm index 109e820345b..ea43f3fd659 100644 --- a/code/modules/tram/tram.dm +++ b/code/modules/tram/tram.dm @@ -243,6 +243,7 @@ qdel(src) src.visible_message("[M] has [M.attacktext] [src]!") M.create_attack_log("attacked [src.name]") + add_attack_logs(M, src, "attacked") /obj/tram/bullet_act(var/obj/item/projectile/proj) if(prob(proj.damage)) diff --git a/paradise.dme b/paradise.dme index 952567f4894..5ef4e7db728 100644 --- a/paradise.dme +++ b/paradise.dme @@ -46,6 +46,7 @@ #include "code\__DEFINES\language.dm" #include "code\__DEFINES\layers.dm" #include "code\__DEFINES\lighting.dm" +#include "code\__DEFINES\logs.dm" #include "code\__DEFINES\machines.dm" #include "code\__DEFINES\math.dm" #include "code\__DEFINES\MC.dm" @@ -263,6 +264,8 @@ #include "code\datums\gas_mixture.dm" #include "code\datums\holocall.dm" #include "code\datums\hud.dm" +#include "code\datums\log_record.dm" +#include "code\datums\log_viewer.dm" #include "code\datums\mind.dm" #include "code\datums\mixed.dm" #include "code\datums\mutable_appearance.dm" @@ -1213,6 +1216,7 @@ #include "code\modules\admin\verbs\gimmick_team.dm" #include "code\modules\admin\verbs\honksquad.dm" #include "code\modules\admin\verbs\infiltratorteam_syndicate.dm" +#include "code\modules\admin\verbs\logging_view.dm" #include "code\modules\admin\verbs\map_template_loadverb.dm" #include "code\modules\admin\verbs\mapping.dm" #include "code\modules\admin\verbs\massmodvar.dm" From bdafa40b406b5049d17f15a66ea932e7c22bdf8f Mon Sep 17 00:00:00 2001 From: Mitchs98 Date: Sat, 21 Mar 2020 19:14:54 -0500 Subject: [PATCH 15/16] Advanced Scanner print-outs now show if an organ is dead. (#13138) * Diagnosis * minor oopsie * fixes the fix --- code/game/machinery/adv_med.dm | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 6b6f3087ad2..9d96ec94b99 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -425,6 +425,7 @@ var/AN = "" var/open = "" var/infected = "" + var/dead = "" var/robot = "" var/imp = "" var/bled = "" @@ -439,6 +440,8 @@ splint = "Splinted:" if(e.status & ORGAN_BROKEN) AN = "[e.broken_description]:" + if(e.status & ORGAN_DEAD) + dead = "DEAD:" if(e.is_robotic()) robot = "Robotic:" if(e.open) @@ -454,9 +457,9 @@ infected = "Acute Infection:" if(INFECTION_LEVEL_TWO + 200 to INFECTION_LEVEL_TWO + 300) infected = "Acute Infection+:" - if(INFECTION_LEVEL_TWO + 300 to INFECTION_LEVEL_TWO + 400) + if(INFECTION_LEVEL_TWO + 300 to INFECTION_LEVEL_TWO + 399) infected = "Acute Infection++:" - if(INFECTION_LEVEL_THREE to INFINITY) + if(INFECTION_LEVEL_TWO + 400 to INFINITY) infected = "Septic:" var/unknown_body = 0 @@ -467,11 +470,14 @@ imp += "Unknown body present:" if(!AN && !open && !infected & !imp) AN = "None:" - dat += "[e.name][e.burn_dam][e.brute_dam][robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured]" + dat += "[e.name][e.burn_dam][e.brute_dam][robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured][dead]" dat += "" for(var/obj/item/organ/internal/i in occupant.internal_organs) var/mech = i.desc var/infection = "None" + var/dead = "" + if(i.status & ORGAN_DEAD) + dead = "DEAD:" switch(i.germ_level) if(1 to INFECTION_LEVEL_ONE + 200) infection = "Mild Infection:" @@ -483,11 +489,13 @@ infection = "Acute Infection:" if(INFECTION_LEVEL_TWO + 200 to INFECTION_LEVEL_TWO + 300) infection = "Acute Infection+:" - if(INFECTION_LEVEL_TWO + 300 to INFINITY) + if(INFECTION_LEVEL_TWO + 300 to INFECTION_LEVEL_TWO + 399) infection = "Acute Infection++:" + if(INFECTION_LEVEL_TWO + 400 to INFINITY) + infection = "Septic:" dat += "" - dat += "[i.name]N/A[i.damage][infection]:[mech]" + dat += "[i.name]N/A[i.damage][infection]:[mech][dead]" dat += "" dat += "" if(occupant.disabilities & BLIND) From 63ea21b20e16a1476c7eaf43c69bf6c8a14a937b Mon Sep 17 00:00:00 2001 From: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com> Date: Sat, 21 Mar 2020 19:21:12 -0500 Subject: [PATCH 16/16] Adds support for multiple callback checks for the do_after and incapacitated procs (#13057) * do_after refactor Update slime.dm fix a comment if you read this you get a cookie! * some little tweaks Changes a TRUE to FALSE in a comment, got confused there. Removes the code that checks for non-callbacks in the extra_checks list and removes them. It should be up to the dev to not add non-callbacks to this list. I'd rather have it runtime instead * check_for_true_callbacks * CRLF to LF Co-authored-by: SteelSlayer --- code/__HELPERS/mobs.dm | 53 ++++++++++++++----- code/game/machinery/doors/airlock.dm | 4 +- .../objects/items/tools/tool_behaviour.dm | 4 +- code/game/objects/structures/window.dm | 10 ++-- .../mob/living/carbon/human/species/slime.dm | 8 +-- code/modules/mob/living/update_status.dm | 10 +++- code/modules/mob/status_procs.dm | 3 ++ 7 files changed, 64 insertions(+), 28 deletions(-) diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 6be2b411376..ff127fd3a48 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -355,24 +355,35 @@ This is always put in the attack log. if(progress) qdel(progbar) -/proc/do_after(mob/user, delay, needhand = 1, atom/target = null, progress = 1, datum/callback/extra_checks = null) +/* Use this proc when you want to have code under it execute after a delay, and ensure certain conditions are met during that delay... + * Such as the user not being interrupted via getting stunned or by moving off the tile they're currently on. + * + * Example usage: + * + * if(do_after(user, 50, target = sometarget, extra_checks = list(callback_check1, callback_check2))) + * do_stuff() + * + * This will create progress bar that lasts for 5 seconds. If the user doesn't move or otherwise do something that would cause the checks to fail in those 5 seconds, do_stuff() would execute. + * The Proc returns TRUE upon success (the progress bar reached the end), or FALSE upon failure (the user moved or some other check failed) + */ +/proc/do_after(mob/user, delay, needhand = 1, atom/target = null, progress = 1, list/extra_checks = list(), use_default_checks = TRUE) if(!user) - return 0 + return FALSE var/atom/Tloc = null if(target) Tloc = target.loc var/atom/Uloc = user.loc - var/drifting = 0 + var/drifting = FALSE if(!user.Process_Spacemove(0) && user.inertia_dir) - drifting = 1 + drifting = TRUE var/holding = user.get_active_hand() - var/holdingnull = 1 //User's hand started out empty, check for an empty hand + var/holdingnull = TRUE //User's hand started out empty, check for an empty hand if(holding) - holdingnull = 0 //Users hand started holding something, check to see if it's still holding that + holdingnull = FALSE //Users hand started holding something, check to see if it's still holding that var/datum/progressbar/progbar if(progress) @@ -380,22 +391,29 @@ This is always put in the attack log. var/endtime = world.time + delay var/starttime = world.time - . = 1 + . = TRUE + + // By default, checks for weakness and stunned get added to the extra_checks list. + // Setting `use_default_checks` to FALSE means that you don't want the do_after to check for these statuses, or that you will be supplying your own checks. + if(use_default_checks) + extra_checks += CALLBACK(user, /mob.proc/IsWeakened) + extra_checks += CALLBACK(user, /mob.proc/IsStunned) + while(world.time < endtime) sleep(1) if(progress) progbar.update(world.time - starttime) if(drifting && !user.inertia_dir) - drifting = 0 + drifting = FALSE Uloc = user.loc - if(!user || user.stat || user.IsWeakened() || user.stunned || (!drifting && user.loc != Uloc)|| (extra_checks && !extra_checks.Invoke())) - . = 0 + if(!user || user.stat || (!drifting && user.loc != Uloc) || check_for_true_callbacks(extra_checks)) + . = FALSE break if(Tloc && (!target || Tloc != target.loc)) - . = 0 + . = FALSE break if(needhand) @@ -403,14 +421,21 @@ This is always put in the attack log. //i.e the hand is used to pull some item/tool out of the construction if(!holdingnull) if(!holding) - . = 0 + . = FALSE break if(user.get_active_hand() != holding) - . = 0 + . = FALSE break if(progress) qdel(progbar) +// Upon any of the callbacks in the list returning TRUE, the proc will return TRUE. +/proc/check_for_true_callbacks(list/extra_checks) + for(var/datum/callback/CB in extra_checks) + if(CB.Invoke()) + return TRUE + return FALSE + #define DOAFTERONCE_MAGIC "Magic~~" GLOBAL_LIST_INIT(do_after_once_tracker, list()) /proc/do_after_once(mob/user, delay, needhand = 1, atom/target = null, progress = 1, attempt_cancel_message = "Attempt cancelled.") @@ -423,7 +448,7 @@ GLOBAL_LIST_INIT(do_after_once_tracker, list()) to_chat(user, "[attempt_cancel_message]") return FALSE GLOB.do_after_once_tracker[cache_key] = TRUE - . = do_after(user, delay, needhand, target, progress, extra_checks = CALLBACK(GLOBAL_PROC, .proc/do_after_once_checks, cache_key)) + . = do_after(user, delay, needhand, target, progress, extra_checks = list(CALLBACK(GLOBAL_PROC, .proc/do_after_once_checks, cache_key))) GLOB.do_after_once_tracker[cache_key] = FALSE /proc/do_after_once_checks(cache_key) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index bf83e6c5d49..692024899a2 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1003,7 +1003,7 @@ About the new airlock wires panel: "You begin [welded ? "unwelding":"welding"] the airlock...", \ "You hear welding.") - if(I.use_tool(src, user, 40, volume = I.tool_volume, extra_checks = CALLBACK(src, .proc/weld_checks, I, user))) + if(I.use_tool(src, user, 40, volume = I.tool_volume, extra_checks = list(CALLBACK(src, .proc/weld_checks, I, user)))) if(!density && !welded) return welded = !welded @@ -1014,7 +1014,7 @@ About the new airlock wires panel: user.visible_message("[user] is welding the airlock.", \ "You begin repairing the airlock...", \ "You hear welding.") - if(I.use_tool(src, user, 40, volume = I.tool_volume, extra_checks = CALLBACK(src, .proc/weld_checks, I, user))) + if(I.use_tool(src, user, 40, volume = I.tool_volume, extra_checks = list(CALLBACK(src, .proc/weld_checks, I, user)))) obj_integrity = max_integrity stat &= ~BROKEN user.visible_message("[user.name] has repaired [src].", \ diff --git a/code/game/objects/items/tools/tool_behaviour.dm b/code/game/objects/items/tools/tool_behaviour.dm index c937f80c30d..80b00dcd1ed 100644 --- a/code/game/objects/items/tools/tool_behaviour.dm +++ b/code/game/objects/items/tools/tool_behaviour.dm @@ -16,11 +16,11 @@ var/datum/callback/tool_check = CALLBACK(src, .proc/tool_check_callback, user, target, amount, extra_checks) if(ismob(target)) - if(!do_mob(user, target, delay, extra_checks=tool_check)) + if(!do_mob(user, target, delay, extra_checks = list(tool_check))) return else - if(!do_after(user, delay, target=target, extra_checks=tool_check)) + if(!do_after(user, delay, target=target, extra_checks = list(tool_check))) return else // Invoke the extra checks once, just in case. diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 9faab45cf97..8fe46ca052d 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -254,7 +254,7 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", if(!can_be_reached(user)) return to_chat(user, "You begin to lever the window [state == WINDOW_OUT_OF_FRAME ? "into":"out of"] the frame...") - if(!I.use_tool(src, user, decon_speed, volume = I.tool_volume, extra_checks = CALLBACK(src, .proc/check_state_and_anchored, state, anchored))) + if(!I.use_tool(src, user, decon_speed, volume = I.tool_volume, extra_checks = list(CALLBACK(src, .proc/check_state_and_anchored, state, anchored)))) return state = (state == WINDOW_OUT_OF_FRAME ? WINDOW_IN_FRAME : WINDOW_OUT_OF_FRAME) to_chat(user, "You pry the window [state == WINDOW_IN_FRAME ? "into":"out of"] the frame.") @@ -268,20 +268,20 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", if(reinf) if(state == WINDOW_SCREWED_TO_FRAME || state == WINDOW_IN_FRAME) to_chat(user, "You begin to [state == WINDOW_SCREWED_TO_FRAME ? "unscrew the window from":"screw the window to"] the frame...") - if(!I.use_tool(src, user, decon_speed, volume = I.tool_volume, extra_checks = CALLBACK(src, .proc/check_state_and_anchored, state, anchored))) + if(!I.use_tool(src, user, decon_speed, volume = I.tool_volume, extra_checks = list(CALLBACK(src, .proc/check_state_and_anchored, state, anchored)))) return state = (state == WINDOW_IN_FRAME ? WINDOW_SCREWED_TO_FRAME : WINDOW_IN_FRAME) to_chat(user, "You [state == WINDOW_IN_FRAME ? "unfasten the window from":"fasten the window to"] the frame.") else if(state == WINDOW_OUT_OF_FRAME) to_chat(user, "You begin to [anchored ? "unscrew the frame from":"screw the frame to"] the floor...") - if(!I.use_tool(src, user, decon_speed, volume = I.tool_volume, extra_checks = CALLBACK(src, .proc/check_state_and_anchored, state, anchored))) + if(!I.use_tool(src, user, decon_speed, volume = I.tool_volume, extra_checks = list(CALLBACK(src, .proc/check_state_and_anchored, state, anchored)))) return anchored = !anchored update_nearby_icons() to_chat(user, "You [anchored ? "fasten the frame to":"unfasten the frame from"] the floor.") else //if we're not reinforced, we don't need to check or update state to_chat(user, "You begin to [anchored ? "unscrew the window from":"screw the window to"] the floor...") - if(!I.use_tool(src, user, decon_speed, volume = I.tool_volume, extra_checks = CALLBACK(src, .proc/check_anchored, anchored))) + if(!I.use_tool(src, user, decon_speed, volume = I.tool_volume, extra_checks = list(CALLBACK(src, .proc/check_anchored, anchored)))) return anchored = !anchored air_update_turf(TRUE) @@ -297,7 +297,7 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", if(!can_be_reached(user)) return TOOL_ATTEMPT_DISMANTLE_MESSAGE - if(!I.use_tool(src, user, decon_speed, volume = I.tool_volume, extra_checks = CALLBACK(src, .proc/check_state_and_anchored, state, anchored))) + if(!I.use_tool(src, user, decon_speed, volume = I.tool_volume, extra_checks = list(CALLBACK(src, .proc/check_state_and_anchored, state, anchored)))) return var/obj/item/stack/sheet/G = new glass_type(user.loc, glass_amount) G.add_fingerprint(user) diff --git a/code/modules/mob/living/carbon/human/species/slime.dm b/code/modules/mob/living/carbon/human/species/slime.dm index d9fa1ccbf3c..622e0919b45 100644 --- a/code/modules/mob/living/carbon/human/species/slime.dm +++ b/code/modules/mob/living/carbon/human/species/slime.dm @@ -146,11 +146,13 @@ return var/limb_select = input(H, "Choose a limb to regrow", "Limb Regrowth") as null|anything in missing_limbs + if(!limb_select) // If the user hit cancel on the popup, return + return var/chosen_limb = missing_limbs[limb_select] H.visible_message("[H] begins to hold still and concentrate on [H.p_their()] missing [limb_select]...", "You begin to focus on regrowing your missing [limb_select]... (This will take [round(SLIMEPERSON_REGROWTHDELAY/10)] seconds, and you must hold still.)") - if(do_after(H, SLIMEPERSON_REGROWTHDELAY, needhand = 0, target = H)) - if(H.incapacitated()) + if(do_after(H, SLIMEPERSON_REGROWTHDELAY, FALSE, H, extra_checks = list(CALLBACK(H, /mob.proc/IsStunned)), use_default_checks = FALSE)) // Override the check for weakness, only check for stunned + if(H.incapacitated(ignore_lying = TRUE, extra_checks = list(CALLBACK(H, /mob.proc/IsStunned)), use_default_checks = FALSE)) // Override the check for weakness, only check for stunned to_chat(H, "You cannot regenerate missing limbs in your current state.") return @@ -196,4 +198,4 @@ #undef SLIMEPERSON_HUNGERCOST #undef SLIMEPERSON_MINHUNGER -#undef SLIMEPERSON_REGROWTHDELAY +#undef SLIMEPERSON_REGROWTHDELAY \ No newline at end of file diff --git a/code/modules/mob/living/update_status.dm b/code/modules/mob/living/update_status.dm index 20cc969119f..d24301b0dd0 100644 --- a/code/modules/mob/living/update_status.dm +++ b/code/modules/mob/living/update_status.dm @@ -65,8 +65,14 @@ return !(IsWeakened() || paralysis || stat || (status_flags & FAKEDEATH)) // Whether the mob is capable of actions or not -/mob/living/incapacitated(ignore_restraints = FALSE, ignore_grab = FALSE, ignore_lying = FALSE) - if(stat || paralysis || stunned || IsWeakened() || (!ignore_restraints && restrained()) || (!ignore_lying && lying)) +/mob/living/incapacitated(ignore_restraints = FALSE, ignore_grab = FALSE, ignore_lying = FALSE, list/extra_checks = list(), use_default_checks = TRUE) + // By default, checks for weakness and stunned get added to the extra_checks list. + // Setting `use_default_checks` to FALSE means that you don't want it checking for these statuses or you are supplying your own checks. + if(use_default_checks) + extra_checks += CALLBACK(src, /mob.proc/IsWeakened) + extra_checks += CALLBACK(src, /mob.proc/IsStunned) + + if(stat || paralysis || (!ignore_restraints && restrained()) || (!ignore_lying && lying) || check_for_true_callbacks(extra_checks)) return TRUE // wonderful proc names, I know - used to check whether the blur overlay diff --git a/code/modules/mob/status_procs.dm b/code/modules/mob/status_procs.dm index 0aeb9beef84..b61ce171194 100644 --- a/code/modules/mob/status_procs.dm +++ b/code/modules/mob/status_procs.dm @@ -173,6 +173,9 @@ /mob/proc/Stun() return +/mob/proc/IsStunned() + return stunned + /mob/proc/SetStunned() return