public static void EnterTheWoods() { var monsters = new List <Combatant>(); monsters.Add(CombatantData.SummonScrawnyBeastman()); var stillAlive = FlowOfBattle.DoBattle(CombatantData.SummonPlayer(), monsters); monsters.Clear(); if (stillAlive) { monsters.Add(CombatantData.SummonTreent()); stillAlive = FlowOfBattle.DoBattle(CombatantData.SummonPlayer(), monsters); monsters.Clear(); } if (stillAlive) { monsters.Add(CombatantData.SummonBloodworm()); stillAlive = FlowOfBattle.DoBattle(CombatantData.SummonPlayer(), monsters); monsters.Clear(); } if (stillAlive) { monsters.Add(CombatantData.SummonSpider()); stillAlive = FlowOfBattle.DoBattle(CombatantData.SummonPlayer(), monsters); monsters.Clear(); } }
public static bool DoBattle(Combatant player, List <Combatant> monsters) { var battlefield = new Battlefield(CombatantData.SummonPlayer(), monsters.First()); var dealer = new Dealer(CardData.GetActiveDeck(), 4); dealer.ShuffleDrawPile(); var battleContinues = true; var playerSurvives = false; while (battleContinues) { var playerWins = doPlayersTurn(battlefield, dealer); if (playerWins) { playerSurvives = true; break; } var monsterFought = battlefield.DoMonsterTurn(); var monsterWins = battlefield.IsBattleConcluded(); if (monsterWins) { battleContinues = false; playerSurvives = false; break; } } return(playerSurvives); }