Esempio n. 1
0
        // Function from file: robot.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            dynamic R       = null;
            dynamic choice  = null;
            dynamic R2      = null;
            dynamic choice2 = null;
            dynamic R3      = null;


            if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc))))
            {
                return(null);
            }

            if (Lang13.Bool(href_list["temp"]))
            {
                this.temp = null;
            }
            else if (Lang13.Bool(href_list["killbot"]))
            {
                if (this.allowed(Task13.User))
                {
                    R = Lang13.FindObj(href_list["killbot"]);

                    if (this.can_control(Task13.User, R))
                    {
                        choice = Interface13.Input("Are you certain you wish to detonate " + R.name + "?", null, null, null, new ByTable(new object [] { "Confirm", "Abort" }), InputType.Any);

                        if (choice == "Confirm" && this.can_control(Task13.User, R) && !Lang13.Bool(base.Topic(href, href_list, (object)(hsrc))))
                        {
                            if (Lang13.Bool(R.mind) && Lang13.Bool(R.mind.special_role) && Lang13.Bool(R.emagged))
                            {
                                R.WriteMsg("Extreme danger.  Termination codes detected.  Scrambling security codes and automatic AI unlink triggered.");
                                ((Mob_Living_Silicon_Robot)R).ResetSecurityCodes();
                            }
                            else
                            {
                                GlobalFuncs.message_admins(new Txt("<span class='notice'>").item(GlobalFuncs.key_name_admin(Task13.User)).str(" (<A HREF='?_src_=holder;adminplayerobservefollow=").Ref(Task13.User).str("'>FLW</A>) detonated ").item(GlobalFuncs.key_name(R, R.client)).str("(<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=").item(R.x).str(";Y=").item(R.y).str(";Z=").item(R.z).str("'>JMP</a>)!</span>").ToString());
                                GlobalFuncs.log_game("&lt;span class='notice'>" + GlobalFuncs.key_name(Task13.User) + " detonated " + GlobalFuncs.key_name(R) + "!</span>");

                                if (Lang13.Bool(R.connected_ai))
                                {
                                    R.connected_ai.WriteMsg("<br><br><span class='alert'>ALERT - Cyborg detonation detected: " + R.name + "</span><br>");
                                }
                                ((Mob_Living_Silicon_Robot)R).self_destruct();
                            }
                        }
                    }
                }
                else
                {
                    Task13.User.WriteMsg("<span class='danger'>Access Denied.</span>");
                }
            }
            else if (Lang13.Bool(href_list["stopbot"]))
            {
                if (this.allowed(Task13.User))
                {
                    R2 = Lang13.FindObj(href_list["stopbot"]);

                    if (this.can_control(Task13.User, R2))
                    {
                        choice2 = Interface13.Input("Are you certain you wish to " + (Lang13.Bool(R2.canmove) ? "lock down" : "release") + " " + R2.name + "?", null, null, null, new ByTable(new object [] { "Confirm", "Abort" }), InputType.Any);

                        if (choice2 == "Confirm" && this.can_control(Task13.User, R2) && !Lang13.Bool(base.Topic(href, href_list, (object)(hsrc))))
                        {
                            GlobalFuncs.message_admins(new Txt("<span class='notice'>").item(GlobalFuncs.key_name_admin(Task13.User)).str(" (<A HREF='?_src_=holder;adminplayerobservefollow=").Ref(Task13.User).str("'>FLW</A>) ").item((Lang13.Bool(R2.canmove) ? "locked down" : "released")).str(" ").item(GlobalFuncs.key_name(R2, R2.client)).str("(<A HREF='?_src_=holder;adminplayerobservefollow=").Ref(R2).str("'>FLW</A>)!</span>").ToString());
                            GlobalFuncs.log_game("" + GlobalFuncs.key_name(Task13.User) + " " + (Lang13.Bool(R2.canmove) ? "locked down" : "released") + " " + GlobalFuncs.key_name(R2) + "!");
                            ((Mob_Living_Silicon_Robot)R2).SetLockdown(!(R2.lockcharge == true));
                            R2.WriteMsg("" + (!(R2.lockcharge == true) ? "<span class='notice'>Your lockdown has been lifted!" : "<span class='alert'>You have been locked down!") + "</span>");

                            if (Lang13.Bool(R2.connected_ai))
                            {
                                R2.connected_ai.WriteMsg(new Txt().item((!(R2.lockcharge == true) ? "<span class='notice'>NOTICE - Cyborg lockdown lifted" : "<span class='alert'>ALERT - Cyborg lockdown detected")).str(": <a href='?src=").Ref(R2.connected_ai).str(";track=").item(String13.HtmlEncode(R2.name)).str("'>").item(R2.name).str("</a></span><br>").ToString());
                            }
                        }
                    }
                }
                else
                {
                    Task13.User.WriteMsg("<span class='danger'>Access Denied.</span>");
                }
            }
            else if (Lang13.Bool(href_list["magbot"]))
            {
                if (Task13.User is Mob_Living_Silicon && GlobalFuncs.is_special_character(Task13.User) != 0 || Lang13.Bool(GlobalFuncs.IsAdminGhost(Task13.User)))
                {
                    R3 = Lang13.FindObj(href_list["magbot"]);

                    if (R3 is Mob_Living_Silicon_Robot && !Lang13.Bool(R3.emagged) && (R3.connected_ai == Task13.User || Lang13.Bool(GlobalFuncs.IsAdminGhost(Task13.User))) && !R3.scrambledcodes && this.can_control(Task13.User, R3))
                    {
                        GlobalFuncs.log_game("" + GlobalFuncs.key_name(Task13.User) + " emagged " + R3.name + " using robotic console!");
                        ((Mob_Living_Silicon_Robot)R3).SetEmagged(true);

                        if (Lang13.Bool(R3.mind.special_role))
                        {
                            R3.verbs += typeof(Mob_Living_Silicon_Robot).GetMethod("ResetSecurityCodes");
                        }
                    }
                }
            }
            this.updateUsrDialog();
            return(null);
        }
Esempio n. 2
0
        // Function from file: food_cart.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            Obj O = null;
            Obj_Item_Weapon_ReagentContainers_Food_Drinks_Drinkingglass DG = null;


            if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc))))
            {
                return(null);
            }

            if (Lang13.Bool(href_list["disposeI"]))
            {
                this.reagents.del_reagent(href_list["disposeI"]);
            }

            if (Lang13.Bool(href_list["dispense"]))
            {
                if (Convert.ToDouble(this.stored_food[href_list["dispense"]]--) <= 0)
                {
                    this.stored_food[href_list["dispense"]] = 0;
                }
                else
                {
                    foreach (dynamic _a in Lang13.Enumerate(this.contents, typeof(Obj)))
                    {
                        O = _a;


                        if (GlobalFuncs.sanitize(O.name) == href_list["dispense"])
                        {
                            O.loc = this.loc;
                            break;
                        }
                    }
                }
            }

            if (Lang13.Bool(href_list["portion"]))
            {
                this.portion = Num13.MaxInt(0, Num13.MinInt(Convert.ToInt32(Interface13.Input("How much drink do you want to dispense per glass?", null, null, null, null, InputType.Num)), 50));
            }

            if (Lang13.Bool(href_list["pour"]) || Lang13.Bool(href_list["m_pour"]))
            {
                if (this.glasses-- <= 0)
                {
                    Task13.User.WriteMsg("<span class='warning'>There are no glasses left!</span>");
                    this.glasses = 0;
                }
                else
                {
                    DG = new Obj_Item_Weapon_ReagentContainers_Food_Drinks_Drinkingglass(this.loc);

                    if (Lang13.Bool(href_list["pour"]))
                    {
                        this.reagents.trans_id_to(DG, href_list["pour"], this.portion);
                    }

                    if (Lang13.Bool(href_list["m_pour"]))
                    {
                        this.mixer.reagents.trans_id_to(DG, href_list["m_pour"], this.portion);
                    }
                }
            }

            if (Lang13.Bool(href_list["mix"]))
            {
                if (this.reagents.trans_id_to(this.mixer, href_list["mix"], this.portion) == 0)
                {
                    Task13.User.WriteMsg("<span class='warning'>The " + this.mixer + " is full!</span>");
                }
            }

            if (Lang13.Bool(href_list["transfer"]))
            {
                if (this.mixer.reagents.trans_id_to(this, href_list["transfer"], this.portion) == 0)
                {
                    Task13.User.WriteMsg("<span class='warning'>The " + this + " is full!</span>");
                }
            }
            this.updateDialog();

            if (Lang13.Bool(href_list["close"]))
            {
                Task13.User.unset_machine();
                Interface13.Browse(Task13.User, null, "window=foodcart");
            }
            return(null);
        }
Esempio n. 3
0
 // Function from file: browser.dm
 public virtual dynamic close(  )
 {
     Interface13.Browse(this.user, null, "window=" + this.window_id);
     return(null);
 }
Esempio n. 4
0
        // Function from file: juicer.dm
        public override dynamic interact(dynamic user = null, bool?flag1 = null)
        {
            bool     is_chamber_empty   = false;
            bool     is_beaker_ready    = false;
            string   processing_chamber = null;
            string   beaker_contents    = null;
            dynamic  i   = null;
            Obj_Item O   = null;
            string   dat = null;

            is_chamber_empty   = false;
            is_beaker_ready    = false;
            processing_chamber = "";
            beaker_contents    = "";

            foreach (dynamic _b in Lang13.Enumerate(GlobalVars.allowed_items))
            {
                i = _b;


                foreach (dynamic _a in Lang13.Enumerate(this.contents, typeof(Obj_Item)))
                {
                    O = _a;


                    if (!Lang13.Bool(i.IsInstanceOfType(O)))
                    {
                        continue;
                    }
                    processing_chamber += "some <B>" + O + "</B><BR>";
                    break;
                }
            }

            if (!Lang13.Bool(processing_chamber))
            {
                is_chamber_empty   = true;
                processing_chamber = "Nothing.";
            }

            if (!Lang13.Bool(this.beaker))
            {
                beaker_contents = new Txt().The(this).item().str(" has no beaker attached.").ToString();
            }
            else if (!Lang13.Bool(this.beaker.reagents.total_volume))
            {
                beaker_contents = new Txt().The(this).item().str("  has attached an empty beaker.").ToString();
                is_beaker_ready = true;
            }
            else if ((this.beaker.reagents.total_volume ?? 0) < Convert.ToDouble(this.beaker.reagents.maximum_volume))
            {
                beaker_contents = new Txt().The(this).item().str("  has attached a beaker with something.").ToString();
                is_beaker_ready = true;
            }
            else
            {
                beaker_contents = new Txt().The(this).item().str("  has attached a beaker and the beaker is full!").ToString();
            }
            dat = "\n<b>Processing chamber contains:</b><br>\n" + processing_chamber + "<br>\n" + beaker_contents + "<hr>\n";

            if (is_beaker_ready && !is_chamber_empty && !((this.stat & 3) != 0))
            {
                dat += new Txt("<A href='?src=").Ref(this).str(";action=juice'>Turn on!<BR>").ToString();
            }

            if (Lang13.Bool(this.beaker))
            {
                dat += new Txt("<A href='?src=").Ref(this).str(";action=detach'>Detach a beaker!<BR>").ToString();
            }
            Interface13.Browse(user, "<HEAD><TITLE>Juicer</TITLE></HEAD><TT>" + dat + "</TT>", "window=juicer");
            GlobalFuncs.onclose(user, "juicer");
            return(null);
        }
