More artifacts triggers and tweaks (#6723)

Co-authored-by: mirrorcult <lunarautomaton6@gmail.com>
This commit is contained in:
Alex Evgrashin
2022-02-19 22:16:49 +03:00
committed by GitHub
parent 162af7add5
commit 6eeaa81131
32 changed files with 347 additions and 61 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Linq;
using Content.Server.Power.Events;
using Content.Server.PowerCell;
using Content.Server.Speech.EntitySystems;
using Content.Server.Stunnable.Components;
@@ -56,6 +57,7 @@ namespace Content.Server.Stunnable
foreach (EntityUid entity in args.HitEntities)
{
StunEntity(entity, comp);
SendPowerPulse(entity, args.User, uid);
}
}
@@ -69,6 +71,7 @@ namespace Content.Server.Stunnable
args.CanInteract = true;
StunEntity(args.Entity, comp);
SendPowerPulse(args.Entity, args.User, uid);
}
private void OnUseInHand(EntityUid uid, StunbatonComponent comp, UseInHandEvent args)
@@ -92,6 +95,7 @@ namespace Content.Server.Stunnable
return;
StunEntity(args.Target, comp);
SendPowerPulse(args.Target, args.User, uid);
}
private void OnPowerCellChanged(EntityUid uid, StunbatonComponent comp, PowerCellChangedEvent args)
@@ -197,5 +201,14 @@ namespace Content.Server.Stunnable
sprite.LayerSetState(0, "stunbaton_on");
comp.Activated = true;
}
private void SendPowerPulse(EntityUid target, EntityUid? user, EntityUid used)
{
RaiseLocalEvent(target, new PowerPulseEvent()
{
Used = used,
User = user
}, false);
}
}
}