]>
Commit | Line | Data |
---|---|---|
1 | #ifndef PLAYER_H | |
2 | #define PLAYER_H | |
3 | ||
4 | #include <string> | |
5 | ||
6 | #include "pouch.h" | |
7 | #include "item.h" | |
8 | ||
9 | using namespace std; | |
10 | ||
11 | typedef struct monster_ Monster; | |
12 | ||
13 | class aClient; // forward declaration | |
14 | class item; // forward declaration | |
15 | class weapon; // forward declaration | |
16 | class armor; // forward declaration | |
17 | class potion; // forward declaration | |
18 | ||
19 | class Player { | |
20 | public: | |
21 | Player(); | |
22 | Player(char *); | |
23 | Player(string); | |
24 | ~Player(); | |
25 | void setData(Player *); | |
26 | void setPassword(const char *p); | |
27 | void reset(); | |
28 | ||
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 | ||
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 | |
43 | ||
44 | string name; // Player's Name | |
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 | |
53 | int forest_fights; // Amount of forest fights left today | |
54 | int player_fights; // Amount of player<->player fights for today | |
55 | string password; // Player's encrypted password | |
56 | Pouch inventory; // This contains their potions, etc. | |
57 | long int lastcommand; // timestamp for the last command typed | |
58 | long int lastlogin; // timestamp for the last login | |
59 | ||
60 | aClient *client; // Pointer to the aClient this player is from | |
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 | |
64 | ||
65 | private: | |
66 | long int flags; // Player's current flags | |
67 | weapon *w; // Player's weapon | |
68 | armor *a; // Player's armor | |
69 | }; | |
70 | ||
71 | struct monster_ { | |
72 | monster_(); | |
73 | monster_(monster_ *); | |
74 | monster_(monster_ &); | |
75 | ~monster_(); | |
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 | |
85 | }; | |
86 | ||
87 | #endif |