Example #1
0
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            dynamic A = null;

            A = Interface13.Input("Select Colour to change it to", "BOOYEA", A, null, this.clothing_choices, InputType.Any);

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

            if (Task13.User.stat != 0)
            {
                return(null);
            }

            if (this.malfunctioning)
            {
                Task13.User.WriteMsg("<span class='danger'>Your jumpsuit is malfunctioning!</span>");
                return(null);
            }
            this.desc = null;
            this.permeability_coefficient = 081;
            this.desc       = A.desc;
            this.name       = A.name;
            this.icon_state = A.icon_state;
            this.item_state = A.item_state;
            this.item_color = A.item_color;
            this.suit_color = A.suit_color;
            Task13.User.update_inv_w_uniform();
            return(null);
        }
Example #2
0
        public void jumptofollower(  )
        {
            ByTable following = null;
            dynamic choice    = null;

            following = new ByTable();

            if (this.side == "red")
            {
                following = GlobalVars.ticker.mode.red_deity_followers | GlobalVars.ticker.mode.red_deity_prophets;
            }
            else if (this.side == "blue")
            {
                following = GlobalVars.ticker.mode.blue_deity_followers | GlobalVars.ticker.mode.blue_deity_prophets;
            }
            else
            {
                this.WriteMsg("You are unaligned, and thus do not have followers");
                return;
            }
            choice = Interface13.Input("Choose a follower", "Jump to Follower", null, null, following, InputType.Null | InputType.Any);

            if (Lang13.Bool(choice) && Lang13.Bool(choice.current))
            {
                this.Move(GlobalFuncs.get_turf(choice.current));
            }
            return;
        }
Example #3
0
        // Function from file: spirit_board.dm
        public bool spirit_board_pick_letter(dynamic M = null)
        {
            Ent_Static T = null;


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

            if (this.virgin)
            {
                this.virgin = false;
                GlobalFuncs.notify_ghosts("Someone has begun playing with a " + this.name + " in " + GlobalFuncs.get_area(this) + "!", null, null, this);
            }
            this.planchette = Interface13.Input("Choose the letter.", "Seance!", null, null, new ByTable(new object [] { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }), InputType.Any);
            GlobalFuncs.add_logs(M, this, "picked a letter on", " which was \"" + this.planchette + "\".");
            this.cooldown = Game13.time;
            this.lastuser = M.ckey;
            T             = this.loc;
            Task13.Sleep(Rand13.Int(20, 30));

            if (T == this.loc)
            {
                this.visible_message("<span class='notice'>The planchette slowly moves... and stops at the letter \"" + this.planchette + "\".</span>");
            }
            return(false);
        }
Example #4
0
        // 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);
        }
Example #5
0
        // Function from file: gun.dm
        public void reskin_gun(Mob M = null)
        {
            dynamic choice = null;

            choice = Interface13.Input(M, "Warning, you can only reskin your weapon once!", "Reskin Gun", null, this.options, InputType.Any);

            if (this != null && Lang13.Bool(choice) && !(M.stat != 0) && Map13.GetDistance(M, this) <= 1 && !M.restrained() && M.canmove)
            {
                if (this.options[choice] == null)
                {
                    return;
                }

                if (this.sawn_state == 1)
                {
                    this.icon_state = this.options[choice] + "-sawn";
                }
                else
                {
                    this.icon_state = this.options[choice];
                }
                M.WriteMsg("Your gun is now skinned as " + choice + ". Say hello to your new friend.");
                this.reskinned = true;
                return;
            }
            return;
        }
        // Function from file: console.dm
        public void SelectDisguise(bool?remote = null)
        {
            remote = remote ?? false;

            ByTable entries    = null;
            dynamic tempname   = null;
            dynamic temp       = null;
            int?    i          = null;
            dynamic entry_name = null;
            dynamic chosen     = null;

            entries = new ByTable();
            i       = null;
            i       = 1;

            while ((i ?? 0) <= this.disguises.len)
            {
                temp     = this.disguises[i];
                tempname = temp.name;
                entries["" + tempname] = this.disguises[i];
                i++;
            }
            entry_name = Interface13.Input("Choose Disguise", "Disguise", null, null, entries, InputType.Any);
            chosen     = entries[entry_name];

            if (Lang13.Bool(chosen) && (remote == true || Map13.GetDistance(Task13.User, this) <= 1))
            {
                ((Obj_Item_Clothing_Suit_Armor_Abductor_Vest)this.vest).SetDisguise(chosen);
            }
            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);
        }
        // Function from file: alien_powers.dm
        public override bool fire(Mob user = null)
        {
            dynamic choice = null;


            if (Lang13.Bool(Lang13.FindIn(typeof(Obj_Structure_Alien_Resin), user.loc)))
            {
                user.WriteMsg("<span class='danger'>There is already a resin structure there.</span>");
                return(false);
            }
            choice = Interface13.Input("Choose what you wish to shape.", "Resin building", null, null, this.structures, InputType.Null | InputType.Any);

            if (!Lang13.Bool(choice))
            {
                return(false);
            }

            if (!this.cost_check(this.check_turf, user))
            {
                return(false);
            }
            user.WriteMsg("<span class='notice'>You shape a " + choice + ".</span>");
            user.visible_message("<span class='notice'>" + user + " vomits up a thick purple substance and begins to shape it.</span>");
            choice = this.structures[choice];
            Lang13.Call(choice, user.loc);
            return(true);
        }
