Adds a stun chemical (uplink only) (#7258)

This commit is contained in:
areit
2022-03-28 23:53:27 +03:00
committed by GitHub
parent 3cc0eb5f33
commit 356186c33f
4 changed files with 75 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Content.Shared.Chemistry.Reagent;
using Content.Server.Stunnable;
namespace Content.Server.Chemistry.ReagentEffects;
public sealed class Paralyze : ReagentEffect
{
[DataField("paralyzeTime")] public double ParalyzeTime = 2;
/// <remarks>
/// true - refresh paralyze time, false - accumulate paralyze time
/// </remarks>
[DataField("refresh")] public bool Refresh = true;
public override void Effect(ReagentEffectArgs args)
{
EntitySystem.Get<StunSystem>().TryParalyze(args.SolutionEntity, TimeSpan.FromSeconds(ParalyzeTime), Refresh);
}
}