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