Example #9
0
        public void blob_broadcast(  )
        {
            dynamic speak_text = null;
            Mob_Living_SimpleAnimal_Hostile_Blob blob_minion = null;

            speak_text = Interface13.Input(this, "What would you like to say with your minions?", "Blob Broadcast", null, null, InputType.Str);

            if (!Lang13.Bool(speak_text))
            {
                return;
            }
            else
            {
                this.WriteMsg("You broadcast with your minions, <B>" + speak_text + "</B>");
            }

            foreach (dynamic _a in Lang13.Enumerate(this.blob_mobs, typeof(Mob_Living_SimpleAnimal_Hostile_Blob)))
            {
                blob_minion = _a;


                if (blob_minion.overmind == this && blob_minion.stat == 0)
                {
                    blob_minion.say(speak_text);
                }
            }
            return;
        }
        // Function from file: PDApainter.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            dynamic P = null;

            base.attack_hand((object)(a), b, c);
            this.add_fingerprint(a);

            if (Lang13.Bool(this.storedpda))
            {
                P = Interface13.Input(a, "Select your color!", "PDA Painting", null, this.colorlist, InputType.Null | InputType.Any);

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

                if (!(Map13.GetDistance(this, a) <= 1))
                {
                    return(null);
                }

                if (!Lang13.Bool(this.storedpda))
                {
                    return(null);
                }
                this.storedpda.icon_state = P.icon_state;
                this.storedpda.desc       = P.desc;
                this.ejectpda();
            }
            else
            {
                a.WriteMsg("<span class='notice'>The " + this + " is empty.</span>");
            }
            return(null);
        }
        // Function from file: photography.dm
        public Picture selectpicture(Obj_Item_Device_Camera_Siliconcam targetloc = null)
        {
            ByTable nametemp = null;
            dynamic find     = null;
            Picture t        = null;
            Picture q        = null;

            nametemp = new ByTable();

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

            foreach (dynamic _a in Lang13.Enumerate(targetloc.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(targetloc.aipictures, typeof(Picture)))
            {
                q = _b;


                if (q.fields["name"] == find)
                {
                    return(q);
                }
            }
            return(null);
        }
        // Function from file: AI_modules.dm
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            dynamic newpos   = null;
            string  response = null;
            string  targName = null;

            newpos = Interface13.Input("Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", this.lawpos, null, null, InputType.Num | InputType.Null);

            if (newpos == null)
            {
                return(null);
            }

            if (Convert.ToDouble(newpos) < 15)
            {
                response = Interface13.Alert("Error: The law priority of " + newpos + " is invalid,  Law priorities below 14 are reserved for core laws,  Would you like to change that that to 15?", "Invalid law priority", "Change to 15", "Cancel");

                if (!Lang13.Bool(response) || response == "Cancel")
                {
                    return(null);
                }
                newpos = 15;
            }
            this.lawpos = Num13.MinInt(Convert.ToInt32(newpos), 50);
            targName    = GlobalFuncs.stripped_input(user, "Please enter a new law for the AI.", "Freeform Law Entry", this.laws[1], 1024);

            if (!Lang13.Bool(targName))
            {
                return(null);
            }
            this.laws[1] = targName;
            base.attack_self((object)(user), (object)(flag), emp);
            return(null);
        }
