forked from space-syndicate/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathProjectileComponent.cs
80 lines (67 loc) · 2.27 KB
/
ProjectileComponent.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
using Content.Shared.Damage;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared.Projectiles;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class ProjectileComponent : Component
{
/// <summary>
/// The effect that appears when a projectile collides with an entity.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public EntProtoId? ImpactEffect;
/// <summary>
/// User that shot this projectile.
/// </summary>
[DataField, AutoNetworkedField]
public EntityUid? Shooter;
/// <summary>
/// Weapon used to shoot.
/// </summary>
[DataField, AutoNetworkedField]
public EntityUid? Weapon;
/// <summary>
/// The projectile spawns inside the shooter most of the time, this prevents entities from shooting themselves.
/// </summary>
[DataField, AutoNetworkedField]
public bool IgnoreShooter = true;
/// <summary>
/// The amount of damage the projectile will do.
/// </summary>
[DataField(required: true)] [ViewVariables(VVAccess.ReadWrite)]
public DamageSpecifier Damage = new();
/// <summary>
/// If the projectile should be deleted on collision.
/// </summary>
[DataField]
public bool DeleteOnCollide = true;
/// <summary>
/// Ignore all damage resistances the target has.
/// </summary>
[DataField]
public bool IgnoreResistances = false;
/// <summary>
/// Get that juicy FPS hit sound.
/// </summary>
[DataField]
public SoundSpecifier? SoundHit;
/// <summary>
/// Force the projectiles sound to play rather than potentially playing the entity's sound.
/// </summary>
[DataField]
public bool ForceSound = false;
/// <summary>
/// Whether this projectile will only collide with entities if it was shot from a gun (if <see cref="Weapon"/> is not null).
/// </summary>
[DataField]
public bool OnlyCollideWhenShot = false;
/// <summary>
/// Whether this projectile has already damaged an entity.
/// </summary>
[DataField]
public bool DamagedEntity;
// Corvax-Next-Penetration
[DataField]
public int PenetrationScore;
}