Add knife butchering and blood gibbing (#6770)

This commit is contained in:
mirrorcult
2022-02-18 15:57:42 -07:00
committed by GitHub
parent 67661ddbdb
commit 676ca21b5f
28 changed files with 223 additions and 45 deletions

View File

@@ -34,6 +34,7 @@ public sealed class BloodstreamSystem : EntitySystem
SubscribeLocalEvent<BloodstreamComponent, ComponentInit>(OnComponentInit);
SubscribeLocalEvent<BloodstreamComponent, DamageChangedEvent>(OnDamageChanged);
SubscribeLocalEvent<BloodstreamComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<BloodstreamComponent, BeingGibbedEvent>(OnBeingGibbed);
}
public override void Update(float frameTime)
@@ -132,6 +133,11 @@ public sealed class BloodstreamSystem : EntitySystem
}
}
private void OnBeingGibbed(EntityUid uid, BloodstreamComponent component, BeingGibbedEvent args)
{
SpillAllSolutions(uid, component);
}
/// <summary>
/// Attempt to transfer provided solution to internal solution.
/// </summary>
@@ -193,4 +199,22 @@ public sealed class BloodstreamSystem : EntitySystem
return true;
}
/// <summary>
/// BLOOD FOR THE BLOOD GOD
/// </summary>
public void SpillAllSolutions(EntityUid uid, BloodstreamComponent? component = null)
{
if (!Resolve(uid, ref component))
return;
var max = component.BloodSolution.MaxVolume + component.BloodTemporarySolution.MaxVolume +
component.ChemicalSolution.MaxVolume;
var tempSol = new Solution() { MaxVolume = max };
tempSol.AddSolution(component.BloodSolution);
tempSol.AddSolution(component.BloodTemporarySolution);
tempSol.AddSolution(component.ChemicalSolution);
_spillableSystem.SpillAt(uid, tempSol, "PuddleBlood", true);
}
}