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