… | |
… | |
19 | * along with this program; if not, write to the Free Software |
19 | * along with this program; if not, write to the Free Software |
20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
21 | * |
21 | * |
22 | * The authors can be reached via e-mail at crossfire@schmorp.de |
22 | * The authors can be reached via e-mail at crossfire@schmorp.de |
23 | */ |
23 | */ |
24 | |
|
|
25 | #define NUM_OUTPUT_BUFS 5 |
|
|
26 | struct Output_Buf |
|
|
27 | { |
|
|
28 | shstr buf; /* Actual string pointer */ |
|
|
29 | uint32 first_update; /* First time this message was stored */ |
|
|
30 | uint16 count; /* How many times we got this message */ |
|
|
31 | }; |
|
|
32 | |
24 | |
33 | /* wand/rod/horn rolled into range_misc. They all use the same body location |
25 | /* wand/rod/horn rolled into range_misc. They all use the same body location |
34 | * anyways. |
26 | * anyways. |
35 | */ |
27 | */ |
36 | enum rangetype |
28 | enum rangetype |
… | |
… | |
184 | sint8 blocked_los[MAP_CLIENT_X][MAP_CLIENT_Y]; /* array showing what spaces */ |
176 | sint8 blocked_los[MAP_CLIENT_X][MAP_CLIENT_Y]; /* array showing what spaces */ |
185 | /* the player can see. For maps smaller than */ |
177 | /* the player can see. For maps smaller than */ |
186 | /* MAP_CLIENT_.., the upper left is used */ |
178 | /* MAP_CLIENT_.., the upper left is used */ |
187 | |
179 | |
188 | shstr ACC (RW, invis_race); /* What race invisible to? */ |
180 | shstr ACC (RW, invis_race); /* What race invisible to? */ |
189 | Output_Buf outputs[NUM_OUTPUT_BUFS]; /* holds output strings to client */ |
|
|
190 | |
181 | |
191 | MTH static player *create (); |
182 | MTH static player *create (); |
192 | |
183 | |
193 | static player *load_pl (object_thawer &thawer); |
184 | static player *load_pl (object_thawer &thawer); |
194 | MTH static player *load_pl (const char *path); |
185 | MTH static player *load_pl (const char *path); |
… | |
… | |
197 | MTH bool save_pl (const char *path); |
188 | MTH bool save_pl (const char *path); |
198 | |
189 | |
199 | void do_destroy (); |
190 | void do_destroy (); |
200 | void gather_callbacks (AV *&callbacks, event_type event) const; |
191 | void gather_callbacks (AV *&callbacks, event_type event) const; |
201 | |
192 | |
|
|
193 | // wether the player can "see" this mapspace or not, decided by los |
|
|
194 | // 0 - nothing see, 100 - fully visible |
|
|
195 | MTH sint8 visibility_at (maptile *map, int x, int y) const; |
|
|
196 | |
202 | MTH void connect (client *ns); |
197 | MTH void connect (client *ns); |
203 | MTH void disconnect (); |
198 | MTH void disconnect (); |
204 | |
199 | |
205 | MTH void activate (); |
200 | MTH void activate (); |
206 | MTH void deactivate (); |
201 | MTH void deactivate (); |
207 | |
202 | |
208 | // enters the initial map, after login or creation |
203 | // enters the initial map, after login or creation |
209 | MTH void enter_map (); |
204 | MTH void enter_map (); |
|
|
205 | |
|
|
206 | MTH void chargen_race_done (); |
|
|
207 | MTH void chargen_race_next (); |
210 | |
208 | |
211 | ~player (); |
209 | ~player (); |
212 | |
210 | |
213 | private: |
211 | private: |
214 | void set_object (object *op); |
212 | void set_object (object *op); |
… | |
… | |
218 | typedef object_vector<player, &player::active> playervec; |
216 | typedef object_vector<player, &player::active> playervec; |
219 | |
217 | |
220 | extern playervec players; |
218 | extern playervec players; |
221 | |
219 | |
222 | #define for_all_players(var) \ |
220 | #define for_all_players(var) \ |
223 | for (int _i = 0; _i < players.size (); ++_i) \ |
221 | for (unsigned _i = 0; _i < players.size (); ++_i) \ |
224 | declvar (player *, var, players [_i]) |
222 | declvar (player *, var, players [_i]) |
225 | |
223 | |