Esempio n. 5
0
        // Function from file: chem_master.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            string name = null;
            Obj_Item_Weapon_ReagentContainers P = null;
            dynamic R         = null;
            string  dat       = null;
            dynamic T         = null;
            Browser popup     = null;
            string  id        = null;
            double? amount    = null;
            dynamic id2       = null;
            dynamic amt_temp  = null;
            string  id3       = null;
            double? amount2   = null;
            dynamic id4       = null;
            dynamic amt_temp2 = null;
            int?    amount3   = null;
            int     vol_each  = 0;
            string  name2     = null;
            Obj_Item_Weapon_ReagentContainers_Pill P2 = null;
            int?   i     = null;
            string name3 = null;
            Obj_Item_Weapon_ReagentContainers_Food_Condiment_Pack P3 = null;
            int?   amount4   = null;
            int    vol_each2 = 0;
            string name4     = null;
            Obj_Item_Weapon_ReagentContainers_Pill_Patch P4 = null;
            int?i2 = null;


            if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc))))
            {
                return(null);
            }
            Task13.User.set_machine(this);

            if (Lang13.Bool(href_list["ejectp"]))
            {
                if (Lang13.Bool(this.bottle))
                {
                    this.bottle.loc = this.loc;
                    this.bottle     = null;
                }
            }
            else if (Lang13.Bool(href_list["close"]))
            {
                Interface13.Browse(Task13.User, null, "window=chem_master");
                Task13.User.unset_machine();
                return(null);
            }
            else if (Lang13.Bool(href_list["toggle"]))
            {
                this.mode = !this.mode;
            }
            else if (Lang13.Bool(href_list["createbottle"]))
            {
                name = GlobalFuncs.stripped_input(Task13.User, "Name:", "Name your bottle!", (Lang13.Bool(this.reagents.total_volume) ? this.reagents.get_master_reagent_name() : " "), 26);

                if (!Lang13.Bool(name))
                {
                    return(null);
                }

                if (this.condi)
                {
                    P = new Obj_Item_Weapon_ReagentContainers_Food_Condiment(this.loc);
                }
                else
                {
                    P         = new Obj_Item_Weapon_ReagentContainers_Glass_Bottle(this.loc);
                    P.pixel_x = Rand13.Int(-7, 7);
                    P.pixel_y = Rand13.Int(-7, 7);
                }
                P.name = GlobalFuncs.trim("" + name + " bottle");
                this.reagents.trans_to(P, P.volume);
            }

            if (Lang13.Bool(this.beaker))
            {
                if (Lang13.Bool(href_list["analyze"]))
                {
                    if (Lang13.Bool(Lang13.FindObj(href_list["reagent"])))
                    {
                        R = Lang13.FindObj(href_list["reagent"]);

                        if (Lang13.Bool(R))
                        {
                            dat  = "";
                            dat += "<H1>" + (this.condi ? "Condiment" : "Chemical") + " information:</H1>";
                            dat += "<B>Name:</B> " + Lang13.Initial(R, "name") + "<BR><BR>";
                            dat += "<B>State:</B> ";

                            if (Lang13.Initial(R, "reagent_state") == 1)
                            {
                                dat += "Solid";
                            }
                            else if (Lang13.Initial(R, "reagent_state") == 2)
                            {
                                dat += "Liquid";
                            }
                            else if (Lang13.Initial(R, "reagent_state") == 3)
                            {
                                dat += "Gas";
                            }
                            else
                            {
                                dat += "Unknown";
                            }
                            dat  += "<BR>";
                            dat  += "<B>Color:</B> <span style='color:" + Lang13.Initial(R, "color") + ";background-color:" + Lang13.Initial(R, "color") + ";font:Lucida Console'>" + Lang13.Initial(R, "color") + "</span><BR><BR>";
                            dat  += "<B>Description:</B> " + Lang13.Initial(R, "description") + "<BR><BR>";
                            T     = Lang13.Initial(R, "metabolization_rate") * 20;
                            dat  += "<B>Metabolization Rate:</B> " + T + "u/minute<BR>";
                            dat  += "<B>Overdose Threshold:</B> " + (Lang13.Bool(Lang13.Initial(R, "overdose_threshold")) ? "" + Lang13.Initial(R, "overdose_threshold") + "u" : "none") + "<BR>";
                            dat  += "<B>Addiction Threshold:</B> " + (Lang13.Bool(Lang13.Initial(R, "addiction_threshold")) ? "" + Lang13.Initial(R, "addiction_threshold") + "u" : "none") + "<BR><BR>";
                            dat  += new Txt("<BR><A href='?src=").Ref(this).str(";main=1'>Back</A>").ToString();
                            popup = new Browser(Task13.User, "chem_master", this.name);
                            popup.set_content(dat);
                            popup.set_title_image(Task13.User.browse_rsc_icon(this.icon, this.icon_state));
                            popup.open(true);
                            return(null);
                        }
                    }
                }
                else if (Lang13.Bool(href_list["main"]))
                {
                    this.attack_hand(Task13.User);
                    return(null);
                }
                else if (Lang13.Bool(href_list["add"]))
                {
                    if (Lang13.Bool(href_list["amount"]))
                    {
                        id     = href_list["add"];
                        amount = String13.ParseNumber(href_list["amount"]);

                        if ((amount ?? 0) > 0)
                        {
                            ((Reagents)this.beaker.reagents).trans_id_to(this, id, amount);
                        }
                    }
                }
                else if (Lang13.Bool(href_list["addcustom"]))
                {
                    id2      = href_list["addcustom"];
                    amt_temp = this.isgoodnumber(Interface13.Input(Task13.User, "Select the amount to transfer.", "Transfer how much?", this.useramount, null, InputType.Num | InputType.Null));

                    if (!Lang13.Bool(amt_temp))
                    {
                        return(null);
                    }
                    this.useramount = amt_temp;
                    this.Topic(null, new ByTable().Set("amount", "" + this.useramount).Set("add", "" + id2));
                }
                else if (Lang13.Bool(href_list["remove"]))
                {
                    if (Lang13.Bool(href_list["amount"]))
                    {
                        id3     = href_list["remove"];
                        amount2 = String13.ParseNumber(href_list["amount"]);

                        if ((amount2 ?? 0) > 0)
                        {
                            if (this.mode)
                            {
                                this.reagents.trans_id_to(this.beaker, id3, amount2);
                            }
                            else
                            {
                                this.reagents.remove_reagent(id3, amount2);
                            }
                        }
                    }
                }
                else if (Lang13.Bool(href_list["removecustom"]))
                {
                    id4       = href_list["removecustom"];
                    amt_temp2 = this.isgoodnumber(Interface13.Input(Task13.User, "Select the amount to transfer.", "Transfer how much?", this.useramount, null, InputType.Num | InputType.Null));

                    if (!Lang13.Bool(amt_temp2))
                    {
                        return(null);
                    }
                    this.useramount = amt_temp2;
                    this.Topic(null, new ByTable().Set("amount", "" + this.useramount).Set("remove", "" + id4));
                }
                else if (Lang13.Bool(href_list["eject"]))
                {
                    if (Lang13.Bool(this.beaker))
                    {
                        this.beaker.loc = this.loc;
                        this.beaker     = null;
                        this.reagents.clear_reagents();
                        this.icon_state = "mixer0";
                    }
                }
                else if (Lang13.Bool(href_list["createpill"]))
                {
                    if (this.reagents.total_volume == 0)
                    {
                        return(null);
                    }

                    if (!this.condi)
                    {
                        amount3  = 1;
                        vol_each = Num13.MinInt(((int)(this.reagents.total_volume ?? 0)), 50);

                        if (Lang13.Bool(String13.ParseNumber(href_list["many"])))
                        {
                            amount3 = Num13.MinInt(Num13.MaxInt(Num13.Floor(Convert.ToDouble(Interface13.Input(Task13.User, "Max 10. Buffer content will be split evenly.", "How many pills?", amount3, null, InputType.Num | InputType.Null))), 0), 10);

                            if (!Lang13.Bool(amount3))
                            {
                                return(null);
                            }
                            vol_each = Num13.MinInt(((int)((this.reagents.total_volume ?? 0) / (amount3 ?? 0))), 50);
                        }
                        name2 = GlobalFuncs.stripped_input(Task13.User, "Name:", "Name your pill!", "" + this.reagents.get_master_reagent_name() + " (" + vol_each + "u)", 26);

                        if (!Lang13.Bool(name2) || !Lang13.Bool(this.reagents.total_volume))
                        {
                            return(null);
                        }
                        i = null;
                        i = 0;

                        while ((i ?? 0) < (amount3 ?? 0))
                        {
                            if (Lang13.Bool(this.bottle) && this.bottle.contents.len < (this.bottle.storage_slots ?? 0))
                            {
                                P2 = new Obj_Item_Weapon_ReagentContainers_Pill(this.bottle);
                            }
                            else
                            {
                                P2 = new Obj_Item_Weapon_ReagentContainers_Pill(this.loc);
                            }
                            P2.name    = GlobalFuncs.trim("" + name2 + " pill");
                            P2.pixel_x = Rand13.Int(-7, 7);
                            P2.pixel_y = Rand13.Int(-7, 7);
                            this.reagents.trans_to(P2, vol_each);
                            i++;
                        }
                    }
                    else
                    {
                        name3 = GlobalFuncs.stripped_input(Task13.User, "Name:", "Name your pack!", this.reagents.get_master_reagent_name(), 26);

                        if (!Lang13.Bool(name3) || !Lang13.Bool(this.reagents.total_volume))
                        {
                            return(null);
                        }
                        P3 = new Obj_Item_Weapon_ReagentContainers_Food_Condiment_Pack(this.loc);
                        P3.originalname = name3;
                        P3.name         = GlobalFuncs.trim("" + name3 + " pack");
                        P3.desc         = "A small condiment pack. The label says it contains " + name3 + ".";
                        this.reagents.trans_to(P3, 10);
                    }
                }
                else if (Lang13.Bool(href_list["createpatch"]))
                {
                    if (this.reagents.total_volume == 0)
                    {
                        return(null);
                    }
                    amount4   = 1;
                    vol_each2 = Num13.MinInt(((int)(this.reagents.total_volume ?? 0)), 50);

                    if (Lang13.Bool(String13.ParseNumber(href_list["many"])))
                    {
                        amount4 = Num13.MinInt(Num13.MaxInt(Num13.Floor(Convert.ToDouble(Interface13.Input(Task13.User, "Max 10. Buffer content will be split evenly.", "How many patches?", amount4, null, InputType.Num | InputType.Null))), 0), 10);

                        if (!Lang13.Bool(amount4))
                        {
                            return(null);
                        }
                        vol_each2 = Num13.MinInt(((int)((this.reagents.total_volume ?? 0) / (amount4 ?? 0))), 50);
                    }
                    name4 = GlobalFuncs.stripped_input(Task13.User, "Name:", "Name your patch!", "" + this.reagents.get_master_reagent_name() + " (" + vol_each2 + "u)", 26);

                    if (!Lang13.Bool(name4) || !Lang13.Bool(this.reagents.total_volume))
                    {
                        return(null);
                    }
                    P4 = null;
                    i2 = null;
                    i2 = 0;

                    while ((i2 ?? 0) < (amount4 ?? 0))
                    {
                        P4         = new Obj_Item_Weapon_ReagentContainers_Pill_Patch(this.loc);
                        P4.name    = GlobalFuncs.trim("" + name4 + " patch");
                        P4.pixel_x = Rand13.Int(-7, 7);
                        P4.pixel_y = Rand13.Int(-7, 7);
                        this.reagents.trans_to(P4, vol_each2);
                        i2++;
                    }
                }
            }
            this.updateUsrDialog();
            return(null);
        }
Esempio n. 6
0
        public bool toggle(  )
        {
            Mob        M          = null;
            ByTable    modes      = null;
            dynamic    switchMode = null;
            Ent_Static H          = null;

            M = Task13.User;

            if (M is Mob_Dead)
            {
                return(false);
            }

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

            if (this.has_sensor >= 2)
            {
                Task13.User.WriteMsg("The controls are locked.");
                return(false);
            }

            if (this.has_sensor <= 0)
            {
                Task13.User.WriteMsg("This suit does not have any sensors.");
                return(false);
            }
            modes      = new ByTable(new object [] { "Off", "Binary vitals", "Exact vitals", "Tracking beacon" });
            switchMode = Interface13.Input("Select a sensor mode:", "Suit Sensor Mode", modes[this.sensor_mode + 1], null, modes, InputType.Any);

            if (Map13.GetDistance(Task13.User, this) > 1)
            {
                Task13.User.WriteMsg("<span class='warning'>You have moved too far away!</span>");
                return(false);
            }
            this.sensor_mode = modes.Find(switchMode) - 1;

            if (this.loc == Task13.User)
            {
                switch ((int)(this.sensor_mode))
                {
                case 0:
                    Task13.User.WriteMsg("<span class='notice'>You disable your suit's remote sensing equipment.</span>");
                    break;

                case 1:
                    Task13.User.WriteMsg("<span class='notice'>Your suit will now only report whether you are alive or dead.</span>");
                    break;

                case 2:
                    Task13.User.WriteMsg("<span class='notice'>Your suit will now only report your exact vital lifesigns.</span>");
                    break;

                case 3:
                    Task13.User.WriteMsg("<span class='notice'>Your suit will now report your exact vital lifesigns as well as your coordinate position.</span>");
                    break;
                }
            }

            if (this.loc is Mob_Living_Carbon_Human)
            {
                H = this.loc;

                if (((dynamic)H).w_uniform == this)
                {
                    ((dynamic)H).update_suit_sensors();
                }
            }
            Lang13.SuperCall();
            return(false);
        }
Esempio n. 7
0
        // Function from file: satchel_ore_boxdm.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            int amt_gold          = 0;
            int amt_silver        = 0;
            int amt_diamond       = 0;
            int amt_glass         = 0;
            int amt_iron          = 0;
            int amt_plasma        = 0;
            int amt_uranium       = 0;
            int amt_clown         = 0;
            int amt_bluespace     = 0;
            Obj_Item_Weapon_Ore C = null;
            string dat            = null;

            amt_gold      = 0;
            amt_silver    = 0;
            amt_diamond   = 0;
            amt_glass     = 0;
            amt_iron      = 0;
            amt_plasma    = 0;
            amt_uranium   = 0;
            amt_clown     = 0;
            amt_bluespace = 0;

            foreach (dynamic _a in Lang13.Enumerate(this.contents, typeof(Obj_Item_Weapon_Ore)))
            {
                C = _a;


                if (C is Obj_Item_Weapon_Ore_Diamond)
                {
                    amt_diamond++;
                }

                if (C is Obj_Item_Weapon_Ore_Glass)
                {
                    amt_glass++;
                }

                if (C is Obj_Item_Weapon_Ore_Plasma)
                {
                    amt_plasma++;
                }

                if (C is Obj_Item_Weapon_Ore_Iron)
                {
                    amt_iron++;
                }

                if (C is Obj_Item_Weapon_Ore_Silver)
                {
                    amt_silver++;
                }

                if (C is Obj_Item_Weapon_Ore_Gold)
                {
                    amt_gold++;
                }

                if (C is Obj_Item_Weapon_Ore_Uranium)
                {
                    amt_uranium++;
                }

                if (C is Obj_Item_Weapon_Ore_Bananium)
                {
                    amt_clown++;
                }

                if (C is Obj_Item_Weapon_Ore_BluespaceCrystal)
                {
                    amt_bluespace++;
                }
            }
            dat = "<b>The contents of the ore box reveal...</b><br>";

            if (amt_gold != 0)
            {
                dat += "Gold ore: " + amt_gold + "<br>";
            }

            if (amt_silver != 0)
            {
                dat += "Silver ore: " + amt_silver + "<br>";
            }

            if (amt_iron != 0)
            {
                dat += "Metal ore: " + amt_iron + "<br>";
            }

            if (amt_glass != 0)
            {
                dat += "Sand: " + amt_glass + "<br>";
            }

            if (amt_diamond != 0)
            {
                dat += "Diamond ore: " + amt_diamond + "<br>";
            }

            if (amt_plasma != 0)
            {
                dat += "Plasma ore: " + amt_plasma + "<br>";
            }

            if (amt_uranium != 0)
            {
                dat += "Uranium ore: " + amt_uranium + "<br>";
            }

            if (amt_clown != 0)
            {
                dat += "Bananium ore: " + amt_clown + "<br>";
            }

            if (amt_bluespace != 0)
            {
                dat += "Bluespace crystals: " + amt_bluespace + "<br>";
            }
            dat += new Txt("<br><br><A href='?src=").Ref(this).str(";removeall=1'>Empty box</A>").ToString();
            Interface13.Browse(a, "" + dat, "window=orebox");
            return(null);
        }
Esempio n. 8
0
        // Range: -1 Access: 0 Flags: ( 0, 4, 255 )
        public static dynamic Reboot(dynamic reason = null, string feedback_c = null, string feedback_r = null, int?time = null)
        {
            double? delay = null;
            dynamic C     = null;

            if (reason == 1)
            {
                if (Task13.user != null)
                {
                    GlobalFuncs.log_admin("" + GlobalFuncs.key_name(Task13.user) + " Has requested an immediate world restart via client side debugging tools");
                    GlobalFuncs.message_admins("" + GlobalFuncs.key_name_admin(Task13.user) + " Has requested an immediate world restart via client side debugging tools");
                }
                Game13.write("<span class='boldannounce'>Rebooting World immediately due to host request</span>");
                return(Game13._internal_Reboot(1, feedback_c, feedback_r, time));
            }
            if (Lang13.Bool(time))
            {
                delay = time;
            }
            else
            {
                delay = GlobalVars.config.round_end_countdown * 10;
            }
            if (GlobalVars.ticker.delay_end)
            {
                Game13.write("<span class='boldannounce'>An admin has delayed the round end.</span>");
                return(null);
            }
            Game13.write("<span class='boldannounce'>Rebooting World in " + (delay ?? 0) / 10 + " " + ((delay ?? 0) > 10 ? "seconds" : "second") + ". " + reason + "</span>");
            Task13.sleep(((int)(delay)));
            if (GlobalVars.blackbox != null)
            {
                GlobalVars.blackbox.save_all_data_to_sql();
            }
            if (GlobalVars.ticker.delay_end)
            {
                Game13.write("<span class='boldannounce'>Reboot was cancelled by an admin.</span>");
                return(null);
            }
            GlobalFuncs.feedback_set_details("" + feedback_c, "" + feedback_r);
            GlobalFuncs.log_game("<span class='boldannounce'>Rebooting World. " + reason + "</span>");
            GlobalFuncs.kick_clients_in_lobby("<span class='boldannounce'>The round came to an end with you in the lobby.</span>", 1);
            Task13.schedule(0, (Task13.Closure)(() => {
                if (GlobalVars.ticker != null && Lang13.Bool(GlobalVars.ticker.round_end_sound))
                {
                    Game13.write(new Sound(GlobalVars.ticker.round_end_sound));
                }
                else
                {
                    Game13.write(new Sound(Rand13.pick(new object [] { "sound/AI/newroundsexy.ogg", "sound/misc/apcdestroyed.ogg", "sound/misc/bangindonk.ogg", "sound/misc/leavingtg.ogg" })));
                }
                return;
            }));
            C = null;
            foreach (dynamic _a in GlobalVars.clients)
            {
                C = _a;
                if (!Lang13.Bool(((dynamic)typeof(Client)).IsInstanceOfType(C)))
                {
                    continue;
                }
                if (Lang13.Bool(GlobalVars.config.server))
                {
                    Interface13.link(C, "byond://" + GlobalVars.config.server);
                }
            }
            ;
            Game13._internal_Reboot(0, feedback_c, feedback_r, time);
            return(null);
        }
