Editing stuff to let it compile (see description)
Malf AI is no longer available as a roundstart ruleset because antag assignment happens before job assignment. On secret, this is not a problem, but on dynamic, there is no way to make malfunctioning AI limited to certain threat levels except by making it a delayed ruleset. Unfortunately, with the upstream changes, delayed rulesets were removed--all roundstart rulesets are delayed, and if it were to roll malf AI, it would simply error, make a runtime stack trace and, in general, shit the bed. There would be no roundstart antag that round, which is *kind of* a problem I'm desperate to fix. So, no more roundstart malf--it's either that or some rounds having no roundstart antags at all.
This commit is contained in:
@@ -41,62 +41,6 @@
|
||||
log_game("DYNAMIC: Checking if we can turn someone into a traitor.")
|
||||
mode.picking_specific_rule(/datum/dynamic_ruleset/midround/autotraitor)
|
||||
|
||||
//////////////////////////////////////////////
|
||||
// //
|
||||
// MALF AI //
|
||||
// //
|
||||
//////////////////////////////////////////////
|
||||
|
||||
/datum/dynamic_ruleset/roundstart/malf_ai
|
||||
name = "Malfunctioning AI"
|
||||
config_tag = "malf_ai"
|
||||
antag_datum = /datum/antagonist/traitor
|
||||
antag_flag = ROLE_MALF
|
||||
enemy_roles = list("Security Officer", "Warden","Detective","Head of Security", "Captain", "Scientist", "Chemist", "Research Director", "Chief Engineer")
|
||||
exclusive_roles = list("AI")
|
||||
required_enemies = list(4,4,4,4,4,4,2,2,2,0)
|
||||
required_candidates = 1
|
||||
weight = 1
|
||||
cost = 35
|
||||
requirements = list(101,101,101,100,90,80,70,60,50,50)
|
||||
high_population_requirement = 50
|
||||
required_type = /mob/living/silicon/ai
|
||||
delay = 30 SECONDS
|
||||
var/autotraitor_cooldown = 450 // 15 minutes (ticks once per 2 sec)
|
||||
|
||||
/datum/dynamic_ruleset/roundstart/malf_ai/trim_candidates()
|
||||
..()
|
||||
candidates = candidates[CURRENT_LIVING_PLAYERS]
|
||||
for(var/mob/living/player in candidates)
|
||||
if(!isAI(player))
|
||||
candidates -= player
|
||||
continue
|
||||
if(is_centcom_level(player.z))
|
||||
candidates -= player
|
||||
continue
|
||||
if(player.mind && (player.mind.special_role || player.mind.antag_datums?.len > 0))
|
||||
candidates -= player
|
||||
|
||||
/datum/dynamic_ruleset/roundstart/malf_ai/execute()
|
||||
if(!candidates || !candidates.len)
|
||||
return FALSE
|
||||
var/mob/living/silicon/ai/M = pick(candidates)
|
||||
candidates -= M
|
||||
assigned += M.mind
|
||||
var/datum/antagonist/traitor/AI = new
|
||||
M.mind.special_role = antag_flag
|
||||
M.mind.add_antag_datum(AI)
|
||||
return TRUE
|
||||
|
||||
/datum/dynamic_ruleset/roundstart/malf_ai/rule_process()
|
||||
if (autotraitor_cooldown > 0)
|
||||
autotraitor_cooldown--
|
||||
else
|
||||
autotraitor_cooldown = 450 // 15 minutes
|
||||
message_admins("Checking if we can turn someone into a traitor.")
|
||||
log_game("DYNAMIC: Checking if we can turn someone into a traitor.")
|
||||
mode.picking_specific_rule(/datum/dynamic_ruleset/midround/autotraitor)
|
||||
|
||||
//////////////////////////////////////////
|
||||
// //
|
||||
// BLOOD BROTHERS //
|
||||
|
||||
Reference in New Issue
Block a user