* APC construction and deconstruction Construction action GivePrototype * APC needs screwing + sprites * apc framework, working construction recipe * Energy swords hot * APC changes * APC construction/deconstruction * removed comments * Revert "Energy swords hot" This reverts commit 75228483abb3cc6252118b319bc8949d5198362d. * Renamed function for clarity * Fixed the last step not showing in the construction menu * Some fixes * Update Content.Server/Power/EntitySystems/ApcSystem.cs Co-authored-by: Jacob Tong <10494922+ShadowCommander@users.noreply.github.com> * Update Content.Server/Construction/Completions/GivePrototype.cs Co-authored-by: Jacob Tong <10494922+ShadowCommander@users.noreply.github.com> * Update Resources/Prototypes/Entities/Structures/Power/apc.yml Co-authored-by: Jacob Tong <10494922+ShadowCommander@users.noreply.github.com> * Update Resources/Prototypes/Entities/Structures/Power/apc.yml Co-authored-by: Jacob Tong <10494922+ShadowCommander@users.noreply.github.com> * Update Content.Server/Power/Components/ApcElectronicsComponent.cs Co-authored-by: Jacob Tong <10494922+ShadowCommander@users.noreply.github.com> * Update Content.Client/Power/APC/ApcVisualizer.cs Co-authored-by: Jacob Tong <10494922+ShadowCommander@users.noreply.github.com> Co-authored-by: CommieFlowers <rasmus.cedergren@hotmail.com> Co-authored-by: Jacob Tong <10494922+ShadowCommander@users.noreply.github.com>
55 lines
1.5 KiB
C#
55 lines
1.5 KiB
C#
using Content.Server.Power.EntitySystems;
|
|
using Content.Server.Power.NodeGroups;
|
|
using Content.Shared.APC;
|
|
using Robust.Shared.Audio;
|
|
|
|
namespace Content.Server.Power.Components;
|
|
|
|
[RegisterComponent]
|
|
public sealed class ApcComponent : BaseApcNetComponent
|
|
{
|
|
[DataField("onReceiveMessageSound")]
|
|
public SoundSpecifier OnReceiveMessageSound = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg");
|
|
|
|
[ViewVariables]
|
|
public ApcChargeState LastChargeState;
|
|
public TimeSpan LastChargeStateTime;
|
|
|
|
/// <summary>
|
|
/// Is the panel open for this entity's APC?
|
|
/// </summary>
|
|
[ViewVariables]
|
|
[DataField("open")]
|
|
public bool IsApcOpen { get; set; }
|
|
|
|
[ViewVariables]
|
|
public ApcExternalPowerState LastExternalState;
|
|
public TimeSpan LastUiUpdate;
|
|
|
|
[ViewVariables]
|
|
public bool MainBreakerEnabled = true;
|
|
|
|
public bool Emagged = false;
|
|
|
|
public const float HighPowerThreshold = 0.9f;
|
|
public static TimeSpan VisualsChangeDelay = TimeSpan.FromSeconds(1);
|
|
|
|
// TODO ECS power a little better!
|
|
protected override void AddSelfToNet(IApcNet apcNet)
|
|
{
|
|
apcNet.AddApc(this);
|
|
}
|
|
|
|
protected override void RemoveSelfFromNet(IApcNet apcNet)
|
|
{
|
|
apcNet.RemoveApc(this);
|
|
}
|
|
|
|
[DataField("screwdriverOpenSound")]
|
|
public SoundSpecifier ScrewdriverOpenSound = new SoundPathSpecifier("/Audio/Machines/screwdriveropen.ogg");
|
|
|
|
[DataField("screwdriverCloseSound")]
|
|
public SoundSpecifier ScrewdriverCloseSound = new SoundPathSpecifier("/Audio/Machines/screwdriverclose.ogg");
|
|
|
|
}
|