Exemplo n.º 1
0
        // Function from file: false_walls.dm
        public void dismantle(dynamic user = null)
        {
            Type P = null;

            ((Ent_Static)user).visible_message("<span class='notice'>" + user + " dismantles the false wall.</span>", "<span class='notice'>You dismantle the false wall.</span>");
            new Obj_Structure_Girder_Displaced(this.loc);

            if (this.mineral == "metal")
            {
                if (this is Obj_Structure_Falsewall_Reinforced)
                {
                    new Obj_Item_Stack_Sheet_Plasteel(this.loc);
                    new Obj_Item_Stack_Sheet_Plasteel(this.loc);
                }
                else
                {
                    new Obj_Item_Stack_Sheet_Metal(this.loc);
                    new Obj_Item_Stack_Sheet_Metal(this.loc);
                }
            }
            else
            {
                P = Lang13.FindClass("/obj/item/stack/sheet/mineral/" + this.mineral);
                Lang13.Call(P, this.loc);
                Lang13.Call(P, this.loc);
            }
            GlobalFuncs.playsound(this, "sound/items/welder.ogg", 100, 1);
            GlobalFuncs.qdel(this);
            return;
        }
        // Function from file: machine_stacking.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            Base_Data inp  = null;
            dynamic   _out = null;


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

            if (Lang13.Bool(href_list["release"]))
            {
                if (!Lang13.Bool(this.machine.stack_list.Contains(Lang13.FindClass(href_list["release"]))))
                {
                    return(null);
                }
                inp                   = this.machine.stack_list[Lang13.FindClass(href_list["release"])];
                _out                  = Lang13.Call(inp.type);
                _out.amount           = ((dynamic)inp).amount;
                ((dynamic)inp).amount = 0;
                ((Obj_Machinery_Mineral)this.machine).unload_mineral(_out);
            }
            this.updateUsrDialog();
            return(null);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        // Function from file: computer.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            Type    areapath = null;
            dynamic area     = null;
            double? safe     = null;


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

            if (!this.Adjacent(Task13.User) && !(Task13.User is Mob_Living_Silicon))
            {
                return(null);
            }
            Task13.User.set_machine(this);
            this.add_fingerprint(Task13.User);

            if (Lang13.Bool(href_list["loadarea"]))
            {
                areapath = Lang13.FindClass(href_list["loadarea"]);

                if (!Lang13.Bool(((dynamic)areapath).IsSubclassOf(typeof(Zone_Holodeck))))
                {
                    return(null);
                }
                area = Lang13.FindObj(areapath);

                if (!(area is Zone_Holodeck))
                {
                    return(null);
                }

                if (area == this.offline_program || this.program_cache.Contains(area) || Lang13.Bool(this.emagged) && this.emag_programs.Contains(area))
                {
                    this.load_program(area);
                }
            }
            else if (href_list.Contains("safety"))
            {
                safe         = String13.ParseNumber(href_list["safety"]);
                this.emagged = !Lang13.Bool(safe) ?1:0;

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

                if (Lang13.Bool(safe) && this.emag_programs.Contains(this.program))
                {
                    this.emergency_shutdown();
                }
                this.nerf(safe);
            }
            this.updateUsrDialog();
            return(null);
        }
 // Function from file: constructable_frame.dm
 public void set_type(dynamic typepath = null, dynamic user = null)
 {
     this.build_path = typepath;
     this.name       = "circuit board (" + this.names_paths[this.build_path] + " Vendor)";
     if (user != null)
     {
         user.WriteMsg("<span class='notice'>You set the board to " + this.names_paths[this.build_path] + ".</span>");
     }
     this.req_components = new ByTable().Set(Lang13.FindClass("/obj/item/weapon/vending_refill/" + String13.SubStr("" + this.build_path, 36, 0)), 3);
     return;
 }
Exemplo n.º 6
0
        // Function from file: topic_input.dm
        public dynamic getPath(string i = null)
        {
            dynamic t = null;

            t = this.get(i);

            if (Lang13.Bool(t))
            {
                t = Lang13.FindClass(t);
            }
            return(t is Type ? t : null);
        }
Exemplo n.º 7
0
        // Function from file: pipe_dispenser.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            Type          p_type = null;
            double?       p_dir  = null;
            Obj_Item_Pipe P      = null;


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

            if (!Lang13.Bool(this.anchored) || !Task13.User.canmove || Task13.User.stat != 0 || Task13.User.restrained() || !(Map13.GetDistance(this.loc, Task13.User) <= 1))
            {
                Interface13.Browse(Task13.User, null, "window=pipedispenser");
                return(1);
            }
            Task13.User.set_machine(this);
            this.add_fingerprint(Task13.User);

            if (Lang13.Bool(href_list["make"]))
            {
                if (!this.wait)
                {
                    p_type = Lang13.FindClass(href_list["make"]);
                    p_dir  = String13.ParseNumber(href_list["dir"]);
                    P      = new Obj_Item_Pipe(this.loc, p_type, p_dir);
                    P.add_fingerprint(Task13.User);
                    this.wait = true;
                    Task13.Schedule(10, (Task13.Closure)(() => {
                        this.wait = false;
                        return;
                    }));
                }
            }

            if (Lang13.Bool(href_list["makemeter"]))
            {
                if (!this.wait)
                {
                    new Obj_Item_PipeMeter(this.loc);
                    this.wait = true;
                    Task13.Schedule(15, (Task13.Closure)(() => {
                        this.wait = false;
                        return;
                    }));
                }
            }
            return(null);
        }
Exemplo n.º 8
0
        // Function from file: god.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            Type construct_type = null;
            Obj_Structure_Divine_ConstructionHolder CH = null;
            Type trap_type = null;


            if (Lang13.Bool(href_list["create_structure"]))
            {
                if (!this.ability_cost(75, true, true))
                {
                    return(null);
                }
                construct_type = Lang13.FindClass(href_list["create_structure"]);

                if (!(construct_type != null))
                {
                    return(null);
                }
                this.add_faith(-75);
                CH = new Obj_Structure_Divine_ConstructionHolder(GlobalFuncs.get_turf(this));
                CH.assign_deity(this);
                CH.setup_construction(construct_type);
                CH.visible_message("<span class='notice'>" + this + " has created a transparent, unfinished " + Lang13.Initial(construct_type, "name") + ". It can be finished by adding materials.</span>");
                this.WriteMsg("<span class='boldnotice'>You may click a construction site to cancel it, but only faith is refunded.</span>");
                this.structure_construction_ui(this);
                return(null);
            }

            if (Lang13.Bool(href_list["place_trap"]))
            {
                if (!this.ability_cost(20, true, true))
                {
                    return(null);
                }
                trap_type = Lang13.FindClass(href_list["place_trap"]);

                if (!(trap_type != null))
                {
                    return(null);
                }
                this.WriteMsg(new Txt("You lay ").a(Lang13.Initial(trap_type, "name")).item().ToString());
                this.add_faith(-20);
                Lang13.Call(trap_type, GlobalFuncs.get_turf(this));
                return(null);
            }
            base.Topic(href, href_list, (object)(hsrc));
            return(null);
        }
        // Function from file: trigger.dm
        public Obj_Effect_ProcHolder_Spell_Targeted_Trigger(dynamic loc = null) : base((object)(loc))
        {
            dynamic spell        = null;
            Type    spell_to_add = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;

            foreach (dynamic _a in Lang13.Enumerate(this.starting_spells))
            {
                spell = _a;

                spell_to_add = Lang13.FindClass(spell);
                Lang13.Call(spell_to_add, this);
            }
            return;
        }
Exemplo n.º 10
0
        // Function from file: portable_turret.dm
        public string get_base_icon(  )
        {
            if (Lang13.Bool(this.installation))
            {
                dynamic _a = this.installation;
                if (_a is string)
                {
                    _a = Lang13.FindClass(_a);
                }

                if (_a == typeof(Obj_Item_Weapon_Gun_Energy_Laser_Bluetag))
                {
                    return("blue");
                }
                else if (_a == typeof(Obj_Item_Weapon_Gun_Energy_Laser_Redtag))
                {
                    return("red");
                }
            }
            return("grey");
        }
Exemplo n.º 11
0
        // Function from file: lightswitch.dm
        public Obj_Machinery_LightSwitch(dynamic loc = null) : base((object)(loc))
        {
            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            Task13.Schedule(5, (Task13.Closure)(() => {
                this.area = this.loc.loc;

                if (Lang13.Bool(this.otherarea))
                {
                    this.area = Lang13.FindObj(Lang13.FindClass("/area/" + this.otherarea));
                }

                if (!Lang13.Bool(this.name))
                {
                    this.name = "light switch (" + this.area.name + ")";
                }
                this.on = this.area.lightswitch;
                this.updateicon();
                return;
            }));
            return;
        }
Exemplo n.º 12
0
        // Function from file: false_walls.dm
        public virtual dynamic ChangeToWall(bool?delete = null)
        {
            delete = delete ?? true;

            dynamic T = null;

            T = GlobalFuncs.get_turf(this);

            if (!Lang13.Bool(this.walltype) || this.walltype == "metal")
            {
                ((Tile)T).ChangeTurf(typeof(Tile_Simulated_Wall));
            }
            else
            {
                ((Tile)T).ChangeTurf(Lang13.FindClass("/turf/simulated/wall/mineral/" + this.walltype));
            }

            if (delete == true)
            {
                GlobalFuncs.qdel(this);
            }
            return(T);
        }
        // Function from file: dumbfire.dm
        public override bool cast(dynamic targets = null, dynamic thearea = null, dynamic user = null)
        {
            thearea = thearea ?? Task13.User;

            dynamic            target          = null;
            dynamic            projectile      = null;
            Type               projectile_type = null;
            Ent_Static         current_loc     = null;
            int?               i     = null;
            dynamic            L     = null;
            Obj_Effect_Overlay trail = null;

            this.playMagSound();

            foreach (dynamic _a in Lang13.Enumerate(targets))
            {
                target = _a;

                Task13.Schedule(0, (Task13.Closure)(() => {
                    projectile = null;

                    if (this.proj_type is string)
                    {
                        projectile_type = Lang13.FindClass(this.proj_type);
                        projectile      = Lang13.Call(projectile_type, thearea);
                    }

                    if (this.proj_type is Obj_Effect_ProcHolder_Spell)
                    {
                        projectile = new Obj_Effect_ProcHolder_Spell_Targeted_Trigger(thearea);
                        projectile.linked_spells.Add(this.proj_type);
                    }
                    projectile.icon       = this.proj_icon;
                    projectile.icon_state = this.proj_icon_state;
                    projectile.dir        = Map13.GetDistance(projectile, target);
                    projectile.name       = this.proj_name;
                    current_loc           = thearea.loc;
                    projectile.loc        = current_loc;
                    i = null;
                    i = 0;

                    while ((i ?? 0) < (this.proj_lifespan ?? 0))
                    {
                        if (!Lang13.Bool(projectile))
                        {
                            break;
                        }

                        if (this.proj_insubstantial)
                        {
                            projectile.loc = Map13.GetStep(projectile, Convert.ToInt32(projectile.dir));
                        }
                        else
                        {
                            Map13.Step(projectile, Convert.ToInt32(projectile.dir));
                        }

                        if (projectile.loc == current_loc || i == this.proj_lifespan)
                        {
                            ((Obj_Effect_ProcHolder_Spell)projectile).cast(current_loc, null, thearea);
                            break;
                        }
                        L = Lang13.FindIn(typeof(Mob_Living), Map13.FetchInRange(this.proj_trigger_range, projectile) - thearea);

                        if (Lang13.Bool(L) && Convert.ToInt32(L.stat) != 2)
                        {
                            ((Obj_Effect_ProcHolder_Spell)projectile).cast(L.loc, null, thearea);
                            break;
                        }

                        if (this.proj_trail && Lang13.Bool(projectile))
                        {
                            Task13.Schedule(0, (Task13.Closure)(() => {
                                if (Lang13.Bool(projectile))
                                {
                                    trail            = new Obj_Effect_Overlay(projectile.loc);
                                    trail.icon       = this.proj_trail_icon;
                                    trail.icon_state = this.proj_trail_icon_state;
                                    trail.density    = false;
                                    Task13.Schedule(this.proj_trail_lifespan ?1:0, (Task13.Closure)(() => {
                                        GlobalFuncs.qdel(trail);
                                        return;
                                    }));
                                }
                                return;
                            }));
                        }
                        current_loc = projectile.loc;
                        Task13.Sleep(this.proj_step_delay);
                        i++;
                    }

                    if (Lang13.Bool(projectile))
                    {
                        GlobalFuncs.qdel(projectile);
                    }
                    return;
                }));
            }
            return(false);
        }
