Advertisement
Benji23245

Untitled

May 27th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 58.67 KB | None | 0 0
  1. void MyHudThing()
  2. {
  3. if (GameState == 4)
  4. {
  5. can_animate_gain = 0;
  6. can_animate_loss = 0;
  7. energy_glow = 0;
  8. glow_down = false;
  9. energy_lvl_glow = 0;
  10. lvl_glow_down = false;
  11. lv1_stretch = 0;
  12. lv2_stretch = 0;
  13. lv3_stretch = 0;
  14. LV1_obtained = false;
  15. LV2_obtained = false;
  16. LV3_obtained = false;
  17. LV1_active = false;
  18. LV2_active = false;
  19. LV3_active = false;
  20. sparkles.clear();
  21. sparkletimer = 0;
  22. sparklegemstimer = 0;
  23. sparklegems_tiny_timer = 0;
  24. LV1_usable = false;
  25. LV2_usable = false;
  26. LV3_usable = false;
  27. stop_active_lvl = 0;
  28. sonic_lv1_glow = 0;
  29. sonic_lv2_glow = 0;
  30. sonic_lv3_glow = 0;
  31. sonic_lv1_glow_down = false;
  32. sonic_lv2_glow_down = false;
  33. sonic_lv3_glow_down = false;
  34. star_glow = 0;
  35. circle_glow = 0;
  36. level3_glow = 0;
  37. Gauge = 10000;
  38. }
  39. if (GameState != 21)
  40. {
  41. if (GetCharacterObject(0))
  42. {
  43. njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_SRCALPHA);
  44. njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_INVSRCALPHA);
  45. njTextureShadingMode(NJD_TEX_SHADING_MODE_DECALALPHA);
  46. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  47. HUD_SPRITE.p.x = -44 * 1.3f * HorizontalResolution / 1680.0f;
  48. HUD_SPRITE.p.y = 70 * 1.3f * VerticalResolution / 1050.0f;
  49. njDrawSprite2D_Queue(&HUD_SPRITE, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  50. HUD_SPRITE.p.x = -44 * 1.3f * HorizontalResolution / 1680.0f;
  51. HUD_SPRITE.p.y = 120 * 1.3f * VerticalResolution / 1050.0f;
  52. njDrawSprite2D_Queue(&HUD_SPRITE, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  53. HUD_SPRITE.p.x = -44 * 1.3f * HorizontalResolution / 1680.0f;
  54. HUD_SPRITE.p.y = 170 * 1.3f * VerticalResolution / 1050.0f;
  55. njDrawSprite2D_Queue(&HUD_SPRITE, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  56. HUD_SPRITE.p.x = -44 * 1.3f * HorizontalResolution / 1680.0f;
  57. HUD_SPRITE.p.y = 220 * 1.3f * VerticalResolution / 1050.0f;
  58. njDrawSprite2D_Queue(&HUD_SPRITE, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  59.  
  60.  
  61. if (GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
  62. {
  63. HUD_SPRITE.p.x = 110 * 1.3f * HorizontalResolution / 1680.0f;
  64. HUD_SPRITE.p.y = 205 * 1.3f * VerticalResolution / 1050.0f;
  65. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE, 4, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  66. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE, 7, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  67. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE, 10, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  68.  
  69. if (ControllerPointers[0]->HeldButtons & Buttons_B) ++checkH;
  70. if (ControllerPointers[0]->HeldButtons & Buttons_X) --checkH;
  71. if (ControllerPointers[0]->HeldButtons & Buttons_A) ++checkV;
  72. if (ControllerPointers[0]->HeldButtons & Buttons_Y) --checkV;
  73. //////////////////////////////SetDebugFontSize(15);
  74. //////////////////////////////DisplayDebugStringFormatted((80 << 16) | 60, "%5i", checkH);
  75. //////////////////////////////SetDebugFontSize(12);
  76. //////////////////////////////SetDebugFontSize(15);
  77. //////////////////////////////DisplayDebugStringFormatted((81 << 16) | 61, "%5i", checkV);
  78. //////////////////////////////SetDebugFontSize(12);
  79.  
  80. //Energy Gauge
  81. HUD_SPRITE_ENERGY.p.x = 810 * 1.3f * HorizontalResolution / 1680.0f;
  82. HUD_SPRITE_ENERGY.p.y = 660 * 1.3f * VerticalResolution / 1050.0f;
  83. njDrawSprite2D_Queue(&HUD_SPRITE_ENERGY, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0); //HUD_Gauge
  84. if (LV3_active)
  85. {
  86. ////////////////////************************************************************************************************************
  87. GEMSGauge_SPRITE.p.x = 1490 * HorizontalResolution / 1680.0f;
  88. GEMSGauge_SPRITE.p.y = 872 * VerticalResolution / 1050.0f;
  89. njDrawSprite2D_Queue(&GEMSGauge_SPRITE, draw, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  90. ////////////////////
  91. }
  92. if (Gauge == 0)
  93. {
  94. energy_glow = 0;
  95. }
  96. if (Gauge > 0 && Gauge < 10000)
  97. {
  98. energy_glow = 0;
  99. njDrawSprite2D_Queue(&HUD_SPRITE_ENERGY, 1 + (Gauge/100), -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  100. }
  101. else if (Gauge >= 10000)
  102. {
  103. HUD_SPRITE_ENERGY.p.x = 810 * 1.3f * HorizontalResolution / 1680.0f;
  104. HUD_SPRITE_ENERGY.p.y = 660 * 1.3f * VerticalResolution / 1050.0f;
  105. njDrawSprite2D_Queue(&HUD_SPRITE_ENERGY, 100, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  106. if (!is_boosting)
  107. {
  108. HUD_SPRITE_ENERGY_GLOW.p.x = 785 * 1.3f * HorizontalResolution / 1680.0f;
  109. HUD_SPRITE_ENERGY_GLOW.p.y = 657 * 1.3f * VerticalResolution / 1050.0f;
  110. if (energy_glow <= 20)
  111. {
  112. if (!glow_down)
  113. {
  114. if (energy_glow < 20)
  115. {
  116. ++energy_glow;
  117. SetMaterialAndSpriteColor_Float((0 + energy_glow) / 20.0f, 1, 1, 1);
  118. njDrawSprite2D_Queue(&HUD_SPRITE_ENERGY_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  119. }
  120. else if (energy_glow == 20)
  121. {
  122. energy_glow = 0;
  123. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  124. njDrawSprite2D_Queue(&HUD_SPRITE_ENERGY_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  125. glow_down = true;
  126. }
  127. }
  128. else if (glow_down)
  129. {
  130. if (energy_glow < 20)
  131. {
  132. ++energy_glow;
  133. SetMaterialAndSpriteColor_Float((20 - energy_glow) / 20.0f, 1, 1, 1);
  134. njDrawSprite2D_Queue(&HUD_SPRITE_ENERGY_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  135. }
  136. else if (energy_glow == 20)
  137. {
  138. energy_glow = 0;
  139. SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
  140. njDrawSprite2D_Queue(&HUD_SPRITE_ENERGY_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  141. glow_down = false;
  142. }
  143. }
  144. }
  145. }
  146. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  147. }
  148.  
  149. //LVL Energy Gauge
  150. if (GameState != 16)
  151. {
  152. if (LV2_usable && !LV3_usable)
  153. {
  154. if (ControllerPointers[0]->PressedButtons & Buttons_B)
  155. {
  156. PlaySound(1250, 0, 0, 0);
  157. LV1_obtained = false;
  158. LV2_obtained = false;
  159. LV1_usable = false;
  160. LV2_usable = false;
  161. LV2_active = true;
  162. Gauge2 = 9999;
  163. sonic_lv1_glow = 0;
  164. sonic_lv2_glow = 0;
  165. sonic_lv3_glow = 0;
  166. lvl_glow_down = false;
  167. sonic_lv1_glow_down = false;
  168. sonic_lv2_glow_down = false;
  169. sonic_lv3_glow_down = false;
  170. star_glow = 0;
  171. circle_glow = 0;
  172. level3_glow = 0;
  173. }
  174. }
  175. }
  176. if (LV2_active) //has to be there to avoid the weird color blinking issue
  177. {
  178. if (GameState != 16)
  179. {
  180. ++stop_active_lvl;
  181. Gauge2 -= 8;
  182. if (stop_active_lvl == 1250)
  183. {
  184. stop_active_lvl = 0;
  185. LV2_active = false;
  186. PlaySound(1247, 0, 0, 0);
  187. }
  188. //3D HUD
  189. ParticleDepthOverride = 2000.0f;
  190. if (star_glow < 10)
  191. {
  192. ++star_glow;
  193. SetMaterialAndSpriteColor_Float((10 - star_glow) / 10.0f, 1, 1, 1);
  194. HUD3D_SPRITE_STAR.sx = ((3 + (star_glow / 2.0f)) / 10.0f) * 1.3f * HorizontalResolution / 1680.0f;
  195. HUD3D_SPRITE_STAR.sy = ((3 + (star_glow / 2.0f)) / 10.0f) * 1.3f * VerticalResolution / 1050.0f;
  196. njDrawSprite3D(&HUD3D_SPRITE_STAR, 0, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
  197. }
  198. else if (star_glow == 10)
  199. {
  200. star_glow = 0;
  201. SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
  202. HUD3D_SPRITE_STAR.sx = 1.3f * HorizontalResolution / 1680.0f;
  203. HUD3D_SPRITE_STAR.sy = 1.3f * VerticalResolution / 1050.0f;
  204. njDrawSprite3D(&HUD3D_SPRITE_STAR, 0, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
  205. }
  206. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  207. if (circle_glow < 14)
  208. {
  209. ++circle_glow;
  210. SetMaterialAndSpriteColor_Float((14 - circle_glow) / 14.0f, 1, 1, 1);
  211. HUD3D_SPRITE_CIRCLE.sx = (circle_glow / 14.0f) * 1.3f * HorizontalResolution / 1680.0f;
  212. HUD3D_SPRITE_CIRCLE.sy = (circle_glow / 14.0f) * 1.3f * VerticalResolution / 1050.0f;
  213. njDrawSprite3D(&HUD3D_SPRITE_CIRCLE, 1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
  214. }
  215. else if (circle_glow == 14)
  216. {
  217. SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
  218. HUD3D_SPRITE_CIRCLE.sx = 1.3f * HorizontalResolution / 1680.0f;
  219. HUD3D_SPRITE_CIRCLE.sy = 1.3f * VerticalResolution / 1050.0f;
  220. njDrawSprite3D(&HUD3D_SPRITE_CIRCLE, 1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
  221. ++circle_glow;
  222. }
  223. else if (circle_glow > 14)
  224. {
  225. if (++circle_glow == 20)
  226. {
  227. circle_glow = 0;
  228. }
  229. }
  230. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  231. ParticleDepthOverride = 0.0f;
  232. }
  233. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 10, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  234. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 13, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  235. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 16, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  236. if (sonic_lv2_glow <= 2)
  237. {
  238. if (!sonic_lv2_glow_down)
  239. {
  240. if (sonic_lv2_glow < 2)
  241. {
  242. ++sonic_lv2_glow;
  243. SetMaterialAndSpriteColor_Float((0 + sonic_lv2_glow) / 2.0f, 1, 1, 1);
  244. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  245. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 4, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  246. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 7, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  247. }
  248. else if (sonic_lv2_glow == 2)
  249. {
  250. sonic_lv2_glow = 0;
  251. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  252. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  253. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 4, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  254. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 7, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  255. sonic_lv2_glow_down = true;
  256. }
  257. }
  258. else if (sonic_lv2_glow_down)
  259. {
  260. if (sonic_lv2_glow < 2)
  261. {
  262. ++sonic_lv2_glow;
  263. SetMaterialAndSpriteColor_Float((2 - sonic_lv2_glow) / 2.0f, 1, 1, 1);
  264. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  265. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 4, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  266. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 7, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  267. }
  268. else if (sonic_lv2_glow == 2)
  269. {
  270. sonic_lv2_glow = 0;
  271. SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
  272. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  273. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 4, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  274. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 7, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  275. sonic_lv2_glow_down = false;
  276. }
  277. }
  278. }
  279. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  280. if (is_sonic) SetMaterialAndSpriteColor_Float(0.35, 0.10588, 0.48235, 0.94902);
  281. else if (is_shadow) SetMaterialAndSpriteColor_Float(0.35, 0.92157, 0.19608, 0.13725);
  282. else if (is_metal) SetMaterialAndSpriteColor_Float(0.35, 0, 0.11373, 0.54118);
  283. njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL, (Gauge2 / 100), -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  284. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  285. }
  286. HUD_SPRITE_ENERGYLVL.p.x = 810 * 1.3f * HorizontalResolution / 1680.0f;
  287. HUD_SPRITE_ENERGYLVL.p.y = 660 * 1.3f * VerticalResolution / 1050.0f;
  288. if (Gauge2 > 0 && Gauge2 < 10000)
  289. {
  290. energy_lvl_glow = 0;
  291. if (is_sonic) SetMaterialAndSpriteColor_Float(0.25, 0.10588, 0.48235, 0.94902);
  292. else if (is_shadow) SetMaterialAndSpriteColor_Float(0.25, 0.92157, 0.19608, 0.13725);
  293. else if (is_metal) SetMaterialAndSpriteColor_Float(0.25, 0, 0.11373, 0.54118);
  294. njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL, (Gauge2 / 100), -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  295. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  296. }
  297. if (Gauge2 >= 10000 && Gauge2 < 20000)
  298. {
  299. if (is_sonic) SetMaterialAndSpriteColor_Float(0.25, 0.10588, 0.48235, 0.94902);
  300. else if (is_shadow) SetMaterialAndSpriteColor_Float(0.25, 0.92157, 0.19608, 0.13725);
  301. else if (is_metal) SetMaterialAndSpriteColor_Float(0.25, 0, 0.11373, 0.54118);
  302. njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL, 99, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  303. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  304. }
  305. if (Gauge2 > 10000 && Gauge2 < 20000)
  306. {
  307. energy_lvl_glow = 0;
  308. if (is_sonic) SetMaterialAndSpriteColor_Float(0.35, 0.10588, 0.48235, 0.94902);
  309. else if (is_shadow) SetMaterialAndSpriteColor_Float(0.35, 0.92157, 0.19608, 0.13725);
  310. else if (is_metal) SetMaterialAndSpriteColor_Float(0.35, 0, 0.11373, 0.54118);
  311. njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL, ((Gauge2-10000) / 100), -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  312. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  313. }
  314. if (Gauge2 >= 20000 && Gauge2 < 30000)
  315. {
  316. if (is_sonic) SetMaterialAndSpriteColor_Float(0.5, 0.10588, 0.48235, 0.94902);
  317. else if (is_shadow) SetMaterialAndSpriteColor_Float(0.5, 0.92157, 0.19608, 0.13725);
  318. else if (is_metal) SetMaterialAndSpriteColor_Float(0.5, 0, 0.11373, 0.54118);
  319. njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL, 99, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  320. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  321. }
  322. if (Gauge2 > 20000 && Gauge2 < 30000)
  323. {
  324. energy_lvl_glow = 0;
  325. if (is_sonic) SetMaterialAndSpriteColor_Float(1, 0.10588, 0.48235, 0.94902);
  326. else if (is_shadow) SetMaterialAndSpriteColor_Float(1, 0.92157, 0.19608, 0.13725);
  327. else if (is_metal) SetMaterialAndSpriteColor_Float(1, 0, 0.11373, 0.54118);
  328. njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL, ((Gauge2 - 20000) / 100), -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  329. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  330. }
  331. else if (Gauge2 >= 30000)
  332. {
  333.  
  334. HUD_SPRITE_ENERGYLVL.p.x = 810 * 1.3f * HorizontalResolution / 1680.0f;
  335. HUD_SPRITE_ENERGYLVL.p.y = 660 * 1.3f * VerticalResolution / 1050.0f;
  336. if (is_sonic) SetMaterialAndSpriteColor_Float(1, 0.10588, 0.48235, 0.94902);
  337. else if (is_shadow) SetMaterialAndSpriteColor_Float(1, 0.92157, 0.19608, 0.13725);
  338. else if (is_metal) SetMaterialAndSpriteColor_Float(1, 0, 0.11373, 0.54118);
  339. njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL, 99, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  340. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  341. HUD_SPRITE_ENERGYLVL_GLOW.p.x = 810 * 1.3f * HorizontalResolution / 1680.0f;
  342. HUD_SPRITE_ENERGYLVL_GLOW.p.y = 660 * 1.3f * VerticalResolution / 1050.0f;
  343. if (Gauge >= 10000)
  344. {
  345. energy_lvl_glow = energy_glow;
  346. if (!glow_down && lvl_glow_down) lvl_glow_down = false;
  347. }
  348. if (energy_lvl_glow <= 20)
  349. {
  350. if (!lvl_glow_down)
  351. {
  352. if (energy_lvl_glow < 20)
  353. {
  354. ++energy_lvl_glow;
  355. SetMaterialAndSpriteColor_Float((0 + energy_lvl_glow) / 20.0f, 1, 1, 1);
  356. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  357. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  358. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  359. }
  360. else if (energy_lvl_glow == 20)
  361. {
  362. energy_lvl_glow = 0;
  363. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  364. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  365. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  366. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  367. lvl_glow_down = true;
  368. }
  369. }
  370. else if (lvl_glow_down)
  371. {
  372. if (energy_lvl_glow < 20)
  373. {
  374. ++energy_lvl_glow;
  375. SetMaterialAndSpriteColor_Float((20 - energy_lvl_glow) / 20.0f, 1, 1, 1);
  376. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  377. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  378. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  379. }
  380. else if (energy_lvl_glow == 20)
  381. {
  382. energy_lvl_glow = 0;
  383. SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
  384. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  385. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  386. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL_GLOW, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  387. lvl_glow_down = false;
  388. }
  389. }
  390. }
  391. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  392. }
  393.  
  394.  
  395.  
  396. //LVL UPS
  397. if (Gauge2 >= 0 && Gauge2 < 10000)
  398. {
  399. LV1_obtained = false;
  400. LV2_obtained = false;
  401. LV3_obtained = false;
  402. LV1_usable = false;
  403. LV2_usable = false;
  404. LV3_usable = false;
  405. lv1_stretch = 0;
  406. lv2_stretch = 0;
  407. lv3_stretch = 0;
  408. }
  409. else if (Gauge2 >= 10000 && Gauge2 < 20000)
  410. {
  411. HUD_SPRITE_LVLUPS.p.x = 810 * 1.3f * HorizontalResolution / 1680.0f;
  412. HUD_SPRITE_LVLUPS.p.y = 660 * 1.3f * VerticalResolution / 1050.0f;
  413. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 9, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  414. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 12, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  415. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 15, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  416. if (Gauge >= 10000)
  417. {
  418. sonic_lv1_glow = energy_glow;
  419. if (!glow_down && sonic_lv1_glow_down) sonic_lv1_glow_down = false;
  420. }
  421. if (sonic_lv1_glow <= 20)
  422. {
  423. if (!sonic_lv1_glow_down)
  424. {
  425. if (sonic_lv1_glow < 20)
  426. {
  427. ++sonic_lv1_glow;
  428. SetMaterialAndSpriteColor_Float((0 + sonic_lv1_glow) / 20.0f, 1, 1, 1);
  429. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  430. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  431. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  432. }
  433. else if (sonic_lv1_glow == 20)
  434. {
  435. sonic_lv1_glow = 0;
  436. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  437. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  438. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  439. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  440. sonic_lv1_glow_down = true;
  441. }
  442. }
  443. else if (sonic_lv1_glow_down)
  444. {
  445. if (sonic_lv1_glow < 20)
  446. {
  447. ++sonic_lv1_glow;
  448. SetMaterialAndSpriteColor_Float((20 - sonic_lv1_glow) / 20.0f, 1, 1, 1);
  449. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  450. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  451. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  452. }
  453. else if (sonic_lv1_glow == 20)
  454. {
  455. sonic_lv1_glow = 0;
  456. SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
  457. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  458. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  459. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  460. sonic_lv1_glow_down = false;
  461. }
  462. }
  463. }
  464. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  465. if (!LV1_obtained)
  466. {
  467. HUD_SPRITE_LVLUPS_GLOW.p.x = 1104 * 1.3f * HorizontalResolution / 1680.0f;
  468. HUD_SPRITE_LVLUPS_GLOW.p.y = 731 * 1.3f * VerticalResolution / 1050.0f;
  469. if (lv1_stretch < 60)
  470. {
  471. if (!LV1_active)
  472. {
  473. LV1_usable = true;
  474. }
  475. ++lv1_stretch;
  476. SetMaterialAndSpriteColor_Float((60 - lv1_stretch) / 60.0f, 1, 1, 1);
  477. HUD_SPRITE_LVLUPS_GLOW.sx = ((60 + (2.0f * lv1_stretch)) / 60.0f) * 1.3f * HorizontalResolution / 1680.0f;
  478. HUD_SPRITE_LVLUPS_GLOW.sy = ((60 + (2.0f * lv1_stretch)) / 60.0f) * 1.3f * VerticalResolution / 1050.0f;
  479. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  480. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS_GLOW, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  481. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS_GLOW, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  482. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  483. }
  484. else if (lv1_stretch == 60)
  485. {
  486. lv1_stretch = 0;
  487. LV1_obtained = true;
  488. }
  489. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  490. }
  491. }
  492. else if (Gauge2 >= 20000 && Gauge2 < 30000)
  493. {
  494. lv1_stretch = 0;
  495. LV1_obtained = false;
  496. sonic_lv1_glow = 0;
  497. sonic_lv1_glow_down = false;
  498. HUD_SPRITE_LVLUPS.p.x = 810 * 1.3f * HorizontalResolution / 1680.0f;
  499. HUD_SPRITE_LVLUPS.p.y = 660 * 1.3f * VerticalResolution / 1050.0f;
  500. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 10, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  501. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 13, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  502. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 16, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  503. if (Gauge >= 10000)
  504. {
  505. sonic_lv2_glow = energy_glow;
  506. if (!glow_down && sonic_lv2_glow_down) sonic_lv2_glow_down = false;
  507. }
  508. if (sonic_lv2_glow <= 20)
  509. {
  510. if (!sonic_lv2_glow_down)
  511. {
  512. if (sonic_lv2_glow < 20)
  513. {
  514. ++sonic_lv2_glow;
  515. SetMaterialAndSpriteColor_Float((0 + sonic_lv2_glow) / 20.0f, 1, 1, 1);
  516. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  517. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 4, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  518. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 7, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  519. }
  520. else if (sonic_lv2_glow == 20)
  521. {
  522. sonic_lv2_glow = 0;
  523. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  524. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  525. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 4, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  526. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 7, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  527. sonic_lv2_glow_down = true;
  528. }
  529. }
  530. else if (sonic_lv2_glow_down)
  531. {
  532. if (sonic_lv2_glow < 20)
  533. {
  534. ++sonic_lv2_glow;
  535. SetMaterialAndSpriteColor_Float((20 - sonic_lv2_glow) / 20.0f, 1, 1, 1);
  536. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  537. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 4, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  538. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 7, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  539. }
  540. else if (sonic_lv2_glow == 20)
  541. {
  542. sonic_lv2_glow = 0;
  543. SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
  544. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  545. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 4, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  546. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 7, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  547. sonic_lv2_glow_down = false;
  548. }
  549. }
  550. }
  551. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  552. if (!LV2_obtained)
  553. {
  554. HUD_SPRITE_LVLUPS_GLOW.p.x = 1119 * 1.3f * HorizontalResolution / 1680.0f;
  555. HUD_SPRITE_LVLUPS_GLOW.p.y = 731 * 1.3f * VerticalResolution / 1050.0f;
  556.  
  557.  
  558. if (lv2_stretch < 60)
  559. {
  560. if (!LV2_active)
  561. {
  562. LV2_usable = true;
  563. }
  564. ++lv2_stretch;
  565. SetMaterialAndSpriteColor_Float((60 - lv2_stretch) / 60.0f, 1, 1, 1);
  566. HUD_SPRITE_LVLUPS_GLOW.sx = ((60 + (2.0f * lv2_stretch)) / 60.0f) * 1.3f * HorizontalResolution / 1680.0f;
  567. HUD_SPRITE_LVLUPS_GLOW.sy = ((60 + (2.0f * lv2_stretch)) / 60.0f) * 1.3f * VerticalResolution / 1050.0f;
  568. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  569. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS_GLOW, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  570. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS_GLOW, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  571. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  572. }
  573. else if (lv2_stretch == 60)
  574. {
  575. lv2_stretch = 0;
  576. LV2_obtained = true;
  577. }
  578. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  579. }
  580. }
  581. else if (Gauge2 >= 30000)
  582. {
  583. lv1_stretch = 0;
  584. lv2_stretch = 0;
  585. LV1_obtained = false;
  586. LV2_obtained = false;
  587. LV1_usable = false;
  588. LV2_usable = false;
  589. sonic_lv1_glow = 0;
  590. sonic_lv1_glow_down = false;
  591. sonic_lv2_glow = 0;
  592. sonic_lv2_glow_down = false;
  593. HUD_SPRITE_LVLUPS.p.x = 810 * 1.3f * HorizontalResolution / 1680.0f;
  594. HUD_SPRITE_LVLUPS.p.y = 660 * 1.3f * VerticalResolution / 1050.0f;
  595. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 11, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  596. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 14, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  597. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 17, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  598. if (Gauge >= 10000)
  599. {
  600. sonic_lv3_glow = energy_glow;
  601. if (!glow_down && sonic_lv3_glow_down) sonic_lv3_glow_down = false;
  602. }
  603. if (sonic_lv3_glow <= 20)
  604. {
  605. if (!sonic_lv3_glow_down)
  606. {
  607. if (sonic_lv3_glow < 20)
  608. {
  609. ++sonic_lv3_glow;
  610. SetMaterialAndSpriteColor_Float((0 + sonic_lv3_glow) / 20.0f, 1, 1, 1);
  611. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  612. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 5, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  613. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 8, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  614. }
  615. else if (sonic_lv3_glow == 20)
  616. {
  617. sonic_lv3_glow = 0;
  618. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  619. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  620. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 5, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  621. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 8, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  622. sonic_lv3_glow_down = true;
  623. }
  624. }
  625. else if (sonic_lv3_glow_down)
  626. {
  627. if (sonic_lv3_glow < 20)
  628. {
  629. ++sonic_lv3_glow;
  630. SetMaterialAndSpriteColor_Float((20 - sonic_lv3_glow) / 20.0f, 1, 1, 1);
  631. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  632. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 5, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  633. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 8, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  634. }
  635. else if (sonic_lv3_glow == 20)
  636. {
  637. sonic_lv3_glow = 0;
  638. SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
  639. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  640. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 5, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  641. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 8, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  642. sonic_lv3_glow_down = false;
  643. }
  644. }
  645. }
  646. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  647. if (!LV3_obtained)
  648. {
  649. HUD_SPRITE_LVLUPS_GLOW.p.x = 1134 * 1.3f * HorizontalResolution / 1680.0f;
  650. HUD_SPRITE_LVLUPS_GLOW.p.y = 731 * 1.3f * VerticalResolution / 1050.0f;
  651.  
  652.  
  653. if (lv3_stretch < 60)
  654. {
  655. if (!LV3_active)
  656. {
  657. LV3_usable = true;
  658. }
  659. ++lv3_stretch;
  660. SetMaterialAndSpriteColor_Float((60 - lv3_stretch) / 60.0f, 1, 1, 1);
  661. HUD_SPRITE_LVLUPS_GLOW.sx = ((60 + (2.0f * lv3_stretch)) / 60.0f) * 1.3f * HorizontalResolution / 1680.0f;
  662. HUD_SPRITE_LVLUPS_GLOW.sy = ((60 + (2.0f * lv3_stretch)) / 60.0f) * 1.3f * VerticalResolution / 1050.0f;
  663. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS_GLOW, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  664. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS_GLOW, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  665. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS_GLOW, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  666. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  667. }
  668. else if (lv3_stretch == 60)
  669. {
  670. lv3_stretch = 0;
  671. LV3_obtained = true;
  672. }
  673. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  674. }
  675. }
  676.  
  677.  
  678. //LEVEL ACTIVATION
  679. if (GameState != 16)
  680. {
  681. if (LV1_usable && !LV2_usable && !LV3_usable)
  682. {
  683. if (ControllerPointers[0]->PressedButtons & Buttons_B)
  684. {
  685. PlaySound(1250, 0, 0, 0);
  686. LV1_obtained = false;
  687. LV1_usable = false;
  688. LV1_active = true;
  689. Gauge2 = 9999;
  690. sonic_lv1_glow = 0;
  691. sonic_lv2_glow = 0;
  692. sonic_lv3_glow = 0;
  693. lvl_glow_down = false;
  694. sonic_lv1_glow_down = false;
  695. sonic_lv2_glow_down = false;
  696. sonic_lv3_glow_down = false;
  697. star_glow = 0;
  698. circle_glow = 0;
  699. level3_glow = 0;
  700. }
  701. }
  702. }
  703. if (LV1_active)
  704. {
  705. if (GameState != 16)
  706. {
  707. ++stop_active_lvl;
  708. Gauge2 -= 8;
  709. if (stop_active_lvl == 1250)
  710. {
  711. stop_active_lvl = 0;
  712. LV1_active = false;
  713. PlaySound(1247, 0, 0, 0);
  714. }
  715. //3D HUD
  716. ParticleDepthOverride = 2000.0f;
  717. if (star_glow < 10)
  718. {
  719. ++star_glow;
  720. SetMaterialAndSpriteColor_Float((10 - star_glow) / 10.0f, 1, 1, 1);
  721. HUD3D_SPRITE_STAR.sx = ((3 + (star_glow / 2.0f)) / 10.0f) * 1.3f * HorizontalResolution / 1680.0f;
  722. HUD3D_SPRITE_STAR.sy = ((3 + (star_glow / 2.0f)) / 10.0f) * 1.3f * VerticalResolution / 1050.0f;
  723. njDrawSprite3D(&HUD3D_SPRITE_STAR, 0, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
  724. }
  725. else if (star_glow == 10)
  726. {
  727. star_glow = 0;
  728. SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
  729. HUD3D_SPRITE_STAR.sx = 1.3f * HorizontalResolution / 1680.0f;
  730. HUD3D_SPRITE_STAR.sy = 1.3f * VerticalResolution / 1050.0f;
  731. njDrawSprite3D(&HUD3D_SPRITE_STAR, 0, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
  732. }
  733. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  734. ParticleDepthOverride = 0.0f;
  735. }
  736.  
  737. //2D HUD
  738.  
  739. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 9, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  740. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 12, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  741. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 15, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  742. if (sonic_lv1_glow <= 2)
  743. {
  744. if (!sonic_lv1_glow_down)
  745. {
  746. if (sonic_lv1_glow < 2)
  747. {
  748. ++sonic_lv1_glow;
  749. SetMaterialAndSpriteColor_Float((0 + sonic_lv1_glow) / 2.0f, 1, 1, 1);
  750. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  751. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  752. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  753. }
  754. else if (sonic_lv1_glow == 2)
  755. {
  756. sonic_lv1_glow = 0;
  757. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  758. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  759. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  760. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  761. sonic_lv1_glow_down = true;
  762. }
  763. }
  764. else if (sonic_lv1_glow_down)
  765. {
  766. if (sonic_lv1_glow < 2)
  767. {
  768. ++sonic_lv1_glow;
  769. SetMaterialAndSpriteColor_Float((2 - sonic_lv1_glow) / 2.0f, 1, 1, 1);
  770. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  771. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  772. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  773. }
  774. else if (sonic_lv1_glow == 2)
  775. {
  776. sonic_lv1_glow = 0;
  777. SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
  778. if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  779. else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 3, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  780. else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  781. sonic_lv1_glow_down = false;
  782. }
  783. }
  784. }
  785. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  786. }
  787. if (GameState != 16)
  788. {
  789. if (LV3_usable)
  790. {
  791. if (ControllerPointers[0]->PressedButtons & Buttons_B)
  792. {
  793. PlaySound(1250, 0, 0, 0);
  794. LV1_obtained = false;
  795. LV2_obtained = false;
  796. LV3_obtained = false;
  797. LV1_usable = false;
  798. LV2_usable = false;
  799. LV3_usable = false;
  800. LV3_active = true;
  801. Gauge2 = 9999;
  802. sonic_lv1_glow = 0;
  803. sonic_lv2_glow = 0;
  804. sonic_lv3_glow = 0;
  805. lvl_glow_down = false;
  806. sonic_lv1_glow_down = false;
  807. sonic_lv2_glow_down = false;
  808. sonic_lv3_glow_down = false;
  809. star_glow = 0;
  810. circle_glow = 0;
  811. level3_glow = 0;
  812. }
  813. }
  814. }
  815. if (LV3_active)
  816. {
  817. if (GameState != 16)
  818. {
  819. //REPUT THAT START***************
  820. //++stop_active_lvl;
  821. //Gauge2 -= 8;
  822. //Gauge += 8;
  823. //if (stop_active_lvl == 1250)
  824. //{
  825. // stop_active_lvl = 0;
  826. // LV3_active = false;
  827. // sparkles.clear();
  828. // sparkletimer = 0;
  829. // PlaySound(1247, 0, 0, 0);
  830. //}
  831. ////3D HUD
  832. //ParticleDepthOverride = 2000.0f;
  833. //if (star_glow < 10)
  834. //{
  835. // ++star_glow;
  836. // SetMaterialAndSpriteColor_Float((10 - star_glow) / 10.0f, 1, 1, 1);
  837. // HUD3D_SPRITE_STAR.sx = ((3 + (star_glow / 2.0f)) / 10.0f) * 1.3f * HorizontalResolution / 1680.0f;
  838. // HUD3D_SPRITE_STAR.sy = ((3 + (star_glow / 2.0f)) / 10.0f) * 1.3f * VerticalResolution / 1050.0f;
  839. // njDrawSprite3D(&HUD3D_SPRITE_STAR, 0, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
  840. //}
  841. //else if (star_glow == 10)
  842. //{
  843. // star_glow = 0;
  844. // SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
  845. // HUD3D_SPRITE_STAR.sx = 1.3f * HorizontalResolution / 1680.0f;
  846. // HUD3D_SPRITE_STAR.sy = 1.3f * VerticalResolution / 1050.0f;
  847. // njDrawSprite3D(&HUD3D_SPRITE_STAR, 0, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
  848. //}
  849. //SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  850. //if (circle_glow < 14)
  851. //{
  852. // ++circle_glow;
  853. // SetMaterialAndSpriteColor_Float((14 - circle_glow) / 14.0f, 1, 1, 1);
  854. // HUD3D_SPRITE_CIRCLE.sx = (circle_glow / 14.0f) * 1.3f * HorizontalResolution / 1680.0f;
  855. // HUD3D_SPRITE_CIRCLE.sy = (circle_glow / 14.0f) * 1.3f * VerticalResolution / 1050.0f;
  856. // njDrawSprite3D(&HUD3D_SPRITE_CIRCLE, 1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
  857. //}
  858. //else if (circle_glow == 14)
  859. //{
  860. // SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
  861. // HUD3D_SPRITE_CIRCLE.sx = 1.3f * HorizontalResolution / 1680.0f;
  862. // HUD3D_SPRITE_CIRCLE.sy = 1.3f * VerticalResolution / 1050.0f;
  863. // njDrawSprite3D(&HUD3D_SPRITE_CIRCLE, 1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR | NJD_SPRITE_SCALE);
  864. // ++circle_glow;
  865. //}
  866. //else if (circle_glow > 14)
  867. //{
  868. // if (++circle_glow == 20)
  869. // {
  870. // circle_glow = 0;
  871. // }
  872. //}
  873. //SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  874. //REPUT THAT END***************
  875.  
  876.  
  877. //Level 3 sparkles*********************************************************************************************************
  878. //ParticleDepthOverride = 0.0f;
  879. //EntityData1 *co1 = EntityData1Ptrs[0];
  880. //for (auto it = sparkles.begin(); it != sparkles.end(); )
  881. //{
  882. // sparklesprite.p = it->pos;
  883. // njDrawSprite3D_Queue(&sparklesprite, 5 + (it->frame++ / 2), NJD_SPRITE_ALPHA | NJD_SPRITE_SCALE, (QueuedModelFlagsB)0);
  884.  
  885. // if (it->frame >= 16)
  886. // it = sparkles.erase(it);
  887. // else
  888. // ++it;
  889. //}
  890. //if (++sparkletimer == 3)
  891. //{
  892. // sparkledata sp = {};
  893. // NJS_VECTOR pos = { 0, ((float)rand() / RAND_MAX) * 8.0, 0 };
  894. // njPushMatrix(nullptr);
  895. // njRotateX(nullptr, rand() & 0xFFFF);
  896. // njRotateY(nullptr, rand() & 0xFFFF);
  897. // njRotateZ(nullptr, rand() & 0xFFFF);
  898. // njCalcVector(nullptr, &pos, &sp.pos);
  899. // njPopMatrix(1);
  900. // sp.pos.x += co1->CollisionInfo->CollisionArray->origin.x;
  901. // sp.pos.y += co1->CollisionInfo->CollisionArray->origin.y;
  902. // sp.pos.z += co1->CollisionInfo->CollisionArray->origin.z;
  903. // sparkles.push_back(sp);
  904. // sparkletimer = 0;
  905. //}
  906. //SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  907. //*************************************************************************************************************************
  908.  
  909. if (ControllerPointers[0]->PressedButtons & Buttons_Left)
  910. {
  911. draw = 0;
  912. }
  913. if (ControllerPointers[0]->PressedButtons & Buttons_Right)
  914. {
  915. draw = 1;
  916. }
  917. if (ControllerPointers[0]->PressedButtons & Buttons_Down)
  918. {
  919. draw = 2;
  920. }
  921. if (ControllerPointers[0]->PressedButtons & Buttons_Up)
  922. {
  923. draw = 3;
  924. }
  925. if (ControllerPointers[0]->PressedButtons & Buttons_C)
  926. {
  927. draw = 4;
  928. }
  929. if (ControllerPointers[0]->PressedButtons & Buttons_Z)
  930. {
  931. draw = 5;
  932. }
  933. if (ControllerPointers[0]->PressedButtons & Buttons_D)
  934. {
  935. draw = 6;
  936. }
  937. //njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_INVSRCALPHA);
  938. //njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_ONE);
  939. njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_SRCCOLOR);
  940. njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_INVSRCALPHA);
  941. njTextureShadingMode(NJD_TEX_SHADING_MODE_DECALALPHA);
  942. //Metal Sonic Gems Sparkles
  943. //Big ones
  944. ParticleDepthOverride = 0.0f;
  945. EntityData1 *co1 = EntityData1Ptrs[0];
  946. for (auto it = sparklesgems.begin(); it != sparklesgems.end(); )
  947. {
  948. NJS_VECTOR pos = { 0, it->radius, 0 };
  949. njPushMatrix(nullptr);
  950. njRotateX(nullptr, it->rotation.x);
  951. njRotateY(nullptr, it->rotation.y);
  952. njRotateZ(nullptr, it->rotation.z);
  953. njCalcVector(nullptr, &pos, &sparklegemssprite.p);
  954. njPopMatrix(1);
  955. sparklegemssprite.p.x += it->pos.x;
  956. sparklegemssprite.p.y += it->pos.y;
  957. sparklegemssprite.p.z += it->pos.z;
  958. if (it->framegems < 11)
  959. {
  960. SetMaterialAndSpriteColor_Float((11 - it->framegems) / 11.0f, 1, 1, 1);
  961. sparklegemssprite.sx = ((22 - it->framegems) / 22.0f) * 0.4f * 1.3f * HorizontalResolution / 1680.0f;
  962. sparklegemssprite.sy = ((22 - it->framegems) / 22.0f) * 0.4f * 1.3f * VerticalResolution / 1050.0f;
  963. njDrawSprite3D_Queue(&sparklegemssprite, (2*draw), NJD_SPRITE_ALPHA | NJD_SPRITE_SCALE, (QueuedModelFlagsB)0);
  964. }
  965. it->framegems++;
  966. if (it->framegems >= 11)
  967. it = sparklesgems.erase(it);
  968. else
  969. {
  970. it->radius += 0.15f;
  971. ++it;
  972. }
  973. }
  974. if (++sparklegemstimer == 10)
  975. {
  976. sparklegemsdata sp = {};
  977. //sp.radius = ((float)rand() / RAND_MAX) * 8.0;//if I wanted them to spawn in the center
  978. sp.radius = (((float)rand() / RAND_MAX) * 3.0) + 4.0;//sp.radius = (((float)rand() / RAND_MAX) * max_radius) + min_radius; //if min_radius is 2, and max_radius is 3, then the sparkles will spawn between 2 and 5 (2+3) away
  979. sp.rotation.x = rand() & 0xFFFF;
  980. sp.rotation.y = rand() & 0xFFFF;
  981. sp.rotation.z = rand() & 0xFFFF;
  982. sp.pos = co1->CollisionInfo->CollisionArray->origin;
  983. sparklesgems.push_back(sp);
  984. sparklegemstimer = 0;
  985. }
  986. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  987.  
  988. //Small ones
  989. ParticleDepthOverride = 0.0f;
  990. for (auto it = sparklesgems_tiny.begin(); it != sparklesgems_tiny.end(); )
  991. {
  992. NJS_VECTOR pos = { 0, it->radius, 0 };
  993. njPushMatrix(nullptr);
  994. njRotateX(nullptr, it->rotation.x);
  995. njRotateY(nullptr, it->rotation.y);
  996. njRotateZ(nullptr, it->rotation.z);
  997. njCalcVector(nullptr, &pos, &sparklegemssprite.p);
  998. njPopMatrix(1);
  999. sparklegemssprite.p.x += it->pos.x;
  1000. sparklegemssprite.p.y += it->pos.y;
  1001. sparklegemssprite.p.z += it->pos.z;
  1002. if (it->framegems_tiny < 11)
  1003. {
  1004. SetMaterialAndSpriteColor_Float((11 - it->framegems_tiny) / 11.0f, 1, 1, 1);
  1005. sparklegemssprite.sx = ((22 - it->framegems_tiny) / 22.0f) * 0.025f * 1.3f * HorizontalResolution / 1680.0f;
  1006. sparklegemssprite.sy = ((22 - it->framegems_tiny) / 22.0f) * 0.025f * 1.3f * VerticalResolution / 1050.0f;
  1007. njDrawSprite3D_Queue(&sparklegemssprite, ((2*draw) + 1), NJD_SPRITE_ALPHA | NJD_SPRITE_SCALE, (QueuedModelFlagsB)0);
  1008. }
  1009. it->framegems_tiny++;
  1010. if (it->framegems_tiny >= 15)
  1011. it = sparklesgems_tiny.erase(it);
  1012. else
  1013. {
  1014. it->radius += 0.075f;
  1015. ++it;
  1016. }
  1017. }
  1018. if (++sparklegems_tiny_timer == 3)
  1019. {
  1020. sparklegemsdata sp = {};
  1021. sp.radius = (((float)rand() / RAND_MAX) * 2.0) + 2.5;
  1022. sp.rotation.x = rand() & 0xFFFF;
  1023. sp.rotation.y = rand() & 0xFFFF;
  1024. sp.rotation.z = rand() & 0xFFFF;
  1025. sp.pos = co1->CollisionInfo->CollisionArray->origin;
  1026. sparklesgems_tiny.push_back(sp);
  1027. sparklegems_tiny_timer = 0;
  1028. }
  1029. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  1030. njColorBlendingMode(NJD_SOURCE_COLOR, NJD_COLOR_BLENDING_SRCALPHA);
  1031. njColorBlendingMode(NJD_DESTINATION_COLOR, NJD_COLOR_BLENDING_INVSRCALPHA);
  1032. njTextureShadingMode(NJD_TEX_SHADING_MODE_DECALALPHA);
  1033.  
  1034.  
  1035. //////////////////Hyper Sonic S3&K like Sparkles ??
  1036. //////////////////ParticleDepthOverride = 0.0f;
  1037. //////////////////EntityData1 *co1 = EntityData1Ptrs[0];
  1038. //////////////////for (auto it = sparklesgems.begin(); it != sparklesgems.end(); )
  1039. //////////////////{
  1040. ////////////////// NJS_VECTOR pos = { 0, it->radius, 0 };
  1041. ////////////////// njPushMatrix(nullptr);
  1042. ////////////////// njRotateX(nullptr, it->rotation.x);
  1043. ////////////////// njRotateY(nullptr, it->rotation.y);
  1044. ////////////////// njRotateZ(nullptr, it->rotation.z);
  1045. ////////////////// njCalcVector(nullptr, &pos, &sparklesprite.p);
  1046. ////////////////// njPopMatrix(1);
  1047. ////////////////// sparklesprite.p.x += co1->CollisionInfo->CollisionArray->origin.x;
  1048. ////////////////// sparklesprite.p.y += co1->CollisionInfo->CollisionArray->origin.y;
  1049. ////////////////// sparklesprite.p.z += co1->CollisionInfo->CollisionArray->origin.z;
  1050. ////////////////// njDrawSprite3D_Queue(&sparklesprite, 5, NJD_SPRITE_ALPHA | NJD_SPRITE_SCALE, (QueuedModelFlagsB)0);
  1051. ////////////////// it->frame++;
  1052. ////////////////// if (it->frame >= 16)
  1053. ////////////////// it = sparklesgems.erase(it);
  1054. ////////////////// else
  1055. ////////////////// {
  1056. ////////////////// it->rotation.x = (it->rotation.x + it->speed.x) & 0xFFFF;
  1057. ////////////////// it->rotation.y = (it->rotation.y + it->speed.y) & 0xFFFF;
  1058. ////////////////// it->rotation.z = (it->rotation.z + it->speed.z) & 0xFFFF;
  1059. ////////////////// ++it;
  1060. ////////////////// }
  1061. //////////////////}
  1062. //////////////////if (++sparkletimer == 3)
  1063. //////////////////{
  1064. ////////////////// sparklegemsdata sp = {};
  1065. ////////////////// sp.radius = ((float)rand() / RAND_MAX) * 8.0;
  1066. ////////////////// sp.rotation.x = rand() & 0xFFFF;
  1067. ////////////////// sp.rotation.y = rand() & 0xFFFF;
  1068. ////////////////// sp.rotation.z = rand() & 0xFFFF;
  1069. ////////////////// sp.speed.x = (rand() & 0xFFF) - 0x800;
  1070. ////////////////// sp.speed.y = (rand() & 0xFFF) - 0x800;
  1071. ////////////////// sp.speed.z = (rand() & 0xFFF) - 0x800;
  1072. ////////////////// sparklesgems.push_back(sp);
  1073. ////////////////// sparkletimer = 0;
  1074. //////////////////}
  1075. //////////////////SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  1076. }
  1077.  
  1078.  
  1079. //REPUT THAT START***************
  1080. //if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 11, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1081. //else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 14, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1082. //else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 17, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1083. //if (sonic_lv3_glow <= 2)
  1084. //{
  1085. // if (!sonic_lv3_glow_down)
  1086. // {
  1087. // if (sonic_lv3_glow < 2)
  1088. // {
  1089. // ++sonic_lv3_glow;
  1090. // SetMaterialAndSpriteColor_Float((0 + sonic_lv3_glow) / 2.0f, 1, 1, 1);
  1091. // if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1092. // else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 5, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1093. // else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 8, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1094. // }
  1095. // else if (sonic_lv3_glow == 2)
  1096. // {
  1097. // sonic_lv3_glow = 0;
  1098. // SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  1099. // if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1100. // else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 5, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1101. // else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 8, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1102. // sonic_lv3_glow_down = true;
  1103. // }
  1104. // }
  1105. // else if (sonic_lv3_glow_down)
  1106. // {
  1107. // if (sonic_lv3_glow < 2)
  1108. // {
  1109. // ++sonic_lv3_glow;
  1110. // SetMaterialAndSpriteColor_Float((2 - sonic_lv3_glow) / 2.0f, 1, 1, 1);
  1111. // if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1112. // else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 5, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1113. // else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 8, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1114. // }
  1115. // else if (sonic_lv3_glow == 2)
  1116. // {
  1117. // sonic_lv3_glow = 0;
  1118. // SetMaterialAndSpriteColor_Float(0, 1, 1, 1);
  1119. // if (is_sonic) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 2, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1120. // else if (is_shadow) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 5, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1121. // else if (is_metal) njDrawSprite2D_Queue(&HUD_SPRITE_LVLUPS, 8, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1122. // sonic_lv3_glow_down = false;
  1123. // }
  1124. // }
  1125. //}
  1126. //SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  1127. //if (is_sonic) SetMaterialAndSpriteColor_Float(0.75, 0.10588, 0.48235, 0.94902);
  1128. //else if (is_shadow) SetMaterialAndSpriteColor_Float(0.75, 0.92157, 0.19608, 0.13725);
  1129. //else if (is_metal) SetMaterialAndSpriteColor_Float(0.75, 0, 0.11373, 0.54118);
  1130. //njDrawSprite2D_Queue(&HUD_SPRITE_ENERGYLVL, (Gauge2 / 100), -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1131. //SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  1132. //REPUT THAT END***************
  1133.  
  1134.  
  1135. }
  1136. }
  1137.  
  1138. else if (GetCharacterID(0) == Characters_Tails)
  1139. {
  1140. HUD_SPRITE.p.x = 110 * 1.3f * HorizontalResolution / 1680.0f;
  1141. HUD_SPRITE.p.y = 205 * 1.3f * VerticalResolution / 1050.0f;
  1142. njDrawSprite2D_Queue(&HUD_SPRITE, 5, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1143. }
  1144. else if (GetCharacterID(0) == Characters_Knuckles)
  1145. {
  1146. HUD_SPRITE.p.x = 110 * 1.3f * HorizontalResolution / 1680.0f;
  1147. HUD_SPRITE.p.y = 205 * 1.3f * VerticalResolution / 1050.0f;
  1148. njDrawSprite2D_Queue(&HUD_SPRITE, 6, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1149. }
  1150. else if (GetCharacterID(0) == Characters_Amy)
  1151. {
  1152. HUD_SPRITE.p.x = 110 * 1.3f * HorizontalResolution / 1680.0f;
  1153. HUD_SPRITE.p.y = 205 * 1.3f * VerticalResolution / 1050.0f;
  1154. njDrawSprite2D_Queue(&HUD_SPRITE, 7, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1155. }
  1156. else if (GetCharacterID(0) == Characters_Gamma)
  1157. {
  1158. HUD_SPRITE.p.x = 110 * 1.3f * HorizontalResolution / 1680.0f;
  1159. HUD_SPRITE.p.y = 205 * 1.3f * VerticalResolution / 1050.0f;
  1160. njDrawSprite2D_Queue(&HUD_SPRITE, 8, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1161. }
  1162.  
  1163.  
  1164. //Ring Counter
  1165. HUD_SPRITE_NUMBERS.p.x = 157 * 1.3f * HorizontalResolution / 1680.0f;
  1166. HUD_SPRITE_NUMBERS.p.y = 174 * 1.3f * VerticalResolution / 1050.0f;
  1167. HUD_SPRITE_RINGS_0_RED.p.x = (HUD_SPRITE_NUMBERS.p.x/1.3f) + (55 * HorizontalResolution / 1680.0f);
  1168. HUD_SPRITE_RINGS_0_RED.p.y = (HUD_SPRITE_NUMBERS.p.y/1.3f) + (42 * VerticalResolution / 1050.0f);
  1169. if (Rings == 0)
  1170. {
  1171. njDrawSprite2D_Queue(&HUD_SPRITE_RINGS_0_RED, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1172. ++zero_ring_alpha;
  1173. SetMaterialAndSpriteColor_Float((9 - zero_ring_alpha) / 9.0f, 1, 1, 1);
  1174. njDrawSprite2D_Queue(&HUD_SPRITE_RINGS_0_RED, 1, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1175. SetMaterialAndSpriteColor_Float(1, 1, 1, 1);
  1176. if (zero_ring_alpha == 9)
  1177. {
  1178. zero_ring_alpha = 0;
  1179. }
  1180. }
  1181. else if (Rings > 0 && Rings < 1000)
  1182. {
  1183. HudDisplayZerosSTH06(Rings, 3, &HUD_SPRITE_NUMBERS);
  1184. zero_ring_alpha = 0;
  1185. }
  1186. else if (Rings >= 1000)
  1187. {
  1188. HudDisplayZerosSTH06(Rings, 4, &HUD_SPRITE_NUMBERS);
  1189. zero_ring_alpha = 0;
  1190. }
  1191. HUD_SPRITE_RING_ANIM.p.x = 161 * HorizontalResolution / 1680.0f;
  1192. HUD_SPRITE_RING_ANIM.p.y = 225 * VerticalResolution / 1050.0f;
  1193. if (Rings - OldRingsHUD > 0)
  1194. {
  1195. can_animate_loss = 0;
  1196. ++can_animate_gain;
  1197. njDrawSprite2D_Queue(&HUD_SPRITE_RING_ANIM, can_animate_gain, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1198. if (can_animate_gain == 7)
  1199. {
  1200. OldRingsHUD = Rings;
  1201. can_animate_gain = 0;
  1202. }
  1203. }
  1204. else if (Rings - OldRingsHUD < 0)
  1205. {
  1206. can_animate_gain = 0;
  1207. ++can_animate_loss;
  1208. njDrawSprite2D_Queue(&HUD_SPRITE_RING_ANIM, 8 - can_animate_loss, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1209. if (can_animate_loss == 7)
  1210. {
  1211. OldRingsHUD = Rings;
  1212. can_animate_loss = 0;
  1213. }
  1214. }
  1215. else if (OldRingsHUD == Rings)
  1216. {
  1217. njDrawSprite2D_Queue(&HUD_SPRITE_RING_ANIM, 0, -1, NJD_SPRITE_ALPHA | NJD_SPRITE_COLOR, (QueuedModelFlagsB)0);
  1218. }
  1219.  
  1220. //Timer Minutes
  1221. HUD_SPRITE_NUMBERS.p.x = (130.846 * 1.3f * HorizontalResolution / 1680.0f);
  1222. HUD_SPRITE_NUMBERS.p.y = (124 * 1.3f * VerticalResolution / 1050.0f);
  1223. HudDisplayZerosSTH06(TimeMinutes, 2, &HUD_SPRITE_NUMBERS);
  1224.  
  1225. //Timer Seconds
  1226. HUD_SPRITE_NUMBERS.p.x = HUD_SPRITE_NUMBERS.p.x + (35 *1.3f * HorizontalResolution / ( 1680.0f));
  1227. HUD_SPRITE_NUMBERS.p.y = HUD_SPRITE_NUMBERS.p.y;
  1228. HudDisplayZerosSTH06(TimeSeconds, 2, &HUD_SPRITE_NUMBERS);
  1229.  
  1230. //Timer Frames
  1231. HUD_SPRITE_NUMBERS.p.x = HUD_SPRITE_NUMBERS.p.x + (37 *1.3f * HorizontalResolution / ( 1680.0f));
  1232. HUD_SPRITE_NUMBERS.p.y = HUD_SPRITE_NUMBERS.p.y;
  1233. HudDisplayFramesSTH06(TimeFrames, 3, &HUD_SPRITE_NUMBERS);
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240. //Lives Counter
  1241. HUD_SPRITE_NUMBERS.p.y = 224 * 1.3f * VerticalResolution / 1050.0f;
  1242. if (Lives < 10)
  1243. {
  1244. HUD_SPRITE_NUMBERS.p.x = 194.538 * 1.3f * HorizontalResolution / 1680.0f;
  1245. HudDisplayNoZerosSTH06(Lives, 1, &HUD_SPRITE_NUMBERS);
  1246. }
  1247. else if (Lives >= 10)
  1248. {
  1249. HUD_SPRITE_NUMBERS.p.x = 176.538 * 1.3f * HorizontalResolution / 1680.0f;
  1250. HudDisplayNoZerosSTH06(Lives, 2, &HUD_SPRITE_NUMBERS);
  1251. }
  1252.  
  1253.  
  1254.  
  1255.  
  1256. //Score Counter
  1257. HUD_SPRITE_NUMBERS.p.y = 71.692 * 1.3f * VerticalResolution / 1050.0f;
  1258. if (EnemyBonus < 10)
  1259. {
  1260. HUD_SPRITE_NUMBERS.p.x = 274.692 * 1.3f * HorizontalResolution / 1680.0f;
  1261. HudDisplayNoZerosSTH06(EnemyBonus, 1, &HUD_SPRITE_NUMBERS);
  1262. }
  1263. else if (EnemyBonus >= 10 && EnemyBonus < 100)
  1264. {
  1265. HUD_SPRITE_NUMBERS.p.x = 256.692 * 1.3f * HorizontalResolution / 1680.0f;
  1266. HudDisplayNoZerosSTH06(EnemyBonus, 2, &HUD_SPRITE_NUMBERS);
  1267. }
  1268. else if (EnemyBonus >= 100 && EnemyBonus < 1000)
  1269. {
  1270. HUD_SPRITE_NUMBERS.p.x = 238.692 * 1.3f * HorizontalResolution / 1680.0f;
  1271. HudDisplayNoZerosSTH06(EnemyBonus, 3, &HUD_SPRITE_NUMBERS);
  1272. }
  1273. else if (EnemyBonus >= 1000 && EnemyBonus < 10000)
  1274. {
  1275. HUD_SPRITE_NUMBERS.p.x = 220.692 * 1.3f * HorizontalResolution / 1680.0f;
  1276. HudDisplayNoZerosSTH06(EnemyBonus, 4, &HUD_SPRITE_NUMBERS);
  1277. }
  1278. else if (EnemyBonus >= 10000 && EnemyBonus < 100000)
  1279. {
  1280. HUD_SPRITE_NUMBERS.p.x = 202.692 * 1.3f * HorizontalResolution / 1680.0f;
  1281. HudDisplayNoZerosSTH06(EnemyBonus, 5, &HUD_SPRITE_NUMBERS);
  1282. }
  1283. else if (EnemyBonus >= 100000 && EnemyBonus < 1000000)
  1284. {
  1285. HUD_SPRITE_NUMBERS.p.x = 184.692 * 1.3f * HorizontalResolution / 1680.0f;
  1286. HudDisplayNoZerosSTH06(EnemyBonus, 6, &HUD_SPRITE_NUMBERS);
  1287. }
  1288. else if (EnemyBonus >= 1000000 && EnemyBonus < 10000000)
  1289. {
  1290. HUD_SPRITE_NUMBERS.p.x = 166.692 * 1.3f * HorizontalResolution / 1680.0f;
  1291. HudDisplayNoZerosSTH06(EnemyBonus, 7, &HUD_SPRITE_NUMBERS);
  1292. }
  1293. else if (EnemyBonus >= 10000000 && EnemyBonus < 100000000)
  1294. {
  1295. HUD_SPRITE_NUMBERS.p.x = 148.692 * 1.3f * HorizontalResolution / 1680.0f;
  1296. HudDisplayNoZerosSTH06(EnemyBonus, 8, &HUD_SPRITE_NUMBERS);
  1297. }
  1298. else
  1299. {
  1300. HUD_SPRITE_NUMBERS.p.x = 130.692 * 1.3f * HorizontalResolution / 1680.0f;
  1301. HudDisplayNoZerosSTH06(EnemyBonus, 9, &HUD_SPRITE_NUMBERS);
  1302. }
  1303. }
  1304. }
  1305. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement