Esempio n. 1
0
        //used when a player attacks an enemy
        public static int AttackEnemy(Entity enemy, Entity player)
        {
            int playerAttack = player.UseAttack();
            int chance       = ConsoleEffects.RandomNumber(1, 5);

            if (chance <= 3)
            {
                enemy.Health -= player.Attack;
                Console.WriteLine("\r\n" + player.Name + " hit " + enemy.Name + " for " + playerAttack + ".");
                CheckHealth(enemy);
                ConsoleEffects.TypeLine(enemy.Name + " has " + enemy.Health + " health.\r\n\r\n");
                return(enemy.Health);
            }
            //double attack
            else if (chance == 4)
            {
                Console.WriteLine("\r\n" + player.Name + " hit " + enemy.Name + " for " + playerAttack + ".");
                System.Threading.Thread.Sleep(500);
                //possible random to decide damage
                int secondPlayerAttack = player.UseAttack();
                enemy.Health -= (playerAttack + secondPlayerAttack);
                ConsoleEffects.ColorTextGreen(player.Name + " hits for a second attacks. " + player.Name + " hit " + enemy.Name + " for " + secondPlayerAttack + ".");
                CheckHealth(enemy);
                ConsoleEffects.TypeLine(enemy.Name + " has " + enemy.Health + " health.\r\n\r\n");

                return(enemy.Health);
            }
            else if (chance == 5)
            {
                Console.WriteLine(enemy.Name + " dodged the attack.\r\n\r\n");
                return(enemy.Health);
            }
            return(enemy.Health);
        }
Esempio n. 2
0
        public int CastFreeze()
        {
            int attack = ConsoleEffects.RandomNumber(5, 8);

            return(MagicAttack = attack);
            //should also freeze the enemy causing it to lose a turn.  Enabled at higher level
        }
Esempio n. 3
0
        //used when an enemy attacks a player
        public static int AttackPlayer(Entity enemy, Entity player)
        {
            int enemyAttack = enemy.UseAttack();
            int chance      = ConsoleEffects.RandomNumber(1, 5);

            if (chance <= 3)
            {
                player.Health -= enemyAttack;
                CheckHealth(player);
                Console.WriteLine(enemy.Name + " hit " + player.Name + " for " + enemyAttack + ".");
                ConsoleEffects.TypeLine(player.Name + " has " + player.Health + " health.\r\n\r\n");
                return(player.Health);
            }
            //enemy hits twice
            if (chance == 4)
            {
                ConsoleEffects.TypeLine(enemy.Name + " hit " + player.Name + " for " + enemyAttack + ".\r\n");
                //possible random to decide damage
                int secondEnemyAttack = enemy.UseAttack();
                player.Health -= (enemyAttack + secondEnemyAttack);
                CheckHealth(player);
                System.Threading.Thread.Sleep(500);
                ConsoleEffects.ColorTextRed(enemy.Name + " hits for a second attacks. " + enemy.Name + " hit " + player.Name + " for " + secondEnemyAttack + ".");
                ConsoleEffects.TypeLine(player.Name + " has " + player.Health + " health.\r\n\r\n");
                return(player.Health);
            }
            Console.WriteLine(player.Name + " dodged the attack.\r\n");
            return(player.Health);
        }
Esempio n. 4
0
//End Fight Process



        public static int LootEnemy(Entity player, Entity enemy)
        {
            int goldAmount = ConsoleEffects.RandomNumber(8, enemy.Gold);

            ConsoleEffects.TypeLine(enemy.Name + " dropped " + goldAmount + " gold.\r\n");
            player.Gold += goldAmount;
            ConsoleEffects.TypeLine(player.Name + " now has " + player.Gold + " gold.");

            return(player.Gold);
        }
Esempio n. 5
0
        public override int UseAttack()
        {
            int attack = ConsoleEffects.RandomNumber(3, 5);

            return(Attack = attack);
        }
Esempio n. 6
0
        public int CastFire()
        {
            int attack = ConsoleEffects.RandomNumber(10, 15);

            return(MagicAttack = attack);
        }
Esempio n. 7
0
        public override int RollMana()
        {
            int maxMana = ConsoleEffects.RandomNumber(25, 33);

            return(MaxMana = maxMana);
        }
Esempio n. 8
0
        public int CastSmite()
        {
            int attack = ConsoleEffects.RandomNumber(5, 8);

            return(MagicAttack = attack);
        }
Esempio n. 9
0
        public int CastHeal()
        {
            int heal = ConsoleEffects.RandomNumber(5, 8);

            return(Health += heal);
        }
Esempio n. 10
0
        public override int RollHealth()
        {
            int maxHealth = ConsoleEffects.RandomNumber(125, 150);

            return(MaxHealth = maxHealth);
        }