46 static Sound* tire_sound = 0;
47 static Sound* catapult_sound = 0;
71 : ship(s), deck(d), squadron(squad), slot(index), cleared(0), final(0), approach(0)
85 if (ship == that.ship) {
89 if (cleared && !that.cleared) {
93 if (!cleared && that.cleared) {
97 if (ship && deck && that.ship) {
102 if (dthis == dthat) {
103 return (DWORD)
this < (DWORD) &that;
106 return dthis < dthat;
114 if (ship == that.ship)
117 if (cleared && !that.cleared)
120 if (!cleared && that.cleared)
123 if (ship && deck && that.ship) {
128 return dthis <= dthat;
133 return this == &that;
182 return "InboundSlot";
188 :
System(FLIGHT_DECK, FLIGHT_DECK_LAUNCH,
"Flight Deck", 1, 1),
189 carrier(0), index(0), num_slots(0), slots(0), cycle_time(5), num_hoops(0), hoops(0),
190 azimuth(0), light(0), num_catsounds(0), num_approach_pts(0)
200 carrier(0), index(0), start_rel(s.start_rel),
201 end_rel(s.end_rel), cam_rel(s.cam_rel),
202 cycle_time(s.cycle_time),
203 num_slots(s.num_slots), slots(0),
204 num_hoops(0), hoops(0), azimuth(s.azimuth), light(0),
205 num_catsounds(0), num_approach_pts(s.num_approach_pts)
218 for (
int i = 0; i < 2; i++)
252 static int initialized = 0;
253 if (initialized)
return;
261 loader->
LoadSound(
"Tires.wav", tire_sound, SOUND_FLAGS);
262 loader->
LoadSound(
"Catapult.wav", catapult_sound, SOUND_FLAGS);
280 delete catapult_sound;
293 bool advance_queue =
false;
298 if (volume > max_vol)
306 if (slot->
ship == 0) {
310 slot_ship = slot->
ship;
314 switch (slot->
state) {
316 if (slot->
time > 0) {
317 slot->
time -= seconds;
340 if (slot->
time > 0) {
345 slot->
time -= seconds;
355 bool clear_for_launch =
true;
358 clear_for_launch =
false;
360 if (clear_for_launch) {
368 advance_queue =
true;
374 if (slot->
time > 0) {
375 slot->
time -= seconds;
382 double dyaw = atan2(dx,dy) -
azimuth;
389 if (slot->
time > 3*ct4) {
390 double step = 1 - (slot->
time - 3*ct4) / ct4;
401 if (catapult_sound) {
412 else if (slot->
time > 2*ct4) {
413 double step = (slot->
time - 2*ct4) / ct4;
428 if (catapult_sound) {
439 else if (slot->
time > ct4) {
440 double step = (slot->
time - ct4) / ct4;
451 if (catapult_sound) {
492 if (slot->
time > 0) {
493 slot->
time -= seconds;
614 light =
new(__FILE__,__LINE__)
Light((
float) l);
692 slots[i].spot_loc = (
slots[i].spot_rel * orientation) + loc;
711 hoops[i].
MoveTo(end_point + hoop_vec * (i+1) * hoop_d);
877 if (dock_distance <
Radius()*3 && altitude < s->
Radius())
881 if (dock_distance < s->
Radius())
903 if (
Spot(s, index)) {
913 Print(
"FlightDeck::Dock(%s) Belly landing!\n", s->
Name());
919 if (docking_deflection > 0.35) {
920 Print(
"Landing upside down? y = %.3f\n", docking_deflection);
927 Print(
"FlightDeck::Dock(%s) Slammed it!\n", s->
Name());
935 double excess = (delta_v.
length() - 100);
956 slots[index].time = 7.5;
983 double current_distance = 1e9;
986 if (distance < current_distance) {
987 current_distance = distance;
992 Point offset(rand()-16000, rand()-16000, rand()-16000);
1042 Print(
"\nRecovery Queue for %s\n",
Name());
1044 Print(
" (empty)\n\n");
1052 Print(
" %2d. null\n", i);
1055 Print(
" %2d. ship is null\n", i);
1117 if (recovery_slot->
GetShip() == s || recovery_slot->
GetShip() == 0) {
1125 if (slot->
ship == s) {
1156 double distance = 1e9;
1161 bool between = (d0 * d1) < 0;
1167 Point w = (sloc - src).cross(dir);
1172 return distance <
Radius();