// Function from file: equipment_locker.dm
        public void CollectOre(  )
        {
            Obj_Item_Weapon_Ore O   = null;
            dynamic             dir = null;
            Tile T = null;


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

                O.loc = this;
            }

            foreach (dynamic _c in Lang13.Enumerate(GlobalVars.alldirs))
            {
                dir = _c;

                T = Map13.GetStep(this, Convert.ToInt32(dir));

                foreach (dynamic _b in Lang13.Enumerate(T, typeof(Obj_Item_Weapon_Ore)))
                {
                    O = _b;

                    O.loc = this;
                }
            }
            return;
        }
Exemplo n.º 2
0
        // Function from file: satchel_ore_boxdm.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            dynamic             S = null;
            Obj_Item_Weapon_Ore O = null;


            if (A is Obj_Item_Weapon_Ore)
            {
                if (!Lang13.Bool(user.drop_item()))
                {
                    return(null);
                }
                A.loc = this;
            }

            if (A is Obj_Item_Weapon_Storage)
            {
                S = A;
                ((Obj_Item_Weapon_Storage)S).hide_from(Task13.User);

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

                    ((Obj_Item_Weapon_Storage)S).remove_from_storage(O, this);
                }
                user.WriteMsg("<span class='notice'>You empty the satchel into the box.</span>");
            }
            return(null);
        }
Exemplo n.º 3
0
        // Function from file: satchel_ore_boxdm.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            Obj_Item_Weapon_Ore O = 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["removeall"]))
            {
                foreach (dynamic _a in Lang13.Enumerate(this.contents, typeof(Obj_Item_Weapon_Ore)))
                {
                    O = _a;

                    this.contents.Remove(O);
                    O.loc = this.loc;
                }
                Task13.User.WriteMsg("<span class='notice'>You empty the box.</span>");
            }
            this.updateUsrDialog();
            return(null);
        }
Exemplo n.º 4
0
        // Function from file: ripley.dm
        public override bool Move(dynamic NewLoc = null, int?Dir = null, int step_x = 0, int step_y = 0)
        {
            bool _default = false;

            dynamic             ore_box = null;
            Obj_Item_Weapon_Ore ore     = null;

            _default = base.Move((object)(NewLoc), Dir, step_x, step_y);

            if (_default && Lang13.Bool(Lang13.FindIn(typeof(Obj_Item_MechaParts_MechaEquipment_HydraulicClamp), this.equipment)))
            {
                ore_box = Lang13.FindIn(typeof(Obj_Structure_OreBox), this.cargo);

                if (Lang13.Bool(ore_box))
                {
                    foreach (dynamic _a in Lang13.Enumerate(GlobalFuncs.get_turf(this), typeof(Obj_Item_Weapon_Ore)))
                    {
                        ore = _a;

                        ore.Move(ore_box);
                    }
                }
            }
            this.update_pressure();
            return(_default);
        }
Exemplo n.º 5
0
        // Function from file: equipment_locker.dm
        public Type SmeltMineral(Obj_Item_Weapon_Ore O = null)
        {
            Type M = null;


            if (O.refined_type != null)
            {
                M            = O.refined_type;
                this.points += O.points * Convert.ToDouble(this.point_upgrade);
                return(M);
            }
            GlobalFuncs.qdel(O);
            return(null);
        }
        // Function from file: tgstation.dme
        public override int?process(dynamic seconds = null)
        {
            Tile T                 = null;
            int  limit             = 0;
            Obj_Structure_OreBox B = null;
            Obj_Item_Weapon_Ore  O = null;
            Obj_Item             I = null;

            T = Map13.GetStep(this, this.input_dir);

            if (T != null)
            {
                foreach (dynamic _b in Lang13.Enumerate(T, typeof(Obj_Structure_OreBox)))
                {
                    B = _b;


                    foreach (dynamic _a in Lang13.Enumerate(B, typeof(Obj_Item_Weapon_Ore)))
                    {
                        O = _a;

                        B.contents.Remove(O);
                        this.unload_mineral(O);
                        limit++;

                        if (limit >= 10)
                        {
                            return(null);
                        }
                    }
                }

                foreach (dynamic _c in Lang13.Enumerate(T, typeof(Obj_Item)))
                {
                    I = _c;

                    this.unload_mineral(I);
                    limit++;

                    if (limit >= 10)
                    {
                        return(null);
                    }
                }
            }
            return(null);
        }
        // Function from file: equipment_locker.dm
        public void DropOre(  )
        {
            Obj_Item_Weapon_Ore O = null;


            if (!(this.contents.len != 0))
            {
                return;
            }

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

                this.contents.Remove(O);
                O.loc = this.loc;
            }
            return;
        }
