Game Phases

The game in split between 3 Phases: Production (Day), Deployment (Dusk), Battle (Night).

## Production Phase (Day)

This Production Phase is the tower defense/city builder part of the game. Each production phase the following happens:

* Heroes regen Health and Mana according to their Regen attributes.
* Production increases for Production Buildings. If the production is complete, rewards are made available.
* Available Workers are fully regenerated.
* The player is notified of the directions the Hordes will be coming from on the upcoming Night.

The player can use the Commander's journal on the left part of the screen as a guide to complete all necessary preparations for the upcoming Night. As such the player can:

* Obtain some favors from Schaden & Freude in the Oraculum (It's the meta game part of the game).

* Grab rewards
	+ Rewards of the Night: available if the Panic Meter stayed < 0 !
	+ Rewards from Production Buildings, if their Production Gauge is full: the player chooses 1 item out of 3 available.
* Spend gold:
	+ Build new Buildings
	+ Buy some new gear at the Shop
	+ Recruit a Hero at the Inn
* Spend Materials to build some defenses.
* Assign Workers to buildings: to regen additional Mana/Health, scavange Ruins for Gold/Materials, boost Production Buildings.
* Equip Heroes and use items.
* Position the Heroes for the upcoming Night.

## Deployment Phase (Dusk)

The Deployment Phase serves as a buffer between Day and Night. It allows the player to pre-position and equip the Heroes before the beginning of the Battle phase, in case they forgot to do that in the Production Phase.

## Battle Phase (Night)

The battle phase is the turn based tactical RPG part of the game. It is split into turns, each starting with the Enemy turn and ending with the Heroes turn.

### Enemy turn

This part of the turn is controlled by the AI. It unfolds as this:

* The Night time progression bar progresses.
* The Panic Meter updates.
* Poison damage is applied.
* Enemy armor is regenerated.
* If the Night time progression bar isn't full, a new wave of enemies spawn & the enemy counter is updated.
* Enemies move.
	+ All who enter the city's wall are flagged with a "!" signifying they will increase the Panic Meter if the player lets them stay alive till their next turn.
	+ The Panic Meter is updated with the expected panic rise caused by all the monsters inside the city's walls.
* Enemies attack all Defenses, Buildings or Heroes in range (according to their behaviour).

### Heroes turn

This part of the turn is controlled by the player. Heroes' armor is regenerated each beginning of this turn. The player can:

* Move their Heroes using Move Points.
	+ Movement can be undone using the "Cancel Last Movement" button.
	+ Warning: Casting a Skill will reset Movement history, thus hiding the "Cancel Last Movement" button.

* Cast one of the Heroes Skills using Action and Mana Points.
	+ Skills can't be undone.
	+ Beware of friendly fire (on Heroes and Defenses)
* Swap weapon set
* Use equipped items or Perks
* End the turn by clicking on the "End Turn" button

### Game over

The game is over if all Heroes are dead or if the Magic Circle is destroyed.

### Reward Screen

The Battle ends when all enemies are dead. The player is then awarded rewards according to their battle performance.

* **Experience** is calculated based on a constant experience pool for that night that is then shared evenly amongst all surviving Heroes. Bonus XP is then given to each hero based on the number of kills they made. That total is then multiplied by the hero's experience modifier.
* **Gold**, **Materials** and **Items** are obtained depending on the Panic level. (The item is chosen by the player during next Production Phase out of 3 choices)
* **Tainted Essence** are awarded based on enemies killed and special Battle Achievements.

Panic rewards and Tainted EssencesXP Rewards