Exemplo n.º 1
0
 public override void Hero_action(BaseEnemy enemy, BaseHero hero)
 {
     if (hero.Mana < 0 || hero.Mana < ManaCost)
     {
         Console.WriteLine("You do not have enough mana");
     }
     else
     {
         hero.Mana -= 20;
         // enemy.health-=20;
         enemy.TakeDamage(ManaCost);
         enemy.Mana -= ManaCost;
         Console.WriteLine("The {0} is bleeding {1} Mana and Health...", enemy.name, ManaCost);
     }
 }
Exemplo n.º 2
0
        public override void Hero_action(BaseEnemy enemy, BaseHero hero)
        {
            if (hero.Mana < 0 || hero.Mana < ManaCost)
            {
                Console.WriteLine("You do not have enough mana");
            }
            else
            {
                Random randDamage = new Random();
                int    topDamage  = 50 + hero.intelligence;
                int    damageDone = randDamage.Next(20, topDamage);
                enemy.TakeDamage(damageDone);

                hero.Mana = hero.Mana - ManaCost;
                Console.WriteLine("The Fireball did " + damageDone + " damage to the " + enemy.name);
            }
        }
Exemplo n.º 3
0
 public override void Hero_action(BaseEnemy enemy, BaseHero hero)
 {
     if (hero.Mana < 0 || hero.Mana < ManaCost)
     {
         Console.WriteLine("You do not have enough mana");
     }
     else
     {
         Random rand       = new Random();
         int    luckdamage = rand.Next(hero.luck + 10, 80);
         enemy.TakeDamage(luckdamage);
         // mana cost
         hero.Mana -= ManaCost;
         // reset luck to default
         hero.luck = 20;
         Console.WriteLine(enemy.name + " health went down by " + luckdamage);
     }
 }
Exemplo n.º 4
0
 public override void Hero_action(BaseEnemy enemy, BaseHero hero)
 {
     if (hero.Mana < 0 || hero.Mana < ManaCost)
     {
         Console.WriteLine("You do not have enough mana");
     }
     else
     {
         hero.Mana -= ManaCost;
         // this.health-=10;
         hero.TakeDamage(10);
         if (enemy.health <= 50)
         {
             enemy.health = 0;
             Console.WriteLine("Enemy {0} Executed", enemy.name);
         }
         else
         {
             // enemy.health-=50;
             enemy.TakeDamage(50);
             Console.WriteLine("Enemy {0} health is now {1}..Stike The Vermine", enemy.name, enemy.health);
         }
     }
 }
Exemplo n.º 5
0
 public override void Hero_action(BaseEnemy enemy, BaseHero hero)
 {
     enemy.TakeDamage(hero.strength);
     Console.WriteLine("You did " + hero.strength + " damage to " + enemy.name);
 }
Exemplo n.º 6
0
 public abstract void Hero_action(BaseEnemy enemy, BaseHero hero);
Exemplo n.º 7
0
 public override void Hero_action(BaseEnemy enemy, BaseHero hero)
 {
     hero.luck += 30;
     hero.Mana -= ManaCost;
     Console.WriteLine("Your luck increased by 30 for one round...Choose a wise Attack");
 }
Exemplo n.º 8
0
 public void calibrateToHero(BaseHero hero)
 {
     this.enemy = hero;
     Console.WriteLine("OK.. " + this.name + " is Calibrating on " + this.enemy.name);
 }
Exemplo n.º 9
0
        static void Main(string[] args)
        {
            bool   gameStarted  = true;
            string HeroSelected = null;
            bool   battleStarted;
            string attackOption = null;
            int    round;

            while (gameStarted == true)
            {
                Console.WriteLine("^^^^Welcome to the Aaron's Arena, Where Smashing your face come a reality.....^^^^");

                // User should choose a Hero...
                while (HeroSelected == null)
                {
                    Console.WriteLine("Select You Hero before entering the Arena... Choose Wisely !!!!");

                    Console.WriteLine("Samurai            Ninja          Wizard");
                    HeroSelected = Console.ReadLine();
                    if (HeroSelected == "Samurai" || HeroSelected == "Ninja" || HeroSelected == "Wizard")
                    {
                        Console.WriteLine("You have selected a " + HeroSelected + ".... Nice Choice. Good Luck out there..LOL \n");
                    }
                    else
                    {
                        HeroSelected = null;
                    }
                }

                // Create the Hero, base on user input
                BaseHero Hero = null;
                switch (HeroSelected)
                {
                case "Samurai":
                    Hero = new Samurai();
                    break;

                case "Ninja":
                    Hero = new Ninja();
                    break;

                case "Wizard":
                    Hero = new Wizard();
                    break;
                }
                battleStarted = true;
                round         = 1;
                Random    RandomMonster = new Random();
                BaseEnemy Monster       = null;
                while (battleStarted == true)
                {
                    bool RoundStart = true;
                    int  result     = RandomMonster.Next(1, 4);

                    switch (result)
                    {
                    case 1:
                        Monster = new Spider();
                        break;

                    case 2:
                        Monster = new Orgre();
                        break;

                    case 3:
                        Monster = new Zombie();
                        break;
                    }

                    while (RoundStart == true)
                    {
                        Hero.DisplayStatus();
                        Console.WriteLine(Monster.name + " health is " + Monster.health);
                        Console.WriteLine("........................ Round " + round + " ....................... \n");
                        Console.WriteLine("-------------------- " + Hero.name + " VS " + Monster.name + " ---------------\n");
                        Monster.calibrateToHero(Hero);
                        Hero.AttackOptions();
                        Console.Write("Your Move: ");
                        attackOption = Console.ReadLine();
                        Hero.chosenAttack(attackOption, Monster);

                        Console.WriteLine(Monster.name + " is attaking you now.... Don't Die!!!");
                        Monster.chosenAttack();
                        Console.WriteLine("\n");
                        round++;

                        if (Hero.health <= 0 || Monster.health <= 0)
                        {
                            bool EndOfMatch = true;
                            RoundStart = false;
                            if (Hero.health > 0)
                            {
                                while (EndOfMatch == true)
                                {
                                    Console.WriteLine("The Winner is " + Hero.name + " Ohhh... You got lucky");
                                    Console.WriteLine("There is more Monsters if you want to crush them.... -->>Yes??");
                                    string answer = Console.ReadLine();
                                    if (answer == "Yes" || answer == "yes")
                                    {
                                        EndOfMatch  = false;
                                        Hero.health = Hero.max_health;
                                        Hero.Mana   = Hero.max_Mana;
                                    }
                                    else if (answer == "no" || answer == "No")
                                    {
                                        battleStarted = false;
                                        EndOfMatch    = false;
                                        HeroSelected  = null;
                                    }
                                }
                            }
                            else
                            {
                                while (EndOfMatch == true)
                                {
                                    Console.WriteLine("You Lost.... The Winner is " + Monster.name);
                                    Console.WriteLine("You can return to the home screen, by typing 'I Lost'");
                                    string answer = Console.ReadLine();
                                    if (answer == "i lost" || answer == "I Lost")
                                    {
                                        battleStarted = false;
                                        EndOfMatch    = false;
                                        HeroSelected  = null;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }