internal static void AllCooldownDrop(Dragon player, Dragon enemy)
 {
     for (int i = 0; i < player.SkillCooldown.GetLength(0); i++)
     {
         if (player.SkillCooldown[i] > 0)
         {
             player.SkillCooldown[i]--;
         }
     }
     for (int i = 0; i < enemy.SkillCooldown.GetLength(0); i++)
     {
         if (enemy.SkillCooldown[i] > 0)
         {
             enemy.SkillCooldown[i]--;
         }
     }
 }
        internal static void BattleCycle(Dragon player, Dragon enemy)
        {
            int round = 1;

            do
            {
                BattleInterface.AllCooldownDrop(player, enemy);
                SkillSystem.BuffAnnounce(player, enemy);
                SkillSystem.BuffAnnounce(enemy, player);
                BattleInterface.VersusTime(player, enemy);

                if (player.HP > 0 && enemy.HP > 0)
                {
                    BattleInterface.RoundAnnounce(player, enemy, round);
                    round++;
                }
            } while (player.HP > 0 && enemy.HP > 0);
        }
        internal static void BuffAnnounce(Dragon player1, Dragon player2)
        {
            for (int i = 0; i < player1.BuffDuration.GetLength(0); i++)
            {
                switch (i)
                {
                case 0: break;

                case 1: break;

                case 2: break;

                case 3:
                    if (player1.BuffDuration[3] > 0)
                    {
                        //if it's the first turn that the buff was applied
                        if (player1.BuffDuration[3] < 4)
                        {
                            Util.WriteLineInRed("==Pommel Debuff==");
                            Util.WriteLineInRed(player2.Name + " restored 1 resilience!");
                        }

                        player1.BuffDuration[3]--;
                        player2.Resilience++;

                        if (player1.BuffDuration[3] == 0)
                        {
                            Util.WriteLineInRed("The debuff wore off completely!");
                        }
                    }
                    break;

                case 4:
                    if (player1.BuffDuration[4] > 0)
                    {
                        player1.BuffDuration[4]--;
                        player1.Resilience /= 2;
                    }
                    break;
                }
            }
        }
        internal static void MissedDialogue(int random, Dragon player1, Dragon player2)
        {
            switch (random)
            {
            case 0:
                Console.WriteLine("\n{0}: I can't believe this!\n{1}: Ha! You suck!", player1.Name, player2.Name);
                break;

            case 1:
                Console.WriteLine("\n{0}: You're pretty good!\n{1}: No, you're just terrible!", player1.Name, player2.Name);
                break;

            case 2:
                Console.WriteLine("\n{0}: Take this!\n{1}: You call that a hit?", player1.Name, player2.Name);
                break;

            case 3:
                Console.WriteLine("\n{0}: Take this!\n{1}: You call that a hit?", player1.Name, player2.Name);
                break;
            }
        }
        internal static void DamageBehavior(Dragon player1, Dragon player2, int damageDealt)
        {
            Random random = new Random();

            if (damageDealt >= 0.5 * player2.HP)
            {
                HeavyHitDialogue(random.Next(0, 1), player1, player2);
            }
            else if (damageDealt >= 0.3 * player2.HP)
            {
                MediumHitDialogue(random.Next(0, 1), player1, player2);
            }
            else if (damageDealt == -1)
            {
                MissedDialogue(random.Next(0, 1), player1, player2);
            }
            else
            {
                LightHitDialogue(random.Next(0, 1), player1, player2);
            }
        }
        private static void HeavyHitDialogue(int random, Dragon player1, Dragon player2)
        {
            switch (random)
            {
            case 0:
                Console.WriteLine("\n{0}: Take this!\n{1}: What is this power??", player1.Name, player2.Name);
                break;

            case 1:
                Console.WriteLine("\n{0}: Uryahhh!\n{1}: Impossible!", player1.Name, player2.Name);
                break;

            case 2:
                Console.WriteLine("\n{0}: Take this!\n{1}: You call that a hit?", player1.Name, player2.Name);
                break;

            case 3:
                Console.WriteLine("\n{0}: Take this!\n{1}: You call that a hit?", player1.Name, player2.Name);
                break;
            }
        }
        private static void MediumHitDialogue(int random, Dragon player1, Dragon player2)
        {
            switch (random)
            {
            case 0:
                Console.WriteLine("\n{0}: Take this!\n{1}: That's quite impressive, but not enough!", player1.Name, player2.Name);
                break;

            case 1:
                Console.WriteLine("\n{0}: Taste the pain!\n{1}: You finally did something to me?", player1.Name, player2.Name);
                break;

            case 2:
                Console.WriteLine("\n{0}: Take this!\n{1}: You call that a hit?", player1.Name, player2.Name);
                break;

            case 3:
                Console.WriteLine("\n{0}: Take this!\n{1}: You call that a hit?", player1.Name, player2.Name);
                break;
            }
        }
        private static void LightHitDialogue(int random, Dragon player1, Dragon player2)
        {
            switch (random)
            {
            case 0:
                Console.WriteLine("\n{0}: Take this!\n{1}: You call that a hit?", player1.Name, player2.Name);
                break;

            case 1:
                Console.WriteLine("\n{0}: How do you like this?\n{1}: I almost felt something!", player1.Name, player2.Name);
                break;

            case 2:
                Console.WriteLine("\n{0}: Take this!\n{1}: You call that a hit?", player1.Name, player2.Name);
                break;

            case 3:
                Console.WriteLine("\n{0}: Take this!\n{1}: You call that a hit?", player1.Name, player2.Name);
                break;
            }
        }
        //Reckless Charge
        internal static void RecklessCharge(Dragon player1, Dragon player2)
        {
            Random random           = new Random();
            double hitRateModifier  = -15;
            double critRateModifier = 8;
            int    damageDealt      = 0;
            double variance         = random.Next(75, 125) * 0.01;

            player1.SP -= 5;

            double actualHitRate  = player1.HitRate + hitRateModifier - player2.EvdRate;
            double actualCritRate = player1.CritRate + critRateModifier - player2.CritEvdRate;
            int    attack         = player1.Strength * 2;
            int    defense        = player2.Resilience * 2;

            if (actualHitRate > random.Next(0, 100))
            {
                damageDealt = (int)((variance) * (player1.Attack * 1.25 - player2.Defense));
                if (actualCritRate > random.Next(0, 100))
                {
                    Console.WriteLine("A critical strike! This should hurt!");
                    damageDealt *= 2;
                }
                if (damageDealt < 0)
                {
                    damageDealt = 0;
                }
                player2.HP -= damageDealt;
                Console.WriteLine("That attack did {0} damage!",
                                  damageDealt);
                BattleDialogue.DamageBehavior(player1, player2, damageDealt);
            }
            else
            {
                Console.WriteLine("The attack missed!");
                damageDealt = -1;
                BattleDialogue.DamageBehavior(player1, player2, damageDealt);
            }
            player1.SkillCooldown[1] = 2;
        }
