public int DAT_94; //0x94 //FUN_24CC (HARBOR.DLL) public override uint UpdateW(int arg1, int arg2) { sbyte sVar1; VigObject oVar2; int iVar3; RSEG_DB unaff_s3; CraneLarge ppcVar4; int iVar6; RSEG_DB rVar6; long lVar6; VigObject oVar6; ConfigContainer ccVar6; RSEG_DB piVar7; JUNC_DB jVar8; int iVar9; JUNC_DB jVar9; Vector3Int local_50; Vector3Int local_40; Vector3Int local_38; Vector3Int local_30; switch (arg1) { case 0: break; case 1: rVar6 = LevelManager.instance.FUN_518DC(screen, id - 100); DAT_88 = rVar6; DAT_90 = 1; iVar9 = rVar6.FUN_51334(screen); DAT_94 = iVar9 << 16; DAT_8C = 6103; flags |= 0x88; return(0); case 2: iVar6 = 120; if (id == 117) { iVar6 = 121; } ppcVar4 = (CraneLarge)GameManager.instance.FUN_318D0(iVar6); if (ppcVar4.GetType().IsSubclassOf(typeof(VigObject))) { ppcVar4.UpdateW(21, null); } FUN_30B78(); return(0); case 4: iVar6 = 120; if (id == 117) { iVar6 = 121; } ppcVar4 = (CraneLarge)GameManager.instance.FUN_318D0(iVar6); if (!ppcVar4.GetType().IsSubclassOf(typeof(VigObject))) { return(0); } ppcVar4.UpdateW(21, null); return(0); default: return(0); case 8: FUN_32B90((uint)arg2); return(0); case 9: if (arg2 != 0) { GameManager.instance.FUN_309A0(this); return(0); } return(0); } switch (((byte)tags - 1) * 0x1000000 >> 24) { case 0: case 8: iVar9 = DAT_8C + 33; goto LAB_261C; case 1: case 4: if (DAT_84 == null) { goto case 12; } if (DAT_84.tags == 0) { goto case 5; } if (DAT_90 == 0) { iVar9 = DAT_94; } else { iVar9 = 0x10000000 - DAT_94; } if (iVar9 < 0) { iVar9 += 0xffff; } iVar9 = (iVar9 >> 16) * 4577; if (iVar9 < 0) { iVar9 += 4095; } goto LAB_2694; case 2: case 5: if (DAT_84 == null || DAT_84.tags == 0) { goto case 12; } break; case 6: case 7: if (DAT_90 == 0) { iVar9 = DAT_94; } else { iVar9 = 0x10000000 - DAT_94; } if (iVar9 < 0) { iVar9 += 0xffff; } iVar9 = (iVar9 >> 16) * 4577; if (iVar9 < 0) { iVar9 += 4095; } LAB_2694: iVar3 = 305; if (305 < iVar9 >> 12) { iVar3 = iVar9 >> 12; } DAT_8C = iVar3; break; case 11: iVar9 = DAT_8C + 3; goto LAB_261C; case 12: iVar9 = DAT_8C + 33; LAB_261C: iVar3 = 6103; if (iVar9 < 6103) { iVar3 = iVar9; } DAT_8C = iVar3; break; } iVar9 = DAT_94; iVar6 = vTransform.position.y; if (iVar9 < 0) { iVar9 += 0xffff; } DAT_88.FUN_285E4(iVar9 >> 16, ref vTransform.position, out local_50); vTransform.position.y = iVar6; local_38 = new Vector3Int(); iVar6 = FUN_2CFBC(vTransform.position, ref local_38); vTransform.position.y = iVar6; if (DAT_90 == 0) { local_50.x = -local_50.x; local_50.z = -local_50.z; } local_50.y = -(local_50.x * local_38.x + local_50.z * local_38.z) / local_38.y; lVar6 = Utilities.VectorNormal2(local_50, out local_30); iVar9 = (int)Utilities.SquareRoot(lVar6); if (DAT_90 == 0) { iVar3 = DAT_8C * -0x10000; } else { iVar3 = DAT_8C << 16; } DAT_94 += iVar3 / iVar9; local_40 = Utilities.FUN_2A1E0(local_38, local_30); vTransform.rotation.V00 = (short)-local_40.x; vTransform.rotation.V10 = (short)-local_40.y; vTransform.rotation.V20 = (short)-local_40.z; vTransform.rotation.V01 = (short)-local_38.x; vTransform.rotation.V11 = (short)-local_38.y; vTransform.rotation.V22 = (short)-local_38.z; vTransform.rotation.V02 = (short)local_30.x; vTransform.rotation.V12 = (short)local_30.y; vTransform.rotation.V22 = (short)local_30.z; if ((uint)DAT_94 < 0x10000001) { return(0); } piVar7 = DAT_88; jVar8 = piVar7.DAT_00[DAT_90]; iVar3 = 0; unaff_s3 = null; //not in the original code if (jVar8.DAT_11 != 0) { do { unaff_s3 = jVar8.DAT_1C[iVar3]; if (unaff_s3 != piVar7 && unaff_s3.DAT_08 == piVar7.DAT_08) { break; } iVar3++; } while (iVar3 < jVar8.DAT_11); } DAT_88 = unaff_s3; jVar9 = unaff_s3.DAT_00[0]; DAT_90 = jVar9 == jVar8 ? 1 : 0; DAT_94 = ((jVar9 == jVar8 ? 1 : 0) == 0 ? 1 : 0) << 28; if ((jVar8.DAT_10 & 0x40) == 0) { return(0); } sVar1 = (sbyte)jVar8.DAT_12; tags = sVar1; switch (sVar1) { case 1: FUN_30BA8(); GameManager.instance.FUN_30CB0(this, 600); iVar6 = 120; if (id == 117) { iVar6 = 121; } ppcVar4 = (CraneLarge)GameManager.instance.FUN_318D0(iVar6); if (ppcVar4.GetType().IsSubclassOf(typeof(VigObject))) { ppcVar4.UpdateW(21, this); } break; case 2: iVar6 = 49; goto LAB_29EC; case 3: case 6: if (DAT_84 != null) { if (DAT_84.tags != 0) { DAT_8C = 0; return(0); } return(0); } break; case 4: if (DAT_80 == null) { ccVar6 = FUN_2C5F4(0x8000); oVar2 = Barge.FUN_1F64(); DAT_80 = oVar2; Utilities.FUN_2CB04(this, ccVar6, oVar2); Utilities.ParentChildren(this, this); return(0); } return(0); case 5: iVar6 = 50; LAB_29EC: oVar6 = GameManager.instance.FUN_318D0(iVar6); DAT_84 = oVar6; break; case 9: FUN_30BA8(); GameManager.instance.FUN_30CB0(this, 180); return(0); case 10: if (DAT_80 == null) { return(0); } oVar6 = DAT_80.FUN_2CCBC(); GameManager.instance.FUN_307CC(oVar6); DAT_80 = null; break; } return(0); }
public int DAT_94; //0x94 //FUN_2C1C (HARBOR.DLL) public override uint UpdateW(int arg1, int arg2) { bool bVar1; sbyte sVar2; Vector3Int v3Var3; int iVar4; VigObject oVar4; ConfigContainer ccVar4; int iVar5; uint uVar5; VigObject oVar5; ConfigContainer ccVar5; Vector3Int v3Var5; int iVar6; VigObject oVar6; int iVar7; bool bVar7; VigObject oVar7; VigObject oVar8; int iVar9; Vector3Int auStack24; switch (arg1) { case 0: oVar7 = child2; oVar8 = oVar7.child2; switch (((byte)tags - 1) * 0x1000000 >> 24) { case 0: case 3: iVar4 = oVar7.vTransform.position.z + DAT_94; oVar7.vTransform.position.z = iVar4; if (DAT_88.z - iVar4 < 0) { iVar4 = DAT_94 - 25; iVar7 = -1525; if (-1526 < iVar4) { iVar7 = 0; if (iVar4 < 1) { iVar7 = iVar4; } } DAT_94 = iVar7; } else { iVar7 = DAT_94 + 25; if (iVar7 < 0) { iVar4 = 0; } else { iVar4 = 1525; if (iVar7 < 1526) { iVar4 = iVar7; } } DAT_94 = iVar4; } bVar1 = tags == 1; if (id == 121) { iVar7 = 0x400; if (bVar1) { iVar7 = 0; } } else { iVar7 = 0x400; if (!bVar1) { iVar7 = 0; } } iVar6 = iVar7 - oVar8.vr.y; iVar4 = -8; if (-9 < iVar6) { iVar4 = 8; if (iVar6 < 9) { iVar4 = iVar6; } } iVar4 = oVar8.vr.y + iVar4; oVar8.vr.y = iVar4; if (iVar4 * 0x10000 >> 0x10 != iVar7 || DAT_94 != 0) { if (arg2 == 0) { return(0); } oVar8.ApplyRotationMatrix(); goto LAB_2CA0; } oVar8.ApplyRotationMatrix(); break; case 1: case 4: iVar7 = oVar8.vTransform.position.y + 1525; oVar8.vTransform.position.y = iVar7; if (iVar7 <= DAT_88.y) { goto LAB_2CA0; } iVar5 = GameManager.instance.FUN_1DD9C(); v3Var3 = GameManager.instance.FUN_2CE50(oVar8); GameManager.instance.FUN_1E580(iVar5, vData.sndList, 2, v3Var3); iVar9 = (uint)(tags ^ 2) < 1 ? 1 : 0; if (id != 120) { if (iVar9 != 0) { oVar7 = DAT_80; } else { oVar7 = DAT_84; } } else { if ((iVar9 ^ 1) != 0) { oVar7 = DAT_80; } else { oVar7 = DAT_84; } } if (oVar7 == null) { goto LAB_2FD4; } if (tags == 2) { if (id == 120) { oVar7 = DAT_84; GameManager.instance.FUN_30CB0(oVar7, 180); oVar4 = oVar7.child2; } else { oVar7 = DAT_80; GameManager.instance.FUN_30CB0(oVar7, 180); oVar4 = oVar7.child2; oVar7.DAT_80 = null; } oVar4.vTransform = GameManager.FUN_2A39C(); oVar5 = oVar4.FUN_2CCBC(); Utilities.FUN_2CC9C(oVar8, oVar5); oVar5.transform.parent = oVar8.transform; } else { if (id == 120) { oVar7 = oVar8.child2; oVar4 = DAT_80; oVar4.DAT_80 = oVar7; } else { oVar4 = DAT_84; oVar7 = oVar8.child2; } ccVar5 = oVar4.FUN_2C5F4(0x8000); oVar7.vTransform = Utilities.FUN_2C77C(ccVar5); oVar5 = oVar7.FUN_2CCBC(); Utilities.FUN_2CC9C(oVar4, oVar5); oVar5.transform.parent = oVar4.transform; GameManager.instance.FUN_30CB0(oVar4, 180); } break; case 2: case 5: iVar4 = oVar8.vTransform.position.y - 1525; oVar8.vTransform.position.y = iVar4; if (oVar8.screen.y <= iVar4) { goto LAB_2CA0; } if (id == 120) { oVar4 = DAT_80; } else { oVar4 = DAT_84; } if (oVar4 != null) { if (id == 120) { ccVar4 = DAT_80.FUN_2C5F4(0x8000); oVar6 = DAT_80; } else { ccVar4 = DAT_84.FUN_2C5F4(0x8000); oVar6 = DAT_84; } auStack24 = Utilities.FUN_24148(oVar6.vTransform, ccVar4.v3_1); DAT_88 = Utilities.FUN_24304(vTransform, auStack24); iVar7 = oVar7.screen.y; sVar2 = (sbyte)(tags + 1); tags = sVar2; DAT_88.y -= iVar7; if (sVar2 == 7) { GameManager.instance.FUN_1DE78(DAT_18); tags = 0; DAT_18 = 0; FUN_30BA8(); return(0); } goto LAB_2CA0; } LAB_2FD4: tags = 0; FUN_30C68(); FUN_30BA8(); break; default: goto LAB_2CA0; } tags++; LAB_2CA0: if (arg2 == 0) { return(0); } v3Var5 = GameManager.instance.FUN_2CE50(oVar8); uVar5 = GameManager.instance.FUN_1E7A8(v3Var5); GameManager.instance.FUN_1E2C8(DAT_18, uVar5); return(0); case 8: bVar7 = FUN_32B90((uint)arg2); if (!bVar7) { return(0); } if ((byte)tags - 3U < 3) { child2.child2.child2.FUN_4ECA0(); } FUN_30BA8(); FUN_30C68(); if (DAT_80 != null) { GameManager.instance.FUN_30CB0(DAT_80, 60); } if (DAT_84 != null) { GameManager.instance.FUN_30CB0(DAT_84, 60); } tags = -1; break; } return(0); }
//FUN_F8 (EXCELSR.DLL) public override uint UpdateW(int arg1, int arg2) { short sVar1; bool bVar2; sbyte sVar3; int iVar4; VigObject oVar4; VigTuple tVar4; int iVar5; VigObject oVar5; uint uVar6; uint uVar7; int iVar8; VigObject oVar8; Throwaway puVar9; int iVar10; VigObject oVar10; int iVar12; Lightning2 oVar12; int iVar13; Lightning2 oVar14; Lightning2 oVar15; Lightning3 oVar16; VigObject local_20; Vector3Int local_38; Vector3Int local_68; Vector3Int auStack88; VigTransform auStack80; switch (state) { case _LIGHTNING2_TYPE.Type1: if (arg1 == 2) { if (DAT_94 == 0) { oVar5 = FUN_2CCBC(); GameManager.instance.FUN_307CC(oVar5); return(0); } else { DAT_94--; GameManager.instance.FUN_30CB0(this, 180); DAT_84.id += 180; } } if (arg1 < 3) { if (arg1 != 0) { return(0); } oVar4 = Utilities.FUN_2CD78(this); DAT_84 = oVar4; if (oVar4 == null || (oVar4 = Utilities.FUN_2CD78(oVar4)) == null) { oVar5 = FUN_2CCBC(); GameManager.instance.FUN_308C4(oVar5); return(0xffffffff); } oVar12 = this; oVar4 = oVar12.DAT_80; if (oVar4 != null) { while ((oVar4.flags & 0x4000) == 0) { if (oVar12.DAT_88 == null) { oVar5 = FUN_2CCBC(); GameManager.instance.FUN_308C4(oVar5); return(0xffffffff); } else { oVar12 = oVar12.DAT_88; oVar4 = oVar12.DAT_80; } } } oVar4 = DAT_80; local_38 = new Vector3Int(); bVar2 = true; if (oVar4 == null) { sVar3 = (sbyte)(DAT_19 - 1); DAT_19 = (byte)sVar3; if (sVar3 != 0) { return(0); } iVar4 = (int)GameManager.FUN_2AC5C(); local_68 = new Vector3Int(); local_68.x = (iVar4 - 0x4000) * 0x10000; uVar6 = GameManager.FUN_2AC5C(); local_68.y = ((int)(uVar6 & 0x1fff) - 0x1000) * 0x10000; iVar4 = (int)GameManager.FUN_2AC5C(); local_68.z = (iVar4 - 0x4000) * 0x10000; Utilities.FUN_29FC8(local_68, out auStack88); vTransform.rotation = Utilities.FUN_2A724(auStack88); iVar4 = (int)GameManager.FUN_2AC5C(); iVar12 = (iVar4 * 0x50000 >> 15) + 0x20000; iVar4 = iVar12 * vTransform.rotation.V02; if (iVar4 < 0) { iVar4 += 0xffff; } iVar8 = iVar12 * vTransform.rotation.V12; vTransform.rotation.V02 = (short)(iVar4 >> 16); if (iVar8 < 0) { iVar8 += 0xffff; } iVar12 = iVar12 * vTransform.rotation.V22; vTransform.rotation.V12 = (short)(iVar8 >> 16); if (iVar12 < 0) { iVar12 += 0xffff; } vTransform.rotation.V22 = (short)(iVar12 >> 16); iVar4 = (int)GameManager.FUN_2AC5C(); DAT_19 = (byte)((iVar4 * 10 >> 15) + 5); } else { local_20 = Utilities.FUN_2CD78(DAT_84); uVar6 = GameManager.FUN_2AC5C(); oVar12 = this; while (true) { uVar7 = GameManager.FUN_2AC5C(); if (DAT_94 == 0) { oVar12.DAT_80.vTransform.position.y -= 682; } else { oVar12.DAT_80.vTransform.position.y -= 222; } iVar10 = oVar12.DAT_80.vTransform.position.x; iVar8 = iVar10 - 2730; if ((uVar7 & 1) == 0) { iVar8 = iVar10 + 2730; } oVar12.DAT_80.vTransform.position.x = iVar8; iVar10 = oVar12.DAT_80.vTransform.position.z; iVar8 = iVar10 - 2730; if ((uVar7 & 2) == 0) { iVar8 = iVar10 + 2730; } oVar12.DAT_80.vTransform.position.z = iVar8; oVar8 = oVar12.DAT_80; oVar8.screen = oVar8.vTransform.position; //should be ignored as a counter to his special iVar8 = (int)GameManager.FUN_2AC5C(); oVar12.DAT_80.FUN_24700((short)((iVar8 * 511 >> 15) - 255), 0, 0); sVar3 = (sbyte)(oVar12.DAT_19 - 1); oVar12.DAT_19 = (byte)sVar3; if (sVar3 == 0) { oVar12.DAT_19 = 40; if (bVar2) { iVar8 = 0; iVar5 = GameManager.instance.FUN_1DD9C(); GameManager.instance.FUN_1E580(iVar5, GameManager.instance.DAT_C2C, 75, oVar12.DAT_80.vTransform.position); UIManager.instance.FUN_4E414(oVar12.DAT_80.vTransform.position, new Color32(0x00, 0x00, 0xff, 8)); do { puVar9 = LevelManager.instance.xobfList[19].ini.FUN_2C17C(49, typeof(Throwaway), 8) as Throwaway; puVar9.physics1.M0 = 0; puVar9.physics1.M1 = 0; puVar9.physics1.M2 = 0; uVar7 = GameManager.FUN_2AC5C(); puVar9.physics1.Z = (int)(uVar7 & 0xfff) - 0x800; iVar10 = (int)GameManager.FUN_2AC5C(); if (iVar10 < 0) { iVar10 += 15; } puVar9.physics1.W = -(iVar10 >> 4); uVar7 = GameManager.FUN_2AC5C(); puVar9.physics2.X = (int)(uVar7 & 0xfff) - 0x800; puVar9.type = 7; puVar9.flags |= 0xb4; sVar1 = id; iVar8++; puVar9.state = _THROWAWAY_TYPE.Type3; puVar9.id = sVar1; puVar9.vTransform = GameManager.FUN_2A39C(); oVar10 = oVar12.DAT_80; puVar9.vTransform.position = oVar10.vTransform.position; puVar9.FUN_2D1DC(); puVar9.DAT_87 = 1; puVar9.FUN_305FC(); } while (iVar8 < 5); } } if (((uVar6 ^ 1) & 1) != 0) { iVar5 = ((Vehicle)oVar12.DAT_80).FUN_3B078(local_20, (ushort)DAT_1A, -2, 1); ((Vehicle)oVar12.DAT_80).FUN_39DCC(iVar5, Lightning.DAT_20, true); if (oVar12.DAT_80.id < 0) { GameManager.instance.FUN_15ADC(~oVar12.DAT_80.id, 20); } } if (bVar2) { auStack80 = GameManager.instance.FUN_2CEAC(oVar12.DAT_84, oVar12.DAT_90); local_68 = Utilities.FUN_24304(auStack80, oVar12.DAT_80.vTransform.position); } else { oVar8 = oVar12.DAT_80; local_68 = new Vector3Int(); local_68.x = oVar8.vTransform.position.x - local_38.x; local_68.y = oVar8.vTransform.position.y - local_38.y; local_68.z = oVar8.vTransform.position.z - local_38.z; oVar12.vTransform.position = local_38; } oVar8 = oVar12.DAT_80; local_38 = oVar8.vTransform.position; Utilities.FUN_29FC8(local_68, out auStack88); iVar8 = Utilities.FUN_29E84(local_68); iVar8 /= 2; if (0x70000 < iVar8 && bVar2) { break; } iVar10 = iVar8; if (!bVar2) { iVar10 = 0x70000; if (iVar8 < 0x70000) { iVar10 = iVar8; } } oVar12.vTransform.rotation = Utilities.FUN_2A724(auStack88); iVar8 = iVar10 * oVar12.vTransform.rotation.V02; if (iVar8 < 0) { iVar8 += 0xffff; } iVar13 = iVar10 * oVar12.vTransform.rotation.V12; oVar12.vTransform.rotation.V02 = (short)(iVar8 >> 16); if (iVar13 < 0) { iVar13 += 0xffff; } iVar10 = iVar10 * oVar12.vTransform.rotation.V22; oVar12.vTransform.rotation.V12 = (short)(iVar13 >> 16); if (iVar10 < 0) { iVar10 += 0xffff; } oVar12.vTransform.rotation.V22 = (short)(iVar10 >> 16); oVar12 = oVar12.DAT_88; bVar2 = false; if (oVar12 == null) { return(0); } } oVar12.DAT_19 = 5; oVar14 = oVar12; while ((oVar15 = oVar14) != null) { oVar14 = oVar15.DAT_88; oVar15.DAT_88 = null; if (oVar15.DAT_80 != null) { oVar16 = oVar15.DAT_8C; if (oVar16 != null && (oVar16.flags & 0x3000000) == 0) { oVar16.flags |= 0x2000000; oVar5 = oVar15.DAT_8C.FUN_2CCBC(); GameManager.instance.FUN_307CC(oVar5); oVar15.DAT_8C = null; } else { oVar15.DAT_80.flags &= 0xfbffffff; oVar15.DAT_80.FUN_30B78(); } oVar15.DAT_80 = null; } if (oVar15 != oVar12) { GameManager.instance.FUN_309A0(oVar15); } } oVar12.DAT_80 = null; } } else { if (arg1 != 4) { return(0); } oVar14 = DAT_88; while (oVar14 != null) { oVar15 = oVar14.DAT_88; oVar16 = oVar14.DAT_8C; oVar14.DAT_88 = null; if (oVar16 != null && (oVar16.flags & 0x3000000) == 0) { oVar16.flags |= 0x2000000; oVar5 = oVar14.DAT_8C.FUN_2CCBC(); GameManager.instance.FUN_307CC(oVar5); oVar14.DAT_8C = null; } else { oVar14.DAT_80.flags &= 0xfbffffff; oVar14.DAT_80.FUN_30B78(); } oVar14.DAT_80 = null; GameManager.instance.FUN_309A0(oVar14); oVar14 = oVar15; } if (DAT_80 != null) { oVar16 = DAT_8C; if (oVar16 != null && (oVar16.flags & 0x3000000) == 0) { oVar16.flags |= 0x2000000; oVar5 = DAT_8C.FUN_2CCBC(); GameManager.instance.FUN_307CC(oVar5); DAT_8C = null; } else { DAT_80.flags &= 0xfbffffff; DAT_80.FUN_30B78(); } DAT_80 = null; } if (DAT_84 != null) { oVar4 = Utilities.FUN_2CD78(DAT_84); if (oVar4 != null) { tVar4 = GameManager.instance.FUN_30134(GameManager.instance.worldObjs, oVar4); if (tVar4 != null) { if (DAT_84.maxHalfHealth == 0) { DAT_84.FUN_3A368(); } } } } GameManager.instance.DAT_1084--; if (DAT_18 == 0) { return(0); } GameManager.instance.FUN_1DE78(DAT_18); } break; } return(0); }
public override uint UpdateW(int arg1, VigObject arg2) { sbyte sVar2; int iVar7; VigObject oVar7; VigObject oVar8; Vector3Int auStack24; switch (arg1) { case 20: case 21: if (arg1 == 20) { DAT_84 = arg2; } else { DAT_80 = arg2; } if (tags != 0) { return(0); } if (DAT_80 == null) { return(0); } if (DAT_84 != null) { if (id != 120 && DAT_80.DAT_80 == null) { return(0); } DAT_80.FUN_30C68(); DAT_84.FUN_30C68(); FUN_30B78(); sVar2 = (sbyte)GameManager.instance.FUN_1DD9C(); GameManager.instance.FUN_1E098(sVar2, vData.sndList, 1, 0); if (id == 120) { oVar7 = DAT_84; oVar8 = oVar7.child2; } else { oVar7 = DAT_80; oVar8 = oVar7.DAT_80; } auStack24 = Utilities.FUN_24148(oVar7.vTransform, oVar8.vTransform.position); DAT_88 = Utilities.FUN_24304(vTransform, auStack24); iVar7 = child2.screen.y; tags = 1; DAT_88.y -= iVar7; } break; } return(0); }
public ConfigContainer DAT_A4; //0xA4 //FUN_40 (TOWTRUCK.DLL) public override uint UpdateW(int arg1, int arg2) { VigTuple ppiVar2; List <VigTuple> ppiVar3; sbyte sVar4; int iVar5; VigObject oVar5; Vehicle vVar5; int iVar6; VigObject oVar6; VigTransform tVar6; VigObject oVar8; VigTuple tVar8; ConfigContainer ccVar9; VigObject oVar10; int iVar10; int iVar11; VigObject oVar11; int iVar12; Vector3Int iStack40; Vector3Int iStack56; Vector3Int iStack72; Vector3Int sStack80; Vector3Int iStack96; Vector3Int iStack112; Vector3Int iStack128; if (arg1 == 2) { sVar4 = tags; if (sVar4 == 1) { oVar6 = FUN_2CCBC(); GameManager.instance.FUN_308C4(oVar6); return(0); } if (sVar4 < 2) { if (sVar4 != 0) { return(0); } iVar11 = physics2.Z; physics2.W = iVar11; iVar5 = iVar11; if (iVar11 < 0) { iVar5 = iVar11 + 15; } child2.vTransform.rotation.V22 = (short)(iVar5 >> 4); DAT_88.vTransform.position.z = iVar11 << 1; iStack112 = Utilities.FUN_24148(DAT_80.vTransform, new Vector3Int(physics1.X, physics2.X, physics2.Y)); iStack96 = GameManager.instance.FUN_2CE50(DAT_88); iStack128 = new Vector3Int(); iStack128.x = iStack112.x - iStack96.x; iStack128.y = iStack112.y - iStack96.y; iStack128.z = iStack112.z - iStack96.z; iVar5 = Utilities.FUN_29E84(iStack128); if (0x14000 < iVar5 || (DAT_80.flags & 0x4000000) != 0) { tags = 1; DAT_A0_2 = (physics2.W - 0x4000) / 15; GameManager.instance.FUN_30CB0(this, 15); return(0); } ((Vehicle)DAT_80).FUN_3A020(-10, DAT_20, true); tags = 2; physics1.Z = 0x18000; GameManager.instance.FUN_30CB0(this, 300); if (((Vehicle)DAT_80).wheelsType == _WHEELS.Air) { ((Vehicle)DAT_80).FUN_3E32C(_WHEELS.Ground, 0); } sVar4 = (sbyte)GameManager.instance.FUN_1DD9C(); DAT_18 = sVar4; GameManager.instance.FUN_1E5D4(sVar4, vData.sndList, 5, iStack96, true); oVar5 = Utilities.FUN_2CD78(DAT_84); oVar5.tags = 3; } else { if (sVar4 != 2) { if (sVar4 != 3) { return(0); } oVar6 = FUN_2CCBC(); GameManager.instance.FUN_308C4(oVar6); return(0); } vVar5 = (Vehicle)DAT_80; iStack56 = new Vector3Int(); iStack56.x = vVar5.vTransform.position.x - vTransform.position.x; iStack56.y = vVar5.vTransform.position.y - vTransform.position.y; iStack56.z = vVar5.vTransform.position.z - vTransform.position.z; iVar5 = 0x1000; oVar11 = null; if (vTransform.rotation.V02 * iStack56.x + vTransform.rotation.V12 * iStack56.y + vTransform.rotation.V22 * iStack56.z < 0) { oVar8 = Utilities.FUN_2CD78(DAT_84); tVar6 = GameManager.instance.FUN_2CDF4(oVar8); ppiVar3 = GameManager.instance.worldObjs; for (int i = 0; i < ppiVar3.Count; i++) { ppiVar2 = ppiVar3[i]; oVar10 = ppiVar2.vObject; if (oVar10.type == 2 && oVar10 != oVar8 && oVar10 != DAT_80) { iStack56 = Utilities.FUN_24304(tVar6, oVar10.screen); if (0 < iStack56.z) { iVar12 = iStack56.x / (iStack56.z >> 12); if (iVar12 < 0) { iVar12 = -iVar12; } if (iVar12 < iVar5) { oVar11 = oVar10; iVar5 = iVar12; } } } } if (oVar11 == null) { iStack56.x = oVar8.vTransform.rotation.V02; iStack56.y = oVar8.vTransform.rotation.V12 - 0x666; iStack56.z = oVar8.vTransform.rotation.V22; } else { vVar5 = (Vehicle)DAT_80; iStack56.x = oVar11.screen.x - vVar5.vTransform.position.x; iStack56.z = oVar11.screen.z - vVar5.vTransform.position.z; iStack56.y = oVar11.screen.y - vVar5.vTransform.position.y - 0x14000; } Utilities.FUN_29FC8(iStack56, out sStack80); iVar5 = physics2.W; if (iVar5 < 0xc000) { iVar11 = 0xc000; } else { iVar11 = 0x28000; if (iVar5 < 0x28001) { iVar11 = iVar5; } } iVar5 = sStack80.x * iVar11; if (iVar5 < 0) { iVar5 += 0x3fff; } iVar10 = sStack80.y * iVar11; iStack72 = new Vector3Int(); iStack72.x = (iVar5 >> 14) << 7; if (iVar10 < 0) { iVar10 += 0x3fff; } iStack72.y = (iVar10 >> 14) << 7; iVar11 = sStack80.z * iVar11; if (iVar11 < 0) { iVar11 += 0x3fff; } iStack72.z = (iVar11 >> 14) << 7; iStack72 = Utilities.FUN_2426C(DAT_80.vTransform.rotation, new Matrix2x4(iStack72.x, iStack72.y, iStack72.z, 0)); DAT_80.FUN_2B1FC(iStack72, new Vector3Int(physics1.W, physics2.X, physics2.Y)); iVar6 = GameManager.instance.FUN_1DD9C(); GameManager.instance.FUN_1E580(iVar6, vData.sndList, 4, oVar8.vTransform.position); } GameManager.instance.FUN_30CB0(this, 6); tags = 3; } } else { if (arg1 < 3) { if (arg1 != 0) { return(0); } oVar5 = Utilities.FUN_2CD78(this); DAT_84 = oVar5; if (oVar5 == null || (oVar5 = Utilities.FUN_2CD78(oVar5)) == null) { oVar6 = FUN_2CCBC(); GameManager.instance.FUN_308C4(oVar6); return(0xffffffff); } sVar4 = tags; if (sVar4 == 1) { physics2.W -= DAT_A0_2; } else { if (sVar4 < 2) { if (sVar4 == 0) { physics2.W += DAT_A0_2; } } else { if (sVar4 < 4) { vVar5 = (Vehicle)DAT_80; if (vVar5.shield != 0) { vVar5.FUN_393F8(); GameManager.instance.FUN_30CB0(this, 0); tags = 3; return(0); } iStack112 = Utilities.FUN_24148(DAT_80.vTransform, new Vector3Int(physics1.W, physics2.X, physics2.Y)); tVar6 = GameManager.instance.FUN_2CEAC(DAT_84, DAT_A4); iStack128 = new Vector3Int(); iStack128.x = iStack112.x - tVar6.position.x; iStack128.y = iStack112.y - tVar6.position.y; iStack128.z = iStack112.z - tVar6.position.z; iStack96 = Utilities.FUN_2426C(tVar6.rotation, new Matrix2x4(iStack128.x, iStack128.y, iStack128.z, 0)); iVar5 = Utilities.FUN_29FC8(iStack96, out sStack80); iVar5 /= 2; if (0x4ffff < iVar5) { oVar6 = FUN_2CCBC(); GameManager.instance.FUN_308C4(oVar6); return(0xffffffff); } vTransform.rotation = Utilities.FUN_2A724(sStack80); physics2.W = iVar5; if (tags != 3 && physics2.Z < iVar5) { Utilities.FUN_29FC8(iStack128, out sStack80); iVar5 = physics2.Z - iVar5; iStack40 = new Vector3Int(); iStack40.x = iVar5 * sStack80.x; if (iStack40.x < 0) { iStack40.x += 0x1fff; } iStack40.y = iVar5 * sStack80.y; iStack40.x >>= 13; if (iStack40.y < 0) { iStack40.y += 0x1fff; } iStack40.y >>= 13; iStack40.z = iVar5 * sStack80.z; if (iStack40.z < 0) { iStack40.z += 0x1fff; } iStack40.z >>= 13; DAT_80.FUN_2B370(iStack40, iStack112); oVar6 = Utilities.FUN_2CD78(DAT_84); iVar5 *= 3; if (iVar5 < 0) { iVar5 += 0xffff; } iVar5 >>= 16; if (-1 < iVar5) { iVar5 = -1; } iVar6 = ((Vehicle)DAT_80).FUN_3B078(oVar6, (ushort)DAT_1A, iVar5, 1); ((Vehicle)DAT_80).FUN_39DCC(iVar6, DAT_20, true); } } } } iVar5 = physics2.W; if (iVar5 < 0) { iVar5 += 15; } child2.vTransform.rotation.V22 = (short)(iVar5 >> 4); DAT_88.vTransform.position.z = physics2.W << 1; } else { if (arg1 != 4) { return(0); } oVar11 = DAT_84; oVar5 = Utilities.FUN_2CD78(oVar11); if (DAT_18 != 0) { GameManager.instance.FUN_1DE78(DAT_18); } if (oVar5 == null) { return(0); } tVar8 = GameManager.instance.FUN_30134(GameManager.instance.worldObjs, oVar5); if (tVar8 != null) { oVar5.DAT_58 -= 0xa0000; if (oVar11.maxHalfHealth == 0) { oVar11.FUN_3A368(); return(0); } oVar6 = DAT_84.vData.ini.FUN_2C17C(2, typeof(VigObject), 8); ccVar9 = oVar11.FUN_2C5F4(0x8000); Utilities.FUN_2CA94(oVar11, ccVar9, oVar6); Utilities.ParentChildren(oVar11, oVar11); oVar6.FUN_30BF0(); oVar11.PDAT_78 = oVar6; oVar11.flags &= 0xf7ffffff; } } } return(0); }