diff --git a/config/example/config.toml b/config/example/config.toml index 23f693da64a4..838bc4243adc 100644 --- a/config/example/config.toml +++ b/config/example/config.toml @@ -1174,7 +1174,7 @@ tag = "mindflayer" "Special Operations Officer", "Solar Federation General", ] -possible_species = ["Machine"] +"allowed_species" = ["Machine"] [[antag_mix_gamemode_configuration.antag_scenarios_configuration]] tag = "vox_raiders" diff --git a/modular_ss220/antagonists/code/antag_datum.dm b/modular_ss220/antagonists/code/antag_datum.dm index 30da48284bec..312890178106 100644 --- a/modular_ss220/antagonists/code/antag_datum.dm +++ b/modular_ss220/antagonists/code/antag_datum.dm @@ -1,4 +1,4 @@ -/datum/antagonist/proc/make_body(loc_spawn, datum/mind/mind, try_use_preference = FALSE, species_name = null, list/possible_species) +/datum/antagonist/proc/make_body(loc_spawn, datum/mind/mind, try_use_preference = FALSE, species_name = null, list/species_pool) var/datum/character_save/character var/mob/living/carbon/human/H = mind.current if(!H) @@ -8,18 +8,20 @@ var/client/client = mind.current.client if(try_use_preference && client && client.prefs && length(client.prefs.character_saves)) - var/temp_species_name = species_name - if(!temp_species_name) - if(length(possible_species)) - temp_species_name = pick(possible_species) - else - temp_species_name = "Human" + var/list/species_pool_to_use + if(species_name) + species_pool_to_use.Add(species_name) + else + species_pool_to_use = species_pool + + var/list/eligible_characters for(var/datum/character_save/temp_character in client.prefs.character_saves) - if(temp_character.species == temp_species_name) - character = temp_character - species_name = temp_species_name - new_name = random_name(character.gender, character.species) - break + for(var/temp_species_name in species_pool_to_use) + if(temp_character.species == temp_species_name) + eligible_characters.Add(temp_character) + + if(eligible_characters.len > 0) + character = pick(eligible_characters) if(!character) // Randomize appearance diff --git a/modular_ss220/antagonists/code/antag_mix/scenarios/antag_scenario.dm b/modular_ss220/antagonists/code/antag_mix/scenarios/antag_scenario.dm index 211792b72c83..241b65c38249 100644 --- a/modular_ss220/antagonists/code/antag_mix/scenarios/antag_scenario.dm +++ b/modular_ss220/antagonists/code/antag_mix/scenarios/antag_scenario.dm @@ -37,6 +37,8 @@ var/list/protected_roles = list() /// Species that can't be chosen for the scenario var/list/restricted_species = list() + /// Only species that can be chosen for the scenario, null - for all + var/list/allowed_species = null /// List of available candidates for this scenario var/list/mob/new_player/candidates = list() /// List of players that were drafted to be antagonists of this scenario @@ -46,12 +48,12 @@ var/is_crew_antag = TRUE /// Spawn antagonist at landmark name var/obj/effect/landmark/spawner/landmark_type = /obj/effect/landmark/spawner/xeno - /// What species can be used for the antagonist - var/list/possible_species = list("Human") - /// Recommended species at prefs to increase the chance of getting a role for RP-experienced players + /// What species can be used to create antagonist + var/list/species_pool = null + // Recommended species at prefs to increase the chance of getting a role for RP-experienced players + // For example list("Vox" = 8) modifier that increases the chance of landing by 8 times var/list/recommended_species_active_pref - /// Multiplication modifier that increases the chance of landing by N times - var/recommended_species_mod = 0 + /datum/antag_scenario/New() if(abstract) @@ -176,6 +178,7 @@ for(var/mob/new_player/candidate as anything in candidates) var/client/candidate_client = candidate.client var/datum/mind/candidate_mind = candidate.mind + var/my_specie = candidate_client.prefs.active_character.species if(!candidate_client || !candidate_mind || !candidate.ready) candidates.Remove(candidate) continue @@ -196,7 +199,11 @@ candidates.Remove(candidate) continue - if(!(antag_role in candidate.client.prefs.be_special) || (candidate.client.prefs.active_character.species in restricted_species)) + if(!(antag_role in candidate_client.prefs.be_special) || (my_specie in restricted_species)) + candidates.Remove(candidate) + continue + + if(!((isnull(allowed_species)) || (my_specie in allowed_species))) candidates.Remove(candidate) continue @@ -241,9 +248,9 @@ * Сreate characters if the antagonist is not from the crew. */ /datum/antag_scenario/proc/make_character(datum/mind/mind, turf/loc_spawn) - var/picked_species = pick(possible_species) + var/picked_species = pick(species_pool) var/datum/antagonist/temp_antag_datum = locate(antag_datum) in mind.antag_datums - temp_antag_datum.make_body(loc_spawn, mind, TRUE, picked_species, possible_species) + temp_antag_datum.make_body(loc_spawn, mind, TRUE, picked_species, species_pool) /datum/antag_scenario/proc/equip_character(datum/mind/mind) return TRUE @@ -254,9 +261,6 @@ if(!length(candidates)) return - if(!recommended_species_mod) - return - if(!length(recommended_species_active_pref)) return @@ -264,6 +268,6 @@ var/list/datum/character_save/characters = candidate.client.prefs.character_saves for(var/datum/character_save/character in characters) if(character.species in recommended_species_active_pref) - candidates[candidate] = recommended_species_mod + candidates[candidate] = recommended_species_active_pref[character.species] else candidates[candidate] = 1 diff --git a/modular_ss220/antagonists/code/antag_mix/scenarios/major_scenarios.dm b/modular_ss220/antagonists/code/antag_mix/scenarios/major_scenarios.dm index 44efb1b899a4..d46c22f8319a 100644 --- a/modular_ss220/antagonists/code/antag_mix/scenarios/major_scenarios.dm +++ b/modular_ss220/antagonists/code/antag_mix/scenarios/major_scenarios.dm @@ -17,9 +17,8 @@ is_crew_antag = FALSE landmark_type = /obj/effect/landmark/spawner/vox_raider - possible_species = list("Vox") - recommended_species_active_pref = list("Vox") - recommended_species_mod = 8 + species_pool = list("Vox") + recommended_species_active_pref = list("Vox" = 8) /datum/antag_scenario/team/vox_raiders/equip_character(datum/mind/mind) diff --git a/modular_ss220/antagonists/code/antag_mix/scenarios/minor_scenarios.dm b/modular_ss220/antagonists/code/antag_mix/scenarios/minor_scenarios.dm index 408c3f390a1a..ebffa5ec040c 100644 --- a/modular_ss220/antagonists/code/antag_mix/scenarios/minor_scenarios.dm +++ b/modular_ss220/antagonists/code/antag_mix/scenarios/minor_scenarios.dm @@ -115,7 +115,8 @@ "Special Operations Officer", "Syndicate Officer", "Solar Federation General") - possible_species = list("Machine") + + allowed_species = list("Machine") /datum/antag_scenario/team/blood_brothers name = "Blood Brothers" diff --git a/modular_ss220/antagonists/code/vox_raider/vox_raider_datum.dm b/modular_ss220/antagonists/code/vox_raider/vox_raider_datum.dm index b906b61023b7..fc5dfd27d679 100644 --- a/modular_ss220/antagonists/code/vox_raider/vox_raider_datum.dm +++ b/modular_ss220/antagonists/code/vox_raider/vox_raider_datum.dm @@ -147,6 +147,6 @@ if(mind.current) H.equipOutfit(/datum/outfit/vox, visualsOnly) -/datum/antagonist/vox_raider/make_body(spawn_loc, datum/mind/mind, try_use_preference = FALSE, species_name = null, list/possible_species) +/datum/antagonist/vox_raider/make_body(spawn_loc, datum/mind/mind, try_use_preference = FALSE, species_name = null, list/species_pool) . = ..() mind.store_memory(" Я Вокс-Рейдер, основа моя: беречь стаю, тащить ценности. .")