diff --git a/Content.Server/Repairable/RepairableComponent.cs b/Content.Server/Repairable/RepairableComponent.cs index b6c0209fdf..e122c492cb 100644 --- a/Content.Server/Repairable/RepairableComponent.cs +++ b/Content.Server/Repairable/RepairableComponent.cs @@ -25,5 +25,11 @@ namespace Content.Server.Repairable [ViewVariables(VVAccess.ReadWrite)] [DataField("doAfterDelay")] public int DoAfterDelay = 1; + + /// + /// A multiplier that will be applied to the above if an entity is repairing themselves. + /// + [ViewVariables(VVAccess.ReadWrite)] [DataField("selfRepairPenalty")] + public float SelfRepairPenalty = 3f; } } diff --git a/Content.Server/Repairable/RepairableSystem.cs b/Content.Server/Repairable/RepairableSystem.cs index 76f9e6280c..0c3fdf019f 100644 --- a/Content.Server/Repairable/RepairableSystem.cs +++ b/Content.Server/Repairable/RepairableSystem.cs @@ -24,8 +24,14 @@ namespace Content.Server.Repairable if (!EntityManager.TryGetComponent(component.Owner, out DamageableComponent? damageable) || damageable.TotalDamage == 0) return; + float delay = component.DoAfterDelay; + + // Add a penalty to how long it takes if the user is repairing itself + if (args.User == args.Target) + delay *= component.SelfRepairPenalty; + // Can the tool actually repair this, does it have enough fuel? - if (!await _toolSystem.UseTool(args.Used, args.User, uid, component.FuelCost, component.DoAfterDelay, component.QualityNeeded)) + if (!await _toolSystem.UseTool(args.Used, args.User, uid, component.FuelCost, delay, component.QualityNeeded)) return; if (component.Damage != null)