Commit fa1fb5bd by krkane

Update Main.c

parent a4db2dba
Showing with 20 additions and 23 deletions
......@@ -39,35 +39,32 @@ int main(void)
while (gameState == 1)
{
if (defeatedEnemies < NUM_HENCHMEN)
{
Enemy enemy = CreateEnemy(defeatedEnemies);
printf("\nVastane tüübiga %s, %dHP ja rünnaku tugevusega"
" %d on loodud.\n", enemy.type, enemy.health, enemy.attack);
gameState = fight(&player, &enemy);
}
else
{
// Generate the final boss
FinalBoss boss = CreateFinalBoss(defeatedEnemies);
printf("\nVastane tüübiga %s, %dHP ja rünnaku tugevusega"
" %d on loodud.\n", boss.type, boss.health, boss.attack);
gameState = bossFight(&player, &boss);
}
int moveResult = Move(defeatedEnemies);
if (gameState == 0)
{
return 0;
if (moveResult == -10) { // Player encountered a trap
handleTrap(&player);
continue; // Restart the loop, allowing the player to choose the path again
}
defeatedEnemies++;
levelUp(&player);
gameState = Move(defeatedEnemies);
if (defeatedEnemies < NUM_HENCHMEN) {
Enemy enemy = CreateEnemy(defeatedEnemies);
printf("\nVastane tüübiga %s, %dHP ja rünnaku tugevusega"
" %d on loodud.\n", enemy.type, enemy.health, enemy.attack);
gameState = fight(&player, &enemy);
} else {
// Generate the final boss
FinalBoss boss = CreateFinalBoss(defeatedEnemies);
printf("\nVastane tüübiga %s, %dHP ja rünnaku tugevusega"
" %d on loodud.\n", boss.type, boss.health, boss.attack);
gameState = bossFight(&player, &boss);
}
if (gameState == 0)
{
if (gameState == 0) {
return 0;
}
defeatedEnemies++;
levelUp(&player);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment