コード例 #1
0
        // Function from file: html_interface.dm
        public void executeJavaScript(dynamic jscript = null, dynamic hclient = null)
        {
            dynamic client = null;


            if (Lang13.Bool(hclient))
            {
                hclient = this.getClient(hclient);

                if (hclient is HtmlInterfaceClient)
                {
                    if (Lang13.Bool(hclient.is_loaded))
                    {
                        Interface13.Output(hclient.client, String13.MakeUrlParams(new ByTable(new object [] { jscript })), new Txt("browser_").Ref(this).str(".browser:eval").ToString());
                    }
                }
            }
            else
            {
                foreach (dynamic _a in Lang13.Enumerate(this.clients))
                {
                    client = _a;


                    if (Lang13.Bool(this.clients[client]))
                    {
                        this.executeJavaScript(jscript, this.clients[client]);
                    }
                }
            }
            return;
        }
コード例 #2
0
        // Function from file: html_interface.dm
        public void _renderLayout(dynamic hclient = null, int?ignore_loaded = null)
        {
            ignore_loaded = ignore_loaded ?? GlobalVars.FALSE;

            string  html = null;
            dynamic id   = null;


            if (Lang13.Bool(hclient) && (Lang13.Bool(ignore_loaded) || Lang13.Bool(hclient.is_loaded)))
            {
                html = this.layout;

                if (html != hclient.layout)
                {
                    hclient.layout = html;
                    Interface13.Output(hclient.client, String13.MakeUrlParams(new ByTable(new object [] { html })), new Txt("browser_").Ref(this).str(".browser:updateLayout").ToString());

                    foreach (dynamic _a in Lang13.Enumerate(this.content_elements))
                    {
                        id = _a;

                        this._renderContent(id, hclient, null, ignore_loaded);
                    }
                }
            }
            return;
        }
コード例 #3
0
        // Function from file: html_interface.dm
        public void _renderTitle(dynamic hclient = null, int?ignore_cache = null, int?ignore_loaded = null)
        {
            ignore_cache  = ignore_cache ?? GlobalVars.FALSE;
            ignore_loaded = ignore_loaded ?? GlobalVars.FALSE;


            if (Lang13.Bool(hclient) && (Lang13.Bool(ignore_loaded) || Lang13.Bool(hclient.is_loaded)))
            {
                if (Lang13.Bool(ignore_cache) || this.title != hclient.title)
                {
                    hclient.title = this.title;
                    this.specificRenderTitle(hclient);
                    Interface13.Output(hclient.client, String13.MakeUrlParams(new ByTable(new object [] { this.title })), new Txt("browser_").Ref(this).str(".browser:setTitle").ToString());
                }
            }
            return;
        }
コード例 #4
0
        // Function from file: html_interface.dm
        public void _renderContent(dynamic id = null, dynamic hclient = null, int?ignore_cache = null, int?ignore_loaded = null)
        {
            ignore_cache  = ignore_cache ?? GlobalVars.FALSE;
            ignore_loaded = ignore_loaded ?? GlobalVars.FALSE;

            dynamic html = null;


            if (Lang13.Bool(hclient) && (Lang13.Bool(ignore_loaded) || Lang13.Bool(hclient.is_loaded)))
            {
                html = this.content_elements[id];

                if (Lang13.Bool(ignore_cache) || !Lang13.Bool(hclient.content_elements.Contains(id)) || html != hclient.content_elements[id])
                {
                    hclient.content_elements[id] = html;
                    Interface13.Output(hclient.client, String13.MakeUrlParams(new ByTable(new object [] { id, html })), new Txt("browser_").Ref(this).str(".browser:updateContent").ToString());
                }
            }
            return;
        }
コード例 #5
0
        // Function from file: tooltip.dm
        public bool show(Obj_Screen thing = null, string _params = null, string title = null, string content = null, string theme = null, string special = null)
        {
            theme   = theme ?? "default";
            special = special ?? "none";


            if (!(thing != null) || !Lang13.Bool(_params) || !Lang13.Bool(title) && !Lang13.Bool(content) || !(this.owner != null) || !Lang13.Bool(Lang13.IsNumber(Game13.icon_size)))
            {
                return(false);
            }

            if (!this.init)
            {
                this.init = true;
                Interface13.Output(this.owner, String13.MakeUrlParams(new ByTable(new object [] { Game13.icon_size, this.control })), "" + this.control + ":tooltip.init");
            }
            this.showing = true;

            if (Lang13.Bool(title) && Lang13.Bool(content))
            {
                title   = "<h1>" + title + "</h1>";
                content = "<p>" + content + "</p>";
            }
            else if (Lang13.Bool(title) && !Lang13.Bool(content))
            {
                title = "<p>" + title + "</p>";
            }
            else if (!Lang13.Bool(title) && Lang13.Bool(content))
            {
                content = "<p>" + content + "</p>";
            }
            _params = "{ \"cursor\": \"" + _params + "\", \"screenLoc\": \"" + thing.screen_loc + "\" }";
            Interface13.Output(this.owner, String13.MakeUrlParams(new ByTable(new object [] { _params, this.owner.view, "" + title + content, theme, special })), "" + this.control + ":tooltip.update");
            this.showing = false;

            if (this.queueHide)
            {
                this.hide();
            }
            return(true);
        }
