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,13 +1,17 @@
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Shared.Projectiles
{
[NetworkedComponent()]
[NetworkedComponent, Access(typeof(SharedProjectileSystem))]
public abstract class SharedProjectileComponent : Component
{
[ViewVariables(VVAccess.ReadWrite), DataField("impactEffect", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
public string? ImpactEffect;
private bool _ignoreShooter = true;
public EntityUid Shooter { get; protected set; }
public EntityUid Shooter { get; set; }
public bool IgnoreShooter
{
@@ -20,18 +24,5 @@ namespace Content.Shared.Projectiles
Dirty();
}
}
[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; }
}
}
}