Advertisement
Benji23245

Untitled

Jun 13th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.79 KB | None | 0 0
  1. // Basics.cpp : Defines the exported functions for the DLL application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "SADXModLoader.h"
  6. #include "44mdlmodified.h"
  7. #include "44mdlorig.h"
  8. #include <cstdlib>
  9.  
  10. DataPointer(int, EnemyBonus, 0x3B0F104);
  11.  
  12. extern "C"
  13. {
  14. __declspec(dllexport) ModInfo SADXModInfo = { ModLoaderVer };
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25. //-------------------------------------------------------- SONIC THE HEDGEHOG --------------------------------------------------------------------------
  26.  
  27. //OnFrame variables
  28. bool r = false;
  29. bool fall_after_roll = false;
  30. bool homing = false;
  31. bool in_air_after_homing = false;
  32. bool dashing = false;
  33. bool no_longer_dashing = false;
  34. bool was_on_trampoline = false;
  35. bool was_invincible_before = false;
  36. bool LightDash_SuperDash_ON = false;
  37. bool just_flipped = false;
  38. bool just_spindashed = false;
  39. bool no_light_attack = false;
  40.  
  41. char balldata[] = { 0xBD, 0x20, 0, 0, 0 };
  42. char HangTimeCheckData[] = { 0x3B, 0x90, 0x9C, 0, 0, 0 };
  43. char LightDash_unNOP[] = { 0xC6, 0x06, 0x06, 0x33, 0xD2 };
  44. //char LightDashSpeed_unNOP[] = { 0xC7, 0x47, 0x38, 0, 0, 0, 0 }; //this controls the "NoRing LightDash" speed
  45. //char LightDashAnim_unNOP[] = { 0x66, 0xC7, 0x87, 0x24, 0x1, 0, 0, 0x40, 0 };
  46. char StompAnim[] = { 0x66, 0xC7, 0x87, 0x24, 0x01, 0, 0, 0x40, 0 };
  47.  
  48. ObjectMaster *auraobj = nullptr;
  49. ObjectMaster *trailobj = nullptr;
  50.  
  51. float ChaosBoostLv1 = 8.0f;
  52. float SuperDash = 8.0f;
  53. float SuperTornado = 16.0f;
  54. float LightDash_SuperDash = -1.0f;
  55. float Boost_SuperTornado = -1.0f;
  56. float LightAttackStatic = 0.0f;
  57. float LightAttackMoving = 10.0f;
  58. float SuperLightAttackMoving = 16.0f;
  59.  
  60. // float TEST = 10.0f;
  61. // float LSStest1 = 3.0f;
  62. // float LSStest2 = 4.0f;
  63.  
  64. int LightAttackTimer = 0;
  65. int HangTimeLikeHeroes = 0;
  66. int OldEnemyBonus;
  67. int SpeedShoesCount = 0;
  68.  
  69. ObjectFunc(sub_441D50, 0x441D50);
  70. void SetSpeedShoes(ObjectMaster *obj)
  71. {
  72. SpeedShoesCount++;
  73. sub_441D50(obj);
  74. }
  75.  
  76. ObjectFunc(sub_441D10, 0x441D10);
  77. void UnsetSpeedShoes(ObjectMaster *obj)
  78. {
  79. if (SpeedShoesCount > 0)
  80. SpeedShoesCount--;
  81. sub_441D10(obj);
  82. }
  83.  
  84. void SetInvincible(ObjectMaster *obj)
  85. {
  86. was_invincible_before = true;
  87. RunObjectChildren(obj);
  88. }
  89.  
  90. void UnsetInvincible(ObjectMaster *obj)
  91. {
  92. was_invincible_before = false;
  93. CheckThingButThenDeleteObject(obj);
  94. }
  95.  
  96.  
  97.  
  98. //Sonic random homing sound | Shadow's Chaos Boost Lv1
  99. int sounds[]{ 762, 777, 778, 779 };
  100. void PlayHomingSound() { PlaySound(sounds[rand() % 4], 0, 0, 0); }
  101. __declspec(dllexport) void Init(const char *path, const HelperFunctions &helperFunctions)
  102. {
  103. WriteCall((void*)0x494BE7, PlayHomingSound);
  104. WriteCall((void*)0x4BA525, SetInvincible);
  105. WriteCall((void*)0x4BA537, UnsetInvincible);
  106. WriteData((void**)0x441E10, &SetSpeedShoes);
  107. WriteData((void**)0x441DEA, &UnsetSpeedShoes);
  108. };
  109.  
  110.  
  111.  
  112.  
  113. void __declspec(dllexport) OnFrame()
  114. {
  115.  
  116. EntityData1* co1 = CharObj1Ptrs[0];
  117. CharObj2 *co2 = GetCharObj2(0);
  118.  
  119.  
  120.  
  121.  
  122. //SONIC'S ANIMATIONS
  123.  
  124.  
  125. //Sonic can animate the SuperAura
  126. WriteData((void*)0x55E95C, 0x90u, 6);
  127.  
  128.  
  129. //Anim data
  130. if (co2 == NULL) return;
  131. if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
  132. {
  133. ((AnimData_t*)0x3C56210)[18].TransitionSpeed = 0.1;
  134. ((AnimData_t*)0x3C56210)[64].TransitionSpeed = 0.25;
  135. ((AnimData_t*)0x3C56210)[64].AnimationSpeed = 1.5;
  136. ((AnimData_t*)0x3C56210)[12].AnimationSpeed = 0.415;
  137. ((AnimData_t*)0x3C56210)[13].AnimationSpeed = 0.415;
  138. ((AnimData_t*)0x3C56210)[14].AnimationSpeed = 0.15;
  139. ((AnimData_t*)0x3C56210)[40].AnimationSpeed = 1.25;
  140. ((AnimData_t*)0x3C56210)[42].AnimationSpeed = 1.0;
  141. ((AnimData_t*)0x3C56210)[31].TransitionSpeed = 0.125;
  142. PhysicsArray[Characters_Sonic].Run1 = 5.25;
  143. }
  144.  
  145.  
  146. //SONIC Top speed anim
  147. if (co2 == NULL) return;
  148. if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0 && (co1->Status & Status_Ground) == 1)
  149. {
  150. if (co2->Speed.x >= 13) (WriteData((short*)0x00495C27, (short)13));
  151. else (WriteData((short*)0x00495C27, (short)12));
  152. }
  153.  
  154.  
  155. //SONIC anim speed
  156. if (co2 == NULL) return;
  157. if (co2->Speed.x <= 2.3 && co2->Speed.x >= 1.3 && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0) ((AnimData_t*)0x3C56210)[11].AnimationSpeed = 0.9;
  158. else ((AnimData_t*)0x3C56210)[11].AnimationSpeed = 0.6225;
  159.  
  160.  
  161. //SONIC No jumpball when jumping
  162. //HMODULE hmodule = GetModuleHandle(L"CHRMODELS_orig");
  163. //NJS_OBJECT **___SONIC_OBJECTS = (NJS_OBJECT**)GetProcAddress(hmodule, "___SONIC_OBJECTS");
  164. //if (r && (co1->Status & Status_Ground) != Status_Ground) fall_after_roll = true;
  165. //if (ControllerPointers[0]->PressedButtons & Buttons_A) fall_after_roll = false;
  166. //if ((co1->Status & Status_Ground) == Status_Ground && CharObj1Ptrs[0]->Action == 5) fall_after_roll = true;
  167. //if ((co1->Status & Status_Ground) == Status_Ground && CharObj1Ptrs[0]->Action == 2) fall_after_roll = false;
  168. //if (co2 == NULL) return;
  169. //if (GetCharacterObject(0) && (CharObj1Ptrs[0]->Action == 4 || CharObj1Ptrs[0]->Action == 5 || fall_after_roll || CharObj1Ptrs[0]->Action == 14 || CharObj1Ptrs[0]->Action == 44)) (*___SONIC_OBJECTS[44] = object_0057BC44);
  170. //else (*___SONIC_OBJECTS[44] = object_0157BC44);
  171.  
  172.  
  173. //Sonic random homing trick
  174. //int anims[]{ 40, 42, 46, 70, 116, 117, 118, 119, 120 };
  175. int anims[]{ 40, 42, 46 };
  176. if (CharObj1Ptrs[0]->Action == 14)
  177. {
  178. homing = true;
  179. co2->AnimationThing.Index = 14;
  180. }
  181. if (homing && (co1->Status & Status_Ground) != Status_Ground) in_air_after_homing = true;
  182. if (homing && ((co1->Status & Status_Ground) == Status_Ground || co2->AnimationThing.Index == 0 || co2->AnimationThing.Index == 1 || co2->AnimationThing.Index == 2 || co2->AnimationThing.Index == 9 || co2->AnimationThing.Index == 10 || co2->AnimationThing.Index == 11 || co2->AnimationThing.Index == 12 || co2->AnimationThing.Index == 13 || co2->AnimationThing.Index == 31)) in_air_after_homing = false;
  183. if (!in_air_after_homing) homing = false;
  184. if (in_air_after_homing && CharObj1Ptrs[0]->Action == 8)
  185. {
  186. WriteData((void*)0x494AF9, 0x90, 5);
  187. co2->AnimationThing.Index = anims[rand() % 2];
  188. homing = false;
  189. in_air_after_homing = false;
  190. }
  191. if ((co1->Status & Status_Ground) == Status_Ground || homing) WriteData((void*)0x494AF9, balldata);
  192.  
  193.  
  194.  
  195.  
  196. //Anims better looks
  197. WriteData((short*)0x004984A3, (short)31);
  198. WriteData((short*)0x0049629E, (short)31);
  199. WriteData((short*)0x004962BF, (short)31);
  200. WriteData((void*)0x4960D9, 0x90, 7); // MESSES UP SPEED HIGHWAY LEVEL ENTRANCE (NOP)
  201.  
  202.  
  203.  
  204. // Dash anim in air
  205.  
  206. if (co2 == NULL) return;
  207. if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
  208. {
  209. if (CharObj1Ptrs[0]->Action == 12 && co2->Speed.x >= 5) dashing = true;
  210. if (CharObj1Ptrs[0]->Action != 12 || co2->Speed.x <= 4) dashing = false;
  211. if (dashing)
  212. {
  213. co2->AnimationThing.Index = 64;
  214. WriteData((short*)0x00494FDC, (short)64);
  215. WriteData((short*)0x00497CC0, (short)64);
  216. }
  217.  
  218. if (co2->AnimationThing.Index == 17 || co2->AnimationThing.Index == 26 || co2->AnimationThing.Index == 40 || co2->AnimationThing.Index == 42) was_on_trampoline = true;
  219. if (!was_on_trampoline && CharObj1Ptrs[0]->Action == 12 && co2->Speed.x <= 4) no_longer_dashing = true;
  220. if (CharObj1Ptrs[0]->Action != 12 || co2->Speed.x >= 4 || was_on_trampoline) no_longer_dashing = false;
  221. if (co2->AnimationThing.Index != 17 || co2->AnimationThing.Index != 26 || co2->AnimationThing.Index != 40 || co2->AnimationThing.Index != 42) was_on_trampoline = false;
  222. if (no_longer_dashing)
  223. {
  224. co2->AnimationThing.Index = 18;
  225. WriteData((short*)0x494FDC, (short)18);
  226. WriteData((short*)0x497CC0, (short)18);
  227. }
  228. }
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239. //SpeedShoes New timer
  240. WriteData((short*)0x441CEF, (short)780);
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249. //NOP JumpCancel Action/Animation/HSpeed/VSpeed
  250. WriteData((void*)0x492F68, 0x90, 3);
  251. //WriteData((short*)0x492F7C, (short)64);
  252. WriteData((void*)0x492F73, StompAnim);
  253. //492F73 - 66 C7 87 24010000 1200 animation
  254. WriteData((void*)0x43C560, 0x90, 3);
  255. WriteData((void*)0x43C55D, 0x90, 3);
  256.  
  257.  
  258.  
  259. //Sonic Stomp Upgrade Physics
  260. if (co2 == NULL) return;
  261. if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
  262. {
  263. if (CharObj1Ptrs[0]->Action == 8)
  264. {
  265. if (ControllerPointers[0]->PressedButtons & Buttons_B && ((co1->Status & Status_Ground) != Status_Ground || co2->AnimationThing.Index != 0 || co2->AnimationThing.Index != 1 || co2->AnimationThing.Index != 2 || co2->AnimationThing.Index != 9 || co2->AnimationThing.Index != 10 || co2->AnimationThing.Index != 11 || co2->AnimationThing.Index != 12 || co2->AnimationThing.Index != 13 || co2->AnimationThing.Index != 18 || co2->AnimationThing.Index != 31))
  266. {
  267. co2->AnimationThing.Index != 64;
  268. co2->Speed.y = -8;
  269.  
  270. }
  271. }
  272. }
  273.  
  274. //set vertical speed
  275. //set character state
  276. //set animation
  277. //set graphics
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285. // //Sonic Boost
  286. // if (co2 == NULL) return;
  287. // if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
  288. // {
  289. //// if (co2->Powerups != Powerups_SpeedUp)
  290. //// {
  291. // if (ControllerPointers[0]->HeldButtons & Buttons_Y && (CharObj1Ptrs[0]->Action != 4 || CharObj1Ptrs[0]->Action != 6 || CharObj1Ptrs[0]->Action != 14 || CharObj1Ptrs[0]->Action != 44))
  292. // {
  293. // WriteData((float**)0x55E6FA, &Boost_SuperTornado);
  294. // if (!auraobj) auraobj = LoadObject(LoadObj_Data1, 2, Sonic_SuperAura_Load);
  295. // if (!trailobj)
  296. // {
  297. // trailobj = LoadObject(LoadObj_Data1, 6, SonicDashTrail_Init);
  298. // trailobj->Data1->CharIndex = 0;
  299. // }
  300. //
  301. // if (co2->Speed.x <= 6)
  302. // {
  303. // co2->PhysicsData.MaxAccel = 7.0;
  304. // co2->PhysicsData.GroundAccel = 0.30;
  305. // co2->PhysicsData.field_68 = 0;
  306. // }
  307. // else
  308. // {
  309. // co2->PhysicsData.MaxAccel = 7.0;
  310. // co2->PhysicsData.GroundAccel = 0.15;
  311. // co2->PhysicsData.field_68 = 0;
  312. // }
  313. // }
  314. // else
  315. // {
  316. // DeleteObject_(auraobj);
  317. // DeleteObject_(trailobj);
  318. // auraobj = nullptr;
  319. // trailobj = nullptr;
  320. // WriteData((float**)0x55E6FA, &SuperTornado);
  321. // co2->PhysicsData.MaxAccel = 3.5;
  322. // co2->PhysicsData.GroundAccel = 0.05;
  323. // co2->PhysicsData.field_68 = -0.4275;
  324. // }
  325. // // }
  326. // // if (co2->Powerups == Powerups_SpeedUp)
  327. // // {
  328. // // if (ControllerPointers[0]->PressedButtons & Buttons_Y || ControllerPointers[0]->HeldButtons & Buttons_Y && (CharObj1Ptrs[0]->Action != 4 || CharObj1Ptrs[0]->Action != 6 || CharObj1Ptrs[0]->Action != 14 || CharObj1Ptrs[0]->Action != 44))
  329. // // {
  330. // // WriteData((float**)0x55E6FA, &Boost_SuperTornado);
  331. // // if (!auraobj) auraobj = LoadObject(LoadObj_Data1, 2, Sonic_SuperAura_Load);
  332. // // if (!trailobj)
  333. // // {
  334. // // trailobj = LoadObject(LoadObj_Data1, 6, SonicDashTrail_Init);
  335. // // trailobj->Data1->CharIndex = 0;
  336. // // if (co2->Speed.x <= 6)
  337. // // {
  338. // // co2->PhysicsData.MaxAccel = 12.0;
  339. // // co2->PhysicsData.GroundAccel = 0.60;
  340. // // co2->PhysicsData.field_68 = 0;
  341. // // }
  342. // // else
  343. // // {
  344. // // co2->PhysicsData.MaxAccel = 12.0;
  345. // // co2->PhysicsData.GroundAccel = 0.30;
  346. // // co2->PhysicsData.field_68 = 0;
  347. // // }
  348. // // }
  349. // // else
  350. // // {
  351. // // DeleteObject_(auraobj);
  352. // // auraobj = nullptr;
  353. // // WriteData((float**)0x55E6FA, &SuperTornado);
  354. // // co2->PhysicsData.MaxAccel = 7.0;
  355. // // co2->PhysicsData.GroundAccel = 0.10;
  356. // // co2->PhysicsData.field_68 = -0.8550;
  357. // // }
  358. // //}
  359. // }
  360. //play sounds (voice and sfx)
  361.  
  362.  
  363. //Sonic Light Dash with Y
  364. //if (co2 == NULL) return;
  365. //if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
  366. //{
  367. // if (ControllerPointers[0]->PressedButtons & Buttons_Y)
  368. // {
  369. // CharObj1Ptrs[0]->NextAction = 46; //doesn't work
  370. // co1->Status |= Status_DoNextAction;
  371.  
  372. // }
  373. //}
  374.  
  375.  
  376.  
  377. // //Y for LightDash
  378. // if (co2 == NULL) return;
  379. // if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
  380. // {
  381. // if (CharObj1Ptrs[0]->Action == 4) just_spindashed = true;
  382. // if (ControllerPointers[0]->PressedButtons & Buttons_Y)
  383. // {
  384. // just_spindashed = false;
  385. //// no_light_attack = true;
  386. // }
  387. //// if (no_light_attack) co1->UpgradeBits |= UpgradeBits_AncientLight;
  388. //// else if (co1->EventFlags |= EventFlags_Sonic_Ancient) co1->UpgradeBits |= UpgradeBits_AncientLight;
  389. //
  390. // if (CharObj1Ptrs[0]->Action != 4 && CharObj1Ptrs[0]->Action != 6 && (co1->Status & Status_LightDash) != Status_LightDash) just_spindashed = false;
  391. // if (!just_spindashed)
  392. // {
  393. // WriteJump((void*)0x493047, (void*)0x4930C1);
  394. // }
  395. // else
  396. // {
  397. // WriteData((void*)0x493047, LightDash_unNOP);
  398. // }
  399. // if (ControllerPointers[0]->PressedButtons & Buttons_Y)
  400. // {
  401. //
  402. // co1->Status |= Status_LightDash;
  403. // }
  404. // }
  405.  
  406.  
  407.  
  408.  
  409.  
  410. ////LightDash with Y new test
  411. // if (co2 == NULL) return;
  412. // if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
  413. // {
  414. // WriteData((void*)0x493047, 0x90, 3);
  415. // WriteData((void*)0x493067, 0x90, 7);
  416. // if (ControllerPointers[0]->PressedButtons & Buttons_Y)
  417. // {
  418. // co1->Status |= Status_LightDash;
  419. // }
  420. // }
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439. //LightDash edits
  440. //WriteData((void*)0x4975BC, 0x90, 7); //not forced out speed
  441. //WriteData((void*)0x492CAE, 0x90, 6); //no horrible ''jumping'' looks
  442. //WriteData((float*)0x4950DF, (float)1.0f);
  443. //WriteData((float*)0x492CBF, (float)10.0f); //speed on rings
  444. //WriteData((float*)0x49306A, (float)0.0f); //speed not on rings
  445. /* if ((co1->Status & Status_LightDash) == Status_LightDash)
  446. {
  447. WriteData((void*)0x493047, 0x90, 3);
  448. WriteData((void*)0x493067, 0x90, 7);
  449. WriteData((void*)0x49304C, 0x90, 9);
  450. }
  451. else
  452. {
  453. WriteData((void*)0x493047, LightDash_unNOP);
  454. WriteData((void*)0x493067, LightDashSpeed_unNOP);
  455. WriteData((void*)0x49304C, LightDashAnim_unNOP);
  456. }*/
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465. //Faster LightSpeedCharge
  466. WriteData((short*)0x495097, (short)80);
  467.  
  468.  
  469.  
  470.  
  471.  
  472. // WriteData((float**)0x0049FF85, &TEST);
  473. // WriteData((float**)0x004A0075, &TEST);
  474.  
  475.  
  476. //Jump anim and HangTime like Heroes
  477. //if (co2 == NULL) return;
  478. //if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
  479. //{
  480. // PhysicsArray[Characters_Sonic].HangTime = 60000;
  481. // if (CharObj1Ptrs[0]->Action == 8)
  482. // {
  483. // if (ControllerPointers[0]->HeldButtons & Buttons_A)
  484. // {
  485. // if (++HangTimeLikeHeroes == 60)
  486. // {
  487. // WriteData((void*)0x43BFCB, 0x90, 6);
  488. // }
  489. // else if (EnemyBonus - OldEnemyBonus > 0 || co2->AnimationThing.Index == 40 || co2->AnimationThing.Index == 42)
  490. // {
  491. // WriteData((void*)0x43BFCB, HangTimeCheckData);
  492. // OldEnemyBonus = EnemyBonus;
  493. // }
  494. // }
  495. // }
  496. // else if ((co1->Status & Status_Ground) == Status_Ground || co2->AnimationThing.Index == 0 || co2->AnimationThing.Index == 1 || co2->AnimationThing.Index == 2 || co2->AnimationThing.Index == 9 || co2->AnimationThing.Index == 10 || co2->AnimationThing.Index == 11 || co2->AnimationThing.Index == 12 || co2->AnimationThing.Index == 13 || co2->AnimationThing.Index == 18 || co2->AnimationThing.Index == 31 || CharObj1Ptrs[0]->Action != 8)
  497. // {
  498. // WriteData((void*)0x43BFCB, HangTimeCheckData);
  499. // HangTimeLikeHeroes = 0;
  500. // }
  501. //}
  502.  
  503. //Jump anim and HangTime like Heroes
  504. if (co2 == NULL) return;
  505. if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
  506. {
  507. PhysicsArray[Characters_Sonic].HangTime = 60000;
  508. if (CharObj1Ptrs[0]->Action == 8)
  509. {
  510. if (ControllerPointers[0]->HeldButtons & Buttons_A)
  511. {
  512. if (++HangTimeLikeHeroes == 60)
  513. {
  514. WriteData((void*)0x43BFCB, 0x90, 6);
  515. }
  516. else if (EnemyBonus - OldEnemyBonus > 0 || co2->AnimationThing.Index == 40 || co2->AnimationThing.Index == 42)
  517. {
  518. WriteData((void*)0x43BFCB, HangTimeCheckData);
  519. OldEnemyBonus = EnemyBonus;
  520. }
  521. }
  522. }
  523. else if ((co1->Status & Status_Ground) == Status_Ground || co2->AnimationThing.Index == 0 || co2->AnimationThing.Index == 1 || co2->AnimationThing.Index == 2 || co2->AnimationThing.Index == 9 || co2->AnimationThing.Index == 10 || co2->AnimationThing.Index == 11 || co2->AnimationThing.Index == 12 || co2->AnimationThing.Index == 13 || co2->AnimationThing.Index == 18 || co2->AnimationThing.Index == 31 || CharObj1Ptrs[0]->Action != 8)
  524. {
  525. WriteData((void*)0x43BFCB, HangTimeCheckData);
  526. HangTimeLikeHeroes = 0;
  527. }
  528. }
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536. //LightAttack like SA2
  537.  
  538. if (co2 == NULL) return;
  539. if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
  540. {
  541. if (CharObj1Ptrs[0]->Action == 44)
  542. {
  543. if ((*(float**)0x492A3B == &LightAttackStatic) && (*(float**)0x492A4F == &LightAttackStatic) && (*(float**)0x492A6A == &LightAttackStatic))
  544. {
  545. WriteData((float**)0x492A3B, &LightAttackMoving);
  546. WriteData((float**)0x492A4F, &LightAttackMoving);
  547. WriteData((float**)0x492A6A, &LightAttackMoving);
  548. }
  549. if (++LightAttackTimer == 10)
  550. {
  551. WriteData((float**)0x492A3B, &LightAttackStatic);
  552. WriteData((float**)0x492A4F, &LightAttackStatic);
  553. WriteData((float**)0x492A6A, &LightAttackStatic);
  554. LightAttackTimer = 0;
  555. }
  556. }
  557. else LightAttackTimer = 0;
  558. }
  559.  
  560.  
  561. //Super Sonic/Shadow anybody LightAttack*************************************************
  562.  
  563.  
  564.  
  565. //LightAttack edits for Super forms
  566. //WriteData((float**)0x492A3B, &LightAttackMoving);
  567. //WriteData((float**)0x492A4F, &LightAttackMoving);
  568. //WriteData((float**)0x492A6A, &LightAttackMoving);
  569.  
  570.  
  571.  
  572. //if (co2 == NULL) return;
  573. //if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
  574. //{
  575. // WriteData((float*)0x492FEB, (float)0.0f);
  576. // if (CharObj1Ptrs[0]->Action == 44)
  577. // {
  578. // if ((*(float**)0x492A3B == &LightAttackStatic) && (*(float**)0x492A4F == &LightAttackStatic) && (*(float**)0x492A6A == &LightAttackStatic))
  579. // {
  580. // WriteData((float**)0x492A3B, &SuperLightAttackMoving);
  581. // WriteData((float**)0x492A4F, &SuperLightAttackMoving);
  582. // WriteData((float**)0x492A6A, &SuperLightAttackMoving);
  583. // }
  584. // if ((++LightAttackTimer == 1) || EnemyBonus - OldEnemyBonus > 0)
  585. // {
  586. // WriteData((float**)0x492A3B, &LightAttackStatic);
  587. // WriteData((float**)0x492A4F, &LightAttackStatic);
  588. // WriteData((float**)0x492A6A, &LightAttackStatic);
  589. // }
  590. // }
  591. // else LightAttackTimer = 0;
  592. // OldEnemyBonus = EnemyBonus;
  593. //}
  594.  
  595.  
  596.  
  597. //Super Sonic's Aura different speeds
  598. // WriteData((float**)0x55E739, &SuperDash);
  599. // WriteData((float**)0x55E6FA, &SuperTornado);
  600.  
  601.  
  602. //Super Aura when LightDashing
  603. if (co2 == NULL) return;
  604. if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
  605. {
  606. if (CharObj1Ptrs[0]->Action == 6) LightDash_SuperDash_ON = true;
  607. else LightDash_SuperDash_ON = false;
  608. if (LightDash_SuperDash_ON)
  609. {
  610. if (!auraobj) auraobj = LoadObject(LoadObj_Data1, 2, Sonic_SuperAura_Load);
  611. }
  612. if (auraobj && CharObj1Ptrs[0]->Action != 6 && ControllerPointers[0]->HeldButtons & !Buttons_Y)
  613. {
  614. DeleteObject_(auraobj);
  615. auraobj = nullptr;
  616. }
  617. if (LightDash_SuperDash_ON) WriteData((float**)0x0055E739, &LightDash_SuperDash);
  618. else WriteData((float**)0x0055E739, &SuperDash);
  619. }
  620.  
  621.  
  622.  
  623. //SONIC physics
  624. if (co2 == NULL) return;
  625. if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
  626. {
  627. PhysicsArray[Characters_Sonic].MaxAccel = 3.5;
  628. PhysicsArray[Characters_Sonic].GroundAccel = 0.05;
  629. PhysicsArray[Characters_Sonic].field_68 = -0.4275;
  630. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement