Advertisement
Benji23245

Untitled

Jun 16th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.08 KB | None | 0 0
  1. //Punching Action without Character Switch FINALLLLLLLLLLLLLLLLLLLLLLLLL
  2. word_3C53626 = 0; //3rd to 4th and 5th no longer automatic
  3. if (co2 == NULL) return; //you return the whole onframe function??
  4. if (co1CPU == NULL) return;
  5. if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
  6. {
  7. if (GameState == 4)
  8. {
  9. co1P3->Position = co1->Position;
  10. WriteData((char*)Sonic_Display, (char)0x8B);
  11. WriteData((char*)Knuckles_Display, (char)0xC3);
  12. punching = false;
  13. punchattack = 0;
  14. has_punched_once = false;
  15. will_punch = 0;
  16. just_rolled = false;
  17. justrolled = 0;
  18. knuckles_teleport_to_sonic = false;
  19. knuckles_teleported_away = false;
  20. X_press = 0;
  21. can_X_press = 0;
  22. stru_3C532A0[54].NextAnim = 0;
  23. stru_3C532A0[55].NextAnim = 0;
  24. stru_3C532A0[56].NextAnim = 0;
  25. }
  26. if (GameState == 15)
  27. {
  28. if (!punching)
  29. {
  30. if (!oldcountSonic) oldcountSonic = co1->CollisionInfo[0].Count;
  31. oldcountSonic = 0;
  32. co1P3->Position = co1->Position;
  33. co1P3->Rotation = co1->Rotation;
  34. co2P3->Speed = co2->Speed;
  35. stru_3C532A0[54].NextAnim = 0;
  36. stru_3C532A0[55].NextAnim = 0;
  37. stru_3C532A0[56].NextAnim = 0;
  38. EntityData1Ptrs[2]->Action = 9;
  39. co2P3->AnimationThing.Index = 19;
  40. X_press = 0;
  41. can_X_press = 0;
  42. }
  43. else
  44. {
  45. if (!oldcountKnux) oldcountKnux = co1P3->CollisionInfo[0].Count;
  46. oldcountKnux = 0;
  47. ++can_X_press;
  48. if (ControllerPointers[0]->PressedButtons & Buttons_X && X_press == 1)
  49. {
  50. stru_3C532A0[55].NextAnim = 56;
  51. X_press = 2;
  52. }
  53. if (ControllerPointers[0]->PressedButtons & Buttons_X && X_press == 0/* && can_X_press >= 10*/)
  54. {
  55. stru_3C532A0[54].NextAnim = 55;
  56. X_press = 1;
  57. }
  58. co1->Position = co1P3->Position;
  59. co1P3->Rotation = co1->Rotation;
  60. co2->Speed = co2P3->Speed;
  61. EntityData1Ptrs[0]->Action = 1;
  62. co2->AnimationThing.Index = 2;
  63. }
  64. if (knuckles_teleport_to_sonic)
  65. {
  66. co1P3->Position.x = co1->Position.x;
  67. co1P3->Position.y = co1->Position.y;
  68. co1P3->Position.z = co1->Position.z;
  69. co1P3->Rotation.x = co1->Rotation.x;
  70. co1P3->Rotation.y = co1->Rotation.y;
  71. co1P3->Rotation.z = co1->Rotation.z;
  72. EntityData1Ptrs[2]->Action = 26;
  73. co2P3->AnimationThing.Index = 54;
  74. co2P3->Powerups |= Powerups_Invincibility;
  75. punching = true;
  76. knuckles_teleport_to_sonic = false;
  77. }
  78. if (justrolled == 1)
  79. {
  80. just_rolled = false;
  81. justrolled = 0;
  82. }
  83. if (EntityData1Ptrs[0]->Action == 5) just_rolled = true;
  84. if (EntityData1Ptrs[0]->Action == 8 || co2->Speed.x <= 0.46) just_rolled = false;
  85. if (just_rolled && ControllerPointers[0]->PressedButtons & Buttons_X) justrolled == 1;
  86. if (!punching && (EntityData1Ptrs[0]->Action == 0 || EntityData1Ptrs[0]->Action == 1 || EntityData1Ptrs[0]->Action == 2))
  87. {
  88. if (ControllerPointers[0]->HeldButtons & Buttons_X && (co1->Status & Status_LightDash) != Status_LightDash && !just_rolled)
  89. {
  90. ++punchattack;
  91. }
  92. if (!just_rolled && punchattack < 30 && ControllerPointers[0]->ReleasedButtons & Buttons_X)
  93. {
  94. co1P3->CollisionInfo[0].Count = oldcountKnux;
  95. WriteData((char*)Sonic_Display, (char)0xC3);
  96. WriteData((char*)Knuckles_Display, (char)0x83);
  97. knuckles_teleport_to_sonic = true;
  98. punchattack = 0;
  99. }
  100. }
  101. if (EntityData1Ptrs[2]->Action != 26 && !knuckles_teleport_to_sonic)
  102. {
  103. WriteData((char*)Sonic_Display, (char)0x8B);
  104. WriteData((char*)Knuckles_Display, (char)0xC3);
  105. co2P3->Powerups &= ~Powerups_Invincibility;
  106. punching = false;
  107. co1P3->Position.x = co1->Position.x;
  108. co1P3->Position.y = co1->Position.y;
  109. co1P3->Position.z = co1->Position.z;
  110. co2P3->Speed.x = 0;
  111. co2P3->Speed.y = 0;
  112. co2P3->Speed.z = 0;
  113. EntityData1Ptrs[2]->Action = 9;
  114. co2P3->AnimationThing.Index = 19;
  115. knuckles_teleported_away = true;
  116. co1->CollisionInfo[0].Count = oldcountSonic;
  117. }
  118. }
  119. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement