Game folder
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
desc = "Used for pulsing wires to test which to cut. Not recommended by doctors."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "multitool"
|
||||
item_state = "multitool"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
|
||||
force = 5
|
||||
@@ -25,13 +26,19 @@
|
||||
throw_speed = 3
|
||||
materials = list(MAT_METAL=50, MAT_GLASS=20)
|
||||
var/obj/machinery/buffer // simple machine buffer for device linkage
|
||||
hitsound = 'sound/weapons/tap.ogg'
|
||||
toolspeed = 1
|
||||
tool_behaviour = TOOL_MULTITOOL
|
||||
usesound = 'sound/weapons/empty.ogg'
|
||||
var/datum/integrated_io/selected_io = null //functional for integrated circuits.
|
||||
var/mode = 0
|
||||
|
||||
/obj/item/multitool/examine(mob/user)
|
||||
..()
|
||||
if(selected_io)
|
||||
to_chat(user, "<span class='notice'>Activate [src] to detach the data wire.</span>")
|
||||
if(buffer)
|
||||
to_chat(user, "<span class='notice'>Its buffer contains [buffer].</span>")
|
||||
|
||||
/obj/item/multitool/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] puts the [src] to [user.p_their()] chest. It looks like [user.p_theyre()] trying to pulse [user.p_their()] heart off!</span>")
|
||||
return OXYLOSS//theres a reason it wasnt recommended by doctors
|
||||
@@ -40,8 +47,6 @@
|
||||
if(selected_io)
|
||||
selected_io = null
|
||||
to_chat(user, "<span class='notice'>You clear the wired connection from the multitool.</span>")
|
||||
else
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/multitool/update_icon()
|
||||
@@ -98,30 +103,89 @@
|
||||
|
||||
// Syndicate device disguised as a multitool; it will turn red when an AI camera is nearby.
|
||||
|
||||
|
||||
/obj/item/multitool/ai_detect
|
||||
var/track_cooldown = 0
|
||||
var/track_delay = 10 //How often it checks for proximity
|
||||
var/detect_state = PROXIMITY_NONE
|
||||
var/rangealert = 8 //Glows red when inside
|
||||
var/rangewarning = 20 //Glows yellow when inside
|
||||
var/hud_type = DATA_HUD_AI_DETECT
|
||||
var/hud_on = FALSE
|
||||
var/mob/camera/aiEye/remote/ai_detector/eye
|
||||
var/datum/action/item_action/toggle_multitool/toggle_action
|
||||
|
||||
/obj/item/multitool/ai_detect/New()
|
||||
..()
|
||||
/obj/item/multitool/ai_detect/Initialize()
|
||||
. = ..()
|
||||
START_PROCESSING(SSobj, src)
|
||||
eye = new /mob/camera/aiEye/remote/ai_detector()
|
||||
toggle_action = new /datum/action/item_action/toggle_multitool(src)
|
||||
|
||||
/obj/item/multitool/ai_detect/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
if(hud_on && ismob(loc))
|
||||
remove_hud(loc)
|
||||
QDEL_NULL(toggle_action)
|
||||
QDEL_NULL(eye)
|
||||
return ..()
|
||||
|
||||
/obj/item/multitool/ai_detect/ui_action_click()
|
||||
return
|
||||
|
||||
/obj/item/multitool/ai_detect/update_icon()
|
||||
if(selected_io)
|
||||
icon_state = "multitool_red"
|
||||
else
|
||||
icon_state = "[initial(icon_state)][detect_state]"
|
||||
|
||||
/obj/item/multitool/ai_detect/equipped(mob/living/carbon/human/user, slot)
|
||||
..()
|
||||
if(hud_on)
|
||||
show_hud(user)
|
||||
|
||||
/obj/item/multitool/ai_detect/dropped(mob/living/carbon/human/user)
|
||||
..()
|
||||
if(hud_on)
|
||||
remove_hud(user)
|
||||
|
||||
/obj/item/multitool/ai_detect/process()
|
||||
if(track_cooldown > world.time)
|
||||
return
|
||||
detect_state = PROXIMITY_NONE
|
||||
if(eye.eye_user)
|
||||
eye.setLoc(get_turf(src))
|
||||
multitool_detect()
|
||||
icon_state = "[initial(icon_state)][detect_state]"
|
||||
update_icon()
|
||||
track_cooldown = world.time + track_delay
|
||||
|
||||
/obj/item/multitool/ai_detect/proc/toggle_hud(mob/user)
|
||||
hud_on = !hud_on
|
||||
if(user)
|
||||
to_chat(user, "<span class='notice'>You toggle the ai detection HUD on [src] [hud_on ? "on" : "off"].</span>")
|
||||
if(hud_on)
|
||||
show_hud(user)
|
||||
else
|
||||
remove_hud(user)
|
||||
|
||||
/obj/item/multitool/ai_detect/proc/show_hud(mob/user)
|
||||
if(user && hud_type)
|
||||
var/obj/screen/plane_master/camera_static/PM = user.hud_used.plane_masters["[CAMERA_STATIC_PLANE]"]
|
||||
PM.alpha = 150
|
||||
var/datum/atom_hud/H = GLOB.huds[hud_type]
|
||||
if(!H.hudusers[user])
|
||||
H.add_hud_to(user)
|
||||
eye.eye_user = user
|
||||
eye.setLoc(get_turf(src))
|
||||
|
||||
/obj/item/multitool/ai_detect/proc/remove_hud(mob/user)
|
||||
if(user && hud_type)
|
||||
var/obj/screen/plane_master/camera_static/PM = user.hud_used.plane_masters["[CAMERA_STATIC_PLANE]"]
|
||||
PM.alpha = 255
|
||||
var/datum/atom_hud/H = GLOB.huds[hud_type]
|
||||
H.remove_hud_from(user)
|
||||
if(eye)
|
||||
eye.setLoc(null)
|
||||
eye.eye_user = null
|
||||
|
||||
/obj/item/multitool/ai_detect/proc/multitool_detect()
|
||||
var/turf/our_turf = get_turf(src)
|
||||
for(var/mob/living/silicon/ai/AI in GLOB.ai_list)
|
||||
@@ -134,6 +198,8 @@
|
||||
var/datum/camerachunk/chunk = GLOB.cameranet.chunkGenerated(our_turf.x, our_turf.y, our_turf.z)
|
||||
if(chunk && chunk.seenby.len)
|
||||
for(var/mob/camera/aiEye/A in chunk.seenby)
|
||||
if(!A.ai_detector_visible)
|
||||
continue
|
||||
var/turf/detect_turf = get_turf(A)
|
||||
if(get_dist(our_turf, detect_turf) < rangealert)
|
||||
detect_state = PROXIMITY_ON_SCREEN
|
||||
@@ -142,6 +208,24 @@
|
||||
detect_state = PROXIMITY_NEAR
|
||||
break
|
||||
|
||||
/mob/camera/aiEye/remote/ai_detector
|
||||
name = "AI detector eye"
|
||||
ai_detector_visible = FALSE
|
||||
use_static = USE_STATIC_TRANSPARENT
|
||||
visible_icon = FALSE
|
||||
|
||||
/datum/action/item_action/toggle_multitool
|
||||
name = "Toggle AI detector HUD"
|
||||
check_flags = NONE
|
||||
|
||||
/datum/action/item_action/toggle_multitool/Trigger()
|
||||
if(!..())
|
||||
return 0
|
||||
if(target)
|
||||
var/obj/item/multitool/ai_detect/M = target
|
||||
M.toggle_hud(owner)
|
||||
return 1
|
||||
|
||||
/obj/item/multitool/cyborg
|
||||
name = "multitool"
|
||||
desc = "Optimised and stripped-down version of a regular multitool."
|
||||
|
||||
Reference in New Issue
Block a user