Skip to content

Commit

Permalink
Merge branch 'master' into add-trait-sluggish
Browse files Browse the repository at this point in the history
  • Loading branch information
angelofallars authored Aug 7, 2024
2 parents 9eaea37 + 1b2c946 commit 64499c2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
11 changes: 5 additions & 6 deletions Content.Server/Atmos/EntitySystems/BarotraumaSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,11 @@ 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);

if (!barotrauma.TakingDamage)
{
barotrauma.TakingDamage = true;
_adminLogger.Add(LogType.Barotrauma, $"{ToPrettyString(uid):entity} started taking high pressure damage");
}
_alertsSystem.ShowAlert(uid, AlertType.HighPressure, 2);
}
else
Expand All @@ -258,11 +262,6 @@ public override void Update(float frameTime)
barotrauma.TakingDamage = false;
_adminLogger.Add(LogType.Barotrauma, $"{ToPrettyString(uid):entity} stopped taking pressure damage");
}
if (!barotrauma.TakingDamage)
{
barotrauma.TakingDamage = true;
_adminLogger.Add(LogType.Barotrauma, $"{ToPrettyString(uid):entity} started taking high pressure damage");
}
// Set correct alert.
switch (pressure)
{
Expand Down
1 change: 1 addition & 0 deletions Content.Server/Body/Components/BloodstreamComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public sealed partial class BloodstreamComponent : Component
/// If this is true, the entity will not passively regenerate blood,
/// and instead will slowly lose blood.
/// </summary>
[DataField]
public bool HasBloodDeficiency = false;

/// <summary>
Expand Down
9 changes: 6 additions & 3 deletions Content.Server/Body/Systems/BloodstreamSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,15 @@ public override void Update(float frameTime)

// Removes blood for Blood Deficiency constantly.
if (bloodstream.HasBloodDeficiency)
{
if (!_mobStateSystem.IsDead(uid))
RemoveBlood(uid, bloodstream.BloodDeficiencyLossAmount, bloodstream);
}
// Adds blood to their blood level if it is below the maximum.
else if (bloodSolution.Volume < bloodSolution.MaxVolume)
if (!_mobStateSystem.IsDead(uid))
TryModifyBloodLevel(uid, bloodstream.BloodRefreshAmount, bloodstream);
else if (bloodSolution.Volume < bloodSolution.MaxVolume && !_mobStateSystem.IsDead(uid))
{
TryModifyBloodLevel(uid, bloodstream.BloodRefreshAmount, bloodstream);
}

// Removes blood from the bloodstream based on bleed amount (bleed rate)
// as well as stop their bleeding to a certain extent.
Expand Down
12 changes: 12 additions & 0 deletions Resources/Changelog/Changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5041,3 +5041,15 @@ Entries:
which can then be traced back to people.
id: 6230
time: '2024-08-06T22:03:36.0000000+00:00'
- author: Skubman
changes:
- type: Fix
message: Passive blood regeneration now works again.
id: 6231
time: '2024-08-07T06:07:35.0000000+00:00'
- author: Fansana
changes:
- type: Fix
message: Barotrauma admin log spam
id: 6232
time: '2024-08-07T17:31:55.0000000+00:00'

0 comments on commit 64499c2

Please sign in to comment.