Пример #1
0
        // Function from file: h_sandbox.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            Mob P = null;
            Obj_Machinery_PortableAtmospherics_Scrubber hsb = null;
            Obj_Item_Weapon_Card_Id_Gold ID = null;
            dynamic all_items  = null;
            dynamic typekey    = null;
            dynamic O          = null;
            dynamic all_items2 = null;
            dynamic typekey2   = null;
            dynamic O2         = null;
            dynamic all_items3 = null;
            dynamic typekey3   = null;
            dynamic O3         = null;
            Type    typepath   = null;
            Type    typepath2  = null;


            if (!(Task13.User != null) || !(this != null) || !(this.owner == Task13.User.ckey))
            {
                if (Task13.User != null)
                {
                    Interface13.Browse(Task13.User, null, "window=sandbox");
                }
                return(null);
            }

            if (Lang13.Bool(href_list["hsb"]))
            {
                dynamic _g = href_list["hsb"];                 // Was a switch-case, sorry for the mess.
                if (_g == "hsbtobj")
                {
                    if (!this.admin)
                    {
                        return(null);
                    }

                    if (GlobalVars.hsboxspawn)
                    {
                        Game13.WriteMsg(new Txt("<span class='boldannounce'>Sandbox:</span> <b>").black().item(Task13.User.key).str(" has disabled object spawning!</b>").ToString());
                        GlobalVars.hsboxspawn = false;
                        return(null);
                    }
                    else
                    {
                        Game13.WriteMsg(new Txt("<span class='boldnotice'>Sandbox:</span> <b>").black().item(Task13.User.key).str(" has enabled object spawning!</b>").ToString());
                        GlobalVars.hsboxspawn = true;
                        return(null);
                    }
                }
                else if (_g == "hsbtac")
                {
                    if (!this.admin)
                    {
                        return(null);
                    }

                    if (GlobalVars.config.sandbox_autoclose)
                    {
                        Game13.WriteMsg(new Txt("<span class='boldnotice'>Sandbox:</span> <b>").black().item(Task13.User.key).str(" has removed the object spawn limiter.</b>").ToString());
                        GlobalVars.config.sandbox_autoclose = false;
                    }
                    else
                    {
                        Game13.WriteMsg(new Txt("<span class='danger'>Sandbox:</span> <b>").black().item(Task13.User.key).str(" has added a limiter to object spawning.  The window will now auto-close after use.</b>").ToString());
                        GlobalVars.config.sandbox_autoclose = true;
                    }
                    return(null);
                }
                else if (_g == "hsbsuit")
                {
                    P = Task13.User;

                    if (!(P is Mob_Living_Carbon_Human))
                    {
                        return(null);
                    }

                    if (Lang13.Bool(((dynamic)P).wear_suit))
                    {
                        ((dynamic)P).wear_suit.loc   = P.loc;
                        ((dynamic)P).wear_suit.layer = Lang13.Initial(((dynamic)P).wear_suit, "layer");
                        ((dynamic)P).wear_suit       = null;
                    }
                    ((dynamic)P).wear_suit       = new Obj_Item_Clothing_Suit_Space(P);
                    ((dynamic)P).wear_suit.layer = 20;
                    P.update_inv_wear_suit();

                    if (Lang13.Bool(((dynamic)P).head))
                    {
                        ((dynamic)P).head.loc   = P.loc;
                        ((dynamic)P).head.layer = Lang13.Initial(((dynamic)P).head, "layer");
                        ((dynamic)P).head       = null;
                    }
                    ((dynamic)P).head       = new Obj_Item_Clothing_Head_Helmet_Space(P);
                    ((dynamic)P).head.layer = 20;
                    P.update_inv_head();

                    if (Lang13.Bool(((dynamic)P).wear_mask))
                    {
                        ((dynamic)P).wear_mask.loc   = P.loc;
                        ((dynamic)P).wear_mask.layer = Lang13.Initial(((dynamic)P).wear_mask, "layer");
                        ((dynamic)P).wear_mask       = null;
                    }
                    ((dynamic)P).wear_mask       = new Obj_Item_Clothing_Mask_Gas(P);
                    ((dynamic)P).wear_mask.layer = 20;
                    P.update_inv_wear_mask();

                    if (Lang13.Bool(((dynamic)P).back))
                    {
                        ((dynamic)P).back.loc   = P.loc;
                        ((dynamic)P).back.layer = Lang13.Initial(((dynamic)P).back, "layer");
                        ((dynamic)P).back       = null;
                    }
                    ((dynamic)P).back       = new Obj_Item_Weapon_Tank_Jetpack_Oxygen(P);
                    ((dynamic)P).back.layer = 20;
                    P.update_inv_back();
                    ((dynamic)P).v_internal = ((dynamic)P).back;
                    ((dynamic)P).update_internals_hud_icon(1);
                }
                else if (_g == "hsbscrubber")
                {
                    hsb = new Obj_Machinery_PortableAtmospherics_Scrubber(Task13.User.loc)
                    {
                        volume_rate = 5066.25,
                        on          = 1
                    };
                    hsb.update_icon();
                }
                else if (_g == "hsbrglass")
                {
                    new Obj_Item_Stack_Sheet_Rglass(Task13.User.loc)
                    {
                        amount = 50
                    };
                }
                else if (_g == "hsbmetal")
                {
                    new Obj_Item_Stack_Sheet_Metal(Task13.User.loc)
                    {
                        amount = 50
                    };
                }
                else if (_g == "hsbplasteel")
                {
                    new Obj_Item_Stack_Sheet_Plasteel(Task13.User.loc)
                    {
                        amount = 50
                    };
                }
                else if (_g == "hsbglass")
                {
                    new Obj_Item_Stack_Sheet_Glass(Task13.User.loc)
                    {
                        amount = 50
                    };
                }
                else if (_g == "hsbwood")
                {
                    new Obj_Item_Stack_Sheet_Mineral_Wood(Task13.User.loc)
                    {
                        amount = 50
                    };
                }
                else if (_g == "hsbaaid")
                {
                    ID = new Obj_Item_Weapon_Card_Id_Gold(Task13.User.loc);
                    ID.registered_name = Task13.User.real_name;
                    ID.assignment      = "Sandbox";
                    ID.access          = GlobalFuncs.get_all_accesses();
                    ID.update_label();
                }
                else if (_g == "hsbrcd")
                {
                    if (!GlobalVars.hsboxspawn)
                    {
                        return(null);
                    }
                    new Obj_Item_Weapon_Rcd_Combat(Task13.User.loc);
                }
                else if (_g == "hsbairlock")
                {
                    new AirlockMaker(Task13.User.loc);
                }
                else if (_g == "hsbcloth")
                {
                    if (!GlobalVars.hsboxspawn)
                    {
                        return(null);
                    }

                    if (!Lang13.Bool(this.clothinfo))
                    {
                        this.clothinfo = new Txt("<b>Clothing</b> <a href='?").Ref(this).str(";hsb=hsbreag'>(Reagent Containers)</a> <a href='?").Ref(this).str(";hsb=hsbobj'>(Other Items)</a><hr><br>").ToString();
                        all_items      = Lang13.GetTypes(typeof(Obj_Item_Clothing)) - typeof(Obj_Item_Clothing);

                        foreach (dynamic _a in Lang13.Enumerate(GlobalVars.spawn_forbidden))
                        {
                            typekey = _a;

                            all_items -= Lang13.GetTypes(typekey);
                        }

                        foreach (dynamic _b in Lang13.Enumerate(GlobalFuncs.reverseRange(all_items)))
                        {
                            O = _b;

                            this.clothinfo += new Txt("<a href='?src=").Ref(this).str(";hsb=hsb_safespawn&path=").item(O).str("'>").item(O).str("</a><br>").ToString();
                        }
                    }
                    Interface13.Browse(Task13.User, this.clothinfo, "window=sandbox");
                }
                else if (_g == "hsbreag")
                {
                    if (!GlobalVars.hsboxspawn)
                    {
                        return(null);
                    }

                    if (!Lang13.Bool(this.reaginfo))
                    {
                        this.reaginfo = new Txt("<b>Reagent Containers</b> <a href='?").Ref(this).str(";hsb=hsbcloth'>(Clothing)</a> <a href='?").Ref(this).str(";hsb=hsbobj'>(Other Items)</a><hr><br>").ToString();
                        all_items2    = Lang13.GetTypes(typeof(Obj_Item_Weapon_ReagentContainers)) - typeof(Obj_Item_Weapon_ReagentContainers);

                        foreach (dynamic _c in Lang13.Enumerate(GlobalVars.spawn_forbidden))
                        {
                            typekey2 = _c;

                            all_items2 -= Lang13.GetTypes(typekey2);
                        }

                        foreach (dynamic _d in Lang13.Enumerate(GlobalFuncs.reverseRange(all_items2)))
                        {
                            O2 = _d;

                            this.reaginfo += new Txt("<a href='?src=").Ref(this).str(";hsb=hsb_safespawn&path=").item(O2).str("'>").item(O2).str("</a><br>").ToString();
                        }
                    }
                    Interface13.Browse(Task13.User, this.reaginfo, "window=sandbox");
                }
                else if (_g == "hsbobj")
                {
                    if (!GlobalVars.hsboxspawn)
                    {
                        return(null);
                    }

                    if (!Lang13.Bool(this.objinfo))
                    {
                        this.objinfo = new Txt("<b>Other Items</b> <a href='?").Ref(this).str(";hsb=hsbcloth'>(Clothing)</a> <a href='?").Ref(this).str(";hsb=hsbreag'>(Reagent Containers)</a><hr><br>").ToString();
                        all_items3   = Lang13.GetTypes(typeof(Obj_Item)) - typeof(Obj_Item) - Lang13.GetTypes(typeof(Obj_Item_Clothing)) - Lang13.GetTypes(typeof(Obj_Item_Weapon_ReagentContainers));

                        foreach (dynamic _e in Lang13.Enumerate(GlobalVars.spawn_forbidden))
                        {
                            typekey3 = _e;

                            all_items3 -= Lang13.GetTypes(typekey3);
                        }

                        foreach (dynamic _f in Lang13.Enumerate(GlobalFuncs.reverseRange(all_items3)))
                        {
                            O3 = _f;

                            this.objinfo += new Txt("<a href='?src=").Ref(this).str(";hsb=hsb_safespawn&path=").item(O3).str("'>").item(O3).str("</a><br>").ToString();
                        }
                    }
                    Interface13.Browse(Task13.User, this.objinfo, "window=sandbox");
                }
                else if (_g == "hsb_safespawn")
                {
                    if (!GlobalVars.hsboxspawn)
                    {
                        Interface13.Browse(Task13.User, null, "window=sandbox");
                        return(null);
                    }
                    typepath = Lang13.FindClass(href_list["path"]);

                    if (!(typepath != null))
                    {
                        Task13.User.WriteMsg("Bad path: \"" + href_list["path"] + "\"");
                        return(null);
                    }
                    Lang13.Call(typepath, Task13.User.loc);

                    if (GlobalVars.config.sandbox_autoclose)
                    {
                        Interface13.Browse(Task13.User, null, "window=sandbox");
                    }
                }
                else if (_g == "hsbspawn")
                {
                    typepath2 = Lang13.FindClass(href_list["path"]);

                    if (!(typepath2 != null))
                    {
                        Task13.User.WriteMsg("Bad path: \"" + href_list["path"] + "\"");
                        return(null);
                    }
                    Lang13.Call(typepath2, Task13.User.loc);

                    if (GlobalVars.config.sandbox_autoclose)
                    {
                        Interface13.Browse(Task13.User, null, "window=sandbox");
                    }
                }
            }
            return(null);
        }
