Re-implement recoil (#9406)

* Re-implement recoil

Playing around with the values atm

* Update constants

* final tweaks
This commit is contained in:
metalgearsloth
2022-07-14 22:01:25 +10:00
committed by GitHub
parent d9e423cebb
commit 38fc066fb9
8 changed files with 76 additions and 52 deletions

View File

@@ -29,7 +29,7 @@ namespace Content.Server.PneumaticCannon
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly StunSystem _stun = default!;
[Dependency] private readonly AtmosphereSystem _atmos = default!;
[Dependency] private readonly CameraRecoilSystem _cameraRecoil = default!;
[Dependency] private readonly SharedCameraRecoilSystem _sharedCameraRecoil = default!;
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly ThrowingSystem _throwingSystem = default!;
[Dependency] private readonly StorageSystem _storageSystem = default!;
@@ -231,7 +231,7 @@ namespace Content.Server.PneumaticCannon
if (EntityManager.HasComponent<CameraRecoilComponent>(data.User))
{
var kick = Vector2.One * data.Strength;
_cameraRecoil.KickCamera(data.User, kick);
_sharedCameraRecoil.KickCamera(data.User, kick);
}
_throwingSystem.TryThrow(ent, data.Direction, data.Strength, data.User, GetPushbackRatioFromPower(comp.Power));