mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 20:45:28 +01:00
[MIRROR] Overlay lighting component (#469)
* Overlay lighting component (#52413) Sparks no longer lag, projectile beams move super smoothly, same with mobs and whatnot. This also allows for easy expansion into directional lights, field-of-view, wee-woo rotating lights or whatever. It does have a downside: things right-clicked or checked through the alt+click tab will show the light overlay: This is a BYOND limitation, very well worth it IMO. 🆑 add: Smooth movable lighting system implemented. Projectiles, sparks, thrown flashlights or moving mobs with lights should be much smoother and less laggy. balance: Light sources no longer stack in range, though they still do in intensity. /🆑 * Overlay lighting component Co-authored-by: Rohesie <rohesie@gmail.com>
This commit is contained in:
@@ -9,8 +9,11 @@
|
||||
throwforce = 0
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
custom_materials = list(/datum/material/iron = 300, /datum/material/glass = 300)
|
||||
light_system = MOVABLE_LIGHT //Used as a flash here.
|
||||
light_range = FLASH_LIGHT_RANGE
|
||||
light_color = COLOR_WHITE
|
||||
light_power = FLASH_LIGHT_POWER
|
||||
light_on = FALSE
|
||||
var/flashing_overlay = "flash-f"
|
||||
var/times_used = 0 //Number of times it's been used.
|
||||
var/burnt_out = FALSE //Is the flash burnt out?
|
||||
@@ -19,6 +22,7 @@
|
||||
var/cooldown = 0
|
||||
var/last_trigger = 0 //Last time it was successfully triggered.
|
||||
|
||||
|
||||
/obj/item/assembly/flash/suicide_act(mob/living/user)
|
||||
if(burnt_out)
|
||||
user.visible_message("<span class='suicide'>[user] raises \the [src] up to [user.p_their()] eyes and activates it ... but it's burnt out!</span>")
|
||||
@@ -97,7 +101,8 @@
|
||||
return FALSE
|
||||
last_trigger = world.time
|
||||
playsound(src, 'sound/weapons/flash.ogg', 100, TRUE)
|
||||
flash_lighting_fx(FLASH_LIGHT_RANGE, light_power, light_color)
|
||||
set_light_on(TRUE)
|
||||
addtimer(CALLBACK(src, .proc/flash_end), FLASH_LIGHT_DURATION, TIMER_OVERRIDE|TIMER_UNIQUE)
|
||||
times_used++
|
||||
flash_recharge()
|
||||
update_icon(TRUE)
|
||||
@@ -105,6 +110,11 @@
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/item/assembly/flash/proc/flash_end()
|
||||
set_light_on(FALSE)
|
||||
|
||||
|
||||
/obj/item/assembly/flash/proc/flash_carbon(mob/living/carbon/M, mob/user, power = 15, targeted = TRUE, generic_message = FALSE)
|
||||
if(!istype(M))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user