Пример #10
0
 internal static void InitialImplement(Dragon player)
 {
     player.CurrentLevel = 1;
     player.CurrentEXP   = 0;
     player.MaximumEXP   = 40;
 }
        internal static void VersusTime(Dragon player, Dragon enemy)
        {
            Random random = new Random();
            int    playerSelection = 0, index = 1, enemySelection = 0;
            bool   validSkill = false, confirmChoice = false;

            Console.WriteLine("Time to select what you want to do!");
            Console.WriteLine("The actions you can take this turn:");
            foreach (var skill in player.Skills)
            {
                SkillSystem.SkillListInterface(skill, index);
                index++;
            }

            do
            {
                try
                {
                    Console.WriteLine("\nEnter the number of the skill you want to execute!");
                    Console.Write("Selection: ");
                    playerSelection = int.Parse(Console.ReadLine());

                    if (playerSelection <= player.Skills.Count)
                    {
                        validSkill    = true;
                        confirmChoice = SkillSystem.SkillActivationConfirm(playerSelection, player.Skills, player);
                    }
                    else
                    {
                        Util.WriteLineInRed("Invalid input! Please select a valid skill!");
                    }
                }
                catch (Exception)
                {
                    Util.WriteLineInRed("Error choosing skill!");
                }
            } while (!validSkill || !confirmChoice);

            enemySelection = EnemyAI.EnemyTurn(enemy);

            bool PlayerFirst = false;

            PlayerFirst = TurnDeterminer(player, enemy, playerSelection, enemySelection);

            if (PlayerFirst)
            {
                BattleTime(playerSelection, player.Skills, player, enemy);
                Util.MPause();
                if (enemy.HP > 0)
                {
                    Console.WriteLine("\nNow, it's time for the {0} to move!", enemy.Name);
                    Util.MPause();
                    BattleDialogue.EnemyAction(player, enemy, enemySelection);
                    BattleTime(enemySelection, enemy.Skills, enemy, player);
                }
            }
            else
            {
                Console.WriteLine("\n{0} outsped you! {0} will move before you!", enemy.Name);
                Util.MPause();
                BattleDialogue.EnemyAction(player, enemy, enemySelection);
                BattleTime(enemySelection, enemy.Skills, enemy, player);

                if (player.HP > 0)
                {
                    Util.MPause();
                    Console.WriteLine("\nNow it's your time to move!");
                    BattleTime(playerSelection, player.Skills, player, enemy);
                }
            }
        }
        //Double Strike
        internal static void DoubleUp(Dragon player1, Dragon player2)
        {
            Random random           = new Random();
            double hitRateModifier  = 0;
            double critRateModifier = 0;
            int    damageDealt      = 0;
            double variance         = random.Next(80, 120) * 0.01;

            player1.SP -= 30;

            double actualHitRate  = player1.HitRate + hitRateModifier - player2.EvdRate;
            double actualCritRate = player1.CritRate + critRateModifier - player2.CritEvdRate;
            int    attack         = player1.Strength * 3;
            int    defense        = player2.Resilience * 2;

            if (actualHitRate > random.Next(0, 100))
            {
                damageDealt = (int)((variance) * (attack * 5 - defense * 2.5));
                if (actualCritRate > random.Next(0, 100))
                {
                    Console.WriteLine("A critical strike! This should hurt!");
                    damageDealt *= 2;
                }
                if (damageDealt < 0)
                {
                    damageDealt = 0;
                }
                player2.HP -= damageDealt;
                Console.WriteLine("The first attack did {0} damage!",
                                  damageDealt);
                BattleDialogue.DamageBehavior(player1, player2, damageDealt);
            }
            else
            {
                Console.WriteLine("The first attack missed!");
                damageDealt = -1;
                BattleDialogue.DamageBehavior(player1, player2, damageDealt);
            }

            Util.MPause();

            if (actualHitRate > random.Next(0, 100))
            {
                damageDealt = (int)((variance) * (attack * 3 - defense * 1.5));
                if (actualCritRate > random.Next(0, 100))
                {
                    Console.WriteLine("\nA critical strike! This should hurt!");
                    damageDealt *= 2;
                }
                player2.HP -= damageDealt;
                Console.WriteLine("\nThe second attack did {0} damage!",
                                  damageDealt);
                BattleDialogue.DamageBehavior(player1, player2, damageDealt);
            }
            else
            {
                Console.WriteLine("The second attack missed!");
                damageDealt = -1;
                BattleDialogue.DamageBehavior(player1, player2, damageDealt);
            }

            player1.SkillCooldown[2] = 3;
        }
        private static void BattleTime(int selection, List <int> skills, Dragon player1, Dragon player2)
        {
            switch (skills[selection - 1])
            {
            case 0:
                NormalStrike(player1, player2);
                break;

            case 1:
                RecklessCharge(player1, player2);
                break;

            case 2:
                DoubleUp(player1, player2);
                break;

            case 3:
                Pommel(player1, player2);
                break;

            case 4:
                Defend(player1);
                break;

            default:
                break;
            }
        }
