Exemplo n.º 1
0
    // Token: 0x0600076A RID: 1898 RVA: 0x00041770 File Offset: 0x0003F970
    private static void gmGmkSwDispFunc(OBS_OBJECT_WORK obj_work)
    {
        AppMain.GMS_GMK_SW_WORK gms_GMK_SW_WORK = (AppMain.GMS_GMK_SW_WORK)obj_work;
        AppMain.VecFx32         vecFx           = default(AppMain.VecFx32);
        uint disp_flag = obj_work.disp_flag;

        vecFx.Assign(obj_work.pos);
        vecFx.y += gms_GMK_SW_WORK.top_pos_y << 12;
        AppMain.ObjDrawAction3DNN(obj_work.obj_3d, new AppMain.VecFx32?(vecFx), new AppMain.VecU16?(obj_work.dir), obj_work.scale, ref obj_work.disp_flag);
        AppMain.ObjDrawAction3DNN(gms_GMK_SW_WORK.obj_3d_base, new AppMain.VecFx32?(obj_work.pos), new AppMain.VecU16?(obj_work.dir), obj_work.scale, ref disp_flag);
    }
Exemplo n.º 2
0
    private static bool gmGmkBumperCheckHit(
        AppMain.VecFx32 gimmick_pos,
        AppMain.VecFx32 target_pos,
        int type)
    {
        switch (type)
        {
        case 0:
            AppMain.VecFx32 vecFx32_1 = new AppMain.VecFx32(gimmick_pos);
            vecFx32_1.y += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][3]);
            AppMain.VecFx32 line_end1 = new AppMain.VecFx32();
            line_end1.Assign(gimmick_pos);
            line_end1.x += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][0]);
            line_end1.y += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][3] * 0.5f);
            AppMain.VecFx32 line_start1 = new AppMain.VecFx32();
            line_start1.Assign(gimmick_pos);
            line_start1.x += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][2]);
            line_start1.y += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][3] * 0.5f);
            if (AppMain.gmGmkBumperCheckLeft(line_start1, vecFx32_1, target_pos) || AppMain.gmGmkBumperCheckLeft(vecFx32_1, line_end1, target_pos))
            {
                return(false);
            }
            break;

        case 1:
            AppMain.VecFx32 vecFx32_2 = new AppMain.VecFx32();
            vecFx32_2.Assign(gimmick_pos);
            vecFx32_2.y += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][1]);
            AppMain.VecFx32 line_start2 = new AppMain.VecFx32();
            line_start2.Assign(gimmick_pos);
            line_start2.x += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][0]);
            line_start2.y += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][1] * 0.4f);
            AppMain.VecFx32 line_end2 = new AppMain.VecFx32();
            line_end2.Assign(gimmick_pos);
            line_end2.x += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][2]);
            line_end2.y += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][1] * 0.4f);
            if (AppMain.gmGmkBumperCheckLeft(line_start2, vecFx32_2, target_pos) || AppMain.gmGmkBumperCheckLeft(vecFx32_2, line_end2, target_pos))
            {
                return(false);
            }
            break;

        case 2:
            AppMain.VecFx32 vecFx32_3 = new AppMain.VecFx32();
            vecFx32_3.Assign(gimmick_pos);
            vecFx32_3.x += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][2]);
            AppMain.VecFx32 line_start3 = new AppMain.VecFx32();
            line_start3.Assign(gimmick_pos);
            line_start3.x += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][2] * 0.4f);
            line_start3.y += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][1]);
            AppMain.VecFx32 line_end3 = new AppMain.VecFx32();
            line_end3.Assign(gimmick_pos);
            line_end3.x += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][2] * 0.4f);
            line_end3.y += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][3]);
            if (AppMain.gmGmkBumperCheckLeft(line_start3, vecFx32_3, target_pos) || AppMain.gmGmkBumperCheckLeft(vecFx32_3, line_end3, target_pos))
            {
                return(false);
            }
            break;

        case 3:
            AppMain.VecFx32 vecFx32_4 = new AppMain.VecFx32();
            vecFx32_4.Assign(gimmick_pos);
            vecFx32_4.x += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][0]);
            AppMain.VecFx32 line_end4 = new AppMain.VecFx32();
            line_end4.Assign(gimmick_pos);
            line_end4.x += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][0] * 0.4f);
            line_end4.y += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][1]);
            AppMain.VecFx32 line_start4 = new AppMain.VecFx32();
            line_start4.Assign(gimmick_pos);
            line_start4.x += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][0] * 0.4f);
            line_start4.y += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][3]);
            if (AppMain.gmGmkBumperCheckLeft(line_start4, vecFx32_4, target_pos) || AppMain.gmGmkBumperCheckLeft(vecFx32_4, line_end4, target_pos))
            {
                return(false);
            }
            break;

        case 4:
            AppMain.VecFx32 line_start5 = new AppMain.VecFx32(gimmick_pos);
            line_start5.x += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][2]);
            line_start5.y += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][3] * 0.2f);
            AppMain.VecFx32 line_end5 = new AppMain.VecFx32(gimmick_pos);
            line_end5.x += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][2] * 0.2f);
            line_end5.y += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][3]);
            if (AppMain.gmGmkBumperCheckLeft(line_start5, line_end5, target_pos))
            {
                return(false);
            }
            break;

        case 5:
            AppMain.VecFx32 line_start6 = new AppMain.VecFx32(gimmick_pos);
            line_start6.x += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][2] * 0.2f);
            line_start6.y += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][1]);
            AppMain.VecFx32 line_end6 = new AppMain.VecFx32(gimmick_pos);
            line_end6.x += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][2]);
            line_end6.y += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][1] * 0.2f);
            if (AppMain.gmGmkBumperCheckLeft(line_start6, line_end6, target_pos))
            {
                return(false);
            }
            break;

        case 6:
            AppMain.VecFx32 line_end7 = new AppMain.VecFx32(gimmick_pos);
            line_end7.x += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][0]);
            line_end7.y += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][3] * 0.2f);
            AppMain.VecFx32 line_start7 = new AppMain.VecFx32(gimmick_pos);
            line_start7.x += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][0] * 0.2f);
            line_start7.y += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][3]);
            if (AppMain.gmGmkBumperCheckLeft(line_start7, line_end7, target_pos))
            {
                return(false);
            }
            break;

        case 7:
            AppMain.VecFx32 line_end8 = new AppMain.VecFx32(gimmick_pos);
            line_end8.x += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][2] * 0.2f);
            line_end8.y += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][1]);
            AppMain.VecFx32 line_start8 = new AppMain.VecFx32(gimmick_pos);
            line_start8.x += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][0]);
            line_start8.y += AppMain.FX_F32_TO_FX32((float)AppMain.g_gmk_bumper_rect[type][1] * 0.2f);
            if (AppMain.gmGmkBumperCheckLeft(line_start8, line_end8, target_pos))
            {
                return(false);
            }
            break;
        }
        return(true);
    }