Exemplo n.º 14
0
        // Function from file: buildmode.dm
        public bool change_settings(Mob user = null)
        {
            dynamic target_path = null;
            ByTable locked      = null;
            dynamic thetype     = null;
            dynamic gen_paths   = null;
            dynamic type        = null;


            switch ((int)(this.mode))
            {
            case 1:
                return(true);

                break;

            case 2:
                target_path    = Interface13.Input(user, "Enter typepath:", "Typepath", "/obj/structure/closet", null, InputType.Any);
                this.objholder = Lang13.FindClass(target_path);

                if (!(this.objholder is Type))
                {
                    this.objholder = GlobalFuncs.pick_closest_path(target_path);

                    if (!Lang13.Bool(this.objholder))
                    {
                        this.objholder = typeof(Obj_Structure_Closet);
                        Interface13.Alert("That path is not allowed.");
                    }
                }
                else if (Lang13.Bool(this.objholder.IsSubclassOf(typeof(Mob))) && !GlobalFuncs.check_rights(32, false))
                {
                    this.objholder = typeof(Obj_Structure_Closet);
                }
                break;

            case 3:
                locked         = new ByTable(new object [] { "vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "viruses", "cuffed", "ka", "last_eaten", "urine" });
                this.varholder = Interface13.Input(user, "Enter variable name:", "Name", "name", null, InputType.Any);

                if (Lang13.Bool(((dynamic)(locked != null && !GlobalFuncs.check_rights(32, false))).Contains(this.varholder)))
                {
                    return(true);
                }
                thetype = Interface13.Input(user, "Select variable type:", "Type", null, new ByTable(new object [] { "text", "number", "mob-reference", "obj-reference", "turf-reference" }), InputType.Any);

                if (!Lang13.Bool(thetype))
                {
                    return(true);
                }

                dynamic _a = thetype;                         // Was a switch-case, sorry for the mess.
                if (_a == "text")
                {
                    this.valueholder = Interface13.Input(user, "Enter variable value:", "Value", "value", null, InputType.Str);
                }
                else if (_a == "number")
                {
                    this.valueholder = Interface13.Input(user, "Enter variable value:", "Value", 123, null, InputType.Num);
                }
                else if (_a == "mob-reference")
                {
                    this.valueholder = Interface13.Input(user, "Enter variable value:", "Value", null, GlobalVars.mob_list, InputType.Mob);
                }
                else if (_a == "obj-reference")
                {
                    this.valueholder = Interface13.Input(user, "Enter variable value:", "Value", null, Game13.contents, InputType.Obj);
                }
                else if (_a == "turf-reference")
                {
                    this.valueholder = Interface13.Input(user, "Enter variable value:", "Value", null, Game13.contents, InputType.Tile);
                }
                break;

            case 5:
                gen_paths = Lang13.GetTypes(typeof(MapGenerator)) - typeof(MapGenerator);
                type      = Interface13.Input(user, "Select Generator Type", "Type", null, gen_paths, InputType.Null | InputType.Any);

                if (!Lang13.Bool(type))
                {
                    return(false);
                }
                this.generator_path = type;
                this.cornerA        = null;
                this.cornerB        = null;
                break;
            }
            return(false);
        }
Exemplo n.º 15
0
        private void parse_grid(string model = null, int xcrd = 0, double ycrd = 0, int zcrd = 0)
        {
            ByTable members            = null;
            ByTable members_attributes = null;
            double  index            = 0;
            int     old_position     = 0;
            int     dpos             = 0;
            string  full_def         = null;
            Type    atom_def         = null;
            ByTable fields           = null;
            int     variables_start  = 0;
            ByTable turfs_underlays  = null;
            dynamic instance         = null;
            Tile    crds             = null;
            int     first_turf_index = 0;
            dynamic T  = null;
            dynamic UT = null;

            members            = new ByTable();
            members_attributes = new ByTable();
            index        = 1;
            old_position = 1;
            while (true)               // Was a do-while, sorry for the mess.
            {
                dpos     = this.find_next_delimiter_position(model, old_position, ",", "{", "}");
                full_def = String13.SubStr(model, old_position, dpos);
                string path = String13.SubStr(full_def, 1, String13.Find(full_def, "{", 1, 0));
                atom_def = Lang13.FindClass(path);
                members.Add(atom_def);
                old_position    = dpos + 1;
                fields          = new ByTable();
                variables_start = String13.Find(full_def, "{", 1, 0);
                if (variables_start != 0)
                {
                    full_def = String13.SubStr(full_def, variables_start + 1, Lang13.Length(full_def));
                    fields   = this.text2list(full_def, ";");
                }
                members_attributes.len++;
                members_attributes[index++] = fields;
                Task13.Sleep(-1);
                if (!(dpos != 0))
                {
                    break;
                }
            }

            turfs_underlays = new ByTable();
            index           = members.len;

            // Setup zone...
            GlobalVars._preloader.setup(members_attributes[index]);
            instance = Lang13.FindObj(members[index]);

            crds = Map13.GetTile(xcrd, ((int)(ycrd)), zcrd);
            if (crds != null)
            {
                instance.contents.Add(crds);
            }

            if (Lang13.Bool(GlobalVars.use_preloader) && Lang13.Bool(instance))
            {
                GlobalVars._preloader.load(instance);
            }

            members.Remove(members[index]);

            // Load tile(s?!?)
            first_turf_index = 1;
            while (members[first_turf_index] == null || !members[first_turf_index].IsSubclassOf(typeof(Tile)))
            {
                first_turf_index++;
            }

            try {
                T = this.instance_atom(members[first_turf_index], members_attributes[first_turf_index], xcrd, ycrd, zcrd);
            }
            catch (Exception e)
            {
                Logger.Error("Failed to init tile [" + members[first_turf_index] + "] at ( " + xcrd + ", " + ycrd + ", " + zcrd + " )", e);
            }

            if (Lang13.Bool(T))
            {
                index = first_turf_index + 1;
                while (index <= members.len)
                {
                    turfs_underlays.Insert(1, new Image(T.icon, null, T.icon_state, T.layer, T.dir));
                    UT = this.instance_atom(members[index], members_attributes[index], xcrd, ycrd, zcrd);
                    this.add_underlying_turf(UT, T, turfs_underlays);
                    T = UT;
                    index++;
                }
            }

            // Setup objs
            foreach (dynamic _a in Lang13.IterateRange(1, first_turf_index - 1))
            {
                index = _a;
                try {
                    this.instance_atom(members[index], members_attributes[index], xcrd, ycrd, zcrd);
                }
                catch (Exception e) {
                    Logger.Error("Failed to init object [" + members[index] + "] at ( " + xcrd + ", " + ycrd + ", " + zcrd + " )", e);
                }
            }
            return;
        }
Exemplo n.º 16
0
        // Function from file: equipment_locker.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            dynamic   I           = null;
            Base_Data inp         = null;
            dynamic   _out        = null;
            dynamic   desired     = null;
            dynamic   metalstack  = null;
            dynamic   plasmastack = null;
            dynamic   desired2    = null;
            Obj_Item_Stack_Sheet_Plasteel plasteelout = null;


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

            if (Lang13.Bool(href_list["choice"]))
            {
                if (this.inserted_id is Obj_Item_Weapon_Card_Id)
                {
                    if (href_list["choice"] == "eject")
                    {
                        this.inserted_id.loc = this.loc;
                        this.inserted_id.__CallVerb("Pick up");
                        this.inserted_id = null;
                    }

                    if (href_list["choice"] == "claim")
                    {
                        if (Lang13.Bool(this.inserted_id.access.Contains(GlobalVars.access_mining_station)))
                        {
                            this.inserted_id.mining_points += this.points;
                            this.points = 0;
                        }
                        else
                        {
                            Task13.User.WriteMsg("<span class='warning'>Required access not found.</span>");
                        }
                    }
                }
                else if (href_list["choice"] == "insert")
                {
                    I = Task13.User.get_active_hand();

                    if (I is Obj_Item_Weapon_Card_Id)
                    {
                        if (!Task13.User.drop_item())
                        {
                            return(null);
                        }
                        I.loc            = this;
                        this.inserted_id = I;
                    }
                    else
                    {
                        Task13.User.WriteMsg("<span class='warning'>No valid ID.</span>");
                    }
                }
            }

            if (Lang13.Bool(href_list["release"]))
            {
                if (this.check_access(this.inserted_id) || this.allowed(Task13.User))
                {
                    if (!this.stack_list.Contains(Lang13.FindClass(href_list["release"])))
                    {
                        return(null);
                    }
                    inp         = this.stack_list[Lang13.FindClass(href_list["release"])];
                    _out        = Lang13.Call(inp.type);
                    desired     = Interface13.Input("How much?", "How much to eject?", 1, null, null, InputType.Num);
                    _out.amount = Num13.MinInt(Convert.ToInt32(desired), 50, Convert.ToInt32(((dynamic)inp).amount));

                    if (Convert.ToDouble(_out.amount) >= 1)
                    {
                        ((dynamic)inp).amount -= _out.amount;
                        this.unload_mineral(_out);
                    }

                    if (Convert.ToDouble(((dynamic)inp).amount) < 1)
                    {
                        this.stack_list.Remove(Lang13.FindClass(href_list["release"]));
                    }
                }
                else
                {
                    Task13.User.WriteMsg("<span class='warning'>Required access not found.</span>");
                }
            }

            if (Lang13.Bool(href_list["plasteel"]))
            {
                if (this.check_access(this.inserted_id) || this.allowed(Task13.User))
                {
                    if (!this.stack_list.Contains(typeof(Obj_Item_Stack_Sheet_Metal)))
                    {
                        return(null);
                    }

                    if (!this.stack_list.Contains(typeof(Obj_Item_Stack_Sheet_Mineral_Plasma)))
                    {
                        return(null);
                    }
                    metalstack         = this.stack_list[typeof(Obj_Item_Stack_Sheet_Metal)];
                    plasmastack        = this.stack_list[typeof(Obj_Item_Stack_Sheet_Mineral_Plasma)];
                    desired2           = Interface13.Input("How much?", "How much would you like to smelt?", 1, null, null, InputType.Num);
                    plasteelout        = new Obj_Item_Stack_Sheet_Plasteel();
                    plasteelout.amount = Num13.MinInt(Convert.ToInt32(desired2), 50, Convert.ToInt32(metalstack.amount), Convert.ToInt32(plasmastack.amount));

                    if ((plasteelout.amount ?? 0) >= 1)
                    {
                        metalstack.amount  -= plasteelout.amount;
                        plasmastack.amount -= plasteelout.amount;
                        this.unload_mineral(plasteelout);
                    }
                }
                else
                {
                    Task13.User.WriteMsg("<span class='warning'>Required access not found.</span>");
                }
            }
            this.updateUsrDialog();
            return(null);
        }
Exemplo n.º 17
0
        // Function from file: tile_types.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            dynamic WT = null;
            Obj_Item_Stack_Sheet_Metal new_item = null;
            Obj_Item_Stack_Tile        R        = null;
            bool                replace         = false;
            Type                sheet_type      = null;
            dynamic             new_item2       = null;
            Obj_Item_Stack_Tile R2       = null;
            bool                replace2 = false;


            if (A is Obj_Item_Weapon_Weldingtool)
            {
                WT = A;

                if ((this.get_amount() ?? 0) < 4)
                {
                    user.WriteMsg("<span class='warning'>You need at least four tiles to do this!</span>");
                    return(null);
                }

                if (((Obj_Item)WT).is_hot() != 0 && !Lang13.Bool(this.mineralType))
                {
                    user.WriteMsg("<span class='warning'>You can not reform this!</span>");
                    return(null);
                }

                if (((Obj_Item_Weapon_Weldingtool)WT).remove_fuel(0, user))
                {
                    if (this.mineralType == "plasma")
                    {
                        this.atmos_spawn_air(5, 5);
                        ((Ent_Static)user).visible_message("<span class='warning'>" + user.name + " sets the plasma tiles on fire!</span>", "<span class='warning'>You set the plasma tiles on fire!</span>");
                        GlobalFuncs.qdel(this);
                        return(null);
                    }

                    if (this.mineralType == "metal")
                    {
                        new_item = new Obj_Item_Stack_Sheet_Metal(user.loc);
                        ((Ent_Static)user).visible_message("" + user.name + " shaped " + this + " into metal with the weldingtool.", "<span class='notice'>You shaped " + this + " into metal with the weldingtool.</span>", "<span class='italics'>You hear welding.</span>");
                        R             = this;
                        Task13.Source = null;
                        replace       = ((Mob)user).get_inactive_hand() == R;
                        R.use(4);

                        if (!(R != null) && replace)
                        {
                            ((Mob)user).put_in_hands(new_item);
                        }
                    }
                    else
                    {
                        sheet_type = Lang13.FindClass("/obj/item/stack/sheet/mineral/" + this.mineralType);
                        new_item2  = Lang13.Call(sheet_type, user.loc);
                        ((Ent_Static)user).visible_message("" + user.name + " shaped " + this + " into a sheet with the weldingtool.", "<span class='notice'>You shaped " + this + " into a sheet with the weldingtool.</span>", "<span class='italics'>You hear welding.</span>");
                        R2            = this;
                        Task13.Source = null;
                        replace2      = ((Mob)user).get_inactive_hand() == R2;
                        R2.use(4);

                        if (!(R2 != null) && replace2)
                        {
                            ((Mob)user).put_in_hands(new_item2);
                        }
                    }
                }
                return(null);
            }
            else
            {
                base.attackby((object)(A), (object)(user), _params, silent, replace_spent);
            }
            return(null);
        }
