From d177127b99c12c4d2d4904f67f1c253d211ac44a Mon Sep 17 00:00:00 2001 From: CaypenNow <66198468+CaypenNow@users.noreply.github.com> Date: Sun, 24 Mar 2024 18:03:56 +0500 Subject: [PATCH 1/3] =?UTF-8?q?=D0=A5=D0=BE=D1=82=D1=84=D0=B8=D0=BA=D1=81?= =?UTF-8?q?=20(#242)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * hotfix * fix --- .../MovespeedModifierMetabolismComponent.cs | 6 ++++- .../_White/Chemistry/NarcoticEffect.cs | 25 ++++++++----------- .../Chemistry/NarcoticEffectComponent.cs | 5 +--- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/Content.Shared/Chemistry/Components/MovespeedModifierMetabolismComponent.cs b/Content.Shared/Chemistry/Components/MovespeedModifierMetabolismComponent.cs index 62127ab533..2c9a98b208 100644 --- a/Content.Shared/Chemistry/Components/MovespeedModifierMetabolismComponent.cs +++ b/Content.Shared/Chemistry/Components/MovespeedModifierMetabolismComponent.cs @@ -1,3 +1,4 @@ +using System.Threading; using Robust.Shared.GameStates; namespace Content.Shared.Chemistry.Components @@ -6,6 +7,9 @@ namespace Content.Shared.Chemistry.Components [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] public sealed partial class MovespeedModifierMetabolismComponent : Component { + [ViewVariables, DataField] + public CancellationTokenSource CancelTokenSource = new(); + [AutoNetworkedField, ViewVariables] public float WalkSpeedModifier { get; set; } @@ -15,7 +19,7 @@ namespace Content.Shared.Chemistry.Components /// /// When the current modifier is expected to end. /// - [AutoNetworkedField, ViewVariables] + [AutoNetworkedField, ViewVariables] // WD EDIT public TimeSpan ModifierTimer { get; set; } = TimeSpan.Zero; } } diff --git a/Content.Shared/_White/Chemistry/NarcoticEffect.cs b/Content.Shared/_White/Chemistry/NarcoticEffect.cs index bb98352db7..6af9301b16 100644 --- a/Content.Shared/_White/Chemistry/NarcoticEffect.cs +++ b/Content.Shared/_White/Chemistry/NarcoticEffect.cs @@ -23,7 +23,7 @@ public sealed class NarcoticEffect : EntitySystem base.Initialize(); SubscribeLocalEvent(OnInit); - SubscribeLocalEvent(OnRemove); + SubscribeLocalEvent(OnRemove); } private void OnInit(EntityUid uid, NarcoticEffectComponent component, ComponentInit args) @@ -33,34 +33,29 @@ public sealed class NarcoticEffect : EntitySystem Effects(uid, component, index); } - private void OnRemove(EntityUid uid, NarcoticEffectComponent component, ComponentRemove args) + private void OnRemove(EntityUid uid, MovespeedModifierMetabolismComponent component, ComponentRemove args) { - if (TryComp(uid, out var movespeedModifierComponent)) - { - if (movespeedModifierComponent.ModifierTimer != TimeSpan.Zero) - Timer.Spawn(movespeedModifierComponent.ModifierTimer, () => component.CancelTokenSource.Cancel()); - return; - } component.CancelTokenSource.Cancel(); } private void Effects(EntityUid uid, NarcoticEffectComponent component, int index) { - if(!TryComp(uid, out var standingComp)) + if(!TryComp(uid, out var standingComp) || !TryComp(uid, out var movespeedModifierComponent)) return; - RaiseLocalEvent(uid, new MoodEffectEvent("Stimulator")); - CancellationToken token = component.CancelTokenSource.Token; - TryComp(uid, out var statusEffectsComp); + RaiseLocalEvent(uid, new MoodEffectEvent("Stimulator")); + CancellationToken token = movespeedModifierComponent.CancelTokenSource.Token; + + int timer = component.TimerInterval[_robustRandom.Next(0, component.TimerInterval.Count)]; int slur = component.SlurTime[_robustRandom.Next(0, component.SlurTime.Count)]; switch (Enum.GetValues(typeof(NarcoticEffects)).GetValue(index)) { case NarcoticEffects.TremorAndShake when _statusEffectsSystem.HasStatusEffect(uid, "Drunk", statusEffectsComp): - Timer.SpawnRepeating(timer, () => _stamina.TakeStaminaDamage(uid, 15F), token); + Timer.SpawnRepeating(timer, () => _stamina.TakeStaminaDamage(uid, 25F), token); _statusEffectsSystem.TryAddTime(uid, "Drunk", TimeSpan.FromSeconds(slur), statusEffectsComp); break; @@ -78,12 +73,12 @@ public sealed class NarcoticEffect : EntitySystem break; case NarcoticEffects.TremorAndShake: - Timer.SpawnRepeating(timer, () => _stamina.TakeStaminaDamage(uid, 15F), token); + Timer.SpawnRepeating(timer, () => _stamina.TakeStaminaDamage(uid, 25F), token); _statusEffectsSystem.TryAddStatusEffect(uid, "Drunk", TimeSpan.FromSeconds(slur), true, statusEffectsComp); break; case NarcoticEffects.Tremor: - Timer.SpawnRepeating(timer, () => _stamina.TakeStaminaDamage(uid, 15F), token); + Timer.SpawnRepeating(timer, () => _stamina.TakeStaminaDamage(uid, 25F), token); break; case NarcoticEffects.Shake: diff --git a/Content.Shared/_White/Chemistry/NarcoticEffectComponent.cs b/Content.Shared/_White/Chemistry/NarcoticEffectComponent.cs index f23182685e..32e236ff59 100644 --- a/Content.Shared/_White/Chemistry/NarcoticEffectComponent.cs +++ b/Content.Shared/_White/Chemistry/NarcoticEffectComponent.cs @@ -9,11 +9,8 @@ namespace Content.Shared._White.Chemistry; [RegisterComponent] public sealed partial class NarcoticEffectComponent : Component { - [ViewVariables(VVAccess.ReadWrite), DataField] - public CancellationTokenSource CancelTokenSource = new(); - [ViewVariables(VVAccess.ReadOnly), DataField] - public List TimerInterval = new() { 3000, 6000, 3800, 7000, 5000 }; + public List TimerInterval = new() { 8000, 12000, 10000, 12500, 10500 }; [ViewVariables(VVAccess.ReadOnly), DataField] public List SlurTime = new() { 35, 60, 80, 90, 45 }; From cd03321fcf92365b30dde2bf3c5a8edac059f786 Mon Sep 17 00:00:00 2001 From: ThereDrD0 <88589686+ThereDrD0@users.noreply.github.com> Date: Sun, 24 Mar 2024 18:23:56 +0300 Subject: [PATCH 2/3] fix: add hos trench to hos dresser (#243) --- Resources/Prototypes/Catalog/Fills/Lockers/dressers.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/Resources/Prototypes/Catalog/Fills/Lockers/dressers.yml b/Resources/Prototypes/Catalog/Fills/Lockers/dressers.yml index d7838745c7..a5aea77122 100644 --- a/Resources/Prototypes/Catalog/Fills/Lockers/dressers.yml +++ b/Resources/Prototypes/Catalog/Fills/Lockers/dressers.yml @@ -96,6 +96,7 @@ - id: ClothingEyesGlassesSecurity - id: ClothingHeadsetAltSecurity - id: ClothingMaskGasSwat + - id: ClothingOuterCoatHoSTrench - type: entity id: DresserQuarterMasterFilled From 459750b34b319dbd8b2ac04cf7c5570a2888e3a2 Mon Sep 17 00:00:00 2001 From: RavmorganButOnCocaine Date: Sun, 24 Mar 2024 15:24:59 +0000 Subject: [PATCH 3/3] Automatic changelog update --- Resources/Changelog/ChangelogWhite.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Resources/Changelog/ChangelogWhite.yml b/Resources/Changelog/ChangelogWhite.yml index fce3c4c798..4c5ecb98f4 100644 --- a/Resources/Changelog/ChangelogWhite.yml +++ b/Resources/Changelog/ChangelogWhite.yml @@ -2889,3 +2889,12 @@ id: 221 time: '2024-03-24T10:31:18.0000000+00:00' url: https://api.github.com/repos/frosty-dev/ss14-core/pulls/241 +- author: ThereDrD + changes: + - message: "\u0412 \u043A\u043E\u043C\u043E\u0434 \u0445\u043E\u0441\u0430 \u0434\ + \u043E\u0431\u0430\u0432\u043B\u0435\u043D \u043F\u0440\u043E\u043F\u0430\u0432\ + \u0448\u0438\u0439 \u0442\u0440\u0435\u043D\u0447" + type: Fix + id: 222 + time: '2024-03-24T15:23:56.0000000+00:00' + url: https://api.github.com/repos/frosty-dev/ss14-core/pulls/243