Skip to content

Commit

Permalink
make limb severing bleed instead of bloodloss damage (#2668)
Browse files Browse the repository at this point in the history
Co-authored-by: deltanedas <@deltanedas:kde.org>
  • Loading branch information
deltanedas authored Jan 9, 2025
1 parent c5a008c commit 17d0861
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
9 changes: 9 additions & 0 deletions Content.Server/Body/Systems/BodySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace Content.Server.Body.Systems;

public sealed class BodySystem : SharedBodySystem
{
[Dependency] private readonly BloodstreamSystem _bloodstream = default!; // Shitmed Change
[Dependency] private readonly GhostSystem _ghostSystem = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly HumanoidAppearanceSystem _humanoidSystem = default!;
Expand Down Expand Up @@ -195,5 +196,13 @@ protected override void RemoveBodyMarkings(EntityUid target, BodyPartAppearanceC
Dirty(target, bodyAppearance);
}

protected override void PartRemoveDamage(Entity<BodyComponent?> bodyEnt, Entity<BodyPartComponent> partEnt)
{
var bleeding = partEnt.Comp.SeverBleeding;
if (partEnt.Comp.IsVital)
bleeding *= 2f;
_bloodstream.TryModifyBleedAmount(bodyEnt, bleeding);
}

// Shitmed Change End
}
8 changes: 4 additions & 4 deletions Content.Shared/Body/Part/BodyPartComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ public sealed partial class BodyPartComponent : Component, ISurgeryToolComponent
public BodyPartSlot? ParentSlot;

/// <summary>
/// Shitmed Change: Amount of damage to deal when the part gets removed.
/// Only works if IsVital is true.
/// Shitmed Change: Bleeding stacks to give when this body part is severed.
/// Doubled for <see cref="IsVital"/>. parts.
/// </summary>
[DataField, AutoNetworkedField]
public FixedPoint2 VitalDamage = 100;
[DataField]
public float SeverBleeding = 4f;

[DataField, AlwaysPushInheritance]
public string ToolName { get; set; } = "A body part";
Expand Down
14 changes: 2 additions & 12 deletions Content.Shared/Body/Systems/SharedBodySystem.Parts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -383,19 +383,9 @@ private void RemoveLeg(Entity<BodyPartComponent> legEnt, Entity<BodyComponent?>
}
}

private void PartRemoveDamage(Entity<BodyComponent?> bodyEnt, Entity<BodyPartComponent> partEnt)
// Shitmed Change: made virtual, bleeding damage is done on server
protected virtual void PartRemoveDamage(Entity<BodyComponent?> bodyEnt, Entity<BodyPartComponent> partEnt)
{
if (!Resolve(bodyEnt, ref bodyEnt.Comp, logMissing: false))
return;

if (!_timing.ApplyingState
&& partEnt.Comp.IsVital
&& !GetBodyChildrenOfType(bodyEnt, partEnt.Comp.PartType, bodyEnt.Comp).Any()
)
{
var damage = new DamageSpecifier(Prototypes.Index<DamageTypePrototype>("Bloodloss"), partEnt.Comp.VitalDamage); // Shitmed Change
Damageable.TryChangeDamage(bodyEnt, damage, partMultiplier: 0f); // Shitmed Change
}
}

/// <summary>
Expand Down

0 comments on commit 17d0861

Please sign in to comment.