Exemplo n.º 18
0
        // Function from file: RPD.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            if (!Task13.User.canUseTopic(this))
            {
                Interface13.Browse(Task13.User, null, "window=pipedispenser");
                return(null);
            }
            Task13.User.set_machine(this);
            this.add_fingerprint(Task13.User);

            if (Lang13.Bool(href_list["screen"]))
            {
                this.screen = String13.ParseNumber(href_list["screen"]);
                this.show_menu(Task13.User);
            }

            if (Lang13.Bool(href_list["setdir"]))
            {
                this.p_dir     = String13.ParseNumber(href_list["setdir"]);
                this.p_flipped = String13.ParseNumber(href_list["flipped"]);
                this.show_menu(Task13.User);
            }

            if (Lang13.Bool(href_list["eatpipes"]))
            {
                this.p_class    = -1;
                this.p_conntype = -1;
                this.p_dir      = 1;
                this.spark_system.start();
                GlobalFuncs.playsound(GlobalFuncs.get_turf(this), "sound/effects/pop.ogg", 50, 0);
                this.show_menu(Task13.User);
            }

            if (Lang13.Bool(href_list["paintpipes"]))
            {
                this.p_class    = -2;
                this.p_conntype = -1;
                this.p_dir      = 1;
                this.spark_system.start();
                GlobalFuncs.playsound(GlobalFuncs.get_turf(this), "sound/effects/pop.ogg", 50, 0);
                this.show_menu(Task13.User);
            }

            if (Lang13.Bool(href_list["set_color"]))
            {
                this.paint_color = href_list["set_color"];
                this.spark_system.start();
                GlobalFuncs.playsound(GlobalFuncs.get_turf(this), "sound/effects/pop.ogg", 50, 0);
                this.show_menu(Task13.User);
            }

            if (Lang13.Bool(href_list["makepipe"]))
            {
                this.p_type     = Lang13.FindClass(href_list["makepipe"]);
                this.p_dir      = String13.ParseNumber(href_list["dir"]);
                this.p_conntype = String13.ParseNumber(href_list["type"]);
                this.p_class    = 0;
                this.spark_system.start();
                GlobalFuncs.playsound(GlobalFuncs.get_turf(this), "sound/effects/pop.ogg", 50, 0);
                this.show_menu(Task13.User);
            }

            if (Lang13.Bool(href_list["makemeter"]))
            {
                this.p_class    = 1;
                this.p_conntype = -1;
                this.p_dir      = 1;
                this.spark_system.start();
                GlobalFuncs.playsound(GlobalFuncs.get_turf(this), "sound/effects/pop.ogg", 50, 0);
                this.show_menu(Task13.User);
            }

            if (Lang13.Bool(href_list["dmake"]))
            {
                this.p_type     = String13.ParseNumber(href_list["dmake"]);
                this.p_conntype = String13.ParseNumber(href_list["type"]);
                this.p_dir      = 1;
                this.p_class    = 2;
                this.spark_system.start();
                GlobalFuncs.playsound(GlobalFuncs.get_turf(this), "sound/effects/pop.ogg", 50, 0);
                this.show_menu(Task13.User);
            }
            return(null);
        }
Exemplo n.º 19
0
        // Function from file: reader.dm
        public void parse_grid(string model = null, int xcrd = 0, double ycrd = 0, int zcrd = 0)
        {
            ByTable members            = null;
            ByTable members_attributes = null;
            double  index            = 0;
            int     old_position     = 0;
            int     dpos             = 0;
            string  full_def         = null;
            Type    atom_def         = null;
            ByTable fields           = null;
            int     variables_start  = 0;
            ByTable turfs_underlays  = null;
            dynamic instance         = null;
            Tile    crds             = null;
            int     first_turf_index = 0;
            dynamic T  = null;
            dynamic UT = null;

            members            = new ByTable();
            members_attributes = new ByTable();
            index        = 1;
            old_position = 1;

            do
            {
                dpos     = this.find_next_delimiter_position(model, old_position, ",", "{", "}");
                full_def = String13.SubStr(model, old_position, dpos);
                atom_def = Lang13.FindClass(String13.SubStr(full_def, 1, String13.FindIgnoreCase(full_def, "{", 1, 0)));
                members.Add(atom_def);
                old_position    = dpos + 1;
                fields          = new ByTable();
                variables_start = String13.FindIgnoreCase(full_def, "{", 1, 0);

                if (variables_start != 0)
                {
                    full_def = String13.SubStr(full_def, variables_start + 1, Lang13.Length(full_def));
                    fields   = this.readlist(full_def, ";");
                }
                members_attributes.len++;
                members_attributes[index++] = fields;
                Task13.Sleep(-1);
            } while (dpos != 0);
            turfs_underlays = new ByTable();
            index           = members.len;
            GlobalVars._preloader.setup(members_attributes[index]);
            instance = Lang13.FindObj(members[index]);
            crds     = Map13.GetTile(xcrd, ((int)(ycrd)), zcrd);

            if (crds != null)
            {
                instance.contents.Add(crds);
            }

            if (Lang13.Bool(GlobalVars.use_preloader) && Lang13.Bool(instance))
            {
                GlobalVars._preloader.load(instance);
            }
            members.Remove(members[index]);
            first_turf_index = 1;

            while (!Lang13.Bool(members[first_turf_index].IsSubclassOf(typeof(Tile))))
            {
                first_turf_index++;
            }
            T = this.instance_atom(members[first_turf_index], members_attributes[first_turf_index], xcrd, ycrd, zcrd);

            if (Lang13.Bool(T))
            {
                index = first_turf_index + 1;

                while (index <= members.len)
                {
                    turfs_underlays.Insert(1, new Image(T.icon, null, T.icon_state, T.layer, T.dir));
                    UT = this.instance_atom(members[index], members_attributes[index], xcrd, ycrd, zcrd);
                    this.add_underlying_turf(UT, T, turfs_underlays);
                    T = UT;
                    index++;
                }
            }

            foreach (dynamic _a in Lang13.IterateRange(1, first_turf_index - 1))
            {
                index = _a;

                this.instance_atom(members[index], members_attributes[index], xcrd, ycrd, zcrd);
            }
            return;
        }
