Initialize files from GitLab repository
This commit is contained in:
53
lib/items/Armor.cpp
Normal file
53
lib/items/Armor.cpp
Normal file
@@ -0,0 +1,53 @@
|
||||
#include "../../include/items/Armor.h"
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
// This constructor just initializes the Armor to null.
|
||||
Armor::Armor()
|
||||
{
|
||||
name = "No Armor Equipped";
|
||||
health = 0;
|
||||
hits_remaining = 0;
|
||||
upgrades_remaining = 0;
|
||||
value = 0;
|
||||
}
|
||||
|
||||
// This constructor just initializes the Armor to the passed values.
|
||||
Armor::Armor(string armor_name, int health_added, int cost)
|
||||
{
|
||||
name = armor_name;
|
||||
health = health_added;
|
||||
hits_remaining = 150;
|
||||
upgrades_remaining = 3;
|
||||
value = cost;
|
||||
}
|
||||
|
||||
// SETTER FUNCTIONS
|
||||
|
||||
// GETTER FUNCTIONS
|
||||
|
||||
string Armor::getArmorName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
int Armor::getArmorHealth()
|
||||
{
|
||||
return health;
|
||||
}
|
||||
|
||||
int Armor::getArmorHitsRemaining()
|
||||
{
|
||||
return hits_remaining;
|
||||
}
|
||||
|
||||
int Armor::getArmorUpgradesRemaining()
|
||||
{
|
||||
return upgrades_remaining;
|
||||
}
|
||||
|
||||
int Armor::getArmorValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
58
lib/items/Potion.cpp
Normal file
58
lib/items/Potion.cpp
Normal file
@@ -0,0 +1,58 @@
|
||||
#include "../../include/items/Potion.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
// This constructor just initializes the User to null.
|
||||
|
||||
Potion::Potion()
|
||||
{
|
||||
name = "No Potion Stocked";
|
||||
heal_amount = 0;
|
||||
value = 0;
|
||||
|
||||
}
|
||||
|
||||
Potion::Potion(string potion_name, int amount_provided, int cost)
|
||||
{
|
||||
name = potion_name;
|
||||
heal_amount = amount_provided;
|
||||
value = cost;
|
||||
}
|
||||
|
||||
//SETTER FUNCTIONS
|
||||
void Potion::setPotionName(string potion_name)
|
||||
{
|
||||
name = potion_name;
|
||||
}
|
||||
|
||||
void Potion::setPotionValue(int cost)
|
||||
{
|
||||
value = cost;
|
||||
}
|
||||
|
||||
// GETTER FUNCTIONS
|
||||
string Potion::getPotionName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
int Potion::getPotionValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
int Potion::getPotionAmount()
|
||||
{
|
||||
return heal_amount;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
95
lib/items/Weapon.cpp
Normal file
95
lib/items/Weapon.cpp
Normal file
@@ -0,0 +1,95 @@
|
||||
#include "../../include/items/Weapon.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
// This constructor just initializes the Weapon to null.
|
||||
Weapon::Weapon()
|
||||
{
|
||||
name = "No Secondary Equipped";
|
||||
base_damage = 0;
|
||||
max_damage = 0;
|
||||
hits_remaining = 0;
|
||||
upgrades_remaining = 0;
|
||||
value = 0;
|
||||
}
|
||||
|
||||
Weapon::Weapon(string weapon_name, int base, int max, int cost)
|
||||
{
|
||||
name = weapon_name;
|
||||
base_damage = base;
|
||||
base_heavy_damage = base;
|
||||
max_damage = max;
|
||||
max_heavy_damage = max;
|
||||
hits_remaining = 200;
|
||||
upgrades_remaining = 3;
|
||||
value = cost;
|
||||
}
|
||||
|
||||
//SETTER FUNCTIONS
|
||||
void Weapon::setWeaponValue(int cost)
|
||||
{
|
||||
value = (cost / 2) * 1.5;
|
||||
}
|
||||
|
||||
void Weapon::setUpgradesRemaining(int upgrades_remaining)
|
||||
{
|
||||
upgrades_remaining = upgrades_remaining - 1;
|
||||
}
|
||||
|
||||
void Weapon::setWeaponBaseHeavyDamage(int level, int base, int random)
|
||||
{
|
||||
base_heavy_damage = base + random + (level * 10);
|
||||
}
|
||||
|
||||
void Weapon::setWeaponMaxHeavyDamage(int level, int max, int random)
|
||||
{
|
||||
max_heavy_damage = max + random + (level * 10);
|
||||
}
|
||||
|
||||
// GETTER FUNCTIONS
|
||||
string Weapon::getWeaponName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
int Weapon::getWeaponValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
int Weapon::getWeaponBaseDamage()
|
||||
{
|
||||
return base_damage;
|
||||
}
|
||||
|
||||
int Weapon::getWeaponBaseHeavyDamage()
|
||||
{
|
||||
return base_heavy_damage;
|
||||
}
|
||||
|
||||
int Weapon::getWeaponMaxDamage()
|
||||
{
|
||||
return max_damage;
|
||||
}
|
||||
|
||||
int Weapon::getWeaponMaxHeavyDamage()
|
||||
{
|
||||
return max_heavy_damage;
|
||||
}
|
||||
|
||||
int Weapon::getWeaponHitsRemaining()
|
||||
{
|
||||
return hits_remaining;
|
||||
}
|
||||
|
||||
int Weapon::getWeaponUpgradesRemaining()
|
||||
{
|
||||
return upgrades_remaining;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user