Merge pull request #10752 from VOREStation/Arokha/flashpoint

The One Where You Can Aim Lights
This commit is contained in:
Aronai Sieyes
2021-06-30 15:28:13 -04:00
committed by GitHub
16 changed files with 165 additions and 22 deletions
+43 -1
View File
@@ -98,11 +98,53 @@
light_color = LIGHT_COLOR_FIRE
light_range = LIGHT_RANGE_FIRE
/obj/effect/abstract/directional_lighting
/obj/effect/abstract
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/obj/effect/abstract/light_spot
icon = 'icons/effects/eris_flashlight.dmi'
icon_state = "medium"
pixel_x = -16
pixel_y = -16
/obj/effect/abstract/directional_lighting
var/obj/effect/abstract/light_spot/light_spot = new
var/trans_angle
var/icon_dist
/obj/effect/abstract/directional_lighting/Initialize()
. = ..()
vis_contents += light_spot
/obj/effect/abstract/directional_lighting/proc/face_light(atom/movable/source, angle, distance)
if(!loc) // We're in nullspace
return
// Save ourselves some matrix math
if(angle != trans_angle)
trans_angle = angle
// Doing this in one operation (tn = turn(initial(tn), angle)) has strange results...
light_spot.transform = initial(light_spot.transform)
light_spot.transform = turn(light_spot.transform, angle)
if(icon_dist != distance)
icon_dist = distance
switch(distance)
if(0)
light_spot.icon_state = "vclose"
if(1)
light_spot.icon_state = "close"
if(2)
light_spot.icon_state = "medium"
if(3 to INFINITY)
light_spot.icon_state = "far"
/obj/effect/abstract/directional_lighting/Destroy(force)
if(!force)
stack_trace("Directional light atom deleted, but not by our component")
return QDEL_HINT_LETMELIVE
vis_contents.Cut()
qdel_null(light_spot)
return ..()
+14
View File
@@ -161,6 +161,20 @@
alpha = 110
blocks_emissive = FALSE
var/static/matrix/normal_transform
/obj/effect/overlay/light_cone/Initialize()
. = ..()
apply_standard_transform()
/obj/effect/overlay/light_cone/proc/reset_transform(apply_standard)
transform = initial(transform)
if(apply_standard)
apply_standard_transform()
/obj/effect/overlay/light_cone/proc/apply_standard_transform()
transform = transform.Translate(-32, -32)
/obj/effect/overlay/light_cone/Destroy(force)
if(!force)
stack_trace("Directional light cone deleted, but not by our component")