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