mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-21 09:56:53 +01:00
28e11dee54
Co-authored-by: silicons <2003111+silicons@users.noreply.github.com> Co-authored-by: Zandario <zandarioh@gmail.com> Co-authored-by: VM_USER <VM_USER> Co-authored-by: AlphaM01 <33434925+AlphaM01@users.noreply.github.com> Co-authored-by: LordPapalus <54518057+LordPapalus@users.noreply.github.com>
19 lines
649 B
Plaintext
19 lines
649 B
Plaintext
// Makes the screen shake for nearby players every so often.
|
|
/obj/effect/map_effect/interval/screen_shaker
|
|
name = "screen shaker"
|
|
icon_state = "screen_shaker"
|
|
|
|
interval_lower_bound = 1 SECOND
|
|
interval_upper_bound = 2 SECONDS
|
|
|
|
var/shake_radius = 7 // How far the shaking effect extends to. By default it is one screen length.
|
|
var/shake_duration = 2 // How long the shaking lasts.
|
|
var/shake_strength = 1 // How much it shakes.
|
|
|
|
/obj/effect/map_effect/interval/screen_shaker/trigger()
|
|
for(var/A in GLOB.player_list)
|
|
var/mob/M = A
|
|
if(M.z == src.z && get_dist(src, M) <= shake_radius)
|
|
shake_camera(M, shake_duration, shake_strength)
|
|
..()
|