Exemplo n.º 20
0
        // Function from file: runes.dm
        public override void invoke(dynamic user = null)
        {
            dynamic T = null;
            ByTable papers_on_rune         = null;
            Obj_Item_Weapon_Paper P        = null;
            dynamic         paper_to_imbue = null;
            ByTable         nearby_runes   = null;
            Obj_Effect_Rune R               = null;
            dynamic         picked_rune     = null;
            ByTable         split_rune_type = null;
            dynamic         imbue_type      = null;
            Type            talisman_type   = null;
            dynamic         TA              = null;
            dynamic         TR              = null;
            dynamic         TT              = null;

            T = GlobalFuncs.get_turf(this);
            papers_on_rune = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(T, typeof(Obj_Item_Weapon_Paper)))
            {
                P = _a;


                if (!Lang13.Bool(P.info))
                {
                    papers_on_rune.Add(P);
                }
            }

            if (!(papers_on_rune.len != 0))
            {
                user.WriteMsg("<span class='cultitalic'>There must be a blank paper on top of " + this + "!</span>");
                this.fail_invoke();
                GlobalFuncs.log_game("Talisman Imbue rune failed - no blank papers on rune");
                return;
            }
            paper_to_imbue = Rand13.PickFromTable(papers_on_rune);
            nearby_runes   = new ByTable();

            foreach (dynamic _b in Lang13.Enumerate(Map13.FetchInRangeExcludeThis(this, 1), typeof(Obj_Effect_Rune)))
            {
                R = _b;

                nearby_runes.Add(R);
            }

            if (!(nearby_runes.len != 0))
            {
                user.WriteMsg("<span class='cultitalic'>There are no runes near " + this + "!</span>");
                this.fail_invoke();
                GlobalFuncs.log_game("Talisman Imbue rune failed - no nearby runes");
                return;
            }
            picked_rune     = Rand13.PickFromTable(nearby_runes);
            split_rune_type = GlobalFuncs.splittext("" + picked_rune.type, "/");
            imbue_type      = split_rune_type[split_rune_type.len];
            talisman_type   = Lang13.FindClass("/obj/item/weapon/paper/talisman/" + imbue_type);

            if (talisman_type is Type)
            {
                ((Ent_Dynamic)user).say("H'drak v'loso, mir'kanas verbot!");
                TA = Lang13.Call(talisman_type, GlobalFuncs.get_turf(this));

                if (picked_rune is Obj_Effect_Rune_Teleport)
                {
                    TR         = picked_rune;
                    TT         = TA;
                    TT.keyword = TR.keyword;
                }
            }
            else
            {
                user.WriteMsg("<span class='cultitalic'>The chosen rune was not a valid target!</span>");
                this.fail_invoke();
                GlobalFuncs.log_game("Talisman Imbue rune failed - chosen rune invalid");
                return;
            }
            this.visible_message("<span class='warning'>" + picked_rune + " crumbles to dust, and bloody images form themselves on " + paper_to_imbue + ".</span>");
            GlobalFuncs.qdel(paper_to_imbue);
            GlobalFuncs.qdel(picked_rune);
            return;
        }
Exemplo n.º 21
0
        // Function from file: girders.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            Obj_Item_Stack_Sheet_Metal     M  = null;
            Obj_Structure_Girder           G  = null;
            Obj_Structure_Girder_Displaced D  = null;
            Obj_Item_Stack_Sheet_Metal     M2 = null;
            dynamic D2 = null;
            Obj_Structure_Girder G2 = null;
            dynamic S = null;
            Obj_Structure_Falsewall_Iron FW = null;
            dynamic T  = null;
            dynamic S2 = null;
            Obj_Structure_Falsewall F = null;
            dynamic T2 = null;
            Obj_Structure_Falsewall_Reinforced FW2 = null;
            dynamic T3 = null;
            Obj_Structure_Girder_Reinforced R = null;
            string  M3  = null;
            Type    F2  = null;
            dynamic FW3 = null;
            dynamic T4  = null;
            dynamic P   = null;

            this.add_fingerprint(user);

            if (A is Obj_Item_Weapon_Screwdriver)
            {
                if (this.state == 3)
                {
                    GlobalFuncs.playsound(this.loc, "sound/items/Screwdriver.ogg", 100, 1);
                    ((Ent_Static)user).visible_message("<span class='warning'>" + user + " disassembles the girder.</span>", "<span class='notice'>You start to disassemble the girder...</span>", "You hear clanking and banging noises.");

                    if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this))
                    {
                        if (this.state != 3)
                        {
                            return(null);
                        }
                        this.state = 4;
                        user.WriteMsg("<span class='notice'>You disassemble the girder.</span>");
                        M = new Obj_Item_Stack_Sheet_Metal(this.loc, 2);
                        M.add_fingerprint(user);
                        GlobalFuncs.qdel(this);
                    }
                }
                else if (this.state == 2)
                {
                    GlobalFuncs.playsound(this.loc, "sound/items/Screwdriver.ogg", 100, 1);
                    user.WriteMsg("<span class='notice'>You start unsecuring support struts...</span>");

                    if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this))
                    {
                        if (this.state != 2)
                        {
                            return(null);
                        }
                        user.WriteMsg("<span class='notice'>You unsecure the support struts.</span>");
                        this.state = 1;
                    }
                }
            }
            else if (A is Obj_Item_Weapon_Wrench)
            {
                if (this.state == 3)
                {
                    if (!(this.loc is Tile_Simulated_Floor))
                    {
                        user.WriteMsg("<span class='warning'>A floor must be present to secure the girder!</span>");
                        return(null);
                    }
                    GlobalFuncs.playsound(this.loc, "sound/items/ratchet.ogg", 100, 1);
                    user.WriteMsg("<span class='notice'>You start securing the girder...</span>");

                    if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this))
                    {
                        user.WriteMsg("<span class='notice'>You secure the girder.</span>");
                        G = new Obj_Structure_Girder(this.loc);
                        this.transfer_fingerprints_to(G);
                        GlobalFuncs.qdel(this);
                    }
                }
                else if (this.state == 0)
                {
                    GlobalFuncs.playsound(this.loc, "sound/items/ratchet.ogg", 100, 1);
                    user.WriteMsg("<span class='notice'>You start unsecuring the girder...</span>");

                    if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this))
                    {
                        user.WriteMsg("<span class='notice'>You unsecure the girder.</span>");
                        D = new Obj_Structure_Girder_Displaced(this.loc);
                        this.transfer_fingerprints_to(D);
                        GlobalFuncs.qdel(this);
                    }
                }
            }
            else if (A is Obj_Item_Weapon_Gun_Energy_Plasmacutter)
            {
                user.WriteMsg("<span class='notice'>You start slicing apart the girder...</span>");
                GlobalFuncs.playsound(this, "sound/items/welder.ogg", 100, 1);

                if (GlobalFuncs.do_after(user, 30, null, this))
                {
                    user.WriteMsg("<span class='notice'>You slice apart the girder.</span>");
                    M2 = new Obj_Item_Stack_Sheet_Metal(this.loc, 2);
                    M2.add_fingerprint(user);
                    GlobalFuncs.qdel(this);
                }
            }
            else if (A is Obj_Item_Weapon_Pickaxe_Drill_Jackhammer)
            {
                D2 = A;
                user.WriteMsg("<span class='notice'>You smash through the girder!</span>");
                new Obj_Item_Stack_Sheet_Metal(GlobalFuncs.get_turf(this));
                ((Obj_Item_Weapon_Pickaxe)D2).playDigSound();
                GlobalFuncs.qdel(this);
            }
            else if (A is Obj_Item_Weapon_Wirecutters && this.state == 1)
            {
                GlobalFuncs.playsound(this.loc, "sound/items/Wirecutter.ogg", 100, 1);
                user.WriteMsg("<span class='notice'>You start removing support struts...</span>");

                if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this))
                {
                    user.WriteMsg("<span class='notice'>You remove the support struts.</span>");
                    new Obj_Item_Stack_Sheet_Plasteel(GlobalFuncs.get_turf(this));
                    G2 = new Obj_Structure_Girder(this.loc);
                    this.transfer_fingerprints_to(G2);
                    GlobalFuncs.qdel(this);
                }
            }
            else if (A is Obj_Item_Stack)
            {
                if (this.loc is Tile_Simulated_Wall)
                {
                    user.WriteMsg("<span class='warning'>There is already a wall present!</span>");
                    return(null);
                }

                if (!(this.loc is Tile_Simulated_Floor))
                {
                    user.WriteMsg("<span class='warning'>A floor must be present to build a false wall!</span>");
                    return(null);
                }

                if (Lang13.Bool(Lang13.FindIn(typeof(Obj_Structure_Falsewall), this.loc.contents)))
                {
                    user.WriteMsg("<span class='warning'>There is already a false wall present!</span>");
                    return(null);
                }

                if (A is Obj_Item_Stack_Rods)
                {
                    S = A;

                    if (this.state == 3)
                    {
                        if (Convert.ToDouble(S.amount) < 2)
                        {
                            user.WriteMsg("<span class='warning'>You need at least two rods to create a false wall!</span>");
                            return(null);
                        }
                        user.WriteMsg("<span class='notice'>You start building a reinforced false wall...</span>");

                        if (GlobalFuncs.do_after(user, 20, null, this))
                        {
                            if (!(this.loc != null) || !Lang13.Bool(S) || Convert.ToDouble(S.amount) < 2)
                            {
                                return(null);
                            }
                            S.use(2);
                            user.WriteMsg("<span class='notice'>You create a false wall. Push on it to open or close the passage.</span>");
                            FW = new Obj_Structure_Falsewall_Iron(this.loc);
                            this.transfer_fingerprints_to(FW);
                            GlobalFuncs.qdel(this);
                        }
                    }
                    else
                    {
                        if (Convert.ToDouble(S.amount) < 5)
                        {
                            user.WriteMsg("<span class='warning'>You need at least five rods to add plating!</span>");
                            return(null);
                        }
                        user.WriteMsg("<span class='notice'>You start adding plating...</span>");

                        if (GlobalFuncs.do_after(user, 40, null, this))
                        {
                            if (!(this.loc != null) || !Lang13.Bool(S) || Convert.ToDouble(S.amount) < 5)
                            {
                                return(null);
                            }
                            S.use(5);
                            user.WriteMsg("<span class='notice'>You add the plating.</span>");
                            T = GlobalFuncs.get_turf(this);
                            ((Tile)T).ChangeTurf(typeof(Tile_Simulated_Wall_Mineral_Iron));
                            this.transfer_fingerprints_to(T);
                            GlobalFuncs.qdel(this);
                        }
                        return(null);
                    }
                }

                if (!(A is Obj_Item_Stack_Sheet))
                {
                    return(null);
                }
                S2 = A;

                dynamic _a = S2.type;                 // Was a switch-case, sorry for the mess.
                if (_a == typeof(Obj_Item_Stack_Sheet_Metal) || _a == typeof(Obj_Item_Stack_Sheet_Metal_Cyborg))
                {
                    if (this.state == 3)
                    {
                        if ((((Obj_Item_Stack)S2).get_amount() ?? 0) < 2)
                        {
                            user.WriteMsg("<span class='warning'>You need two sheets of metal to create a false wall!</span>");
                            return(null);
                        }
                        user.WriteMsg("<span class='notice'>You start building a false wall...</span>");

                        if (GlobalFuncs.do_after(user, 20, null, this))
                        {
                            if (!(this.loc != null) || !Lang13.Bool(S2) || (((Obj_Item_Stack)S2).get_amount() ?? 0) < 2)
                            {
                                return(null);
                            }
                            S2.use(2);
                            user.WriteMsg("<span class='notice'>You create a false wall. Push on it to open or close the passage.</span>");
                            F = new Obj_Structure_Falsewall(this.loc);
                            this.transfer_fingerprints_to(F);
                            GlobalFuncs.qdel(this);
                        }
                    }
                    else
                    {
                        if ((((Obj_Item_Stack)S2).get_amount() ?? 0) < 2)
                        {
                            user.WriteMsg("<span class='warning'>You need two sheets of metal to finish a wall!</span>");
                            return(null);
                        }
                        user.WriteMsg("<span class='notice'>You start adding plating...</span>");

                        if (GlobalFuncs.do_after(user, 40, null, this))
                        {
                            if (this.loc == null || (((Obj_Item_Stack)S2).get_amount() ?? 0) < 2)
                            {
                                return(null);
                            }
                            S2.use(2);
                            user.WriteMsg("<span class='notice'>You add the plating.</span>");
                            T2 = GlobalFuncs.get_turf(this);
                            ((Tile)T2).ChangeTurf(typeof(Tile_Simulated_Wall));
                            this.transfer_fingerprints_to(T2);
                            GlobalFuncs.qdel(this);
                        }
                        return(null);
                    }
                }
                else if (_a == typeof(Obj_Item_Stack_Sheet_Plasteel))
                {
                    if (this.state == 3)
                    {
                        if (Convert.ToDouble(S2.amount) < 2)
                        {
                            user.WriteMsg("<span class='warning'>You need at least two sheets to create a false wall!</span>");
                            return(null);
                        }
                        user.WriteMsg("<span class='notice'>You start building a reinforced false wall...</span>");

                        if (GlobalFuncs.do_after(user, 20, null, this))
                        {
                            if (!(this.loc != null) || !Lang13.Bool(S2) || Convert.ToDouble(S2.amount) < 2)
                            {
                                return(null);
                            }
                            S2.use(2);
                            user.WriteMsg("<span class='notice'>You create a reinforced false wall. Push on it to open or close the passage.</span>");
                            FW2 = new Obj_Structure_Falsewall_Reinforced(this.loc);
                            this.transfer_fingerprints_to(FW2);
                            GlobalFuncs.qdel(this);
                        }
                    }
                    else if (this.state == 2)
                    {
                        if (Convert.ToDouble(S2.amount) < 1)
                        {
                            return(null);
                        }
                        user.WriteMsg("<span class='notice'>You start finalizing the reinforced wall...</span>");

                        if (GlobalFuncs.do_after(user, 50, null, this))
                        {
                            if (!(this.loc != null) || !Lang13.Bool(S2) || Convert.ToDouble(S2.amount) < 1)
                            {
                                return(null);
                            }
                            S2.use(1);
                            user.WriteMsg("<span class='notice'>You fully reinforce the wall.</span>");
                            T3 = GlobalFuncs.get_turf(this);
                            ((Tile)T3).ChangeTurf(typeof(Tile_Simulated_Wall_RWall));
                            this.transfer_fingerprints_to(T3);
                            GlobalFuncs.qdel(this);
                        }
                        return(null);
                    }
                    else
                    {
                        if (Convert.ToDouble(S2.amount) < 1)
                        {
                            return(null);
                        }
                        user.WriteMsg("<span class='notice'>You start reinforcing the girder...</span>");

                        if (GlobalFuncs.do_after(user, 60, null, this))
                        {
                            if (!(this.loc != null) || !Lang13.Bool(S2) || Convert.ToDouble(S2.amount) < 1)
                            {
                                return(null);
                            }
                            S2.use(1);
                            user.WriteMsg("<span class='notice'>You reinforce the girder.</span>");
                            R = new Obj_Structure_Girder_Reinforced(this.loc);
                            this.transfer_fingerprints_to(R);
                            GlobalFuncs.qdel(this);
                        }
                        return(null);
                    }
                }

                if (Lang13.Bool(S2.sheettype))
                {
                    M3 = S2.sheettype;

                    if (this.state == 3)
                    {
                        if (Convert.ToDouble(S2.amount) < 2)
                        {
                            user.WriteMsg("<span class='warning'>You need at least two sheets to create a false wall!</span>");
                            return(null);
                        }
                        S2.use(2);
                        user.WriteMsg("<span class='notice'>You create a false wall. Push on it to open or close the passage.</span>");
                        F2  = Lang13.FindClass("/obj/structure/falsewall/" + M3);
                        FW3 = Lang13.Call(F2, this.loc);
                        this.transfer_fingerprints_to(FW3);
                        GlobalFuncs.qdel(this);
                    }
                    else
                    {
                        if (Convert.ToDouble(S2.amount) < 2)
                        {
                            user.WriteMsg("<span class='warning'>You need at least two sheets to add plating!</span>");
                            return(null);
                        }
                        user.WriteMsg("<span class='notice'>You start adding plating...</span>");

                        if (GlobalFuncs.do_after(user, 40, null, this))
                        {
                            if (!(this.loc != null) || !Lang13.Bool(S2) || Convert.ToDouble(S2.amount) < 2)
                            {
                                return(null);
                            }
                            S2.use(2);
                            user.WriteMsg("<span class='notice'>You add the plating.</span>");
                            T4 = GlobalFuncs.get_turf(this);
                            ((Tile)T4).ChangeTurf(Lang13.FindClass("/turf/simulated/wall/mineral/" + M3));
                            this.transfer_fingerprints_to(T4);
                            GlobalFuncs.qdel(this);
                        }
                        return(null);
                    }
                }
                this.add_hiddenprint(user);
            }
            else if (A is Obj_Item_Pipe)
            {
                P = A;

                if (new ByTable(new object [] { 0, 1, 5 }).Contains(P.pipe_type))
                {
                    if (!Lang13.Bool(user.drop_item()))
                    {
                        return(null);
                    }
                    P.loc = this.loc;
                    user.WriteMsg(new Txt("<span class='notice'>You fit the pipe into ").the(this).item().str(".</span>").ToString());
                }
            }
            else
            {
                base.attackby((object)(A), (object)(user), _params, silent, replace_spent);
            }
            return(null);
        }