コード例 #6
0
        // Function from file: html_interface.dm
        public void callJavaScript(string func = null, ByTable arguments = null, dynamic hclient = null)
        {
            dynamic client = null;


            if (!(arguments != null))
            {
                arguments = new ByTable();
            }

            if (Lang13.Bool(hclient))
            {
                hclient = this.getClient(hclient);

                if (hclient is HtmlInterfaceClient)
                {
                    if (Lang13.Bool(hclient.is_loaded))
                    {
                        Interface13.Output(hclient.client, String13.MakeUrlParams(arguments), new Txt("browser_").Ref(this).str(".browser:").item(func).ToString());
                    }
                }
            }
            else
            {
                foreach (dynamic _a in Lang13.Enumerate(this.clients))
                {
                    client = _a;


                    if (Lang13.Bool(this.clients[client]))
                    {
                        this.callJavaScript(func, arguments, this.clients[client]);
                    }
                }
            }
            return;
        }
コード例 #7
0
        // Function from file: tgui.dm
        public void open(  )
        {
            string window_size = null;
            bool   debugable   = false;


            if (!Lang13.Bool(this.user.client))
            {
                return;
            }
            this.update_status(false);

            if (this.status < 1)
            {
                return;
            }

            if (!(this.initial_data != null))
            {
                this.set_initial_data(this.src_object.ui_data(this.user));
            }
            window_size = "";

            if (Lang13.Bool(this.width) && Lang13.Bool(this.height))
            {
                window_size = "size=" + this.width + "x" + this.height + ";";
            }
            debugable = GlobalFuncs.check_rights_for(this.user.client, 32);
            Interface13.Browse(this.user, this.get_html(debugable), "window=" + this.window_id + ";" + window_size + String13.MakeUrlParams(this.window_options));
            Interface13.WindowSet(this.user, this.window_id, new Txt("on-close=\"uiclose ").Ref(this).str("\"").ToString());
            GlobalVars.SStgui.on_open(this);
            return;
        }
