Add repairable scaling based on the damage the repair target has.

This commit is contained in:
Vanessa 2026-06-27 15:12:26 -05:00
parent e0f4a497d0
commit e309d3ea3a
4 changed files with 17 additions and 6 deletions

View File

@ -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<DamageableComponent>(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<ToolComponent>(args.Used, out var tool))
return;

View File

@ -55,9 +55,6 @@
resistance: 2
- type: BlockWeather
- type: SunShadowCast
- type: Repairable # Monolith - Nanite Applicator
qualityNeeded:
- Applicating
- type: entity
abstract: true

View File

@ -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

View File

@ -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