Exemplo n.º 22
0
        // Function from file: telecomunications.dm
        public int?relay_information(Signal signal = null, dynamic filter = null, bool?copysig = null, int?amount = null)
        {
            amount = amount ?? 20;

            int?send_count = null;
            int netlag     = 0;
            Obj_Machinery_Telecomms machine = null;
            Signal copy = null;


            if (!this.on)
            {
                return(null);
            }
            send_count = 0;
            netlag     = Num13.Floor(this.traffic / 50);

            if (netlag > Convert.ToDouble(signal.data["slow"]))
            {
                signal.data["slow"] = netlag;
            }

            foreach (dynamic _a in Lang13.Enumerate(this.links, typeof(Obj_Machinery_Telecomms)))
            {
                machine = _a;


                if (Lang13.Bool(filter) && !Lang13.Bool(((dynamic)Lang13.FindClass(filter)).IsInstanceOfType(machine)))
                {
                    continue;
                }

                if (!machine.on)
                {
                    continue;
                }

                if (Lang13.Bool(amount) && (send_count ?? 0) >= (amount ?? 0))
                {
                    break;
                }

                if (machine.loc.z != this.listening_level)
                {
                    if (!this.long_range_link && !machine.long_range_link)
                    {
                        continue;
                    }
                }
                copy = new Signal();

                if (copysig == true)
                {
                    copy.transmission_method = 2;
                    copy.frequency           = signal.frequency;
                    copy.data = new ByTable()
                                .Set("mob", signal.data["mob"])
                                .Set("mobtype", signal.data["mobtype"])
                                .Set("realname", signal.data["realname"])
                                .Set("name", signal.data["name"])
                                .Set("job", signal.data["job"])
                                .Set("key", signal.data["key"])
                                .Set("vmask", signal.data["vmask"])
                                .Set("compression", signal.data["compression"])
                                .Set("message", signal.data["message"])
                                .Set("radio", signal.data["radio"])
                                .Set("slow", signal.data["slow"])
                                .Set("traffic", signal.data["traffic"])
                                .Set("type", signal.data["type"])
                                .Set("server", signal.data["server"])
                                .Set("reject", signal.data["reject"])
                                .Set("level", signal.data["level"])
                                .Set("spans", signal.data["spans"])
                                .Set("verb_say", signal.data["verb_say"])
                                .Set("verb_ask", signal.data["verb_ask"])
                                .Set("verb_exclaim", signal.data["verb_exclaim"])
                                .Set("verb_yell", signal.data["verb_yell"])
                    ;

                    if (!Lang13.Bool(signal.data["original"]))
                    {
                        copy.data["original"] = signal;
                    }
                    else
                    {
                        copy.data["original"] = signal.data["original"];
                    }
                }
                else
                {
                    copy = null;
                }
                send_count++;

                if (machine.is_freq_listening(signal))
                {
                    machine.traffic++;
                }

                if (copysig == true && copy != null)
                {
                    machine.receive_information(copy, this);
                }
                else
                {
                    machine.receive_information(signal, this);
                }
            }

            if ((send_count ?? 0) > 0 && this.is_freq_listening(signal))
            {
                this.traffic++;
            }
            return(send_count);
        }
        // Function from file: robot_fabricator.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            double? part_type  = null;
            string  build_type = null;
            int     build_time = 0;
            double  build_cost = 0;
            Type    building   = null;
            dynamic M          = null;


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

            if (Lang13.Bool(href_list["make"]))
            {
                if (!this.operating)
                {
                    part_type  = String13.ParseNumber(href_list["make"]);
                    build_type = "";
                    build_time = 200;
                    build_cost = 25000;

                    switch ((int?)(part_type))
                    {
                    case 1:
                        build_type = "/obj/item/robot_parts/l_arm";
                        build_time = 200;
                        build_cost = 10000;
                        break;

                    case 2:
                        build_type = "/obj/item/robot_parts/r_arm";
                        build_time = 200;
                        build_cost = 10000;
                        break;

                    case 3:
                        build_type = "/obj/item/robot_parts/l_leg";
                        build_time = 200;
                        build_cost = 10000;
                        break;

                    case 4:
                        build_type = "/obj/item/robot_parts/r_leg";
                        build_time = 200;
                        build_cost = 10000;
                        break;

                    case 5:
                        build_type = "/obj/item/robot_parts/chest";
                        build_time = 350;
                        build_cost = 40000;
                        break;

                    case 6:
                        build_type = "/obj/item/robot_parts/head";
                        build_time = 350;
                        build_cost = 5000;
                        break;

                    case 7:
                        build_type = "/obj/item/robot_parts/robot_suit";
                        build_time = 600;
                        build_cost = 15000;
                        break;
                    }
                    building = Lang13.FindClass(build_type);

                    if (!(building == null))
                    {
                        if (this.metal_amount >= build_cost)
                        {
                            this.operating    = true;
                            this.use_power    = 2;
                            this.metal_amount = Num13.MaxInt(0, ((int)(this.metal_amount - build_cost)));
                            this.being_built  = Lang13.Call(building, this);
                            this.overlays.Add("fab-active");
                            this.updateUsrDialog();
                            Task13.Schedule(build_time, (Task13.Closure)(() => {
                                if (!(this.being_built == null))
                                {
                                    this.being_built.loc = GlobalFuncs.get_turf(this);
                                    this.being_built     = null;
                                }
                                this.use_power = 1;
                                this.operating = false;
                                this.overlays.Remove("fab-active");
                                return;
                            }));
                        }
                    }
                }
                return(null);
            }

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


                if (Lang13.Bool(M.client) && M.machine == this)
                {
                    this.attack_hand(M);
                }
            }
            return(null);
        }