Exemplo n.º 8
0
        // Function from file: mining_mobs.dm
        public void EatOre(dynamic targeted_ore = null)
        {
            Obj_Item_Weapon_Ore O = null;


            foreach (dynamic _a in Lang13.Enumerate(targeted_ore.loc, typeof(Obj_Item_Weapon_Ore)))
            {
                O = _a;


                if (this.loot.len < 10)
                {
                    this.loot.Add(O.type);
                    GlobalFuncs.qdel(O);
                }
            }
            this.visible_message("<span class='notice'>The ore was swallowed whole!</span>");
            return;
        }
Exemplo n.º 9
0
        // Function from file: equipment_locker.dm
        public void process_sheet(Obj_Item_Weapon_Ore O = null)
        {
            Type    processed_sheet = null;
            dynamic s   = null;
            string  msg = null;
            Obj_Machinery_RequestsConsole D = null;
            dynamic storage = null;

            processed_sheet = this.SmeltMineral(O);

            if (processed_sheet != null)
            {
                if (!this.stack_list.Contains(processed_sheet))
                {
                    s        = Lang13.Call(processed_sheet, this, 0);
                    s.amount = 0;
                    this.stack_list[processed_sheet] = s;

                    if (s.name != "glass" && s.name != "metal")
                    {
                        msg = "" + GlobalFuncs.capitalize(s.name) + " sheets are now available in the Cargo Bay.";

                        foreach (dynamic _a in Lang13.Enumerate(GlobalVars.allConsoles, typeof(Obj_Machinery_RequestsConsole)))
                        {
                            D = _a;


                            if (D.department == "Science" || D.department == "Robotics" || D.department == "Research Director's Desk" || D.department == "Chemistry" && (s.name == "uranium" || s.name == "solid plasma"))
                            {
                                D.createmessage("Ore Redemption Machine", "New minerals available!", msg, 1);
                            }
                        }
                    }
                }
                storage         = this.stack_list[processed_sheet];
                storage.amount += this.sheet_per_ore;
                O.loc           = null;
                GlobalFuncs.qdel(O);
            }
            return;
        }
        // Function from file: mine_turfs.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            double              digging_speed = 0;
            dynamic             S             = null;
            dynamic             P             = null;
            Ent_Static          T             = null;
            dynamic             S2            = null;
            Obj_Item_Weapon_Ore O             = null;
            dynamic             Z             = null;
            dynamic             T2            = null;
            dynamic             L             = null;
            dynamic             F             = null;


            if (!Lang13.Bool(A) || !Lang13.Bool(user))
            {
                return(0);
            }
            digging_speed = 0;

            if (A is Obj_Item_Weapon_Shovel)
            {
                S             = A;
                digging_speed = Convert.ToDouble(S.digspeed);
            }
            else if (A is Obj_Item_Weapon_Pickaxe)
            {
                P             = A;
                digging_speed = Convert.ToDouble(P.digspeed);
            }

            if (digging_speed != 0)
            {
                T = user.loc;

                if (!(T is Tile))
                {
                    return(null);
                }

                if (this.dug)
                {
                    user.WriteMsg("<span class='warning'>This area has already been dug!</span>");
                    return(null);
                }
                user.WriteMsg("<span class='notice'>You start digging...</span>");
                GlobalFuncs.playsound(this, "sound/effects/shovel_dig.ogg", 50, 1);

                if (GlobalFuncs.do_after(user, digging_speed, null, this))
                {
                    if (this is Tile_Simulated_Floor_Plating_Asteroid)
                    {
                        user.WriteMsg("<span class='notice'>You dig a hole.</span>");
                        this.gets_dug();
                        GlobalFuncs.feedback_add_details("pick_used_mining", "" + A.type);
                    }
                }
            }

            if (A is Obj_Item_Weapon_Storage_Bag_Ore)
            {
                S2 = A;

                if (S2.collection_mode == 1)
                {
                    foreach (dynamic _a in Lang13.Enumerate(this.contents, typeof(Obj_Item_Weapon_Ore)))
                    {
                        O = _a;

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

            if (A is Obj_Item_Stack_Tile)
            {
                Z = A;

                if (!(((Obj_Item_Stack)Z).use(1) != 0))
                {
                    return(null);
                }
                T2 = this.ChangeTurf(Z.turf_type);

                if (Z is Obj_Item_Stack_Tile_Light)
                {
                    L       = Z;
                    F       = T2;
                    F.state = L.state;
                }
                GlobalFuncs.playsound(this, "sound/weapons/genhit.ogg", 50, 1);
            }
            return(null);
        }
Exemplo n.º 11
0
        // Function from file: satchel_ore_boxdm.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            int amt_gold          = 0;
            int amt_silver        = 0;
            int amt_diamond       = 0;
            int amt_glass         = 0;
            int amt_iron          = 0;
            int amt_plasma        = 0;
            int amt_uranium       = 0;
            int amt_clown         = 0;
            int amt_bluespace     = 0;
            Obj_Item_Weapon_Ore C = null;
            string dat            = null;

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if (amt_bluespace != 0)
            {
                dat += "Bluespace crystals: " + amt_bluespace + "<br>";
            }
            dat += new Txt("<br><br><A href='?src=").Ref(this).str(";removeall=1'>Empty box</A>").ToString();
            Interface13.Browse(a, "" + dat, "window=orebox");
            return(null);
        }
        public override bool f_action(dynamic target = null)
        {
            dynamic target_obj          = null;
            Tile_Simulated_Mineral M    = null;
            dynamic             ore_box = null;
            Obj_Item_Weapon_Ore ore     = null;
            Tile_Simulated_Floor_Plating_Asteroid M2 = null;
            dynamic             ore_box2             = null;
            Obj_Item_Weapon_Ore ore2 = null;


            if (!this.action_checks(target))
            {
                return(false);
            }

            if (target is Tile && !(target is Tile_Simulated))
            {
                return(false);
            }

            if (target is Obj)
            {
                target_obj = target;

                if (target_obj.unacidable)
                {
                    return(false);
                }
            }
            ((Ent_Static)target).visible_message("<span class='warning'>" + this.chassis + " starts to drill " + target + ".</span>", "<span class='userdanger'>" + this.chassis + " starts to drill " + target + "...</span>", "<span class='italics'>You hear drilling.</span>");

            if (this.do_after_cooldown(target))
            {
                if (target is Tile_Simulated_Wall_RWall)
                {
                    if (this is Obj_Item_MechaParts_MechaEquipment_Drill_Diamonddrill)
                    {
                        if (this.do_after_cooldown(target))
                        {
                            this.log_message("Drilled through " + target);
                            ((Ent_Static)target).ex_act(3);
                        }
                    }
                    else
                    {
                        this.occupant_message("<span class='danger'>" + target + " is too durable to drill through.</span>");
                    }
                }
                else if (target is Tile_Simulated_Mineral)
                {
                    foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInRange(1, this.chassis), typeof(Tile_Simulated_Mineral)))
                    {
                        M = _a;


                        if ((Map13.GetDistance(this.chassis, M) & this.chassis.dir) != 0)
                        {
                            M.gets_drilled(this.chassis.occupant);
                        }
                    }
                    this.log_message("Drilled through " + target);

                    if (Lang13.Bool(Lang13.FindIn(typeof(Obj_Item_MechaParts_MechaEquipment_HydraulicClamp), this.chassis.equipment)))
                    {
                        ore_box = Lang13.FindIn(typeof(Obj_Structure_OreBox), ((dynamic)this.chassis).cargo);

                        if (Lang13.Bool(ore_box))
                        {
                            foreach (dynamic _b in Lang13.Enumerate(Map13.FetchInRange(this.chassis, 1), typeof(Obj_Item_Weapon_Ore)))
                            {
                                ore = _b;


                                if ((Map13.GetDistance(this.chassis, ore) & this.chassis.dir) != 0)
                                {
                                    ore.Move(ore_box);
                                }
                            }
                        }
                    }
                }
                else if (target is Tile_Simulated_Floor_Plating_Asteroid)
                {
                    foreach (dynamic _c in Lang13.Enumerate(Map13.FetchInRange(this.chassis, 1), typeof(Tile_Simulated_Floor_Plating_Asteroid)))
                    {
                        M2 = _c;


                        if ((Map13.GetDistance(this.chassis, M2) & this.chassis.dir) != 0)
                        {
                            M2.gets_dug();
                        }
                    }
                    this.log_message("Drilled through " + target);

                    if (Lang13.Bool(Lang13.FindIn(typeof(Obj_Item_MechaParts_MechaEquipment_HydraulicClamp), this.chassis.equipment)))
                    {
                        ore_box2 = Lang13.FindIn(typeof(Obj_Structure_OreBox), ((dynamic)this.chassis).cargo);

                        if (Lang13.Bool(ore_box2))
                        {
                            foreach (dynamic _d in Lang13.Enumerate(Map13.FetchInRange(this.chassis, 1), typeof(Obj_Item_Weapon_Ore)))
                            {
                                ore2 = _d;


                                if ((Map13.GetDistance(this.chassis, ore2) & this.chassis.dir) != 0)
                                {
                                    ore2.Move(ore_box2);
                                }
                            }
                        }
                    }
                }
                else
                {
                    this.log_message("Drilled through " + target);

                    if (target is Mob_Living)
                    {
                        if (this is Obj_Item_MechaParts_MechaEquipment_Drill_Diamonddrill)
                        {
                            this.drill_mob(target, this.chassis.occupant, 120);
                        }
                        else
                        {
                            this.drill_mob(target, this.chassis.occupant);
                        }
                    }
                    else
                    {
                        ((Ent_Static)target).ex_act(2);
                    }
                }
            }
            return(false);
        }
