Beispiel #1
0
        // Function from file: holidays.dm
        public virtual string getStationPrefix(  )
        {
            int i = 0;

            i = String13.FindIgnoreCase(this.name, " ", 1, 0);
            return(String13.SubStr(this.name, 1, i));
        }
Beispiel #2
0
        // Function from file: god.dm
        public void god_speak(dynamic msg = null)
        {
            string  rendered = null;
            dynamic M        = null;

            GlobalFuncs.log_say("Hand of God: " + GlobalFuncs.capitalize(this.side) + " God/" + GlobalFuncs.key_name(this) + " : " + msg);
            msg = GlobalFuncs.trim(String13.SubStr(GlobalFuncs.sanitize(msg), 1, 1024));

            if (!Lang13.Bool(msg))
            {
                return;
            }
            msg      = this.say_quote(msg, this.get_spans());
            rendered = "<font color='#045FB4'><i><span class='game say'>Divine Telepathy, <span class='name'>" + this.name + "</span> <span class='message'>" + msg + "</span></span></i></font>";

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


                if (this.is_handofgod_myprophet(M) || M is Mob_Dead_Observer)
                {
                    M.show_message(rendered, 2);
                }
            }
            this.WriteMsg(rendered);
            return;
        }
Beispiel #3
0
        // Function from file: xenobiology.dm
        public override bool attack(dynamic M = null, dynamic user = null, bool?def_zone = null)
        {
            string newname = null;


            if (!(M is Mob_Living_SimpleAnimal_Slime))
            {
                user.WriteMsg("<span class='warning'>The potion only works on slimes!</span>");
                return(base.attack((object)(M), (object)(user), def_zone));
            }

            if (Lang13.Bool(M.stat))
            {
                user.WriteMsg("<span class='warning'>The slime is dead!</span>");
                return(base.attack((object)(M), (object)(user), def_zone));
            }
            M.docile    = true;
            M.nutrition = 700;
            M.WriteMsg("<span class='warning'>You absorb the potion and feel your intense desire to feed melt away.</span>");
            user.WriteMsg("<span class='notice'>You feed the slime the potion, removing its hunger and calming it.</span>");
            newname = String13.SubStr(GlobalFuncs.sanitize(Interface13.Input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime", null, InputType.Str | InputType.Null)), 1, 26);

            if (!Lang13.Bool(newname))
            {
                newname = "pet slime";
            }
            M.name      = newname;
            M.real_name = newname;
            GlobalFuncs.qdel(this);
            return(false);
        }
Beispiel #4
0
        // Function from file: cable.dm
        public Obj_Structure_Cable(dynamic loc = null) : base((object)(loc))
        {
            int        dash = 0;
            Ent_Static T    = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            dash    = String13.FindIgnoreCase(this.icon_state, "-", 1, 0);
            this.d1 = String13.ParseNumber(String13.SubStr(this.icon_state, 1, dash));
            this.d2 = String13.ParseNumber(String13.SubStr(this.icon_state, dash + 1, 0));
            T       = this.loc;

            if (this.level == 1)
            {
                this.hide(Lang13.Bool(((dynamic)T).intact));
            }
            GlobalVars.cable_list.Add(this);

            if (Lang13.Bool(this.d1))
            {
                this.stored = new Obj_Item_Stack_CableCoil(null, 2, this.cable_color);
            }
            else
            {
                this.stored = new Obj_Item_Stack_CableCoil(null, 1, this.cable_color);
            }
            return;
        }
Beispiel #5
0
        // Function from file: say.dm
        public override bool say(dynamic message = null, string bubble_type = null)
        {
            bool _default = false;

            message = GlobalFuncs.trim(String13.SubStr(GlobalFuncs.sanitize(message), 1, 1024));

            if (!Lang13.Bool(message))
            {
                return(_default);
            }
            GlobalFuncs.log_say("Ghost/" + this.key + " : " + message);

            if (this.client != null)
            {
                if ((this.client.prefs.muted & 16) != 0)
                {
                    this.WriteMsg("<span class='danger'>You cannot talk in deadchat (muted).</span>");
                    return(_default);
                }

                if (this.client.handle_spam_prevention(message, 16))
                {
                    return(_default);
                }
            }
            _default = this.say_dead(message) != null;
            return(_default);
        }
Beispiel #6
0
        // Function from file: overmind.dm
        public void blob_talk(dynamic message = null)
        {
            string  message_a = null;
            string  rendered  = null;
            dynamic M         = null;

            GlobalFuncs.log_say("" + GlobalFuncs.key_name(this) + " : " + message);
            message = GlobalFuncs.trim(String13.SubStr(GlobalFuncs.sanitize(message), 1, 1024));

            if (!Lang13.Bool(message))
            {
                return;
            }
            message_a = this.say_quote(message, this.get_spans());
            rendered  = "<span class='big'><font color=\"#EE4000\"><b>[Blob Telepathy] " + this.name + "(<font color=\"" + this.blob_reagent_datum.color + "\">" + this.blob_reagent_datum.name + "</font>)</b> " + message_a + "</font></span>";

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


                if (M is Mob_Camera_Blob || M is Mob_Living_SimpleAnimal_Hostile_Blob)
                {
                    M.WriteMsg(rendered);
                }

                if (M is Mob_Dead_Observer)
                {
                    M.WriteMsg(new Txt("<a href='?src=").Ref(M).str(";follow=").Ref(this).str("'>(F)</a> ").item(rendered).ToString());
                }
            }
            return;
        }
Beispiel #7
0
        // Function from file: say.dm
        public virtual string say_quote(dynamic input = null, dynamic spans = null)
        {
            spans = spans ?? new ByTable();

            string ending = null;


            if (!Lang13.Bool(input))
            {
                return("says, \"...\"");
            }
            ending = String13.SubStr(input, Lang13.Length(input), 0);

            if (String13.SubStr(input, Lang13.Length(input) - 1, 0) == "!!")
            {
                spans |= "yell";
                return("" + this.verb_yell + ", \"" + GlobalFuncs.attach_spans(input, spans) + "\"");
            }
            input = GlobalFuncs.attach_spans(input, spans);

            if (ending == "?")
            {
                return("" + this.verb_ask + ", \"" + input + "\"");
            }

            if (ending == "!")
            {
                return("" + this.verb_exclaim + ", \"" + input + "\"");
            }
            return("" + this.verb_say + ", \"" + input + "\"");
        }
        // Function from file: folders.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            string n_name = null;


            if (A is Obj_Item_Weapon_Paper || A is Obj_Item_Weapon_Photo || A is Obj_Item_Documents)
            {
                if (!((Mob)user).unEquip(A))
                {
                    return(null);
                }
                A.loc = this;
                user.WriteMsg("<span class='notice'>You put " + A + " into " + this + ".</span>");
                this.update_icon();
            }
            else if (A is Obj_Item_Weapon_Pen)
            {
                n_name = String13.SubStr(GlobalFuncs.sanitize(Interface13.Input(user, "What would you like to label the folder?", "Folder Labelling", null, null, InputType.Str)), 1, 26);

                if (Map13.GetDistance(this, user) <= 1 && Lang13.Bool(user.stat) == false)
                {
                    this.name = "folder" + (Lang13.Bool(n_name) ? "- '" + n_name + "'" : null);
                }
            }
            return(null);
        }
