This commit is contained in:
TemporalOroboros
2023-06-28 05:02:06 -07:00
committed by GitHub
parent 638026878e
commit d9de405859
35 changed files with 965 additions and 1005 deletions

View File

@@ -0,0 +1,81 @@
using Content.Server.Ame.EntitySystems;
using Content.Shared.Ame;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
namespace Content.Server.Ame.Components;
/// <summary>
/// The component used to make an entity the controller/fuel injector port of an AntiMatter Engine.
/// Connects to adjacent entities with this component or <see cref="AmeShieldComponent"/> to make an AME.
/// </summary>
[Access(typeof(AmeControllerSystem), typeof(AmeNodeGroup))]
[RegisterComponent]
public sealed class AmeControllerComponent : SharedAmeControllerComponent
{
/// <summary>
/// The id of the container used to store the current fuel container for the AME.
/// </summary>
public const string FuelContainerId = "AmeFuel";
/// <summary>
/// The container for the fuel canisters used by the AME.
/// </summary>
[ViewVariables]
public ContainerSlot JarSlot = default!;
/// <summary>
/// Whether or not the AME controller is currently injecting animatter into the reactor.
/// </summary>
[DataField("injecting")]
[ViewVariables(VVAccess.ReadWrite)]
public bool Injecting = false;
/// <summary>
/// How much antimatter the AME controller is set to inject into the reactor per update.
/// </summary>
[DataField("injectionAmount")]
[ViewVariables(VVAccess.ReadWrite)]
public int InjectionAmount = 2;
/// <summary>
/// How stable the reactor currently is.
/// When this falls to <= 0 the reactor explodes.
/// </summary>
[DataField("stability")]
[ViewVariables(VVAccess.ReadWrite)]
public int Stability = 100;
/// <summary>
/// The sound used when pressing buttons in the UI.
/// </summary>
[DataField("clickSound")]
[ViewVariables(VVAccess.ReadWrite)]
public SoundSpecifier ClickSound = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg");
/// <summary>
/// The sound used when injecting antimatter into the AME.
/// </summary>
[DataField("injectSound")]
[ViewVariables(VVAccess.ReadWrite)]
public SoundSpecifier InjectSound = new SoundPathSpecifier("/Audio/Effects/bang.ogg");
/// <summary>
/// The last time this could have injected fuel into the AME.
/// </summary>
[DataField("lastUpdate")]
public TimeSpan LastUpdate = default!;
/// <summary>
/// The next time this will try to inject fuel into the AME.
/// </summary>
[DataField("nextUpdate")]
public TimeSpan NextUpdate = default!;
/// <summary>
/// The the amount of time that passes between injection attempts.
/// </summary>
[DataField("updatePeriod")]
[ViewVariables(VVAccess.ReadWrite)]
public TimeSpan UpdatePeriod = TimeSpan.FromSeconds(10.0);
}

View File

@@ -0,0 +1,23 @@
namespace Content.Server.Ame.Components;
/// <summary>
/// An antimatter containment cell used to handle the fuel for the AME.
/// TODO: network and put in shared
/// </summary>
[RegisterComponent]
public sealed class AmeFuelContainerComponent : Component
{
/// <summary>
/// The amount of fuel in the jar.
/// </summary>
[DataField("fuelAmount")]
[ViewVariables(VVAccess.ReadWrite)]
public int FuelAmount = 1000;
/// <summary>
/// The maximum fuel capacity of the jar.
/// </summary>
[DataField("fuelCapacity")]
[ViewVariables(VVAccess.ReadWrite)]
public int FuelCapacity = 1000;
}

View File

@@ -0,0 +1,24 @@
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Ame.Components;
/// <summary>
/// Packaged AME machinery that can be deployed to construct an AME.
/// </summary>
[RegisterComponent]
public sealed class AmePartComponent : Component
{
/// <summary>
/// The sound played when the AME shielding is unpacked.
/// </summary>
[DataField("unwrapSound")]
public SoundSpecifier UnwrapSound = new SoundPathSpecifier("/Audio/Effects/unwrap.ogg");
/// <summary>
/// The tool quality required to deploy the packaged AME shielding.
/// </summary>
[DataField("qualityNeeded", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string QualityNeeded = "Pulsing";
}

View File

@@ -0,0 +1,26 @@
using Content.Server.Ame.EntitySystems;
using Content.Shared.Ame;
namespace Content.Server.Ame.Components;
/// <summary>
/// The component used to make an entity part of the bulk machinery of an AntiMatter Engine.
/// Connects to adjacent entities with this component or <see cref="AmeControllerComponent"/> to make an AME.
/// </summary>
[Access(typeof(AmeShieldingSystem), typeof(AmeNodeGroup))]
[RegisterComponent]
public sealed class AmeShieldComponent : SharedAmeShieldComponent
{
/// <summary>
/// Whether or not this AME shield counts as a core for the AME or not.
/// </summary>
[ViewVariables]
public bool IsCore = false;
/// <summary>
/// The current integrity of the AME shield.
/// </summary>
[DataField("integrity")]
[ViewVariables]
public int CoreIntegrity = 100;
}