xenoarch: arti effect happens faster, for more fun danger (#4743)

* xenoarch: arti effect happens faster, for more fun danger

* minor review comments
This commit is contained in:
Charlie Morley 2025-11-26 20:48:09 -07:00 committed by GitHub
parent 062e414b04
commit 3fdb3ea9cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View File

@ -78,6 +78,14 @@ public sealed partial class XenoArtifactComponent : Component
[DataField]
public TimeSpan UnlockStateRefractory = TimeSpan.FromSeconds(5);
/// <summary>
/// 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.
/// </summary>
[DataField]
public TimeSpan? UnlockCompleteDuration = TimeSpan.FromSeconds(0.7);
/// <summary>
/// When next unlock session can be triggered.
/// </summary>

View File

@ -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);
}
}