Exemple #1
0
        public void DestroyItem(string itemForDestruction)
        {
            switch (itemForDestruction)
            {
            case "weapon":
                Toolbar.SystemMsg.Instance.AllMessages.Add(new Dictionary <string, Color>()
                {
                    { String.Format(">> {0} destroyed.", this.Weapon.Name), Color.Red }
                });
                this.Weapon = null;
                break;

            case "shield":
                Toolbar.SystemMsg.Instance.AllMessages.Add(new Dictionary <string, Color>()
                {
                    { String.Format(">> You destroyed {0}.", this.Shield.Name), Color.Red }
                });
                this.Shield = null;
                break;

            case "gloves":
                Toolbar.SystemMsg.Instance.AllMessages.Add(new Dictionary <string, Color>()
                {
                    { String.Format(">> You destroyed {0}.", this.Gloves.Name), Color.Red }
                });
                this.Gloves = null;
                break;

            case "robe":
                Toolbar.SystemMsg.Instance.AllMessages.Add(new Dictionary <string, Color>()
                {
                    { String.Format(">> You destroyed {0}.", this.Robe.Name), Color.Red }
                });
                this.Robe = null;
                break;

            case "boots":
                Toolbar.SystemMsg.Instance.AllMessages.Add(new Dictionary <string, Color>()
                {
                    { String.Format(">> You destroyed {0}.", this.Boots.Name), Color.Red }
                });
                this.Boots = null;
                break;

            case "helmet":
                Toolbar.SystemMsg.Instance.AllMessages.Add(new Dictionary <string, Color>()
                {
                    { String.Format(">> You destroyed {0}.", this.Helmet.Name), Color.Red }
                });
                this.Helmet = null;
                break;
            }
        }
Exemple #2
0
 public void BuyItem(Interfaces.IItem newItem, int coinsSpent)
 {
     if (coinsSpent <= this.Coins.Amount)
     {
         if (newItem.ToString().Contains("Elixir"))
         {
             CompleteTransaction(newItem, coinsSpent);
             this.Elixirs = (Items.ElixirsHP)newItem;
         }
         else if (newItem.ToString().Contains("Boots"))
         {
             if (this.Boots != null)
             {
                 Toolbar.SystemMsg.Instance.AllMessages.Add(new Dictionary <string, Color>()
                 {
                     { String.Format(">> First destroy your Boots!"), Color.Red }
                 });
             }
             else
             {
                 CompleteTransaction(newItem, coinsSpent);
                 this.Boots = (Interfaces.IBoots)newItem;
             }
         }
         else if (newItem.ToString().Contains("Gloves"))
         {
             if (this.Gloves != null)
             {
                 Toolbar.SystemMsg.Instance.AllMessages.Add(new Dictionary <string, Color>()
                 {
                     { String.Format(">> First destroy your Gloves!"), Color.Red }
                 });
             }
             else
             {
                 CompleteTransaction(newItem, coinsSpent);
                 this.Gloves = (Interfaces.IGloves)newItem;
             }
         }
         else if (newItem.ToString().Contains("Helmet"))
         {
             if (this.Helmet != null)
             {
                 Toolbar.SystemMsg.Instance.AllMessages.Add(new Dictionary <string, Color>()
                 {
                     { String.Format(">> First destroy your Helmet!"), Color.Red }
                 });
             }
             else
             {
                 CompleteTransaction(newItem, coinsSpent);
                 this.Helmet = (Interfaces.IHelmet)newItem;
             }
         }
         else if (newItem.ToString().Contains("Robe"))
         {
             if (this.Robe != null)
             {
                 Toolbar.SystemMsg.Instance.AllMessages.Add(new Dictionary <string, Color>()
                 {
                     { String.Format(">> First destroy your Robe!"), Color.Red }
                 });
             }
             else
             {
                 CompleteTransaction(newItem, coinsSpent);
                 this.Robe = (Interfaces.IRobe)newItem;
             }
         }
         else if (newItem.ToString().Contains("Shield"))
         {
             if (this.Shield != null)
             {
                 Toolbar.SystemMsg.Instance.AllMessages.Add(new Dictionary <string, Color>()
                 {
                     { String.Format(">> First destroy your Shield!"), Color.Red }
                 });
             }
             else
             {
                 CompleteTransaction(newItem, coinsSpent);
                 this.Shield = (Interfaces.IShield)newItem;
             }
         }
         else if (newItem.ToString().Contains("Weapon"))
         {
             if (this.Weapon != null)
             {
                 Toolbar.SystemMsg.Instance.AllMessages.Add(new Dictionary <string, Color>()
                 {
                     { String.Format(">> First destroy your Weapon!"), Color.Red }
                 });
             }
             else
             {
                 CompleteTransaction(newItem, coinsSpent);
                 this.Weapon = (Interfaces.IWeapon)newItem;
             }
         }
     }
     else
     {
         Toolbar.SystemMsg.Instance.AllMessages.Add(new Dictionary <string, Color>()
         {
             { ">> Not enough coins.", Color.Red }
         });
     }
 }