[MIRROR] Adds traitor final objective to make the station AI malf [MDB IGNORE] (#19376)

* Adds traitor final objective to make the station AI malf

* Update malf_ai.dm

---------

Co-authored-by: SuperSlayer <91609255+SuperSlayer0@users.noreply.github.com>
Co-authored-by: Zonespace <41448081+Zonespace27@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-03-05 02:48:31 +01:00
committed by GitHub
parent cc0103b60d
commit a6ecf76aeb
7 changed files with 149 additions and 1 deletions
@@ -39,6 +39,8 @@
// SKYRAT EDIT END
employer = pick(GLOB.ai_employers)
if(!employer)
employer = pick(GLOB.ai_employers)
malfunction_flavor = strings(MALFUNCTION_FLAVOR_FILE, employer)
@@ -283,4 +285,41 @@
return malf_ai_icon
//Subtype of Malf AI datum, used for one of the traitor final objectives
/datum/antagonist/malf_ai/infected
name = "Infected AI"
employer = "Infected AI"
///The player, to who is this AI slaved
var/datum/mind/boss
/datum/antagonist/malf_ai/infected/New(give_objectives = TRUE, datum/mind/new_boss)
. = ..()
if(new_boss)
boss = new_boss
/datum/antagonist/malf_ai/infected/forge_ai_objectives()
if(!boss)
return
var/datum/objective/protect/protection_objective = new
protection_objective.owner = owner
protection_objective.target = boss
protection_objective.update_explanation_text()
objectives += protection_objective
/datum/antagonist/malf_ai/infected/add_law_zero()
if(!boss)
return
var/mob/living/silicon/ai/malf_ai = owner.current
malf_ai.laws = new /datum/ai_laws/syndicate_override
var/mob/living/boss_mob = boss.current
malf_ai.set_zeroth_law("Only [boss_mob.real_name] and people [boss_mob.p_they()] designate[boss_mob.p_s()] as being such are Syndicate Agents.")
malf_ai.set_syndie_radio()
to_chat(malf_ai, "Your radio has been upgraded! Use :t to speak on an encrypted channel with Syndicate Agents!")
malf_ai.add_malf_picker()
#undef PROB_SPECIAL
@@ -5,6 +5,7 @@
/datum/traitor_objective/ultimate/battlecruiser = 1,
/datum/traitor_objective/ultimate/space_dragon = 1,
/datum/traitor_objective/ultimate/supermatter_cascade = 1,
/datum/traitor_objective/ultimate/infect_ai = 1,
)
weight = 100
@@ -0,0 +1,56 @@
/datum/traitor_objective/ultimate/infect_ai
name = "Infect the station AI with an experimental virus."
description = "Infect the station AI with an experimental virus. Go to %AREA% to receive an infected law upload board \
and use it on the AI core or a law upload console."
///area type the objective owner must be in to recieve the law upload module
var/area/board_area_pickup
///checker on whether we have sent the law upload module
var/sent_board = FALSE
/datum/traitor_objective/ultimate/infect_ai/can_generate_objective(generating_for, list/possible_duplicates)
. = ..()
if(!.)
return FALSE
for(var/mob/living/silicon/ai/ai in GLOB.ai_list)
if(ai.stat == DEAD || ai.mind?.has_antag_datum(/datum/antagonist/malf_ai) || !is_station_level(ai.z))
continue
return TRUE
return FALSE
/datum/traitor_objective/ultimate/infect_ai/generate_objective(datum/mind/generating_for, list/possible_duplicates)
var/list/possible_areas = GLOB.the_station_areas.Copy()
for(var/area/possible_area as anything in possible_areas)
//remove areas too close to the destination, too obvious for our poor shmuck, or just unfair
if(istype(possible_area, /area/station/hallway) || istype(possible_area, /area/station/security))
possible_areas -= possible_area
if(!length(possible_areas))
return FALSE
board_area_pickup = pick(possible_areas)
replace_in_name("%AREA%", initial(board_area_pickup.name))
return TRUE
/datum/traitor_objective/ultimate/infect_ai/generate_ui_buttons(mob/user)
var/list/buttons = list()
if(!sent_board)
buttons += add_ui_button("", "Pressing this will call down a pod with an infected law upload board.", "wifi", "upload_board")
return buttons
/datum/traitor_objective/ultimate/infect_ai/ui_perform_action(mob/living/user, action)
. = ..()
switch(action)
if("upload_board")
if(sent_board)
return
var/area/delivery_area = get_area(user)
if(delivery_area.type != board_area_pickup)
to_chat(user, span_warning("You must be in [initial(board_area_pickup.name)] to receive the infected law upload board."))
return
sent_board = TRUE
podspawn(list(
"target" = get_turf(user),
"style" = STYLE_SYNDICATE,
"spawn" = /obj/item/ai_module/malf,
))