ArtifactDamageTriggerComponent.cs 1.0 KB

1234567891011121314151617181920212223242526272829
  1. using Content.Shared.Damage.Prototypes;
  2. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
  3. namespace Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;
  4. /// <summary>
  5. /// Triggers when a certain threshold of damage of certain types is reached
  6. /// </summary>
  7. [RegisterComponent]
  8. public sealed partial class ArtifactDamageTriggerComponent : Component
  9. {
  10. /// <summary>
  11. /// What damage types are accumulated for the trigger?
  12. /// </summary>
  13. [DataField("damageTypes", customTypeSerializer: typeof(PrototypeIdListSerializer<DamageTypePrototype>))]
  14. public List<string>? DamageTypes;
  15. /// <summary>
  16. /// What threshold has to be reached before it is activated?
  17. /// </summary>
  18. [DataField("damageThreshold", required: true)]
  19. public float DamageThreshold;
  20. /// <summary>
  21. /// How much damage has been accumulated on the artifact so far
  22. /// </summary>
  23. [ViewVariables(VVAccess.ReadWrite)]
  24. public float AccumulatedDamage = 0;
  25. }