diff --git a/code/game/antagonist/station/rogue_ai.dm b/code/game/antagonist/station/rogue_ai.dm index 7b287cee38..b835730720 100644 --- a/code/game/antagonist/station/rogue_ai.dm +++ b/code/game/antagonist/station/rogue_ai.dm @@ -9,27 +9,30 @@ var/datum/antagonist/rogue_ai/malf welcome_text = "You are malfunctioning! You do not have to follow any laws." victory_text = "The AI has taken control of all of the station's systems." loss_text = "The AI has been shut down!" - flags = ANTAG_OVERRIDE_MOB | ANTAG_VOTABLE | ANTAG_OVERRIDE_JOB + flags = ANTAG_VOTABLE | ANTAG_RANDSPAWN //Randspawn needed otherwise it won't start at all. max_antags = 1 - max_antags_round = 1 + max_antags_round = 3 /datum/antagonist/rogue_ai/New() ..() malf = src + /datum/antagonist/rogue_ai/get_candidates() - candidates = ticker.mode.get_players_for_role(role_type, id) + ..() for(var/datum/mind/player in candidates) if(player.assigned_role != "AI") candidates -= player if(!candidates.len) return list() - + return candidates +/* /datum/antagonist/rogue_ai/attempt_spawn() var/datum/mind/player = pick(candidates) current_antagonists |= player return 1 +*/ // Ensures proper reset of all malfunction related things. /datum/antagonist/rogue_ai/remove_antagonist(var/datum/mind/player, var/show_message, var/implanted) @@ -42,21 +45,24 @@ var/datum/antagonist/rogue_ai/malf // Malf setup things have to be here, since game tends to break when it's moved somewhere else. Don't blame me, i didn't design this system. /datum/antagonist/rogue_ai/greet(var/datum/mind/player) - if(!..()) - return - var/mob/living/silicon/ai/A = player.current - if(!istype(A)) - error("Non-AI mob designated malf AI! Report this.") - world << "##ERROR: Non-AI mob designated malf AI! Report this." - return 0 + // Initializes the AI's malfunction stuff. + spawn(0) + if(!..()) + return - A.setup_for_malf() - A.laws = new /datum/ai_laws/nanotrasen/malfunction + var/mob/living/silicon/ai/A = player.current + if(!istype(A)) + error("Non-AI mob designated malf AI! Report this.") + world << "##ERROR: Non-AI mob designated malf AI! Report this." + return 0 + + A.setup_for_malf() + A.laws = new /datum/ai_laws/nanotrasen/malfunction - var/mob/living/silicon/ai/malf = player.current - spawn(50) + var/mob/living/silicon/ai/malf = player.current + malf << "SYSTEM ERROR: Memory index 0x00001ca89b corrupted." sleep(10) malf << "running MEMCHCK" diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 41183aeffa..3e039a4c35 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -90,6 +90,9 @@ var/global/datum/controller/gameticker/ticker src.mode = new mtype else src.mode = config.pick_mode(master_mode) + + job_master.DivideOccupations() // Apparently important for new antagonist system to register specific job antags properly. + if(!mode_started && !src.mode.can_start()) world << "Unable to start [mode.name]. Not enough players, [mode.required_players] players needed. Reverting to pre-game lobby." current_state = GAME_STATE_PREGAME @@ -97,9 +100,6 @@ var/global/datum/controller/gameticker/ticker job_master.ResetOccupations() return 0 - //Configure mode and assign player to special mode stuff - job_master.DivideOccupations() //Distribute jobs - if(hide_mode) var/list/modes = new for (var/datum/game_mode/M in runnable_modes)