* Station event system Adds 2 basic events: (Power) GridCheck and RadiationStorm (based on the goonstation version). The system itself to choose events is based on tgstation's implementation. This also adds the event command that can be run to force specific events. There's still some other TODO items for these to be complete, to my knowledge: 1. There's no worldspace DrawCircle method (though the radstorm could look a lot nicer with a shader). 2. The PlayGlobal power_off / power_on audio seems to cut out halfway-through 3. (I think this is a known issue) lights still emit light until you get closer in a gridcheck so PVS range might need bumping. * Invariants for event names * Fix random event shutdown * Mix stereo announcements to mono * Address feedback * Remove redundant client system and use the overlay component instead * Drop the server prefix * Fix radiation overlay enum * use entityquery instead * zum's feedback * Use EntityQuery Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using System;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared.GameObjects.Components
|
|
{
|
|
public abstract class SharedRadiationPulseComponent : Component
|
|
{
|
|
public override string Name => "RadiationPulse";
|
|
public override uint? NetID => ContentNetIDs.RADIATION_PULSE;
|
|
|
|
/// <summary>
|
|
/// Radius of the pulse from its position
|
|
/// </summary>
|
|
public float Range => _range;
|
|
private float _range;
|
|
|
|
public override void ExposeData(ObjectSerializer serializer)
|
|
{
|
|
base.ExposeData(serializer);
|
|
serializer.DataField(ref _range, "range", 5.0f);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// For syncing the pulse's lifespan between client and server for the overlay
|
|
/// </summary>
|
|
[Serializable, NetSerializable]
|
|
public sealed class RadiationPulseMessage : ComponentState
|
|
{
|
|
public TimeSpan EndTime { get; }
|
|
|
|
public RadiationPulseMessage(TimeSpan endTime) : base(ContentNetIDs.RADIATION_PULSE)
|
|
{
|
|
EndTime = endTime;
|
|
}
|
|
}
|
|
} |