Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void func_808C12A4(ArmsHook *this, GlobalContext *globalCtx) {
- ActorPlayer *spC4;
- struct Actor *spC0;
- Actor *spBC;
- f32 spB0;
- f32 spAC;
- f32 spA8;
- f32 spA4;
- f32 sp9C;
- f32 sp94;
- f32 sp90;
- s32 sp88;
- s32 sp84;
- ? sp78;
- ? sp6C;
- f32 sp68;
- f32 sp64;
- f32 sp60;
- f32 sp5C;
- f32 sp58;
- PosRot *sp44;
- Vec3f *sp40;
- CollisionContext *sp3C;
- Actor *temp_a3;
- Actor *temp_a3_2;
- ActorPlayer *temp_a2;
- CollisionContext *temp_a0_4;
- DynaPolyActor *temp_v0_2;
- PosRot *temp_a0_2;
- PosRot *temp_a1_2;
- Vec3f *temp_a0;
- Vec3f *temp_a0_3;
- f32 *temp_a1_3;
- f32 temp_f0;
- f32 temp_f0_2;
- f32 temp_f0_3;
- f32 temp_f12;
- f32 temp_f12_2;
- f32 temp_f14;
- f32 temp_f2;
- f32 temp_f2_2;
- s16 temp_v1;
- struct Actor *temp_a1;
- struct ColBodyInfo_t *temp_v0;
- s16 phi_v0;
- Actor *phi_a3;
- f32 phi_f2;
- f32 phi_f2_2;
- f32 phi_f16;
- f32 phi_f16_2;
- temp_a2 = globalCtx->unk1CCC;
- if (this->actor.parent == 0) {
- block_2:
- func_808C1198(this);
- Actor_MarkForDeath(this);
- return;
- }
- spC4 = temp_a2;
- if (func_801240C8(temp_a2) == 0) {
- goto block_2;
- }
- func_800B8F98(spC4, 0x100B);
- func_808C11C0(this);
- temp_v1 = this->timer;
- if (temp_v1 != 0) {
- if ((this->collider.base.flagsAT & 2) != 0) {
- temp_v0 = this->collider.body.unk20;
- if (temp_v0->unk14 != 4) {
- temp_a1 = this->collider.base.collisionAT;
- if (temp_a1->update != 0) {
- if ((temp_a1->flags & 0x600) != 0) {
- if ((temp_v0->unk16 & 4) != 0) {
- spC0 = temp_a1;
- func_808C125C(this, temp_a1);
- if ((temp_a1->flags & 0x400) == 0x400) {
- func_808C1154(this);
- }
- }
- }
- }
- this->timer = 0;
- func_8019F1C0(&this->actor.projectedPos, 0x1814);
- return;
- }
- }
- }
- if (temp_v1 == 0) {
- phi_v0 = 0;
- } else {
- this->timer = temp_v1 - 1;
- phi_v0 = this->timer;
- }
- if (phi_v0 == 0) {
- temp_a3 = this->grabbed;
- phi_a3 = temp_a3;
- if (temp_a3 != 0) {
- if ((temp_a3->update == 0) || ((temp_a3->flags & 0x2000) != 0x2000)) {
- this->grabbed = NULL;
- phi_a3 = NULL;
- } else {
- phi_a3 = temp_a3;
- if (this->actor.child != 0) {
- spBC = temp_a3;
- sp94 = Actor_DistanceBetweenActors(this, temp_a3);
- temp_f2 = this->unk_1FC.x;
- temp_f12 = this->unk_1FC.y;
- temp_f14 = this->unk_1FC.z;
- sp90 = sqrtf(((temp_f2 * temp_f2) + (temp_f12 * temp_f12)) + (temp_f14 * temp_f14));
- Math_Vec3f_Diff(&temp_a3->currPosRot, &this->unk_1FC, &this->actor.currPosRot);
- phi_a3 = temp_a3;
- if (50.0f < (sp94 - sp90)) {
- func_808C1198(this);
- phi_a3 = NULL;
- }
- }
- }
- }
- temp_a1_2 = &this->actor.currPosRot;
- sp44 = temp_a1_2;
- temp_a0 = &spC4->unk368;
- sp40 = temp_a0;
- spBC = phi_a3;
- temp_f0 = Math_Vec3f_DistXYZAndStoreDiff(temp_a0, temp_a1_2, &spB0);
- temp_a3_2 = phi_a3;
- temp_a1_3 = &spA4;
- if (temp_f0 < 30.0f) {
- phi_f2_2 = 0.0f;
- phi_f16 = 0.0f;
- } else {
- if (this->actor.child != 0) {
- phi_f2 = 30.0f;
- } else {
- if (temp_a3_2 != 0) {
- phi_f2 = 50.0f;
- } else {
- phi_f2 = 200.0f;
- }
- }
- phi_f16_2 = temp_f0 - phi_f2;
- if (temp_f0 <= phi_f2) {
- phi_f16_2 = 0.0f;
- }
- phi_f2_2 = phi_f16_2 / temp_f0;
- phi_f16 = phi_f16_2;
- }
- spA4 = spB0 * phi_f2_2;
- spA8 = spB4 * phi_f2_2;
- spAC = spB8 * phi_f2_2;
- if (this->actor.child == 0) {
- spBC = temp_a3_2;
- sp9C = phi_f16;
- Math_Vec3f_Sum(temp_a0, &spA4, sp44);
- if (temp_a3_2 != 0) {
- sp9C = phi_f16;
- Math_Vec3f_Sum(sp44, &this->unk_1FC, &temp_a3_2->currPosRot);
- }
- } else {
- sp9C = phi_f16;
- Math_Vec3f_Diff(&spB0, temp_a1_3, &spC4->base.velocity);
- spC4->base.currPosRot.rot.x = atans_flip(sqrtf((spB0 * spB0) + (spB8 * spB8)), -spB4);
- }
- if (phi_f16 < 50.0f) {
- sp9C = phi_f16;
- func_808C1198(this);
- if (phi_f16 == 0.0f) {
- func_808C1030(this, &func_808C10F8);
- if (func_808C1168(this, spC4) != 0) {
- Math_Vec3f_Diff(sp44, &spC4->base.currPosRot, &spC4->base.velocity);
- spC4->base.velocity.y = spC4->base.velocity.y - 20.0f;
- return;
- }
- }
- }
- } else {
- Actor_SetVelocityAndMoveYRotationAndGravity(this);
- temp_a0_2 = &this->actor.currPosRot;
- sp44 = temp_a0_2;
- Math_Vec3f_Diff(temp_a0_2, &this->actor.lastPos, &sp6C);
- temp_a0_3 = &this->unk_1E0;
- sp40 = temp_a0_3;
- Math_Vec3f_Sum(temp_a0_3, &sp6C, temp_a0_3);
- temp_f0_2 = this->unk_1EC.x;
- this->actor.shape.rot.x = atans_flip(this->actor.speedXZ, -this->actor.velocity.y);
- sp60 = temp_f0_2 - (this->unk_1E0.x - temp_f0_2);
- temp_f2_2 = this->unk_1EC.y;
- temp_a0_4 = &globalCtx->colCtx;
- sp64 = temp_f2_2 - (this->unk_1E0.y - temp_f2_2);
- temp_f12_2 = this->unk_1EC.z;
- sp3C = temp_a0_4;
- sp68 = temp_f12_2 - (this->unk_1E0.z - temp_f12_2);
- if (func_800C55C4(temp_a0_4, &sp60, sp40, &sp78, &sp88, 1, 1, 1, 1, &sp84) != 0) {
- if (func_800B90AC(globalCtx, this, sp88, sp84, &sp78) == 0) {
- block_44:
- temp_f0_3 = D_808C1C60;
- sp5C = sp88->unk8 * temp_f0_3;
- sp58 = sp88->unkC * temp_f0_3;
- Math_Vec3f_Copy(sp44, &sp78);
- this->actor.currPosRot.pos.x = this->actor.currPosRot.pos.x + (10.0f * sp5C);
- this->timer = 1;
- this->actor.currPosRot.pos.z = this->actor.currPosRot.pos.z + (10.0f * sp58);
- func_800C9CEC();
- if (ERROR(Read from unset register $v0) == 0) {
- func_800E8668(globalCtx, sp44);
- func_8019F1C0(&this->actor.projectedPos, 0x1813);
- return;
- }
- if (sp84 != 0x32) {
- temp_v0_2 = BgCheck_GetActorOfMesh(sp3C, sp84);
- if (temp_v0_2 != 0) {
- func_808C125C(this, temp_v0_2);
- }
- }
- func_808C1154(this);
- func_8019F1C0(&this->actor.projectedPos, 0x1829);
- return;
- }
- if (func_800C576C(sp3C, &sp60, sp40, &sp78, &sp88, 1, 1, 1, 1, &sp84) != 0) {
- goto block_44;
- }
- }
- if ((globalCtx->unk20 & 0xC01F) != 0) {
- this->timer = 1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement