|
TheCOSCGameProject
1.0
|
Responsible for spawning enemies in the game. More...
#include <enemies.h>
Public Member Functions | |
| EnemySpawner () | |
| Constructor for the EnemySpawner class. More... | |
| Enemy | spawnEnemy () |
| Spawns a new enemy with randomly generated attributes. More... | |
| int | getHealth (const Enemy &enemy) |
| Gets the health of the specified enemy. More... | |
| int | getAttack (const Enemy &enemy) |
| Gets the attack power of the specified enemy. More... | |
| std::string | getName (const Enemy &enemy) |
| Gets the name of the specified enemy. More... | |
| std::string | getType (const Enemy &enemy) |
| Gets the type of the specified enemy. More... | |
| std::string | getPersonality (const Enemy &enemy) |
| Gets the personality of the specified enemy. More... | |
| int | getDefence (const Enemy &enemy) |
| Gets the defense value of the specified enemy. More... | |
| bool | isDead (const Enemy &enemy) |
| Checks if the specified enemy is dead. More... | |
| void | damageDelt (Enemy &enemy, int hurt) |
| Applies damage to the specified enemy. More... | |
| void | setAttack (Enemy &enemy, int attack) |
| Sets the attack power of the specified enemy. More... | |
| void | setHealth (Enemy &enemy, int health) |
| Sets the health of the specified enemy. More... | |
Responsible for spawning enemies in the game.
The EnemySpawner class generates enemies with random attributes, and provides methods to interact with and modify the properties of these enemies.
| EnemySpawner::EnemySpawner | ( | ) |
Constructor for the EnemySpawner class.
Initializes the EnemySpawner object, preparing it to generate enemies.
Initializes the random number generator used for generating random enemy attributes.
| void EnemySpawner::damageDelt | ( | Enemy & | enemy, |
| int | hurt | ||
| ) |
Applies damage to the specified enemy.
Apply damage to a given enemy.
| enemy | The enemy to damage. |
| hurt | The amount of damage to apply. |
| enemy | The enemy to apply damage to. |
| hurt | The amount of damage to apply. |
The damage is reduced based on the enemy's type and defence value. Sardaukar enemies take 20% less damage.
| int EnemySpawner::getAttack | ( | const Enemy & | enemy | ) |
Gets the attack power of the specified enemy.
Get the attack value of a given enemy.
| enemy | The enemy whose attack power is to be retrieved. |
| enemy | The enemy whose attack value is to be retrieved. |
| int EnemySpawner::getDefence | ( | const Enemy & | enemy | ) |
Gets the defense value of the specified enemy.
Get the defence value of a given enemy.
| enemy | The enemy whose defense value is to be retrieved. |
| enemy | The enemy whose defence value is to be retrieved. |
| int EnemySpawner::getHealth | ( | const Enemy & | enemy | ) |
Gets the health of the specified enemy.
Get the health of a given enemy.
| enemy | The enemy whose health is to be retrieved. |
| enemy | The enemy whose health is to be retrieved. |
| std::string EnemySpawner::getName | ( | const Enemy & | enemy | ) |
Gets the name of the specified enemy.
Get the name of a given enemy.
| enemy | The enemy whose name is to be retrieved. |
| std::string EnemySpawner::getPersonality | ( | const Enemy & | enemy | ) |
Gets the personality of the specified enemy.
Get the personality of a given enemy.
| enemy | The enemy whose personality is to be retrieved. |
| std::string EnemySpawner::getType | ( | const Enemy & | enemy | ) |
Gets the type of the specified enemy.
Get the type of a given enemy.
| enemy | The enemy whose type is to be retrieved. |
| bool EnemySpawner::isDead | ( | const Enemy & | enemy | ) |
Checks if the specified enemy is dead.
Check if a given enemy is dead.
| enemy | The enemy to check. |
| enemy | The enemy to check. |
| void EnemySpawner::setAttack | ( | Enemy & | enemy, |
| int | attack | ||
| ) |
Sets the attack power of the specified enemy.
Set the attack value of a given enemy.
| enemy | The enemy whose attack power is to be set. |
| attack | The attack power to set. |
| enemy | The enemy whose attack value is to be set. |
| attack | The new attack value. |
| void EnemySpawner::setHealth | ( | Enemy & | enemy, |
| int | health | ||
| ) |
Sets the health of the specified enemy.
Set the health value of a given enemy.
| enemy | The enemy whose health is to be set. |
| health | The health value to set. |
| enemy | The enemy whose health value is to be set. |
| health | The new health value. |
| Enemy EnemySpawner::spawnEnemy | ( | ) |
1.8.13