diff --git a/Content.Shared/Repairable/RepairableSystem.cs b/Content.Shared/Repairable/RepairableSystem.cs index 05bd2ac54e9..a7e377d7239 100644 --- a/Content.Shared/Repairable/RepairableSystem.cs +++ b/Content.Shared/Repairable/RepairableSystem.cs @@ -116,6 +116,18 @@ public sealed partial class RepairableSystem : EntitySystem delay *= ent.Comp.SelfRepairPenalty; } + // BEGIN DeltaV - Scale Repair Time with Damage + // If its a self-repair, ignore it since they've already been penalized. + if (args.User != args.Target && TryComp(args.Target, out var damageComp)) + { + var totalDamage = damageComp.Damage.GetTotal(); + // TODO: Scale with the destructible threshold if DestructibleSystem ever gets more prediction added. + // For now, just scale up the delay per 100 damage, or reduce the delay if its less. + delay *= Math.Clamp((float)totalDamage / 100.0f, 0.5f, 3.0f); + } + + // END DeltaV + // BEGIN Monolith - Nanite Applicators if (!TryComp(args.Used, out var tool)) return; diff --git a/Resources/Prototypes/Entities/Structures/Walls/walls.yml b/Resources/Prototypes/Entities/Structures/Walls/walls.yml index 245bbb4726b..b62fdc75717 100644 --- a/Resources/Prototypes/Entities/Structures/Walls/walls.yml +++ b/Resources/Prototypes/Entities/Structures/Walls/walls.yml @@ -55,9 +55,6 @@ resistance: 2 - type: BlockWeather - type: SunShadowCast - - type: Repairable # Monolith - Nanite Applicator - qualityNeeded: - - Applicating - type: entity abstract: true diff --git a/Resources/Prototypes/Entities/Structures/Windows/window.yml b/Resources/Prototypes/Entities/Structures/Windows/window.yml index 68a089a8a9e..01a9f5a2849 100644 --- a/Resources/Prototypes/Entities/Structures/Windows/window.yml +++ b/Resources/Prototypes/Entities/Structures/Windows/window.yml @@ -45,6 +45,7 @@ - type: ExaminableDamage messages: WindowMessages - type: Repairable + doAfterDelay: 2 # DeltaV qualityNeeded: # Monolith - Nanite Applicators - Welding - Applicating @@ -174,6 +175,7 @@ layer: - GlassLayer - type: Repairable + doAfterDelay: 2 # DeltaV qualityNeeded: # Monolith - Added qualities to override base - Welding - Applicating diff --git a/Resources/Prototypes/Entities/Structures/base_structure.yml b/Resources/Prototypes/Entities/Structures/base_structure.yml index 4b4dff15141..3e9f7cbabb7 100644 --- a/Resources/Prototypes/Entities/Structures/base_structure.yml +++ b/Resources/Prototypes/Entities/Structures/base_structure.yml @@ -26,11 +26,11 @@ - type: Tag tags: - Structure - # BEGIN DeltaV - - type: ExaminableDamage + + - type: ExaminableDamage # DeltaV messages: BaseStructureMessages - # END DeltaV - type: Repairable # Monolith - Nanite Applicator + doAfterDelay: 3 qualityNeeded: - Applicating