CatStation/Content.Shared/Actions/DangerousActionSystem.cs
ScarKy0 091180655d
Changeling Chemicals (#45239)
* 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
2026-08-19 19:25:16 +00:00

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;
}
}