Bullet impact effects (#9530)

This commit is contained in:
metalgearsloth
2022-07-09 13:46:11 +10:00
committed by GitHub
parent 1b5f88e4d0
commit 5107bc3be7
14 changed files with 175 additions and 85 deletions

View File

@@ -1,4 +1,6 @@
using Robust.Shared.Map;
using Robust.Shared.Physics.Dynamics;
using Robust.Shared.Serialization;
namespace Content.Shared.Projectiles
{
@@ -20,5 +22,39 @@ namespace Content.Shared.Projectiles
return;
}
}
public void SetShooter(SharedProjectileComponent component, EntityUid uid)
{
if (component.Shooter == uid) return;
component.Shooter = uid;
Dirty(component);
}
[NetSerializable, Serializable]
protected sealed class ProjectileComponentState : ComponentState
{
public ProjectileComponentState(EntityUid shooter, bool ignoreShooter)
{
Shooter = shooter;
IgnoreShooter = ignoreShooter;
}
public EntityUid Shooter { get; }
public bool IgnoreShooter { get; }
}
[Serializable, NetSerializable]
protected sealed class ImpactEffectEvent : EntityEventArgs
{
public string Prototype;
public EntityCoordinates Coordinates;
public ImpactEffectEvent(string prototype, EntityCoordinates coordinates)
{
Prototype = prototype;
Coordinates = coordinates;
}
}
}
}