mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-17 22:31:00 +03:00
* Admin log silicon laws * Remove duplicate IonStorm lawchange logging and other stuff ig * Update SharedSiliconLawSystem.cs * Update IonStormSystem.cs * Update SiliconLawSystem.cs * Maybe I shouldve just used an IDE from the start
37 lines
1.4 KiB
C#
37 lines
1.4 KiB
C#
using Content.Shared.Silicons.Laws.Components;
|
|
using Content.Shared.Administration.Logs;
|
|
using Content.Shared.Database;
|
|
|
|
namespace Content.Server.Silicons.Laws;
|
|
|
|
/// <summary>
|
|
/// This handles running the ion storm event a on specific entity when that entity is spawned in.
|
|
/// </summary>
|
|
public sealed partial class StartIonStormedSystem : EntitySystem
|
|
{
|
|
[Dependency] private IonStormSystem _ionStorm = default!;
|
|
[Dependency] private ISharedAdminLogManager _adminLogger = default!;
|
|
[Dependency] private SiliconLawSystem _siliconLaw = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
SubscribeLocalEvent<StartIonStormedComponent, MapInitEvent>(OnMapInit);
|
|
}
|
|
|
|
private void OnMapInit(Entity<StartIonStormedComponent> ent, ref MapInitEvent args)
|
|
{
|
|
if (!TryComp<SiliconLawBoundComponent>(ent.Owner, out var lawBound))
|
|
return;
|
|
if (!TryComp<IonStormTargetComponent>(ent.Owner, out var target))
|
|
return;
|
|
|
|
for (int currentIonStorm = 0; currentIonStorm < ent.Comp.IonStormAmount; currentIonStorm++)
|
|
{
|
|
_ionStorm.IonStormTarget((ent.Owner, lawBound, target));
|
|
}
|
|
|
|
var laws = _siliconLaw.GetLaws(ent.Owner, lawBound);
|
|
_adminLogger.Add(LogType.Mind, LogImpact.High, $"{ToPrettyString(ent.Owner):silicon} spawned with ion stormed laws: {laws.LoggingString()}");
|
|
}
|
|
}
|