Beispiel #9
0
        public bool reenter_corpse(  )
        {
            if (!(this.client != null))
            {
                return(false);
            }

            if (!(this.mind != null && Lang13.Bool(this.mind.current)))
            {
                this.WriteMsg("<span class='warning'>You have no body.</span>");
                return(false);
            }

            if (!(this.can_reenter_corpse == true))
            {
                this.WriteMsg("<span class='warning'>You cannot re-enter your body.</span>");
                return(false);
            }

            if (Lang13.Bool(this.mind.current.key) && String13.SubStr(this.mind.current.key, 1, 2) != "@")
            {
                Task13.User.WriteMsg("<span class='warning'>Another consciousness is in your body...It is resisting you.</span>");
                return(false);
            }
            GlobalVars.SStgui.on_transfer(this, this.mind.current);
            this.mind.current.key = this.key;
            return(true);
        }
        // Function from file: boxing.dm
        public override dynamic speechModification(dynamic message = null)
        {
            if (String13.SubStr(message, 1, 2) != "*")
            {
                message = GlobalFuncs.replacetext(message, "captain", "CAPITÁN");
                message = GlobalFuncs.replacetext(message, "station", "ESTACIÓN");
                message = GlobalFuncs.replacetext(message, "sir", "SEÑOR");
                message = GlobalFuncs.replacetext(message, "the ", "el ");
                message = GlobalFuncs.replacetext(message, "my ", "mi ");
                message = GlobalFuncs.replacetext(message, "is ", "es ");
                message = GlobalFuncs.replacetext(message, "it's", "es");
                message = GlobalFuncs.replacetext(message, "friend", "amigo");
                message = GlobalFuncs.replacetext(message, "buddy", "amigo");
                message = GlobalFuncs.replacetext(message, "hello", "hola");
                message = GlobalFuncs.replacetext(message, " hot", " caliente");
                message = GlobalFuncs.replacetext(message, " very ", " muy ");
                message = GlobalFuncs.replacetext(message, "sword", "espada");
                message = GlobalFuncs.replacetext(message, "library", "biblioteca");
                message = GlobalFuncs.replacetext(message, "traitor", "traidor");
                message = GlobalFuncs.replacetext(message, "wizard", "mago");
                message = String13.ToUpper(message);

                if (Rand13.PercentChance(25))
                {
                    message += " OLE!";
                }
            }
            return(message);
        }
        // Function from file: transit_tube_construction.dm
        public virtual void tube_flip(  )
        {
            ByTable split_text = null;

            split_text = GlobalFuncs.splittext(this.icon_state, "-");

            if (Lang13.Length(split_text[2]) < 2)
            {
                return;
            }

            if (split_text.len == 3 && split_text[3] != "Pass")
            {
                split_text.Swap(2, 3);
            }
            else if (Lang13.Length(split_text[1]) == 2 && Lang13.Length(split_text[2]) == 2)
            {
                split_text[1] = String13.SubStr(split_text[1], 1, 2) + String13.SubStr(split_text[2], 2, 3);
                split_text[2] = String13.SubStr(split_text[2], 1, 2) + (String13.SubStr(split_text[2], 2, 3) == "E" ? "W" : "E");
            }
            else if (split_text[1] == "N" || split_text[1] == "S")
            {
                split_text[2] = String13.SubStr(split_text[2], 1, 2) + (String13.SubStr(split_text[2], 2, 3) == "E" ? "W" : "E");
            }
            else
            {
                split_text[2] = (String13.SubStr(split_text[2], 1, 2) == "N" ? "S" : "N") + String13.SubStr(split_text[2], 2, 3);
            }
            this.icon_state = GlobalFuncs.jointext(split_text, "-");
            return;
        }
        // Function from file: handlabeler.dm
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            string str = null;


            if (!((Mob)user).IsAdvancedToolUser())
            {
                user.WriteMsg("<span class='warning'>You don't have the dexterity to use " + this + "!</span>");
                return(null);
            }
            this.mode       = !this.mode;
            this.icon_state = "labeler" + this.mode;

            if (this.mode)
            {
                user.WriteMsg("<span class='notice'>You turn on " + this + ".</span>");
                str = String13.SubStr(GlobalFuncs.reject_bad_text(Interface13.Input(user, "Label text?", "Set label", "", null, InputType.Any)), 1, 26);

                if (!Lang13.Bool(str) || !(Lang13.Length(str) != 0))
                {
                    user.WriteMsg("<span class='warning'>Invalid text!</span>");
                    return(null);
                }
                this.label = str;
                user.WriteMsg("<span class='notice'>You set the text to '" + str + "'.</span>");
            }
            else
            {
                user.WriteMsg("<span class='notice'>You turn off " + this + ".</span>");
            }
            return(null);
        }
