30 #include "engines/icb/common/px_common.h" 31 #include "engines/icb/debug.h" 32 #include "engines/icb/object_structs.h" 33 #include "engines/icb/common/px_route_barriers.h" 34 #include "engines/icb/common/px_scriptengine.h" 35 #include "engines/icb/animation_mega_set.h" 36 #include "engines/icb/fn_routines.h" 37 #include "engines/icb/bone.h" 41 extern int32 armedChangesMode;
42 extern int32 animToggles;
43 extern PXreal REPEL_TURN;
44 extern PXreal REPULSE_DISTANCE;
45 extern int32 CAMERA_SMOOTH_CYCLES;
48 #define CONTROL_MODE_STACK_DEPTH 4 51 static const uint32 MAX_AMMO_CLIPS = 5;
54 static const uint32 MAX_HITS = 10;
63 CROUCH_TO_STAND_UNARMED,
64 CROUCH_TO_STAND_ARMED,
69 PUTTING_AWAY_CROUCH_GUN,
91 FIN_NORMAL_CROUCH_RELOAD,
92 STILL_REVERSE_LINKING,
98 enum __mode_return { __FINISHED_THIS_CYCLE, __MORE_THIS_CYCLE };
101 enum __player_momentum {
120 enum __player_button {
148 __player_momentum momentum;
153 void SetButton(
const enum ButtonEnums b) { bitflag |= b; }
154 void UnSetButton(
const enum ButtonEnums b) { bitflag &= ~b; }
155 uint32 IsButtonSet(
const enum ButtonEnums b)
const {
156 return (bitflag & b);
162 bool8 stepped_on_step;
165 #define MAX_stair_length 40 166 #define TOP_stair_num (MAX_stair_length - 1) 168 enum __pc_input { __KEYS, __OTHER_DI_DEVICE };
171 enum __Actor_control_mode { ACTOR_RELATIVE, SCREEN_RELATIVE };
177 void Set_player_id(uint32
id);
178 uint32 Fetch_player_id();
179 mcodeFunctionReturnCodes Gateway();
180 void Update_input_state();
184 void Find_current_player_interact_object();
185 void Render_crude_interact_highlight();
187 uint32 Fetch_player_interact_id();
188 bool8 Fetch_player_interact_status();
190 bool8 Player_exists();
194 _input *Fetch_input_state();
196 uint32 GetBulletsPerClip();
197 uint32 GetMaxClips();
199 int32 GetNoBullets();
200 void SetBullets(uint32 num);
201 void UseBullets(uint32 num);
203 int32 GetNoAmmoClips();
204 void AddAmmoClips(uint32 num, bool8 bFlashIcons);
205 void UseAmmoClips(uint32 num);
207 int32 GetNoMediPacks();
208 void AddMediPacks(uint32 num, bool8 bFlashIcons);
209 void UseMediPacks(uint32 num);
211 __mode_return Player_walking();
212 __mode_return Player_crouch_walk();
213 __mode_return Player_running();
214 __mode_return Player_stood();
215 __mode_return Player_crouching();
216 __mode_return Player_aiming();
217 __mode_return Player_new_aim();
218 __mode_return Player_crouch_aim();
219 __mode_return Process_strike();
220 __mode_return Player_stairs();
221 __mode_return Player_running_on_stairs();
222 __mode_return Player_stood_on_stairs();
223 __mode_return Player_ladder();
224 __mode_return Player_slide_on_ladder();
228 __mode_return Process_link();
229 __mode_return Process_fast_link();
231 __mode_return Process_reverse_link();
233 __mode_return Process_easy_link();
234 __mode_return Process_still_link();
235 __mode_return Process_reverse_still_link();
237 __mode_return Player_interact();
238 __mode_return Player_press_fire_button();
239 __mode_return Player_press_inv_button();
240 __mode_return Player_press_strike_button();
241 __mode_return Player_press_remora_button();
243 void Add_to_interact_history();
245 void Set_to_first_frame(__mega_set_names opt_link);
246 void Set_to_last_frame(__mega_set_names opt_link);
248 void Start_new_mode(_player_stat new_mode);
250 void Soft_start_new_mode_no_link(_player_stat new_mode, __mega_set_names type);
252 void Soft_start_new_mode(_player_stat new_mode, __mega_set_names opt_link);
253 void Soft_start_new_mode(_player_stat new_mode, __mega_set_names opt_link, __mega_set_names opt_link2);
255 void Hard_start_new_mode(_player_stat new_mode, __mega_set_names opt_link);
256 void Fast_hard_start_new_mode(_player_stat new_mode, __mega_set_names opt_link);
258 void Hard_start_reverse_new_mode(_player_stat new_mode, __mega_set_names opt_link);
260 void Easy_start_new_mode(_player_stat new_mode, __mega_set_names opt_link);
262 void Still_start_new_mode(_player_stat new_mode, __mega_set_names link);
263 void Still_reverse_start_new_mode(_player_stat new_mode, __mega_set_names link);
265 bool8 Advance_frame_motion_and_pan(__mega_set_names anim_type);
266 bool8 Reverse_frame_motion_and_pan(__mega_set_names anim_type);
268 void Set_player_status(_player_stat new_mode);
270 inline void Push_control_mode(__Actor_control_mode newMode);
271 inline void Pop_control_mode();
272 inline void Set_control_mode(__Actor_control_mode newMode);
273 inline __Actor_control_mode Get_control_mode();
275 void Push_player_stat();
276 void Pop_player_stat();
283 _player_stat player_status;
286 _player_stat stat_after_link;
289 _player_stat previous_stat;
294 uint32 inv_cycle_count;
295 uint32 cur_interact_id;
299 __Actor_control_mode focus_mode;
300 __Actor_control_mode master_mode;
302 PXfloat lastCameraPan;
303 PXfloat deltaCameraPan;
306 PXfloat aim_turn_amount;
307 PXfloat stood_turn_amount;
308 PXfloat stood_fast_turn_amount;
309 PXfloat walk_turn_amount;
310 PXfloat run_turn_amount;
311 PXfloat crouch_turn_amount;
330 bool8 interact_selected;
331 bool8 look_at_selected;
346 uint8 begun_at_bottom;
349 int32 step_sample_num;
360 inline bool8 _player::Player_exists() {
363 return (player_exists);
366 inline uint32 _player::Fetch_player_id() {
370 Fatal_error(
"no live player - must stop");
375 inline uint32 _player::Fetch_player_interact_id() {
378 return (cur_interact_id);
381 inline bool8 _player::Fetch_player_interact_status() {
384 return (interact_selected);
387 inline _input *_player::Fetch_input_state() {
393 inline void _player::Push_control_mode(__Actor_control_mode newMode) { focus_mode = newMode; }
395 inline void _player::Set_control_mode(__Actor_control_mode newMode) {
396 focus_mode = newMode;
397 master_mode = newMode;
400 inline void _player::Pop_control_mode() {}
402 inline __Actor_control_mode _player::Get_control_mode() {
return focus_mode; }
405 extern uint32 fire_key;
406 extern uint32 interact_key;
407 extern uint32 inventory_key;
408 extern uint32 arm_key;
409 extern uint32 remora_key;
410 extern uint32 crouch_key;
411 extern uint32 sidestep_key;
412 extern uint32 run_key;
413 extern uint32 pause_key;
414 extern uint32 up_key;
415 extern uint32 down_key;
416 extern uint32 left_key;
417 extern uint32 right_key;
Definition: object_structs.h:391