Anomalous infections (#31876)

* inner anomaly

* anomaly pulse action

* test anom mine

* Update anomalies.yml

* fix action cooldown

* pyro_eyes

* clientsystem

* experiments

* blya

* some telegraphy

* shock eyes!

* shadow eyes

* separate files

* frosty eyes

* fix

* flora eyes

* bluespace eyes

* flesh eyes

* redoing injction

* auto add layers

* пипяу

* new injector component

* stupid me

* nice marker injectors

* anomaly spawn on shutdown

* gravity anom

* dead anomaly spawning

* add VOX states

* sprite specific layers support

* technology anom infection

* auto detach anomalies that have moved away

* Update anomaly_injections.yml

* anomalyspawner integration

* rock anomaly!

* Update anomaly_injections.yml

* fix crash bug

* tag filter

* fix anom dublication spawns

* Update anomaly.yml

* Update InnerBodyAnomalyComponent.cs

* Update anomaly_injections.yml

* dont spawn anomalies after decay

* fix morb sprite, add end message

* gravity resprite

* admin logging, double injection fix

* make flesh and living light mobs friendly to anomaly hosts

* popups

* severity feedback

* sloth review

* A

* keep organs after gib

* punpun host

* sloth synchronization

* Update arachnid.yml

* increase infections spawnrate
This commit is contained in:
Ed
2024-09-17 12:49:19 +03:00
committed by GitHub
parent 5eaac00432
commit 92be69a5ab
49 changed files with 1859 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
using System.Numerics;
using Content.Shared.Anomaly.Effects;
using Content.Shared.Anomaly.Prototypes;
using Content.Shared.Damage;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
@@ -16,7 +16,7 @@ namespace Content.Shared.Anomaly.Components;
/// Anomalies and their related components were designed here: https://hackmd.io/@ss14-design/r1sQbkJOs
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
[Access(typeof(SharedAnomalySystem))]
[Access(typeof(SharedAnomalySystem), typeof(SharedInnerBodyAnomalySystem))]
public sealed partial class AnomalyComponent : Component
{
/// <summary>
@@ -184,21 +184,21 @@ public sealed partial class AnomalyComponent : Component
/// <summary>
/// The minimum amount of research points generated per second
/// </summary>
[DataField("minPointsPerSecond")]
[DataField]
public int MinPointsPerSecond = 10;
/// <summary>
/// The maximum amount of research points generated per second
/// This doesn't include the point bonus for being unstable.
/// </summary>
[DataField("maxPointsPerSecond")]
[DataField]
public int MaxPointsPerSecond = 70;
/// <summary>
/// The multiplier applied to the point value for the
/// anomaly being above the <see cref="GrowthThreshold"/>
/// </summary>
[DataField("growingPointMultiplier")]
[DataField]
public float GrowingPointMultiplier = 1.5f;
#endregion
@@ -252,10 +252,13 @@ public sealed partial class AnomalyComponent : Component
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("offset")]
public Vector2 FloatingOffset = new(0, 0.15f);
public Vector2 FloatingOffset = new(0, 0);
public readonly string AnimationKey = "anomalyfloat";
#endregion
[DataField]
public bool DeleteEntity = true;
}
/// <summary>

View File

@@ -0,0 +1,72 @@
using Content.Shared.Anomaly.Effects;
using Content.Shared.Body.Prototypes;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
namespace Content.Shared.Anomaly.Components;
/// <summary>
/// An anomaly within the body of a living being. Controls the ability to return to the standard state.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true), Access(typeof(SharedInnerBodyAnomalySystem))]
public sealed partial class InnerBodyAnomalyComponent : Component
{
[DataField]
public bool Injected;
/// <summary>
/// A prototype of an entity whose components will be added to the anomaly host **AND** then removed at the right time
/// </summary>
[DataField(required: true)]
public EntProtoId? InjectionProto;
/// <summary>
/// Duration of stun from the effect of the anomaly
/// </summary>
[DataField]
public float StunDuration = 4f;
/// <summary>
/// A message sent in chat to a player who has become infected by an anomaly
/// </summary>
[DataField]
public LocId? StartMessage = null;
/// <summary>
/// A message sent in chat to a player who has cleared an anomaly
/// </summary>
[DataField]
public LocId? EndMessage = "inner-anomaly-end-message";
/// <summary>
/// Sound, playing on becoming anomaly
/// </summary>
[DataField]
public SoundSpecifier? StartSound = new SoundPathSpecifier("/Audio/Effects/inneranomaly.ogg");
/// <summary>
/// Used to display messages to the player about their level of disease progression
/// </summary>
[DataField]
public float LastSeverityInformed = 0f;
/// <summary>
/// The fallback sprite to be added on the original entity. Allows you to visually identify the feature and type of anomaly to other players
/// </summary>
[DataField, AutoNetworkedField]
public SpriteSpecifier? FallbackSprite = null;
/// <summary>
/// Ability to use unique sprites for different body types
/// </summary>
[DataField, AutoNetworkedField]
public Dictionary<ProtoId<BodyPrototype>, SpriteSpecifier> SpeciesSprites = new();
/// <summary>
/// The key of the entity layer into which the sprite will be inserted
/// </summary>
[DataField]
public string LayerMap = "inner_anomaly_layer";
}

