Example #1
0
        // Function from file: rods.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_Rods        R        = null;
            bool    replace = false;
            dynamic S       = null;
            Obj_Item_Weapon_ReagentContainers_Food_Snacks_Customizable_Kebab A2 = null;


            if (A is Obj_Item_Weapon_Weldingtool)
            {
                WT = A;

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

                if (((Obj_Item_Weapon_Weldingtool)WT).remove_fuel(0, user))
                {
                    new_item = new Obj_Item_Stack_Sheet_Metal(Task13.User.loc);
                    ((Ent_Static)user).visible_message("" + user.name + " shaped " + this + " into metal with the welding tool.", "<span class='notice'>You shape " + this + " into metal with the welding tool.</span>", "<span class='italics'>You hear welding.</span>");
                    R             = this;
                    Task13.Source = null;
                    replace       = ((Mob)user).get_inactive_hand() == R;
                    R.use(2);

                    if (!(R != null) && replace)
                    {
                        ((Mob)user).put_in_hands(new_item);
                    }
                }
                return(null);
            }

            if (A is Obj_Item_Weapon_ReagentContainers_Food_Snacks)
            {
                S = A;

                if (this.amount != 1)
                {
                    user.WriteMsg("<span class='warning'>You must use a single rod!</span>");
                }
                else if (Convert.ToDouble(S.w_class) > 2)
                {
                    user.WriteMsg("<span class='warning'>The ingredient is too big for " + this + "!</span>");
                }
                else
                {
                    A2 = new Obj_Item_Weapon_ReagentContainers_Food_Snacks_Customizable_Kebab(GlobalFuncs.get_turf(this));
                    A2.initialize_custom_food(this, S, user);
                }
                return(null);
            }
            base.attackby((object)(A), (object)(user), _params, silent, replace_spent);
            return(null);
        }