mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Fix
- 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:
@@ -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 << "<span class='notice'><B>SYSTEM ERROR:</B> Memory index 0x00001ca89b corrupted.</span>"
|
||||
sleep(10)
|
||||
malf << "<B>running MEMCHCK</B>"
|
||||
|
||||
@@ -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 << "<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
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user