public void FUN_3934(JUNC_DB param1) { RSEG_DB piVar1; int iVar2; piVar1 = param1.DAT_1C[0]; DAT_B8 = piVar1; iVar2 = piVar1.DAT_00[0] == param1 ? 1 : 0; DAT_C0 = iVar2; DAT_C4 = (iVar2 == 0 ? 1 : 0) << 28; }
public static void ImportJUNC(MenuCommand menuCommand) { string file = EditorUtility.OpenFilePanel("Open junc file to load asset", previousOpen, ""); previousOpen = Path.GetDirectoryName(file); string name = Path.GetFileNameWithoutExtension(file); int index = (byte)name[name.Length - 1] - 0x30; JUNC_DB junc = menuCommand.context as JUNC_DB; while (true) { if (!junc.LoadDB(file)) { break; } index++; file = previousOpen + "\\JUNC" + index.ToString().PadLeft(4, '0'); GameObject obj = new GameObject("JUNC" + index.ToString().PadLeft(2, '0')); junc = obj.AddComponent <JUNC_DB>(); } }
public JUNC_DB DAT_84_2; //0x84 //FUN_2428 (OILFIELD.DLL) public override uint UpdateW(int arg1, int arg2) { bool bVar1; sbyte sVar2; uint uVar3; RSEG_DB piVar5; JUNC_DB puVar6; int iVar7; JUNC_DB jVar7; int iVar8; int iVar9; int iVar4; int iVar10; uint uVar12; int iVar13; Vehicle vVar14; switch (arg1) { case 0: if (tags != 3) { iVar8 = physics2.X - vTransform.position.z; iVar13 = vTransform.position.y; iVar4 = physics1.Z - vTransform.position.x; if (tags != 0) { iVar13 -= 0x32000; } iVar13 = GameManager.instance.DAT_DB0 - iVar13; if (DAT_18 == 0 && tags == 0 && 0 < iVar13) { sVar2 = (sbyte)GameManager.instance.FUN_1DD9C(); DAT_18 = sVar2; GameManager.instance.FUN_1E580(sVar2, GameManager.instance.DAT_C2C, 38, vTransform.position); GameManager.instance.FUN_30CB0(this, 60); } iVar7 = iVar8; if (iVar8 < 0) { iVar7 = -iVar8; } iVar9 = iVar4; if (iVar4 < 0) { iVar9 = -iVar4; } if (iVar7 < iVar9) { iVar7 = iVar9; } if (iVar7 < 0x10000) { uVar12 = (uint)GameManager.FUN_2AC5C(); jVar7 = DAT_84_2; piVar5 = jVar7.DAT_1C[(int)(uVar12 & 1)]; bVar1 = jVar7 == piVar5.DAT_00[0]; DAT_19 = (byte)(bVar1 ? 1 : 0); puVar6 = piVar5.DAT_00[DAT_19]; DAT_84_2 = puVar6; physics1.Z = puVar6.DAT_00.x; physics1.W = puVar6.DAT_00.y; physics2.X = puVar6.DAT_00.z; if ((uVar12 & 3) == 0) { tags = (sbyte)(1 - tags); } } iVar4 = Utilities.Ratan2(iVar4, iVar8); iVar8 = (iVar4 - (ushort)vr.y) * 0x100000 >> 20; iVar4 = -22; if (-23 < iVar8) { iVar4 = 22; if (iVar8 < 23) { iVar4 = iVar8; } } vr.y += (short)iVar4; iVar4 = (-iVar13 / 0x5000) * 56; iVar13 = -341; if (-342 < iVar4) { iVar13 = 341; if (iVar4 < 342) { iVar13 = iVar4; } } iVar13 -= vr.x; iVar4 = -5; if (-6 < iVar13) { iVar4 = 5; if (iVar13 < 6) { iVar4 = iVar13; } } vr.x += (short)iVar4; ApplyRotationMatrix(); iVar13 = vTransform.rotation.V02 * 7629; if (iVar13 < 0) { iVar13 += 4095; } iVar4 = vTransform.rotation.V12 * 7629; vTransform.position.x += iVar13 >> 12; if (iVar4 < 0) { iVar4 += 4095; } iVar13 = vTransform.rotation.V22 * 7629; vTransform.position.y += iVar4 >> 12; if (iVar13 < 0) { iVar13 += 4095; } vTransform.position.z += iVar13 >> 12; return(0); } uVar12 = maxHalfHealth; maxHalfHealth--; if (uVar12 == 0) { uVar3 = flags; tags = 0; flags = uVar3 & 0xffffffdf; } else { if (uVar12 == 0x10) { iVar10 = GameManager.instance.FUN_1DD9C(); GameManager.instance.FUN_1E580(iVar10, GameManager.instance.DAT_C2C, 38, vTransform.position); uVar3 = flags; flags = uVar3 & 0xffffffdf; } } iVar13 = (int)uVar12 - 16; if (iVar13 < 0) { iVar13 = -iVar13; } iVar4 = (16 - iVar13) * 227; if (iVar4 < 0) { iVar4 += 15; } vr.x = iVar4 >> 4; ApplyRotationMatrix(); iVar4 = vTransform.rotation.V02 * 3814; if (iVar4 < 0) { iVar4 += 4095; } iVar8 = vTransform.rotation.V22 * 3814; vTransform.position.x += iVar4 >> 12; if (iVar8 < 0) { iVar8 += 4095; } vTransform.position.z += iVar8 >> 12; vTransform.position.y = GameManager.instance.DAT_DB0 + (16 - iVar13) * -0x780; break; case 1: piVar5 = LevelManager.instance.FUN_518DC(screen, 16); puVar6 = piVar5.DAT_00[0]; DAT_84_2 = puVar6; physics1.Z = puVar6.DAT_00.x; physics1.W = puVar6.DAT_00.y; physics2.X = puVar6.DAT_00.z; flags |= 0x10184; break; case 2: DAT_18 = 0; break; } return(0); }
public JUNC_DB DAT_84_2; //0x84 //FUN_3E28 (LAUNCH.DLL) public override uint UpdateW(int arg1, int arg2) { sbyte sVar1; short sVar2; short sVar3; bool bVar4; uint uVar5; int iVar6; JUNC_DB jVar6; uint uVar8; JUNC_DB puVar9; Sharky2 ppcVar10; RSEG_DB piVar11; int iVar12; int iVar13; JUNC_DB jVar13; RSEG_DB piVar14; int iVar15; int iVar17; List <JUNC_DB> piVar18; if (arg1 == 1) { piVar11 = LevelManager.instance.FUN_518DC(screen, id); puVar9 = piVar11.DAT_00[0]; DAT_84_2 = puVar9; physics1.Z = puVar9.DAT_00.x; physics1.W = puVar9.DAT_00.y; physics2.X = puVar9.DAT_00.z; flags |= 0x10184; if (id == 16) { GameObject obj = new GameObject(); ppcVar10 = obj.AddComponent <Sharky2>(); ppcVar10.type = 255; GameManager.instance.FUN_30CB0(ppcVar10, 60); iVar17 = LevelManager.instance.DAT_1184; iVar12 = 0; piVar18 = LevelManager.instance.juncList; if (0 < LevelManager.instance.DAT_1184) { do { jVar6 = piVar18[iVar12]; iVar15 = 0; if (jVar6.DAT_11 != 0) { do { piVar14 = jVar6.DAT_1C[iVar15]; if (piVar14.DAT_08 - 16 < 4) { jVar6.DAT_12 = (short)piVar14.DAT_08; if (jVar6 == piVar14.DAT_00[0] && jVar6.DAT_1C[0] != piVar14) { jVar6.DAT_1C[1] = jVar6.DAT_1C[0]; jVar6.DAT_1C[0] = piVar14; break; } } iVar15++; } while (iVar15 < jVar6.DAT_11); } iVar12++; } while (iVar12 < iVar17); } } GameManager.instance.FUN_30CB0(this, 60); return(0); } if (arg1 == 0) { sVar1 = tags; if (sVar1 != 3) { iVar17 = physics1.Z - vTransform.position.x; iVar12 = physics2.X - vTransform.position.z; if (sVar1 == 1) { iVar13 = iVar12; if (iVar12 < 0) { iVar13 = -iVar12; } iVar6 = iVar17; if (iVar17 < 0) { iVar6 = -iVar17; } if (iVar13 < iVar6) { iVar13 = iVar6; } if (0xffff < iVar13) { goto LAB_419C; } if (DAT_84_2.DAT_11 == 2) { iVar13 = (1 - DAT_19); } else { iVar13 = 0; } puVar9 = DAT_84_2.DAT_1C[iVar13].DAT_00[DAT_19]; DAT_84_2 = puVar9; } else { if (1 < sVar1) { if (sVar1 == 2) { iVar13 = iVar12; if (iVar12 < 0) { iVar13 = -iVar12; } iVar6 = iVar17; if (iVar17 < 0) { iVar6 = -iVar17; } if (iVar13 < iVar6) { iVar13 = iVar6; } if (iVar13 < 0xfa001 && 0x2e67ff < GameManager.instance.terrain.FUN_1B750((uint)vTransform.position.x, (uint)vTransform.position.z)) { iVar17 = DAT_80.vTransform.position.x - vTransform.position.x; iVar12 = DAT_80.vTransform.position.z - vTransform.position.z; } else { tags = 0; } } goto LAB_419C; } if (sVar1 != 0) { goto LAB_419C; } iVar13 = iVar12; if (iVar12 < 0) { iVar13 = -iVar12; } iVar6 = iVar17; if (iVar17 < 0) { iVar6 = -iVar17; } if (iVar13 < iVar6) { iVar13 = iVar6; } if (0xffff < iVar13) { goto LAB_419C; } jVar13 = DAT_84_2; if (jVar13.DAT_11 == 2) { uVar8 = GameManager.FUN_2AC5C(); iVar6 = (int)(uVar8 & 1); } else { iVar6 = 0; } piVar11 = jVar13.DAT_1C[iVar6]; bVar4 = jVar13 == piVar11.DAT_00[0]; DAT_19 = (byte)(bVar4 ? 1 : 0); puVar9 = piVar11.DAT_00[DAT_19]; DAT_84_2 = puVar9; } physics1.Z = puVar9.DAT_00.x; physics1.W = puVar9.DAT_00.y; physics2.X = puVar9.DAT_00.z; LAB_419C: iVar17 = Utilities.Ratan2(iVar17, iVar12); iVar12 = ((iVar17 - (ushort)vr.y) * 0x100000) >> 20; iVar17 = -45; if (-46 < iVar12) { iVar17 = 45; if (iVar12 < 46) { iVar17 = iVar12; } } vr.y += iVar17; iVar17 = (vr.y & 0xfff) * 2; sVar2 = GameManager.DAT_65C90[iVar17]; sVar3 = GameManager.DAT_65C90[iVar17 + 1]; iVar17 = sVar2 * 7629; if (iVar17 < 0) { iVar17 += 4095; } iVar12 = sVar3 * 7629; vTransform.position.x += iVar17 >> 12; if (iVar12 < 0) { iVar12 += 4095; } vTransform.rotation.V20 = (short)-sVar2; iVar17 = GameManager.instance.DAT_DB0; vTransform.rotation.V22 = sVar3; vTransform.rotation.V00 = sVar3; vTransform.rotation.V02 = sVar2; vTransform.position.z += iVar12 >> 12; vTransform.position.y = iVar17; return(0); } uVar8 = maxHalfHealth; maxHalfHealth--; if (uVar8 == 0) { uVar5 = flags; tags = 0; } else { if (uVar8 != 16) { goto LAB_3ECC; } uVar5 = flags; } flags = uVar5 & 0xffffffdf; LAB_3ECC: iVar17 = (int)uVar8 - 16; if (iVar17 < 0) { iVar17 = -iVar17; } iVar12 = (16 - iVar17) * 227; if (iVar12 < 0) { iVar12 += 15; } vr.x = iVar12 >> 4; ApplyRotationMatrix(); iVar12 = vTransform.rotation.V02 * 3814; if (iVar12 < 0) { iVar12 += 4095; } iVar13 = vTransform.rotation.V22 * 3814; vTransform.position.x += iVar12 >> 12; if (iVar13 < 0) { iVar13 += 4095; } vTransform.position.z += iVar13 >> 12; vTransform.position.y = GameManager.instance.DAT_DB0 + (16 - iVar17) * -1920; } return(0); }