From c517ea0787b0e2c16e6472f26fc145d8a6956169 Mon Sep 17 00:00:00 2001 From: Bolper Date: Mon, 26 Aug 2024 14:44:35 +0300 Subject: [PATCH 01/10] =?UTF-8?q?=D0=BA=D0=B0=D0=BA=D0=BE=D0=B9=20=D1=82?= =?UTF-8?q?=D0=BE=20=D1=89=D0=B8=D1=82=20=D0=BA=D0=BE=D0=B4,=20=D0=BA?= =?UTF-8?q?=D0=BE=D1=82=D0=BE=D1=80=D1=8B=20=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE?= =?UTF-8?q?=20=D0=B1=D1=8B=D0=BB=D0=BE=20=D0=B7=D0=B0=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=82=D1=8C=20=D0=BE=D1=84=D0=BE=D1=84=D1=81=D0=BA=D0=B8?= =?UTF-8?q?=D0=BC.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ADT/Addiction/AddictionSystem.cs | 29 +++++++++++++++ Content.Server/ADT/Addiction/EntityEffects.cs | 37 +++++++++++++++++++ .../ADT/Addiction/AddictedComponent.cs | 11 ++++++ .../ru-RU/ADT/Addiction/AddictionEffect.ftl | 6 +++ Resources/Prototypes/Reagents/narcotics.yml | 11 ++++++ 5 files changed, 94 insertions(+) create mode 100644 Content.Server/ADT/Addiction/AddictionSystem.cs create mode 100644 Content.Server/ADT/Addiction/EntityEffects.cs create mode 100644 Content.Shared/ADT/Addiction/AddictedComponent.cs create mode 100644 Resources/Locale/ru-RU/ADT/Addiction/AddictionEffect.ftl diff --git a/Content.Server/ADT/Addiction/AddictionSystem.cs b/Content.Server/ADT/Addiction/AddictionSystem.cs new file mode 100644 index 00000000000..d7997e778c5 --- /dev/null +++ b/Content.Server/ADT/Addiction/AddictionSystem.cs @@ -0,0 +1,29 @@ +using Content.Shared.ADT.Addiction.Components; +using Content.Server.ADT.Addiction.EntityEffects; +using Content.Shared.Popups; +using Robust.Shared.Random; +using Robust.Shared.Timing; +namespace Content.Server.ADT.Addiction; + +public sealed partial class AddictionSystem : EntitySystem +{ + [Dependency] private readonly SharedPopupSystem _popup = default!; + [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private readonly IGameTiming _timing = default!; + + public override void Update(float frameTime) + { + base.Update(frameTime); + var query = EntityQueryEnumerator(); + while (query.MoveNext(out var uid, out var comp)) + { + if (_timing.CurTime < comp.NextPopup) + continue; + if (comp.PopupMessages.Count <= 0) + continue; + var selfMessage = Loc.GetString(_random.Pick(comp.PopupMessages)); + _popup.PopupEntity(selfMessage, uid, uid); + comp.NextPopup = _timing.CurTime + TimeSpan.FromSeconds(10); + } + } +} diff --git a/Content.Server/ADT/Addiction/EntityEffects.cs b/Content.Server/ADT/Addiction/EntityEffects.cs new file mode 100644 index 00000000000..ce1c2f49035 --- /dev/null +++ b/Content.Server/ADT/Addiction/EntityEffects.cs @@ -0,0 +1,37 @@ +using Content.Shared.ADT.Addiction.Components; +using Content.Shared.StatusEffect; +using Content.Shared.EntityEffects; +using Robust.Shared.Prototypes; +namespace Content.Server.ADT.Addiction.EntityEffects; +public sealed partial class AddictionEffect : EntityEffect +{ + [DataField(required: true)] + public List PopupMessages = new(); + + + protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) + { + return Loc.GetString("reagent-effect-addiction",("chance", Probability)); + } + + public override void Effect(EntityEffectBaseArgs ev) + { + if (ev is not EntityEffectReagentArgs args) + return; + + if (args.EntityManager.TryGetComponent(args.TargetEntity, out var comp)) + { + foreach (var item in PopupMessages) + { + if (comp.PopupMessages.Contains(item)) + continue; + comp.PopupMessages.Add(item); + } + } + else + { + var comp1 = args.EntityManager.EnsureComponent(args.TargetEntity); + comp1.PopupMessages.AddRange(PopupMessages); + } + } +} diff --git a/Content.Shared/ADT/Addiction/AddictedComponent.cs b/Content.Shared/ADT/Addiction/AddictedComponent.cs new file mode 100644 index 00000000000..4c72f144d86 --- /dev/null +++ b/Content.Shared/ADT/Addiction/AddictedComponent.cs @@ -0,0 +1,11 @@ +namespace Content.Shared.ADT.Addiction.Components; + +/// +/// Кароче, это не компонент как я понял, а затычка, для хранения данных. Нихуя не делает, добавлять никуда не нужно. используется для системы курения. +/// +[RegisterComponent] +public sealed partial class AddictedComponent : Component +{ + public List PopupMessages = new(); + public TimeSpan NextPopup = TimeSpan.Zero; +} diff --git a/Resources/Locale/ru-RU/ADT/Addiction/AddictionEffect.ftl b/Resources/Locale/ru-RU/ADT/Addiction/AddictionEffect.ftl new file mode 100644 index 00000000000..160b3f7b12b --- /dev/null +++ b/Resources/Locale/ru-RU/ADT/Addiction/AddictionEffect.ftl @@ -0,0 +1,6 @@ +addictionEffect-message-1 = Вы чувсвуете привязанность к этому. +addictionEffect-message-2 = Вы чувсвуете себя более спокойно. +addictionEffect-message-3 = Вы чувсвуете себя более расслабленным. +addictionEffect-message-4 = Вы привыкаете к этому. +addictionEffect-message-5 = Вы чувсвуете себя удовлетворенно. +addictionEffect-message-6 = У вас сформировывается зависимость к этому. diff --git a/Resources/Prototypes/Reagents/narcotics.yml b/Resources/Prototypes/Reagents/narcotics.yml index 8e73eb13955..376f2367579 100644 --- a/Resources/Prototypes/Reagents/narcotics.yml +++ b/Resources/Prototypes/Reagents/narcotics.yml @@ -216,6 +216,17 @@ plantMetabolism: - !type:PlantAdjustHealth amount: -5 + metabolisms: + Narcotic: + effects: + - !type:AddictionEffect + popupMessages: + - addictionEffect-message-1 + - addictionEffect-message-2 + - addictionEffect-message-3 + - addictionEffect-message-4 + - addictionEffect-message-5 + - addictionEffect-message-6 # TODO: Replace these nonstandardized effects with generic brain damage - type: reagent From fb37939c0b62c29d9b0d9d61253340f9481d4a1d Mon Sep 17 00:00:00 2001 From: Bolper <169089627+Bolper@users.noreply.github.com> Date: Mon, 26 Aug 2024 12:09:59 +0000 Subject: [PATCH 02/10] =?UTF-8?q?=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Resources/Prototypes/Reagents/narcotics.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Resources/Prototypes/Reagents/narcotics.yml b/Resources/Prototypes/Reagents/narcotics.yml index 376f2367579..228840597ec 100644 --- a/Resources/Prototypes/Reagents/narcotics.yml +++ b/Resources/Prototypes/Reagents/narcotics.yml @@ -216,6 +216,7 @@ plantMetabolism: - !type:PlantAdjustHealth amount: -5 + #Start-ADT-AddictionEffect metabolisms: Narcotic: effects: @@ -227,6 +228,7 @@ - addictionEffect-message-4 - addictionEffect-message-5 - addictionEffect-message-6 +#End-ADT-AddictionEffect # TODO: Replace these nonstandardized effects with generic brain damage - type: reagent From df0e8df8381e317a60c3354ce0f742c8a1a068c2 Mon Sep 17 00:00:00 2001 From: Bolper Date: Thu, 29 Aug 2024 21:50:40 +0300 Subject: [PATCH 03/10] ~ --- .../ADT/Addiction/AddictionSystem.cs | 6 +++--- Content.Server/ADT/Addiction/EntityEffects.cs | 10 +++++----- .../ADT/Addiction/AddictedComponent.cs | 15 +++++++++++---- .../ADT/Addiction/AddictionComponent.cs | 11 +++++++++++ .../ru-RU/ADT/Addiction/AddictionEffect.ftl | 6 ------ .../Locale/ru-RU/ADT/reagents/addiction.ftl | 6 ++++++ Resources/Prototypes/Reagents/narcotics.yml | 19 +++++++++++-------- 7 files changed, 47 insertions(+), 26 deletions(-) create mode 100644 Content.Shared/ADT/Addiction/AddictionComponent.cs delete mode 100644 Resources/Locale/ru-RU/ADT/Addiction/AddictionEffect.ftl create mode 100644 Resources/Locale/ru-RU/ADT/reagents/addiction.ftl diff --git a/Content.Server/ADT/Addiction/AddictionSystem.cs b/Content.Server/ADT/Addiction/AddictionSystem.cs index d7997e778c5..98e8e74a772 100644 --- a/Content.Server/ADT/Addiction/AddictionSystem.cs +++ b/Content.Server/ADT/Addiction/AddictionSystem.cs @@ -1,4 +1,4 @@ -using Content.Shared.ADT.Addiction.Components; +using Content.Shared.ADT.Addiction.AddictedComponent; using Content.Server.ADT.Addiction.EntityEffects; using Content.Shared.Popups; using Robust.Shared.Random; @@ -14,7 +14,7 @@ public sealed partial class AddictionSystem : EntitySystem public override void Update(float frameTime) { base.Update(frameTime); - var query = EntityQueryEnumerator(); +/* var query = EntityQueryEnumerator(); while (query.MoveNext(out var uid, out var comp)) { if (_timing.CurTime < comp.NextPopup) @@ -24,6 +24,6 @@ public override void Update(float frameTime) var selfMessage = Loc.GetString(_random.Pick(comp.PopupMessages)); _popup.PopupEntity(selfMessage, uid, uid); comp.NextPopup = _timing.CurTime + TimeSpan.FromSeconds(10); - } + }*/ } } diff --git a/Content.Server/ADT/Addiction/EntityEffects.cs b/Content.Server/ADT/Addiction/EntityEffects.cs index ce1c2f49035..497fca51932 100644 --- a/Content.Server/ADT/Addiction/EntityEffects.cs +++ b/Content.Server/ADT/Addiction/EntityEffects.cs @@ -1,12 +1,12 @@ -using Content.Shared.ADT.Addiction.Components; +using Content.Shared.ADT.Addiction.AddictedComponent; using Content.Shared.StatusEffect; using Content.Shared.EntityEffects; using Robust.Shared.Prototypes; namespace Content.Server.ADT.Addiction.EntityEffects; public sealed partial class AddictionEffect : EntityEffect { - [DataField(required: true)] - public List PopupMessages = new(); +/* [DataField(required: true)] + public List PopupMessages = new();*/ protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) @@ -19,7 +19,7 @@ public override void Effect(EntityEffectBaseArgs ev) if (ev is not EntityEffectReagentArgs args) return; - if (args.EntityManager.TryGetComponent(args.TargetEntity, out var comp)) +/* if (args.EntityManager.TryGetComponent(args.TargetEntity, out var comp)) { foreach (var item in PopupMessages) { @@ -32,6 +32,6 @@ public override void Effect(EntityEffectBaseArgs ev) { var comp1 = args.EntityManager.EnsureComponent(args.TargetEntity); comp1.PopupMessages.AddRange(PopupMessages); - } + }*/ } } diff --git a/Content.Shared/ADT/Addiction/AddictedComponent.cs b/Content.Shared/ADT/Addiction/AddictedComponent.cs index 4c72f144d86..d20b8f1cf1e 100644 --- a/Content.Shared/ADT/Addiction/AddictedComponent.cs +++ b/Content.Shared/ADT/Addiction/AddictedComponent.cs @@ -1,11 +1,18 @@ -namespace Content.Shared.ADT.Addiction.Components; +namespace Content.Shared.ADT.Addiction.AddictedComponent; /// -/// Кароче, это не компонент как я понял, а затычка, для хранения данных. Нихуя не делает, добавлять никуда не нужно. используется для системы курения. +/// Компонент для базовых представителей рас. +/// Используется такие переменные для указания: RequiredTime, ChangeAddictionTypeTime. /// [RegisterComponent] public sealed partial class AddictedComponent : Component { - public List PopupMessages = new(); - public TimeSpan NextPopup = TimeSpan.Zero; + //public List PopupMessages = new(); + //public TimeSpan NextPopup = TimeSpan.Zero; + public int CurrentAddictedTime; // Время проведенное за употреблением - время, когда не употреблял. + public int RemaningTime; // Время оставшиеся до того, как сменится тип зависимости. + public int ChangeAddictionTypeTime; // Время от которого зависит, как скоро сменится тип зависимости на более тяжелую. + public int RequiredTime; // Время необходимое, чтобы стать зависимым. + public int TypeAddiction; // Собсна тип зависимости. 0 - легкая, без побочек, 1 - с небольшими побочками и т п, до 4 + public bool Addicted = false; // собсна сообщает нам имеет ли зависимость пациент } diff --git a/Content.Shared/ADT/Addiction/AddictionComponent.cs b/Content.Shared/ADT/Addiction/AddictionComponent.cs new file mode 100644 index 00000000000..a25696c158f --- /dev/null +++ b/Content.Shared/ADT/Addiction/AddictionComponent.cs @@ -0,0 +1,11 @@ +namespace Content.Shared.ADT.Addiction.AddictionComponent; +/// +/// Компонент для реагентов +/// +/// +[RegisterComponent] +public sealed partial class AddictionComponent : Component +{ + public float TimeCoefficient; // Коэфицент домножающий на себя время воздействие этого регаента на организм + public float QuantityCoefficient; // Коэфицент домножающий на себя количество полученнного реагента организмом +} diff --git a/Resources/Locale/ru-RU/ADT/Addiction/AddictionEffect.ftl b/Resources/Locale/ru-RU/ADT/Addiction/AddictionEffect.ftl deleted file mode 100644 index 160b3f7b12b..00000000000 --- a/Resources/Locale/ru-RU/ADT/Addiction/AddictionEffect.ftl +++ /dev/null @@ -1,6 +0,0 @@ -addictionEffect-message-1 = Вы чувсвуете привязанность к этому. -addictionEffect-message-2 = Вы чувсвуете себя более спокойно. -addictionEffect-message-3 = Вы чувсвуете себя более расслабленным. -addictionEffect-message-4 = Вы привыкаете к этому. -addictionEffect-message-5 = Вы чувсвуете себя удовлетворенно. -addictionEffect-message-6 = У вас сформировывается зависимость к этому. diff --git a/Resources/Locale/ru-RU/ADT/reagents/addiction.ftl b/Resources/Locale/ru-RU/ADT/reagents/addiction.ftl new file mode 100644 index 00000000000..992f20407d9 --- /dev/null +++ b/Resources/Locale/ru-RU/ADT/reagents/addiction.ftl @@ -0,0 +1,6 @@ +addiction-message-1 = Вы чувсвуете привязанность к этому. +addiction-message-2 = Вы чувсвуете себя более спокойно. +addiction-message-3 = Вы чувсвуете себя более расслабленным. +addiction-message-4 = Вы привыкаете к этому. +addiction-message-5 = Вы чувсвуете себя удовлетворенно. +addiction-message-6 = У вас сформировывается зависимость к этому. diff --git a/Resources/Prototypes/Reagents/narcotics.yml b/Resources/Prototypes/Reagents/narcotics.yml index 376f2367579..d7fe15b4688 100644 --- a/Resources/Prototypes/Reagents/narcotics.yml +++ b/Resources/Prototypes/Reagents/narcotics.yml @@ -216,17 +216,20 @@ plantMetabolism: - !type:PlantAdjustHealth amount: -5 +#ADT start metabolisms: Narcotic: effects: - - !type:AddictionEffect - popupMessages: - - addictionEffect-message-1 - - addictionEffect-message-2 - - addictionEffect-message-3 - - addictionEffect-message-4 - - addictionEffect-message-5 - - addictionEffect-message-6 + - !type:PopupMessage + type: Local + messages: + - addiction-message-1 + - addiction-message-2 + - addiction-message-3 + - addiction-message-4 + - addiction-message-5 + - addiction-message-6 +#ADT end # TODO: Replace these nonstandardized effects with generic brain damage - type: reagent From b15cd877a5ed7a07a9061b84a4870c9999c6283a Mon Sep 17 00:00:00 2001 From: Bolper Date: Sat, 7 Sep 2024 16:42:40 +0300 Subject: [PATCH 04/10] =?UTF-8?q?add:=20=D0=BA=D0=B0=D0=BA=D0=B0=D1=8F=20?= =?UTF-8?q?=D1=82=D0=BE=20=D1=85=D1=83=D0=B5=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ADT/Addiction/AddictionSystem.cs | 24 +++++++++++++ Content.Server/ADT/Addiction/EntityEffects.cs | 36 ++++++++++++++++--- .../ADT/Addiction/AddictedComponent.cs | 9 ++--- .../ADT/Addiction/AddictionComponent.cs | 11 ------ .../Entities/Mobs/Species/human.yml | 5 ++- Resources/Prototypes/Reagents/narcotics.yml | 3 ++ 6 files changed, 67 insertions(+), 21 deletions(-) delete mode 100644 Content.Shared/ADT/Addiction/AddictionComponent.cs diff --git a/Content.Server/ADT/Addiction/AddictionSystem.cs b/Content.Server/ADT/Addiction/AddictionSystem.cs index 98e8e74a772..d2eb5eedac3 100644 --- a/Content.Server/ADT/Addiction/AddictionSystem.cs +++ b/Content.Server/ADT/Addiction/AddictionSystem.cs @@ -14,6 +14,30 @@ public sealed partial class AddictionSystem : EntitySystem public override void Update(float frameTime) { base.Update(frameTime); + var query = EntityQueryEnumerator(); + while (query.MoveNext(out var uid, out var comp)) + { + if (comp.Addicted) + { + comp.RemaningTime -= frameTime; + if (comp.RemaningTime <= 0) + { + comp.RemaningTime = comp.ChangeAddictionTypeTime; + if (comp.TypeAddiction > 0) + { + comp.TypeAddiction -= 1; + } + + } + } + else + { + if (comp.CurrentAddictedTime >= comp.RequiredTime) + { + comp.Addicted = true; + } + } + } /* var query = EntityQueryEnumerator(); while (query.MoveNext(out var uid, out var comp)) { diff --git a/Content.Server/ADT/Addiction/EntityEffects.cs b/Content.Server/ADT/Addiction/EntityEffects.cs index 497fca51932..3c688e4cdc1 100644 --- a/Content.Server/ADT/Addiction/EntityEffects.cs +++ b/Content.Server/ADT/Addiction/EntityEffects.cs @@ -1,24 +1,50 @@ using Content.Shared.ADT.Addiction.AddictedComponent; -using Content.Shared.StatusEffect; +/*using Content.Shared.StatusEffect;*/ using Content.Shared.EntityEffects; using Robust.Shared.Prototypes; +using Robust.Shared.Timing; +/*using Content.Shared.Chemistry.Reagent;*/ +/*using Robust.Shared.Prototypes;*/ +//using Content.Shared.Body.Prototypes; + namespace Content.Server.ADT.Addiction.EntityEffects; public sealed partial class AddictionEffect : EntityEffect { -/* [DataField(required: true)] - public List PopupMessages = new();*/ - + /* [DataField(required: true)] + public List PopupMessages = new();*/ + [DataField(required: true)] + public float TimeCoefficient = new(); // Коэфицент домножающий на себя время воздействие этого регаента на организм + [DataField(required: true)] + public float QuantityCoefficient = new(); // Коэфицент домножающий на себя количество усвоенного реагента организмом + [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private readonly TimeSpan _delayTime = TimeSpan.FromSeconds(1); // Время задержки эффекта + //[Dependency] private readonly MetabolismGroupPrototype groupNarcotics = MetabolismGroupPrototype.ID; // +/* [Dependency] private readonly IPrototypeManager _prototypeManager = default!;*/ protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) { - return Loc.GetString("reagent-effect-addiction",("chance", Probability)); + return Loc.GetString("reagent-effect-addiction", ("chance", Probability)); } public override void Effect(EntityEffectBaseArgs ev) { if (ev is not EntityEffectReagentArgs args) return; + if (ev.EntityManager.TryGetComponent(ev.TargetEntity, out var comp)) // Получили компонент того, на кого действует эффект. + { + if (_timing.CurTime < comp.LastEffect + _delayTime) + return; +/* if (!_prototypeManager.TryIndex(ev.TargetEntity.ToString, out var proto)) + return; + + if (!proto.Metabolisms.TryGetValue("Narcotic", out var entry)) + return;*/ + + comp.CurrentAddictedTime += _delayTime; + comp.RemaningTime = comp.ChangeAddictionTypeTime; + } + /* if (args.EntityManager.TryGetComponent(args.TargetEntity, out var comp)) { foreach (var item in PopupMessages) diff --git a/Content.Shared/ADT/Addiction/AddictedComponent.cs b/Content.Shared/ADT/Addiction/AddictedComponent.cs index d20b8f1cf1e..32ada1f5635 100644 --- a/Content.Shared/ADT/Addiction/AddictedComponent.cs +++ b/Content.Shared/ADT/Addiction/AddictedComponent.cs @@ -9,10 +9,11 @@ public sealed partial class AddictedComponent : Component { //public List PopupMessages = new(); //public TimeSpan NextPopup = TimeSpan.Zero; - public int CurrentAddictedTime; // Время проведенное за употреблением - время, когда не употреблял. - public int RemaningTime; // Время оставшиеся до того, как сменится тип зависимости. - public int ChangeAddictionTypeTime; // Время от которого зависит, как скоро сменится тип зависимости на более тяжелую. - public int RequiredTime; // Время необходимое, чтобы стать зависимым. + public TimeSpan CurrentAddictedTime = TimeSpan.Zero; // Время проведенное за употреблением - время, когда не употреблял. + [DataField(required: true)] public float ChangeAddictionTypeTime; // Время от которого зависит, как скоро сменится тип зависимости на более тяжелую. + public float RemaningTime; // Время оставшиеся до того, как сменится тип зависимости. + [DataField(required: true)] public TimeSpan RequiredTime; // Время необходимое, чтобы стать зависимым. public int TypeAddiction; // Собсна тип зависимости. 0 - легкая, без побочек, 1 - с небольшими побочками и т п, до 4 public bool Addicted = false; // собсна сообщает нам имеет ли зависимость пациент + public TimeSpan LastEffect = TimeSpan.Zero; // Собсна время, которое сообщает нам, время последнего воздействия эффекта на челика } diff --git a/Content.Shared/ADT/Addiction/AddictionComponent.cs b/Content.Shared/ADT/Addiction/AddictionComponent.cs deleted file mode 100644 index a25696c158f..00000000000 --- a/Content.Shared/ADT/Addiction/AddictionComponent.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Content.Shared.ADT.Addiction.AddictionComponent; -/// -/// Компонент для реагентов -/// -/// -[RegisterComponent] -public sealed partial class AddictionComponent : Component -{ - public float TimeCoefficient; // Коэфицент домножающий на себя время воздействие этого регаента на организм - public float QuantityCoefficient; // Коэфицент домножающий на себя количество полученнного реагента организмом -} diff --git a/Resources/Prototypes/Entities/Mobs/Species/human.yml b/Resources/Prototypes/Entities/Mobs/Species/human.yml index 4d6bc17b26c..e7d0b2d2fa5 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/human.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/human.yml @@ -34,6 +34,9 @@ understands: - GalacticCommon - SolCommon +- type: Addicted + changeAddictionTypeTime: 50 + requiredTime: 50 - type: entity parent: BaseSpeciesDummy @@ -46,4 +49,4 @@ sizeMaps: 32: sprite: Mobs/Species/Human/displacement.rsi - state: jumpsuit-female \ No newline at end of file + state: jumpsuit-female diff --git a/Resources/Prototypes/Reagents/narcotics.yml b/Resources/Prototypes/Reagents/narcotics.yml index d7fe15b4688..a7b8d43a227 100644 --- a/Resources/Prototypes/Reagents/narcotics.yml +++ b/Resources/Prototypes/Reagents/narcotics.yml @@ -229,6 +229,9 @@ - addiction-message-4 - addiction-message-5 - addiction-message-6 + - !type:AddictionEffect + TimeCoefficient: 10 + QuantityCoefficient: 10 #ADT end # TODO: Replace these nonstandardized effects with generic brain damage From ac64a3cc64f990f7df0f32adb4c1571c2dcaaf49 Mon Sep 17 00:00:00 2001 From: Bolper Date: Sun, 8 Sep 2024 19:35:33 +0300 Subject: [PATCH 05/10] =?UTF-8?q?=D0=BD=D1=83=20=D1=82=D0=B8=D0=BF=D0=B0?= =?UTF-8?q?=20=D1=8D=D1=82=D0=B0=20=D1=85=D1=83=D0=B5=D1=82=D0=B0=20=D1=83?= =?UTF-8?q?=D0=B6=D0=B5=20=D0=BD=D0=B5=20=D0=BB=D0=BE=D0=BC=D0=B0=D0=B5?= =?UTF-8?q?=D1=82=D1=81=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Server/ADT/Addiction/EntityEffects.cs | 9 +++++---- Resources/Prototypes/Entities/Mobs/Species/human.yml | 6 +++--- Resources/Prototypes/Reagents/narcotics.yml | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Content.Server/ADT/Addiction/EntityEffects.cs b/Content.Server/ADT/Addiction/EntityEffects.cs index 3c688e4cdc1..8e8b36311c2 100644 --- a/Content.Server/ADT/Addiction/EntityEffects.cs +++ b/Content.Server/ADT/Addiction/EntityEffects.cs @@ -16,8 +16,8 @@ public sealed partial class AddictionEffect : EntityEffect public float TimeCoefficient = new(); // Коэфицент домножающий на себя время воздействие этого регаента на организм [DataField(required: true)] public float QuantityCoefficient = new(); // Коэфицент домножающий на себя количество усвоенного реагента организмом - [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly TimeSpan _delayTime = TimeSpan.FromSeconds(1); // Время задержки эффекта +/* [Dependency] private readonly IGameTiming _timing = default!;*/ + [DataField(required: false)] public TimeSpan _delayTime = TimeSpan.FromSeconds(1); // Время задержки эффекта //[Dependency] private readonly MetabolismGroupPrototype groupNarcotics = MetabolismGroupPrototype.ID; // /* [Dependency] private readonly IPrototypeManager _prototypeManager = default!;*/ @@ -32,7 +32,7 @@ public override void Effect(EntityEffectBaseArgs ev) return; if (ev.EntityManager.TryGetComponent(ev.TargetEntity, out var comp)) // Получили компонент того, на кого действует эффект. { - if (_timing.CurTime < comp.LastEffect + _delayTime) + if (IoCManager.Resolve().CurTime < comp.LastEffect + _delayTime) return; /* if (!_prototypeManager.TryIndex(ev.TargetEntity.ToString, out var proto)) @@ -41,8 +41,9 @@ public override void Effect(EntityEffectBaseArgs ev) if (!proto.Metabolisms.TryGetValue("Narcotic", out var entry)) return;*/ - comp.CurrentAddictedTime += _delayTime; + comp.CurrentAddictedTime += _delayTime * TimeCoefficient; comp.RemaningTime = comp.ChangeAddictionTypeTime; + comp.LastEffect = IoCManager.Resolve().CurTime; } /* if (args.EntityManager.TryGetComponent(args.TargetEntity, out var comp)) diff --git a/Resources/Prototypes/Entities/Mobs/Species/human.yml b/Resources/Prototypes/Entities/Mobs/Species/human.yml index e7d0b2d2fa5..8089b074f66 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/human.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/human.yml @@ -34,9 +34,9 @@ understands: - GalacticCommon - SolCommon -- type: Addicted - changeAddictionTypeTime: 50 - requiredTime: 50 + - type: Addicted + changeAddictionTypeTime: 50 + requiredTime: 50 - type: entity parent: BaseSpeciesDummy diff --git a/Resources/Prototypes/Reagents/narcotics.yml b/Resources/Prototypes/Reagents/narcotics.yml index a7b8d43a227..e676560d770 100644 --- a/Resources/Prototypes/Reagents/narcotics.yml +++ b/Resources/Prototypes/Reagents/narcotics.yml @@ -230,8 +230,8 @@ - addiction-message-5 - addiction-message-6 - !type:AddictionEffect - TimeCoefficient: 10 - QuantityCoefficient: 10 + timeCoefficient: 10 + quantityCoefficient: 10 #ADT end # TODO: Replace these nonstandardized effects with generic brain damage From 51100784507bd72584643dc2d5775b226f8fe805 Mon Sep 17 00:00:00 2001 From: Bolper Date: Mon, 9 Sep 2024 10:39:56 +0300 Subject: [PATCH 06/10] =?UTF-8?q?=D0=A2=D0=B8=D0=BF=D0=B0=20=D0=B5=D1=89?= =?UTF-8?q?=D0=B5=20=D1=80=D0=B0=D0=B7=20=D1=83=D0=BB=D1=83=D1=87=D1=88?= =?UTF-8?q?=D0=B8=D0=BB=20=D0=BF=D0=BE=D0=B5=D0=B1=D0=BE=D1=82=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ADT/Addiction/AddictionSystem.cs | 57 ++++++++----------- Content.Server/ADT/Addiction/EntityEffects.cs | 37 ++---------- .../ADT/Addiction/AddictedComponent.cs | 37 +++++++++--- 3 files changed, 57 insertions(+), 74 deletions(-) diff --git a/Content.Server/ADT/Addiction/AddictionSystem.cs b/Content.Server/ADT/Addiction/AddictionSystem.cs index d2eb5eedac3..ff7c65b10ce 100644 --- a/Content.Server/ADT/Addiction/AddictionSystem.cs +++ b/Content.Server/ADT/Addiction/AddictionSystem.cs @@ -7,47 +7,40 @@ namespace Content.Server.ADT.Addiction; public sealed partial class AddictionSystem : EntitySystem { - [Dependency] private readonly SharedPopupSystem _popup = default!; - [Dependency] private readonly IRobustRandom _random = default!; +/* [Dependency] private readonly SharedPopupSystem _popup = default!; + [Dependency] private readonly IRobustRandom _random = default!;*/ [Dependency] private readonly IGameTiming _timing = default!; public override void Update(float frameTime) { base.Update(frameTime); + TimeSpan fT = TimeSpan.FromSeconds(frameTime); var query = EntityQueryEnumerator(); while (query.MoveNext(out var uid, out var comp)) { - if (comp.Addicted) - { - comp.RemaningTime -= frameTime; - if (comp.RemaningTime <= 0) - { - comp.RemaningTime = comp.ChangeAddictionTypeTime; - if (comp.TypeAddiction > 0) - { - comp.TypeAddiction -= 1; - } - - } - } - else - { - if (comp.CurrentAddictedTime >= comp.RequiredTime) - { - comp.Addicted = true; - } - } + UpdateCurrentAddictedTime(comp, fT); + UpdateTypeAddiction(comp); + UpdateAddicted(comp); } -/* var query = EntityQueryEnumerator(); - while (query.MoveNext(out var uid, out var comp)) + } + public void UpdateCurrentAddictedTime(AddictedComponent comp, TimeSpan frameTime) + { + if (comp.CurrentAddictedTime >= TimeSpan.Zero + frameTime) + comp.CurrentAddictedTime -= frameTime; + else + comp.CurrentAddictedTime = TimeSpan.Zero; + } + public void UpdateTypeAddiction(AddictedComponent comp) + { + if (comp.TypeAddiction > 0 && comp.Addicted && comp.RemaningTime <= TimeSpan.Zero) { - if (_timing.CurTime < comp.NextPopup) - continue; - if (comp.PopupMessages.Count <= 0) - continue; - var selfMessage = Loc.GetString(_random.Pick(comp.PopupMessages)); - _popup.PopupEntity(selfMessage, uid, uid); - comp.NextPopup = _timing.CurTime + TimeSpan.FromSeconds(10); - }*/ + comp.RemaningTime = comp.ChangeAddictionTypeTime; + comp.TypeAddiction -= 1; + } + } + public void UpdateAddicted(AddictedComponent comp) + { + if (comp.CurrentAddictedTime >= comp.RequiredTime) + comp.Addicted = true; } } diff --git a/Content.Server/ADT/Addiction/EntityEffects.cs b/Content.Server/ADT/Addiction/EntityEffects.cs index 8e8b36311c2..8612901779f 100644 --- a/Content.Server/ADT/Addiction/EntityEffects.cs +++ b/Content.Server/ADT/Addiction/EntityEffects.cs @@ -1,25 +1,17 @@ using Content.Shared.ADT.Addiction.AddictedComponent; -/*using Content.Shared.StatusEffect;*/ using Content.Shared.EntityEffects; using Robust.Shared.Prototypes; using Robust.Shared.Timing; -/*using Content.Shared.Chemistry.Reagent;*/ -/*using Robust.Shared.Prototypes;*/ -//using Content.Shared.Body.Prototypes; namespace Content.Server.ADT.Addiction.EntityEffects; public sealed partial class AddictionEffect : EntityEffect { - /* [DataField(required: true)] - public List PopupMessages = new();*/ [DataField(required: true)] public float TimeCoefficient = new(); // Коэфицент домножающий на себя время воздействие этого регаента на организм [DataField(required: true)] public float QuantityCoefficient = new(); // Коэфицент домножающий на себя количество усвоенного реагента организмом -/* [Dependency] private readonly IGameTiming _timing = default!;*/ - [DataField(required: false)] public TimeSpan _delayTime = TimeSpan.FromSeconds(1); // Время задержки эффекта - //[Dependency] private readonly MetabolismGroupPrototype groupNarcotics = MetabolismGroupPrototype.ID; // -/* [Dependency] private readonly IPrototypeManager _prototypeManager = default!;*/ + [DataField(required: false)] public TimeSpan DelayTime = TimeSpan.FromSeconds(1); // Время задержки эффекта + protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) { @@ -32,33 +24,12 @@ public override void Effect(EntityEffectBaseArgs ev) return; if (ev.EntityManager.TryGetComponent(ev.TargetEntity, out var comp)) // Получили компонент того, на кого действует эффект. { - if (IoCManager.Resolve().CurTime < comp.LastEffect + _delayTime) - return; - -/* if (!_prototypeManager.TryIndex(ev.TargetEntity.ToString, out var proto)) + if (IoCManager.Resolve().CurTime < comp.LastEffect + DelayTime) return; - if (!proto.Metabolisms.TryGetValue("Narcotic", out var entry)) - return;*/ - - comp.CurrentAddictedTime += _delayTime * TimeCoefficient; + comp.CurrentAddictedTime += DelayTime * TimeCoefficient; comp.RemaningTime = comp.ChangeAddictionTypeTime; comp.LastEffect = IoCManager.Resolve().CurTime; } - -/* if (args.EntityManager.TryGetComponent(args.TargetEntity, out var comp)) - { - foreach (var item in PopupMessages) - { - if (comp.PopupMessages.Contains(item)) - continue; - comp.PopupMessages.Add(item); - } - } - else - { - var comp1 = args.EntityManager.EnsureComponent(args.TargetEntity); - comp1.PopupMessages.AddRange(PopupMessages); - }*/ } } diff --git a/Content.Shared/ADT/Addiction/AddictedComponent.cs b/Content.Shared/ADT/Addiction/AddictedComponent.cs index 32ada1f5635..d6394c00620 100644 --- a/Content.Shared/ADT/Addiction/AddictedComponent.cs +++ b/Content.Shared/ADT/Addiction/AddictedComponent.cs @@ -7,13 +7,32 @@ namespace Content.Shared.ADT.Addiction.AddictedComponent; [RegisterComponent] public sealed partial class AddictedComponent : Component { - //public List PopupMessages = new(); - //public TimeSpan NextPopup = TimeSpan.Zero; - public TimeSpan CurrentAddictedTime = TimeSpan.Zero; // Время проведенное за употреблением - время, когда не употреблял. - [DataField(required: true)] public float ChangeAddictionTypeTime; // Время от которого зависит, как скоро сменится тип зависимости на более тяжелую. - public float RemaningTime; // Время оставшиеся до того, как сменится тип зависимости. - [DataField(required: true)] public TimeSpan RequiredTime; // Время необходимое, чтобы стать зависимым. - public int TypeAddiction; // Собсна тип зависимости. 0 - легкая, без побочек, 1 - с небольшими побочками и т п, до 4 - public bool Addicted = false; // собсна сообщает нам имеет ли зависимость пациент - public TimeSpan LastEffect = TimeSpan.Zero; // Собсна время, которое сообщает нам, время последнего воздействия эффекта на челика + /// + /// Время проведенное за употреблением - время, когда не употреблял. + /// + [DataField] public TimeSpan CurrentAddictedTime = TimeSpan.Zero; + /// + /// Время проведенное за употреблением - время, когда не употреблял. + /// + [DataField(required: true)] public TimeSpan ChangeAddictionTypeTime; + /// + /// Время оставшиеся до того, как сменится тип зависимости. + /// + [DataField] public TimeSpan RemaningTime; + /// + /// Время необходимое, чтобы стать зависимым. + /// + [DataField(required: true)] public TimeSpan RequiredTime;. + /// + /// Собсна тип зависимости. 0 - легкая, без побочек, 1 - с небольшими побочками и т п, до 4 + /// + [DataField] public int TypeAddiction; + /// + /// собсна сообщает нам имеет ли зависимость пациент + /// + [DataField] public bool Addicted = false; + /// + /// Собсна время, которое сообщает нам, время последнего воздействия эффекта на челика + /// + [DataField] public TimeSpan LastEffect = TimeSpan.Zero; } From 57defd235f2cd92d036872e0b45e57fb5ef06c6b Mon Sep 17 00:00:00 2001 From: Bolper Date: Mon, 9 Sep 2024 10:40:54 +0300 Subject: [PATCH 07/10] =?UTF-8?q?=D0=9E=D1=85=D1=85=20=D0=B1=D0=BB=D1=8F?= =?UTF-8?q?=20=D1=82=D0=BE=D1=87=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Shared/ADT/Addiction/AddictedComponent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Shared/ADT/Addiction/AddictedComponent.cs b/Content.Shared/ADT/Addiction/AddictedComponent.cs index d6394c00620..2fcf967a2e8 100644 --- a/Content.Shared/ADT/Addiction/AddictedComponent.cs +++ b/Content.Shared/ADT/Addiction/AddictedComponent.cs @@ -22,7 +22,7 @@ public sealed partial class AddictedComponent : Component /// /// Время необходимое, чтобы стать зависимым. /// - [DataField(required: true)] public TimeSpan RequiredTime;. + [DataField(required: true)] public TimeSpan RequiredTime; /// /// Собсна тип зависимости. 0 - легкая, без побочек, 1 - с небольшими побочками и т п, до 4 /// From af091ad11f749042a1d74eab81da64ac55009db1 Mon Sep 17 00:00:00 2001 From: Bolper Date: Mon, 9 Sep 2024 14:13:49 +0300 Subject: [PATCH 08/10] =?UTF-8?q?=D0=A2=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20?= =?UTF-8?q?=D1=82=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20=D0=BF=D0=BE=D0=BF=D0=B0?= =?UTF-8?q?=D1=85=D0=B8=D0=B2=D0=B0=D0=B5=D1=82=20=D1=85=D1=83=D0=B9=D0=BD?= =?UTF-8?q?=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Server/ADT/Addiction/AddictionSystem.cs | 6 ++++-- Content.Server/ADT/Addiction/EntityEffects.cs | 11 ++++++----- Content.Shared/ADT/Addiction/AddictedComponent.cs | 2 +- Resources/Prototypes/Reagents/narcotics.yml | 4 ++-- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Content.Server/ADT/Addiction/AddictionSystem.cs b/Content.Server/ADT/Addiction/AddictionSystem.cs index ff7c65b10ce..160521e6c7d 100644 --- a/Content.Server/ADT/Addiction/AddictionSystem.cs +++ b/Content.Server/ADT/Addiction/AddictionSystem.cs @@ -7,8 +7,6 @@ namespace Content.Server.ADT.Addiction; public sealed partial class AddictionSystem : EntitySystem { -/* [Dependency] private readonly SharedPopupSystem _popup = default!; - [Dependency] private readonly IRobustRandom _random = default!;*/ [Dependency] private readonly IGameTiming _timing = default!; public override void Update(float frameTime) @@ -29,6 +27,10 @@ public void UpdateCurrentAddictedTime(AddictedComponent comp, TimeSpan frameTime comp.CurrentAddictedTime -= frameTime; else comp.CurrentAddictedTime = TimeSpan.Zero; + if (comp.RemaningTime >= TimeSpan.Zero + frameTime) + comp.RemaningTime -= frameTime; + else + comp.RemaningTime = TimeSpan.Zero; } public void UpdateTypeAddiction(AddictedComponent comp) { diff --git a/Content.Server/ADT/Addiction/EntityEffects.cs b/Content.Server/ADT/Addiction/EntityEffects.cs index 8612901779f..be43ce2e9e3 100644 --- a/Content.Server/ADT/Addiction/EntityEffects.cs +++ b/Content.Server/ADT/Addiction/EntityEffects.cs @@ -10,7 +10,7 @@ public sealed partial class AddictionEffect : EntityEffect public float TimeCoefficient = new(); // Коэфицент домножающий на себя время воздействие этого регаента на организм [DataField(required: true)] public float QuantityCoefficient = new(); // Коэфицент домножающий на себя количество усвоенного реагента организмом - [DataField(required: false)] public TimeSpan DelayTime = TimeSpan.FromSeconds(1); // Время задержки эффекта + [DataField] public TimeSpan DelayTime = TimeSpan.FromSeconds(30); // Время между получением реагента protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) @@ -24,11 +24,12 @@ public override void Effect(EntityEffectBaseArgs ev) return; if (ev.EntityManager.TryGetComponent(ev.TargetEntity, out var comp)) // Получили компонент того, на кого действует эффект. { - if (IoCManager.Resolve().CurTime < comp.LastEffect + DelayTime) - return; - - comp.CurrentAddictedTime += DelayTime * TimeCoefficient; + if (comp.LastEffect + DelayTime >= IoCManager.Resolve().CurTime) + comp.CurrentAddictedTime += (IoCManager.Resolve().CurTime - comp.LastEffect) * 2; + else + comp.CurrentAddictedTime += TimeSpan.FromSeconds(1) * TimeCoefficient * 2; comp.RemaningTime = comp.ChangeAddictionTypeTime; + comp.TypeAddiction = 4; comp.LastEffect = IoCManager.Resolve().CurTime; } } diff --git a/Content.Shared/ADT/Addiction/AddictedComponent.cs b/Content.Shared/ADT/Addiction/AddictedComponent.cs index 2fcf967a2e8..152b4f4aa78 100644 --- a/Content.Shared/ADT/Addiction/AddictedComponent.cs +++ b/Content.Shared/ADT/Addiction/AddictedComponent.cs @@ -26,7 +26,7 @@ public sealed partial class AddictedComponent : Component /// /// Собсна тип зависимости. 0 - легкая, без побочек, 1 - с небольшими побочками и т п, до 4 /// - [DataField] public int TypeAddiction; + [DataField] public int TypeAddiction = 4; /// /// собсна сообщает нам имеет ли зависимость пациент /// diff --git a/Resources/Prototypes/Reagents/narcotics.yml b/Resources/Prototypes/Reagents/narcotics.yml index e676560d770..43b8c251f6d 100644 --- a/Resources/Prototypes/Reagents/narcotics.yml +++ b/Resources/Prototypes/Reagents/narcotics.yml @@ -230,8 +230,8 @@ - addiction-message-5 - addiction-message-6 - !type:AddictionEffect - timeCoefficient: 10 - quantityCoefficient: 10 + timeCoefficient: 1 + quantityCoefficient: 2 #ADT end # TODO: Replace these nonstandardized effects with generic brain damage From 2e6d3c7e6582165bd6993b6d6174afbf92370e05 Mon Sep 17 00:00:00 2001 From: Bolper Date: Tue, 17 Sep 2024 16:16:33 +0300 Subject: [PATCH 09/10] ~ --- Content.Server/ADT/Addiction/AddictionSystem.cs | 8 ++++++-- Content.Server/ADT/Addiction/EntityEffects.cs | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Content.Server/ADT/Addiction/AddictionSystem.cs b/Content.Server/ADT/Addiction/AddictionSystem.cs index 160521e6c7d..661c4932cfe 100644 --- a/Content.Server/ADT/Addiction/AddictionSystem.cs +++ b/Content.Server/ADT/Addiction/AddictionSystem.cs @@ -8,6 +8,7 @@ namespace Content.Server.ADT.Addiction; public sealed partial class AddictionSystem : EntitySystem { [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private readonly SharedPopupSystem _popup = default!; public override void Update(float frameTime) { @@ -18,7 +19,7 @@ public override void Update(float frameTime) { UpdateCurrentAddictedTime(comp, fT); UpdateTypeAddiction(comp); - UpdateAddicted(comp); + UpdateAddicted(comp, uid); } } public void UpdateCurrentAddictedTime(AddictedComponent comp, TimeSpan frameTime) @@ -40,9 +41,12 @@ public void UpdateTypeAddiction(AddictedComponent comp) comp.TypeAddiction -= 1; } } - public void UpdateAddicted(AddictedComponent comp) + public void UpdateAddicted(AddictedComponent comp, EntityUid uid) { if (comp.CurrentAddictedTime >= comp.RequiredTime) + { comp.Addicted = true; + _popup.PopupEntity("У вас сформировывается зависимость", uid, uid); + } } } diff --git a/Content.Server/ADT/Addiction/EntityEffects.cs b/Content.Server/ADT/Addiction/EntityEffects.cs index be43ce2e9e3..d09f4e43b67 100644 --- a/Content.Server/ADT/Addiction/EntityEffects.cs +++ b/Content.Server/ADT/Addiction/EntityEffects.cs @@ -29,7 +29,8 @@ public override void Effect(EntityEffectBaseArgs ev) else comp.CurrentAddictedTime += TimeSpan.FromSeconds(1) * TimeCoefficient * 2; comp.RemaningTime = comp.ChangeAddictionTypeTime; - comp.TypeAddiction = 4; + if comp.TypeAddiction < 4 + comp.TypeAddiction += 1; comp.LastEffect = IoCManager.Resolve().CurTime; } } From f0f3d9932afa383529df588253842c142c96d32e Mon Sep 17 00:00:00 2001 From: Bolper Date: Tue, 17 Sep 2024 17:27:26 +0300 Subject: [PATCH 10/10] ~ --- Content.Server/ADT/Addiction/EntityEffects.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Server/ADT/Addiction/EntityEffects.cs b/Content.Server/ADT/Addiction/EntityEffects.cs index d09f4e43b67..7061a5cc656 100644 --- a/Content.Server/ADT/Addiction/EntityEffects.cs +++ b/Content.Server/ADT/Addiction/EntityEffects.cs @@ -29,7 +29,7 @@ public override void Effect(EntityEffectBaseArgs ev) else comp.CurrentAddictedTime += TimeSpan.FromSeconds(1) * TimeCoefficient * 2; comp.RemaningTime = comp.ChangeAddictionTypeTime; - if comp.TypeAddiction < 4 + if (comp.TypeAddiction < 4) comp.TypeAddiction += 1; comp.LastEffect = IoCManager.Resolve().CurTime; }