Advertisement
Benji23245

Untitled

Jul 11th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.56 KB | None | 0 0
  1. //Chaos Blast Action // SUPERSONIC FLAG CAUSES SUPERSONIC TRANSFORMATIONS..........................................??????????????????????
  2.  
  3. WriteData((char*)0x4C09F9, (char)0xEB);
  4. if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
  5. {
  6. if (GameState == 4)
  7. {
  8. using_chaos_blast = false;
  9. chaos_blast_active_timer = 0;
  10. chaos_blast_radius_timer = 0;
  11. ((AnimData_t*)0x3C56210)[84].AnimationSpeed = 0.25;
  12. CHAOSBLAST_was_played = false;
  13. WriteData((void*)0x43CC72, gravity_orig_hovering);
  14. co2->PhysicsData.Gravity = 0.08;
  15. BombRadius = -1.0;
  16. OldBombRadius = 0.0;
  17. co2->Upgrades &= ~Upgrades_SuperSonic;
  18. cbBLUEsize = 0.0;
  19. cbREDsize = 0.0;
  20. }
  21. if (GameState == 15)
  22. {
  23. if (CB_lv3)
  24. {
  25. //if (EntityData1Ptrs[0]->Action != 16 && EntityData1Ptrs[0]->Action != 86 && EntityData1Ptrs[0]->Action != 44 && co2->AnimationThing.Index != 33 && co2->AnimationThing.Index != 34 && co2->AnimationThing.Index != 35 && co2->AnimationThing.Index != 36 && co2->AnimationThing.Index != 37 && co2->AnimationThing.Index != 38 && co2->AnimationThing.Index != 47 && co2->AnimationThing.Index != 48 && co2->AnimationThing.Index != 49 && co2->AnimationThing.Index != 50 && co2->AnimationThing.Index != 51 && co2->AnimationThing.Index != 52 && co2->AnimationThing.Index != 53 && co2->AnimationThing.Index != 54 && co2->AnimationThing.Index != 55 && co2->AnimationThing.Index != 56 && co2->AnimationThing.Index != 57 && co2->AnimationThing.Index != 58 && co2->AnimationThing.Index != 59 && co2->AnimationThing.Index != 60 && co2->AnimationThing.Index != 61 && co2->AnimationThing.Index != 62 && co2->AnimationThing.Index != 63 && co2->AnimationThing.Index != 65 && co2->AnimationThing.Index != 66 && co2->AnimationThing.Index != 67 && co2->AnimationThing.Index != 68 && co2->AnimationThing.Index != 69 && co2->AnimationThing.Index != 70 && co2->AnimationThing.Index != 71 && co2->AnimationThing.Index != 72 && co2->AnimationThing.Index != 73 && co2->AnimationThing.Index != 74 && co2->AnimationThing.Index != 75 && co2->AnimationThing.Index != 76 && co2->AnimationThing.Index != 77 && co2->AnimationThing.Index != 78 && co2->AnimationThing.Index != 79 && co2->AnimationThing.Index != 80 && co2->AnimationThing.Index != 81 && co2->AnimationThing.Index != 82 && co2->AnimationThing.Index != 89 && co2->AnimationThing.Index != 90 && co2->AnimationThing.Index != 91 && co2->AnimationThing.Index != 92 && co2->AnimationThing.Index != 93 && co2->AnimationThing.Index != 94 && co2->AnimationThing.Index != 95 && co2->AnimationThing.Index != 96 && co2->AnimationThing.Index != 97 && co2->AnimationThing.Index != 98 && co2->AnimationThing.Index != 99 && co2->AnimationThing.Index != 100 && co2->AnimationThing.Index != 101)
  26. if (EntityData1Ptrs[0]->Action == 0 || EntityData1Ptrs[0]->Action == 1 || EntityData1Ptrs[0]->Action == 2 || EntityData1Ptrs[0]->Action == 8 || EntityData1Ptrs[0]->Action == 12)
  27. {
  28. if (ControllerPointers[0]->PressedButtons & Buttons_Z && !using_chaos_blast)
  29. {
  30. if (EntityData1Ptrs[0]->Action == 0 || EntityData1Ptrs[0]->Action == 1 || EntityData1Ptrs[0]->Action == 2) co1->Position.y += 1.0;
  31. co2->Upgrades |= Upgrades_SuperSonic;
  32. using_chaos_blast = true;
  33. co2->field_A = 210;//to disable controls for 3.5 secs
  34. co2->Speed.x = 0;
  35. co2->Speed.y = 0;
  36. co2->Speed.z = 0;
  37. WriteData<6>((void*)0x43CC72, 0x90); //Allow gravity change for P1
  38. co2->PhysicsData.Gravity = 0.0;
  39. EntityData1Ptrs[0]->Action = 12;
  40. co2->AnimationThing.Index = 85;
  41. co1->Status &= ~Status_Ball;
  42. co1->Status &= ~Status_Attack;
  43. BombRadius = 0.0;
  44. OldBombRadius = 0.0;
  45. ((AnimData_t*)0x3C56210)[84].AnimationSpeed = 1.5;
  46. }
  47. }
  48. if (using_chaos_blast)
  49. {
  50. BombRadius = 0.0;
  51. ++chaos_blast_active_timer;
  52. if (chaos_blast_active_timer > 35)
  53. {
  54. cbBLUEsize += 0.01;
  55. njSetTexture((NJS_TEXLIST*)0x91CB58);
  56. njPushMatrix(nullptr);
  57. njTranslateV(nullptr, &co1->CollisionInfo->CollisionArray->origin);
  58. njScale(nullptr, cbBLUEsize, cbBLUEsize, cbBLUEsize);
  59. ProcessModelNode_B(&object_cbBLUE_0061B4DC, 1);
  60. njPopMatrix(0);
  61. }
  62. if (chaos_blast_active_timer < 90)
  63. {
  64. co2->Speed.y = 0.06;
  65. co2->AnimationThing.Index = 85; //tweak the anim speed to make it look good
  66. if (!CHAOSBLAST_was_played)
  67. {
  68. PlayVoice(1326);
  69. CHAOSBLAST_was_played = true;
  70. }
  71. }
  72. else if (chaos_blast_active_timer >= 90 && chaos_blast_active_timer < 210)
  73. {
  74. if (chaos_blast_active_timer <= 170)
  75. {
  76. cbREDsize += 0.333333;
  77. }
  78. njSetTexture((NJS_TEXLIST*)0x91CB58);
  79. njPushMatrix(nullptr);
  80. njTranslateV(nullptr, &co1->CollisionInfo->CollisionArray->origin);
  81. njScale(nullptr, cbREDsize, cbREDsize, cbREDsize);
  82. ProcessModelNode_B(&object_cbRED_0061AA94, 1);
  83. njPopMatrix(1);
  84.  
  85. co2->Speed.y = 0.0;
  86. if (anim84speed < 7)
  87. {
  88. ((AnimData_t*)0x3C56210)[84].AnimationSpeed = 1.5;
  89. }
  90. else if (anim84speed / 4 % 2 == 0)
  91. {
  92. ((AnimData_t*)0x3C56210)[84].AnimationSpeed = -0.1;
  93. }
  94. else
  95. {
  96. ((AnimData_t*)0x3C56210)[84].AnimationSpeed = 0.1;
  97. }
  98. ++anim84speed;
  99. co2->AnimationThing.Index = 84; //tweak the anim speed to make it look good
  100. BombPosition = co1->Position;
  101. if (chaos_blast_radius_timer < 60)
  102. {
  103. ++chaos_blast_radius_timer;
  104. OldBombRadius += 3.33333;
  105. BombRadius = OldBombRadius;
  106. }
  107. //*****spawn explosion model;
  108. }
  109. else if (chaos_blast_active_timer >= 210)
  110. {
  111. co2->Upgrades &= ~Upgrades_SuperSonic;
  112. using_chaos_blast = false;
  113. cbBLUEsize = 0.0;
  114. cbREDsize = 0.0;
  115. chaos_blast_active_timer = 0;
  116. chaos_blast_radius_timer = 0;
  117. ((AnimData_t*)0x3C56210)[84].AnimationSpeed = 0.25;
  118. anim84speed = 0;
  119. CHAOSBLAST_was_played = false;
  120. WriteData((void*)0x43CC72, gravity_orig_hovering);
  121. if (co2->_struct_a3.ColFlagsA & ColFlags_Water)
  122. {
  123. co2->PhysicsData.Gravity = 0.032;
  124. }
  125. else co2->PhysicsData.Gravity = 0.08;
  126. EntityData1Ptrs[0]->Action = 8;
  127. co2->AnimationThing.Index = 18;
  128. }
  129. }
  130. else
  131. {
  132. OldBombRadius = 0.0;
  133. BombRadius = -1.0;
  134. }
  135. }
  136. else
  137. {
  138. OldBombRadius = 0.0;
  139. BombRadius = -1.0;
  140. }
  141. }
  142. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement