public void Fighting(HeroClassTypes heroClassTypes, EnemyClassType enemyClassType, StateManager stateManager, int playerCombatSelecter, int enemyCombatSelecter, Hero playerHero, Enemy enemy) { { if (playerCombatSelecter == 1) { if (enemyCombatSelecter == 1) { playerHero.AttackEnemy1(heroClassTypes, enemy, enemyClassType, stateManager.AttackMissFactor()); enemy.AttackPlayer1(heroClassTypes, playerHero, enemyClassType); MenuQueries.BattleDisplayPage(heroClassTypes, playerHero, enemy, enemyClassType, false, playerCombatSelecter, enemyCombatSelecter); } else if (enemyCombatSelecter == 2) { enemy.EnemyDefend(enemyClassType, true); playerHero.AttackEnemy1(heroClassTypes, enemy, enemyClassType, stateManager.AttackMissFactor()); enemy.EnemyDefend(enemyClassType, false); MenuQueries.BattleDisplayPage(heroClassTypes, playerHero, enemy, enemyClassType, false, playerCombatSelecter, enemyCombatSelecter); } } else if (playerCombatSelecter == 2) { if (enemyCombatSelecter == 1) { playerHero.PlayerDefend(heroClassTypes, true); enemy.AttackPlayer1(heroClassTypes, playerHero, enemyClassType); playerHero.PlayerDefend(heroClassTypes, false); MenuQueries.BattleDisplayPage(heroClassTypes, playerHero, enemy, enemyClassType, false, playerCombatSelecter, enemyCombatSelecter); } else if (enemyCombatSelecter == 2) { playerHero.PlayerDefend(heroClassTypes, true); enemy.EnemyDefend(enemyClassType, true); playerHero.PlayerDefend(heroClassTypes, false); enemy.EnemyDefend(enemyClassType, false); MenuQueries.BattleDisplayPage(heroClassTypes, playerHero, enemy, enemyClassType, false, playerCombatSelecter, enemyCombatSelecter); } } else { playerHero.UseItem(heroClassTypes); } } }
static void Main(string[] args) { HeroClassTypes heroClassTypes; EnemyClassType enemyClassType; StateManager stateManager = new StateManager(); ItemManager itemManager = new ItemManager(); string userInput; string userName; int playerCombatSelecter; int enemyCombatSelecter; /*NEXT ITEM * -------------> * Have hero select screne * */ do { MenuQueries.MainMenuStart(); userInput = MenuQueries.HeroSelectionDisplay(); MenuQueries.ConsoleClearResetMenu(); heroClassTypes = CharacterCreation.ConvertUserHeroTypeToEnum(userInput); userName = CharacterCreation.HeroName(); Hero playerHero = new Hero(heroClassTypes, userName); // loop for level while (playerHero.IsAlive) { MenuQueries.ConsoleClearResetMenu(); enemyClassType = CharacterCreation.GenerateEnemyType(stateManager.GenerateEnemyBasedOnCurrentGameLevel()); Enemy enemy = new Enemy(enemyClassType); MenuQueries.BattleDisplayPage(heroClassTypes, playerHero, enemy, enemyClassType, true); // loop for alive while (enemy.IsAlive && playerHero.IsAlive) { Console.WriteLine($"level is {stateManager.GAMELEVEL}"); playerCombatSelecter = MenuQueries.PlayerCombactSelection(); enemyCombatSelecter = stateManager.EnemyCombatSelecter(); stateManager.Fighting(heroClassTypes, enemyClassType, stateManager, playerCombatSelecter, enemyCombatSelecter, playerHero, enemy); stateManager.SetGameLevel(enemy.IsAlive, playerHero.IsAlive); playerHero.EquipItem(itemManager, enemy.IsAlive); playerHero.PlayerLevelManager(enemy, enemyClassType, heroClassTypes, stateManager); MenuQueries.ConsoleClearResetMenu(); MenuQueries.BattleDisplayPage(heroClassTypes, playerHero, enemy, enemyClassType, false); } } } while (stateManager.PlayAgain()); }