Esempio n. 1
0
        public void TestWeaponDamagetoHealth()
        {
            Player attacker = new Player("Dave", Races.Human, Classes.Knight);
            Player defender = new Player("Steve-O", Races.Dwarf, Classes.Mage);

            attacker.AttackPower = 21;
            defender.DamageResistance = 9;
            defender.Health = 100;

            _repo.AddPlayerToDirectory(attacker);
            _repo.AddPlayerToDirectory(defender);

            Console.WriteLine($"{attacker.PlayerName} starts with attack of {attacker.AttackPower}.");
            Console.WriteLine($"{attacker.PlayerName} rolls, and now has attack value of {_repo.AttackWithWeapon(attacker.PlayerName, attacker)}.");
            Console.WriteLine();
            Console.WriteLine($"{defender.PlayerName} starts with defense of {defender.DamageResistance}.");
            Console.WriteLine($"{defender.PlayerName} rolls, and now has defense value of {_repo.DefendAgainstWeapon(defender.PlayerName, defender)}.");
            Console.WriteLine();

            Console.WriteLine(_repo.CombatWeapon(attacker.PlayerName,  defender.PlayerName));
            Console.WriteLine();
            Console.WriteLine(_repo.WeaponDamageToHealth(attacker.PlayerName, defender.PlayerName, defender));
            //next iteration
            Thread.Sleep(1000);
            Console.WriteLine($"{attacker.PlayerName} starts with attack of {attacker.AttackPower}.");
            Console.WriteLine($"{attacker.PlayerName} rolls, and now has attack value of {_repo.AttackWithWeapon(attacker.PlayerName, attacker)}.");
            Console.WriteLine();
            Console.WriteLine($"{defender.PlayerName} starts with defense of {defender.DamageResistance}.");
            Console.WriteLine($"{defender.PlayerName} rolls, and now has defense value of {_repo.DefendAgainstWeapon(defender.PlayerName, defender)}.");
            Console.WriteLine();

            Console.WriteLine(_repo.CombatWeapon(attacker.PlayerName, defender.PlayerName));
            Console.WriteLine();
            Console.WriteLine(_repo.WeaponDamageToHealth(attacker.PlayerName, defender.PlayerName, defender));
            //Next Iteration
            Thread.Sleep(1000);

            Console.WriteLine($"{attacker.PlayerName} starts with attack of {attacker.AttackPower}.");
            Console.WriteLine($"{attacker.PlayerName} rolls, and now has attack value of {_repo.AttackWithWeapon(attacker.PlayerName, attacker)}.");
            Console.WriteLine();
            Console.WriteLine($"{defender.PlayerName} starts with defense of {defender.DamageResistance}.");
            Console.WriteLine($"{defender.PlayerName} rolls, and now has defense value of {_repo.DefendAgainstWeapon(defender.PlayerName, defender)}.");
            Console.WriteLine();

            Console.WriteLine(_repo.CombatWeapon(attacker.PlayerName, defender.PlayerName));
            Console.WriteLine();
            Console.WriteLine(_repo.WeaponDamageToHealth(attacker.PlayerName, defender.PlayerName, defender));



        }