Beispiel #13
0
        // Function from file: reader.dm
        public string trim_text(string what = null, bool?trim_quotes = null)
        {
            trim_quotes = trim_quotes ?? false;


            while (Lang13.Length(what) != 0 && String13.FindIgnoreCase(what, " ", 1, 2) != 0)
            {
                what = String13.SubStr(what, 2, 0);
            }

            while (Lang13.Length(what) != 0 && String13.FindIgnoreCase(what, " ", Lang13.Length(what), 0) != 0)
            {
                what = String13.SubStr(what, 1, Lang13.Length(what));
            }

            if (trim_quotes == true)
            {
                while (Lang13.Length(what) != 0 && String13.FindIgnoreCase(what, this.quote, 1, 2) != 0)
                {
                    what = String13.SubStr(what, 2, 0);
                }

                while (Lang13.Length(what) != 0 && String13.FindIgnoreCase(what, this.quote, Lang13.Length(what), 0) != 0)
                {
                    what = String13.SubStr(what, 1, Lang13.Length(what));
                }
            }
            return(what);
        }
Beispiel #14
0
        // Function from file: species_types.dm
        public override dynamic handle_speech(dynamic message = null, Mob_Living_Carbon_Human H = null)
        {
            ByTable message_list = null;
            int     maxchanges   = 0;
            int?    i            = null;
            int     insertpos    = 0;
            string  inserttext   = null;

            message_list = GlobalFuncs.splittext(message, " ");
            maxchanges   = Num13.MaxInt(Num13.Floor(message_list.len / 1.5), 2);
            i            = null;
            i            = Rand13.Int(((int)(maxchanges / 2)), maxchanges);

            while ((i ?? 0) > 0)
            {
                insertpos  = Rand13.Int(1, message_list.len - 1);
                inserttext = message_list[insertpos];

                if (!(String13.SubStr(inserttext, Lang13.Length(inserttext) - 2, 0) == "..."))
                {
                    message_list[insertpos] = inserttext + "...";
                }

                if (Rand13.PercentChance(20) && message_list.len > 3)
                {
                    message_list.Insert(insertpos, "" + Rand13.Pick(new object [] { "BRAINS", "Brains", "Braaaiinnnsss", "BRAAAIIINNSSS" }) + "...");
                }
                i--;
            }
            return(GlobalFuncs.jointext(message_list, " "));
        }
        // Function from file: navbeacon.dm
        public void set_codes(  )
        {
            ByTable entries = null;
            dynamic e       = null;
            int     index   = 0;
            string  key     = null;
            string  val     = null;


            if (!Lang13.Bool(this.codes_txt))
            {
                return;
            }
            this.codes = new ByTable();
            entries    = GlobalFuncs.splittext(this.codes_txt, ";");

            foreach (dynamic _a in Lang13.Enumerate(entries))
            {
                e = _a;

                index = String13.FindIgnoreCase(e, "=", 1, 0);

                if (index != 0)
                {
                    key             = String13.SubStr(e, 1, index);
                    val             = String13.SubStr(e, index + 1, 0);
                    this.codes[key] = val;
                }
                else
                {
                    this.codes[e] = "1";
                }
            }
            return;
        }
