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

@@ -92,7 +92,7 @@ namespace Content.Server.Kitchen.EntitySystems
if (!Resolve(uid, ref component) || !Resolve(victimUid, ref butcherable))
return;
component.MeatPrototype = butcherable.MeatPrototype;
component.MeatPrototype = butcherable.SpawnedPrototype;
component.MeatParts = butcherable.Pieces;
// This feels not okay, but entity is getting deleted on "Spike", for now...
@@ -164,7 +164,7 @@ namespace Content.Server.Kitchen.EntitySystems
return false;
}
if (!Resolve(victimUid, ref butcherable, false) || butcherable.MeatPrototype == null)
if (!Resolve(victimUid, ref butcherable, false) || butcherable.SpawnedPrototype == null)
{
_popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-butcher", ("victim", victimUid), ("this", uid)), victimUid, Filter.Entities(userUid));
return false;
@@ -180,6 +180,9 @@ namespace Content.Server.Kitchen.EntitySystems
!Resolve(victimUid, ref butcherable) || butcherable.BeingButchered)
return false;
if (butcherable.Type != ButcheringType.Spike)
return false;
// THE WHAT? (again)
// Prevent dead from being spiked TODO: Maybe remove when rounds can be played and DOT is implemented
if (Resolve(victimUid, ref mobState, false) &&
@@ -201,7 +204,7 @@ namespace Content.Server.Kitchen.EntitySystems
butcherable.BeingButchered = true;
component.InUse = true;
var doAfterArgs = new DoAfterEventArgs(userUid, component.SpikeDelay, default, uid)
var doAfterArgs = new DoAfterEventArgs(userUid, component.SpikeDelay + butcherable.ButcherDelay, default, uid)
{
BreakOnTargetMove = true,
BreakOnUserMove = true,