mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-30 11:32:20 +00:00
About The Super Hyper Ultra Ultimate Deluxe Perfect Amazing Shining Mob Spawn Refactor
The Super Hyper Ultra Ultimate Deluxe Perfect Amazing Shining Mob Spawn Refactor is my attempt to clean up the file structure, the code, and the type tree for mob spawns.
Splits mob spawn types into corpses (dead spawns) and ghost roles (living spawns you can possess). The vars that didn't make sense for corpses and vice versa for ghost roles are now appropriately there
Because of above, there are no longer the fucking "death, roundstart, and instant" vars. thank god
Removes a lot of single or very few used vars, whose properties can be applied on special().
All Mob Spawns are given fitting folders instead of just being stuck in a single ghost roles file. Corpses are in the corpse folder, Ghost Roles are in the ghost role folder. Only exception are drones which should stay near their respective homes
Just generally cleaner all around you know
spider structures file renamed to spiderwebs now that spider eggs are gone
Why Super Hyper Ultra Ultimate Deluxe Perfect Amazing Shining Mob Spawn Refactor Is Good For The Game
The Super Hyper Ultra Ultimate Deluxe Perfect Amazing Shining Mob Spawn Refactor cleans up so many terrible cases and uses
Changelog For The Super Hyper Ultra Ultimate Deluxe Perfect Amazing Shining Mob Spawn Refactor
cl armhulen
refactor: Mob spawns are refactored, no more assortment of "random, instant, and roundstart" vars on every mob spawn type
refactor: if there are some minimal differences in how mob spawners feel, that's why!
/cl
52 lines
2.0 KiB
Plaintext
52 lines
2.0 KiB
Plaintext
/// Verifies that all glands for an egg are valid
|
|
/datum/unit_test/mob_spawn
|
|
|
|
/datum/unit_test/mob_spawn/Run()
|
|
|
|
//these are not expected to be filled out as they are base prototypes
|
|
var/list/prototypes = list(
|
|
/obj/effect/mob_spawn,
|
|
/obj/effect/mob_spawn/corpse,
|
|
/obj/effect/mob_spawn/corpse/human,
|
|
/obj/effect/mob_spawn/ghost_role,
|
|
/obj/effect/mob_spawn/ghost_role/human,
|
|
)
|
|
|
|
//ghost role checks
|
|
for(var/role_spawn_path in subtypesof(/obj/effect/mob_spawn/ghost_role) - prototypes)
|
|
var/obj/effect/mob_spawn/ghost_role/ghost_role = allocate(role_spawn_path)
|
|
|
|
if(ghost_role.outfit_override)
|
|
Fail("[ghost_role.type] has a defined \"outfit_override\" list, which is only for mapping. Do not set this!")
|
|
|
|
if(ghost_role.mob_type != /mob/living/carbon/human)
|
|
//vars that must not be set if the mob type isn't human
|
|
var/list/human_only_vars = list(
|
|
"mob_species",
|
|
"outfit",
|
|
"hairstyle",
|
|
"facial_hairstyle",
|
|
"haircolor",
|
|
"facial_haircolor",
|
|
"skin_tone",
|
|
)
|
|
for(var/human_only_var in human_only_vars)
|
|
if(ghost_role.vars[human_only_var])
|
|
Fail("[ghost_role.type] has a defined \"[human_only_var]\" HUMAN ONLY var, but this type doesn't spawn humans.")
|
|
|
|
//vars that must be set on
|
|
var/list/required_vars = list(
|
|
//mob_type is not included because the errors on it are loud and some types choose their mob_type on selection
|
|
"prompt_name" = "Your ghost role has broken tgui without it.",
|
|
//these must be set even if show_flavor is false because the spawn menu still uses them and in 2021 we simply must have higher quality roles
|
|
"you_are_text" = "Spawners menu uses it.",
|
|
"flavour_text" = "Spawners menu uses it.",
|
|
)
|
|
for(var/required_var in required_vars)
|
|
if(required_var == "prompt_name" && !ghost_role.prompt_ghost)
|
|
continue //only case it makes sense why you shouldn't have a prompt_name
|
|
if(!ghost_role.vars[required_var])
|
|
Fail("[ghost_role.type] must have \"[required_var]\" defined. Reason: [required_vars[required_var]]")
|
|
|
|
qdel(ghost_role)
|