2022-02-23 21:00:39 -03:00
|
|
|
using Content.Shared.Damage;
|
2021-10-07 13:01:27 +02:00
|
|
|
using Content.Shared.Tools;
|
|
|
|
|
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]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed 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>
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)] [DataField("damage")]
|
|
|
|
|
public DamageSpecifier? Damage;
|
|
|
|
|
|
2021-03-05 01:08:38 +01:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)] [DataField("fuelCost")]
|
2021-09-15 03:07:37 +10:00
|
|
|
public int FuelCost = 5;
|
2021-02-26 22:56:32 -04:00
|
|
|
|
2021-10-07 13:01:27 +02:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)] [DataField("qualityNeeded", customTypeSerializer:typeof(PrototypeIdSerializer<ToolQualityPrototype>))]
|
|
|
|
|
public string QualityNeeded = "Welding";
|
|
|
|
|
|
2021-03-05 01:08:38 +01:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)] [DataField("doAfterDelay")]
|
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>
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)] [DataField("selfRepairPenalty")]
|
|
|
|
|
public float SelfRepairPenalty = 3f;
|
2021-02-26 22:56:32 -04:00
|
|
|
}
|
|
|
|
|
}
|