Initialize files from GitLab repository

This commit is contained in:
2025-11-04 20:22:10 -07:00
commit 4050e30ae8
30 changed files with 3328 additions and 0 deletions

34
include/items/Armor.h Normal file
View File

@@ -0,0 +1,34 @@
#ifndef ARMOR_H
#define ARMOR_H
#include<iostream>
using namespace std;
class Armor
{
// data members
private:
string name;
int health;
int hits_remaining;
int upgrades_remaining;
int value;
public:
// Constructors of Armor class
Armor();
Armor(string armor_name, int health_added, int cost);
// SETTER FUNCIONS
// GETTER FUNCTIONS
string getArmorName();
int getArmorHealth();
int getArmorHitsRemaining();
int getArmorUpgradesRemaining();
int getArmorValue();
};
#endif

32
include/items/Potion.h Normal file
View File

@@ -0,0 +1,32 @@
#ifndef POTION_H
#define POTION_H
#include<iostream>
using namespace std;
class Potion
{
private:
string name;
int heal_amount;
int value;
int amount;
int potions_amount;
public:
Potion();
Potion(string potion_name, int amount_provided, int cost);
// SETTER FUNCTIONS
void setPotionName(string name);
void setPotionValue(int cost);
void addPotion();
void subtractPotion();
// GETTER FUNCTIONS
string getPotionName();
int getPotionValue();
int getPotionAmount();
};
#endif

43
include/items/Weapon.h Normal file
View File

@@ -0,0 +1,43 @@
#ifndef WEAPON_H
#define WEAPON_H
#include<iostream>
using namespace std;
class Weapon
{
// data members
private:
string name;
int base_damage;
int base_heavy_damage;
int max_damage;
int max_heavy_damage;
int hits_remaining;
int upgrades_remaining;
int value;
public:
// Constructors of Weapon class
Weapon();
Weapon(string weapon_name, int base, int max, int cost);
// SETTER FUNCIONS
void setWeaponValue(int cost);
void setUpgradesRemaining(int upgrades_remaining);
void setWeaponBaseHeavyDamage(int level, int base, int random);
void setWeaponMaxHeavyDamage(int level, int base, int random);
// GETTER FUNCTIONS
string getWeaponName();
int getWeaponValue();
int getWeaponBaseDamage();
int getWeaponBaseHeavyDamage();
int getWeaponMaxDamage();
int getWeaponMaxHeavyDamage();
int getWeaponHitsRemaining();
int getWeaponUpgradesRemaining();
};
#endif

34
include/people/Opponent.h Normal file
View File

@@ -0,0 +1,34 @@
#ifndef OPPONENT_H
#define OPPONENT_H
#include<iostream>
using namespace std;
class Opponent
{
private:
string name;
int current_health;
int max_health;
int level;
int base_damage;
int max_damage;
public:
Opponent();
Opponent(string opponent_name, int opponent_level, int base, int max);
// SETTER FUNCTIONS
void setOpponentHealth(int damage_taken); // Set current Health minus dmaage_taken
// GETTER FUNCTIONS
string getOpponentName();
int getOpponentHealth();
int getOpponentMaxHealth();
int getOpponentLevel();
int getOpponentBaseDamage();
int getOpponentMaxDamage();
int getPotionAmount();
};
#endif

53
include/people/User.h Normal file
View File

@@ -0,0 +1,53 @@
#ifndef USER_H
#define USER_H
#include "../items/Weapon.h" // include the Weapon header file
#include "../items/Armor.h"
#include "../items/Potion.h"
#include <string>
class User
{
private:
string name;
int current_health;
int max_health;
int level;
int xp_points;
int xp_needed;
int credits;
Weapon equipped_weapon[2]; // declare the user_weapons array to hold 2 Weapon objects
Armor equipped_armor[3];
Potion equipped_potions[5];
public:
User(string username, Weapon current_weapons[], Armor current_armor[], Potion current_potions[]);
// SETTER FUNCTIONS
void setUserName(string username);
void setUserHealth(int damage_taken);
void setHealthAfterPurchase(int armor_amount_added);
void setUserHealthFull(int full_health);
void addArmorToHealth(Armor current_armor);
void setMaxHealth(Armor current_armor[]);
void setUserCredits(int current_credits);
void giveUserCredits(int credits_added);
void setUserXP(int xp_earned);
void resetUserXP(int xp_remaining);
void setUserXPNeeded(int level); //Returns amount of XP needed to level up (random each time)
void usePotion(int potion_amount);
void levelUpUser(int current_level);
// GETTER FUNCTIONS
string getUserName();
int getUserHealth();
int getUserMaxHealth();
int getUserLevel();
int getUserXP();
int getUserCredits();
int getUserXPNeeded();
Weapon getUserWeapon(int input); // add a semicolon at the end of the function definition
};
#endif

57
include/ship/Map.h Normal file
View File

@@ -0,0 +1,57 @@
#ifndef MAP_H
#define MAP_H
#include <iostream>
using namespace std;
class Map
{
private:
char SHIP = '-';
char BED = 'B'; // marker for room locations
char FIGHTER = 'o'; // marker for party position
char EXIT = 'H'; // marker for ship exit
static const int num_rows_ = 12; // number of rows in map
static const int num_cols_ = 12; // number of columns in map
static const int max_npcs_ = 5; // max non-player characters
static const int max_rooms_ = 5; // max number of rooms
int player_position_[2]; // player position (row,col)
int ship_exit_[2];
int ship_bed_[2]; // exit location of the ship
int npc_positions_[max_npcs_][3]; // stores the (row,col) positions of NPCs present on map and if they have been found
int room_positions_[max_rooms_][2]; // stores the (row,col) positions of rooms present on map
char map_data_[num_rows_][num_cols_]; // stores the character that will be shown at a given (row,col)
int npc_count_; // stores number of misfortunes currently on map
int room_count_; // stores number of sites currently on map
public:
Map();
void resetMap();
// getters
int getPlayerRow();
int getPlayerCol();
int getShipExitRow();
int getShipExitCol();
int getNumRows();
int getNumCols();
bool isOnMap(int row, int col);
bool isShipExit(int row, int col);
bool isShipBed(int row, int col);
// setters
void setPlayerPosition(int row, int col);
void setShipExit(int row, int col);
void setShipBed(int row, int col);
// other
void displayMap();
bool move(char);
};
#endif