public void UnlockAllLevels() { if (saveHandler.GetPointer(Program) == IntPtr.Zero) { return; } //SaveHandler.s_mainLevels.m_levelDatas IntPtr mainLevels = saveHandler.Read <IntPtr>(Program, -0x14, 0x10); int size = Program.Read <int>(mainLevels, 0xc); for (int i = 0; i < size; i++) { IntPtr level = Program.Read <IntPtr>(mainLevels, 0x10 + i * 4); IntPtr nextLevel = Program.Read <IntPtr>(mainLevels, 0x10 + (i + 1 < size ? i + 1 : i) * 4); bool unlocked = Program.Read <bool>(level, 0x14); bool completed = Program.Read <bool>(level, 0x15); bool nextUnlocked = Program.Read <bool>(nextLevel, 0x14); bool nextCompleted = Program.Read <bool>(nextLevel, 0x15); if ((unlocked ^ completed) || (!(unlocked & completed) && (nextUnlocked | nextCompleted))) { Program.Write(level, 16843009, 0x14); } } }
public void ResetTimer() { if (arcadeTimer.GetPointer(Program) != IntPtr.Zero) { //ArcadeTimer.s_self.m_time //ArcadeTimer.s_self.m_pauseTimer arcadeTimer.Write <long>(Program, 0L, 0x0, 0x74); //ArcadeTimer.s_self.m_timerIsOn arcadeTimer.Write <bool>(Program, false, 0x0, 0x7c); } }
public Vector CurrentVelocity() { if (playerHandler.GetPointer(Program) == IntPtr.Zero) { return(default(Vector)); } //PlayerHandler.self.speedSettings.lastVelocity float x = playerHandler.Read <float>(Program, 0x0, 0x38, 0x50); float y = playerHandler.Read <float>(Program, 0x0, 0x38, 0x54); float z = playerHandler.Read <float>(Program, 0x0, 0x38, 0x58); return(new Vector() { X = x, Y = y, Z = z, M = (float)Math.Sqrt(x * x + y * y + z * z) }); }
public int[] Collectibles() { int[] stats = new int[3] { 0, 0, 0 }; if (saveHandler.GetPointer(Program) != IntPtr.Zero && preloadLevel.GetPointer(Program) != IntPtr.Zero) { //PreloadLevel.s_levelIndex int lvlIndex = preloadLevel.Read <int>(Program); //SaveHandler.s_mainLevels.m_levelDatas IntPtr mainLevels = saveHandler.Read <IntPtr>(Program, -0x14, 0x10); int size = Program.Read <int>(mainLevels, 0xc); int totalCount = 0; if (lvlIndex == 5) { //CheckPointSystem.currentAreas IntPtr areas = checkPointSystem.Read <IntPtr>(Program); int areaSize = Program.Read <int>(areas, 0xc); if (areaSize > 0) { //CheckPointSystem.currentAreas[areaSize-1].cps.Count areaSize = Program.Read <int>(areas, 0x8, 0x10 + (areaSize - 1) * 4, 0x10, 0xc); if (areaSize == 9) { lvlIndex = 6; } } } if (lvlIndex >= 0) { //LevelHandler.m_mainLevels[lvlIndex].m_collectablesAmount stats[0] = levelHandler.Read <int>(Program, 0x0, 0x10, 0x8, 0x10 + (4 * lvlIndex), 0x1c); } for (int i = 0; i < size; i++) { //SaveHandler.s_mainLevels.m_levelDatas[i] IntPtr level = Program.Read <IntPtr>(mainLevels, 0x10 + (i * 4)); //SaveHandler.s_mainLevels.m_levelDatas[i].m_collectables.length int length = Program.Read <int>(level, 0x8, 0xc); int count = 0; for (int j = 0; j < length; j++) { //SaveHandler.s_mainLevels.m_levelDatas[i].m_collectables[j] if (Program.Read <bool>(level, 0x8, 0x10 + j)) { count++; totalCount++; } } if (i == lvlIndex) { stats[1] = count; } } stats[2] = totalCount; } return(stats); }