]>
Commit | Line | Data |
---|---|---|
85ce9d3e | 1 | #ifndef PLAYER_H |
2 | #define PLAYER_H | |
3 | ||
5c449fde | 4 | #include <string> |
85ce9d3e | 5 | #include "aClient.h" |
3662210f | 6 | #include "pouch.h" |
5c449fde | 7 | |
8 | using namespace std; | |
85ce9d3e | 9 | |
c8ada07e | 10 | typedef struct monster_ Monster; |
9d057db5 | 11 | |
85ce9d3e | 12 | class aClient; // forward declaration |
13 | ||
14 | class Player { | |
15 | public: | |
85bcf836 | 16 | Player(); |
17 | Player(aClient *); | |
85ce9d3e | 18 | Player(char *); |
5c449fde | 19 | Player(string); |
85ce9d3e | 20 | ~Player(); |
21 | void setData(Player *); | |
1563e73b | 22 | void setPassword(const char *p); |
e3c5fe46 | 23 | void reset(); |
85ce9d3e | 24 | |
1af35752 | 25 | long int getFlags() { return flags; }; // Returns the Client's current flags |
26 | // Functions also return the flags after modifying them | |
27 | long int setFlags(long int); // Sets the clients flags to a new value | |
28 | long int addFlag(long int); // Adds a flag to the client's flags | |
29 | long int remFlag(long int); // Removes a flag from the client's current flags | |
30 | ||
31 | ||
5c449fde | 32 | string name; // Player's Name |
85ce9d3e | 33 | int level; // Player's level (1-12) |
34 | long int exp; // Player's experience | |
35 | long int gold; // Gold on hand | |
36 | long int bank; // Gold in the bank | |
37 | int hp; // Current Hit Points (health) | |
38 | int maxhp; // Maximum Hit Points | |
39 | int strength; // Player's Strength | |
40 | int defense; // Player's defensive strength | |
41 | int armor; // Number for the player's armor | |
42 | int weapon; // Number for the player's weapon | |
85ce9d3e | 43 | int forest_fights; // Amount of forest fights left today |
44 | int player_fights; // Amount of player<->player fights for today | |
5c449fde | 45 | string password; // Player's encrypted password |
3662210f | 46 | Pouch inventory; // This contains their potions, etc. |
40251952 | 47 | long int lastcommand; // timestamp for the last command typed |
14e24ba1 | 48 | long int lastlogin; // timestamp for the last login |
e3c5fe46 | 49 | |
85bcf836 | 50 | aClient *client; // Pointer to the aClient this player is from |
85ce9d3e | 51 | Monster *fight; // Pointer to the monster the player is currently fighting |
52 | Monster *master; // Pointer to the master the player is currently fighting | |
53 | aClient *battle; // Pointer to the player this player is currently fighting | |
3662210f | 54 | |
1af35752 | 55 | private: |
56 | long int flags; // Player's current flags | |
85ce9d3e | 57 | }; |
58 | ||
59 | struct monster_ { | |
c8ada07e | 60 | monster_(); |
61 | monster_(monster_ *); | |
bf3a2ff9 | 62 | monster_(monster_ &); |
c8ada07e | 63 | ~monster_(); |
5c449fde | 64 | string name; // The monster's name |
65 | string weapon; // A name for their weapon. Doesn't have to be in weapons[] | |
85ce9d3e | 66 | int strength; // Their strength |
67 | int gold; // The gold you get when you kill them | |
68 | int exp; // The experience you get when you kill them | |
69 | int hp; // Their remaining hitpoints | |
70 | int maxhp; // Their max hitpoints | |
5c449fde | 71 | string death; // What is said when they die |
85ce9d3e | 72 | }; |
73 | ||
74 | #endif |