Example #13
0
        // Function from file: crayons.dm
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            dynamic choice = null;

            choice = Interface13.Input(user, "Spraycan options", null, null, new ByTable(new object [] { "Toggle Cap", "Change Drawing", "Change Color" }), InputType.Null | InputType.Any);

            dynamic _a = choice;             // Was a switch-case, sorry for the mess.

            if (_a == "Toggle Cap")
            {
                user.WriteMsg("<span class='notice'>You " + (this.capped ? "Remove" : "Replace") + " the cap of the " + this + "</span>");
                this.capped     = (this.capped ? false : true);
                this.icon_state = "spraycan" + (this.capped ? "_cap" : "");
                this.update_icon();
            }
            else if (_a == "Change Drawing")
            {
                base.attack_self((object)(user), (object)(flag), emp);
            }
            else if (_a == "Change Color")
            {
                this.paint_color = Interface13.Input(user, "Choose Color", null, null, null, InputType.Color);
                this.update_icon();
            }
            return(null);
        }
Example #14
0
        // Function from file: alien_powers.dm
        public override bool fire(Mob user = null)
        {
            ByTable    options = null;
            Mob_Living Ms      = null;
            dynamic    M       = null;
            string     msg     = null;

            options = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInViewExcludeThis(null, user), typeof(Mob_Living)))
            {
                Ms = _a;

                options.Add(Ms);
            }
            M = Interface13.Input("Select who to whisper to:", "Whisper to?", null, null, options, InputType.Mob | InputType.Null);

            if (!Lang13.Bool(M))
            {
                return(false);
            }
            msg = GlobalFuncs.sanitize(Interface13.Input("Message:", "Alien Whisper", null, null, null, InputType.Str | InputType.Null));

            if (Lang13.Bool(msg))
            {
                GlobalFuncs.log_say("AlienWhisper: " + GlobalFuncs.key_name(user) + "->" + M.key + " : " + msg);
                M.WriteMsg("<span class='noticealien'>You hear a strange, alien voice in your head...</span>" + msg);
                user.WriteMsg("<span class='noticealien'>You said: \"" + msg + "\" to " + M + "</span>");
            }
            else
            {
                return(false);
            }
            return(true);
        }
Example #15
0
        // Function from file: shadowling_items.dm
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            dynamic H             = null;
            dynamic new_dark_view = null;


            if (!(user is Mob_Living_Carbon_Human))
            {
                return(null);
            }
            H = user;

            if (H.dna.species.id != "shadowling")
            {
                user.WriteMsg("<span class='warning'>You aren't sure how to do this...</span>");
                return(null);
            }
            H.dna.species.darksight = 0;
            new_dark_view           = Interface13.Input(user, "Enter the radius of tiles to see with night vision.", "Night Vision", "" + new_dark_view, null, InputType.Num);
            new_dark_view           = Num13.MaxInt(this.min_darkness_view ?1:0, Num13.MinInt(Convert.ToInt32(new_dark_view), this.max_darkness_view));

            dynamic _a = new_dark_view;             // Was a switch-case, sorry for the mess.

            if (_a == 0)
            {
                user.WriteMsg("<span class='notice'>Your night vision capabilities fade away for the time being.</span>");
            }
            else
            {
                user.WriteMsg("<span class='notice'>You shift your night vision capabilities to see " + new_dark_view + " tiles away.</span>");
            }
            this.darkness_view = new_dark_view;
            user.update_sight();
            return(null);
        }
Example #16
0
        // Function from file: lib_items.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            dynamic choice = null;


            if (this.contents.len != 0)
            {
                choice = Interface13.Input("Which book would you like to remove from the shelf?", null, null, null, this.contents, InputType.Obj | InputType.Null);

                if (Lang13.Bool(choice))
                {
                    if (!Task13.User.canmove || Task13.User.stat != 0 || Task13.User.restrained() || !(Map13.GetDistance(this.loc, Task13.User) <= 1))
                    {
                        return(null);
                    }

                    if (a is Mob_Living_Carbon_Human)
                    {
                        if (!Lang13.Bool(((Mob)a).get_active_hand()))
                        {
                            ((Mob)a).put_in_hands(choice);
                        }
                    }
                    else
                    {
                        choice.loc = GlobalFuncs.get_turf(this);
                    }
                    this.update_icon();
                }
            }
            return(null);
        }
