Make Surgery dependant on Part Damage (#4307)

* Make Surgery dependant on Part Damage

* Comments

* Fix things
This commit is contained in:
Sir Warock 2025-10-03 06:52:41 +02:00 committed by GitHub
parent 5823415edb
commit 276d47d89a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 5 deletions

View File

@ -348,16 +348,17 @@ public abstract partial class SharedSurgerySystem
{
var group = ent.Comp.MainGroup == "Brute" ? BruteDamageTypes : BurnDamageTypes;
if (!HasDamageGroup(args.Body, group, out var damageable)
&& !HasDamageGroup(args.Part, group, out var _)
if (!HasDamageGroup(args.Part, group, out var damageable) // DeltaV - Surgery Healing Depends on Limbs.
&& !HasDamageGroup(args.Body, group, out var _)
|| damageable == null) // This shouldnt be possible but the compiler doesn't shut up.
return;
// Right now the bonus is based off the body's total damage, maybe we could make it based off each part in the future.
// We did make it based of each part, the future is here - DeltaV
var bonus = ent.Comp.HealMultiplier * damageable.DamagePerGroup[ent.Comp.MainGroup];
if (_mobState.IsDead(args.Body))
bonus *= 0.2;
bonus *= 0.1; // DeltaV - Surgery Healing Depends on Limbs.
var adjustedDamage = new DamageSpecifier(ent.Comp.Damage);
@ -372,8 +373,7 @@ public abstract partial class SharedSurgerySystem
{
var group = ent.Comp.MainGroup == "Brute" ? BruteDamageTypes : BurnDamageTypes;
if (HasDamageGroup(args.Body, group, out var _)
|| HasDamageGroup(args.Part, group, out var _))
if (HasDamageGroup(args.Part, group, out var _)) // DeltaV - Surgery Healing Depends on Limbs.
args.Cancelled = true;
}