* The AI can now use alt click to get a list of objects and the turf for easy access.

* The AI can interact with all the items in the list.
* The AI can use this for several things:
 * Since the list will not dissappear for the AI, until there's no camera coverage, they can use it to bookmark a single tile to interact while not having to look at it.
 * They can also use this to quickly jump to the listed turf.
 * They can interact with objects under other objects.
* Made the CTRL Click on the APC directly use the toggle_breaker() proc.
This commit is contained in:
Giacomand
2013-10-14 17:23:53 +01:00
parent 7408c84e3e
commit 1bf07a3065
3 changed files with 18 additions and 7 deletions
+12 -4
View File
@@ -45,7 +45,7 @@
if(modifiers["ctrl"])
CtrlClickOn(A)
return
if(control_disabled || stat || world.time <= next_move) return
next_move = world.time + 9
@@ -113,11 +113,12 @@
else
Topic("aiDisable=4", list("aiDisable"="4"), 1)
/obj/machinery/power/apc/AICtrlClick() // turns off APCs.
Topic("breaker=1", list("breaker"="1"), 0) // 0 meaning no window (consistency! wait...)
/obj/machinery/power/apc/AICtrlClick() // turns off/on APCs.
toggle_breaker()
/atom/proc/AIAltClick()
/atom/proc/AIAltClick(var/mob/living/silicon/ai/user)
AltClick(user)
return
/obj/machinery/door/airlock/AIAltClick() // Eletrifies doors.
@@ -128,3 +129,10 @@
// disable/6 is not in Topic; disable/5 disables both temporary and permenant shock
Topic("aiDisable=5", list("aiDisable"="5"), 1)
return
//
// Override TurfAdjacent for AltClicking
//
/mob/living/silicon/ai/TurfAdjacent(var/turf/T)
return (cameranet && cameranet.checkTurfVis(T))
+5 -2
View File
@@ -55,7 +55,7 @@
if(modifiers["ctrl"])
CtrlClickOn(A)
return
if(stat || paralysis || stunned || weakened)
return
@@ -243,7 +243,7 @@
/atom/proc/AltClick(var/mob/user)
var/turf/T = get_turf(src)
if(T && T.Adjacent(user))
if(T && user.TurfAdjacent(T))
if(user.listed_turf == T)
user.listed_turf = null
else
@@ -251,6 +251,9 @@
user.client.statpanel = T.name
return
/mob/proc/TurfAdjacent(var/turf/T)
return T.Adjacent(src)
/*
Misc helpers
+1 -1
View File
@@ -656,7 +656,7 @@ note dizziness decrements automatically in the mob's Life() proc.
stat(null,"MasterController-ERROR")
if(listed_turf && client)
if(get_dist(listed_turf,src) > 1)
if(!TurfAdjacent(listed_turf))
listed_turf = null
else
statpanel(listed_turf.name, null, listed_turf)