Example #17
0
        // Function from file: swarmer.dm
        public void ContactSwarmers(  )
        {
            dynamic message  = null;
            string  rendered = null;
            dynamic M        = null;

            message  = Interface13.Input(this, "Announce to other swarmers", "Swarmer contact", null, null, InputType.Any);
            rendered = "<B>Swarm communication - </b> " + this + " states: " + message;

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


                    if (M is Mob_Living_SimpleAnimal_Hostile_Swarmer)
                    {
                        M.WriteMsg(rendered);
                    }

                    if (GlobalVars.dead_mob_list.Contains(M))
                    {
                        M.WriteMsg(new Txt("<a href='?src=").Ref(M).str(";follow=").Ref(this).str("'>(F)</a> ").item(rendered).ToString());
                    }
                }
            }
            return;
        }
        // Function from file: equipment_locker.dm
        public void RedeemVoucher(dynamic voucher = null, dynamic redeemer = null)
        {
            dynamic selection = null;

            selection = Interface13.Input(redeemer, "Pick your equipment", "Mining Voucher Redemption", null, new ByTable(new object [] { "Kinetic Accelerator", "Resonator", "Mining Drone", "Advanced Scanner" }), InputType.Null | InputType.Any);

            if (!Lang13.Bool(selection) || !this.Adjacent(redeemer) || Lang13.Bool(voucher.gc_destroyed) || voucher.loc != redeemer)
            {
                return;
            }

            dynamic _a = selection;             // Was a switch-case, sorry for the mess.

            if (_a == "Kinetic Accelerator")
            {
                new Obj_Item_Weapon_Gun_Energy_KineticAccelerator(this.loc);
            }
            else if (_a == "Resonator")
            {
                new Obj_Item_Weapon_Resonator(this.loc);
            }
            else if (_a == "Mining Drone")
            {
                new Mob_Living_SimpleAnimal_Hostile_MiningDrone(this.loc);
                new Obj_Item_Weapon_Weldingtool_Hugetank(this.loc);
            }
            else if (_a == "Advanced Scanner")
            {
                new Obj_Item_Device_TScanner_AdvMiningScanner(this.loc);
            }
            GlobalFuncs.qdel(voucher);
            return;
        }
Example #19
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);
        }
Example #20
0
        public void jump_to_node(  )
        {
            ByTable    nodes       = null;
            int?       i           = null;
            dynamic    node_name   = null;
            Ent_Static chosen_node = null;


            if (GlobalVars.blob_nodes.len != 0)
            {
                nodes = new ByTable();
                i     = null;
                i     = 1;

                while ((i ?? 0) <= GlobalVars.blob_nodes.len)
                {
                    nodes["Blob Node #" + i] = GlobalVars.blob_nodes[i];
                    i++;
                }
                node_name   = Interface13.Input(this, "Choose a node to jump to.", "Node Jump", null, nodes, InputType.Any);
                chosen_node = nodes[node_name];

                if (chosen_node != null)
                {
                    this.loc = chosen_node.loc;
                }
            }
            return;
        }
Example #21
0
        // Function from file: machine_interactions.dm
        public override void Options_Topic(string href = null, ByTable href_list = null)
        {
            dynamic newfreq = null;


            if (Lang13.Bool(href_list["change_freq"]))
            {
                newfreq = Interface13.Input(Task13.User, "Specify a new frequency for new signals to change to. Enter null to turn off frequency changing. Decimals assigned automatically.", this, this.network, null, InputType.Num | InputType.Null);

                if (this.canAccess(Task13.User))
                {
                    if (Lang13.Bool(newfreq))
                    {
                        if (String13.FindIgnoreCase(String13.NumberToString(Convert.ToDouble(newfreq)), ".", 1, 0) != 0)
                        {
                            newfreq *= 10;
                        }

                        if (Convert.ToDouble(newfreq) < 10000)
                        {
                            this.change_frequency = newfreq;
                            this.temp             = "<font color = #666633>-% New frequency to change to assigned: \"" + newfreq + " GHz\" %-</font color>";
                        }
                    }
                    else
                    {
                        this.change_frequency = 0;
                        this.temp             = "<font color = #666633>-% Frequency changing deactivated %-</font color>";
                    }
                }
            }
            return;
        }