Пример #14
0
        internal static void SelectType(Dragon newDragon)
        {
            String[] TypeSelections = new String[] { "All Rounder", "Vanguard",
                                                     "Guardian", "Assassin",
                                                     "Late Bloomer" };
            String[] TypeExplanations = new String[TypeSelections.Length];
            int      index            = 1;
            int      selection        = 0;

            PopulateTypeExplanations(TypeExplanations);

            Console.WriteLine("You seem to be capable of fighting. That skill will come in handy in this world.");
            Util.SPause();
            Console.WriteLine("Hmm... Just what type of combatant are you, though?\n\n");
            Util.MPause();
            Console.WriteLine("=======================================");
            Console.WriteLine("It's time to select your starting type!");
            Console.WriteLine("Your type will influence your stats and obtainable skills!");
            Console.WriteLine("Here are the list of types that you can choose from!\n");
            foreach (String type in TypeSelections)
            {
                Console.WriteLine("{0}. {1}", index, type);
                index++;
            }

            bool validDragonType = false;

            do
            {
                try
                {
                    Util.SPause();
                    Console.WriteLine("\nEnter the number of the type you would like.");
                    Console.WriteLine("You can also enter 0 for an explanation of each type.");
                    Console.Write("Selection: ");
                    selection = int.Parse(Console.ReadLine());
                    if (selection > 0 && selection < TypeSelections.Length + 1)
                    {
                        validDragonType = true;
                        newDragon.Type  = TypeSelections[selection - 1];
                        Console.WriteLine("Type selected is {0}.", newDragon.Type);
                        Console.Write("Continue with choice? Y/N: ");
                        if (Console.ReadLine().ToUpper() != "Y")
                        {
                            validDragonType = false;
                            Console.WriteLine("Alright, let's select again then.");
                        }
                    }
                    else if (selection == 0)
                    {
                        Console.WriteLine();
                        validDragonType = false;
                        index           = 0;
                        foreach (var type in TypeExplanations)
                        {
                            Console.WriteLine("{0}: {1}", TypeSelections[index], type);
                            index++;
                        }
                    }
                    else
                    {
                        validDragonType = false;
                        Util.WriteLineInRed("\nThis is an invalid dragon type!");
                        Util.SPause();
                        Util.WriteLineInRed("Please enter a valid dragon type from the list!");
                    }
                }
                catch (FormatException)
                {
                    Util.WriteLineInRed("\nError choosing dragon type!");
                }
            } while (!validDragonType);
        }
