mirror of
https://github.com/wega-team/ss14-wega.git
synced 2026-02-15 03:31:44 +01:00
@@ -167,7 +167,7 @@ namespace Content.Server.Ghost
|
||||
if (!_minds.TryGetMind(uid, out var mindId, out var mind) || mind.IsVisitingEntity)
|
||||
return;
|
||||
|
||||
if (component.MustBeDead && (_mobState.IsAlive(uid) || _mobState.IsCritical(uid)))
|
||||
if (component.MustBeDead && (_mobState.IsAlive(uid) || _mobState.IsCritical(uid) || _mobState.IsPreCritical(uid))) // Corvax-Wega-PreCritical
|
||||
return;
|
||||
|
||||
OnGhostAttempt(mindId, component.CanReturn, mind: mind);
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace Content.Shared.Mobs.Components
|
||||
public HashSet<MobState> AllowedStates = new()
|
||||
{
|
||||
MobState.Alive,
|
||||
MobState.PreCritical, // Corvax-Wega-PreCritical
|
||||
MobState.Critical,
|
||||
MobState.Dead
|
||||
};
|
||||
|
||||
@@ -28,6 +28,7 @@ public sealed partial class MobThresholdsComponent : Component
|
||||
public Dictionary<MobState, ProtoId<AlertPrototype>> StateAlertDict = new()
|
||||
{
|
||||
{MobState.Alive, "HumanHealth"},
|
||||
{MobState.PreCritical, "HumanCrit"}, // Corvax-Wega-PreCritical
|
||||
{MobState.Critical, "HumanCrit"},
|
||||
{MobState.Dead, "HumanDead"},
|
||||
};
|
||||
|
||||
@@ -15,8 +15,11 @@ public enum MobState : byte
|
||||
{
|
||||
Invalid = 0,
|
||||
Alive = 1,
|
||||
Critical = 2,
|
||||
Dead = 3
|
||||
// Corvax-Wega-PreCritical-change-start
|
||||
PreCritical = 2,
|
||||
Critical = 3,
|
||||
Dead = 4
|
||||
// Corvax-Wega-PreCritical-change-end
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.Speech.EntitySystems; // Corvax-Wega-PreCritical
|
||||
|
||||
namespace Content.Shared.Mobs.Systems;
|
||||
|
||||
public partial class MobStateSystem
|
||||
{
|
||||
[Dependency] private readonly SharedStutteringSystem _stutteringSystem = default!; // Corvax-Wega-PreCritical
|
||||
|
||||
#region Public API
|
||||
|
||||
/// <summary>
|
||||
@@ -66,6 +69,13 @@ public partial class MobStateSystem
|
||||
protected virtual void OnEnterState(EntityUid entity, MobStateComponent component, MobState state)
|
||||
{
|
||||
OnStateEnteredSubscribers(entity, component, state);
|
||||
|
||||
// Corvax-Wega-PreCritical-start
|
||||
if (state == MobState.PreCritical)
|
||||
ApplyStutteringEffect(entity);
|
||||
else
|
||||
RemoveStutteringEffect(entity);
|
||||
// Corvax-Wega-PreCritical-end
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -116,6 +126,20 @@ public partial class MobStateSystem
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Corvax-Wega-PreCritical-start
|
||||
#region PreCritical Effect
|
||||
private void ApplyStutteringEffect(EntityUid target)
|
||||
{
|
||||
_stutteringSystem.DoStutter(target, TimeSpan.FromSeconds(5), refresh: true);
|
||||
}
|
||||
|
||||
private void RemoveStutteringEffect(EntityUid target)
|
||||
{
|
||||
_stutteringSystem.DoRemoveStutterTime(target, 5);
|
||||
}
|
||||
#endregion
|
||||
// Corvax-Wega-PreCritical-end
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -77,6 +77,11 @@ public partial class MobStateSystem
|
||||
case MobState.Alive:
|
||||
//unused
|
||||
break;
|
||||
// Corvax-Wega-PreCritical-start
|
||||
case MobState.PreCritical:
|
||||
//unused
|
||||
break;
|
||||
// Corvax-Wega-PreCritical-end
|
||||
case MobState.Critical:
|
||||
_standing.Stand(target);
|
||||
break;
|
||||
@@ -106,6 +111,12 @@ public partial class MobStateSystem
|
||||
_standing.Stand(target);
|
||||
_appearance.SetData(target, MobStateVisuals.State, MobState.Alive);
|
||||
break;
|
||||
// Corvax-Wega-PreCritical-start
|
||||
case MobState.PreCritical:
|
||||
_standing.Stand(target);
|
||||
_appearance.SetData(target, MobStateVisuals.State, MobState.Critical);
|
||||
break;
|
||||
// Corvax-Wega-PreCritical-end
|
||||
case MobState.Critical:
|
||||
_standing.Down(target);
|
||||
_appearance.SetData(target, MobStateVisuals.State, MobState.Critical);
|
||||
@@ -142,10 +153,14 @@ public partial class MobStateSystem
|
||||
private void OnGettingStripped(EntityUid target, MobStateComponent component, BeforeGettingStrippedEvent args)
|
||||
{
|
||||
// Incapacitated or dead targets get stripped two or three times as fast. Makes stripping corpses less tedious.
|
||||
// Corvax-Wega-PreCritical-change-start
|
||||
if (IsDead(target, component))
|
||||
args.Multiplier /= 3;
|
||||
args.Multiplier /= 4;
|
||||
else if (IsCritical(target, component))
|
||||
args.Multiplier /= 3;
|
||||
else if (IsPreCritical(target, component))
|
||||
args.Multiplier /= 2;
|
||||
// Corvax-Wega-PreCritical-change-end
|
||||
}
|
||||
|
||||
private void OnSpeakAttempt(EntityUid uid, MobStateComponent component, SpeakAttemptEvent args)
|
||||
|
||||
@@ -43,6 +43,15 @@ public partial class MobStateSystem : EntitySystem
|
||||
return component.CurrentState == MobState.Alive;
|
||||
}
|
||||
|
||||
// Corvax-Wega-PreCritical-start
|
||||
public bool IsPreCritical(EntityUid target, MobStateComponent? component = null)
|
||||
{
|
||||
if (!_mobStateQuery.Resolve(target, ref component, false))
|
||||
return false;
|
||||
return component.CurrentState == MobState.PreCritical;
|
||||
}
|
||||
// Corvax-Wega-PreCritical-end
|
||||
|
||||
/// <summary>
|
||||
/// Check if a Mob is Critical
|
||||
/// </summary>
|
||||
|
||||
@@ -89,7 +89,8 @@
|
||||
- type: MobThresholds
|
||||
thresholds:
|
||||
0: Alive
|
||||
100: Critical
|
||||
100: PreCritical # Corvax-Wega-PreCritical
|
||||
125: Critical # Corvax-Wega-PreCritical
|
||||
200: Dead
|
||||
- type: MobStateActions
|
||||
actions:
|
||||
|
||||
@@ -49,7 +49,8 @@
|
||||
- type: MobThresholds
|
||||
thresholds:
|
||||
0: Alive
|
||||
80: Critical
|
||||
80: PreCritical
|
||||
100: Critical
|
||||
160: Dead
|
||||
- type: Butcherable
|
||||
butcheringType: Spike
|
||||
|
||||
Reference in New Issue
Block a user