Exemplo n.º 24
0
        // Function from file: projectile.dm
        public override bool cast(dynamic targets = null, dynamic thearea = null, dynamic user = null)
        {
            thearea = thearea ?? Task13.User;

            Mob_Living         target          = null;
            dynamic            projectile      = null;
            Type               projectile_type = null;
            Ent_Static         current_loc     = null;
            int?               i     = null;
            Obj_Effect_Overlay trail = null;

            this.playMagSound();

            foreach (dynamic _a in Lang13.Enumerate(targets, typeof(Mob_Living)))
            {
                target = _a;

                Task13.Schedule(0, (Task13.Closure)(() => {
                    projectile = null;

                    if (this.proj_type is string)
                    {
                        projectile_type = Lang13.FindClass(this.proj_type);
                        projectile      = Lang13.Call(projectile_type, thearea);
                    }

                    if (this.proj_type is Obj_Effect_ProcHolder_Spell)
                    {
                        projectile = new Obj_Effect_ProcHolder_Spell_Targeted_Trigger(thearea);
                        projectile.linked_spells.Add(this.proj_type);
                    }
                    projectile.icon       = this.proj_icon;
                    projectile.icon_state = this.proj_icon_state;
                    projectile.dir        = Map13.GetDistance(target, projectile);
                    projectile.name       = this.proj_name;
                    current_loc           = thearea.loc;
                    projectile.loc        = current_loc;
                    i = null;
                    i = 0;

                    while ((i ?? 0) < (this.proj_lifespan ?? 0))
                    {
                        if (!Lang13.Bool(projectile))
                        {
                            break;
                        }

                        if (this.proj_homing)
                        {
                            if (this.proj_insubstantial)
                            {
                                projectile.dir = Map13.GetDistance(projectile, target);
                                projectile.loc = Map13.GetStepTowards(projectile, target, 0);
                            }
                            else
                            {
                                Map13.StepTowards(projectile, target, 0);
                            }
                        }
                        else if (this.proj_insubstantial)
                        {
                            projectile.loc = Map13.GetStep(projectile, this.dir);
                        }
                        else
                        {
                            Map13.Step(projectile, this.dir);
                        }

                        if (!Lang13.Bool(projectile))
                        {
                            break;
                        }

                        if (!(target != null) || !this.proj_lingering && projectile.loc == current_loc)
                        {
                            GlobalFuncs.qdel(projectile);
                            break;
                        }

                        if (this.proj_trail && Lang13.Bool(projectile))
                        {
                            Task13.Schedule(0, (Task13.Closure)(() => {
                                if (Lang13.Bool(projectile))
                                {
                                    trail            = new Obj_Effect_Overlay(projectile.loc);
                                    trail.icon       = this.proj_trail_icon;
                                    trail.icon_state = this.proj_trail_icon_state;
                                    trail.density    = false;
                                    Task13.Schedule(this.proj_trail_lifespan, (Task13.Closure)(() => {
                                        GlobalFuncs.qdel(trail);
                                        return;
                                    }));
                                }
                                return;
                            }));
                        }

                        if (Map13.FetchInRange(this.proj_trigger_range, target.loc).Contains(projectile.loc))
                        {
                            ((Obj_Effect_ProcHolder_Spell)projectile).perform(new ByTable(new object [] { target }), null, thearea);
                            break;
                        }
                        current_loc = projectile.loc;
                        Task13.Sleep(this.proj_step_delay);
                        i++;
                    }

                    if (Lang13.Bool(projectile))
                    {
                        GlobalFuncs.qdel(projectile);
                    }
                    return;
                }));
            }
            return(false);
        }
Exemplo n.º 25
0
        // Function from file: statues.dm
        public void Dismantle(bool?devastated = null)
        {
            devastated = devastated ?? false;

            Type ore  = null;
            int? i    = null;
            Type ore2 = null;
            int? i2   = null;
            Type ore3 = null;
            int? i3   = null;
            Type ore4 = null;
            int? i4   = null;


            if (!(devastated == true))
            {
                if (this.mineralType == "metal")
                {
                    ore = typeof(Obj_Item_Stack_Sheet_Metal);
                    i   = null;
                    i   = 1;

                    while ((i ?? 0) <= (this.oreAmount ?? 0))
                    {
                        Lang13.Call(ore, GlobalFuncs.get_turf(this));
                        i++;
                    }
                }
                else
                {
                    ore2 = Lang13.FindClass("/obj/item/stack/sheet/mineral/" + this.mineralType);
                    i2   = null;
                    i2   = 1;

                    while ((i2 ?? 0) <= (this.oreAmount ?? 0))
                    {
                        Lang13.Call(ore2, GlobalFuncs.get_turf(this));
                        i2++;
                    }
                }
            }
            else if (this.mineralType == "metal")
            {
                ore3 = typeof(Obj_Item_Stack_Sheet_Metal);
                i3   = null;
                i3   = 3;

                while ((i3 ?? 0) <= (this.oreAmount ?? 0))
                {
                    Lang13.Call(ore3, GlobalFuncs.get_turf(this));
                    i3++;
                }
            }
            else
            {
                ore4 = Lang13.FindClass("/obj/item/stack/sheet/mineral/" + this.mineralType);
                i4   = null;
                i4   = 3;

                while ((i4 ?? 0) <= (this.oreAmount ?? 0))
                {
                    Lang13.Call(ore4, GlobalFuncs.get_turf(this));
                    i4++;
                }
            }
            GlobalFuncs.qdel(this);
            return;
        }
Exemplo n.º 26
0
        // Function from file: airlock_maker.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            string     newname     = null;
            double?    value       = null;
            Ent_Static t_loc       = null;
            dynamic    target_type = null;
            dynamic    final       = null;
            dynamic    D           = null;


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

            if (!(this != null) || !(this.linked != null) || !(this.linked.loc != null))
            {
                Interface13.Browse(Task13.User, null, "window=airlockmaker");
                return(null);
            }

            if (href_list.Contains("rename"))
            {
                newname = GlobalFuncs.stripped_input(Task13.User, "New airlock name:", "Name the airlock", this.doorname);

                if (Lang13.Bool(newname))
                {
                    this.doorname = newname;
                }
            }

            if (href_list.Contains("access"))
            {
                value = String13.ParseNumber(href_list["access"]);
                this.access_used.Xor(value);
            }

            if (href_list.Contains("reqall"))
            {
                this.require_all = !this.require_all;
            }

            if (href_list.Contains("paint"))
            {
                this.paintjob = href_list["paint"];
            }

            if (href_list.Contains("glass"))
            {
                this.glassdoor = !this.glassdoor;
            }

            if (href_list.Contains("cancel"))
            {
                Interface13.Browse(Task13.User, null, "window=airlockmaker");
                GlobalFuncs.qdel(this.linked);
                GlobalFuncs.qdel(this);
                return(null);
            }

            if (href_list.Contains("done"))
            {
                Interface13.Browse(Task13.User, null, "window=airlockmaker");
                t_loc = this.linked.loc;
                GlobalFuncs.qdel(this.linked);

                if (!(t_loc is Tile))
                {
                    return(null);
                }
                target_type = "/obj/machinery/door/airlock";

                if (this.glassdoor)
                {
                    if (this.paintjob != "none")
                    {
                        if (new ByTable(new object [] { "external", "highsecurity", "maintenance" }).Contains(this.paintjob))
                        {
                            target_type += "/" + this.paintjob;
                        }
                        else
                        {
                            target_type += "/glass_" + this.paintjob;
                        }
                    }
                    else
                    {
                        target_type += "/glass";
                    }
                }
                else if (this.paintjob != "none")
                {
                    target_type += "/" + this.paintjob;
                }
                final       = target_type;
                target_type = Lang13.FindClass(final);

                if (!Lang13.Bool(target_type))
                {
                    Task13.User.WriteMsg("Didn't work, contact Sayu with this: " + final);
                    Interface13.Browse(Task13.User, null, "window=airlockmaker");
                    return(null);
                }
                D      = Lang13.Call(target_type, t_loc);
                D.name = this.doorname;

                if (this.access_used.len == 0)
                {
                    D.req_access     = null;
                    D.req_one_access = null;
                }
                else if (this.require_all)
                {
                    D.req_access     = this.access_used.Copy();
                    D.req_one_access = null;
                }
                else
                {
                    D.req_access     = null;
                    D.req_one_access = this.access_used.Copy();
                }
                return(null);
            }
            this.interact();
            return(null);
        }
Exemplo n.º 27
0
        // Function from file: h_sandbox.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            Mob P = null;
            Obj_Machinery_PortableAtmospherics_Scrubber hsb = null;
            Obj_Item_Weapon_Card_Id_Gold ID = null;
            dynamic all_items  = null;
            dynamic typekey    = null;
            dynamic O          = null;
            dynamic all_items2 = null;
            dynamic typekey2   = null;
            dynamic O2         = null;
            dynamic all_items3 = null;
            dynamic typekey3   = null;
            dynamic O3         = null;
            Type    typepath   = null;
            Type    typepath2  = null;


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

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

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

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

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

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

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

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

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

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

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

                            all_items -= Lang13.GetTypes(typekey);
                        }

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

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

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

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

                            all_items2 -= Lang13.GetTypes(typekey2);
                        }

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

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

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

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

                            all_items3 -= Lang13.GetTypes(typekey3);
                        }

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

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

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

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

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

                    if (GlobalVars.config.sandbox_autoclose)
                    {
                        Interface13.Browse(Task13.User, null, "window=sandbox");
                    }
                }
            }
            return(null);
        }
