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