Exemplo n.º 13
0
        // Function from file: equipment_locker.dm
        public override int?process(dynamic seconds = null)
        {
            Tile T = null;
            int  i = 0;
            Obj_Item_Weapon_Ore O  = null;
            dynamic             B  = null;
            Obj_Item_Weapon_Ore O2 = null;


            if (!Lang13.Bool(this.panel_open) && Lang13.Bool(this.powered()))
            {
                T = Map13.GetStep(this, this.input_dir);
                i = 0;

                if (T != null)
                {
                    foreach (dynamic _a in Lang13.Enumerate(T, typeof(Obj_Item_Weapon_Ore)))
                    {
                        O = _a;


                        if (i >= Convert.ToDouble(this.ore_pickup_rate))
                        {
                            break;
                        }
                        else if (!(O != null) || !(O.refined_type != null))
                        {
                            continue;
                        }
                        else
                        {
                            this.process_sheet(O);
                            i++;
                        }
                    }
                }
                else
                {
                    B = Lang13.FindIn(typeof(Obj_Structure_OreBox), T);

                    if (Lang13.Bool(B))
                    {
                        foreach (dynamic _b in Lang13.Enumerate(B.contents, typeof(Obj_Item_Weapon_Ore)))
                        {
                            O2 = _b;


                            if (i >= Convert.ToDouble(this.ore_pickup_rate))
                            {
                                break;
                            }
                            else if (!(O2 != null) || !(O2.refined_type != null))
                            {
                                continue;
                            }
                            else
                            {
                                this.process_sheet(O2);
                                i++;
                            }
                        }
                    }
                }
            }
            return(null);
        }