mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Adds ability for the AI to toggle movement of its hologram.
This commit is contained in:
@@ -37,7 +37,7 @@ var/const/HOLOPAD_MODE = RANGE_BASED
|
||||
icon_state = "holopad0"
|
||||
|
||||
layer = TURF_LAYER+0.1 //Preventing mice and drones from sneaking under them.
|
||||
|
||||
|
||||
var/power_per_hologram = 500 //per usage per hologram
|
||||
idle_power_usage = 5
|
||||
use_power = 1
|
||||
@@ -144,15 +144,15 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
|
||||
if((stat & NOPOWER) || !active_ai)
|
||||
clear_holo(master)
|
||||
continue
|
||||
|
||||
if((HOLOPAD_MODE == RANGE_BASED && (get_dist(master.eyeobj, src) > holo_range)))
|
||||
clear_holo(master)
|
||||
continue
|
||||
|
||||
|
||||
// if((HOLOPAD_MODE == RANGE_BASED && (get_dist(master.eyeobj, src) > holo_range)))
|
||||
// clear_holo(master)
|
||||
// continue
|
||||
|
||||
if(HOLOPAD_MODE == AREA_BASED)
|
||||
var/area/holo_area = get_area(src)
|
||||
var/area/eye_area = get_area(master.eyeobj)
|
||||
|
||||
|
||||
if(!(eye_area in holo_area.master.related))
|
||||
clear_holo(master)
|
||||
continue
|
||||
@@ -166,6 +166,8 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
|
||||
var/obj/effect/overlay/H = masters[user]
|
||||
H.loc = get_turf(user.eyeobj)
|
||||
masters[user] = H
|
||||
if((HOLOPAD_MODE == RANGE_BASED && (get_dist(H, src) > holo_range)))
|
||||
clear_holo(user)
|
||||
return 1
|
||||
|
||||
/*
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
|
||||
//Holopad
|
||||
if(ai.holo)
|
||||
ai.holo.move_hologram(ai)
|
||||
if(ai.hologram_follow)
|
||||
ai.holo.move_hologram(ai)
|
||||
return 1
|
||||
|
||||
// AI MOVEMENT
|
||||
|
||||
@@ -22,7 +22,8 @@ var/list/ai_verbs_default = list(
|
||||
/mob/living/silicon/ai/proc/sensor_mode,
|
||||
/mob/living/silicon/ai/proc/show_laws_verb,
|
||||
/mob/living/silicon/ai/proc/toggle_acceleration,
|
||||
/mob/living/silicon/ai/proc/toggle_camera_light
|
||||
/mob/living/silicon/ai/proc/toggle_camera_light,
|
||||
/mob/living/silicon/ai/proc/toggle_hologram_movement
|
||||
)
|
||||
|
||||
//Not sure why this is necessary...
|
||||
@@ -76,6 +77,7 @@ var/list/ai_verbs_default = list(
|
||||
var/datum/trackable/track = null
|
||||
var/last_announcement = ""
|
||||
var/datum/announcement/priority/announcement
|
||||
var/hologram_follow = 1 //This is used for the AI eye, to determine if a holopad's hologram should follow it or not.
|
||||
|
||||
/mob/living/silicon/ai/proc/add_ai_verbs()
|
||||
src.verbs |= ai_verbs_default
|
||||
@@ -664,6 +666,15 @@ var/list/ai_verbs_default = list(
|
||||
set desc = "Augment visual feed with internal sensor overlays"
|
||||
toggle_sensor_mode()
|
||||
|
||||
/mob/living/silicon/ai/proc/toggle_hologram_movement()
|
||||
set name = "Toggle Hologram Movement"
|
||||
set category = "AI Commands"
|
||||
set desc = "Toggles hologram movement based on moving with your virtual eye."
|
||||
|
||||
hologram_follow = !hologram_follow
|
||||
usr << "Your hologram will [hologram_follow ? "follow" : "no longer follow"] you now."
|
||||
|
||||
|
||||
/mob/living/silicon/ai/proc/check_unable(var/flags = 0)
|
||||
if(stat == DEAD)
|
||||
usr << "\red You are dead!"
|
||||
|
||||
Reference in New Issue
Block a user