2022-11-06 18:05:44 -05:00
|
|
|
|
using Content.Shared.Damage.Prototypes;
|
|
|
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Triggers when a certain threshold of damage of certain types is reached
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[RegisterComponent]
|
2023-08-22 18:14:33 -07:00
|
|
|
|
public sealed partial class ArtifactDamageTriggerComponent : Component
|
2022-11-06 18:05:44 -05:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// What damage types are accumulated for the trigger?
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataField("damageTypes", customTypeSerializer: typeof(PrototypeIdListSerializer<DamageTypePrototype>))]
|
|
|
|
|
|
public List<string>? DamageTypes;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// What threshold has to be reached before it is activated?
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataField("damageThreshold", required: true)]
|
|
|
|
|
|
public float DamageThreshold;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// How much damage has been accumulated on the artifact so far
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
|
public float AccumulatedDamage = 0;
|
|
|
|
|
|
}
|