Beispiel #16
0
 private string trim_text(string what = null, bool?trim_quotes = null)
 {
     if (trim_quotes == null)
     {
         trim_quotes = false;
     }
     while (Lang13.Length(what) != 0 && String13.Find(what, " ", 1, 2) != 0)
     {
         what = String13.SubStr(what, 2, 0);
     }
     while (Lang13.Length(what) != 0 && String13.Find(what, " ", Lang13.Length(what), 0) != 0)
     {
         what = String13.SubStr(what, 1, Lang13.Length(what));
     }
     if (trim_quotes == true)
     {
         while (Lang13.Length(what) != 0 && String13.Find(what, this.quote, 1, 2) != 0)
         {
             what = String13.SubStr(what, 2, 0);
         }
         while (Lang13.Length(what) != 0 && String13.Find(what, this.quote, Lang13.Length(what), 0) != 0)
         {
             what = String13.SubStr(what, 1, Lang13.Length(what));
         }
     }
     return(what);
 }
Beispiel #17
0
        // Function from file: reader.dm
        public ByTable readlist(string text = null, string delimiter = null)
        {
            delimiter = delimiter ?? ",";

            ByTable to_return      = null;
            int     position       = 0;
            int     old_position   = 0;
            int     equal_position = 0;
            string  trim_left      = null;
            dynamic trim_right     = null;

            to_return    = new ByTable();
            old_position = 1;

            do
            {
                position       = this.find_next_delimiter_position(text, old_position, delimiter);
                equal_position = String13.FindIgnoreCase(text, "=", old_position, position);
                trim_left      = this.trim_text(String13.SubStr(text, old_position, (equal_position != 0 ? equal_position : position)), true);
                old_position   = position + 1;

                if (equal_position != 0)
                {
                    trim_right = this.trim_text(String13.SubStr(text, equal_position + 1, position));

                    if (String13.FindIgnoreCase(trim_right, this.quote, 1, 2) != 0)
                    {
                        trim_right = String13.SubStr(trim_right, 2, String13.FindIgnoreCase(trim_right, this.quote, 3, 0));
                    }
                    else if (Lang13.Bool(Lang13.IsNumber(String13.ParseNumber(trim_right))))
                    {
                        trim_right = String13.ParseNumber(trim_right);
                    }
                    else if (trim_right == "null")
                    {
                        trim_right = null;
                    }
                    else if (String13.SubStr(trim_right, 1, 5) == "list")
                    {
                        trim_right = this.readlist(String13.SubStr(trim_right, 6, Lang13.Length(trim_right)));
                    }
                    else if (String13.SubStr(trim_right, 1, 2) == "'")
                    {
                        trim_right = new File(String13.SubStr(trim_right, 2, Lang13.Length(trim_right)));
                    }
                    else if (Lang13.FindClass(trim_right) is Type)
                    {
                        trim_right = Lang13.FindClass(trim_right);
                    }
                    to_return[trim_left] = trim_right;
                }
                else
                {
                    to_return[trim_left] = null;
                }
            } while (position != 0);
            return(to_return);
        }
