From 200bf2d931b3efdba13e8bd666ebfb460ddc7fbb Mon Sep 17 00:00:00 2001 From: Spookerton Date: Tue, 7 Jan 2025 16:49:07 +0000 Subject: [PATCH] species are singletons, pulled species bare globals into GLOB --- baystation12.dme | 1 - code/_helpers/global_lists.dm | 20 +--- code/_helpers/mobs.dm | 17 +-- code/_helpers/species.dm | 14 --- code/datums/mil_ranks.dm | 10 +- code/datums/outfits/outfit.dm | 4 +- code/datums/traits/README.md | 6 +- code/game/antagonist/outsider/vox.dm | 6 +- code/game/antagonist/station/changeling.dm | 2 +- code/game/gamemodes/cult/manifest.dm | 6 +- code/game/jobs/job/job.dm | 12 +- code/game/jobs/whitelist.dm | 6 +- code/game/machinery/bioprinter.dm | 2 +- code/game/movietitles.dm | 2 +- code/game/objects/items/robot/robot_parts.dm | 4 +- code/modules/admin/view_variables/topic.dm | 2 +- .../preference_setup/background/01_culture.dm | 2 +- .../preference_setup/general/02_body.dm | 52 ++++----- .../preference_setup/general/03_equipment.dm | 2 +- .../client/preference_setup/laws/laws_pref.dm | 4 +- .../preference_setup/loadout/loadout.dm | 2 +- .../preference_setup/occupation/occupation.dm | 8 +- .../preference_setup/preference_setup.dm | 2 +- code/modules/clothing/masks/miscellaneous.dm | 2 +- .../codex/categories/category_species.dm | 4 +- code/modules/emotes/definitions/_species.dm | 14 +-- code/modules/emotes/skrell.dm | 2 +- code/modules/events/ion_storm.dm | 4 +- code/modules/ghosttrap/trap.dm | 8 +- code/modules/mob/living/autohiss.dm | 14 +-- .../mob/living/carbon/alien/diona/_nymph.dm | 2 +- .../alien/diona/gestalt/gestalt_verbs.dm | 2 +- .../mob/living/carbon/carbon_defines.dm | 2 +- .../mob/living/carbon/human/appearance.dm | 6 +- code/modules/mob/living/carbon/human/human.dm | 4 +- code/modules/mob/living/silicon/robot/life.dm | 2 +- code/modules/mob/mob_helpers.dm | 4 +- code/modules/mob/new_player/new_player.dm | 12 +- .../mob/new_player/preferences_setup.dm | 5 +- .../modules/organs/internal/species/nabber.dm | 4 +- code/modules/organs/internal/species/vox.dm | 2 +- code/modules/organs/organ.dm | 6 +- .../exoplanets/planet_types/chlorine.dm | 2 +- .../overmap/exoplanets/planet_types/desert.dm | 2 +- .../overmap/exoplanets/planet_types/grass.dm | 4 +- .../overmap/exoplanets/planet_types/snow.dm | 2 +- .../exoplanets/planet_types/volcanic.dm | 2 +- code/modules/projectiles/projectile/change.dm | 2 +- .../Chemistry-Reagents-Toxins.dm | 6 +- .../reagents/reagent_containers/ivbag.dm | 2 +- code/modules/species/outsider/random.dm | 8 +- code/modules/species/outsider/shadow.dm | 4 +- code/modules/species/outsider/starlight.dm | 14 +-- code/modules/species/outsider/vox.dm | 8 +- code/modules/species/outsider/zombie.dm | 14 +-- code/modules/species/species.dm | 107 ++++++++++-------- .../modules/species/species_age_comparison.dm | 8 +- code/modules/species/species_getters.dm | 58 +++++----- code/modules/species/species_grab.dm | 2 +- code/modules/species/species_helpers.dm | 18 +-- code/modules/species/species_random.dm | 8 +- code/modules/species/species_shapeshift.dm | 68 +++++------ code/modules/species/station/adherent.dm | 20 ++-- code/modules/species/station/golem.dm | 8 +- .../species/station/human_subspecies.dm | 16 +-- code/modules/species/station/lizard.dm | 6 +- .../species/station/lizard_subspecies.dm | 6 +- code/modules/species/station/machine.dm | 12 +- code/modules/species/station/monkey.dm | 12 +- code/modules/species/station/nabber.dm | 36 +++--- code/modules/species/station/prometheans.dm | 21 ++-- code/modules/species/station/station.dm | 32 +++--- code/modules/submaps/submap_job.dm | 4 +- code/unit_tests/culture.dm | 4 +- code/unit_tests/mob_tests.dm | 12 +- code/unit_tests/organ_tests.dm | 10 +- code/unit_tests/trait_tests.dm | 8 +- maps/mapsystem/map_ranks.dm | 4 +- maps/mapsystem/maps_jobs.dm | 4 +- maps/torch/job/torch_jobs.dm | 20 ++-- maps/torch/torch_ranks.dm | 32 +++--- 81 files changed, 430 insertions(+), 461 deletions(-) delete mode 100644 code/_helpers/species.dm diff --git a/baystation12.dme b/baystation12.dme index e33decaac4d0e..1da4ee275bebd 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -125,7 +125,6 @@ #include "code\_helpers\names.dm" #include "code\_helpers\sanitize_values.dm" #include "code\_helpers\spawn_sync.dm" -#include "code\_helpers\species.dm" #include "code\_helpers\storage.dm" #include "code\_helpers\system.dm" #include "code\_helpers\text.dm" diff --git a/code/_helpers/global_lists.dm b/code/_helpers/global_lists.dm index cfd3fcf1145ab..f4e5bb773d19f 100644 --- a/code/_helpers/global_lists.dm +++ b/code/_helpers/global_lists.dm @@ -16,11 +16,9 @@ var/global/list/landmarks_list = list() //list of all landmarks created #define all_genders_text_list list("Male","Female","Plural","Neuter") //Languages/species/whitelist. -var/global/list/all_species[0] + var/global/list/datum/language/all_languages = list() var/global/list/language_keys[0] // Table of say codes for all languages -var/global/list/playable_species = list(SPECIES_HUMAN) // A list of ALL playable species, whitelisted, latejoin or otherwise. - GLOBAL_LIST_EMPTY(all_particles) @@ -134,22 +132,6 @@ var/global/list/string_slot_flags = list( if(!(L.flags & NONGLOBAL)) language_keys[lowertext(L.key)] = L - var/rkey = 0 - paths = typesof(/datum/species) - for(var/T in paths) - - rkey++ - - var/datum/species/S = T - if(!initial(S.name)) - continue - - S = new T - S.race_key = rkey //Used in mob icon caching. - all_species[S.name] = S - if(!(S.spawn_flags & SPECIES_IS_RESTRICTED)) - playable_species += S.name - //Grabs paths = typesof(/datum/grab) - /datum/grab for(var/T in paths) diff --git a/code/_helpers/mobs.dm b/code/_helpers/mobs.dm index 120c1ccf5faa9..0d5bd6508f70f 100644 --- a/code/_helpers/mobs.dm +++ b/code/_helpers/mobs.dm @@ -19,34 +19,35 @@ var/M = AM.get_mob() if(M) mobs += M - return mobs + /proc/random_hair_style(gender, species = SPECIES_HUMAN) var/h_style = "Bald" - - var/datum/species/mob_species = all_species[species] + var/singleton/species/mob_species = GLOB.species_by_name[species] var/list/valid_hairstyles = mob_species.get_hair_styles() if(length(valid_hairstyles)) h_style = pick(valid_hairstyles) - return h_style + /proc/random_facial_hair_style(gender, species = SPECIES_HUMAN) var/f_style = "Shaved" - var/datum/species/mob_species = all_species[species] + var/singleton/species/mob_species = GLOB.species_by_name[species] var/list/valid_facialhairstyles = mob_species.get_facial_hair_styles(gender) if(length(valid_facialhairstyles)) f_style = pick(valid_facialhairstyles) return f_style + /proc/random_name(gender, species = SPECIES_HUMAN) - var/datum/species/current_species = all_species[species] + var/singleton/species/current_species = GLOB.species_by_name[species] var/singleton/cultural_info/current_culture = SSculture.get_culture(current_species.default_cultural_info[TAG_CULTURE]) return current_culture.get_random_name(gender) -/proc/random_skin_tone(datum/species/current_species) - var/species_tone = current_species ? 35 - current_species.max_skin_tone() : -185 + +/proc/random_skin_tone(singleton/species/species) + var/species_tone = species ? 35 - species.max_skin_tone() : -185 switch(pick(60;"caucasian", 15;"afroamerican", 10;"african", 10;"latino", 5;"albino")) if("caucasian") . = -10 if("afroamerican") . = -115 diff --git a/code/_helpers/species.dm b/code/_helpers/species.dm deleted file mode 100644 index c605f46b636cb..0000000000000 --- a/code/_helpers/species.dm +++ /dev/null @@ -1,14 +0,0 @@ -/** - Helpers related to /datum/species -*/ - - -/// Null, or a species if thing is a species, a species path, or a species name -/proc/resolve_species(datum/species/thing) - RETURN_TYPE(/datum/species) - if (ispath(thing, /datum/species)) - thing = initial(thing.name) - if (istext(thing)) - thing = all_species[thing] - if (istype(thing)) - return thing diff --git a/code/datums/mil_ranks.dm b/code/datums/mil_ranks.dm index a8c25d177287a..2e613ba7201cf 100644 --- a/code/datums/mil_ranks.dm +++ b/code/datums/mil_ranks.dm @@ -53,7 +53,7 @@ GLOBAL_DATUM_INIT(mil_branches, /datum/mil_branches, new) /** * Return all spawn branches for the given input */ -/datum/mil_branches/proc/spawn_branches(datum/species/S) +/datum/mil_branches/proc/spawn_branches(singleton/species/S) if(!S) return spawn_branches_.Copy() . = LAZYACCESS(spawn_branches_by_species_, S) @@ -67,21 +67,21 @@ GLOBAL_DATUM_INIT(mil_branches, /datum/mil_branches, new) /** * Return all spawn ranks for the given input */ -/datum/mil_branches/proc/spawn_ranks(branch_name, datum/species/S) +/datum/mil_branches/proc/spawn_ranks(branch_name, singleton/species/S) var/datum/mil_branch/branch = get_branch(branch_name) return branch && branch.spawn_ranks(S) /** * Return a true value if branch_name is a valid spawn branch key */ -/datum/mil_branches/proc/is_spawn_branch(branch_name, datum/species/S) +/datum/mil_branches/proc/is_spawn_branch(branch_name, singleton/species/S) return (branch_name in spawn_branches(S)) /** * Return a true value if rank_name is a valid spawn rank in branch under branch_name */ -/datum/mil_branches/proc/is_spawn_rank(branch_name, rank_name, datum/species/S) +/datum/mil_branches/proc/is_spawn_rank(branch_name, rank_name, singleton/species/S) var/datum/mil_branch/branch = get_branch(branch_name) if(branch && (rank_name in branch.spawn_ranks(S))) return TRUE @@ -130,7 +130,7 @@ GLOBAL_DATUM_INIT(mil_branches, /datum/mil_branches, new) if(rank_path in spawn_rank_types) spawn_ranks_[rank.name] = rank -/datum/mil_branch/proc/spawn_ranks(datum/species/S) +/datum/mil_branch/proc/spawn_ranks(singleton/species/S) if(!S) return spawn_ranks_.Copy() . = spawn_ranks_by_species_[S] diff --git a/code/datums/outfits/outfit.dm b/code/datums/outfits/outfit.dm index d02569b2b2fd2..64bc0fb76e75c 100644 --- a/code/datums/outfits/outfit.dm +++ b/code/datums/outfits/outfit.dm @@ -84,8 +84,8 @@ var/global/list/outfits_singletons_by_type_ // If you want to add more items that has species restriction, consider follow- // ing the same format as the gloves shown in the code below. Thanks. /singleton/hierarchy/outfit/proc/check_and_try_equip_xeno(mob/living/carbon/human/H) - var/datum/species/S = H.species - if (!S || istype(S, /datum/species/human)) // null failcheck & get out here you damn humans + var/singleton/species/S = H.species + if (!S || istype(S, /singleton/species/human)) // null failcheck & get out here you damn humans return // Gloves diff --git a/code/datums/traits/README.md b/code/datums/traits/README.md index 0b053903839d9..b191709d25940 100644 --- a/code/datums/traits/README.md +++ b/code/datums/traits/README.md @@ -9,12 +9,12 @@ As a specific example: Previously water checked for either the mob type `/mob/li ## What is a Trait? -* A trait is at this time simply a `/decl` with a name, description, and potency: +* A trait is at this time simply a `/singleton` with a name, description, and potency: * Simply has the trait, or: * Minor/Moderate/Major (or a subset thereof) * Traits are currently primarily checked for during various interactions between chemicals and mobs, but can potentially be used anywhere a mob type or species check is currently made. * Trait checks can either merely check if a mob has a given trait, or have the trait potency affect the effect of the interaction. -* Can be used by both `/mob/living` and `/datum/species` subtypes. In the latter case traits are granted to all `/mob/living/carbon` instances of a given species. +* Can be used by both `/mob/living` and `/singleton/species` subtypes. In the latter case traits are granted to all `/mob/living/carbon` instances of a given species. ## What makes a good Trait? @@ -29,7 +29,7 @@ If you plan to add your own trait, it's worthwhile to consider the following poi ## Future Potential -Traits do not necessarily have to be granted to entire `/mob/living` or `/datum/species` types, it is technically possible to grant them to individual mob instances as there are procs for doing so. +Traits do not necessarily have to be granted to entire `/mob/living` or `/singleton/species` types, it is technically possible to grant them to individual mob instances as there are procs for doing so. Some examples for those inclined to implement practical uses: diff --git a/code/game/antagonist/outsider/vox.dm b/code/game/antagonist/outsider/vox.dm index f68a82056f101..eaad5da7583c4 100644 --- a/code/game/antagonist/outsider/vox.dm +++ b/code/game/antagonist/outsider/vox.dm @@ -44,7 +44,7 @@ GLOBAL_LIST_EMPTY(vox_artifact_spawners) if (player_is_antag(player)) log_debug("[key_name(player)] is not eligible to become a [role_text]: They are already an antagonist!") continue - if(!is_alien_whitelisted(player.current, all_species[SPECIES_VOX])) + if(!is_alien_whitelisted(player.current, GLOB.species_by_name[SPECIES_VOX])) log_debug("[player.current.ckey] is not whitelisted") continue var/result = can_become_antag_detailed(player) @@ -65,14 +65,14 @@ GLOBAL_LIST_EMPTY(vox_artifact_spawners) else if (player in pending_antagonists) else if(!can_become_antag(player)) else if(player_is_antag(player)) - else if(!is_alien_whitelisted(player.current, all_species[SPECIES_VOX])) + else if(!is_alien_whitelisted(player.current, GLOB.species_by_name[SPECIES_VOX])) else candidates |= player return candidates /datum/antagonist/vox/can_become_antag_detailed(datum/mind/player, ignore_role) - if(!is_alien_whitelisted(player.current, all_species[SPECIES_VOX])) + if(!is_alien_whitelisted(player.current, GLOB.species_by_name[SPECIES_VOX])) return "Player doesn't have vox whitelist" ..() diff --git a/code/game/antagonist/station/changeling.dm b/code/game/antagonist/station/changeling.dm index b207bc29fe5d6..c6bd59ff0c16a 100644 --- a/code/game/antagonist/station/changeling.dm +++ b/code/game/antagonist/station/changeling.dm @@ -79,7 +79,7 @@ GLOBAL_DATUM_INIT(changelings, /datum/antagonist/changeling, new) return 1 else if(isnewplayer(player.current)) if(player.current.client && player.current.client.prefs) - var/datum/species/S = all_species[player.current.client.prefs.species] + var/singleton/species/S = GLOB.species_by_name[player.current.client.prefs.species] if(S?.species_flags & SPECIES_FLAG_NO_SCAN|SPECIES_FLAG_NEED_DIRECT_ABSORB) return 0 if(player.current.client.prefs.organ_data[BP_CHEST] == "cyborg") // Full synthetic. diff --git a/code/game/gamemodes/cult/manifest.dm b/code/game/gamemodes/cult/manifest.dm index 3f8ef136dfc12..d85d36b13776b 100644 --- a/code/game/gamemodes/cult/manifest.dm +++ b/code/game/gamemodes/cult/manifest.dm @@ -1,4 +1,4 @@ -/datum/species/human/cult +/singleton/species/human/cult name = "Cult" spawn_flags = SPECIES_IS_RESTRICTED brute_mod = 2 @@ -10,12 +10,12 @@ TAG_FACTION = FACTION_OTHER ) -/datum/species/human/cult/handle_death(mob/living/carbon/human/H) +/singleton/species/human/cult/handle_death(mob/living/carbon/human/H) spawn(1) if(H) H.dust() -/datum/species/human/cult/handle_post_spawn(mob/living/carbon/human/H) +/singleton/species/human/cult/handle_post_spawn(mob/living/carbon/human/H) H.skin_tone = 35 H.eye_color = "#e60707" H.update_eyes() diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 00c0e12e27d53..2fbfe7397dbf0 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -195,10 +195,10 @@ return (supplied_title == desired_title) || (H.mind && H.mind.role_alt_title == desired_title) /datum/job/proc/is_restricted(datum/preferences/prefs, feedback) - var/datum/species/S + var/singleton/species/S if (!is_species_whitelist_allowed(prefs.client, use_species_whitelist)) - S = all_species[use_species_whitelist] + S = GLOB.species_by_name[use_species_whitelist] to_chat(feedback, SPAN_CLASS("boldannounce", "\An [S] species whitelist is required for [title].")) return TRUE @@ -210,7 +210,7 @@ to_chat(feedback, SPAN_CLASS("boldannounce", "Wrong rank for [title]. Valid ranks in [prefs.branches[title]] are: [get_ranks(prefs.branches[title])].")) return TRUE - S = all_species[prefs.species] + S = GLOB.species_by_name[prefs.species] if(!is_species_allowed(S)) to_chat(feedback, SPAN_CLASS("boldannounce", "Restricted species, [S], for [title].")) return TRUE @@ -245,7 +245,7 @@ active++ return active -/datum/job/proc/is_species_allowed(datum/species/S) +/datum/job/proc/is_species_allowed(singleton/species/S) if(GLOB.using_map.is_species_job_restricted(S, src)) return FALSE // We also make sure that there is at least one valid branch-rank combo for the species. @@ -262,7 +262,7 @@ return is_species_whitelisted(C.mob, use_species_whitelist) // Don't use if the map doesn't use branches but jobs do. -/datum/job/proc/get_branch_rank(datum/species/S) +/datum/job/proc/get_branch_rank(singleton/species/S) . = species_branch_rank_cache_[S] if(.) return @@ -380,7 +380,7 @@ reasons["Your rank choice does not allow it."] = TRUE if (!is_species_whitelist_allowed(caller)) reasons["You do not have the required [use_species_whitelist] species whitelist."] = TRUE - var/datum/species/S = all_species[caller.prefs.species] + var/singleton/species/S = GLOB.species_by_name[caller.prefs.species] if(S) if(!is_species_allowed(S)) reasons["Your species choice does not allow it."] = TRUE diff --git a/code/game/jobs/whitelist.dm b/code/game/jobs/whitelist.dm index b4c5de02193c0..e48de05747a9c 100644 --- a/code/game/jobs/whitelist.dm +++ b/code/game/jobs/whitelist.dm @@ -50,7 +50,7 @@ var/global/list/alien_whitelist = list() return 1 /proc/is_species_whitelisted(mob/M, species_name) - var/datum/species/S = all_species[species_name] + var/singleton/species/S = GLOB.species_by_name[species_name] return is_alien_whitelisted(M, S) //todo: admin aliens @@ -70,8 +70,8 @@ var/global/list/alien_whitelist = list() return 1 return whitelist_lookup(L.name, M.ckey) - if(istype(species,/datum/species)) - var/datum/species/S = species + if(istype(species,/singleton/species)) + var/singleton/species/S = species if(!(S.spawn_flags & (SPECIES_IS_WHITELISTED|SPECIES_IS_RESTRICTED))) return 1 return whitelist_lookup(S.get_bodytype(S), M.ckey) diff --git a/code/game/machinery/bioprinter.dm b/code/game/machinery/bioprinter.dm index e8d0a964f8478..1046ea39b7153 100644 --- a/code/game/machinery/bioprinter.dm +++ b/code/game/machinery/bioprinter.dm @@ -214,7 +214,7 @@ /obj/item/organ = null ) var/datum/dna/loaded_dna_datum - var/datum/species/loaded_species //For quick refrencing + var/singleton/species/loaded_species //For quick refrencing /obj/machinery/organ_printer/flesh/mapped/Initialize() . = ..() diff --git a/code/game/movietitles.dm b/code/game/movietitles.dm index d4921737f8dbd..d93994b7660f7 100644 --- a/code/game/movietitles.dm +++ b/code/game/movietitles.dm @@ -166,7 +166,7 @@ GLOBAL_LIST(end_titles) else if(H.real_name) corpses += H.real_name for(var/spec in monkies) - var/datum/species/S = all_species[spec] + var/singleton/species/S = GLOB.species_by_name[spec] corpses += "[monkies[spec]] [lowertext(monkies[spec] > 1 ? S.name_plural : S.name)]" if(length(corpses)) titles += "
BASED ON REAL EVENTS
In memory of [english_list(corpses)].
" diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 8d44bff365e3f..5b349613b37d6 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -183,8 +183,8 @@ /obj/item/robot_parts/chest/proc/GetCyborgSpecies() . = list() - for(var/N in playable_species) - var/datum/species/S = all_species[N] + for(var/N in GLOB.playable_species) + var/singleton/species/S = GLOB.species_by_name[N] if(S.spawn_flags & SPECIES_NO_FBP_CONSTRUCTION) continue . += N diff --git a/code/modules/admin/view_variables/topic.dm b/code/modules/admin/view_variables/topic.dm index 8ea136d4aeb58..0b1e97f145406 100644 --- a/code/modules/admin/view_variables/topic.dm +++ b/code/modules/admin/view_variables/topic.dm @@ -324,7 +324,7 @@ to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") return - var/new_species = input("Please choose a new species.","Species",null) as null|anything in all_species + var/new_species = input("Please choose a new species.","Species",null) as null | anything in GLOB.species_by_name if(!H) to_chat(usr, "Mob doesn't exist anymore") diff --git a/code/modules/client/preference_setup/background/01_culture.dm b/code/modules/client/preference_setup/background/01_culture.dm index ce4bda1863f84..049273b65e43b 100644 --- a/code/modules/client/preference_setup/background/01_culture.dm +++ b/code/modules/client/preference_setup/background/01_culture.dm @@ -1,5 +1,5 @@ #define GET_ALLOWED_VALUES(write_to, check_key) \ - var/datum/species/S = all_species[pref.species]; \ + var/singleton/species/S = GLOB.species_by_name[pref.species]; \ if(!S) { \ write_to = list(); \ } else if(S.force_cultural_info[check_key]) { \ diff --git a/code/modules/client/preference_setup/general/02_body.dm b/code/modules/client/preference_setup/general/02_body.dm index a5e958b03a4ed..6d98a95abbf10 100644 --- a/code/modules/client/preference_setup/general/02_body.dm +++ b/code/modules/client/preference_setup/general/02_body.dm @@ -101,9 +101,9 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O pref.facial_hair_style = sanitize_inlist(pref.facial_hair_style, GLOB.facial_hair_styles_list, initial(pref.facial_hair_style)) pref.b_type = sanitize_text(pref.b_type, initial(pref.b_type)) - if(!pref.species || !(pref.species in playable_species)) + if(!pref.species || !(pref.species in GLOB.playable_species)) pref.species = SPECIES_HUMAN - var/datum/species/mob_species = all_species[pref.species] + var/singleton/species/mob_species = GLOB.species_by_name[pref.species] pref.gender = sanitize_inlist(pref.gender, mob_species.genders, pick(mob_species.genders)) pref.pronouns = sanitize_inlist(pref.pronouns, mob_species.pronouns, pick(mob_species.pronouns)) @@ -143,7 +143,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O /datum/category_item/player_setup_item/physical/body/content(mob/user) . = list() - var/datum/species/mob_species = all_species[pref.species] + var/singleton/species/mob_species = GLOB.species_by_name[pref.species] . += "Species [BTN("show_species", "Info")]" . += "
[TBTN("set_species", mob_species.name, "Selected")]" . += "

