Skip to content

Commit

Permalink
fixes shotgun casing bounce sounds (#3057)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
I

![image](https://github.com/shiptest-ss13/Shiptest/assets/45698967/5ec6ffa1-219a-4ada-b83c-fbdecab5231f)
may have accidentally pr'd this to retlaw's branch before here
<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
shotgun
<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## Changelog

:cl:
fix: shoutgun casing bounce sfx now plays as intended. oopsies.
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
  • Loading branch information
Sun-Soaked authored Jun 2, 2024
1 parent f4b6f59 commit b54f609
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion code/datums/components/movable_physics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/ammunition/_ammunition.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/guns/ballistic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/projectiles/guns/ballistic/revolver.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/guns/ballistic/shotgun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,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)
Expand Down

0 comments on commit b54f609

Please sign in to comment.