From 0f771204cfa53b6e458d0f7d626f3e623913eb3b Mon Sep 17 00:00:00 2001 From: Spatison <137375981+Spatison@users.noreply.github.com> Date: Thu, 10 Oct 2024 21:46:37 +0300 Subject: [PATCH 1/4] add: neuro stabilizer implant --- .../SubdermalBionicSyrinxImplantSystem.cs | 15 ++-- Content.Server/Mindshield/MindShieldSystem.cs | 64 ---------------- .../_White/Implants/ImplantsSystem.cs | 76 +++++++++++++++++++ .../Implants/SharedImplanterSystem.cs | 32 ++++++++ .../Implants/SharedSubdermalImplantSystem.cs | 25 +----- .../NeuroStabilizerComponent.cs | 14 ++++ .../NeuroStabilizerSystem.cs | 28 +++++++ .../en-US/_white/store/uplink-catalog.ftl | 3 + .../_white/implants/neurostabilization.ftl | 5 -- .../entities/objects/misc/implanters.ftl | 3 + .../objects/misc/subdermal_implants.ftl | 2 + .../ru-RU/_white/store/uplink-catalog.ftl | 3 + .../Objects/Misc/subdermal_implants.yml | 1 - .../_White/Catalog/uplink_catalog.yml | 15 +++- .../Entities/Objects/Misc/implanters.yml | 7 ++ .../Objects/Misc/subdermal_implants.yml | 11 +++ Resources/Prototypes/_White/tags.yml | 5 +- 17 files changed, 205 insertions(+), 104 deletions(-) delete mode 100644 Content.Server/Mindshield/MindShieldSystem.cs create mode 100644 Content.Server/_White/Implants/ImplantsSystem.cs create mode 100644 Content.Shared/_White/Implants/NeuroStabilization/NeuroStabilizerComponent.cs create mode 100644 Content.Shared/_White/Implants/NeuroStabilization/NeuroStabilizerSystem.cs delete mode 100644 Resources/Locale/ru-RU/_white/implants/neurostabilization.ftl create mode 100644 Resources/Locale/ru-RU/_white/prototypes/entities/objects/misc/implanters.ftl create mode 100644 Resources/Locale/ru-RU/_white/prototypes/entities/objects/misc/subdermal_implants.ftl create mode 100644 Resources/Prototypes/_White/Entities/Objects/Misc/implanters.yml create mode 100644 Resources/Prototypes/_White/Entities/Objects/Misc/subdermal_implants.yml diff --git a/Content.Server/DeltaV/Implants/SubdermalBionicSyrinxImplantSystem.cs b/Content.Server/DeltaV/Implants/SubdermalBionicSyrinxImplantSystem.cs index 30a894a2d1..96adfc2ab2 100644 --- a/Content.Server/DeltaV/Implants/SubdermalBionicSyrinxImplantSystem.cs +++ b/Content.Server/DeltaV/Implants/SubdermalBionicSyrinxImplantSystem.cs @@ -29,7 +29,7 @@ public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnInsert); + SubscribeLocalEvent(OnInsert); // WD EDIT SubscribeLocalEvent(OnSpeakerNameTransform); SubscribeLocalEvent(OnChangeName); // We need to remove the SyrinxVoiceMaskComponent from the owner before the implant @@ -37,16 +37,17 @@ public override void Initialize() SubscribeLocalEvent(OnRemove, before: new[] { typeof(SubdermalImplantSystem) }); } - private void OnInsert(EntityUid uid, VoiceMaskerComponent component, ImplantImplantedEvent args) + // WD EDIT START + private void OnInsert(EntityUid uid, VoiceMaskerComponent component, SubdermalImplantInserted args) { - if (!args.Implanted.HasValue || - !_tag.HasTag(args.Implant, BionicSyrinxImplant)) + if (_tag.HasTag(uid, BionicSyrinxImplant)) return; - var voicemask = EnsureComp(args.Implanted.Value); - voicemask.VoiceName = MetaData(args.Implanted.Value).EntityName; - Dirty(args.Implanted.Value, voicemask); + var voicemask = EnsureComp(args.Target); + voicemask.VoiceName = MetaData(args.Target).EntityName; + Dirty(args.Target, voicemask); } + // WD EDIT END private void OnRemove(EntityUid uid, VoiceMaskerComponent component, EntGotRemovedFromContainerMessage args) { diff --git a/Content.Server/Mindshield/MindShieldSystem.cs b/Content.Server/Mindshield/MindShieldSystem.cs deleted file mode 100644 index bfca6c008e..0000000000 --- a/Content.Server/Mindshield/MindShieldSystem.cs +++ /dev/null @@ -1,64 +0,0 @@ -using Content.Server.Administration.Logs; -using Content.Server.Mind; -using Content.Server.Popups; -using Content.Server.Roles; -using Content.Shared.Database; -using Content.Shared.Implants; -using Content.Shared.Implants.Components; -using Content.Shared.Mindshield.Components; -using Content.Shared.Revolutionary.Components; -using Content.Shared.Tag; - -namespace Content.Server.Mindshield; - -/// -/// System used for checking if the implanted is a Rev or Head Rev. -/// -public sealed class MindShieldSystem : EntitySystem -{ - [Dependency] private readonly IAdminLogManager _adminLogManager = default!; - [Dependency] private readonly RoleSystem _roleSystem = default!; - [Dependency] private readonly MindSystem _mindSystem = default!; - [Dependency] private readonly TagSystem _tag = default!; - [Dependency] private readonly PopupSystem _popupSystem = default!; - - [ValidatePrototypeId] - public const string MindShieldTag = "MindShield"; - - public override void Initialize() - { - base.Initialize(); - SubscribeLocalEvent(ImplantCheck); - } - - /// - /// Checks if the implant was a mindshield or not - /// - public void ImplantCheck(EntityUid uid, SubdermalImplantComponent comp, ref ImplantImplantedEvent ev) - { - if (_tag.HasTag(ev.Implant, MindShieldTag) && ev.Implanted != null) - { - EnsureComp(ev.Implanted.Value); - MindShieldRemovalCheck(ev.Implanted.Value, ev.Implant); - } - } - - /// - /// Checks if the implanted person was a Rev or Head Rev and remove role or destroy mindshield respectively. - /// - public void MindShieldRemovalCheck(EntityUid implanted, EntityUid implant) - { - if (HasComp(implanted)) - { - _popupSystem.PopupEntity(Loc.GetString("head-rev-break-mindshield"), implanted); - QueueDel(implant); - return; - } - - if (_mindSystem.TryGetMind(implanted, out var mindId, out _) && - _roleSystem.MindTryRemoveRole(mindId)) - { - _adminLogManager.Add(LogType.Mind, LogImpact.Medium, $"{ToPrettyString(implanted)} was deconverted due to being implanted with a Mindshield."); - } - } -} diff --git a/Content.Server/_White/Implants/ImplantsSystem.cs b/Content.Server/_White/Implants/ImplantsSystem.cs new file mode 100644 index 0000000000..838515c0e4 --- /dev/null +++ b/Content.Server/_White/Implants/ImplantsSystem.cs @@ -0,0 +1,76 @@ +using Content.Server.Administration.Logs; +using Content.Server.Mind; +using Content.Server.Popups; +using Content.Server.Roles; +using Content.Shared._White.Implants.NeuroStabilization; +using Content.Shared.Database; +using Content.Shared.Implants; +using Content.Shared.Implants.Components; +using Content.Shared.Mindshield.Components; +using Content.Shared.Revolutionary.Components; +using Content.Shared.Tag; + +namespace Content.Server._White.Implants; + +public sealed class ImplantsSystem : EntitySystem +{ + [Dependency] private readonly IAdminLogManager _adminLogManager = default!; + [Dependency] private readonly RoleSystem _roleSystem = default!; + [Dependency] private readonly MindSystem _mindSystem = default!; + [Dependency] private readonly TagSystem _tag = default!; + [Dependency] private readonly PopupSystem _popupSystem = default!; + + [ValidatePrototypeId] + private const string MindShieldTag = "MindShield"; + + [ValidatePrototypeId] + private const string NeuroStabilizationTag = "NeuroStabilization"; + + public override void Initialize() + { + base.Initialize(); + SubscribeLocalEvent(OnImplantInserted); + SubscribeLocalEvent(OnImplantRemoved); + } + + private void OnImplantInserted(EntityUid uid, SubdermalImplantComponent component, SubdermalImplantInserted args) + { + if (_tag.HasTag(uid, MindShieldTag) + && RevolutionCheck(uid, args.Target)) + EnsureComp(args.Target); + + if (_tag.HasTag(uid, NeuroStabilizationTag)) + EnsureComp(args.Target); + } + + private void OnImplantRemoved(EntityUid uid, SubdermalImplantComponent component, SubdermalImplantRemoved args) + { + if (_tag.HasTag(uid, MindShieldTag)) + RemComp(args.Target); + + if (_tag.HasTag(uid, NeuroStabilizationTag)) + RemComp(args.Target); + } + + /// + /// Checks if the implanted person was a Rev or Head Rev and remove role or destroy mindshield respectively. + /// + private bool RevolutionCheck(EntityUid uid, EntityUid target) + { + if (HasComp(target)) + { + _popupSystem.PopupEntity(Loc.GetString("head-rev-break-mindshield"), target); + QueueDel(uid); + return false; + } + + if (!_mindSystem.TryGetMind(target, out var mindId, out _) + || !_roleSystem.MindTryRemoveRole(mindId)) + return true; + + _adminLogManager.Add(LogType.Mind, LogImpact.Medium, + $"{ToPrettyString(target)} was deconverted due to being implanted with a Mindshield."); + return false; + + } +} diff --git a/Content.Shared/Implants/SharedImplanterSystem.cs b/Content.Shared/Implants/SharedImplanterSystem.cs index 36a31bac1d..dce599ef15 100644 --- a/Content.Shared/Implants/SharedImplanterSystem.cs +++ b/Content.Shared/Implants/SharedImplanterSystem.cs @@ -69,6 +69,8 @@ public void Implant(EntityUid user, EntityUid target, EntityUid implanter, Impla implantContainer.OccludesLight = false; _container.Insert(implant.Value, implantContainer); + RaiseLocalEvent(implant.Value, new SubdermalImplantInserted(user, target)); // WD EDIT + if (component.CurrentMode == ImplanterToggleMode.Inject && !component.ImplantOnly) DrawMode(implanter, component); else @@ -146,6 +148,8 @@ public void Draw(EntityUid implanter, EntityUid user, EntityUid target, Implante _container.Insert(implant, implanterContainer); permanentFound = implantComp.Permanent; + RaiseLocalEvent(implant, new SubdermalImplantRemoved(user, target)); // WD EDIT + var ev = new TransferDnaEvent { Donor = target, Recipient = implanter }; RaiseLocalEvent(target, ref ev); @@ -225,3 +229,31 @@ public AddImplantAttemptEvent(EntityUid user, EntityUid target, EntityUid implan Implanter = implanter; } } + +// WD EDIT START +public sealed class SubdermalImplantInserted(EntityUid user, EntityUid target) +{ + /// + /// Entity who implants + /// + public EntityUid User = user; + + /// + /// Entity being implanted + /// + public EntityUid Target = target; +} + +public sealed class SubdermalImplantRemoved(EntityUid user, EntityUid target) +{ + /// + /// Entity who removes implant + /// + public EntityUid User = user; + + /// + /// Entity which implant is removing + /// + public EntityUid Target = target; +} +// WD EDIT END diff --git a/Content.Shared/Implants/SharedSubdermalImplantSystem.cs b/Content.Shared/Implants/SharedSubdermalImplantSystem.cs index 830d2270aa..0df552d8a6 100644 --- a/Content.Shared/Implants/SharedSubdermalImplantSystem.cs +++ b/Content.Shared/Implants/SharedSubdermalImplantSystem.cs @@ -53,9 +53,6 @@ private void OnInsert(EntityUid uid, SubdermalImplantComponent component, EntGot } } } - - var ev = new ImplantImplantedEvent(uid, component.ImplantedEntity.Value); - RaiseLocalEvent(uid, ref ev); } private void OnRemoveAttempt(EntityUid uid, SubdermalImplantComponent component, ContainerGettingRemovedAttemptEvent args) @@ -125,6 +122,8 @@ public void ForceImplant(EntityUid target, EntityUid implant, SubdermalImplantCo component.ImplantedEntity = target; _container.Insert(implant, implantContainer); + + RaiseLocalEvent(implant, new SubdermalImplantInserted(target, target)); // WD EDIT } /// @@ -185,23 +184,3 @@ public ImplantRelayEvent(T ev) Event = ev; } } - -/// -/// Event that is raised whenever someone is implanted with any given implant. -/// Raised on the the implant entity. -/// -/// -/// implant implant implant implant -/// -[ByRefEvent] -public readonly struct ImplantImplantedEvent -{ - public readonly EntityUid Implant; - public readonly EntityUid? Implanted; - - public ImplantImplantedEvent(EntityUid implant, EntityUid? implanted) - { - Implant = implant; - Implanted = implanted; - } -} diff --git a/Content.Shared/_White/Implants/NeuroStabilization/NeuroStabilizerComponent.cs b/Content.Shared/_White/Implants/NeuroStabilization/NeuroStabilizerComponent.cs new file mode 100644 index 0000000000..740f492946 --- /dev/null +++ b/Content.Shared/_White/Implants/NeuroStabilization/NeuroStabilizerComponent.cs @@ -0,0 +1,14 @@ +namespace Content.Shared._White.Implants.NeuroStabilization; + +[RegisterComponent] +public sealed partial class NeuroStabilizationComponent : Component +{ + [DataField] + public bool Electrocution = true; + + [DataField] + public TimeSpan TimeElectrocution = TimeSpan.FromSeconds(1); + + [DataField] + public float DamageModifier = 0.66f; +} diff --git a/Content.Shared/_White/Implants/NeuroStabilization/NeuroStabilizerSystem.cs b/Content.Shared/_White/Implants/NeuroStabilization/NeuroStabilizerSystem.cs new file mode 100644 index 0000000000..f339ae8117 --- /dev/null +++ b/Content.Shared/_White/Implants/NeuroStabilization/NeuroStabilizerSystem.cs @@ -0,0 +1,28 @@ +using Content.Shared.Electrocution; +using Content.Shared.Damage.Systems; + +namespace Content.Shared._White.Implants.NeuroStabilization; + +public sealed class NeuroStabilizerSystem : EntitySystem +{ + [Dependency] private readonly SharedElectrocutionSystem _electrocution = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(BeforeStaminaDamage); + } + + private void BeforeStaminaDamage(EntityUid uid, NeuroStabilizationComponent component, ref BeforeStaminaDamageEvent args) + { + args.Cancelled = true; + + if (component.Electrocution) + { + _electrocution.TryDoElectrocution(uid, null, + (int) MathF.Round(args.Value * component.DamageModifier), component.TimeElectrocution, + false, 0.5f, null, true); + } + } +} diff --git a/Resources/Locale/en-US/_white/store/uplink-catalog.ftl b/Resources/Locale/en-US/_white/store/uplink-catalog.ftl index f80d022535..0a22d43c02 100644 --- a/Resources/Locale/en-US/_white/store/uplink-catalog.ftl +++ b/Resources/Locale/en-US/_white/store/uplink-catalog.ftl @@ -9,3 +9,6 @@ uplink-betrayal-knife-desc = Syndicate teleporter, when used, moves 3-8 meters f uplink-ebow-name = Small energy crossbow uplink-ebow-desc = A fairly quiet weapon that automatically reloads and stuns. It goes well with other types of weapons. + +uplink-neuro-control = Neuro stabilization implanter +uplink-neuro-control-desc = Blocks all incoming stamina damage, compensating for it with a heat damage proportional to the blocked one. \ No newline at end of file diff --git a/Resources/Locale/ru-RU/_white/implants/neurostabilization.ftl b/Resources/Locale/ru-RU/_white/implants/neurostabilization.ftl deleted file mode 100644 index d360d68476..0000000000 --- a/Resources/Locale/ru-RU/_white/implants/neurostabilization.ftl +++ /dev/null @@ -1,5 +0,0 @@ -uplink-neuro-stabilization = Имплант нейростабилизации -uplink-neuro-stabilization-desc = Блокирует весь входящий урон по выносливости, компенсируя его шоковым зарядом. - -ent-NeuroStabilizationImplant = Имплант нейростабилизации - .desc = Блокирует весь входящий урон по выносливости за счет шока. diff --git a/Resources/Locale/ru-RU/_white/prototypes/entities/objects/misc/implanters.ftl b/Resources/Locale/ru-RU/_white/prototypes/entities/objects/misc/implanters.ftl new file mode 100644 index 0000000000..c3e61f3136 --- /dev/null +++ b/Resources/Locale/ru-RU/_white/prototypes/entities/objects/misc/implanters.ftl @@ -0,0 +1,3 @@ +ent-NeuroStabilizationImplanter = { ent-BaseImplanter } + .desc = { ent-BaseImplanter.desc } + .suffix = нейро стабилизация \ No newline at end of file diff --git a/Resources/Locale/ru-RU/_white/prototypes/entities/objects/misc/subdermal_implants.ftl b/Resources/Locale/ru-RU/_white/prototypes/entities/objects/misc/subdermal_implants.ftl new file mode 100644 index 0000000000..730fea53dd --- /dev/null +++ b/Resources/Locale/ru-RU/_white/prototypes/entities/objects/misc/subdermal_implants.ftl @@ -0,0 +1,2 @@ +ent-NeuroStabilizationImplant = имплант нейро стабализации + .desc = Блокирует весь входящий урон по выносливости за счет шока. \ No newline at end of file diff --git a/Resources/Locale/ru-RU/_white/store/uplink-catalog.ftl b/Resources/Locale/ru-RU/_white/store/uplink-catalog.ftl index 8d58a4bc17..d7aec3171f 100644 --- a/Resources/Locale/ru-RU/_white/store/uplink-catalog.ftl +++ b/Resources/Locale/ru-RU/_white/store/uplink-catalog.ftl @@ -9,3 +9,6 @@ uplink-experimental-syndicate-teleporter-desc = Телепортер синди uplink-ebow-name = Маленький энергетический арбалет uplink-ebow-desc = Довольно тихое оружие, которое автоматически перезаряжается и оглушает. Хорошо сочетается с другими видами оружия. + +uplink-neuro-control = Имплант нейро стабилизации +uplink-neuro-control-desc = Блокирует весь входящий урон по выносливости, компенсируя его шоковым зарядом, наносящим урон, пропорциональный заблокированному. \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml b/Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml index 2336945f17..d42af179a0 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml @@ -322,7 +322,6 @@ noSpawn: true components: - type: SubdermalImplant - permanent: true - type: Tag tags: - MindShield diff --git a/Resources/Prototypes/_White/Catalog/uplink_catalog.yml b/Resources/Prototypes/_White/Catalog/uplink_catalog.yml index c58efd96c6..bd5ccb423d 100644 --- a/Resources/Prototypes/_White/Catalog/uplink_catalog.yml +++ b/Resources/Prototypes/_White/Catalog/uplink_catalog.yml @@ -22,7 +22,6 @@ id: UplinkBetrayalKnife name: uplink-betrayal-knife-name description: uplink-betrayal-knife-desc - icon: { sprite: /Textures/_White/Objects/Weapons/Melee/Daggers/betrayal_knife.rsi, state: icon } productEntity: BetrayalKnife cost: Telecrystal: 10 @@ -39,7 +38,6 @@ id: UplinkMiniEbow name: uplink-ebow-name description: uplink-ebow-desc - icon: { sprite: /Textures/_White/Objects/Weapons/Guns/Battery/mini-ebow.rsi, state: icon } productEntity: EnergyCrossbowMini cost: Telecrystal: 10 @@ -50,4 +48,15 @@ blacklist: tags: - NukeOpsUplink - saleLimit: 1 \ No newline at end of file + saleLimit: 1 + +- type: listing + id: NeuroControlImplanter + name: uplink-neuro-control + description: uplink-neuro-control-desc + icon: { sprite: /Textures/Interface/Alerts/stamina.rsi, state: stamina5 } + productEntity: NeuroStabilizationImplanter + cost: + Telecrystal: 2 + categories: + - UplinkImplants \ No newline at end of file diff --git a/Resources/Prototypes/_White/Entities/Objects/Misc/implanters.yml b/Resources/Prototypes/_White/Entities/Objects/Misc/implanters.yml new file mode 100644 index 0000000000..063329bf54 --- /dev/null +++ b/Resources/Prototypes/_White/Entities/Objects/Misc/implanters.yml @@ -0,0 +1,7 @@ +- type: entity + parent: BaseImplantOnlyImplanterSyndi + id: NeuroStabilizationImplanter + suffix: neuro stabilization + components: + - type: Implanter + implant: NeuroStabilizationImplant \ No newline at end of file diff --git a/Resources/Prototypes/_White/Entities/Objects/Misc/subdermal_implants.yml b/Resources/Prototypes/_White/Entities/Objects/Misc/subdermal_implants.yml new file mode 100644 index 0000000000..9380840477 --- /dev/null +++ b/Resources/Prototypes/_White/Entities/Objects/Misc/subdermal_implants.yml @@ -0,0 +1,11 @@ +- type: entity + parent: BaseSubdermalImplant + id: NeuroStabilizationImplant + name: neuro stabilization implant + description: Blocks all incoming stamina damage at a cost of shock. + noSpawn: true + components: + - type: SubdermalImplant + - type: Tag + tags: + - NeuroStabilization \ No newline at end of file diff --git a/Resources/Prototypes/_White/tags.yml b/Resources/Prototypes/_White/tags.yml index 62e70f42a9..fe2392f438 100644 --- a/Resources/Prototypes/_White/tags.yml +++ b/Resources/Prototypes/_White/tags.yml @@ -1,2 +1,5 @@ - type: Tag - id: EnergySword \ No newline at end of file + id: EnergySword + +- type: Tag + id: NeuroStabilization \ No newline at end of file From cb8974f33764c0fc000bcb8cc4bbd5ecf67c84a8 Mon Sep 17 00:00:00 2001 From: Spatison <137375981+Spatison@users.noreply.github.com> Date: Thu, 10 Oct 2024 21:51:26 +0300 Subject: [PATCH 2/4] Stabilization\ --- .../_White/Implants/NeuroStabilization/NeuroStabilizerSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Shared/_White/Implants/NeuroStabilization/NeuroStabilizerSystem.cs b/Content.Shared/_White/Implants/NeuroStabilization/NeuroStabilizerSystem.cs index f339ae8117..1b2fd11358 100644 --- a/Content.Shared/_White/Implants/NeuroStabilization/NeuroStabilizerSystem.cs +++ b/Content.Shared/_White/Implants/NeuroStabilization/NeuroStabilizerSystem.cs @@ -3,7 +3,7 @@ namespace Content.Shared._White.Implants.NeuroStabilization; -public sealed class NeuroStabilizerSystem : EntitySystem +public sealed class NeuroStabilizationSystem : EntitySystem { [Dependency] private readonly SharedElectrocutionSystem _electrocution = default!; From be63f55f07ecabeb1dca0ffb6efb912232a7b24e Mon Sep 17 00:00:00 2001 From: Spatison <137375981+Spatison@users.noreply.github.com> Date: Thu, 10 Oct 2024 22:12:16 +0300 Subject: [PATCH 3/4] AI rewiew --- Content.Server/_White/Implants/ImplantsSystem.cs | 12 ++++++------ .../NeuroStabilization/NeuroStabilizerSystem.cs | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Content.Server/_White/Implants/ImplantsSystem.cs b/Content.Server/_White/Implants/ImplantsSystem.cs index 838515c0e4..81123097c4 100644 --- a/Content.Server/_White/Implants/ImplantsSystem.cs +++ b/Content.Server/_White/Implants/ImplantsSystem.cs @@ -64,13 +64,13 @@ private bool RevolutionCheck(EntityUid uid, EntityUid target) return false; } - if (!_mindSystem.TryGetMind(target, out var mindId, out _) - || !_roleSystem.MindTryRemoveRole(mindId)) - return true; - - _adminLogManager.Add(LogType.Mind, LogImpact.Medium, + if (_mindSystem.TryGetMind(target, out var mindId, out _) + && _roleSystem.MindTryRemoveRole(mindId)) + { + _adminLogManager.Add(LogType.Mind, LogImpact.Medium, $"{ToPrettyString(target)} was deconverted due to being implanted with a Mindshield."); - return false; + } + return true; } } diff --git a/Content.Shared/_White/Implants/NeuroStabilization/NeuroStabilizerSystem.cs b/Content.Shared/_White/Implants/NeuroStabilization/NeuroStabilizerSystem.cs index 1b2fd11358..c0234c71f3 100644 --- a/Content.Shared/_White/Implants/NeuroStabilization/NeuroStabilizerSystem.cs +++ b/Content.Shared/_White/Implants/NeuroStabilization/NeuroStabilizerSystem.cs @@ -18,11 +18,11 @@ private void BeforeStaminaDamage(EntityUid uid, NeuroStabilizationComponent comp { args.Cancelled = true; - if (component.Electrocution) - { - _electrocution.TryDoElectrocution(uid, null, - (int) MathF.Round(args.Value * component.DamageModifier), component.TimeElectrocution, - false, 0.5f, null, true); - } + if (!component.Electrocution) + return; + + var damage = (int) MathF.Round(args.Value * component.DamageModifier); + _electrocution.TryDoElectrocution(uid, null, damage, component.TimeElectrocution, + false, 0.5f, null, true); } } From bd6e4ffa4cdda22477484d248f44df605cabbd3a Mon Sep 17 00:00:00 2001 From: Remuchi <72476615+Remuchi@users.noreply.github.com> Date: Fri, 11 Oct 2024 11:16:21 +0700 Subject: [PATCH 4/4] fix: translation --- Resources/Locale/en-US/_white/store/uplink-catalog.ftl | 2 +- .../_White/Entities/Objects/Misc/subdermal_implants.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/Locale/en-US/_white/store/uplink-catalog.ftl b/Resources/Locale/en-US/_white/store/uplink-catalog.ftl index 0a22d43c02..9783c75bd2 100644 --- a/Resources/Locale/en-US/_white/store/uplink-catalog.ftl +++ b/Resources/Locale/en-US/_white/store/uplink-catalog.ftl @@ -11,4 +11,4 @@ uplink-ebow-name = Small energy crossbow uplink-ebow-desc = A fairly quiet weapon that automatically reloads and stuns. It goes well with other types of weapons. uplink-neuro-control = Neuro stabilization implanter -uplink-neuro-control-desc = Blocks all incoming stamina damage, compensating for it with a heat damage proportional to the blocked one. \ No newline at end of file +uplink-neuro-control-desc = Blocks all of the incoming stamina damage while dealing shock damage instead. \ No newline at end of file diff --git a/Resources/Prototypes/_White/Entities/Objects/Misc/subdermal_implants.yml b/Resources/Prototypes/_White/Entities/Objects/Misc/subdermal_implants.yml index 9380840477..b6a884e451 100644 --- a/Resources/Prototypes/_White/Entities/Objects/Misc/subdermal_implants.yml +++ b/Resources/Prototypes/_White/Entities/Objects/Misc/subdermal_implants.yml @@ -2,7 +2,7 @@ parent: BaseSubdermalImplant id: NeuroStabilizationImplant name: neuro stabilization implant - description: Blocks all incoming stamina damage at a cost of shock. + description: Blocks all of the incoming stamina damage at the cost of frying you nerve system a bit each time. noSpawn: true components: - type: SubdermalImplant