Пример #15
0
        static void Main(string[] args)
        {
            Random random = new Random();

            Console.Write("...");
            Util.SPause();
            Console.Write("..");
            Util.SPause();
            Console.Write("..");
            Util.SPause();

            Console.WriteLine("\n\nIt has been quite a long journey from your hometown...");
            Console.WriteLine("Seeking an exciting adventure, you hopped on a ship to another continent.");
            Console.WriteLine("What new fate awaits you...?");

            Console.WriteLine("\n===========DRAGON PROJECT===========\n");

            Console.WriteLine("It's high noon in Ocuraho, the Dragon Continent.");
            Console.WriteLine("You are not aware of why they call it that.");
            Console.WriteLine("");

            var player = new Dragon();

            Console.WriteLine("But first of all, please tell me your name...");
            Console.Write("Your name: ");
            player.Name = Console.ReadLine();
            Console.Clear();

            Console.WriteLine("It's a pleasure to meet you, {0}!", player.Name);
            DragonCreation.SelectType(player);
            DragonCreation.CreateDragon(player, player.Type);
            SkillSystem.InitialImplement(player);
            LevelSystem.InitialImplement(player);

            Console.Clear();

            var enemy = new Dragon();

            Console.WriteLine("Let's save the pleasantries for later, though.");
            Console.WriteLine("Looks like someone has a bone to pick with you.");
            Console.WriteLine("Let's quickly dispatch of this ruffian!");
            Console.WriteLine("\nHere he comes! Battle time!\n\n");

            Util.LPause();
            enemy.Name         = "Local Bandit";
            enemy.Type         = "Bandit";
            enemy.AIBehaviorID = 0;
            enemy.CurrentLevel = 1;

            DragonCreation.CreateDragon(enemy, enemy.Type);
            SkillSystem.InitialImplement(enemy);

            BattleInterface.StartTheBattle(player, enemy);
            BattleInterface.DisplayStats(player);
            Util.MPause();
            BattleInterface.DisplayStats(enemy);

            Util.PressAnyKey();
            Console.Clear();

            BattleInterface.BattleCycle(player, enemy);

            if (player.HP < 0)
            {
                Util.LPause();
                Console.Clear();
                Util.WriteLineInRed("The bandit ended your life, moments after " +
                                    "you set foot on the continent.");
                Util.WriteLineInRed("What a truly foolish end...");
                Util.PressAnyKey();
                Environment.Exit(0);
            }
            if (player.HP > 0)
            {
                Util.LPause();
                Console.Clear();
                Console.WriteLine("{0}'s health dropped to 0!", enemy.Name);
                Console.WriteLine("Victory!\n");
                Util.SPause();
                LevelSystem.AddExperience(40, player);
            }

            Util.LPause();
            Console.WriteLine();
            Util.PressAnyKey();

            ////////////////////////////////////////////////////////////////
            Console.Clear();
            Console.WriteLine("Amazing, you're quite the fighter!");
            Console.WriteLine("Bandits have been appearing in these parts.");
            Console.WriteLine("Really terrorizing the locals here, I tell you.");

            Util.SPause();
            Console.WriteLine("\nSay, why don't you follow me to the nearest town?");
            Console.WriteLine("I think you would need a short break after all that!\n");

            Util.PressAnyKey();
            Console.Clear();

            Town Vdrfr = new Town();

            Console.WriteLine("Welcome to Viaderfore!");
            Console.WriteLine("Here, you will have a chance to rest up, buy items" +
                              " and prepare yourself before you head to your next location.");
            Util.SPause();
            Console.WriteLine("You also have the choice to talk to locals and maybe" +
                              " learn some more about this area.\n");
            Util.SPause();
            Util.PressAnyKey();
            Console.Clear();

            do
            {
                try
                {
                    Console.WriteLine("Here are the things you can do at this moment in time");
                    Console.WriteLine("1. Talk to someone.");
                    Console.WriteLine("2. Rest up at an inn.");
                    Console.WriteLine("3. Visit the weapon store.");
                    Console.WriteLine("4. Visit the item store.");
                    Console.WriteLine("5. Head out.");
                    Console.WriteLine("\nWhat do you wish to do?");
                    Console.Write("Your choice: ");
                    Vdrfr.Navigation = int.Parse(Console.ReadLine());

                    if (Vdrfr.Navigation < 1 || Vdrfr.Navigation > 5)
                    {
                        Console.Clear();
                        Util.WriteLineInRed("Such an option does not exist!");
                    }

                    if (Vdrfr.Navigation == 1)
                    {
                        do
                        {
                            Console.Clear();
                            Console.WriteLine("Seems like there's a number of people here");
                            Console.WriteLine("1. The elderly man.");
                            Console.WriteLine("2. The armorclad fellow");
                            Console.WriteLine("3. The arrogant young man.");
                            Console.WriteLine("\nWho do you wish to talk to?");
                            Console.Write("Your choice: ");
                            Vdrfr.TalkChoice = int.Parse(Console.ReadLine());
                            if (Vdrfr.TalkChoice == 1)
                            {
                                Console.Clear();
                                Town.Vdrfr.OldMan();

                                Console.Write("\nTalk to another person? Y/N ");
                                if (Console.ReadLine().ToUpper() != "Y")
                                {
                                    Vdrfr.InTalk = true;
                                }
                                else
                                {
                                    Vdrfr.InTalk = false;
                                }
                            }
                            if (Vdrfr.TalkChoice == 2)
                            {
                                Console.Clear();
                                Town.Vdrfr.ArmorcladFellow(player);

                                Console.Write("Accept Jeremy's challenge? Y/N ");
                                if (Console.ReadLine().ToUpper() == "Y")
                                {
                                    if (player.HP < player.MaxHP)
                                    {
                                        Console.Clear();
                                        Town.Vdrfr.ChallengeNotMaxHP();

                                        Console.Write("\nTalk to another person? Y/N ");
                                        if (Console.ReadLine().ToUpper() != "Y")
                                        {
                                            Vdrfr.InTalk = true;
                                        }
                                        else
                                        {
                                            Vdrfr.InTalk = false;
                                        }
                                    }
                                    else
                                    {
                                        enemy.Name         = "Jeremy Evert";
                                        enemy.Type         = "Fledgling Knight";
                                        enemy.AIBehaviorID = 1;
                                        enemy.CurrentLevel = 2;

                                        EnemyInitializationAndBattleStart(player, enemy);
                                        BattleInterface.BattleCycle(player, enemy);

                                        if (player.HP > 0)
                                        {
                                            Town.Vdrfr.ChallengeWin();
                                        }
                                        if (player.HP < 0)
                                        {
                                            Town.Vdrfr.ChallengeLost(player);
                                        }
                                    }
                                }
                                else
                                {
                                    Console.Clear();
                                    Town.Vdrfr.ChallengeReject();
                                    Console.Write("\nTalk to another person? Y/N ");
                                    if (Console.ReadLine().ToUpper() != "Y")
                                    {
                                        Vdrfr.InTalk = true;
                                    }
                                    else
                                    {
                                        Vdrfr.InTalk = false;
                                    }
                                }
                            }
                            if (Vdrfr.TalkChoice == 3)
                            {
                                Console.Clear();
                            }
                        } while (!Vdrfr.InTalk);
                    }
                }
                catch (Exception)
                {
                    Console.Clear();
                    Util.WriteLineInRed("Error making selection! Did you input a letter?");
                }
            } while (!Vdrfr.InTown);


            Console.WriteLine("\nFor now, your journey comes to an end");
            Console.WriteLine("Look forward for more updates in the near future!");
            Util.PressAnyKey();
        }