Esempio n. 9
0
        // Function from file: pai.dm
        public void findPAI(Obj_Item_Device_Paicard p = null, Mob user = null)
        {
            ByTable           available = null;
            PaiCandidate      c         = null;
            bool              found     = false;
            Mob_Dead_Observer o         = null;
            string            dat       = null;
            PaiCandidate      c2        = null;

            this.requestRecruits();
            available = new ByTable();

            foreach (dynamic _b in Lang13.Enumerate(GlobalVars.SSpai.candidates, typeof(PaiCandidate)))
            {
                c = _b;


                if (c.ready)
                {
                    found = false;

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


                        if (o.key == c.key)
                        {
                            found = true;
                        }
                    }

                    if (found)
                    {
                        available.Add(c);
                    }
                }
            }
            dat  = "";
            dat += @"
			<style type=""text/css"">

			p.top {
				background-color: #AAAAAA; color: black;
			}

			tr.d0 td {
				background-color: #CC9999; color: black;
			}
			tr.d1 td {
				background-color: #9999CC; color: black;
			}
			tr.d2 td {
				background-color: #99CC99; color: black;
			}
			</style>
			"            ;
            dat += "<p class=\"top\">Requesting AI personalities from central database... If there are no entries, or if a suitable entry is not listed, check again later as more personalities may be added.</p>";
            dat += "<table>";

            foreach (dynamic _c in Lang13.Enumerate(available, typeof(PaiCandidate)))
            {
                c2 = _c;

                dat += "<tr class=\"d0\"><td>Name:</td><td>" + c2.name + "</td></tr>";
                dat += "<tr class=\"d1\"><td>Description:</td><td>" + c2.description + "</td></tr>";
                dat += "<tr class=\"d0\"><td>Preferred Role:</td><td>" + c2.role + "</td></tr>";
                dat += "<tr class=\"d1\"><td>OOC Comments:</td><td>" + c2.comments + "</td></tr>";
                dat += new Txt("<tr class=\"d2\"><td><a href='byond://?src=").Ref(this).str(";download=1;candidate=").Ref(c2).str(";device=").Ref(p).str("'>[Download ").item(c2.name).str("]</a></td><td></td></tr>").ToString();
            }
            dat += "</table>";
            Interface13.Browse(user, dat, "window=findPai");
            return;
        }
        // Function from file: pandemic.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            Obj_Item_Weapon_ReagentContainers_Glass_Bottle B = null;
            dynamic   path         = null;
            dynamic   vaccine_type = null;
            string    vaccine_name = null;
            dynamic   D            = null;
            dynamic   D2           = null;
            dynamic   type         = null;
            dynamic   D3           = null;
            Base_Data A            = null;
            string    name         = null;
            Obj_Item_Weapon_ReagentContainers_Glass_Bottle B2 = null;
            ByTable         data     = null;
            string          new_name = null;
            dynamic         id       = null;
            Disease_Advance A2       = null;
            Disease_Advance AD       = null;


            if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc))))
            {
                return(null);
            }
            Task13.User.set_machine(this);

            if (!Lang13.Bool(this.beaker))
            {
                return(null);
            }

            if (Lang13.Bool(href_list["create_vaccine"]))
            {
                if (!(this.wait == true))
                {
                    B = new Obj_Item_Weapon_ReagentContainers_Glass_Bottle(this.loc);

                    if (B != null)
                    {
                        B.pixel_x    = Rand13.Int(-3, 3);
                        B.pixel_y    = Rand13.Int(-3, 3);
                        path         = this.GetResistancesByIndex(String13.ParseNumber(href_list["create_vaccine"]));
                        vaccine_type = path;
                        vaccine_name = "Unknown";

                        if (!(vaccine_type is Type))
                        {
                            if (Lang13.Bool(GlobalVars.archive_diseases[path]))
                            {
                                D = GlobalVars.archive_diseases[path];

                                if (Lang13.Bool(D))
                                {
                                    vaccine_name = D.name;
                                    vaccine_type = path;
                                }
                            }
                        }
                        else if (Lang13.Bool(vaccine_type))
                        {
                            D2 = Lang13.Call(vaccine_type, 0, null);

                            if (Lang13.Bool(D2))
                            {
                                vaccine_name = D2.name;
                            }
                        }

                        if (Lang13.Bool(vaccine_type))
                        {
                            B.name = "" + vaccine_name + " vaccine bottle";
                            B.reagents.add_reagent("vaccine", 15, new ByTable(new object [] { vaccine_type }));
                            this.replicator_cooldown(200);
                        }
                    }
                }
                else
                {
                    this.temp_html = "The replicator is not ready yet.";
                }
                this.updateUsrDialog();
                return(null);
            }
            else if (Lang13.Bool(href_list["create_virus_culture"]))
            {
                if (!(this.wait == true))
                {
                    type = this.GetVirusTypeByIndex(String13.ParseNumber(href_list["create_virus_culture"]));
                    D3   = null;

                    if (!(type is Type))
                    {
                        D3 = this.GetVirusByIndex(String13.ParseNumber(href_list["create_virus_culture"]));
                        A  = GlobalVars.archive_diseases[((Disease)D3).GetDiseaseID()];

                        if (A != null)
                        {
                            D3 = Lang13.Call(A.type, 0, A);
                        }
                    }
                    else if (Lang13.Bool(type))
                    {
                        if (Lang13.Bool(GlobalVars.diseases.Contains(type)))
                        {
                            D3 = Lang13.Call(type, 0, null);
                        }
                    }

                    if (!Lang13.Bool(D3))
                    {
                        return(null);
                    }
                    name = GlobalFuncs.stripped_input(Task13.User, "Name:", "Name the culture", D3.name, 26);

                    if (name == null || this.wait == true)
                    {
                        return(null);
                    }
                    B2            = new Obj_Item_Weapon_ReagentContainers_Glass_Bottle(this.loc);
                    B2.icon_state = "bottle3";
                    B2.pixel_x    = Rand13.Int(-3, 3);
                    B2.pixel_y    = Rand13.Int(-3, 3);
                    this.replicator_cooldown(50);
                    data    = new ByTable().Set("viruses", new ByTable(new object [] { D3 }));
                    B2.name = "" + name + " culture bottle";
                    B2.desc = "A small bottle. Contains " + D3.agent + " culture in synthblood medium.";
                    B2.reagents.add_reagent("blood", 20, data);
                    this.updateUsrDialog();
                }
                else
                {
                    this.temp_html = "The replicator is not ready yet.";
                }
                this.updateUsrDialog();
                return(null);
            }
            else if (Lang13.Bool(href_list["empty_beaker"]))
            {
                ((Reagents)this.beaker.reagents).clear_reagents();
                this.updateUsrDialog();
                return(null);
            }
            else if (Lang13.Bool(href_list["eject"]))
            {
                this.beaker.loc = this.loc;
                this.beaker     = null;
                this.icon_state = "mixer0";
                this.updateUsrDialog();
                return(null);
            }
            else if (Lang13.Bool(href_list["clear"]))
            {
                this.temp_html = "";
                this.updateUsrDialog();
                return(null);
            }
            else if (Lang13.Bool(href_list["name_disease"]))
            {
                new_name = GlobalFuncs.stripped_input(Task13.User, "Name the Disease", "New Name", "", 26);

                if (!Lang13.Bool(new_name))
                {
                    return(null);
                }

                if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc))))
                {
                    return(null);
                }
                id = this.GetVirusTypeByIndex(String13.ParseNumber(href_list["name_disease"]));

                if (Lang13.Bool(GlobalVars.archive_diseases[id]))
                {
                    A2 = GlobalVars.archive_diseases[id];
                    A2.AssignName(new_name);

                    foreach (dynamic _a in Lang13.Enumerate(GlobalVars.SSdisease.processing, typeof(Disease_Advance)))
                    {
                        AD = _a;

                        AD.Refresh();
                    }
                }
                this.updateUsrDialog();
            }
            else
            {
                Interface13.Browse(Task13.User, null, "window=pandemic");
                this.updateUsrDialog();
                return(null);
            }
            this.add_fingerprint(Task13.User);
            return(null);
        }
        // Function from file: pandemic.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            string        dat              = null;
            Reagents      R                = null;
            Reagent_Blood Blood            = null;
            Reagent_Blood B                = null;
            ByTable       vir              = null;
            int           i                = 0;
            Disease       D                = null;
            Disease       A                = null;
            Disease       A2               = null;
            ByTable       english_symptoms = null;
            Symptom       S                = null;
            ByTable       res              = null;
            int           i2               = 0;
            dynamic       type             = null;
            string        disease_name     = null;
            dynamic       A3               = null;
            dynamic       D2               = null;


            if (Lang13.Bool(base.attack_hand((object)(a), b, c)))
            {
                return(null);
            }
            ((Mob)a).set_machine(this);
            dat = "";

            if (Lang13.Bool(this.temp_html))
            {
                dat = new Txt().item(this.temp_html).str("<BR><BR><A href='?src=").Ref(this).str(";clear=1'>Main Menu</A>").ToString();
            }
            else if (!Lang13.Bool(this.beaker))
            {
                dat += "Please insert beaker.<BR>";
                dat += new Txt("<A href='?src=").Ref(a).str(";mach_close=pandemic'>Close</A>").ToString();
            }
            else
            {
                R     = this.beaker.reagents;
                Blood = null;

                foreach (dynamic _a in Lang13.Enumerate(R.reagent_list, typeof(Reagent_Blood)))
                {
                    B = _a;


                    if (B != null)
                    {
                        Blood = B;
                        break;
                    }
                }

                if (!Lang13.Bool(R.total_volume) || !(R.reagent_list.len != 0))
                {
                    dat += "The beaker is empty<BR>";
                }
                else if (!(Blood != null))
                {
                    dat += "No blood sample found in beaker.";
                }
                else if (!Lang13.Bool(Blood.data))
                {
                    dat += "No blood data found in beaker.";
                }
                else
                {
                    dat += "<h3>Blood sample data:</h3>";
                    dat += "<b>Blood DNA:</b> " + (Lang13.Bool(Blood.data["blood_DNA"]) || Lang13.Bool("none")) + "<BR>";
                    dat += "<b>Blood Type:</b> " + (Lang13.Bool(Blood.data["blood_type"]) || Lang13.Bool("none")) + "<BR>";

                    if (Lang13.Bool(Blood.data["viruses"]))
                    {
                        vir = Blood.data["viruses"];

                        if (vir.len != 0)
                        {
                            i = 0;

                            foreach (dynamic _c in Lang13.Enumerate(Blood.data["viruses"], typeof(Disease)))
                            {
                                D = _c;

                                i++;

                                if (!((D.visibility_flags & 2) != 0))
                                {
                                    if (D is Disease_Advance)
                                    {
                                        A = D;
                                        D = GlobalVars.archive_diseases[A.GetDiseaseID()];

                                        if (D != null && D.name == "Unknown")
                                        {
                                            dat += new Txt("<b><a href='?src=").Ref(this).str(";name_disease=").item(i).str("'>Name Disease</a></b><BR>").ToString();
                                        }
                                    }

                                    if (!(D != null))
                                    {
                                        Task13.Crash("We weren't able to get the advance disease from the archive.");
                                    }
                                    dat += "<b>Disease Agent:</b> " + (D != null ? new Txt().item(D.agent).str(" - <A href='?src=").Ref(this).str(";create_virus_culture=").item(i).str("'>Create virus culture bottle</A>").ToString() : "none") + "<BR>";
                                    dat += "<b>Common name:</b> " + (Lang13.Bool(D.name) || Lang13.Bool("none")) + "<BR>";
                                    dat += "<b>Description: </b> " + (Lang13.Bool(D.desc) || Lang13.Bool("none")) + "<BR>";
                                    dat += "<b>Spread:</b> " + (Lang13.Bool(D.spread_text) || Lang13.Bool("none")) + "<BR>";
                                    dat += "<b>Possible cure:</b> " + (Lang13.Bool(D.cure_text) || Lang13.Bool("none")) + "<BR><BR>";

                                    if (D is Disease_Advance)
                                    {
                                        A2   = D;
                                        dat += "<b>Symptoms:</b> ";
                                        english_symptoms = new ByTable();

                                        foreach (dynamic _b in Lang13.Enumerate(((dynamic)A2).symptoms, typeof(Symptom)))
                                        {
                                            S = _b;

                                            english_symptoms.Add(S.name);
                                        }
                                        dat += GlobalFuncs.english_list(english_symptoms);
                                    }
                                }
                                else
                                {
                                    dat += "No detectable virus in the sample.";
                                }
                            }
                        }
                    }
                    else
                    {
                        dat += "No detectable virus in the sample.";
                    }
                    dat += "<BR><b>Contains antibodies to:</b> ";

                    if (Lang13.Bool(Blood.data["resistances"]))
                    {
                        res = Blood.data["resistances"];

                        if (res.len != 0)
                        {
                            dat += "<ul>";
                            i2   = 0;

                            foreach (dynamic _d in Lang13.Enumerate(Blood.data["resistances"]))
                            {
                                type = _d;

                                i2++;
                                disease_name = "Unknown";

                                if (!(type is Type))
                                {
                                    A3 = GlobalVars.archive_diseases[type];

                                    if (Lang13.Bool(A3))
                                    {
                                        disease_name = A3.name;
                                    }
                                }
                                else
                                {
                                    D2           = Lang13.Call(type, 0, null);
                                    disease_name = D2.name;
                                }
                                dat += new Txt("<li>").item(disease_name).str(" - <A href='?src=").Ref(this).str(";create_vaccine=").item(i2).str("'>Create vaccine bottle</A></li>").ToString();
                            }
                            dat += "</ul><BR>";
                        }
                        else
                        {
                            dat += "nothing<BR>";
                        }
                    }
                    else
                    {
                        dat += "nothing<BR>";
                    }
                }
                dat += new Txt("<BR><A href='?src=").Ref(this).str(";eject=1'>Eject beaker</A>").item((Lang13.Bool(R.total_volume) && R.reagent_list.len != 0 ? new Txt("-- <A href='?src=").Ref(this).str(";empty_beaker=1'>Empty beaker</A>").ToString() : "")).str("<BR>").ToString();
                dat += new Txt("<A href='?src=").Ref(a).str(";mach_close=pandemic'>Close</A>").ToString();
            }
            Interface13.Browse(a, "<TITLE>" + this.name + "</TITLE><BR>" + dat, "window=pandemic;size=575x400");
            GlobalFuncs.onclose(a, "pandemic");
            return(null);
        }
Esempio n. 12
0
        // Function from file: server.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            string dat = null;
            Obj_Machinery_RND_Server         S = null;
            Obj_Machinery_Computer_Rdconsole C = null;
            dynamic console_turf = null;
            Obj_Machinery_Computer_Rdconsole C2 = null;
            dynamic console_turf2       = null;
            dynamic v                   = null;
            dynamic T                   = null;
            dynamic v2                  = null;
            dynamic D                   = null;
            Obj_Machinery_RND_Server S2 = null;


            if (Lang13.Bool(base.attack_hand((object)(a), b, c)))
            {
                return(null);
            }
            ((Mob)a).set_machine(this);
            dat = "";

            switch ((int)(this.screen))
            {
            case 0:
                dat += "Connected Servers:<BR><BR>";

                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_RND_Server)))
                {
                    S = _a;


                    if (S is Obj_Machinery_RND_Server_Centcom && !this.badmin)
                    {
                        continue;
                    }
                    dat += "" + S.name + " || ";
                    dat += new Txt("<A href='?src=").Ref(this).str(";access=").item(S.server_id).str("'>Access Rights</A> | ").ToString();
                    dat += new Txt("<A href='?src=").Ref(this).str(";data=").item(S.server_id).str("'>Data Management</A>").ToString();

                    if (this.badmin)
                    {
                        dat += new Txt(" | <A href='?src=").Ref(this).str(";transfer=").item(S.server_id).str("'>Server-to-Server Transfer</A>").ToString();
                    }
                    dat += "<BR>";
                }
                break;

            case 1:
                dat += "" + this.temp_server.name + " Access Rights<BR><BR>";
                dat += "Consoles with Upload Access<BR>";

                foreach (dynamic _b in Lang13.Enumerate(this.consoles, typeof(Obj_Machinery_Computer_Rdconsole)))
                {
                    C = _b;

                    console_turf = GlobalFuncs.get_turf(C);
                    dat         += new Txt("* <A href='?src=").Ref(this).str(";upload_toggle=").item(C.id).str("'>").item(console_turf.loc).ToString();

                    if (this.temp_server.id_with_upload.Contains(C.id))
                    {
                        dat += " (Remove)</A><BR>";
                    }
                    else
                    {
                        dat += " (Add)</A><BR>";
                    }
                }
                dat += "Consoles with Download Access<BR>";

                foreach (dynamic _c in Lang13.Enumerate(this.consoles, typeof(Obj_Machinery_Computer_Rdconsole)))
                {
                    C2 = _c;

                    console_turf2 = GlobalFuncs.get_turf(C2);
                    dat          += new Txt("* <A href='?src=").Ref(this).str(";download_toggle=").item(C2.id).str("'>").item(console_turf2.loc).ToString();

                    if (this.temp_server.id_with_download.Contains(C2.id))
                    {
                        dat += " (Remove)</A><BR>";
                    }
                    else
                    {
                        dat += " (Add)</A><BR>";
                    }
                }
                dat += new Txt("<HR><A href='?src=").Ref(this).str(";main=1'>Main Menu</A>").ToString();
                break;

            case 2:
                dat += "" + this.temp_server.name + " Data ManagementP<BR><BR>";
                dat += "Known Technologies<BR>";

                foreach (dynamic _d in Lang13.Enumerate(this.temp_server.files.known_tech))
                {
                    v = _d;

                    T    = this.temp_server.files.known_tech[v];
                    dat += "* " + T.name + " ";
                    dat += new Txt("<A href='?src=").Ref(this).str(";reset_tech=").item(T.id).str("'>(Reset)</A><BR>").ToString();
                }
                dat += "Known Designs<BR>";

                foreach (dynamic _e in Lang13.Enumerate(this.temp_server.files.known_designs))
                {
                    v2 = _e;

                    D    = this.temp_server.files.known_designs[v2];
                    dat += "* " + D.name + " ";
                    dat += new Txt("<A href='?src=").Ref(this).str(";reset_design=").item(D.id).str("'>(Delete)</A><BR>").ToString();
                }
                dat += new Txt("<HR><A href='?src=").Ref(this).str(";main=1'>Main Menu</A>").ToString();
                break;

            case 3:
                dat += "" + this.temp_server.name + " Server to Server Transfer<BR><BR>";
                dat += "Send Data to what server?<BR>";

                foreach (dynamic _f in Lang13.Enumerate(this.servers, typeof(Obj_Machinery_RND_Server)))
                {
                    S2 = _f;

                    dat += new Txt().item(S2.name).str(" <A href='?src=").Ref(this).str(";send_to=").item(S2.server_id).str("'>(Transfer)</A><BR>").ToString();
                }
                dat += new Txt("<HR><A href='?src=").Ref(this).str(";main=1'>Main Menu</A>").ToString();
                break;
            }
            Interface13.Browse(a, "<TITLE>R&D Server Control</TITLE><HR>" + dat, "window=server_control;size=575x400");
            GlobalFuncs.onclose(a, "server_control");
            return(null);
        }
