Merge pull request #5502 from Citadel-Station-13/upstream-merge-35586
[MIRROR] Cleans up remnant traitor cyborg code and AI hacking.
This commit is contained in:
@@ -1,78 +1,78 @@
|
||||
|
||||
|
||||
/obj/machinery/computer/upload
|
||||
var/mob/living/silicon/current = null //The target of future law uploads
|
||||
icon_screen = "command"
|
||||
|
||||
/obj/machinery/computer/upload/attackby(obj/item/O, mob/user, params)
|
||||
if(istype(O, /obj/item/aiModule))
|
||||
var/obj/item/aiModule/M = O
|
||||
if(src.stat & (NOPOWER|BROKEN|MAINT))
|
||||
return
|
||||
if(!current)
|
||||
to_chat(user, "<span class='caution'>You haven't selected anything to transmit laws to!</span>")
|
||||
return
|
||||
if(!can_upload_to(current))
|
||||
to_chat(user, "<span class='caution'>Upload failed!</span> Check to make sure [current.name] is functioning properly.")
|
||||
current = null
|
||||
return
|
||||
var/turf/currentloc = get_turf(current)
|
||||
if(currentloc && user.z != currentloc.z)
|
||||
to_chat(user, "<span class='caution'>Upload failed!</span> Unable to establish a connection to [current.name]. You're too far away!")
|
||||
current = null
|
||||
return
|
||||
M.install(current.laws, user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/upload/proc/can_upload_to(mob/living/silicon/S)
|
||||
if(S.stat == DEAD || S.syndicate)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/machinery/computer/upload/ai
|
||||
name = "\improper AI upload console"
|
||||
desc = "Used to upload laws to the AI."
|
||||
circuit = /obj/item/circuitboard/computer/aiupload
|
||||
|
||||
/obj/machinery/computer/upload/ai/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
|
||||
src.current = select_active_ai(user)
|
||||
|
||||
if (!src.current)
|
||||
to_chat(user, "<span class='caution'>No active AIs detected!</span>")
|
||||
else
|
||||
to_chat(user, "[src.current.name] selected for law changes.")
|
||||
|
||||
/obj/machinery/computer/upload/ai/can_upload_to(mob/living/silicon/ai/A)
|
||||
if(!A || !isAI(A))
|
||||
return 0
|
||||
if(A.control_disabled)
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/computer/upload/borg
|
||||
name = "cyborg upload console"
|
||||
desc = "Used to upload laws to Cyborgs."
|
||||
circuit = /obj/item/circuitboard/computer/borgupload
|
||||
|
||||
/obj/machinery/computer/upload/borg/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
|
||||
src.current = select_active_free_borg(user)
|
||||
|
||||
if(!src.current)
|
||||
to_chat(user, "<span class='caution'>No active unslaved cyborgs detected!</span>")
|
||||
else
|
||||
to_chat(user, "[src.current.name] selected for law changes.")
|
||||
|
||||
/obj/machinery/computer/upload/borg/can_upload_to(mob/living/silicon/robot/B)
|
||||
if(!B || !iscyborg(B))
|
||||
return 0
|
||||
if(B.scrambledcodes || B.emagged)
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/computer/upload
|
||||
var/mob/living/silicon/current = null //The target of future law uploads
|
||||
icon_screen = "command"
|
||||
|
||||
/obj/machinery/computer/upload/attackby(obj/item/O, mob/user, params)
|
||||
if(istype(O, /obj/item/aiModule))
|
||||
var/obj/item/aiModule/M = O
|
||||
if(src.stat & (NOPOWER|BROKEN|MAINT))
|
||||
return
|
||||
if(!current)
|
||||
to_chat(user, "<span class='caution'>You haven't selected anything to transmit laws to!</span>")
|
||||
return
|
||||
if(!can_upload_to(current))
|
||||
to_chat(user, "<span class='caution'>Upload failed!</span> Check to make sure [current.name] is functioning properly.")
|
||||
current = null
|
||||
return
|
||||
var/turf/currentloc = get_turf(current)
|
||||
if(currentloc && user.z != currentloc.z)
|
||||
to_chat(user, "<span class='caution'>Upload failed!</span> Unable to establish a connection to [current.name]. You're too far away!")
|
||||
current = null
|
||||
return
|
||||
M.install(current.laws, user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/upload/proc/can_upload_to(mob/living/silicon/S)
|
||||
if(S.stat == DEAD)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/machinery/computer/upload/ai
|
||||
name = "\improper AI upload console"
|
||||
desc = "Used to upload laws to the AI."
|
||||
circuit = /obj/item/circuitboard/computer/aiupload
|
||||
|
||||
/obj/machinery/computer/upload/ai/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
|
||||
src.current = select_active_ai(user)
|
||||
|
||||
if (!src.current)
|
||||
to_chat(user, "<span class='caution'>No active AIs detected!</span>")
|
||||
else
|
||||
to_chat(user, "[src.current.name] selected for law changes.")
|
||||
|
||||
/obj/machinery/computer/upload/ai/can_upload_to(mob/living/silicon/ai/A)
|
||||
if(!A || !isAI(A))
|
||||
return 0
|
||||
if(A.control_disabled)
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/computer/upload/borg
|
||||
name = "cyborg upload console"
|
||||
desc = "Used to upload laws to Cyborgs."
|
||||
circuit = /obj/item/circuitboard/computer/borgupload
|
||||
|
||||
/obj/machinery/computer/upload/borg/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
|
||||
src.current = select_active_free_borg(user)
|
||||
|
||||
if(!src.current)
|
||||
to_chat(user, "<span class='caution'>No active unslaved cyborgs detected!</span>")
|
||||
else
|
||||
to_chat(user, "[src.current.name] selected for law changes.")
|
||||
|
||||
/obj/machinery/computer/upload/borg/can_upload_to(mob/living/silicon/robot/B)
|
||||
if(!B || !iscyborg(B))
|
||||
return 0
|
||||
if(B.scrambledcodes || B.emagged)
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
|
||||
|
||||
|
||||
/obj/machinery/computer/robotics
|
||||
name = "robotics control console"
|
||||
desc = "Used to remotely lockdown or detonate linked Cyborgs and Drones."
|
||||
@@ -61,11 +58,14 @@
|
||||
dat += " Slaved to [R.connected_ai.name] |"
|
||||
else
|
||||
dat += " Independent from AI |"
|
||||
if(issilicon(user) || IsAdminGhost(user))
|
||||
if(is_servant_of_ratvar(user) && user != R)
|
||||
if(issilicon(user) && user != R)
|
||||
var/mob/living/silicon/S = user
|
||||
if(is_servant_of_ratvar(S))
|
||||
dat += "<A href='?src=[REF(src)];convert=[REF(R)]'>(<font color=#BE8700><i>Convert</i></font>)</A> "
|
||||
else if(((issilicon(user) && is_special_character(user)) || IsAdminGhost(user)) && !R.emagged && (user != R || R.syndicate))
|
||||
else if(S.hack_software && !R.emagged)
|
||||
dat += "<A href='?src=[REF(src)];magbot=[REF(R)]'>(<font color=blue><i>Hack</i></font>)</A> "
|
||||
else if(IsAdminGhost(user) && !R.emagged)
|
||||
dat += "<A href='?src=[REF(src)];magbot=[REF(R)]'>(<font color=blue><i>Hack</i></font>)</A> "
|
||||
dat += "<A href='?src=[REF(src)];stopbot=[REF(R)]'>(<font color=green><i>[R.canmove ? "Lockdown" : "Release"]</i></font>)</A> "
|
||||
dat += "<A href='?src=[REF(src)];killbot=[REF(R)]'>(<font color=red><i>Destroy</i></font>)</A>"
|
||||
dat += "<BR>"
|
||||
@@ -107,18 +107,12 @@
|
||||
if(can_control(usr, R))
|
||||
var/choice = input("Are you certain you wish to detonate [R.name]?") in list("Confirm", "Abort")
|
||||
if(choice == "Confirm" && can_control(usr, R) && !..())
|
||||
if(R.syndicate && R.emagged)
|
||||
to_chat(R, "Extreme danger. Termination codes detected. Scrambling security codes and automatic AI unlink triggered.")
|
||||
if(R.connected_ai)
|
||||
to_chat(R.connected_ai, "<br><br><span class='alert'>ALERT - Cyborg detonation detected: [R.name]</span><br>")
|
||||
R.ResetSecurityCodes()
|
||||
else
|
||||
var/turf/T = get_turf(R)
|
||||
message_admins("<span class='notice'>[ADMIN_LOOKUPFLW(usr)] detonated [key_name(R, R.client)][ADMIN_JMP(T)]!</span>")
|
||||
log_game("\<span class='notice'>[key_name(usr)] detonated [key_name(R)]!</span>")
|
||||
if(R.connected_ai)
|
||||
to_chat(R.connected_ai, "<br><br><span class='alert'>ALERT - Cyborg detonation detected: [R.name]</span><br>")
|
||||
R.self_destruct()
|
||||
var/turf/T = get_turf(R)
|
||||
message_admins("<span class='notice'>[ADMIN_LOOKUPFLW(usr)] detonated [key_name(R, R.client)][ADMIN_JMP(T)]!</span>")
|
||||
log_game("\<span class='notice'>[key_name(usr)] detonated [key_name(R)]!</span>")
|
||||
if(R.connected_ai)
|
||||
to_chat(R.connected_ai, "<br><br><span class='alert'>ALERT - Cyborg detonation detected: [R.name]</span><br>")
|
||||
R.self_destruct()
|
||||
else
|
||||
to_chat(usr, "<span class='danger'>Access Denied.</span>")
|
||||
|
||||
@@ -139,19 +133,18 @@
|
||||
to_chat(usr, "<span class='danger'>Access Denied.</span>")
|
||||
|
||||
else if (href_list["magbot"])
|
||||
if((issilicon(usr) && is_special_character(usr)) || IsAdminGhost(usr))
|
||||
var/mob/living/silicon/S = usr
|
||||
if((istype(S) && S.hack_software) || IsAdminGhost(usr))
|
||||
var/mob/living/silicon/robot/R = locate(href_list["magbot"]) in GLOB.silicon_mobs
|
||||
if(istype(R) && !R.emagged && ((R.syndicate && R == usr) || R.connected_ai == usr || IsAdminGhost(usr)) && !R.scrambledcodes && can_control(usr, R))
|
||||
if(istype(R) && !R.emagged && (R.connected_ai == usr || IsAdminGhost(usr)) && !R.scrambledcodes && can_control(usr, R))
|
||||
log_game("[key_name(usr)] emagged [R.name] using robotic console!")
|
||||
message_admins("[key_name_admin(usr)] emagged cyborg [key_name_admin(R)] using robotic console!")
|
||||
R.SetEmagged(1)
|
||||
if(is_special_character(R))
|
||||
R.verbs += /mob/living/silicon/robot/proc/ResetSecurityCodes
|
||||
|
||||
else if(href_list["convert"])
|
||||
if(issilicon(usr) && is_special_character(usr))
|
||||
if(isAI(usr) && is_servant_of_ratvar(usr))
|
||||
var/mob/living/silicon/robot/R = locate(href_list["convert"]) in GLOB.silicon_mobs
|
||||
if(istype(R) && !is_servant_of_ratvar(R) && is_servant_of_ratvar(usr) && R.connected_ai == usr)
|
||||
if(istype(R) && !is_servant_of_ratvar(R) && R.connected_ai == usr)
|
||||
log_game("[key_name(usr)] converted [R.name] using robotic console!")
|
||||
message_admins("[key_name_admin(usr)] converted cyborg [key_name_admin(R)] using robotic console!")
|
||||
add_servant_of_ratvar(R)
|
||||
|
||||
@@ -118,7 +118,8 @@
|
||||
else
|
||||
for(var/n = ++i; n <= optioncount; n++)
|
||||
dat += "<dd><font color='blue'>	[n]. ---------------</font><br></dd>"
|
||||
if(issilicon(usr) && is_special_character(usr))
|
||||
var/mob/living/silicon/S = usr
|
||||
if(istype(S) && S.hack_software)
|
||||
//Malf/Traitor AIs can bruteforce into the system to gain the Key.
|
||||
dat += "<dd><A href='?src=[REF(src)];hack=1'><i><font color='Red'>*&@#. Bruteforce Key</font></i></font></a><br></dd>"
|
||||
else
|
||||
@@ -338,7 +339,8 @@
|
||||
|
||||
//Hack the Console to get the password
|
||||
if (href_list["hack"])
|
||||
if(issilicon(usr) && is_special_character(usr))
|
||||
var/mob/living/silicon/S = usr
|
||||
if(istype(S) && S.hack_software)
|
||||
hacking = TRUE
|
||||
screen = 2
|
||||
//Time it takes to bruteforce is dependant on the password length.
|
||||
|
||||
Reference in New Issue
Block a user