Skip to content

Commit

Permalink
Make Spent Casing Ejection Not Suck (#478)
Browse files Browse the repository at this point in the history
# Description

Part of #467, #460, and #474

This is a small PR that corrects a math error in SharedGunSystem,
causing shell casings to be "Thrown" directly downwards instead of in an
actually cinematic and exciting arc. While I'm at it, I also corrected
the fixture of base shell casings to favor "Bounciness", and decreased
its mass to approximately 100 grams. Finally, I added a sound for when
casings bounce off of walls, which wasn't present before.


https://github.com/Simple-Station/Einstein-Engines/assets/16548818/56bb4ecc-d5eb-4b36-853b-42f05374150d

🆑
- fix: Spent bullet casings now fly away from a shooter in a cinematic
manner, rather than fall at their feet.

Co-authored-by: Danger Revolution! <[email protected]>
  • Loading branch information
VMSolidus and DangerRevolution authored Jul 1, 2024
1 parent 89a6bb3 commit ba2d538
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ protected void EjectCartridge(
{
Angle ejectAngle = angle.Value;
ejectAngle += 3.7f; // 212 degrees; casings should eject slightly to the right and behind of a gun
ThrowingSystem.TryThrow(entity, ejectAngle.ToVec().Normalized() / 100, 5f);
ThrowingSystem.TryThrow(entity, ejectAngle.ToVec(), 625f);
}
if (playSound && TryComp<CartridgeAmmoComponent>(entity, out var cartridge))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
shape:
!type:PhysShapeAabb
bounds: "-0.10,-0.05,0.10,0.05"
density: 20
density: 0.5
mask:
- ItemMask
restitution: 0.3 # fite me
restitution: 0.7 # Small and bouncy
friction: 0.2
- type: Tag
tags:
Expand All @@ -23,6 +23,11 @@
size: Tiny
- type: SpaceGarbage
- type: EmitSoundOnLand
sound:
path: /Audio/Weapons/Guns/Casings/casing_fall_1.ogg
params:
volume: -1
- type: EmitSoundOnCollide
sound:
path: /Audio/Weapons/Guns/Casings/casing_fall_2.ogg
params:
Expand Down

0 comments on commit ba2d538

Please sign in to comment.