Esempio n. 13
0
        // Function from file: server.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            Obj_Machinery_RND_Server         S = null;
            Obj_Machinery_Computer_Rdconsole C = null;
            Obj_Machinery S2      = null;
            double?       num     = null;
            double?       num2    = null;
            string        choice  = null;
            dynamic       T       = null;
            string        choice2 = null;
            dynamic       D       = null;


            if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc))))
            {
                return(null);
            }
            this.add_fingerprint(Task13.User);
            Task13.User.set_machine(this);

            if (!this.allowed(Task13.User) && !Lang13.Bool(this.emagged))
            {
                Task13.User.WriteMsg("<span class='danger'>You do not have the required access level.</span>");
                return(null);
            }

            if (Lang13.Bool(href_list["main"]))
            {
                this.screen = 0;
            }
            else if (Lang13.Bool(href_list["access"]) || Lang13.Bool(href_list["data"]) || Lang13.Bool(href_list["transfer"]))
            {
                this.temp_server = null;
                this.consoles    = new ByTable();
                this.servers     = new ByTable();

                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_RND_Server)))
                {
                    S = _a;


                    if (S.server_id == String13.ParseNumber(href_list["access"]) || S.server_id == String13.ParseNumber(href_list["data"]) || S.server_id == String13.ParseNumber(href_list["transfer"]))
                    {
                        this.temp_server = S;
                        break;
                    }
                }

                if (Lang13.Bool(href_list["access"]))
                {
                    this.screen = 1;

                    foreach (dynamic _b in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_Computer_Rdconsole)))
                    {
                        C = _b;


                        if (C.sync)
                        {
                            this.consoles.Add(C);
                        }
                    }
                }
                else if (Lang13.Bool(href_list["data"]))
                {
                    this.screen = 2;
                }
                else if (Lang13.Bool(href_list["transfer"]))
                {
                    this.screen = 3;

                    foreach (dynamic _c in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_RND_Server)))
                    {
                        S2 = _c;


                        if (S2 == this)
                        {
                            continue;
                        }
                        this.servers.Add(S2);
                    }
                }
            }
            else if (Lang13.Bool(href_list["upload_toggle"]))
            {
                num = String13.ParseNumber(href_list["upload_toggle"]);

                if (this.temp_server.id_with_upload.Contains(num))
                {
                    this.temp_server.id_with_upload.Remove(num);
                }
                else
                {
                    this.temp_server.id_with_upload.Add(num);
                }
            }
            else if (Lang13.Bool(href_list["download_toggle"]))
            {
                num2 = String13.ParseNumber(href_list["download_toggle"]);

                if (this.temp_server.id_with_download.Contains(num2))
                {
                    this.temp_server.id_with_download.Remove(num2);
                }
                else
                {
                    this.temp_server.id_with_download.Add(num2);
                }
            }
            else if (Lang13.Bool(href_list["reset_tech"]))
            {
                choice = Interface13.Alert("Technology Data Reset", "Are you sure you want to reset this technology to its default data? Data lost cannot be recovered.", "Continue", "Cancel");

                if (choice == "Continue")
                {
                    T = this.temp_server.files.known_tech[href_list["reset_tech"]];

                    if (Lang13.Bool(T))
                    {
                        T.level = 1;
                    }
                }
                this.temp_server.files.RefreshResearch();
            }
            else if (Lang13.Bool(href_list["reset_design"]))
            {
                choice2 = Interface13.Alert("Design Data Deletion", "Are you sure you want to delete this design? If you still have the prerequisites for the design, it'll reset to its base reliability. Data lost cannot be recovered.", "Continue", "Cancel");

                if (choice2 == "Continue")
                {
                    D = this.temp_server.files.known_designs[href_list["reset_design"]];

                    if (Lang13.Bool(D))
                    {
                        this.temp_server.files.known_designs.Remove(D.id);
                    }
                }
                this.temp_server.files.RefreshResearch();
            }
            this.updateUsrDialog();
            return(null);
        }
Esempio n. 14
0
        // Function from file: ritual.dm
        public void scribe_rune(dynamic user = null)
        {
            string  chosen_keyword    = null;
            dynamic rune_to_scribe    = null;
            dynamic entered_rune_name = null;
            ByTable possible_runes    = null;
            dynamic T           = null;
            dynamic R           = null;
            dynamic T2          = null;
            dynamic R2          = null;
            string  the_keyword = null;
            dynamic C           = null;
            dynamic R3          = null;

            possible_runes = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(this.known_runes))
            {
                T = _a;

                R = T;

                if (Lang13.Bool(Lang13.Initial(R, "cultist_name")))
                {
                    possible_runes.Add(Lang13.Initial(R, "cultist_name"));
                }
            }

            if (!(possible_runes.len != 0))
            {
                return;
            }
            entered_rune_name = Interface13.Input(user, "Choose a rite to scribe.", "Sigils of Power", null, possible_runes, InputType.Null | InputType.Any);

            if (!this.Adjacent(user) || !(this != null) || Lang13.Bool(GlobalFuncs.qdeleted(this)) || ((Mob)user).incapacitated())
            {
                return;
            }

            foreach (dynamic _b in Lang13.Enumerate(Lang13.GetTypes(typeof(Obj_Effect_Rune))))
            {
                T2 = _b;

                R2 = T2;

                if (Lang13.Initial(R2, "cultist_name") == entered_rune_name)
                {
                    rune_to_scribe = R2;

                    if (Lang13.Bool(Lang13.Initial(R2, "req_keyword")))
                    {
                        the_keyword = GlobalFuncs.stripped_input(Task13.User, "Please enter a keyword for the rune.", "Enter Keyword", "");

                        if (!Lang13.Bool(the_keyword))
                        {
                            return;
                        }
                        chosen_keyword = the_keyword;
                    }
                    break;
                }
            }

            if (!Lang13.Bool(rune_to_scribe))
            {
                return;
            }

            if (!this.Adjacent(user) || !(this != null) || Lang13.Bool(GlobalFuncs.qdeleted(this)) || ((Mob)user).incapacitated())
            {
                return;
            }
            ((Ent_Static)user).visible_message("<span class='warning'>" + user + " cuts open their arm and begins writing in their own blood!</span>", "<span class='cult'>You slice open your arm and begin drawing a sigil of the Geometer.</span>");

            if (user is Mob_Living_Carbon)
            {
                C = user;
                C.apply_damage(0.1, "brute", Rand13.Pick(new object [] { "l_arm", "r_arm" }));
            }

            if (!GlobalFuncs.do_after(user, 50, null, GlobalFuncs.get_turf(user)))
            {
                return;
            }
            ((Ent_Static)user).visible_message("<span class='warning'>" + user + " creates a strange circle in their own blood.</span>", "<span class='cult'>You finish drawing the arcane markings of the Geometer.</span>");
            R3 = Lang13.Call(rune_to_scribe, GlobalFuncs.get_turf(user));

            if (Lang13.Bool(chosen_keyword))
            {
                R3.keyword = chosen_keyword;
            }
            return;
        }
Esempio n. 15
0
        // Function from file: wildwest.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            dynamic          wish   = null;
            Objective_Hijack hijack = null;
            int       obj_count     = 0;
            Objective OBJ           = null;
            Mob_Living_SimpleAnimal_Hostile_Faithless F = null;

            Task13.User.set_machine(this);

            if (this.chargesa <= 0)
            {
                a.WriteMsg("The Wish Granter lies silent.");
                return(null);
            }
            else if (!(a is Mob_Living_Carbon_Human))
            {
                a.WriteMsg("You feel a dark stirring inside of the Wish Granter, something you want nothing of. Your instincts are better than any man's.");
                return(null);
            }
            else if (GlobalFuncs.is_special_character(a) != 0)
            {
                a.WriteMsg("Even to a heart as dark as yours, you know nothing good will come of this.  Something instinctual makes you pull away.");
            }
            else if (!(this.insistinga != 0))
            {
                a.WriteMsg("Your first touch makes the Wish Granter stir, listening to you.  Are you really sure you want to do this?");
                this.insistinga++;
            }
            else
            {
                this.chargesa--;
                this.insistinga = 0;
                wish            = Interface13.Input("You want...", "Wish", null, null, new ByTable(new object [] { "Power", "Wealth", "Immortality", "To Kill", "Peace" }), InputType.Null | InputType.Any);

                dynamic _c = wish;                 // Was a switch-case, sorry for the mess.
                if (_c == "Power")
                {
                    a.WriteMsg("<B>Your wish is granted, but at a terrible cost...</B>");
                    a.WriteMsg("The Wish Granter punishes you for your selfishness, claiming your soul and warping your body to match the darkness in your heart.");
                    ((Dna)a.dna).add_mutation("Laser Eyes");
                    ((Dna)a.dna).add_mutation("Cold Resistance");
                    ((Dna)a.dna).add_mutation("X Ray Vision");
                    ((Mob)a).set_species(typeof(Species_Shadow));
                }
                else if (_c == "Wealth")
                {
                    a.WriteMsg("<B>Your wish is granted, but at a terrible cost...</B>");
                    a.WriteMsg("The Wish Granter punishes you for your selfishness, claiming your soul and warping your body to match the darkness in your heart.");
                    new Obj_Structure_Closet_Syndicate_Resources_Everything(this.loc);
                    ((Mob)a).set_species(typeof(Species_Shadow));
                }
                else if (_c == "Immortality")
                {
                    a.WriteMsg("<B>Your wish is granted, but at a terrible cost...</B>");
                    a.WriteMsg("The Wish Granter punishes you for your selfishness, claiming your soul and warping your body to match the darkness in your heart.");
                    a.verbs += typeof(Mob_Living_Carbon).GetMethod("immortality");
                    ((Mob)a).set_species(typeof(Species_Shadow));
                }
                else if (_c == "To Kill")
                {
                    a.WriteMsg("<B>Your wish is granted, but at a terrible cost...</B>");
                    a.WriteMsg("The Wish Granter punishes you for your wickedness, claiming your soul and warping your body to match the darkness in your heart.");
                    GlobalVars.ticker.mode.traitors.Add(a.mind);
                    a.mind.special_role = "traitor";
                    hijack       = new Objective_Hijack();
                    hijack.owner = a.mind;
                    a.mind.objectives.Add(hijack);
                    a.WriteMsg("<B>Your inhibitions are swept away, the bonds of loyalty broken, you are free to murder as you please!</B>");
                    obj_count = 1;

                    foreach (dynamic _a in Lang13.Enumerate(a.mind.objectives, typeof(Objective)))
                    {
                        OBJ = _a;

                        a.WriteMsg("<B>Objective #" + obj_count + "</B>: " + OBJ.explanation_text);
                        obj_count++;
                    }
                    ((Mob)a).set_species(typeof(Species_Shadow));
                }
                else if (_c == "Peace")
                {
                    a.WriteMsg("<B>Whatever alien sentience that the Wish Granter possesses is satisfied with your wish. There is a distant wailing as the last of the Faithless begin to die, then silence.</B>");
                    a.WriteMsg("You feel as if you just narrowly avoided a terrible fate...");

                    foreach (dynamic _b in Lang13.Enumerate(GlobalVars.mob_list, typeof(Mob_Living_SimpleAnimal_Hostile_Faithless)))
                    {
                        F = _b;

                        F.death();
                    }
                }
            }
            return(null);
        }
Esempio n. 16
0
        // Function from file: pai.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            dynamic candidate          = null;
            dynamic card               = null;
            Mob_Living_Silicon_Pai pai = null;
            dynamic candidate2         = null;
            dynamic option             = null;
            dynamic t = null;
            Obj_Item_Device_Paicard p = null;


            if (Lang13.Bool(href_list["download"]))
            {
                candidate = Lang13.FindObj(href_list["candidate"]);
                card      = Lang13.FindObj(href_list["device"]);

                if (Lang13.Bool(card.pai))
                {
                    return(null);
                }

                if (card is Obj_Item_Device_Paicard && candidate is PaiCandidate)
                {
                    pai = new Mob_Living_Silicon_Pai(card);

                    if (!Lang13.Bool(candidate.name))
                    {
                        pai.name = Rand13.PickFromTable(GlobalVars.ninja_names);
                    }
                    else
                    {
                        pai.name = candidate.name;
                    }
                    pai.real_name = pai.name;
                    pai.key       = candidate.key;
                    ((Obj_Item_Device_Paicard)card).setPersonality(pai);
                    card.looking_for_personality = false;
                    ((GameMode)GlobalVars.ticker.mode).update_cult_icons_removed(card.pai.mind);
                    ((GameMode)GlobalVars.ticker.mode).update_rev_icons_removed(card.pai.mind);
                    this.candidates.Remove(candidate);
                    Interface13.Browse(Task13.User, null, "window=findPai");
                }
            }

            if (Lang13.Bool(href_list["new"]))
            {
                candidate2 = Lang13.FindObj(href_list["candidate"]);
                option     = href_list["option"];
                t          = "";

                dynamic _b = option;                 // Was a switch-case, sorry for the mess.
                if (_b == "name")
                {
                    t = Interface13.Input("Enter a name for your pAI", "pAI Name", candidate2.name, null, null, InputType.Str);

                    if (Lang13.Bool(t))
                    {
                        candidate2.name = String13.SubStr(GlobalFuncs.sanitize(t), 1, 26);
                    }
                }
                else if (_b == "desc")
                {
                    t = Interface13.Input("Enter a description for your pAI", "pAI Description", candidate2.description, null, null, InputType.StrMultiline);

                    if (Lang13.Bool(t))
                    {
                        candidate2.description = String13.SubStr(GlobalFuncs.sanitize(t), 1, 1024);
                    }
                }
                else if (_b == "role")
                {
                    t = Interface13.Input("Enter a role for your pAI", "pAI Role", candidate2.role, null, null, InputType.Str);

                    if (Lang13.Bool(t))
                    {
                        candidate2.role = String13.SubStr(GlobalFuncs.sanitize(t), 1, 1024);
                    }
                }
                else if (_b == "ooc")
                {
                    t = Interface13.Input("Enter any OOC comments", "pAI OOC Comments", candidate2.comments, null, null, InputType.StrMultiline);

                    if (Lang13.Bool(t))
                    {
                        candidate2.comments = String13.SubStr(GlobalFuncs.sanitize(t), 1, 1024);
                    }
                }
                else if (_b == "save")
                {
                    ((PaiCandidate)candidate2).savefile_save(Task13.User);
                }
                else if (_b == "load")
                {
                    ((PaiCandidate)candidate2).savefile_load(Task13.User);

                    if (Lang13.Bool(candidate2.name))
                    {
                        candidate2.name = String13.SubStr(GlobalFuncs.sanitize(candidate2.name), 1, 26);
                    }

                    if (Lang13.Bool(candidate2.description))
                    {
                        candidate2.description = String13.SubStr(GlobalFuncs.sanitize(candidate2.description), 1, 1024);
                    }

                    if (Lang13.Bool(candidate2.role))
                    {
                        candidate2.role = String13.SubStr(GlobalFuncs.sanitize(candidate2.role), 1, 1024);
                    }

                    if (Lang13.Bool(candidate2.comments))
                    {
                        candidate2.comments = String13.SubStr(GlobalFuncs.sanitize(candidate2.comments), 1, 1024);
                    }
                }
                else if (_b == "submit")
                {
                    if (Lang13.Bool(candidate2))
                    {
                        candidate2.ready = 1;

                        foreach (dynamic _a in Lang13.Enumerate(typeof(Game13), typeof(Obj_Item_Device_Paicard)))
                        {
                            p = _a;


                            if (p.looking_for_personality)
                            {
                                p.alertUpdate();
                            }
                        }
                    }
                    Interface13.Browse(Task13.User, null, "window=paiRecruit");
                    return(null);
                }
                this.recruitWindow(Task13.User);
            }
            return(null);
        }
