From 6c546ef1a91bcaa95d792414afb68e3f469aa4e6 Mon Sep 17 00:00:00 2001 From: Sun-Soaked <45698967+Sun-Soaked@users.noreply.github.com> Date: Sat, 1 Jun 2024 07:29:41 -0400 Subject: [PATCH] fixes bounce sounds e --- code/datums/components/movable_physics.dm | 2 +- code/modules/projectiles/ammunition/_ammunition.dm | 2 +- code/modules/projectiles/guns/ballistic.dm | 2 +- code/modules/projectiles/guns/ballistic/revolver.dm | 4 ++-- code/modules/projectiles/guns/ballistic/shotgun.dm | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/datums/components/movable_physics.dm b/code/datums/components/movable_physics.dm index 55686bb1e259..114cac29f24b 100644 --- a/code/datums/components/movable_physics.dm +++ b/code/datums/components/movable_physics.dm @@ -69,7 +69,7 @@ /datum/component/movable_physics/proc/z_floor_bounce(atom/movable/moving_atom) angle_of_movement += rand(-3000, 3000) / 100 var/turf/a_turf = get_turf(moving_atom) - if(istype(moving_atom, /obj/item/ammo_casing)) + if(istype(moving_atom, /obj/item/ammo_casing) && !bounce_sound) playsound(moving_atom, a_turf.bullet_bounce_sound, 50, TRUE) else playsound(moving_atom, bounce_sound, 50, TRUE) diff --git a/code/modules/projectiles/ammunition/_ammunition.dm b/code/modules/projectiles/ammunition/_ammunition.dm index 2bcd961427db..26597a64f33b 100644 --- a/code/modules/projectiles/ammunition/_ammunition.dm +++ b/code/modules/projectiles/ammunition/_ammunition.dm @@ -109,7 +109,7 @@ pixel_y = rand(-4, 4) pixel_z = 8 //bounce time var/angle_of_movement = !isnull(shooter) ? (rand(-3000, 3000) / 100) + dir2angle(turn(shooter.dir, 180)) : rand(-3000, 3000) / 100 - AddComponent(/datum/component/movable_physics, _horizontal_velocity = rand(400, 450) / 100, _vertical_velocity = rand(400, 450) / 100, _horizontal_friction = rand(20, 24) / 100, _z_gravity = PHYSICS_GRAV_STANDARD, _z_floor = 0, _angle_of_movement = angle_of_movement) + AddComponent(/datum/component/movable_physics, _horizontal_velocity = rand(400, 450) / 100, _vertical_velocity = rand(400, 450) / 100, _horizontal_friction = rand(20, 24) / 100, _z_gravity = PHYSICS_GRAV_STANDARD, _z_floor = 0, _angle_of_movement = angle_of_movement, _bounce_sound = bounce_sfx_override) /obj/item/ammo_casing/proc/bounce_away(still_warm = FALSE, bounce_delay = 3) diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index 4f3b80bf478a..f363a66ed551 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -366,7 +366,7 @@ CB.forceMove(drop_location()) var/angle_of_movement =(rand(-3000, 3000) / 100) + dir2angle(turn(user.dir, 180)) - CB.AddComponent(/datum/component/movable_physics, _horizontal_velocity = rand(350, 450) / 100, _vertical_velocity = rand(400, 450) / 100, _horizontal_friction = rand(20, 24) / 100, _z_gravity = PHYSICS_GRAV_STANDARD, _z_floor = 0, _angle_of_movement = angle_of_movement) + CB.AddComponent(/datum/component/movable_physics, _horizontal_velocity = rand(350, 450) / 100, _vertical_velocity = rand(400, 450) / 100, _horizontal_friction = rand(20, 24) / 100, _z_gravity = PHYSICS_GRAV_STANDARD, _z_floor = 0, _angle_of_movement = angle_of_movement, _bounce_sound = CB.bounce_sfx_override) num_unloaded++ SSblackbox.record_feedback("tally", "station_mess_created", 1, CB.name) diff --git a/code/modules/projectiles/guns/ballistic/revolver.dm b/code/modules/projectiles/guns/ballistic/revolver.dm index dc6f184e4a0b..7fcc3c4b500c 100644 --- a/code/modules/projectiles/guns/ballistic/revolver.dm +++ b/code/modules/projectiles/guns/ballistic/revolver.dm @@ -85,7 +85,7 @@ continue casing_to_eject.forceMove(drop_location()) var/angle_of_movement =(rand(-3000, 3000) / 100) + dir2angle(turn(user.dir, 180)) - casing_to_eject.AddComponent(/datum/component/movable_physics, _horizontal_velocity = rand(450, 550) / 100, _vertical_velocity = rand(400, 450) / 100, _horizontal_friction = rand(20, 24) / 100, _z_gravity = PHYSICS_GRAV_STANDARD, _z_floor = 0, _angle_of_movement = angle_of_movement) + casing_to_eject.AddComponent(/datum/component/movable_physics, _horizontal_velocity = rand(450, 550) / 100, _vertical_velocity = rand(400, 450) / 100, _horizontal_friction = rand(20, 24) / 100, _z_gravity = PHYSICS_GRAV_STANDARD, _z_floor = 0, _angle_of_movement = angle_of_movement, _bounce_sound = casing_to_eject.bounce_sfx_override) num_unloaded++ SSblackbox.record_feedback("tally", "station_mess_created", 1, casing_to_eject.name) @@ -124,7 +124,7 @@ playsound(src, eject_sound, eject_sound_volume, eject_sound_vary) casing_to_eject.forceMove(drop_location()) var/angle_of_movement =(rand(-3000, 3000) / 100) + dir2angle(turn(user.dir, 180)) - casing_to_eject.AddComponent(/datum/component/movable_physics, _horizontal_velocity = rand(350, 450) / 100, _vertical_velocity = rand(400, 450) / 100, _horizontal_friction = rand(20, 24) / 100, _z_gravity = PHYSICS_GRAV_STANDARD, _z_floor = 0, _angle_of_movement = angle_of_movement) + casing_to_eject.AddComponent(/datum/component/movable_physics, _horizontal_velocity = rand(350, 450) / 100, _vertical_velocity = rand(400, 450) / 100, _horizontal_friction = rand(20, 24) / 100, _z_gravity = PHYSICS_GRAV_STANDARD, _z_floor = 0, _angle_of_movement = angle_of_movement, _bounce_sound = casing_to_eject.bounce_sfx_override) SSblackbox.record_feedback("tally", "station_mess_created", 1, casing_to_eject.name) if(!gate_loaded) diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm index 4502f7fe9b2c..8c13f8843bcc 100644 --- a/code/modules/projectiles/guns/ballistic/shotgun.dm +++ b/code/modules/projectiles/guns/ballistic/shotgun.dm @@ -304,7 +304,7 @@ for(var/obj/item/ammo_casing/casing_bullet in get_ammo_list(FALSE, TRUE)) casing_bullet.forceMove(drop_location()) var/angle_of_movement =(rand(-3000, 3000) / 100) + dir2angle(turn(user.dir, 180)) - casing_bullet.AddComponent(/datum/component/movable_physics, _horizontal_velocity = rand(450, 550) / 100, _vertical_velocity = rand(400, 450) / 100, _horizontal_friction = rand(20, 24) / 100, _z_gravity = PHYSICS_GRAV_STANDARD, _z_floor = 0, _angle_of_movement = angle_of_movement) + casing_bullet.AddComponent(/datum/component/movable_physics, _horizontal_velocity = rand(450, 550) / 100, _vertical_velocity = rand(400, 450) / 100, _horizontal_friction = rand(20, 24) / 100, _z_gravity = PHYSICS_GRAV_STANDARD, _z_floor = 0, _angle_of_movement = angle_of_movement, _bounce_sound = casing_bullet.bounce_sfx_override) num_unloaded++ SSblackbox.record_feedback("tally", "station_mess_created", 1, casing_bullet.name)