Body [BTN("random", "Randomize")]" @@ -276,18 +276,18 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O . = jointext(., null) -/datum/category_item/player_setup_item/physical/body/proc/HasAppearanceFlag(datum/species/mob_species, flag) +/datum/category_item/player_setup_item/physical/body/proc/HasAppearanceFlag(singleton/species/mob_species, flag) return mob_species && (mob_species.appearance_flags & flag) /datum/category_item/player_setup_item/physical/body/OnTopic(href,list/href_list, mob/user) - var/datum/species/mob_species = all_species[pref.species] + var/singleton/species/mob_species = GLOB.species_by_name[pref.species] if(href_list["toggle_species_verbose"]) hide_species = !hide_species return TOPIC_REFRESH else if(href_list["gender"]) - mob_species = all_species[pref.species] + mob_species = GLOB.species_by_name[pref.species] var/new_gender = input(user, "Choose your character's bodytype:", CHARACTER_PREFERENCE_INPUT_TITLE, pref.gender) as null|anything in mob_species.genders if(new_gender && CanUseTopic(user) && (new_gender in mob_species.genders)) pref.gender = new_gender @@ -308,7 +308,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O else if(href_list["pronouns"]) var/new_pronouns = input(user, "Choose your character's pronouns:", CHARACTER_PREFERENCE_INPUT_TITLE, pref.pronouns) as null|anything in mob_species.pronouns - mob_species = all_species[pref.species] + mob_species = GLOB.species_by_name[pref.species] if(new_pronouns && CanUseTopic(user) && (new_pronouns in mob_species.pronouns)) pref.pronouns = new_pronouns return TOPIC_REFRESH @@ -330,18 +330,18 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O return TOPIC_REFRESH else if(href_list["show_species"]) - var/choice = input("Which species would you like to look at?") as null|anything in playable_species + var/choice = input("Which species would you like to look at?") as null|anything in GLOB.playable_species if(choice) - var/datum/species/current_species = all_species[choice] + var/singleton/species/current_species = GLOB.species_by_name[choice] show_browser(user, current_species.get_description(), "window=species;size=700x400") return TOPIC_HANDLED else if(href_list["set_species"]) var/list/species_to_pick = list() - for(var/species in playable_species) + for(var/species in GLOB.playable_species) if(!GLOB.skip_allow_lists && !check_rights(R_ADMIN, 0) && config.usealienwhitelist) - var/datum/species/current_species = all_species[species] + var/singleton/species/current_species = GLOB.species_by_name[species] if(!(current_species.spawn_flags & SPECIES_CAN_JOIN)) continue else if((current_species.spawn_flags & SPECIES_IS_WHITELISTED) && !is_alien_whitelisted(preference_mob(),current_species)) @@ -349,13 +349,13 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O species_to_pick += species var/choice = input("Select a species to play as.") as null|anything in species_to_pick - if(!choice || !(choice in all_species)) + if(!choice || !(choice in GLOB.species_by_name)) return var/prev_species = pref.species pref.species = choice if(prev_species != pref.species) - mob_species = all_species[pref.species] + mob_species = GLOB.species_by_name[pref.species] if(!(pref.gender in mob_species.genders)) pref.gender = mob_species.genders[1] if(!(pref.pronouns in mob_species.pronouns)) @@ -379,7 +379,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O sanitize_organs() - if(!HasAppearanceFlag(all_species[pref.species], SPECIES_APPEARANCE_HAS_UNDERWEAR)) + if(!HasAppearanceFlag(GLOB.species_by_name[pref.species], SPECIES_APPEARANCE_HAS_UNDERWEAR)) pref.all_underwear.Cut() return TOPIC_REFRESH_UPDATE_PREVIEW @@ -388,7 +388,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O if(!HasAppearanceFlag(mob_species, SPECIES_APPEARANCE_HAS_HAIR_COLOR)) return TOPIC_NOACTION var/new_hair = input(user, "Choose your character's hair colour:", CHARACTER_PREFERENCE_INPUT_TITLE, pref.head_hair_color) as color|null - if(new_hair && HasAppearanceFlag(all_species[pref.species], SPECIES_APPEARANCE_HAS_HAIR_COLOR) && CanUseTopic(user)) + if(new_hair && HasAppearanceFlag(GLOB.species_by_name[pref.species], SPECIES_APPEARANCE_HAS_HAIR_COLOR) && CanUseTopic(user)) pref.head_hair_color = new_hair return TOPIC_REFRESH_UPDATE_PREVIEW @@ -406,7 +406,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O else new_h_style = input(user, "Choose your character's hair style:", CHARACTER_PREFERENCE_INPUT_TITLE, pref.head_hair_style) as null|anything in valid_hairstyles - mob_species = all_species[pref.species] + mob_species = GLOB.species_by_name[pref.species] if(new_h_style && CanUseTopic(user) && (new_h_style in mob_species.get_hair_styles())) pref.head_hair_style = new_h_style return TOPIC_REFRESH_UPDATE_PREVIEW @@ -415,7 +415,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O if(!HasAppearanceFlag(mob_species, SPECIES_APPEARANCE_HAS_HAIR_COLOR)) return TOPIC_NOACTION var/new_facial = input(user, "Choose your character's facial-hair colour:", CHARACTER_PREFERENCE_INPUT_TITLE, pref.facial_hair_color) as color|null - if(new_facial && HasAppearanceFlag(all_species[pref.species], SPECIES_APPEARANCE_HAS_HAIR_COLOR) && CanUseTopic(user)) + if(new_facial && HasAppearanceFlag(GLOB.species_by_name[pref.species], SPECIES_APPEARANCE_HAS_HAIR_COLOR) && CanUseTopic(user)) pref.facial_hair_color = new_facial return TOPIC_REFRESH_UPDATE_PREVIEW @@ -423,7 +423,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O if(!HasAppearanceFlag(mob_species, SPECIES_APPEARANCE_HAS_EYE_COLOR)) return TOPIC_NOACTION var/new_eyes = input(user, "Choose your character's eye colour:", CHARACTER_PREFERENCE_INPUT_TITLE, pref.eye_color) as color|null - if(new_eyes && HasAppearanceFlag(all_species[pref.species], SPECIES_APPEARANCE_HAS_EYE_COLOR) && CanUseTopic(user)) + if(new_eyes && HasAppearanceFlag(GLOB.species_by_name[pref.species], SPECIES_APPEARANCE_HAS_EYE_COLOR) && CanUseTopic(user)) pref.eye_color = new_eyes return TOPIC_REFRESH_UPDATE_PREVIEW @@ -439,7 +439,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O if(!HasAppearanceFlag(mob_species, SPECIES_APPEARANCE_HAS_A_SKIN_TONE)) return TOPIC_NOACTION var/new_s_tone = input(user, "Choose your character's skin-tone. Lower numbers are lighter, higher are darker. Range: 1 to [mob_species.max_skin_tone()]", CHARACTER_PREFERENCE_INPUT_TITLE, (-pref.skin_tone) + 35) as num|null - mob_species = all_species[pref.species] + mob_species = GLOB.species_by_name[pref.species] if(new_s_tone && HasAppearanceFlag(mob_species, SPECIES_APPEARANCE_HAS_A_SKIN_TONE) && CanUseTopic(user)) pref.skin_tone = 35 - max(min(round(new_s_tone), mob_species.max_skin_tone()), 1) return TOPIC_REFRESH_UPDATE_PREVIEW @@ -448,7 +448,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O if(!HasAppearanceFlag(mob_species, SPECIES_APPEARANCE_HAS_SKIN_COLOR)) return TOPIC_NOACTION var/new_skin = input(user, "Choose your character's skin colour: ", CHARACTER_PREFERENCE_INPUT_TITLE, pref.skin_color) as color|null - if(new_skin && HasAppearanceFlag(all_species[pref.species], SPECIES_APPEARANCE_HAS_SKIN_COLOR) && CanUseTopic(user)) + if(new_skin && HasAppearanceFlag(GLOB.species_by_name[pref.species], SPECIES_APPEARANCE_HAS_SKIN_COLOR) && CanUseTopic(user)) pref.skin_color = new_skin return TOPIC_REFRESH_UPDATE_PREVIEW @@ -466,7 +466,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O else new_f_style = input(user, "Choose your character's facial-hair style:", CHARACTER_PREFERENCE_INPUT_TITLE, pref.facial_hair_style) as null|anything in valid_facialhairstyles - mob_species = all_species[pref.species] + mob_species = GLOB.species_by_name[pref.species] if(new_f_style && CanUseTopic(user) && (new_f_style in mob_species.get_facial_hair_styles(pref.gender))) pref.facial_hair_style = new_f_style return TOPIC_REFRESH_UPDATE_PREVIEW @@ -508,7 +508,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O var/list/limb_selection_list = list("Left Leg","Right Leg","Left Arm","Right Arm","Left Foot","Right Foot","Left Hand","Right Hand","Full Body") // Full prosthetic bodies without a brain are borderline unkillable so make sure they have a brain to remove/destroy. - var/datum/species/current_species = all_species[pref.species] + var/singleton/species/current_species = GLOB.species_by_name[pref.species] if(current_species.spawn_flags & SPECIES_NO_FBP_CHARGEN) limb_selection_list -= "Full Body" else if(pref.organ_data[BP_CHEST] == "cyborg") @@ -588,7 +588,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O pref.rlimb_data[second_limb] = null if("Prosthesis") - var/datum/species/temp_species = pref.species ? all_species[pref.species] : all_species[SPECIES_HUMAN] + var/singleton/species/temp_species = pref.species ? GLOB.species_by_name[pref.species] : GLOB.species_by_name[SPECIES_HUMAN] var/tmp_species = temp_species.get_bodytype(user) var/list/usable_manufacturers = list() for(var/company in chargen_robolimbs) @@ -746,7 +746,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O ResetFacialHair() /datum/category_item/player_setup_item/proc/ResetHair() - var/datum/species/mob_species = all_species[pref.species] + var/singleton/species/mob_species = GLOB.species_by_name[pref.species] var/list/valid_hairstyles = mob_species.get_hair_styles() if(length(valid_hairstyles)) @@ -756,7 +756,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O pref.head_hair_style = GLOB.hair_styles_list["Bald"] /datum/category_item/player_setup_item/proc/ResetFacialHair() - var/datum/species/mob_species = all_species[pref.species] + var/singleton/species/mob_species = GLOB.species_by_name[pref.species] var/list/valid_facialhairstyles = mob_species.get_facial_hair_styles(pref.gender) if(length(valid_facialhairstyles)) @@ -766,7 +766,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O pref.facial_hair_style = GLOB.facial_hair_styles_list["Shaved"] /datum/category_item/player_setup_item/physical/body/proc/sanitize_organs() - var/datum/species/mob_species = all_species[pref.species] + var/singleton/species/mob_species = GLOB.species_by_name[pref.species] if(mob_species && mob_species.spawn_flags & SPECIES_NO_ROBOTIC_INTERNAL_ORGANS) for(var/name in pref.organ_data) var/status = pref.organ_data[name] diff --git a/code/modules/client/preference_setup/general/03_equipment.dm b/code/modules/client/preference_setup/general/03_equipment.dm index d59c575dc6dbf..1f0b29d3ef1fb 100644 --- a/code/modules/client/preference_setup/general/03_equipment.dm +++ b/code/modules/client/preference_setup/general/03_equipment.dm @@ -53,7 +53,7 @@ pref.all_underwear[WRC.name] = WRI.name break - var/datum/species/mob_species = all_species[pref.species] + var/singleton/species/mob_species = GLOB.species_by_name[pref.species] if(!(mob_species && mob_species.appearance_flags & SPECIES_APPEARANCE_HAS_UNDERWEAR)) pref.all_underwear.Cut() diff --git a/code/modules/client/preference_setup/laws/laws_pref.dm b/code/modules/client/preference_setup/laws/laws_pref.dm index 7577f8a42b2ce..71dbb5660e6b9 100644 --- a/code/modules/client/preference_setup/laws/laws_pref.dm +++ b/code/modules/client/preference_setup/laws/laws_pref.dm @@ -25,7 +25,7 @@ /datum/category_item/player_setup_item/law_pref/sanitize_character() if(!istype(pref.laws)) pref.laws = list() - var/datum/species/species = all_species[pref.species] + var/singleton/species/species = GLOB.species_by_name[pref.species] if(!(species && species.has_organ[BP_POSIBRAIN])) pref.is_shackled = initial(pref.is_shackled) else @@ -33,7 +33,7 @@ /datum/category_item/player_setup_item/law_pref/content() . = list() - var/datum/species/species = all_species[pref.species] + var/singleton/species/species = GLOB.species_by_name[pref.species] if(!(species && species.has_organ[BP_POSIBRAIN])) . += "Your Species Has No Laws
" diff --git a/code/modules/client/preference_setup/loadout/loadout.dm b/code/modules/client/preference_setup/loadout/loadout.dm index 4cbdf4528dfac..9f2b0b27449b9 100644 --- a/code/modules/client/preference_setup/loadout/loadout.dm +++ b/code/modules/client/preference_setup/loadout/loadout.dm @@ -240,7 +240,7 @@ var/global/list/gear_datums = list() entry += "[english_list(skill_checks)]" if (allowed && G.allowed_traits) - var/datum/species/picked_species = all_species[pref.species] + var/singleton/species/picked_species = GLOB.species_by_name[pref.species] var/list/species_traits = picked_species.traits var/trait_checks = list() entry += "
" diff --git a/code/modules/client/preference_setup/occupation/occupation.dm b/code/modules/client/preference_setup/occupation/occupation.dm index f4f0b37effdcd..0e93effbc8bd5 100644 --- a/code/modules/client/preference_setup/occupation/occupation.dm +++ b/code/modules/client/preference_setup/occupation/occupation.dm @@ -81,7 +81,7 @@ if(!SSmapping || !SSjobs.job_lists_by_map_name) return - var/datum/species/S = preference_species() + var/singleton/species/S = preference_species() . = list() . += "" . += "" @@ -264,7 +264,7 @@ if(LAZYLEN(removing_ranks)) pref.ranks -= removing_ranks - var/datum/species/S = preference_species() + var/singleton/species/S = preference_species() for(var/job_name in SSjobs.titles_to_datums) var/datum/job/job = SSjobs.get_by_title(job_name) @@ -333,7 +333,7 @@ else if(href_list["char_branch"]) var/datum/job/job = locate(href_list["checking_job"]) if(istype(job)) - var/datum/species/S = preference_species() + var/singleton/species/S = preference_species() var/list/options = job.allowed_branches ? job.get_branch_rank(S) : GLOB.mil_branches.spawn_branches(S) var/choice = input(user, "Choose your branch of service.", CHARACTER_PREFERENCE_INPUT_TITLE) as null|anything in options if(choice && CanUseTopic(user) && GLOB.mil_branches.is_spawn_branch(choice, S)) @@ -348,7 +348,7 @@ var/datum/job/job = locate(href_list["checking_job"]) if(istype(job)) var/datum/mil_branch/branch = GLOB.mil_branches.get_branch(pref.branches[job.title]) - var/datum/species/S = preference_species() + var/singleton/species/S = preference_species() var/list/branch_rank = job.allowed_branches ? job.get_branch_rank(S) : GLOB.mil_branches.spawn_branches(S) var/list/options = branch_rank[branch.name] || GLOB.mil_branches.spawn_ranks(branch.name, S) var/choice = input(user, "Choose your rank.", CHARACTER_PREFERENCE_INPUT_TITLE) as null|anything in options diff --git a/code/modules/client/preference_setup/preference_setup.dm b/code/modules/client/preference_setup/preference_setup.dm index 09344a28fcf70..7039b4f7a7025 100644 --- a/code/modules/client/preference_setup/preference_setup.dm +++ b/code/modules/client/preference_setup/preference_setup.dm @@ -258,4 +258,4 @@ var/global/const/CHARACTER_PREFERENCE_INPUT_TITLE = "Character Preference" return pref.client.mob /datum/category_item/player_setup_item/proc/preference_species() - return all_species[pref.species] || all_species[SPECIES_HUMAN] + return GLOB.species_by_name[pref.species] || GLOB.species_by_name[SPECIES_HUMAN] diff --git a/code/modules/clothing/masks/miscellaneous.dm b/code/modules/clothing/masks/miscellaneous.dm index 5e007ebaef107..26c2cee53377a 100644 --- a/code/modules/clothing/masks/miscellaneous.dm +++ b/code/modules/clothing/masks/miscellaneous.dm @@ -207,7 +207,7 @@ /obj/item/clothing/mask/rubber/species/New() ..() visible_name = species - var/datum/species/S = all_species[species] + var/singleton/species/S = GLOB.species_by_name[species] if(istype(S)) var/singleton/cultural_info/C = SSculture.get_culture(S.default_cultural_info[TAG_CULTURE]) if(istype(C)) diff --git a/code/modules/codex/categories/category_species.dm b/code/modules/codex/categories/category_species.dm index 51b3efa04ebd7..875b95c20cba2 100644 --- a/code/modules/codex/categories/category_species.dm +++ b/code/modules/codex/categories/category_species.dm @@ -3,8 +3,8 @@ desc = "Sapient species encountered in known space." /datum/codex_category/species/Initialize() - for(var/thing in all_species) - var/datum/species/species = all_species[thing] + for(var/thing in GLOB.species_by_name) + var/singleton/species/species = GLOB.species_by_name[thing] if(!species.hidden_from_codex) var/datum/codex_entry/entry = new(_display_name = "[species.name] (species)") entry.lore_text = species.codex_description diff --git a/code/modules/emotes/definitions/_species.dm b/code/modules/emotes/definitions/_species.dm index edc3bd3b375dc..99432027a1e72 100644 --- a/code/modules/emotes/definitions/_species.dm +++ b/code/modules/emotes/definitions/_species.dm @@ -8,14 +8,14 @@ usable_emotes = sortAssoc(usable_emotes) // Specific defines follow. -/datum/species/slime/default_emotes = list( +/singleton/species/slime/default_emotes = list( /singleton/emote/visible/bounce, /singleton/emote/visible/jiggle, /singleton/emote/visible/lightup, /singleton/emote/visible/vibrate ) -/datum/species/unathi/default_emotes = list( +/singleton/species/unathi/default_emotes = list( /singleton/emote/human/swish, /singleton/emote/human/wag, /singleton/emote/human/sway, @@ -26,7 +26,7 @@ /singleton/emote/audible/lizard_bellow ) -/datum/species/unathi/yeosa/default_emotes = list( +/singleton/species/unathi/yeosa/default_emotes = list( /singleton/emote/human/swish, /singleton/emote/human/wag, /singleton/emote/human/sway, @@ -38,22 +38,22 @@ /singleton/emote/audible/lizard_squeal ) -/datum/species/nabber/default_emotes = list( +/singleton/species/nabber/default_emotes = list( /singleton/emote/audible/bug_hiss, /singleton/emote/audible/bug_buzz, /singleton/emote/audible/bug_chitter ) -/datum/species/adherent/default_emotes = list( +/singleton/species/adherent/default_emotes = list( /singleton/emote/audible/adherent_chime, /singleton/emote/audible/adherent_ding ) -/datum/species/vox/default_emotes = list( +/singleton/species/vox/default_emotes = list( /singleton/emote/audible/vox_shriek ) -/datum/species/diona/default_emotes = list( +/singleton/species/diona/default_emotes = list( /singleton/emote/audible/chirp, /singleton/emote/audible/multichirp ) diff --git a/code/modules/emotes/skrell.dm b/code/modules/emotes/skrell.dm index 8cac470d23532..c7959669868bb 100644 --- a/code/modules/emotes/skrell.dm +++ b/code/modules/emotes/skrell.dm @@ -1,4 +1,4 @@ -/datum/species/skrell/default_emotes = list( +/singleton/species/skrell/default_emotes = list( /singleton/emote/audible/skrell_anger, /singleton/emote/audible/skrell_anger1, /singleton/emote/audible/skrell_anger2, diff --git a/code/modules/events/ion_storm.dm b/code/modules/events/ion_storm.dm index 965c584e71aef..49aedfc5a8fd2 100644 --- a/code/modules/events/ion_storm.dm +++ b/code/modules/events/ion_storm.dm @@ -142,8 +142,8 @@ /datum/event/ionstorm/proc/get_random_species_name(default_if_none = "Humans") var/list/species = list() - for(var/S in typesof(/datum/species)) - var/datum/species/specimen = S + for(var/S in typesof(/singleton/species)) + var/singleton/species/specimen = S if(initial(specimen.spawn_flags) & SPECIES_CAN_JOIN) species += initial(specimen.name_plural) diff --git a/code/modules/ghosttrap/trap.dm b/code/modules/ghosttrap/trap.dm index 99d0bbc68fdb5..e98f5c798dfe3 100644 --- a/code/modules/ghosttrap/trap.dm +++ b/code/modules/ghosttrap/trap.dm @@ -30,7 +30,7 @@ var/global/list/ghost_traps var/can_set_own_name = TRUE var/list/request_timeouts - var/datum/species/species_whitelist // If defined, this is the species whitelist required to join + var/singleton/species/species_whitelist // If defined, this is the species whitelist required to join /datum/ghosttrap/New() request_timeouts = list() @@ -64,7 +64,7 @@ var/global/list/ghost_traps if (!assess_whitelist(candidate)) if (feedback) - var/datum/species/S = new species_whitelist() + var/singleton/species/S = new species_whitelist() to_chat(candidate, "You require \a [S] whitelist to play as \a [object].") return FALSE return TRUE @@ -73,7 +73,7 @@ var/global/list/ghost_traps . = TRUE if (!species_whitelist) return - var/datum/species/S = new species_whitelist() + var/singleton/species/S = new species_whitelist() if (!is_alien_whitelisted(candidate, S)) . = FALSE @@ -180,7 +180,7 @@ var/global/list/ghost_traps ban_checks = list("Dionaea") ghost_trap_message = "They are occupying a living plant now." ghost_trap_role = "Plant" - species_whitelist = /datum/species/diona + species_whitelist = /singleton/species/diona /datum/ghosttrap/plant/welcome_candidate(mob/target) to_chat(target, SPAN_CLASS("alium", "You awaken slowly, stirring into sluggish motion as the air caresses you.")) diff --git a/code/modules/mob/living/autohiss.dm b/code/modules/mob/living/autohiss.dm index fb7a1e60c91c4..25e5f96400726 100644 --- a/code/modules/mob/living/autohiss.dm +++ b/code/modules/mob/living/autohiss.dm @@ -9,22 +9,22 @@ return message return species.handle_autohiss(message, L, get_preference_value(/datum/client_preference/autohiss)) -/datum/species/var/list/autohiss_basic_map = null -/datum/species/var/list/autohiss_extra_map = null -/datum/species/var/list/autohiss_exempt = null +/singleton/species/var/list/autohiss_basic_map = null +/singleton/species/var/list/autohiss_extra_map = null +/singleton/species/var/list/autohiss_exempt = null -/datum/species/unathi/autohiss_basic_map = list( +/singleton/species/unathi/autohiss_basic_map = list( "s" = list("ss", "sss", "ssss") ) -/datum/species/unathi/autohiss_extra_map = list( +/singleton/species/unathi/autohiss_extra_map = list( "x" = list("ks", "kss", "ksss") ) -/datum/species/unathi/autohiss_exempt = list( +/singleton/species/unathi/autohiss_exempt = list( LANGUAGE_UNATHI_SINTA, LANGUAGE_UNATHI_YEOSA ) -/datum/species/proc/handle_autohiss(message, datum/language/lang, mode) +/singleton/species/proc/handle_autohiss(message, datum/language/lang, mode) if(!autohiss_basic_map) return message if(lang.flags & NO_STUTTER) // Currently prevents EAL, Sign language, and emotes from autohissing diff --git a/code/modules/mob/living/carbon/alien/diona/_nymph.dm b/code/modules/mob/living/carbon/alien/diona/_nymph.dm index 0a297506689bd..1c782264f6964 100644 --- a/code/modules/mob/living/carbon/alien/diona/_nymph.dm +++ b/code/modules/mob/living/carbon/alien/diona/_nymph.dm @@ -66,7 +66,7 @@ /mob/living/carbon/alien/diona/Initialize(mapload, flower_chance = 15) - species = all_species[SPECIES_DIONA] + species = GLOB.species_by_name[SPECIES_DIONA] add_language(LANGUAGE_ROOTGLOBAL) add_language(LANGUAGE_HUMAN_EURO, 0) diff --git a/code/modules/mob/living/carbon/alien/diona/gestalt/gestalt_verbs.dm b/code/modules/mob/living/carbon/alien/diona/gestalt/gestalt_verbs.dm index 8d0ca64476d88..c5d6e0e2a4ac6 100644 --- a/code/modules/mob/living/carbon/alien/diona/gestalt/gestalt_verbs.dm +++ b/code/modules/mob/living/carbon/alien/diona/gestalt/gestalt_verbs.dm @@ -4,7 +4,7 @@ set category = "IC" set src = usr.loc - if(!is_alien_whitelisted(usr, all_species[SPECIES_DIONA])) + if(!is_alien_whitelisted(usr, GLOB.species_by_name[SPECIES_DIONA])) to_chat(usr, SPAN_WARNING("You are not whitelisted for control of more complex forms of gestalt.")) return diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index 58aa62af79636..c79273c5a3c13 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -1,7 +1,7 @@ /mob/living/carbon gender = MALE pronouns = PRONOUNS_THEY_THEM - var/datum/species/species //Contains icon generation and language information, set during New(). + var/singleton/species/species //Contains icon generation and language information, set during New(). var/life_tick = 0 // The amount of life ticks that have processed on this mob. var/obj/item/handcuffed = null //Whether or not the mob is handcuffed diff --git a/code/modules/mob/living/carbon/human/appearance.dm b/code/modules/mob/living/carbon/human/appearance.dm index 315e5896f1b7e..c225e6ba44406 100644 --- a/code/modules/mob/living/carbon/human/appearance.dm +++ b/code/modules/mob/living/carbon/human/appearance.dm @@ -9,7 +9,7 @@ if(species == new_species) return - if(!(new_species in all_species)) + if(!(new_species in GLOB.species_by_name)) return set_species(new_species) @@ -165,7 +165,7 @@ /mob/living/carbon/human/proc/generate_valid_species(appearance_flags, list/allow, list/deny) var/list/result = list() - for (var/name in all_species) + for (var/name in GLOB.species_by_name) if (name in deny) continue if (!appearance_flags) @@ -174,7 +174,7 @@ if (name in allow) result += name continue - var/datum/species/species = all_species[name] + var/singleton/species/species = GLOB.species_by_name[name] if (!(appearance_flags & APPEARANCE_SKIP_RESTRICTED_CHECK)) if (species.spawn_flags & SPECIES_IS_RESTRICTED) continue diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 74e539ee15991..8a8a59262f81d 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1185,7 +1185,7 @@ new_species = dna.species // No more invisible screaming wheelchairs because of set_species() typos. - if(!all_species[new_species]) + if(!GLOB.species_by_name[new_species]) new_species = SPECIES_HUMAN if(dna) dna.species = new_species @@ -1200,7 +1200,7 @@ species.remove_inherent_verbs(src) holder_type = null - species = all_species[new_species] + species = GLOB.species_by_name[new_species] species.handle_pre_spawn(src) if(species.grab_type) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 6c76dec5dc012..b7c383d03c596 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -213,7 +213,7 @@ else src.fire.icon_state = "fire1" if(oxygen && environment) - var/datum/species/species = all_species[SPECIES_HUMAN] + var/singleton/species/species = GLOB.species_by_name[SPECIES_HUMAN] if(environment.gas[species.breath_type] >= species.breath_pressure) src.oxygen.icon_state = "oxy0" for(var/gas in species.poison_types) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index c368f2c31caca..2f62e835d3a7d 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -37,11 +37,11 @@ /// Determine if the mob is the supplied species by text name, species path, or species instance name -/mob/proc/is_species(datum/species/S) +/mob/proc/is_species(singleton/species/S) return FALSE -/mob/living/carbon/is_species(datum/species/S) +/mob/living/carbon/is_species(singleton/species/S) if (!S || !species) return FALSE if (istext(S)) return species.name == S if (ispath(S)) return species.name == initial(S.name) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index e78034a215603..f636dde46c3e9 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -195,7 +195,7 @@ if(!SSjobs.check_general_join_blockers(src, job)) return FALSE - var/datum/species/S = all_species[client.prefs.species] + var/singleton/species/S = GLOB.species_by_name[client.prefs.species] if(!check_species_allowed(S)) return 0 @@ -458,9 +458,9 @@ var/mob/living/carbon/human/new_character - var/datum/species/chosen_species + var/singleton/species/chosen_species if(client.prefs.species) - chosen_species = all_species[client.prefs.species] + chosen_species = GLOB.species_by_name[client.prefs.species] if(!spawn_turf) var/datum/job/job = SSjobs.get_by_title(mind.assigned_role) @@ -525,7 +525,7 @@ close_browser(src, "window=latechoices") //closes late choices window panel.close() -/mob/new_player/proc/check_species_allowed(datum/species/S, show_alert=1) +/mob/new_player/proc/check_species_allowed(singleton/species/S, show_alert=1) if(!S.is_available_for_join() && !has_admin_rights()) if(show_alert) to_chat(src, alert("Your current species, [client.prefs.species], is not available for play.")) @@ -537,9 +537,9 @@ return 1 /mob/new_player/get_species() - var/datum/species/chosen_species + var/singleton/species/chosen_species if(client.prefs.species) - chosen_species = all_species[client.prefs.species] + chosen_species = GLOB.species_by_name[client.prefs.species] if(!chosen_species || !check_species_allowed(chosen_species, 0)) return SPECIES_HUMAN diff --git a/code/modules/mob/new_player/preferences_setup.dm b/code/modules/mob/new_player/preferences_setup.dm index ee0f98432208f..4e82bc444e4cd 100644 --- a/code/modules/mob/new_player/preferences_setup.dm +++ b/code/modules/mob/new_player/preferences_setup.dm @@ -1,8 +1,9 @@ #define ASSIGN_LIST_TO_COLORS(L, R, G, B) if(L) { R = L[1]; G = L[2]; B = L[3]; } /datum/preferences/proc/randomize_appearance_and_body_for(mob/living/carbon/human/H) - var/datum/species/current_species = all_species[species] - if(!current_species) current_species = all_species[SPECIES_HUMAN] + var/singleton/species/current_species = GLOB.species_by_name[species] + if (!current_species) + current_species = GLOB.species_by_name[SPECIES_HUMAN] gender = pick(current_species.genders) pronouns = pick(current_species.pronouns) diff --git a/code/modules/organs/internal/species/nabber.dm b/code/modules/organs/internal/species/nabber.dm index 78ffd57f81edb..c5aa505ca5fd4 100644 --- a/code/modules/organs/internal/species/nabber.dm +++ b/code/modules/organs/internal/species/nabber.dm @@ -193,12 +193,12 @@ if(prob(15)) to_chat(owner, SPAN_WARNING("You're almost unable to move!")) if(!owner.pulling_punches) - var/datum/species/nabber/nab = species + var/singleton/species/nabber/nab = species nab.arm_swap(owner, TRUE) if(-(INFINITY) to BLOOD_VOLUME_SURVIVE) lowblood_tally = 10 if(prob(30) && !owner.pulling_punches) - var/datum/species/nabber/nab = species + var/singleton/species/nabber/nab = species nab.arm_swap(owner, TRUE) if(prob(10)) to_chat(owner, SPAN_WARNING("Your body is barely functioning and is starting to shut down.")) diff --git a/code/modules/organs/internal/species/vox.dm b/code/modules/organs/internal/species/vox.dm index 849dfc67d1679..bbafd5d7486da 100644 --- a/code/modules/organs/internal/species/vox.dm +++ b/code/modules/organs/internal/species/vox.dm @@ -245,7 +245,7 @@ owner.languages = languages.Copy() to_chat(owner, SPAN_NOTICE("Consciousness slowly creeps over you as your new body awakens.")) -/datum/species/vox/handle_death(mob/living/carbon/human/H) +/singleton/species/vox/handle_death(mob/living/carbon/human/H) ..() var/obj/item/organ/internal/voxstack/stack = H.get_organ(BP_STACK) if (stack) diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index bf339ec287b9f..c1e80f908cafb 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -18,7 +18,7 @@ var/global/list/organ_cache = list() // Reference data. var/mob/living/carbon/human/owner // Current mob owning the organ. var/datum/dna/dna // Original DNA. - var/datum/species/species // Original species. + var/singleton/species/species // Original species. // Damage vars. var/damage = 0 // Current damage to the organ @@ -70,7 +70,7 @@ var/global/list/organ_cache = list() if (given_dna) set_dna(given_dna) if (!species) - species = all_species[SPECIES_HUMAN] + species = GLOB.species_by_name[SPECIES_HUMAN] species.resize_organ(src) create_reagents(5 * (w_class-1)**2) @@ -85,7 +85,7 @@ var/global/list/organ_cache = list() blood_DNA = list() blood_DNA.Cut() blood_DNA[dna.unique_enzymes] = dna.b_type - species = all_species[dna.species] + species = GLOB.species_by_name[dna.species] if (!species) crash_with("Invalid DNA species. Expected a valid species name as string, was: [log_info_line(dna.species)]") diff --git a/code/modules/overmap/exoplanets/planet_types/chlorine.dm b/code/modules/overmap/exoplanets/planet_types/chlorine.dm index b0386b61c91d5..780781bf50024 100644 --- a/code/modules/overmap/exoplanets/planet_types/chlorine.dm +++ b/code/modules/overmap/exoplanets/planet_types/chlorine.dm @@ -26,7 +26,7 @@ atmosphere = atmosphere.remove(chlor_moles ) atmosphere.adjust_gas(GAS_CHLORINE, chlor_moles ) - var/datum/species/H = all_species[SPECIES_HUMAN] + var/singleton/species/H = GLOB.species_by_name[SPECIES_HUMAN] var/generator/new_temp = generator("num", H.cold_level_1 + 40, H.heat_level_1 + 10, UNIFORM_RAND) atmosphere.temperature = new_temp.Rand() atmosphere.update_values() diff --git a/code/modules/overmap/exoplanets/planet_types/desert.dm b/code/modules/overmap/exoplanets/planet_types/desert.dm index 38fe8e2253314..864542de8c03d 100644 --- a/code/modules/overmap/exoplanets/planet_types/desert.dm +++ b/code/modules/overmap/exoplanets/planet_types/desert.dm @@ -19,7 +19,7 @@ /obj/overmap/visitable/sector/exoplanet/desert/generate_atmosphere() ..() - var/datum/species/H = all_species[SPECIES_HUMAN] + var/singleton/species/H = GLOB.species_by_name[SPECIES_HUMAN] var/generator/new_temp = generator("num", H.heat_level_1, 2 * H.heat_level_1, NORMAL_RAND) atmosphere.temperature = new_temp.Rand() atmosphere.update_values() diff --git a/code/modules/overmap/exoplanets/planet_types/grass.dm b/code/modules/overmap/exoplanets/planet_types/grass.dm index 7b5c44956f03c..3828c3d75f723 100644 --- a/code/modules/overmap/exoplanets/planet_types/grass.dm +++ b/code/modules/overmap/exoplanets/planet_types/grass.dm @@ -19,7 +19,7 @@ /obj/overmap/visitable/sector/exoplanet/grass/generate_atmosphere() ..() - var/datum/species/H = all_species[SPECIES_HUMAN] + var/singleton/species/H = GLOB.species_by_name[SPECIES_HUMAN] var/generator/new_temp = generator("num", T0C, H.heat_level_1 - 10, UNIFORM_RAND) atmosphere.temperature = new_temp.Rand() atmosphere.update_values() @@ -106,7 +106,7 @@ /obj/overmap/visitable/sector/exoplanet/grass/terraformed/generate_atmosphere() ..() - var/datum/species/H = all_species[SPECIES_HUMAN] + var/singleton/species/H = GLOB.species_by_name[SPECIES_HUMAN] var/generator/new_temp = generator("num", T20C, H.heat_level_1 - 15) atmosphere.temperature = new_temp.Rand() atmosphere.update_values() diff --git a/code/modules/overmap/exoplanets/planet_types/snow.dm b/code/modules/overmap/exoplanets/planet_types/snow.dm index 5ba51855824b0..85b2024c0c44f 100644 --- a/code/modules/overmap/exoplanets/planet_types/snow.dm +++ b/code/modules/overmap/exoplanets/planet_types/snow.dm @@ -18,7 +18,7 @@ /obj/overmap/visitable/sector/exoplanet/snow/generate_atmosphere() ..() - var/datum/species/H = all_species[SPECIES_HUMAN] + var/singleton/species/H = GLOB.species_by_name[SPECIES_HUMAN] var/generator/new_temp = generator("num", H.cold_level_1 - 50, H.cold_level_3, NORMAL_RAND) atmosphere.temperature = new_temp.Rand() atmosphere.update_values() diff --git a/code/modules/overmap/exoplanets/planet_types/volcanic.dm b/code/modules/overmap/exoplanets/planet_types/volcanic.dm index 159c74b37748e..472e94ee72f63 100644 --- a/code/modules/overmap/exoplanets/planet_types/volcanic.dm +++ b/code/modules/overmap/exoplanets/planet_types/volcanic.dm @@ -21,7 +21,7 @@ /obj/overmap/visitable/sector/exoplanet/volcanic/generate_atmosphere() ..() - var/datum/species/H = all_species[SPECIES_HUMAN] + var/singleton/species/H = GLOB.species_by_name[SPECIES_HUMAN] var/xtreme = H.heat_level_2 + (rand(1,3) * H.heat_level_2) var/generator/new_temp = generator("num", H.heat_level_2, xtreme, UNIFORM_RAND) atmosphere.temperature = new_temp.Rand() diff --git a/code/modules/projectiles/projectile/change.dm b/code/modules/projectiles/projectile/change.dm index b94552b64806e..d866857879a6c 100644 --- a/code/modules/projectiles/projectile/change.dm +++ b/code/modules/projectiles/projectile/change.dm @@ -30,7 +30,7 @@ var/mob/living/new_mob var/options = list("robot", "slime") - for(var/t in all_species) + for(var/t in GLOB.species_by_name) options += t if(ishuman(M)) var/mob/living/carbon/human/H = M diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm index fdd91d6c6ee5c..9e3bc5aec6407 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm @@ -1058,11 +1058,11 @@ return var/obj/item/organ/external/O = pick(meatchunks) to_chat(H, SPAN_DANGER("Your [O.name]'s flesh mutates rapidly!")) - if(!wrapped_species_by_ref["\ref[H]"]) - wrapped_species_by_ref["\ref[H]"] = H.species.name + if(!GLOB.mob_ref_to_species_name[any2ref(H)]) + GLOB.mob_ref_to_species_name[any2ref(H)] = H.species.name meatchunks = list(O) | O.children for(var/obj/item/organ/external/E in meatchunks) - E.species = all_species[SPECIES_PROMETHEAN] + E.species = GLOB.species_by_name[SPECIES_PROMETHEAN] E.skin_tone = null E.s_col = ReadRGB("#05ff9b") E.s_col_blend = ICON_ADD diff --git a/code/modules/reagents/reagent_containers/ivbag.dm b/code/modules/reagents/reagent_containers/ivbag.dm index 2a5b2836d15b0..0bf8027a90aef 100644 --- a/code/modules/reagents/reagent_containers/ivbag.dm +++ b/code/modules/reagents/reagent_containers/ivbag.dm @@ -282,7 +282,7 @@ if (!(blood_type in GLOB.blood_types)) crash_with({"Invalid blood_type supplied to [src]- "[blood_type]""}) return INITIALIZE_HINT_QDEL - var/datum/species/species = all_species[blood_species] + var/singleton/species/species = GLOB.species_by_name[blood_species] if (!species) crash_with({"Invalid blood_species supplied to [src]- "[blood_species]""}) return INITIALIZE_HINT_QDEL diff --git a/code/modules/species/outsider/random.dm b/code/modules/species/outsider/random.dm index 53a5e031dc38d..99d3a8e05ec4f 100644 --- a/code/modules/species/outsider/random.dm +++ b/code/modules/species/outsider/random.dm @@ -1,4 +1,4 @@ -/datum/species/alium +/singleton/species/alium name = SPECIES_ALIEN name_plural = "Humanoids" description = "Some alien humanoid species, unknown to humanity. How exciting." @@ -28,7 +28,7 @@ /singleton/emote/exertion/biological/pant ) -/datum/species/alium/New() +/singleton/species/alium/New() //Coloring blood_color = RANDOM_RGB flesh_color = RANDOM_RGB @@ -96,10 +96,10 @@ ..() -/datum/species/alium/get_bodytype(mob/living/carbon/human/H) +/singleton/species/alium/get_bodytype(mob/living/carbon/human/H) return SPECIES_HUMAN -/datum/species/alium/proc/adapt_to_atmosphere(datum/gas_mixture/atmosphere) +/singleton/species/alium/proc/adapt_to_atmosphere(datum/gas_mixture/atmosphere) var/temp_comfort_shift = atmosphere.temperature - body_temperature cold_level_1 += temp_comfort_shift diff --git a/code/modules/species/outsider/shadow.dm b/code/modules/species/outsider/shadow.dm index 98a3dfaa9f8a7..d155e6ce25966 100644 --- a/code/modules/species/outsider/shadow.dm +++ b/code/modules/species/outsider/shadow.dm @@ -1,4 +1,4 @@ -/datum/species/starlight/shadow +/singleton/species/starlight/shadow name = "Shadow" name_plural = "shadows" description = "A being of pure darkness, hates the light and all that comes with it." @@ -23,7 +23,7 @@ species_flags = SPECIES_FLAG_NO_SCAN | SPECIES_FLAG_NO_SLIP | SPECIES_FLAG_NO_POISON | SPECIES_FLAG_NO_EMBED -/datum/species/starlight/shadow/handle_environment_special(mob/living/carbon/human/H) +/singleton/species/starlight/shadow/handle_environment_special(mob/living/carbon/human/H) if(H.InStasis() || H.stat == DEAD || H.isSynthetic()) return var/light_amount = 0 diff --git a/code/modules/species/outsider/starlight.dm b/code/modules/species/outsider/starlight.dm index 6259568a7195c..dae4df2676f61 100644 --- a/code/modules/species/outsider/starlight.dm +++ b/code/modules/species/outsider/starlight.dm @@ -1,4 +1,4 @@ -/datum/species/starlight +/singleton/species/starlight name = "Starlight Base" preview_icon = null @@ -28,15 +28,15 @@ TAG_CULTURE = CULTURE_STARLIGHT ) -/datum/species/starlight/handle_death_check(mob/living/carbon/human/H) +/singleton/species/starlight/handle_death_check(mob/living/carbon/human/H) if(H.health == 0) return TRUE return FALSE -/datum/species/starlight/handle_death(mob/living/carbon/human/H) +/singleton/species/starlight/handle_death(mob/living/carbon/human/H) addtimer(new Callback(H,/mob/proc/dust),0) -/datum/species/starlight/starborn +/singleton/species/starlight/starborn name = "Starborn" name_plural = "Starborn" icobase = 'icons/mob/human_races/species/starborn/body.dmi' @@ -81,13 +81,13 @@ /obj/aura/starborn ) -/datum/species/starlight/starborn/handle_death(mob/living/carbon/human/H) +/singleton/species/starlight/starborn/handle_death(mob/living/carbon/human/H) ..() var/turf/T = get_turf(H) new/obj/decal/cleanable/liquid_fuel(T, 20, TRUE) T.hotspot_expose(PHORON_MINIMUM_BURN_TEMPERATURE) -/datum/species/starlight/blueforged +/singleton/species/starlight/blueforged name = "Blueforged" name_plural = "Blueforged" icobase = 'icons/mob/human_races/species/blueforged/body.dmi' @@ -111,6 +111,6 @@ override_organ_types = list(BP_EYES = /obj/item/organ/internal/eyes/blueforged) -/datum/species/starlight/blueforged/handle_death(mob/living/carbon/human/H) +/singleton/species/starlight/blueforged/handle_death(mob/living/carbon/human/H) ..() new /obj/temporary(get_turf(H),11, 'icons/mob/mob.dmi', "liquify") diff --git a/code/modules/species/outsider/vox.dm b/code/modules/species/outsider/vox.dm index 7998903975c76..ef0fa377eb9be 100644 --- a/code/modules/species/outsider/vox.dm +++ b/code/modules/species/outsider/vox.dm @@ -1,4 +1,4 @@ -/datum/species/vox +/singleton/species/vox name = SPECIES_VOX name_plural = SPECIES_VOX icobase = 'icons/mob/human_races/species/vox/body.dmi' @@ -126,7 +126,7 @@ traits = list(/singleton/trait/general/nonpermeable_skin = TRAIT_LEVEL_EXISTS) -/datum/species/vox/equip_survival_gear(mob/living/carbon/human/H) +/singleton/species/vox/equip_survival_gear(mob/living/carbon/human/H) H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/vox(H), slot_wear_mask) if(istype(H.get_equipped_item(slot_back), /obj/item/storage/backpack)) @@ -138,7 +138,7 @@ H.equip_to_slot_or_del(new /obj/item/storage/box/vox(H), slot_r_hand) H.set_internals(H.back) -/datum/species/vox/disfigure_msg(mob/living/carbon/human/H) +/singleton/species/vox/disfigure_msg(mob/living/carbon/human/H) var/datum/pronouns/P = H.choose_from_pronouns() return "[SPAN_DANGER("[P.His] beak-segments are cracked and chipped! [P.He] [P.is] not even recognizable.")]\n" @@ -157,7 +157,7 @@ return if (allowed_role && user.mind?.special_role != allowed_role) return - if (user.species.name == SPECIES_VOX || !is_alien_whitelisted(user, all_species[SPECIES_VOX])) + if (user.species.name == SPECIES_VOX || !is_alien_whitelisted(user, GLOB.species_by_name[SPECIES_VOX])) return var/data = input(user, "Become Vox?", "Become Vox") as null | anything in list("No", "Yes") if (isnull(data) || data == "No") diff --git a/code/modules/species/outsider/zombie.dm b/code/modules/species/outsider/zombie.dm index 2d55dce769009..77ea41026b147 100644 --- a/code/modules/species/outsider/zombie.dm +++ b/code/modules/species/outsider/zombie.dm @@ -46,7 +46,7 @@ GLOBAL_LIST_INIT(zombie_species, list(\ //// Zombie Types -/datum/species/zombie +/singleton/species/zombie name = "Zombie" name_plural = "Zombies" blood_color = "#411111" @@ -74,7 +74,7 @@ GLOBAL_LIST_INIT(zombie_species, list(\ move_intents = list(/singleton/move_intent/zombie) var/heal_rate = 0.5 // Regen. -/datum/species/zombie/handle_post_spawn(mob/living/carbon/human/H) +/singleton/species/zombie/handle_post_spawn(mob/living/carbon/human/H) H.mutations |= MUTATION_CLUMSY H.mutations |= MUTATION_FERAL H.mutations |= mNobreath //Byond doesn't like adding them all in one OR statement :( @@ -117,7 +117,7 @@ GLOBAL_LIST_INIT(zombie_species, list(\ ..() -/datum/species/zombie/handle_environment_special(mob/living/carbon/human/H) +/singleton/species/zombie/handle_environment_special(mob/living/carbon/human/H) if (H.stat == CONSCIOUS) if (prob(5)) playsound(H.loc, 'sound/hallucinations/far_noise.ogg', 15, 1) @@ -152,14 +152,14 @@ GLOBAL_LIST_INIT(zombie_species, list(\ if (vuln > 0.10 && prob(8)) M.reagents.add_reagent(/datum/reagent/zombie, 0.5) // Infect 'em -/datum/species/zombie/handle_death(mob/living/carbon/human/H) +/singleton/species/zombie/handle_death(mob/living/carbon/human/H) playsound(H, 'sound/hallucinations/wail.ogg', 30, 1) return TRUE -/datum/species/zombie/get_blood_name() +/singleton/species/zombie/get_blood_name() return "decaying blood" -/datum/species/zombie/has_fine_manipulation(mob/living/carbon/human/H) +/singleton/species/zombie/has_fine_manipulation(mob/living/carbon/human/H) return (MUTATION_CLUMSY in H.mutations) ? FALSE : TRUE /singleton/move_intent/zombie @@ -468,7 +468,7 @@ GLOBAL_LIST_INIT(zombie_species, list(\ mind.special_role = ANTAG_ZOMBIE species.handle_pre_spawn(src) - species = all_species[SPECIES_ZOMBIE] + species = GLOB.species_by_name[SPECIES_ZOMBIE] species.handle_post_spawn(src) if(!(MUTATION_HUSK in mutations)) diff --git a/code/modules/species/species.dm b/code/modules/species/species.dm index 4114489ab8645..8c796c2fbf816 100644 --- a/code/modules/species/species.dm +++ b/code/modules/species/species.dm @@ -1,8 +1,21 @@ -/* - Datum-based species. Should make for much cleaner and easier to maintain race code. -*/ +GLOBAL_LIST_EMPTY(species_by_name) + +GLOBAL_LIST_INIT(playable_species, list( + SPECIES_HUMAN +)) + +GLOBAL_LIST_EMPTY(mob_ref_to_species_name) + +/hook/startup/proc/CreateSpeciesLists() + var/race_key = 1 + for (var/singleton/species/species as anything in GET_SINGLETON_SUBTYPE_LIST(/singleton/species)) + GLOB.species_by_name[species.name] = species + if (~species.spawn_flags & SPECIES_IS_RESTRICTED) + GLOB.playable_species += species.name + species.race_key = race_key++ + return TRUE -/datum/species +/singleton/species // Descriptors and strings. var/name @@ -308,7 +321,7 @@ The slots that you can use are found in items_clothing.dm and are the inventory you use the _str version of the slot. */ -/datum/species/New() +/singleton/species/New() if(!codex_description) codex_description = description @@ -375,7 +388,7 @@ The slots that you can use are found in items_clothing.dm and are the inventory var/obj/item/organ/limb_path = organ_data["path"] organ_data["descriptor"] = initial(limb_path.name) -/datum/species/proc/equip_survival_gear(mob/living/carbon/human/H,extendedtank = 1) +/singleton/species/proc/equip_survival_gear(mob/living/carbon/human/H,extendedtank = 1) if(istype(H.get_equipped_item(slot_back), /obj/item/storage/backpack)) if (extendedtank) H.equip_to_slot_or_del(new /obj/item/storage/box/engineer(H.back), slot_in_backpack) else H.equip_to_slot_or_del(new /obj/item/storage/box/survival(H.back), slot_in_backpack) @@ -383,7 +396,7 @@ The slots that you can use are found in items_clothing.dm and are the inventory if (extendedtank) H.equip_to_slot_or_del(new /obj/item/storage/box/engineer(H), slot_r_hand) else H.equip_to_slot_or_del(new /obj/item/storage/box/survival(H), slot_r_hand) -/datum/species/proc/create_organs(mob/living/carbon/human/H) //Handles creation of mob organs. +/singleton/species/proc/create_organs(mob/living/carbon/human/H) //Handles creation of mob organs. H.mob_size = mob_size for(var/obj/item/organ/organ in H.contents) @@ -423,7 +436,7 @@ The slots that you can use are found in items_clothing.dm and are the inventory post_organ_rejuvenate(O, H) H.sync_organ_dna() -/datum/species/proc/hug(mob/living/carbon/human/H, mob/living/target) +/singleton/species/proc/hug(mob/living/carbon/human/H, mob/living/target) var/t_him = "them" switch(target.gender) @@ -446,12 +459,12 @@ The slots that you can use are found in items_clothing.dm and are the inventory H.update_personal_goal(/datum/goal/achievement/givehug, TRUE) target.update_personal_goal(/datum/goal/achievement/gethug, TRUE) -/datum/species/proc/add_base_auras(mob/living/carbon/human/H) +/singleton/species/proc/add_base_auras(mob/living/carbon/human/H) if(base_auras) for(var/type in base_auras) H.add_aura(new type(H)) -/datum/species/proc/remove_base_auras(mob/living/carbon/human/H) +/singleton/species/proc/remove_base_auras(mob/living/carbon/human/H) if(base_auras) var/list/bcopy = base_auras.Copy() for(var/a in H.auras) @@ -461,19 +474,19 @@ The slots that you can use are found in items_clothing.dm and are the inventory H.remove_aura(A) qdel(A) -/datum/species/proc/remove_inherent_verbs(mob/living/carbon/human/H) +/singleton/species/proc/remove_inherent_verbs(mob/living/carbon/human/H) if(inherent_verbs) for(var/verb_path in inherent_verbs) H.verbs -= verb_path return -/datum/species/proc/add_inherent_verbs(mob/living/carbon/human/H) +/singleton/species/proc/add_inherent_verbs(mob/living/carbon/human/H) if(inherent_verbs) for(var/verb_path in inherent_verbs) H.verbs |= verb_path return -/datum/species/proc/handle_post_spawn(mob/living/carbon/human/H) //Handles anything not already covered by basic species assignment. +/singleton/species/proc/handle_post_spawn(mob/living/carbon/human/H) //Handles anything not already covered by basic species assignment. H.icon_width = icon_width H.icon_height = icon_height add_inherent_verbs(H) @@ -484,19 +497,19 @@ The slots that you can use are found in items_clothing.dm and are the inventory H.pass_flags = pass_flags handle_limbs_setup(H) -/datum/species/proc/handle_pre_spawn(mob/living/carbon/human/H) +/singleton/species/proc/handle_pre_spawn(mob/living/carbon/human/H) // Changing species can change NPC behaviour, so delete the holder if there is one if (H.ai_holder && istype(H.ai_holder, /datum)) GLOB.stat_set_event.unregister(H, H.ai_holder, /datum/ai_holder/proc/holder_stat_change) QDEL_NULL(H.ai_holder) -/datum/species/proc/handle_death(mob/living/carbon/human/H) //Handles any species-specific death events (such as dionaea nymph spawns). +/singleton/species/proc/handle_death(mob/living/carbon/human/H) //Handles any species-specific death events (such as dionaea nymph spawns). return -/datum/species/proc/handle_new_grab(mob/living/carbon/human/H, obj/item/grab/G) +/singleton/species/proc/handle_new_grab(mob/living/carbon/human/H, obj/item/grab/G) return -/datum/species/proc/handle_sleeping(mob/living/carbon/human/H) +/singleton/species/proc/handle_sleeping(mob/living/carbon/human/H) if(prob(2) && !H.failed_last_breath && !H.isSynthetic()) if(!H.paralysis) H.emote("snore") @@ -504,37 +517,37 @@ The slots that you can use are found in items_clothing.dm and are the inventory H.emote("groan") // Only used for alien plasma weeds atm, but could be used for Dionaea later. -/datum/species/proc/handle_environment_special(mob/living/carbon/human/H) +/singleton/species/proc/handle_environment_special(mob/living/carbon/human/H) return -/datum/species/proc/handle_movement_delay_special(mob/living/carbon/human/H) +/singleton/species/proc/handle_movement_delay_special(mob/living/carbon/human/H) return 0 // Used to update alien icons for aliens. -/datum/species/proc/handle_login_special(mob/living/carbon/human/H) +/singleton/species/proc/handle_login_special(mob/living/carbon/human/H) return // As above. -/datum/species/proc/handle_logout_special(mob/living/carbon/human/H) +/singleton/species/proc/handle_logout_special(mob/living/carbon/human/H) return // Builds the HUD using species-specific icons and usable slots. -/datum/species/proc/build_hud(mob/living/carbon/human/H) +/singleton/species/proc/build_hud(mob/living/carbon/human/H) return //Used by xenos understanding larvae and dionaea understanding nymphs. -/datum/species/proc/can_understand(mob/other) +/singleton/species/proc/can_understand(mob/other) return -/datum/species/proc/can_overcome_gravity(mob/living/carbon/human/H) +/singleton/species/proc/can_overcome_gravity(mob/living/carbon/human/H) return FALSE // Used for any extra behaviour when falling and to see if a species will fall at all. -/datum/species/proc/can_fall(mob/living/carbon/human/H) +/singleton/species/proc/can_fall(mob/living/carbon/human/H) return TRUE //Used for swimming -/datum/species/proc/can_float(mob/living/carbon/human/H) +/singleton/species/proc/can_float(mob/living/carbon/human/H) if(!H.is_physically_disabled()) if(H.skill_check(SKILL_HAULING, SKILL_BASIC)) if(H.encumbrance() < 1) @@ -542,11 +555,11 @@ The slots that you can use are found in items_clothing.dm and are the inventory return FALSE // Used to override normal fall behaviour. Use only when the species does fall down a level. -/datum/species/proc/handle_fall_special(mob/living/carbon/human/H, turf/landing) +/singleton/species/proc/handle_fall_special(mob/living/carbon/human/H, turf/landing) return FALSE // Called when using the shredding behavior. -/datum/species/proc/can_shred(mob/living/carbon/human/H, ignore_intent, ignore_antag) +/singleton/species/proc/can_shred(mob/living/carbon/human/H, ignore_intent, ignore_antag) if((!ignore_intent && H.a_intent != I_HURT) || H.pulling_punches) return 0 @@ -562,7 +575,7 @@ The slots that you can use are found in items_clothing.dm and are the inventory return 0 -/datum/species/proc/handle_vision(mob/living/carbon/human/H) +/singleton/species/proc/handle_vision(mob/living/carbon/human/H) var/list/vision = H.get_accumulated_vision_handlers() H.update_sight() H.set_sight(H.sight|get_vision_flags(H)|H.equipment_vision_flags|vision[1]) @@ -597,7 +610,7 @@ The slots that you can use are found in items_clothing.dm and are the inventory return 1 -/datum/species/proc/get_how_nearsighted(mob/living/carbon/human/H) +/singleton/species/proc/get_how_nearsighted(mob/living/carbon/human/H) var/prescriptions = short_sighted if(H.disabilities & NEARSIGHTED) prescriptions += 7 @@ -621,24 +634,24 @@ The slots that you can use are found in items_clothing.dm and are the inventory light -= H.equipment_light_protection return clamp(max(prescriptions, light), 0, 7) -/datum/species/proc/set_default_hair(mob/living/carbon/human/H) +/singleton/species/proc/set_default_hair(mob/living/carbon/human/H) H.head_hair_style = H.species.default_head_hair_style H.facial_hair_style = H.species.default_facial_hair_style H.update_hair() -/datum/species/proc/get_blood_name() +/singleton/species/proc/get_blood_name() return "blood" -/datum/species/proc/handle_death_check(mob/living/carbon/human/H) +/singleton/species/proc/handle_death_check(mob/living/carbon/human/H) return FALSE //Mostly for toasters -/datum/species/proc/handle_limbs_setup(mob/living/carbon/human/H) +/singleton/species/proc/handle_limbs_setup(mob/living/carbon/human/H) for(var/thing in H.organs) post_organ_rejuvenate(thing, H) // Impliments different trails for species depending on if they're wearing shoes. -/datum/species/proc/get_move_trail(mob/living/carbon/human/H) +/singleton/species/proc/get_move_trail(mob/living/carbon/human/H) if(H.lying) return /obj/decal/cleanable/blood/tracks/body if(H.shoes || (H.wear_suit && (H.wear_suit.body_parts_covered & FEET))) @@ -651,10 +664,10 @@ The slots that you can use are found in items_clothing.dm and are the inventory else return move_trail -/datum/species/proc/update_skin(mob/living/carbon/human/H) +/singleton/species/proc/update_skin(mob/living/carbon/human/H) return -/datum/species/proc/disarm_attackhand(mob/living/carbon/human/attacker, mob/living/carbon/human/target) +/singleton/species/proc/disarm_attackhand(mob/living/carbon/human/attacker, mob/living/carbon/human/target) attacker.do_attack_animation(target) if(target.w_uniform) @@ -704,11 +717,11 @@ The slots that you can use are found in items_clothing.dm and are the inventory playsound(target.loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) target.visible_message(SPAN_DANGER("[attacker] attempted to disarm \the [target]!")) -/datum/species/proc/disfigure_msg(mob/living/carbon/human/H) //Used for determining the message a disfigured face has on examine. To add a unique message, just add this onto a specific species and change the "return" message. +/singleton/species/proc/disfigure_msg(mob/living/carbon/human/H) //Used for determining the message a disfigured face has on examine. To add a unique message, just add this onto a specific species and change the "return" message. var/datum/pronouns/P = H.choose_from_pronouns() return "[SPAN_DANGER("[P.His] face is horribly mangled!")]\n" -/datum/species/proc/max_skin_tone() +/singleton/species/proc/max_skin_tone() if(appearance_flags & SPECIES_APPEARANCE_HAS_SKIN_TONE_GRAV) return 100 if(appearance_flags & SPECIES_APPEARANCE_HAS_SKIN_TONE_SPCR) @@ -717,7 +730,7 @@ The slots that you can use are found in items_clothing.dm and are the inventory return 80 return 220 -/datum/species/proc/get_hair_styles() +/singleton/species/proc/get_hair_styles() var/list/L = LAZYACCESS(hair_styles, type) if(!L) L = list() @@ -732,7 +745,7 @@ The slots that you can use are found in items_clothing.dm and are the inventory L[hairstyle] = S return L -/datum/species/proc/get_facial_hair_styles(gender) +/singleton/species/proc/get_facial_hair_styles(gender) var/list/facial_hair_styles_by_species = LAZYACCESS(facial_hair_styles, type) if(!facial_hair_styles_by_species) facial_hair_styles_by_species = list() @@ -758,7 +771,7 @@ The slots that you can use are found in items_clothing.dm and are the inventory return facial_hair_style_by_gender -/datum/species/proc/get_selectable_traits() +/singleton/species/proc/get_selectable_traits() var/list/allowed_traits = list() var/list/trait_list = GET_SINGLETON_SUBTYPE_LIST(/singleton/trait) for (var/singleton/trait/allowed_trait in trait_list) @@ -774,7 +787,7 @@ The slots that you can use are found in items_clothing.dm and are the inventory return allowed_traits -/datum/species/proc/get_description(header, append, verbose = TRUE, skip_detail, skip_photo) +/singleton/species/proc/get_description(header, append, verbose = TRUE, skip_detail, skip_photo) var/list/damage_types = list( "physical trauma" = brute_mod, "burns" = burn_mod, @@ -854,15 +867,15 @@ The slots that you can use are found in items_clothing.dm and are the inventory show_browser(src, species.get_description(), "window=species;size=700x400") -/datum/species/proc/post_organ_rejuvenate(obj/item/organ/org, mob/living/carbon/human/H) +/singleton/species/proc/post_organ_rejuvenate(obj/item/organ/org, mob/living/carbon/human/H) return -/datum/species/proc/check_no_slip(mob/living/carbon/human/H) +/singleton/species/proc/check_no_slip(mob/living/carbon/human/H) if(can_overcome_gravity(H)) return TRUE return (species_flags & SPECIES_FLAG_NO_SLIP) -/datum/species/proc/get_pain_emote(mob/living/carbon/human/H, pain_power) +/singleton/species/proc/get_pain_emote(mob/living/carbon/human/H, pain_power) if(!(species_flags & SPECIES_FLAG_NO_PAIN)) return for(var/pain_emotes in pain_emotes_with_pain_level) @@ -872,7 +885,7 @@ The slots that you can use are found in items_clothing.dm and are the inventory var/singleton/emote/E = GET_SINGLETON(pick(pain_emotes)) return E.key -/datum/species/proc/handle_exertion(mob/living/carbon/human/H) +/singleton/species/proc/handle_exertion(mob/living/carbon/human/H) if (!exertion_effect_chance) return var/chance = exertion_effect_chance * H.encumbrance() diff --git a/code/modules/species/species_age_comparison.dm b/code/modules/species/species_age_comparison.dm index f342de74be8d8..86b436c17ed2b 100644 --- a/code/modules/species/species_age_comparison.dm +++ b/code/modules/species/species_age_comparison.dm @@ -1,5 +1,5 @@ /// List (string => integer). Map of descriptive words to the age threshhold to display these words. Age threshhold is the _highest_ age that can use this descriptor. Descriptors should make grammatical sense when used in the following sentence: "They are of [X] age for a [species]." -/datum/species/var/list/age_descriptors = list( +/singleton/species/var/list/age_descriptors = list( "very young" = 20, "young" = 40, "moderate" = 60, @@ -10,7 +10,7 @@ /// List (string => integer). Map of descriptive words to the age different threshhold to display these words. Age difference threshhold is the _highest_ number that can use this descriptor. Descriptors should make grammatical sence when used in the following sentence: "They are [X] you." -/datum/species/var/list/age_diff_descriptors = list( +/singleton/species/var/list/age_diff_descriptors = list( "much younger than" = -15, "younger than" = -10, "slightly younger than" = -5, @@ -22,10 +22,10 @@ /// Boolean. If set, allows other species to see age descriptions. -/datum/species/var/show_age_to_other_species = FALSE +/singleton/species/var/show_age_to_other_species = FALSE -/datum/species/proc/get_age_comparison_string(mob/living/carbon/human/observed, mob/living/carbon/human/observer) +/singleton/species/proc/get_age_comparison_string(mob/living/carbon/human/observed, mob/living/carbon/human/observer) if (!age_descriptors || !age_diff_descriptors || !istype(observed) || observed.isSynthetic()) return if (!show_age_to_other_species && name != observer.get_species()) diff --git a/code/modules/species/species_getters.dm b/code/modules/species/species_getters.dm index ad82a91892bb1..85b4650756742 100644 --- a/code/modules/species/species_getters.dm +++ b/code/modules/species/species_getters.dm @@ -1,49 +1,49 @@ -/datum/species/proc/get_valid_shapeshifter_forms(mob/living/carbon/human/H) +/singleton/species/proc/get_valid_shapeshifter_forms(mob/living/carbon/human/H) return list() -/datum/species/proc/get_additional_examine_text(mob/living/carbon/human/H) +/singleton/species/proc/get_additional_examine_text(mob/living/carbon/human/H) return -/datum/species/proc/get_tail(mob/living/carbon/human/H) +/singleton/species/proc/get_tail(mob/living/carbon/human/H) return tail -/datum/species/proc/get_tail_animation(mob/living/carbon/human/H) +/singleton/species/proc/get_tail_animation(mob/living/carbon/human/H) return tail_animation -/datum/species/proc/get_tail_hair(mob/living/carbon/human/H) +/singleton/species/proc/get_tail_hair(mob/living/carbon/human/H) return tail_hair -/datum/species/proc/get_blood_mask(mob/living/carbon/human/H) +/singleton/species/proc/get_blood_mask(mob/living/carbon/human/H) return blood_mask -/datum/species/proc/get_damage_overlays(mob/living/carbon/human/H) +/singleton/species/proc/get_damage_overlays(mob/living/carbon/human/H) return damage_overlays -/datum/species/proc/get_damage_mask(mob/living/carbon/human/H) +/singleton/species/proc/get_damage_mask(mob/living/carbon/human/H) return damage_mask -/datum/species/proc/get_examine_name(mob/living/carbon/human/H) +/singleton/species/proc/get_examine_name(mob/living/carbon/human/H) return name -/datum/species/proc/get_icobase(mob/living/carbon/human/H, get_deform) +/singleton/species/proc/get_icobase(mob/living/carbon/human/H, get_deform) return (get_deform ? deform : icobase) -/datum/species/proc/get_station_variant() +/singleton/species/proc/get_station_variant() return name -/datum/species/proc/get_race_key(mob/living/carbon/human/H) +/singleton/species/proc/get_race_key(mob/living/carbon/human/H) return race_key -/datum/species/proc/get_bodytype(mob/living/carbon/human/H) +/singleton/species/proc/get_bodytype(mob/living/carbon/human/H) return name -/datum/species/proc/get_knockout_message(mob/living/carbon/human/H) +/singleton/species/proc/get_knockout_message(mob/living/carbon/human/H) return ((H && H.isSynthetic()) ? "encounters a hardware fault and suddenly reboots!" : knockout_message) -/datum/species/proc/get_death_message(mob/living/carbon/human/H) +/singleton/species/proc/get_death_message(mob/living/carbon/human/H) return ((H && H.isSynthetic()) ? "gives one shrill beep before falling lifeless." : death_message) -/datum/species/proc/get_ssd(mob/living/carbon/human/H) +/singleton/species/proc/get_ssd(mob/living/carbon/human/H) if (H.ai_holder) return @@ -52,13 +52,13 @@ else return ((H && H.isSynthetic()) ? "displaying a blue screen on their monitor indicating total system failure" : show_coma) -/datum/species/proc/get_blood_colour(mob/living/carbon/human/H) +/singleton/species/proc/get_blood_colour(mob/living/carbon/human/H) return ((H && H.isSynthetic()) ? SYNTH_BLOOD_COLOUR : blood_color) -/datum/species/proc/get_flesh_colour(mob/living/carbon/human/H) +/singleton/species/proc/get_flesh_colour(mob/living/carbon/human/H) return ((H && H.isSynthetic()) ? SYNTH_FLESH_COLOUR : flesh_color) -/datum/species/proc/get_environment_discomfort(mob/living/carbon/human/H, msg_type) +/singleton/species/proc/get_environment_discomfort(mob/living/carbon/human/H, msg_type) if(!prob(5)) return @@ -79,32 +79,32 @@ if(covered) to_chat(H, SPAN_DANGER("[pick(heat_discomfort_strings)]")) -/datum/species/proc/get_vision_flags(mob/living/carbon/human/H) +/singleton/species/proc/get_vision_flags(mob/living/carbon/human/H) return vision_flags -/datum/species/proc/get_husk_icon(mob/living/carbon/human/H) +/singleton/species/proc/get_husk_icon(mob/living/carbon/human/H) return husk_icon -/datum/species/proc/get_sex(mob/living/carbon/H) +/singleton/species/proc/get_sex(mob/living/carbon/H) return H.gender -/datum/species/proc/get_surgery_overlay_icon(mob/living/carbon/human/H) +/singleton/species/proc/get_surgery_overlay_icon(mob/living/carbon/human/H) return 'icons/mob/surgery.dmi' -/datum/species/proc/get_footstep(mob/living/carbon/human/H, footstep_type) +/singleton/species/proc/get_footstep(mob/living/carbon/human/H, footstep_type) return -/datum/species/proc/get_brute_mod(mob/living/carbon/human/H) +/singleton/species/proc/get_brute_mod(mob/living/carbon/human/H) . = brute_mod -/datum/species/proc/get_burn_mod(mob/living/carbon/human/H) +/singleton/species/proc/get_burn_mod(mob/living/carbon/human/H) . = burn_mod -/datum/species/proc/get_toxins_mod(mob/living/carbon/human/H) +/singleton/species/proc/get_toxins_mod(mob/living/carbon/human/H) . = toxins_mod -/datum/species/proc/get_radiation_mod(mob/living/carbon/human/H) +/singleton/species/proc/get_radiation_mod(mob/living/carbon/human/H) . = (H && H.isSynthetic() ? 0.5 : radiation_mod) -/datum/species/proc/get_slowdown(mob/living/carbon/human/H) +/singleton/species/proc/get_slowdown(mob/living/carbon/human/H) . = (H && H.isSynthetic() ? 0 : slowdown) diff --git a/code/modules/species/species_grab.dm b/code/modules/species/species_grab.dm index 8c9145bc3ed45..1b778b973d518 100644 --- a/code/modules/species/species_grab.dm +++ b/code/modules/species/species_grab.dm @@ -1,4 +1,4 @@ -/datum/species/proc/attempt_grab(mob/living/carbon/human/grabber, atom/movable/target, grab_type) +/singleton/species/proc/attempt_grab(mob/living/carbon/human/grabber, atom/movable/target, grab_type) if(grabber != target) grabber.visible_message(SPAN_DANGER("[grabber] attempted to grab \the [target]!")) return grabber.make_grab(grabber, target, grab_type) diff --git a/code/modules/species/species_helpers.dm b/code/modules/species/species_helpers.dm index 04d329ea6b2f1..30c12b59fc2eb 100644 --- a/code/modules/species/species_helpers.dm +++ b/code/modules/species/species_helpers.dm @@ -5,15 +5,15 @@ var/global/list/stored_shock_by_ref = list() target.electrocute_act(stored_shock_by_ref["\ref[src]"]*0.9, src) stored_shock_by_ref["\ref[src]"] = 0 -/datum/species/proc/has_fine_manipulation(mob/living/carbon/human/H) +/singleton/species/proc/has_fine_manipulation(mob/living/carbon/human/H) return has_fine_manipulation -/datum/species/proc/toggle_stance(mob/living/carbon/human/H) +/singleton/species/proc/toggle_stance(mob/living/carbon/human/H) if(!H.incapacitated()) H.pulling_punches = !H.pulling_punches to_chat(H, SPAN_NOTICE("You are now [H.pulling_punches ? "pulling your punches" : "not pulling your punches"].")) -/datum/species/proc/get_offset_overlay_image(spritesheet, mob_icon, mob_state, color, slot) +/singleton/species/proc/get_offset_overlay_image(spritesheet, mob_icon, mob_state, color, slot) // If we don't actually need to offset this, don't bother with any of the generation/caching. if(!spritesheet && length(equip_adjust) && equip_adjust[slot] && LAZYLEN(equip_adjust[slot])) @@ -39,14 +39,14 @@ var/global/list/stored_shock_by_ref = list() return I return overlay_image(mob_icon, mob_state, color, RESET_COLOR) -/datum/species/proc/water_act(mob/living/carbon/human/H, depth) +/singleton/species/proc/water_act(mob/living/carbon/human/H, depth) if(!isnull(water_soothe_amount) && depth >= 40) if(H.getHalLoss()) H.adjustHalLoss(-(water_soothe_amount)) if(prob(5)) to_chat(H, SPAN_NOTICE("The water ripples gently over your skin in a soothing balm.")) -/datum/species/proc/is_available_for_join() +/singleton/species/proc/is_available_for_join() if(!(spawn_flags & SPECIES_CAN_JOIN)) return FALSE else if(!isnull(max_players)) @@ -58,16 +58,16 @@ var/global/list/stored_shock_by_ref = list() return FALSE return TRUE -/datum/species/proc/check_background(datum/job/job, datum/preferences/prefs) +/singleton/species/proc/check_background(datum/job/job, datum/preferences/prefs) . = TRUE -/datum/species/proc/get_digestion_product() +/singleton/species/proc/get_digestion_product() return /datum/reagent/nutriment -/datum/species/proc/get_resized_organ_w_class(organ_w_class) +/singleton/species/proc/get_resized_organ_w_class(organ_w_class) . = clamp(organ_w_class + mob_size_difference(mob_size, MOB_MEDIUM), ITEM_SIZE_TINY, ITEM_SIZE_GARGANTUAN) -/datum/species/proc/resize_organ(obj/item/organ/organ) +/singleton/species/proc/resize_organ(obj/item/organ/organ) if(!istype(organ)) return organ.w_class = get_resized_organ_w_class(initial(organ.w_class)) diff --git a/code/modules/species/species_random.dm b/code/modules/species/species_random.dm index 3a688b2891851..b5485466b0abd 100644 --- a/code/modules/species/species_random.dm +++ b/code/modules/species/species_random.dm @@ -1,6 +1,6 @@ #define SETUP_RANDOM_COLOR_GETTER(X, Y, Z, W) \ -/datum/species/var/list/random_##Y = W;\ -/datum/species/proc/get_random_##X(){\ +/singleton/species/var/list/random_##Y = W;\ +/singleton/species/proc/get_random_##X(){\ if(!(appearance_flags & Z) || !length(random_##Y)){\ return;\ }\ @@ -53,12 +53,12 @@ SETUP_RANDOM_COLOR_GETTER(eye_color, eye_colors, SPECIES_APPEARANCE_HAS_EYE_COLO /singleton/color_generator/albino_eye)) SETUP_RANDOM_COLOR_SETTER(eye_color, change_eye_color) -/datum/species/proc/get_random_facial_hair_color() +/singleton/species/proc/get_random_facial_hair_color() return get_random_hair_color() SETUP_RANDOM_COLOR_SETTER(facial_hair_color, change_facial_hair_color) -/datum/species/proc/get_random_skin_tone() +/singleton/species/proc/get_random_skin_tone() return random_skin_tone(src) /mob/living/carbon/human/proc/randomize_skin_tone() diff --git a/code/modules/species/species_shapeshift.dm b/code/modules/species/species_shapeshift.dm index 9a66cf0d85e37..1650cffea4106 100644 --- a/code/modules/species/species_shapeshift.dm +++ b/code/modules/species/species_shapeshift.dm @@ -1,10 +1,4 @@ -// This is something of an intermediary species used for species that -// need to emulate the appearance of another race. Currently it is only -// used for slimes but it may be useful for changelings later. -var/global/list/wrapped_species_by_ref = list() - -/datum/species/shapeshifter - +/singleton/species/shapeshifter inherent_verbs = list( /mob/living/carbon/human/proc/shapeshifter_select_shape, /mob/living/carbon/human/proc/shapeshifter_select_hair, @@ -15,75 +9,75 @@ var/global/list/wrapped_species_by_ref = list() var/monochromatic var/default_form = SPECIES_HUMAN -/datum/species/shapeshifter/get_valid_shapeshifter_forms(mob/living/carbon/human/H) +/singleton/species/shapeshifter/get_valid_shapeshifter_forms(mob/living/carbon/human/H) return valid_transform_species -/datum/species/shapeshifter/get_icobase(mob/living/carbon/human/H, get_deform) +/singleton/species/shapeshifter/get_icobase(mob/living/carbon/human/H, get_deform) if(!H) return ..(null, get_deform) - var/datum/species/S = all_species[wrapped_species_by_ref["\ref[H]"]] + var/singleton/species/S = GLOB.species_by_name[GLOB.mob_ref_to_species_name[any2ref(H)]] return S.get_icobase(H, get_deform) -/datum/species/shapeshifter/get_race_key(mob/living/carbon/human/H) - return "[..()]-[wrapped_species_by_ref["\ref[H]"]]" +/singleton/species/shapeshifter/get_race_key(mob/living/carbon/human/H) + return "[..()]-[GLOB.mob_ref_to_species_name[any2ref(H)]]" -/datum/species/shapeshifter/get_bodytype(mob/living/carbon/human/H) +/singleton/species/shapeshifter/get_bodytype(mob/living/carbon/human/H) if(!H) return ..() - var/datum/species/S = all_species[wrapped_species_by_ref["\ref[H]"]] + var/singleton/species/S = GLOB.species_by_name[GLOB.mob_ref_to_species_name[any2ref(H)]] return S.get_bodytype(H) -/datum/species/shapeshifter/get_blood_mask(mob/living/carbon/human/H) +/singleton/species/shapeshifter/get_blood_mask(mob/living/carbon/human/H) if(!H) return ..() - var/datum/species/S = all_species[wrapped_species_by_ref["\ref[H]"]] + var/singleton/species/S = GLOB.species_by_name[GLOB.mob_ref_to_species_name[any2ref(H)]] return S.get_blood_mask(H) -/datum/species/shapeshifter/get_damage_mask(mob/living/carbon/human/H) +/singleton/species/shapeshifter/get_damage_mask(mob/living/carbon/human/H) if(!H) return ..() - var/datum/species/S = all_species[wrapped_species_by_ref["\ref[H]"]] + var/singleton/species/S = GLOB.species_by_name[GLOB.mob_ref_to_species_name[any2ref(H)]] return S.get_damage_mask(H) -/datum/species/shapeshifter/get_damage_overlays(mob/living/carbon/human/H) +/singleton/species/shapeshifter/get_damage_overlays(mob/living/carbon/human/H) if(!H) return ..() - var/datum/species/S = all_species[wrapped_species_by_ref["\ref[H]"]] + var/singleton/species/S = GLOB.species_by_name[GLOB.mob_ref_to_species_name[any2ref(H)]] return S.get_damage_overlays(H) -/datum/species/shapeshifter/get_tail(mob/living/carbon/human/H) +/singleton/species/shapeshifter/get_tail(mob/living/carbon/human/H) if(!H) return ..() - var/datum/species/S = all_species[wrapped_species_by_ref["\ref[H]"]] + var/singleton/species/S = GLOB.species_by_name[GLOB.mob_ref_to_species_name[any2ref(H)]] return S.get_tail(H) -/datum/species/shapeshifter/get_tail_animation(mob/living/carbon/human/H) +/singleton/species/shapeshifter/get_tail_animation(mob/living/carbon/human/H) if(!H) return ..() - var/datum/species/S = all_species[wrapped_species_by_ref["\ref[H]"]] + var/singleton/species/S = GLOB.species_by_name[GLOB.mob_ref_to_species_name[any2ref(H)]] return S.get_tail_animation(H) -/datum/species/shapeshifter/get_tail_hair(mob/living/carbon/human/H) +/singleton/species/shapeshifter/get_tail_hair(mob/living/carbon/human/H) if(!H) return ..() - var/datum/species/S = all_species[wrapped_species_by_ref["\ref[H]"]] + var/singleton/species/S = GLOB.species_by_name[GLOB.mob_ref_to_species_name[any2ref(H)]] return S.get_tail_hair(H) -/datum/species/shapeshifter/get_husk_icon(mob/living/carbon/human/H) +/singleton/species/shapeshifter/get_husk_icon(mob/living/carbon/human/H) if(H) - var/datum/species/S = all_species[wrapped_species_by_ref["\ref[H]"]] + var/singleton/species/S = GLOB.species_by_name[GLOB.mob_ref_to_species_name[any2ref(H)]] if(S) return S.get_husk_icon(H) return ..() -/datum/species/shapeshifter/handle_pre_spawn(mob/living/carbon/human/H) +/singleton/species/shapeshifter/handle_pre_spawn(mob/living/carbon/human/H) ..() - wrapped_species_by_ref["\ref[H]"] = default_form + GLOB.mob_ref_to_species_name[any2ref(H)] = default_form -/datum/species/shapeshifter/handle_post_spawn(mob/living/carbon/human/H) +/singleton/species/shapeshifter/handle_post_spawn(mob/living/carbon/human/H) if(monochromatic) H.head_hair_color = H.skin_color H.facial_hair_color = H.head_hair_color ..() -/datum/species/shapeshifter/post_organ_rejuvenate(obj/item/organ/org, mob/living/carbon/human/H) +/singleton/species/shapeshifter/post_organ_rejuvenate(obj/item/organ/org, mob/living/carbon/human/H) var/obj/item/organ/external/E = org if(H && istype(E)) E.sync_colour_to_human(H) -/datum/species/shapeshifter/get_pain_emote(mob/living/carbon/human/H, pain_power) - var/datum/species/S = all_species[wrapped_species_by_ref["\ref[H]"]] +/singleton/species/shapeshifter/get_pain_emote(mob/living/carbon/human/H, pain_power) + var/singleton/species/S = GLOB.species_by_name[GLOB.mob_ref_to_species_name[any2ref(H)]] return S.get_pain_emote(H, pain_power) // Verbs follow. @@ -133,10 +127,10 @@ var/global/list/wrapped_species_by_ref = list() last_special = world.time + 50 var/new_species = input("Please select a species to emulate.", "Shapeshifter Body") as null|anything in species.get_valid_shapeshifter_forms(src) - if(!new_species || !all_species[new_species] || wrapped_species_by_ref["\ref[src]"] == new_species) + if(!new_species || !GLOB.species_by_name[new_species] || GLOB.mob_ref_to_species_name[any2ref(src)] == new_species) return - wrapped_species_by_ref["\ref[src]"] = new_species + GLOB.mob_ref_to_species_name[any2ref(src)] = new_species visible_message(SPAN_NOTICE("\The [src] shifts and contorts, taking the form of \a ["\improper [new_species]"]!")) regenerate_icons() @@ -157,7 +151,7 @@ var/global/list/wrapped_species_by_ref = list() /mob/living/carbon/human/proc/shapeshifter_set_colour(new_skin) skin_color = new_skin - var/datum/species/shapeshifter/S = species + var/singleton/species/shapeshifter/S = species if(S.monochromatic) head_hair_color = skin_color facial_hair_color = head_hair_color diff --git a/code/modules/species/station/adherent.dm b/code/modules/species/station/adherent.dm index fe0fe9866cbb5..4a1d841619ae9 100644 --- a/code/modules/species/station/adherent.dm +++ b/code/modules/species/station/adherent.dm @@ -1,4 +1,4 @@ -/datum/species/adherent +/singleton/species/adherent name = SPECIES_ADHERENT name_plural = "Adherents" @@ -109,7 +109,7 @@ "Jet" = "_black" ) -/datum/species/adherent/New() +/singleton/species/adherent/New() equip_adjust = list( "[slot_l_hand_str]" = list("[NORTH]" = list("x" = 0, "y" = 14), "[EAST]" = list("x" = 0, "y" = 14), "[SOUTH]" = list("x" = 0, "y" = 14), "[WEST]" = list("x" = 0, "y" = 14)), "[slot_r_hand_str]" = list("[NORTH]" = list("x" = 0, "y" = 14), "[EAST]" = list("x" = 0, "y" = 14), "[SOUTH]" = list("x" = 0, "y" = 14), "[WEST]" = list("x" = 0, "y" = 14)), @@ -121,7 +121,7 @@ ) ..() -/datum/species/adherent/can_overcome_gravity(mob/living/carbon/human/H) +/singleton/species/adherent/can_overcome_gravity(mob/living/carbon/human/H) . = FALSE if(H && H.stat == CONSCIOUS) for(var/obj/item/organ/internal/powered/float/float in H.internal_organs) @@ -129,16 +129,16 @@ . = TRUE break -/datum/species/adherent/can_fall(mob/living/carbon/human/H) +/singleton/species/adherent/can_fall(mob/living/carbon/human/H) . = !can_overcome_gravity(H) -/datum/species/adherent/can_float(mob/living/carbon/human/H) +/singleton/species/adherent/can_float(mob/living/carbon/human/H) return FALSE -/datum/species/adherent/get_slowdown(mob/living/carbon/human/H) +/singleton/species/adherent/get_slowdown(mob/living/carbon/human/H) return slowdown -/datum/species/adherent/handle_fall_special(mob/living/carbon/human/H, turf/landing) +/singleton/species/adherent/handle_fall_special(mob/living/carbon/human/H, turf/landing) var/float_is_usable = FALSE if(H && H.stat == CONSCIOUS) for(var/obj/item/organ/internal/powered/float/float in H.internal_organs) @@ -153,10 +153,10 @@ return TRUE return FALSE -/datum/species/adherent/get_blood_name() +/singleton/species/adherent/get_blood_name() return "coolant" -/datum/species/adherent/get_additional_examine_text(mob/living/carbon/human/H) +/singleton/species/adherent/get_additional_examine_text(mob/living/carbon/human/H) if(can_overcome_gravity(H)) return "\nThey are floating on a cloud of shimmering distortion." /datum/hud_data/adherent @@ -169,5 +169,5 @@ "belt" = list("loc" = ui_belt, "name" = "Belt", "slot" = slot_belt, "state" = "belt") ) -/datum/species/adherent/post_organ_rejuvenate(obj/item/organ/org, mob/living/carbon/human/H) +/singleton/species/adherent/post_organ_rejuvenate(obj/item/organ/org, mob/living/carbon/human/H) org.status |= (ORGAN_BRITTLE|ORGAN_CRYSTAL|ORGAN_ROBOTIC) diff --git a/code/modules/species/station/golem.dm b/code/modules/species/station/golem.dm index bde850efe2a7d..040efdb198d78 100644 --- a/code/modules/species/station/golem.dm +++ b/code/modules/species/station/golem.dm @@ -1,4 +1,4 @@ -/datum/species/golem +/singleton/species/golem name = SPECIES_GOLEM name_plural = "Golems" @@ -51,7 +51,7 @@ /singleton/trait/general/nonpermeable_skin = TRAIT_LEVEL_EXISTS ) -/datum/species/golem/handle_post_spawn(mob/living/carbon/human/H) +/singleton/species/golem/handle_post_spawn(mob/living/carbon/human/H) if(H.mind) H.mind.reset() H.mind.assigned_role = "Golem" @@ -61,8 +61,8 @@ H.status_flags |= NO_ANTAG ..() -/datum/species/golem/post_organ_rejuvenate(obj/item/organ/org, mob/living/carbon/human/H) +/singleton/species/golem/post_organ_rejuvenate(obj/item/organ/org, mob/living/carbon/human/H) org.status |= (ORGAN_BRITTLE|ORGAN_CRYSTAL) -/datum/species/golem/can_float(mob/living/carbon/human/H) +/singleton/species/golem/can_float(mob/living/carbon/human/H) return FALSE diff --git a/code/modules/species/station/human_subspecies.dm b/code/modules/species/station/human_subspecies.dm index d5b93b265ca1a..c62a186aacd63 100644 --- a/code/modules/species/station/human_subspecies.dm +++ b/code/modules/species/station/human_subspecies.dm @@ -1,4 +1,4 @@ -/datum/species/human/gravworlder +/singleton/species/human/gravworlder name = SPECIES_GRAVWORLDER name_plural = "Grav-Adapted Humans" description = "Heavier and stronger than a baseline human, gravity-adapted people have \ @@ -25,12 +25,12 @@ appearance_flags = SPECIES_APPEARANCE_HAS_HAIR_COLOR | SPECIES_APPEARANCE_HAS_SKIN_TONE_GRAV | SPECIES_APPEARANCE_HAS_LIPS | SPECIES_APPEARANCE_HAS_UNDERWEAR | SPECIES_APPEARANCE_HAS_EYE_COLOR -/datum/species/human/gravworlder/can_float(mob/living/carbon/human/H) +/singleton/species/human/gravworlder/can_float(mob/living/carbon/human/H) . = ..() if(.) return H.skill_check(SKILL_HAULING, SKILL_EXPERIENCED) //Hard for them to swim -/datum/species/human/spacer +/singleton/species/human/spacer name = SPECIES_SPACER name_plural = "Space-Adapted Humans" description = "Lithe and frail, these sickly folk were engineered for work in environments that \ @@ -61,7 +61,7 @@ warning_low_pressure = WARNING_LOW_PRESSURE * 0.8 // Low pressure warning. hazard_low_pressure = HAZARD_LOW_PRESSURE * 0.8 // Dangerously low pressure. -/datum/species/human/vatgrown +/singleton/species/human/vatgrown name = SPECIES_VATGROWN name_plural = "Vat-Grown Humans" description = "With cloning technology having become commercially viable in the late 21st century, \ @@ -95,7 +95,7 @@ TAG_CULTURE = CULTURE_HUMAN_VATGROWN ) -/datum/species/human/tritonian +/singleton/species/human/tritonian name = SPECIES_TRITONIAN name_plural = "Tritonians" description = "Of all human gene-adapts, the Tritonian genotype is probably the most wildly divergent from \ @@ -137,13 +137,13 @@ appearance_flags = SPECIES_APPEARANCE_HAS_HAIR_COLOR | SPECIES_APPEARANCE_HAS_SKIN_TONE_TRITON | SPECIES_APPEARANCE_HAS_LIPS | SPECIES_APPEARANCE_HAS_UNDERWEAR | SPECIES_APPEARANCE_HAS_EYE_COLOR -/datum/species/human/tritonian/can_float(mob/living/carbon/human/H) +/singleton/species/human/tritonian/can_float(mob/living/carbon/human/H) if(!H.is_physically_disabled()) if(H.encumbrance() < 2) return TRUE return FALSE -/datum/species/human/mule +/singleton/species/human/mule name = SPECIES_MULE name_plural = "Mules" description = "Psionics are a relatively new phenomenon, theorized to be linked to long-term exposure to deep, \ @@ -164,7 +164,7 @@ min_age = 18 max_age = 45 -/datum/species/human/mule/handle_post_spawn(mob/living/carbon/human/H) +/singleton/species/human/mule/handle_post_spawn(mob/living/carbon/human/H) if(!H.psi) H.psi = new(H) var/list/faculties = list("[PSI_COERCION]", "[PSI_REDACTION]", "[PSI_ENERGISTICS]", "[PSI_PSYCHOKINESIS]") diff --git a/code/modules/species/station/lizard.dm b/code/modules/species/station/lizard.dm index 200c3e32064f2..a4bc6aee92bb5 100644 --- a/code/modules/species/station/lizard.dm +++ b/code/modules/species/station/lizard.dm @@ -1,4 +1,4 @@ -/datum/species/unathi +/singleton/species/unathi name = SPECIES_UNATHI name_plural = SPECIES_UNATHI icobase = 'icons/mob/human_races/species/unathi/skin.dmi' @@ -165,9 +165,9 @@ show_age_to_other_species = TRUE -/datum/species/unathi/equip_survival_gear(mob/living/carbon/human/H) +/singleton/species/unathi/equip_survival_gear(mob/living/carbon/human/H) ..() H.equip_to_slot_or_del(new /obj/item/clothing/shoes/sandal(H),slot_shoes) -/datum/species/unathi/get_bodytype(mob/living/carbon/human/H) +/singleton/species/unathi/get_bodytype(mob/living/carbon/human/H) return SPECIES_UNATHI diff --git a/code/modules/species/station/lizard_subspecies.dm b/code/modules/species/station/lizard_subspecies.dm index 806d89defadab..c4f5d8c9a0fbc 100644 --- a/code/modules/species/station/lizard_subspecies.dm +++ b/code/modules/species/station/lizard_subspecies.dm @@ -1,4 +1,4 @@ -/datum/species/unathi/yeosa +/singleton/species/unathi/yeosa name = SPECIES_YEOSA name_plural = SPECIES_YEOSA preview_icon = 'icons/mob/human_races/species/unathi/yeosa_preview.dmi' @@ -49,8 +49,8 @@ ingest_amount = 15 -/datum/species/unathi/yeosa/can_float(mob/living/carbon/human/H) +/singleton/species/unathi/yeosa/can_float(mob/living/carbon/human/H) if(!H.is_physically_disabled()) if(H.encumbrance() < 2) return TRUE - return FALSE \ No newline at end of file + return FALSE diff --git a/code/modules/species/station/machine.dm b/code/modules/species/station/machine.dm index 5106cf314757b..e3497ac071ccf 100644 --- a/code/modules/species/station/machine.dm +++ b/code/modules/species/station/machine.dm @@ -1,4 +1,4 @@ -/datum/species/machine +/singleton/species/machine name = SPECIES_IPC name_plural = "machines" @@ -110,24 +110,24 @@ /mob/living/carbon/human/proc/MachineShowText ) -/datum/species/machine/handle_death(mob/living/carbon/human/H) +/singleton/species/machine/handle_death(mob/living/carbon/human/H) ..() if(istype(H.wear_mask,/obj/item/clothing/mask/monitor)) var/obj/item/clothing/mask/monitor/M = H.wear_mask M.monitor_state_index = "blank" M.update_icon() -/datum/species/machine/post_organ_rejuvenate(obj/item/organ/org, mob/living/carbon/human/H) +/singleton/species/machine/post_organ_rejuvenate(obj/item/organ/org, mob/living/carbon/human/H) var/obj/item/organ/external/E = org if(istype(E) && !BP_IS_ROBOTIC(E)) E.robotize("Morpheus") -/datum/species/machine/get_blood_name() +/singleton/species/machine/get_blood_name() return "oil" -/datum/species/machine/disfigure_msg(mob/living/carbon/human/H) +/singleton/species/machine/disfigure_msg(mob/living/carbon/human/H) var/datum/pronouns/P = H.choose_from_pronouns() return "[SPAN_DANGER("[P.His] monitor is completely busted!")]\n" -/datum/species/machine/can_float(mob/living/carbon/human/H) +/singleton/species/machine/can_float(mob/living/carbon/human/H) return FALSE diff --git a/code/modules/species/station/monkey.dm b/code/modules/species/station/monkey.dm index c74f5635b1d15..5a4361073290b 100644 --- a/code/modules/species/station/monkey.dm +++ b/code/modules/species/station/monkey.dm @@ -1,4 +1,4 @@ -/datum/species/monkey +/singleton/species/monkey name = "Monkey" name_plural = "Monkeys" description = "Ook." @@ -59,7 +59,7 @@ show_age_to_other_species = TRUE -/datum/species/monkey/New() +/singleton/species/monkey/New() equip_adjust = list( slot_l_hand_str = list("[NORTH]" = list("x" = 1, "y" = 3), "[EAST]" = list("x" = -3, "y" = 2), "[SOUTH]" = list("x" = -1, "y" = 3), "[WEST]" = list("x" = 3, "y" = 2)), slot_r_hand_str = list("[NORTH]" = list("x" = -1, "y" = 3), "[EAST]" = list("x" = 3, "y" = 2), "[SOUTH]" = list("x" = 1, "y" = 3), "[WEST]" = list("x" = -3, "y" = 2)), @@ -69,14 +69,14 @@ ) ..() -/datum/species/monkey/handle_post_spawn(mob/living/carbon/human/H) +/singleton/species/monkey/handle_post_spawn(mob/living/carbon/human/H) ..() H.item_state = lowertext(name) H.ai_holder = new /datum/ai_holder/human/monkey (H) H.say_list_type = /datum/say_list/monkey H.say_list = new /datum/say_list/monkey (H) -/datum/species/monkey/alien +/singleton/species/monkey/alien name = "Farwa" name_plural = "Farwa" health_hud_intensity = 2 @@ -93,7 +93,7 @@ TAG_FACTION = FACTION_TEST_SUBJECTS ) -/datum/species/monkey/skrell +/singleton/species/monkey/skrell name = "Neaera" name_plural = "Neaera" health_hud_intensity = 1.75 @@ -112,7 +112,7 @@ ) -/datum/species/monkey/unathi +/singleton/species/monkey/unathi name = "Stok" name_plural = "Stok" health_hud_intensity = 1.5 diff --git a/code/modules/species/station/nabber.dm b/code/modules/species/station/nabber.dm index 75b09b3e98ff3..d78e5a5df2ad1 100644 --- a/code/modules/species/station/nabber.dm +++ b/code/modules/species/station/nabber.dm @@ -1,4 +1,4 @@ -/datum/species/nabber +/singleton/species/nabber name = SPECIES_NABBER name_plural = "giant armoured serpentids" description = "A species of large invertebrates who, after being discovered by a \ @@ -158,7 +158,7 @@ traits = list(/singleton/trait/general/serpentid_adapted = TRAIT_LEVEL_EXISTS) -/datum/species/nabber/New() +/singleton/species/nabber/New() equip_adjust = list( slot_head_str = list("[NORTH]" = list("x" = 0, "y" = 7), "[EAST]" = list("x" = 0, "y" = 8), "[SOUTH]" = list("x" = 0, "y" = 8), "[WEST]" = list("x" = 0, "y" = 8)), slot_back_str = list("[NORTH]" = list("x" = 0, "y" = 7), "[EAST]" = list("x" = 0, "y" = 8), "[SOUTH]" = list("x" = 0, "y" = 8), "[WEST]" = list("x" = 0, "y" = 8)), @@ -167,10 +167,10 @@ ) ..() -/datum/species/nabber/get_blood_name() +/singleton/species/nabber/get_blood_name() return "haemolymph" -/datum/species/nabber/can_overcome_gravity(mob/living/carbon/human/H) +/singleton/species/nabber/can_overcome_gravity(mob/living/carbon/human/H) var/datum/gas_mixture/mixture = H.loc.return_air() if(mixture) @@ -183,13 +183,13 @@ return FALSE -/datum/species/nabber/handle_environment_special(mob/living/carbon/human/H) +/singleton/species/nabber/handle_environment_special(mob/living/carbon/human/H) if(!H.on_fire && H.fire_stacks < 2) H.fire_stacks += 0.2 return // Nabbers will only fall when there isn't enough air pressure for them to keep themselves aloft. -/datum/species/nabber/can_fall(mob/living/carbon/human/H) +/singleton/species/nabber/can_fall(mob/living/carbon/human/H) var/datum/gas_mixture/mixture = H.loc.return_air() //nabbers should not be trying to break their fall on stairs. @@ -205,7 +205,7 @@ return TRUE // Even when nabbers do fall, if there's enough air pressure they won't hurt themselves. -/datum/species/nabber/handle_fall_special(mob/living/carbon/human/H, turf/landing) +/singleton/species/nabber/handle_fall_special(mob/living/carbon/human/H, turf/landing) var/datum/gas_mixture/mixture = H.loc.return_air() @@ -229,13 +229,13 @@ return FALSE -/datum/species/nabber/can_shred(mob/living/carbon/human/H, ignore_intent, ignore_antag) +/singleton/species/nabber/can_shred(mob/living/carbon/human/H, ignore_intent, ignore_antag) if(!H.handcuffed || H.buckled) return ..(H, ignore_intent, TRUE) else return 0 -/datum/species/nabber/handle_movement_delay_special(mob/living/carbon/human/H) +/singleton/species/nabber/handle_movement_delay_special(mob/living/carbon/human/H) var/tally = 0 H.remove_cloaking_source(src) @@ -258,7 +258,7 @@ affecting.visible_message(SPAN_DANGER("[assailant]'s spikes dig in painfully!")) affecting.Stun(10) -/datum/species/nabber/update_skin(mob/living/carbon/human/H) +/singleton/species/nabber/update_skin(mob/living/carbon/human/H) if(H.stat) H.skin_state = SKIN_NORMAL @@ -293,7 +293,7 @@ return(threat_image) return -/datum/species/nabber/disarm_attackhand(mob/living/carbon/human/attacker, mob/living/carbon/human/target) +/singleton/species/nabber/disarm_attackhand(mob/living/carbon/human/attacker, mob/living/carbon/human/target) if(attacker.pulling_punches || target.lying || attacker == target) return ..(attacker, target) if(world.time < attacker.last_attack + 20) @@ -310,21 +310,21 @@ if(prob(50)) target.set_dir(GLOB.reverse_dir[target.dir]) -/datum/species/nabber/get_additional_examine_text(mob/living/carbon/human/H) +/singleton/species/nabber/get_additional_examine_text(mob/living/carbon/human/H) var/datum/pronouns/P = H.choose_from_pronouns() if(H.pulling_punches) return "\n[P.His] manipulation arms are out and [P.he] looks ready to use complex items." else return "\n[SPAN_WARNING("[P.His] deadly upper arms are raised and [P.he] looks ready to attack!")]" -/datum/species/nabber/handle_post_spawn(mob/living/carbon/human/H) +/singleton/species/nabber/handle_post_spawn(mob/living/carbon/human/H) ..() return H.pulling_punches = TRUE -/datum/species/nabber/has_fine_manipulation(mob/living/carbon/human/H) +/singleton/species/nabber/has_fine_manipulation(mob/living/carbon/human/H) return (..() && (H && H.pulling_punches)) -/datum/species/nabber/attempt_grab(mob/living/carbon/human/grabber, mob/living/target) +/singleton/species/nabber/attempt_grab(mob/living/carbon/human/grabber, mob/living/target) if(grabber.pulling_punches) return ..() if(grabber == target) @@ -355,7 +355,7 @@ else grabber.visible_message(SPAN_DANGER("\The [grabber] suddenly lunges out, almost grabbing \the [target]!")) -/datum/species/nabber/toggle_stance(mob/living/carbon/human/H) +/singleton/species/nabber/toggle_stance(mob/living/carbon/human/H) if(H.incapacitated()) return FALSE var/datum/pronouns/P = H.choose_from_pronouns() @@ -370,7 +370,7 @@ to_chat(H, SPAN_NOTICE("You stop adjusting your arms and don't switch between them.")) return TRUE -/datum/species/nabber/proc/arm_swap(mob/living/carbon/human/H, forced) +/singleton/species/nabber/proc/arm_swap(mob/living/carbon/human/H, forced) for (var/obj/item/item as anything in H.GetAllHeld()) H.unEquip(item) var/hidden = H.is_cloaked() @@ -395,6 +395,6 @@ H.visible_message(SPAN_WARNING("[H] tenses as [P.he] brings [P.his] smaller arms in close to [P.his] body. [P.His] two massive spiked arms reach \ out. [P.He] looks ready to attack.")) -/datum/species/nabber/check_background(datum/job/job, datum/preferences/prefs) +/singleton/species/nabber/check_background(datum/job/job, datum/preferences/prefs) var/singleton/cultural_info/culture/nabber/grade = SSculture.get_culture(prefs.cultural_info[TAG_CULTURE]) . = istype(grade) ? (job.type in grade.valid_jobs) : ..() diff --git a/code/modules/species/station/prometheans.dm b/code/modules/species/station/prometheans.dm index 99d16cebb10ff..bf20c700aeded 100644 --- a/code/modules/species/station/prometheans.dm +++ b/code/modules/species/station/prometheans.dm @@ -1,8 +1,4 @@ -var/global/datum/species/shapeshifter/promethean/prometheans - -// Species definition follows. -/datum/species/shapeshifter/promethean - +/singleton/species/shapeshifter/promethean name = SPECIES_PROMETHEAN name_plural = "Prometheans" description = "What has Science done?" @@ -74,20 +70,17 @@ var/global/datum/species/shapeshifter/promethean/prometheans traits = list(/singleton/trait/malus/water = TRAIT_LEVEL_MODERATE) -/datum/species/shapeshifter/promethean/New() - ..() - prometheans = src -/datum/species/shapeshifter/promethean/hug(mob/living/carbon/human/H,mob/living/target) +/singleton/species/shapeshifter/promethean/hug(mob/living/carbon/human/H,mob/living/target) var/datum/gender/G = GLOB.gender_datums[target.gender] H.visible_message(SPAN_NOTICE("\The [H] glomps [target] to make [G.him] feel better!"), \ SPAN_NOTICE("You glomps [target] to make [G.him] feel better!")) H.apply_stored_shock_to(target) -/datum/species/shapeshifter/promethean/handle_death(mob/living/carbon/human/H) +/singleton/species/shapeshifter/promethean/handle_death(mob/living/carbon/human/H) addtimer(new Callback(H, /mob/proc/gib),0) -/datum/species/shapeshifter/promethean/handle_environment_special(mob/living/carbon/human/H) +/singleton/species/shapeshifter/promethean/handle_environment_special(mob/living/carbon/human/H) var/turf/T = H.loc if(istype(T)) @@ -133,17 +126,17 @@ var/global/datum/species/shapeshifter/promethean/prometheans H.adjustToxLoss(-heal_rate) return 1 -/datum/species/shapeshifter/promethean/get_blood_colour(mob/living/carbon/human/H) +/singleton/species/shapeshifter/promethean/get_blood_colour(mob/living/carbon/human/H) if (H) return H.skin_color return ..() -/datum/species/shapeshifter/promethean/get_flesh_colour(mob/living/carbon/human/H) +/singleton/species/shapeshifter/promethean/get_flesh_colour(mob/living/carbon/human/H) if (H) return H.skin_color return ..() -/datum/species/shapeshifter/promethean/get_additional_examine_text(mob/living/carbon/human/H) +/singleton/species/shapeshifter/promethean/get_additional_examine_text(mob/living/carbon/human/H) if(!stored_shock_by_ref["\ref[H]"]) return diff --git a/code/modules/species/station/station.dm b/code/modules/species/station/station.dm index 912342fb87094..dcd2f54ecdbfc 100644 --- a/code/modules/species/station/station.dm +++ b/code/modules/species/station/station.dm @@ -1,4 +1,4 @@ -/datum/species/human +/singleton/species/human name = SPECIES_HUMAN name_plural = "Humans" primitive_form = "Monkey" @@ -80,10 +80,10 @@ show_age_to_other_species = TRUE -/datum/species/human/get_bodytype(mob/living/carbon/human/H) +/singleton/species/human/get_bodytype(mob/living/carbon/human/H) return SPECIES_HUMAN -/datum/species/human/get_ssd(mob/living/carbon/human/H) +/singleton/species/human/get_ssd(mob/living/carbon/human/H) if (H.ai_holder) return @@ -91,7 +91,7 @@ return "staring blankly, not reacting to your presence" return ..() -/datum/species/skrell +/singleton/species/skrell name = SPECIES_SKRELL name_plural = SPECIES_SKRELL icobase = 'icons/mob/human_races/species/skrell/body.dmi' @@ -240,19 +240,19 @@ bodyfall_sound = 'sound/effects/bodyfall_skrell.ogg' -/datum/species/skrell/get_sex(mob/living/carbon/human/H) +/singleton/species/skrell/get_sex(mob/living/carbon/human/H) return istype(H) && (H.descriptors["headtail length"] == 1 ? MALE : FEMALE) -/datum/species/skrell/check_background() +/singleton/species/skrell/check_background() return TRUE -/datum/species/skrell/can_float(mob/living/carbon/human/H) +/singleton/species/skrell/can_float(mob/living/carbon/human/H) if(!H.is_physically_disabled()) if(H.encumbrance() < 2) return TRUE return FALSE -/datum/species/diona +/singleton/species/diona name = SPECIES_DIONA name_plural = "Dionaea" icobase = 'icons/mob/human_races/species/diona/body.dmi' @@ -369,7 +369,7 @@ death() #define DIONA_LIMB_DEATH_COUNT 9 -/datum/species/diona/handle_death_check(mob/living/carbon/human/H) +/singleton/species/diona/handle_death_check(mob/living/carbon/human/H) var/lost_limb_count = length(has_limbs) - length(H.organs) if(lost_limb_count >= DIONA_LIMB_DEATH_COUNT) return TRUE @@ -380,13 +380,13 @@ return (lost_limb_count >= DIONA_LIMB_DEATH_COUNT) #undef DIONA_LIMB_DEATH_COUNT -/datum/species/diona/can_understand(mob/other) +/singleton/species/diona/can_understand(mob/other) var/mob/living/carbon/alien/diona/D = other if(istype(D)) return 1 return 0 -/datum/species/diona/equip_survival_gear(mob/living/carbon/human/H) +/singleton/species/diona/equip_survival_gear(mob/living/carbon/human/H) if(istype(H.get_equipped_item(slot_back), /obj/item/storage/backpack)) H.equip_to_slot_or_del(new /obj/item/device/flashlight/flare(H.back), slot_in_backpack) else @@ -394,12 +394,12 @@ // Dionaea spawned by hand or by joining will not have any // nymphs passed to them. This should take care of that. -/datum/species/diona/handle_post_spawn(mob/living/carbon/human/H) +/singleton/species/diona/handle_post_spawn(mob/living/carbon/human/H) H.gender = NEUTER . = ..() addtimer(new Callback(src, .proc/fill_with_nymphs, H), 0) -/datum/species/diona/proc/fill_with_nymphs(mob/living/carbon/human/H) +/singleton/species/diona/proc/fill_with_nymphs(mob/living/carbon/human/H) if(!H || H.species.name != name) return @@ -412,7 +412,7 @@ new /mob/living/carbon/alien/diona/sterile(H) nymph_count++ -/datum/species/diona/handle_death(mob/living/carbon/human/H) +/singleton/species/diona/handle_death(mob/living/carbon/human/H) if(H.isSynthetic()) var/mob/living/carbon/alien/diona/S = new(get_turf(H)) @@ -424,10 +424,10 @@ else split_into_nymphs(H, TRUE) -/datum/species/diona/get_blood_name() +/singleton/species/diona/get_blood_name() return "sap" -/datum/species/diona/handle_environment_special(mob/living/carbon/human/H) +/singleton/species/diona/handle_environment_special(mob/living/carbon/human/H) if(H.InStasis() || H.stat == DEAD) return diff --git a/code/modules/submaps/submap_job.dm b/code/modules/submaps/submap_job.dm index 641f89961546e..e90f2bea8a337 100644 --- a/code/modules/submaps/submap_job.dm +++ b/code/modules/submaps/submap_job.dm @@ -49,7 +49,7 @@ owner = _owner ..() -/datum/job/submap/is_species_allowed(datum/species/S) +/datum/job/submap/is_species_allowed(singleton/species/S) if(LAZYLEN(whitelisted_species) && !(S.name in whitelisted_species)) return FALSE if(S.name in blacklisted_species) @@ -62,7 +62,7 @@ return TRUE /datum/job/submap/is_restricted(datum/preferences/prefs, feedback) - var/datum/species/S = all_species[prefs.species] + var/singleton/species/S = GLOB.species_by_name[prefs.species] if(LAZYACCESS(minimum_character_age, S.get_bodytype()) && (prefs.age < minimum_character_age[S.get_bodytype()])) to_chat(feedback, SPAN_CLASS("boldannounce", "Not old enough. Minimum character age is [minimum_character_age[S.get_bodytype()]].")) return TRUE diff --git a/code/unit_tests/culture.dm b/code/unit_tests/culture.dm index b390d78a7cb23..4ccd604a08378 100644 --- a/code/unit_tests/culture.dm +++ b/code/unit_tests/culture.dm @@ -3,8 +3,8 @@ /datum/unit_test/culture/start_test() var/fails = 0 - for(var/species_name in all_species) - var/datum/species/species = all_species[species_name] + for(var/species_name in GLOB.species_by_name) + var/singleton/species/species = GLOB.species_by_name[species_name] if(!islist(species.default_cultural_info)) fails++ log_bad("Default cultural info for [species_name] is not a list.") diff --git a/code/unit_tests/mob_tests.dm b/code/unit_tests/mob_tests.dm index 57ad238a37cc8..78e2dff991ba0 100644 --- a/code/unit_tests/mob_tests.dm +++ b/code/unit_tests/mob_tests.dm @@ -26,8 +26,8 @@ if(!istype(T, /turf/space)) //If the above isn't a space turf then we force it to find one will most likely pick 1,1,1 T = locate(/turf/space) - for(var/species_name in all_species) - var/datum/species/S = all_species[species_name] + for(var/species_name in GLOB.species_by_name) + var/singleton/species/S = GLOB.species_by_name[species_name] var/mob/living/carbon/human/H = new(T, S.name) if(H.need_breathe()) var/species_organ = H.species.breathing_organ @@ -520,8 +520,8 @@ var/global/default_mobloc = null var/failcount = 0 /datum/unit_test/species_base_skin/start_test() - for(var/species_name in all_species) - var/datum/species/S = all_species[species_name] + for(var/species_name in GLOB.species_by_name) + var/singleton/species/S = GLOB.species_by_name[species_name] if(S.base_skin_colours) if(!(S.appearance_flags & SPECIES_APPEARANCE_HAS_BASE_SKIN_COLOURS)) log_unit_test("[S.name] has a skin colour list but no SPECIES_APPEARANCE_HAS_BASE_SKIN_COLOURS flag.") @@ -570,7 +570,7 @@ var/global/default_mobloc = null /datum/unit_test/mob_nullspace/start_test() // Simply create one of each species type in nullspace - for(var/species_name in all_species) + for(var/species_name in GLOB.species_by_name) var/test_subject = new/mob/living/carbon/human(null, species_name) test_subjects += test_subject return TRUE @@ -591,7 +591,7 @@ var/global/default_mobloc = null /datum/unit_test/mob_organ_size/start_test() var/failed = FALSE - for(var/species_name in all_species) + for(var/species_name in GLOB.species_by_name) var/mob/living/carbon/human/H = new(null, species_name) for(var/obj/item/organ/external/E in H.organs) for(var/obj/item/organ/internal/I in E.internal_organs) diff --git a/code/unit_tests/organ_tests.dm b/code/unit_tests/organ_tests.dm index ce397529c4ca9..27448c490ba72 100644 --- a/code/unit_tests/organ_tests.dm +++ b/code/unit_tests/organ_tests.dm @@ -22,7 +22,7 @@ /datum/unit_test/species_organ_creation name = "ORGAN: Species Organs are Created Correctly" -/datum/unit_test/species_organ_creation/proc/check_internal_organs(mob/living/carbon/human/H, datum/species/species) +/datum/unit_test/species_organ_creation/proc/check_internal_organs(mob/living/carbon/human/H, singleton/species/species) . = 1 for(var/organ_tag in species.has_organ) var/obj/item/organ/internal/I = H.internal_organs_by_name[organ_tag] @@ -43,7 +43,7 @@ fail("[species.name] internal organ tag mismatch. Registered as \"[organ_tag]\", actual tag was \"[I.organ_tag]\".") . = 0 -/datum/unit_test/species_organ_creation/proc/check_external_organs(mob/living/carbon/human/H, datum/species/species) +/datum/unit_test/species_organ_creation/proc/check_external_organs(mob/living/carbon/human/H, singleton/species/species) . = 1 for(var/organ_tag in species.has_limbs) var/obj/item/organ/external/E = H.organs_by_name[organ_tag] @@ -65,7 +65,7 @@ fail("[species.name] internal organ tag mismatch. Registered as \"[organ_tag]\", actual tag was \"[E.organ_tag]\".") . = 0 -/datum/unit_test/species_organ_creation/proc/check_organ_parents(mob/living/carbon/human/H, datum/species/species) +/datum/unit_test/species_organ_creation/proc/check_organ_parents(mob/living/carbon/human/H, singleton/species/species) . = 1 for(var/obj/item/organ/external/E in H.organs) if(!E.parent_organ) @@ -109,7 +109,7 @@ /datum/unit_test/species_organ_creation/start_test() var/failcount = 0 - for(var/datum/species/species in all_species) + for(var/singleton/species/species in GLOB.species_by_name) var/mob/living/carbon/human/test_subject = new(null, species.name) var/fail = 0 @@ -234,7 +234,7 @@ /datum/unit_test/species_organ_lists_update/start_test() var/failcount = 0 - for(var/datum/species/species in all_species) + for(var/singleton/species/species in GLOB.species_by_name) var/mob/living/carbon/human/test_subject = new(null, species.name) for(var/O in test_subject.internal_organs) diff --git a/code/unit_tests/trait_tests.dm b/code/unit_tests/trait_tests.dm index adbd0d8c1cc7c..7c411275fba6a 100644 --- a/code/unit_tests/trait_tests.dm +++ b/code/unit_tests/trait_tests.dm @@ -87,8 +87,8 @@ /datum/unit_test/trait/all_species_shall_have_valid_trait_levels/start_test() var/list/invalid_species = list() - for(var/species_name in all_species) - var/datum/species/S = all_species[species_name] + for(var/species_name in GLOB.species_by_name) + var/singleton/species/S = GLOB.species_by_name[species_name] for(var/trait_type in S.traits) var/trait_level = S.traits[trait_type] var/singleton/trait/T = GET_SINGLETON(trait_type) @@ -110,8 +110,8 @@ /datum/unit_test/trait/all_species_shall_have_valid_trait_compatibilities/start_test() var/list/invalid_species = list() - for (var/species_name in all_species) - var/datum/species/S = all_species[species_name] + for (var/species_name in GLOB.species_by_name) + var/singleton/species/S = GLOB.species_by_name[species_name] for (var/trait_type in S.traits) var/singleton/trait/T = GET_SINGLETON(trait_type) for (var/incompatible_trait_type in T.incompatible_traits) diff --git a/maps/mapsystem/map_ranks.dm b/maps/mapsystem/map_ranks.dm index 3c10eb164ea10..8dc1ab303c48c 100644 --- a/maps/mapsystem/map_ranks.dm +++ b/maps/mapsystem/map_ranks.dm @@ -9,7 +9,7 @@ var/list/species_to_rank_blacklist = list() // Lists of ranks which are restricted, per species. // The white, and blacklist are type specific, any subtypes (of both species and jobs) have to be added explicitly -/datum/map/proc/is_species_branch_restricted(datum/species/S, datum/mil_branch/MB) +/datum/map/proc/is_species_branch_restricted(singleton/species/S, datum/mil_branch/MB) if(!istype(S) || !istype(MB)) return TRUE @@ -23,7 +23,7 @@ return whitelist // not in the whitelist, no blacklist = bad, no whitelist or blacklist = fine -/datum/map/proc/is_species_rank_restricted(datum/species/S, datum/mil_branch/MB, datum/mil_rank/MR) +/datum/map/proc/is_species_rank_restricted(singleton/species/S, datum/mil_branch/MB, datum/mil_rank/MR) if(!istype(S) || !istype(MB) || !istype(MR)) return TRUE diff --git a/maps/mapsystem/maps_jobs.dm b/maps/mapsystem/maps_jobs.dm index 3421d0810e660..49fd347eee2a6 100644 --- a/maps/mapsystem/maps_jobs.dm +++ b/maps/mapsystem/maps_jobs.dm @@ -1,5 +1,5 @@ /datum/map - var/species_to_job_whitelist = list(/datum/species/vox = list(/datum/job/ai, /datum/job/cyborg)) + var/species_to_job_whitelist = list(/singleton/species/vox = list(/datum/job/ai, /datum/job/cyborg)) var/species_to_job_blacklist = list() var/job_to_species_whitelist = list() @@ -16,7 +16,7 @@ // The white, and blacklist are type specific, any subtypes (of both species and jobs) have to be added explicitly -/datum/map/proc/is_species_job_restricted(datum/species/S, datum/job/J) +/datum/map/proc/is_species_job_restricted(singleton/species/S, datum/job/J) if(!istype(S) || !istype(J)) return TRUE diff --git a/maps/torch/job/torch_jobs.dm b/maps/torch/job/torch_jobs.dm index 94d10f7f5e1ff..68509d1f90f0c 100644 --- a/maps/torch/job/torch_jobs.dm +++ b/maps/torch/job/torch_jobs.dm @@ -1,21 +1,21 @@ /datum/map/torch species_to_job_whitelist = list( - /datum/species/adherent = list(/datum/job/ai, /datum/job/cyborg, /datum/job/assistant, /datum/job/janitor, /datum/job/chef, /datum/job/cargo_tech, + /singleton/species/adherent = list(/datum/job/ai, /datum/job/cyborg, /datum/job/assistant, /datum/job/janitor, /datum/job/chef, /datum/job/cargo_tech, /datum/job/engineer, /datum/job/roboticist, /datum/job/chemist, /datum/job/scientist_assistant, /datum/job/scientist, /datum/job/nt_pilot, /datum/job/mining), - /datum/species/nabber = list(/datum/job/ai, /datum/job/cyborg, /datum/job/janitor, /datum/job/scientist_assistant, /datum/job/chemist, + /singleton/species/nabber = list(/datum/job/ai, /datum/job/cyborg, /datum/job/janitor, /datum/job/scientist_assistant, /datum/job/chemist, /datum/job/roboticist, /datum/job/cargo_tech, /datum/job/chef, /datum/job/engineer, /datum/job/doctor), - /datum/species/vox = list(/datum/job/ai, /datum/job/cyborg), - /datum/species/human/mule = list(/datum/job/ai, /datum/job/cyborg, /datum/job/merchant) + /singleton/species/vox = list(/datum/job/ai, /datum/job/cyborg), + /singleton/species/human/mule = list(/datum/job/ai, /datum/job/cyborg, /datum/job/merchant) ) #define HUMAN_ONLY_JOBS /datum/job/captain, /datum/job/hop, /datum/job/cmo, /datum/job/chief_engineer, /datum/job/hos, /datum/job/representative, /datum/job/sea, /datum/job/pathfinder, /datum/job/rd species_to_job_blacklist = list( - /datum/species/unathi = list(HUMAN_ONLY_JOBS, /datum/job/liaison, /datum/job/warden), //Other jobs unavailable via branch restrictions, - /datum/species/unathi/yeosa = list(HUMAN_ONLY_JOBS, /datum/job/liaison, /datum/job/warden), - /datum/species/skrell = list(HUMAN_ONLY_JOBS), - /datum/species/machine = list(HUMAN_ONLY_JOBS, /datum/job/liaison, /datum/job/psychiatrist, /datum/job/bridgeofficer, /datum/job/senior_engineer, /datum/job/warden, /datum/job/qm, /datum/job/senior_scientist, /datum/job/chief_steward), - /datum/species/diona = list(HUMAN_ONLY_JOBS, /datum/job/officer, /datum/job/liaison, /datum/job/warden, /datum/job/doctor, /datum/job/medical_trainee), //Other jobs unavailable via branch restrictions, + /singleton/species/unathi = list(HUMAN_ONLY_JOBS, /datum/job/liaison, /datum/job/warden), //Other jobs unavailable via branch restrictions, + /singleton/species/unathi/yeosa = list(HUMAN_ONLY_JOBS, /datum/job/liaison, /datum/job/warden), + /singleton/species/skrell = list(HUMAN_ONLY_JOBS), + /singleton/species/machine = list(HUMAN_ONLY_JOBS, /datum/job/liaison, /datum/job/psychiatrist, /datum/job/bridgeofficer, /datum/job/senior_engineer, /datum/job/warden, /datum/job/qm, /datum/job/senior_scientist, /datum/job/chief_steward), + /singleton/species/diona = list(HUMAN_ONLY_JOBS, /datum/job/officer, /datum/job/liaison, /datum/job/warden, /datum/job/doctor, /datum/job/medical_trainee), //Other jobs unavailable via branch restrictions, ) #undef HUMAN_ONLY_JOBS @@ -53,7 +53,7 @@ // Most species are restricted from SCG security and command roles if(job && (job.department_flag & COM) && length(job.allowed_branches) && !(/datum/mil_branch/civilian in job.allowed_branches)) for(var/species_name in list(SPECIES_IPC, SPECIES_SKRELL, SPECIES_UNATHI)) - var/datum/species/S = all_species[species_name] + var/singleton/species/S = GLOB.species_by_name[species_name] var/species_blacklist = species_to_job_blacklist[S.type] if(!species_blacklist) species_blacklist = list() diff --git a/maps/torch/torch_ranks.dm b/maps/torch/torch_ranks.dm index 0a690e0516a7e..3b65e84c9eb40 100644 --- a/maps/torch/torch_ranks.dm +++ b/maps/torch/torch_ranks.dm @@ -31,9 +31,9 @@ ) species_to_branch_blacklist = list( - /datum/species/human = list(/datum/mil_branch/alien, /datum/mil_branch/skrell_fleet), - /datum/species/machine = list(/datum/mil_branch/alien, /datum/mil_branch/skrell_fleet), - /datum/species/vox = list( + /singleton/species/human = list(/datum/mil_branch/alien, /datum/mil_branch/skrell_fleet), + /singleton/species/machine = list(/datum/mil_branch/alien, /datum/mil_branch/skrell_fleet), + /singleton/species/vox = list( /datum/mil_branch/expeditionary_corps, /datum/mil_branch/fleet, /datum/mil_branch/civilian, @@ -43,17 +43,17 @@ ) species_to_branch_whitelist = list( - /datum/species/diona = list(/datum/mil_branch/civilian), - /datum/species/nabber = list(/datum/mil_branch/civilian), - /datum/species/skrell = list(/datum/mil_branch/civilian, /datum/mil_branch/expeditionary_corps, /datum/mil_branch/skrell_fleet), - /datum/species/unathi = list(/datum/mil_branch/civilian, /datum/mil_branch/expeditionary_corps), - /datum/species/unathi/yeosa = list(/datum/mil_branch/civilian, /datum/mil_branch/expeditionary_corps), - /datum/species/adherent = list(/datum/mil_branch/civilian), - /datum/species/vox = list(/datum/mil_branch/alien) + /singleton/species/diona = list(/datum/mil_branch/civilian), + /singleton/species/nabber = list(/datum/mil_branch/civilian), + /singleton/species/skrell = list(/datum/mil_branch/civilian, /datum/mil_branch/expeditionary_corps, /datum/mil_branch/skrell_fleet), + /singleton/species/unathi = list(/datum/mil_branch/civilian, /datum/mil_branch/expeditionary_corps), + /singleton/species/unathi/yeosa = list(/datum/mil_branch/civilian, /datum/mil_branch/expeditionary_corps), + /singleton/species/adherent = list(/datum/mil_branch/civilian), + /singleton/species/vox = list(/datum/mil_branch/alien) ) species_to_rank_blacklist = list( - /datum/species/machine = list( + /singleton/species/machine = list( /datum/mil_branch/solgov = list( /datum/mil_rank/sol/agent ) @@ -61,7 +61,7 @@ ) species_to_rank_whitelist = list( - /datum/species/machine = list( + /singleton/species/machine = list( /datum/mil_branch/expeditionary_corps = list( /datum/mil_rank/ec/e3, /datum/mil_rank/ec/e5, @@ -79,7 +79,7 @@ /datum/mil_rank/fleet/o1 ) ), - /datum/species/skrell = list( + /singleton/species/skrell = list( /datum/mil_branch/expeditionary_corps = list( /datum/mil_rank/ec/e3, /datum/mil_rank/ec/e5, @@ -87,19 +87,19 @@ /datum/mil_rank/ec/o1 ) ), - /datum/species/unathi = list( + /singleton/species/unathi = list( /datum/mil_branch/expeditionary_corps = list( /datum/mil_rank/ec/e3, /datum/mil_rank/ec/e5 ) ), - /datum/species/unathi/yeosa = list( + /singleton/species/unathi/yeosa = list( /datum/mil_branch/expeditionary_corps = list( /datum/mil_rank/ec/e3, /datum/mil_rank/ec/e5 ) ), - /datum/species/vox = list( + /singleton/species/vox = list( /datum/mil_branch/alien = list( /datum/mil_rank/alien )