예제 #1
0
        // Function from file: crew.dm
        public void updateFor(dynamic hclient_or_mob = null, HtmlInterface hi = null, int?z = null)
        {
            ByTable L = null;

            hi.callJavaScript("clearAll", null, hclient_or_mob);

            foreach (dynamic _a in Lang13.Enumerate(this.data, typeof(ByTable)))
            {
                L = _a;

                hi.callJavaScript("add", L, hclient_or_mob);
            }
            hi.callJavaScript("onAfterUpdate", null, hclient_or_mob);
            return;
        }
예제 #2
0
        // Function from file: crew.dm
        public override dynamic Destroy(  )
        {
            HtmlInterface hi = null;


            if (this.interfaces != null)
            {
                foreach (dynamic _a in Lang13.Enumerate(this.interfaces, typeof(HtmlInterface)))
                {
                    hi = _a;

                    GlobalFuncs.qdel(hi);
                }
                this.interfaces = null;
            }
            return(base.Destroy());
        }
예제 #3
0
        // Function from file: crew.dm
        public void show(dynamic mob = null, int?z = null)
        {
            HtmlInterface hi = null;


            if (Lang13.Bool(mob.client))
            {
                this.sendResources(mob.client);
            }

            if (!Lang13.Bool(z))
            {
                z = Lang13.IntNullable(mob.z);
            }

            if ((z ?? 0) > 0 && this.interfaces != null)
            {
                if (!Lang13.Bool(this.interfaces["" + z]))
                {
                    this.interfaces["" + z] = new HtmlInterface_Nanotrasen(this, "Crew Monitoring", 900, 540, "<link rel=\"stylesheet\" type=\"text/css\" href=\"crewmonitor.css\" /><script type=\"text/javascript\">var z = " + z + "; var tile_size = " + Game13.icon_size + "; var maxx = " + Game13.map_size_x + "; var maxy = " + Game13.map_size_y + ";</script><script type=\"text/javascript\" src=\"crewmonitor.js\"></script>");
                    hi = this.interfaces["" + z];
                    hi.updateContent("content", "<div id=\"minimap\"><a href=\"javascript:zoomIn();\" class=\"zoom in\">+</a><a href=\"javascript:zoomOut();\" class=\"zoom\">-</a></div><div id=\"textbased\"></div>");
                    this.update(z, GlobalVars.TRUE);
                }
                else
                {
                    hi = this.interfaces["" + z];
                }
                Interface13.CacheBrowseResource(mob, new File("code/game/machinery/computer/crew.js"), "crew.js");
                Interface13.CacheBrowseResource(mob, new File("code/game/machinery/computer/crew.css"), "crew.css");
                hi = this.interfaces["" + z];
                hi.show(mob);
                this.updateFor(mob, hi, z);
            }
            return;
        }
