mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-29 23:57:29 +00:00
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:
co-authored by
pre-commit-ci[bot]
parent
4223bae8aa
commit
dc261bc4d0
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user