X-Git-Url: https://jfr.im/git/irc/gameservirc.git/blobdiff_plain/14e24ba1bf9a16eb685914837c83d6c1798011b6..26b1738621ecdeb4fdf857d76a6f9b882a296da6:/gameserv/player.h diff --git a/gameserv/player.h b/gameserv/player.h index 00b95f3..096bb45 100644 --- a/gameserv/player.h +++ b/gameserv/player.h @@ -1,21 +1,29 @@ #ifndef PLAYER_H #define PLAYER_H -#include -#include "aClient.h" +#include + #include "pouch.h" +#include "item.h" + +using namespace std; typedef struct monster_ Monster; class aClient; // forward declaration +class item; // forward declaration +class weapon; // forward declaration +class armor; // forward declaration +class potion; // forward declaration class Player { public: Player(); - Player(aClient *); Player(char *); + Player(string); ~Player(); void setData(Player *); + void setPassword(const char *p); void reset(); long int getFlags() { return flags; }; // Returns the Client's current flags @@ -24,8 +32,16 @@ public: long int addFlag(long int); // Adds a flag to the client's flags long int remFlag(long int); // Removes a flag from the client's current flags + int wea; + int arm; // delete soon + + weapon *getWeapon() { return w; }; + armor *getArmor() { return a; }; + + void setWeapon (weapon &); // Set a player's weapon to some item + void setArmor (armor &); // Set a player's weapon to some item - char *name; // Player's Name + string name; // Player's Name int level; // Player's level (1-12) long int exp; // Player's experience long int gold; // Gold on hand @@ -34,11 +50,9 @@ public: int maxhp; // Maximum Hit Points int strength; // Player's Strength int defense; // Player's defensive strength - int armor; // Number for the player's armor - int weapon; // Number for the player's weapon int forest_fights; // Amount of forest fights left today int player_fights; // Amount of player<->player fights for today - char *password; // Player's encrypted password + string password; // Player's encrypted password Pouch inventory; // This contains their potions, etc. long int lastcommand; // timestamp for the last command typed long int lastlogin; // timestamp for the last login @@ -50,20 +64,24 @@ public: private: long int flags; // Player's current flags + weapon *w; // Player's weapon + armor *a; // Player's armor }; struct monster_ { monster_(); monster_(monster_ *); + monster_(monster_ &); ~monster_(); - char *name; // The monster's name - char *weapon; // A name for their weapon. Doesn't have to be in weapons[] - int strength; // Their strength - int gold; // The gold you get when you kill them - int exp; // The experience you get when you kill them - int hp; // Their remaining hitpoints - int maxhp; // Their max hitpoints - char *death; // What is said when they die + string name; // The monster's name + string weapon; // A name for their weapon. Doesn't have to be in weapons[] + int strength; // Their strength + int gold; // The gold you get when you kill them + int exp; // The experience you get when you kill them + int hp; // Their remaining hitpoints + int maxhp; // Their max hitpoints + int defense; // Only used seldomly + string death; // What is said when they die }; #endif