From b6afaaeae1bc9a8ddb81c8e2a885c8056d1aed97 Mon Sep 17 00:00:00 2001 From: Geeves Date: Tue, 17 Nov 2020 11:19:59 +0200 Subject: [PATCH] Remote Mech Access (#10517) --- .../controllers/subsystems/virtual_reality.dm | 24 +++++++++++++++++++ html/changelogs/geeves-long_overdue.yml | 6 +++++ 2 files changed, 30 insertions(+) create mode 100644 html/changelogs/geeves-long_overdue.yml diff --git a/code/controllers/subsystems/virtual_reality.dm b/code/controllers/subsystems/virtual_reality.dm index 8d232f61fcf..c08d1748bc0 100644 --- a/code/controllers/subsystems/virtual_reality.dm +++ b/code/controllers/subsystems/virtual_reality.dm @@ -72,6 +72,23 @@ to_chat(src, SPAN_DANGER("Interface error, you cannot exit the system at this time.")) to_chat(src, SPAN_WARNING("Ahelp to get back into your body, a bug has occurred.")) +/mob/living/simple_animal/spiderbot/body_return() + set name = "Return to Body" + set category = "IC" + + if(old_mob) + ckey_transfer(old_mob) + languages = list(all_languages[LANGUAGE_TCB]) + internal_id.access = list() + if(ismech(loc)) + var/mob/living/heavy_vehicle/HV = loc + HV.access_card.access = list() + to_chat(old_mob, SPAN_NOTICE("System exited safely, we hope you enjoyed your stay.")) + old_mob = null + else + to_chat(src, SPAN_DANGER("Interface error, you cannot exit the system at this time.")) + to_chat(src, SPAN_WARNING("Ahelp to get back into your body, a bug has occurred.")) + /mob/living/proc/vr_mob_exit_languages() languages = list(all_languages[LANGUAGE_TCB]) @@ -94,6 +111,12 @@ if(target.client) target.client.screen |= global_hud.vr_control + if(istype(target, /mob/living/simple_animal/spiderbot)) + var/obj/item/card/id/original_id = M.GetIdCard() + if(original_id) + var/mob/living/simple_animal/spiderbot/SB = target + SB.internal_id.access = original_id.access + to_chat(target, SPAN_NOTICE("Connection established, system suite active and calibrated.")) to_chat(target, SPAN_WARNING("To exit this mode, use the \"Return to Body\" verb in the IC tab.")) @@ -154,6 +177,7 @@ var/mob/living/heavy_vehicle/chosen_mech = mech[choice] var/mob/living/remote_pilot = chosen_mech.pilots[1] // the first pilot mind_transfer(user, remote_pilot) + chosen_mech.sync_access() /datum/controller/subsystem/virtualreality/proc/robot_selection(var/user, var/network) var/list/robot = list() diff --git a/html/changelogs/geeves-long_overdue.yml b/html/changelogs/geeves-long_overdue.yml new file mode 100644 index 00000000000..54b570731f7 --- /dev/null +++ b/html/changelogs/geeves-long_overdue.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - rscadd: "Using a remote control mech now transfers your ID card access to it." \ No newline at end of file