Esempio n. 1
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);
            }
        }
Esempio n. 2
0
        private void OnRelayMovement(EntityUid uid, MedicalScannerComponent component, RelayMovementEntityEvent args)
        {
            if (_blocker.CanInteract(args.Entity))
            {
                if (_gameTiming.CurTime <
                    component.LastInternalOpenAttempt + MedicalScannerComponent.InternalOpenAttemptDelay)
                {
                    return;
                }

                component.LastInternalOpenAttempt = _gameTiming.CurTime;
                component.EjectBody();
            }
        }