Skip to content

Commit

Permalink
Weaken the effects of damage on parts
Browse files Browse the repository at this point in the history
  • Loading branch information
Mnemotechnician committed Feb 6, 2025
1 parent 9153de3 commit 3d7e990
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions Content.Server/Atmos/EntitySystems/BarotraumaSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,12 @@ public override void Update(float frameTime)
>= Atmospherics.WarningHighPressure => GetFeltHighPressure(uid, barotrauma, pressure),
_ => pressure
};

const float partMultiplier = 0.4f; // Floof - weakened the effect of barotrauma on body parts to 40%
if (pressure <= Atmospherics.HazardLowPressure)
{
// Deal damage and ignore resistances. Resistance to pressure damage should be done via pressure protection gear.
_damageableSystem.TryChangeDamage(uid, barotrauma.Damage * Atmospherics.LowPressureDamage, true, false, canSever: false);
_damageableSystem.TryChangeDamage(uid, barotrauma.Damage * Atmospherics.LowPressureDamage, true, false, canSever: false, partMultiplier: partMultiplier); // Floof - added partMultiplier
if (!barotrauma.TakingDamage)
{
barotrauma.TakingDamage = true;
Expand All @@ -247,7 +249,7 @@ public override void Update(float frameTime)
{
var damageScale = MathF.Min(((pressure / Atmospherics.HazardHighPressure) - 1) * Atmospherics.PressureDamageCoefficient, Atmospherics.MaxHighPressureDamage);

_damageableSystem.TryChangeDamage(uid, barotrauma.Damage * damageScale, true, false, canSever: false);
_damageableSystem.TryChangeDamage(uid, barotrauma.Damage * damageScale, true, false, canSever: false, partMultiplier: partMultiplier); // Floof - added partMultiplier
RaiseLocalEvent(uid, new MoodEffectEvent("MobHighPressure"));

if (!barotrauma.TakingDamage)
Expand Down
6 changes: 3 additions & 3 deletions Content.Shared/Body/Part/BodyPartComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public sealed partial class BodyPartComponent : Component, ISurgeryToolComponent
/// to make possible severing it.
/// </summary>
[DataField, AutoNetworkedField]
public float SeverIntegrity = 90;
public float SeverIntegrity = 300; // Floof - increased to 300 due to frequent RR

/// <summary>
/// The ID of the base layer for this body part.
Expand All @@ -159,8 +159,8 @@ public sealed partial class BodyPartComponent : Component, ISurgeryToolComponent
[DataField, AutoNetworkedField]
public Dictionary<TargetIntegrity, float> IntegrityThresholds = new()
{
{ TargetIntegrity.CriticallyWounded, 90 },
{ TargetIntegrity.HeavilyWounded, 75 },
{ TargetIntegrity.CriticallyWounded, 100 }, // Floof - adjusted the thresholds to come in increments of 20
{ TargetIntegrity.HeavilyWounded, 80 },
{ TargetIntegrity.ModeratelyWounded, 60 },
{ TargetIntegrity.SomewhatWounded, 40},
{ TargetIntegrity.LightlyWounded, 20 },
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Body/Systems/SharedBodySystem.Targeting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private void OnTryChangePartDamage(Entity<BodyComponent> ent, ref TryChangePartD
else if (damage != null)
{
// Division by 2 cuz damaging all parts by the same damage by default is too much.
damage /= 2;
damage /= 10; // Floofstation - changed to 10 because there's typically 10 parts and division by 2 is just too little.
targetPart = TargetBodyPart.All;
}
}
Expand Down

0 comments on commit 3d7e990

Please sign in to comment.