コード例 #1
0
        // Function from file: nuclearbomb.dm
        public void explode(  )
        {
            dynamic M                      = null;
            int     off_station            = 0;
            dynamic bomb_location          = null;
            Obj_DockingPort_Mobile Shuttle = null;


            if (this.safety)
            {
                this.timing = 0;
                return;
            }
            this.timing   = -1;
            this.yes_code = false;
            this.safety   = true;
            this.update_icon();

            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.player_list))
            {
                M = _a;

                M.WriteMsg("sound/machines/Alarm.ogg");
            }

            if (GlobalVars.ticker != null && Lang13.Bool(GlobalVars.ticker.mode))
            {
                GlobalVars.ticker.mode.explosion_in_progress = true;
            }
            Task13.Sleep(100);

            if (!(this.core != null))
            {
                GlobalVars.ticker.station_explosion_cinematic(3, "no_core");
                GlobalVars.ticker.mode.explosion_in_progress = false;
                return;
            }
            GlobalVars.enter_allowed = false;
            off_station   = 0;
            bomb_location = GlobalFuncs.get_turf(this);

            if (Lang13.Bool(bomb_location) && Lang13.Bool(bomb_location.z) == true)
            {
                if (Convert.ToDouble(bomb_location.x) < 48 || Convert.ToDouble(bomb_location.x) > 208 || Convert.ToDouble(bomb_location.y) < 48 || Convert.ToDouble(bomb_location.y) > 208)
                {
                    off_station = 1;
                }
            }
            else
            {
                off_station = 2;
            }

            if (Lang13.Bool(GlobalVars.ticker.mode) && GlobalVars.ticker.mode.name == "nuclear emergency")
            {
                Shuttle = GlobalVars.SSshuttle.getShuttle("syndicate");
                GlobalVars.ticker.mode.syndies_didnt_escape = (Shuttle != null && Shuttle.z == 2 ? false : true);
                GlobalVars.ticker.mode.nuke_off_station     = off_station;
            }
            GlobalVars.ticker.station_explosion_cinematic(off_station, null);

            if (Lang13.Bool(GlobalVars.ticker.mode))
            {
                GlobalVars.ticker.mode.explosion_in_progress = false;

                if (GlobalVars.ticker.mode.name == "nuclear emergency")
                {
                    GlobalVars.ticker.mode.nukes_left--;
                }
                else
                {
                    Game13.WriteMsg("<B>The station was destoyed by the nuclear blast!</B>");
                }
                GlobalVars.ticker.mode.station_was_nuked = off_station < 2;

                if (!((GameMode)GlobalVars.ticker.mode).check_finished())
                {
                    Task13.Schedule(0, (Task13.Closure)(() => {
                        Game13.Reboot("Station destroyed by Nuclear Device.", "end_error", "nuke - unhandled ending");
                        return;
                    }));
                    return;
                }
            }
            return;
        }
コード例 #2
0
        // Function from file: ticker.dm
        public override void fire(  )
        {
            Mob_NewPlayer player = null;


            switch ((int)(this.current_state))
            {
            case 0:
                this.timeLeft = (GlobalVars.config.lobby_countdown ?? 0) * 10;
                Game13.WriteMsg("<b><font color='blue'>Welcome to the pre-game lobby!</font></b>");
                Game13.WriteMsg("Please, setup your character and select ready. Game will start in " + GlobalVars.config.lobby_countdown + " seconds");
                this.current_state = 1;
                break;

            case 1:
                this.totalPlayers      = 0;
                this.totalPlayersReady = 0;

                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.player_list, typeof(Mob_NewPlayer)))
                {
                    player = _a;

                    this.totalPlayers++;

                    if (Lang13.Bool(player.ready))
                    {
                        this.totalPlayersReady++;
                    }
                }

                if (Convert.ToDouble(this.timeLeft) < 0)
                {
                    return;
                }
                this.timeLeft -= this.wait;

                if (Convert.ToDouble(this.timeLeft) <= 300 && !this.tipped)
                {
                    this.send_random_tip();
                    this.tipped = true;
                }

                if (Convert.ToDouble(this.timeLeft) <= 0)
                {
                    this.current_state = 2;
                }
                break;

            case 2:

                if (!this.setup())
                {
                    this.current_state = 0;
                }
                break;

            case 3:
                ((Game_Data)this.mode).process(this.wait * 0.1);
                this.check_queue();
                this.check_maprotate();

                if (!this.mode.explosion_in_progress && ((GameMode)this.mode).check_finished() || Lang13.Bool(this.force_ending))
                {
                    this.current_state = 4;
                    GlobalFuncs.toggle_ooc(true);
                    this.declare_completion(  );
                    Task13.Schedule(50, (Task13.Closure)(() => {
                        if (this.mode.station_was_nuked)
                        {
                            Game13.Reboot("Station destroyed by Nuclear Device.", "end_proper", "nuke");
                        }
                        else
                        {
                            Game13.Reboot("Round ended.", "end_proper", "proper completion");
                        }
                        return;
                    }));
                }
                break;
            }
            return;
        }
コード例 #3
0
        // Function from file: voting.dm
        public dynamic result(  )
        {
            dynamic _default = null;

            bool    restart       = false;
            bool    active_admins = false;
            dynamic C             = null;

            _default = this.announce_result();
            restart  = false;

            if (Lang13.Bool(_default))
            {
                switch ((string)(this.mode))
                {
                case "restart":

                    if (_default == "Restart Round")
                    {
                        restart = true;
                    }
                    break;

                case "gamemode":

                    if (GlobalVars.master_mode != _default)
                    {
                        Game13.save_mode(_default);

                        if (GlobalVars.ticker != null && Lang13.Bool(GlobalVars.ticker.mode))
                        {
                            restart = true;
                        }
                        else
                        {
                            GlobalVars.master_mode = _default;
                        }
                    }
                    break;
                }
            }

            if (restart)
            {
                active_admins = false;

                foreach (dynamic _b in Lang13.Enumerate(GlobalVars.admins))
                {
                    C = _b;


                    if (!Lang13.Bool(((dynamic)typeof(Client)).IsInstanceOfType(C)))
                    {
                        continue;
                    }

                    if (!(((Client)C).is_afk() != 0) && GlobalFuncs.check_rights_for(C, 16))
                    {
                        active_admins = true;
                        break;
                    }
                }

                if (!active_admins)
                {
                    Game13.Reboot("Restart vote successful.", "end_error", "restart vote");
                }
                else
                {
                    Game13.WriteMsg("<span style='boldannounce'>Notice:Restart vote will not restart the server automatically because there are active admins on.</span>");
                    GlobalFuncs.message_admins("A restart vote has passed, but there are active admins on with +server, so it has been canceled. If you wish, you may restart the server.");
                }
            }
            return(_default);
        }