diff --git a/code/modules/clothing/spacesuits/rig/modules/computer.dm b/code/modules/clothing/spacesuits/rig/modules/computer.dm index 71722b1a6eb..b3f954703c0 100644 --- a/code/modules/clothing/spacesuits/rig/modules/computer.dm +++ b/code/modules/clothing/spacesuits/rig/modules/computer.dm @@ -6,6 +6,25 @@ * /obj/item/rig_module/electrowarfare_suite */ +/obj/item/ai_verbs + name = "AI verb holder" + +/obj/item/ai_verbs/verb/hardsuit_interface() + set category = "Hardsuit" + set name = "Open Hardsuit Interface" + set src in usr + + if(!usr.loc || !usr.loc.loc || !istype(usr.loc.loc, /obj/item/rig_module)) + usr << "You are not loaded into a hardsuit." + return + + var/obj/item/rig_module/module = usr.loc.loc + if(!module.holder) + usr << "Your module is not installed in a hardsuit." + return + + module.holder.ui_interact(usr) + /obj/item/rig_module/ai_container name = "IIS module" @@ -24,11 +43,15 @@ var/mob/integrated_ai // Direct reference to the actual mob held in the suit. var/obj/item/ai_card // Reference to the MMI, posibrain, intellicard or pAI card previously holding the AI. - var/list/ai_interface_verbs = list( - //mob/living/proc/hardsuit_interface_ai, - //mob/living/proc/hardsuit_host_bioscan, - //mob/living/proc/hardsuit_hack - ) + var/obj/item/ai_verbs/verb_holder + +/obj/item/rig_module/ai_container/proc/update_verb_holder() + if(!verb_holder) + verb_holder = new(src) + if(integrated_ai) + verb_holder.loc = integrated_ai + else + verb_holder.loc = src /obj/item/rig_module/ai_container/accepts_item(var/obj/item/input_device, var/mob/living/user) @@ -59,9 +82,9 @@ if(locate(/mob/living/silicon/ai) in card) ai_card = card integrated_ai = locate(/mob/living/silicon/ai) in card - integrated_ai.verbs |= ai_interface_verbs else eject_ai() + update_verb_holder() return 1 if(istype(input_device,/obj/item/device/aicard)) @@ -99,6 +122,7 @@ ai_card.attack_self(H) else eject_ai(H) + update_verb_holder() return 1 if(accepts_item(target,H)) @@ -124,10 +148,8 @@ else ai_card.loc = get_turf(src) ai_card = null - - if(integrated_ai) - integrated_ai.verbs -= ai_interface_verbs integrated_ai = null + update_verb_holder() /obj/item/rig_module/ai_container/proc/integrate_ai(var/obj/item/ai,var/mob/user) @@ -165,12 +187,11 @@ if(!(locate(integrated_ai) in ai_card)) integrated_ai = null eject_ai() - else - integrated_ai.verbs |= ai_interface_verbs else user << "There is no active AI within \the [ai]." else user << "There is no active AI within \the [ai]." + update_verb_holder() return /obj/item/rig_module/datajack diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm index cacc290efdf..fafa47b593c 100644 --- a/code/modules/clothing/spacesuits/rig/rig.dm +++ b/code/modules/clothing/spacesuits/rig/rig.dm @@ -470,16 +470,13 @@ /obj/item/weapon/rig/Topic(href,href_list) - if(..()) - return 1 - var/mob/living/carbon/human/H = usr if((istype(H) && H.back == src) || (istype(H,/mob/living/silicon))) - if(istype(H,/mob/living/silicon)) if(!control_overridden) + usr << "Synthetic access disabled. Please consult hardware provider." return else if(security_check_enabled && !src.allowed(usr)) usr << "Access denied." @@ -546,7 +543,7 @@ H << "The hardsuit is not being worn." return - var/check_slot + var/obj/item/check_slot var/equip_to var/obj/item/use_obj @@ -589,7 +586,7 @@ else if (deploy_mode != ONLY_RETRACT) if(check_slot) if(check_slot != use_obj) - H << "You are unable to deploy \the [piece] as \the [check_slot] is in the way." + H << "You are unable to deploy \the [piece] as \the [check_slot] [check_slot.gender == PLURAL ? "are" : "is"] in the way." return else H << "Your [use_obj.name] [use_obj.gender == PLURAL ? "deploy" : "deploys"] swiftly." diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index dd175509850..4a70e8e6510 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -509,7 +509,7 @@ var/list/ai_verbs_default = list( else src << "\red System error. Cannot locate [html_decode(href_list["trackname"])]." return - + return /mob/living/silicon/ai/meteorhit(obj/O as obj) @@ -582,22 +582,6 @@ var/list/ai_verbs_default = list( //src.cameraFollow = null src.view_core() -/mob/living/silicon/ai/verb/hardsuit_interface() - set category = "AI Commands" - set name = "Open Hardsuit Interface" - - if(!src.loc || !src.loc.loc || !istype(src.loc.loc, /obj/item/rig_module)) - usr << "You are not loaded into a hardsuit." - return - - var/obj/item/rig_module/module = src.loc.loc - if(!module.holder) - usr << "Your module is not installed in a hardsuit." - return - - module.holder.ui_interact(usr) - - //Replaces /mob/living/silicon/ai/verb/change_network() in ai.dm & camera.dm //Adds in /mob/living/silicon/ai/proc/ai_network_change() instead //Addition by Mord_Sith to define AI's network change ability diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 3e7aeb36c23..68310e4d14f 100755 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -222,21 +222,6 @@ src.reset_view(C) return 1 -/mob/living/silicon/pai/verb/hardsuit_interface() - set category = "pAI Commands" - set name = "Open Hardsuit Interface" - - if(!src.loc || !src.loc.loc || !istype(src.loc.loc, /obj/item/rig_module)) - usr << "You are not loaded into a hardsuit." - return - - var/obj/item/rig_module/module = src.loc.loc - if(!module.holder) - usr << "Your module is not installed in a hardsuit." - return - - module.holder.ui_interact(usr) - /mob/living/silicon/pai/cancel_camera() set category = "pAI Commands" set name = "Cancel Camera View"