Нерф веществ

This commit is contained in:
BIGZi0348
2025-01-01 22:28:52 +03:00
parent 12bf0d18cc
commit df9bf3a883
3 changed files with 21 additions and 3 deletions

View File

@@ -2,7 +2,9 @@ using Content.Shared.Chemistry.Reagent;
using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes;
using Content.Shared.FixedPoint;
using Content.Shared.Inventory;
using Content.Shared.Localizations;
using Content.Shared.Tag;
using JetBrains.Annotations;
using Robust.Shared.Prototypes;
using System.Linq;
@@ -35,6 +37,14 @@ namespace Content.Server.Chemistry.ReagentEffects
[JsonPropertyName("ignoreResistances")]
public bool IgnoreResistances = true;
/// <summary>
/// WD.
/// Whether this will work through hardsuits or not.
/// </summary>
[DataField]
[JsonPropertyName("pierceHardsuit")]
public bool PierceHardsuit = true;
protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
{
var damages = new List<string>();
@@ -112,6 +122,11 @@ namespace Content.Server.Chemistry.ReagentEffects
public override void Effect(ReagentEffectArgs args)
{
if (!PierceHardsuit &&
args.EntityManager.System<InventorySystem>().TryGetSlotEntity(args.SolutionEntity, "outerClothing", out var suit) &&
args.EntityManager.System<TagSystem>().HasTag(suit.Value, "Hardsuit"))
return; // WD
var scale = ScaleByQuantity ? args.Quantity : FixedPoint2.New(1);
scale *= args.Scale;