X-Git-Url: https://jfr.im/git/irc/gameservirc.git/blobdiff_plain/5c449fdefc6456ed1f53fb4488755826ac1d5198..37ed80a99c033d815fcef9a7d1c8b48ef334220d:/gameserv/player.h diff --git a/gameserv/player.h b/gameserv/player.h index c2a149e..b0919dd 100644 --- a/gameserv/player.h +++ b/gameserv/player.h @@ -2,8 +2,6 @@ #define PLAYER_H #include -#include "aClient.h" -#include "pouch.h" using namespace std; @@ -11,14 +9,20 @@ 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 pouch; // 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 @@ -27,6 +31,14 @@ 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 string name; // Player's Name int level; // Player's level (1-12) @@ -37,12 +49,10 @@ 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 string password; // Player's encrypted password - Pouch inventory; // This contains their potions, etc. + pouch *inventory; // This contains everything you're holding long int lastcommand; // timestamp for the last command typed long int lastlogin; // timestamp for the last login @@ -53,6 +63,8 @@ public: private: long int flags; // Player's current flags + weapon *w; // Player's weapon + armor *a; // Player's armor }; struct monster_ { @@ -60,14 +72,15 @@ struct monster_ { monster_(monster_ *); monster_(monster_ &); ~monster_(); - 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 - string 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