Files
wwdpublic/Content.Server/StationEvents/Events/GlimmerEventSystem.cs
VMSolidus 08822e34ba Cherry-Pick Antag Refactor (#734)
This cherry-pick's Wizden's Antag Refactor, which is needed for all
future antag updates, as well as for me to cherry-pick over Cultists(Who
are going to need some editing to fit the antag refactor), Changelings,
Heretics, and Wizards. I actually selected the White-Dream-Public
version of the Antag Refactor, due to it having commits made tailored to
our repository, so it comes prepackaged with all the changes necessary
for our repo-specific content.

https://github.com/frosty-dev/ss14-wwdp/pull/10

Signed-off-by: Timemaster99 <57200767+Timemaster99@users.noreply.github.com>
Co-authored-by: ThereDrD <88589686+ThereDrD0@users.noreply.github.com>
Co-authored-by: Jeff <velcroboy333@hotmail.com>
Co-authored-by: Timemaster99 <57200767+Timemaster99@users.noreply.github.com>
Co-authored-by: Timemaster99 <elijahrobot@gmail.com>
Co-authored-by: luckywill339@gmail.com <luckywill339@gmail.com>
Co-authored-by: Danger Revolution! <142105406+DangerRevolution@users.noreply.github.com>
Co-authored-by: Azzy <azzydev@icloud.com>
2024-08-15 10:11:48 -07:00

36 lines
1.2 KiB
C#

using Content.Server.GameTicking.Components;
using Content.Server.GameTicking.Rules.Components;
using Content.Server.Psionics.Glimmer;
using Content.Shared.Psionics.Glimmer;
namespace Content.Server.StationEvents.Events
{
public sealed class GlimmerEventSystem : StationEventSystem<GlimmerEventComponent>
{
[Dependency] private readonly GlimmerSystem _glimmerSystem = default!;
protected override void Ended(EntityUid uid, GlimmerEventComponent component, GameRuleComponent gameRule, GameRuleEndedEvent args)
{
base.Ended(uid, component, gameRule, args);
var glimmerBurned = RobustRandom.Next(component.GlimmerBurnLower, component.GlimmerBurnUpper);
_glimmerSystem.Glimmer -= glimmerBurned;
var reportEv = new GlimmerEventEndedEvent(component.SophicReport, glimmerBurned);
RaiseLocalEvent(reportEv);
}
}
public sealed class GlimmerEventEndedEvent : EntityEventArgs
{
public string Message = "";
public int GlimmerBurned = 0;
public GlimmerEventEndedEvent(string message, int glimmerBurned)
{
Message = message;
GlimmerBurned = glimmerBurned;
}
}
}