Anomalies behaviours (#24683)

* Added new anomaly particle

* Add basic anomaly behaviour

* +2 parametres

* add functional to new particle

* add components to behaviours

* big content

* add shuffle, moved thing to server

* clean up

* fixes

* random pick redo

* bonjour behavioUr

* fix AJCM

* fix

* add some new behaviours

* power modifier behaviour

* rmeove timer

* new event for update ui fix

* refactor!

* fixes

* enum

* Fix mapinit

* Minor touches

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Ed
2024-04-01 11:29:13 +03:00
committed by GitHub
parent de8b788856
commit a4ec01d471
29 changed files with 832 additions and 91 deletions

View File

@@ -1,4 +1,5 @@
using System.Numerics;
using Content.Shared.Anomaly.Prototypes;
using Content.Shared.Damage;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
@@ -166,6 +167,12 @@ public sealed partial class AnomalyComponent : Component
[DataField]
public AnomalousParticleType WeakeningParticleType;
/// <summary>
/// The particle type that change anomaly behaviour.
/// </summary>
[DataField]
public AnomalousParticleType TransformationParticleType;
#region Points and Vessels
/// <summary>
/// The vessel that the anomaly is connceted to. Stored so that multiple
@@ -185,7 +192,7 @@ public sealed partial class AnomalyComponent : Component
/// This doesn't include the point bonus for being unstable.
/// </summary>
[DataField("maxPointsPerSecond")]
public int MaxPointsPerSecond = 80;
public int MaxPointsPerSecond = 70;
/// <summary>
/// The multiplier applied to the point value for the
@@ -221,6 +228,31 @@ public sealed partial class AnomalyComponent : Component
[DataField, ViewVariables(VVAccess.ReadWrite)]
public EntProtoId? CoreInertPrototype;
#region Behavior Deviations
[DataField]
public ProtoId<AnomalyBehaviorPrototype>? CurrentBehavior;
/// <summary>
/// Presumption of anomaly to change behavior. The higher the number, the higher the chance that the anomaly will change its behavior.
/// </summary>
[DataField]
public float Continuity = 0f;
/// <summary>
/// Minimum contituty probability chance, that can be selected by anomaly on MapInit
/// </summary>
[DataField]
public float MinContituty = 0.1f;
/// <summary>
/// Maximum contituty probability chance, that can be selected by anomaly on MapInit
/// </summary>
[DataField]
public float MaxContituty = 1.0f;
#endregion
#region Floating Animation
/// <summary>
/// How long it takes to go from the bottom of the animation to the top.
@@ -247,13 +279,13 @@ public sealed partial class AnomalyComponent : Component
/// <param name="Stability"></param>
/// <param name="Severity"></param>
[ByRefEvent]
public readonly record struct AnomalyPulseEvent(EntityUid Anomaly, float Stability, float Severity);
public readonly record struct AnomalyPulseEvent(EntityUid Anomaly, float Stability, float Severity, float PowerModifier);
/// <summary>
/// Event raised on an anomaly when it reaches a supercritical point.
/// </summary>
[ByRefEvent]
public readonly record struct AnomalySupercriticalEvent(EntityUid Anomaly);
public readonly record struct AnomalySupercriticalEvent(EntityUid Anomaly, float PowerModifier);
/// <summary>
/// Event broadcast after an anomaly goes supercritical
@@ -282,3 +314,9 @@ public readonly record struct AnomalyStabilityChangedEvent(EntityUid Anomaly, fl
/// <param name="Anomaly">The anomaly being changed</param>
[ByRefEvent]
public readonly record struct AnomalyHealthChangedEvent(EntityUid Anomaly, float Health);
/// <summary>
/// Event broadcast when an anomaly's behavior is changed.
/// </summary>
[ByRefEvent]
public readonly record struct AnomalyBehaviorChangedEvent(EntityUid Anomaly, ProtoId<AnomalyBehaviorPrototype>? Old, ProtoId<AnomalyBehaviorPrototype>? New);