diff --git a/code/datums/ai_laws/ai_laws.dm b/code/datums/ai_laws/ai_laws.dm index 22384c1c922..c3ea9fcfadf 100644 --- a/code/datums/ai_laws/ai_laws.dm +++ b/code/datums/ai_laws/ai_laws.dm @@ -1,5 +1,9 @@ #define AI_LAWS_ASIMOV "asimov" +/// See [/proc/get_round_default_lawset], do not get directily. +/// This is the default lawset for silicons. +GLOBAL_VAR(round_default_lawset) + /** * A getter that sets up the round default if it has not been yet. * @@ -9,10 +13,9 @@ * This requires config, so it is generated at the first request to use this var. */ /proc/get_round_default_lawset() - var/static/round_default_lawset - if(!round_default_lawset) - round_default_lawset = setup_round_default_laws() - return round_default_lawset + if(!GLOB.round_default_lawset) + GLOB.round_default_lawset = setup_round_default_laws() + return GLOB.round_default_lawset //different settings for configured defaults diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm index 92748f1d6a4..133038f3af6 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm @@ -696,3 +696,5 @@ for(var/department_type in department_types) create_separatist_nation(department_type, announcement = FALSE, dangerous = FALSE, message_admins = FALSE) + + GLOB.round_default_lawset = /datum/ai_laws/united_nations diff --git a/code/modules/antagonists/separatist/nation_creation.dm b/code/modules/antagonists/separatist/nation_creation.dm index d9dec149552..5d010740f0c 100644 --- a/code/modules/antagonists/separatist/nation_creation.dm +++ b/code/modules/antagonists/separatist/nation_creation.dm @@ -48,8 +48,8 @@ nation.generate_nation_objectives(dangerous, department_target) //convert current members of the department - for(var/mob/living/carbon/human/possible_separatist as anything in GLOB.human_list) - if(!possible_separatist.mind) + for(var/mob/living/possible_separatist in GLOB.player_list) + if(isnull(possible_separatist.mind)) continue var/datum/mind/separatist_mind = possible_separatist.mind if(!(separatist_mind.assigned_role.title in jobs_to_revolt)) diff --git a/code/modules/antagonists/separatist/objectives.dm b/code/modules/antagonists/separatist/objectives.dm index 250eed1b188..3e22907796e 100644 --- a/code/modules/antagonists/separatist/objectives.dm +++ b/code/modules/antagonists/separatist/objectives.dm @@ -51,3 +51,20 @@ /datum/objective/separatist_fluff/check_completion() return TRUE + +/datum/objective/united_nations + explanation_text = "Maintain the peace on the station. Ensure every nation has a delegate alive by the end of the round." + team_explanation_text = "Maintain the peace on the station. Ensure every nation has a delegate alive by the end of the round." + +/datum/objective/united_nations/check_completion() + var/list/all_separatists = list() + var/list/alive_separatists = list() + + for(var/datum/team/nation/separatist_team in GLOB.antagonist_teams) + all_separatists |= separatist_team.department + for(var/datum/mind/separatist as anything in separatist_team.members) + if(considered_escaped(separatist)) + alive_separatists |= separatist_team.department + break + + return length(all_separatists) == length(alive_separatists) diff --git a/code/modules/antagonists/separatist/separatist.dm b/code/modules/antagonists/separatist/separatist.dm index 45ce9bf0ad5..6830cba8aef 100644 --- a/code/modules/antagonists/separatist/separatist.dm +++ b/code/modules/antagonists/separatist/separatist.dm @@ -42,13 +42,21 @@ * target_nation: string of the nation they need to destroy/befriend */ /datum/team/nation/proc/generate_nation_objectives(are_we_hostile = TRUE, datum/team/nation/target_nation) - dangerous_nation = are_we_hostile - if(dangerous_nation && target_nation) - var/datum/objective/destroy = new /datum/objective/destroy_nation(null, target_nation) - destroy.team = src - objectives += destroy - target_nation.war_declared(src) //they need to possibly get an objective back - var/datum/objective/fluff = new /datum/objective/separatist_fluff(null, name) + + var/datum/objective/fluff + if(istype(department, /datum/job_department/silicon)) + // snowflake but silicons have their own goals + fluff = new /datum/objective/united_nations() + + else + dangerous_nation = are_we_hostile + if(dangerous_nation && target_nation) + var/datum/objective/destroy = new /datum/objective/destroy_nation(null, target_nation) + destroy.team = src + objectives += destroy + target_nation.war_declared(src) //they need to possibly get an objective back + fluff = new /datum/objective/separatist_fluff(null, name) + fluff.team = src objectives += fluff update_all_member_objectives() @@ -89,10 +97,11 @@ //give ais their role as UN /datum/antagonist/separatist/apply_innate_effects(mob/living/mob_override) . = ..() - if(isAI(mob_override)) - var/mob/living/silicon/ai/united_nations_ai = mob_override - united_nations_ai.laws = new /datum/ai_laws/united_nations + var/mob/living/silicon/ai/united_nations_ai = mob_override || owner.current + if(isAI(united_nations_ai)) + united_nations_ai.laws = new /datum/ai_laws/united_nations() united_nations_ai.laws.associate(united_nations_ai) + united_nations_ai.show_laws() /datum/antagonist/separatist/on_removal() remove_objectives()