Ejemplo n.º 1
0
        // Function from file: blob_report.dm
        public double score(StationState result = null)
        {
            double output = 0;


            if (!(result != null))
            {
                return(0);
            }
            output  = 0;
            output += result.floor / Num13.MaxInt(this.floor, 1);
            output += result.r_wall / Num13.MaxInt(this.r_wall, 1);
            output += result.wall / Num13.MaxInt(this.wall, 1);
            output += result.window / Num13.MaxInt(this.window, 1);
            output += result.door / Num13.MaxInt(this.door, 1);
            output += result.grille / Num13.MaxInt(this.grille, 1);
            output += result.mach / Num13.MaxInt(this.mach, 1);
            return(output / 7);
        }
Ejemplo n.º 2
0
        // Function from file: recaller.dm
        public bool recall(Mob user = null)
        {
            dynamic      userturf  = null;
            StationState end_state = null;


            if (!this.can_use(user))
            {
                return(false);
            }

            if (this.recalling)
            {
                Task13.User.WriteMsg("<span class='warning'>Error: Recall already in progress.</span>");
                return(false);
            }
            ((Gang)this.gang).message_gangtools("" + Task13.User + " is attempting to recall the emergency shuttle.");
            this.recalling = true;
            ((dynamic)this.loc).WriteMsg(new Txt("<span class='info'>").icon(this).str("Generating shuttle recall order with codes retrieved from last call signal...</span>").ToString());
            Task13.Sleep(Rand13.Int(100, 300));

            if (GlobalVars.SSshuttle.emergency.mode != 2)
            {
                user.WriteMsg(new Txt("<span class='warning'>").icon(this).str("Emergency shuttle cannot be recalled at this time.</span>").ToString());
                this.recalling = false;
                return(false);
            }
            ((dynamic)this.loc).WriteMsg(new Txt("<span class='info'>").icon(this).str("Shuttle recall order generated. Accessing station long-range communication arrays...</span>").ToString());
            Task13.Sleep(Rand13.Int(100, 300));

            if (!(this.gang.dom_attempts != 0))
            {
                user.WriteMsg(new Txt("<span class='warning'>").icon(this).str("Error: Unable to access communication arrays. Firewall has logged our signature and is blocking all further attempts.</span>").ToString());
                this.recalling = false;
                return(false);
            }
            userturf = GlobalFuncs.get_turf(user);

            if (Lang13.Bool(userturf.z) != true)
            {
                user.WriteMsg(new Txt("<span class='warning'>").icon(this).str("Error: Device out of range of station communication arrays.</span>").ToString());
                this.recalling = false;
                return(false);
            }
            end_state = new StationState();
            end_state.count();

            if (GlobalVars.start_state.score(end_state) * 100 < 80)
            {
                user.WriteMsg(new Txt("<span class='warning'>").icon(this).str("Error: Station communication systems compromised. Unable to establish connection.</span>").ToString());
                this.recalling = false;
                return(false);
            }
            ((dynamic)this.loc).WriteMsg(new Txt("<span class='info'>").icon(this).str("Comm arrays accessed. Broadcasting recall signal...</span>").ToString());
            Task13.Sleep(Rand13.Int(100, 300));
            this.recalling = false;
            GlobalFuncs.log_game("" + GlobalFuncs.key_name(user) + " has tried to recall the shuttle with a gangtool.");
            GlobalFuncs.message_admins("" + GlobalFuncs.key_name_admin(user) + " has tried to recall the shuttle with a gangtool.");
            userturf = GlobalFuncs.get_turf(user);

            if (Lang13.Bool(userturf.z) == true)
            {
                if (GlobalVars.SSshuttle.cancelEvac(user))
                {
                    return(true);
                }
            }
            ((dynamic)this.loc).WriteMsg(new Txt("<span class='info'>").icon(this).str("No response recieved. Emergency shuttle cannot be recalled at this time.</span>").ToString());
            return(false);
        }