Beispiel #18
0
 // Function from file: species_types.dm
 public override dynamic handle_speech(dynamic message = null, Mob_Living_Carbon_Human H = null)
 {
     if (String13.SubStr(message, 1, 2) != "*")
     {
         message = GlobalVars.lizard_hiss.Replace(message, "sss");
         message = GlobalVars.lizard_hiSS.Replace(message, "SSS");
     }
     return(message);
 }
Beispiel #19
0
        private ByTable text2list(string text = null, string delimiter = null)
        {
            ByTable to_return      = null;
            int     position       = 0;
            int     old_position   = 0;
            int     equal_position = 0;
            string  trim_left      = null;
            dynamic trim_right     = null;

            if (delimiter == null)
            {
                delimiter = ",";
            }
            to_return    = new ByTable();
            old_position = 1;
            while (true)               // Was a do-while, sorry for the mess.
            {
                position       = this.find_next_delimiter_position(text, old_position, delimiter);
                equal_position = String13.Find(text, "=", old_position, position);
                trim_left      = this.trim_text(String13.SubStr(text, old_position, (equal_position != 0 ? equal_position : position)), true);
                old_position   = position + 1;
                if (equal_position != 0)
                {
                    trim_right = this.trim_text(String13.SubStr(text, equal_position + 1, position));
                    if (String13.Find(trim_right, this.quote, 1, 2) != 0)
                    {
                        trim_right = String13.SubStr(trim_right, 2, String13.Find(trim_right, this.quote, 3, 0));
                    }
                    else if (Lang13.Bool(Lang13.IsNumber(String13.ParseNumber(trim_right))))
                    {
                        trim_right = String13.ParseNumber(trim_right);
                    }
                    else if (trim_right == "null")
                    {
                        trim_right = null;
                    }
                    else if (String13.SubStr(trim_right, 1, 5) == "list")
                    {
                        trim_right = this.text2list(String13.SubStr(trim_right, 6, Lang13.Length(trim_right)));
                    }
                    else if (String13.SubStr(trim_right, 1, 2) == "'")
                    {
                        trim_right = new File(String13.SubStr(trim_right, 2, Lang13.Length(trim_right)));
                    }
                    to_return[trim_left] = trim_right;
                }
                else
                {
                    to_return[trim_left] = null;
                }
                if (!(position != 0))
                {
                    break;
                }
            }
            return(to_return);
        }
        // Function from file: scanners.dm
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            this.on         = !this.on;
            this.icon_state = String13.SubStr(this.icon_state, 1, Lang13.Length(this.icon_state)) + ("" + this.on);

            if (this.on)
            {
                GlobalVars.SSobj.processing.Or(this);
            }
            return(null);
        }