Esempio n. 17
0
        // Function from file: special_shadowling_abilities.dm
        public override bool cast(dynamic targets = null, dynamic thearea = null, dynamic user = null)
        {
            thearea = thearea ?? Task13.User;

            dynamic              H                      = null;
            string               hatch_or_no            = null;
            Obj_Item             I                      = null;
            Tile_Simulated_Floor F                      = null;
            dynamic              shadowturf             = null;
            Obj_Structure_Alien_Resin_Wall_Shadowling R = null;
            int     temp_flags = 0;
            dynamic newNameId  = null;
            Obj_Structure_Alien_Resin_Wall_Shadowling W = null;
            Obj_Structure_Alien_Weeds_Node            N = null;


            if (Lang13.Bool(thearea.stat) || !(thearea is Mob_Living_Carbon_Human) || !Lang13.Bool(thearea) || !GlobalFuncs.is_shadow(Lang13.Bool(thearea) || this.isinspace(  )))
            {
                return(false);
            }
            H           = thearea;
            hatch_or_no = Interface13.Alert(H, "Are you sure you want to hatch? You cannot undo this!", null, "Yes", "No");

            switch ((string)(hatch_or_no))
            {
            case "No":
                H.WriteMsg("<span class='warning'>You decide against hatching for now.");
                this.charge_counter = this.charge_max;
                return(false);

                break;

            case "Yes":
                H.stunned = Double.PositiveInfinity;
                ((Ent_Static)H).visible_message("<span class='warning'>" + H + "'s things suddenly slip off. They hunch over and vomit up a copious amount of purple goo which begins to shape around them!</span>", "<span class='shadowling'>You remove any equipment which would hinder your hatching and begin regurgitating the resin which will protect you.</span>");

                foreach (dynamic _a in Lang13.Enumerate(H, typeof(Obj_Item)))
                {
                    I = _a;

                    ((Mob)H).unEquip(I);
                }
                Task13.Sleep(50);
                F          = null;
                shadowturf = GlobalFuncs.get_turf(thearea);

                foreach (dynamic _b in Lang13.Enumerate(Map13.FetchInRangeExcludeThis(thearea, 1), typeof(Tile_Simulated_Floor)))
                {
                    F = _b;

                    new Obj_Structure_Alien_Resin_Wall_Shadowling(F);
                }

                foreach (dynamic _c in Lang13.Enumerate(shadowturf, typeof(Obj_Structure_Alien_Resin_Wall_Shadowling)))
                {
                    R = _c;

                    GlobalFuncs.qdel(R);
                    new Obj_Structure_Alien_Weeds_Node(  );
                }
                temp_flags      = H.status_flags;
                H.status_flags |= 4096;
                ((Ent_Static)H).visible_message("<span class='warning'>A chrysalis forms around " + H + ", sealing them inside.</span>", "<span class='shadowling'>You create your chrysalis and begin to contort within.</span>");
                Task13.Sleep(100);
                ((Ent_Static)H).visible_message("<span class='warning'><b>The skin on " + H + "'s back begins to split apart. Black spines slowly emerge from the divide.</b></span>", "<span class='shadowling'>Spines pierce your back. Your claws break apart your fingers. You feel excruciating pain as your true form begins its exit.</span>");
                Task13.Sleep(90);
                ((Ent_Static)H).visible_message("<span class='warning'><b>" + H + ", skin shifting, begins tearing at the walls around them.</b></span>", "<span class='shadowling'>Your false skin slips away. You begin tearing at the fragile membrane protecting you.</span>");
                Task13.Sleep(80);
                GlobalFuncs.playsound(H.loc, "sound/weapons/slash.ogg", 25, 1);
                H.WriteMsg("<i><b>You rip and slice.</b></i>");
                Task13.Sleep(10);
                GlobalFuncs.playsound(H.loc, "sound/weapons/slashmiss.ogg", 25, 1);
                H.WriteMsg("<i><b>The chrysalis falls like water before you.</b></i>");
                Task13.Sleep(10);
                GlobalFuncs.playsound(H.loc, "sound/weapons/slice.ogg", 25, 1);
                H.WriteMsg("<i><b>You are free!</b></i>");
                H.status_flags = temp_flags;
                Task13.Sleep(10);
                GlobalFuncs.playsound(H.loc, "sound/effects/ghost.ogg", 100, 1);
                newNameId = Rand13.PickFromTable(GlobalVars.possibleShadowlingNames);
                GlobalVars.possibleShadowlingNames.Remove(newNameId);
                H.real_name = newNameId;
                H.name      = thearea.real_name;
                H.stunned   = 0;
                H.WriteMsg("<i><b><font size=3>YOU LIVE!!!</i></b></font>");

                foreach (dynamic _d in Lang13.Enumerate(Map13.FetchInRangeExcludeThis(H, 1), typeof(Obj_Structure_Alien_Resin_Wall_Shadowling)))
                {
                    W = _d;

                    GlobalFuncs.playsound(W, "sound/effects/splat.ogg", 50, 1);
                    GlobalFuncs.qdel(W);
                }

                foreach (dynamic _e in Lang13.Enumerate(shadowturf, typeof(Obj_Structure_Alien_Weeds_Node)))
                {
                    N = _e;

                    GlobalFuncs.qdel(N);
                }
                ((Ent_Static)H).visible_message("<span class='warning'>The chrysalis explodes in a shower of purple flesh and fluid!</span>");
                H.underwear  = "Nude";
                H.undershirt = "Nude";
                H.socks      = "Nude";
                H.faction   |= "faithless";
                ((Mob)H).equip_to_slot_or_del(new Obj_Item_Clothing_Under_Shadowling(H), 14);
                ((Mob)H).equip_to_slot_or_del(new Obj_Item_Clothing_Shoes_Shadowling(H), 12);
                ((Mob)H).equip_to_slot_or_del(new Obj_Item_Clothing_Suit_Space_Shadowling(H), 13);
                ((Mob)H).equip_to_slot_or_del(new Obj_Item_Clothing_Head_Shadowling(H), 11);
                ((Mob)H).equip_to_slot_or_del(new Obj_Item_Clothing_Gloves_Shadowling(H), 10);
                ((Mob)H).equip_to_slot_or_del(new Obj_Item_Clothing_Mask_Gas_Shadowling(H), 2);
                ((Mob)H).equip_to_slot_or_del(new Obj_Item_Clothing_Glasses_Night_Shadowling(H), 9);
                ((Mob)H).set_species(typeof(Species_Shadow_Ling));
                ((Mind)H.mind).remove_spell(this);
                Task13.Sleep(10);
                H.WriteMsg("<span class='shadowling'><b><i>Your powers are awoken. You may now live to your fullest extent. Remember your goal. Cooperate with your thralls and allies.</b></i></span>");
                H.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Targeted_Enthrall(null));
                H.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Targeted_Glare(null));
                H.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_AoeTurf_Veil(null));
                H.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Self_ShadowWalk(null));
                H.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_AoeTurf_Flashfreeze(null));
                H.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Self_CollectiveMind(null));
                H.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Self_ShadowlingRegenarmor(null));
                H.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Targeted_ShadowlingExtendShuttle(null));
                break;
            }
            return(false);
        }
Esempio n. 18
0
        // Function from file: megaphone.dm
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            string message = null;


            if (Lang13.Bool(user.client))
            {
                if ((user.client.prefs.muted & 1) != 0)
                {
                    ((dynamic)this).WriteMsg("<span class='warning'>You cannot speak in IC (muted).</span>");
                    return(null);
                }
            }

            if (!(user is Mob_Living_Carbon_Human))
            {
                user.WriteMsg("<span class='warning'>You don't know how to use this!</span>");
                return(null);
            }

            if (this.spamcheck > Game13.time)
            {
                user.WriteMsg(new Txt("<span class='warning'>").The(this).item().str(" needs to recharge!</span>").ToString());
                return(null);
            }
            message = String13.SubStr(GlobalFuncs.sanitize(Interface13.Input(user, "Shout a message?", "Megaphone", null, null, InputType.Str)), 1, 1024);

            if (!Lang13.Bool(message))
            {
                return(null);
            }
            message = GlobalFuncs.capitalize(message);

            if (!((Ent_Dynamic)user).can_speak(message))
            {
                user.WriteMsg("<span class='warning'>You find yourself unable to speak at all!</span>");
                return(null);
            }

            if (this.loc == user && Lang13.Bool(user.stat) == false)
            {
                if (this.emagged)
                {
                    if (this.insults != 0)
                    {
                        ((Ent_Static)user).audible_message("<B>" + ((Ent_Dynamic)user).GetVoice() + "</B> broadcasts, <FONT size=3>\"" + Rand13.PickFromTable(this.insultmsg) + "\"</FONT>");
                        this.insults--;
                    }
                    else
                    {
                        user.WriteMsg("<span class='warning'>*BZZZZzzzzzt*</span>");
                    }
                }
                else
                {
                    ((Ent_Static)user).audible_message("<B>" + ((Ent_Dynamic)user).GetVoice() + "</B> broadcasts, <FONT size=3>\"" + message + "\"</FONT>");
                }
                GlobalFuncs.playsound(this.loc, "sound/items/megaphone.ogg", 100, 0, 1);
                this.spamcheck = Game13.time + 50;
                return(null);
            }
            return(null);
        }
        // Function from file: dna_console.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            Mob     viable_occupant             = null;
            double? num                         = null;
            string  last_change                 = null;
            bool    epinephrine_amount          = false;
            int     can_add                     = 0;
            string  text                        = null;
            dynamic buffer_slot                 = null;
            ByTable buffer_slot2                = null;
            dynamic buffer_slot3                = null;
            Obj_Item_Weapon_Dnainjector_Timed I = null;
            Mutation_Human HM                   = null;
            int?           time_coeff           = null;
            Mutation_Human HM2                  = null;
            dynamic        buffer_slot4         = null;
            dynamic        locked_state         = null;
            int            len                  = 0;
            int            block                = 0;
            double         subblock             = 0;
            string         hex                  = null;
            int            len2                 = 0;
            int            block2               = 0;
            double         subblock2            = 0;
            string         hex2                 = null;


            if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc))))
            {
                return(null);
            }

            if (!(Task13.User.loc is Tile))
            {
                return(null);
            }

            if (!(this.loc is Tile && Map13.GetDistance(this, Task13.User) <= 1 || Task13.User is Mob_Living_Silicon))
            {
                return(null);
            }

            if (this.current_screen == "working")
            {
                return(null);
            }
            this.add_fingerprint(Task13.User);
            Task13.User.set_machine(this);
            viable_occupant = this.get_viable_occupant();
            num             = Num13.Floor(String13.ParseNumber(href_list["num"]) ?? 0);

            dynamic _f = href_list["task"];             // Was a switch-case, sorry for the mess.

            if (_f == "togglelock")
            {
                if (Lang13.Bool(this.connected))
                {
                    this.connected.locked = !Lang13.Bool(this.connected.locked);
                }
            }
            else if (_f == "toggleopen")
            {
                if (Lang13.Bool(this.connected))
                {
                    ((Obj_Machinery_DnaScannernew)this.connected).toggle_open(Task13.User);
                }
            }
            else if (_f == "setduration")
            {
                if (!Lang13.Bool(num))
                {
                    num = Num13.Floor(Convert.ToDouble(Interface13.Input(Task13.User, "Choose pulse duration:", "Input an Integer", null, null, InputType.Num | InputType.Null)));
                }

                if (Lang13.Bool(num))
                {
                    this.radduration = GlobalFuncs.Wrap(num, true, 31);
                }
            }
            else if (_f == "setstrength")
            {
                if (!Lang13.Bool(num))
                {
                    num = Num13.Floor(Convert.ToDouble(Interface13.Input(Task13.User, "Choose pulse strength:", "Input an Integer", null, null, InputType.Num | InputType.Null)));
                }

                if (Lang13.Bool(num))
                {
                    this.radstrength = GlobalFuncs.Wrap(num, true, 16);
                }
            }
            else if (_f == "screen")
            {
                this.current_screen = href_list["text"];
            }
            else if (_f == "rejuv")
            {
                if (viable_occupant != null && viable_occupant.reagents != null)
                {
                    epinephrine_amount = viable_occupant.reagents.get_reagent_amount("epinephrine");
                    can_add            = Num13.MaxInt(Num13.MinInt(90 - (epinephrine_amount ?1:0), 15), 0);
                    viable_occupant.reagents.add_reagent("epinephrine", can_add);
                }
            }
            else if (_f == "setbufferlabel")
            {
                text = GlobalFuncs.sanitize(Interface13.Input(Task13.User, "Input a new label:", "Input an Text", null, null, InputType.Str | InputType.Null));

                if (Lang13.Bool(num) && Lang13.Bool(text))
                {
                    num         = Num13.MaxInt(1, Num13.MinInt(((int)(num ?? 0)), 3));
                    buffer_slot = this.buffer[num];

                    if (buffer_slot is ByTable)
                    {
                        buffer_slot["label"] = text;
                    }
                }
            }
            else if (_f == "setbuffer")
            {
                if (Lang13.Bool(num) && viable_occupant != null)
                {
                    num = Num13.MaxInt(1, Num13.MinInt(((int)(num ?? 0)), 3));
                    this.buffer[num] = new ByTable()
                                       .Set("label", "Buffer" + num + ":" + viable_occupant.real_name)
                                       .Set("UI", ((dynamic)viable_occupant).dna.uni_identity)
                                       .Set("SE", ((dynamic)viable_occupant).dna.struc_enzymes)
                                       .Set("UE", ((dynamic)viable_occupant).dna.unique_enzymes)
                                       .Set("name", viable_occupant.real_name)
                                       .Set("blood_type", ((dynamic)viable_occupant).dna.blood_type)
                    ;
                }
            }
            else if (_f == "clearbuffer")
            {
                if (Lang13.Bool(num))
                {
                    num          = Num13.MaxInt(1, Num13.MinInt(((int)(num ?? 0)), 3));
                    buffer_slot2 = this.buffer[num];

                    if (buffer_slot2 is ByTable)
                    {
                        buffer_slot2.Cut();
                    }
                }
            }
            else if (_f == "transferbuffer")
            {
                if (Lang13.Bool(num) && viable_occupant != null)
                {
                    dynamic _a = href_list["text"];                     // Was a switch-case, sorry for the mess.
                    if (_a == "se")
                    {
                        this.apply_buffer(1, num);
                    }
                    else if (_a == "ui")
                    {
                        this.apply_buffer(2, num);
                    }
                    else if (_a == "ue")
                    {
                        this.apply_buffer(3, num);
                    }
                    else if (_a == "mixed")
                    {
                        this.apply_buffer(4, num);
                    }
                }
            }
            else if (_f == "injector")
            {
                if (Lang13.Bool(num) && this.injectorready)
                {
                    num          = Num13.MaxInt(1, Num13.MinInt(((int)(num ?? 0)), 3));
                    buffer_slot3 = this.buffer[num];

                    if (buffer_slot3 is ByTable)
                    {
                        I = null;

                        dynamic _d = href_list["text"];                         // Was a switch-case, sorry for the mess.
                        if (_d == "se")
                        {
                            if (Lang13.Bool(buffer_slot3["SE"]))
                            {
                                I = new Obj_Item_Weapon_Dnainjector_Timed(this.loc);

                                foreach (dynamic _b in Lang13.Enumerate(GlobalVars.good_mutations + GlobalVars.bad_mutations + GlobalVars.not_good_mutations, typeof(Mutation_Human)))
                                {
                                    HM = _b;


                                    if (HM.check_block_string(buffer_slot3["SE"]))
                                    {
                                        I.add_mutations.Add(HM);
                                    }
                                    else
                                    {
                                        I.remove_mutations.Add(HM);
                                    }
                                }
                                time_coeff = null;

                                foreach (dynamic _c in Lang13.Enumerate(I.add_mutations, typeof(Mutation_Human)))
                                {
                                    HM2 = _c;


                                    if (!Lang13.Bool(time_coeff))
                                    {
                                        time_coeff = HM2.time_coeff;
                                        continue;
                                    }
                                    time_coeff = Num13.MinInt(time_coeff ?? 0, HM2.time_coeff);
                                }

                                if (Lang13.Bool(this.connected))
                                {
                                    I.duration     = I.duration * (time_coeff ?? 0) * Convert.ToDouble(this.connected.damage_coeff);
                                    I.damage_coeff = Convert.ToDouble(this.connected.damage_coeff);
                                }
                            }
                        }
                        else if (_d == "ui")
                        {
                            if (Lang13.Bool(buffer_slot3["UI"]))
                            {
                                I        = new Obj_Item_Weapon_Dnainjector_Timed(this.loc);
                                I.fields = new ByTable().Set("UI", buffer_slot3["UI"]);

                                if (Lang13.Bool(this.connected))
                                {
                                    I.damage_coeff = Convert.ToDouble(this.connected.damage_coeff);
                                }
                            }
                        }
                        else if (_d == "ue")
                        {
                            if (Lang13.Bool(buffer_slot3["name"]) && Lang13.Bool(buffer_slot3["UE"]) && Lang13.Bool(buffer_slot3["blood_type"]))
                            {
                                I        = new Obj_Item_Weapon_Dnainjector_Timed(this.loc);
                                I.fields = new ByTable().Set("name", buffer_slot3["name"]).Set("UE", buffer_slot3["UE"]).Set("blood_type", buffer_slot3["blood_type"]);

                                if (Lang13.Bool(this.connected))
                                {
                                    I.damage_coeff = Convert.ToDouble(this.connected.damage_coeff);
                                }
                            }
                        }
                        else if (_d == "mixed")
                        {
                            if (Lang13.Bool(buffer_slot3["UI"]) && Lang13.Bool(buffer_slot3["name"]) && Lang13.Bool(buffer_slot3["UE"]) && Lang13.Bool(buffer_slot3["blood_type"]))
                            {
                                I        = new Obj_Item_Weapon_Dnainjector_Timed(this.loc);
                                I.fields = new ByTable().Set("UI", buffer_slot3["UI"]).Set("name", buffer_slot3["name"]).Set("UE", buffer_slot3["UE"]).Set("blood_type", buffer_slot3["blood_type"]);

                                if (Lang13.Bool(this.connected))
                                {
                                    I.damage_coeff = Convert.ToDouble(this.connected.damage_coeff);
                                }
                            }
                        }

                        if (I != null)
                        {
                            this.injectorready = false;
                            Task13.Schedule(100, (Task13.Closure)(() => {
                                this.injectorready = true;
                                return;
                            }));
                        }
                    }
                }
            }
            else if (_f == "loaddisk")
            {
                if (Lang13.Bool(num) && Lang13.Bool(this.diskette) && Lang13.Bool(this.diskette.fields))
                {
                    num = Num13.MaxInt(1, Num13.MinInt(((int)(num ?? 0)), 3));
                    this.buffer[num] = this.diskette.fields.Copy();
                }
            }
            else if (_f == "savedisk")
            {
                if (Lang13.Bool(num) && Lang13.Bool(this.diskette) && !this.diskette.read_only)
                {
                    num          = Num13.MaxInt(1, Num13.MinInt(((int)(num ?? 0)), 3));
                    buffer_slot4 = this.buffer[num];

                    if (buffer_slot4 is ByTable)
                    {
                        this.diskette.name   = "data disk [" + buffer_slot4["label"] + "]";
                        this.diskette.fields = buffer_slot4.Copy();
                    }
                }
            }
            else if (_f == "ejectdisk")
            {
                if (Lang13.Bool(this.diskette))
                {
                    this.diskette.loc = GlobalFuncs.get_turf(this);
                    this.diskette     = null;
                }
            }
            else if (_f == "setdelayed")
            {
                if (Lang13.Bool(num))
                {
                    this.delayed_action = new ByTable().Set("action", String13.ParseNumber(href_list["delayaction"])).Set("buffer", num);
                }
            }
            else if (_f == "pulseui" || _f == "pulsese")
            {
                if (Lang13.Bool(num) && viable_occupant != null && Lang13.Bool(this.connected))
                {
                    this.radduration      = GlobalFuncs.Wrap(this.radduration, true, 31);
                    this.radstrength      = GlobalFuncs.Wrap(this.radstrength, true, 16);
                    locked_state          = this.connected.locked;
                    this.connected.locked = 1;
                    this.current_screen   = "working";
                    this.ShowInterface(Task13.User);
                    Task13.Sleep(((int)((this.radduration ?? 0) * 10)));
                    this.current_screen = "mainmenu";

                    if (viable_occupant != null && Lang13.Bool(this.connected) && this.connected.occupant == viable_occupant)
                    {
                        viable_occupant.radiation += (this.radduration ?? 0) * (this.radstrength ?? 0) * 0.2 / Math.Pow(Convert.ToDouble(this.connected.damage_coeff), 2);

                        dynamic _e = href_list["task"];                         // Was a switch-case, sorry for the mess.
                        if (_e == "pulseui")
                        {
                            len          = Lang13.Length(((dynamic)viable_occupant).dna.uni_identity);
                            num          = GlobalFuncs.Wrap(num, true, len + 1);
                            num          = this.randomize_radiation_accuracy(num, (this.radduration ?? 0) + Math.Pow(Convert.ToDouble(this.connected.precision_coeff), 2), len);
                            block        = Num13.Floor(((num ?? 0) - 1) / 3) + 1;
                            subblock     = (num ?? 0) - block * 3;
                            last_change  = "UI #" + block + "-" + subblock + "; ";
                            hex          = String13.SubStr(((dynamic)viable_occupant).dna.uni_identity, ((int)(num ?? 0)), ((int)((num ?? 0) + 1)));
                            last_change += "" + hex;
                            hex          = this.scramble(hex, this.radstrength, this.radduration);
                            last_change += "->" + hex;
                            ((dynamic)viable_occupant).dna.uni_identity = String13.SubStr(((dynamic)viable_occupant).dna.uni_identity, 1, ((int)(num ?? 0))) + hex + String13.SubStr(((dynamic)viable_occupant).dna.uni_identity, ((int)((num ?? 0) + 1)), 0);
                            new ByTable().Set("mutations_overlay_update", 1).Apply(Lang13.BindFunc(viable_occupant, "updateappearance"));
                        }
                        else if (_e == "pulsese")
                        {
                            len2         = Lang13.Length(((dynamic)viable_occupant).dna.struc_enzymes);
                            num          = GlobalFuncs.Wrap(num, true, len2 + 1);
                            num          = this.randomize_radiation_accuracy(num, (this.radduration ?? 0) + Math.Pow(Convert.ToDouble(this.connected.precision_coeff), 2), len2);
                            block2       = Num13.Floor(((num ?? 0) - 1) / 3) + 1;
                            subblock2    = (num ?? 0) - block2 * 3;
                            last_change  = "SE #" + block2 + "-" + subblock2 + "; ";
                            hex2         = String13.SubStr(((dynamic)viable_occupant).dna.struc_enzymes, ((int)(num ?? 0)), ((int)((num ?? 0) + 1)));
                            last_change += "" + hex2;
                            hex2         = this.scramble(hex2, this.radstrength, this.radduration);
                            last_change += "->" + hex2;
                            ((dynamic)viable_occupant).dna.struc_enzymes = String13.SubStr(((dynamic)viable_occupant).dna.struc_enzymes, 1, ((int)(num ?? 0))) + hex2 + String13.SubStr(((dynamic)viable_occupant).dna.struc_enzymes, ((int)((num ?? 0) + 1)), 0);
                            viable_occupant.domutcheck();
                        }
                    }
                    else
                    {
                        this.current_screen = "mainmenu";
                    }

                    if (Lang13.Bool(this.connected))
                    {
                        this.connected.locked = locked_state;
                    }
                }
            }
            this.ShowInterface(Task13.User, last_change);
            return(null);
        }