Exemplo n.º 3
0
    public static void gmGmkSwWallDispFunc(AppMain.OBS_OBJECT_WORK obj_work)
    {
        AppMain.GMS_GMK_SWWALL_WORK gmsGmkSwwallWork = (AppMain.GMS_GMK_SWWALL_WORK)obj_work;
        AppMain.VecFx32             vecFx32          = new AppMain.VecFx32();
        AppMain.VecFx32             scale            = new AppMain.VecFx32();
        AppMain.VecU16 vecU16 = new AppMain.VecU16();
        int            num1   = (gmsGmkSwwallWork.wall_draw_size + 131071) / 131072;

        AppMain.OBS_COLLISION_WORK colWork = gmsGmkSwwallWork.gmk_work.ene_com.col_work;
        vecFx32.Assign(obj_work.pos);
        int num2;
        int num3 = num2 = 0;

        if (gmsGmkSwwallWork.wall_type <= (ushort)1)
        {
            if (gmsGmkSwwallWork.wall_type == (ushort)0)
            {
                vecFx32.x += (int)colWork.obj_col.width + (int)colWork.obj_col.ofst_x - 16 << 12;
                num3       = -131072;
            }
            else
            {
                vecFx32.x += (int)colWork.obj_col.ofst_x + 16 << 12;
                num3       = 131072;
            }
        }
        else if (gmsGmkSwwallWork.wall_type == (ushort)2)
        {
            vecFx32.y += (int)colWork.obj_col.height + (int)colWork.obj_col.ofst_y - 16 << 12;
            num2       = -131072;
        }
        else
        {
            vecFx32.y += (int)colWork.obj_col.ofst_y + 16 << 12;
            num2       = 131072;
        }
        uint dispFlag = obj_work.disp_flag;

        if (((int)gmsGmkSwwallWork.gmk_work.ene_com.enemy_flag & 2) != 0)
        {
            while (num1 > 0)
            {
                AppMain.ObjDrawAction3DNN(obj_work.obj_3d, new AppMain.VecFx32?(vecFx32), new AppMain.VecU16?(obj_work.dir), obj_work.scale, ref dispFlag);
                --num1;
                vecFx32.x += num3;
                vecFx32.y += num2;
            }
        }
        else
        {
            while (num1 > 0)
            {
                AppMain.ObjDrawAction3DNN(obj_work.obj_3d, new AppMain.VecFx32?(vecFx32), new AppMain.VecU16?(obj_work.dir), obj_work.scale, ref dispFlag);
                --num1;
                vecFx32.x += num3;
                vecFx32.y += num2;
            }
        }
        if (((int)gmsGmkSwwallWork.gmk_work.ene_com.enemy_flag & 1) == 0)
        {
            return;
        }
        vecU16.x = vecU16.y = (ushort)0;
        vecU16.z = (ushort)((uint)gmsGmkSwwallWork.gear_dir + (uint)gmsGmkSwwallWork.gear_base_dir);
        AppMain.ObjDrawAction3DNN(gmsGmkSwwallWork.obj_3d_opt[0], new AppMain.VecFx32?(gmsGmkSwwallWork.gear_pos), new AppMain.VecU16?(vecU16), obj_work.scale, ref dispFlag);
        scale.x = scale.y = scale.z = 4096;
        if (((int)gmsGmkSwwallWork.gmk_work.ene_com.enemy_flag & 4) != 0)
        {
            scale.x = -scale.x;
        }
        AppMain.ObjDrawAction3DNN(gmsGmkSwwallWork.obj_3d_opt[1], new AppMain.VecFx32?(gmsGmkSwwallWork.gearbase_pos), new AppMain.VecU16?(obj_work.dir), scale, ref dispFlag);
    }
    // Token: 0x06000757 RID: 1879 RVA: 0x0004096C File Offset: 0x0003EB6C
    public static void gmGmkSwWallDispFunc(AppMain.OBS_OBJECT_WORK obj_work)
    {
        AppMain.GMS_GMK_SWWALL_WORK gms_GMK_SWWALL_WORK = (AppMain.GMS_GMK_SWWALL_WORK)obj_work;
        AppMain.VecFx32             vecFx = default(AppMain.VecFx32);
        AppMain.VecFx32             scale = default(AppMain.VecFx32);
        AppMain.VecU16 vecU = default(AppMain.VecU16);
        int            i    = (gms_GMK_SWWALL_WORK.wall_draw_size + 131071) / 131072;

        AppMain.OBS_COLLISION_WORK col_work = gms_GMK_SWWALL_WORK.gmk_work.ene_com.col_work;
        vecFx.Assign(obj_work.pos);
        int num2;
        int num = num2 = 0;

        if (gms_GMK_SWWALL_WORK.wall_type <= 1)
        {
            if (gms_GMK_SWWALL_WORK.wall_type == 0)
            {
                vecFx.x += ( int )(col_work.obj_col.width + ( ushort )col_work.obj_col.ofst_x - 16) << 12;
                num2     = -131072;
            }
            else
            {
                vecFx.x += ( int )(col_work.obj_col.ofst_x + 16) << 12;
                num2     = 131072;
            }
        }
        else if (gms_GMK_SWWALL_WORK.wall_type == 2)
        {
            vecFx.y += ( int )(col_work.obj_col.height + ( ushort )col_work.obj_col.ofst_y - 16) << 12;
            num      = -131072;
        }
        else
        {
            vecFx.y += ( int )(col_work.obj_col.ofst_y + 16) << 12;
            num      = 131072;
        }
        uint disp_flag = obj_work.disp_flag;

        if ((gms_GMK_SWWALL_WORK.gmk_work.ene_com.enemy_flag & 2U) != 0U)
        {
            while (i > 0)
            {
                AppMain.ObjDrawAction3DNN(obj_work.obj_3d, new AppMain.VecFx32?(vecFx), new AppMain.VecU16?(obj_work.dir), obj_work.scale, ref disp_flag);
                i--;
                vecFx.x += num2;
                vecFx.y += num;
            }
        }
        else
        {
            while (i > 0)
            {
                AppMain.ObjDrawAction3DNN(obj_work.obj_3d, new AppMain.VecFx32?(vecFx), new AppMain.VecU16?(obj_work.dir), obj_work.scale, ref disp_flag);
                i--;
                vecFx.x += num2;
                vecFx.y += num;
            }
        }
        if ((gms_GMK_SWWALL_WORK.gmk_work.ene_com.enemy_flag & 1U) != 0U)
        {
            vecU.x = (vecU.y = 0);
            vecU.z = ( ushort )(gms_GMK_SWWALL_WORK.gear_dir + gms_GMK_SWWALL_WORK.gear_base_dir);
            AppMain.ObjDrawAction3DNN(gms_GMK_SWWALL_WORK.obj_3d_opt[0], new AppMain.VecFx32?(gms_GMK_SWWALL_WORK.gear_pos), new AppMain.VecU16?(vecU), obj_work.scale, ref disp_flag);
            scale.x = (scale.y = (scale.z = 4096));
            if ((gms_GMK_SWWALL_WORK.gmk_work.ene_com.enemy_flag & 4U) != 0U)
            {
                scale.x = -scale.x;
            }
            AppMain.ObjDrawAction3DNN(gms_GMK_SWWALL_WORK.obj_3d_opt[1], new AppMain.VecFx32?(gms_GMK_SWWALL_WORK.gearbase_pos), new AppMain.VecU16?(obj_work.dir), scale, ref disp_flag);
        }
    }