Beispiel #21
0
        // Function from file: mutations.dm
        public override dynamic say_mod(dynamic message = null)
        {
            string  prefix     = null;
            ByTable words      = null;
            ByTable rearranged = null;
            int?    i          = null;
            dynamic cword      = null;
            string  suffix     = null;


            if (Lang13.Bool(message))
            {
                prefix = String13.SubStr(message, 1, 2);

                if (prefix == ";")
                {
                    message = String13.SubStr(message, 2, 0);
                }
                else if (new ByTable(new object [] { ":", "#" }).Contains(prefix))
                {
                    prefix += String13.SubStr(message, 2, 3);
                    message = String13.SubStr(message, 3, 0);
                }
                else
                {
                    prefix = "";
                }
                words      = GlobalFuncs.splittext(message, " ");
                rearranged = new ByTable();
                i          = null;
                i          = 1;

                while ((i ?? 0) <= words.len)
                {
                    cword = Rand13.PickFromTable(words);
                    words.Remove(cword);
                    suffix = String13.SubStr(cword, Lang13.Length(cword) - 1, Lang13.Length(cword));

                    while (new ByTable(new object [] { ".", ",", ";", "!", ":", "?" }).Contains(Lang13.Length(cword) > 0 && Lang13.Bool(suffix)))
                    {
                        cword  = String13.SubStr(cword, 1, Lang13.Length(cword) - 1);
                        suffix = String13.SubStr(cword, Lang13.Length(cword) - 1, Lang13.Length(cword));
                    }

                    if (Lang13.Length(cword) != 0)
                    {
                        rearranged.Add(cword);
                    }
                    i++;
                }
                message = "" + prefix + String13.ToUpper(GlobalFuncs.jointext(rearranged, " ")) + "!!";
            }
            return(message);
        }
Beispiel #22
0
        // Function from file: sortingmachinery.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            dynamic O   = null;
            string  tag = null;
            string  str = null;
            dynamic WP  = null;


            if (A is Obj_Item_Device_DestTagger)
            {
                O = A;

                if (this.sortTag != O.currTag)
                {
                    tag = String13.ToUpper(GlobalVars.TAGGERLOCATIONS[O.currTag]);
                    user.WriteMsg("<span class='notice'>*" + tag + "*</span>");
                    this.sortTag = O.currTag;
                    GlobalFuncs.playsound(this.loc, "sound/machines/twobeep.ogg", 100, 1);
                }
            }
            else if (A is Obj_Item_Weapon_Pen)
            {
                str = String13.SubStr(GlobalFuncs.sanitize(Interface13.Input(user, "Label text?", "Set label", "", null, InputType.Any)), 1, 26);

                if (!Lang13.Bool(str) || !(Lang13.Length(str) != 0))
                {
                    user.WriteMsg("<span class='warning'>Invalid text!</span>");
                    return(null);
                }
                ((Ent_Static)user).visible_message("" + user + " labels " + this + " as " + str + ".");
                this.name = "" + this.name + " (" + str + ")";
            }
            else if (A is Obj_Item_Stack_WrappingPaper && !this.giftwrapped)
            {
                WP = A;

                if (Lang13.Bool(WP.use(1)))
                {
                    this.icon_state  = "giftcrate" + this.wrapped.w_class;
                    this.giftwrapped = true;
                    ((Ent_Static)user).visible_message("" + user + " wraps the package in festive paper!");

                    if (Convert.ToDouble(WP.amount) <= 0 && !(WP.loc != null))
                    {
                        new Obj_Item_Weapon_CTube(GlobalFuncs.get_turf(user));
                    }
                }
                else
                {
                    user.WriteMsg("<span class='warning'>You need more paper!</span>");
                }
            }
            return(null);
        }
