Beispiel #1
0
 public Character()
 {
     lvl   = 1;
     str   = 1;
     intl  = 1;
     agi   = 30;
     phatk = 1;
     matk  = 1;
     def   = 1;
     vit   = 100;
     wis   = 50;
     hp    = vit;
     gold  = 0;
     exp   = 0;
     msgs  = new CharacterMessages();
     msgs.RaiseCustomEvent += Messaging;
 }
Beispiel #2
0
        public Hostile(int enemy_lvl, Queue <string> names, CharacterMessages msgs)
        {
            Random rand = new Random();

            lvl = enemy_lvl;
            if (lvl > 4 && lvl < 10)
            {
                if (names.Peek().CompareTo("GrimReaper") == 0)
                {
                    names.Dequeue();
                }
                if (names.Peek().CompareTo("Angel") == 0)
                {
                    names.Dequeue();
                }
                lvl = lvl + rand.Next(1, 3);
            }
            if (lvl == 10)
            {
                if (names.Peek().CompareTo("Succubus") == 0)
                {
                    names.Dequeue();
                }
                if (names.Peek().CompareTo("Unicorn") == 0)
                {
                    names.Dequeue();
                }
                lvl = lvl + rand.Next(2, 6);
            }
            Name  = names.Peek();
            Class = "Monster";
            str   = 15 + (4 * lvl);
            intl  = 17 + (4 * lvl);
            agi   = 140 + (70 * lvl);
            phatk = 30 + (8 * lvl);
            matk  = 35 + (8 * lvl);
            def   = 12 + (4 * lvl);
            vit   = 100 + (80 * lvl);
            hp    = vit;
            wis   = 200 + (70 * lvl);
            gold  = rand.Next(1, 21);
            exp   = 0;
        }
Beispiel #3
0
        public void RangerBattle(Hostile hostile, Character character, int enemy_turn, Queue <string> Battlestats, CharacterMessages msgs)
        {
            string typech;
            int    typen;

            Console.WriteLine("Type <<Skill_list>> to begin fight");
            while (true)
            {
                typech = Console.ReadLine();
                if (typech.CompareTo("Skill_list") == 0)
                {
                    System.Console.Clear();
                    Asciidraw.drawpic("Header");
                    if (hostile.Name.CompareTo("Succubus") == 0)
                    {
                        Asciidraw.drawpic("Succubus");
                    }
                    else if (hostile.Name.CompareTo("GrimReaper") == 0)
                    {
                        Asciidraw.drawpic("GrimReaper");
                    }
                    else if (hostile.Name.CompareTo("Archlord") == 0)
                    {
                        Asciidraw.drawpic("Archlord");
                    }
                    else if (hostile.Name.CompareTo("CentaurQueen") == 0)
                    {
                        Asciidraw.drawpic("CentaurQueen");
                    }
                    else if (hostile.Name.CompareTo("Unicorn") == 0)
                    {
                        Asciidraw.drawpic("Unicorn");
                    }
                    else
                    {
                        Asciidraw.drawpic("Angel");
                    }
                    CharactersAbilities.RangerShowSkillList();
                    Console.WriteLine("Choose skill number:");
                    typen = Convert.ToInt32(Console.ReadLine());
                    switch (typen)
                    {
                    case 1:

                        hostile.hp = hostile.hp - CharactersAbilities.AutoShoot(character.str, character.phatk);
                        break;

                    case 2:
                        if ((70 + 20 * character.lvl) < character.ep)
                        {
                            character.ep = character.ep - (70 + 20 * character.lvl);
                            hostile.hp   = hostile.hp - CharactersAbilities.PowerArrow(character.str, character.phatk);
                        }
                        else
                        {
                            Console.WriteLine("Not enough energy. Try to use another skill");
                            continue;
                        }

                        break;

                    case 3:

                        character.ep = character.ep + CharactersAbilities.RangerHealthRegeneration(character.agi, character.lvl);
                        if (character.ep > character.agi)
                        {
                            character.ep = character.agi;
                        }
                        break;

                    default:
                        break;
                    }
                    if (hostile.hp > (100 * hostile.lvl) && hostile.hp < (200 * hostile.lvl))
                    {
                        msgs.Message(hostile.Name, hostile.hp);
                    }
                }

                else
                {
                    Console.WriteLine("Incorrect text! Type Skill_list to choose skill: ");
                    continue;
                }
                if (character.hp < 1)
                {
                    Console.WriteLine("Character DIED!(will be revived at the end of the battle)");
                    break;
                }
                else if (hostile.hp < 1)
                {
                    if (character.lvl == 10)
                    {
                        System.Console.Clear();
                        Asciidraw.drawpic("GoodGameOver");
                        Console.WriteLine("You defetead the most powerful enemy, and now Evergarden can finally be at peace! You have done an unbelievable job, and many centuries further your name will be in every single ballad!");
                        System.Console.ReadKey();
                        System.Console.ReadKey();
                        Environment.Exit(0);
                    }
                    Console.WriteLine("Congratulations, you won!");
                    character.exp = character.exp + hostile.lvl * 5;
                    character.CheckLvlUp();
                    Console.WriteLine("You got " + (hostile.lvl * 5) + " exp points! " + (100 - character.exp) + " untill next lvl");
                    character.hp = character.vit;
                    character.ep = character.agi;
                    Battlestats.Enqueue(hostile.Name + " " + hostile.lvl);
                    break;
                }

                else
                {
                    if (enemy_turn == 3)
                    {
                        character.hp = character.hp - CharactersAbilities.Fury(hostile.str, hostile.phatk);
                        enemy_turn   = 1;
                    }
                    else
                    {
                        character.hp = character.hp - CharactersAbilities.Bite(hostile.str, hostile.phatk);
                        enemy_turn++;
                    }
                    Console.WriteLine("You have" + character.hp + " hp.");
                    Console.WriteLine("Enemy has " + hostile.hp + " hp. Type Skill_list to attack againg.");
                    if (character.hp < 1)
                    {
                        Console.WriteLine("Character DIED!(will be revived at the end of the battle)");
                    }
                    break;
                }
            }
        }