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

@@ -0,0 +1,31 @@
using Content.Shared.FixedPoint;
using Content.Shared.Mobs.Systems;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Mobs.Components;
[RegisterComponent, NetworkedComponent]
[Access(typeof(MobThresholdSystem))]
public sealed class MobThresholdsComponent : Component
{
[DataField("thresholds", required:true)]public SortedDictionary<FixedPoint2, MobState> Thresholds = new();
[DataField("triggersAlerts")] public bool TriggersAlerts = true;
public MobState CurrentThresholdState;
}
[Serializable, NetSerializable]
public sealed class MobThresholdComponentState : ComponentState
{
public Dictionary<FixedPoint2, MobState> Thresholds;
public MobState CurrentThresholdState;
public MobThresholdComponentState(MobState currentThresholdState,
Dictionary<FixedPoint2, MobState> thresholds)
{
CurrentThresholdState = currentThresholdState;
Thresholds = thresholds;
}
}