1 extern void LiftBehaveFun(STRATEGYBLOCK* sbptr);
2 extern void * LiftBehaveInit(void* bhdata, STRATEGYBLOCK* sbptr);
3 extern void CleanUpLiftControl();
4 
5 extern void TeleportContents(MODULE* new_pos, MODULE* old_pos,BOOL floor_switches_fixed);
6 extern BOOL BadGuyInModule();
7 
8 
9 
10 
11 
12 /*********************** Lifts **************************/
13 
14 
15 typedef struct lift_stations
16 {
17 	char lift_call_switch_name[SB_NAME_LENGTH];
18 	STRATEGYBLOCK* lift_call_switch;
19 	char lift_door_name[SB_NAME_LENGTH];
20 	STRATEGYBLOCK* lift_door;
21 	char lift_floor_switch_name[SB_NAME_LENGTH];
22 	STRATEGYBLOCK* lift_floor_switch; // the floor switches teleport
23 	BOOL called;
24 	char my_sb_name[SB_NAME_LENGTH];	// only used when envs change
25 	MODULE* lift_module;
26 	I_AVP_ENVIRONMENTS env; 	// tells us if we need a cd load
27 	int num_floor;						// not the floor num but the poition
28 														// in the array
29 	int orient; 				//the facing of the lift (from 0 to 3)
30 	BOOL starting_station;
31 
32 
33 }LIFT_STATION;
34 
35 typedef enum liftmotion{
36 
37 	I_going_up,					/*** numbers go down (0 at surface **/
38 	I_going_down,				// numbers go up
39 
40 }LIFT_MOTION;
41 
42 
43 typedef enum lift_ctrl_states
44 {
45 	I_ls_waiting,
46 	I_ls_closing_door,
47 	I_ls_moving,
48 	I_ls_opening_door,
49 	I_ls_delay_at_floor,
50 
51 }LIFT_CTRL_STATES;
52 
53 #define LIFT_FLOOR_DELAY ONE_FIXED*2  // two secs
54 #define LIFT_MOVE_DELAY ONE_FIXED*5   // three secs
55 
56 
57 typedef struct lift_control
58 {
59 	int num_stations;				// num staions for this lift
60 	LIFT_STATION** lift_stations;	// array of lift stations for this lift
61 	int dest_station;							// -1 when there is no floor
62 	int curr_station;					 		// 	tells us the lift pos
63 	int prev_station;							// where did we come from
64 	int delay_at_floor;				 		// tells us how long to stay at floor
65 	int delay_between_floors;	 		// tells us how long before teleport
66 	LIFT_MOTION motion;
67 	LIFT_CTRL_STATES state;
68 	BOOL floor_switches_fixed;
69 	int SoundHandle;
70 
71 } LIFT_CONTROL_BLOCK;
72 
73 
74 typedef struct lift_behaviour
75 {
76 	AVP_BEHAVIOUR_TYPE bhvr_type;
77 	char control_sb_name[SB_NAME_LENGTH];
78 	STRATEGYBLOCK* control_sb;
79 	LIFT_CONTROL_BLOCK* lift_control;
80 	LIFT_STATION lift_station;
81 	int controller;
82 
83 } LIFT_BEHAV_BLOCK;
84 
85 #define LiftFlag_Here			0x00000001
86 #define LiftFlag_Airlock		0x00000002
87 #define LiftFlag_NoTel			0x00000004 /*switches aren't teleported*/
88 
89 typedef struct lift_tools_template
90 {
91 	// for behaviour block
92 	char control_sb_name[SB_NAME_LENGTH];
93 	int controller;
94 
95 	// for control block
96 	int num_stations;
97 
98 	// for station block
99 	char call_switch_name[SB_NAME_LENGTH];
100 	char lift_door_name[SB_NAME_LENGTH];
101 	char lift_floor_switch_name[SB_NAME_LENGTH];
102 	char my_module_name[SB_NAME_LENGTH];
103 	int environment;
104 	int num_floor;
105 	int lift_flags;
106 	int orient;
107 
108 	// for strategy block
109 	MREF my_module;
110 	char nameID[SB_NAME_LENGTH];
111 
112 } LIFT_TOOLS_TEMPLATE;
113 
114 
115 extern int RequestEnvChangeViaLift;
116 extern int RequestEnvChangeViaAirlock;
117