Exemplo n.º 28
0
        // Function from file: door_assembly.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            string             t          = null;
            dynamic            WT         = null;
            dynamic            icontype   = null;
            ByTable            optionlist = null;
            bool               has_solid  = false;
            bool               has_glass  = false;
            dynamic            WT2        = null;
            Type               M          = null;
            bool               door_check = false;
            Obj_Machinery_Door D          = null;
            dynamic            C          = null;
            dynamic            ae         = null;
            dynamic            G          = null;
            string             M2         = null;
            dynamic            door       = null;


            if (A is Obj_Item_Weapon_Pen)
            {
                t = GlobalFuncs.stripped_input(user, "Enter the name for the door.", this.name, this.created_name, 26);

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

                if (!(Map13.GetDistance(this, Task13.User) <= 1) && this.loc != Task13.User)
                {
                    return(null);
                }
                this.created_name = t;
                return(null);
            }
            else if (A is Obj_Item_Weapon_AirlockPainter)
            {
                WT = A;

                if (Lang13.Bool(WT.can_use(user)))
                {
                    if (Lang13.Bool(this.mineral) && this.mineral == "glass")
                    {
                        optionlist = new ByTable(new object [] { "Public", "Public2", "Engineering", "Atmospherics", "Security", "Command", "Medical", "Research", "Science", "Mining" });
                    }
                    else
                    {
                        optionlist = new ByTable(new object [] { "Public", "Engineering", "Atmospherics", "Security", "Command", "Medical", "Research", "Science", "Mining", "Maintenance", "External", "High Security" });
                    }
                    icontype = Interface13.Input(user, "Please select a paintjob for this airlock.", null, null, optionlist, InputType.Any);

                    if (!(Map13.GetDistance(this, Task13.User) <= 1) && this.loc != Task13.User || !Lang13.Bool(WT.use(user)))
                    {
                        return(null);
                    }
                    has_solid = false;
                    has_glass = false;

                    dynamic _a = icontype;                     // Was a switch-case, sorry for the mess.
                    if (_a == "Public")
                    {
                        this.icon          = "icons/obj/doors/airlocks/station/public.dmi";
                        this.overlays_file = "icons/obj/doors/airlocks/station/overlays.dmi";
                        this.typetext      = "";
                        this.icontext      = "";
                        has_solid          = true;
                        has_glass          = true;
                    }
                    else if (_a == "Public2")
                    {
                        this.icon          = "icons/obj/doors/airlocks/station2/glass.dmi";
                        this.overlays_file = "icons/obj/doors/airlocks/station2/overlays.dmi";
                        this.typetext      = "";
                        this.icontext      = "";
                        has_solid          = true;
                        has_glass          = true;
                    }
                    else if (_a == "Engineering")
                    {
                        this.icon          = "icons/obj/doors/airlocks/station/engineering.dmi";
                        this.overlays_file = "icons/obj/doors/airlocks/station/overlays.dmi";
                        this.typetext      = "engineering";
                        this.icontext      = "eng";
                        has_solid          = true;
                        has_glass          = true;
                    }
                    else if (_a == "Atmospherics")
                    {
                        this.icon          = "icons/obj/doors/airlocks/station/atmos.dmi";
                        this.overlays_file = "icons/obj/doors/airlocks/station/overlays.dmi";
                        this.typetext      = "atmos";
                        this.icontext      = "atmo";
                        has_solid          = true;
                        has_glass          = true;
                    }
                    else if (_a == "Security")
                    {
                        this.icon          = "icons/obj/doors/airlocks/station/security.dmi";
                        this.overlays_file = "icons/obj/doors/airlocks/station/overlays.dmi";
                        this.typetext      = "security";
                        this.icontext      = "sec";
                        has_solid          = true;
                        has_glass          = true;
                    }
                    else if (_a == "Command")
                    {
                        this.icon          = "icons/obj/doors/airlocks/station/command.dmi";
                        this.overlays_file = "icons/obj/doors/airlocks/station/overlays.dmi";
                        this.typetext      = "command";
                        this.icontext      = "com";
                        has_solid          = true;
                        has_glass          = true;
                    }
                    else if (_a == "Medical")
                    {
                        this.icon          = "icons/obj/doors/airlocks/station/medical.dmi";
                        this.overlays_file = "icons/obj/doors/airlocks/station/overlays.dmi";
                        this.typetext      = "medical";
                        this.icontext      = "med";
                        has_solid          = true;
                        has_glass          = true;
                    }
                    else if (_a == "Research")
                    {
                        this.icon          = "icons/obj/doors/airlocks/station/research.dmi";
                        this.overlays_file = "icons/obj/doors/airlocks/station/overlays.dmi";
                        this.typetext      = "research";
                        this.icontext      = "res";
                        has_solid          = true;
                        has_glass          = true;
                    }
                    else if (_a == "Science")
                    {
                        this.icon          = "icons/obj/doors/airlocks/station/science.dmi";
                        this.overlays_file = "icons/obj/doors/airlocks/station/overlays.dmi";
                        this.typetext      = "research";
                        this.icontext      = "res";
                        has_solid          = true;
                        has_glass          = true;
                    }
                    else if (_a == "Mining")
                    {
                        this.icon          = "icons/obj/doors/airlocks/station/mining.dmi";
                        this.overlays_file = "icons/obj/doors/airlocks/station/overlays.dmi";
                        this.typetext      = "mining";
                        this.icontext      = "min";
                        has_solid          = true;
                        has_glass          = true;
                    }
                    else if (_a == "Maintenance")
                    {
                        this.icon          = "icons/obj/doors/airlocks/station/maintenance.dmi";
                        this.overlays_file = "icons/obj/doors/airlocks/station/overlays.dmi";
                        this.typetext      = "maintenance";
                        this.icontext      = "mai";
                        has_solid          = true;
                        has_glass          = false;
                    }
                    else if (_a == "External")
                    {
                        this.icon          = "icons/obj/doors/airlocks/external/external.dmi";
                        this.overlays_file = "icons/obj/doors/airlocks/external/overlays.dmi";
                        this.typetext      = "external";
                        this.icontext      = "ext";
                        has_solid          = true;
                        has_glass          = false;
                    }
                    else if (_a == "High Security")
                    {
                        this.icon          = "icons/obj/doors/airlocks/highsec/highsec.dmi";
                        this.overlays_file = "icons/obj/doors/airlocks/highsec/overlays.dmi";
                        this.typetext      = "highsecurity";
                        this.icontext      = "highsec";
                        has_solid          = true;
                        has_glass          = false;
                    }

                    if (has_solid)
                    {
                        this.airlock_type = Lang13.FindClass("/obj/machinery/door/airlock/" + this.typetext);
                    }
                    else
                    {
                        this.airlock_type = typeof(Obj_Machinery_Door_Airlock);
                    }

                    if (has_glass)
                    {
                        this.glass_type = Lang13.FindClass("/obj/machinery/door/airlock/glass_" + this.typetext);
                    }
                    else
                    {
                        this.glass_type = typeof(Obj_Machinery_Door_Airlock_Glass);
                    }

                    if (Lang13.Bool(this.mineral) && this.mineral != "glass")
                    {
                        this.mineral = null;
                    }
                    user.WriteMsg("<span class='notice'>You change the paintjob on the airlock assembly.</span>");
                }
            }
            else if (A is Obj_Item_Weapon_Weldingtool && !Lang13.Bool(this.anchored))
            {
                WT2 = A;

                if (((Obj_Item_Weapon_Weldingtool)WT2).remove_fuel(0, user))
                {
                    ((Ent_Static)user).visible_message("<span class='warning'>" + user + " disassembles the airlock assembly.</span>", "You start to disassemble the airlock assembly...");
                    GlobalFuncs.playsound(this.loc, "sound/items/welder2.ogg", 50, 1);

                    if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this))
                    {
                        if (!((Obj_Item_Weapon_Weldingtool)WT2).isOn())
                        {
                            return(null);
                        }
                        user.WriteMsg("<span class='notice'>You disassemble the airlock assembly.</span>");
                        new Obj_Item_Stack_Sheet_Metal(GlobalFuncs.get_turf(this), 4);

                        if (Lang13.Bool(this.mineral))
                        {
                            if (this.mineral == "glass")
                            {
                                if (this.heat_proof_finished)
                                {
                                    new Obj_Item_Stack_Sheet_Rglass(GlobalFuncs.get_turf(this));
                                }
                                else
                                {
                                    new Obj_Item_Stack_Sheet_Glass(GlobalFuncs.get_turf(this));
                                }
                            }
                            else
                            {
                                M = Lang13.FindClass("/obj/item/stack/sheet/mineral/" + this.mineral);
                                Lang13.Call(M, GlobalFuncs.get_turf(this));
                                Lang13.Call(M, GlobalFuncs.get_turf(this));
                            }
                        }
                        GlobalFuncs.qdel(this);
                    }
                }
                else
                {
                    return(null);
                }
            }
            else if (A is Obj_Item_Weapon_Wrench && !Lang13.Bool(this.anchored))
            {
                door_check = true;

                foreach (dynamic _b in Lang13.Enumerate(this.loc, typeof(Obj_Machinery_Door)))
                {
                    D = _b;


                    if (!D.sub_door)
                    {
                        door_check = false;
                        break;
                    }
                }

                if (door_check)
                {
                    GlobalFuncs.playsound(this.loc, "sound/items/ratchet.ogg", 100, 1);
                    ((Ent_Static)user).visible_message("" + user + " secures the airlock assembly to the floor.", "<span class='notice'>You start to secure the airlock assembly to the floor...</span>", "<span class='italics'>You hear wrenching.</span>");

                    if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this))
                    {
                        if (Lang13.Bool(this.anchored))
                        {
                            return(null);
                        }
                        user.WriteMsg("<span class='notice'>You secure the airlock assembly.</span>");
                        this.name     = "secured airlock assembly";
                        this.anchored = 1;
                    }
                }
                else
                {
                    user.WriteMsg("There is another door here!");
                }
            }
            else if (A is Obj_Item_Weapon_Wrench && Lang13.Bool(this.anchored))
            {
                GlobalFuncs.playsound(this.loc, "sound/items/ratchet.ogg", 100, 1);
                ((Ent_Static)user).visible_message("" + user + " unsecures the airlock assembly from the floor.", "<span class='notice'>You start to unsecure the airlock assembly from the floor...</span>", "<span class='italics'>You hear wrenching.</span>");

                if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this))
                {
                    if (!Lang13.Bool(this.anchored))
                    {
                        return(null);
                    }
                    user.WriteMsg("<span class='notice'>You unsecure the airlock assembly.</span>");
                    this.name     = "airlock assembly";
                    this.anchored = 0;
                }
            }
            else if (A is Obj_Item_Stack_CableCoil && this.state == 0 && Lang13.Bool(this.anchored))
            {
                C = A;

                if ((((Obj_Item_Stack)C).get_amount() ?? 0) < 1)
                {
                    user.WriteMsg("<span class='warning'>You need one length of cable to wire the airlock assembly!</span>");
                    return(null);
                }
                ((Ent_Static)user).visible_message("" + user + " wires the airlock assembly.", "<span class='notice'>You start to wire the airlock assembly...</span>");

                if (GlobalFuncs.do_after(user, 40, null, this))
                {
                    if ((((Obj_Item_Stack)C).get_amount() ?? 0) < 1 || this.state != 0)
                    {
                        return(null);
                    }
                    C.use(1);
                    this.state = 1;
                    user.WriteMsg("<span class='notice'>You wire the airlock assembly.</span>");
                    this.name = "wired airlock assembly";
                }
            }
            else if (A is Obj_Item_Weapon_Wirecutters && this.state == 1)
            {
                GlobalFuncs.playsound(this.loc, "sound/items/Wirecutter.ogg", 100, 1);
                ((Ent_Static)user).visible_message("" + user + " cuts the wires from the airlock assembly.", "<span class='notice'>You start to cut the wires from the airlock assembly...</span>");

                if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this))
                {
                    if (this.state != 1)
                    {
                        return(null);
                    }
                    user.WriteMsg("<span class='notice'>You cut the wires from the airlock assembly.</span>");
                    new Obj_Item_Stack_CableCoil(GlobalFuncs.get_turf(user), 1);
                    this.state = 0;
                    this.name  = "secured airlock assembly";
                }
            }
            else if (A is Obj_Item_Weapon_Electronics_Airlock && this.state == 1)
            {
                GlobalFuncs.playsound(this.loc, "sound/items/Screwdriver.ogg", 100, 1);
                ((Ent_Static)user).visible_message("" + user + " installs the electronics into the airlock assembly.", "<span class='notice'>You start to install electronics into the airlock assembly...</span>");

                if (GlobalFuncs.do_after(user, 40, null, this))
                {
                    if (this.state != 1)
                    {
                        return(null);
                    }

                    if (!Lang13.Bool(user.drop_item()))
                    {
                        return(null);
                    }
                    A.loc = this;
                    user.WriteMsg("<span class='notice'>You install the airlock electronics.</span>");
                    this.state       = 2;
                    this.name        = "near finished airlock assembly";
                    this.electronics = A;
                }
            }
            else if (A is Obj_Item_Weapon_Crowbar && this.state == 2)
            {
                GlobalFuncs.playsound(this.loc, "sound/items/Crowbar.ogg", 100, 1);
                ((Ent_Static)user).visible_message("" + user + " removes the electronics from the airlock assembly.", "<span class='notice'>You start to remove electronics from the airlock assembly...</span>");

                if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this))
                {
                    if (this.state != 2)
                    {
                        return(null);
                    }
                    user.WriteMsg("<span class='notice'>You remove the airlock electronics.</span>");
                    this.state = 1;
                    this.name  = "wired airlock assembly";
                    ae         = null;

                    if (!Lang13.Bool(this.electronics))
                    {
                        ae = new Obj_Item_Weapon_Electronics_Airlock(this.loc);
                    }
                    else
                    {
                        ae = this.electronics;
                        this.electronics = null;
                        ae.loc           = this.loc;
                    }
                }
            }
            else if (A is Obj_Item_Stack_Sheet && !Lang13.Bool(this.mineral))
            {
                G = A;

                if (Lang13.Bool(G))
                {
                    if ((((Obj_Item_Stack)G).get_amount() ?? 0) >= 1)
                    {
                        if (G is Obj_Item_Stack_Sheet_Rglass || G is Obj_Item_Stack_Sheet_Glass)
                        {
                            GlobalFuncs.playsound(this.loc, "sound/items/Crowbar.ogg", 100, 1);
                            ((Ent_Static)user).visible_message("" + user + " adds " + G.name + " to the airlock assembly.", "<span class='notice'>You start to install " + G.name + " into the airlock assembly...</span>");

                            if (GlobalFuncs.do_after(user, 40, null, this))
                            {
                                if ((((Obj_Item_Stack)G).get_amount() ?? 0) < 1 || Lang13.Bool(this.mineral))
                                {
                                    return(null);
                                }

                                if (G.type == typeof(Obj_Item_Stack_Sheet_Rglass))
                                {
                                    user.WriteMsg("<span class='notice'>You install reinforced glass windows into the airlock assembly.</span>");
                                    this.heat_proof_finished = true;
                                    this.name = "near finished heat-proofed window airlock assembly";
                                }
                                else
                                {
                                    user.WriteMsg("<span class='notice'>You install regular glass windows into the airlock assembly.</span>");
                                    this.name = "near finished window airlock assembly";
                                }
                                G.use(1);
                                this.mineral  = "glass";
                                this.material = "glass";

                                if (new ByTable(new object [] { "eng", "atmo", "sec", "com", "med", "res", "min" }).Contains(this.icontext))
                                {
                                    this.airlock_type = Lang13.FindClass("/obj/machinery/door/airlock/" + this.typetext);
                                    this.glass_type   = Lang13.FindClass("/obj/machinery/door/airlock/glass_" + this.typetext);
                                }
                                else
                                {
                                    this.airlock_type = typeof(Obj_Machinery_Door_Airlock);
                                    this.glass_type   = typeof(Obj_Machinery_Door_Airlock_Glass);
                                    this.typetext     = "";
                                    this.icontext     = "";
                                }
                            }
                        }
                        else if (G is Obj_Item_Stack_Sheet_Mineral)
                        {
                            M2 = G.sheettype;

                            if ((((Obj_Item_Stack)G).get_amount() ?? 0) >= 2)
                            {
                                GlobalFuncs.playsound(this.loc, "sound/items/Crowbar.ogg", 100, 1);
                                ((Ent_Static)user).visible_message("" + user + " adds " + G.name + " to the airlock assembly.", "<span class='notice'>You start to install " + G.name + " into the airlock assembly...</span>");

                                if (GlobalFuncs.do_after(user, 40, null, this))
                                {
                                    if ((((Obj_Item_Stack)G).get_amount() ?? 0) < 2 || Lang13.Bool(this.mineral))
                                    {
                                        return(null);
                                    }
                                    user.WriteMsg("<span class='notice'>You install " + M2 + " plating into the airlock assembly.</span>");
                                    G.use(2);
                                    this.mineral      = "" + M2;
                                    this.name         = "near finished " + M2 + " airlock assembly";
                                    this.airlock_type = Lang13.FindClass("/obj/machinery/door/airlock/" + M2);
                                    this.glass_type   = typeof(Obj_Machinery_Door_Airlock_Glass);
                                }
                            }
                        }
                    }
                }
            }
            else if (A is Obj_Item_Weapon_Screwdriver && this.state == 2)
            {
                GlobalFuncs.playsound(this.loc, "sound/items/Screwdriver.ogg", 100, 1);
                ((Ent_Static)user).visible_message("" + user + " finishes the airlock.", "<span class='notice'>You start finishing the airlock...</span>");

                if (GlobalFuncs.do_after(user, 40 / A.toolspeed, null, this))
                {
                    if (this.loc != null && this.state == 2)
                    {
                        user.WriteMsg("<span class='notice'>You finish the airlock.</span>");
                        door = null;

                        if (this.mineral == "glass")
                        {
                            door = Lang13.Call(this.glass_type, this.loc);
                        }
                        else
                        {
                            door = Lang13.Call(this.airlock_type, this.loc);
                        }
                        door.electronics = this.electronics;
                        door.heat_proof  = this.heat_proof_finished;

                        if (this.electronics.one_access)
                        {
                            door.req_one_access = this.electronics.accesses;
                        }
                        else
                        {
                            door.req_access = this.electronics.accesses;
                        }

                        if (Lang13.Bool(this.created_name))
                        {
                            door.name = this.created_name;
                        }
                        this.electronics.loc = door;
                        GlobalFuncs.qdel(this);
                    }
                }
            }
            else
            {
                base.attackby((object)(A), (object)(user), _params, silent, replace_spent);
            }
            this.update_icon();
            return(null);
        }