Esempio n. 20
0
        // Function from file: scrolls.dm
        public void teleportscroll(Mob user = null)
        {
            dynamic   A       = null;
            Base_Data thearea = null;
            EffectSystem_SmokeSpread smoke = null;
            ByTable L       = null;
            dynamic T       = null;
            bool    clear   = false;
            Obj     O       = null;
            ByTable tempL   = null;
            dynamic attempt = null;
            bool    success = false;

            A       = Interface13.Input(user, "Area to jump to", "BOOYEA", A, GlobalVars.teleportlocs, InputType.Any);
            thearea = GlobalVars.teleportlocs[A];

            if (!(user != null) || user.stat != 0 || user.restrained() || this.uses <= 0)
            {
                return;
            }

            if (!(user == this.loc || Map13.GetDistance(this, user) <= 1 && this.loc is Tile))
            {
                return;
            }
            smoke = new EffectSystem_SmokeSpread();
            smoke.set_up(2, user.loc);
            smoke.attach(user);
            smoke.start();
            L = new ByTable();

            foreach (dynamic _b in Lang13.Enumerate(GlobalFuncs.get_area_turfs(thearea.type)))
            {
                T = _b;


                if (!T.density)
                {
                    clear = true;

                    foreach (dynamic _a in Lang13.Enumerate(T, typeof(Obj)))
                    {
                        O = _a;


                        if (O.density)
                        {
                            clear = false;
                            break;
                        }
                    }

                    if (clear)
                    {
                        L.Add(T);
                    }
                }
            }

            if (!(L.len != 0))
            {
                user.WriteMsg("The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry.");
                return;
            }

            if (user != null && user.buckled != null)
            {
                user.buckled.unbuckle_mob();
            }
            tempL   = L.Copy();
            attempt = null;
            success = false;

            while (tempL.len != 0)
            {
                attempt = Rand13.PickFromTable(tempL);
                user.Move(attempt);

                if (GlobalFuncs.get_turf(user) == attempt)
                {
                    success = true;
                    break;
                }
                else
                {
                    tempL.Remove(attempt);
                }
            }

            if (!success)
            {
                user.loc = Rand13.PickFromTable(L);
            }
            smoke.start();
            this.uses -= 1;
            return;
        }
