The game engine now has two bonuses for long build streaks. +10% max hp or 1 free death. I'll be adding more but that's enough to work on the real UI.
This commit is contained in:
parent
07553400f5
commit
0a9fa59365
3 changed files with 81 additions and 9 deletions
|
@ -19,6 +19,10 @@ enum class GameEvent {
|
|||
BUILD_DONE, BUILD_FAILED, HIT
|
||||
};
|
||||
|
||||
enum class GameBonus {
|
||||
MORE_HP, FREE_DEATH
|
||||
};
|
||||
|
||||
class GameEngine : DeadSimpleFSM<GameState, GameEvent> {
|
||||
|
||||
std::map<string, int> damage_types{
|
||||
|
@ -33,6 +37,8 @@ class GameEngine : DeadSimpleFSM<GameState, GameEvent> {
|
|||
int hits_taken = 0;
|
||||
int rounds = 0;
|
||||
int streak = 0;
|
||||
float hp_bonus = 1.0f;
|
||||
bool free_death = false;
|
||||
|
||||
GameEngine(int hp);
|
||||
|
||||
|
@ -82,4 +88,6 @@ class GameEngine : DeadSimpleFSM<GameState, GameEvent> {
|
|||
void heal();
|
||||
bool hit(string &type);
|
||||
void reset();
|
||||
void add_bonus(GameBonus bonus);
|
||||
int max_hp();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue