Mobstate Refactor (#13389)

Refactors mobstate and moves mob health thresholds to their own component

Co-authored-by: DrSmugleaf <drsmugleaf@gmail.com>
This commit is contained in:
Jezithyr
2023-01-13 16:57:10 -08:00
committed by GitHub
parent 97e4c477bd
commit eeb5b17b34
148 changed files with 1517 additions and 1290 deletions

View File

@@ -1,6 +1,6 @@
using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
using Content.Shared.MobState.Components;
using Content.Shared.Mobs.Components;
using Robust.Shared.Map;
using Robust.Shared.Random;

View File

@@ -1,5 +1,5 @@
using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;
using Content.Shared.MobState;
using Content.Shared.Mobs;
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Systems;
@@ -15,10 +15,10 @@ public sealed class ArtifactDeathTriggerSystem : EntitySystem
private void OnMobStateChanged(MobStateChangedEvent ev)
{
if (ev.CurrentMobState != DamageState.Dead)
if (ev.NewMobState != MobState.Dead)
return;
var deathXform = Transform(ev.Entity);
var deathXform = Transform(ev.Target);
var toActivate = new List<ArtifactDeathTriggerComponent>();
foreach (var (trigger, xform) in EntityQuery<ArtifactDeathTriggerComponent, TransformComponent>())