Advertisement
fggkyle

Untitled

Sep 23rd, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.59 KB | None | 0 0
  1. void func_808C12A4(ArmsHook *this, GlobalContext *globalCtx) {
  2. ActorPlayer *spC4;
  3. struct Actor *spC0;
  4. Actor *spBC;
  5. f32 spB0;
  6. f32 spAC;
  7. f32 spA8;
  8. f32 spA4;
  9. f32 sp9C;
  10. f32 sp94;
  11. f32 sp90;
  12. s32 sp88;
  13. s32 sp84;
  14. ? sp78;
  15. ? sp6C;
  16. f32 sp68;
  17. f32 sp64;
  18. f32 sp60;
  19. f32 sp5C;
  20. f32 sp58;
  21. PosRot *sp44;
  22. Vec3f *sp40;
  23. CollisionContext *sp3C;
  24. Actor *temp_a3;
  25. Actor *temp_a3_2;
  26. ActorPlayer *temp_a2;
  27. CollisionContext *temp_a0_4;
  28. DynaPolyActor *temp_v0_2;
  29. PosRot *temp_a0_2;
  30. PosRot *temp_a1_2;
  31. Vec3f *temp_a0;
  32. Vec3f *temp_a0_3;
  33. f32 *temp_a1_3;
  34. f32 temp_f0;
  35. f32 temp_f0_2;
  36. f32 temp_f0_3;
  37. f32 temp_f12;
  38. f32 temp_f12_2;
  39. f32 temp_f14;
  40. f32 temp_f2;
  41. f32 temp_f2_2;
  42. s16 temp_v1;
  43. struct Actor *temp_a1;
  44. struct ColBodyInfo_t *temp_v0;
  45. s16 phi_v0;
  46. Actor *phi_a3;
  47. f32 phi_f2;
  48. f32 phi_f2_2;
  49. f32 phi_f16;
  50. f32 phi_f16_2;
  51.  
  52. temp_a2 = globalCtx->unk1CCC;
  53. if (this->actor.parent == 0) {
  54. block_2:
  55. func_808C1198(this);
  56. Actor_MarkForDeath(this);
  57. return;
  58. }
  59. spC4 = temp_a2;
  60. if (func_801240C8(temp_a2) == 0) {
  61. goto block_2;
  62. }
  63. func_800B8F98(spC4, 0x100B);
  64. func_808C11C0(this);
  65. temp_v1 = this->timer;
  66. if (temp_v1 != 0) {
  67. if ((this->collider.base.flagsAT & 2) != 0) {
  68. temp_v0 = this->collider.body.unk20;
  69. if (temp_v0->unk14 != 4) {
  70. temp_a1 = this->collider.base.collisionAT;
  71. if (temp_a1->update != 0) {
  72. if ((temp_a1->flags & 0x600) != 0) {
  73. if ((temp_v0->unk16 & 4) != 0) {
  74. spC0 = temp_a1;
  75. func_808C125C(this, temp_a1);
  76. if ((temp_a1->flags & 0x400) == 0x400) {
  77. func_808C1154(this);
  78. }
  79. }
  80. }
  81. }
  82. this->timer = 0;
  83. func_8019F1C0(&this->actor.projectedPos, 0x1814);
  84. return;
  85. }
  86. }
  87. }
  88. if (temp_v1 == 0) {
  89. phi_v0 = 0;
  90. } else {
  91. this->timer = temp_v1 - 1;
  92. phi_v0 = this->timer;
  93. }
  94. if (phi_v0 == 0) {
  95. temp_a3 = this->grabbed;
  96. phi_a3 = temp_a3;
  97. if (temp_a3 != 0) {
  98. if ((temp_a3->update == 0) || ((temp_a3->flags & 0x2000) != 0x2000)) {
  99. this->grabbed = NULL;
  100. phi_a3 = NULL;
  101. } else {
  102. phi_a3 = temp_a3;
  103. if (this->actor.child != 0) {
  104. spBC = temp_a3;
  105. sp94 = Actor_DistanceBetweenActors(this, temp_a3);
  106. temp_f2 = this->unk_1FC.x;
  107. temp_f12 = this->unk_1FC.y;
  108. temp_f14 = this->unk_1FC.z;
  109. sp90 = sqrtf(((temp_f2 * temp_f2) + (temp_f12 * temp_f12)) + (temp_f14 * temp_f14));
  110. Math_Vec3f_Diff(&temp_a3->currPosRot, &this->unk_1FC, &this->actor.currPosRot);
  111. phi_a3 = temp_a3;
  112. if (50.0f < (sp94 - sp90)) {
  113. func_808C1198(this);
  114. phi_a3 = NULL;
  115. }
  116. }
  117. }
  118. }
  119. temp_a1_2 = &this->actor.currPosRot;
  120. sp44 = temp_a1_2;
  121. temp_a0 = &spC4->unk368;
  122. sp40 = temp_a0;
  123. spBC = phi_a3;
  124. temp_f0 = Math_Vec3f_DistXYZAndStoreDiff(temp_a0, temp_a1_2, &spB0);
  125. temp_a3_2 = phi_a3;
  126. temp_a1_3 = &spA4;
  127. if (temp_f0 < 30.0f) {
  128. phi_f2_2 = 0.0f;
  129. phi_f16 = 0.0f;
  130. } else {
  131. if (this->actor.child != 0) {
  132. phi_f2 = 30.0f;
  133. } else {
  134. if (temp_a3_2 != 0) {
  135. phi_f2 = 50.0f;
  136. } else {
  137. phi_f2 = 200.0f;
  138. }
  139. }
  140. phi_f16_2 = temp_f0 - phi_f2;
  141. if (temp_f0 <= phi_f2) {
  142. phi_f16_2 = 0.0f;
  143. }
  144. phi_f2_2 = phi_f16_2 / temp_f0;
  145. phi_f16 = phi_f16_2;
  146. }
  147. spA4 = spB0 * phi_f2_2;
  148. spA8 = spB4 * phi_f2_2;
  149. spAC = spB8 * phi_f2_2;
  150. if (this->actor.child == 0) {
  151. spBC = temp_a3_2;
  152. sp9C = phi_f16;
  153. Math_Vec3f_Sum(temp_a0, &spA4, sp44);
  154. if (temp_a3_2 != 0) {
  155. sp9C = phi_f16;
  156. Math_Vec3f_Sum(sp44, &this->unk_1FC, &temp_a3_2->currPosRot);
  157. }
  158. } else {
  159. sp9C = phi_f16;
  160. Math_Vec3f_Diff(&spB0, temp_a1_3, &spC4->base.velocity);
  161. spC4->base.currPosRot.rot.x = atans_flip(sqrtf((spB0 * spB0) + (spB8 * spB8)), -spB4);
  162. }
  163. if (phi_f16 < 50.0f) {
  164. sp9C = phi_f16;
  165. func_808C1198(this);
  166. if (phi_f16 == 0.0f) {
  167. func_808C1030(this, &func_808C10F8);
  168. if (func_808C1168(this, spC4) != 0) {
  169. Math_Vec3f_Diff(sp44, &spC4->base.currPosRot, &spC4->base.velocity);
  170. spC4->base.velocity.y = spC4->base.velocity.y - 20.0f;
  171. return;
  172. }
  173. }
  174. }
  175. } else {
  176. Actor_SetVelocityAndMoveYRotationAndGravity(this);
  177. temp_a0_2 = &this->actor.currPosRot;
  178. sp44 = temp_a0_2;
  179. Math_Vec3f_Diff(temp_a0_2, &this->actor.lastPos, &sp6C);
  180. temp_a0_3 = &this->unk_1E0;
  181. sp40 = temp_a0_3;
  182. Math_Vec3f_Sum(temp_a0_3, &sp6C, temp_a0_3);
  183. temp_f0_2 = this->unk_1EC.x;
  184. this->actor.shape.rot.x = atans_flip(this->actor.speedXZ, -this->actor.velocity.y);
  185. sp60 = temp_f0_2 - (this->unk_1E0.x - temp_f0_2);
  186. temp_f2_2 = this->unk_1EC.y;
  187. temp_a0_4 = &globalCtx->colCtx;
  188. sp64 = temp_f2_2 - (this->unk_1E0.y - temp_f2_2);
  189. temp_f12_2 = this->unk_1EC.z;
  190. sp3C = temp_a0_4;
  191. sp68 = temp_f12_2 - (this->unk_1E0.z - temp_f12_2);
  192. if (func_800C55C4(temp_a0_4, &sp60, sp40, &sp78, &sp88, 1, 1, 1, 1, &sp84) != 0) {
  193. if (func_800B90AC(globalCtx, this, sp88, sp84, &sp78) == 0) {
  194. block_44:
  195. temp_f0_3 = D_808C1C60;
  196. sp5C = sp88->unk8 * temp_f0_3;
  197. sp58 = sp88->unkC * temp_f0_3;
  198. Math_Vec3f_Copy(sp44, &sp78);
  199. this->actor.currPosRot.pos.x = this->actor.currPosRot.pos.x + (10.0f * sp5C);
  200. this->timer = 1;
  201. this->actor.currPosRot.pos.z = this->actor.currPosRot.pos.z + (10.0f * sp58);
  202. func_800C9CEC();
  203. if (ERROR(Read from unset register $v0) == 0) {
  204. func_800E8668(globalCtx, sp44);
  205. func_8019F1C0(&this->actor.projectedPos, 0x1813);
  206. return;
  207. }
  208. if (sp84 != 0x32) {
  209. temp_v0_2 = BgCheck_GetActorOfMesh(sp3C, sp84);
  210. if (temp_v0_2 != 0) {
  211. func_808C125C(this, temp_v0_2);
  212. }
  213. }
  214. func_808C1154(this);
  215. func_8019F1C0(&this->actor.projectedPos, 0x1829);
  216. return;
  217. }
  218. if (func_800C576C(sp3C, &sp60, sp40, &sp78, &sp88, 1, 1, 1, 1, &sp84) != 0) {
  219. goto block_44;
  220. }
  221. }
  222. if ((globalCtx->unk20 & 0xC01F) != 0) {
  223. this->timer = 1;
  224. }
  225. }
  226. }
  227.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement