diff --git a/Content.Server/Chemistry/EntitySystems/VaporSystem.cs b/Content.Server/Chemistry/EntitySystems/VaporSystem.cs index 8fd6d31572..edbaffb5a5 100644 --- a/Content.Server/Chemistry/EntitySystems/VaporSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/VaporSystem.cs @@ -63,7 +63,7 @@ namespace Content.Server.Chemistry.EntitySystems _physics.SetLinearDamping(physics, 0f); _physics.SetAngularDamping(physics, 0f); - _throwing.TryThrow(vapor.Owner, dir, speed, user: user, pushbackRatio: 50f); + _throwing.TryThrow(vapor.Owner, dir, speed, user: user, pushbackRatio: ThrowingSystem.PushbackDefault * 10f); var distance = (target.Position - vaporXform.WorldPosition).Length; var time = (distance / physics.LinearVelocity.Length); diff --git a/Content.Shared/Throwing/ThrowingSystem.cs b/Content.Shared/Throwing/ThrowingSystem.cs index 5b8f6b335a..3035411148 100644 --- a/Content.Shared/Throwing/ThrowingSystem.cs +++ b/Content.Shared/Throwing/ThrowingSystem.cs @@ -12,7 +12,9 @@ namespace Content.Shared.Throwing; public sealed class ThrowingSystem : EntitySystem { - public const float ThrowAngularImpulse = 1.5f; + public const float ThrowAngularImpulse = 5f; + + public const float PushbackDefault = 1f; /// /// The minimum amount of time an entity needs to be thrown before the timer can be run. @@ -37,7 +39,7 @@ public sealed class ThrowingSystem : EntitySystem Vector2 direction, float strength = 1.0f, EntityUid? user = null, - float pushbackRatio = 5.0f) + float pushbackRatio = PushbackDefault) { var physicsQuery = GetEntityQuery(); if (!physicsQuery.TryGetComponent(uid, out var physics)) @@ -73,7 +75,7 @@ public sealed class ThrowingSystem : EntitySystem EntityQuery tagQuery, float strength = 1.0f, EntityUid? user = null, - float pushbackRatio = 5.0f) + float pushbackRatio = PushbackDefault) { if (strength <= 0 || direction == Vector2.Infinity || direction == Vector2.NaN || direction == Vector2.Zero) return; @@ -92,7 +94,7 @@ public sealed class ThrowingSystem : EntitySystem // Give it a l'il spin. if (!tagQuery.TryGetComponent(uid, out var tag) || !_tagSystem.HasTag(tag, "NoSpinOnThrow")) - _physics.ApplyAngularImpulse(uid, ThrowAngularImpulse, body: physics); + _physics.ApplyAngularImpulse(uid, ThrowAngularImpulse / physics.InvI, body: physics); else transform.LocalRotation = direction.ToWorldAngle() - Math.PI; @@ -124,7 +126,8 @@ public sealed class ThrowingSystem : EntitySystem // Give thrower an impulse in the other direction if (user != null && - pushbackRatio > 0.0f && + pushbackRatio != 0.0f && + physics.Mass > 0f && TryComp(user.Value, out PhysicsComponent? userPhysics) && _gravity.IsWeightless(user.Value, userPhysics)) { @@ -132,7 +135,7 @@ public sealed class ThrowingSystem : EntitySystem RaiseLocalEvent(uid, msg); if (!msg.Cancelled) - _physics.ApplyLinearImpulse(user.Value, -impulseVector * pushbackRatio, body: userPhysics); + _physics.ApplyLinearImpulse(user.Value, -impulseVector * pushbackRatio * physics.Mass, body: userPhysics); } } } diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/base_cartridge.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/base_cartridge.yml index 230be6a76b..504633fb84 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/base_cartridge.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/base_cartridge.yml @@ -6,6 +6,17 @@ - type: Sprite drawdepth: Items netsync: false + - type: Fixtures + fixtures: + fix1: + shape: + !type:PhysShapeAabb + bounds: "-0.10,-0.05,0.10,0.05" + density: 20 + mask: + - ItemMask + restitution: 0.3 # fite me + friction: 0.2 - type: Tag tags: - Cartridge