Example #22
0
        // Function from file: pizzabox.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            dynamic topbox = null;


            if (((Mob)a).get_inactive_hand() != this)
            {
                base.attack_hand((object)(a), b, c);
                return(null);
            }

            if (this.open)
            {
                if (Lang13.Bool(this.pizza))
                {
                    ((Mob)a).put_in_hands(this.pizza);
                    a.WriteMsg("<span class='notice'>You take " + this.pizza + " out of " + this + ".</span>");
                    this.pizza = null;
                    this.update_icon();
                    return(null);
                }
                else if (Lang13.Bool(this.bomb))
                {
                    if (Lang13.Bool(((Wires)this.wires).is_all_cut()) && Lang13.Bool(this.bomb_defused))
                    {
                        ((Mob)a).put_in_hands(this.bomb);
                        a.WriteMsg("<span class='notice'>You carefully remove the " + this.bomb + " from " + this + ".</span>");
                        this.bomb = null;
                        this.update_icon();
                        return(null);
                    }
                    else
                    {
                        this.bomb_timer   = Interface13.Input(a, "Set the " + this.bomb + " timer from " + GlobalVars.BOMB_TIMER_MIN + " to " + GlobalVars.BOMB_TIMER_MAX + ".", this.bomb, this.bomb_timer, null, InputType.Num);
                        this.bomb_timer   = Num13.MaxInt(GlobalVars.BOMB_TIMER_MIN ?1:0, Num13.MinInt(GlobalFuncs.Ceiling(this.bomb_timer / 2), GlobalVars.BOMB_TIMER_MAX));
                        this.bomb_defused = GlobalVars.FALSE;
                        GlobalFuncs.message_admins(new Txt().item(GlobalFuncs.key_name_admin(a)).str("<A HREF='?_src_=holder;adminmoreinfo=").Ref(a).str("'>?</A> (<A HREF='?_src_=holder;adminplayerobservefollow=").Ref(a).str("'>FLW</A>) has trapped a ").item(this).str(" with ").item(this.bomb).str(" set to ").item(this.bomb_timer * 2).str(" seconds.").ToString());
                        GlobalFuncs.log_game("" + GlobalFuncs.key_name(a) + " has trapped a " + this + " with " + this.bomb + " set to " + this.bomb_timer * 2 + " seconds.");
                        this.bomb.adminlog = "The " + this.bomb.name + " in " + this.name + " that " + GlobalFuncs.key_name(a) + " activated has detonated!";
                        a.WriteMsg("<span class='warning'>You trap " + this + " with " + this.bomb + ".</span>");
                        this.update_icon();
                    }
                    return(null);
                }
            }
            else if (this.boxes.len != 0)
            {
                topbox = this.boxes[this.boxes.len];
                this.boxes.Remove(topbox);
                ((Mob)a).put_in_hands(topbox);
                a.WriteMsg("<span class='notice'>You remove the topmost " + this.name + " from the stack.</span>");
                topbox.update_icon();
                this.update_icon();
                return(null);
            }
            base.attack_hand((object)(a), b, c);
            return(null);
        }
Example #23
0
        // Function from file: cable.dm
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            dynamic cable_color = null;

            cable_color     = Interface13.Input(user, "Pick a cable color.", "Cable Color", null, new ByTable(new object [] { "red", "yellow", "green", "blue", "pink", "orange", "cyan", "white" }), InputType.Any);
            this.item_color = cable_color;
            this.update_icon();
            return(null);
        }
