mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-31 07:58:22 +01:00
Added integrated AI hardsuit interface verb, tweaked Topic() a bit so the AI can use it.
This commit is contained in:
@@ -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 << "<span class='warning'>There is no active AI within \the [ai].</span>"
|
||||
else
|
||||
user << "<span class='warning'>There is no active AI within \the [ai].</span>"
|
||||
update_verb_holder()
|
||||
return
|
||||
|
||||
/obj/item/rig_module/datajack
|
||||
|
||||
@@ -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 << "<span class='danger'>Synthetic access disabled. Please consult hardware provider.</span>"
|
||||
return
|
||||
else if(security_check_enabled && !src.allowed(usr))
|
||||
usr << "<span class='danger'>Access denied.</span>"
|
||||
@@ -546,7 +543,7 @@
|
||||
H << "<span class='warning'>The hardsuit is not being worn.</span>"
|
||||
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 << "<span class='danger'>You are unable to deploy \the [piece] as \the [check_slot] is in the way.</span>"
|
||||
H << "<span class='danger'>You are unable to deploy \the [piece] as \the [check_slot] [check_slot.gender == PLURAL ? "are" : "is"] in the way.</span>"
|
||||
return
|
||||
else
|
||||
H << "<font color='blue'><b>Your [use_obj.name] [use_obj.gender == PLURAL ? "deploy" : "deploys"] swiftly.</b></span>"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user