Beispiel #23
0
 public int f_string(int i = 0, ByTable node = null)
 {
     if (new ByTable(new object [] { "'", "\"" }).Contains(String13.SubStr(this.token(i), 1, 2)))
     {
         node.Add(String13.SubStr(this.token(i), 2, -1));
     }
     else
     {
         this.parse_error("Expected string but found '" + this.token(i) + "'");
     }
     return(i + 1);
 }
Beispiel #24
0
        // Function from file: writer.dm
        public string check_attributes(dynamic A = null)
        {
            string  attributes_text = null;
            dynamic V = null;

            attributes_text = "{";

            foreach (dynamic _a in Lang13.Enumerate(A.vars))
            {
                V = _a;

                Task13.Sleep(-1);

                if (!Lang13.Bool(Lang13.IsSaved(A, V)) || A.vars[V] == Lang13.Initial(A, V))
                {
                    continue;
                }

                if (A.vars[V] is string)
                {
                    attributes_text += "" + V + " = \"" + A.vars[V] + "\"";
                }
                else if (Lang13.Bool(Lang13.IsNumber(A.vars[V])) || A.vars[V] is Type)
                {
                    attributes_text += "" + V + " = " + A.vars[V];
                }
                else if (A.vars[V] is Icon || A.vars[V] is File)
                {
                    attributes_text += "" + V + " = '" + A.vars[V] + "'";
                }
                else
                {
                    continue;
                }

                if (attributes_text != "{")
                {
                    attributes_text += "; ";
                }
            }

            if (attributes_text == "{")
            {
                return(null);
            }

            if (String13.SubStr(attributes_text, Lang13.Length(attributes_text) - 1, 0) == "; ")
            {
                attributes_text = String13.SubStr(attributes_text, 1, Lang13.Length(attributes_text) - 1);
            }
            attributes_text += "}";
            return(attributes_text);
        }
Beispiel #25
0
        // Function from file: requests_console.dm
        public override string say_quote(dynamic input = null, dynamic spans = null)
        {
            string ending = null;

            ending = String13.SubStr(input, Lang13.Length(input) - 2, 0);

            if (ending == "!!!")
            {
                return("blares, \"" + GlobalFuncs.attach_spans(input, spans) + "\"");
            }
            return(base.say_quote((object)(input), (object)(spans)));
        }
Beispiel #26
0
 // Function from file: SDQL_2_parser.dm
 public int object_type(int i = 0, ByTable node = null)
 {
     if (String13.SubStr(this.token(i), 1, 2) == "/")
     {
         node.Add(this.token(i));
     }
     else
     {
         i = this.f_string(i, node);
     }
     return(i + 1);
 }
