mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-28 07:20:09 +01:00
Cyborg Access Rework (#15157)
This commit is contained in:
@@ -386,7 +386,8 @@
|
||||
return
|
||||
for(var/B in get_linked_cyborgs(src))
|
||||
var/mob/living/silicon/robot/target = B
|
||||
target.malf_AI_module = 1
|
||||
target.malf_AI_module = TRUE
|
||||
target.id_card.access = get_all_station_access() + access_equipment // Give full station access
|
||||
to_chat(user, "The robotic transformation machine can now be built. To build get a robot to activate the construction module and use the RTF tool. Be careful, it needs to have empty space to the east and west of it and only one can be built!")
|
||||
sleep(300) //Allows the AI to reset its borgs into combat units
|
||||
to_chat(user, "Bypassing crisis module safeties.")
|
||||
|
||||
@@ -551,10 +551,10 @@ var/const/access_kataphract_knight = 114
|
||||
/*******
|
||||
* Misc *
|
||||
*******/
|
||||
/var/const/access_synth = 199
|
||||
/datum/access/synthetic
|
||||
id = access_synth
|
||||
desc = "Synthetic"
|
||||
/var/const/access_equipment = 199
|
||||
/datum/access/equipment
|
||||
id = access_equipment
|
||||
desc = "Equipment"
|
||||
access_type = ACCESS_TYPE_NONE
|
||||
|
||||
/var/const/access_crate_cash = 200
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "robot_control.tmpl", "Robotic Control Console", 400, 500)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
@@ -41,7 +41,7 @@
|
||||
return
|
||||
var/mob/user = usr
|
||||
if(!src.allowed(user))
|
||||
to_chat(user, "Access Denied")
|
||||
to_chat(user, "Access denied.")
|
||||
return
|
||||
|
||||
// Destroys the cyborg
|
||||
@@ -50,11 +50,11 @@
|
||||
if(!target || !istype(target))
|
||||
return
|
||||
if(isAI(user) && (target.connected_ai != user))
|
||||
to_chat(user, "Access Denied. This robot is not linked to you.")
|
||||
to_chat(user, "Access denied. This robot is not linked to you.")
|
||||
return
|
||||
// Cyborgs may blow up themselves via the console
|
||||
if(isrobot(user) && user != target)
|
||||
to_chat(user, "Access Denied.")
|
||||
to_chat(user, "Access denied.")
|
||||
return
|
||||
var/choice = input("Really detonate [target.name]?") in list ("Yes", "No")
|
||||
if(choice != "Yes")
|
||||
@@ -69,7 +69,7 @@
|
||||
return
|
||||
|
||||
if(target.emagged)
|
||||
to_chat(user, "Access Denied. Safety protocols are disabled.")
|
||||
to_chat(user, "Access denied. Safety protocols are disabled.")
|
||||
return
|
||||
|
||||
else
|
||||
@@ -82,17 +82,17 @@
|
||||
|
||||
|
||||
// Locks or unlocks the cyborg
|
||||
else if (href_list["lockdown"])
|
||||
else if(href_list["lockdown"])
|
||||
var/mob/living/silicon/robot/target = get_cyborg_by_name(href_list["lockdown"])
|
||||
if(!target || !istype(target))
|
||||
return
|
||||
|
||||
if(isAI(user) && (target.connected_ai != user))
|
||||
to_chat(user, "Access Denied. This robot is not linked to you.")
|
||||
to_chat(user, "Access denied. This robot is not linked to you.")
|
||||
return
|
||||
|
||||
if(isrobot(user))
|
||||
to_chat(user, "Access Denied.")
|
||||
to_chat(user, "Access denied.")
|
||||
return
|
||||
|
||||
if(target.emagged)
|
||||
@@ -109,16 +109,45 @@
|
||||
message_admins("[key_name_admin(usr)] [target.lock_charge ? "locked down" : "released"] [target.name]!")
|
||||
log_game("[key_name(usr)] [target.lock_charge ? "locked down" : "released"] [target.name]!",ckey=key_name(usr))
|
||||
to_chat(target, (target.lock_charge ? "You have been locked down!" : "Your lockdown has been lifted!"))
|
||||
|
||||
// Changes borg's access
|
||||
else if(href_list["access"])
|
||||
var/mob/living/silicon/robot/target = get_cyborg_by_name(href_list["access"])
|
||||
if(!istype(target))
|
||||
return
|
||||
|
||||
if(isAI(user) && (target.connected_ai != user))
|
||||
to_chat(user, "Access denied. This robot is not linked to you.")
|
||||
return
|
||||
|
||||
if(isrobot(user) || target.emagged)
|
||||
to_chat(user, "Access denied.")
|
||||
return
|
||||
|
||||
if(!istype(target))
|
||||
return
|
||||
|
||||
if(!target.module)
|
||||
to_chat(user, "\The [src]\s access protocols are immutable.")
|
||||
return
|
||||
|
||||
target.module.all_access = !target.module.all_access
|
||||
target.update_access()
|
||||
|
||||
var/log_message = "[key_name_admin(usr)] changed [target.name] access to [target.module.all_access ? "all access" : "role specific"]."
|
||||
message_admins(log_message)
|
||||
log_game(log_message, ckey = key_name(usr))
|
||||
to_chat(target, ("Your access was changed to: [target.module.all_access ? "all access" : "role specific"]."))
|
||||
|
||||
// Remotely hacks the cyborg. Only antag AIs can do this and only to linked cyborgs.
|
||||
else if (href_list["hack"])
|
||||
else if(href_list["hack"])
|
||||
var/mob/living/silicon/robot/target = get_cyborg_by_name(href_list["hack"])
|
||||
if(!target || !istype(target))
|
||||
return
|
||||
|
||||
// Antag AI checks
|
||||
if(!istype(user, /mob/living/silicon/ai) || !(user.mind.special_role && user.mind.original == user))
|
||||
to_chat(user, "Access Denied")
|
||||
to_chat(user, "Access denied.")
|
||||
return
|
||||
|
||||
if(target.emagged)
|
||||
@@ -140,7 +169,7 @@
|
||||
// Arms the emergency self-destruct system
|
||||
else if(href_list["arm"])
|
||||
if(istype(user, /mob/living/silicon))
|
||||
to_chat(user, "Access Denied")
|
||||
to_chat(user, "Access denied.")
|
||||
return
|
||||
|
||||
safety = !safety
|
||||
@@ -149,7 +178,7 @@
|
||||
// Destroys all accessible cyborgs if safety is disabled
|
||||
else if(href_list["nuke"])
|
||||
if(istype(user, /mob/living/silicon))
|
||||
to_chat(user, "Access Denied")
|
||||
to_chat(user, "Access denied.")
|
||||
return
|
||||
if(safety)
|
||||
to_chat(user, "Self-destruct aborted - safety active")
|
||||
@@ -189,7 +218,7 @@
|
||||
robot["name"] = R.name
|
||||
if(R.stat)
|
||||
robot["status"] = "Not Responding"
|
||||
else if (R.lock_charge) // changed this from !R.canmove to R.lock_charge because of issues with lockdown and chairs
|
||||
else if(R.lock_charge) // changed this from !R.canmove to R.lock_charge because of issues with lockdown and chairs
|
||||
robot["status"] = "Lockdown"
|
||||
else
|
||||
robot["status"] = "Operational"
|
||||
@@ -205,6 +234,7 @@
|
||||
robot["module"] = R.module ? R.module.name : "None"
|
||||
robot["master_ai"] = R.connected_ai ? R.connected_ai.name : "None"
|
||||
robot["hackable"] = 0
|
||||
robot["access"] = R.module ? R.module.all_access : FALSE
|
||||
// Antag AIs know whether linked cyborgs are hacked or not.
|
||||
if(operator && istype(operator, /mob/living/silicon/ai) && (R.connected_ai == operator) && (operator.mind.special_role && operator.mind.original == operator))
|
||||
robot["hacked"] = R.emagged ? 1 : 0
|
||||
@@ -216,7 +246,7 @@
|
||||
// Parameters: 1 (name - Cyborg we are trying to find)
|
||||
// Description: Helper proc for finding cyborg by name
|
||||
/obj/machinery/computer/robotics/proc/get_cyborg_by_name(var/name)
|
||||
if (!name)
|
||||
if(!name)
|
||||
return
|
||||
for(var/mob/living/silicon/robot/R in mob_list)
|
||||
if(R.name == name)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
var/global/list/default_internal_channels = list(
|
||||
num2text(PUB_FREQ) = list(),
|
||||
num2text(ENT_FREQ) = list(),
|
||||
num2text(AI_FREQ) = list(access_synth),
|
||||
num2text(AI_FREQ) = list(access_equipment),
|
||||
num2text(ERT_FREQ) = list(access_cent_specops),
|
||||
num2text(COMM_FREQ)= list(access_heads),
|
||||
num2text(ENG_FREQ) = list(access_engine_equip, access_atmospherics),
|
||||
|
||||
@@ -425,16 +425,27 @@ var/const/NO_EMAG_ACT = -50
|
||||
access = list(access_merchant)
|
||||
|
||||
/obj/item/card/id/synthetic
|
||||
name = "\improper Synthetic ID"
|
||||
desc = "Access module for NanoTrasen Synthetics"
|
||||
name = "\improper Equipment ID"
|
||||
desc = "Access module for SCC equipment."
|
||||
icon_state = "id-robot"
|
||||
item_state = "tdgreen"
|
||||
assignment = "Synthetic"
|
||||
assignment = "Equipment"
|
||||
|
||||
/obj/item/card/id/synthetic/New()
|
||||
access = get_all_station_access() + access_synth
|
||||
access = get_all_station_access() + access_equipment
|
||||
..()
|
||||
|
||||
/obj/item/card/id/synthetic/cyborg
|
||||
name = "\improper Equipment ID"
|
||||
desc = "Access module for SCC equipment."
|
||||
icon_state = "id-robot"
|
||||
item_state = "tdgreen"
|
||||
assignment = "Equipment"
|
||||
|
||||
/obj/item/card/id/synthetic/cyborg/New()
|
||||
..()
|
||||
access = list(access_equipment, access_ai_upload, access_external_airlocks) // barebones cyborg access. Job special added in different place
|
||||
|
||||
/obj/item/card/id/minedrone
|
||||
name = "\improper Minedrone ID"
|
||||
desc = "Access module for NanoTrasen Minedrones"
|
||||
|
||||
Reference in New Issue
Block a user