Files
OldThink/Content.Server/Chemistry/ReagentEffects/Electrocute.cs
Moony d5c5cbeaf4 buzz buzz (#5490)
* buzz buzz

* Darn now i'm all out of periods   thanks mirror
fix toy issue

* desc edits.

* rng and alphabee

* adds some missed parens
2021-11-24 23:06:13 -07:00

26 lines
875 B
C#

using System;
using Content.Server.Atmos.Components;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Electrocution;
using Content.Shared.Chemistry.Reagent;
using Robust.Shared.GameObjects;
using Robust.Shared.Log;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Chemistry.ReagentEffects;
public class Electrocute : ReagentEffect
{
[DataField("electrocuteTime")] public int ElectrocuteTime = 2;
[DataField("electrocuteDamageScale")] public int ElectrocuteDamageScale = 5;
public override void Effect(ReagentEffectArgs args)
{
EntitySystem.Get<ElectrocutionSystem>().TryDoElectrocution(args.SolutionEntity, null,
Math.Max((args.Quantity * ElectrocuteDamageScale).Int(), 1), TimeSpan.FromSeconds(ElectrocuteTime));
args.Source?.RemoveReagent(args.Reagent.ID, args.Quantity);
}
}