* Move entity effects to shared * relocate spawning to server * Generic version of EntityEffect for just raising event. * genericise everything * oops forgot to push you * some condensation * finish rebas * unwhite the space * oops forgot nuke * bad rebase fix * useless annotations begone --------- Co-authored-by: EmoGarbage404 <retron404@gmail.com>
34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using Content.Shared.EntityEffects;
|
|
using Content.Shared.Stunnable;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared.EntityEffects.Effects;
|
|
|
|
public sealed partial class Paralyze : EntityEffect
|
|
{
|
|
[DataField] public double ParalyzeTime = 2;
|
|
|
|
/// <remarks>
|
|
/// true - refresh paralyze time, false - accumulate paralyze time
|
|
/// </remarks>
|
|
[DataField] public bool Refresh = true;
|
|
|
|
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
|
=> Loc.GetString("reagent-effect-guidebook-paralyze",
|
|
("chance", Probability),
|
|
("time", ParalyzeTime));
|
|
|
|
public override void Effect(EntityEffectBaseArgs args)
|
|
{
|
|
var paralyzeTime = ParalyzeTime;
|
|
|
|
if (args is EntityEffectReagentArgs reagentArgs)
|
|
{
|
|
paralyzeTime *= (double)reagentArgs.Scale;
|
|
}
|
|
|
|
args.EntityManager.System<SharedStunSystem>().TryParalyze(args.TargetEntity, TimeSpan.FromSeconds(paralyzeTime), Refresh);
|
|
}
|
|
}
|
|
|