コード例 #8
0
        // Function from file: experimentor.dm
        public void experiment(double?exp = null, dynamic exp_on = null)
        {
            dynamic    chosenchem       = null;
            dynamic    criticalReaction = null;
            Mob_Living m        = null;
            dynamic    target   = null;
            dynamic    throwing = null;
            dynamic    T        = null;
            Obj_Effect_Decal_Cleanable_Greenglow reagentdecal = null;
            string   savedName = null;
            dynamic  newPath   = null;
            dynamic  CG        = null;
            Reagents R         = null;
            EffectSystem_SmokeSpread_Chem smoke = null;
            Reagents R2 = null;
            EffectSystem_SmokeSpread_Chem smoke2 = null;
            Obj_Item_Weapon_ReagentContainers_Food_Drinks_Coffee C = null;
            dynamic start = null;
            dynamic M     = null;
            dynamic MT    = null;
            Obj_Item_Projectile_Magic_Fireball FB = null;
            GasMixture env                  = null;
            double     transfer_moles       = 0;
            GasMixture removed              = null;
            double?    heat_capacity        = null;
            Mob_Living m2                   = null;
            Obj_Machinery_Vending_Coffee C2 = null;
            Reagents R3 = null;
            EffectSystem_SmokeSpread_Chem smoke3 = null;
            GasMixture env2                 = null;
            double     transfer_moles2      = 0;
            GasMixture removed2             = null;
            double?    heat_capacity2       = null;
            EffectSystem_SmokeSpread smoke4 = null;
            dynamic     material            = null;
            Ent_Dynamic AM         = null;
            ByTable     throwAt    = null;
            Ent_Dynamic AM2        = null;
            int?        counter    = null;
            Ent_Dynamic cast       = null;
            dynamic     a          = null;
            dynamic     b          = null;
            dynamic     R4         = null;
            int         globalMalf = 0;
            Mob_Living  m3         = null;
            ByTable     reqs       = null;
            dynamic     T2         = null;

            this.recentlyExperimented = true;
            this.icon_state           = "h_lathe_wloop";
            criticalReaction          = Lang13.FindIn(exp_on, (this.critical_items != null ? GlobalVars.TRUE : GlobalVars.FALSE));

            if (exp == 1)
            {
                this.visible_message("" + this + " prods at " + exp_on + " with mechanical arms.");

                if (Rand13.PercentChance(35) && Lang13.Bool(criticalReaction))
                {
                    this.visible_message("" + exp_on + " is gripped in just the right way, enhancing its focus.");
                    this.badThingCoeff++;
                }

                if (Rand13.PercentChance(((int)(20 - this.badThingCoeff))))
                {
                    this.visible_message("<span class='danger'>" + this + " malfunctions and destroys " + exp_on + ", lashing its arms out at nearby people!</span>");

                    foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInViewExcludeThis(this, 1), typeof(Mob_Living)))
                    {
                        m = _a;

                        m.apply_damage(15, "brute", Rand13.Pick(new object [] { "head", "chest", "groin" }));
                        this.investigate_log("Experimentor dealt minor brute to " + m + ".", "experimentor");
                    }
                    this.ejectItem(GlobalVars.TRUE);
                }

                if (Rand13.PercentChance(((int)(35 - this.badThingCoeff))))
                {
                    this.visible_message("<span class='warning'>" + this + " malfunctions!</span>");
                    exp = 6;
                }

                if (Rand13.PercentChance(((int)(50 - this.badThingCoeff))))
                {
                    this.visible_message("<span class='danger'>" + this + " malfunctions, throwing the " + exp_on + "!</span>");
                    target = Lang13.FindIn(typeof(Mob_Living), Map13.FetchInViewExcludeThis(this, 7));

                    if (Lang13.Bool(target))
                    {
                        throwing = this.loaded_item;
                        this.investigate_log("Experimentor has thrown " + this.loaded_item + " at " + target, "experimentor");
                        this.ejectItem();

                        if (Lang13.Bool(throwing))
                        {
                            ((Ent_Dynamic)throwing).throw_at(target, 10, 1);
                        }
                    }
                }
            }

            if (exp == 2)
            {
                this.visible_message("<span class='danger'>" + this + " reflects radioactive rays at " + exp_on + "!</span>");

                if (Rand13.PercentChance(35) && Lang13.Bool(criticalReaction))
                {
                    this.visible_message("" + exp_on + " has activated an unknown subroutine!");
                    this.cloneMode  = GlobalVars.TRUE;
                    this.cloneCount = this.badThingCoeff;
                    this.investigate_log("Experimentor has made a clone of " + exp_on, "experimentor");
                    this.ejectItem();
                }

                if (Rand13.PercentChance(((int)(20 - this.badThingCoeff))))
                {
                    this.visible_message("<span class='danger'>" + this + " malfunctions, melting " + exp_on + " and leaking radiation!</span>");
                    GlobalFuncs.radiation_pulse(GlobalFuncs.get_turf(this), 1, 1, 25, true);
                    this.ejectItem(GlobalVars.TRUE);
                }

                if (Rand13.PercentChance(((int)(35 - this.badThingCoeff))))
                {
                    this.visible_message("<span class='warning'>" + this + " malfunctions, spewing toxic waste!</span>");

                    foreach (dynamic _b in Lang13.Enumerate(Map13.FetchInViewExcludeThis(this, 1)))
                    {
                        T = _b;


                        if (!T.density)
                        {
                            if (Rand13.PercentChance(95))
                            {
                                reagentdecal = new Obj_Effect_Decal_Cleanable_Greenglow(T);
                                reagentdecal.reagents.add_reagent("radium", 7);
                            }
                        }
                    }
                }

                if (Rand13.PercentChance(((int)(50 - this.badThingCoeff))))
                {
                    savedName = "" + exp_on;
                    this.ejectItem(GlobalVars.TRUE);
                    newPath          = this.pickWeighted(this.valid_items);
                    this.loaded_item = Lang13.Call(newPath, this);
                    this.visible_message("<span class='warning'>" + this + " malfunctions, transforming " + savedName + " into " + this.loaded_item + "!</span>");
                    this.investigate_log("Experimentor has transformed " + savedName + " into " + this.loaded_item, "experimentor");

                    if (this.loaded_item is Obj_Item_Weapon_Grenade_ChemGrenade)
                    {
                        CG = this.loaded_item;
                        ((Obj_Item_Weapon_Grenade)CG).prime();
                    }
                    this.ejectItem();
                }
            }

            if (exp == 3)
            {
                this.visible_message("<span class='warning'>" + this + " fills its chamber with gas, " + exp_on + " included.</span>");

                if (Rand13.PercentChance(35) && Lang13.Bool(criticalReaction))
                {
                    this.visible_message("" + exp_on + " achieves the perfect mix!");
                    new Obj_Item_Stack_Sheet_Mineral_Plasma(GlobalFuncs.get_turf(Rand13.PickFromTable(Map13.FetchInViewExcludeThis(this, 1))));
                }

                if (Rand13.PercentChance(((int)(20 - this.badThingCoeff))))
                {
                    this.visible_message("<span class='danger'>" + this + " destroys " + exp_on + ", leaking dangerous gas!</span>");
                    chosenchem = Rand13.Pick(new object [] { "carbon", "radium", "toxin", "condensedcapsaicin", "mushroomhallucinogen", "space_drugs", "ethanol", "beepskysmash" });
                    R          = new Reagents(50);
                    R.my_atom  = this;
                    R.add_reagent(chosenchem, 50);
                    this.investigate_log("Experimentor has released " + chosenchem + " smoke.", "experimentor");
                    smoke = new EffectSystem_SmokeSpread_Chem();
                    smoke.set_up(R, 0, this);
                    GlobalFuncs.playsound(this.loc, "sound/effects/smoke.ogg", 50, 1, -3);
                    smoke.start();
                    GlobalFuncs.qdel(R);
                    this.ejectItem(GlobalVars.TRUE);
                }

                if (Rand13.PercentChance(((int)(20 - this.badThingCoeff))))
                {
                    this.visible_message("<span class='danger'>" + this + "'s chemical chamber has sprung a leak!</span>");
                    chosenchem = Rand13.Pick(new object [] { "mutationtoxin", "nanomachines", "sacid" });
                    R2         = new Reagents(50);
                    R2.my_atom = this;
                    R2.add_reagent(chosenchem, 50);
                    smoke2 = new EffectSystem_SmokeSpread_Chem();
                    smoke2.set_up(R2, 0, this);
                    GlobalFuncs.playsound(this.loc, "sound/effects/smoke.ogg", 50, 1, -3);
                    smoke2.start();
                    GlobalFuncs.qdel(R2);
                    this.ejectItem(GlobalVars.TRUE);
                    this.warn_admins(Task13.User, "" + chosenchem + " smoke");
                    this.investigate_log("Experimentor has released <font color='red'>" + chosenchem + "</font> smoke!", "experimentor");
                }

                if (Rand13.PercentChance(((int)(35 - this.badThingCoeff))))
                {
                    this.visible_message("" + this + " malfunctions, spewing harmless gas.");
                    this.throwSmoke(this.loc);
                }

                if (Rand13.PercentChance(((int)(50 - this.badThingCoeff))))
                {
                    this.visible_message("<span class='warning'>" + this + " melts " + exp_on + ", ionizing the air around it!</span>");
                    GlobalFuncs.empulse(this.loc, 4, 6);
                    this.investigate_log("Experimentor has generated an Electromagnetic Pulse.", "experimentor");
                    this.ejectItem(GlobalVars.TRUE);
                }
            }

            if (exp == 4)
            {
                this.visible_message("" + this + " raises " + exp_on + "'s temperature.");

                if (Rand13.PercentChance(35) && Lang13.Bool(criticalReaction))
                {
                    this.visible_message("<span class='warning'>" + this + "'s emergency coolant system gives off a small ding!</span>");
                    GlobalFuncs.playsound(this.loc, "sound/machines/ding.ogg", 50, 1);
                    C          = new Obj_Item_Weapon_ReagentContainers_Food_Drinks_Coffee(GlobalFuncs.get_turf(Rand13.PickFromTable(Map13.FetchInViewExcludeThis(this, 1))));
                    chosenchem = Rand13.Pick(new object [] { "plasma", "capsaicin", "ethanol" });
                    C.reagents.remove_any(25);
                    C.reagents.add_reagent(chosenchem, 50);
                    C.name = "Cup of Suspicious Liquid";
                    C.desc = "It has a large hazard symbol printed on the side in fading ink.";
                    this.investigate_log("Experimentor has made a cup of " + chosenchem + " coffee.", "experimentor");
                }

                if (Rand13.PercentChance(((int)(20 - this.badThingCoeff))))
                {
                    start = GlobalFuncs.get_turf(this);
                    M     = Lang13.FindIn(typeof(Mob_Living), Map13.FetchInView(3, this));
                    MT    = GlobalFuncs.get_turf(M);

                    if (Lang13.Bool(MT))
                    {
                        this.visible_message("<span class='danger'>" + this + " dangerously overheats, launching a flaming fuel orb!</span>");
                        this.investigate_log("Experimentor has launched a <font color='red'>fireball</font> at " + M + "!", "experimentor");
                        FB          = new Obj_Item_Projectile_Magic_Fireball(start);
                        FB.original = MT;
                        FB.current  = start;
                        FB.yo       = Convert.ToDouble(MT.y - start.y);
                        FB.xo       = Convert.ToDouble(MT.x - start.x);
                        FB.fire();
                    }
                }

                if (Rand13.PercentChance(((int)(35 - this.badThingCoeff))))
                {
                    this.visible_message("<span class='danger'>" + this + " malfunctions, melting " + exp_on + " and releasing a burst of flame!</span>");
                    GlobalFuncs.explosion(this.loc, -1, 0, 0, 0, 0, null, 2);
                    this.investigate_log("Experimentor started a fire.", "experimentor");
                    this.ejectItem(GlobalVars.TRUE);
                }

                if (Rand13.PercentChance(((int)(50 - this.badThingCoeff))))
                {
                    this.visible_message("<span class='warning'>" + this + " malfunctions, melting " + exp_on + " and leaking hot air!</span>");
                    env            = this.loc.return_air();
                    transfer_moles = env.total_moles() * 0.25;
                    removed        = env.remove(transfer_moles);

                    if (removed != null)
                    {
                        heat_capacity = removed.heat_capacity();

                        if (heat_capacity == 0 || heat_capacity == null)
                        {
                            heat_capacity = 1;
                        }
                        removed.temperature = Num13.MinInt(Convert.ToInt32((removed.temperature * heat_capacity + 100000) / heat_capacity), 1000);
                    }
                    env.merge(removed);
                    this.air_update_turf();
                    this.investigate_log("Experimentor has released hot air.", "experimentor");
                    this.ejectItem(GlobalVars.TRUE);
                }

                if (Rand13.PercentChance(((int)(50 - this.badThingCoeff))))
                {
                    this.visible_message("<span class='warning'>" + this + " malfunctions, activating its emergency coolant systems!</span>");
                    this.throwSmoke(this.loc);

                    foreach (dynamic _c in Lang13.Enumerate(Map13.FetchInViewExcludeThis(this, 1), typeof(Mob_Living)))
                    {
                        m2 = _c;

                        m2.apply_damage(5, "burn", Rand13.Pick(new object [] { "head", "chest", "groin" }));
                        this.investigate_log("Experimentor has dealt minor burn damage to " + m2, "experimentor");
                    }
                    this.ejectItem();
                }
            }

            if (exp == 5)
            {
                this.visible_message("" + this + " lowers " + exp_on + "'s temperature.");

                if (Rand13.PercentChance(35) && Lang13.Bool(criticalReaction))
                {
                    this.visible_message("<span class='warning'>" + this + "'s emergency coolant system gives off a small ding!</span>");
                    C2 = new Obj_Machinery_Vending_Coffee(GlobalFuncs.get_turf(Rand13.PickFromTable(Map13.FetchInViewExcludeThis(this, 1))));
                    GlobalFuncs.playsound(this.loc, "sound/machines/ding.ogg", 50, 1);
                    chosenchem = Rand13.Pick(new object [] { "uranium", "frostoil", "ephedrine" });
                    C2.reagents.remove_any(25);
                    C2.reagents.add_reagent(chosenchem, 50);
                    C2.name = "Cup of Suspicious Liquid";
                    C2.desc = "It has a large hazard symbol printed on the side in fading ink.";
                    this.investigate_log("Experimentor has made a cup of " + chosenchem + " coffee.", "experimentor");
                }

                if (Rand13.PercentChance(((int)(20 - this.badThingCoeff))))
                {
                    this.visible_message("<span class='danger'>" + this + " malfunctions, shattering " + exp_on + " and releasing a dangerous cloud of coolant!</span>");
                    R3         = new Reagents(50);
                    R3.my_atom = this;
                    R3.add_reagent("frostoil", 50);
                    this.investigate_log("Experimentor has released frostoil gas.", "experimentor");
                    smoke3 = new EffectSystem_SmokeSpread_Chem();
                    smoke3.set_up(R3, 0, this);
                    GlobalFuncs.playsound(this.loc, "sound/effects/smoke.ogg", 50, 1, -3);
                    smoke3.start();
                    GlobalFuncs.qdel(R3);
                    this.ejectItem(GlobalVars.TRUE);
                }

                if (Rand13.PercentChance(((int)(35 - this.badThingCoeff))))
                {
                    this.visible_message("<span class='warning'>" + this + " malfunctions, shattering " + exp_on + " and leaking cold air!</span>");
                    env2            = this.loc.return_air();
                    transfer_moles2 = env2.total_moles() * 0.25;
                    removed2        = env2.remove(transfer_moles2);

                    if (removed2 != null)
                    {
                        heat_capacity2 = removed2.heat_capacity();

                        if (heat_capacity2 == 0 || heat_capacity2 == null)
                        {
                            heat_capacity2 = 1;
                        }
                        removed2.temperature = (removed2.temperature * heat_capacity2 - 75000) / heat_capacity2;
                    }
                    env2.merge(removed2);
                    this.air_update_turf();
                    this.investigate_log("Experimentor has released cold air.", "experimentor");
                    this.ejectItem(GlobalVars.TRUE);
                }

                if (Rand13.PercentChance(((int)(50 - this.badThingCoeff))))
                {
                    this.visible_message("<span class='warning'>" + this + " malfunctions, releasing a flurry of chilly air as " + exp_on + " pops out!</span>");
                    smoke4 = new EffectSystem_SmokeSpread();
                    smoke4.set_up(0, this.loc);
                    smoke4.start();
                    this.ejectItem();
                }
            }

            if (exp == 6)
            {
                this.visible_message("<span class='warning'>" + exp_on + " activates the crushing mechanism, " + exp_on + " is destroyed!</span>");

                if (Rand13.PercentChance(35) && Lang13.Bool(criticalReaction))
                {
                    this.visible_message("<span class='warning'>" + this + "'s crushing mechanism slowly and smoothly descends, flattening the " + exp_on + "!</span>");
                    new Obj_Item_Stack_Sheet_Plasteel(GlobalFuncs.get_turf(Rand13.PickFromTable(Map13.FetchInViewExcludeThis(this, 1))));
                }

                if (this.linked_console.linked_lathe != null)
                {
                    foreach (dynamic _d in Lang13.Enumerate(exp_on.materials))
                    {
                        material = _d;

                        ((MaterialContainer)((dynamic)this.linked_console.linked_lathe).materials).insert_amount(Num13.MinInt(Convert.ToInt32(((dynamic)this.linked_console.linked_lathe).materials.max_amount - ((dynamic)this.linked_console.linked_lathe).materials.total_amount), Convert.ToInt32(exp_on.materials[material])), material);
                    }
                }

                if (Rand13.PercentChance(((int)(20 - this.badThingCoeff))))
                {
                    this.visible_message("<span class='danger'>" + this + "'s crusher goes way too many levels too high, crushing right through space-time!</span>");
                    GlobalFuncs.playsound(this.loc, "sound/effects/supermatter.ogg", 50, 1, -3);
                    this.investigate_log("Experimentor has triggered the 'throw things' reaction.", "experimentor");

                    foreach (dynamic _e in Lang13.Enumerate(Map13.FetchInViewExcludeThis(this, 7), typeof(Ent_Dynamic)))
                    {
                        AM = _e;


                        if (!Lang13.Bool(AM.anchored))
                        {
                            AM.throw_at_fast(this, 10, 1);
                        }
                    }
                }

                if (Rand13.PercentChance(((int)(35 - this.badThingCoeff))))
                {
                    this.visible_message("<span class='danger'>" + this + "'s crusher goes one level too high, crushing right into space-time!</span>");
                    GlobalFuncs.playsound(this.loc, "sound/effects/supermatter.ogg", 50, 1, -3);
                    this.investigate_log("Experimentor has triggered the 'minor throw things' reaction.", "experimentor");
                    throwAt = new ByTable();

                    foreach (dynamic _f in Lang13.Enumerate(Map13.FetchInViewExcludeThis(this, 7), typeof(Ent_Dynamic)))
                    {
                        AM2 = _f;


                        if (!Lang13.Bool(AM2.anchored))
                        {
                            throwAt.Add(AM2);
                        }
                    }
                    counter = null;
                    counter = 1;

                    while ((counter ?? 0) < throwAt.len)
                    {
                        cast = throwAt[counter];
                        cast.throw_at_fast(Rand13.PickFromTable(throwAt), 10, 1);
                        counter++;
                    }
                }
                this.ejectItem(GlobalVars.TRUE);
            }

            if (exp == 8)
            {
                a = Rand13.Pick(new object [] { "rumbles", "shakes", "vibrates", "shudders" });
                b = Rand13.Pick(new object [] { "crushes", "spins", "viscerates", "smashes", "insults" });
                this.visible_message("<span class='warning'>" + exp_on + " " + a + ", and " + b + ", the experiment was a failure.</span>");
            }

            if (exp == 7)
            {
                this.visible_message("" + this + " scans the " + exp_on + ", revealing its true nature!");
                GlobalFuncs.playsound(this.loc, "sound/effects/supermatter.ogg", 50, 3, -1);
                R4 = this.loaded_item;
                R4.reveal();
                this.investigate_log("Experimentor has revealed a relic with <span class='danger'>" + R4.realProc + "</span> effect.", "experimentor");
                this.ejectItem();
            }

            if (Rand13.PercentChance(((int)(20 - this.badThingCoeff))))
            {
                globalMalf = Rand13.Int(1, 100);

                if (globalMalf < 15)
                {
                    this.visible_message("<span class='warning'>" + this + "'s onboard detection system has malfunctioned!</span>");
                    this.item_reactions["" + exp_on.type] = Rand13.Pick(new object [] { 1, 2, 3, 4, 5, 6 });
                    this.ejectItem();
                }

                if (globalMalf > 16 && globalMalf < 35)
                {
                    this.visible_message("<span class='warning'>" + this + " melts " + exp_on + ", ian-izing the air around it!</span>");
                    this.throwSmoke(this.loc);

                    if (Lang13.Bool(this.trackedIan))
                    {
                        this.throwSmoke(this.trackedIan.loc);
                        this.trackedIan.loc = this.loc;
                        this.investigate_log("Experimentor has stolen Ian!", "experimentor");
                    }
                    else
                    {
                        new Mob_Living_SimpleAnimal_Pet_Dog_Corgi(this.loc);
                        this.investigate_log("Experimentor has spawned a new corgi.", "experimentor");
                    }
                    this.ejectItem(GlobalVars.TRUE);
                }

                if (globalMalf > 36 && globalMalf < 50)
                {
                    this.visible_message("<span class='warning'>" + this + " improves " + exp_on + ", drawing the life essence of those nearby!</span>");

                    foreach (dynamic _g in Lang13.Enumerate(Map13.FetchInView(this, 4), typeof(Mob_Living)))
                    {
                        m3 = _g;

                        m3.WriteMsg("<span class='danger'>You feel your flesh being torn from you, mists of blood drifting to " + this + "!</span>");
                        m3.apply_damage(50, "brute", "chest");
                        this.investigate_log("Experimentor has taken 50 brute a blood sacrifice from " + m3, "experimentor");
                    }
                    reqs = this.ConvertReqString2List(exp_on.origin_tech);

                    foreach (dynamic _h in Lang13.Enumerate(reqs))
                    {
                        T2 = _h;

                        reqs[T2] = reqs[T2] + 1;
                    }
                    exp_on.origin_tech = String13.MakeUrlParams(reqs);
                    this.investigate_log("Experimentor has set the origin tech of " + exp_on + " to " + exp_on.origin_tech, "experimentor");
                }

                if (globalMalf > 51 && globalMalf < 75)
                {
                    this.visible_message("<span class='warning'>" + this + " encounters a run-time error!</span>");
                    this.throwSmoke(this.loc);

                    if (Lang13.Bool(this.trackedRuntime))
                    {
                        this.throwSmoke(this.trackedRuntime.loc);
                        this.trackedRuntime.loc = this.loc;
                        this.investigate_log("Experimentor has stolen Runtime!", "experimentor");
                    }
                    else
                    {
                        new Mob_Living_SimpleAnimal_Pet_Cat(this.loc);
                        this.investigate_log("Experimentor failed to steal runtime, and instead spawned a new cat.", "experimentor");
                    }
                    this.ejectItem(GlobalVars.TRUE);
                }

                if (globalMalf > 76)
                {
                    this.visible_message("<span class='warning'>" + this + " begins to smoke and hiss, shaking violently!</span>");
                    this.f_use_power(500000);
                    this.investigate_log("Experimentor has drained power from its APC", "experimentor");
                }
            }
            Task13.Schedule(((int)(this.resetTime)), (Task13.Closure)(() => {
                this.icon_state           = "h_lathe";
                this.recentlyExperimented = false;
                return;
            }));
            return;
        }
