RepairableComponent.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using Content.Shared.Damage;
  2. using Content.Shared.Tools;
  3. using Robust.Shared.Prototypes;
  4. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  5. namespace Content.Server.Repairable
  6. {
  7. [RegisterComponent]
  8. public sealed partial class RepairableComponent : Component
  9. {
  10. /// <summary>
  11. /// All the damage to change information is stored in this <see cref="DamageSpecifier"/>.
  12. /// </summary>
  13. /// <remarks>
  14. /// If this data-field is specified, it will change damage by this amount instead of setting all damage to 0.
  15. /// in order to heal/repair the damage values have to be negative.
  16. /// </remarks>
  17. [DataField]
  18. public DamageSpecifier? Damage;
  19. [DataField]
  20. public int FuelCost = 5;
  21. [DataField]
  22. public ProtoId<ToolQualityPrototype> QualityNeeded = "Welding";
  23. [DataField]
  24. public int DoAfterDelay = 1;
  25. /// <summary>
  26. /// A multiplier that will be applied to the above if an entity is repairing themselves.
  27. /// </summary>
  28. [DataField]
  29. public float SelfRepairPenalty = 3f;
  30. /// <summary>
  31. /// Whether or not an entity is allowed to repair itself.
  32. /// </summary>
  33. [DataField]
  34. public bool AllowSelfRepair = true;
  35. }
  36. }