Field of Vision component. (#12075)
* Hopeless WIP for vision cones. * Core component and hooks done * Removing clutter. * linter bashing me for using statements as args. * Ok. * continue * bring back the macro * Configs and openspace filter. * Chat plane, reset perspective signal, mechs/vehicles cases, machineries. * view, viewers and spoopy ghosts. * Renamed component, admin fun button and snowflakes robots. * Whoopsie. * Yikes * test merge tweak. * radial yaketi sax. * Fixed tgui UIs, some messages not displayed to the target. * Documentation and a little bugfix. * Pulling QoL, seventh plane made in this PR. * Fix. * Tweaks and improvements. * Update randomverbs.dm
This commit is contained in:
@@ -106,6 +106,7 @@ GLOBAL_LIST_INIT(admin_verbs_fun, list(
|
||||
/client/proc/show_tip,
|
||||
/client/proc/smite,
|
||||
/client/proc/admin_away,
|
||||
/client/proc/cmd_admin_toggle_fov,
|
||||
/client/proc/roll_dices //CIT CHANGE - Adds dice verb
|
||||
))
|
||||
GLOBAL_PROTECT(admin_verbs_fun)
|
||||
|
||||
@@ -1218,6 +1218,58 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
|
||||
|
||||
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggled Hub Visibility", "[GLOB.hub_visibility ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/cmd_admin_toggle_fov()
|
||||
set category = "Fun"
|
||||
set name = "Enable/Disable Field of Vision"
|
||||
|
||||
var/static/busy_toggling_fov = FALSE
|
||||
if(!check_rights(R_ADMIN) || !check_rights(R_FUN))
|
||||
return
|
||||
|
||||
var/on_off = CONFIG_GET(flag/use_field_of_vision)
|
||||
|
||||
if(busy_toggling_fov)
|
||||
to_chat(usr, "<span class='warning'>A previous call of this function is still busy toggling FoV [on_off ? "on" : "off"]. Have some patiece</span>.")
|
||||
return
|
||||
busy_toggling_fov = TRUE
|
||||
|
||||
log_admin("[key_name(usr)] has [on_off ? "disabled" : "enabled"] the Field of Vision configuration.")
|
||||
CONFIG_SET(flag/use_field_of_vision, !on_off)
|
||||
|
||||
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggled Field of Vision", "[on_off ? "Enabled" : "Disabled"]"))
|
||||
|
||||
if(on_off)
|
||||
for(var/k in GLOB.mob_list)
|
||||
if(!k)
|
||||
continue
|
||||
var/mob/M = k
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(!(H.dna?.species.has_field_of_vision))
|
||||
continue
|
||||
else if(!M.has_field_of_vision)
|
||||
continue
|
||||
var/datum/component/field_of_vision/FoV = M.GetComponent(/datum/component/field_of_vision)
|
||||
if(FoV)
|
||||
qdel(FoV)
|
||||
CHECK_TICK
|
||||
else
|
||||
for(var/k in GLOB.clients)
|
||||
if(!k)
|
||||
continue
|
||||
var/client/C = k
|
||||
var/mob/M = C.mob
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(!(H.dna?.species.has_field_of_vision))
|
||||
continue
|
||||
else if(!M.has_field_of_vision)
|
||||
continue
|
||||
M.LoadComponent(/datum/component/field_of_vision, M.field_of_vision_type)
|
||||
CHECK_TICK
|
||||
|
||||
busy_toggling_fov = FALSE
|
||||
|
||||
/client/proc/smite(mob/living/carbon/human/target as mob)
|
||||
set name = "Smite"
|
||||
set category = "Fun"
|
||||
|
||||
Reference in New Issue
Block a user