Exemplo n.º 29
0
        // Function from file: gang_datum.dm
        public bool gang_outfit(Mob user = null, Obj_Item_Device_Gangtool gangtool = null)
        {
            ByTable gang_style_list = null;
            Type    outfit_path     = null;
            dynamic outfit          = null;


            if (!(user != null) || !(gangtool != null))
            {
                return(false);
            }

            if (!gangtool.can_use(user))
            {
                return(false);
            }
            gang_style_list = new ByTable(new object [] { "Gang Colors", "Black Suits", "White Suits", "Leather Jackets", "Leather Overcoats", "Puffer Jackets", "Military Jackets", "Tactical Turtlenecks", "Soviet Uniforms" });

            if (!Lang13.Bool(this.style) && ((GameMode)GlobalVars.ticker.mode).get_gang_bosses().Contains(user.mind))
            {
                this.style = Interface13.Input("Pick an outfit style.", "Pick Style", null, null, gang_style_list, InputType.Null | InputType.Any);
            }

            if (gangtool.can_use(user) && gangtool.outfits >= 1)
            {
                dynamic _a = this.style;                 // Was a switch-case, sorry for the mess.
                if (_a == "Gang Colors")
                {
                    outfit_path = Lang13.FindClass("/obj/item/clothing/under/color/" + this.color);
                }
                else if (_a == "Black Suits")
                {
                    outfit_path = typeof(Obj_Item_Clothing_Under_SuitJacket_Charcoal);
                }
                else if (_a == "White Suits")
                {
                    outfit_path = typeof(Obj_Item_Clothing_Under_SuitJacket_White);
                }
                else if (_a == "Puffer Jackets")
                {
                    outfit_path = typeof(Obj_Item_Clothing_Suit_Jacket_Puffer);
                }
                else if (_a == "Leather Jackets")
                {
                    outfit_path = typeof(Obj_Item_Clothing_Suit_Jacket_Leather);
                }
                else if (_a == "Leather Overcoats")
                {
                    outfit_path = typeof(Obj_Item_Clothing_Suit_Jacket_Leather_Overcoat);
                }
                else if (_a == "Military Jackets")
                {
                    outfit_path = typeof(Obj_Item_Clothing_Suit_Jacket_Miljacket);
                }
                else if (_a == "Soviet Uniforms")
                {
                    outfit_path = typeof(Obj_Item_Clothing_Under_Soviet);
                }
                else if (_a == "Tactical Turtlenecks")
                {
                    outfit_path = typeof(Obj_Item_Clothing_Under_Syndicate);
                }

                if (outfit_path != null)
                {
                    outfit       = Lang13.Call(outfit_path, user.loc);
                    outfit.armor = new ByTable().Set("melee", 20).Set("bullet", 30).Set("laser", 10).Set("energy", 10).Set("bomb", 20).Set("bio", 0).Set("rad", 0);
                    outfit.desc += " Tailored for the " + this.name + " Gang to offer the wearer moderate protection against ballistics and physical trauma.";
                    outfit.gang  = this;
                    user.put_in_hands(outfit);
                    return(true);
                }
            }
            return(false);
        }