mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* initially works i think * yeah * pulled these numbers outta my ass * text * silly * fixy fix * fix * This sure is a videogame * init test fuck everything * sprites * fix dirty * query * another query * craftable changeling sting * remove todo * \n * doc
32 lines
872 B
C#
32 lines
872 B
C#
using Content.Shared.Actions.Components;
|
|
using Content.Shared.Actions.Events;
|
|
using Content.Shared.CombatMode.Pacification;
|
|
using Content.Shared.Popups;
|
|
|
|
namespace Content.Shared.Actions;
|
|
|
|
public sealed partial class DangerousActionSystem : EntitySystem
|
|
{
|
|
[Dependency] private EntityQuery<PacifiedComponent> _pacifiedQuery = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
SubscribeLocalEvent<DangerousActionComponent, ActionAttemptEvent>(OnAttempt);
|
|
}
|
|
|
|
private void OnAttempt(Entity<DangerousActionComponent> ent, ref ActionAttemptEvent args)
|
|
{
|
|
if (args.Cancelled)
|
|
return;
|
|
|
|
if (!_pacifiedQuery.HasComp(args.User))
|
|
return;
|
|
|
|
args.Reason = Loc.GetString(ent.Comp.PacificationMessage);
|
|
args.Type = ent.Comp.MessageType;
|
|
|
|
args.Cancelled = true;
|
|
}
|
|
|
|
}
|