diff --git a/Content.Server/Chemistry/Components/MeleeChemicalInjectorComponent.cs b/Content.Server/Chemistry/Components/MeleeChemicalInjectorComponent.cs index 4b855f759a..2042c1d212 100644 --- a/Content.Server/Chemistry/Components/MeleeChemicalInjectorComponent.cs +++ b/Content.Server/Chemistry/Components/MeleeChemicalInjectorComponent.cs @@ -15,6 +15,12 @@ namespace Content.Server.Chemistry.Components [DataField("transferEfficiency")] private float _transferEfficiency = 1f; + /// + /// Whether this will inject through hardsuits or not. + /// + [DataField("pierceArmor"), ViewVariables(VVAccess.ReadWrite)] + public bool PierceArmor = true; + /// /// Solution to inject from. /// diff --git a/Content.Server/Weapons/Melee/MeleeWeaponSystem.cs b/Content.Server/Weapons/Melee/MeleeWeaponSystem.cs index 7d8c0873e9..c354a82bcc 100644 --- a/Content.Server/Weapons/Melee/MeleeWeaponSystem.cs +++ b/Content.Server/Weapons/Melee/MeleeWeaponSystem.cs @@ -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)); } diff --git a/Resources/Locale/en-US/weapons/melee/melee.ftl b/Resources/Locale/en-US/weapons/melee/melee.ftl new file mode 100644 index 0000000000..ad18c43121 --- /dev/null +++ b/Resources/Locale/en-US/weapons/melee/melee.ftl @@ -0,0 +1 @@ +melee-inject-failed-hardsuit = Your {$weapon} cannot inject through hardsuits! diff --git a/Resources/Prototypes/Entities/Clothing/OuterClothing/armor.yml b/Resources/Prototypes/Entities/Clothing/OuterClothing/armor.yml index e15cfebf98..a270f4a959 100644 --- a/Resources/Prototypes/Entities/Clothing/OuterClothing/armor.yml +++ b/Resources/Prototypes/Entities/Clothing/OuterClothing/armor.yml @@ -163,6 +163,9 @@ - type: ExplosionResistance damageCoefficient: 0.8 - type: GroupExamine + - type: Tag + tags: + - Hardsuit - type: entity parent: ClothingOuterBaseLarge diff --git a/Resources/Prototypes/Entities/Clothing/OuterClothing/base_clothingouter.yml b/Resources/Prototypes/Entities/Clothing/OuterClothing/base_clothingouter.yml index af41be3c40..aed8e69035 100644 --- a/Resources/Prototypes/Entities/Clothing/OuterClothing/base_clothingouter.yml +++ b/Resources/Prototypes/Entities/Clothing/OuterClothing/base_clothingouter.yml @@ -74,6 +74,9 @@ containers: toggleable-clothing: !type:ContainerSlot {} - type: GroupExamine + - type: Tag + tags: + - Hardsuit - type: entity abstract: true diff --git a/Resources/Prototypes/Entities/Clothing/OuterClothing/suits.yml b/Resources/Prototypes/Entities/Clothing/OuterClothing/suits.yml index 5ec3c1ebaf..8254b3e91d 100644 --- a/Resources/Prototypes/Entities/Clothing/OuterClothing/suits.yml +++ b/Resources/Prototypes/Entities/Clothing/OuterClothing/suits.yml @@ -18,6 +18,9 @@ - type: ExplosionResistance damageCoefficient: 0.65 - type: GroupExamine + - type: Tag + tags: + - Hardsuit - type: entity parent: ClothingOuterEVASuitBase diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml index 5910191b36..f0462227ce 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml @@ -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 diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml index f7870ccdc6..8b4550abc1 100644 --- a/Resources/Prototypes/tags.yml +++ b/Resources/Prototypes/tags.yml @@ -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