IDATA.CPP 61 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374
  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/IDATA.CPP 3 3/16/97 10:16p Joe_b $ */
  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 : IDATA.CPP *
  26. * *
  27. * Programmer : Joe L. Bostic *
  28. * *
  29. * Start Date : August 15, 1994 *
  30. * *
  31. * Last Update : July 19, 1996 [JLB] *
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * InfantryTypeClass::As_Reference -- Fetches a reference to the infantry type specified. *
  36. * InfantryTypeClass::Create_And_Place -- Creates and places infantry object onto the map. *
  37. * InfantryTypeClass::Create_One_Of -- Creates an infantry object. *
  38. * InfantryTypeClass::Display -- Displays a generic infantry object. *
  39. * InfantryTypeClass::From_Name -- Converts an ASCII name into an infantry type number. *
  40. * InfantryTypeClass::Full_Name -- Fetches the full name text number. *
  41. * InfantryTypeClass::Get_Cameo_Data -- Fetches the small cameo shape for sidebar strip. *
  42. * InfantryTypeClass::InfantryTypeClass -- Constructor for infantry type class objects. *
  43. * InfantryTypeClass::Init_Heap -- Initialize the infantry type class heap. *
  44. * InfantryTypeClass::Occupy_List -- Returns with default infantry occupation list. *
  45. * InfantryTypeClass::One_Time -- Performs any one time processing for infantry system. *
  46. * InfantryTypeClass::Prep_For_Add -- Prepares the scenario editor for adding of infantry obj*
  47. * InfantryTypeClass::Read_INI -- Fetches infantry override values from the INI database. *
  48. * InfantryTypeClass::operator delete -- Frees an infantry type class object. *
  49. * InfantryTypeClass::operator new -- Allocate an infanty type class object. *
  50. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  51. #include "function.h"
  52. #include "type.h"
  53. static DoInfoStruct DogDoControls[DO_COUNT] = {
  54. {0, 1, 1}, // DO_STAND_READY
  55. {0, 1, 1}, // DO_STAND_GUARD
  56. {0, 1, 1}, // DO_PRONE // NA
  57. {8, 6, 6}, // DO_WALK
  58. {104, 14,14}, // DO_FIRE_WEAPON
  59. {0, 0, 0}, // DO_LIE_DOWN // NA
  60. {56, 6, 6}, // DO_CRAWL
  61. {0, 0, 0}, // DO_GET_UP
  62. {104, 14,14}, // DO_FIRE_PRONE
  63. {216, 18,0}, // DO_IDLE1
  64. {216, 18,0}, // DO_IDLE2
  65. {235, 7, 0}, // DO_GUN_DEATH
  66. {242, 9, 0}, // DO_EXPLOSION_DEATH
  67. {242, 9, 0}, // DO_EXPLOSION2_DEATH
  68. {242, 9, 0}, // DO_GRENADE_DEATH
  69. {251, 14,0}, // DO_FIRE_DEATH
  70. {0, 1, 0}, // DO_GESTURE1
  71. {0, 1, 0}, // DO_SALUTE1
  72. {0, 1, 0}, // DO_GESTURE2
  73. {0, 1, 0}, // DO_SALUTE2
  74. {106, 12,14}, // DO_DOG_MAUL
  75. };
  76. static DoInfoStruct E1DoControls[DO_COUNT] = {
  77. {0, 1, 1}, // DO_STAND_READY
  78. {8, 1, 1}, // DO_STAND_GUARD
  79. {192, 1, 8}, // DO_PRONE
  80. {16, 6, 6}, // DO_WALK
  81. {64, 8, 8}, // DO_FIRE_WEAPON
  82. {128, 2, 2}, // DO_LIE_DOWN
  83. {144, 4, 4}, // DO_CRAWL
  84. {176, 2, 2}, // DO_GET_UP
  85. {192, 6, 8}, // DO_FIRE_PRONE
  86. {256, 16,0}, // DO_IDLE1
  87. {272, 16,0}, // DO_IDLE2
  88. {382-94, 8, 0}, // DO_GUN_DEATH
  89. {398-94, 8, 0}, // DO_EXPLOSION_DEATH
  90. {398-94, 8, 0}, // DO_EXPLOSION2_DEATH
  91. {406-94, 12,0}, // DO_GRENADE_DEATH
  92. {418-94, 18,0}, // DO_FIRE_DEATH
  93. {436-94, 3, 3}, // DO_GESTURE1
  94. {460-94, 3, 3}, // DO_SALUTE1
  95. {484-94, 3, 3}, // DO_GESTURE2
  96. {508-94, 3, 3}, // DO_SALUTE2
  97. {0, 0, 0}, // DO_DOG_MAUL // N/A
  98. };
  99. static DoInfoStruct E2DoControls[DO_COUNT] = {
  100. {0, 1, 1}, // DO_STAND_READY
  101. {8, 1, 1}, // DO_STAND_GUARD
  102. {288, 1, 12}, // DO_PRONE
  103. {16, 6, 6}, // DO_WALK
  104. {64, 20,20}, // DO_FIRE_WEAPON
  105. {224, 2, 2}, // DO_LIE_DOWN
  106. {240, 4, 4}, // DO_CRAWL
  107. {272, 2, 2}, // DO_GET_UP
  108. {288, 8, 12}, // DO_FIRE_PRONE
  109. {384, 16,0}, // DO_IDLE1
  110. {400, 16,0}, // DO_IDLE2
  111. {510-94, 8, 0}, // DO_GUN_DEATH
  112. {526-94, 8, 0}, // DO_EXPLOSION_DEATH
  113. {526-94, 8, 0}, // DO_EXPLOSION2_DEATH
  114. {534-94, 12,0}, // DO_GRENADE_DEATH
  115. {546-94, 18,0}, // DO_FIRE_DEATH
  116. {564-94, 3, 3}, // DO_GESTURE1
  117. {588-94, 3, 3}, // DO_SALUTE1
  118. {612-94, 3, 3}, // DO_GESTURE2
  119. {636-94, 3, 3}, // DO_SALUTE2
  120. {0, 0, 0}, // DO_DOG_MAUL // N/A
  121. };
  122. static DoInfoStruct E3DoControls[DO_COUNT] = {
  123. {0, 1, 1}, // DO_STAND_READY
  124. {8, 1, 1}, // DO_STAND_GUARD
  125. {192, 1,10}, // DO_PRONE
  126. {16, 6, 6}, // DO_WALK
  127. {64, 8, 8}, // DO_FIRE_WEAPON
  128. {128, 2, 2}, // DO_LIE_DOWN
  129. {144, 4, 4}, // DO_CRAWL
  130. {176, 2, 2}, // DO_GET_UP
  131. {192, 10,10}, // DO_FIRE_PRONE
  132. {272, 16,0}, // DO_IDLE1
  133. {288, 16,0}, // DO_IDLE2
  134. {398-94, 8, 0}, // DO_GUN_DEATH
  135. {414-94, 8, 0}, // DO_EXPLOSION_DEATH
  136. {414-94, 8, 0}, // DO_EXPLOSION2_DEATH
  137. {422-94, 12,0}, // DO_GRENADE_DEATH
  138. {434-94, 18,0}, // DO_FIRE_DEATH
  139. {452-94, 3, 3}, // DO_GESTURE1
  140. {476-94, 3, 3}, // DO_SALUTE1
  141. {500-94, 3, 3}, // DO_GESTURE2
  142. {524-94, 3, 3}, // DO_SALUTE2
  143. {0, 0, 0}, // DO_DOG_MAUL // N/A
  144. };
  145. static DoInfoStruct E4DoControls[DO_COUNT] = {
  146. {0, 1, 1}, // DO_STAND_READY
  147. {8, 1, 1}, // DO_STAND_GUARD
  148. {256, 1,16}, // DO_PRONE
  149. {16, 6, 6}, // DO_WALK
  150. {64, 16,16}, // DO_FIRE_WEAPON
  151. {192, 2, 2}, // DO_LIE_DOWN
  152. {208, 4, 4}, // DO_CRAWL
  153. {240, 2, 2}, // DO_GET_UP
  154. {256, 16,16}, // DO_FIRE_PRONE
  155. {384, 16,0}, // DO_IDLE1
  156. {400, 16,0}, // DO_IDLE2
  157. {510-94, 8, 0}, // DO_GUN_DEATH
  158. {526-94, 8, 0}, // DO_EXPLOSION_DEATH
  159. {526-94, 8, 0}, // DO_EXPLOSION2_DEATH
  160. {534-94, 12,0}, // DO_GRENADE_DEATH
  161. {546-94, 18,0}, // DO_FIRE_DEATH
  162. {564-94, 3, 3}, // DO_GESTURE1
  163. {588-94, 3, 3}, // DO_SALUTE1
  164. {612-94, 3, 3}, // DO_GESTURE2
  165. {636-94, 3, 3}, // DO_SALUTE2
  166. {0, 0, 0}, // DO_DOG_MAUL // N/A
  167. };
  168. static DoInfoStruct E6DoControls[DO_COUNT] = {
  169. {0, 1, 1}, // DO_STAND_READY
  170. {8, 1, 1}, // DO_STAND_GUARD
  171. {82, 1, 4}, // DO_PRONE
  172. {16, 6, 6}, // DO_WALK
  173. {0, 0, 0}, // DO_FIRE_WEAPON
  174. {67, 2, 2}, // DO_LIE_DOWN
  175. {82, 4, 4}, // DO_CRAWL
  176. {114, 2, 2}, // DO_GET_UP
  177. {0, 0, 0}, // DO_FIRE_PRONE
  178. {130, 16,0}, // DO_IDLE1
  179. {130, 16,0}, // DO_IDLE2
  180. {146, 8, 0}, // DO_GUN_DEATH
  181. {154, 8, 0}, // DO_EXPLOSION_DEATH
  182. {162, 8, 0}, // DO_EXPLOSION2_DEATH
  183. {162, 12,0}, // DO_GRENADE_DEATH
  184. {182, 18,0}, // DO_FIRE_DEATH
  185. {200, 3, 3}, // DO_GESTURE1
  186. {224, 3, 3}, // DO_SALUTE1
  187. {200, 3, 3}, // DO_GESTURE2
  188. {224, 3, 3}, // DO_SALUTE2
  189. {0, 0, 0}, // DO_DOG_MAUL // N/A
  190. };
  191. static DoInfoStruct E7DoControls[DO_COUNT] = {
  192. {0, 1, 1}, // DO_STAND_READY
  193. {0, 1, 1}, // DO_STAND_GUARD
  194. {128, 1, 4}, // DO_PRONE
  195. {8, 6, 6}, // DO_WALK
  196. {56, 7, 7}, // DO_FIRE_WEAPON
  197. {113, 2, 2}, // DO_LIE_DOWN
  198. {128, 4, 4}, // DO_CRAWL
  199. {161, 2, 2}, // DO_GET_UP
  200. {176, 7, 7}, // DO_FIRE_PRONE
  201. {232, 17,0}, // DO_IDLE1
  202. {249, 13,0}, // DO_IDLE2
  203. {262, 8, 0}, // DO_GUN_DEATH
  204. {270, 8, 0}, // DO_EXPLOSION_DEATH
  205. {278, 8, 0}, // DO_EXPLOSION2_DEATH
  206. {286, 12,0}, // DO_GRENADE_DEATH
  207. {298, 18,0}, // DO_FIRE_DEATH
  208. {0, 1, 0}, // DO_GESTURE1
  209. {0, 1, 0}, // DO_SALUTE1
  210. {0, 1, 0}, // DO_GESTURE2
  211. {0, 1, 0}, // DO_SALUTE2
  212. {0, 0, 0}, // DO_DOG_MAUL // N/A
  213. };
  214. //Spy
  215. static DoInfoStruct SpyDoControls[DO_COUNT] = {
  216. {0, 1, 1}, // DO_STAND_READY
  217. {8, 1, 1}, // DO_STAND_GUARD
  218. {144, 1, 4}, // DO_PRONE
  219. {16, 6, 6}, // DO_WALK
  220. {64, 8, 8}, // DO_FIRE_WEAPON
  221. {128, 2, 2}, // DO_LIE_DOWN
  222. {144, 4, 4}, // DO_CRAWL
  223. {176, 2, 2}, // DO_GET_UP
  224. {192, 8, 8}, // DO_FIRE_PRONE
  225. {256, 14,0}, // DO_IDLE1
  226. {270, 18,0}, // DO_IDLE2
  227. {288, 8, 0}, // DO_GUN_DEATH
  228. {296, 8, 0}, // DO_EXPLOSION_DEATH
  229. {304, 8, 0}, // DO_EXPLOSION2_DEATH
  230. {312, 12,0}, // DO_GRENADE_DEATH
  231. {324, 18,0}, // DO_FIRE_DEATH
  232. {0, 1, 0}, // DO_GESTURE1
  233. {0, 1, 0}, // DO_SALUTE1
  234. {0, 1, 0}, // DO_GESTURE2
  235. {0, 1, 0}, // DO_SALUTE2
  236. {0, 0, 0}, // DO_DOG_MAUL // N/A
  237. };
  238. static DoInfoStruct E9DoControls[DO_COUNT] = {
  239. {0, 1, 1}, // DO_STAND_READY
  240. {8, 1, 1}, // DO_STAND_GUARD
  241. {72, 1, 4}, // DO_PRONE
  242. {8, 6, 6}, // DO_WALK
  243. {0, 0, 0}, // DO_FIRE_WEAPON
  244. {56, 2, 2}, // DO_LIE_DOWN
  245. {72, 4, 4}, // DO_CRAWL
  246. {108, 2, 2}, // DO_GET_UP
  247. {0, 0, 0}, // DO_FIRE_PRONE
  248. {120, 19,0}, // DO_IDLE1
  249. {120, 19,0}, // DO_IDLE2
  250. {139, 8, 0}, // DO_GUN_DEATH
  251. {147, 8, 0}, // DO_EXPLOSION_DEATH
  252. {155, 8, 0}, // DO_EXPLOSION2_DEATH
  253. {163, 12,0}, // DO_GRENADE_DEATH
  254. {175, 18,0}, // DO_FIRE_DEATH
  255. {0, 1, 0}, // DO_GESTURE1
  256. {0, 1, 0}, // DO_SALUTE1
  257. {0, 1, 0}, // DO_GESTURE2
  258. {0, 1, 0}, // DO_SALUTE2
  259. {0, 0, 0}, // DO_DOG_MAUL // N/A
  260. };
  261. static DoInfoStruct MedicDoControls[DO_COUNT] = {
  262. {0, 1, 1}, // DO_STAND_READY
  263. {0, 1, 1}, // DO_STAND_GUARD
  264. {130, 1, 4}, // DO_PRONE
  265. {8, 6, 6}, // DO_WALK
  266. {56, 28,0}, // DO_FIRE_WEAPON
  267. {114, 2, 2}, // DO_LIE_DOWN
  268. {130, 4, 4}, // DO_CRAWL
  269. {162, 2, 2}, // DO_GET_UP
  270. {56, 28,0}, // DO_FIRE_PRONE
  271. {178, 15,0}, // DO_IDLE1
  272. {178, 15,0}, // DO_IDLE2
  273. {193, 8, 0}, // DO_GUN_DEATH
  274. {210, 8, 0}, // DO_EXPLOSION_DEATH
  275. {202, 8, 0}, // DO_EXPLOSION2_DEATH
  276. {217, 12,0}, // DO_GRENADE_DEATH
  277. {229, 18,0}, // DO_FIRE_DEATH
  278. {0, 1, 0}, // DO_GESTURE1
  279. {0, 1, 0}, // DO_SALUTE1
  280. {0, 1, 0}, // DO_GESTURE2
  281. {0, 1, 0}, // DO_SALUTE2
  282. {0, 0, 0}, // DO_DOG_MAUL // N/A
  283. };
  284. static DoInfoStruct GeneralDoControls[DO_COUNT] = {
  285. {0, 1, 1}, // DO_STAND_READY
  286. {0, 1, 1}, // DO_STAND_GUARD
  287. {104, 1, 4}, // DO_PRONE
  288. {8, 6, 6}, // DO_WALK
  289. {56, 4, 4}, // DO_FIRE_WEAPON
  290. {88, 2, 2}, // DO_LIE_DOWN
  291. {104, 4, 4}, // DO_CRAWL
  292. {136, 2, 2}, // DO_GET_UP
  293. {152, 4, 4}, // DO_FIRE_PRONE
  294. {184, 26,0}, // DO_IDLE1
  295. {184, 26,0}, // DO_IDLE2
  296. {210, 8, 0}, // DO_GUN_DEATH
  297. {226, 8, 0}, // DO_EXPLOSION_DEATH
  298. {218, 8, 0}, // DO_EXPLOSION2_DEATH
  299. {234, 12,0}, // DO_GRENADE_DEATH
  300. {246, 18,0}, // DO_FIRE_DEATH
  301. {0, 1, 0}, // DO_GESTURE1
  302. {0, 1, 0}, // DO_SALUTE1
  303. {0, 1, 0}, // DO_GESTURE2
  304. {0, 1, 0}, // DO_SALUTE2
  305. {0, 0, 0}, // DO_DOG_MAUL // N/A
  306. };
  307. static DoInfoStruct CivilianDoControls[DO_COUNT] = {
  308. {0, 1, 1}, // DO_STAND_READY
  309. {0, 1, 1}, // DO_STAND_GUARD
  310. {0, 1, 1}, // DO_PRONE // N/A
  311. {56, 6, 6}, // DO_WALK
  312. {205-85, 4, 4}, // DO_FIRE_WEAPON
  313. {0, 1, 1}, // DO_LIE_DOWN // N/A
  314. {8, 6, 6}, // DO_CRAWL
  315. {0, 1, 1}, // DO_GET_UP // N/A
  316. {205-85, 4, 4}, // DO_FIRE_PRONE
  317. {189-85, 10,0}, // DO_IDLE1
  318. {199-85, 6, 0}, // DO_IDLE2
  319. {152, 8, 0}, // DO_GUN_DEATH
  320. {160, 8, 0}, // DO_EXPLOSION_DEATH
  321. {160, 8, 0}, // DO_EXPLOSION2_DEATH
  322. {168, 12,0}, // DO_GRENADE_DEATH
  323. {180, 18,0}, // DO_FIRE_DEATH
  324. {0, 1, 0}, // DO_GESTURE1 // N/A
  325. {0, 1, 0}, // DO_SALUTE1 // N/A
  326. {0, 1, 0}, // DO_GESTURE2 // N/A
  327. {0, 1, 0}, // DO_SALUTE2 // N/A
  328. {0, 0, 0}, // DO_DOG_MAUL // N/A
  329. };
  330. static DoInfoStruct EinsteinDoControls[DO_COUNT] = {
  331. {0, 1, 1}, // DO_STAND_READY
  332. {0, 1, 1}, // DO_STAND_GUARD
  333. {0, 1, 1}, // DO_PRONE // N/A
  334. {56, 6, 6}, // DO_WALK
  335. {205-92, 4, 4}, // DO_FIRE_WEAPON
  336. {0, 1, 1}, // DO_LIE_DOWN // N/A
  337. {8, 6, 6}, // DO_CRAWL
  338. {0, 1, 1}, // DO_GET_UP // N/A
  339. {0, 0, 0}, // DO_FIRE_PRONE
  340. {104, 16,0}, // DO_IDLE1
  341. {104, 16,0}, // DO_IDLE2
  342. {212-92, 8, 0}, // DO_GUN_DEATH
  343. {220-92, 8, 0}, // DO_EXPLOSION_DEATH
  344. {228-92, 12,0}, // DO_EXPLOSION2_DEATH
  345. {228-92, 12,0}, // DO_GRENADE_DEATH
  346. {240-92, 17,0}, // DO_FIRE_DEATH
  347. {0, 1, 0}, // DO_GESTURE1 // N/A
  348. {0, 1, 0}, // DO_SALUTE1 // N/A
  349. {0, 1, 0}, // DO_GESTURE2 // N/A
  350. {0, 1, 0}, // DO_SALUTE2 // N/A
  351. {0, 0, 0}, // DO_DOG_MAUL // N/A
  352. };
  353. // Attack dogs
  354. static InfantryTypeClass const Dog(
  355. INFANTRY_DOG, // Infantry type number.
  356. TXT_GUARD_DOG, // Translate name number for infantry type.
  357. "DOG", // INI name for infantry.
  358. 0x0015, // Vertical offset.
  359. 0x0010, // Primary weapon offset along turret centerline.
  360. false, // Is this a female type?
  361. false, // Has crawling animation frames?
  362. false, // Is this a civilian?
  363. false, // Does this unit use the override remap table?
  364. false, // Always use the given name for the infantry?
  365. false, // Theater specific graphic image?
  366. PIP_FULL, // Transport pip shape/color to use.
  367. DogDoControls,
  368. 1, // Frame of projectile launch.
  369. 1, // Frame of projectile launch while prone.
  370. 0 // pointer to override remap table
  371. );
  372. // Minigunners
  373. static InfantryTypeClass const E1(
  374. INFANTRY_E1, // Infantry type number.
  375. TXT_E1, // Translate name number for infantry type.
  376. "E1", // INI name for infantry.
  377. 0x0035, // Vertical offset.
  378. 0x0010, // Primary weapon offset along turret centerline.
  379. false, // Is this a female type?
  380. true, // Has crawling animation frames?
  381. false, // Is this a civilian?
  382. false, // Does this unit use the override remap table?
  383. false, // Always use the given name for the infantry?
  384. false, // Theater specific graphic image?
  385. PIP_FULL, // Transport pip shape/color to use.
  386. E1DoControls,
  387. 2, // Frame of projectile launch.
  388. 2, // Frame of projectile launch while prone.
  389. 0 // pointer to override remap table
  390. );
  391. // Grenadiers
  392. static InfantryTypeClass const E2(
  393. INFANTRY_E2, // Infantry type number.
  394. TXT_E2, // Translate name number for infantry type.
  395. "E2", // INI name for infantry.
  396. 0x0035, // Vertical offset.
  397. 0x0010, // Primary weapon offset along turret centerline.
  398. false, // Is this a female type?
  399. true, // Has crawling animation frames?
  400. false, // Is this a civilian?
  401. false, // Does this unit use the override remap table?
  402. false, // Always use the given name for the infantry?
  403. false, // Theater specific graphic image?
  404. PIP_FULL, // Transport pip shape/color to use.
  405. E2DoControls,
  406. 14, // Frame of projectile launch.
  407. 6, // Frame of projectile launch while prone.
  408. 0 // pointer to override remap table
  409. );
  410. // Bazooka
  411. static InfantryTypeClass const E3(
  412. INFANTRY_E3, // Infantry type number.
  413. TXT_E3, // Translate name number for infantry type.
  414. "E3", // INI name for infantry.
  415. 0x0035, // Vertical offset.
  416. 0x0010, // Primary weapon offset along turret centerline.
  417. false, // Is this a female type?
  418. true, // Has crawling animation frames?
  419. false, // Is this a civilian?
  420. false, // Does this unit use the override remap table?
  421. false, // Always use the given name for the infantry?
  422. false, // Theater specific graphic image?
  423. PIP_FULL, // Transport pip shape/color to use.
  424. E3DoControls,
  425. 3, // Frame of projectile launch.
  426. 3, // Frame of projectile launch while prone.
  427. 0 // pointer to override remap table
  428. );
  429. // Flamethrower
  430. static InfantryTypeClass const E4(
  431. INFANTRY_E4, // Infantry type number.
  432. TXT_E4, // Translate name number for infantry type.
  433. "E4", // INI name for infantry.
  434. 0x0035, // Vertical offset.
  435. 0x0010, // Primary weapon offset along turret centerline.
  436. false, // Is this a female type?
  437. true, // Has crawling animation frames?
  438. false, // Is this a civilian?
  439. false, // Does this unit use the override remap table?
  440. false, // Always use the given name for the infantry?
  441. false, // Theater specific graphic image?
  442. PIP_FULL, // Transport pip shape/color to use.
  443. E4DoControls,
  444. 2, // Frame of projectile launch.
  445. 0, // Frame of projectile launch while prone.
  446. 0 // pointer to override remap table
  447. );
  448. // Renovator
  449. static InfantryTypeClass const E6(
  450. INFANTRY_RENOVATOR, // Infantry type number.
  451. TXT_E6, // Translate name number for infantry type.
  452. "E6", // INI name for infantry.
  453. 0x0035, // Vertical offset.
  454. 0x0010, // Primary weapon offset along turret centerline.
  455. false, // Is this a female type?
  456. false, // Has crawling animation frames?
  457. false, // Is this a civilian?
  458. false, // Does this unit use the override remap table?
  459. false, // Always use the given name for the infantry?
  460. false, // Theater specific graphic image?
  461. PIP_ENGINEER, // Transport pip shape/color to use.
  462. E6DoControls,
  463. 3, // Frame of projectile launch.
  464. 3, // Frame of projectile launch while prone.
  465. 0 // pointer to override remap table
  466. );
  467. // Spy
  468. static InfantryTypeClass const E8(
  469. INFANTRY_SPY, // Infantry type number.
  470. TXT_E8, // Translate name number for infantry type.
  471. "SPY", // INI name for infantry.
  472. 0x0035, // Vertical offset.
  473. 0x0010, // Primary weapon offset along turret centerline.
  474. false, // Is this a female type?
  475. false, // Has crawling animation frames?
  476. false, // Is this a civilian?
  477. false, // Does this unit use the override remap table?
  478. false, // Always use the given name for the infantry?
  479. false, // Theater specific graphic image?
  480. PIP_ENGINEER, // Transport pip shape/color to use.
  481. SpyDoControls,
  482. 3, // Frame of projectile launch.
  483. 3, // Frame of projectile launch while prone.
  484. 0 // pointer to override remap table
  485. );
  486. // Thief
  487. static InfantryTypeClass const E9(
  488. INFANTRY_THIEF, // Infantry type number.
  489. TXT_THIEF, // Translate name number for infantry type.
  490. "THF", // INI name for infantry.
  491. 0x0035, // Vertical offset.
  492. 0x0010, // Primary weapon offset along turret centerline.
  493. false, // Is this a female type?
  494. false, // Has crawling animation frames?
  495. false, // Is this a civilian?
  496. false, // Does this unit use the override remap table?
  497. false, // Always use the given name for the infantry?
  498. false, // Theater specific graphic image?
  499. PIP_ENGINEER, // Transport pip shape/color to use.
  500. E9DoControls,
  501. 3, // Frame of projectile launch.
  502. 3, // Frame of projectile launch while prone.
  503. 0 // pointer to override remap table
  504. );
  505. // Tanya
  506. static InfantryTypeClass const E7(
  507. INFANTRY_TANYA, // Infantry type number.
  508. TXT_E7, // Translate name number for infantry type.
  509. "E7", // INI name for infantry.
  510. 0x0035, // Vertical offset.
  511. 0x0010, // Primary weapon offset along turret centerline.
  512. false, // Is this a female type?
  513. true, // Has crawling animation frames?
  514. false, // Is this a civilian?
  515. false, // Does this unit use the override remap table?
  516. false, // Always use the given name for the infantry?
  517. false, // Theater specific graphic image?
  518. PIP_COMMANDO, // Transport pip shape/color to use.
  519. E7DoControls,
  520. 2, // Frame of projectile launch.
  521. 2, // Frame of projectile launch while prone.
  522. 0 // pointer to override remap table
  523. );
  524. static InfantryTypeClass const Medic(
  525. INFANTRY_MEDIC, // Infantry type number.
  526. TXT_MEDIC, // Translate name number for infantry type.
  527. "MEDI", // INI name for infantry.
  528. 0x0035, // Vertical offset.
  529. 0x0010, // Primary weapon offset along turret centerline.
  530. false, // Is this a female type?
  531. true, // Has crawling animation frames?
  532. false, // Is this a civilian?
  533. false, // Does this unit use the override remap table?
  534. false, // Always use the given name for the infantry?
  535. false, // Theater specific graphic image?
  536. PIP_ENGINEER, // Transport pip shape/color to use.
  537. MedicDoControls,
  538. 25, // Frame of projectile launch.
  539. 25, // Frame of projectile launch while prone.
  540. 0 // pointer to override remap table
  541. );
  542. static InfantryTypeClass const General(
  543. INFANTRY_GENERAL, // Infantry type number.
  544. TXT_GENERAL, // Translate name number for infantry type.
  545. "GNRL", // INI name for infantry.
  546. 0x0035, // Vertical offset.
  547. 0x0010, // Primary weapon offset along turret centerline.
  548. false, // Is this a female type?
  549. true, // Has crawling animation frames?
  550. false, // Is this a civilian?
  551. false, // Does this unit use the override remap table?
  552. false, // Always use the given name for the infantry?
  553. false, // Theater specific graphic image?
  554. PIP_ENGINEER, // Transport pip shape/color to use.
  555. GeneralDoControls,
  556. 2, // Frame of projectile launch.
  557. 2, // Frame of projectile launch while prone.
  558. 0 // pointer to override remap table
  559. );
  560. // Civilians
  561. static InfantryTypeClass const C1(
  562. INFANTRY_C1, // Infantry type number.
  563. TXT_C1, // Translate name number for infantry type.
  564. "C1", // INI name for infantry.
  565. 0x0035, // Vertical offset.
  566. 0x0010, // Primary weapon offset along turret centerline.
  567. false, // Is this a female type?
  568. false, // Has crawling animation frames?
  569. true, // Is this a civilian?
  570. false, // Does this unit use the override remap table?
  571. true, // Always use the given name for the infantry?
  572. false, // Theater specific graphic image?
  573. PIP_CIVILIAN, // Transport pip shape/color to use.
  574. CivilianDoControls,
  575. 2, // Frame of projectile launch.
  576. 0, // Frame of projectile launch while prone.
  577. 0 // pointer to override remap table
  578. );
  579. static InfantryTypeClass const C2(
  580. INFANTRY_C2, // Infantry type number.
  581. TXT_C2, // Translate name number for infantry type.
  582. "C2", // INI name for infantry.
  583. 0x0035, // Vertical offset.
  584. 0x0010, // Primary weapon offset along turret centerline.
  585. false, // Is this a female type?
  586. false, // Has crawling animation frames?
  587. true, // Is this a civilian?
  588. true, // Does this unit use the override remap table?
  589. true, // Always use the given name for the infantry?
  590. false, // Theater specific graphic image?
  591. PIP_CIVILIAN, // Transport pip shape/color to use.
  592. CivilianDoControls,
  593. 2, // Frame of projectile launch.
  594. 0, // Frame of projectile launch while prone.
  595. RemapCiv2 // pointer to override remap table
  596. );
  597. static InfantryTypeClass const C3(
  598. INFANTRY_C3, // Infantry type number.
  599. TXT_C3, // Translate name number for infantry type.
  600. "C3", // INI name for infantry.
  601. 0x0035, // Vertical offset.
  602. 0x0010, // Primary weapon offset along turret centerline.
  603. true, // Is this a female type?
  604. false, // Has crawling animation frames?
  605. true, // Is this a civilian?
  606. false, // Does this unit use the override remap table?
  607. true, // Always use the given name for the infantry?
  608. false, // Theater specific graphic image?
  609. PIP_CIVILIAN, // Transport pip shape/color to use.
  610. CivilianDoControls,
  611. 2, // Frame of projectile launch.
  612. 0, // Frame of projectile launch while prone.
  613. 0 // pointer to override remap table
  614. );
  615. static InfantryTypeClass const C4(
  616. INFANTRY_C4, // Infantry type number.
  617. TXT_C4, // Translate name number for infantry type.
  618. "C4", // INI name for infantry.
  619. 0x0035, // Vertical offset.
  620. 0x0010, // Primary weapon offset along turret centerline.
  621. true, // Is this a female type?
  622. false, // Has crawling animation frames?
  623. true, // Is this a civilian?
  624. true, // Does this unit use the override remap table?
  625. true, // Always use the given name for the infantry?
  626. false, // Theater specific graphic image?
  627. PIP_CIVILIAN, // Transport pip shape/color to use.
  628. CivilianDoControls,
  629. 2, // Frame of projectile launch.
  630. 0, // Frame of projectile launch while prone.
  631. RemapCiv4 // pointer to override remap table
  632. );
  633. static InfantryTypeClass const C5(
  634. INFANTRY_C5, // Infantry type number.
  635. TXT_C5, // Translate name number for infantry type.
  636. "C5", // INI name for infantry.
  637. 0x0035, // Vertical offset.
  638. 0x0010, // Primary weapon offset along turret centerline.
  639. false, // Is this a female type?
  640. false, // Has crawling animation frames?
  641. true, // Is this a civilian?
  642. true, // Does this unit use the override remap table?
  643. true, // Always use the given name for the infantry?
  644. false, // Theater specific graphic image?
  645. PIP_CIVILIAN, // Transport pip shape/color to use.
  646. CivilianDoControls,
  647. 2, // Frame of projectile launch.
  648. 0, // Frame of projectile launch while prone.
  649. RemapCiv5 // pointer to override remap table
  650. );
  651. static InfantryTypeClass const C6(
  652. INFANTRY_C6, // Infantry type number.
  653. TXT_C6, // Translate name number for infantry type.
  654. "C6", // INI name for infantry.
  655. 0x0035, // Vertical offset.
  656. 0x0010, // Primary weapon offset along turret centerline.
  657. false, // Is this a female type?
  658. false, // Has crawling animation frames?
  659. true, // Is this a civilian?
  660. true, // Does this unit use the override remap table?
  661. true, // Always use the given name for the infantry?
  662. false, // Theater specific graphic image?
  663. PIP_CIVILIAN, // Transport pip shape/color to use.
  664. CivilianDoControls,
  665. 2, // Frame of projectile launch.
  666. 0, // Frame of projectile launch while prone.
  667. RemapCiv6 // pointer to override remap table
  668. );
  669. static InfantryTypeClass const C7(
  670. INFANTRY_C7, // Infantry type number.
  671. TXT_C7, // Translate name number for infantry type.
  672. "C7", // INI name for infantry.
  673. 0x0035, // Vertical offset.
  674. 0x0010, // Primary weapon offset along turret centerline.
  675. false, // Is this a female type?
  676. false, // Has crawling animation frames?
  677. true, // Is this a civilian?
  678. true, // Does this unit use the override remap table?
  679. true, // Always use the given name for the infantry?
  680. false, // Theater specific graphic image?
  681. PIP_CIVILIAN, // Transport pip shape/color to use.
  682. CivilianDoControls,
  683. 2, // Frame of projectile launch.
  684. 0, // Frame of projectile launch while prone.
  685. RemapCiv7 // pointer to override remap table
  686. );
  687. static InfantryTypeClass const C8(
  688. INFANTRY_C8, // Infantry type number.
  689. TXT_C8, // Translate name number for infantry type.
  690. "C8", // INI name for infantry.
  691. 0x0035, // Vertical offset.
  692. 0x0010, // Primary weapon offset along turret centerline.
  693. false, // Is this a female type?
  694. false, // Has crawling animation frames?
  695. true, // Is this a civilian?
  696. true, // Does this unit use the override remap table?
  697. true, // Always use the given name for the infantry?
  698. false, // Theater specific graphic image?
  699. PIP_CIVILIAN, // Transport pip shape/color to use.
  700. CivilianDoControls,
  701. 2, // Frame of projectile launch.
  702. 0, // Frame of projectile launch while prone.
  703. RemapCiv8 // pointer to override remap table
  704. );
  705. static InfantryTypeClass const C9(
  706. INFANTRY_C9, // Infantry type number.
  707. TXT_C9, // Translate name number for infantry type.
  708. "C9", // INI name for infantry.
  709. 0x0035, // Vertical offset.
  710. 0x0010, // Primary weapon offset along turret centerline.
  711. false, // Is this a female type?
  712. false, // Has crawling animation frames?
  713. true, // Is this a civilian?
  714. true, // Does this unit use the override remap table?
  715. true, // Always use the given name for the infantry?
  716. false, // Theater specific graphic image?
  717. PIP_CIVILIAN, // Transport pip shape/color to use.
  718. CivilianDoControls,
  719. 2, // Frame of projectile launch.
  720. 0, // Frame of projectile launch while prone.
  721. RemapCiv9 // pointer to override remap table
  722. );
  723. // Nikoomba
  724. static InfantryTypeClass const C10(
  725. INFANTRY_C10, // Infantry type number.
  726. TXT_C10, // Translate name number for infantry type.
  727. "C10", // INI name for infantry.
  728. 0x0035, // Vertical offset.
  729. 0x0010, // Primary weapon offset along turret centerline.
  730. false, // Is this a female type?
  731. false, // Has crawling animation frames?
  732. true, // Is this a civilian?
  733. true, // Does this unit use the override remap table?
  734. true, // Always use the given name for the infantry?
  735. false, // Theater specific graphic image?
  736. PIP_ENGINEER, // Transport pip shape/color to use.
  737. CivilianDoControls,
  738. 2, // Frame of projectile launch.
  739. 0, // Frame of projectile launch while prone.
  740. RemapCiv10 // pointer to override remap table
  741. );
  742. static InfantryTypeClass const Einstein(
  743. INFANTRY_EINSTEIN, // Infantry type number.
  744. TXT_EINSTEIN, // Translate name number for infantry type.
  745. "EINSTEIN", // INI name for infantry.
  746. 0x0035, // Vertical offset.
  747. 0x0010, // Primary weapon offset along turret centerline.
  748. false, // Is this a female type?
  749. false, // Has crawling animation frames?
  750. true, // Is this a civilian?
  751. false, // Does this unit use the override remap table?
  752. true, // Always use the given name for the infantry?
  753. false, // Theater specific graphic image?
  754. PIP_ENGINEER, // Transport pip shape/color to use.
  755. EinsteinDoControls,
  756. 0, // Frame of projectile launch.
  757. 0, // Frame of projectile launch while prone.
  758. 0 // pointer to override remap table
  759. );
  760. static InfantryTypeClass const Delphi(
  761. INFANTRY_DELPHI, // Infantry type number.
  762. TXT_DELPHI, // Translate name number for infantry type.
  763. "DELPHI", // INI name for infantry.
  764. 0x0035, // Vertical offset.
  765. 0x0010, // Primary weapon offset along turret centerline.
  766. false, // Is this a female type?
  767. false, // Has crawling animation frames?
  768. true, // Is this a civilian?
  769. false, // Does this unit use the override remap table?
  770. true, // Always use the given name for the infantry?
  771. false, // Theater specific graphic image?
  772. PIP_ENGINEER, // Transport pip shape/color to use.
  773. CivilianDoControls,
  774. 2, // Frame of projectile launch.
  775. 0, // Frame of projectile launch while prone.
  776. 0 // pointer to override remap table
  777. );
  778. static InfantryTypeClass const DrChan(
  779. INFANTRY_CHAN, // Infantry type number.
  780. TXT_CHAN, // Translate name number for infantry type.
  781. "CHAN", // INI name for infantry.
  782. 0x0035, // Vertical offset.
  783. 0x0010, // Primary weapon offset along turret centerline.
  784. false, // Is this a female type?
  785. false, // Has crawling animation frames?
  786. true, // Is this a civilian?
  787. false, // Does this unit use the override remap table?
  788. true, // Always use the given name for the infantry?
  789. false, // Theater specific graphic image?
  790. PIP_ENGINEER, // Transport pip shape/color to use.
  791. EinsteinDoControls,
  792. 2, // Frame of projectile launch.
  793. 0, // Frame of projectile launch while prone.
  794. 0 // pointer to override remap table
  795. );
  796. #ifdef FIXIT_CSII // checked - ajw 9/28/98
  797. // Shock Trooper
  798. static InfantryTypeClass const ShockTrooper(
  799. INFANTRY_SHOCK, // Infantry type number.
  800. TXT_SHOCKTROOPER, // Translate name number for infantry type.
  801. "SHOK", // INI name for infantry.
  802. 0x0035, // Vertical offset.
  803. 0x0010, // Primary weapon offset along turret centerline.
  804. false, // Is this a female type?
  805. true, // Has crawling animation frames?
  806. false, // Is this a civilian?
  807. false, // Does this unit use the override remap table?
  808. false, // Always use the given name for the infantry?
  809. false, // Theater specific graphic image?
  810. PIP_FULL, // Transport pip shape/color to use.
  811. E4DoControls,
  812. 2, // Frame of projectile launch.
  813. 0, // Frame of projectile launch while prone.
  814. 0 // pointer to override remap table
  815. );
  816. static InfantryTypeClass const Mechanic(
  817. INFANTRY_MECHANIC, // Infantry type number.
  818. TXT_MECHANIC, // Translate name number for infantry type.
  819. "MECH", // INI name for infantry.
  820. 0x0035, // Vertical offset.
  821. 0x0010, // Primary weapon offset along turret centerline.
  822. false, // Is this a female type?
  823. true, // Has crawling animation frames?
  824. false, // Is this a civilian?
  825. false, // Does this unit use the override remap table?
  826. false, // Always use the given name for the infantry?
  827. false, // Theater specific graphic image?
  828. PIP_ENGINEER, // Transport pip shape/color to use.
  829. MedicDoControls,
  830. 25, // Frame of projectile launch.
  831. 25, // Frame of projectile launch while prone.
  832. 0 // pointer to override remap table
  833. );
  834. #endif
  835. /***********************************************************************************************
  836. * InfantryTypeClass::InfantryTypeClass -- Constructor for infantry type class objects. *
  837. * *
  838. * This routine will construct the infantry type objects. It is use to create the static *
  839. * infantry types that are used to give each of the infantry objects their characteristics. *
  840. * *
  841. * INPUT: see below... *
  842. * *
  843. * OUTPUT: none *
  844. * *
  845. * WARNINGS: none *
  846. * *
  847. * HISTORY: *
  848. * 09/24/1994 JLB : Created. *
  849. * 02/16/1996 JLB : Greatly simplified. *
  850. *=============================================================================================*/
  851. InfantryTypeClass::InfantryTypeClass (
  852. InfantryType type,
  853. int name,
  854. char const * ininame,
  855. int verticaloffset,
  856. int primaryoffset,
  857. bool is_female,
  858. bool is_crawling,
  859. bool is_civilian,
  860. bool is_remap_override,
  861. bool is_nominal,
  862. bool is_theater,
  863. PipEnum pip,
  864. DoInfoStruct const * control,
  865. int firelaunch,
  866. int pronelaunch,
  867. unsigned char const * override_remap)
  868. : TechnoTypeClass(RTTI_INFANTRYTYPE,
  869. int(type),
  870. name,
  871. ininame,
  872. REMAP_NORMAL,
  873. verticaloffset,
  874. primaryoffset,
  875. 0x0000,
  876. 0x0000,
  877. 0x0000,
  878. is_nominal,
  879. true,
  880. true,
  881. true,
  882. false,
  883. false,
  884. is_theater,
  885. false,
  886. true,
  887. true,
  888. 8,
  889. SPEED_FOOT),
  890. IsFemale(is_female),
  891. IsCrawling(is_crawling),
  892. IsCapture(false),
  893. IsFraidyCat(false),
  894. IsCivilian(is_civilian),
  895. IsBomber(false),
  896. IsDog(false),
  897. IsRemapOverride(is_remap_override),
  898. Type(type),
  899. Pip(pip),
  900. DoControls(control),
  901. FireLaunch(firelaunch),
  902. ProneLaunch(pronelaunch),
  903. OverrideRemap(override_remap)
  904. {
  905. /*
  906. ** Forced infantry overrides from the default.
  907. */
  908. IsCrushable = true;
  909. IsScanner = true;
  910. IsRepairable = false;
  911. IsCrew = false;
  912. Speed = SPEED_FOOT;
  913. }
  914. /***********************************************************************************************
  915. * InfantryTypeClass::operator new -- Allocate an infanty type class object. *
  916. * *
  917. * This will allocate an infantry type class object from the special memory pool of that *
  918. * purpose. *
  919. * *
  920. * INPUT: none *
  921. * *
  922. * OUTPUT: Returns with a pointer to the infantry type class object allocated. If there was *
  923. * insufficient memory to fulfill the request, then NULL is returned. *
  924. * *
  925. * WARNINGS: none *
  926. * *
  927. * HISTORY: *
  928. * 07/11/1996 JLB : Created. *
  929. *=============================================================================================*/
  930. void * InfantryTypeClass::operator new(size_t)
  931. {
  932. return(InfantryTypes.Alloc());
  933. }
  934. /***********************************************************************************************
  935. * InfantryTypeClass::operator delete -- Frees an infantry type class object. *
  936. * *
  937. * This will return a previously allocated infantry type class object back to the memory *
  938. * pool from whence it came. *
  939. * *
  940. * INPUT: pointer -- The pointer to the infantry type class object to free. *
  941. * *
  942. * OUTPUT: none *
  943. * *
  944. * WARNINGS: none *
  945. * *
  946. * HISTORY: *
  947. * 07/11/1996 JLB : Created. *
  948. *=============================================================================================*/
  949. void InfantryTypeClass::operator delete(void * pointer)
  950. {
  951. InfantryTypes.Free((InfantryTypeClass *)pointer);
  952. }
  953. /***********************************************************************************************
  954. * InfantryTypeClass::Init_Heap -- Initialize the infantry type class heap. *
  955. * *
  956. * This will pre-allocate all known infantry types. *
  957. * *
  958. * INPUT: none *
  959. * *
  960. * OUTPUT: none *
  961. * *
  962. * WARNINGS: Call this routine once and before the rules.ini file is processed. *
  963. * *
  964. * HISTORY: *
  965. * 07/11/1996 JLB : Created. *
  966. *=============================================================================================*/
  967. void InfantryTypeClass::Init_Heap(void)
  968. {
  969. /*
  970. ** These infantry type class objects must be allocated in the exact order that they
  971. ** are specified in the InfantryType enumeration. This is necessary because the heap
  972. ** allocation block index serves double duty as the type number index.
  973. */
  974. new InfantryTypeClass(E1);
  975. new InfantryTypeClass(E2);
  976. new InfantryTypeClass(E3);
  977. new InfantryTypeClass(E4);
  978. new InfantryTypeClass(E6);
  979. new InfantryTypeClass(E7);
  980. new InfantryTypeClass(E8);
  981. new InfantryTypeClass(E9);
  982. new InfantryTypeClass(Medic);
  983. new InfantryTypeClass(General);
  984. new InfantryTypeClass(Dog);
  985. new InfantryTypeClass(C1);
  986. new InfantryTypeClass(C2);
  987. new InfantryTypeClass(C3);
  988. new InfantryTypeClass(C4);
  989. new InfantryTypeClass(C5);
  990. new InfantryTypeClass(C6);
  991. new InfantryTypeClass(C7);
  992. new InfantryTypeClass(C8);
  993. new InfantryTypeClass(C9);
  994. new InfantryTypeClass(C10);
  995. new InfantryTypeClass(Einstein);
  996. new InfantryTypeClass(Delphi);
  997. new InfantryTypeClass(DrChan);
  998. #ifdef FIXIT_CSII // checked - ajw 9/28/98
  999. new InfantryTypeClass(ShockTrooper);
  1000. new InfantryTypeClass(Mechanic);
  1001. #endif
  1002. }
  1003. /***********************************************************************************************
  1004. * InfantryTypeClass::Create_One_Of -- Creates an infantry object. *
  1005. * *
  1006. * This creates an infantry object, but does not attempt to place it on the map. It is *
  1007. * typically used by the scenario editor when an object is needed, but the location has *
  1008. * not yet been specified for where it should appear on the map. *
  1009. * *
  1010. * INPUT: house -- The owner of the infantry object. *
  1011. * *
  1012. * OUTPUT: Returns with a pointer to the created infantry object. If an object could not be *
  1013. * created, then NULL is returned. *
  1014. * *
  1015. * WARNINGS: none *
  1016. * *
  1017. * HISTORY: *
  1018. * 09/24/1994 JLB : Created. *
  1019. *=============================================================================================*/
  1020. ObjectClass * InfantryTypeClass::Create_One_Of(HouseClass * house) const
  1021. {
  1022. return(new InfantryClass(Type, house->Class->House));
  1023. }
  1024. /***********************************************************************************************
  1025. * InfantryTypeClass::Create_And_Place -- Creates and places infantry object onto the map. *
  1026. * *
  1027. * This routine is used by the scenario editor to create and place an infantry object onto *
  1028. * the map at the location specified. *
  1029. * *
  1030. * INPUT: cell -- The cell location to place the infantry object at. *
  1031. * *
  1032. * house -- The owner of the infantry object. *
  1033. * *
  1034. * OUTPUT: bool; Was the infantry object successfully created and placed at the location *
  1035. * specified? *
  1036. * *
  1037. * WARNINGS: none *
  1038. * *
  1039. * HISTORY: *
  1040. * 09/24/1994 JLB : Created. *
  1041. *=============================================================================================*/
  1042. bool InfantryTypeClass::Create_And_Place(CELL cell, HousesType house) const
  1043. {
  1044. InfantryClass * i = new InfantryClass(Type, house);
  1045. if (i != NULL) {
  1046. COORDINATE coord = Map[cell].Closest_Free_Spot(Cell_Coord(cell));
  1047. if (coord) {
  1048. return(i->Unlimbo(coord, DIR_E));
  1049. } else {
  1050. delete i;
  1051. }
  1052. }
  1053. return(false);
  1054. }
  1055. /***********************************************************************************************
  1056. * InfantryTypeClass::Occupy_List -- Returns with default infantry occupation list. *
  1057. * *
  1058. * This routine will return with a cell offset occupation list for a generic infantry *
  1059. * object. This is typically just a single cell since infantry are never bigger than one *
  1060. * cell and this routine presumes the infantry is located in the center of the cell. *
  1061. * *
  1062. * INPUT: placement -- Is this for placement legality checking only? The normal condition *
  1063. * is for marking occupation flags. *
  1064. * *
  1065. * OUTPUT: Returns with a cell offset list for the infantry object as if it were located *
  1066. * in the center of a cell. *
  1067. * *
  1068. * WARNINGS: none *
  1069. * *
  1070. * HISTORY: *
  1071. * 09/24/1994 JLB : Created. *
  1072. *=============================================================================================*/
  1073. short const * InfantryTypeClass::Occupy_List(bool) const
  1074. {
  1075. static short const _list[] = {0, REFRESH_EOL};
  1076. return(&_list[0]);
  1077. }
  1078. #ifdef SCENARIO_EDITOR
  1079. /***********************************************************************************************
  1080. * InfantryTypeClass::Display -- Displays a generic infantry object. *
  1081. * *
  1082. * This routine is used by the scenario editor to display a generic representation of the *
  1083. * infantry object for the scenario editor. It simply draws a single (nice profile) view *
  1084. * of the infantry type. *
  1085. * *
  1086. * INPUT: x,y -- The display coordinates to render the infantry object at. *
  1087. * *
  1088. * window -- The window that the display coordinates are relative to. *
  1089. * *
  1090. * house -- The house colors to use when rendering this infantry object. *
  1091. * *
  1092. * OUTPUT: none *
  1093. * *
  1094. * WARNINGS: none *
  1095. * *
  1096. * HISTORY: *
  1097. * 09/24/1994 JLB : Created. *
  1098. *=============================================================================================*/
  1099. void InfantryTypeClass::Display(int x, int y, WindowNumberType window, HousesType house) const
  1100. {
  1101. if (house != HOUSE_NONE) {
  1102. int shape = 0;
  1103. void const * ptr = Get_Cameo_Data();
  1104. if (ptr == NULL) {
  1105. ptr = Get_Image_Data();
  1106. shape = 2;
  1107. }
  1108. CC_Draw_Shape(ptr, shape, x, y, window, SHAPE_NORMAL|SHAPE_CENTER|SHAPE_WIN_REL);
  1109. }
  1110. }
  1111. /***********************************************************************************************
  1112. * InfantryTypeClass::Prep_For_Add -- Prepares the scenario editor for adding of infantry object.*
  1113. * *
  1114. * This routine will prepare the scenario editor so that the infantry objects appear on *
  1115. * the object list. *
  1116. * *
  1117. * INPUT: none *
  1118. * *
  1119. * OUTPUT: none *
  1120. * *
  1121. * WARNINGS: none *
  1122. * *
  1123. * HISTORY: *
  1124. * 09/24/1994 JLB : Created. *
  1125. *=============================================================================================*/
  1126. void InfantryTypeClass::Prep_For_Add(void)
  1127. {
  1128. for (InfantryType index = INFANTRY_FIRST; index < INFANTRY_COUNT; index++) {
  1129. Map.Add_To_List(&As_Reference(index));
  1130. }
  1131. }
  1132. #endif
  1133. /***********************************************************************************************
  1134. * InfantryTypeClass::From_Name -- Converts an ASCII name into an infantry type number. *
  1135. * *
  1136. * This routine is used to convert the infantry ASCII name as specified into an infantry *
  1137. * type number. This is called from the INI reader routine in the process if creating the *
  1138. * infantry objects needed for the scenario. *
  1139. * *
  1140. * INPUT: name -- The ASCII name to convert into an infantry type number. *
  1141. * *
  1142. * OUTPUT: Returns with the infantry type number that corresponds to the infantry ASCII name *
  1143. * specified. If no match could be found, then INFANTRY_NONE is returned. *
  1144. * *
  1145. * WARNINGS: none *
  1146. * *
  1147. * HISTORY: *
  1148. * 09/24/1994 JLB : Created. *
  1149. *=============================================================================================*/
  1150. InfantryType InfantryTypeClass::From_Name(char const * name)
  1151. {
  1152. if (name != NULL) {
  1153. for (InfantryType classid = INFANTRY_FIRST; classid < INFANTRY_COUNT; classid++) {
  1154. if (stricmp(As_Reference(classid).IniName, name) == 0) {
  1155. return(classid);
  1156. }
  1157. }
  1158. }
  1159. return(INFANTRY_NONE);
  1160. }
  1161. /***********************************************************************************************
  1162. * InfantryTypeClass::One_Time -- Performs any one time processing for infantry system. *
  1163. * *
  1164. * This routine will perform one time processing for the infantry type system. This is *
  1165. * generally restricted to loading of the infantry shape data. *
  1166. * *
  1167. * INPUT: none *
  1168. * *
  1169. * OUTPUT: none *
  1170. * *
  1171. * WARNINGS: none *
  1172. * *
  1173. * HISTORY: *
  1174. * 09/24/1994 JLB : Created. *
  1175. *=============================================================================================*/
  1176. void InfantryTypeClass::One_Time(void)
  1177. {
  1178. for (InfantryType index = INFANTRY_FIRST; index < INFANTRY_COUNT; index++) {
  1179. char fullname[_MAX_FNAME+_MAX_EXT];
  1180. InfantryTypeClass const * uclass;
  1181. CCFileClass file;
  1182. uclass = &As_Reference(index);
  1183. /*
  1184. ** Generic shape for all houses load method.
  1185. */
  1186. _makepath(fullname, NULL, NULL, uclass->Graphic_Name(), ".SHP");
  1187. #ifndef NDEBUG
  1188. RawFileClass sfile(fullname);
  1189. if (sfile.Is_Available()) {
  1190. ((void const *&)uclass->ImageData) = Load_Alloc_Data(sfile);
  1191. } else {
  1192. ((void const *&)uclass->ImageData) = MFCD::Retrieve(fullname);
  1193. }
  1194. #else
  1195. ((void const *&)uclass->ImageData) = MFCD::Retrieve(fullname);
  1196. #endif
  1197. /*
  1198. ** The small build image icon sized shapes are always generic.
  1199. */
  1200. char buffer[_MAX_FNAME];
  1201. sprintf(buffer, "%.4sICON", uclass->Graphic_Name());
  1202. _makepath(fullname, NULL, NULL, buffer, ".SHP");
  1203. #ifndef NDEBUG
  1204. RawFileClass ifile(fullname);
  1205. if (ifile.Is_Available()) {
  1206. ((void const *&)uclass->CameoData) = Load_Alloc_Data(ifile);
  1207. } else {
  1208. ((void const *&)uclass->CameoData) = MFCD::Retrieve(fullname);
  1209. }
  1210. #else
  1211. ((void const *&)uclass->CameoData) = MFCD::Retrieve(fullname);
  1212. #endif
  1213. }
  1214. }
  1215. /***********************************************************************************************
  1216. * InfantryTypeClass::Full_Name -- Fetches the full name text number. *
  1217. * *
  1218. * This routine will fetch the full name text number for this infantry type. It examines *
  1219. * the special custom name flag to determine whether the custom name or the generic name *
  1220. * is to be used. *
  1221. * *
  1222. * INPUT: none *
  1223. * *
  1224. * OUTPUT: Returns with text number for the name to give this infantry type object. *
  1225. * *
  1226. * WARNINGS: none *
  1227. * *
  1228. * HISTORY: *
  1229. * 06/29/1995 JLB : Created. *
  1230. *=============================================================================================*/
  1231. int InfantryTypeClass::Full_Name(void) const
  1232. {
  1233. if (Debug_Map || !IsNominal || Rule.IsNamed || Type == INFANTRY_C10 || Type == INFANTRY_DELPHI || Type == INFANTRY_EINSTEIN) {
  1234. return(TechnoTypeClass::Full_Name());
  1235. }
  1236. return(TXT_CIVILIAN);
  1237. }
  1238. /***********************************************************************************************
  1239. * InfantryTypeClass::As_Reference -- Fetches a reference to the infantry type specified. *
  1240. * *
  1241. * Use this routine to convert an infantry type number into a reference to the infantry *
  1242. * type class object it represents. *
  1243. * *
  1244. * INPUT: type -- The infantry type number to convert into a infantry type class object. *
  1245. * *
  1246. * OUTPUT: Returns with a reference to the infantry type class object specified. *
  1247. * *
  1248. * WARNINGS: Be sure that the type parameter is legal, otherwise the results are undefined. *
  1249. * *
  1250. * HISTORY: *
  1251. * 07/11/1996 JLB : Created. *
  1252. *=============================================================================================*/
  1253. InfantryTypeClass & InfantryTypeClass::As_Reference(InfantryType type)
  1254. {
  1255. return(*InfantryTypes.Ptr(type));
  1256. }
  1257. /***********************************************************************************************
  1258. * InfantryTypeClass::Read_INI -- Fetches infantry override values from the INI database. *
  1259. * *
  1260. * This routine will retrieve the override values for this infantry type class object from *
  1261. * the INI database specified. *
  1262. * *
  1263. * INPUT: ini -- Reference to the INI database to retrieve the data from. *
  1264. * *
  1265. * OUTPUT: bool; Was the infantry section for this type found and data retrieved from it? *
  1266. * *
  1267. * WARNINGS: none *
  1268. * *
  1269. * HISTORY: *
  1270. * 07/19/1996 JLB : Created. *
  1271. *=============================================================================================*/
  1272. bool InfantryTypeClass::Read_INI(CCINIClass & ini)
  1273. {
  1274. if (TechnoTypeClass::Read_INI(ini)) {
  1275. IsFraidyCat = ini.Get_Bool(Name(), "Fraidycat", IsFraidyCat);
  1276. IsCapture = ini.Get_Bool(Name(), "Infiltrate", IsCapture);
  1277. IsBomber = ini.Get_Bool(Name(), "C4", IsBomber);
  1278. IsDog = ini.Get_Bool(Name(), "IsCanine", IsDog);
  1279. if (IsBomber) IsCapture = true;
  1280. if (IsDog) IsLeader = false;
  1281. return(true);
  1282. }
  1283. return(false);
  1284. }
  1285. void InfantryTypeClass::Dimensions(int & width, int & height) const
  1286. {
  1287. #ifdef WIN32
  1288. width = 14;
  1289. height = 20;
  1290. #else
  1291. width = 12;
  1292. height = 16;
  1293. #endif
  1294. }