Ejemplo n.º 1
0
        // Persuade

        // Pick pocket

        // Decorate weapon
        public bool DecorateWeapon(WeaponDecorator wpnDecorator,
                                   AbstractWeapon weapon)
        {
            AbstractWeapon newWeapon;

            if (weapon is WeaponDecorator)
            {
                //cant decorate
                return(false);
            }
            else if (wpnDecorator is RedGem)
            {
                //// Decorate fire weapon
                //newWeapon = new RedGem(weapon);
                //Inventory.Push(newWeapon);
                //Render.UpdateItemFeed(this);

                Inventory = new Stack <IItem>();
                // Decorate fire weapon
                newWeapon = new RedGem(weapon);
                Inventory.Push(newWeapon);
                Render.UpdateItemFeed(this);

                return(true);

                // Add other items to inventory
            }
            else if (wpnDecorator is BlueGem)
            {
                Inventory = new Stack <IItem>();

                newWeapon = new BlueGem(weapon);
                Inventory.Push(newWeapon);
                Render.UpdateItemFeed(this);

                return(true);

                // Add other items to inventory
            }
            else if (wpnDecorator is GreenGem)
            {
                Inventory = new Stack <IItem>();

                newWeapon = new GreenGem(weapon);
                Inventory.Push(newWeapon);
                Render.UpdateItemFeed(this);

                return(true);

                // Add the deleted items
            }
            // Other decorations

            return(false);
        }
Ejemplo n.º 2
0
        public override void AddItems()
        {
            AbstractWeapon item = new GreenGem();

            Items.Add(item);
        }