Пример #16
0
        internal static bool SkillActivationConfirm(int selection, List <int> skills, Dragon player)
        {
            bool confirm;

            switch (skills[selection - 1])
            {
            case 0:
                Console.WriteLine("Normal Strike: Just a regular attack onto your enemy");
                Console.WriteLine("Costs nothing.");
                Console.WriteLine("Has no cooldown.");
                confirm = ConfirmSkillUse();
                if (!confirm)
                {
                    goto default;
                }
                return(true);

            case 1:
                Console.WriteLine("\nReckless Charge: An attack that deals much " +
                                  "more damage at the cost of having lower accuracy.");
                Console.WriteLine("Costs 25 stamina.");
                Console.WriteLine("Has a cooldown of 1 turn.");
                confirm = ConfirmSkillUse();
                if (player.SkillCooldown[1] > 0)
                {
                    Util.WriteLineInRed("This skill is currently on cooldown!");
                    Util.WriteLineInRed("Turn(s) remaining: " + player.SkillCooldown[1]);
                    goto default;
                }
                if (player.SP < 25)
                {
                    Util.WriteLineInRed("You do not have enough stamina to execute this skill!");
                    goto default;
                }
                if (!confirm)
                {
                    goto default;
                }
                return(true);

            case 2:
                Console.WriteLine("\nDouble Up: Perform two consecutive normal strikes.");
                Console.WriteLine("Costs 30 stamina.");
                Console.WriteLine("Has a cooldown of 2 turns.");
                confirm = ConfirmSkillUse();
                if (player.SkillCooldown[2] > 0)
                {
                    Util.WriteLineInRed("This skill is currently on cooldown!");
                    Util.WriteLineInRed("Turn(s) remaining: " + player.SkillCooldown[2]);
                    goto default;
                }
                if (player.SP < 30)
                {
                    Util.WriteLineInRed("You do not have enough stamina to execute this skill!");
                    goto default;
                }
                if (!confirm)
                {
                    goto default;
                }
                return(true);

            case 3:
                Console.WriteLine("\nPommel: A weak attack that targets the " +
                                  "enemy's defenses. Reduces enemy's resilience by 3 for 3 turns.");
                Console.WriteLine("Costs 20 stamina.");
                Console.WriteLine("Has a cooldown of 5 turns.");
                confirm = ConfirmSkillUse();
                if (player.SkillCooldown[3] > 0)
                {
                    Util.WriteLineInRed("This skill is currently on cooldown!");
                    Util.WriteLineInRed("Turn(s) remaining: " + player.SkillCooldown[3]);
                    goto default;
                }
                if (player.SP < 20)
                {
                    Util.WriteLineInRed("You do not have enough stamina to execute this skill!");
                    goto default;
                }
                if (!confirm)
                {
                    goto default;
                }
                return(true);

            case 4:
                Console.WriteLine("\nDefend: Assumes a defensive stance. " +
                                  "Doubles your resilience during this turn only.");
                Console.WriteLine("This skill will always be performed first.");
                Console.WriteLine("Costs nothing.");
                Console.WriteLine("Has no cooldown.");
                confirm = ConfirmSkillUse();
                if (!confirm)
                {
                    goto default;
                }
                return(true);

            default:
                return(false);
            }
        }