Example #24
0
        // Function from file: dresser.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            dynamic H              = null;
            dynamic choice         = null;
            dynamic new_undies     = null;
            dynamic new_undershirt = null;
            dynamic new_socks      = null;


            if (!this.Adjacent(a))
            {
                return(null);
            }

            if (a is Mob_Living_Carbon_Human)
            {
                H      = a;
                choice = Interface13.Input(a, "Underwear, Undershirt, or Socks?", "Changing", null, new ByTable(new object [] { "Underwear", "Undershirt", "Socks" }), InputType.Null | InputType.Any);

                if (!this.Adjacent(a))
                {
                    return(null);
                }

                dynamic _a = choice;                 // Was a switch-case, sorry for the mess.
                if (_a == "Underwear")
                {
                    new_undies = Interface13.Input(a, "Select your underwear", "Changing", null, GlobalVars.underwear_list, InputType.Null | InputType.Any);

                    if (Lang13.Bool(new_undies))
                    {
                        H.underwear = new_undies;
                    }
                }
                else if (_a == "Undershirt")
                {
                    new_undershirt = Interface13.Input(a, "Select your undershirt", "Changing", null, GlobalVars.undershirt_list, InputType.Null | InputType.Any);

                    if (Lang13.Bool(new_undershirt))
                    {
                        H.undershirt = new_undershirt;
                    }
                }
                else if (_a == "Socks")
                {
                    new_socks = Interface13.Input(a, "Select your socks", "Changing", null, GlobalVars.socks_list, InputType.Null | InputType.Any);

                    if (Lang13.Bool(new_socks))
                    {
                        H.socks = new_socks;
                    }
                }
                this.add_fingerprint(H);
                ((Mob_Living_Carbon_Human)H).update_body();
            }
            return(null);
        }
        // Function from file: chem_heater.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            dynamic target = null;
            double? adjust = null;


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

            switch ((string)(action))
            {
            case "power":
                this.on  = !Lang13.Bool(this.on) ?1:0;
                _default = GlobalVars.TRUE;
                break;

            case "temperature":
                target = _params["target"];
                adjust = String13.ParseNumber(_params["adjust"]);

                if (target == "input")
                {
                    target = Interface13.Input("New target temperature:", this.name, this.target_temperature, null, null, InputType.Num | InputType.Null);

                    if (!(target == null) && !Lang13.Bool(base.ui_act(action, _params, ui, state)))
                    {
                        _default = GlobalVars.TRUE;
                    }
                }
                else if (Lang13.Bool(adjust))
                {
                    target = (this.target_temperature ?? 0) + (adjust ?? 0);
                }
                else if (String13.ParseNumber(target) != null)
                {
                    target   = String13.ParseNumber(target);
                    _default = GlobalVars.TRUE;
                }

                if (Lang13.Bool(_default))
                {
                    this.target_temperature = Num13.MaxInt(0, Num13.MinInt(Convert.ToInt32(target), 1000));
                }
                break;

            case "eject":
                this.on = GlobalVars.FALSE;
                this.eject_beaker();
                _default = GlobalVars.TRUE;
                break;
            }
            return(_default);
        }
Example #26
0
        // Function from file: thermomachine.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            dynamic target = null;
            double? adjust = null;


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

            switch ((string)(action))
            {
            case "power":
                this.on        = !this.on;
                this.use_power = (this.on ?1:0) + 1;
                this.investigate_log("was turned " + (this.on ? "on" : "off") + " by " + GlobalFuncs.key_name(Task13.User), "atmos");
                _default = GlobalVars.TRUE;
                break;

            case "target":
                target = _params["target"];
                adjust = String13.ParseNumber(_params["adjust"]);

                if (target == "input")
                {
                    target = Interface13.Input("Set new target (" + this.min_temperature + "-" + this.max_temperature + " K):", this.name, this.target_temperature, null, null, InputType.Num | InputType.Null);

                    if (!(target == null) && !Lang13.Bool(base.ui_act(action, _params, ui, state)))
                    {
                        _default = GlobalVars.TRUE;
                    }
                }
                else if (Lang13.Bool(adjust))
                {
                    target   = this.target_temperature + (adjust ?? 0);
                    _default = GlobalVars.TRUE;
                }
                else if (String13.ParseNumber(target) != null)
                {
                    target   = String13.ParseNumber(target);
                    _default = GlobalVars.TRUE;
                }

                if (Lang13.Bool(_default))
                {
                    this.target_temperature = Num13.MaxInt(((int)(this.min_temperature)), Num13.MinInt(Convert.ToInt32(target), Convert.ToInt32(this.max_temperature)));
                    this.investigate_log("was set to " + this.target_temperature + " K by " + GlobalFuncs.key_name(Task13.User), "atmos");
                }
                break;
            }
            this.update_icon();
            return(_default);
        }
