Beispiel #1
0
 protected new void StartObject(BitmapImage Image, double ImageWidth, double ImageHeight)
 {
     StartImage(Image, ImageWidth, ImageHeight);
     StartMovement();
     StartCollision();
     StartNotebook();
     this.Inventory = new Inventory();
     Inventory.AddPotion(PotionDAO.GetPotions()[0]);
     Inventory.AddPotion(PotionDAO.GetPotions()[1]);
 }
Beispiel #2
0
        private void GenerateItem()
        {
            if (ChestItems.Count < MAXIMUM_SLOTS_IN_CHEST)
            {
                Random NumRandom  = new Random();
                Random NumRandom2 = new Random();

                int RandomNumber  = NumRandom.Next(8);
                int RandomNumber2 = NumRandom2.Next(100);

                switch (RandomNumber)
                {
                case 1:
                    if (RandomNumber2 <= 75)
                    {
                        ChestItems.Add(HardwareDAO.GetHardware()[0][0]);
                    }
                    else if (RandomNumber2 > 75 && RandomNumber2 <= 95)
                    {
                        ChestItems.Add(HardwareDAO.GetHardware()[0][1]);
                    }
                    else
                    {
                        ChestItems.Add(HardwareDAO.GetHardware()[0][2]);
                    }
                    break;

                case 2:
                    if (RandomNumber2 <= 75)
                    {
                        ChestItems.Add(HardwareDAO.GetHardware()[1][0]);
                    }
                    else if (RandomNumber2 > 75 && RandomNumber2 <= 95)
                    {
                        ChestItems.Add(HardwareDAO.GetHardware()[1][1]);
                    }
                    else
                    {
                        ChestItems.Add(HardwareDAO.GetHardware()[1][2]);
                    }
                    break;

                case 3:
                    if (RandomNumber2 <= 75)
                    {
                        ChestItems.Add(HardwareDAO.GetHardware()[2][0]);
                    }
                    else if (RandomNumber2 > 75 && RandomNumber2 <= 95)
                    {
                        ChestItems.Add(HardwareDAO.GetHardware()[2][1]);
                    }
                    else
                    {
                        ChestItems.Add(HardwareDAO.GetHardware()[2][2]);
                    }
                    break;

                case 4:
                    if (RandomNumber2 <= 75)
                    {
                        ChestItems.Add(HardwareDAO.GetHardware()[3][0]);
                    }
                    else if (RandomNumber2 > 75 && RandomNumber2 <= 95)
                    {
                        ChestItems.Add(HardwareDAO.GetHardware()[3][1]);
                    }
                    else
                    {
                        ChestItems.Add(HardwareDAO.GetHardware()[3][2]);
                    }
                    break;

                case 5:
                    if (RandomNumber2 <= 75)
                    {
                        ChestItems.Add(HardwareDAO.GetHardware()[4][0]);
                    }
                    else if (RandomNumber2 > 75 && RandomNumber2 <= 95)
                    {
                        ChestItems.Add(HardwareDAO.GetHardware()[4][1]);
                    }
                    else
                    {
                        ChestItems.Add(HardwareDAO.GetHardware()[4][2]);
                    }
                    break;

                case 6:
                    ChestItems.Add(PotionDAO.GetPotions()[0]);
                    break;

                case 7:
                    ChestItems.Add(PotionDAO.GetPotions()[1]);
                    break;

                default:
                    break;
                }
            }
        }