1 
2 #ifndef __player_h__
3 #define __player_h__
4 
5 #include "build.h"
6 
7 #define MAXNUMORBS   8
8 #define MAXTREASURES 18
9 #define MAXWEAPONS   10
10 #define MAXPOTIONS   5
11 #define PLAYERHEIGHT 48
12 
13 struct Player
14 {
15     int32_t x, y, z;
16     int ang;
17     int horiz;
18     int zoom;
19     int height;
20     int hvel;
21     short sector, oldsector;
22     short screensize;
23     short spritenum;
24     uint8_t dimension;
25     uint32_t flags;
26     int weapon[MAXWEAPONS];
27     int ammo[MAXWEAPONS];
28     int orbammo[MAXNUMORBS];
29     int treasure[MAXTREASURES];
30     int orbactive[MAXNUMORBS];
31     int orb[MAXNUMORBS];
32     int potion[MAXPOTIONS];
33     int lvl;
34     int score;
35     int health;
36     int svgahealth;
37     int maxhealth;
38     int armor;
39     int armortype;
40     uint8_t onsomething;
41     int fallz;
42 
43     int8_t currentpotion;
44     int8_t currweapon;
45     int8_t selectedgun;
46     int8_t currentorb;
47     int8_t currweaponfired;
48     int8_t currweaponanim;
49     int8_t currweaponattackstyle;
50     int8_t shieldpoints;
51     int8_t poisoned;
52     bool currweaponflip;
53     bool spiked;
54     bool playerdie;
55     int invincibletime;
56 
57     bool hasshot;
58     bool orbshot;
59 
60     int16_t helmettime;
61     int16_t shadowtime;
62     int16_t nightglowtime;
63     int16_t strongtime;
64     int16_t manatime;
65     int16_t vampiretime;
66     int16_t shockme;
67     int16_t poisontime;
68     int16_t invisibletime;
69 
70     fix16_t q16angle, q16oangle;
71     fix16_t q16horiz, q16ohoriz;
72     vec3_t opos;
73 };
74 
75 extern Player player[MAXPLAYERS];
76 
77 extern int pyrn;
78 extern int autohoriz;
79 
80 void addarmoramount(int nArmor);
81 void addscoreamount(int nScore);
82 void drawweapons(Player *plr);
83 void drawarmor();
84 void drawpotionpic();
85 void drawscore();
86 void draworbpic();
87 void spikeheart(Player *plr);
88 void updatepics();
89 void sethealth(int hp);
90 void healthpic();
91 void setpotion(int nPotion);
92 //void score(int score);
93 void keyspic();
94 //void armorpic(int arm);
95 void autoweaponchange(int dagun);
96 void levelpic();
97 void shootgun(Player *plr, short daang, char guntype);
98 void potiontext();
99 int checkweapondist(short i, int x, int y, int z, char guntype);
100 void castaorb(Player *plr);
101 //void orbpic(int currentorb);
102 void goesupalevel(Player *plr);
103 void loadnewlevel(int mapon);
104 void displayspelltext();
105 void captureflagpic();
106 void fragspic();
107 void initplayersprite();
108 void plrfireweapon(Player *plr);
109 int lvlspellcheck(Player* plr);
110 void activatedaorb(Player* plr);
111 void usapotion(Player* plr);
112 void plruse(Player* plr);
113 void playerdead(Player* plr);
114 void autothehoriz(Player* plr);
115 void singleshot(short bstatus);
116 void weaponchange();
117 void checkcheat();
118 void victory();
119 
120 #endif
121