mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-24 05:23:22 +01:00
Oh look at that, every modular computer in existence was always processing at all times, regardless of if it was actually needed. There's a couple more small examples I caught in my first pass, but all of the rest are very low incidence. There are of course a very large number of modular computers at any one point in time.
77 lines
1.7 KiB
Plaintext
77 lines
1.7 KiB
Plaintext
/singleton/psionic_power/nlom_eyes
|
|
name = "Nlom Eyes"
|
|
desc = "Roughly locate a mob on your z-level."
|
|
icon_state = "tech_control"
|
|
point_cost = 2
|
|
ability_flags = PSI_FLAG_ANTAG
|
|
spell_path = /obj/item/spell/nlom_eyes
|
|
|
|
/obj/item/spell/nlom_eyes
|
|
name = "nlom eyes"
|
|
desc = "Psionic drugs? No way."
|
|
icon_state = "track"
|
|
cast_methods = CAST_USE
|
|
aspect = ASPECT_PSIONIC
|
|
cooldown = 10
|
|
psi_cost = 5
|
|
/// The mob we are tracking.
|
|
var/mob/living/tracked
|
|
/// If we are tracking a mob.
|
|
var/tracking = FALSE
|
|
|
|
/obj/item/spell/nlom_eyes/Destroy()
|
|
tracked = null
|
|
tracking = 0
|
|
STOP_PROCESSING(SSprocessing, src)
|
|
return ..()
|
|
|
|
/obj/item/spell/nlom_eyes/on_use_cast(mob/user)
|
|
if(tracking)
|
|
tracking = FALSE
|
|
to_chat(user, SPAN_NOTICE("You stop looking in the Nlom for \the [tracked]'s whereabouts."))
|
|
tracked = null
|
|
STOP_PROCESSING(SSprocessing, src)
|
|
icon_state = "track"
|
|
return
|
|
. = ..()
|
|
if(!.)
|
|
return
|
|
|
|
var/list/mob_choices = list()
|
|
for(var/mob/living/L in GLOB.mob_list)
|
|
if(L == user)
|
|
continue
|
|
if(!L.is_psi_blocked(user, TRUE))
|
|
continue
|
|
if(GET_Z(L) != GET_Z(user))
|
|
continue
|
|
mob_choices += L
|
|
var/choice = tgui_input_list(user, "Decide who to track.", "Nlom Eyes", mob_choices)
|
|
if(choice)
|
|
tracked = choice
|
|
tracking = TRUE
|
|
START_PROCESSING(SSprocessing, src)
|
|
|
|
/obj/item/spell/track/process()
|
|
if(!tracking)
|
|
icon_state = "track"
|
|
return PROCESS_KILL
|
|
|
|
if(!tracked)
|
|
icon_state = "track_unknown"
|
|
|
|
if(GET_Z(tracked) != GET_Z(owner))
|
|
icon_state = "track_unknown"
|
|
|
|
else
|
|
set_dir(get_dir(src,get_turf(tracked)))
|
|
switch(get_dist(src,get_turf(tracked)))
|
|
if(0)
|
|
icon_state = "track_direct"
|
|
if(1 to 8)
|
|
icon_state = "track_close"
|
|
if(9 to 16)
|
|
icon_state = "track_medium"
|
|
if(16 to INFINITY)
|
|
icon_state = "track_far"
|