From 3fdb3ea9cf8c60a4e4d0c7f324e3cc33a6898055 Mon Sep 17 00:00:00 2001 From: Charlie Morley Date: Wed, 26 Nov 2025 20:48:09 -0700 Subject: [PATCH] xenoarch: arti effect happens faster, for more fun danger (#4743) * xenoarch: arti effect happens faster, for more fun danger * minor review comments --- .../Artifact/Components/XenoArtifactComponent.cs | 8 ++++++++ .../Artifact/SharedXenoArtifactSystem.XAT.cs | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/Content.Shared/Xenoarchaeology/Artifact/Components/XenoArtifactComponent.cs b/Content.Shared/Xenoarchaeology/Artifact/Components/XenoArtifactComponent.cs index 0cd7e822b2..3cc7f45212 100644 --- a/Content.Shared/Xenoarchaeology/Artifact/Components/XenoArtifactComponent.cs +++ b/Content.Shared/Xenoarchaeology/Artifact/Components/XenoArtifactComponent.cs @@ -78,6 +78,14 @@ public sealed partial class XenoArtifactComponent : Component [DataField] public TimeSpan UnlockStateRefractory = TimeSpan.FromSeconds(5); + /// + /// DeltaV - If set, will overwrite the unlocking state time remaining as soon as a node is ready to unlock (triggers are met). + /// (why: letting the timer run out naturally makes artifacts less dangerous, since scientists have lots of time to run away) + /// If null, the unlock time will just run its course naturally. + /// + [DataField] + public TimeSpan? UnlockCompleteDuration = TimeSpan.FromSeconds(0.7); + /// /// When next unlock session can be triggered. /// diff --git a/Content.Shared/Xenoarchaeology/Artifact/SharedXenoArtifactSystem.XAT.cs b/Content.Shared/Xenoarchaeology/Artifact/SharedXenoArtifactSystem.XAT.cs index 1ef85db27f..f573ffd763 100644 --- a/Content.Shared/Xenoarchaeology/Artifact/SharedXenoArtifactSystem.XAT.cs +++ b/Content.Shared/Xenoarchaeology/Artifact/SharedXenoArtifactSystem.XAT.cs @@ -90,6 +90,16 @@ public abstract partial class SharedXenoArtifactSystem if (node != null && unlockingComp.TriggeredNodeIndexes.Add(GetIndex(ent, node.Value))) { + // DeltaV - start of faster unlock effect + if ( + ent.Comp.UnlockCompleteDuration is {} completeDuration + && TryGetNodeFromUnlockState((ent.Owner, unlockingComp, ent.Comp), out var unlockingNode) + ) + { + unlockingComp.EndTime = _timing.CurTime + completeDuration; + } + // DeltaV - end of faster unlock effect + Dirty(ent, unlockingComp); } }