| | 1 | #ifndef _bh_binsw_h_ |
| | 2 | #define _bh_binsw_h_ 1 |
| | 3 | |
| | 4 | #include "track.h" |
| | 5 | |
| | 6 | extern void BinarySwitchBehaveInit(void* bhdata, STRATEGYBLOCK* sbptr); |
| | 7 | extern void BinarySwitchBehaveFun(STRATEGYBLOCK* sbptr); |
| | 8 | extern int BinarySwitchGetSynchData(STRATEGYBLOCK* sbptr); |
| | 9 | extern void BinarySwitchSetSynchData(STRATEGYBLOCK* sbptr,int status); |
| | 10 | |
| | 11 | /******************** BinarySwitch ***********************/ |
| | 12 | |
| | 13 | // enum to decxribe how the switch works |
| | 14 | // action is always dependent on the SB block of the target |
| | 15 | |
| | 16 | typedef enum binary_switch_mode |
| | 17 | { |
| | 18 | I_bswitch_timer, |
| | 19 | I_bswitch_wait, |
| | 20 | I_bswitch_toggle, |
| | 21 | I_bswitch_moving, |
| | 22 | I_bswitch_time_delay, |
| | 23 | I_bswitch_time_delay_autoexec //timer starts as soon as game starts |
| | 24 | |
| | 25 | } BSWITCH_MODE; |
| | 26 | |
| | 27 | typedef enum binary_switch_req_states |
| | 28 | { |
| | 29 | I_no_request, |
| | 30 | I_request_on, |
| | 31 | I_request_off |
| | 32 | |
| | 33 | } BINARY_SWITCH_REQUEST_STATE; |
| | 34 | |
| | 35 | typedef enum bswitch_display_types |
| | 36 | { |
| | 37 | binswitch_no_display, |
| | 38 | binswitch_animate_me, |
| | 39 | binswitch_move_me, |
| | 40 | binswitch_animate_and_move_me |
| | 41 | |
| | 42 | } BSWITCH_DISPLAY_TYPES; |
| | 43 | |
| | 44 | // require three states for rest fso we can ignore |
| | 45 | |
| | 46 | #define SwitchFlag_UseTriggerVolume 0x00000001 //switch triggered by walking into trigger volume |
| | 47 | |
| | 48 | typedef struct binary_switch |
| | 49 | { |
| | 50 | AVP_BEHAVIOUR_TYPE bhvr_type; |
| | 51 | BINARY_SWITCH_REQUEST_STATE request; |
| | 52 | int state; |
| | 53 | BSWITCH_MODE bs_mode; |
| | 54 | |
| | 55 | int num_targets; |
| | 56 | SBNAMEBLOCK * target_names; |
| | 57 | int * request_messages; |
| | 58 | |
| | 59 | STRATEGYBLOCK ** bs_targets; |
| | 60 | |
| | 61 | int time_for_reset; // constant |
| | 62 | int timer; |
| | 63 | |
| | 64 | // stuff for showing how the switch displays its state |
| | 65 | |
| | 66 | BSWITCH_DISPLAY_TYPES bs_dtype; |
| | 67 | |
| | 68 | TXACTRLBLK *bs_tac; // animations |
| | 69 | |
| | 70 | TRACK_CONTROLLER* bs_track; |
| | 71 | // or positions |
| | 72 | |
| | 73 | BSWITCH_MODE mode_store; |
| | 74 | |
| | 75 | int new_state; |
| | 76 | int new_request; |
| | 77 | |
| | 78 | int security_clerance; // what the plyer has to be to use this switch |
| | 79 | |
| | 80 | int switch_flags; |
| | 81 | VECTORCH trigger_volume_min;//for switches that can be set off by walking |
| | 82 | VECTORCH trigger_volume_max;//into a given area |
| | 83 | |
| | 84 | int soundHandle; |
| | 85 | int triggered_last; |
| | 86 | |
| | 87 | unsigned int switch_off_message_same:1; |
| | 88 | unsigned int switch_off_message_none:1; |
| | 89 | |
| | 90 | int TimeUntilNetSynchAllowed; |
| | 91 | |
| | 92 | } BINARY_SWITCH_BEHAV_BLOCK; |
| | 93 | |
| | 94 | typedef struct bin_switch_tools_template |
| | 95 | { |
| | 96 | VECTORCH position; |
| | 97 | EULER orientation; |
| | 98 | int mode; |
| | 99 | int time_for_reset; |
| | 100 | int security_clearance; |
| | 101 | int num_targets; |
| | 102 | SBNAMEBLOCK * target_names; |
| | 103 | int* request_messages; |
| | 104 | char nameID[SB_NAME_LENGTH]; |
| | 105 | TRACK_CONTROLLER* track; |
| | 106 | int switch_flags; |
| | 107 | VECTORCH trigger_volume_min;//for switches that can be set off by walking |
| | 108 | VECTORCH trigger_volume_max;//into a given area |
| | 109 | unsigned int starts_on:1; |
| | 110 | unsigned int switch_off_message_same:1; |
| | 111 | unsigned int switch_off_message_none:1; |
| | 112 | |
| | 113 | } BIN_SWITCH_TOOLS_TEMPLATE; |
| | 114 | #endif |