コード例 #1
0
        // Function from file: glass.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            dynamic CC = null;
            Obj_Item_Stack_LightW new_tile = null;
            dynamic V = null;
            Obj_Item_Stack_Sheet_Rglass RG = null;
            Obj_Item_Stack_Sheet_Glass  G  = null;
            bool replace = false;

            base.attackby((object)(A), (object)(user), _params, silent, replace_spent);
            this.add_fingerprint(user);

            if (A is Obj_Item_Stack_CableCoil)
            {
                CC = A;

                if ((this.get_amount() ?? 0) < 1 || (((Obj_Item_Stack)CC).get_amount() ?? 0) < 5)
                {
                    user.WriteMsg("<span class='warning>You need five lengths of coil and one sheet of glass to make wired glass!</span>");
                    return(null);
                }
                CC.use(5);
                this.use(1);
                user.WriteMsg("<span class='notice'>You attach wire to the " + this.name + ".</span>");
                new_tile = new Obj_Item_Stack_LightW(user.loc);
                new_tile.add_fingerprint(user);
            }
            else if (A is Obj_Item_Stack_Rods)
            {
                V = A;

                if ((((Obj_Item_Stack)V).get_amount() ?? 0) >= 1 && (this.get_amount() ?? 0) >= 1)
                {
                    RG = new Obj_Item_Stack_Sheet_Rglass(user.loc);
                    RG.add_fingerprint(user);
                    G             = this;
                    Task13.Source = null;
                    replace       = ((Mob)user).get_inactive_hand() == G;
                    V.use(1);
                    G.use(1);

                    if (!(G != null) && replace)
                    {
                        ((Mob)user).put_in_hands(RG);
                    }
                }
                else
                {
                    user.WriteMsg("<span class='warning'>You need one rod and one sheet of glass to make reinforced glass!</span>");
                    return(null);
                }
            }
            else
            {
                return(base.attackby((object)(A), (object)(user), _params, silent, replace_spent));
            }
            return(null);
        }