2022-02-23 21:00:39 -03:00
|
|
|
using Content.Shared.Damage;
|
2021-10-07 13:01:27 +02:00
|
|
|
using Content.Shared.Tools;
|
2024-04-19 19:20:30 -04:00
|
|
|
using Robust.Shared.Prototypes;
|
2021-10-07 13:01:27 +02:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
2021-02-26 22:56:32 -04:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Repairable
|
2021-02-26 22:56:32 -04:00
|
|
|
{
|
|
|
|
|
[RegisterComponent]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class RepairableComponent : Component
|
2021-02-26 22:56:32 -04:00
|
|
|
{
|
2022-02-23 21:00:39 -03:00
|
|
|
/// <summary>
|
|
|
|
|
/// All the damage to change information is stored in this <see cref="DamageSpecifier"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// If this data-field is specified, it will change damage by this amount instead of setting all damage to 0.
|
|
|
|
|
/// in order to heal/repair the damage values have to be negative.
|
|
|
|
|
/// </remarks>
|
2024-04-19 19:20:30 -04:00
|
|
|
[DataField]
|
2022-02-23 21:00:39 -03:00
|
|
|
public DamageSpecifier? Damage;
|
|
|
|
|
|
2024-04-19 19:20:30 -04:00
|
|
|
[DataField]
|
2021-09-15 03:07:37 +10:00
|
|
|
public int FuelCost = 5;
|
2021-02-26 22:56:32 -04:00
|
|
|
|
2024-04-19 19:20:30 -04:00
|
|
|
[DataField]
|
|
|
|
|
public ProtoId<ToolQualityPrototype> QualityNeeded = "Welding";
|
2021-10-07 13:01:27 +02:00
|
|
|
|
2024-04-19 19:20:30 -04:00
|
|
|
[DataField]
|
2021-09-15 03:07:37 +10:00
|
|
|
public int DoAfterDelay = 1;
|
2022-06-19 01:50:43 -04:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// A multiplier that will be applied to the above if an entity is repairing themselves.
|
|
|
|
|
/// </summary>
|
2024-04-19 19:20:30 -04:00
|
|
|
[DataField]
|
2022-06-19 01:50:43 -04:00
|
|
|
public float SelfRepairPenalty = 3f;
|
2023-08-12 17:39:58 -04:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whether or not an entity is allowed to repair itself.
|
|
|
|
|
/// </summary>
|
2024-04-19 19:20:30 -04:00
|
|
|
[DataField]
|
2023-08-12 17:39:58 -04:00
|
|
|
public bool AllowSelfRepair = true;
|
2021-02-26 22:56:32 -04:00
|
|
|
}
|
|
|
|
|
}
|