Beispiel #27
0
        // Function from file: twohanded.dm
        public virtual void unwield(dynamic user = null)
        {
            int     sf = 0;
            dynamic O  = null;


            if (!this.wielded || !Lang13.Bool(user))
            {
                return;
            }
            this.wielded = false;

            if (this.force_unwielded != 0)
            {
                this.force = this.force_unwielded;
            }
            sf = String13.FindIgnoreCase(this.name, " (Wielded)", 1, 0);

            if (sf != 0)
            {
                this.name = String13.SubStr(this.name, 1, sf);
            }
            else
            {
                this.name = "" + Lang13.Initial(this, "name");
            }
            this.update_icon();

            if (user is Mob_Living_Silicon_Robot)
            {
                user.WriteMsg("<span class='notice'>You free up your module.</span>");
            }
            else if (this is Obj_Item_Weapon_Twohanded_Required)
            {
                user.WriteMsg(new Txt("<span class='notice'>You drop ").the(this.name).item().str(".</span>").ToString());
            }
            else
            {
                user.WriteMsg("<span class='notice'>You are now carrying the " + this.name + " with one hand.</span>");
            }

            if (Lang13.Bool(this.unwieldsound))
            {
                GlobalFuncs.playsound(this.loc, this.unwieldsound, 50, 1);
            }
            O = ((Mob)user).get_inactive_hand();

            if (Lang13.Bool(O) && O is Obj_Item_Weapon_Twohanded_Offhand)
            {
                ((Obj_Item_Weapon_Twohanded)O).unwield();
            }
            return;
        }
Beispiel #28
0
        public void rename(  )
        {
            string n_name = null;

            n_name = String13.SubStr(GlobalFuncs.sanitize(Interface13.Input(Task13.User, "What would you like to label the photo?", "Photo Labelling", null, null, InputType.Str)), 1, 26);

            if ((this.loc == Task13.User || this.loc.loc != null && this.loc.loc == Task13.User) && Task13.User.stat == 0 && Task13.User.canmove && !Task13.User.restrained())
            {
                this.name = "photo" + (Lang13.Bool(n_name) ? "- '" + n_name + "'" : null);
            }
            this.add_fingerprint(Task13.User);
            return;
        }
Beispiel #29
0
        // Function from file: martial.dm
        public void add_to_streak(string element = null, Ent_Static D = null)
        {
            if (D != this.current_target)
            {
                this.current_target = D;
                this.streak         = "";
            }
            this.streak = this.streak + element;

            if (Lang13.Length(this.streak) > this.max_streak_length)
            {
                this.streak = String13.SubStr(this.streak, 2, 0);
            }
            return;
        }
Beispiel #30
0
        // Function from file: transit_tube.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            Obj_Structure_TransitTubePod pod = null;
            dynamic R = null;
            Obj_Structure_TransitTubePod pod2 = null;


            if (A is Obj_Item_Weapon_Wrench)
            {
                if (String13.SubStr(this.icon_state, 1, 3) != "D-")
                {
                    foreach (dynamic _a in Lang13.Enumerate(this.loc, typeof(Obj_Structure_TransitTubePod)))
                    {
                        pod = _a;

                        user.WriteMsg("<span class='warning'>Remove the pod first!</span>");
                        return(null);
                    }
                    ((Ent_Static)user).visible_message(new Txt().item(user).str(" starts to deattach ").the(this).item().str(".").ToString(), "<span class='notice'>You start to deattach the " + this.name + "...</span>");
                    GlobalFuncs.playsound(this.loc, "sound/items/ratchet.ogg", 50, 1);

                    if (GlobalFuncs.do_after(user, 35 / A.toolspeed, null, this))
                    {
                        user.WriteMsg("<span class='notice'>You deattach the " + this.name + ".</span>");
                        R            = Lang13.Call(this.tube_construction, this.loc);
                        R.icon_state = this.icon_state;
                        this.transfer_fingerprints_to(R);
                        ((Ent_Static)R).add_fingerprint(user);
                        this.destroy_diagonals();
                        GlobalFuncs.qdel(this);
                    }
                }
            }

            if (A is Obj_Item_Weapon_Crowbar)
            {
                foreach (dynamic _b in Lang13.Enumerate(this.loc, typeof(Obj_Structure_TransitTubePod)))
                {
                    pod2 = _b;

                    pod2.attackby(A, user);
                }
            }
            return(null);
        }