示例#1
0
 private void OnStartup(EntityUid uid, PAIComponent component, ComponentStartup args)
 {
     _blocker.UpdateCanMove(uid);
     if (component.MidiAction != null)
     {
         _actionsSystem.AddAction(uid, component.MidiAction, null);
     }
 }
示例#2
0
        private void OnHandleState(EntityUid uid, PilotComponent component, ref ComponentHandleState args)
        {
            if (args.Current is not PilotComponentState state)
            {
                return;
            }

            var console = state.Console.GetValueOrDefault();

            if (!console.IsValid())
            {
                component.Console = null;
                _input.Contexts.SetActiveContext("human");
                return;
            }

            if (!TryComp <ShuttleConsoleComponent>(console, out var shuttleConsoleComponent))
            {
                Logger.Warning($"Unable to set Helmsman console to {console}");
                return;
            }

            component.Console = shuttleConsoleComponent;
            ActionBlockerSystem.UpdateCanMove(uid);
            _input.Contexts.SetActiveContext("shuttle");
        }
 private void OnPull(EntityUid uid, SharedCuffableComponent component, PullMessage args)
 {
     if (!component.CanStillInteract)
     {
         _blocker.UpdateCanMove(uid);
     }
 }
        public void AddPilot(EntityUid entity, ShuttleConsoleComponent component)
        {
            if (!EntityManager.TryGetComponent(entity, out PilotComponent? pilotComponent) ||
                component.SubscribedPilots.Contains(pilotComponent))
            {
                return;
            }

            if (TryComp <SharedEyeComponent>(entity, out var eye))
            {
                eye.Zoom = component.Zoom;
            }

            component.SubscribedPilots.Add(pilotComponent);

            _alertsSystem.ShowAlert(entity, AlertType.PilotingShuttle);

            pilotComponent.Console = component;
            ActionBlockerSystem.UpdateCanMove(entity);
            pilotComponent.Position = EntityManager.GetComponent <TransformComponent>(entity).Coordinates;
            Dirty(pilotComponent);
        }
示例#5
0
 private void UpdateCanMove(EntityUid uid, AdminFrozenComponent component, EntityEventArgs args)
 {
     _blocker.UpdateCanMove(uid);
 }
示例#6
0
 protected virtual void HandlePilotShutdown(EntityUid uid, PilotComponent component, ComponentShutdown args)
 {
     ActionBlockerSystem.UpdateCanMove(uid);
 }
 private void OnStateChanged(MobStateChangedEvent ev)
 {
     _blocker.UpdateCanMove(ev.Entity);
 }
 private void UpdateCanMove(EntityUid uid, StunnedComponent component, EntityEventArgs args)
 {
     _blocker.UpdateCanMove(uid);
 }