DamageNearbyArtifactComponent.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using Content.Shared.Damage;
  2. using Content.Shared.Whitelist;
  3. namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
  4. /// <summary>
  5. /// When activated, damages nearby entities.
  6. /// </summary>
  7. [RegisterComponent]
  8. public sealed partial class DamageNearbyArtifactComponent : Component
  9. {
  10. /// <summary>
  11. /// The radius of entities that will be affected
  12. /// </summary>
  13. [DataField("radius")]
  14. public float Radius = 3f;
  15. /// <summary>
  16. /// A whitelist for filtering certain damage.
  17. /// </summary>
  18. /// <remarks>
  19. /// TODO: The component portion, since it uses an array, does not work currently.
  20. /// </remarks>
  21. [DataField("whitelist")]
  22. public EntityWhitelist? Whitelist;
  23. /// <summary>
  24. /// The damage that is applied
  25. /// </summary>
  26. [DataField("damage", required: true)]
  27. public DamageSpecifier Damage = default!;
  28. /// <summary>
  29. /// The chance that damage is applied to each individual entity
  30. /// </summary>
  31. [DataField("damageChance")]
  32. public float DamageChance = 1f;
  33. /// <summary>
  34. /// Whether or not this should ignore resistances for the damage
  35. /// </summary>
  36. [DataField("ignoreResistances")]
  37. public bool IgnoreResistances;
  38. }