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:
Ghom
2020-05-16 00:25:04 +02:00
committed by GitHub
parent b21fb97bda
commit 7c7147cb3e
122 changed files with 947 additions and 347 deletions
+2 -2
View File
@@ -143,8 +143,8 @@ RLD
//if user can't be seen from A (only checks surroundings' opaqueness) and can't see A.
//jarring, but it should stop people from targetting atoms they can't see...
//excluding darkness, to allow RLD to be used to light pitch black dark areas.
if(!((user in view(view_range, A)) || (user in viewers(view_range, A))))
to_chat(user, "<span class='warning'>You focus, pointing \the [src] at whatever outside your field of vision in the given direction... to no avail.</span>")
if(!((user in view(view_range, A)) || (user in get_actual_viewers(view_range, A))))
to_chat(user, "<span class='warning'>You focus, pointing \the [src] at whatever outside your field of vision in that direction... to no avail.</span>")
return FALSE
return TRUE
@@ -135,7 +135,8 @@
outmsg = "<span class='warning'>You miss the lens of [C] with [src]!</span>"
//catpeople
for(var/mob/living/carbon/human/H in view(1,targloc))
var/list/viewers = get_actual_viewers(1,targloc)
for(var/mob/living/carbon/human/H in viewers)
if(!iscatperson(H) || H.incapacitated() || H.eye_blind )
continue
if(!H.lying)
@@ -150,7 +151,7 @@
H.visible_message("<span class='notice'>[H] stares at the light</span>","<span class = 'warning'> You stare at the light... </span>")
//cats!
for(var/mob/living/simple_animal/pet/cat/C in view(1,targloc))
for(var/mob/living/simple_animal/pet/cat/C in viewers)
if(prob(50))
C.visible_message("<span class='notice'>[C] pounces on the light!</span>","<span class='warning'>LIGHT!</span>")
C.Move(targloc)
@@ -2,6 +2,7 @@
name = "station intercom"
desc = "Talk through this."
icon_state = "intercom"
plane = ABOVE_WALL_PLANE
anchored = TRUE
w_class = WEIGHT_CLASS_BULKY
canhear_range = 2
+2 -3
View File
@@ -196,9 +196,8 @@
sleep(1)
previousturf = T
operating = FALSE
for(var/mob/M in viewers(1, loc))
if((M.client && M.machine == src))
attack_self(M)
if(usr.machine == src)
attack_self(usr)
/obj/item/flamethrower/proc/default_ignite(turf/target, release_amount = 0.05)
@@ -66,7 +66,7 @@
if(ismob(loc))
attack_self(loc)
else
for(var/mob/M in viewers(1, src))
for(var/mob/M in get_actual_viewers(1, src))
if(M.client)
attack_self(M)
add_fingerprint(usr)
+2 -4
View File
@@ -105,10 +105,7 @@
if (length(code) > 5)
code = "ERROR"
add_fingerprint(usr)
for(var/mob/M in viewers(1, loc))
if ((M.client && M.machine == src))
attack_self(M)
return
attack_self(usr)
return
@@ -158,6 +155,7 @@
/obj/item/storage/secure/safe
name = "secure safe"
icon = 'icons/obj/storage.dmi'
plane = ABOVE_WALL_PLANE
icon_state = "safe"
icon_opened = "safe0"
icon_locking = "safeb"
+1 -1
View File
@@ -104,7 +104,7 @@
if (ismob(src.loc))
attack_self(src.loc)
else
for(var/mob/M in viewers(1, src))
for(var/mob/M in get_actual_viewers(1, src))
if (M.client)
src.attack_self(M)
return