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:
parent
062e414b04
commit
3fdb3ea9cf
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue