ECS and cleanup body system, merge body templates and presets into body prototypes (#11991)

Co-authored-by: Jezithyr <Jezithyr@gmail.com>
This commit is contained in:
DrSmugleaf
2022-10-23 00:46:28 +02:00
committed by GitHub
parent 9a38736c3c
commit f323fb7644
140 changed files with 2478 additions and 2571 deletions

View File

@@ -1,12 +1,10 @@
using System.Threading;
using Content.Server.Body.Components;
using Content.Server.Body.Systems;
using Content.Server.Coordinates.Helpers;
using Content.Server.Decals;
using Content.Server.DoAfter;
using Content.Server.Doors.Components;
using Content.Server.Magic.Events;
using Content.Server.Popups;
using Content.Server.Spawners.Components;
using Content.Server.Weapons.Ranged.Systems;
using Content.Shared.Actions;
using Content.Shared.Actions.ActionTypes;
@@ -35,6 +33,7 @@ public sealed class MagicSystem : EntitySystem
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly BodySystem _bodySystem = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly SharedDoorSystem _doorSystem = default!;
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
@@ -281,7 +280,7 @@ public sealed class MagicSystem : EntitySystem
if (!TryComp<BodyComponent>(ev.Target, out var body))
return;
var ents = body.Gib(true);
var ents = _bodySystem.GibBody(ev.Target, true, body);
if (!ev.DeleteNonBrainParts)
return;
@@ -289,8 +288,7 @@ public sealed class MagicSystem : EntitySystem
foreach (var part in ents)
{
// just leaves a brain and clothes
if ((HasComp<BodyPartComponent>(part) || HasComp<MechanismComponent>(part))
&& !HasComp<BrainComponent>(part))
if (HasComp<BodyComponent>(part) && !HasComp<BrainComponent>(part))
{
QueueDel(part);
}