AADATA.CPP 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. /*
  2. ** Command & Conquer Red Alert(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /* $Header: /CounterStrike/AADATA.CPP 1 3/03/97 10:24a Joe_bostic $ */
  19. /***********************************************************************************************
  20. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  21. ***********************************************************************************************
  22. * *
  23. * Project Name : Command & Conquer *
  24. * *
  25. * File Name : AADATA.CPP *
  26. * *
  27. * Programmer : Joe L. Bostic *
  28. * *
  29. * Start Date : July 22, 1994 *
  30. * *
  31. * Last Update : July 9, 1996 [JLB] *
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * AircraftTypeClass::AircraftTypeClass -- Constructor for aircraft objects. *
  36. * AircraftTypeClass::As_Reference -- Given an aircraft type, find the matching type object. *
  37. * AircraftTypeClass::Create_And_Place -- Creates and places aircraft using normal game syste*
  38. * AircraftTypeClass::Create_One_Of -- Creates an aircraft object of the appropriate type. *
  39. * AircraftTypeClass::Dimensions -- Fetches the graphic dimensions of the aircraft type. *
  40. * AircraftTypeClass::Display -- Displays a generic version of the aircraft type. *
  41. * AircraftTypeClass::From_Name -- Converts an ASCII name into an aircraft type number. *
  42. * AircraftTypeClass::Init_Heap -- Initialize the aircraft type class heap. *
  43. * AircraftTypeClass::Max_Pips -- Fetches the maximum number of pips allowed. *
  44. * AircraftTypeClass::Occupy_List -- Returns with occupation list for landed aircraft. *
  45. * AircraftTypeClass::One_Time -- Performs one time initialization of the aircraft type class*
  46. * AircraftTypeClass::Overlap_List -- Determines the overlap list for a landed aircraft. *
  47. * AircraftTypeClass::Prep_For_Add -- Prepares the scenario editor for adding an aircraft obj*
  48. * AircraftTypeClass::operator delete -- Returns aircraft type to special memory pool. *
  49. * AircraftTypeClass::operator new -- Allocates an aircraft type object from special pool. *
  50. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  51. #include "function.h"
  52. void const * AircraftTypeClass::LRotorData = NULL;
  53. void const * AircraftTypeClass::RRotorData = NULL;
  54. // Badger bomber
  55. static AircraftTypeClass const BadgerPlane(
  56. AIRCRAFT_BADGER, // What kind of aircraft is this.
  57. TXT_BADGER, // Translated text number for aircraft.
  58. "BADR", // INI name of aircraft.
  59. 0x0000, // Vertical offset.
  60. 0x0000, // Primary weapon offset along turret centerline.
  61. 0x0000, // Primary weapon lateral offset along turret centerline.
  62. true, // Fixed wing aircraft?
  63. false, // Equipped with a rotor?
  64. false, // Custom rotor sets for each facing?
  65. false, // Can this aircraft land on clear terrain?
  66. true, // Is it invisible on radar?
  67. false, // Can the player select it so as to give it orders?
  68. true, // Can it be assigned as a target for attack.
  69. false, // Is it insignificant (won't be announced)?
  70. false, // Is it immune to normal combat damage?
  71. STRUCT_NONE, // Preferred landing building.
  72. 0xFF, // Landing speed
  73. 16, // Number of rotation stages.
  74. MISSION_HUNT // Default mission for aircraft.
  75. );
  76. // Photo recon plane.
  77. static AircraftTypeClass const U2Plane(
  78. AIRCRAFT_U2, // What kind of aircraft is this.
  79. TXT_U2, // Translated text number for aircraft.
  80. "U2", // INI name of aircraft.
  81. 0x0000, // Vertical offset.
  82. 0x0000, // Primary weapon offset along turret centerline.
  83. 0x0000, // Primary weapon lateral offset along turret centerline.
  84. true, // Fixed wing aircraft?
  85. false, // Equipped with a rotor?
  86. false, // Custom rotor sets for each facing?
  87. false, // Can this aircraft land on clear terrain?
  88. true, // Is it invisible on radar?
  89. false, // Can the player select it so as to give it orders?
  90. true, // Can it be assigned as a target for attack.
  91. false, // Is it insignificant (won't be announced)?
  92. false, // Is it immune to normal combat damage?
  93. STRUCT_NONE, // Preferred landing building.
  94. 0xFF, // Landing speed
  95. 16, // Number of rotation stages.
  96. MISSION_HUNT // Default mission for aircraft.
  97. );
  98. // Mig attack aircraft.
  99. static AircraftTypeClass const MigPlane(
  100. AIRCRAFT_MIG, // What kind of aircraft is this.
  101. TXT_MIG, // Translated text number for aircraft.
  102. "MIG", // INI name of aircraft.
  103. 0x0000, // Vertical offset.
  104. 0x0020, // Primary weapon offset along turret centerline.
  105. 0x0020, // Primary weapon lateral offset along turret centerline.
  106. true, // Fixed wing aircraft?
  107. false, // Equipped with a rotor?
  108. false, // Custom rotor sets for each facing?
  109. false, // Can this aircraft land on clear terrain?
  110. true, // Is it invisible on radar?
  111. true, // Can the player select it so as to give it orders?
  112. true, // Can it be assigned as a target for attack.
  113. false, // Is it insignificant (won't be announced)?
  114. false, // Is it immune to normal combat damage?
  115. STRUCT_AIRSTRIP, // Preferred landing building.
  116. 0xC0, // Landing speed
  117. 16, // Number of rotation stages.
  118. MISSION_HUNT // Default mission for aircraft.
  119. );
  120. // Yak attack aircraft.
  121. static AircraftTypeClass const YakPlane(
  122. AIRCRAFT_YAK, // What kind of aircraft is this.
  123. TXT_YAK, // Translated text number for aircraft.
  124. "YAK", // INI name of aircraft.
  125. 0x0000, // Vertical offset.
  126. 0x0020, // Primary weapon offset along turret centerline.
  127. 0x0020, // Primary weapon lateral offset along turret centerline.
  128. true, // Fixed wing aircraft?
  129. false, // Equipped with a rotor?
  130. false, // Custom rotor sets for each facing?
  131. false, // Can this aircraft land on clear terrain?
  132. true, // Is it invisible on radar?
  133. true, // Can the player select it so as to give it orders?
  134. true, // Can it be assigned as a target for attack.
  135. false, // Is it insignificant (won't be announced)?
  136. false, // Is it immune to normal combat damage?
  137. STRUCT_AIRSTRIP, // Preferred landing building.
  138. 0xFF, // Landing speed
  139. 16, // Number of rotation stages.
  140. MISSION_HUNT // Default mission for aircraft.
  141. );
  142. // Transport helicopter.
  143. static AircraftTypeClass const TransportHeli(
  144. AIRCRAFT_TRANSPORT, // What kind of aircraft is this.
  145. TXT_TRANS, // Translated text number for aircraft.
  146. "TRAN", // INI name of aircraft.
  147. 0x0000, // Vertical offset.
  148. 0x0000, // Primary weapon offset along turret centerline.
  149. 0x0000, // Primary weapon lateral offset along turret centerline.
  150. false, // Fixed wing aircraft?
  151. true, // Equipped with a rotor?
  152. true, // Custom rotor sets for each facing?
  153. true, // Can this aircraft land on clear terrain?
  154. true, // Is it invisible on radar?
  155. true, // Can the player select it so as to give it orders?
  156. true, // Can it be assigned as a target for attack.
  157. false, // Is it insignificant (won't be announced)?
  158. false, // Is it immune to normal combat damage?
  159. STRUCT_NONE, // Preferred landing building.
  160. 0xFF, // Landing speed
  161. 32, // Number of rotation stages.
  162. MISSION_HUNT // Default mission for aircraft.
  163. );
  164. // Longbow attack helicopter
  165. static AircraftTypeClass const AttackHeli(
  166. AIRCRAFT_LONGBOW, // What kind of aircraft is this.
  167. TXT_HELI, // Translated text number for aircraft.
  168. "HELI", // INI name of aircraft.
  169. 0x0000, // Vertical offset.
  170. 0x0040, // Primary weapon offset along turret centerline.
  171. 0x0000, // Primary weapon lateral offset along turret centerline.
  172. false, // Fixed wing aircraft?
  173. true, // Equipped with a rotor?
  174. false, // Custom rotor sets for each facing?
  175. false, // Can this aircraft land on clear terrain?
  176. true, // Is it invisible on radar?
  177. true, // Can the player select it so as to give it orders?
  178. true, // Can it be assigned as a target for attack.
  179. false, // Is it insignificant (won't be announced)?
  180. false, // Is it immune to normal combat damage?
  181. STRUCT_HELIPAD, // Preferred landing building.
  182. 0xFF, // Landing speed
  183. 32, // Number of rotation stages.
  184. MISSION_HUNT // Default mission for aircraft.
  185. );
  186. // Hind
  187. static AircraftTypeClass const OrcaHeli(
  188. AIRCRAFT_HIND, // What kind of aircraft is this.
  189. TXT_ORCA, // Translated text number for aircraft.
  190. "HIND", // INI name of aircraft.
  191. 0x0000, // Vertical offset.
  192. 0x0040, // Primary weapon offset along turret centerline.
  193. 0x0000, // Primary weapon lateral offset along turret centerline.
  194. false, // Fixed wing aircraft?
  195. true, // Equipped with a rotor?
  196. false, // Custom rotor sets for each facing?
  197. false, // Can this aircraft land on clear terrain?
  198. true, // Is it invisible on radar?
  199. true, // Can the player select it so as to give it orders?
  200. true, // Can it be assigned as a target for attack.
  201. false, // Is it insignificant (won't be announced)?
  202. false, // Is it immune to normal combat damage?
  203. STRUCT_HELIPAD, // Preferred landing building.
  204. 0xFF, // Landing speed
  205. 32, // Number of rotation stages.
  206. MISSION_HUNT // Default mission for aircraft.
  207. );
  208. /***********************************************************************************************
  209. * AircraftTypeClass::AircraftTypeClass -- Constructor for aircraft objects. *
  210. * *
  211. * This is the constructor for the aircraft object. *
  212. * *
  213. * INPUT: see below... *
  214. * *
  215. * OUTPUT: none *
  216. * *
  217. * WARNINGS: none *
  218. * *
  219. * HISTORY: *
  220. * 07/26/1994 JLB : Created. *
  221. *=============================================================================================*/
  222. AircraftTypeClass::AircraftTypeClass(
  223. AircraftType airtype,
  224. int name,
  225. char const * ininame,
  226. int verticaloffset,
  227. int primaryoffset,
  228. int primarylateral,
  229. bool is_fixedwing,
  230. bool is_rotorequipped,
  231. bool is_rotorcustom,
  232. bool is_landable,
  233. bool is_stealthy,
  234. bool is_selectable,
  235. bool is_legal_target,
  236. bool is_insignificant,
  237. bool is_immune,
  238. StructType building,
  239. int landingspeed,
  240. int rotation,
  241. MissionType deforder
  242. ) :
  243. TechnoTypeClass(RTTI_AIRCRAFTTYPE,
  244. int(airtype),
  245. name,
  246. ininame,
  247. REMAP_NORMAL,
  248. verticaloffset,
  249. primaryoffset,
  250. primarylateral,
  251. primaryoffset,
  252. primarylateral,
  253. false,
  254. is_stealthy,
  255. is_selectable,
  256. is_legal_target,
  257. is_insignificant,
  258. is_immune,
  259. false,
  260. false,
  261. true,
  262. true,
  263. rotation,
  264. SPEED_WINGED),
  265. IsFixedWing(is_fixedwing),
  266. IsLandable(is_landable),
  267. IsRotorEquipped(is_rotorequipped),
  268. IsRotorCustom(is_rotorcustom),
  269. Type(airtype),
  270. Mission(deforder),
  271. Building(building),
  272. LandingSpeed(landingspeed)
  273. {
  274. /*
  275. ** Forced aircraft overrides from the default.
  276. */
  277. Speed = SPEED_WINGED;
  278. }
  279. /***********************************************************************************************
  280. * AircraftTypeClass::operator new -- Allocates an aircraft type object from special pool. *
  281. * *
  282. * This will allocate an aircraft type class object from the memory pool of that purpose. *
  283. * *
  284. * INPUT: none *
  285. * *
  286. * OUTPUT: Returns with a pointer to the newly allocated aircraft type class object. If there *
  287. * was insufficient memory to fulfill the request, then NULL is returned. *
  288. * *
  289. * WARNINGS: none *
  290. * *
  291. * HISTORY: *
  292. * 07/09/1996 JLB : Created. *
  293. *=============================================================================================*/
  294. void * AircraftTypeClass::operator new(size_t)
  295. {
  296. return(AircraftTypes.Alloc());
  297. }
  298. /***********************************************************************************************
  299. * AircraftTypeClass::operator delete -- Returns aircraft type to special memory pool. *
  300. * *
  301. * This will return the aircraft type class object back to the special memory pool that *
  302. * it was allocated from. *
  303. * *
  304. * INPUT: pointer -- Pointer to the aircraft type class object to delete. *
  305. * *
  306. * OUTPUT: none *
  307. * *
  308. * WARNINGS: none *
  309. * *
  310. * HISTORY: *
  311. * 07/09/1996 JLB : Created. *
  312. *=============================================================================================*/
  313. void AircraftTypeClass::operator delete(void * pointer)
  314. {
  315. AircraftTypes.Free((AircraftTypeClass *)pointer);
  316. }
  317. /***********************************************************************************************
  318. * AircraftTypeClass::Init_Heap -- Initialize the aircraft type class heap. *
  319. * *
  320. * This will initialize the aircraft type class heap by pre-allocating all known aircraft *
  321. * types. It should be called once and before the rules.ini file is processed. *
  322. * *
  323. * INPUT: none *
  324. * *
  325. * OUTPUT: none *
  326. * *
  327. * WARNINGS: none *
  328. * *
  329. * HISTORY: *
  330. * 07/09/1996 JLB : Created. *
  331. *=============================================================================================*/
  332. void AircraftTypeClass::Init_Heap(void)
  333. {
  334. /*
  335. ** These aircraft type class objects must be allocated in the exact order that they
  336. ** are specified in the AircraftSmen enumeration. This is necessary because the heap
  337. ** allocation block index serves double duty as the type number index.
  338. */
  339. new AircraftTypeClass(TransportHeli);
  340. new AircraftTypeClass(BadgerPlane);
  341. new AircraftTypeClass(U2Plane);
  342. new AircraftTypeClass(MigPlane);
  343. new AircraftTypeClass(YakPlane);
  344. new AircraftTypeClass(AttackHeli);
  345. new AircraftTypeClass(OrcaHeli);
  346. }
  347. /***********************************************************************************************
  348. * AircraftTypeClass::From_Name -- Converts an ASCII name into an aircraft type number. *
  349. * *
  350. * This routine is used to convert an ASCII representation of an aircraft into the *
  351. * matching aircraft type number. This is used by the scenario INI reader code. *
  352. * *
  353. * INPUT: name -- Pointer to ASCII name to translate. *
  354. * *
  355. * OUTPUT: Returns the aircraft type number that matches the ASCII name provided. If no *
  356. * match could be found, then AIRCRAFT_NONE is returned. *
  357. * *
  358. * WARNINGS: none *
  359. * *
  360. * HISTORY: *
  361. * 07/26/1994 JLB : Created. *
  362. *=============================================================================================*/
  363. AircraftType AircraftTypeClass::From_Name(char const * name)
  364. {
  365. if (name != NULL) {
  366. for (AircraftType classid = AIRCRAFT_FIRST; classid < AIRCRAFT_COUNT; classid++) {
  367. if (stricmp(As_Reference(classid).IniName, name) == 0) {
  368. return(classid);
  369. }
  370. }
  371. }
  372. return(AIRCRAFT_NONE);
  373. }
  374. /***********************************************************************************************
  375. * AircraftTypeClass::One_Time -- Performs one time initialization of the aircraft type class. *
  376. * *
  377. * This routine is used to perform the onetime initialization of the aircraft type. This *
  378. * includes primarily the shape and other graphic data loading. *
  379. * *
  380. * INPUT: none *
  381. * *
  382. * OUTPUT: none *
  383. * *
  384. * WARNINGS: This goes to disk and also must only be called ONCE. *
  385. * *
  386. * HISTORY: *
  387. * 07/26/1994 JLB : Created. *
  388. *=============================================================================================*/
  389. void AircraftTypeClass::One_Time(void)
  390. {
  391. for (AircraftType index = AIRCRAFT_FIRST; index < AIRCRAFT_COUNT; index++) {
  392. char fullname[_MAX_FNAME+_MAX_EXT];
  393. AircraftTypeClass const & uclass = As_Reference(index);
  394. /*
  395. ** Fetch the supporting data files for the unit.
  396. */
  397. char buffer[_MAX_FNAME];
  398. sprintf(buffer, "%sICON", uclass.Graphic_Name());
  399. _makepath(fullname, NULL, NULL, buffer, ".SHP");
  400. ((void const *&)uclass.CameoData) = MFCD::Retrieve(fullname);
  401. /*
  402. ** Generic shape for all houses load method.
  403. */
  404. _makepath(fullname, NULL, NULL, uclass.Graphic_Name(), ".SHP");
  405. ((void const *&)uclass.ImageData) = MFCD::Retrieve(fullname);
  406. }
  407. LRotorData = MFCD::Retrieve("LROTOR.SHP");
  408. RRotorData = MFCD::Retrieve("RROTOR.SHP");
  409. }
  410. /***********************************************************************************************
  411. * AircraftTypeClass::Create_One_Of -- Creates an aircraft object of the appropriate type. *
  412. * *
  413. * This routine is used to create an aircraft object that matches the aircraft type. It *
  414. * serves as a shortcut to creating an object using the "new" operator and "if" checks. *
  415. * *
  416. * INPUT: house -- The house owner of the aircraft that is to be created. *
  417. * *
  418. * OUTPUT: Returns with a pointer to the aircraft created. If the aircraft could not be *
  419. * created, then a NULL is returned. *
  420. * *
  421. * WARNINGS: none *
  422. * *
  423. * HISTORY: *
  424. * 07/26/1994 JLB : Created. *
  425. *=============================================================================================*/
  426. ObjectClass * AircraftTypeClass::Create_One_Of(HouseClass * house) const
  427. {
  428. return(new AircraftClass(Type, house->Class->House));
  429. }
  430. #ifdef SCENARIO_EDITOR
  431. /***********************************************************************************************
  432. * AircraftTypeClass::Prep_For_Add -- Prepares the scenario editor for adding an aircraft objec*
  433. * *
  434. * This routine is used by the scenario editor to prepare for the adding operation. It *
  435. * builds a list of pointers to object types that can be added. *
  436. * *
  437. * INPUT: none *
  438. * *
  439. * OUTPUT: none *
  440. * *
  441. * WARNINGS: none *
  442. * *
  443. * HISTORY: *
  444. * 07/26/1994 JLB : Created. *
  445. *=============================================================================================*/
  446. void AircraftTypeClass::Prep_For_Add(void)
  447. {
  448. for (AircraftType index = AIRCRAFT_FIRST; index < AIRCRAFT_COUNT; index++) {
  449. if (As_Reference(index).Get_Image_Data()) {
  450. Map.Add_To_List(&As_Reference(index));
  451. }
  452. }
  453. }
  454. /***********************************************************************************************
  455. * AircraftTypeClass::Display -- Displays a generic version of the aircraft type. *
  456. * *
  457. * This routine is used by the scenario editor to display a generic version of the object *
  458. * type. This is displayed in the object selection dialog box. *
  459. * *
  460. * INPUT: x,y -- The coordinates to draw the aircraft at (centered). *
  461. * *
  462. * window -- The window to base the coordinates upon. *
  463. * *
  464. * house -- The owner of this generic aircraft. *
  465. * *
  466. * OUTPUT: none *
  467. * *
  468. * WARNINGS: none *
  469. * *
  470. * HISTORY: *
  471. * 07/26/1994 JLB : Created. *
  472. *=============================================================================================*/
  473. void AircraftTypeClass::Display(int x, int y, WindowNumberType window, HousesType ) const
  474. {
  475. int shape = 0;
  476. void const * ptr = Get_Cameo_Data();
  477. if (ptr == NULL) {
  478. ptr = Get_Image_Data();
  479. shape = 5;
  480. }
  481. CC_Draw_Shape(ptr, shape, x, y, window, SHAPE_CENTER|SHAPE_WIN_REL);
  482. }
  483. #endif
  484. /***********************************************************************************************
  485. * AircraftTypeClass::Occupy_List -- Returns with occupation list for landed aircraft. *
  486. * *
  487. * This determines the occupation list for the aircraft (if it was landed). *
  488. * *
  489. * INPUT: placement -- Is this for placement legality checking only? The normal condition *
  490. * is for marking occupation flags. *
  491. * *
  492. * OUTPUT: Returns with a pointer to a cell offset occupation list for the aircraft. *
  493. * *
  494. * WARNINGS: This occupation list is only valid if the aircraft is landed. *
  495. * *
  496. * HISTORY: *
  497. * 07/26/1994 JLB : Created. *
  498. *=============================================================================================*/
  499. short const * AircraftTypeClass::Occupy_List(bool) const
  500. {
  501. static short const _list[] = {0, REFRESH_EOL};
  502. return(_list);
  503. }
  504. /***********************************************************************************************
  505. * AircraftTypeClass::Overlap_List -- Determines the overlap list for a landed aircraft. *
  506. * *
  507. * This routine figures out the overlap list for the aircraft as if it were landed. *
  508. * *
  509. * INPUT: none *
  510. * *
  511. * OUTPUT: Returns with the cell offset overlap list for the aircraft. *
  512. * *
  513. * WARNINGS: This overlap list is only valid when the aircraft is landed. *
  514. * *
  515. * HISTORY: *
  516. * 07/26/1994 JLB : Created. *
  517. *=============================================================================================*/
  518. short const * AircraftTypeClass::Overlap_List(void) const
  519. {
  520. static short const _list[] = {-(MAP_CELL_W-1), -MAP_CELL_W, -(MAP_CELL_W+1), -1, 1, (MAP_CELL_W-1), MAP_CELL_W, (MAP_CELL_W+1), REFRESH_EOL};
  521. return(_list);
  522. }
  523. /***********************************************************************************************
  524. * AircraftTypeClass::Max_Pips -- Fetches the maximum number of pips allowed. *
  525. * *
  526. * Use this routine to retrieve the maximum pip count allowed for this aircraft. This is *
  527. * the maximum number of passengers. *
  528. * *
  529. * INPUT: none *
  530. * *
  531. * OUTPUT: Returns with the maximum number of pips for this aircraft. *
  532. * *
  533. * WARNINGS: none *
  534. * *
  535. * HISTORY: *
  536. * 06/26/1995 JLB : Created. *
  537. *=============================================================================================*/
  538. int AircraftTypeClass::Max_Pips(void) const
  539. {
  540. if (PrimaryWeapon != NULL) {
  541. return(5);
  542. }
  543. return(Max_Passengers());
  544. }
  545. /***********************************************************************************************
  546. * AircraftTypeClass::Create_And_Place -- Creates and places aircraft using normal game system *
  547. * *
  548. * This routine is used to create and place an aircraft through the normal game system. *
  549. * Since creation of aircraft in this fashion is prohibited, this routine does nothing. *
  550. * *
  551. * INPUT: na *
  552. * *
  553. * OUTPUT: Always returns a failure code (false). *
  554. * *
  555. * WARNINGS: none *
  556. * *
  557. * HISTORY: *
  558. * 08/07/1995 JLB : Created. *
  559. *=============================================================================================*/
  560. bool AircraftTypeClass::Create_And_Place(CELL, HousesType) const
  561. {
  562. return(false);
  563. }
  564. /***********************************************************************************************
  565. * AircraftTypeClass::Dimensions -- Fetches the graphic dimensions of the aircraft type. *
  566. * *
  567. * This routine will fetch the pixel dimensions of this aircraft type. These dimensions *
  568. * are used to control map refresh and select box rendering. *
  569. * *
  570. * INPUT: width -- Reference to variable that will be filled in with aircraft width. *
  571. * *
  572. * height -- Reference to variable that will be filled in with aircraft height. *
  573. * *
  574. * OUTPUT: none *
  575. * *
  576. * WARNINGS: none *
  577. * *
  578. * HISTORY: *
  579. * 08/07/1995 JLB : Created. *
  580. *=============================================================================================*/
  581. void AircraftTypeClass::Dimensions(int &width, int &height) const
  582. {
  583. if (Type == AIRCRAFT_BADGER) {
  584. width = 56;
  585. height = 56;
  586. } else {
  587. width = 21;
  588. height = 20;
  589. }
  590. }
  591. /***********************************************************************************************
  592. * AircraftTypeClass::As_Reference -- Given an aircraft type, find the matching type object. *
  593. * *
  594. * This routine is used to fetch a reference to the aircraft type class object that matches *
  595. * the aircraft type specified. *
  596. * *
  597. * INPUT: aircraft -- The aircraft type to fetch a reference to the type class object of. *
  598. * *
  599. * OUTPUT: Returns with a reference to the type class object of this aircraft type. *
  600. * *
  601. * WARNINGS: Be sure that the aircraft type specified is legal. Illegal values will result *
  602. * in undefined behavior. *
  603. * *
  604. * HISTORY: *
  605. * 07/09/1996 JLB : Created. *
  606. *=============================================================================================*/
  607. AircraftTypeClass & AircraftTypeClass::As_Reference(AircraftType aircraft)
  608. {
  609. return(*AircraftTypes.Ptr(aircraft));
  610. }