Ejemplo n.º 3
0
        // Function from file: ticker.dm
        public bool declare_completion(  )
        {
            bool                     station_evacuated = false;
            int                      num_survivors     = 0;
            int                      num_escapees      = 0;
            dynamic                  Player            = null;
            StationState             end_state         = null;
            int                      station_integrity = 0;
            Mob_Living_Silicon_Ai    aiPlayer          = null;
            string                   robolist          = null;
            Mob_Living_Silicon_Robot robo              = null;
            Mob_Living_Silicon_Robot robo2             = null;
            dynamic                  handler           = null;
            ByTable                  total_antagonists = null;
            Mind                     Mind              = null;
            string                   temprole          = null;
            dynamic                  i      = null;
            string                   dellog = null;
            dynamic                  path   = null;


            if (GlobalVars.SSshuttle.emergency.mode >= 5)
            {
                station_evacuated = true;
            }
            num_survivors = 0;
            num_escapees  = 0;
            Game13.WriteMsg("<BR><BR><BR><FONT size=3><B>The round has ended.</B></FONT>");

            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.mob_list))
            {
                Player = _a;


                if (Lang13.Bool(Player.mind) && !(Player is Mob_NewPlayer))
                {
                    if (Convert.ToInt32(Player.stat) != 2 && !(Player is Mob_Living_Carbon_Brain))
                    {
                        num_survivors++;

                        if (station_evacuated)
                        {
                            if (!((Ent_Static)Player).onCentcom() && !((Ent_Static)Player).onSyndieBase())
                            {
                                Player.WriteMsg("<font color='blue'><b>You managed to survive, but were marooned on " + GlobalFuncs.station_name() + "...</b></FONT>");
                            }
                            else
                            {
                                num_escapees++;
                                Player.WriteMsg("<font color='green'><b>You managed to survive the events on " + GlobalFuncs.station_name() + " as " + Player.real_name + ".</b></FONT>");
                            }
                        }
                        else
                        {
                            Player.WriteMsg("<font color='green'><b>You managed to survive the events on " + GlobalFuncs.station_name() + " as " + Player.real_name + ".</b></FONT>");
                        }
                    }
                    else
                    {
                        Player.WriteMsg("<font color='red'><b>You did not survive the events on " + GlobalFuncs.station_name() + "...</b></FONT>");
                    }
                }
            }
            end_state = new StationState();
            end_state.count();
            station_integrity = Num13.MinInt(((int)(Num13.Round(GlobalVars.start_state.score(end_state) * 100, 0.1))), 100);
            Game13.WriteMsg("<BR>" + GlobalVars.TAB + "Shift Duration: <B>" + Num13.Floor(Game13.time / 36000) + ":" + GlobalFuncs.add_zero("" + Game13.time / 600 % 60, 2) + ":" + Game13.time / 100 % 6 + Game13.time / 100 % 10 + "</B>");
            Game13.WriteMsg("<BR>" + GlobalVars.TAB + "Station Integrity: <B>" + (this.mode.station_was_nuked ? "<font color='red'>Destroyed</font>" : "" + station_integrity + "%") + "</B>");

            if (GlobalVars.joined_player_list.len != 0)
            {
                Game13.WriteMsg("<BR>" + GlobalVars.TAB + "Total Population: <B>" + GlobalVars.joined_player_list.len + "</B>");

                if (station_evacuated)
                {
                    Game13.WriteMsg("<BR>" + GlobalVars.TAB + "Evacuation Rate: <B>" + num_escapees + " (" + Num13.Round(num_escapees / GlobalVars.joined_player_list.len * 100, 0.1) + "%)</B>");
                }
                Game13.WriteMsg("<BR>" + GlobalVars.TAB + "Survival Rate: <B>" + num_survivors + " (" + Num13.Round(num_survivors / GlobalVars.joined_player_list.len * 100, 0.1) + "%)</B>");
            }
            Game13.WriteMsg("<BR>");

            foreach (dynamic _c in Lang13.Enumerate(GlobalVars.mob_list, typeof(Mob_Living_Silicon_Ai)))
            {
                aiPlayer = _c;


                if (aiPlayer.stat != 2 && aiPlayer.mind != null)
                {
                    Game13.WriteMsg("<b>" + aiPlayer.name + " (Played by: " + aiPlayer.mind.key + ")'s laws at the end of the round were:</b>");
                    aiPlayer.show_laws(true);
                }
                else if (aiPlayer.mind != null)
                {
                    Game13.WriteMsg("<b>" + aiPlayer.name + " (Played by: " + aiPlayer.mind.key + ")'s laws when it was deactivated were:</b>");
                    aiPlayer.show_laws(true);
                }
                Game13.WriteMsg("<b>Total law changes: " + aiPlayer.law_change_counter + "</b>");

                if (aiPlayer.connected_robots.len != 0)
                {
                    robolist = "<b>" + aiPlayer.real_name + "'s minions were:</b> ";

                    foreach (dynamic _b in Lang13.Enumerate(aiPlayer.connected_robots, typeof(Mob_Living_Silicon_Robot)))
                    {
                        robo = _b;


                        if (robo.mind != null)
                        {
                            robolist += "" + robo.name + (robo.stat != 0 ? " (Deactivated) (Played by: " + robo.mind.key + "), " : " (Played by: " + robo.mind.key + "), ");
                        }
                    }
                    Game13.WriteMsg("" + robolist);
                }
            }

            foreach (dynamic _d in Lang13.Enumerate(GlobalVars.mob_list, typeof(Mob_Living_Silicon_Robot)))
            {
                robo2 = _d;


                if (!Lang13.Bool(robo2.connected_ai) && robo2.mind != null)
                {
                    if (robo2.stat != 2)
                    {
                        Game13.WriteMsg("<b>" + robo2.name + " (Played by: " + robo2.mind.key + ") survived as an AI-less borg! Its laws were:</b>");
                    }
                    else
                    {
                        Game13.WriteMsg("<b>" + robo2.name + " (Played by: " + robo2.mind.key + ") was unable to survive the rigors of being a cyborg without an AI. Its laws were:</b>");
                    }

                    if (robo2 != null)
                    {
                        robo2.laws.show_laws(typeof(Game13));
                    }
                }
            }
            this.mode.declare_completion();

            foreach (dynamic _e in Lang13.Enumerate(Lang13.GetTypes("/datum/game_mode/proc")))
            {
                handler = _e;


                if (String13.FindIgnoreCase("" + handler, "auto_declare_completion_", 1, 0) != 0)
                {
                    Lang13.Call(Lang13.BindFunc(this.mode, handler), this.force_ending);
                }
            }
            total_antagonists = new ByTable();

            foreach (dynamic _f in Lang13.Enumerate(this.minds, typeof(Mind)))
            {
                Mind = _f;

                temprole = Mind.special_role;

                if (Lang13.Bool(temprole))
                {
                    if (total_antagonists.Contains(temprole))
                    {
                        total_antagonists[temprole] += ", " + Mind.name + "(" + Mind.key + ")";
                    }
                    else
                    {
                        total_antagonists.Add(temprole);
                        total_antagonists[temprole] += ": " + Mind.name + "(" + Mind.key + ")";
                    }
                }
            }
            GlobalFuncs.log_game("Antagonists at round end were...");

            foreach (dynamic _g in Lang13.Enumerate(total_antagonists))
            {
                i = _g;

                GlobalFuncs.log_game("" + i + "s" + total_antagonists[i] + ".");
            }

            if (GlobalVars.SSgarbage.didntgc.len != 0)
            {
                dellog = "";

                foreach (dynamic _h in Lang13.Enumerate(GlobalVars.SSgarbage.didntgc))
                {
                    path = _h;

                    dellog += "Path : " + path + " \n";
                    dellog += "Failures : " + GlobalVars.SSgarbage.didntgc[path] + " \n";
                }
                Game13.log.WriteMsg(dellog);
            }
            return(true);
        }