View File

@@ -0,0 +1,21 @@
using Content.Shared.Anomaly.Effects;
using Content.Shared.Whitelist;
using Robust.Shared.Prototypes;
namespace Content.Shared.Anomaly.Components;
/// <summary>
/// On contact with an entity, if it meets the conditions, it will transfer the specified components to it
/// </summary>
[RegisterComponent, Access(typeof(SharedInnerBodyAnomalySystem))]
public sealed partial class InnerBodyAnomalyInjectorComponent : Component
{
[DataField]
public EntityWhitelist? Whitelist;
/// <summary>
/// components that will be automatically removed after “curing”
/// </summary>
[DataField(required: true)]
public ComponentRegistry InjectionComponents = default!;
}

View File

@@ -0,0 +1,5 @@
namespace Content.Shared.Anomaly.Effects;
public abstract class SharedInnerBodyAnomalySystem : EntitySystem
{
}

View File

@@ -1,13 +1,10 @@
using Content.Shared.Administration.Logs;
using Content.Shared.Anomaly.Components;
using Content.Shared.Anomaly.Prototypes;
using Content.Shared.Damage;
using Content.Shared.Database;
using Content.Shared.Interaction;
using Content.Shared.Physics;
using Content.Shared.Popups;
using Content.Shared.Weapons.Melee.Components;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
@@ -21,6 +18,7 @@ using Robust.Shared.Timing;
using Robust.Shared.Utility;
using System.Linq;
using System.Numerics;
using Content.Shared.Actions;
namespace Content.Shared.Anomaly;
@@ -36,6 +34,7 @@ public abstract class SharedAnomalySystem : EntitySystem
[Dependency] protected readonly SharedPopupSystem Popup = default!;
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
public override void Initialize()
{
@@ -145,7 +144,7 @@ public abstract class SharedAnomalySystem : EntitySystem
if (!Timing.IsFirstTimePredicted)
return;
Audio.PlayPvs(component.SupercriticalSound, uid);
Audio.PlayPvs(component.SupercriticalSound, Transform(uid).Coordinates);
if (_net.IsServer)
Log.Info($"Raising supercritical event. Entity: {ToPrettyString(uid)}");
@@ -169,7 +168,8 @@ public abstract class SharedAnomalySystem : EntitySystem
/// <param name="uid">The anomaly being shut down</param>
/// <param name="component"></param>
/// <param name="supercritical">Whether or not the anomaly ended via supercritical event</param>
public void EndAnomaly(EntityUid uid, AnomalyComponent? component = null, bool supercritical = false)
/// <param name="spawnCore">Create anomaly cores based on the result of completing an anomaly?</param>
public void EndAnomaly(EntityUid uid, AnomalyComponent? component = null, bool supercritical = false, bool spawnCore = true)
{
// Logging before resolve, in case the anomaly has deleted itself.
if (_net.IsServer)
@@ -186,9 +186,14 @@ public abstract class SharedAnomalySystem : EntitySystem
if (Terminating(uid) || _net.IsClient)
return;
Spawn(supercritical ? component.CorePrototype : component.CoreInertPrototype, Transform(uid).Coordinates);
if (spawnCore)
{
var core = Spawn(supercritical ? component.CorePrototype : component.CoreInertPrototype, Transform(uid).Coordinates);
_transform.PlaceNextTo(core, uid);
}
QueueDel(uid);
if (component.DeleteEntity)
QueueDel(uid);
}
/// <summary>
@@ -458,3 +463,5 @@ public partial record struct AnomalySpawnSettings()
/// </summary>
public bool SpawnOnSeverityChanged { get; set; } = false;
}
public sealed partial class ActionAnomalyPulseEvent : InstantActionEvent { }