Adds muzzle flashes for guns depending on the ammo (#13322)

* Muzzle flashes added for guns

* Use an muzzle flash effect now.

* Unused var

* sillenced guns have a lower alpha muzzleflash effect
This commit is contained in:
farie82
2020-09-20 12:41:45 -04:00
committed by GitHub
parent f110cef216
commit 81682dc626
23 changed files with 205 additions and 46 deletions
@@ -0,0 +1,19 @@
/obj/effect/temp_visual/target_angled/muzzle_flash
icon = 'icons/effects/projectile.dmi'
icon_state = "firing_effect"
duration = 0.2
/obj/effect/temp_visual/target_angled/muzzle_flash/Initialize(mapload, atom/target, duration_override = null)
if(duration_override)
duration = duration_override
. = ..()
if(get_dir(src, target) & NORTH)
layer = BELOW_MOB_LAYER
/obj/effect/temp_visual/target_angled/muzzle_flash/energy
icon_state = "firing_effect_energy"
/obj/effect/temp_visual/target_angled/muzzle_flash/magic
icon = 'icons/effects/effects.dmi'
icon_state = "shieldsparkles"
@@ -35,3 +35,13 @@
if(set_dir)
setDir(set_dir)
. = ..()
/obj/effect/temp_visual/target_angled
randomdir = FALSE
/obj/effect/temp_visual/target_angled/Initialize(mapload, atom/target)
. = ..()
if(target)
var/matrix/M = new
M.Turn(get_angle(src, target))
transform = M
@@ -141,6 +141,8 @@
/obj/item/ammo_casing/energy/chrono_beam
name = "eradication beam"
projectile_type = /obj/item/projectile/energy/chrono_beam
muzzle_flash_effect = /obj/effect/temp_visual/target_angled/muzzle_flash/energy
muzzle_flash_color = null
icon_state = "chronobolt"
e_cost = 0