Advertisement
Benji23245

Untitled

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