From dc261bc4d00827251643d10ded4e9d3f5109ac9f Mon Sep 17 00:00:00 2001 From: Coryn Date: Fri, 2 Jan 2026 20:00:58 +0100 Subject: [PATCH] Change how Minor Mass Mind Swap Cooldown starts/Fix Telegnosis (#5013) * Move Cooldown to the Event itself * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Move delay into variable within the component * Move Cooldown Method into an optional bit within MindSwapPowerSystem * Remove redundant using and dependency --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .../Psionics/Abilities/MindSwapPowerSystem.cs | 11 ++++++++++- .../Components/MinorMassMindSwapRuleComponent.cs | 3 +++ .../_DV/StationEvents/Events/MinorMassMindSwapRule.cs | 2 +- Resources/Prototypes/_DV/Actions/psionic.yml | 3 +-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Content.Server/Nyanotrasen/Abilities/Psionics/Abilities/MindSwapPowerSystem.cs b/Content.Server/Nyanotrasen/Abilities/Psionics/Abilities/MindSwapPowerSystem.cs index 3c911de3954..c7b76b20d7e 100644 --- a/Content.Server/Nyanotrasen/Abilities/Psionics/Abilities/MindSwapPowerSystem.cs +++ b/Content.Server/Nyanotrasen/Abilities/Psionics/Abilities/MindSwapPowerSystem.cs @@ -169,7 +169,7 @@ namespace Content.Server.Abilities.Psionics psionic.PsionicAbility = component.MindSwapReturnActionEntity; } - public void Swap(EntityUid performer, EntityUid target, bool end = false) + public void Swap(EntityUid performer, EntityUid target, bool end = false, int ReturnSwapCooldown = 0) { if (end && (!HasComp(performer) || !HasComp(target))) return; @@ -211,6 +211,15 @@ namespace Content.Server.Abilities.Psionics var perfComp = EnsureComp(performer); var targetComp = EnsureComp(target); + // Delta V - Cooldown for Returning back + if (ReturnSwapCooldown > 0) + { + var cooldown = TimeSpan.FromSeconds(ReturnSwapCooldown); + _actions.SetCooldown(perfComp.MindSwapReturnActionEntity, cooldown); + _actions.SetCooldown(targetComp.MindSwapReturnActionEntity, cooldown); + } + // Delta V + perfComp.OriginalEntity = target; targetComp.OriginalEntity = performer; } diff --git a/Content.Server/_DV/StationEvents/Components/MinorMassMindSwapRuleComponent.cs b/Content.Server/_DV/StationEvents/Components/MinorMassMindSwapRuleComponent.cs index 339c05f49c7..14da667a18b 100644 --- a/Content.Server/_DV/StationEvents/Components/MinorMassMindSwapRuleComponent.cs +++ b/Content.Server/_DV/StationEvents/Components/MinorMassMindSwapRuleComponent.cs @@ -16,6 +16,9 @@ public sealed partial class MinorMassMindSwapRuleComponent : Component [DataField] public TimeSpan Delay = TimeSpan.FromSeconds(60); + [DataField] + public int ReturnSwapCooldown = 120; + [DataField] public SoundSpecifier AnnouncementSound = new SoundPathSpecifier("/Audio/Misc/notice1.ogg"); diff --git a/Content.Server/_DV/StationEvents/Events/MinorMassMindSwapRule.cs b/Content.Server/_DV/StationEvents/Events/MinorMassMindSwapRule.cs index fe0761bc910..8f3d5785759 100644 --- a/Content.Server/_DV/StationEvents/Events/MinorMassMindSwapRule.cs +++ b/Content.Server/_DV/StationEvents/Events/MinorMassMindSwapRule.cs @@ -95,7 +95,7 @@ internal sealed class MinorMassMindSwapRule : StationEventSystem 120 + useDelay: 20 checkCanInteract: false - type: InstantAction event: !type:MindSwapPowerReturnActionEvent