1 #ifndef __PLATFORM_DEFINITIONS_H
2 #define __PLATFORM_DEFINITIONS_H
3 
4 /*
5 PLATFORM_DEFINITIONS.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 Monday, June 26, 1995 9:43:22 AM  (Jason)
25 */
26 
27 #include "platforms.h"
28 #include "SoundManagerEnums.h"
29 
30 /* ---------- constants */
31 
32 enum /* sound codes for play_platform_sound() */
33 {
34 	_stopping_sound,
35 	_starting_sound,
36 	_obstructed_sound,
37 	_uncontrollable_sound
38 };
39 
40 /* ---------- structures */
41 
42 struct platform_definition
43 {
44 	/* sounds; specific sounds are played if they can be (i.e., ...at_bottom) otherwise the
45 		general sound is played */
46 	int16 starting_extension, starting_contraction;
47 	int16 stopping_extension, stopping_contraction;
48 	int16 obstructed_sound, uncontrollable_sound;
49 	int16 moving_sound;
50 
51 	int16 key_item_index;
52 
53 	struct static_platform_data defaults;
54 
55 	struct damage_definition damage;
56 };
57 
58 /* ---------- definitions */
59 
60 struct platform_definition platform_definitions[NUMBER_OF_PLATFORM_TYPES]=
61 {
62 	{ // _platform_is_spht_door
63 		_snd_spht_door_opening, _snd_spht_door_closing,
64 		NONE, NONE,
65 		_snd_spht_door_obstructed, _snd_spht_door_obstructed,
66 		_ambient_snd_spht_door,
67 
68 		NONE, /* key item index */
69 
70 		{ /* defaults */
71 			_platform_is_spht_door, _fast_platform, _very_long_delay_platform, NONE, NONE,
72 				FLAG(_platform_deactivates_at_initial_level) | FLAG(_platform_extends_floor_to_ceiling) |
73 				FLAG(_platform_is_player_controllable) | FLAG(_platform_is_monster_controllable) |
74 				FLAG(_platform_reverses_direction_when_obstructed) | FLAG(_platform_is_initially_extended) |
75 				FLAG(_platform_comes_from_ceiling) | FLAG(_platform_is_door)
76 		},
77 
78 		{_damage_crushing, 0, 30, 10, FIXED_ONE} /* damage, if necessary */
79 	},
80 
81 	{ // _platform_is_split_spht_door
82 		_snd_spht_door_opening, _snd_spht_door_closing,
83 		NONE, NONE,
84 		_snd_spht_door_obstructed, _snd_spht_door_obstructed,
85 		_ambient_snd_spht_door,
86 
87 		NONE, /* key item index */
88 
89 		{ /* defaults */
90 			_platform_is_spht_split_door, _slow_platform, _very_long_delay_platform, NONE, NONE,
91 				FLAG(_platform_deactivates_at_initial_level) | FLAG(_platform_extends_floor_to_ceiling) |
92 				FLAG(_platform_is_player_controllable) | FLAG(_platform_is_monster_controllable) |
93 				FLAG(_platform_reverses_direction_when_obstructed) | FLAG(_platform_comes_from_floor) |
94 				FLAG(_platform_comes_from_ceiling) | FLAG(_platform_is_initially_extended) |
95 				FLAG(_platform_is_door)
96 		},
97 
98 		{_damage_crushing, 0, 5, 4, FIXED_ONE}
99 	},
100 
101 	{ // _platform_is_locked_spht_door
102 		_snd_spht_door_opening, _snd_spht_door_closing,
103 		NONE, NONE,
104 		_snd_spht_door_obstructed, _snd_spht_door_obstructed,
105 		_ambient_snd_spht_door,
106 
107 		NONE, /* key item index */
108 
109 		{ /* defaults */
110 			_platform_is_locked_spht_door, _slow_platform, _very_long_delay_platform, NONE, NONE,
111 				FLAG(_platform_deactivates_at_initial_level) | FLAG(_platform_extends_floor_to_ceiling) |
112 				FLAG(_platform_is_player_controllable) | FLAG(_platform_is_monster_controllable) |
113 				FLAG(_platform_reverses_direction_when_obstructed) | FLAG(_platform_comes_from_floor) |
114 				FLAG(_platform_comes_from_ceiling) | FLAG(_platform_is_initially_extended) |
115 				FLAG(_platform_is_door)
116 		},
117 
118 		{_damage_crushing, 0, 5, 4, FIXED_ONE}
119 	},
120 
121 	{ // _platform_is_spht_platform
122 		NONE, NONE,
123 		NONE, NONE,
124 		NONE, NONE,
125 		NONE,
126 
127 		NONE, /* key item index */
128 
129 		{ /* defaults */
130 			_platform_is_spht_platform, _slow_platform, _long_delay_platform, NONE, NONE,
131 				FLAG(_platform_is_initially_active) | FLAG(_platform_is_initially_extended) | FLAG(_platform_comes_from_floor) |
132 				FLAG(_platform_reverses_direction_when_obstructed)
133 		},
134 
135 		{_damage_crushing, 0, 30, 10, FIXED_ONE} /* damage, if necessary */
136 	},
137 
138 	{ // _platform_is_noisy_spht_platform
139 		_snd_spht_platform_starting, _snd_spht_platform_starting,
140 		_snd_spht_platform_stopping, _snd_spht_platform_stopping,
141 		_snd_spht_platform_stopping, NONE,
142 		_ambient_snd_spht_platform,
143 
144 		NONE, /* key item index */
145 
146 		{ /* defaults */
147 			_platform_is_noisy_spht_platform, _slow_platform, _long_delay_platform, NONE, NONE,
148 				FLAG(_platform_is_initially_active) | FLAG(_platform_is_initially_extended) | FLAG(_platform_comes_from_floor) |
149 				FLAG(_platform_reverses_direction_when_obstructed)
150 		},
151 
152 		{_damage_crushing, 0, 30, 10, FIXED_ONE} /* damage, if necessary */
153 	},
154 
155 	{ // _platform_is_heavy_spht_door
156 		_snd_heavy_spht_door_closing, _snd_heavy_spht_door_opening,
157 		_snd_heavy_spht_door_closed, _snd_heavy_spht_door_open,
158 		_snd_heavy_spht_door_obstructed, _snd_heavy_spht_door_obstructed,
159 		_ambient_snd_heavy_spht_door,
160 
161 		NONE, /* key item index */
162 
163 		{ /* defaults */
164 			_platform_is_heavy_spht_door, _slow_platform, _very_long_delay_platform, NONE, NONE,
165 				FLAG(_platform_deactivates_at_initial_level) | FLAG(_platform_extends_floor_to_ceiling) |
166 				FLAG(_platform_is_player_controllable) | FLAG(_platform_is_monster_controllable) |
167 				FLAG(_platform_reverses_direction_when_obstructed) | FLAG(_platform_comes_from_ceiling) |
168 				FLAG(_platform_is_initially_extended) | FLAG(_platform_is_door)
169 		},
170 
171 		{_damage_crushing, 0, 5, 4, FIXED_ONE}
172 	},
173 
174 	{ // pfhor door
175 		_snd_pfhor_door_opening, _snd_pfhor_door_closing,
176 		NONE, NONE,
177 		_snd_pfhor_door_obstructed, _snd_pfhor_door_obstructed,
178 		_ambient_snd_pfhor_door,
179 
180 		NONE, /* key item index */
181 
182 		{ /* defaults */
183 			_platform_is_pfhor_door, _fast_platform, _very_long_delay_platform, NONE, NONE,
184 				FLAG(_platform_deactivates_at_initial_level) | FLAG(_platform_extends_floor_to_ceiling) |
185 				FLAG(_platform_is_player_controllable) | FLAG(_platform_is_monster_controllable) |
186 				FLAG(_platform_reverses_direction_when_obstructed) | FLAG(_platform_is_initially_extended) |
187 				FLAG(_platform_comes_from_ceiling) | FLAG(_platform_is_door)
188 		},
189 
190 		{_damage_crushing, 0, 30, 10, FIXED_ONE} /* damage, if necessary */
191 	},
192 
193 	{ // _platform_is_heavy_spht_platform
194 		_snd_heavy_spht_platform_starting, _snd_heavy_spht_platform_starting,
195 		_snd_heavy_spht_platform_stopping, _snd_heavy_spht_platform_stopping,
196 		_snd_heavy_spht_platform_stopping, NONE,
197 		_ambient_snd_heavy_spht_platform,
198 
199 		NONE, /* key item index */
200 
201 		{ /* defaults */
202 			_platform_is_heavy_spht_platform, _slow_platform, _long_delay_platform, NONE, NONE,
203 				FLAG(_platform_is_initially_active) | FLAG(_platform_is_initially_extended) |
204 				FLAG(_platform_comes_from_floor) | FLAG(_platform_reverses_direction_when_obstructed),
205 		},
206 
207 		{_damage_crushing, 0, 5, 4, FIXED_ONE}
208 	},
209 
210 	{ // pfhor platform
211 		_snd_pfhor_platform_starting, _snd_pfhor_platform_starting,
212 		_snd_pfhor_platform_stopping, _snd_pfhor_platform_stopping,
213 		_snd_pfhor_platform_stopping, NONE,
214 		_ambient_snd_pfhor_platform,
215 
216 		NONE, /* key item index */
217 
218 		{ /* defaults */
219 			_platform_is_pfhor_platform, _slow_platform, _long_delay_platform, NONE, NONE,
220 				FLAG(_platform_is_initially_active) | FLAG(_platform_is_initially_extended) | FLAG(_platform_comes_from_floor) |
221 				FLAG(_platform_reverses_direction_when_obstructed)
222 		},
223 
224 		{_damage_crushing, 0, 30, 10, FIXED_ONE} /* damage, if necessary */
225 	},
226 };
227 
228 #endif
229 
230