예제 #1
0
        public override void Added()
        {
            _chatManager.DispatchServerAnnouncement("There are traitors on the station! Find them, and kill them!");

            _entityManager.EventBus.SubscribeEvent <MobDamageStateChangedMessage>(EventSource.Local, this, _onMobDamageStateChanged);

            Timer.SpawnRepeating(DeadCheckDelay, _checkWinConditions, _checkTimerCancel.Token);
        }
        public override void Added()
        {
            _chatManager.DispatchServerAnnouncement("There are traitors on the station! Find them, and kill them!");

            EntitySystem.Get <AudioSystem>().PlayGlobal("/Audio/Misc/tatoralert.ogg", AudioParams.Default,
                                                        (session) => session.ContentData().Mind?.HasRole <SuspicionTraitorRole>() ?? false);

            Timer.SpawnRepeating(DeadCheckDelay, _checkWinConditions, _checkTimerCancel.Token);
        }
예제 #3
0
        public override void Added()
        {
            _chatManager.DispatchServerAnnouncement(Loc.GetString("There are traitors on the station! Find them, and kill them!"));

            bool Predicate(IPlayerSession session) => session.ContentData()?.Mind?.HasRole <SuspicionTraitorRole>() ?? false;

            EntitySystem.Get <AudioSystem>().PlayGlobal("/Audio/Misc/tatoralert.ogg", AudioParams.Default, Predicate);

            EntitySystem.Get <DoorSystem>().AccessType = DoorSystem.AccessTypes.AllowAllNoExternal;

            Timer.SpawnRepeating(DeadCheckDelay, _checkWinConditions, _checkTimerCancel.Token);
        }
        public CommunicationsConsoleMenu(CommunicationsConsoleBoundUserInterface owner)
        {
            IoCManager.InjectDependencies(this);

            Title = Loc.GetString("Communications Console");
            Owner = owner;

            _countdownLabel = new RichTextLabel()
            {
                CustomMinimumSize = new Vector2(0, 200)
            };
            _emergencyShuttleButton            = new Button();
            _emergencyShuttleButton.OnPressed += (e) => Owner.EmergencyShuttleButtonPressed();

            var vbox = new VBoxContainer()
            {
                SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsVertical = SizeFlags.FillExpand
            };

            vbox.AddChild(_countdownLabel);
            vbox.AddChild(_emergencyShuttleButton);

            var hbox = new HBoxContainer()
            {
                SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsVertical = SizeFlags.FillExpand
            };

            hbox.AddChild(new Control()
            {
                CustomMinimumSize = new Vector2(100, 0), SizeFlagsHorizontal = SizeFlags.FillExpand
            });
            hbox.AddChild(vbox);
            hbox.AddChild(new Control()
            {
                CustomMinimumSize = new Vector2(100, 0), SizeFlagsHorizontal = SizeFlags.FillExpand
            });

            Contents.AddChild(hbox);

            UpdateCountdown();
            Timer.SpawnRepeating(1000, UpdateCountdown, _timerCancelTokenSource.Token);
        }
예제 #5
0
        public override void Added()
        {
            _entityManager.EventBus.SubscribeEvent <MobDamageStateChangedMessage>(EventSource.Local, this, _onMobDamageStateChanged);

            Timer.SpawnRepeating(DeadCheckDelay, _checkWinConditions, _checkTimerCancel.Token);
        }
 private void SetupTimer()
 {
     TokenSource?.Cancel();
     TokenSource = new CancellationTokenSource();
     Timer.SpawnRepeating(TimeSpan.FromSeconds(IntervalSeconds), OnTimerFired, TokenSource.Token);
 }