Skip to content

Commit

Permalink
yuh
Browse files Browse the repository at this point in the history
req changes
  • Loading branch information
Sun-Soaked committed Apr 11, 2024
1 parent 3d5d971 commit a553467
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions code/datums/components/movable_physics.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define PHYSICS_GRAV_STANDARD 9.80665

///Remove the component as soon as there's zero velocity, useful for movables that will no longer move after being initially moved (blood splatters)
#define QDEL_WHEN_NO_MOVEMENT (1<<0)

Expand All @@ -22,8 +24,7 @@
///The sound effect to play when bouncing off of something
var/bounce_sound

///set when the spin animation starts, unset when it ends. prevents jittery spinanim spam on bounces
var/spun = FALSE
var/numbounce = 1

/datum/component/movable_physics/Initialize(_horizontal_velocity = 0, _vertical_velocity = 0, _horizontal_friction = 0, _z_gravity = 0, _z_floor = 0, _angle_of_movement = 0, _physic_flags = 0, _bounce_sound)
. = ..()
Expand Down Expand Up @@ -66,7 +67,6 @@
ricochet(atom_source, Get_Angle(atom_source, throwingdatum.target_turf))

/datum/component/movable_physics/proc/z_floor_bounce(atom/movable/moving_atom)
var/numbounce = 1
angle_of_movement += rand(-3000, 3000) / 100
var/turf/a_turf = get_turf(moving_atom)
if(istype(moving_atom, /obj/item/ammo_casing))
Expand All @@ -77,7 +77,7 @@
moving_atom.pixel_z = z_floor
horizontal_velocity = max(0, horizontal_velocity + (vertical_velocity * -0.8))
vertical_velocity = max(0, ((vertical_velocity * -0.8) - 0.2))
numbounce += 1
numbounce += 0.5

/datum/component/movable_physics/proc/ricochet(atom/movable/moving_atom, bounce_angle)
angle_of_movement = ((180 - bounce_angle) - angle_of_movement)
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 @@ -107,7 +107,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 = 9.80665, _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)


/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 = 9.80665, _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)

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 = 9.80665, _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)

num_unloaded++
SSblackbox.record_feedback("tally", "station_mess_created", 1, casing_to_eject.name)
Expand Down Expand Up @@ -123,7 +123,7 @@
return FALSE
playsound(src, eject_sound, eject_sound_volume, eject_sound_vary)
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 = 9.80665, _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)

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 @@ -312,7 +312,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 = 9.80665, _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)

num_unloaded++
SSblackbox.record_feedback("tally", "station_mess_created", 1, casing_bullet.name)
Expand Down

0 comments on commit a553467

Please sign in to comment.