diff --git a/code/__DEFINES/muzzle_flash.dm b/code/__DEFINES/muzzle_flash.dm
new file mode 100644
index 00000000000..e35e1c73ca0
--- /dev/null
+++ b/code/__DEFINES/muzzle_flash.dm
@@ -0,0 +1,7 @@
+#define MUZZLE_FLASH_STRENGTH_WEAK 1
+#define MUZZLE_FLASH_STRENGTH_NORMAL 2
+#define MUZZLE_FLASH_STRENGTH_STRONG 3
+
+#define MUZZLE_FLASH_RANGE_WEAK 1
+#define MUZZLE_FLASH_RANGE_NORMAL 2
+#define MUZZLE_FLASH_RANGE_STRONG 3
diff --git a/code/game/gamemodes/changeling/powers/mutations.dm b/code/game/gamemodes/changeling/powers/mutations.dm
index d12b970d884..be88e0bb6e0 100644
--- a/code/game/gamemodes/changeling/powers/mutations.dm
+++ b/code/game/gamemodes/changeling/powers/mutations.dm
@@ -221,6 +221,7 @@
projectile_type = /obj/item/projectile/tentacle
caliber = "tentacle"
icon_state = "tentacle_end"
+ muzzle_flash_effect = null
var/obj/item/gun/magic/tentacle/gun //the item that shot it
/obj/item/ammo_casing/magic/tentacle/New(obj/item/gun/magic/tentacle/tentacle_gun)
diff --git a/code/game/objects/effects/temporary_visuals/muzzle_flashes.dm b/code/game/objects/effects/temporary_visuals/muzzle_flashes.dm
new file mode 100644
index 00000000000..ab7bb7a056d
--- /dev/null
+++ b/code/game/objects/effects/temporary_visuals/muzzle_flashes.dm
@@ -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"
diff --git a/code/game/objects/effects/temporary_visuals/temporary_visual.dm b/code/game/objects/effects/temporary_visuals/temporary_visual.dm
index d09acce7255..0bbbb554ace 100644
--- a/code/game/objects/effects/temporary_visuals/temporary_visual.dm
+++ b/code/game/objects/effects/temporary_visuals/temporary_visual.dm
@@ -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
diff --git a/code/game/objects/items/weapons/chrono_eraser.dm b/code/game/objects/items/weapons/chrono_eraser.dm
index 1dc0b22abdf..ef158e3758c 100644
--- a/code/game/objects/items/weapons/chrono_eraser.dm
+++ b/code/game/objects/items/weapons/chrono_eraser.dm
@@ -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
diff --git a/code/modules/mining/lavaland/loot/tendril_loot.dm b/code/modules/mining/lavaland/loot/tendril_loot.dm
index 0af08e40c74..f7a555f104b 100644
--- a/code/modules/mining/lavaland/loot/tendril_loot.dm
+++ b/code/modules/mining/lavaland/loot/tendril_loot.dm
@@ -358,6 +358,7 @@
projectile_type = /obj/item/projectile/hook
caliber = "hook"
icon_state = "hook"
+ muzzle_flash_effect = null
/obj/item/projectile/hook
name = "hook"
diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm
index fd526d0e12a..0938dd7af76 100644
--- a/code/modules/projectiles/ammunition.dm
+++ b/code/modules/projectiles/ammunition.dm
@@ -19,6 +19,15 @@
var/click_cooldown_override = 0 //Override this to make your gun have a faster fire rate, in tenths of a second. 4 is the default gun cooldown.
var/harmful = TRUE //pacifism check for boolet, set to FALSE if bullet is non-lethal
+ /// What type of muzzle flash effect will be shown. If null then no effect and flash of light will be shown
+ var/muzzle_flash_effect = /obj/effect/temp_visual/target_angled/muzzle_flash
+ /// What color the flash has. If null then the flash won't cause lighting
+ var/muzzle_flash_color = LIGHT_COLOR_TUNGSTEN
+ /// What range the muzzle flash has
+ var/muzzle_flash_range = MUZZLE_FLASH_RANGE_WEAK
+ /// How strong the flash is
+ var/muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_WEAK
+
/obj/item/ammo_casing/New()
..()
if(projectile_type)
diff --git a/code/modules/projectiles/ammunition/ammo_casings.dm b/code/modules/projectiles/ammunition/ammo_casings.dm
index 92ecf815104..ec2bb5e6ad3 100644
--- a/code/modules/projectiles/ammunition/ammo_casings.dm
+++ b/code/modules/projectiles/ammunition/ammo_casings.dm
@@ -2,6 +2,8 @@
desc = "A .357 bullet casing."
caliber = "357"
projectile_type = /obj/item/projectile/bullet
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_STRONG
/obj/item/ammo_casing/rubber9mm
desc = "A 9mm rubber bullet casing."
@@ -14,6 +16,8 @@
icon_state = "762-casing"
caliber = "a762"
projectile_type = /obj/item/projectile/bullet
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_STRONG
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_STRONG
/obj/item/ammo_casing/a762/enchanted
projectile_type = /obj/item/projectile/bullet/weakbullet3
@@ -22,15 +26,20 @@
desc = "A .50AE bullet casing."
caliber = ".50"
projectile_type = /obj/item/projectile/bullet
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_STRONG
/obj/item/ammo_casing/c38
desc = "A .38 bullet casing."
caliber = "38"
icon_state = "r-casing"
projectile_type = /obj/item/projectile/bullet/weakbullet2
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL
/obj/item/ammo_casing/c38/invisible
projectile_type = /obj/item/projectile/bullet/weakbullet2/invisible
+ muzzle_flash_effect = null // invisible eh
/obj/item/ammo_casing/c38/invisible/fake
projectile_type = /obj/item/projectile/bullet/weakbullet2/invisible/fake
@@ -39,12 +48,15 @@
desc = "A 10mm bullet casing."
caliber = "10mm"
projectile_type = /obj/item/projectile/bullet/midbullet3
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL
/obj/item/ammo_casing/c10mm/ap
projectile_type = /obj/item/projectile/bullet/midbullet3/ap
/obj/item/ammo_casing/c10mm/fire
projectile_type = /obj/item/projectile/bullet/midbullet3/fire
+ muzzle_flash_color = LIGHT_COLOR_FIRE
/obj/item/ammo_casing/c10mm/hp
projectile_type = /obj/item/projectile/bullet/midbullet3/hp
@@ -53,62 +65,60 @@
desc = "A 9mm bullet casing."
caliber = "9mm"
projectile_type = /obj/item/projectile/bullet/weakbullet3
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_WEAK
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL
-/obj/item/ammo_casing/c9mmap
- desc = "A 9mm bullet casing."
- caliber = "9mm"
+/obj/item/ammo_casing/c9mm/ap
projectile_type = /obj/item/projectile/bullet/armourpiercing
-/obj/item/ammo_casing/c9mmtox
- desc = "A 9mm bullet casing."
- caliber = "9mm"
+/obj/item/ammo_casing/c9mm/tox
projectile_type = /obj/item/projectile/bullet/toxinbullet
-/obj/item/ammo_casing/c9mminc
- desc = "A 9mm bullet casing."
- caliber = "9mm"
+/obj/item/ammo_casing/c9mm/inc
projectile_type = /obj/item/projectile/bullet/incendiary/firebullet
+ muzzle_flash_color = LIGHT_COLOR_FIRE
/obj/item/ammo_casing/c46x30mm
desc = "A 4.6x30mm bullet casing."
caliber = "4.6x30mm"
projectile_type = /obj/item/projectile/bullet/weakbullet3
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_WEAK
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL
-/obj/item/ammo_casing/c46x30mmap
- desc = "A 4.6x30mm bullet casing."
- caliber = "4.6x30mm"
+/obj/item/ammo_casing/c46x30mm/ap
projectile_type = /obj/item/projectile/bullet/armourpiercing
-/obj/item/ammo_casing/c46x30mmtox
- desc = "A 4.6x30mm bullet casing."
- caliber = "4.6x30mm"
+/obj/item/ammo_casing/c46x30mm/tox
projectile_type = /obj/item/projectile/bullet/toxinbullet
-/obj/item/ammo_casing/c46x30mminc
- desc = "A 4.6x30mm bullet casing."
- caliber = "4.6x30mm"
+/obj/item/ammo_casing/c46x30mm/inc
projectile_type = /obj/item/projectile/bullet/incendiary/firebullet
+ muzzle_flash_color = LIGHT_COLOR_FIRE
/obj/item/ammo_casing/rubber45
desc = "A .45 rubber bullet casing."
caliber = ".45"
icon_state = "r-casing"
projectile_type = /obj/item/projectile/bullet/midbullet_r
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL
/obj/item/ammo_casing/c45
desc = "A .45 bullet casing."
caliber = ".45"
projectile_type = /obj/item/projectile/bullet/midbullet
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL
-/obj/item/ammo_casing/c45nostamina
- desc = "A .45 bullet casing."
- caliber = ".45"
+/obj/item/ammo_casing/c45/nostamina
projectile_type = /obj/item/projectile/bullet/midbullet3
/obj/item/ammo_casing/n762
desc = "A 7.62x38mmR bullet casing."
caliber = "n762"
projectile_type = /obj/item/projectile/bullet
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_STRONG
/obj/item/ammo_casing/caseless/magspear
name = "magnetic spear"
@@ -118,6 +128,7 @@
icon_state = "magspear"
throwforce = 15 //still deadly when thrown
throw_speed = 3
+ muzzle_flash_color = null
/obj/item/ammo_casing/shotgun
name = "shotgun slug"
@@ -127,6 +138,8 @@
drop_sound = 'sound/weapons/gun_interactions/shotgun_fall.ogg'
projectile_type = /obj/item/projectile/bullet
materials = list(MAT_METAL=4000)
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_STRONG
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_STRONG
/obj/item/ammo_casing/shotgun/buckshot
@@ -153,6 +166,8 @@
icon_state = "bshell"
projectile_type = /obj/item/projectile/bullet/weakbullet
materials = list(MAT_METAL=250)
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL
/obj/item/ammo_casing/shotgun/improvised
@@ -163,6 +178,8 @@
materials = list(MAT_METAL=250)
pellets = 10
variance = 25
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL
/obj/item/ammo_casing/shotgun/improvised/overload
@@ -174,6 +191,8 @@
materials = list(MAT_METAL=250)
pellets = 4
variance = 40
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_STRONG
/obj/item/ammo_casing/shotgun/stunslug
@@ -182,6 +201,9 @@
icon_state = "stunshell"
projectile_type = /obj/item/projectile/bullet/stunshot
materials = list(MAT_METAL=250)
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL
+ muzzle_flash_color = "#FFFF00"
/obj/item/ammo_casing/shotgun/meteorshot
@@ -203,12 +225,14 @@
would have difficulty with."
icon_state = "pshell"
projectile_type = /obj/item/projectile/beam/pulse/shot
+ muzzle_flash_color = LIGHT_COLOR_DARKBLUE
/obj/item/ammo_casing/shotgun/incendiary
name = "incendiary slug"
desc = "An incendiary-coated shotgun slug."
icon_state = "ishell"
projectile_type = /obj/item/projectile/bullet/incendiary/shell
+ muzzle_flash_color = LIGHT_COLOR_FIRE
/obj/item/ammo_casing/shotgun/frag12
name = "FRAG-12 slug"
@@ -223,6 +247,7 @@
projectile_type = /obj/item/projectile/bullet/incendiary/shell/dragonsbreath
pellets = 4
variance = 35
+ muzzle_flash_color = LIGHT_COLOR_FIRE
/obj/item/ammo_casing/shotgun/ion
name = "ion shell"
@@ -232,12 +257,18 @@
projectile_type = /obj/item/projectile/ion/weak
pellets = 4
variance = 35
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL
+ muzzle_flash_color = LIGHT_COLOR_LIGHTBLUE
/obj/item/ammo_casing/shotgun/laserslug
name = "laser slug"
desc = "An advanced shotgun shell that uses a micro laser to replicate the effects of a laser weapon in a ballistic package."
icon_state = "lshell"
projectile_type = /obj/item/projectile/beam/laser
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL
+ muzzle_flash_color = LIGHT_COLOR_DARKRED
/obj/item/ammo_casing/shotgun/techshell
name = "unloaded technological shell"
@@ -251,6 +282,8 @@
icon_state = "cshell"
container_type = OPENCONTAINER
projectile_type = /obj/item/projectile/bullet/dart
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL
/obj/item/ammo_casing/shotgun/dart/New()
..()
@@ -275,18 +308,24 @@
desc = "A tranquilizer round used to subdue individuals utilizing stimulants."
icon_state = "nshell"
projectile_type = /obj/item/projectile/bullet/dart/syringe/tranquilizer
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL
materials = list(MAT_METAL=250)
/obj/item/ammo_casing/a556
desc = "A 5.56mm bullet casing."
caliber = "a556"
projectile_type = /obj/item/projectile/bullet/heavybullet
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL
/obj/item/ammo_casing/shotgun/fakebeanbag
name = "beanbag shell"
desc = "A weak beanbag shell."
icon_state = "bshell"
projectile_type = /obj/item/projectile/bullet/weakbullet/booze
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL
/obj/item/ammo_casing/rocket
name = "rocket shell"
@@ -294,6 +333,8 @@
icon_state = "rocketshell"
projectile_type = /obj/item/missile
caliber = "rocket"
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_STRONG
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_STRONG
/obj/item/ammo_casing/caseless
desc = "A caseless bullet casing."
@@ -309,6 +350,8 @@
desc = "A .75 bullet casing."
caliber = "75"
projectile_type = /obj/item/projectile/bullet/gyro
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_STRONG
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_STRONG
/obj/item/ammo_casing/a40mm
name = "40mm HE shell"
@@ -316,11 +359,14 @@
caliber = "40mm"
icon_state = "40mmHE"
projectile_type = /obj/item/projectile/bullet/a40mm
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL
/obj/item/ammo_casing/caseless/foam_dart
name = "foam dart"
desc = "It's nerf or nothing! Ages 8 and up."
projectile_type = /obj/item/projectile/bullet/reusable/foam_dart
+ muzzle_flash_effect = null
caliber = "foam_force"
icon = 'icons/obj/guns/toy.dmi'
icon_state = "foamdart"
@@ -403,6 +449,7 @@
name = "assassination shell"
desc = "A specialist shrapnel shell that has been laced with a silencing toxin."
projectile_type = /obj/item/projectile/bullet/pellet/assassination
+ muzzle_flash_effect = null
icon_state = "gshell"
pellets = 6
variance = 25
@@ -411,9 +458,15 @@
desc = "A cap for children toys."
caliber = "cap"
projectile_type = /obj/item/projectile/bullet/cap
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL
/obj/item/ammo_casing/laser
desc = "An experimental laser casing."
caliber = "laser"
projectile_type = /obj/item/projectile/beam/laser
+ muzzle_flash_effect = /obj/effect/temp_visual/target_angled/muzzle_flash/energy
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_WEAK
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL
+ muzzle_flash_color = LIGHT_COLOR_DARKRED
icon_state = "lasercasing"
diff --git a/code/modules/projectiles/ammunition/energy.dm b/code/modules/projectiles/ammunition/energy.dm
index bcadfc62e08..a809953b8fd 100644
--- a/code/modules/projectiles/ammunition/energy.dm
+++ b/code/modules/projectiles/ammunition/energy.dm
@@ -6,9 +6,11 @@
var/e_cost = 100 //The amount of energy a cell needs to expend to create this shot.
var/select_name = "energy"
fire_sound = 'sound/weapons/laser.ogg'
+ muzzle_flash_effect = /obj/effect/temp_visual/target_angled/muzzle_flash/energy
/obj/item/ammo_casing/energy/laser
projectile_type = /obj/item/projectile/beam/laser
+ muzzle_flash_color = LIGHT_COLOR_DARKRED
select_name = "kill"
/obj/item/ammo_casing/energy/laser/cyborg //to balance cyborg energy cost seperately
@@ -16,6 +18,7 @@
/obj/item/ammo_casing/energy/lasergun
projectile_type = /obj/item/projectile/beam/laser
+ muzzle_flash_color = LIGHT_COLOR_DARKRED
e_cost = 83
select_name = "kill"
@@ -40,6 +43,7 @@
/obj/item/ammo_casing/energy/laser/pulse
projectile_type = /obj/item/projectile/beam/pulse
+ muzzle_flash_color = LIGHT_COLOR_DARKBLUE
e_cost = 200
select_name = "DESTROY"
fire_sound = 'sound/weapons/pulse.ogg'
@@ -52,6 +56,7 @@
/obj/item/ammo_casing/energy/laser/bluetag
projectile_type = /obj/item/projectile/beam/lasertag/bluetag
+ muzzle_flash_color = LIGHT_COLOR_BLUE
select_name = "bluetag"
harmful = FALSE
@@ -62,6 +67,7 @@
/obj/item/ammo_casing/energy/xray
projectile_type = /obj/item/projectile/beam/xray
+ muzzle_flash_color = LIGHT_COLOR_GREEN
e_cost = 100
fire_sound = 'sound/weapons/laser3.ogg'
@@ -92,6 +98,7 @@
/obj/item/ammo_casing/energy/electrode
projectile_type = /obj/item/projectile/energy/electrode
+ muzzle_flash_color = "#FFFF00"
select_name = "stun"
fire_sound = 'sound/weapons/taser.ogg'
e_cost = 200
@@ -107,11 +114,13 @@
/obj/item/ammo_casing/energy/ion
projectile_type = /obj/item/projectile/ion
+ muzzle_flash_color = LIGHT_COLOR_LIGHTBLUE
select_name = "ion"
fire_sound = 'sound/weapons/ionrifle.ogg'
/obj/item/ammo_casing/energy/declone
projectile_type = /obj/item/projectile/energy/declone
+ muzzle_flash_color = LIGHT_COLOR_GREEN
select_name = "declone"
fire_sound = 'sound/weapons/pulse3.ogg'
@@ -122,6 +131,7 @@
/obj/item/ammo_casing/energy/flora
fire_sound = 'sound/effects/stealthoff.ogg'
+ muzzle_flash_color = LIGHT_COLOR_GREEN
harmful = FALSE
/obj/item/ammo_casing/energy/flora/yield
@@ -146,10 +156,13 @@
/obj/item/ammo_casing/energy/meteor
projectile_type = /obj/item/projectile/meteor
+ muzzle_flash_effect = /obj/effect/temp_visual/target_angled/muzzle_flash
+ muzzle_flash_color = null
select_name = "goddamn meteor"
/obj/item/ammo_casing/energy/disabler
projectile_type = /obj/item/projectile/beam/disabler
+ muzzle_flash_color = LIGHT_COLOR_LIGHTBLUE
select_name = "disable"
e_cost = 50
fire_sound = 'sound/weapons/taser2.ogg'
@@ -160,6 +173,7 @@
/obj/item/ammo_casing/energy/plasma
projectile_type = /obj/item/projectile/plasma
+ muzzle_flash_color = LIGHT_COLOR_PURPLE
select_name = "plasma burst"
fire_sound = 'sound/weapons/plasma_cutter.ogg'
delay = 15
@@ -172,6 +186,7 @@
/obj/item/ammo_casing/energy/wormhole
projectile_type = /obj/item/projectile/beam/wormhole
+ muzzle_flash_color = "#33CCFF"
e_cost = 0
fire_sound = 'sound/weapons/pulse3.ogg'
var/obj/item/gun/energy/wormhole_projector/gun = null
@@ -183,10 +198,13 @@
/obj/item/ammo_casing/energy/wormhole/orange
projectile_type = /obj/item/projectile/beam/wormhole/orange
+ muzzle_flash_color = "#FF6600"
select_name = "orange"
/obj/item/ammo_casing/energy/bolt
projectile_type = /obj/item/projectile/energy/bolt
+ muzzle_flash_color = null
+ muzzle_flash_effect = /obj/effect/temp_visual/target_angled/muzzle_flash
select_name = "bolt"
e_cost = 500
fire_sound = 'sound/weapons/genhit.ogg'
@@ -203,17 +221,21 @@
/obj/item/ammo_casing/energy/instakill
projectile_type = /obj/item/projectile/beam/instakill
+ muzzle_flash_color = LIGHT_COLOR_PURPLE
e_cost = 0
select_name = "DESTROY"
/obj/item/ammo_casing/energy/instakill/blue
projectile_type = /obj/item/projectile/beam/instakill/blue
+ muzzle_flash_color = LIGHT_COLOR_DARKBLUE
/obj/item/ammo_casing/energy/instakill/red
projectile_type = /obj/item/projectile/beam/instakill/red
+ muzzle_flash_color = LIGHT_COLOR_DARKRED
/obj/item/ammo_casing/energy/plasma
projectile_type = /obj/item/projectile/plasma
+ muzzle_flash_color = LIGHT_COLOR_PURPLE
select_name = "plasma burst"
fire_sound = 'sound/weapons/pulse.ogg'
@@ -224,26 +246,31 @@
fire_sound = 'sound/magic/lightningbolt.ogg'
e_cost = 200
select_name = "lightning beam"
+ muzzle_flash_color = LIGHT_COLOR_FADEDPURPLE
projectile_type = /obj/item/projectile/energy/shock_revolver
/obj/item/ammo_casing/energy/toxplasma
projectile_type = /obj/item/projectile/energy/toxplasma
+ muzzle_flash_color = LIGHT_COLOR_FADEDPURPLE
fire_sound = 'sound/weapons/taser2.ogg'
select_name = "plasma dart"
/obj/item/ammo_casing/energy/clown
projectile_type = /obj/item/projectile/clown
+ muzzle_flash_effect = null
fire_sound = 'sound/weapons/gunshots/gunshot_smg.ogg'
select_name = "clown"
/obj/item/ammo_casing/energy/sniper
projectile_type = /obj/item/projectile/beam/sniper
+ muzzle_flash_color = LIGHT_COLOR_PINK
fire_sound = 'sound/weapons/marauder.ogg'
delay = 50
select_name = "snipe"
/obj/item/ammo_casing/energy/teleport
projectile_type = /obj/item/projectile/energy/teleport
+ muzzle_flash_color = LIGHT_COLOR_LIGHTBLUE
fire_sound = 'sound/weapons/wave.ogg'
e_cost = 250
select_name = "teleport beam"
@@ -258,6 +285,7 @@
/obj/item/ammo_casing/energy/mimic
projectile_type = /obj/item/projectile/mimic
+ muzzle_flash_effect = null
fire_sound = 'sound/weapons/bite.ogg'
select_name = "gun mimic"
var/mimic_type
diff --git a/code/modules/projectiles/ammunition/magazines.dm b/code/modules/projectiles/ammunition/magazines.dm
index 5cc6a19b840..135f8c14718 100644
--- a/code/modules/projectiles/ammunition/magazines.dm
+++ b/code/modules/projectiles/ammunition/magazines.dm
@@ -271,15 +271,15 @@
/obj/item/ammo_box/magazine/wt550m9/wtap
name = "wt550 magazine (Armour Piercing 4.6x30mm)"
- ammo_type = /obj/item/ammo_casing/c46x30mmap
+ ammo_type = /obj/item/ammo_casing/c46x30mm/ap
/obj/item/ammo_box/magazine/wt550m9/wttx
name = "wt550 magazine (Toxin Tipped 4.6x30mm)"
- ammo_type = /obj/item/ammo_casing/c46x30mmtox
+ ammo_type = /obj/item/ammo_casing/c46x30mm/tox
/obj/item/ammo_box/magazine/wt550m9/wtic
name = "wt550 magazine (Incendiary 4.6x30mm)"
- ammo_type = /obj/item/ammo_casing/c46x30mminc
+ ammo_type = /obj/item/ammo_casing/c46x30mm/inc
/obj/item/ammo_box/magazine/uzim9mm
name = "uzi magazine (9mm)"
@@ -302,17 +302,17 @@
/obj/item/ammo_box/magazine/smgm9mm/ap
name = "SMG magazine (Armour Piercing 9mm)"
- ammo_type = /obj/item/ammo_casing/c9mmap
+ ammo_type = /obj/item/ammo_casing/c9mm/ap
materials = list(MAT_METAL = 3000)
/obj/item/ammo_box/magazine/smgm9mm/toxin
name = "SMG magazine (Toxin Tipped 9mm)"
- ammo_type = /obj/item/ammo_casing/c9mmtox
+ ammo_type = /obj/item/ammo_casing/c9mm/tox
materials = list(MAT_METAL = 3000)
/obj/item/ammo_box/magazine/smgm9mm/fire
name = "SMG Magazine (Incendiary 9mm)"
- ammo_type = /obj/item/ammo_casing/c9mminc
+ ammo_type = /obj/item/ammo_casing/c9mm/inc
materials = list(MAT_METAL = 3000)
/obj/item/ammo_box/magazine/smgm9mm/update_icon()
diff --git a/code/modules/projectiles/ammunition/special.dm b/code/modules/projectiles/ammunition/special.dm
index 5fa53566fe5..f37690e2787 100644
--- a/code/modules/projectiles/ammunition/special.dm
+++ b/code/modules/projectiles/ammunition/special.dm
@@ -2,6 +2,8 @@
name = "magic casing"
desc = "I didn't even know magic needed ammo..."
projectile_type = /obj/item/projectile/magic
+ muzzle_flash_color = COLOR_BLUE_GRAY
+ muzzle_flash_effect = /obj/effect/temp_visual/target_angled/muzzle_flash/magic
/obj/item/ammo_casing/magic/change
projectile_type = /obj/item/projectile/magic/change
@@ -40,13 +42,14 @@
projectile_type = pick(typesof(/obj/item/projectile/magic))
..()
-/obj/item/ammo_casing/forcebolt
+/obj/item/ammo_casing/magic/forcebolt
projectile_type = /obj/item/projectile/forcebolt
/obj/item/ammo_casing/syringegun
name = "syringe gun spring"
desc = "A high-power spring that throws syringes."
projectile_type = null
+ muzzle_flash_effect = null
/obj/item/ammo_casing/energy/c3dbullet
projectile_type = /obj/item/projectile/bullet/midbullet3
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index 3e41bf81271..ab21182e98f 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -109,20 +109,33 @@
to_chat(user, "*click*")
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
-/obj/item/gun/proc/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1)
+/obj/item/gun/proc/shoot_live_shot(mob/living/user, atom/target, pointblank = FALSE, message = TRUE)
if(recoil)
shake_camera(user, recoil + 1, recoil)
+ var/muzzle_range = chambered.muzzle_flash_range
+ var/muzzle_strength = chambered.muzzle_flash_strength
+ var/muzzle_flash_time = 0.2 SECONDS
if(suppressed)
playsound(user, fire_sound, 10, 1)
+ muzzle_range *= 0.5
+ muzzle_strength *= 0.2
+ muzzle_flash_time *= 0.5
else
playsound(user, fire_sound, 50, 1)
- if(!message)
- return
- if(pointblank)
- user.visible_message("[user] fires [src] point blank at [pbtarget]!", "You fire [src] point blank at [pbtarget]!", "You hear \a [fire_sound_text]!")
+ if(message)
+ if(pointblank)
+ user.visible_message("[user] fires [src] point blank at [target]!", "You fire [src] point blank at [target]!", "You hear \a [fire_sound_text]!")
+ else
+ user.visible_message("[user] fires [src]!", "You fire [src]!", "You hear \a [fire_sound_text]!")
+ if(chambered.muzzle_flash_effect)
+ var/obj/effect/temp_visual/target_angled/muzzle_flash/effect = new chambered.muzzle_flash_effect(get_turf(src), target, muzzle_flash_time)
+ effect.alpha = min(255, muzzle_strength * 255)
+ if(chambered.muzzle_flash_color)
+ effect.color = chambered.muzzle_flash_color
+ effect.set_light(muzzle_range, muzzle_strength, chambered.muzzle_flash_color)
else
- user.visible_message("[user] fires [src]!", "You fire [src]!", "You hear \a [fire_sound_text]!")
+ effect.color = LIGHT_COLOR_TUNGSTEN
/obj/item/gun/emp_act(severity)
for(var/obj/O in contents)
@@ -228,9 +241,9 @@
break
else
if(get_dist(user, target) <= 1) //Making sure whether the target is in vicinity for the pointblank shot
- shoot_live_shot(user, 1, target, message)
+ shoot_live_shot(user, target, TRUE, message)
else
- shoot_live_shot(user, 0, target, message)
+ shoot_live_shot(user, target, FALSE, message)
else
shoot_with_empty_chamber(user)
break
@@ -250,9 +263,9 @@
return
else
if(get_dist(user, target) <= 1) //Making sure whether the target is in vicinity for the pointblank shot
- shoot_live_shot(user, 1, target, message)
+ shoot_live_shot(user, target, TRUE, message)
else
- shoot_live_shot(user, 0, target, message)
+ shoot_live_shot(user, target, FALSE, message)
else
shoot_with_empty_chamber(user)
return
diff --git a/code/modules/projectiles/guns/alien.dm b/code/modules/projectiles/guns/alien.dm
index d9f149b3b17..aec047ad89b 100644
--- a/code/modules/projectiles/guns/alien.dm
+++ b/code/modules/projectiles/guns/alien.dm
@@ -49,6 +49,7 @@
name = "alloy spike"
desc = "A broadhead spike made out of a weird silvery metal."
projectile_type = /obj/item/projectile/bullet/spike
+ muzzle_flash_effect = null
throwforce = 5
w_class = WEIGHT_CLASS_NORMAL
caliber = "spike"
diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
index 19316cb9540..c715ba966dd 100644
--- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
+++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
@@ -88,7 +88,7 @@
if(!holds_charge)
empty()
-/obj/item/gun/energy/kinetic_accelerator/shoot_live_shot()
+/obj/item/gun/energy/kinetic_accelerator/shoot_live_shot(mob/living/user, atom/target, pointblank = FALSE, message = TRUE)
. = ..()
attempt_reload()
@@ -173,6 +173,7 @@
//Casing
/obj/item/ammo_casing/energy/kinetic
projectile_type = /obj/item/projectile/kinetic
+ muzzle_flash_color = null
select_name = "kinetic"
e_cost = 500
fire_sound = 'sound/weapons/kenetic_accel.ogg' // fine spelling there chap
diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm
index da72c971130..44e393f9762 100644
--- a/code/modules/projectiles/guns/energy/special.dm
+++ b/code/modules/projectiles/guns/energy/special.dm
@@ -132,7 +132,7 @@
if(!suppressed)
playsound(loc, 'sound/weapons/kenetic_reload.ogg', 60, 1)
user.visible_message("[user] cocks the [name] and pretends to blow [user.p_their()] brains out! It looks like [user.p_theyre()] trying to commit suicide!")
- shoot_live_shot()
+ shoot_live_shot(user, user, FALSE, FALSE)
return OXYLOSS
// Plasma Cutters //
diff --git a/code/modules/projectiles/guns/magic/staff.dm b/code/modules/projectiles/guns/magic/staff.dm
index 72d128178a6..e028d970894 100644
--- a/code/modules/projectiles/guns/magic/staff.dm
+++ b/code/modules/projectiles/guns/magic/staff.dm
@@ -71,7 +71,7 @@
icon = 'icons/obj/wizard.dmi'
icon_state = "focus"
item_state = "focus"
- ammo_type = list(/obj/item/ammo_casing/forcebolt)
+ ammo_type = /obj/item/ammo_casing/magic/forcebolt
/obj/item/gun/magic/staff/spellblade
name = "spellblade"
diff --git a/code/modules/projectiles/guns/projectile/bow.dm b/code/modules/projectiles/guns/projectile/bow.dm
index 70229a7c6b0..d87b9a08d98 100644
--- a/code/modules/projectiles/guns/projectile/bow.dm
+++ b/code/modules/projectiles/guns/projectile/bow.dm
@@ -78,6 +78,7 @@
icon_state = "arrow"
force = 10
projectile_type = /obj/item/projectile/bullet/reusable/arrow
+ muzzle_flash_effect = null
caliber = "arrow"
//quiver
diff --git a/code/modules/projectiles/guns/projectile/saw.dm b/code/modules/projectiles/guns/projectile/saw.dm
index bb800214020..9c55f3b23fd 100644
--- a/code/modules/projectiles/guns/projectile/saw.dm
+++ b/code/modules/projectiles/guns/projectile/saw.dm
@@ -142,6 +142,8 @@
icon_state = "762-casing"
caliber = "mm55645"
projectile_type = /obj/item/projectile/bullet/saw
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_STRONG
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_STRONG
/obj/item/ammo_casing/mm556x45/bleeding
desc = "A 556x45mm bullet casing with specialized inner-casing, that when it makes contact with a target, release tiny shrapnel to induce internal bleeding."
@@ -159,3 +161,4 @@
/obj/item/ammo_casing/mm556x45/incen
desc = "A 556x45mm bullet casing designed with a chemical-filled capsule on the tip that when bursted, reacts with the atmosphere to produce a fireball, engulfing the target in flames. "
projectile_type = /obj/item/projectile/bullet/saw/incen
+ muzzle_flash_color = LIGHT_COLOR_FIRE
diff --git a/code/modules/projectiles/guns/projectile/shotgun.dm b/code/modules/projectiles/guns/projectile/shotgun.dm
index 6c11fda5fd7..c1824b48f7e 100644
--- a/code/modules/projectiles/guns/projectile/shotgun.dm
+++ b/code/modules/projectiles/guns/projectile/shotgun.dm
@@ -260,7 +260,7 @@
..()
guns_left = 0
-/obj/item/gun/projectile/shotgun/boltaction/enchanted/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1)
+/obj/item/gun/projectile/shotgun/boltaction/enchanted/shoot_live_shot(mob/living/user, atom/target, pointblank = FALSE, message = TRUE)
..()
if(guns_left)
var/obj/item/gun/projectile/shotgun/boltaction/enchanted/GUN = new
@@ -278,7 +278,7 @@
/obj/item/gun/projectile/shotgun/automatic
-/obj/item/gun/projectile/shotgun/automatic/shoot_live_shot(mob/living/user as mob|obj)
+/obj/item/gun/projectile/shotgun/automatic/shoot_live_shot(mob/living/user, atom/target, pointblank = FALSE, message = TRUE)
..()
pump(user)
diff --git a/code/modules/projectiles/guns/projectile/sniper.dm b/code/modules/projectiles/guns/projectile/sniper.dm
index 761c15a6141..316a22a4db1 100644
--- a/code/modules/projectiles/guns/projectile/sniper.dm
+++ b/code/modules/projectiles/guns/projectile/sniper.dm
@@ -78,6 +78,8 @@
desc = "A .50 bullet casing."
caliber = ".50"
projectile_type = /obj/item/projectile/bullet/sniper
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_STRONG
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_STRONG
icon_state = ".50"
/obj/item/projectile/bullet/sniper
@@ -192,6 +194,8 @@
desc = "A .50 caliber compact round casing."
caliber = ".50"
projectile_type = /obj/item/projectile/bullet/sniper/compact
+ muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
+ muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL
icon_state = ".50"
/obj/item/projectile/bullet/sniper/compact //Can't dismember, and can't break things; just deals massive damage.
diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm
index 13f959be590..c320296e0bd 100644
--- a/code/modules/projectiles/projectile/beams.dm
+++ b/code/modules/projectiles/projectile/beams.dm
@@ -11,7 +11,7 @@
impact_effect_type = /obj/effect/temp_visual/impact_effect/red_laser
is_reflectable = TRUE
light_range = 2
- light_color = LIGHT_COLOR_RED
+ light_color = LIGHT_COLOR_DARKRED
ricochets_max = 50 //Honk!
ricochet_chance = 80
@@ -109,11 +109,12 @@
icon_state = "laser"
suit_types = list(/obj/item/clothing/suit/bluetag)
impact_effect_type = /obj/effect/temp_visual/impact_effect/red_laser
- light_color = LIGHT_COLOR_RED
+ light_color = LIGHT_COLOR_DARKRED
/obj/item/projectile/beam/lasertag/bluetag
icon_state = "bluelaser"
suit_types = list(/obj/item/clothing/suit/redtag)
+ light_color = LIGHT_COLOR_BLUE
/obj/item/projectile/beam/sniper
name = "sniper beam"
@@ -161,7 +162,7 @@
/obj/item/projectile/beam/instakill/red
icon_state = "red_laser"
impact_effect_type = /obj/effect/temp_visual/impact_effect/red_laser
- light_color = LIGHT_COLOR_RED
+ light_color = LIGHT_COLOR_DARKRED
/obj/item/projectile/beam/instakill/on_hit(atom/target)
. = ..()
diff --git a/icons/effects/projectile.dmi b/icons/effects/projectile.dmi
new file mode 100644
index 00000000000..48e25c6fe8d
Binary files /dev/null and b/icons/effects/projectile.dmi differ
diff --git a/paradise.dme b/paradise.dme
index dc2881574c0..b7e13ffe768 100644
--- a/paradise.dme
+++ b/paradise.dme
@@ -58,6 +58,7 @@
#include "code\__DEFINES\misc.dm"
#include "code\__DEFINES\mobs.dm"
#include "code\__DEFINES\move_force.dm"
+#include "code\__DEFINES\muzzle_flash.dm"
#include "code\__DEFINES\pda.dm"
#include "code\__DEFINES\pipes.dm"
#include "code\__DEFINES\preferences.dm"
@@ -851,6 +852,7 @@
#include "code\game\objects\effects\temporary_visuals\clockcult.dm"
#include "code\game\objects\effects\temporary_visuals\cult.dm"
#include "code\game\objects\effects\temporary_visuals\miscellaneous.dm"
+#include "code\game\objects\effects\temporary_visuals\muzzle_flashes.dm"
#include "code\game\objects\effects\temporary_visuals\temporary_visual.dm"
#include "code\game\objects\items\ashtray.dm"
#include "code\game\objects\items\blueprints.dm"