Esempio n. 21
0
        // Function from file: communications.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            dynamic CM         = null;
            Mob     M          = null;
            dynamic I          = null;
            dynamic pda        = null;
            Mob     M2         = null;
            dynamic I2         = null;
            dynamic pda2       = null;
            int     old_level  = 0;
            dynamic title      = null;
            dynamic text       = null;
            string  input      = null;
            string  input2     = null;
            string  input3     = null;
            dynamic title2     = null;
            dynamic text2      = null;
            int     old_level2 = 0;


            if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc))))
            {
                return(null);
            }

            if (this.z > 2)
            {
                Task13.User.WriteMsg("<span class='boldannounce'>Unable to establish a connection</span>: ÿ\"You're too far away from the station!");
                return(null);
            }
            Task13.User.set_machine(this);

            if (!Lang13.Bool(href_list["operation"]))
            {
                return(null);
            }
            CM = this.circuit;

            dynamic _d = href_list["operation"];             // Was a switch-case, sorry for the mess.

            if (_d == "main")
            {
                this.state = GlobalVars.STATE_DEFAULT ?1:0;
            }
            else if (_d == "login")
            {
                M = Task13.User;
                I = M.get_active_hand();

                if (I is Obj_Item_Device_Pda)
                {
                    pda = I;
                    I   = pda.id;
                }

                if (Lang13.Bool(I) && I is Obj_Item_Weapon_Card_Id)
                {
                    if (this.check_access(I))
                    {
                        this.authenticated = 1;
                        this.auth_id       = "" + I.registered_name + " (" + I.assignment + ")";

                        if (Lang13.Bool(I.access.Contains(20)))
                        {
                            this.authenticated = 2;
                        }
                    }

                    if (Lang13.Bool(this.emagged))
                    {
                        this.authenticated = 2;
                        this.auth_id       = "Unknown";
                    }
                }
            }
            else if (_d == "logout")
            {
                this.authenticated = 0;
            }
            else if (_d == "swipeidseclevel")
            {
                M2 = Task13.User;
                I2 = M2.get_active_hand();

                if (I2 is Obj_Item_Device_Pda)
                {
                    pda2 = I2;
                    I2   = pda2.id;
                }

                if (Lang13.Bool(I2) && I2 is Obj_Item_Weapon_Card_Id)
                {
                    if (Lang13.Bool(I2.access.Contains(GlobalVars.access_captain)))
                    {
                        old_level = GlobalVars.security_level;

                        if (!Lang13.Bool(this.tmp_alertlevel))
                        {
                            this.tmp_alertlevel = 0;
                        }

                        if ((this.tmp_alertlevel ?? 0) < 0)
                        {
                            this.tmp_alertlevel = 0;
                        }

                        if ((this.tmp_alertlevel ?? 0) > 1)
                        {
                            this.tmp_alertlevel = 1;
                        }
                        GlobalFuncs.set_security_level(this.tmp_alertlevel);

                        if (GlobalVars.security_level != old_level)
                        {
                            GlobalFuncs.log_game("" + GlobalFuncs.key_name(Task13.User) + " has changed the security level to " + GlobalFuncs.get_security_level() + ".");
                            GlobalFuncs.message_admins("" + GlobalFuncs.key_name_admin(Task13.User) + " has changed the security level to " + GlobalFuncs.get_security_level() + ".");

                            switch ((int)(GlobalVars.security_level))
                            {
                            case 0:
                                GlobalFuncs.feedback_inc("alert_comms_green", 1);
                                break;

                            case 1:
                                GlobalFuncs.feedback_inc("alert_comms_blue", 1);
                                break;
                            }
                        }
                        this.tmp_alertlevel = 0;
                    }
                    else
                    {
                        Task13.User.WriteMsg("<span class='warning'>You are not authorized to do this!</span>");
                        this.tmp_alertlevel = 0;
                    }
                    this.state = GlobalVars.STATE_DEFAULT ?1:0;
                }
                else
                {
                    Task13.User.WriteMsg("<span class='warning'>You need to swipe your ID!</span>");
                }
            }
            else if (_d == "announce")
            {
                if (this.authenticated == 2 && !this.message_cooldown)
                {
                    this.make_announcement(Task13.User);
                }
                else if (this.authenticated == 2 && this.message_cooldown)
                {
                    Task13.User.WriteMsg("Intercomms recharging. Please stand by.");
                }
            }
            else if (_d == "callshuttle")
            {
                this.state = GlobalVars.STATE_DEFAULT ?1:0;

                if (this.authenticated != 0)
                {
                    this.state = GlobalVars.STATE_CALLSHUTTLE;
                }
            }
            else if (_d == "callshuttle2")
            {
                if (this.authenticated != 0)
                {
                    GlobalVars.SSshuttle.requestEvac(Task13.User, href_list["call"]);

                    if (GlobalVars.SSshuttle.emergency.timer != 0)
                    {
                        this.post_status("shuttle");
                    }
                }
                this.state = GlobalVars.STATE_DEFAULT ?1:0;
            }
            else if (_d == "cancelshuttle")
            {
                this.state = GlobalVars.STATE_DEFAULT ?1:0;

                if (this.authenticated != 0)
                {
                    this.state = GlobalVars.STATE_CANCELSHUTTLE;
                }
            }
            else if (_d == "cancelshuttle2")
            {
                if (this.authenticated != 0)
                {
                    GlobalVars.SSshuttle.cancelEvac(Task13.User);
                }
                this.state = GlobalVars.STATE_DEFAULT ?1:0;
            }
            else if (_d == "messagelist")
            {
                this.currmsg = 0;
                this.state   = GlobalVars.STATE_MESSAGELIST;
            }
            else if (_d == "viewmessage")
            {
                this.state = GlobalVars.STATE_VIEWMESSAGE;

                if (!Lang13.Bool(this.currmsg))
                {
                    if (Lang13.Bool(href_list["message-num"]))
                    {
                        this.currmsg = String13.ParseNumber(href_list["message-num"]);
                    }
                    else
                    {
                        this.state = GlobalVars.STATE_MESSAGELIST;
                    }
                }
            }
            else if (_d == "delmessage")
            {
                this.state = (Lang13.Bool(this.currmsg) ? GlobalVars.STATE_DELMESSAGE : GlobalVars.STATE_MESSAGELIST);
            }
            else if (_d == "delmessage2")
            {
                if (this.authenticated != 0)
                {
                    if (Lang13.Bool(this.currmsg))
                    {
                        title = this.messagetitle[this.currmsg];
                        text  = this.messagetext[this.currmsg];
                        this.messagetitle.Remove(title);
                        this.messagetext.Remove(text);

                        if (this.currmsg == this.aicurrmsg)
                        {
                            this.aicurrmsg = 0;
                        }
                        this.currmsg = 0;
                    }
                    this.state = GlobalVars.STATE_MESSAGELIST;
                }
                else
                {
                    this.state = GlobalVars.STATE_VIEWMESSAGE;
                }
            }
            else if (_d == "status")
            {
                this.state = GlobalVars.STATE_STATUSDISPLAY;
            }
            else if (_d == "securitylevel")
            {
                this.tmp_alertlevel = String13.ParseNumber(href_list["newalertlevel"]);

                if (!Lang13.Bool(this.tmp_alertlevel))
                {
                    this.tmp_alertlevel = 0;
                }
                this.state = GlobalVars.STATE_CONFIRM_LEVEL;
            }
            else if (_d == "changeseclevel")
            {
                this.state = GlobalVars.STATE_ALERT_LEVEL;
            }
            else if (_d == "emergencyaccess")
            {
                this.state = GlobalVars.STATE_TOGGLE_EMERGENCY;
            }
            else if (_d == "enableemergency")
            {
                GlobalFuncs.make_maint_all_access();
                GlobalFuncs.log_game("" + GlobalFuncs.key_name(Task13.User) + " enabled emergency maintenance access.");
                GlobalFuncs.message_admins("" + GlobalFuncs.key_name_admin(Task13.User) + " enabled emergency maintenance access.");
                this.state = GlobalVars.STATE_DEFAULT ?1:0;
            }
            else if (_d == "disableemergency")
            {
                GlobalFuncs.revoke_maint_all_access();
                GlobalFuncs.log_game("" + GlobalFuncs.key_name(Task13.User) + " disabled emergency maintenance access.");
                GlobalFuncs.message_admins("" + GlobalFuncs.key_name_admin(Task13.User) + " disabled emergency maintenance access.");
                this.state = GlobalVars.STATE_DEFAULT ?1:0;
            }
            else if (_d == "setstat")
            {
                dynamic _b = href_list["statdisp"];                 // Was a switch-case, sorry for the mess.
                if (_b == "message")
                {
                    this.post_status("message", this.stat_msg1, this.stat_msg2);
                }
                else if (_b == "alert")
                {
                    this.post_status("alert", href_list["alert"]);
                }
                else
                {
                    this.post_status(href_list["statdisp"]);
                }
            }
            else if (_d == "setmsg1")
            {
                this.stat_msg1 = GlobalFuncs.reject_bad_text(Interface13.Input("Line 1", "Enter Message Text", this.stat_msg1, null, null, InputType.Str | InputType.Null), 40);
                this.updateDialog();
            }
            else if (_d == "setmsg2")
            {
                this.stat_msg2 = GlobalFuncs.reject_bad_text(Interface13.Input("Line 2", "Enter Message Text", this.stat_msg2, null, null, InputType.Str | InputType.Null), 40);
                this.updateDialog();
            }
            else if (_d == "MessageCentcomm")
            {
                if (this.authenticated == 2)
                {
                    if (((Obj_Item_Weapon_Circuitboard_Communications)CM).cooldownLeft() != 0)
                    {
                        Task13.User.WriteMsg("Arrays recycling.  Please stand by.");
                        return(null);
                    }
                    input = GlobalFuncs.stripped_input(Task13.User, "Please choose a message to transmit to Centcom via quantum entanglement.  Please be aware that this process is very expensive, and abuse will lead to... termination.  Transmission does not guarantee a response.", "Send a message to Centcomm.", "");

                    if (!Lang13.Bool(input) || !Map13.FetchInView(this, 1).Contains(Task13.User))
                    {
                        return(null);
                    }
                    GlobalFuncs.Centcomm_announce(input, Task13.User);
                    Task13.User.WriteMsg("Message transmitted.");
                    GlobalFuncs.log_say("" + GlobalFuncs.key_name(Task13.User) + " has made a Centcom announcement: " + input);
                    CM.lastTimeUsed = Game13.time;
                }
            }
            else if (_d == "MessageSyndicate")
            {
                if (this.authenticated == 2 && Lang13.Bool(this.emagged))
                {
                    if (((Obj_Item_Weapon_Circuitboard_Communications)CM).cooldownLeft() != 0)
                    {
                        Task13.User.WriteMsg("Arrays recycling.  Please stand by.");
                        return(null);
                    }
                    input2 = GlobalFuncs.stripped_input(Task13.User, "Please choose a message to transmit to [ABNORMAL ROUTING COORDINATES] via quantum entanglement.  Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "Send a message to /??????/.", "");

                    if (!Lang13.Bool(input2) || !Map13.FetchInView(this, 1).Contains(Task13.User))
                    {
                        return(null);
                    }
                    GlobalFuncs.Syndicate_announce(input2, Task13.User);
                    Task13.User.WriteMsg("Message transmitted.");
                    GlobalFuncs.log_say("" + GlobalFuncs.key_name(Task13.User) + " has made a Syndicate announcement: " + input2);
                    CM.lastTimeUsed = Game13.time;
                }
            }
            else if (_d == "RestoreBackup")
            {
                Task13.User.WriteMsg("Backup routing data restored!");
                this.emagged = 0;
                this.updateDialog();
            }
            else if (_d == "nukerequest")
            {
                if (this.authenticated == 2)
                {
                    if (((Obj_Item_Weapon_Circuitboard_Communications)CM).cooldownLeft() != 0)
                    {
                        Task13.User.WriteMsg("Arrays recycling. Please stand by.");
                        return(null);
                    }
                    input3 = GlobalFuncs.stripped_input(Task13.User, "Please enter the reason for requesting the nuclear self-destruct codes. Misuse of the nuclear request system will not be tolerated under any circumstances.  Transmission does not guarantee a response.", "Self Destruct Code Request.", "");

                    if (!Lang13.Bool(input3) || !Map13.FetchInView(this, 1).Contains(Task13.User))
                    {
                        return(null);
                    }
                    GlobalFuncs.Nuke_request(input3, Task13.User);
                    Task13.User.WriteMsg("Request sent.");
                    GlobalFuncs.log_say("" + GlobalFuncs.key_name(Task13.User) + " has requested the nuclear codes from Centcomm");
                    GlobalFuncs.priority_announce("The codes for the on-station nuclear self-destruct have been requested by " + Task13.User + ". Confirmation or denial of this request will be sent shortly.", "Nuclear Self Destruct Codes Requested", "sound/AI/commandreport.ogg");
                    CM.lastTimeUsed = Game13.time;
                }
            }
            else if (_d == "ai-main")
            {
                this.aicurrmsg = 0;
                this.aistate   = GlobalVars.STATE_DEFAULT ?1:0;
            }
            else if (_d == "ai-callshuttle")
            {
                this.aistate = GlobalVars.STATE_CALLSHUTTLE;
            }
            else if (_d == "ai-callshuttle2")
            {
                GlobalVars.SSshuttle.requestEvac(Task13.User, href_list["call"]);
                this.aistate = GlobalVars.STATE_DEFAULT ?1:0;
            }
            else if (_d == "ai-messagelist")
            {
                this.aicurrmsg = 0;
                this.aistate   = GlobalVars.STATE_MESSAGELIST;
            }
            else if (_d == "ai-viewmessage")
            {
                this.aistate = GlobalVars.STATE_VIEWMESSAGE;

                if (!Lang13.Bool(this.aicurrmsg))
                {
                    if (Lang13.Bool(href_list["message-num"]))
                    {
                        this.aicurrmsg = String13.ParseNumber(href_list["message-num"]);
                    }
                    else
                    {
                        this.aistate = GlobalVars.STATE_MESSAGELIST;
                    }
                }
            }
            else if (_d == "ai-delmessage")
            {
                this.aistate = (Lang13.Bool(this.aicurrmsg) ? GlobalVars.STATE_DELMESSAGE : GlobalVars.STATE_MESSAGELIST);
            }
            else if (_d == "ai-delmessage2")
            {
                if (Lang13.Bool(this.aicurrmsg))
                {
                    title2 = this.messagetitle[this.aicurrmsg];
                    text2  = this.messagetext[this.aicurrmsg];
                    this.messagetitle.Remove(title2);
                    this.messagetext.Remove(text2);

                    if (this.currmsg == this.aicurrmsg)
                    {
                        this.currmsg = 0;
                    }
                    this.aicurrmsg = 0;
                }
                this.aistate = GlobalVars.STATE_MESSAGELIST;
            }
            else if (_d == "ai-status")
            {
                this.aistate = GlobalVars.STATE_STATUSDISPLAY;
            }
            else if (_d == "ai-announce")
            {
                if (!this.ai_message_cooldown)
                {
                    this.make_announcement(Task13.User, true);
                }
            }
            else if (_d == "ai-securitylevel")
            {
                this.tmp_alertlevel = String13.ParseNumber(href_list["newalertlevel"]);

                if (!Lang13.Bool(this.tmp_alertlevel))
                {
                    this.tmp_alertlevel = 0;
                }
                old_level2 = GlobalVars.security_level;

                if (!Lang13.Bool(this.tmp_alertlevel))
                {
                    this.tmp_alertlevel = 0;
                }

                if ((this.tmp_alertlevel ?? 0) < 0)
                {
                    this.tmp_alertlevel = 0;
                }

                if ((this.tmp_alertlevel ?? 0) > 1)
                {
                    this.tmp_alertlevel = 1;
                }
                GlobalFuncs.set_security_level(this.tmp_alertlevel);

                if (GlobalVars.security_level != old_level2)
                {
                    GlobalFuncs.log_game("" + GlobalFuncs.key_name(Task13.User) + " has changed the security level to " + GlobalFuncs.get_security_level() + ".");
                    GlobalFuncs.message_admins("" + GlobalFuncs.key_name_admin(Task13.User) + " has changed the security level to " + GlobalFuncs.get_security_level() + ".");

                    switch ((int)(GlobalVars.security_level))
                    {
                    case 0:
                        GlobalFuncs.feedback_inc("alert_comms_green", 1);
                        break;

                    case 1:
                        GlobalFuncs.feedback_inc("alert_comms_blue", 1);
                        break;
                    }
                }
                this.tmp_alertlevel = 0;
                this.aistate        = GlobalVars.STATE_DEFAULT ?1:0;
            }
            else if (_d == "ai-changeseclevel")
            {
                this.aistate = GlobalVars.STATE_ALERT_LEVEL;
            }
            else if (_d == "ai-emergencyaccess")
            {
                this.aistate = GlobalVars.STATE_TOGGLE_EMERGENCY;
            }
            else if (_d == "ai-enableemergency")
            {
                GlobalFuncs.make_maint_all_access();
                GlobalFuncs.log_game("" + GlobalFuncs.key_name(Task13.User) + " enabled emergency maintenance access.");
                GlobalFuncs.message_admins("" + GlobalFuncs.key_name_admin(Task13.User) + " enabled emergency maintenance access.");
                this.aistate = GlobalVars.STATE_DEFAULT ?1:0;
            }
            else if (_d == "ai-disableemergency")
            {
                GlobalFuncs.revoke_maint_all_access();
                GlobalFuncs.log_game("" + GlobalFuncs.key_name(Task13.User) + " disabled emergency maintenance access.");
                GlobalFuncs.message_admins("" + GlobalFuncs.key_name_admin(Task13.User) + " disabled emergency maintenance access.");
                this.aistate = GlobalVars.STATE_DEFAULT ?1:0;
            }
            this.updateUsrDialog();
            return(null);
        }
Esempio n. 22
0
        // Function from file: cult_items.dm
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            dynamic T    = null;
            dynamic cult = null;
            Obj_Structure_Constructshell_Large S = null;
            dynamic A = null;


            if (!GlobalFuncs.iscultist(user))
            {
                return(base.attack_self((object)(user), (object)(flag), emp));
            }

            if (GlobalVars.ticker.mode.name != "cult")
            {
                return(null);
            }
            T = GlobalFuncs.get_turf(user);

            if (Lang13.Bool(T.z) != true)
            {
                user.WriteMsg("<span class='cultlarge'>You shouldn't do this here. Go back.</span>");
                return(null);
            }
            cult = GlobalVars.ticker.mode;

            if (!(cult.attempts_left != 0))
            {
                user.WriteMsg("<span class='notice'>You attempt to call out to the Geometer, but there is no answer...</span>");
                return(null);
            }

            if (cult.eldergod)
            {
                user.WriteMsg("<span class='cultlarge>The Geometer is already among us.</span>");
                return(null);
            }

            if (cult.large_shell_reference != null)
            {
                S = cult.large_shell_reference;

                if (Lang13.Bool(S.anchored))
                {
                    A = GlobalFuncs.get_area(S);
                    user.WriteMsg("<span class='cult'>The Geometer has already started manifesting in " + Lang13.Initial(A, "name") + ". You can no longer move Her shell.</span>");
                    return(null);
                }

                switch ((string)(Interface13.Alert(user, "The Geometer's shell has already been manifested. Do you wish to summon it to your location?", "Summoning Large Shell", "Yes", "No")))
                {
                case "Yes":
                    S.visible_message("<span class='cultlarge'>The shell suddenly vanishes.</span>");
                    S.loc = user.loc;
                    break;
                }
            }
            else
            {
                switch ((string)(Interface13.Alert(user, "Are you sure you wish to summon the large construct shell? " + cult.attempts_left + " attempts left!", "Summoning Large Shell", "Yes", "No")))
                {
                case "Yes":
                    cult.attempts_left--;
                    this.place_down_large_shell(user);
                    GlobalFuncs.qdel(this);
                    break;
                }
            }
            return(null);
        }
Esempio n. 23
0
        // Function from file: money_bag.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            int amt_gold           = 0;
            int amt_silver         = 0;
            int amt_diamond        = 0;
            int amt_iron           = 0;
            int amt_plasma         = 0;
            int amt_uranium        = 0;
            int amt_clown          = 0;
            int amt_adamantine     = 0;
            Obj_Item_Weapon_Coin C = null;
            string dat             = null;

            amt_gold       = 0;
            amt_silver     = 0;
            amt_diamond    = 0;
            amt_iron       = 0;
            amt_plasma     = 0;
            amt_uranium    = 0;
            amt_clown      = 0;
            amt_adamantine = 0;

            foreach (dynamic _a in Lang13.Enumerate(this.contents, typeof(Obj_Item_Weapon_Coin)))
            {
                C = _a;


                if (C is Obj_Item_Weapon_Coin_Diamond)
                {
                    amt_diamond++;
                }

                if (C is Obj_Item_Weapon_Coin_Plasma)
                {
                    amt_plasma++;
                }

                if (C is Obj_Item_Weapon_Coin_Iron)
                {
                    amt_iron++;
                }

                if (C is Obj_Item_Weapon_Coin_Silver)
                {
                    amt_silver++;
                }

                if (C is Obj_Item_Weapon_Coin_Gold)
                {
                    amt_gold++;
                }

                if (C is Obj_Item_Weapon_Coin_Uranium)
                {
                    amt_uranium++;
                }

                if (C is Obj_Item_Weapon_Coin_Clown)
                {
                    amt_clown++;
                }

                if (C is Obj_Item_Weapon_Coin_Adamantine)
                {
                    amt_adamantine++;
                }
            }
            dat = "<b>The contents of the moneybag reveal...</b><br>";

            if (amt_gold != 0)
            {
                dat += new Txt("Gold coins: ").item(amt_gold).str(" <A href='?src=").Ref(this).str(";remove=gold'>Remove one</A><br>").ToString();
            }

            if (amt_silver != 0)
            {
                dat += new Txt("Silver coins: ").item(amt_silver).str(" <A href='?src=").Ref(this).str(";remove=silver'>Remove one</A><br>").ToString();
            }

            if (amt_iron != 0)
            {
                dat += new Txt("Metal coins: ").item(amt_iron).str(" <A href='?src=").Ref(this).str(";remove=iron'>Remove one</A><br>").ToString();
            }

            if (amt_diamond != 0)
            {
                dat += new Txt("Diamond coins: ").item(amt_diamond).str(" <A href='?src=").Ref(this).str(";remove=diamond'>Remove one</A><br>").ToString();
            }

            if (amt_plasma != 0)
            {
                dat += new Txt("Plasma coins: ").item(amt_plasma).str(" <A href='?src=").Ref(this).str(";remove=plasma'>Remove one</A><br>").ToString();
            }

            if (amt_uranium != 0)
            {
                dat += new Txt("Uranium coins: ").item(amt_uranium).str(" <A href='?src=").Ref(this).str(";remove=uranium'>Remove one</A><br>").ToString();
            }

            if (amt_clown != 0)
            {
                dat += new Txt("Bananium coins: ").item(amt_clown).str(" <A href='?src=").Ref(this).str(";remove=clown'>Remove one</A><br>").ToString();
            }

            if (amt_adamantine != 0)
            {
                dat += new Txt("Adamantine coins: ").item(amt_adamantine).str(" <A href='?src=").Ref(this).str(";remove=adamantine'>Remove one</A><br>").ToString();
            }
            Interface13.Browse(a, "" + dat, "window=moneybag");
            return(null);
        }
Esempio n. 24
0
        // Function from file: robot_parts.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            Mob     living_user  = null;
            dynamic item_in_hand = null;
            string  new_name     = null;


            if (Lang13.Bool(Task13.User.lying) || Task13.User.stat != 0 || Task13.User.stunned != 0 || !this.Adjacent(Task13.User))
            {
                return(null);
            }
            living_user  = Task13.User;
            item_in_hand = living_user.get_active_hand();

            if (!(item_in_hand is Obj_Item_Device_Multitool))
            {
                living_user.WriteMsg("<span class='warning'>You need a multitool!</span>");
                return(null);
            }

            if (Lang13.Bool(href_list["Name"]))
            {
                new_name = GlobalFuncs.reject_bad_name(Interface13.Input(Task13.User, "Enter new designation. Set to blank to reset to default.", "Cyborg Debug", this.created_name, null, InputType.Any), true);

                if (!(Map13.GetDistance(this, Task13.User) <= 1) && this.loc != Task13.User)
                {
                    return(null);
                }

                if (Lang13.Bool(new_name))
                {
                    this.created_name = new_name;
                }
                else
                {
                    this.created_name = "";
                }
            }
            else if (Lang13.Bool(href_list["Master"]))
            {
                this.forced_ai = GlobalFuncs.select_active_ai(Task13.User);

                if (!Lang13.Bool(this.forced_ai))
                {
                    Task13.User.WriteMsg("<span class='error'>No active AIs detected.</span>");
                }
            }
            else if (Lang13.Bool(href_list["Law"]))
            {
                this.lawsync = !this.lawsync;
            }
            else if (Lang13.Bool(href_list["AI"]))
            {
                this.aisync = !this.aisync;
            }
            else if (Lang13.Bool(href_list["Loco"]))
            {
                this.locomotion = !this.locomotion;
            }
            else if (Lang13.Bool(href_list["Panel"]))
            {
                this.panel_locked = !this.panel_locked;
            }
            this.add_fingerprint(Task13.User);
            this.Interact(Task13.User);
            return(null);
        }