예제 #4
0
        // Function from file: crew.dm
        public void update(int?z = null, int?ignore_unused = null)
        {
            ignore_unused = ignore_unused ?? GlobalVars.FALSE;

            HtmlInterface           hi          = null;
            ByTable                 results     = null;
            dynamic                 U           = null;
            dynamic                 I           = null;
            dynamic                 pos         = null;
            int                     ijob        = 0;
            dynamic                 name        = null;
            dynamic                 assignment  = null;
            double?                 dam1        = null;
            double?                 dam2        = null;
            double?                 dam3        = null;
            double?                 dam4        = null;
            dynamic                 area        = null;
            int?                    pos_x       = null;
            int?                    pos_y       = null;
            string                  life_status = null;
            Mob_Living_Carbon_Human H           = null;
            dynamic                 player_area = null;


            if (Lang13.Bool(this.interfaces["" + z]))
            {
                hi = this.interfaces["" + z];

                if (Lang13.Bool(ignore_unused) || Lang13.Bool(hi.isUsed()))
                {
                    results = new ByTable();

                    foreach (dynamic _a in Lang13.Enumerate(GlobalVars.mob_list, typeof(Mob_Living_Carbon_Human)))
                    {
                        H = _a;


                        if ((H.z == 0 || H.z == z) && H.w_uniform is Obj_Item_Clothing_Under)
                        {
                            U = H.w_uniform;

                            if (U.has_sensor != 0 && U.sensor_mode != 0)
                            {
                                pos = (H.z == 0 || U.sensor_mode == 3 ? GlobalFuncs.get_turf(H) : null);

                                if (H.z == 0 && (!Lang13.Bool(pos) || Lang13.IntNullable(pos.z) != z))
                                {
                                    continue;
                                }
                                I = (Lang13.Bool(H.wear_id) ? ((Obj_Item)H.wear_id).GetID() : null);

                                if (Lang13.Bool(I))
                                {
                                    name       = I.registered_name;
                                    assignment = I.assignment;
                                    ijob       = Convert.ToInt32(this.jobs[I.assignment]);
                                }
                                else
                                {
                                    name       = "<i>Unknown</i>";
                                    assignment = "";
                                    ijob       = 80;
                                }

                                if (U.sensor_mode >= 1)
                                {
                                    life_status = (!(H.stat != 0) ? "true" : "false");
                                }
                                else
                                {
                                    life_status = null;
                                }

                                if (U.sensor_mode >= 2)
                                {
                                    dam1 = Num13.Round(Convert.ToDouble(H.getOxyLoss()), 1);
                                    dam2 = Num13.Round(Convert.ToDouble(H.getToxLoss()), 1);
                                    dam3 = Num13.Round(H.getFireLoss(), 1);
                                    dam4 = Num13.Round(H.getBruteLoss(), 1);
                                }
                                else
                                {
                                    dam1 = null;
                                    dam2 = null;
                                    dam3 = null;
                                    dam4 = null;
                                }

                                if (U.sensor_mode >= 3)
                                {
                                    if (!Lang13.Bool(pos))
                                    {
                                        pos = GlobalFuncs.get_turf(H);
                                    }
                                    player_area = GlobalFuncs.get_area(H);
                                    area        = GlobalFuncs.format_text(player_area.name);
                                    pos_x       = Lang13.IntNullable(pos.x);
                                    pos_y       = Lang13.IntNullable(pos.y);
                                }
                                else
                                {
                                    area  = null;
                                    pos_x = null;
                                    pos_y = null;
                                }
                                results[++results.len] = new ByTable(new object [] { name, assignment, ijob, life_status, dam1, dam2, dam3, dam4, area, pos_x, pos_y, H.can_track(null) });
                            }
                        }
                    }
                    this.data = results;
                    this.updateFor(null, hi, z);
                }
            }
            return;
        }
