2020-07-02 23:24:27 +02:00
|
|
|
using System;
|
|
|
|
|
using Robust.Shared.GameObjects;
|
2021-07-12 01:32:10 -07:00
|
|
|
using Robust.Shared.GameStates;
|
2020-07-02 23:24:27 +02:00
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Shared.Projectiles
|
2020-07-02 23:24:27 +02:00
|
|
|
{
|
2021-07-12 01:32:10 -07:00
|
|
|
[NetworkedComponent()]
|
2021-05-30 23:30:44 +10:00
|
|
|
public abstract class SharedProjectileComponent : Component
|
2020-07-02 23:24:27 +02:00
|
|
|
{
|
|
|
|
|
private bool _ignoreShooter = true;
|
2021-05-30 23:30:44 +10:00
|
|
|
public EntityUid Shooter { get; protected set; }
|
2020-07-02 23:24:27 +02:00
|
|
|
|
|
|
|
|
public bool IgnoreShooter
|
|
|
|
|
{
|
|
|
|
|
get => _ignoreShooter;
|
|
|
|
|
set
|
|
|
|
|
{
|
2021-03-08 04:09:59 +11:00
|
|
|
if (_ignoreShooter == value) return;
|
|
|
|
|
|
2020-07-02 23:24:27 +02:00
|
|
|
_ignoreShooter = value;
|
|
|
|
|
Dirty();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NetSerializable, Serializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
protected sealed class ProjectileComponentState : ComponentState
|
2020-07-02 23:24:27 +02:00
|
|
|
{
|
2021-07-12 01:32:10 -07:00
|
|
|
public ProjectileComponentState(EntityUid shooter, bool ignoreShooter)
|
2020-07-02 23:24:27 +02:00
|
|
|
{
|
|
|
|
|
Shooter = shooter;
|
|
|
|
|
IgnoreShooter = ignoreShooter;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public EntityUid Shooter { get; }
|
|
|
|
|
public bool IgnoreShooter { get; }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|