Made Artifact EORG a server config (#18172)

* Added config and updated sala

* CE's suggestion.

* Fixed config

* greater than
This commit is contained in:
LankLTE
2023-07-21 01:49:10 -07:00
committed by GitHub
parent 3e7d3e98fe
commit fb53c14a54
3 changed files with 19 additions and 5 deletions

View File

@@ -10,6 +10,8 @@ using Content.Shared.Xenoarchaeology.XenoArtifacts;
using JetBrains.Annotations;
using Robust.Shared.Random;
using Robust.Shared.Timing;
using Robust.Shared.Configuration;
using Content.Shared.CCVar;
namespace Content.Server.Xenoarchaeology.XenoArtifacts;
@@ -18,6 +20,7 @@ public sealed partial class ArtifactSystem : EntitySystem
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
private ISawmill _sawmill = default!;
@@ -301,12 +304,16 @@ public sealed partial class ArtifactSystem : EntitySystem
/// </summary>
private void OnRoundEnd(RoundEndTextAppendEvent ev)
{
var query = EntityQueryEnumerator<ArtifactComponent>();
while (query.MoveNext(out var ent, out var artifactComp))
var RoundEndTimer = _configurationManager.GetCVar(CCVars.ArtifactRoundEndTimer);
if (RoundEndTimer > 0)
{
artifactComp.CooldownTime = TimeSpan.Zero;
var timerTrigger = EnsureComp<ArtifactTimerTriggerComponent>(ent);
timerTrigger.ActivationRate = TimeSpan.FromSeconds(0.5); //HAHAHAHAHAHAHAHAHAH -emo
var query = EntityQueryEnumerator<ArtifactComponent>();
while (query.MoveNext(out var ent, out var artifactComp))
{
artifactComp.CooldownTime = TimeSpan.Zero;
var timerTrigger = EnsureComp<ArtifactTimerTriggerComponent>(ent);
timerTrigger.ActivationRate = TimeSpan.FromSeconds(RoundEndTimer); //HAHAHAHAHAHAHAHAHAH -emo
}
}
}
}