Miscellaneous Body Decoupling (#38958)

This commit is contained in:
Nemanja
2025-08-06 15:01:20 -04:00
committed by GitHub
parent 2e0b11ea51
commit 9872a28d7f
16 changed files with 83 additions and 78 deletions

View File

@@ -117,19 +117,18 @@ public sealed class SharpSystem : EntitySystem
popupEnt = Spawn(proto, coords.Offset(_robustRandom.NextVector2(0.25f)));
}
var hasBody = TryComp<BodyComponent>(args.Args.Target.Value, out var body);
// only show a big popup when butchering living things.
var popupType = PopupType.Small;
if (hasBody)
popupType = PopupType.LargeCaution;
// Meant to differentiate cutting up clothes and cutting up your boss.
var popupType = HasComp<MobStateComponent>(args.Args.Target.Value)
? PopupType.LargeCaution
: PopupType.Small;
_popupSystem.PopupEntity(Loc.GetString("butcherable-knife-butchered-success", ("target", args.Args.Target.Value), ("knife", Identity.Entity(uid, EntityManager))),
popupEnt, args.Args.User, popupType);
if (hasBody)
_bodySystem.GibBody(args.Args.Target.Value, body: body);
popupEnt,
args.Args.User,
popupType);
_bodySystem.GibBody(args.Args.Target.Value); // does nothing if ent can't be gibbed
_destructibleSystem.DestroyEntity(args.Args.Target.Value);
args.Handled = true;