Example #27
0
        // Function from file: runes.dm
        public override void invoke(dynamic user = null)
        {
            ByTable cultists          = null;
            Mind    M                 = null;
            dynamic cultist_to_summon = null;

            cultists = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.ticker.mode.cult, typeof(Mind)))
            {
                M = _a;

                cultists.Add(M.current);
            }
            cultist_to_summon = Interface13.Input("Who do you wish to call to " + this + "?", "Followers of the Geometer", null, null, cultists - user, InputType.Null | InputType.Any);

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

            if (!Lang13.Bool(cultist_to_summon))
            {
                user.WriteMsg("<span class='cultitalic'>You require a summoning target!</span>");
                this.fail_invoke();
                GlobalFuncs.log_game("Summon Cultist rune failed - no target");
                return;
            }

            if (!GlobalFuncs.iscultist(cultist_to_summon))
            {
                user.WriteMsg("<span class='cultitalic'>" + cultist_to_summon + " is not a follower of the Geometer!</span>");
                this.fail_invoke();
                GlobalFuncs.log_game("Summon Cultist rune failed - no target");
                return;
            }

            if (Convert.ToDouble(cultist_to_summon.z) > 7)
            {
                user.WriteMsg("<span class='cultitalic'>" + cultist_to_summon + " is not in our dimension!</span>");
                this.fail_invoke();
                GlobalFuncs.log_game("Summon Cultist rune failed - target in away mission");
                return;
            }

            if (cultist_to_summon.buckled != null)
            {
                cultist_to_summon.buckled.unbuckle_mob();
            }
            ((Ent_Static)cultist_to_summon).visible_message("<span class='warning'>" + cultist_to_summon + " suddenly disappears in a flash of red light!</span>", "<span class='cultitalic'><b>Overwhelming vertigo consumes you as you are hurled through the air!</b></span>");
            this.visible_message("<span class='warning'>A foggy shape materializes atop " + this + " and solidifes into " + cultist_to_summon + "!</span>");
            user.apply_damage(10, "brute", "head");
            cultist_to_summon.loc = GlobalFuncs.get_turf(this);
            GlobalFuncs.qdel(this);
            return;
        }
        // Function from file: ai.dm
        public override bool Click(dynamic loc = null, string control = null, string _params = null)
        {
            Mob     AI          = null;
            dynamic target_name = null;

            AI          = Task13.User;
            target_name = Interface13.Input(AI, "Choose who you want to track", "Tracking", null, ((Mob_Living_Silicon_Ai)AI).trackable_mobs(), InputType.Null | InputType.Any);
            ((Mob_Living_Silicon_Ai)AI).ai_camera_track(target_name);
            return(false);
        }
Example #29
0
        // Function from file: ai.dm
        public override bool Click(dynamic loc = null, string control = null, string _params = null)
        {
            Mob     AI     = null;
            dynamic camera = null;

            AI     = Task13.User;
            camera = Interface13.Input(AI, "Choose which camera you want to view", "Cameras", null, ((Mob_Living_Silicon_Ai)AI).get_camera_list(), InputType.Null | InputType.Any);
            ((Mob_Living_Silicon_Ai)AI).ai_camera_list(camera);
            return(false);
        }
Example #30
0
        // Function from file: tanks.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            dynamic pressure = null;


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

            switch ((string)(action))
            {
            case "pressure":
                pressure = _params["pressure"];

                if (pressure == "reset")
                {
                    pressure = 16;
                    _default = GlobalVars.TRUE;
                }
                else if (pressure == "min")
                {
                    pressure = 0;
                    _default = GlobalVars.TRUE;
                }
                else if (pressure == "max")
                {
                    pressure = 303.9749755859375;
                    _default = GlobalVars.TRUE;
                }
                else if (pressure == "input")
                {
                    pressure = Interface13.Input("New release pressure (" + 0 + "-" + 303.9749755859375 + " kPa):", this.name, this.distribute_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.distribute_pressure = Num13.MaxInt(0, Num13.MinInt(Num13.Floor(Convert.ToDouble(pressure)), ((int)(303.9749755859375))));
                }
                break;
            }
            return(_default);
        }