IDATA.CPP 66 KB

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