Esempio n. 1
0
 private void OnSpeakAttempt(SpeakAttemptEvent args)
 {
     if (!TryComp(args.Uid, out SharedSpeechComponent? speech) || !speech.Enabled)
     {
         args.Cancel();
     }
 }
        private void OnSpeakAttempt(EntityUid uid, MimePowersComponent component, SpeakAttemptEvent args)
        {
            if (!component.Enabled)
            {
                return;
            }

            _popupSystem.PopupEntity(Loc.GetString("mime-cant-speak"), uid, Filter.Entities(uid));
            args.Cancel();
        }
        public bool CanSpeak(IEntity entity)
        {
            var ev = new SpeakAttemptEvent(entity);

            RaiseLocalEvent(entity.Uid, ev);

            foreach (var blocker in ev.Entity.GetAllComponents <IActionBlocker>())
            {
                if (!blocker.CanSpeak())
                {
                    ev.Cancel();
                    break;
                }
            }

            return(!ev.Cancelled);
        }
 private void OnSpeakAttempt(EntityUid uid, SleepingComponent component, SpeakAttemptEvent args)
 {
     args.Cancel();
 }
Esempio n. 5
0
 private void OnSpeakAttempt(EntityUid uid, MutedComponent component, SpeakAttemptEvent args)
 {
     _popupSystem.PopupEntity(Loc.GetString("speech-muted"), uid, Filter.Entities(uid));
     args.Cancel();
 }