Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Text-based-Game/equipment.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
44 lines (30 sloc)
713 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef EQUIPMENT_H | |
#define EQUIPMENT_H | |
using namespace std; | |
class Equipment { | |
protected: | |
string rarity; // common, uncommon, rare, epic, legendary | |
array<int, 5> stats = {0, 0, 0, 0, 0}; // str, intel, dex, maxHp, con | |
public: | |
void randomRarity(); | |
void bonusStats(); | |
void getStats(); | |
void legendary(){ rarity = "legendary";} | |
}; | |
class Weapon: public Equipment{ | |
private: | |
string weaponType; | |
public: | |
void baseStats(); | |
void randomWeapon(); | |
string getWeaponT(); | |
}; | |
class Armor: public Equipment{ | |
private: | |
string armorType; // helmet, gloves, leggings, chestplate, boots | |
public: | |
Armor(); | |
void randomArmor(); | |
string getArmorT(); | |
}; | |
#endif |