private void AddInsertOtherVerb(EntityUid uid, MedicalScannerComponent component, GetVerbsEvent <InteractionVerb> args)
        {
            if (args.Using == null ||
                !args.CanAccess ||
                !args.CanInteract ||
                IsOccupied(component) ||
                !component.CanInsert(args.Using.Value))
            {
                return;
            }

            string name = "Unknown";

            if (TryComp <MetaDataComponent>(args.Using.Value, out var metadata))
            {
                name = metadata.EntityName;
            }

            InteractionVerb verb = new()
            {
                Act      = () => InsertBody(component.Owner, args.Target, component),
                Category = VerbCategory.Insert,
                Text     = name
            };

            args.Verbs.Add(verb);
        }
        private void AddAlternativeVerbs(EntityUid uid, MedicalScannerComponent component, GetVerbsEvent <AlternativeVerb> args)
        {
            if (!args.CanAccess || !args.CanInteract)
            {
                return;
            }

            // Eject verb
            if (IsOccupied(component))
            {
                AlternativeVerb verb = new();
                verb.Act      = () => EjectBody(uid, component);
                verb.Category = VerbCategory.Eject;
                verb.Text     = Loc.GetString("medical-scanner-verb-noun-occupant");
                args.Verbs.Add(verb);
            }

            // Self-insert verb
            if (!IsOccupied(component) &&
                component.CanInsert(args.User) &&
                _blocker.CanMove(args.User))
            {
                AlternativeVerb verb = new();
                verb.Act  = () => InsertBody(component.Owner, args.User, component);
                verb.Text = Loc.GetString("medical-scanner-verb-enter");
                args.Verbs.Add(verb);
            }
        }
Exemple #3
0
        private void AddAlternativeVerbs(EntityUid uid, MedicalScannerComponent component, GetAlternativeVerbsEvent args)
        {
            if (!args.CanAccess || !args.CanInteract)
            {
                return;
            }

            // Eject verb
            if (component.IsOccupied)
            {
                Verb verb = new();
                verb.Act      = () => component.EjectBody();
                verb.Category = VerbCategory.Eject;
                verb.Text     = Loc.GetString("medical-scanner-verb-noun-occupant");
                args.Verbs.Add(verb);
            }

            // Self-insert verb
            if (!component.IsOccupied &&
                component.CanInsert(args.User) &&
                _actionBlockerSystem.CanMove(args.User))
            {
                Verb verb = new();
                verb.Act  = () => component.InsertBody(args.User);
                verb.Text = Loc.GetString("medical-scanner-verb-enter");
                // TODO VERN ICON
                // TODO VERB CATEGORY
                // create a verb category for "enter"?
                // See also, disposal unit.  Also maybe add verbs for entering lockers/body bags?
                args.Verbs.Add(verb);
            }
        }
Exemple #4
0
        private void AddInsertOtherVerb(EntityUid uid, MedicalScannerComponent component, GetInteractionVerbsEvent args)
        {
            if (args.Using == null ||
                !args.CanAccess ||
                !args.CanInteract ||
                component.IsOccupied ||
                !component.CanInsert(args.Using))
            {
                return;
            }

            Verb verb = new();

            verb.Act      = () => component.InsertBody(args.Using);
            verb.Category = VerbCategory.Insert;
            verb.Text     = args.Using.Name;
            args.Verbs.Add(verb);
        }
        private void AddInsertOtherVerb(EntityUid uid, MedicalScannerComponent component, GetVerbsEvent <InteractionVerb> args)
        {
            if (args.Using == null ||
                !args.CanAccess ||
                !args.CanInteract ||
                component.IsOccupied ||
                !component.CanInsert(args.Using.Value))
            {
                return;
            }

            InteractionVerb verb = new();

            verb.Act      = () => component.InsertBody(args.Using.Value);
            verb.Category = VerbCategory.Insert;
            verb.Text     = EntityManager.GetComponent <MetaDataComponent>(args.Using.Value).EntityName;
            args.Verbs.Add(verb);
        }