Exemplo n.º 5
0
 private static AppMain.OBS_OBJECT_WORK GmGmkGearInit(
     AppMain.GMS_EVE_RECORD_EVENT eve_rec,
     int pos_x,
     int pos_y,
     byte type)
 {
     AppMain.VecFx32           vecFx32        = new AppMain.VecFx32();
     AppMain.OBS_OBJECT_WORK   obsObjectWork  = eve_rec.id != (ushort)184 ? AppMain.GMM_ENEMY_CREATE_RIDE_WORK(eve_rec, pos_x, pos_y, (AppMain.TaskWorkFactoryDelegate)(() => (object)new AppMain.GMS_GMK_GEAR_WORK()), "GMK_GEAR") : AppMain.GMM_ENEMY_CREATE_WORK(eve_rec, pos_x, pos_y, (AppMain.TaskWorkFactoryDelegate)(() => (object)new AppMain.GMS_GMK_GEAR_WORK()), "GMK_GEAR_SW");
     AppMain.GMS_ENEMY_3D_WORK gmsEnemy3DWork = (AppMain.GMS_ENEMY_3D_WORK)obsObjectWork;
     AppMain.GMS_GMK_GEAR_WORK gear_work      = (AppMain.GMS_GMK_GEAR_WORK)obsObjectWork;
     if (eve_rec.id == (ushort)182 && eve_rec.byte_param[1] != (byte)0)
     {
         obsObjectWork.disp_flag |= 32U;
         obsObjectWork.move_flag |= 8448U;
         obsObjectWork.flag      |= 2U;
         return(obsObjectWork);
     }
     obsObjectWork.ppIn = new AppMain.MPP_VOID_OBS_OBJECT_WORK(AppMain.gmGmkGearInFunc);
     AppMain.mtTaskChangeTcbDestructor(obsObjectWork.tcb, new AppMain.GSF_TASK_PROCEDURE(AppMain.gmGmkGearDest));
     gear_work.h_snd_gear = AppMain.GsSoundAllocSeHandle();
     AppMain.GmSoundStopSE(gear_work.h_snd_gear);
     AppMain.GmSoundPlaySE("Gear", gear_work.h_snd_gear);
     if (eve_rec.id == (ushort)181)
     {
         float num = 0.2f;
         AppMain.ObjObjectCopyAction3dNNModel(obsObjectWork, AppMain.gm_gmk_gear_obj_3d_list[0], gmsEnemy3DWork.obj_3d);
         obsObjectWork.pos.z  = -131072;
         obsObjectWork.ppLast = new AppMain.MPP_VOID_OBS_OBJECT_WORK(AppMain.gmGmkGearLastFunc);
         float val = num + 0.2f * (float)AppMain.MTM_MATH_CLIP((int)eve_rec.left, 0, 3);
         gear_work.h_snd_gear.au_player.SetAisac("Speed", val);
     }
     else if (eve_rec.id == (ushort)182)
     {
         AppMain.ObjObjectCopyAction3dNNModel(obsObjectWork, AppMain.gm_gmk_gear_move_obj_3d_list[0], gmsEnemy3DWork.obj_3d);
         obsObjectWork.pos.z = -131072;
         AppMain.ObjCopyAction3dNNModel(AppMain.gm_gmk_gear_opt_obj_3d_list[0], gear_work.obj_3d_gear_opt);
         AppMain.ObjCopyAction3dNNModel(AppMain.gm_gmk_gear_opt_obj_3d_list[1], gear_work.obj_3d_gear_opt_ashiba);
         obsObjectWork.ppLast = new AppMain.MPP_VOID_OBS_OBJECT_WORK(AppMain.gmGmkGearMoveLastFunc);
     }
     else
     {
         AppMain.ObjObjectCopyAction3dNNModel(obsObjectWork, AppMain.gm_gmk_gear_sw_obj_3d_list[0], gmsEnemy3DWork.obj_3d);
         obsObjectWork.pos.z = -131072;
         AppMain.ObjCopyAction3dNNModel(AppMain.gm_gmk_gear_opt_obj_3d_list[0], gear_work.obj_3d_gear_opt);
         AppMain.ObjCopyAction3dNNModel(AppMain.gm_gmk_gear_opt_obj_3d_list[1], gear_work.obj_3d_gear_opt_ashiba);
         obsObjectWork.ppLast = new AppMain.MPP_VOID_OBS_OBJECT_WORK(AppMain.gmGmkGearMoveLastFunc);
     }
     AppMain.OBS_COLLISION_WORK colWork = gear_work.gmk_work.ene_com.col_work;
     colWork.obj_col.obj                              = (AppMain.OBS_OBJECT_WORK)gear_work;
     colWork.obj_col.width                            = (ushort)176;
     colWork.obj_col.height                           = (ushort)176;
     colWork.obj_col.ofst_x                           = (short)-88;
     colWork.obj_col.ofst_y                           = (short)-88;
     colWork.obj_col.flag                            |= 402653216U;
     obsObjectWork.move_flag                         &= 4294967167U;
     obsObjectWork.disp_flag                         |= 4194304U;
     gmsEnemy3DWork.ene_com.enemy_flag               |= 16384U;
     gmsEnemy3DWork.obj_3d.use_light_flag            &= 4294967294U;
     gmsEnemy3DWork.obj_3d.use_light_flag            |= 2U;
     gear_work.obj_3d_gear_opt_ashiba.use_light_flag &= 4294967294U;
     gear_work.obj_3d_gear_opt_ashiba.use_light_flag |= 2U;
     if (AppMain.g_gs_main_sys_info.stage_id == (ushort)14)
     {
         gear_work.obj_3d_gear_opt.use_light_flag &= 4294967294U;
         gear_work.obj_3d_gear_opt.use_light_flag |= 2U;
     }
     if (eve_rec.id == (ushort)181)
     {
         obsObjectWork.move_flag |= 8192U;
         obsObjectWork.move_flag |= 256U;
         gear_work.dir_speed      = (float)(32.0 + (double)AppMain.MTM_MATH_CLIP((int)eve_rec.left, 0, 3) * 32.0);
         if (((int)eve_rec.flag & 1) != 0)
         {
             gear_work.dir_speed = -gear_work.dir_speed;
         }
         int num = (int)(65536.0 / (double)AppMain.MTM_MATH_ABS(gear_work.dir_speed));
         gear_work.dir_temp  = (float)((long)AppMain.g_gm_main_system.sync_time % (long)num) * gear_work.dir_speed;
         gear_work.dir_temp += (float)(AppMain.MTM_MATH_CLIP((int)eve_rec.top, 0, 3) * 2048);
         float a = gear_work.dir_temp / 65536f;
         if ((double)AppMain.MTM_MATH_ABS(a) >= 1.0)
         {
             gear_work.dir_temp -= a * 65536f;
         }
         obsObjectWork.dir.z = (double)gear_work.dir_speed <= 0.0 ? (ushort)((uint)((double)AppMain.nnRoundOff(gear_work.dir_temp) + 1023.0) / 1024U * 1024U) : (ushort)((uint)AppMain.nnRoundOff(gear_work.dir_temp) / 1024U * 1024U);
         gear_work.prev_dir  = obsObjectWork.dir.z;
         AppMain.gmGmkGearChangeCol(gear_work);
         AppMain.gmGmkGearFwInit(obsObjectWork);
     }
     else if (eve_rec.id == (ushort)182)
     {
         obsObjectWork.ppOut = new AppMain.MPP_VOID_OBS_OBJECT_WORK(AppMain.gmGmkGearMoveSwDraw);
         byte[] numArray1;
         if (AppMain.gm_gmk_gear_add_data[16] is AppMain.AmbChunk)
         {
             AppMain.AmbChunk ambChunk = (AppMain.AmbChunk)AppMain.gm_gmk_gear_add_data[16];
             numArray1 = new byte[ambChunk.length];
             Buffer.BlockCopy((Array)ambChunk.array, ambChunk.offset, (Array)numArray1, 0, ambChunk.length);
             AppMain.gm_gmk_gear_add_data[16] = (object)numArray1;
         }
         else
         {
             numArray1 = (byte[])AppMain.gm_gmk_gear_add_data[16];
         }
         colWork.obj_col.diff_data = numArray1;
         byte[] numArray2;
         if (AppMain.gm_gmk_gear_add_data[17] is AppMain.AmbChunk)
         {
             AppMain.AmbChunk ambChunk = (AppMain.AmbChunk)AppMain.gm_gmk_gear_add_data[17];
             numArray2 = new byte[ambChunk.length];
             Buffer.BlockCopy((Array)ambChunk.array, ambChunk.offset, (Array)numArray2, 0, ambChunk.length);
             AppMain.gm_gmk_gear_add_data[17] = (object)numArray2;
         }
         else
         {
             numArray2 = (byte[])AppMain.gm_gmk_gear_add_data[17];
         }
         colWork.obj_col.dir_data = numArray2;
         obsObjectWork.flag      &= 4294967294U;
         obsObjectWork.disp_flag |= 16777472U;
         obsObjectWork.move_flag &= 4294967039U;
         obsObjectWork.move_flag |= 704U;
         if (((int)eve_rec.flag & 8) != 0)
         {
             obsObjectWork.user_flag |= 4U;
         }
         AppMain.OBS_RECT_WORK pRec1 = gmsEnemy3DWork.ene_com.rect_work[2];
         pRec1.ppDef = new AppMain.OBS_RECT_WORK_Delegate1(AppMain.gmGmkMoveGearBodyDefFunc);
         pRec1.ppHit = (AppMain.OBS_RECT_WORK_Delegate1)null;
         AppMain.ObjRectWorkSet(pRec1, (short)-16, (short)-72, (short)16, (short)-48);
         AppMain.OBS_RECT_WORK pRec2 = gmsEnemy3DWork.ene_com.rect_work[0];
         pRec2.ppDef = new AppMain.OBS_RECT_WORK_Delegate1(AppMain.gmGmkMoveGearDefFunc);
         pRec2.ppHit = (AppMain.OBS_RECT_WORK_Delegate1)null;
         AppMain.ObjRectAtkSet(pRec2, (ushort)0, (short)0);
         AppMain.ObjRectDefSet(pRec2, (ushort)65527, (short)0);
         AppMain.ObjRectWorkSet(pRec2, (short)-80, (short)-80, (short)80, (short)80);
         pRec2.flag |= 32U;
         AppMain.ObjObjectFieldRectSet(obsObjectWork, (short)-8, (short)-8, (short)8, (short)8);
         if (type == (byte)0)
         {
             obsObjectWork.move_flag |= 1U;
             obsObjectWork.prev_pos.Assign(obsObjectWork.pos);
             if (((int)eve_rec.flag & 1) != 0)
             {
                 obsObjectWork.dir.z       = (ushort)16384;
                 obsObjectWork.pos.x      += 32768;
                 obsObjectWork.prev_pos.x -= 32768;
                 obsObjectWork.move.x      = 65536;
                 obsObjectWork.spd.x       = 65536;
                 obsObjectWork.move_flag  &= 4294967167U;
                 obsObjectWork.user_flag  |= 8U;
             }
             else
             {
                 obsObjectWork.pos.y      += 32768;
                 obsObjectWork.prev_pos.y -= 32768;
                 obsObjectWork.move.y      = 65536;
                 obsObjectWork.spd.y       = 65536;
                 obsObjectWork.user_flag  &= 4294967287U;
             }
             AppMain.g_obj.ppCollision(obsObjectWork);
             obsObjectWork.move_flag |= 1U;
             vecFx32.Assign(obsObjectWork.pos);
             obsObjectWork.prev_pos.Assign(obsObjectWork.pos);
             obsObjectWork.move.x = obsObjectWork.move.y = 0;
             obsObjectWork.spd.x  = obsObjectWork.spd.y = 0;
             if (((int)eve_rec.flag & 1) != 0)
             {
                 if (((int)eve_rec.flag & 2) != 0)
                 {
                     obsObjectWork.prev_pos.y -= 32768;
                     obsObjectWork.move.y      = 32768;
                     obsObjectWork.spd.y       = 32768;
                     obsObjectWork.disp_flag  |= 1U;
                 }
                 else
                 {
                     obsObjectWork.prev_pos.y += 32768;
                     obsObjectWork.move.y      = (int)short.MinValue;
                     obsObjectWork.spd.y       = (int)short.MinValue;
                 }
             }
             else if (((int)eve_rec.flag & 2) != 0)
             {
                 obsObjectWork.prev_pos.x -= 32768;
                 obsObjectWork.move.x      = 32768;
                 obsObjectWork.spd.x       = 32768;
                 obsObjectWork.disp_flag  |= 1U;
             }
             else
             {
                 obsObjectWork.prev_pos.x += 32768;
                 obsObjectWork.move.x      = (int)short.MinValue;
                 obsObjectWork.spd.x       = (int)short.MinValue;
             }
             AppMain.g_obj.ppCollision(obsObjectWork);
             if (((int)obsObjectWork.move_flag & 8) != 0)
             {
                 if (((int)eve_rec.flag & 1) != 0)
                 {
                     obsObjectWork.prev_pos.y = vecFx32.y;
                 }
                 else
                 {
                     obsObjectWork.prev_pos.x = vecFx32.x;
                 }
             }
             else
             {
                 obsObjectWork.pos.Assign(vecFx32);
             }
             gear_work.move_end_x = ((int)eve_rec.flag & 2) == 0 ? (gear_work.move_end_y = int.MaxValue) : (gear_work.move_end_y = 0);
             obsObjectWork.prev_pos.Assign(obsObjectWork.pos);
             obsObjectWork.move.x     = obsObjectWork.move.y = 0;
             obsObjectWork.spd.x      = obsObjectWork.spd.y = 0;
             obsObjectWork.disp_flag &= 4294967294U;
             obsObjectWork.move_flag |= 1U;
             AppMain.gmGmkMoveGearFwInit(obsObjectWork);
         }
         else
         {
             AppMain.nnMakeRotateZMatrix(obsObjectWork.obj_3d.user_obj_mtx_r, 2730);
             AppMain.gmGmkMoveGearEndInit(obsObjectWork);
         }
     }
     else
     {
         obsObjectWork.ppOut = new AppMain.MPP_VOID_OBS_OBJECT_WORK(AppMain.gmGmkGearMoveSwDraw);
         byte[] numArray1;
         if (AppMain.gm_gmk_gear_add_data[16] is AppMain.AmbChunk)
         {
             AppMain.AmbChunk ambChunk = (AppMain.AmbChunk)AppMain.gm_gmk_gear_add_data[16];
             numArray1 = new byte[ambChunk.length];
             Buffer.BlockCopy((Array)ambChunk.array, ambChunk.offset, (Array)numArray1, 0, ambChunk.length);
             AppMain.gm_gmk_gear_add_data[16] = (object)numArray1;
         }
         else
         {
             numArray1 = (byte[])AppMain.gm_gmk_gear_add_data[16];
         }
         colWork.obj_col.diff_data = numArray1;
         byte[] numArray2;
         if (AppMain.gm_gmk_gear_add_data[17] is AppMain.AmbChunk)
         {
             AppMain.AmbChunk ambChunk = (AppMain.AmbChunk)AppMain.gm_gmk_gear_add_data[17];
             numArray2 = new byte[ambChunk.length];
             Buffer.BlockCopy((Array)ambChunk.array, ambChunk.offset, (Array)numArray2, 0, ambChunk.length);
             AppMain.gm_gmk_gear_add_data[17] = (object)numArray2;
         }
         else
         {
             numArray2 = (byte[])AppMain.gm_gmk_gear_add_data[17];
         }
         colWork.obj_col.dir_data = numArray2;
         AppMain.OBS_RECT_WORK pRec = gmsEnemy3DWork.ene_com.rect_work[1];
         AppMain.ObjRectGroupSet(pRec, (byte)0, (byte)2);
         pRec.ppDef = (AppMain.OBS_RECT_WORK_Delegate1)null;
         pRec.ppHit = new AppMain.OBS_RECT_WORK_Delegate1(AppMain.gmGmkGearSwitchAtkHitFunc);
         AppMain.ObjRectAtkSet(pRec, (ushort)8, (short)1);
         AppMain.ObjRectDefSet(pRec, ushort.MaxValue, (short)0);
         AppMain.ObjRectWorkSet(pRec, (short)-92, (short)-92, (short)92, (short)92);
         pRec.flag |= 1024U;
         obsObjectWork.disp_flag |= 16777472U;
         obsObjectWork.move_flag |= 8448U;
         gear_work.open_rot_dist  = 65536;
         if (eve_rec.height > (byte)0)
         {
             gear_work.close_rot_spd = 65536 / ((int)eve_rec.height * 30);
         }
         AppMain.gmGmkGearSwFwInit(obsObjectWork);
     }
     return(obsObjectWork);
 }
    // Token: 0x0600007B RID: 123 RVA: 0x00006C80 File Offset: 0x00004E80
    private static bool gmGmkBumperCheckHit(AppMain.VecFx32 gimmick_pos, AppMain.VecFx32 target_pos, int type)
    {
        switch (type)
        {
        case 0:
        {
            AppMain.VecFx32 vecFx = new AppMain.VecFx32(gimmick_pos);
            vecFx.y += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][3]);
            AppMain.VecFx32 line_end = default(AppMain.VecFx32);
            line_end.Assign(gimmick_pos);
            line_end.x += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][0]);
            line_end.y += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][3] * 0.5f);
            AppMain.VecFx32 line_start = default(AppMain.VecFx32);
            line_start.Assign(gimmick_pos);
            line_start.x += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][2]);
            line_start.y += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][3] * 0.5f);
            if (AppMain.gmGmkBumperCheckLeft(line_start, vecFx, target_pos) || AppMain.gmGmkBumperCheckLeft(vecFx, line_end, target_pos))
            {
                return(false);
            }
            break;
        }

        case 1:
        {
            AppMain.VecFx32 vecFx2 = default(AppMain.VecFx32);
            vecFx2.Assign(gimmick_pos);
            vecFx2.y += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][1]);
            AppMain.VecFx32 line_start2 = default(AppMain.VecFx32);
            line_start2.Assign(gimmick_pos);
            line_start2.x += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][0]);
            line_start2.y += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][1] * 0.4f);
            AppMain.VecFx32 line_end2 = default(AppMain.VecFx32);
            line_end2.Assign(gimmick_pos);
            line_end2.x += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][2]);
            line_end2.y += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][1] * 0.4f);
            if (AppMain.gmGmkBumperCheckLeft(line_start2, vecFx2, target_pos) || AppMain.gmGmkBumperCheckLeft(vecFx2, line_end2, target_pos))
            {
                return(false);
            }
            break;
        }

        case 2:
        {
            AppMain.VecFx32 vecFx3 = default(AppMain.VecFx32);
            vecFx3.Assign(gimmick_pos);
            vecFx3.x += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][2]);
            AppMain.VecFx32 line_start3 = default(AppMain.VecFx32);
            line_start3.Assign(gimmick_pos);
            line_start3.x += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][2] * 0.4f);
            line_start3.y += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][1]);
            AppMain.VecFx32 line_end3 = default(AppMain.VecFx32);
            line_end3.Assign(gimmick_pos);
            line_end3.x += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][2] * 0.4f);
            line_end3.y += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][3]);
            if (AppMain.gmGmkBumperCheckLeft(line_start3, vecFx3, target_pos) || AppMain.gmGmkBumperCheckLeft(vecFx3, line_end3, target_pos))
            {
                return(false);
            }
            break;
        }

        case 3:
        {
            AppMain.VecFx32 vecFx4 = default(AppMain.VecFx32);
            vecFx4.Assign(gimmick_pos);
            vecFx4.x += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][0]);
            AppMain.VecFx32 line_end4 = default(AppMain.VecFx32);
            line_end4.Assign(gimmick_pos);
            line_end4.x += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][0] * 0.4f);
            line_end4.y += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][1]);
            AppMain.VecFx32 line_start4 = default(AppMain.VecFx32);
            line_start4.Assign(gimmick_pos);
            line_start4.x += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][0] * 0.4f);
            line_start4.y += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][3]);
            if (AppMain.gmGmkBumperCheckLeft(line_start4, vecFx4, target_pos) || AppMain.gmGmkBumperCheckLeft(vecFx4, line_end4, target_pos))
            {
                return(false);
            }
            break;
        }

        case 4:
        {
            AppMain.VecFx32 line_start5 = new AppMain.VecFx32(gimmick_pos);
            line_start5.x += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][2]);
            line_start5.y += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][3] * 0.2f);
            AppMain.VecFx32 line_end5 = new AppMain.VecFx32(gimmick_pos);
            line_end5.x += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][2] * 0.2f);
            line_end5.y += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][3]);
            if (AppMain.gmGmkBumperCheckLeft(line_start5, line_end5, target_pos))
            {
                return(false);
            }
            break;
        }

        case 5:
        {
            AppMain.VecFx32 line_start6 = new AppMain.VecFx32(gimmick_pos);
            line_start6.x += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][2] * 0.2f);
            line_start6.y += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][1]);
            AppMain.VecFx32 line_end6 = new AppMain.VecFx32(gimmick_pos);
            line_end6.x += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][2]);
            line_end6.y += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][1] * 0.2f);
            if (AppMain.gmGmkBumperCheckLeft(line_start6, line_end6, target_pos))
            {
                return(false);
            }
            break;
        }

        case 6:
        {
            AppMain.VecFx32 line_end7 = new AppMain.VecFx32(gimmick_pos);
            line_end7.x += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][0]);
            line_end7.y += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][3] * 0.2f);
            AppMain.VecFx32 line_start7 = new AppMain.VecFx32(gimmick_pos);
            line_start7.x += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][0] * 0.2f);
            line_start7.y += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][3]);
            if (AppMain.gmGmkBumperCheckLeft(line_start7, line_end7, target_pos))
            {
                return(false);
            }
            break;
        }

        case 7:
        {
            AppMain.VecFx32 line_end8 = new AppMain.VecFx32(gimmick_pos);
            line_end8.x += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][2] * 0.2f);
            line_end8.y += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][1]);
            AppMain.VecFx32 line_start8 = new AppMain.VecFx32(gimmick_pos);
            line_start8.x += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][0]);
            line_start8.y += AppMain.FX_F32_TO_FX32(( float )AppMain.g_gmk_bumper_rect[type][1] * 0.2f);
            if (AppMain.gmGmkBumperCheckLeft(line_start8, line_end8, target_pos))
            {
                return(false);
            }
            break;
        }
        }
        return(true);
    }