Example #1
0
        public void startEnchantment()
        {
            Random s_Random = new Random();
            int    perCent  = s_Random.Next(0, 100);

            EnchantmentStrength main = minorE;

            if (perCent < 30)
            {
                main.addToPlayerStrength(3);
            }
            else if (perCent < 60)
            {
                main.addToPlayerStrength(2);
            }
            else if (perCent < 90)
            {
                main.addToPlayerStrength(1);
            }
            else
            {
                main.addToPlayerStrength(0);
            }
            p.gold -= enchantmentCost;
        }
Example #2
0
 public void addToPlayerStrength(int value)
 {
     if (strength == value)
     {
         Console.WriteLine("You got a {0} enchantment!", value);
         p.setAttack(p.getAttack() + strength);
         p.setDefence(p.getDefence() + strength);
     }
     else
     {
         Console.WriteLine("This is the not the correct enchantment");
         next.addToPlayerStrength(value);
     }
 }