diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index 9ec26b75067..247e1109f83 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -46,8 +46,8 @@ #define INIT_ORDER_DBCORE 18 #define INIT_ORDER_BLACKBOX 17 #define INIT_ORDER_SERVER_MAINT 16 -#define INIT_ORDER_JOBS 15 -#define INIT_ORDER_EVENTS 14 +#define INIT_ORDER_EVENTS 15 +#define INIT_ORDER_JOBS 14 #define INIT_ORDER_TICKER 13 #define INIT_ORDER_MAPPING 12 #define INIT_ORDER_ATOMS 11 diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm index cb4109436cc..0cb004b07c3 100644 --- a/code/controllers/configuration/entries/game_options.dm +++ b/code/controllers/configuration/entries/game_options.dm @@ -112,27 +112,7 @@ CONFIG_DEF(flag/show_game_type_odds) //if set this allows players to see the odd CONFIG_DEF(flag/join_with_mutant_race) //players can choose their mutant race before joining the game -CONFIG_DEF(keyed_flag_list/roundstart_races) //races you can play as from the get go. If left undefined the game's roundstart var for species is used - var/first_edit = TRUE - -/datum/config_entry/keyed_flag_list/roundstart_races/New() - for(var/I in subtypesof(/datum/species)) - var/datum/species/S = I - if(initial(S.roundstart)) - value[initial(S.id)] = TRUE - ..() - -/datum/config_entry/keyed_flag_list/roundstart_races/ValidateAndSet(str_val) - var/list/old_val - if(first_edit) - old_val = value - old_val = old_val.Copy() - . = ..() - if(first_edit) - if(!.) - value = old_val - else - first_edit = FALSE +CONFIG_DEF(keyed_flag_list/roundstart_races) //races you can play as from the get go. CONFIG_DEF(flag/join_with_mutant_humans) //players can pick mutant bodyparts for humans before joining the game @@ -188,7 +168,7 @@ CONFIG_DEF(number/run_delay) //Used for modifying movement speed for mobs. CONFIG_DEF(number/walk_delay) - + CONFIG_DEF(number/human_delay) //Mob specific modifiers. NOTE: These will affect different mob types in different ways CONFIG_DEF(number/robot_delay) CONFIG_DEF(number/monkey_delay) diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm index e34a68ae243..74221def4b4 100644 --- a/code/controllers/subsystem/job.dm +++ b/code/controllers/subsystem/job.dm @@ -18,6 +18,7 @@ SUBSYSTEM_DEF(job) SetupOccupations() if(CONFIG_GET(flag/load_jobs_from_txt)) LoadJobs() + generate_selectable_species() ..() diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 66aef98a82c..4474cbd6a54 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -12,7 +12,7 @@ SUBSYSTEM_DEF(ticker) var/force_ending = 0 //Round was ended by admin intervention // If true, there is no lobby phase, the game starts immediately. var/start_immediately = FALSE - var/setup_done = FALSE //All game setup done including mode post setup and + var/setup_done = FALSE //All game setup done including mode post setup and var/hide_mode = 0 var/datum/game_mode/mode = null @@ -86,7 +86,7 @@ SUBSYSTEM_DEF(ticker) var/list/provisional_title_music = flist("config/title_music/sounds/") var/list/music = list() var/use_rare_music = prob(1) - + for(var/S in provisional_title_music) var/lower = lowertext(S) var/list/L = splittext(lower,"+") @@ -114,18 +114,19 @@ SUBSYSTEM_DEF(ticker) if(byond_sound_formats[ext]) continue music -= S - + if(isemptylist(music)) music = world.file2list(ROUND_START_MUSIC_LIST, "\n") login_music = pick(music) else login_music = "config/title_music/sounds/[pick(music)]" - + if(!GLOB.syndicate_code_phrase) GLOB.syndicate_code_phrase = generate_code_phrase() if(!GLOB.syndicate_code_response) GLOB.syndicate_code_response = generate_code_phrase() + ..() start_at = world.time + (CONFIG_GET(number/lobby_countdown) * 10) diff --git a/code/datums/dna.dm b/code/datums/dna.dm index c764a3f7ccd..1b63e77bdd7 100644 --- a/code/datums/dna.dm +++ b/code/datums/dna.dm @@ -259,7 +259,7 @@ /mob/living/carbon/proc/create_dna() dna = new /datum/dna(src) if(!dna.species) - var/rando_race = pick(CONFIG_GET(keyed_flag_list/roundstart_races)) + var/rando_race = pick(GLOB.roundstart_races) dna.species = new rando_race() //proc used to update the mob's appearance after its dna UI has been changed diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 31126a6c08c..ee316b3eed0 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -470,7 +470,7 @@ // species datums R.fields["mrace"] = dna.species else - var/datum/species/rando_race = pick(CONFIG_GET(keyed_flag_list/roundstart_races)) + var/datum/species/rando_race = pick(GLOB.roundstart_races) R.fields["mrace"] = rando_race.type R.fields["ckey"] = mob_occupant.ckey diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 8859522ed26..fba60f34ab9 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -598,7 +598,7 @@ What a mess.*/ active1.fields["age"] = t1 if("species") if(istype(active1, /datum/data/record)) - var/t1 = input("Select a species", "Species Selection") as null|anything in CONFIG_GET(keyed_flag_list/roundstart_races) + var/t1 = input("Select a species", "Species Selection") as null|anything in GLOB.roundstart_races if(!canUseSecurityRecordsConsole(usr, t1, a1)) return active1.fields["species"] = t1 @@ -766,7 +766,7 @@ What a mess.*/ if(6) R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable") if(7) - R.fields["species"] = pick(CONFIG_GET(keyed_flag_list/roundstart_races)) + R.fields["species"] = pick(GLOB.roundstart_races) if(8) var/datum/data/record/G = pick(GLOB.data_core.general) R.fields["photo_front"] = G.fields["photo_front"] diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index 296e4ba757a..711f9baf0ba 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -101,8 +101,7 @@ ..() /obj/structure/mirror/magic/lesser/New() - var/list/L = CONFIG_GET(keyed_flag_list/roundstart_races) - choosable_races = L.Copy() + choosable_races = GLOB.roundstart_races.Copy() ..() /obj/structure/mirror/magic/badmin/New() diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 9c83e61ddb2..180c399c0b0 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -47,7 +47,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/allow_midround_antag = 1 var/preferred_map = null var/pda_style = MONO - + var/uses_glasses_colour = 0 //character preferences @@ -968,7 +968,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if("species") - var/result = input(user, "Select a species", "Species Selection") as null|anything in CONFIG_GET(keyed_flag_list/roundstart_races) + var/result = input(user, "Select a species", "Species Selection") as null|anything in GLOB.roundstart_races if(result) var/newtype = GLOB.species_list[result] diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index ccfa005f0f6..abed1fac48c 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -252,12 +252,11 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car //Species var/species_id S["species"] >> species_id - var/list/roundstart_races = CONFIG_GET(keyed_flag_list/roundstart_races) - if(species_id && (species_id in roundstart_races) && CONFIG_GET(flag/join_with_mutant_race)) + if(species_id && (species_id in GLOB.roundstart_races) && CONFIG_GET(flag/join_with_mutant_race)) var/newtype = GLOB.species_list[species_id] pref_species = new newtype() - else if (roundstart_races.len) - var/rando_race = pick(roundstart_races) + else if (GLOB.roundstart_races.len) + var/rando_race = pick(GLOB.roundstart_races) if (rando_race) pref_species = new rando_race() diff --git a/code/modules/events/holiday/halloween.dm b/code/modules/events/holiday/halloween.dm index 5415eab386b..db41a84d4ff 100644 --- a/code/modules/events/holiday/halloween.dm +++ b/code/modules/events/holiday/halloween.dm @@ -11,11 +11,6 @@ for(var/mob/living/carbon/human/H in GLOB.mob_list) var/obj/item/storage/backpack/b = locate() in H.contents new /obj/item/storage/spooky(b) - if(ishuman(H) || islizard(H)) - if(prob(50)) - H.set_species(/datum/species/skeleton) - else - H.set_species(/datum/species/zombie) for(var/mob/living/simple_animal/pet/dog/corgi/Ian/Ian in GLOB.mob_list) Ian.place_on_head(new /obj/item/bedsheet(Ian)) diff --git a/code/modules/mob/dead/new_player/preferences_setup.dm b/code/modules/mob/dead/new_player/preferences_setup.dm index 873c2184b20..633418f5717 100644 --- a/code/modules/mob/dead/new_player/preferences_setup.dm +++ b/code/modules/mob/dead/new_player/preferences_setup.dm @@ -15,7 +15,7 @@ facial_hair_color = hair_color eye_color = random_eye_color() if(!pref_species) - var/rando_race = pick(CONFIG_GET(keyed_flag_list/roundstart_races)) + var/rando_race = pick(GLOB.roundstart_races) pref_species = new rando_race() features = random_features() age = rand(AGE_MIN,AGE_MAX) diff --git a/code/modules/mob/living/brain/brain.dm b/code/modules/mob/living/brain/brain.dm index 94ed0129c71..c175acf9d6e 100644 --- a/code/modules/mob/living/brain/brain.dm +++ b/code/modules/mob/living/brain/brain.dm @@ -19,7 +19,7 @@ /mob/living/brain/proc/create_dna() stored_dna = new /datum/dna/stored(src) if(!stored_dna.species) - var/rando_race = pick(CONFIG_GET(keyed_flag_list/roundstart_races)) + var/rando_race = pick(GLOB.roundstart_races) stored_dna.species = new rando_race() /mob/living/brain/Destroy() diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 0f02162064e..29402766430 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1,5 +1,7 @@ // This code handles different species in the game. +GLOBAL_LIST_EMPTY(roundstart_races) + #define HEAT_DAMAGE_LEVEL_1 2 #define HEAT_DAMAGE_LEVEL_2 3 #define HEAT_DAMAGE_LEVEL_3 8 @@ -12,7 +14,6 @@ var/id // if the game needs to manually check your race to do something not included in a proc here, it will use this var/limbs_id //this is used if you want to use a different species limb sprites. Mainly used for angels as they look like humans. var/name // this is the fluff name. these will be left generic (such as 'Lizardperson' for the lizard race) so servers can change them to whatever - var/roundstart = 0 // can this mob be chosen at roundstart? (assuming the config option is checked?) var/default_color = "#FFF" // if alien colors are disabled, this is the color that will be used by that race var/sexes = 1 // whether or not the race has sexual characteristics. at the moment this is only 0 for skeletons and shadows @@ -86,6 +87,20 @@ ..() +/proc/generate_selectable_species() + for(var/I in subtypesof(/datum/species)) + var/datum/species/S = new I + if(S.check_roundstart_eligible()) + GLOB.roundstart_races += S.id + qdel(S) + if(!GLOB.roundstart_races.len) + GLOB.roundstart_races += "human" + +/datum/species/proc/check_roundstart_eligible() + if(id in (CONFIG_GET(keyed_flag_list/roundstart_races))) + return TRUE + return FALSE + /datum/species/proc/random_name(gender,unique,lastname) if(unique) return random_unique_name(gender) @@ -989,7 +1004,7 @@ if(radiation > RAD_MOB_VOMIT && prob(RAD_MOB_VOMIT_PROB)) H.vomit(10, TRUE) - + if(radiation > RAD_MOB_MUTATE) if(prob(1)) to_chat(H, "You mutate!") diff --git a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm index 0d7867c4f0b..f1532520b16 100644 --- a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm @@ -24,6 +24,10 @@ else if (light_amount < SHADOW_SPECIES_LIGHT_THRESHOLD) //heal in the dark H.heal_overall_damage(1,1) +/datum/species/shadow/check_roundstart_eligible() + if(SSevents.holidays && SSevents.holidays[HALLOWEEN]) + return TRUE + return ..() /datum/species/shadow/nightmare name = "Nightmare" @@ -60,7 +64,8 @@ return -1 return 0 - +/datum/species/shadow/nightmare/check_roundstart_eligible() + return FALSE //Organs diff --git a/code/modules/mob/living/carbon/human/species_types/skeletons.dm b/code/modules/mob/living/carbon/human/species_types/skeletons.dm index 401aff89280..80ac9ced0b1 100644 --- a/code/modules/mob/living/carbon/human/species_types/skeletons.dm +++ b/code/modules/mob/living/carbon/human/species_types/skeletons.dm @@ -11,3 +11,8 @@ damage_overlay_type = ""//let's not show bloody wounds or burns over bones. disliked_food = NONE liked_food = GROSS | MEAT | RAW + +/datum/species/skeleton/check_roundstart_eligible() + if(SSevents.holidays && SSevents.holidays[HALLOWEEN]) + return TRUE + return ..() \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species_types/synths.dm b/code/modules/mob/living/carbon/human/species_types/synths.dm index 45b4a28bb55..8b21c2a237e 100644 --- a/code/modules/mob/living/carbon/human/species_types/synths.dm +++ b/code/modules/mob/living/carbon/human/species_types/synths.dm @@ -118,4 +118,4 @@ else return ..() else - return ..() + return ..() \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species_types/zombies.dm b/code/modules/mob/living/carbon/human/species_types/zombies.dm index 533c9d20f6f..d6dc833e639 100644 --- a/code/modules/mob/living/carbon/human/species_types/zombies.dm +++ b/code/modules/mob/living/carbon/human/species_types/zombies.dm @@ -14,6 +14,11 @@ disliked_food = NONE liked_food = GROSS | MEAT | RAW +/datum/species/zombie/check_roundstart_eligible() + if(SSevents.holidays && SSevents.holidays[HALLOWEEN]) + return TRUE + return ..() + /datum/species/zombie/infectious name = "Infectious Zombie" id = "memezombies" @@ -24,6 +29,10 @@ mutanteyes = /obj/item/organ/eyes/night_vision/zombie var/regen_cooldown = 0 +/datum/species/zombie/infectious/check_roundstart_eligible() + return FALSE + + /datum/species/zombie/infectious/spec_stun(mob/living/carbon/human/H,amount) . = min(2, amount)