예제 #5
0
        // Function from file: ticker.dm
        public void station_explosion_cinematic(dynamic station_missed = null, dynamic _override = null)
        {
            station_missed = station_missed ?? 0;

            HtmlInterface     hi          = null;
            Obj_Structure_Bed temp_buckle = null;
            dynamic           M           = null;
            dynamic           M2          = null;
            dynamic           T           = null;


            if (this.cinematic != null)
            {
                return;
            }

            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.html_interfaces, typeof(HtmlInterface)))
            {
                hi = _a;

                hi.closeAll();
            }
            this.cinematic = new Obj_Screen(this)
            {
                icon          = "icons/effects/station_explosion.dmi",
                icon_state    = "station_intact",
                layer         = 20,
                mouse_opacity = 0,
                screen_loc    = "1,0"
            };
            temp_buckle = new Obj_Structure_Bed(this);

            if (Lang13.Bool(station_missed))
            {
                foreach (dynamic _b in Lang13.Enumerate(GlobalVars.mob_list))
                {
                    M = _b;

                    M.buckled = temp_buckle;

                    if (Lang13.Bool(M.client))
                    {
                        M.client.screen += this.cinematic;
                    }
                }
            }
            else
            {
                foreach (dynamic _c in Lang13.Enumerate(GlobalVars.mob_list))
                {
                    M2 = _c;

                    M2.buckled = temp_buckle;

                    if (Lang13.Bool(M2.client))
                    {
                        M2.client.screen += this.cinematic;
                    }

                    if (Convert.ToInt32(M2.stat) != 2)
                    {
                        T = GlobalFuncs.get_turf(M2);

                        if (Lang13.Bool(T) && Lang13.Bool(T.z) == true)
                        {
                            ((Mob)M2).death(false);
                        }
                    }
                }
            }

            dynamic _f = station_missed;             // Was a switch-case, sorry for the mess.

            if (_f == 1)
            {
                if (Lang13.Bool(this.mode) && !Lang13.Bool(_override))
                {
                    _override = this.mode.name;
                }

                dynamic _d = _override;                 // Was a switch-case, sorry for the mess.
                if (_d == "nuclear emergency")
                {
                    Icon13.Flick("intro_nuke", this.cinematic);
                    Task13.Sleep(35);
                    Game13.WriteMsg(new Sound("sound/effects/explosionfar.ogg"));
                    Icon13.Flick("station_intact_fade_red", this.cinematic);
                    this.cinematic.icon_state = "summary_nukefail";
                }
                else if (_d == "gang war")
                {
                    this.cinematic.icon_state = "intro_malf_still";
                    Icon13.Flick("intro_malf", this.cinematic);
                    Task13.Sleep(70);
                }
                else if (_d == "fake")
                {
                    Icon13.Flick("intro_nuke", this.cinematic);
                    Task13.Sleep(35);
                    Game13.WriteMsg(new Sound("sound/items/bikehorn.ogg"));
                    Icon13.Flick("summary_selfdes", this.cinematic);
                }
                else
                {
                    Icon13.Flick("intro_nuke", this.cinematic);
                    Task13.Sleep(35);
                    Game13.WriteMsg(new Sound("sound/effects/explosionfar.ogg"));
                }
            }
            else if (_f == 2)
            {
                Task13.Sleep(50);
                Game13.WriteMsg(new Sound("sound/effects/explosionfar.ogg"));
            }
            else
            {
                if (Lang13.Bool(this.mode) && !Lang13.Bool(_override))
                {
                    _override = this.mode.name;
                }

                dynamic _e = _override;                 // Was a switch-case, sorry for the mess.
                if (_e == "nuclear emergency")
                {
                    Icon13.Flick("intro_nuke", this.cinematic);
                    Task13.Sleep(35);
                    Icon13.Flick("station_explode_fade_red", this.cinematic);
                    Game13.WriteMsg(new Sound("sound/effects/explosionfar.ogg"));
                    this.cinematic.icon_state = "summary_nukewin";
                }
                else if (_e == "AI malfunction")
                {
                    Icon13.Flick("intro_malf", this.cinematic);
                    Task13.Sleep(76);
                    Icon13.Flick("station_explode_fade_red", this.cinematic);
                    Game13.WriteMsg(new Sound("sound/effects/explosionfar.ogg"));
                    this.cinematic.icon_state = "summary_malf";
                }
                else if (_e == "blob")
                {
                    Icon13.Flick("intro_nuke", this.cinematic);
                    Task13.Sleep(35);
                    Icon13.Flick("station_explode_fade_red", this.cinematic);
                    Game13.WriteMsg(new Sound("sound/effects/explosionfar.ogg"));
                    this.cinematic.icon_state = "summary_selfdes";
                }
                else if (_e == "no_core")
                {
                    Icon13.Flick("intro_nuke", this.cinematic);
                    Task13.Sleep(35);
                    Icon13.Flick("station_intact", this.cinematic);
                    Game13.WriteMsg(new Sound("sound/ambience/signal.ogg"));
                    Task13.Sleep(100);

                    if (this.cinematic != null)
                    {
                        GlobalFuncs.qdel(this.cinematic);
                        this.cinematic = null;
                    }

                    if (temp_buckle != null)
                    {
                        GlobalFuncs.qdel(temp_buckle);
                    }
                    return;
                }
                else
                {
                    Icon13.Flick("intro_nuke", this.cinematic);
                    Task13.Sleep(35);
                    Icon13.Flick("station_explode_fade_red", this.cinematic);
                    Game13.WriteMsg(new Sound("sound/effects/explosionfar.ogg"));
                    this.cinematic.icon_state = "summary_selfdes";
                }
            }
            Task13.Schedule(300, (Task13.Closure)(() => {
                if (this.cinematic != null)
                {
                    GlobalFuncs.qdel(this.cinematic);
                }

                if (temp_buckle != null)
                {
                    GlobalFuncs.qdel(temp_buckle);
                }
                return;
            }));
            return;
        }