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>
This commit is contained in:
Coryn
2026-01-02 13:00:58 -06:00
committed by GitHub
co-authored by pre-commit-ci[bot]
parent 4223bae8aa
commit dc261bc4d0
4 changed files with 15 additions and 4 deletions
@@ -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<MindSwappedComponent>(performer) || !HasComp<MindSwappedComponent>(target)))
return;
@@ -211,6 +211,15 @@ namespace Content.Server.Abilities.Psionics
var perfComp = EnsureComp<MindSwappedComponent>(performer);
var targetComp = EnsureComp<MindSwappedComponent>(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;
}
@@ -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");
@@ -95,7 +95,7 @@ internal sealed class MinorMassMindSwapRule : StationEventSystem<MinorMassMindSw
var target01 = _random.PickAndTake(psionicActors);
var target02 = _random.PickAndTake(psionicActors);
_mindSwap.Swap(target01, target02);
_mindSwap.Swap(target01, target02, false, component.ReturnSwapCooldown);
if (!component.IsTemporary)
{
+1 -2
View File
@@ -68,8 +68,7 @@
icon:
sprite: _DV/Interface/Actions/actions_psionics.rsi
state: mind_swap_return
startDelay: true # Delta V - Start Delay after Mind Swap
useDelay: 120 # Delta V - 20 => 120
useDelay: 20
checkCanInteract: false
- type: InstantAction
event: !type:MindSwapPowerReturnActionEvent