1 #ifndef __PLAYER_H
2 #define __PLAYER_H
3 
4 /*
5 PLAYER.H
6 
7 	Copyright (C) 1991-2001 and beyond by Bungie Studios, Inc.
8 	and the "Aleph One" developers.
9 
10 	This program is free software; you can redistribute it and/or modify
11 	it under the terms of the GNU General Public License as published by
12 	the Free Software Foundation; either version 3 of the License, or
13 	(at your option) any later version.
14 
15 	This program is distributed in the hope that it will be useful,
16 	but WITHOUT ANY WARRANTY; without even the implied warranty of
17 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 	GNU General Public License for more details.
19 
20 	This license is contained in the file "COPYING",
21 	which is included with this source code; it is available online at
22 	http://www.gnu.org/licenses/gpl.html
23 
24 Sunday, July 10, 1994 10:07:21 PM
25 
26 Feb 6, 2000 (Loren Petrich):
27 	Added access to size of physics-definition structure
28 	and to the number of physics models (restricted sense: player physics)
29 
30 Feb 18, 2000 (Loren Petrich):
31 	Added support for a chase cam
32 
33 Feb 25, 2000 (Loren Petrich):
34 	Made it possible to switch viewing sides with the chase cam
35 
36 Feb 26, 2000 (Loren Petrich):
37 	Added chase-cam reset feature, for the purpose of doing chase-cam inertia.
38 	The reset is necessary to take into account teleporting or entering a level.
39 
40 Mar 2, 2000 (Loren Petrich):
41 	Moved the chase-cam stuff into ChaseCam.c/h
42 
43 May 14, 2000 (Loren Petrich):
44 	Added XML support for configuring various player features
45 
46 May 23, 2000 (Loren Petrich):
47 	Added XML configuration of self-luminosity
48 
49 July 1, 2000 (Loren Petrich):
50 	Made player-data accessor inline; added map.h to define some stuff for it
51 
52 Aug 31, 2000 (Loren Petrich):
53 	Added stuff for unpacking and packing
54 
55 Oct 21, 2001 (Woody Zenfell):
56         Moved some info from player.cpp to here, so can be shared (in particular, with SDL net dialog widgets)
57 
58 Feb 20, 2002 (Woody Zenfell):
59     Support for multiple sets of action queues (including gRealActionQueues)
60 
61 May 20, 2002 (Woody Zenfell):
62     Can now find out how long since local player used a terminal
63 */
64 
65 // LP additions: stuff that this file needs
66 #include "cseries.h"
67 #include "world.h"
68 #include "map.h"
69 // ZZZ addition: same deal
70 #include "weapons.h"
71 
72 /* ---------- constants */
73 
74 #ifdef DEMO
75 #define MAXIMUM_NUMBER_OF_PLAYERS 2
76 #else
77 #define MAXIMUM_NUMBER_OF_PLAYERS 8
78 #endif
79 
80 enum
81 {
82 	NUMBER_OF_ITEMS= 64
83 };
84 
85 // All the player values settable by MML put into one struct for easier management.
86 struct player_settings_definition {
87 	// LP additions: variables for initial energy, initial oxygen, and stripped energy:
88 	short InitialEnergy;
89 	short InitialOxygen;
90 	short StrippedEnergy;
91 	// For picked-up powerups
92 	short SingleEnergy;
93 	short DoubleEnergy;
94 	short TripleEnergy;
95 	// LP addition: self-luminosity
96 	_fixed PlayerSelfLuminosity;
97 	// LP: can one swim?
98 	bool CanSwim;
99 	// Used in weapons.cpp: player can have guided missiles
100 	bool PlayerShotsGuided;
101 	short PlayerHalfVisualArc;
102 	short PlayerHalfVertVisualArc;
103 	float PlayerVisualRange;
104 	float PlayerDarkVisualRange;
105 	// LP additions: oxygen depletion and replenishment rates
106 	// (number of units per tick);
107 	// oxygen change is set equal to depletion or replenishment,
108 	// whichever one is appropriate for the environment (vacuum/liquid vs. normal air)
109 	short OxygenDepletion;
110 	short OxygenReplenishment;
111 	short OxygenChange;
112 	// LP addition: invincibility-powerup vulnerability
113 	short Vulnerability;
114 };
115 
116 extern struct player_settings_definition player_settings;
117 #define NATURAL_LIGHT_INTENSITY player_settings.PlayerSelfLuminosity
118 
119 enum /* physics models */
120 {
121 	_editor_model,
122 	_earth_gravity_model,
123 	_low_gravity_model /* cyberspace? */
124 };
125 
126 enum /* player actions; irrelevant if the player is dying or something */
127 {
128 	_player_stationary,
129 	_player_walking,
130 	_player_running,
131 	_player_sliding,
132 	_player_airborne,
133 	NUMBER_OF_PLAYER_ACTIONS
134 };
135 
136 enum /* team colors */
137 {
138 	_violet_team,
139 	_red_team,
140 	_tan_team,
141 	_light_blue_team,
142 	_yellow_team,
143 	_brown_team,
144 	_blue_team,
145 	_green_team,
146 	NUMBER_OF_TEAM_COLORS
147 };
148 
149 enum /* stringset that holds the names of the above colors */
150 {
151 	kTeamColorsStringSetID	= 152 // matches STR# for colors in original Marathon (m2 and inf moved it to a menu)
152 };
153 
154 // Is here for script_instructions.cpp
155 // ZZZ: increasing this queue size so machines (esp. in netgames) are even more tolerant
156 // of abnormalities (can probably reduce it back once the current biggest source of stalled
157 // update_world() calls - OpenGL texture setup in PreloadTextures() etc. - comes before NetSync().)
158 //#define ACTION_QUEUE_BUFFER_DIAMETER 0x100
159 #define ACTION_QUEUE_BUFFER_DIAMETER 0x400
160 
161 /* ---------- action flags */
162 
163 #define ABSOLUTE_YAW_BITS 7
164 #define MAXIMUM_ABSOLUTE_YAW (1<<ABSOLUTE_YAW_BITS)
165 #define GET_ABSOLUTE_YAW(i) (((i)>>(_absolute_yaw_mode_bit+1))&(MAXIMUM_ABSOLUTE_YAW-1))
166 #define SET_ABSOLUTE_YAW(i,y) (((i)&~((MAXIMUM_ABSOLUTE_YAW-1)<<(_absolute_yaw_mode_bit+1))) | ((y)<<(_absolute_yaw_mode_bit+1)))
167 
168 #define ABSOLUTE_PITCH_BITS 5
169 #define MAXIMUM_ABSOLUTE_PITCH (1<<ABSOLUTE_PITCH_BITS)
170 #define GET_ABSOLUTE_PITCH(i) (((i)>>(_absolute_pitch_mode_bit+1))&(MAXIMUM_ABSOLUTE_PITCH-1))
171 #define SET_ABSOLUTE_PITCH(i,y) (((i)&~((MAXIMUM_ABSOLUTE_PITCH-1)<<(_absolute_pitch_mode_bit+1))) | ((y)<<(_absolute_pitch_mode_bit+1)))
172 
173 #define ABSOLUTE_POSITION_BITS 7
174 #define MAXIMUM_ABSOLUTE_POSITION (1<<ABSOLUTE_POSITION_BITS)
175 #define GET_ABSOLUTE_POSITION(i) (((i)>>(_absolute_position_mode_bit+1))&(MAXIMUM_ABSOLUTE_POSITION-1))
176 #define SET_ABSOLUTE_POSITION(i,y) (((i)&~((MAXIMUM_ABSOLUTE_POSITION-1)<<(_absolute_position_mode_bit+1)))|((y)<<(_absolute_position_mode_bit+1)))
177 
178 enum /* action flag bit offsets */
179 {
180 	_absolute_yaw_mode_bit,
181 	_turning_left_bit,
182 	_turning_right_bit,
183 	_sidestep_dont_turn_bit,
184 	_looking_left_bit,
185 	_looking_right_bit,
186 	_absolute_yaw_bit0,
187 	_absolute_yaw_bit1,
188 
189 	_absolute_pitch_mode_bit,
190 	_looking_up_bit,
191 	_looking_down_bit,
192 	_looking_center_bit,
193 	_absolute_pitch_bit0,
194 	_absolute_pitch_bit1,
195 
196 	_absolute_position_mode_bit,
197 	_moving_forward_bit,
198 	_moving_backward_bit,
199 	_run_dont_walk_bit,
200 	_look_dont_turn_bit,
201 	_absolute_position_bit0,
202 	_absolute_position_bit1,
203 	_absolute_position_bit2,
204 
205 	_sidestepping_left_bit,
206 	_sidestepping_right_bit,
207 	_left_trigger_state_bit,
208 	_right_trigger_state_bit,
209 	_action_trigger_state_bit,
210 	_cycle_weapons_forward_bit,
211 	_cycle_weapons_backward_bit,
212 	_toggle_map_bit,
213 	_microphone_button_bit,
214 	_swim_bit,
215 
216 	NUMBER_OF_ACTION_FLAG_BITS /* should be <=32 */
217 };
218 
219 #define _override_absolute_yaw (_turning_left|_turning_right|_looking_left|_looking_right)
220 #define _override_absolute_pitch (_looking_up|_looking_down|_looking_center)
221 #define _override_absolute_position (_moving_forward|_moving_backward)
222 
223 enum /* action_flags */
224 {
225 	_absolute_yaw_mode= 1<<_absolute_yaw_mode_bit,
226 	_turning_left= 1<<_turning_left_bit,
227 	_turning_right= 1<<_turning_right_bit,
228 	_sidestep_dont_turn= 1<<_sidestep_dont_turn_bit,
229 	_looking_left= 1<<_looking_left_bit,
230 	_looking_right= 1<<_looking_right_bit,
231 
232 	_absolute_pitch_mode= 1<<_absolute_pitch_mode_bit,
233 	_looking_up= 1<<_looking_up_bit,
234 	_looking_down= 1<<_looking_down_bit,
235 	_looking_center= 1<<_looking_center_bit,
236 	_look_dont_turn= 1<<_look_dont_turn_bit,
237 
238 	_absolute_position_mode= 1<<_absolute_position_mode_bit,
239 	_moving_forward= 1<<_moving_forward_bit,
240 	_moving_backward= 1<<_moving_backward_bit,
241 	_run_dont_walk= 1<<_run_dont_walk_bit,
242 
243 	_sidestepping_left= 1<<_sidestepping_left_bit,
244 	_sidestepping_right= 1<<_sidestepping_right_bit,
245 	_left_trigger_state= 1<<_left_trigger_state_bit,
246 	_right_trigger_state= 1<<_right_trigger_state_bit,
247 	_action_trigger_state= 1<<_action_trigger_state_bit,
248 	_cycle_weapons_forward= 1<<_cycle_weapons_forward_bit,
249 	_cycle_weapons_backward= 1<<_cycle_weapons_backward_bit,
250 	_toggle_map= 1<<_toggle_map_bit,
251 	_microphone_button= 1<<_microphone_button_bit,
252 	_swim= 1<<_swim_bit,
253 
254 	_turning= _turning_left|_turning_right,
255 	_looking= _looking_left|_looking_right,
256 	_moving= _moving_forward|_moving_backward,
257 	_sidestepping= _sidestepping_left|_sidestepping_right,
258 	_looking_vertically= _looking_up|_looking_down|_looking_center
259 };
260 
261 /* ---------- structures */
262 
263 enum /* player flag bits */
264 {
265 	_RECENTERING_BIT= 0x8000,
266 	_ABOVE_GROUND_BIT= 0x4000,
267 	_BELOW_GROUND_BIT= 0x2000,
268 	_FEET_BELOW_MEDIA_BIT= 0x1000,
269 	_HEAD_BELOW_MEDIA_BIT= 0x0800,
270 	_STEP_PERIOD_BIT= 0x0400
271 };
272 
273 struct physics_variables
274 {
275 	_fixed head_direction;
276 	_fixed last_direction, direction, elevation, angular_velocity, vertical_angular_velocity;
277 	_fixed velocity, perpendicular_velocity; /* in and perpendicular to direction, respectively */
278 	fixed_point3d last_position, position;
279 	_fixed actual_height;
280 
281 	/* used by mask_in_absolute_positioning_information (because it is not really absolute) to
282 		keep track of where we�re going */
283 	_fixed adjusted_pitch, adjusted_yaw;
284 
285 	fixed_vector3d external_velocity; /* from impacts; slowly absorbed */
286 	_fixed external_angular_velocity; /* from impacts; slowly absorbed */
287 
288 	_fixed step_phase; /* step_phase is in [0,1) and is some function of the distance travelled
289 		(for bobbing the gun and the viewpoint) */
290 	_fixed step_amplitude; /* step amplitude is in [0,1) and is some function of velocity */
291 
292 	_fixed floor_height; /* the height of the floor on the polygon where we ended up last time */
293 	_fixed ceiling_height; /* same as above, but ceiling height */
294 	_fixed media_height; /* media height */
295 
296 	int16 action; /* what the player�s legs are doing, basically */
297 	uint16 old_flags, flags; /* stuff like _RECENTERING */
298 };
299 
300 enum { /* Player flags */
301 	_player_doesnt_auto_switch_weapons_flag= 0x0080,
302 	_player_is_interlevel_teleporting_flag= 0x0100,
303 	_player_has_cheated_flag= 0x0200,
304 	_player_is_teleporting_flag= 0x0400,
305 	_player_has_map_open_flag= 0x0800,
306 	_player_is_totally_dead_flag= 0x1000,
307 	_player_is_zombie_flag= 0x2000, // IS THIS USED??
308 	_player_is_dead_flag= 0x4000,
309 	_player_is_pfhortran_controlled_flag= 0x8000
310 };
311 
312 #define PLAYER_PERSISTANT_FLAGS (_player_has_cheated_flag | _player_doesnt_auto_switch_weapons_flag)
313 
314 #define PLAYER_IS_DEAD(p) ((p)->flags&_player_is_dead_flag)
315 #define SET_PLAYER_DEAD_STATUS(p,v) ((void)((v)?((p)->flags|=(uint16)_player_is_dead_flag):((p)->flags&=(uint16)~_player_is_dead_flag)))
316 
317 #define PLAYER_IS_ZOMBIE(p) ((p)->flags&_player_is_zombie_flag)
318 #define SET_PLAYER_ZOMBIE_STATUS(p,v) ((v)?((p)->flags|=(uint16)_player_is_zombie_flag):((p)->flags&=(uint16)~_player_is_zombie_flag))
319 
320 #define PLAYER_IS_PFHORTRAN_CONTROLLED(p) ( ( p )->flags & _player_is_pfhortran_controlled_flag )
321 #define SET_PLAYER_IS_PFHORTRAN_CONTROLLED_STATUS(p,v) ((v)?((p)->flags|=(uint16)_player_is_pfhortran_controlled_flag):((p)->flags&=(uint16)~_player_is_pfhortran_controlled_flag))
322 
323 /* i.e., our animation has stopped */
324 #define PLAYER_IS_TOTALLY_DEAD(p) ((p)->flags&_player_is_totally_dead_flag)
325 #define SET_PLAYER_TOTALLY_DEAD_STATUS(p,v) ((void)((v)?((p)->flags|=(uint16)_player_is_totally_dead_flag):((p)->flags&=(uint16)~_player_is_totally_dead_flag)))
326 
327 #define PLAYER_HAS_MAP_OPEN(p) ( (p)->flags & _player_has_map_open_flag )
328 #define SET_PLAYER_MAP_STATUS(p,v) ((void)((v)?((p)->flags|=(uint16)_player_has_map_open_flag):((p)->flags&=(uint16)~_player_has_map_open_flag)))
329 
330 #define PLAYER_IS_TELEPORTING(p) ((p)->flags&_player_is_teleporting_flag)
331 #define SET_PLAYER_TELEPORTING_STATUS(p,v) ((void)((v)?((p)->flags|=(uint16)_player_is_teleporting_flag):((p)->flags&=(uint16)~_player_is_teleporting_flag)))
332 
333 #define PLAYER_IS_INTERLEVEL_TELEPORTING(p) ((p)->flags&_player_is_interlevel_teleporting_flag)
334 #define SET_PLAYER_INTERLEVEL_TELEPORTING_STATUS(p,v) ((void)((v)?((p)->flags|=(uint16)_player_is_interlevel_teleporting_flag):((p)->flags&=(uint16)~_player_is_interlevel_teleporting_flag)))
335 
336 #define PLAYER_HAS_CHEATED(p) ((p)->flags&_player_has_cheated_flag)
337 #define SET_PLAYER_HAS_CHEATED(p) ((p)->flags|=(uint16)_player_has_cheated_flag)
338 
339 #define PLAYER_DOESNT_AUTO_SWITCH_WEAPONS(p) ((p)->flags&_player_doesnt_auto_switch_weapons_flag)
340 #define SET_PLAYER_DOESNT_AUTO_SWITCH_WEAPONS_STATUS(p,v) ((void)((v)?((p)->flags|=(uint16)_player_doesnt_auto_switch_weapons_flag):((p)->flags&=(uint16)~_player_doesnt_auto_switch_weapons_flag)))
341 
342 #define PLAYER_MAXIMUM_SUIT_ENERGY (150)
343 #define PLAYER_MAXIMUM_SUIT_OXYGEN (6*TICKS_PER_MINUTE)
344 
345 #define MAXIMUM_PLAYER_NAME_LENGTH 32
346 
347 #define PLAYER_TELEPORTING_DURATION TELEPORTING_DURATION
348 #define PLAYER_TELEPORTING_MIDPOINT TELEPORTING_MIDPOINT
349 
350 struct damage_record
351 {
352 	int32 damage;
353 	int16 kills;
354 };
355 
356 struct player_data
357 {
358 	int16 identifier;
359 	int16 flags; // Player flags
360 
361 	int16 color;
362 	int16 team;
363 	char name[MAXIMUM_PLAYER_NAME_LENGTH+1];
364 
365 	/* shadowed from physics_variables structure below and the player�s object (read-only) */
366 	world_point3d location;
367 	world_point3d camera_location; // beginning of fake world_location3d structure
368 	int16 camera_polygon_index;
369 	angle facing, elevation;
370 	int16 supporting_polygon_index; /* what polygon is actually supporting our weight */
371 	int16 last_supporting_polygon_index;
372 
373 	/* suit energy shadows vitality in the player�s monster slot */
374 	int16 suit_energy, suit_oxygen;
375 
376 	int16 monster_index; /* this player�s entry in the monster list */
377 	int16 object_index; /* monster->object_index */
378 
379 	/* Reset by initialize_player_weapons */
380 	int16 weapon_intensity_decay; /* zero is idle intensity */
381 	_fixed weapon_intensity;
382 
383 	/* powerups */
384 	int16 invisibility_duration;
385 	int16 invincibility_duration;
386 	int16 infravision_duration;
387 	int16 extravision_duration;
388 
389 	/* teleporting */
390 	int16 delay_before_teleport; /* This is only valid for interlevel teleports (teleporting_destination is a negative number) */
391 	int16 teleporting_phase; /* NONE means no teleporting, otherwise [0,TELEPORTING_PHASE) */
392 	int16 teleporting_destination; /* level number or NONE if intralevel transporter */
393 	int16 interlevel_teleport_phase; /* This is for the other players when someone else initiates the teleport */
394 
395 	/* there is no state information associated with items; each item slot is only a count */
396 	int16 items[NUMBER_OF_ITEMS];
397 
398 	/* Used by the game window code to keep track of the interface state. */
399 	int16 interface_flags;
400 	int16 interface_decay;
401 
402 	struct physics_variables variables;
403 
404 	struct damage_record total_damage_given;
405 	struct damage_record damage_taken[MAXIMUM_NUMBER_OF_PLAYERS];
406 	struct damage_record monster_damage_taken, monster_damage_given;
407 
408 	int16 reincarnation_delay;
409 
410 	int16 control_panel_side_index; // NONE, or the side index of a control panel the user is using that requires passage of time
411 
412 	int32 ticks_at_last_successful_save;
413 
414 	int32 netgame_parameters[2];
415 
416 	bool	netdead;	// ZZZ: added this; it should not be serialized/deserialized
417 
418 	world_distance step_height; // not serialized, used to correct chase cam bob
419 
420 	// ZZZ: since we don't put this structure directly into files or network communications,
421 	// there ought? to be no reason for the padding
422 //	int16 unused[256];
423 };
424 
425 const int SIZEOF_player_data = 930;
426 
427 const int SIZEOF_physics_constants = 104;
428 
429 // ZZZ: moved here so we can get/use in files other than player.cpp
430 struct player_shape_definitions
431 {
432 	short collection;
433 
434 	short dying_hard, dying_soft;
435 	short dead_hard, dead_soft;
436 	short legs[NUMBER_OF_PLAYER_ACTIONS]; /* stationary, walking, running, sliding, airborne */
437 	short torsos[PLAYER_TORSO_SHAPE_COUNT]; /* NONE, ..., double pistols */
438 	short charging_torsos[PLAYER_TORSO_SHAPE_COUNT]; /* NONE, ..., double pistols */
439 	short firing_torsos[PLAYER_TORSO_SHAPE_COUNT]; /* NONE, ..., double pistols */
440 };
441 
442 // ghs: added these for Lua
443 
444 #define MAXIMUM_ACTIVATION_RANGE (3*WORLD_ONE)
445 
446 enum
447 {
448 	_target_is_platform,
449 	_target_is_control_panel,
450 	_target_is_unrecognized
451 };
452 
453 short find_action_key_target(short player_index, world_distance range, short *target_type, bool perform_panel_actions);
454 
455 /* ---------- globals */
456 
457 extern struct player_data *players;
458 extern struct damage_record team_damage_given[NUMBER_OF_TEAM_COLORS];
459 extern struct damage_record team_damage_taken[NUMBER_OF_TEAM_COLORS];
460 extern struct damage_record team_monster_damage_taken[NUMBER_OF_TEAM_COLORS];
461 extern struct damage_record team_monster_damage_given[NUMBER_OF_TEAM_COLORS];
462 extern struct damage_record team_friendly_fire[NUMBER_OF_TEAM_COLORS];
463 
464 /* use set_local_player_index() and set_current_player_index() to change these! */
465 extern short local_player_index, current_player_index;
466 extern struct player_data *local_player, *current_player;
467 
468 // ZZZ: The set of "real" action queues; existing calls like queue_action_flags
469 // will be operations on the returned value.  Returned from a function to avoid
470 // accidental assignment to the pointer.
471 class ActionQueues;
472 extern ActionQueues*    GetRealActionQueues();
473 
474 /* ---------- prototypes/PLAYER.C */
475 
476 void initialize_players(void);
477 void reset_action_queues(void);
478 void allocate_player_memory(void);
479 
480 void set_local_player_index(short player_index);
481 void set_current_player_index(short player_index);
482 
483 // Flags for new_player()
484 using new_player_flags = uint32;
485 constexpr new_player_flags
486 	new_player_make_local = 1u << 0,
487 	new_player_make_current = 1u << 1,
488 	new_player_make_local_and_current = new_player_make_local | new_player_make_current;
489 
490 short new_player(short team, short color, short player_identifier, new_player_flags flags);
491 void delete_player(short player_number);
492 
493 void recreate_players_for_new_level(void);
494 
495 void team_damage_from_player_data(void);
496 
497 // ZZZ: this now takes a set of ActionQueues as a parameter so the caller can redirect
498 // the update routine's input.  Also, now callers can request a 'predictive update',
499 // which changes less state, in an effort to make partial state saving/restoration successful.
500 void update_players(ActionQueues* inActionQueuesToUse, bool inPredictive); /* assumes �t==1 tick */
501 
502 // handle pausing Marathon 1 terminals
503 bool m1_solo_player_in_terminal();
504 void update_m1_solo_player_in_terminal(ActionQueues* inActionQueuesToUse);
505 
506 void walk_player_list(void);
507 
508 void damage_player(short monster_index, short aggressor_index, short aggressor_type,
509 	struct damage_definition *damage, short projectile_index);
510 
511 void mark_player_collections(bool loading);
512 
513 // ZZZ: new function to get current player_shape_definitions
514 player_shape_definitions* get_player_shape_definitions();
515 
516 short player_identifier_to_player_index(short player_identifier);
517 
518 player_data *get_player_data(
519 	const size_t player_index);
520 
521 short monster_index_to_player_index(short monster_index);
522 
523 short get_polygon_index_supporting_player(short player_index);
524 
525 bool legal_player_powerup(short player_index, short item_index);
526 void process_player_powerup(short player_index, short item_index);
527 
528 world_distance dead_player_minimum_polygon_height(short polygon_index);
529 
530 bool try_and_subtract_player_item(short player_index, short item_type);
531 
532 /* ---------- prototypes/PHYSICS.C */
533 
534 void initialize_player_physics_variables(short player_index);
535 void update_player_physics_variables(short player_index, uint32 action_flags, bool predictive);
536 
537 void adjust_player_for_polygon_height_change(short monster_index, short polygon_index, world_distance new_floor_height,
538 	world_distance new_ceiling_height);
539 void accelerate_player(short monster_index, world_distance vertical_velocity, angle direction, world_distance velocity);
540 
541 void kill_player_physics_variables(short player_index);
542 
543 void get_absolute_pitch_range(_fixed *minimum, _fixed *maximum);
544 
545 _fixed get_player_forward_velocity_scale(short player_index);
546 
547 // Delta from the low-precision physical aim to the virtual "true" aim implied by high-precision aiming input;
548 // |<yaw or pitch delta>| <= FIXED_ONE/2
549 fixed_yaw_pitch virtual_aim_delta();
550 
551 // Resync the virtual aim to the current physical aim
552 void resync_virtual_aim();
553 
554 // Update the virtual aim and return action flags updated with yaw/pitch deltas (if appropriate)
555 uint32 process_aim_input(uint32 action_flags, fixed_yaw_pitch delta);
556 
557 
558 // LP: to pack and unpack this data;
559 // these do not make the definitions visible to the outside world
560 
561 uint8 *unpack_player_data(uint8 *Stream, player_data *Objects, size_t Count);
562 uint8 *pack_player_data(uint8 *Stream, player_data *Objects, size_t Count);
563 uint8 *unpack_physics_constants(uint8 *Stream, size_t Count);
564 uint8 *pack_physics_constants(uint8 *Stream, size_t Count);
565 
566 // LP addition: get number of physics models (restricted sense)
567 size_t get_number_of_physics_models();
568 
569 // ZZZ addition: get number of ticks (NOT measured carefully, beware)
570 // since local player was in terminal mode.
571 int get_ticks_since_local_player_in_terminal();
572 
573 class InfoTree;
574 void parse_mml_player(const InfoTree& root);
575 void reset_mml_player();
576 
577 #endif
578 
579