From 125a9435e95b99d1d2b9778a25f8ed816178ddef Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 12 Sep 2022 13:00:43 -0400 Subject: [Taiji] Split on completing a world --- Taiji.asl | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'Taiji.asl') diff --git a/Taiji.asl b/Taiji.asl index 3505a86..9752860 100644 --- a/Taiji.asl +++ b/Taiji.asl @@ -2,6 +2,7 @@ state("Taiji") { // v9.10.2022 int solveCount: "GameAssembly.dll", 0x0168ED88, 0x80, 0x100, 0xD94; + byte10 worldsCompleted: "GameAssembly.dll", 0x015C8010, 0x48, 0x40, 0x80, 0x290, 0xB8, 0x10, 0x20; } startup @@ -10,19 +11,36 @@ startup print("[Taiji ASL] " + logLine); }); + settings.Add("solveCount", true, "Split on solve count increasing"); + settings.Add("world", false, "Split on completing a world"); + vars.log("Autosplitter loaded"); } onStart { vars.maxSolve = 0; + vars.numWorlds = 0; } split { - if (current.solveCount > vars.maxSolve) { + if (settings["solveCount"] && current.solveCount > vars.maxSolve) { vars.log(String.Format("Solve count increased from {0} to {1}", vars.maxSolve, current.solveCount)); vars.maxSolve = current.solveCount; return true; } + if (settings["world"]) { + int curWorlds = 0; + foreach (byte b in current.worldsCompleted) { + if (b == 1) { + curWorlds += 1; + } + } + if (curWorlds > vars.numWorlds) { + vars.log(String.Format("World count increased from {0} to {1}", vars.numWorlds, curWorlds)); + vars.numWorlds = curWorlds; + return true; + } + } } -- cgit 1.4.1