TrogWW

Sidle Move Function

Feb 14th, 2021
936
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 5.78 KB | None | 0 0
  1.  
  2. /* __thiscall daPy_lk_c::procWHideMove(void) */
  3.  
  4. void __thiscall procWHideMove(daPy_lk_c *this)
  5.  
  6. {
  7.   float fVar1;
  8.   daPy_lk_c *this_00;
  9.   int iVar2;
  10.   undefined4 uVar3;
  11.   float *pfVar4;
  12.   short sVar6;
  13.   cM3dGPla *pcVar5;
  14.   cXyz acStack72 [12];
  15.   cXyz acStack60 [12];
  16.   cXyz acStack48 [12];
  17.   cXyz acStack36 [36];
  18.  
  19.   this_00 = (daPy_lk_c *)FUN_80326940();
  20.   iVar2 = changeSlideProc(this_00);
  21.   if (iVar2 == 0) {
  22.     getWHideBasePos(this_00,acStack36);
  23.     sVar6 = *(short *)(this_00 + 0x206);
  24.     iVar2 = changeWHideEndProc(this_00,acStack36);
  25.     fVar1 = @8345;
  26.     if (iVar2 == 0) {
  27.       pfVar4 = (float *)GetTriPla((cBgS *)&DAT_803b93a8,(uint)*(ushort *)(this_00 + 0x646),
  28.                                   (uint)*(ushort *)(this_00 + 0x644));
  29.       sVar6 = cM_atan2s((double)*pfVar4,(double)pfVar4[2]);
  30.       iVar2 = checkWHideModeChange(this_00,acStack36);
  31.       fVar1 = @4965;
  32.       if ((((iVar2 == 0) && (@6249 < *(float *)(this_00 + 0x35b0))) &&
  33.           (@4865 != *(float *)(this_00 + 0x500))) &&
  34.          (iVar2 = GetTriPla((cBgS *)&DAT_803b93a8,(uint)*(ushort *)(this_00 + 0x556),
  35.                             (uint)*(ushort *)(this_00 + 0x554)), fVar1 = @4965,
  36.          @5622 <= *(float *)(iVar2 + 4))) {
  37.         iVar2 = getDirectionFromCurrentAngle(this_00);
  38.         if (iVar2 == 1) {
  39.           *(short *)(this_00 + 0x206) = *(short *)(this_00 + 0x206) + -0x8000;
  40.           *(float *)(this_00 + 0x35bc) = *(float *)(this_00 + 0x35bc) * @5622;
  41.           if (this_00[0x34b8] == (daPy_lk_c)0x2) {
  42.             this_00[0x34b8] = (daPy_lk_c)0x3;
  43.           }
  44.           else {
  45.             this_00[0x34b8] = (daPy_lk_c)0x2;
  46.           }
  47.           setBlendWHideMoveAnime(this_00,@4864);
  48.         }
  49.         if ((iVar2 == 0) || (fVar1 = @4965, iVar2 == 1)) {
  50.           fVar1 = *(float *)(this_00 + 0x35b0) * 3.50000000;
  51.         }
  52.       }
  53.       setNormalSpeedF(this_00,fVar1,@5622,@4864,@6242);
  54.       getWHideNextPos(this_00,acStack36,acStack48);
  55.       if (((*(uint *)(this_00 + 0x29c) & 0x10000) == 0) ||
  56.          (iVar2 = checkWHideFrontFloor(this_00,acStack48), iVar2 != 0)) {
  57.         pcVar5 = (cM3dGPla *)
  58.                  getWHideModePolygon(this_00,acStack36,acStack48,acStack60,
  59.                                      (uint)(byte)this_00[0x34b8]);
  60.         if (pcVar5 == (cM3dGPla *)0x0) {
  61.           if (@5618 < ABS(*(float *)(this_00 + 0x35bc))) {
  62.             if (((@4865 == *(float *)(this_00 + 0x500)) ||
  63.                 (iVar2 = GetTriPla((cBgS *)&DAT_803b93a8,(uint)*(ushort *)(this_00 + 0x556),
  64.                                    (uint)*(ushort *)(this_00 + 0x554)),
  65.                 *(float *)(iVar2 + 4) < @5622)) ||
  66.                (iVar2 = checkWHideBackWall(this_00,acStack48), iVar2 == 0)) {
  67.               *(float *)(this_00 + 0x35bc) = @4965;
  68.               uVar3 = procWHideWait_init(this_00);
  69.             }
  70.             else {
  71.               if ((sVar6 != *(short *)(this_00 + 0x20e)) &&
  72.                  (iVar2 = getWHideModePolygon(this_00,(cXyz *)0x0,(cXyz *)0x0,acStack72,
  73.                                               (uint)(byte)this_00[0x34b8]), iVar2 != 0)) {
  74.                 if ((short)(*(short *)(this_00 + 0x206) - *(short *)(this_00 + 0x20e)) < 1) {
  75.                   *(short *)(this_00 + 0x206) = sVar6 + -0x4000;
  76.                 }
  77.                 else {
  78.                   *(short *)(this_00 + 0x206) = sVar6 + 0x4000;
  79.                 }
  80.                 *(short *)(this_00 + 0x20e) = sVar6;
  81.                 fVar1 = @6245;
  82.                 *(float *)(this_00 + 0x1f8) =
  83.                      *(float *)(this_00 + 0x1f8) +
  84.                      @6245 * *(float *)(jmaSinTable +
  85.                                        ((int)((int)*(short *)(this_00 + 0x206) & 0xffffU) >>
  86.                                        (jmaSinShift & 0x3f)) * 4);
  87.                 *(float *)(this_00 + 0x200) =
  88.                      *(float *)(this_00 + 0x200) +
  89.                      fVar1 * *(float *)(jmaCosTable +
  90.                                        ((int)((int)*(short *)(this_00 + 0x206) & 0xffffU) >>
  91.                                        (jmaSinShift & 0x3f)) * 4);
  92.               }
  93.               fVar1 = @6029 * 8.50000000;
  94.               *(float *)(this_00 + 0x1f8) =
  95.                    *(float *)(this_00 + 0x1f8) -
  96.                    fVar1 * *(float *)(jmaSinTable +
  97.                                      ((int)((int)*(short *)(this_00 + 0x20e) & 0xffffU) >>
  98.                                      (jmaSinShift & 0x3f)) * 4);
  99.               *(float *)(this_00 + 0x200) =
  100.                    *(float *)(this_00 + 0x200) -
  101.                    fVar1 * *(float *)(jmaCosTable +
  102.                                      ((int)((int)*(short *)(this_00 + 0x20e) & 0xffffU) >>
  103.                                      (jmaSinShift & 0x3f)) * 4);
  104.               setBlendWHideMoveAnime(this_00,@4964);
  105.               uVar3 = 1;
  106.             }
  107.           }
  108.           else {
  109.             uVar3 = procWHideWait_init(this_00);
  110.           }
  111.         }
  112.         else {
  113.           uVar3 = procWHideReady_init(this_00,pcVar5,acStack60);
  114.         }
  115.       }
  116.       else {
  117.         *(float *)(this_00 + 0x35bc) = @4965;
  118.         uVar3 = procWHideWait_init(this_00);
  119.       }
  120.     }
  121.     else {
  122.       if ((((byte)this_00[0x34c9] & 1) == 0) && (@6249 < *(float *)(this_00 + 0x35b0))) {
  123.         *(float *)(this_00 + 0x1f8) =
  124.              *(float *)(this_00 + 0x1f8) +
  125.              @8345 * *(float *)(jmaSinTable +
  126.                                ((int)((int)sVar6 & 0xffffU) >> (jmaSinShift & 0x3f)) * 4);
  127.         *(float *)(this_00 + 0x200) =
  128.              *(float *)(this_00 + 0x200) +
  129.              fVar1 * *(float *)(jmaCosTable +
  130.                                ((int)((int)sVar6 & 0xffffU) >> (jmaSinShift & 0x3f)) * 4);
  131.       }
  132.       uVar3 = 1;
  133.     }
  134.   }
  135.   else {
  136.     uVar3 = 1;
  137.   }
  138.   FUN_8032698c(uVar3);
  139.   return;
  140. }
  141.  
  142.  
Advertisement
Add Comment
Please, Sign In to add comment