Neuro control implant (#253)

* - add: Neuro control implanter.

* - tweak: Less beanbag stamina damage.

* - tweak: No heat damage.
This commit is contained in:
Aviu00
2024-03-30 21:02:10 +09:00
committed by GitHub
parent 034a18b1d0
commit a2a5459a07
12 changed files with 111 additions and 5 deletions

View File

@@ -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<MindShieldComponent>(ev.Implanted.Value);
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>

View File

@@ -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<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))
{
_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);
}

View File

@@ -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";
}

View File

@@ -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);
}
}

View File

@@ -0,0 +1,5 @@
uplink-neuro-control = Имплант нейро контроля
uplink-neuro-control-desc = Блокирует весь входящий урон по выносливости, компенсируя его шоковым зарядом, наносящим урон, пропорциональный заблокированному.
ent-NeuroControlImplant = Имплант нейро контроля
.desc = Блокирует весь входящий урон по выносливости за счет шока.

View File

@@ -16,7 +16,7 @@
penetrationLayer: MobLayer
- type: StaminaDamageOnCollide
ignoreResistances: false
damage: 70
damage: 60
- type: TimedDespawn
lifetime: 0.25

View File

@@ -27,7 +27,7 @@
Blunt: 10
- type: StaminaDamageOnCollide
ignoreResistances: false
damage: 70
damage: 60
- type: entity
id: PelletShotgun

View File

@@ -208,7 +208,7 @@
- type: Projectile
damage:
types:
Heat: 5
Heat: 0
soundHit:
path: "/Audio/Weapons/Guns/Hits/taser_hit.ogg"
forceSound: true

View File

@@ -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: Имплантер

View File

@@ -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

View File

@@ -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

View File

@@ -57,3 +57,6 @@
- type: Tag
id: BaseModule
- type: Tag
id: NeuroControl