From d5833cb162f2140bc7fc0cdca7dba4118f17e91f Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Sun, 25 Jun 2023 03:55:07 -0700 Subject: [PATCH] some tiny optimizations/shifting things around, removes 2 unused files (#5643) title --------- Co-authored-by: silicons --- citadel.dme | 11 +- code/__DEFINES/controllers/_subsystems.dm | 1 + code/__HELPERS/icons.dm | 15 +- code/__HELPERS/lists/types_typecaches.dm | 13 ++ code/_globals/lists/names.dm | 26 --- code/_globals/lists/typecache.dm | 1 + code/controllers/subsystem/early_init.dm | 8 + code/datums/locations/locations.dm | 76 -------- code/datums/locations/nyx.dm | 102 ---------- code/datums/locations/qerrvallis.dm | 57 ------ code/datums/locations/s_randarr.dm | 127 ------------ code/datums/locations/sol.dm | 42 ---- code/datums/locations/tau_ceti.dm | 52 ----- code/datums/locations/uueoa_esa.dm | 40 ---- code/datums/locations/vir.dm | 68 ------- .../gamemodes/changeling/changeling_powers.dm | 6 +- .../gamemodes/changeling/modularchangling.dm | 14 +- code/game/gamemodes/technomancer/catalog.dm | 13 +- code/game/sd_Alert.dm | 180 ------------------ code/game/trader_visit.dm | 59 ------ code/modules/admin/admin_verbs.dm | 3 +- code/modules/mob/inventory/slot_meta.dm | 3 +- code/modules/mob/living/carbon/give.dm | 3 +- .../simple_mob/subtypes/vore/morph/morph.dm | 12 +- .../subtypes/vore/solargrub_larva.dm | 3 +- code/modules/nanites/chamber.dm | 9 +- code/modules/spells/spell_code.dm | 2 - interface/interface.dm | 6 +- interface/menus/main.dm | 2 +- 29 files changed, 66 insertions(+), 888 deletions(-) create mode 100644 code/controllers/subsystem/early_init.dm delete mode 100644 code/datums/locations/locations.dm delete mode 100644 code/datums/locations/nyx.dm delete mode 100644 code/datums/locations/qerrvallis.dm delete mode 100644 code/datums/locations/s_randarr.dm delete mode 100644 code/datums/locations/sol.dm delete mode 100644 code/datums/locations/tau_ceti.dm delete mode 100644 code/datums/locations/uueoa_esa.dm delete mode 100644 code/datums/locations/vir.dm delete mode 100644 code/game/sd_Alert.dm delete mode 100644 code/game/trader_visit.dm diff --git a/citadel.dme b/citadel.dme index 95052be22c0..bf6b35b147f 100644 --- a/citadel.dme +++ b/citadel.dme @@ -509,6 +509,7 @@ #include "code\controllers\subsystem\dcs.dm" #include "code\controllers\subsystem\DPC.dm" #include "code\controllers\subsystem\early_assets.dm" +#include "code\controllers\subsystem\early_init.dm" #include "code\controllers\subsystem\emergency_shuttle.dm" #include "code\controllers\subsystem\events.dm" #include "code\controllers\subsystem\fail2topic.dm" @@ -767,14 +768,6 @@ #include "code\datums\holograms\types\species.dm" #include "code\datums\interfaces\appearance.dm" #include "code\datums\interfaces\procpath.dm" -#include "code\datums\locations\locations.dm" -#include "code\datums\locations\nyx.dm" -#include "code\datums\locations\qerrvallis.dm" -#include "code\datums\locations\s_randarr.dm" -#include "code\datums\locations\sol.dm" -#include "code\datums\locations\tau_ceti.dm" -#include "code\datums\locations\uueoa_esa.dm" -#include "code\datums\locations\vir.dm" #include "code\datums\looping_sounds\_looping_sound.dm" #include "code\datums\looping_sounds\item_sounds.dm" #include "code\datums\looping_sounds\machinery_sounds.dm" @@ -870,12 +863,10 @@ #include "code\game\AStar.dm" #include "code\game\radio.dm" #include "code\game\response_team.dm" -#include "code\game\sd_Alert.dm" #include "code\game\shuttle_engines.dm" #include "code\game\skincmd.dm" #include "code\game\sound.dm" #include "code\game\statistics.dm" -#include "code\game\trader_visit.dm" #include "code\game\world.dm" #include "code\game\antagonist\_antagonist_setup.dm" #include "code\game\antagonist\antagonist.dm" diff --git a/code/__DEFINES/controllers/_subsystems.dm b/code/__DEFINES/controllers/_subsystems.dm index 3e581ec5497..4e09edfc09c 100644 --- a/code/__DEFINES/controllers/_subsystems.dm +++ b/code/__DEFINES/controllers/_subsystems.dm @@ -80,6 +80,7 @@ DEFINE_BITFIELD(runlevels, list( #define INIT_ORDER_FAIL2TOPIC 200 #define INIT_ORDER_TIMER 195 #define INIT_ORDER_DBCORE 190 +#define INIT_ORDER_EARLY_INIT 185 #define INIT_ORDER_REPOSITORY 180 #define INIT_ORDER_STATPANELS 170 #define INIT_ORDER_INPUT 160 diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index 9e820274044..7889e5416ba 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -1127,29 +1127,30 @@ GLOBAL_LIST_INIT(freon_color_matrix, list("#2E5E69", "#60A2A8", "#A1AFB1", rgb(0 color[3] = color[1] * cm[7] + color[2] * cm[8] + color[3] * cm[9] + cm[12] * 255 return rgb(color[1], color[2], color[3]) +// citadel edit: use this so we can VV it at a negligible performance hit. +GLOBAL_LIST_EMPTY(icon_exists_cache) /** * Checks if the given iconstate exists in the given file, caching the result. * Setting scream to TRUE will print a stack trace ONCE. * Written by Kapu1178 */ /proc/icon_exists(file, state, scream) - var/static/list/icon_states_cache = list() - if(icon_states_cache[file]?[state]) + if(GLOB.icon_exists_cache[file]?[state]) return TRUE - if(icon_states_cache[file]?[state] == FALSE) + if(GLOB.icon_exists_cache[file]?[state] == FALSE) return FALSE var/list/states = icon_states(file) - if(!icon_states_cache[file]) - icon_states_cache[file] = list() + if(!GLOB.icon_exists_cache[file]) + GLOB.icon_exists_cache[file] = list() if(state in states) - icon_states_cache[file][state] = TRUE + GLOB.icon_exists_cache[file][state] = TRUE return TRUE else - icon_states_cache[file][state] = FALSE + GLOB.icon_exists_cache[file][state] = FALSE if(scream) stack_trace("Icon Lookup for state: [state] in file [file] failed.") return FALSE diff --git a/code/__HELPERS/lists/types_typecaches.dm b/code/__HELPERS/lists/types_typecaches.dm index 87404be9919..ac9340eaa6a 100644 --- a/code/__HELPERS/lists/types_typecaches.dm +++ b/code/__HELPERS/lists/types_typecaches.dm @@ -81,3 +81,16 @@ for(var/T in typesof(P)) L[T] = TRUE return L + +/** + * cached typecache of a given path list + * + * do not mutate the lists returned by this! + */ +/proc/cached_typecacheof(path = list(), ignore_root_path = FALSE, only_root_path = FALSE) + var/key = json_encode(args) + if(GLOB.typecaches[key]) + return GLOB.typecaches[key] + return (GLOB.typecaches[key] = typecacheof(path, ignore_root_path, only_root_path)) + +GLOBAL_LIST_EMPTY(typecaches) diff --git a/code/_globals/lists/names.dm b/code/_globals/lists/names.dm index 7fa02c39b8d..dfe26cb1772 100644 --- a/code/_globals/lists/names.dm +++ b/code/_globals/lists/names.dm @@ -2,31 +2,13 @@ //! would include in rsc if ' was used GLOBAL_LIST_INIT(ai_names, world.file2list("strings/names/ai.txt")) -// GLOBAL_LIST_INIT(carp_names, world.file2list("strings/names/carp.txt")) GLOBAL_LIST_INIT(clown_names, world.file2list("strings/names/clown.txt")) -// GLOBAL_LIST_INIT(clown_names, world.file2list("strings/names/clown.txt")) GLOBAL_LIST_INIT(commando_names, world.file2list("strings/names/death_commando.txt")) -// GLOBAL_LIST_INIT(ethereal_names, world.file2list("strings/names/ethereal.txt")) GLOBAL_LIST_INIT(first_names_female, world.file2list("strings/names/first_female.txt")) GLOBAL_LIST_INIT(first_names_male, world.file2list("strings/names/first_male.txt")) -// GLOBAL_LIST_INIT(first_names, world.file2list("strings/names/first.txt")) -// GLOBAL_LIST_INIT(golem_names, world.file2list("strings/names/golem.txt")) GLOBAL_LIST_INIT(last_names, world.file2list("strings/names/last.txt")) -// GLOBAL_LIST_INIT(lizard_names_female, world.file2list("strings/names/lizard_female.txt")) -// GLOBAL_LIST_INIT(lizard_names_female, world.file2list("strings/names/lizard_female.txt")) -// GLOBAL_LIST_INIT(lizard_names_male, world.file2list("strings/names/lizard_male.txt")) -// GLOBAL_LIST_INIT(lizard_names_male, world.file2list("strings/names/lizard_male.txt")) -// GLOBAL_LIST_INIT(megacarp_first_names, world.file2list("strings/names/megacarp1.txt")) -// GLOBAL_LIST_INIT(megacarp_last_names, world.file2list("strings/names/megacarp2.txt")) -// GLOBAL_LIST_INIT(mime_names, world.file2list("strings/names/mime.txt")) -// GLOBAL_LIST_INIT(moth_first, world.file2list("strings/names/moth_first.txt")) -// GLOBAL_LIST_INIT(moth_last, world.file2list("strings/names/moth_last.txt")) -// GLOBAL_LIST_INIT(nightmare_names, world.file2list("strings/names/nightmare.txt")) GLOBAL_LIST_INIT(ninja_names, world.file2list("strings/names/ninjaname.txt")) GLOBAL_LIST_INIT(ninja_titles, world.file2list("strings/names/ninjatitle.txt")) -// GLOBAL_LIST_INIT(plasmaman_names, world.file2list("strings/names/plasmaman.txt")) -// GLOBAL_LIST_INIT(posibrain_names, world.file2list("strings/names/posibrain.txt")) -// GLOBAL_LIST_INIT(religion_names, world.file2list("strings/names/religion.txt")) GLOBAL_LIST_INIT(wizard_first, world.file2list("strings/names/wizardfirst.txt")) GLOBAL_LIST_INIT(wizard_second, world.file2list("strings/names/wizardsecond.txt")) @@ -34,12 +16,4 @@ GLOBAL_LIST_INIT(skrell_first_names, world.file2list("strings/names/skrell_fir GLOBAL_LIST_INIT(skrell_last_names, world.file2list("strings/names/skrell_last.txt")) GLOBAL_LIST_INIT(adjectives, world.file2list("strings/names/adjectives.txt")) -// GLOBAL_LIST_INIT(adverbs, world.file2list("strings/names/adverbs.txt")) -// GLOBAL_LIST_INIT(dream_strings, world.file2list("strings/dreamstrings.txt")) -// GLOBAL_LIST_INIT(greek_alphabet, world.file2list("strings/greek_alphabet.txt")) -// GLOBAL_LIST_INIT(gross_adjectives, world.file2list("strings/names/gross_adjectives.txt")) -// GLOBAL_LIST_INIT(hive_names, world.file2list("strings/names/hive_names.txt")) -// GLOBAL_LIST_INIT(ing_verbs, world.file2list("strings/names/ing_verbs.txt")) -// GLOBAL_LIST_INIT(martial_prefix, world.file2list("strings/names/martial_prefix.txt")) -// GLOBAL_LIST_INIT(vampire_house_names, world.file2list("strings/names/vampire_house_names.txt")) GLOBAL_LIST_INIT(verbs, world.file2list("strings/names/verbs.txt")) diff --git a/code/_globals/lists/typecache.dm b/code/_globals/lists/typecache.dm index 518b998c46c..d3be34f7448 100644 --- a/code/_globals/lists/typecache.dm +++ b/code/_globals/lists/typecache.dm @@ -2,4 +2,5 @@ GLOBAL_LIST_INIT(typecache_mob, typecacheof(list(/mob))) GLOBAL_LIST_INIT(typecache_living, typecacheof(list(/mob/living))) +GLOBAL_LIST_INIT(typecache_machine, typecacheof(list(/obj/machinery))) GLOBAL_LIST_INIT(typecache_machine_or_structure, typecacheof(list(/obj/machinery))|typecacheof(list(/obj/structure))) diff --git a/code/controllers/subsystem/early_init.dm b/code/controllers/subsystem/early_init.dm new file mode 100644 index 00000000000..680cb29525e --- /dev/null +++ b/code/controllers/subsystem/early_init.dm @@ -0,0 +1,8 @@ +SUBSYSTEM_DEF(early_init) + name = "Early Init" + init_order = INIT_ORDER_EARLY_INIT + subsystem_flags = SS_NO_FIRE + +/datum/controller/subsystem/early_init/Initialize() + init_inventory_slot_meta() + return ..() diff --git a/code/datums/locations/locations.dm b/code/datums/locations/locations.dm deleted file mode 100644 index 4e16647aa6c..00000000000 --- a/code/datums/locations/locations.dm +++ /dev/null @@ -1,76 +0,0 @@ -/datum/locations - var/name - var/desc - var/list/contents = list() - var/parent - -/datum/locations/New(var/creator) - if(creator) - parent = creator - -var/global/datum/locations/milky_way/all_locations = new() - -//Galaxy - -/datum/locations/milky_way - name = "Milky Way Galaxy" - desc = "The galaxy we all live in." - -/datum/locations/milky_way/New() - contents.Add( - new /datum/locations/sol(src), - new /datum/locations/tau_ceti(src), - new /datum/locations/nyx(src), - new /datum/locations/qerrvallis(src), - new /datum/locations/s_randarr(src), - new /datum/locations/uueoa_esa(src), - new /datum/locations/vir(src) - ) - -/proc/choose_location_datum(client/user) - var/datum/locations/choice = all_locations - while(length(choice.contents) > 0) //For some reason it wouldn't let me do contents.len even when I defined it as a list. - var/specific = alert(user, "The location currently selected is [choice.name]. More specific options exist, would you like to pick a more specific location?", - "Choose location", "Yes", "No") - if(specific == "Yes" && length(choice.contents) > 0) - choice = input(user, "Please choose a location.","Locations") as null|anything in choice.contents - else - break - to_chat(user, choice.name) - to_chat(user, choice.desc) - return choice - -// var/datum/locations/choice = input(user, "Please choose a location.","Locations") as null|anything in all_locations -// if(choice && choice.contents.len > 0) - - -/* -/datum/locations/proc/show_contents() -// to_chat(world, "[src]\n[desc]") - for(var/datum/locations/a in contents) - to_chat(world, "[a]\n[a.parent ? "Located in [a.parent]\n" : ""][a.desc]") - a.show_contents() - to_chat(world, "\n") - -/datum/locations/proc/count_locations() - var/i = 0 - for(var/datum/locations/a in contents) - i = i + a.count_locations() - return i - -/client/verb/show_locations() - set name = "Show Locations" - set category = "Debug" - locations.show_contents() - -/client/verb/debug_locations() - set name = "Debug Locations" - set category = "Debug" - debug_variables(locations) - -/client/verb/count_locations() - set name = "Count Locations" - set category = "Debug" - var/location_number = locations.count_locations() - world << location_number -*/ diff --git a/code/datums/locations/nyx.dm b/code/datums/locations/nyx.dm deleted file mode 100644 index 2561e4ca816..00000000000 --- a/code/datums/locations/nyx.dm +++ /dev/null @@ -1,102 +0,0 @@ -//Nyx - -/datum/locations/nyx - name = "Nyx" - desc = "Nyx is most certainly considered an outer system, being on the edge of colonized space. It's a red dwarf flare star far out in the \ - frontier. There are four planets orbiting it, not including its sub-stellar companion, Erebus." - -/datum/locations/nyx/New(var/creator) - contents.Add( - new /datum/locations/erebus(src), - new /datum/locations/moros(src), - new /datum/locations/brinkburn(src), - new /datum/locations/haulers_tragedy(src), - new /datum/locations/void_star(src), - new /datum/locations/yulcite(src), - new /datum/locations/emerald_habitation(src), - new /datum/locations/euthenia(src) - ) - ..(creator) - -/datum/locations/erebus - name = "Erebus" - desc = "Erebus was regarded for centuries as an uninteresting substellar companion to Nyx, itself a relatively uninteresting red dwarf. \ - Massing at 44.7 times that of Jupiter, Erebus is a T-Class brown dwarf with a surface temperature of 963K, just above the melting point \ - of aluminium. However, the presence of Phoron in and around Erebus has driven much of the activity of the first half of the 26th century \ - in the Nyx system. Orbiting 39.8 AU from Nyx with an eccentricity of 4%, it takes a bit more than 315 standard years for Erebus to orbit Nyx. \ - With over 80 moons with diameters more than 5 kilometers and hundreds smaller than that, Erebus is a hub of mining and corporate warfare. \ - The most notable moon, but not the largest, is Roanake, a dwarf planet in its own right, which orbits with a high enough eccentricity to \ - have significant volcanic activity due to tidal heating." - -/datum/locations/erebus/New(var/creator) - contents.Add( - new /datum/locations/talons_bull(src), - new /datum/locations/exodus(src), - new /datum/locations/crescent(src) - ) - ..(creator) - -/datum/locations/talons_bull - name = "Talon's Bull" - desc = "A well visited Free Trade Union space station where a large amount of the independent trade outside of the Hauler's Tragedy is done. \ - It is currently stationed on one of the smaller moons that orbits Erebus and has extensive facilities all across the moon's surface." - -/datum/locations/exodus - name = "NSS Exodus" - desc = "A highly profitable research, mining, and supply dock for NanoTrasen that serves as one of their many facilities in exploiting the \ - wonders of phoron. It is currently orbiting around Erebus and maintains close contact with the NAS Crescent. The station itself has been \ - a target for a large number of Mercenaries and other companies wishing to steal NanoTrasen's secrets." - -/datum/locations/crescent - name = "NAS Crescent" - desc = "The main hub for NanoTrasen in the Nyx system and is commonly referred to it by their workers as central command or \"CentCom\". \ - The Crescent refines and stores much of the products that stations (such as the Exodus) bring in. It is also a large refueling and supply \ - station of phoron and tritium in the Nyx system due to NanoTrasen being able to outsell almost any other company." - -/datum/locations/emerald_habitation - name = "Emerald Habitation" - desc = "A relatively sub-par housing station that has a large population of aliens. The facility has areas for shopping, \ - a few restaurants, and multiple blocks for living arrangements. The station is crowded, busy, and the air quality is a recurring issue. \ - Nonetheless, it allows lower income spacers the means to travel in the Nyx system." - -/datum/locations/void_star - name = "The Void Star" - desc = "No one quite knows who founded the Void Star, or indeed who actually manages the place. Theories range from a corporate money-laundry \ - operation to interstellar mobsters, with the more far-fetched even suggesting the place has always been there, like some kind of haunt. \ - Theories about the station's management are just as varied, though those who have been deep \"behind the scenes\" generally claim \ - they've spoken to shrouded figures, ranging from one to a whole panel of three to eight. \ - The Void Star is best described as a casino, complete with all the garish neon, advertisements and flashing lights such a description would entail. \ - Orbiting at the edge of the Hauler's Tragedy, the Void Star can sometimes even be spotted with the naked eye - flashing and pulsing through \ - the dull, dark asteroid belt like a beacon, broadcasting all manner of advertisements and promises for the gullible on just about any unencrypted \ - frequency - occasionally bleeding over into encrypted frequencies, too. \ - Despite the Star's remote location, traffic tends to be heavy. Despite the proximity to Brinkburn, the Star remains a relatively safe \ - place - as safe as anywhere in Nyx would be, anyway. The Star employs a well-equipped fleet of defense craft, mercenaries and sophisticated \ - drones, all ruthlessly enforcing the peace. As long as you have money you're willing to spend, the Void Star welcomes just about anyone. \ - Some even call the Star home, as the sprawling asteroid-station offers hotel services; luxurious or spartan. Addicts, smugglers, pirates and \ - privateers - you'll find them all at the Void Star, ostensibly at their best behavior." - -/datum/locations/moros - name = "Moros" - desc = "A mercurial planet, Moros is tidally locked to Nyx with a dayside surface temperature of 980K. Unsettled, although several geological \ - surveys have been performed on the night side. Undergoing orbital decay due to the influence of Euthenia; expected to break apart due to tidal \ - forces within 50 million years." - -/datum/locations/brinkburn - name = "Brinkburn" - desc = "A martian planet, Brinkburn is small and dry yet is hot enough to be habitable. Possesses a dense ring system, theorised to be the fate of \ - primordial moons, which makes it difficult to enter or exit orbit." - -/datum/locations/haulers_tragedy - name = "Hauler's Tragedy" - desc = "A thick asteroid belt that's full of pirate activity, mining operations, and trade depots. Very few corporate interests are active in the area." - -/datum/locations/yulcite - name = "Yulcite" - desc = "A superearth near the outer edge of the habitable zone, Yulcite has 40% higher surface gravity than Earth. \ - Has been a hotbed of xenoarcheology for decades, due to the remains of a civilization that existed on this world approximately 570 million years ago." - -/datum/locations/euthenia - name = "Euthenia" - desc = "A superneptune massing at 46 time that of Earth, Euthenia is one of the few planets still commonly called it's original survey designation. \ - (The surveyor is noted to have a preference for ancient Greek mythology) As an ice giant, Euthenia has had consistent economic stability thanks to \ - the presence of fuel depots supplied by the giants atmosphere." diff --git a/code/datums/locations/qerrvallis.dm b/code/datums/locations/qerrvallis.dm deleted file mode 100644 index a3cc2468ba0..00000000000 --- a/code/datums/locations/qerrvallis.dm +++ /dev/null @@ -1,57 +0,0 @@ -//Qerrbalak - -/datum/locations/qerrvallis - name = "Qerr'Vallis" - desc = "The home system of the Skrell, which translates to 'Star of the royals' or 'Light of the Crown'." - -/datum/locations/qerrvallis/New(var/creator) - contents.Add( - new /datum/locations/qerrbalak(src) - ) - ..(creator) - -/datum/locations/qerrbalak - name = "Qerrbalak" - desc = "The homeworld of the Skrell. It is a planet with a humid atmosphere, featuring plenty of swamps and jungles. \ - The world is filled with Skrellian cities which often sit on stilts." - -/datum/locations/qerrbalak/New(var/creator) - contents.Add( - new /datum/locations/qarrkloa(src), - new /datum/locations/moglar(src), - new /datum/locations/miqoxi(src), - new /datum/locations/kallo(src), - new /datum/locations/glimorr(src) - ) - ..(creator) - -/datum/locations/qarrkloa - name = "Qarr'kloa" - desc = "Mythically considered the first State-City ever built by Skrellkind, Qarr'kloa attracts thousands of tourists and archeologists \ - every year thanks to the ancestral structures, built thousands of years ago by the Skrell, scattered in its vicinity." - -/datum/locations/moglar - name = "Mo'glar" - desc = "Built on the northern coast of Qorr'gloa, Mo'glar was, at the time of Xi'Krri'oal's colonization, a major port of trade between \ - the two continents of the planet. It has kept that role to this day, although it never truly adapted to inter-planetary trade, leaving the \ - task of exporting Qerrbalak's goods to other planets to other cities, mainly on Xi'Krri'oal." - -/datum/locations/miqoxi - name = "Mi'qoxi" - desc = "This city, built on the small patch of islands north of Xi'Krri'oal, owes most of its current status to the infamous Qerr-Skria \ - Glo'morr Krrixi who, in the 23th century BCE, built a large empire spanning from the Qo'rria Sea to the current city of Qal'krrea, mostly \ - through military conquests. As the center of his empire, Mi'qoxi became a large center of population and industry and while the fall of \ - the empire at Krrixi's death did put a halt to the city's growth, it is still today one of the biggest cities of the continent." - -/datum/locations/kallo - name = "Kal'lo" - desc = "A relatively recent city compared to the other major cities of the planet, Kal'lo quickly rose in status by fathering some of the most \ - important figures of modern skrellian society. It is notably the birthplace of Xikrra Kol'goa, who wrote the Lo'glo'mog'rri in 46 BCE, \ - the constitutional code that is still used by most of the skrellian states in the galaxy." - -/datum/locations/glimorr - name = "Gli'morr" - desc = "While Gli'morr is not as heavily-populated than its continental counterparts, its touristic potential made it rich enough to finance \ - the biggest research center of the planet, covering dozens of scientific fields. Its Academy is just as much renowned, and even the lowest \ - Qrri-Mog (although most of its students prefer to continue their studies until they become Qerr-Mog) coming out of its classrooms is \ - considered part of the elite." diff --git a/code/datums/locations/s_randarr.dm b/code/datums/locations/s_randarr.dm deleted file mode 100644 index 9b3cc3d1ebe..00000000000 --- a/code/datums/locations/s_randarr.dm +++ /dev/null @@ -1,127 +0,0 @@ -//S'randarr - -/datum/locations/s_randarr - name = "S'randarr" - desc = "A yellow-orange Ib supergiant (spectral type-M), which provides most of Adhomai's heat, and serves as the system's primary body. \ - It is also an object of great religious significance in the two largest Tajaran religions." - -/datum/locations/s_randarr/New(var/creator) - contents.Add( - new /datum/locations/ahdomai(src), - new /datum/locations/messa(src), - new /datum/locations/al_benj_sri(src) - ) - ..(creator) - -//BEGIN AHDOMAI - -/datum/locations/ahdomai - name = "Ahdomai" - desc = "The Tajaran home planet. It is the fourth planet from S'rand'marr. Its atmosphere is not dissimilar to that of Earth. \ - It is a cold and icy world, suffering from almost perpetual snowfall and extremely low temperatures." - -/datum/locations/ahdomai/New(var/creator) - contents.Add( - new /datum/locations/ahdomai_northern_plains(src), - new /datum/locations/ahdomai_snowy_mountains(src) - ) - ..(creator) - -/datum/locations/ahdomai_northern_plains - name = "The Northern Plains" - desc = "One of the regions of Ahdomai." - -/datum/locations/ahdomai_northern_plains/New(var/creator) - contents.Add( - new /datum/locations/mijri_peninsula(src), - new /datum/locations/the_noble_strip(src) - ) - ..(creator) - -/datum/locations/mijri_peninsula - name = "Mi'jri Peninsula" - desc = "The peninsula is an area that remains sloped down to the shores due to decades freezing and thawing constantly \ - chewing away at the land prior to the Frost. This area is popular for ice-fishing for the Nazkiin, and is a major source of most of their food." - -/datum/locations/the_noble_strip - name = "The Noble Strip" - desc = "Previously referred to as the Overseer Artery. Much of this area is composed of more rugged plain lands, with a few craters \ - and small mountains dotting the landscape, all covered in dozens of layers of snow. One specific area of note is what is referred to as \ - the \"Crater of Light.\" In the pre-Frost era, the Crater was used as a mine for most of the raw minerals the nobility had, and \ - was the main site of the Nothern Plains Mining Network. Since the Frost, the Hadii have fought tooth and \ - nail to preserve hold of it, believing S'randarr gave it to them, and those of Tajr-kii S'randarr must keep it away from the Shards of Messa." - -/datum/locations/the_noble_strip/New(var/creator) - contents.Add( - new /datum/locations/northern_plains_mining_network(src), - new /datum/locations/mi_dynh_al_manq(src), - new /datum/locations/contai(src) - ) - ..(creator) - -/datum/locations/northern_plains_mining_network - name = "Northern Plains Mining Network" - desc = "A pre-Frost mining complex, now owned, operated, and supplied by NT. Before the Frost, the nobility cleared out a large portion of the area's \ - mineral wealth, but not all was depleted prior to their leaving. Tajara employed from nearby towns hail mostly from those days and are glad to \ - see the improvements, safety regulations, and supplies provided by NT (which is to say, any)." - -/datum/locations/mi_dynh_al_manq - name = "Mi'dynh Al'Manq" - desc = "a large NT-funded city, providing (cramped) housing for less-fortunate Tajaran, hospitals, schooling, job training, \ - job certification, space ports, and more. Many humans also live here, and operate many facilities." - -/datum/locations/contai - name = "Contai" - desc = "a smaller village whose miners all remember the Frost. The relative size of the village is such that they have no local \ - school, and must attend academy in the nearby city of Mi'dynh Al'Manq." - -/datum/locations/ahdomai_snowy_mountains - name = "The Snowy Mountains" - desc = "One of the regions of Ahdomai." - -/datum/locations/ahdomai_snowy_mountains/New(var/creator) - contents.Add( - new /datum/locations/rhezars_crown(src), - new /datum/locations/rrhazkal_ice_maw(src), - new /datum/locations/ah_fralak_landing(src), - new /datum/locations/ahdomai_ruined_land(src) - ) - ..(creator) - -/datum/locations/rhezars_crown - name = "Rhezar's Crown" - desc = "An area that is separate from the rest of the region by a large glacier between the continents, Has very jagged, icy, and unforgiving peaks, \ - crevasses, and a vast networks of mountain caves." - -/datum/locations/rrhazkal_ice_maw - name = "Rrhazkal Ice Maw" - desc = "The area between the main continent and the Rhezar's Crown Continent. It is a large, permanently frozen sea with islands forming \ - mountains poking up around. This strip is filled with cracks, and hidden ravines in the glacier. This path is a major breaking point for \ - separation of culture from the rest of Ahdomai, and Rhezar's Crown" - -/datum/locations/ah_fralak_landing - name = "Ah'Fralak Landing" - desc = "A large area of more rugged terrain than the plains to the south. Near the coast to the Rrhazkal Ice Maw, the area has a \ - long cliff face that steeply falls down to the Maw. Tribes looking to work their way to the Crown may make the sides of \ - these cliffs their home, many times." - -/datum/locations/ahdomai_ruined_land - name = "Ruined Land" - desc = "The area in the northeast corner of the main continent of Ahdomai is a barren, almost lifeless strip of land. Flora and \ - fauna on the surface are hard to find, even with most of the land flat and white as far as the eye can see, that is if the heavy fogs and \ - blizzards ever stopped." - -//END AHDOMAI - -/datum/locations/messa - name = "Messa" - desc = "An abnormal white dwarf (spectral type-B) with a very high magnitude for its size, associated with the Tajaran goddess of death and change. \ - Messa orbits S'rrendarr at an inclination that is almost parallel compared to other bodies in the system. \ - It orbits close enough to S'rrendarr that its gravitational effects are barely tangible to the other bodies in the system, \ - holding a minor tidal influence at the most. By the superstitious and religious, it is considered a bad omen when Messa is the \ - only one in the sky. It is also said the rings are the souls Messa has clung on to, and is consuming." - -/datum/locations/al_benj_sri - name = "Al-Benj S'ri" - desc = "An astroid belt seperating S'randarr and Messa from Ahdomai. This is known also as \"The Sea of Souls\". Those sould in Al-Benj S'ri \ - are said to be in limbo between S'randarr and Messa, as they both fight over them." diff --git a/code/datums/locations/sol.dm b/code/datums/locations/sol.dm deleted file mode 100644 index 2dbe1ae32e3..00000000000 --- a/code/datums/locations/sol.dm +++ /dev/null @@ -1,42 +0,0 @@ -//Sol - -/datum/locations/sol - name = "Sol" - desc = "The home system of humanity." - -/datum/locations/sol/New(var/creator) - contents.Add( - new /datum/locations/mercury(src), - new /datum/locations/venus(src), - new /datum/locations/earth(src), - new /datum/locations/mars(src), - new /datum/locations/jupiter(src), - new /datum/locations/saturn(src), - new /datum/locations/uranus(src), - new /datum/locations/neptune(src) - ) - ..(creator) - -/datum/locations/mercury - name = "Mercury" - -/datum/locations/venus - name = "Venus" - -/datum/locations/earth - name = "Earth" - -/datum/locations/mars - name = "Mars" - -/datum/locations/jupiter - name = "Jupiter" - -/datum/locations/saturn - name = "Saturn" - -/datum/locations/uranus - name = "Uranus" - -/datum/locations/neptune - name = "Neptune" diff --git a/code/datums/locations/tau_ceti.dm b/code/datums/locations/tau_ceti.dm deleted file mode 100644 index a9aefd52bba..00000000000 --- a/code/datums/locations/tau_ceti.dm +++ /dev/null @@ -1,52 +0,0 @@ -//Tau Ceti - -/datum/locations/tau_ceti - name = "Tau Ceti" - desc = "Tau Ceti is a relatively populated system that sits between the inner and outer systems of human colonized space." - -/datum/locations/tau_ceti/New(var/creator) - contents.Add( - new /datum/locations/tau_ceti_i(src), - new /datum/locations/luthien(src), - new /datum/locations/bimna(src), - new /datum/locations/new_gibson(src), - new /datum/locations/reade(src), - new /datum/locations/tau_ceti_vi(src) - ) - ..(creator) - -/datum/locations/tau_ceti_i - name = "Tau Ceti I" - desc = "Tau Ceti I is a small, hot world with a thick and toxic atmosphere reminiscent of Sol's Venus. The close proximity to Tau Ceti renders any activity \ - on this world too dangerous to consider, although heavy heat and radiation shielding mitigate the risk enough for a single stellar observation post in the \ - upper equatorial region, which has the shortest day period on the planet." - -/datum/locations/luthien - name = "Luthien" - desc = "A small colony established on a feral, untamed world largely comprised of jungles with some savannah around the lower equatorial regions. \ - Human inhabitants are outnumbered by feral native species and wild beasts, which attack the outpost regularly, The Tau Ceti government maintains tight \ - military control over the few tiny population centres located near the poles." - -/datum/locations/bimna - name = "Bimna" - desc = "A medium sized planet with a strong economy and stable populace, Bimna is noteworthy for very little beyond having a large academic population, \ - and having one of the largest shipyards in the sector." - -/datum/locations/new_gibson - name = "New Gibson" - desc = "New Gibson is a medium sized, rocky planet that is covered in rampant industrialisation. Containing the majority of the planet-bound \ - resources in the system, New Gibson is torn by unrest and has very little wealth to call it's own." - -/datum/locations/reade - name = "Reade" - desc = "A small, cold, metal-deficient world, the Tau Ceti government maintains agricultural pastures in whatever available space in an attempt to salvage some \ - worth from this profitless colony, after a clerical error in the late 2400s resulted in significant expenditure in settlement and infrastructure. \ - Nowadays, what remains of that misguided re-colonisation project makes up several cavernous, ruined cities (some of which are visible from orbit)." - -/datum/locations/tau_ceti_vi - name = "Tau Ceti VI" - desc = "A small, cold world with a thin and unbreathable atmosphere and notably low gravity. Geological surveys over the centuries have catalogued \ - an anomalous network of cavities within the middle and lower crust of the planet that result in remarkably low gravity, and a complete lack of \ - seismic activity. The planet is completely void of anything making settlement worthwhile, but recently there have been rumours of illegitimate \ - shipping here. Security patrols have thus far turned up nothing, but some parties hypothesize that any smugglers or bandits could hide in the dense \ - molecular band in a median orbit around Tau Ceti to fool in-system sensors." diff --git a/code/datums/locations/uueoa_esa.dm b/code/datums/locations/uueoa_esa.dm deleted file mode 100644 index 39ed10c14d2..00000000000 --- a/code/datums/locations/uueoa_esa.dm +++ /dev/null @@ -1,40 +0,0 @@ -//Uueoa-Esa - -/datum/locations/uueoa_esa - name = "Uueoa-Esa" - desc = "The home system of the Unathi. It roughly translates to 'burning mother'." - -/datum/locations/uueoa_esa/New(var/creator) - contents.Add( - new /datum/locations/moghes(src), - new /datum/locations/ouere(src), - new /datum/locations/yeora(src), - new /datum/locations/yoos(src) - ) - ..(creator) - -/datum/locations/moghes - name = "Moghes" - desc = "The planet Moghes is home of the Unathi, and is dominated primarily by deserts as a result of an ancient nuclear disaster. \ - Evidence of this previous, older race manifests itself in the form of ruins that dot themselves across the surface. Traces of \ - swamp-land and jungles are present, showing that, at one time, Moghes was a lush world filled with a thriving ecosystem. \ - The planet is 1/6 smaller than the size of Earth, and it's only sun is close enough to make it uncomfortable for non-natives. \ - It has a single moon. Despite the doomsday event that burned away most of the plant life and water on the planet, \ - Moghes is still home to two large oceans called Malawi and Tanganyika. Sand storms are common at the equator and rain is only semi-common at the polar caps." - -/datum/locations/ouere - name = "Ouere" - desc = "Second closest planet to the burning mother and somewhat close to Moghes, oddly a planet heavily forested in swamp, \ - jungle and plain with very few lakes and some very harsh, carnivorous flora, most of it's water is underground in sub-geo lakes \ - and rivers... Rumors about colonies of very exploration minded Unathi circle it, but who can tell? Roughly 2/3rds Moghes' size." - -/datum/locations/yeora - name = "Yeora" - desc = "The planet with the biggest AU gap in the 'Esa system, a large blue gas giant with a trio of moons that's suspected \ - to account for it's distance from the other 3 bodies, some energy corporations wonder if it's worth harvesting for valuable \ - gasses, but aren't hopeful...It doesn't help most city-state councils and warlords wouldn't be happy with Skrell or Human establishment \ - in a system which could be /their/ rightful resource." - -/datum/locations/yoos - name = "Yoos" - desc = "A tiny (1/8th the size of Moghes) frozen planet at the very edge of the Uueoa-Esa system of very little note." diff --git a/code/datums/locations/vir.dm b/code/datums/locations/vir.dm deleted file mode 100644 index 3a407f1dc88..00000000000 --- a/code/datums/locations/vir.dm +++ /dev/null @@ -1,68 +0,0 @@ -//Vir - -/datum/locations/vir - name = "Vir" - desc = "Vir is a human system that sits between the inner and outer systems of human-controlled space." - -/datum/locations/vir/New(var/creator) - contents.Add( - new /datum/locations/firnir(src), - new /datum/locations/tyr(src), - new /datum/locations/sif(src), - new /datum/locations/magni(src), - new /datum/locations/kara(src), - new /datum/locations/rota(src) - ) - ..(creator) - -/datum/locations/firnir - name = "Firnir" - desc = "Tidally locked to Vir and having temperatures in excess of 570 degrees kelvin (299°C) on the day side has caused this planet to go mostly ignored." - -/datum/locations/tyr - name = "Tyr" - desc = "Second closest planet, with a high concentration of minerals in the crust, but otherwise a typical planet. The surface temperature can reach \ - 405 degrees kelvin (132°C), which deter most mining operations, except for one, which has a mining base and a few orbitals established, utilizing \ - specialized equipment, chiefly being autonomous synthetic mining drones, to retrieve precious ore in a rather expensive, but safer way, compared to the \ - pirate haven that is asteroid mining." - -/datum/locations/sif - name = "Sif" - desc = "Falling within Vir's 'habitable zone', the third planet was the first to be colonized, initially by a large group of colonists owing \ - loyalty to their own employers. Unfortunate events discussed previously had forced the settlement to be abandoned, and then reclaimed. \ - The planet's mean temperature is 286 kelvin (13°C), chilly but habitable." - -/datum/locations/magni - name = "Magni" - desc = "Outside of the habitable zone, Vir D is generally at 202 kelvin (-71°C)." - -/datum/locations/kara - name = "Kara" - desc = "A gas giant, with a large number of moons. Captured asteroids, to be specific. Many of these asteroids are being used by different companies for \ - various purposes. The temperature of the gas giant is 150 kelvin (-108°C)" - -/datum/locations/kara/New(var/creator) - contents.Add( - new /datum/locations/northern_star(src) - ) - ..(creator) - -/datum/locations/northern_star //Inception joke here - name = "Northern Star" - desc = "The Northern Star is an asteroid colony owned and operated by NanoTrasen, among many other asteroid installations. \ - Originally conceived as 'just another pitstop' for weary asteroid miners, it has grown to become a significant installation in the Kara subsystem." - -/datum/locations/northern_star/New(var/creator) - contents.Add( - new /datum/locations/northern_star_interior(src) - ) - ..(creator) - -/datum/locations/northern_star_interior - name = "Northern Star Inner Level" - desc = "The Northern Star contains multiple layers, this one being the inner level, also known as the residentual area. It contains most of the \ - homes for the Northern Star, as well as acting as the heart of commerece, with many shops and markets near the center." - -/datum/locations/rota - name = "Rota" - desc = "A Neptune-like ice giant, with a beautiful ring system circling it. It is 165 kelvin (-157°C)." diff --git a/code/game/gamemodes/changeling/changeling_powers.dm b/code/game/gamemodes/changeling/changeling_powers.dm index 8b8c4834f3d..5c9f058cd2a 100644 --- a/code/game/gamemodes/changeling/changeling_powers.dm +++ b/code/game/gamemodes/changeling/changeling_powers.dm @@ -80,12 +80,8 @@ var/global/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","E var/lesser_form = !ishuman(src) - if(!powerinstances.len) - for(var/P in powers) - powerinstances += new P() - // Code to auto-purchase free powers. - for(var/datum/power/changeling/P in powerinstances) + for(var/datum/power/changeling/P in GLOB.changeling_powers) if(!P.genomecost) // Is it free? if(!(P in mind.changeling.purchased_powers)) // Do we not have it already? mind.changeling.purchasePower(mind, P.name, 0)// Purchase it. Don't remake our verbs, we're doing it after this. diff --git a/code/game/gamemodes/changeling/modularchangling.dm b/code/game/gamemodes/changeling/modularchangling.dm index 5741850d830..1bfdf343efd 100644 --- a/code/game/gamemodes/changeling/modularchangling.dm +++ b/code/game/gamemodes/changeling/modularchangling.dm @@ -2,8 +2,11 @@ //Ling power's evolution menu entry datum should be contained alongside the mob proc for the actual power, in their own file. -var/list/powers = typesof(/datum/power/changeling) - /datum/power/changeling //needed for the badmin verb for now -var/list/datum/power/changeling/powerinstances = list() +GLOBAL_LIST_INIT(changeling_powers, init_changeling_powers()) +/proc/init_changeling_powers() + . = list() + for(var/datum/power/changeling/path as anything in subtypesof(/datum/power/changeling)) + . += new path /datum/power //Could be used by other antags too var/name = "Power" @@ -35,9 +38,6 @@ var/list/datum/power/changeling/powerinstances = list() return src = usr.mind.changeling - if(!powerinstances.len) - for(var/P in powers) - powerinstances += new P() var/dat = "Changling Evolution Menu" @@ -254,7 +254,7 @@ var/list/datum/power/changeling/powerinstances = list() "} var/i = 1 - for(var/datum/power/changeling/P in powerinstances) + for(var/datum/power/changeling/P in GLOB.changeling_powers) var/ownsthis = 0 if(P in purchased_powers) @@ -321,7 +321,7 @@ var/list/datum/power/changeling/powerinstances = list() var/datum/power/changeling/Thepower = Pname - for (var/datum/power/changeling/P in powerinstances) + for (var/datum/power/changeling/P in GLOB.changeling_powers) //to_chat(world, "[P] - [Pname] = [P.name == Pname ? "True" : "False"]") if(P.name == Pname) Thepower = P diff --git a/code/game/gamemodes/technomancer/catalog.dm b/code/game/gamemodes/technomancer/catalog.dm index 6bb966a3ed7..a82c86a2790 100644 --- a/code/game/gamemodes/technomancer/catalog.dm +++ b/code/game/gamemodes/technomancer/catalog.dm @@ -4,11 +4,6 @@ #define UTILITY_SPELLS "Utility" #define SUPPORT_SPELLS "Support" -var/list/all_technomancer_spells = typesof(/datum/technomancer/spell) - /datum/technomancer/spell -var/list/all_technomancer_equipment = typesof(/datum/technomancer/equipment) - /datum/technomancer/equipment -var/list/all_technomancer_consumables = typesof(/datum/technomancer/consumable) - /datum/technomancer/consumable -var/list/all_technomancer_assistance = typesof(/datum/technomancer/assistance) - /datum/technomancer/assistance - /datum/technomancer var/name = "technomancer thing" var/desc = "If you can see this, something broke." @@ -71,16 +66,16 @@ var/list/all_technomancer_assistance = typesof(/datum/technomancer/assistance) - // Description: Instantiates all the catalog datums for everything that can be bought. /obj/item/technomancer_catalog/proc/set_up() if(!spell_instances.len) - for(var/S in all_technomancer_spells) + for(var/S in subtypesof(/datum/technomancer/spell)) spell_instances += new S() if(!equipment_instances.len) - for(var/E in all_technomancer_equipment) + for(var/E in subtypesof(/datum/technomancer/equipment)) equipment_instances += new E() if(!consumable_instances.len) - for(var/C in all_technomancer_consumables) + for(var/C in subtypesof(/datum/technomancer/consumable)) consumable_instances += new C() if(!assistance_instances.len) - for(var/A in all_technomancer_assistance) + for(var/A in subtypesof(/datum/technomancer/assistance)) assistance_instances += new A() /obj/item/technomancer_catalog/apprentice/set_up() diff --git a/code/game/sd_Alert.dm b/code/game/sd_Alert.dm deleted file mode 100644 index 2ee8e2cdc88..00000000000 --- a/code/game/sd_Alert.dm +++ /dev/null @@ -1,180 +0,0 @@ -/** - *! sd_Alert library - *! by Shadowdarke (shadowdarke@byond.com) - * - * sd_Alert() is a powerful and flexible alternative to the built in BYOND - * alert() proc. sd_Alert offers timed popups, unlimited buttons, custom - * appearance, and even the option to popup without stealing keyboard focus - * from the map or command line. - * - * Please see demo.dm for detailed examples. - * - * FORMAT - * sd_Alert(who, message, title, buttons, default, duration, unfocus, \ - * size, table, style, tag, select, flags) - * - * ARGUMENTS - * who - the client or mob to display the alert to. - * message - text message to display - * title - title of the alert box - * buttons - list of buttons - * Default Value: list("Ok") - * default - default button selestion - * Default Value: the first button in the list - * duration - the number of ticks before this alert expires. If not - * set, the alert lasts until a button is clicked. - * Default Value: 0 (unlimited) - * unfocus - if this value is set, the popup will not steal keyboard - * focus from the map or command line. - * Default Value: 1 (do not take focus) - * size - size of the popup window in px - * Default Value: "300x200" - * table - optional parameters for the HTML table in the alert - * Default Value: "width=100% height=100%" (fill the window) - * style - optional style sheet information - * tag - lets you specify a certain tag for this sd_Alert so you may manipulate it - * externally. (i.e. force the alert to close, change options and redisplay, - * reuse the same window, etc.) - * select - if set, the buttons will be replaced with a selection box with a number of - * lines displayed equal to this value. - * Default value: 0 (use buttons) - * flags - optional flags effecting the alert display. These flags may be ORed (|) - * together for multiple effects. - * SD_ALERT_SCROLL = display a scrollbar - * SD_ALERT_SELECT_MULTI = forces selection box display (instead of - * buttons) allows the user to select multiple - * choices. - * SD_ALERT_LINKS = display each choice as a plain text link. - * Any selection box style overrides this flag. - * SD_ALERT_NOVALIDATE = don't validate responses - * Default value: SD_ALERT_SCROLL - * (button display with scroll bar, validate responses) - * RETURNS - * The text of the selected button, or null if the alert duration expired - * without a button click. - * - * Version 1 changes (from version 0): - * * Added the tag, select, and flags arguments, thanks to several suggestions from Foomer. - * * Split the sd_Alert/Alert() proc into New(), Display(), and Response() to allow more - * customization by developers. Primarily developers would want to use Display() to change - * the display of active tagged windows - * - */ - - -#define SD_ALERT_SCROLL 1 -#define SD_ALERT_SELECT_MULTI 2 -#define SD_ALERT_LINKS 4 -#define SD_ALERT_NOVALIDATE 8 - -/proc/sd_Alert(client/who, message, title, buttons = list("Ok"),\ - default, duration = 0, unfocus = 1, size = "300x200", \ - table = "width=100% height=100%", style, tag, select, flags = SD_ALERT_SCROLL) - - if(ismob(who)) - var/mob/M = who - who = M.client - if(!istype(who)) CRASH("sd_Alert: Invalid target:[who] (\ref[who])") - - var/sd_alert/T = locate(tag) - if(T) - if(istype(T)) qdel(T) - else CRASH("sd_Alert: tag \"[tag]\" is already in use by datum '[T]' (type: [T.type])") - T = new(who, tag) - if(duration) - spawn(duration) - if(T) qdel(T) - return - T.Display(message,title,buttons,default,unfocus,size,table,style,select,flags) - . = T.Response() - -/sd_alert - var/client/target - var/response - var/list/validation - -/sd_alert/Destroy() - target << browse(null,"window=\ref[src]") - ..() - -/sd_alert/New(who, tag) - ..() - target = who - src.tag = tag - -/sd_alert/Topic(href,params[]) - if(usr.client != target) - return - response = params["clk"] - -/sd_alert/proc/Display(message, title, list/buttons, default, unfocus, size, table, style, select, flags) - if (unfocus) - spawn() target << browse(null,null) - if (istext(buttons)) - buttons = list(buttons) - if (!default) - default = buttons[1] - if (!(flags & SD_ALERT_NOVALIDATE)) - validation = buttons.Copy() - - var/html = {"[title][style]
\ -
[message]
"} - - if (select || (flags & SD_ALERT_SELECT_MULTI)) // select style choices - html += {"
\ - -
" - else if(flags & SD_ALERT_LINKS) // text link style - for(var/b in buttons) - var/list/L = list() - L["clk"] = b - var/html_string=list2params(L) - var/focus - if(b == default) - focus = " ID=fcs" - html += "[html_encode(b)]\ -
" - else // button style choices - for(var/b in buttons) - var/list/L = list() - L["clk"] = b - var/html_string=list2params(L) - var/focus - if(b == default) - focus = " ID=fcs" - html += " " - - html += "
" - - target << browse(html,"window=\ref[src];size=[size];can_close=0") - -/sd_alert/proc/Response() - var/validated - while(!validated) - while(target && !response) // wait for a response - sleep(2) - - if(response && validation) - if(istype(response, /list)) - var/list/L = response - validation - if(L.len) - response = null - else - validated = 1 - else if(response in validation) - validated = 1 - else - response=null - else - validated = 1 - spawn(2) qdel(src) - return response diff --git a/code/game/trader_visit.dm b/code/game/trader_visit.dm deleted file mode 100644 index 5a95e9e192d..00000000000 --- a/code/game/trader_visit.dm +++ /dev/null @@ -1,59 +0,0 @@ -//Based on the ERT setup - -var/global/hire_nebula = 0 -var/can_call_traders = 1 - -/client/proc/trader_ship() - set name = "Hire Nebula Gas Employees" - set category = "Special Verbs" - set desc = "Invite players to work at the local Nebula Gas station." - - if(!holder) - to_chat(usr, "Only administrators may use this command.") - return - if(SSticker.current_state == 1) - to_chat(usr, "The round hasn't started yet!") - return - if(alert("Do you want to hire Nebula Gas attendants?",,"Yes","No") != "Yes") - return - if(get_security_level() == "red") // Allow admins to reconsider if the alert level is Red - switch(alert("The station is in red alert. Do you still want to hire traders?",,"Yes","No")) - if("No") - return - if(hire_nebula) - to_chat(usr, "Looks like somebody beat you to it!") - return - - message_admins("[key_name_admin(usr)] is hiring Nebula Gas attendants.", 1) - log_admin("[key_name(usr)] used Hire Nebula Gas Employees.") - trigger_trader_visit() - -/client/verb/JoinTraders() - - set name = "Join as Nebula Gas Employee" - set category = "IC" - - if(!MayRespawn(1)) - to_chat(usr, "You cannot join the traders.") - return - - if(istype(usr,/mob/observer/dead) || istype(usr,/mob/new_player)) - if(traders.current_antagonists.len >= traders.hard_cap) - to_chat(usr, "The number of trader slots is already full!") - return - traders.create_default(usr) - else - to_chat(usr, "You need to be an observer or new player to use this.") - -/proc/trigger_trader_visit() - if(!can_call_traders) - return - if(hire_nebula) - return - - command_announcement.Announce("Local scans indicate active commercial interest: Nebula Gas Food Mart.", "[station_name()] Traffic Control") - - can_call_traders = 0 // Only one call per round. - hire_nebula = 1 - - sleep(600 * 5) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 8092ad39e6f..a202f4fd41f 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -88,7 +88,6 @@ var/list/admin_verbs_admin = list( /client/proc/man_up, /client/proc/global_man_up, /client/proc/response_team, // Response Teams admin verb - /client/proc/trader_ship, // Trader ship admin verb /client/proc/toggle_antagHUD_use, /client/proc/toggle_antagHUD_restrictions, /client/proc/allow_character_respawn, // Allows a ghost to respawn , @@ -1093,7 +1092,7 @@ var/list/admin_verbs_event_manager = list( set category = "Fun" set name = "Give Spell" set desc = "Gives a spell to a mob." - var/spell/S = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in spells + var/spell/S = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in typesof(/spell) if(!S) return T.spell_list += new S feedback_add_details("admin_verb","GS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/mob/inventory/slot_meta.dm b/code/modules/mob/inventory/slot_meta.dm index db881f99a3d..21d96f19f3e 100644 --- a/code/modules/mob/inventory/slot_meta.dm +++ b/code/modules/mob/inventory/slot_meta.dm @@ -1,5 +1,6 @@ /// global slot meta cache - all ids must be string! -GLOBAL_LIST_INIT(inventory_slot_meta, init_inventory_slot_meta()) +/// initialized by SSearly_init +GLOBAL_LIST_EMPTY(inventory_slot_meta) /// global slot meta cache by type - only works for hardcoded GLOBAL_LIST_EMPTY(inventory_slot_type_cache) diff --git a/code/modules/mob/living/carbon/give.dm b/code/modules/mob/living/carbon/give.dm index e9aa97001e8..ce50e991848 100644 --- a/code/modules/mob/living/carbon/give.dm +++ b/code/modules/mob/living/carbon/give.dm @@ -42,12 +42,11 @@ target.visible_message("\The [src] handed \the [I] to \the [target].") /mob/living/carbon/human/proc/valid_give_mobs() - var/static/list/living_typecache = typecacheof(/mob/living) var/list/scan = view(1) // lmao shitcode . = list() for(var/i in scan) var/mob/living/L = i - if(!living_typecache[L.type]) + if(!GLOB.typecache_living[L.type]) continue . += L . -= src diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/morph/morph.dm b/code/modules/mob/living/simple_mob/subtypes/vore/morph/morph.dm index 6cf77fb99a3..39eec72f291 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/morph/morph.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/morph/morph.dm @@ -49,13 +49,15 @@ var/atom/movable/form = null var/morph_time = 0 var/our_size_multiplier = 1 - var/static/list/blacklist_typecache = typecacheof(list( - /atom/movable/screen, - /obj/singularity, - /mob/living/simple_mob/vore/hostile/morph, - /obj/effect)) + var/list/blacklist_typecache /mob/living/simple_mob/vore/hostile/morph/Initialize(mapload) + blacklist_typecache = cached_typecacheof(list( + /atom/movable/screen, + /obj/singularity, + /mob/living/simple_mob/vore/hostile/morph, + /obj/effect, + )) add_verb(src, /mob/living/proc/ventcrawl) return ..() diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/solargrub_larva.dm b/code/modules/mob/living/simple_mob/subtypes/vore/solargrub_larva.dm index 2dbdb88526e..94897831a70 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/solargrub_larva.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/solargrub_larva.dm @@ -215,10 +215,9 @@ var/global/list/grub_machine_overlays = list() var/list/ignored_targets = list() /datum/ai_holder/simple_mob/solargrub_larva/list_targets() - var/static/potential_targets = typecacheof(list(/obj/machinery)) var/list/actual_targets = list() - for(var/AT in typecache_filter_list(range(vision_range, holder), potential_targets)) + for(var/AT in typecache_filter_list(range(vision_range, holder), GLOB.typecache_machine)) var/obj/machinery/M = AT if(istype(M, /obj/machinery/atmospherics/component/unary/vent_pump)) var/obj/machinery/atmospherics/component/unary/vent_pump/V = M diff --git a/code/modules/nanites/chamber.dm b/code/modules/nanites/chamber.dm index 6e717a8e9b9..08822792ab7 100644 --- a/code/modules/nanites/chamber.dm +++ b/code/modules/nanites/chamber.dm @@ -50,18 +50,18 @@ var/operation_effects_timerid /// cost to rebuild a protean's swarm - var/static/list/protean_cost_nanoswarm = list( + var/list/protean_cost_nanoswarm = list( MAT_STEEL = 20000, ) /// cost to rebuild protean's orchestrator - var/static/list/protean_cost_orchestrator = list( + var/list/protean_cost_orchestrator = list( MAT_VERDANTIUM = 4000, MAT_GOLD = 8000, MAT_SILVER = 8000, MAT_METALHYDROGEN = 12000, ) /// cost to rebuild protean's refactory - var/static/list/protean_cost_refactory = list( + var/list/protean_cost_refactory = list( MAT_DIAMOND = 6000, MAT_MORPHIUM = 12000, MAT_STEEL = 5000, @@ -70,6 +70,9 @@ /obj/machinery/nanite_chamber/Initialize(mapload) . = ..() + protean_cost_nanoswarm = typelist(NAMEOF(src, protean_cost_nanoswarm), protean_cost_nanoswarm) + protean_cost_orchestrator = typelist(NAMEOF(src, protean_cost_orchestrator), protean_cost_orchestrator) + protean_cost_refactory = typelist(NAMEOF(src, protean_cost_refactory), protean_cost_refactory) detect_connection() /obj/machinery/nanite_chamber/Destroy() diff --git a/code/modules/spells/spell_code.dm b/code/modules/spells/spell_code.dm index 7c43391cedb..01652393464 100644 --- a/code/modules/spells/spell_code.dm +++ b/code/modules/spells/spell_code.dm @@ -1,5 +1,3 @@ -var/list/spells = typesof(/spell) //needed for the badmin verb for now - /spell var/name = "Spell" var/desc = "A spell" diff --git a/interface/interface.dm b/interface/interface.dm index 08a4568d417..57b7e9b48ad 100644 --- a/interface/interface.dm +++ b/interface/interface.dm @@ -79,7 +79,7 @@ message += GLOB.revdata.GetTestMergeInfo(FALSE) if(tgalert(src, message, "Report Issue","Yes","No")!="Yes") return - var/static/issue_template = file2text(".github/ISSUE_TEMPLATE.md") + var/issue_template = file2text(".github/ISSUE_TEMPLATE.md") var/servername = "Citadel Station 13 RP" // CONFIG_GET(string/servername) var/url_params = "Reporting client version: [byond_version].[byond_build]\n\n[issue_template]" if(GLOB.round_id || servername) @@ -228,7 +228,7 @@ Any-Mode: (hotkey doesn't need to be on) set category = "Preferences" set desc = "Toggle input control scheme" set hidden = TRUE - + prefs.hotkeys = !prefs.hotkeys set_macros() - + diff --git a/interface/menus/main.dm b/interface/menus/main.dm index 171a91ff18c..e233d3f2518 100644 --- a/interface/menus/main.dm +++ b/interface/menus/main.dm @@ -37,7 +37,7 @@ GLOBAL_DATUM_INIT(main_window_menu, /datum/skin_menu/main, new) /datum/skin_menu_category/main_zoom/init_entries() . = ..() - var/static/list/auto_sizes = list( + var/list/auto_sizes = list( 32, 48, 64,