prevent nettles from injecting through hardsuit (#14895)

* prevent nettles from injecting through hardsuit

* pro

* better

* pro

* pro

* noob

* inject popup

* caution

* )

* ;

* 💀

* 💀

* scaf + bomb suit immune to nettle

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-04-11 02:19:43 +00:00
committed by GitHub
parent 5d66215513
commit 27bdc5d4b5
8 changed files with 32 additions and 0 deletions

View File

@@ -15,6 +15,12 @@ namespace Content.Server.Chemistry.Components
[DataField("transferEfficiency")]
private float _transferEfficiency = 1f;
/// <summary>
/// Whether this will inject through hardsuits or not.
/// </summary>
[DataField("pierceArmor"), ViewVariables(VVAccess.ReadWrite)]
public bool PierceArmor = true;
/// <summary>
/// Solution to inject from.
/// </summary>

View File

@@ -15,7 +15,10 @@ using Content.Shared.Database;
using Content.Shared.FixedPoint;
using Content.Shared.Hands.Components;
using Content.Shared.IdentityManagement;
using Content.Shared.Inventory;
using Content.Shared.Popups;
using Content.Shared.StatusEffect;
using Content.Shared.Tag;
using Content.Shared.Verbs;
using Content.Shared.Weapons.Melee;
using Content.Shared.Weapons.Melee.Events;
@@ -35,8 +38,10 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem
[Dependency] private readonly BloodstreamSystem _bloodstream = default!;
[Dependency] private readonly ContestsSystem _contests = default!;
[Dependency] private readonly ExamineSystem _examine = default!;
[Dependency] private readonly InventorySystem _inventory = default!;
[Dependency] private readonly LagCompensationSystem _lag = default!;
[Dependency] private readonly SolutionContainerSystem _solutions = default!;
[Dependency] private readonly TagSystem _tag = default!;
public override void Initialize()
{
@@ -254,6 +259,13 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem
if (Deleted(entity))
continue;
// prevent deathnettles injecting through hardsuits
if (!comp.PierceArmor && _inventory.TryGetSlotEntity(entity, "outerClothing", out var suit) && _tag.HasTag(suit.Value, "Hardsuit"))
{
PopupSystem.PopupEntity(Loc.GetString("melee-inject-failed-hardsuit", ("weapon", owner)), args.User, args.User, PopupType.SmallCaution);
continue;
}
if (bloodQuery.TryGetComponent(entity, out var bloodstream))
hitBloodstreams.Add((entity, bloodstream));
}

View File

@@ -0,0 +1 @@
melee-inject-failed-hardsuit = Your {$weapon} cannot inject through hardsuits!

View File

@@ -163,6 +163,9 @@
- type: ExplosionResistance
damageCoefficient: 0.8
- type: GroupExamine
- type: Tag
tags:
- Hardsuit
- type: entity
parent: ClothingOuterBaseLarge

View File

@@ -74,6 +74,9 @@
containers:
toggleable-clothing: !type:ContainerSlot {}
- type: GroupExamine
- type: Tag
tags:
- Hardsuit
- type: entity
abstract: true

View File

@@ -18,6 +18,9 @@
- type: ExplosionResistance
damageCoefficient: 0.65
- type: GroupExamine
- type: Tag
tags:
- Hardsuit
- type: entity
parent: ClothingOuterEVASuitBase

View File

@@ -133,6 +133,7 @@
- type: MeleeChemicalInjector
transferAmount: 6 #To OD someone you would need 2 nettles and about 6-7 hits, the DOT is likely to crit them if they are running away with almost no health
solution: food
pierceArmor: false
- type: Extractable
grindableSolutionName: food

View File

@@ -293,6 +293,9 @@
- type: Tag
id: Handcuffs
- type: Tag
id: Hardsuit # Prevent melee injectors that can't penetrate hardsuits from injecting the wearer (nettles)
- type: Tag
id: Head