Esempio n. 25
0
        // Function from file: lib_items.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            dynamic         choice         = null;
            dynamic         newtitle       = null;
            string          content        = null;
            string          newauthor      = null;
            dynamic         scanner        = null;
            Borrowbook      b              = null;
            Obj_Item_Weapon book           = null;
            Obj_Item_Weapon_Storage_Book B = null;


            if (A is Obj_Item_Weapon_Pen)
            {
                if (GlobalFuncs.is_blind(user) != 0)
                {
                    return(null);
                }

                if (this.unique)
                {
                    user.WriteMsg("<span class='warning'>These pages don't seem to take the ink well! Looks like you can't modify it.</span>");
                    return(null);
                }
                choice = Interface13.Input("What would you like to change?", null, null, null, new ByTable(new object [] { "Title", "Contents", "Author", "Cancel" }), InputType.Any);

                dynamic _a = choice;                 // Was a switch-case, sorry for the mess.
                if (_a == "Title")
                {
                    newtitle = GlobalFuncs.reject_bad_text(GlobalFuncs.stripped_input(Task13.User, "Write a new title:"));

                    if (!Lang13.Bool(newtitle))
                    {
                        Task13.User.WriteMsg("The title is invalid.");
                        return(null);
                    }
                    else
                    {
                        this.name  = newtitle;
                        this.title = newtitle;
                    }
                }
                else if (_a == "Contents")
                {
                    content = GlobalFuncs.stripped_input(Task13.User, "Write your book's contents (HTML NOT allowed):", "", "", 8192);

                    if (!Lang13.Bool(content))
                    {
                        Task13.User.WriteMsg("The content is invalid.");
                        return(null);
                    }
                    else
                    {
                        this.dat += content;
                    }
                }
                else if (_a == "Author")
                {
                    newauthor = GlobalFuncs.stripped_input(Task13.User, "Write the author's name:");

                    if (!Lang13.Bool(newauthor))
                    {
                        Task13.User.WriteMsg("The name is invalid.");
                        return(null);
                    }
                    else
                    {
                        this.author = newauthor;
                    }
                }
                else
                {
                    return(null);
                }
            }
            else if (A is Obj_Item_Weapon_Barcodescanner)
            {
                scanner = A;

                if (!Lang13.Bool(scanner.computer))
                {
                    user.WriteMsg("" + A + "'s screen flashes: 'No associated computer found!'");
                }
                else
                {
                    dynamic _d = scanner.mode;                     // Was a switch-case, sorry for the mess.
                    if (_d == 0)
                    {
                        scanner.book = this;
                        user.WriteMsg("" + A + "'s screen flashes: 'Book stored in buffer.'");
                    }
                    else if (_d == 1)
                    {
                        scanner.book = this;
                        scanner.computer.buffer_book = this.name;
                        user.WriteMsg("" + A + "'s screen flashes: 'Book stored in buffer. Book title stored in associated computer buffer.'");
                    }
                    else if (_d == 2)
                    {
                        scanner.book = this;

                        foreach (dynamic _b in Lang13.Enumerate(scanner.computer.checkouts, typeof(Borrowbook)))
                        {
                            b = _b;


                            if (b.bookname == this.name)
                            {
                                scanner.computer.checkouts.Remove(b);
                                user.WriteMsg("" + A + "'s screen flashes: 'Book stored in buffer. Book has been checked in.'");
                                return(null);
                            }
                        }
                        user.WriteMsg("" + A + "'s screen flashes: 'Book stored in buffer. No active check-out record found for current title.'");
                    }
                    else if (_d == 3)
                    {
                        scanner.book = this;

                        foreach (dynamic _c in Lang13.Enumerate(scanner.computer.inventory, typeof(Obj_Item_Weapon)))
                        {
                            book = _c;


                            if (book == this)
                            {
                                user.WriteMsg("" + A + "'s screen flashes: 'Book stored in buffer. Title already present in inventory, aborting to avoid duplicate entry.'");
                                return(null);
                            }
                        }
                        scanner.computer.inventory.Add(this);
                        user.WriteMsg("" + A + "'s screen flashes: 'Book stored in buffer. Title added to general inventory.'");
                    }
                }
            }
            else if (A is Obj_Item_Weapon_Kitchen_Knife || A is Obj_Item_Weapon_Wirecutters)
            {
                user.WriteMsg("<span class='notice'>You begin to carve out " + this.title + "...</span>");

                if (GlobalFuncs.do_after(user, 30, null, this))
                {
                    user.WriteMsg("<span class='notice'>You carve out the pages from " + this.title + "! You didn't want to read it anyway.</span>");
                    B            = new Obj_Item_Weapon_Storage_Book();
                    B.name       = this.name;
                    B.title      = this.title;
                    B.icon_state = this.icon_state;

                    if (user.l_hand == this || user.r_hand == this)
                    {
                        GlobalFuncs.qdel(this);
                        ((Mob)user).put_in_hands(B);
                        return(null);
                    }
                    else
                    {
                        B.loc = this.loc;
                        GlobalFuncs.qdel(this);
                        return(null);
                    }
                }
                return(null);
            }
            else
            {
                base.attackby((object)(A), (object)(user), _params, silent, replace_spent);
            }
            return(null);
        }
Esempio n. 26
0
        // Function from file: photography.dm
        public void borgprint(  )
        {
            ByTable    nametemp  = null;
            dynamic    find      = null;
            Picture    selection = null;
            Ent_Static C         = null;
            Obj_Item_Device_Camera_Siliconcam targetcam = null;
            Picture t = null;
            Picture q = null;
            Obj_Item_Weapon_Photo p = null;

            nametemp  = new ByTable();
            C         = this.loc;
            targetcam = null;

            if (Convert.ToDouble(((dynamic)C).toner) < 20)
            {
                Task13.User.WriteMsg("Insufficent toner to print image.");
                return;
            }

            if (Lang13.Bool(((dynamic)C).connected_ai))
            {
                targetcam = ((dynamic)C).connected_ai.aicamera;
            }
            else
            {
                targetcam = ((dynamic)C).aicamera;
            }

            if (targetcam.aipictures.len == 0)
            {
                Task13.User.WriteMsg("<span class='userdanger'>No images saved</span>");
                return;
            }

            foreach (dynamic _a in Lang13.Enumerate(targetcam.aipictures, typeof(Picture)))
            {
                t = _a;

                nametemp.Add(t.fields["name"]);
            }
            find = Interface13.Input("Select image (numbered in order taken)", null, null, null, nametemp, InputType.Any);

            foreach (dynamic _b in Lang13.Enumerate(targetcam.aipictures, typeof(Picture)))
            {
                q = _b;


                if (q.fields["name"] == find)
                {
                    selection = q;
                    break;
                }
            }
            p = new Obj_Item_Weapon_Photo(C.loc);
            p.photocreate(selection.fields["icon"], selection.fields["img"], selection.fields["desc"], selection.fields["blueprints"]);
            p.pixel_x           = Rand13.Int(-10, 10);
            p.pixel_y           = Rand13.Int(-10, 10);
            ((dynamic)C).toner -= 20;
            this.visible_message("" + C.name + " spits out a photograph from a narrow slot on it's chassis.");
            Task13.User.WriteMsg("<span class='notice'>You print a photograph.</span>");
            return;
        }
Esempio n. 27
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);
        }
Esempio n. 28
0
        // Function from file: runes.dm
        public override void invoke(dynamic user = null)
        {
            ByTable potential_runes         = null;
            Obj_Effect_Rune_TeleportOther T = null;
            dynamic    selected_rune        = null;
            dynamic    target  = null;
            ByTable    targets = null;
            Mob_Living L       = null;

            potential_runes = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.teleport_other_runes, typeof(Obj_Effect_Rune_TeleportOther)))
            {
                T = _a;


                if (T.keyword == this.keyword && T != this && T.z <= 7)
                {
                    potential_runes.Add(T);
                }
            }

            if (!(potential_runes.len != 0))
            {
                user.WriteMsg("<span class='warning'>There are no runes with the same keyword!</span>");
                this.fail_invoke();
                GlobalFuncs.log_game("Teleport Other rune failed - no candidates with matching keyword");
                return;
            }

            if (Convert.ToDouble(user.z) > 7)
            {
                user.WriteMsg("<span class='cultitalic'>You are not in the right dimension!</span>");
                this.fail_invoke();
                GlobalFuncs.log_game("Teleport rune failed - user in away mission");
                return;
            }
            selected_rune = Rand13.PickFromTable(potential_runes);
            target        = null;
            targets       = new ByTable();

            foreach (dynamic _b in Lang13.Enumerate(GlobalFuncs.get_turf(this), typeof(Mob_Living)))
            {
                L = _b;


                if (L != user)
                {
                    targets.Add(L);
                }
            }

            if (!(targets.len != 0))
            {
                user.WriteMsg("<span class='warning'>There are no targets standing on the rune!</span>");
                this.fail_invoke();
                GlobalFuncs.log_game("Teleport Other rune failed - no targets on rune");
                return;
            }

            if (targets.len > 1)
            {
                target = Interface13.Input(user, "Choose a person to teleport.", "Rite of Forced Translocation", null, targets - user, InputType.Null | InputType.Any);

                if (!this.Adjacent(user) || !(this != null) || Lang13.Bool(GlobalFuncs.qdeleted(this)) || ((Mob)user).incapacitated())
                {
                    return;
                }

                if (!Lang13.Bool(target))
                {
                    this.fail_invoke();
                    return;
                }
            }
            else
            {
                target = targets[targets.len];
            }
            ((Ent_Static)target).visible_message("<span class='warning'>" + target + " vanishes in a flash of red light!</span>", "<span class='cult'>Your vision blurs, and you suddenly appear somewhere else.</span>");
            ((Ent_Dynamic)target).forceMove(GlobalFuncs.get_turf(selected_rune));
            return;
        }
Esempio n. 29
0
        // Function from file: canister.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            dynamic label       = null;
            dynamic newtype     = null;
            dynamic replacement = null;
            dynamic pressure    = null;
            string  logmsg      = null;
            dynamic plasma      = null;
            dynamic n2o         = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)))
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "relabel":
                label = Interface13.Input("New canister label:", this.name, null, null, GlobalVars.label2types, InputType.Null | InputType.Any);

                if (Lang13.Bool(label) && !Lang13.Bool(base.ui_act(action, _params, ui, state)))
                {
                    newtype = GlobalVars.label2types[label];

                    if (Lang13.Bool(newtype))
                    {
                        replacement = Lang13.Call(newtype, this.loc, this.air_contents);
                        replacement.interact(Task13.User);
                        GlobalFuncs.qdel(this);
                    }
                }
                break;

            case "pressure":
                pressure = _params["pressure"];

                if (pressure == "reset")
                {
                    pressure = 101.32499694824219;
                    _default = GlobalVars.TRUE;
                }
                else if (pressure == "min")
                {
                    pressure = 10.132499694824219;
                    _default = GlobalVars.TRUE;
                }
                else if (pressure == "max")
                {
                    pressure = 1013.25;
                    _default = GlobalVars.TRUE;
                }
                else if (pressure == "input")
                {
                    pressure = Interface13.Input("New release pressure (" + 10.132499694824219 + "-" + 1013.25 + " kPa):", this.name, this.release_pressure, null, null, InputType.Num | InputType.Null);

                    if (!(pressure == null) && !Lang13.Bool(base.ui_act(action, _params, ui, state)))
                    {
                        _default = GlobalVars.TRUE;
                    }
                }
                else if (String13.ParseNumber(pressure) != null)
                {
                    pressure = String13.ParseNumber(pressure);
                    _default = GlobalVars.TRUE;
                }

                if (Lang13.Bool(_default))
                {
                    this.release_pressure = Num13.MaxInt(((int)(10.132499694824219)), Num13.MinInt(Num13.Floor(Convert.ToDouble(pressure)), ((int)(1013.25))));
                    this.investigate_log("was set to " + this.release_pressure + " kPa by " + GlobalFuncs.key_name(Task13.User) + ".", "atmos");
                }
                break;

            case "valve":
                logmsg          = null;
                this.valve_open = !this.valve_open;

                if (this.valve_open)
                {
                    logmsg = new Txt("Valve was <b>opened</b> by ").item(GlobalFuncs.key_name(Task13.User)).str(", starting a transfer into ").the(Lang13.Bool(this.holding) || Lang13.Bool("air")).item().str(".<br>").ToString();

                    if (!Lang13.Bool(this.holding))
                    {
                        plasma = this.air_contents.gases["plasma"];
                        n2o    = this.air_contents.gases["n2o"];

                        if (Lang13.Bool(n2o) || Lang13.Bool(plasma))
                        {
                            GlobalFuncs.message_admins(new Txt().item(GlobalFuncs.key_name_admin(Task13.User)).str(" (<A HREF='?_src_=holder;adminmoreinfo=").Ref(Task13.User).str("'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=").Ref(Task13.User).str("'>FLW</A>) opened a canister that contains ").item((Lang13.Bool(n2o) ? "N2O" : "")).item((Lang13.Bool(n2o) && Lang13.Bool(plasma) ? " & " : "")).item((Lang13.Bool(plasma) ? "Plasma" : "")).str("! (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=").item(this.x).str(";Y=").item(this.y).str(";Z=").item(this.z).str("'>JMP</a>)").ToString());
                            GlobalFuncs.log_admin("" + GlobalFuncs.key_name(Task13.User) + " opened a canister that contains " + (Lang13.Bool(n2o) ? "N2O" : "") + (Lang13.Bool(n2o) && Lang13.Bool(plasma) ? " & " : "") + (Lang13.Bool(plasma) ? "Plasma" : "") + " at " + this.x + ", " + this.y + ", " + this.z);
                        }
                    }
                }
                else
                {
                    logmsg = new Txt("Valve was <b>closed</b> by ").item(GlobalFuncs.key_name(Task13.User)).str(", stopping the transfer into ").the(Lang13.Bool(this.holding) || Lang13.Bool("air")).item().str(".<br>").ToString();
                }
                this.investigate_log(logmsg, "atmos");
                this.release_log += logmsg;
                _default          = GlobalVars.TRUE;
                break;

            case "eject":

                if (Lang13.Bool(this.holding))
                {
                    if (this.valve_open)
                    {
                        this.investigate_log("" + GlobalFuncs.key_name(Task13.User) + " removed the " + this.holding + ", leaving the valve open and transfering into the <span class='boldannounce'>air</span><br>", "atmos");
                    }
                    this.holding.loc = GlobalFuncs.get_turf(this);
                    this.holding     = null;
                    _default         = GlobalVars.TRUE;
                }
                break;
            }
            this.update_icon();
            return(_default);
        }
Esempio n. 30
0
        // Function from file: navbeacon.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            string  newloc   = null;
            dynamic codekey  = null;
            string  newkey   = null;
            dynamic codeval  = null;
            string  newval   = null;
            dynamic codekey2 = null;
            string  newkey2  = null;
            string  newval2  = null;


            if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc))))
            {
                return(null);
            }

            if (this.open && !this.locked)
            {
                Task13.User.set_machine(this);

                if (Lang13.Bool(href_list["locedit"]))
                {
                    newloc = String13.SubStr(GlobalFuncs.sanitize(Interface13.Input("Enter New Location", "Navigation Beacon", this.location, null, null, InputType.Str | InputType.Null)), 1, 1024);

                    if (Lang13.Bool(newloc))
                    {
                        this.location = newloc;
                        this.updateDialog();
                    }
                }
                else if (Lang13.Bool(href_list["edit"]))
                {
                    codekey = href_list["code"];
                    newkey  = GlobalFuncs.stripped_input(Task13.User, "Enter Transponder Code Key", "Navigation Beacon", codekey);

                    if (!Lang13.Bool(newkey))
                    {
                        return(null);
                    }
                    codeval = this.codes[codekey];
                    newval  = GlobalFuncs.stripped_input(Task13.User, "Enter Transponder Code Value", "Navigation Beacon", codeval);

                    if (!Lang13.Bool(newval))
                    {
                        newval = codekey;
                        return(null);
                    }
                    this.codes.Remove(codekey);
                    this.codes[newkey] = newval;
                    this.updateDialog();
                }
                else if (Lang13.Bool(href_list["delete"]))
                {
                    codekey2 = href_list["code"];
                    this.codes.Remove(codekey2);
                    this.updateDialog();
                }
                else if (Lang13.Bool(href_list["add"]))
                {
                    newkey2 = GlobalFuncs.stripped_input(Task13.User, "Enter New Transponder Code Key", "Navigation Beacon");

                    if (!Lang13.Bool(newkey2))
                    {
                        return(null);
                    }
                    newval2 = GlobalFuncs.stripped_input(Task13.User, "Enter New Transponder Code Value", "Navigation Beacon");

                    if (!Lang13.Bool(newval2))
                    {
                        newval2 = "1";
                        return(null);
                    }

                    if (!(this.codes != null))
                    {
                        this.codes = new ByTable();
                    }
                    this.codes[newkey2] = newval2;
                    this.updateDialog();
                }
            }
            return(null);
        }