Made Artifact EORG a server config (#18172)
* Added config and updated sala * CE's suggestion. * Fixed config * greater than
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,6 +306,12 @@ namespace Content.Shared.CCVar
|
||||
public static readonly CVarDef<int> GameAlertLevelChangeDelay =
|
||||
CVarDef.Create("game.alert_level_change_delay", 30, CVar.SERVERONLY);
|
||||
|
||||
/// <summary>
|
||||
/// How many times per second artifacts when the round is over.
|
||||
/// If set to 0, they won't activate (on a timer) when the round ends.
|
||||
/// </summary>
|
||||
public static readonly CVarDef<float> ArtifactRoundEndTimer = CVarDef.Create("game.artifact_round_end_timer", 0.5f, CVar.NOTIFY | CVar.REPLICATED);
|
||||
|
||||
/*
|
||||
* Discord
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
[game]
|
||||
desc = "Official English Space Station 14 servers. Roleplay required, you must be whitelisted through Discord to play if there are more than 15 online players."
|
||||
hostname = "[EN] Wizard's Den Salamander [US West RP]"
|
||||
artifact_round_end_timer = 0.0
|
||||
|
||||
[server]
|
||||
rules_file = "RP_Rules.txt"
|
||||
|
||||
Reference in New Issue
Block a user