// ______ _ _ _ _ _____ ___ // / ____| | (_) | | |_ _| | | | | (_) //| (___ | | ___| | | | | _ __ | |_ ___ _ __ __ _ ___| |_ _ ___ _ __ ___ // \___ \| |/ / | | | | | | '_ \| __/ _ \ '__/ _` |/ __| __| |/ _ \| '_ \/ __| // ____) | <| | | | _| |_| | | | || __/ | | (_| | (__| |_| | (_) | | | \__ \ //|_____/|_|\_\_|_|_| |_____|_| |_|\__\___|_| \__,_|\___|\__|_|\___/|_| |_|___/ //Normal Strike internal static void NormalStrike(Dragon player1, Dragon player2) { Random random = new Random(); double hitRateModifier = 0; double critRateModifier = 0; int damageDealt = 0; double variance = random.Next(90, 110) * 0.01; double actualHitRate = player1.HitRate + hitRateModifier - player2.EvdRate; double actualCritRate = player1.CritRate + critRateModifier - player2.CritEvdRate; if (actualHitRate > random.Next(0, 100)) { damageDealt = (int)((variance) * (player1.Attack - 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); } }
//Pommel internal static void Pommel(Dragon player1, Dragon player2) { Random random = new Random(); double hitRateModifier = 200; double critRateModifier = -2; int damageDealt = 0; double variance = random.Next(90, 110) * 0.01; player1.SP -= 20; 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 * 2 - 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); Util.SPause(); Console.WriteLine("\nYou also apply a debuff to the enemy!"); Util.SPause(); Console.WriteLine("\nThe enemy loses 3 resilience for 3 turns."); Console.WriteLine("They will restore 1 resilience every start of turn."); player1.BuffDuration[3] = 4; player2.Resilience -= 4; } else { Console.WriteLine("The attack missed!"); damageDealt = -1; BattleDialogue.DamageBehavior(player1, player2, damageDealt); } player1.SkillCooldown[3] = 5; }
//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; }
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; }