- Malfunction gamemode should now be startable. Probably not the nicest way to do it, but since the antag system is not documented at all i have no idea how to do it in nicer way.
This commit is contained in:
Atlantiscze
2015-05-06 01:31:13 +02:00
parent 024dabef7b
commit c34b8850a6
2 changed files with 24 additions and 18 deletions

View File

@@ -9,27 +9,30 @@ var/datum/antagonist/rogue_ai/malf
welcome_text = "You are malfunctioning! You do not have to follow any laws." 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." victory_text = "The AI has taken control of all of the station's systems."
loss_text = "The AI has been shut down!" 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 = 1
max_antags_round = 1 max_antags_round = 3
/datum/antagonist/rogue_ai/New() /datum/antagonist/rogue_ai/New()
..() ..()
malf = src malf = src
/datum/antagonist/rogue_ai/get_candidates() /datum/antagonist/rogue_ai/get_candidates()
candidates = ticker.mode.get_players_for_role(role_type, id) ..()
for(var/datum/mind/player in candidates) for(var/datum/mind/player in candidates)
if(player.assigned_role != "AI") if(player.assigned_role != "AI")
candidates -= player candidates -= player
if(!candidates.len) if(!candidates.len)
return list() return list()
return candidates
/*
/datum/antagonist/rogue_ai/attempt_spawn() /datum/antagonist/rogue_ai/attempt_spawn()
var/datum/mind/player = pick(candidates) var/datum/mind/player = pick(candidates)
current_antagonists |= player current_antagonists |= player
return 1 return 1
*/
// Ensures proper reset of all malfunction related things. // Ensures proper reset of all malfunction related things.
/datum/antagonist/rogue_ai/remove_antagonist(var/datum/mind/player, var/show_message, var/implanted) /datum/antagonist/rogue_ai/remove_antagonist(var/datum/mind/player, var/show_message, var/implanted)
@@ -42,6 +45,9 @@ 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. // 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) /datum/antagonist/rogue_ai/greet(var/datum/mind/player)
// Initializes the AI's malfunction stuff.
spawn(0)
if(!..()) if(!..())
return return
@@ -56,7 +62,7 @@ var/datum/antagonist/rogue_ai/malf
var/mob/living/silicon/ai/malf = player.current var/mob/living/silicon/ai/malf = player.current
spawn(50)
malf << "<span class='notice'><B>SYSTEM ERROR:</B> Memory index 0x00001ca89b corrupted.</span>" malf << "<span class='notice'><B>SYSTEM ERROR:</B> Memory index 0x00001ca89b corrupted.</span>"
sleep(10) sleep(10)
malf << "<B>running MEMCHCK</B>" malf << "<B>running MEMCHCK</B>"

View File

@@ -90,6 +90,9 @@ var/global/datum/controller/gameticker/ticker
src.mode = new mtype src.mode = new mtype
else else
src.mode = config.pick_mode(master_mode) 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()) if(!mode_started && !src.mode.can_start())
world << "<B>Unable to start [mode.name].</B> Not enough players, [mode.required_players] players needed. Reverting to pre-game lobby." world << "<B>Unable to start [mode.name].</B> Not enough players, [mode.required_players] players needed. Reverting to pre-game lobby."
current_state = GAME_STATE_PREGAME current_state = GAME_STATE_PREGAME
@@ -97,9 +100,6 @@ var/global/datum/controller/gameticker/ticker
job_master.ResetOccupations() job_master.ResetOccupations()
return 0 return 0
//Configure mode and assign player to special mode stuff
job_master.DivideOccupations() //Distribute jobs
if(hide_mode) if(hide_mode)
var/list/modes = new var/list/modes = new
for (var/datum/game_mode/M in runnable_modes) for (var/datum/game_mode/M in runnable_modes)