Пример #2
0
        // Function from file: xmas.dm
        public override bool start(  )
        {
            dynamic M        = null;
            string  response = null;
            Obj_Item_Weapon_Card_Id_Gold santacard = null;
            Job_Captain           J               = null;
            dynamic               bag             = null;
            Obj_Item_Weapon_AGift gift            = null;
            Objective             santa_objective = null;
            Obj_Effect_ProcHolder_Spell_Targeted_AreaTeleport_Teleport telespell = null;


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

                Task13.Schedule(0, (Task13.Closure)(() => {
                    response = Interface13.Alert(M, "Santa is coming to town! Do you want to be santa?", "Ho ho ho!", "Yes", "No");

                    if (response == "Yes" && Lang13.Bool(M) && Lang13.Bool(M.client) && Convert.ToInt32(M.stat) == 2 && !(this.santa != null))
                    {
                        this.santa     = new Mob_Living_Carbon_Human(Rand13.PickFromTable(GlobalVars.blobstart));
                        this.santa.key = M.key;
                        GlobalFuncs.qdel(M);
                        this.santa.real_name          = "Santa Claus";
                        this.santa.name               = "Santa Claus";
                        this.santa.mind.name          = "Santa Claus";
                        this.santa.mind.assigned_role = "Santa";
                        this.santa.mind.special_role  = "Santa";
                        this.santa.hair_style         = "Long Hair";
                        this.santa.facial_hair_style  = "Full Beard";
                        this.santa.hair_color         = "FFF";
                        this.santa.facial_hair_color  = "FFF";
                        this.santa.equip_to_slot_or_del(new Obj_Item_Clothing_Under_Color_Red(), 14);
                        this.santa.equip_to_slot_or_del(new Obj_Item_Clothing_Suit_Space_Santa(), 13);
                        this.santa.equip_to_slot_or_del(new Obj_Item_Clothing_Head_Santa(), 11);
                        this.santa.equip_to_slot_or_del(new Obj_Item_Clothing_Mask_Breath(), 2);
                        this.santa.equip_to_slot_or_del(new Obj_Item_Clothing_Gloves_Color_Red(), 10);
                        this.santa.equip_to_slot_or_del(new Obj_Item_Clothing_Shoes_Sneakers_Red(), 12);
                        this.santa.equip_to_slot_or_del(new Obj_Item_Weapon_Tank_Internals_EmergencyOxygen_Double(), 6);
                        this.santa.equip_to_slot_or_del(new Obj_Item_Device_Radio_Headset_Heads_Captain(), 8);
                        this.santa.equip_to_slot_or_del(new Obj_Item_Weapon_Storage_Backpack_Santabag(), 1);
                        this.santa.equip_to_slot_or_del(new Obj_Item_Device_Flashlight(), 16);
                        santacard = new Obj_Item_Weapon_Card_Id_Gold(this.santa);
                        santacard.update_label("Santa Claus", "Santa");
                        J = new Job_Captain();
                        santacard.access = J.get_access();
                        this.santa.equip_to_slot_or_del(santacard, 7);
                        this.santa.update_icons();
                        bag  = this.santa.back;
                        gift = new Obj_Item_Weapon_AGift(this.santa);

                        while (((Obj_Item_Weapon_Storage)bag).can_be_inserted(gift, true))
                        {
                            ((Obj_Item_Weapon_Storage)bag).handle_item_insertion(gift, true);
                            gift = new Obj_Item_Weapon_AGift(this.santa);
                        }
                        santa_objective = new Objective();
                        santa_objective.explanation_text = "Bring joy and presents to the station!";
                        santa_objective.completed        = true;
                        santa_objective.owner            = this.santa.mind;
                        this.santa.mind.objectives.Add(santa_objective);
                        this.santa.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_AoeTurf_Conjure_Presents());
                        telespell             = new Obj_Effect_ProcHolder_Spell_Targeted_AreaTeleport_Teleport(this.santa);
                        telespell.clothes_req = 0;
                        this.santa.mind.AddSpell(telespell);
                        this.santa.WriteMsg("<span class='boldannounce'>You are Santa! Your objective is to bring joy to the people on this station. You can conjure more presents using a spell, and there are several presents in your bag.</span>");
                    }
                    return;
                }));
            }
            return(false);
        }