Make it easier to delimb extremities, make it harder to delimb core (#3585)
* Make it easier to delimb extremities, make it harder to delimb core * thresholds * thresholds yaml warrioring * direction feedback * mrrrp
This commit is contained in:
parent
8601e46844
commit
90dcb5eecc
|
|
@ -117,11 +117,11 @@ public sealed partial class BodyPartComponent : Component, ISurgeryToolComponent
|
||||||
public string Species { get; set; } = "";
|
public string Species { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shitmed Change: The total damage that has to be dealt to a body part
|
/// Shitmed Change: Any of these damage specifiers being present on the part
|
||||||
/// to make possible severing it.
|
/// will result in it severing
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField, AutoNetworkedField]
|
[DataField, AutoNetworkedField]
|
||||||
public float SeverIntegrity = 90;
|
public List<DamageSpecifier> SeverThresholds = [];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shitmed Change: The ID of the base layer for this body part.
|
/// Shitmed Change: The ID of the base layer for this body part.
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ public partial class SharedBodySystem
|
||||||
[Dependency] private readonly DamageableSystem _damageable = default!;
|
[Dependency] private readonly DamageableSystem _damageable = default!;
|
||||||
|
|
||||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||||
private readonly ProtoId<DamageTypePrototype>[] _severingDamageTypes = { "Slash", "Piercing", "Blunt" };
|
|
||||||
private const double IntegrityJobTime = 0.005;
|
private const double IntegrityJobTime = 0.005;
|
||||||
private readonly JobQueue _integrityJobQueue = new(IntegrityJobTime);
|
private readonly JobQueue _integrityJobQueue = new(IntegrityJobTime);
|
||||||
public sealed class IntegrityJob : Job<object>
|
public sealed class IntegrityJob : Job<object>
|
||||||
|
|
@ -212,6 +211,19 @@ public partial class SharedBodySystem
|
||||||
return landed;
|
return landed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool CheckDamageThreshold(DamageSpecifier thresholds, DamageSpecifier testing)
|
||||||
|
{
|
||||||
|
foreach (var (kind, amount) in thresholds.DamageDict)
|
||||||
|
{
|
||||||
|
if (!testing.DamageDict.TryGetValue(kind, out var testAmount))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (testAmount < amount)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private void OnDamageChanged(Entity<BodyPartComponent> partEnt, ref DamageChangedEvent args)
|
private void OnDamageChanged(Entity<BodyPartComponent> partEnt, ref DamageChangedEvent args)
|
||||||
{
|
{
|
||||||
if (!TryComp<DamageableComponent>(partEnt, out var damageable) || _timing.ApplyingState) // DeltaV: Don't try to predict limb severing
|
if (!TryComp<DamageableComponent>(partEnt, out var damageable) || _timing.ApplyingState) // DeltaV: Don't try to predict limb severing
|
||||||
|
|
@ -227,8 +239,7 @@ public partial class SharedBodySystem
|
||||||
&& delta != null
|
&& delta != null
|
||||||
&& !HasComp<BodyPartReattachedComponent>(partEnt)
|
&& !HasComp<BodyPartReattachedComponent>(partEnt)
|
||||||
&& !partEnt.Comp.Enabled
|
&& !partEnt.Comp.Enabled
|
||||||
&& damageable.TotalDamage >= partEnt.Comp.SeverIntegrity
|
&& partEnt.Comp.SeverThresholds.Any(threshold => CheckDamageThreshold(threshold, damageable.Damage)))
|
||||||
&& _severingDamageTypes.Any(damageType => delta.DamageDict.TryGetValue(damageType, out var value) && value > 0))
|
|
||||||
severed = true;
|
severed = true;
|
||||||
|
|
||||||
CheckBodyPart(partEnt, GetTargetBodyPart(partEnt), severed, damageable);
|
CheckBodyPart(partEnt, GetTargetBodyPart(partEnt), severed, damageable);
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,7 @@
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
abstract: true
|
abstract: true
|
||||||
|
parent: BaseHeadDV # DeltaV - adjusted damages
|
||||||
id: BaseHead
|
id: BaseHead
|
||||||
name: "head"
|
name: "head"
|
||||||
components:
|
components:
|
||||||
|
|
@ -102,6 +103,7 @@
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
abstract: true
|
abstract: true
|
||||||
|
parent: BaseArmDV # DeltaV - adjusted damages
|
||||||
id: BaseLeftArm
|
id: BaseLeftArm
|
||||||
name: "left arm"
|
name: "left arm"
|
||||||
components:
|
components:
|
||||||
|
|
@ -120,6 +122,7 @@
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
abstract: true
|
abstract: true
|
||||||
|
parent: BaseArmDV # DeltaV - adjusted damages
|
||||||
id: BaseRightArm
|
id: BaseRightArm
|
||||||
name: "right arm"
|
name: "right arm"
|
||||||
components:
|
components:
|
||||||
|
|
@ -138,6 +141,7 @@
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
abstract: true
|
abstract: true
|
||||||
|
parent: BaseHandDV # DeltaV - adjusted damages
|
||||||
id: BaseLeftHand
|
id: BaseLeftHand
|
||||||
name: "left hand"
|
name: "left hand"
|
||||||
components:
|
components:
|
||||||
|
|
@ -152,6 +156,7 @@
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
abstract: true
|
abstract: true
|
||||||
|
parent: BaseHandDV # DeltaV - adjusted damages
|
||||||
id: BaseRightHand
|
id: BaseRightHand
|
||||||
name: "right hand"
|
name: "right hand"
|
||||||
components:
|
components:
|
||||||
|
|
@ -166,6 +171,7 @@
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
abstract: true
|
abstract: true
|
||||||
|
parent: BaseLegDV # DeltaV - adjusted damages
|
||||||
id: BaseLeftLeg
|
id: BaseLeftLeg
|
||||||
name: "left leg"
|
name: "left leg"
|
||||||
components:
|
components:
|
||||||
|
|
@ -185,6 +191,7 @@
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
abstract: true
|
abstract: true
|
||||||
|
parent: BaseLegDV # DeltaV - adjusted damages
|
||||||
id: BaseRightLeg
|
id: BaseRightLeg
|
||||||
name: "right leg"
|
name: "right leg"
|
||||||
components:
|
components:
|
||||||
|
|
@ -204,6 +211,7 @@
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
abstract: true
|
abstract: true
|
||||||
|
parent: BaseFootDV # DeltaV - adjusted damages
|
||||||
id: BaseLeftFoot
|
id: BaseLeftFoot
|
||||||
name: "left foot"
|
name: "left foot"
|
||||||
components:
|
components:
|
||||||
|
|
@ -218,6 +226,7 @@
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
abstract: true
|
abstract: true
|
||||||
|
parent: BaseFootDV # DeltaV - adjusted damages
|
||||||
id: BaseRightFoot
|
id: BaseRightFoot
|
||||||
name: "right foot"
|
name: "right foot"
|
||||||
components:
|
components:
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,99 @@
|
||||||
|
- type: entity
|
||||||
|
abstract: true
|
||||||
|
id: BaseHeadDV
|
||||||
|
components:
|
||||||
|
- type: BodyPart
|
||||||
|
severThresholds:
|
||||||
|
- types:
|
||||||
|
Piercing: 100
|
||||||
|
- types:
|
||||||
|
Slash: 100
|
||||||
|
- types:
|
||||||
|
Blunt: 100
|
||||||
|
integrityThresholds:
|
||||||
|
CriticallyWounded: 90
|
||||||
|
HeavilyWounded: 75
|
||||||
|
ModeratelyWounded: 60
|
||||||
|
SomewhatWounded: 40
|
||||||
|
LightlyWounded: 20
|
||||||
|
Healthy: 10
|
||||||
|
|
||||||
|
- type: entity
|
||||||
|
abstract: true
|
||||||
|
id: BaseArmDV
|
||||||
|
components:
|
||||||
|
- type: BodyPart
|
||||||
|
severThresholds:
|
||||||
|
- types:
|
||||||
|
Piercing: 90
|
||||||
|
- types:
|
||||||
|
Slash: 55
|
||||||
|
- types:
|
||||||
|
Blunt: 90
|
||||||
|
integrityThresholds:
|
||||||
|
CriticallyWounded: 50
|
||||||
|
HeavilyWounded: 40
|
||||||
|
ModeratelyWounded: 30
|
||||||
|
SomewhatWounded: 20
|
||||||
|
LightlyWounded: 15
|
||||||
|
Healthy: 10
|
||||||
|
|
||||||
|
- type: entity
|
||||||
|
abstract: true
|
||||||
|
id: BaseHandDV
|
||||||
|
components:
|
||||||
|
- type: BodyPart
|
||||||
|
severThresholds:
|
||||||
|
- types:
|
||||||
|
Piercing: 90
|
||||||
|
- types:
|
||||||
|
Slash: 40
|
||||||
|
- types:
|
||||||
|
Blunt: 90
|
||||||
|
integrityThresholds:
|
||||||
|
CriticallyWounded: 35
|
||||||
|
HeavilyWounded: 30
|
||||||
|
ModeratelyWounded: 25
|
||||||
|
SomewhatWounded: 20
|
||||||
|
LightlyWounded: 15
|
||||||
|
Healthy: 10
|
||||||
|
|
||||||
|
- type: entity
|
||||||
|
abstract: true
|
||||||
|
id: BaseLegDV
|
||||||
|
components:
|
||||||
|
- type: BodyPart
|
||||||
|
severThresholds:
|
||||||
|
- types:
|
||||||
|
Piercing: 90
|
||||||
|
- types:
|
||||||
|
Slash: 80
|
||||||
|
- types:
|
||||||
|
Blunt: 90
|
||||||
|
integrityThresholds:
|
||||||
|
CriticallyWounded: 70
|
||||||
|
HeavilyWounded: 60
|
||||||
|
ModeratelyWounded: 50
|
||||||
|
SomewhatWounded: 40
|
||||||
|
LightlyWounded: 20
|
||||||
|
Healthy: 10
|
||||||
|
|
||||||
|
- type: entity
|
||||||
|
abstract: true
|
||||||
|
id: BaseFootDV
|
||||||
|
components:
|
||||||
|
- type: BodyPart
|
||||||
|
severThresholds:
|
||||||
|
- types:
|
||||||
|
Piercing: 90
|
||||||
|
- types:
|
||||||
|
Slash: 40
|
||||||
|
- types:
|
||||||
|
Blunt: 90
|
||||||
|
integrityThresholds:
|
||||||
|
CriticallyWounded: 35
|
||||||
|
HeavilyWounded: 30
|
||||||
|
ModeratelyWounded: 25
|
||||||
|
SomewhatWounded: 20
|
||||||
|
LightlyWounded: 15
|
||||||
|
Healthy: 10
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
- trigger:
|
- trigger:
|
||||||
!type:DamageTypeTrigger
|
!type:DamageTypeTrigger
|
||||||
damageType: Slash
|
damageType: Slash
|
||||||
damage: 60 # DeltaV - was 150
|
damage: 150
|
||||||
behaviors:
|
behaviors:
|
||||||
- !type:GibPartBehavior { }
|
- !type:GibPartBehavior { }
|
||||||
- trigger:
|
- trigger:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue