using Content.Shared.Cuffs; using Content.Shared.Cuffs.Components; using JetBrains.Annotations; using Robust.Shared.GameStates; namespace Content.Server.Cuffs { [UsedImplicitly] public sealed class CuffableSystem : SharedCuffableSystem { public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnCuffableGetState); } private void OnCuffableGetState(Entity entity, ref ComponentGetState args) { // there are 2 approaches i can think of to handle the handcuff overlay on players // 1 - make the current RSI the handcuff type that's currently active. all handcuffs on the player will appear the same. // 2 - allow for several different player overlays for each different cuff type. // approach #2 would be more difficult/time consuming to do and the payoff doesn't make it worth it. // right now we're doing approach #1. HandcuffComponent? cuffs = null; if (TryGetLastCuff((entity, entity.Comp), out var cuff)) TryComp(cuff, out cuffs); args.State = new CuffableComponentState(entity.Comp.CuffedHandCount, entity.Comp.CanStillInteract, cuffs?.CuffedRSI, $"{cuffs?.BodyIconState}-{entity.Comp.CuffedHandCount}", cuffs?.Color); // the iconstate is formatted as blah-2, blah-4, blah-6, etc. // the number corresponds to how many hands are cuffed. } } }