diff --git a/Content.Server/Mindshield/MindShieldSystem.cs b/Content.Server/Mindshield/MindShieldSystem.cs index bfca6c008e..40e6ca65d9 100644 --- a/Content.Server/Mindshield/MindShieldSystem.cs +++ b/Content.Server/Mindshield/MindShieldSystem.cs @@ -2,6 +2,7 @@ using Content.Server.Administration.Logs; using Content.Server.Mind; using Content.Server.Popups; using Content.Server.Roles; +using Content.Shared._White.Implants.NeuroControl; using Content.Shared.Database; using Content.Shared.Implants; using Content.Shared.Implants.Components; @@ -41,6 +42,13 @@ public sealed class MindShieldSystem : EntitySystem EnsureComp(ev.Implanted.Value); MindShieldRemovalCheck(ev.Implanted.Value, ev.Implant); } + + // WD START + if (_tag.HasTag(ev.Implant, NeuroControlComponent.NeuroControlTag) && ev.Implanted != null) + { + EnsureComp(ev.Implanted.Value); + } + // WD END } /// diff --git a/Content.Server/Stunnable/Systems/StunOnCollideSystem.cs b/Content.Server/Stunnable/Systems/StunOnCollideSystem.cs index 52e3cab79c..3b3811b71c 100644 --- a/Content.Server/Stunnable/Systems/StunOnCollideSystem.cs +++ b/Content.Server/Stunnable/Systems/StunOnCollideSystem.cs @@ -1,4 +1,5 @@ using Content.Server.Stunnable.Components; +using Content.Shared._White.Implants.NeuroControl; using Content.Shared.Standing; using Content.Shared.StatusEffect; using JetBrains.Annotations; @@ -12,6 +13,7 @@ namespace Content.Server.Stunnable internal sealed class StunOnCollideSystem : EntitySystem { [Dependency] private readonly StunSystem _stunSystem = default!; + [Dependency] private readonly NeuroControlSystem _neuroControl = default!; // WD EDIT public override void Initialize() { @@ -22,14 +24,32 @@ namespace Content.Server.Stunnable private void TryDoCollideStun(EntityUid uid, StunOnCollideComponent component, EntityUid target) { + // WD START + var neuroControlled = HasComp(target); + var stunAmount = component.StunAmount; + var knockdownAmount = component.KnockdownAmount; + if (neuroControlled) + { + stunAmount = Math.Max(1, stunAmount / 6); + knockdownAmount = Math.Max(1, knockdownAmount / 6); + } + // WD END if (EntityManager.TryGetComponent(target, out var status)) { - _stunSystem.TryStun(target, TimeSpan.FromSeconds(component.StunAmount), true, status); + // WD EDIT START + _stunSystem.TryStun(target, TimeSpan.FromSeconds(stunAmount), true, status); - _stunSystem.TryKnockdown(target, TimeSpan.FromSeconds(component.KnockdownAmount), true, + _stunSystem.TryKnockdown(target, TimeSpan.FromSeconds(knockdownAmount), true, status); + if (neuroControlled) + { + _neuroControl.Electrocute(target, component.StunAmount * 6, status); + return; + } + // WD EDIT END + _stunSystem.TrySlowdown(target, TimeSpan.FromSeconds(component.SlowdownAmount), true, component.WalkSpeedMultiplier, component.RunSpeedMultiplier, status); } diff --git a/Content.Shared/_White/Implants/NeuroControl/NeuroControlComponent.cs b/Content.Shared/_White/Implants/NeuroControl/NeuroControlComponent.cs new file mode 100644 index 0000000000..963f6920b4 --- /dev/null +++ b/Content.Shared/_White/Implants/NeuroControl/NeuroControlComponent.cs @@ -0,0 +1,11 @@ +using Content.Shared.Tag; +using Robust.Shared.GameStates; + +namespace Content.Shared._White.Implants.NeuroControl; + +[RegisterComponent, NetworkedComponent] +public sealed partial class NeuroControlComponent : Component +{ + [ValidatePrototypeId] + public const string NeuroControlTag = "NeuroControl"; +} diff --git a/Content.Shared/_White/Implants/NeuroControl/NeuroControlSystem.cs b/Content.Shared/_White/Implants/NeuroControl/NeuroControlSystem.cs new file mode 100644 index 0000000000..7fe36c47ff --- /dev/null +++ b/Content.Shared/_White/Implants/NeuroControl/NeuroControlSystem.cs @@ -0,0 +1,28 @@ +using Content.Shared.Damage.Systems; +using Content.Shared.Electrocution; +using Content.Shared.StatusEffect; + +namespace Content.Shared._White.Implants.NeuroControl; + +public sealed class NeuroControlSystem : EntitySystem +{ + [Dependency] private readonly SharedElectrocutionSystem _electrocution = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(BeforeStaminaDamage); + } + + private void BeforeStaminaDamage(Entity ent, ref BeforeStaminaDamageEvent args) + { + args.Cancelled = true; + Electrocute(ent, (int) MathF.Round(args.Value * 2f / 3f)); + } + + public void Electrocute(EntityUid uid, int damage, StatusEffectsComponent? status = null) + { + _electrocution.TryDoElectrocution(uid, null, damage, TimeSpan.FromSeconds(1), false, 0.5f, status, true); + } +} diff --git a/Resources/Locale/ru-RU/_white/implants/neurocontrol.ftl b/Resources/Locale/ru-RU/_white/implants/neurocontrol.ftl new file mode 100644 index 0000000000..d9edb2550d --- /dev/null +++ b/Resources/Locale/ru-RU/_white/implants/neurocontrol.ftl @@ -0,0 +1,5 @@ +uplink-neuro-control = Имплант нейро контроля +uplink-neuro-control-desc = Блокирует весь входящий урон по выносливости, компенсируя его шоковым зарядом, наносящим урон, пропорциональный заблокированному. + +ent-NeuroControlImplant = Имплант нейро контроля + .desc = Блокирует весь входящий урон по выносливости за счет шока. diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/grenade.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/grenade.yml index 133eadb047..9a9a93877d 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/grenade.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/grenade.yml @@ -16,7 +16,7 @@ penetrationLayer: MobLayer - type: StaminaDamageOnCollide ignoreResistances: false - damage: 70 + damage: 60 - type: TimedDespawn lifetime: 0.25 diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml index fb4d422a0d..51f15d8cae 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml @@ -27,7 +27,7 @@ Blunt: 10 - type: StaminaDamageOnCollide ignoreResistances: false - damage: 70 + damage: 60 - type: entity id: PelletShotgun diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml index 87d8d2a3a5..2cbf2d5c6e 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml @@ -208,7 +208,7 @@ - type: Projectile damage: types: - Heat: 5 + Heat: 0 soundHit: path: "/Audio/Weapons/Guns/Hits/taser_hit.ogg" forceSound: true diff --git a/Resources/Prototypes/_White/Catalog/uplink.yml b/Resources/Prototypes/_White/Catalog/uplink.yml index 09bdf2e136..dc7cc6e146 100644 --- a/Resources/Prototypes/_White/Catalog/uplink.yml +++ b/Resources/Prototypes/_White/Catalog/uplink.yml @@ -231,6 +231,16 @@ categories: - UplinkImplants +- type: listing + id: NeuroControlImplanter + name: uplink-neuro-control + description: uplink-neuro-control-desc + productEntity: NeuroControlImplanter + cost: + Telecrystal: 2 + categories: + - UplinkImplants + - type: listing id: UplinkImplanterSyndi name: Имплантер diff --git a/Resources/Prototypes/_White/Entities/Objects/Misc/implanters.yml b/Resources/Prototypes/_White/Entities/Objects/Misc/implanters.yml index a6e577d4d8..2c0ed97a46 100644 --- a/Resources/Prototypes/_White/Entities/Objects/Misc/implanters.yml +++ b/Resources/Prototypes/_White/Entities/Objects/Misc/implanters.yml @@ -22,6 +22,14 @@ - type: Implanter implant: MindslaveImplant +- type: entity + id: NeuroControlImplanter + parent: BaseImplantOnlyImplanterSyndi + suffix: neuro control + components: + - type: Implanter + implant: NeuroControlImplant + - type: entity id: ImplanterSyndi parent: Implanter diff --git a/Resources/Prototypes/_White/Entities/Objects/Misc/subdermal_implants.yml b/Resources/Prototypes/_White/Entities/Objects/Misc/subdermal_implants.yml index b916ec534f..5c080ad5e4 100644 --- a/Resources/Prototypes/_White/Entities/Objects/Misc/subdermal_implants.yml +++ b/Resources/Prototypes/_White/Entities/Objects/Misc/subdermal_implants.yml @@ -36,3 +36,16 @@ tags: - MindSlave +- type: entity + parent: BaseSubdermalImplant + id: NeuroControlImplant + name: neuro control implant + description: Blocks all incoming stamina damage at a cost of shock. + noSpawn: true + components: + - type: SubdermalImplant + permanent: true + - type: Tag + tags: + - NeuroControl + diff --git a/Resources/Prototypes/_White/tags.yml b/Resources/Prototypes/_White/tags.yml index 73d3311562..dd4aa0be70 100644 --- a/Resources/Prototypes/_White/tags.yml +++ b/Resources/Prototypes/_White/tags.yml @@ -57,3 +57,6 @@ - type: Tag id: BaseModule + +- type: Tag + id: NeuroControl