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:
@@ -1,4 +1,3 @@
|
||||
using Content.Shared.MobState;
|
||||
using Robust.Shared.Audio;
|
||||
|
||||
namespace Content.Server.Explosion.Components
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Content.Shared.MobState;
|
||||
using Content.Shared.Mobs;
|
||||
|
||||
namespace Content.Server.Explosion.Components;
|
||||
|
||||
@@ -13,7 +13,7 @@ public sealed class TriggerOnMobstateChangeComponent : Component
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[DataField("mobState", required: true)]
|
||||
public DamageState MobState = DamageState.Alive;
|
||||
public MobState MobState = MobState.Alive;
|
||||
|
||||
/// <summary>
|
||||
/// If true, prevents suicide attempts for the trigger to prevent cheese.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Content.Server.Explosion.Components;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.MobState;
|
||||
using Content.Shared.Mobs;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Server.Explosion.EntitySystems;
|
||||
@@ -15,7 +15,7 @@ public sealed partial class TriggerSystem
|
||||
|
||||
private void OnMobStateChanged(EntityUid uid, TriggerOnMobstateChangeComponent component, MobStateChangedEvent args)
|
||||
{
|
||||
if (component.MobState < args.CurrentMobState)
|
||||
if (component.MobState < args.NewMobState)
|
||||
return;
|
||||
|
||||
//This chains Mobstate Changed triggers with OnUseTimerTrigger if they have it
|
||||
|
||||
Reference in New Issue
Block a user