Advertisement
Benji23245

Untitled

Apr 25th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.33 KB | None | 0 0
  1. //Chaos Spear Action => have each chaos spear cost energy (only when not in CB_lv2/3)
  2.  
  3. //*****Have Tails CPU always be replaced by Gamma CPU;
  4. //*****Have that same CPU always there, in any level or adventure field, whenever Sonic is played as, that CPU must be here too
  5. WriteData((short*)0x4C4E34, (short)30000);//Gamma infinite aiming laser timer
  6. //*****Disable all Gamma sounds;
  7. //*****Disable Gamma "5,4,3,2,1 sec left" textures;
  8. //*****Make Gamma laser invisible;
  9. //*****Make Gamma x1 / x2 etc all invisible;
  10. WriteData((char*)0x4CEA60, (char)0xC3);//removes the red/yellow squares
  11. WriteData((void*)0x42667F, 0x90, 5);//Stop the timer from going up when killing enemies as gamma
  12. //*****Disable Gamma's timebonuses (sounds, effects and textures);
  13. if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
  14. {
  15. if (GameState == 4)
  16. {
  17. //*****load normal shadow model;
  18. go_back_to_gameplay = 0;
  19. ((AnimData_t*)0x3C56210)[18].AnimationSpeed = 1;
  20. CS_launch_was_played = false;
  21. CS_charging_was_played = false;
  22. CS_empty_was_played = false;
  23. is_in_CS_state = false;
  24. X_was_released = false;
  25. //*****Gamma Y position = 50000;
  26. WriteData((char*)0x4977AB, (char)0x74);//Allows homing attack
  27. //*****Remove controls on Gamma;
  28. EntityData1Ptrs[0]->InvulnerableTime = 0;
  29. WriteData((void*)0x497013, enable_SONIC_KNUXflashing);
  30. has_homing_attacked = false;
  31. //Gauge = 0;
  32. }
  33. if (GameState == 15)
  34. {
  35. int anims2[]{ 116, 117, 119 };
  36. //*****Make Gamma always invincible - flashing;
  37. //*****Gamma speed = 0;
  38. //*****Gamma action is falling;
  39. //*****Gamma animation is falling;
  40. if (EntityData1Ptrs[0]->Action == 14)
  41. {
  42. has_homing_attacked = true;
  43. }
  44. if ((co1->Status & Status_Ground) == Status_Ground || co2->AnimationThing.Index == 0 || co2->AnimationThing.Index == 1 || co2->AnimationThing.Index == 2 || co2->AnimationThing.Index == 3 || co2->AnimationThing.Index == 4 || co2->AnimationThing.Index == 5 || co2->AnimationThing.Index == 6 || co2->AnimationThing.Index == 7 || co2->AnimationThing.Index == 8 || co2->AnimationThing.Index == 9 || co2->AnimationThing.Index == 10 || co2->AnimationThing.Index == 11 || co2->AnimationThing.Index == 12 || co2->AnimationThing.Index == 13 || co2->AnimationThing.Index == 14 || co2->AnimationThing.Index == 20 || co2->AnimationThing.Index == 25 || co2->AnimationThing.Index == 31 || co2->AnimationThing.Index == 71 || co2->AnimationThing.Index == 130 || co2->AnimationThing.Index == 131 || EntityData1Ptrs[0]->Action == 8 || EntityData1Ptrs[0]->Action == 6)
  45. {
  46. has_homing_attacked = false;
  47. }
  48. if ((co2->AnimationThing.Index == 14 || co2->AnimationThing.Index == 18 || co2->AnimationThing.Index == 116 || co2->AnimationThing.Index == 117 || co2->AnimationThing.Index == 119) && (EntityData1Ptrs[0]->Action != 4 && EntityData1Ptrs[0]->Action != 5 && EntityData1Ptrs[0]->Action != 14 && EntityData1Ptrs[0]->Action != 44) && !is_in_CS_state && !has_homing_attacked && (co1->Status & Status_LightDash) != Status_LightDash)
  49. {
  50. if (/*Gauge > 0 && */ControllerPointers[0]->HeldButtons & Buttons_X)
  51. {
  52. ((AnimData_t*)0x3C56210)[18].AnimationSpeed = 0;
  53. EntityData1Ptrs[0]->Action = 12;
  54. co2->AnimationThing.Index = 18;
  55. is_in_CS_state = true;
  56. }
  57. }
  58. if (is_in_CS_state)
  59. {
  60. //*****Gamma position is into Sonic;
  61. //*****Gamma rotation is Sonic's;
  62. WriteData((char*)0x4977AB, (char)0xEB);//disables homing attack
  63. co1->Position.x = old_X_position;
  64. co1->Position.y = old_Y_position;
  65. co1->Position.z = old_Z_position;
  66. co2->Speed.x = 0.0;
  67. co2->Speed.y = 0.0;
  68. co2->Speed.z = 0.0;
  69. WriteData((void*)0x43CC72, 0x90, 6); //Allow gravity change for P1
  70. co2->PhysicsData.Gravity = 0.0;
  71. //*****Remove gravity for Gamma CPU;
  72. //*****Allow controls on Gamma;
  73. if (EntityData1Ptrs[0]->InvulnerableTime == 0)
  74. {
  75. EntityData1Ptrs[0]->InvulnerableTime = 60000;
  76. WriteData((void*)0x497013, 0x90, 4);//disable sonic flashing when "invulnerable time"
  77. }
  78. if (!CS_charging_was_played)
  79. {
  80. PlayVoice(1323);
  81. CS_charging_was_played = true;
  82. }
  83. if (!(ControllerPointers[0]->HeldButtons & Buttons_X))
  84. {
  85. X_was_released = true;
  86. }
  87. if (X_was_released)
  88. {
  89. //DO ALLLLLLLL THE SYSTEM I ORIGINALLY DID FOR MULTIPLE TARGETS AND NUMBER OF TARGETS HE SHOOTS AT LIMITATION
  90. if (!CS_empty_was_played)
  91. {
  92. PlayVoice(1321);
  93. CS_empty_was_played = true;
  94. }
  95. //*****if (Gamma shoot address = 4 /*or 5?*/ && !CS_launch_was_played) => is it the same as I used in my first Chaos Spear attempt ?
  96. //*****{
  97. PlaySound(775, 0, 0, 0);
  98. CS_launch_was_played = true;
  99. //Gauge -= 500; // but how to make it do it for each shoot ??
  100. //***** }
  101. else go_back_to_gameplay = 30;
  102. if (CS_launch_was_played)
  103. {
  104. ++go_back_to_gameplay;
  105. //do the model animation;
  106. }
  107. if (go_back_to_gameplay == 30)
  108. {
  109. //load normal shadow model;
  110. go_back_to_gameplay = 0;
  111. ((AnimData_t*)0x3C56210)[18].AnimationSpeed = 1;
  112. CS_charging_was_played = false;
  113. CS_launch_was_played = false;
  114. CS_empty_was_played = false;
  115. is_in_CS_state = false;
  116. X_was_released = false;
  117. if (has_homing_attacked)
  118. {
  119. EntityData1Ptrs[0]->Action = 12;
  120. co2->AnimationThing.Index = 18;
  121. }
  122. else
  123. {
  124. EntityData1Ptrs[0]->Action = 8;
  125. co2->AnimationThing.Index = anims2[rand() % 3];
  126. }
  127. }
  128. }
  129. }
  130. else
  131. {
  132. //*****Gamma Y position = 50000;// => P2 CPU's X/Y/Z position are P1's +1A0/1A4/1A8
  133. WriteData((void*)0x43CC72, gravity_orig_hovering);
  134. if (co2->_struct_a3.ColFlagsA & ColFlags_Water)
  135. {
  136. co2->PhysicsData.Gravity = 0.032;
  137. }
  138. else co2->PhysicsData.Gravity = 0.08;
  139. EntityData1Ptrs[0]->InvulnerableTime = 0;
  140. WriteData((void*)0x497013, enable_SONIC_KNUXflashing);
  141. //*****Remove Controls on Gamma;
  142. WriteData((char*)0x4977AB, (char)0x74);//Allows Homing Attack
  143. old_X_position = co1->Position.x;
  144. old_Y_position = co1->Position.y;
  145. old_Z_position = co1->Position.z;
  146. }
  147. }
  148. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement