Nerf bullet impulses (#14145)

This commit is contained in:
metalgearsloth
2023-02-23 12:37:57 +11:00
committed by GitHub
parent 893081d784
commit c90f48a220
2 changed files with 5 additions and 5 deletions

View File

@@ -40,18 +40,18 @@ public abstract partial class SharedGunSystem : EntitySystem
[Dependency] protected readonly IRobustRandom Random = default!;
[Dependency] protected readonly ISharedAdminLogManager Logs = default!;
[Dependency] protected readonly DamageableSystem Damageable = default!;
[Dependency] private readonly SharedGravitySystem Gravity = default!;
[Dependency] protected readonly ExamineSystemShared Examine = default!;
[Dependency] private readonly ItemSlotsSystem _slots = default!;
[Dependency] protected readonly SharedActionsSystem Actions = default!;
[Dependency] protected readonly SharedAppearanceSystem Appearance = default!;
[Dependency] private readonly SharedCombatModeSystem _combatMode = default!;
[Dependency] protected readonly SharedContainerSystem Containers = default!;
[Dependency] protected readonly ExamineSystemShared Examine = default!;
[Dependency] protected readonly SharedPhysicsSystem Physics = default!;
[Dependency] protected readonly SharedPopupSystem PopupSystem = default!;
[Dependency] protected readonly ThrowingSystem ThrowingSystem = default!;
[Dependency] protected readonly TagSystem TagSystem = default!;
[Dependency] protected readonly SharedAudioSystem Audio = default!;
[Dependency] private readonly SharedGravitySystem _gravity = default!;
[Dependency] protected readonly SharedProjectileSystem Projectiles = default!;
protected ISawmill Sawmill = default!;
@@ -301,7 +301,7 @@ public abstract partial class SharedGunSystem : EntitySystem
// Projectiles cause impulses especially important in non gravity environments
if (TryComp<PhysicsComponent>(user, out var userPhysics))
{
if (Gravity.IsWeightless(user, userPhysics))
if (_gravity.IsWeightless(user, userPhysics))
CauseImpulse(fromCoordinates, toCoordinates.Value, userPhysics);
}
Dirty(gun);
@@ -391,7 +391,7 @@ public abstract partial class SharedGunSystem : EntitySystem
var toMap = toCoordinates.ToMapPos(EntityManager);
var shotDirection = (toMap - fromMap).Normalized;
const float impulseStrength = 85.0f; //The bullet impulse strength, TODO: In the future we might want to make it more projectile dependent
const float impulseStrength = 5.0f;
var impulseVector = shotDirection * impulseStrength;
Physics.ApplyLinearImpulse(userPhysics.Owner, -impulseVector, body: userPhysics);
}