Double bullet speeds (#34971)
* Double bullet speeds The only reason we had it at 20m/s was tunneling reasons. The quick maths is (BodyA size + BodyB size) / frametime. Currently the game is doing substepping AFAIK so we can use 0.016 as the frametime therefore with a 0.40 width body we can get up to 40.625 (assuming the target is no narrower than 0.25 which given my thindows change last year should be a decently safe assumption). * Fix * Fix impact visuals, as they overshoot otherwise * Revert changes --------- Co-authored-by: SlamBamActionman <slambamactionman@gmail.com>
This commit is contained in:
parent
4530e78e86
commit
6a8e307679
|
|
@ -220,7 +220,7 @@ public sealed partial class GunComponent : Component
|
|||
/// The base value for how fast the projectile moves.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public float ProjectileSpeed = 25f;
|
||||
public float ProjectileSpeed = SharedGunSystem.ProjectileSpeed;
|
||||
|
||||
/// <summary>
|
||||
/// How fast the projectile moves.
|
||||
|
|
|
|||
|
|
@ -67,6 +67,11 @@ public abstract partial class SharedGunSystem : EntitySystem
|
|||
[Dependency] private readonly UseDelaySystem _useDelay = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Default projectile speed
|
||||
/// </summary>
|
||||
public const float ProjectileSpeed = 40f;
|
||||
|
||||
private static readonly ProtoId<TagPrototype> TrashTag = "Trash";
|
||||
|
||||
private const float InteractNextFire = 0.3f;
|
||||
|
|
@ -438,7 +443,7 @@ public abstract partial class SharedGunSystem : EntitySystem
|
|||
EntityUid? user = null,
|
||||
bool throwItems = false);
|
||||
|
||||
public void ShootProjectile(EntityUid uid, Vector2 direction, Vector2 gunVelocity, EntityUid? gunUid, EntityUid? user = null, float speed = 20f)
|
||||
public void ShootProjectile(EntityUid uid, Vector2 direction, Vector2 gunVelocity, EntityUid? gunUid, EntityUid? user = null, float speed = ProjectileSpeed)
|
||||
{
|
||||
var physics = EnsureComp<PhysicsComponent>(uid);
|
||||
Physics.SetBodyStatus(uid, physics, BodyStatus.InAir);
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@
|
|||
projectile:
|
||||
shape:
|
||||
!type:PhysShapeAabb
|
||||
bounds: "-0.1,-0.1,0.1,0.1"
|
||||
bounds: "-0.1,-0.10,0.1,0.30"
|
||||
hard: false
|
||||
mask:
|
||||
- Impassable
|
||||
|
|
|
|||
Loading…
Reference in New Issue