1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
|
#ifndef PLAYER_2_H
#define PLAYER_2_H
#include <iostream>
#include <string>
using namespace std;
enum PlayerTypeT{EXPLORER, WARRIOR, HORNET, KILLERANT, SPIDER}; //The type of the player
enum WeaponT{PISTOL, ASSAULTRIFLE, GRENADE, HEAVYWEAPON, NULLWEAPON}; //The weapons that// players can use
static const int WPNDAM = 6; //Temporary
static const int WPNPOW = 5; //Temporary
static const int IMPACT_TABLE[13][13] = {
/*Power: 0 1 2 3 4 5 6 7 8 9 10 11 12 */
/*Roll: 0*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/*Roll: 1*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/*Roll: 2*/ { 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10},
/*Roll: 3*/ { 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,-1},
/*Roll: 4*/ { 0, 0, 2, 3, 4, 5, 6, 7, 8, 9,10,-1,-1},
/*Roll: 5*/ { 0, 0, 3, 4, 5, 6, 7, 8, 9,10,-1,-1,-1},
/*Roll: 6*/ { 0, 0, 4, 5, 6, 7, 8, 9,10,-1,-1,-1,-1},
/*Roll: 7*/ { 0, 0, 5, 6, 7, 8, 9,10,-1,-1,-1,-1,-1},
/*Roll: 8*/ { 0, 0, 6, 7, 8, 9,10,-1,-1,-1,-1,-1,-1},
/*Roll: 9*/ { 0, 0, 7, 8, 9,10,-1,-1,-1,-1,-1,-1,-1},
/*Roll:10*/ { 0, 0, 8, 9,10,-1,-1,-1,-1,-1,-1,-1,-1},
/*Roll:11*/ { 0, 0, 9,10,-1,-1,-1,-1,-1,-1,-1,-1,-1},
/*Roll:12*/ { 0, 0,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
}; //(note: -1 = wound)
static const int WOUND_TABLE[13][13] = {
/*WP Rating: 0 1 2 3 4 5 6 7 8 9 10 11 12 */
/*Roll: 0*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/*Roll: 1*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/*Roll: 2*/ { 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,-1},
/*Roll: 3*/ { 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,-1,-1},
/*Roll: 4*/ { 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,-1,-1,-1},
/*Roll: 5*/ { 0, 0, 1, 1, 1, 1, 1, 1, 1,-1,-1,-1,-1},
/*Roll: 6*/ { 0, 0, 1, 1, 1, 1, 1, 1,-1,-1,-1,-1,-1},
/*Roll: 7*/ { 0, 0, 1, 1, 1, 1, 1,-1,-1,-1,-1,-1,-1},
/*Roll: 8*/ { 0, 0, 1, 1, 1, 1,-1,-1,-1,-1,-1,-1,-1},
/*Roll: 9*/ { 0, 0, 1, 1, 1,-1,-1,-1,-1,-1,-1,-1,-1},
/*Roll:10*/ { 0, 0, 1, 1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
/*Roll:11*/ { 0, 0, 1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
/*Roll:12*/ { 0, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
}; //(note: 1 = kill)
struct CellT{int col; int row;}; //Used to store where the player is on the game board
class PlayerClass{
public:
PlayerClass(string player_name, char kind); //Constructor; sets stats to those of the type and the name to str
~PlayerClass();//Destructor, Removes all dynamic portions of the class
PlayerClass(const PlayerClass& p);
PlayerClass& operator = (const PlayerClass& p);
bool Active(); //Sets the player to active, but only if they are alive
bool InActive(); //Sets the player to inactive
bool Dead(); //Sets a players health and willpower to 0 and sets them to inactive
bool Heal(); //Raises a players health by 10. If the new health would exceed max health, health is set to max health
int ResetMomentum(); //Sets a player's momentum equal to their current speed
int UseMomentum(int num); //Adjusts a player's momentum after an action is completed
bool SetCell(int newRow, int newCol); //Places a player at a valid coordinate on the board
int Row() const;//Observer for the current row of the player
int Col() const;//Observer for the current column of the player
string Name() const;//Observer for the name of the player
char Type() const;//Observer for the type of the player; returns a corresponding capital letter to their type
int Health() const;//Observer for the health of the player
int WillPower() const;//Observer for the willpower of the player
int MaxSpeed() const;//Observer for the maximum speed of the player
int CurrentSpeed() const;//Observer for the current speed of the player
int Power() const;//Observer for the power of the player
int Armor() const;//Observer for the armor of the player
int Momentum() const;//Observer for the momentum of the player
bool IsAlive() const;//Observer for the player's condition; returns true if alive, false if dead
bool IsDead() const;//Observer for the player's condition; returns true if dead, false if alive
bool IsActive() const;//Observer for the player's activity; returns true if active, false if inactive
bool IsMyEnemy(PlayerClass *p);//Form of comparing players; true if one player is human and the other is a bug or if
//both players are bugs & they are different types of bugs
int SlowDown(int hazard);//Reduces the players current speed by the hazard
currentspeed=momentum
int ResetCurrentSpeed();//Sets players currentspeed to MaxSpeed
int Wounded(int damage);//Removes the damage from the players health if possible
int Damage();//Determines the amount of damage dealt by a player
int Impact();//Determines the impact of a critical wound done on a player
const int WeaponSkill();//Returns the value of a players WeaponSkill
const string WeaponName();//Returns the name of the weapon currently being held
const bool HasWeapon();//Verifies if the player is holding a weapon or not
bool CriticalWound();//If a critical wound is hit, this applies the results
bool DropWeapon();//Drops the weapon if the player has one
bool GrabWeapon(string weapon, int skill);//Grabs a weapon if the player is elidgable
// private:
PlayerClass(); //Default Constructor; sets stats to Spider with name "Default"
void CopyPlayer(PlayerClass* to, const PlayerClass* from); //Copy Constructor for this class.
string wepName;
string name;
int health;
int maxHealth;
int willpower;
int maxSpeed;
int currentSpeed;
int momentum;
int power;
int physicalDiceNumber
int physicalDiceSides;
int defArmorValue;
int weaponSkill;
char * weaponName;
bool isHuman;
bool active;
WeaponT weapon;
PlayerTypeT type;
void SetWarrior(string str);//Sets the players stats to those of a warrior with name of str
void SetExplorer(string str);//Sets the players stats to those of a explorer with name of str
void SetKillerAnt(string str);//Sets the players stats to those of a killerant with name of str
void SetSpider(string str);//Sets the players stats to those of a spider with name of str
void SetHornet(string str);//Sets the players stats to those of a hornet with name of str
};
#endif
|