コード例 #9
0
        // Function from file: nanotrasen.dm
        public override dynamic createWindow(dynamic hclient = null)
        {
            dynamic _default = null;

            _default = base.createWindow((object)(hclient));
            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).ToString(), String13.MakeUrlParams(new ByTable().Set("titlebar", "false")));
            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).str(".browser").ToString(), String13.MakeUrlParams(new ByTable().Set("pos", "0,35").Set("size", "" + this.width + "x" + ((this.height ?? 0) - 35))));
            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).str(".topbg").ToString(), String13.MakeUrlParams(new ByTable()
                                                                                                                                 .Set("parent", new Txt("browser_").Ref(this).ToString())
                                                                                                                                 .Set("type", "label")
                                                                                                                                 .Set("pos", "0,0")
                                                                                                                                 .Set("size", "" + this.width + "x35")
                                                                                                                                 .Set("anchor1", "0,0")
                                                                                                                                 .Set("anchor2", "100,0")
                                                                                                                                 .Set("image", "" + "uiBgtop.png")
                                                                                                                                 .Set("image-mode", "tile")
                                                                                                                                 .Set("is-disabled", "true")
                                                                                                                                 ));
            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).str(".uiTitleFluff").ToString(), String13.MakeUrlParams(new ByTable()
                                                                                                                                        .Set("parent", new Txt("browser_").Ref(this).ToString())
                                                                                                                                        .Set("type", "label")
                                                                                                                                        .Set("pos", "" + ((this.width ?? 0) - 42 - 4 - 24 - 4 - 24 - 4) + ",5")
                                                                                                                                        .Set("size", "42x24")
                                                                                                                                        .Set("anchor1", "100,0")
                                                                                                                                        .Set("anchor2", "100,0")
                                                                                                                                        .Set("image", "" + "uiTitleFluff.png")
                                                                                                                                        .Set("image-mode", "tile")
                                                                                                                                        .Set("is-disabled", "true")
                                                                                                                                        ));
            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).str(".uiTitleEye").ToString(), String13.MakeUrlParams(new ByTable()
                                                                                                                                      .Set("parent", new Txt("browser_").Ref(this).ToString())
                                                                                                                                      .Set("type", "label")
                                                                                                                                      .Set("pos", "8,5")
                                                                                                                                      .Set("size", "42x24")
                                                                                                                                      .Set("anchor1", "0,0")
                                                                                                                                      .Set("anchor2", "0,0")
                                                                                                                                      .Set("image", "" + "uiEyeGreen.png")
                                                                                                                                      .Set("image-mode", "tile")
                                                                                                                                      .Set("is-disabled", "true")
                                                                                                                                      ));
            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).str(".uiTitle").ToString(), String13.MakeUrlParams(new ByTable()
                                                                                                                                   .Set("parent", new Txt("browser_").Ref(this).ToString())
                                                                                                                                   .Set("type", "label")
                                                                                                                                   .Set("is-transparent", "true")
                                                                                                                                   .Set("pos", "64,0")
                                                                                                                                   .Set("size", "580x35")
                                                                                                                                   .Set("anchor1", "0,0")
                                                                                                                                   .Set("anchor2", "100,0")
                                                                                                                                   .Set("is-disabled", "true")
                                                                                                                                   .Set("text", "" + this.title)
                                                                                                                                   .Set("align", "left")
                                                                                                                                   .Set("font-family", "verdana,Geneva,sans-serif")
                                                                                                                                   .Set("font-size", "12")
                                                                                                                                   .Set("text-color", "#E9C183")
                                                                                                                                   ));
            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).str(".uiTitleMinimize").ToString(), String13.MakeUrlParams(new ByTable()
                                                                                                                                           .Set("parent", new Txt("browser_").Ref(this).ToString())
                                                                                                                                           .Set("type", "button")
                                                                                                                                           .Set("is-flat", "true")
                                                                                                                                           .Set("background-color", "#383838")
                                                                                                                                           .Set("text-color", "#FFFFFF")
                                                                                                                                           .Set("is-transparent", "true")
                                                                                                                                           .Set("pos", "" + ((this.width ?? 0) - 24 - 4 - 24 - 4) + ",5")
                                                                                                                                           .Set("size", "24x24")
                                                                                                                                           .Set("anchor1", "100,0")
                                                                                                                                           .Set("anchor2", "100,0")
                                                                                                                                           .Set("text", "-")
                                                                                                                                           .Set("font-family", "verdana,Geneva,sans-serif")
                                                                                                                                           .Set("font-size", "12")
                                                                                                                                           .Set("command", new Txt(".winset \"browser_").Ref(this).str(".can-resize=false;browser_").Ref(this).str(".is-minimized=true;browser_").Ref(this).str(".on-size=\".swinset \\\"browser_").Ref(this).str(".can-resize=true;browser_").Ref(this).str(".on-size=\\\"\"\"").ToString())
                                                                                                                                           ));
            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).str(".uiTitleClose").ToString(), String13.MakeUrlParams(new ByTable()
                                                                                                                                        .Set("parent", new Txt("browser_").Ref(this).ToString())
                                                                                                                                        .Set("type", "button")
                                                                                                                                        .Set("is-flat", "true")
                                                                                                                                        .Set("background-color", "#383838")
                                                                                                                                        .Set("text-color", "#FFFFFF")
                                                                                                                                        .Set("command", new Txt("byond://?src=").Ref(this).str(";html_interface_action=onclose").ToString())
                                                                                                                                        .Set("is-transparent", "true")
                                                                                                                                        .Set("pos", "" + ((this.width ?? 0) - 24 - 4) + ",5")
                                                                                                                                        .Set("size", "24x24")
                                                                                                                                        .Set("anchor1", "100,0")
                                                                                                                                        .Set("anchor2", "100,0")
                                                                                                                                        .Set("text", "X")
                                                                                                                                        .Set("font-family", "verdana,Geneva,sans-serif")
                                                                                                                                        .Set("font-size", "12")
                                                                                                                                        ));
            return(_default);
        }
