HealingComponent.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using Content.Shared.Damage;
  2. using Content.Shared.Damage.Prototypes;
  3. using Robust.Shared.Audio;
  4. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
  5. namespace Content.Server.Medical.Components
  6. {
  7. /// <summary>
  8. /// Applies a damage change to the target when used in an interaction.
  9. /// </summary>
  10. [RegisterComponent]
  11. public sealed partial class HealingComponent : Component
  12. {
  13. [DataField("damage", required: true)]
  14. [ViewVariables(VVAccess.ReadWrite)]
  15. public DamageSpecifier Damage = default!;
  16. /// <remarks>
  17. /// This should generally be negative,
  18. /// since you're, like, trying to heal damage.
  19. /// </remarks>
  20. [DataField("bloodlossModifier")]
  21. [ViewVariables(VVAccess.ReadWrite)]
  22. public float BloodlossModifier = 0.0f;
  23. /// <summary>
  24. /// Restore missing blood.
  25. /// </summary>
  26. [DataField("ModifyBloodLevel")]
  27. [ViewVariables(VVAccess.ReadWrite)]
  28. public float ModifyBloodLevel = 0.0f;
  29. /// <remarks>
  30. /// The supported damage types are specified using a <see cref="DamageContainerPrototype"/>s. For a
  31. /// HealingComponent this filters what damage container type this component should work on. If null,
  32. /// all damage container types are supported.
  33. /// </remarks>
  34. [DataField("damageContainers", customTypeSerializer: typeof(PrototypeIdListSerializer<DamageContainerPrototype>))]
  35. public List<string>? DamageContainers;
  36. /// <summary>
  37. /// How long it takes to apply the damage.
  38. /// </summary>
  39. [ViewVariables(VVAccess.ReadWrite)]
  40. [DataField("delay")]
  41. public float Delay = 3f;
  42. /// <summary>
  43. /// Delay multiplier when healing yourself.
  44. /// </summary>
  45. [DataField("selfHealPenaltyMultiplier")]
  46. public float SelfHealPenaltyMultiplier = 3f;
  47. /// <summary>
  48. /// Sound played on healing begin
  49. /// </summary>
  50. [DataField("healingBeginSound")]
  51. public SoundSpecifier? HealingBeginSound = null;
  52. /// <summary>
  53. /// Sound played on healing end
  54. /// </summary>
  55. [DataField("healingEndSound")]
  56. public SoundSpecifier? HealingEndSound = null;
  57. }
  58. }