|
TheCOSCGameProject
1.0
|
Manages different types of weapons in the game. More...
#include <weapon.h>
Public Member Functions | |
| Weapon () | |
| Constructor for the Weapon class. More... | |
| int | giveRandWeapon () |
| Get a random weapon ID. More... | |
| int | giveRariWeapon (const std::string &rarity) |
| Get a weapon ID based on its rarity. More... | |
| std::string | getName (int weaponId) |
| Get the name of a weapon. More... | |
| std::string | getDescription (int weaponId) |
| Get the description of a weapon. More... | |
| int | getDamage (int weaponId) |
| Get the damage value of a weapon. More... | |
| std::string | getRarity (int weaponId) |
| Get the rarity of a weapon. More... | |
| bool | getRanged (int weaponId) |
| Check if a weapon is ranged. More... | |
| bool | getStun (int weaponId) |
| Check if a weapon can stun. More... | |
Manages different types of weapons in the game.
The Weapon class provides methods to retrieve weapons based on randomness or rarity and access various attributes of the weapons.
| Weapon::Weapon | ( | ) |
Constructor for the Weapon class.
Initializes the weapons data structure and populates it with predefined weapons.
Initializes the weapon system by seeding the random number generator and adding a predefined set of weapons to the system.
| int Weapon::getDamage | ( | int | weaponId | ) |
Get the damage value of a weapon.
Returns the damage value of the weapon with the specified ID.
| weaponId | The ID of the weapon. |
| weaponId | The ID of the weapon. |
| std::string Weapon::getDescription | ( | int | weaponId | ) |
Get the description of a weapon.
Returns the description of the weapon with the specified ID.
| weaponId | The ID of the weapon. |
| weaponId | The ID of the weapon. |
| std::string Weapon::getName | ( | int | weaponId | ) |
Get the name of a weapon.
Returns the name of the weapon with the specified ID.
| weaponId | The ID of the weapon. |
| weaponId | The ID of the weapon. |
| bool Weapon::getRanged | ( | int | weaponId | ) |
Check if a weapon is ranged.
Checks if the weapon with the specified ID is ranged.
| weaponId | The ID of the weapon. |
| std::string Weapon::getRarity | ( | int | weaponId | ) |
Get the rarity of a weapon.
Returns the rarity of the weapon with the specified ID.
| weaponId | The ID of the weapon. |
| weaponId | The ID of the weapon. |
| bool Weapon::getStun | ( | int | weaponId | ) |
Check if a weapon can stun.
Checks if the weapon with the specified ID has stun capability.
| weaponId | The ID of the weapon. |
| weaponId | The ID of the weapon. |
| int Weapon::giveRandWeapon | ( | ) |
Get a random weapon ID.
Returns a random weapon ID.
Selects a random weapon from the available weapons.
| int Weapon::giveRariWeapon | ( | const std::string & | rarity | ) |
Get a weapon ID based on its rarity.
Returns a weapon ID based on the specified rarity.
| rarity | The rarity level of the desired weapon (e.g., "common", "rare", "epic"). |
| rarity | The rarity of the desired weapon (e.g., "Common", "Rare", "Epic"). |
1.8.13