Neuro control implant (#253)
* - add: Neuro control implanter. * - tweak: Less beanbag stamina damage. * - tweak: No heat damage.
This commit is contained in:
@@ -2,6 +2,7 @@ using Content.Server.Administration.Logs;
|
|||||||
using Content.Server.Mind;
|
using Content.Server.Mind;
|
||||||
using Content.Server.Popups;
|
using Content.Server.Popups;
|
||||||
using Content.Server.Roles;
|
using Content.Server.Roles;
|
||||||
|
using Content.Shared._White.Implants.NeuroControl;
|
||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
using Content.Shared.Implants;
|
using Content.Shared.Implants;
|
||||||
using Content.Shared.Implants.Components;
|
using Content.Shared.Implants.Components;
|
||||||
@@ -41,6 +42,13 @@ public sealed class MindShieldSystem : EntitySystem
|
|||||||
EnsureComp<MindShieldComponent>(ev.Implanted.Value);
|
EnsureComp<MindShieldComponent>(ev.Implanted.Value);
|
||||||
MindShieldRemovalCheck(ev.Implanted.Value, ev.Implant);
|
MindShieldRemovalCheck(ev.Implanted.Value, ev.Implant);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WD START
|
||||||
|
if (_tag.HasTag(ev.Implant, NeuroControlComponent.NeuroControlTag) && ev.Implanted != null)
|
||||||
|
{
|
||||||
|
EnsureComp<NeuroControlComponent>(ev.Implanted.Value);
|
||||||
|
}
|
||||||
|
// WD END
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Content.Server.Stunnable.Components;
|
using Content.Server.Stunnable.Components;
|
||||||
|
using Content.Shared._White.Implants.NeuroControl;
|
||||||
using Content.Shared.Standing;
|
using Content.Shared.Standing;
|
||||||
using Content.Shared.StatusEffect;
|
using Content.Shared.StatusEffect;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
@@ -12,6 +13,7 @@ namespace Content.Server.Stunnable
|
|||||||
internal sealed class StunOnCollideSystem : EntitySystem
|
internal sealed class StunOnCollideSystem : EntitySystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly StunSystem _stunSystem = default!;
|
[Dependency] private readonly StunSystem _stunSystem = default!;
|
||||||
|
[Dependency] private readonly NeuroControlSystem _neuroControl = default!; // WD EDIT
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -22,14 +24,32 @@ namespace Content.Server.Stunnable
|
|||||||
|
|
||||||
private void TryDoCollideStun(EntityUid uid, StunOnCollideComponent component, EntityUid target)
|
private void TryDoCollideStun(EntityUid uid, StunOnCollideComponent component, EntityUid target)
|
||||||
{
|
{
|
||||||
|
// WD START
|
||||||
|
var neuroControlled = HasComp<NeuroControlComponent>(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<StatusEffectsComponent>(target, out var status))
|
if (EntityManager.TryGetComponent<StatusEffectsComponent>(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);
|
status);
|
||||||
|
|
||||||
|
if (neuroControlled)
|
||||||
|
{
|
||||||
|
_neuroControl.Electrocute(target, component.StunAmount * 6, status);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// WD EDIT END
|
||||||
|
|
||||||
_stunSystem.TrySlowdown(target, TimeSpan.FromSeconds(component.SlowdownAmount), true,
|
_stunSystem.TrySlowdown(target, TimeSpan.FromSeconds(component.SlowdownAmount), true,
|
||||||
component.WalkSpeedMultiplier, component.RunSpeedMultiplier, status);
|
component.WalkSpeedMultiplier, component.RunSpeedMultiplier, status);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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<TagPrototype>]
|
||||||
|
public const string NeuroControlTag = "NeuroControl";
|
||||||
|
}
|
||||||
@@ -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<NeuroControlComponent, BeforeStaminaDamageEvent>(BeforeStaminaDamage);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BeforeStaminaDamage(Entity<NeuroControlComponent> 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
5
Resources/Locale/ru-RU/_white/implants/neurocontrol.ftl
Normal file
5
Resources/Locale/ru-RU/_white/implants/neurocontrol.ftl
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
uplink-neuro-control = Имплант нейро контроля
|
||||||
|
uplink-neuro-control-desc = Блокирует весь входящий урон по выносливости, компенсируя его шоковым зарядом, наносящим урон, пропорциональный заблокированному.
|
||||||
|
|
||||||
|
ent-NeuroControlImplant = Имплант нейро контроля
|
||||||
|
.desc = Блокирует весь входящий урон по выносливости за счет шока.
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
penetrationLayer: MobLayer
|
penetrationLayer: MobLayer
|
||||||
- type: StaminaDamageOnCollide
|
- type: StaminaDamageOnCollide
|
||||||
ignoreResistances: false
|
ignoreResistances: false
|
||||||
damage: 70
|
damage: 60
|
||||||
- type: TimedDespawn
|
- type: TimedDespawn
|
||||||
lifetime: 0.25
|
lifetime: 0.25
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
Blunt: 10
|
Blunt: 10
|
||||||
- type: StaminaDamageOnCollide
|
- type: StaminaDamageOnCollide
|
||||||
ignoreResistances: false
|
ignoreResistances: false
|
||||||
damage: 70
|
damage: 60
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: PelletShotgun
|
id: PelletShotgun
|
||||||
|
|||||||
@@ -208,7 +208,7 @@
|
|||||||
- type: Projectile
|
- type: Projectile
|
||||||
damage:
|
damage:
|
||||||
types:
|
types:
|
||||||
Heat: 5
|
Heat: 0
|
||||||
soundHit:
|
soundHit:
|
||||||
path: "/Audio/Weapons/Guns/Hits/taser_hit.ogg"
|
path: "/Audio/Weapons/Guns/Hits/taser_hit.ogg"
|
||||||
forceSound: true
|
forceSound: true
|
||||||
|
|||||||
@@ -231,6 +231,16 @@
|
|||||||
categories:
|
categories:
|
||||||
- UplinkImplants
|
- UplinkImplants
|
||||||
|
|
||||||
|
- type: listing
|
||||||
|
id: NeuroControlImplanter
|
||||||
|
name: uplink-neuro-control
|
||||||
|
description: uplink-neuro-control-desc
|
||||||
|
productEntity: NeuroControlImplanter
|
||||||
|
cost:
|
||||||
|
Telecrystal: 2
|
||||||
|
categories:
|
||||||
|
- UplinkImplants
|
||||||
|
|
||||||
- type: listing
|
- type: listing
|
||||||
id: UplinkImplanterSyndi
|
id: UplinkImplanterSyndi
|
||||||
name: Имплантер
|
name: Имплантер
|
||||||
|
|||||||
@@ -22,6 +22,14 @@
|
|||||||
- type: Implanter
|
- type: Implanter
|
||||||
implant: MindslaveImplant
|
implant: MindslaveImplant
|
||||||
|
|
||||||
|
- type: entity
|
||||||
|
id: NeuroControlImplanter
|
||||||
|
parent: BaseImplantOnlyImplanterSyndi
|
||||||
|
suffix: neuro control
|
||||||
|
components:
|
||||||
|
- type: Implanter
|
||||||
|
implant: NeuroControlImplant
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: ImplanterSyndi
|
id: ImplanterSyndi
|
||||||
parent: Implanter
|
parent: Implanter
|
||||||
|
|||||||
@@ -36,3 +36,16 @@
|
|||||||
tags:
|
tags:
|
||||||
- MindSlave
|
- 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
|
||||||
|
|
||||||
|
|||||||
@@ -57,3 +57,6 @@
|
|||||||
|
|
||||||
- type: Tag
|
- type: Tag
|
||||||
id: BaseModule
|
id: BaseModule
|
||||||
|
|
||||||
|
- type: Tag
|
||||||
|
id: NeuroControl
|
||||||
|
|||||||
Reference in New Issue
Block a user