コード例 #10
0
        // Function from file: tgstation.dme
        public void setEyeColor(string color = null, dynamic hclient = null)
        {
            string resource = null;

            hclient = this.getClient(hclient);

            if (hclient is HtmlInterfaceClient)
            {
                switch ((string)(color))
                {
                case "green":
                    resource = "uiEyeGreen.png";
                    break;

                case "orange":
                    resource = "uiEyeOrange.png";
                    break;

                case "red":
                    resource = "uiEyeRed.png";
                    break;

                default:
                    Task13.Crash("Invalid color: " + color);
                    break;
                }

                if (((HtmlInterfaceClient)hclient).getExtraVar("eye_color") != color)
                {
                    ((HtmlInterfaceClient)hclient).putExtraVar("eye_color", color);
                    Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).str(".uiTitleEye").ToString(), String13.MakeUrlParams(new ByTable().Set("image", "" + resource)));
                }
            }
            else
            {
                GlobalFuncs.warning("" + "Invalid object passed to /datum/html_interface/nanotrasen/proc/setEyeColor" + " in " + "tgstation.dme" + " at line " + 1078 + " src: " + this + " usr: "******".");
            }
            return;
        }
コード例 #11
0
        // Function from file: html_interface.dm
        public virtual dynamic createWindow(dynamic hclient = null)
        {
            ByTable _params = null;

            Interface13.WindowClone(hclient.client, "window", new Txt("browser_").Ref(this).ToString());
            _params = new ByTable()
                      .Set("size", "" + this.width + "x" + this.height)
                      .Set("statusbar", "false")
                      .Set("on-close", new Txt("byond://?src=").Ref(this).str("&html_interface_action=onclose").ToString())
            ;

            if (Lang13.Bool(hclient.client.hi_last_pos))
            {
                _params["pos"] = "" + hclient.client.hi_last_pos;
            }
            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).ToString(), String13.MakeUrlParams(_params));
            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).str(".browser").ToString(), String13.MakeUrlParams(new ByTable()
                                                                                                                                   .Set("parent", new Txt("browser_").Ref(this).ToString())
                                                                                                                                   .Set("type", "browser")
                                                                                                                                   .Set("pos", "0,0")
                                                                                                                                   .Set("size", "" + this.width + "x" + this.height)
                                                                                                                                   .Set("anchor1", "0,0")
                                                                                                                                   .Set("anchor2", "100,100")
                                                                                                                                   .Set("use-title", "true")
                                                                                                                                   .Set("auto-format", "false")
                                                                                                                                   ));
            return(null);
        }
コード例 #12
0
        // Function from file: nanotrasen.dm
        public void specificRenderTitle(dynamic hclient = null, int?ignore_cache = null)
        {
            ignore_cache = ignore_cache ?? GlobalVars.FALSE;

            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).str(".uiTitle").ToString(), String13.MakeUrlParams(new ByTable().Set("text", "" + this.title)));
            return;
        }