This commit is contained in:
Nemanja
2023-01-17 00:05:20 -05:00
committed by GitHub
parent 06f19dafc9
commit 9cd0c11870
85 changed files with 3109 additions and 54 deletions

View File

@@ -0,0 +1,23 @@
using Content.Shared.Anomaly;
namespace Content.Server.Anomaly.Components;
/// <summary>
/// This is used for projectiles which affect anomalies through colliding with them.
/// </summary>
[RegisterComponent]
public sealed class AnomalousParticleComponent : Component
{
/// <summary>
/// The type of particle that the projectile
/// imbues onto the anomaly on contact.
/// </summary>
[DataField("particleType", required: true)]
public AnomalousParticleType ParticleType;
/// <summary>
/// The fixture that's checked on collision.
/// </summary>
[DataField("fixtureId")]
public string FixtureId = "projectile";
}

View File

@@ -0,0 +1,44 @@
using Content.Shared.Materials;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Anomaly.Components;
/// <summary>
/// This is used for a machine that is able to generate
/// anomalies randomly on the station.
/// </summary>
[RegisterComponent]
public sealed class AnomalyGeneratorComponent : Component
{
/// <summary>
/// The time at which the cooldown for generating another anomaly will be over
/// </summary>
[DataField("cooldownEndTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
public TimeSpan CooldownEndTime = TimeSpan.Zero;
/// <summary>
/// The cooldown between generating anomalies.
/// </summary>
[DataField("cooldownLength"), ViewVariables(VVAccess.ReadWrite)]
public TimeSpan CooldownLength = TimeSpan.FromMinutes(5);
/// <summary>
/// The material needed to generate an anomaly
/// </summary>
[DataField("requiredMaterial", customTypeSerializer: typeof(PrototypeIdSerializer<MaterialPrototype>)), ViewVariables(VVAccess.ReadWrite)]
public string RequiredMaterial = "Plasma";
/// <summary>
/// The amount of material needed to generate a single anomaly
/// </summary>
[DataField("materialPerAnomaly"), ViewVariables(VVAccess.ReadWrite)]
public int MaterialPerAnomaly = 1500; // a bit less than a stack of plasma
/// <summary>
/// The random anomaly spawner entity
/// </summary>
[DataField("spawnerPrototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>)), ViewVariables(VVAccess.ReadWrite)]
public string SpawnerPrototype = "RandomAnomalySpawner";
}

View File

@@ -0,0 +1,49 @@
using System.Threading;
using Robust.Shared.Audio;
namespace Content.Server.Anomaly.Components;
/// <summary>
/// This is used for scanning anomalies and
/// displaying information about them in the ui
/// </summary>
[RegisterComponent]
public sealed class AnomalyScannerComponent : Component
{
/// <summary>
/// The anomaly that was last scanned by this scanner.
/// </summary>
[ViewVariables]
public EntityUid? ScannedAnomaly;
/// <summary>
/// How long the scan takes
/// </summary>
[DataField("scanDoAfterDuration")]
public float ScanDoAfterDuration = 5;
public CancellationTokenSource? TokenSource;
/// <summary>
/// The sound plays when the scan finished
/// </summary>
[DataField("completeSound")]
public SoundSpecifier? CompleteSound = new SoundPathSpecifier("/Audio/Items/beep.ogg");
}
public sealed class AnomalyScanFinishedEvent : EntityEventArgs
{
public EntityUid Anomaly;
public EntityUid User;
public AnomalyScanFinishedEvent(EntityUid anomaly, EntityUid user)
{
Anomaly = anomaly;
User = user;
}
}
public sealed class AnomalyScanCancelledEvent : EntityEventArgs
{
}

View File

@@ -0,0 +1,40 @@
using Content.Shared.Construction.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Anomaly.Components;
/// <summary>
/// Anomaly Vessels can have an anomaly "stored" in them
/// by interacting on them with an anomaly scanner. Then,
/// they generate points for the selected server based on
/// the anomaly's stability and severity.
/// </summary>
[RegisterComponent]
public sealed class AnomalyVesselComponent : Component
{
/// <summary>
/// The anomaly that the vessel is storing.
/// Can be null.
/// </summary>
[ViewVariables]
public EntityUid? Anomaly;
/// <summary>
/// A multiplier applied to the amount of points generated.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float PointMultiplier = 1;
/// <summary>
/// The machine part that affects the point multiplier of the vessel
/// </summary>
[DataField("machinePartPointModifier", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartPointModifier = "ScanningModule";
/// <summary>
/// A value used to scale the point multiplier
/// with the corresponding part rating.
/// </summary>
[DataField("partRatingPointModifier")]
public float PartRatingPointModifier = 1.5f;
}