From a60f10c1bb3c481b8208f539db4749c381501fc5 Mon Sep 17 00:00:00 2001 From: NintwnDude879 Date: Wed, 20 Sep 2023 19:36:47 -0700 Subject: [PATCH] Reorganized some stuff, removed unnecessary double checking, generally made code more readable --- FNaFSBAutoSplitter.asl | 905 +++++++++++++++++------------------------ 1 file changed, 382 insertions(+), 523 deletions(-) diff --git a/FNaFSBAutoSplitter.asl b/FNaFSBAutoSplitter.asl index 3d15fb9..6f556b7 100644 --- a/FNaFSBAutoSplitter.asl +++ b/FNaFSBAutoSplitter.asl @@ -9,8 +9,7 @@ state("fnaf9-Win64-Shipping"){} startup { vars.CompletedSplits = new HashSet(); - //setting names - //print settings + settings.CurrentDefaultParent = null; settings.Add("Split Settings", false); settings.Add("In-Game Time Settings", true); @@ -597,37 +596,35 @@ init { int gameSize = modules.First().ModuleMemorySize; refreshRate = 30; - print("Size = " + gameSize.ToString()); - - switch (gameSize){ - default: { - vars.version = 100; // Unsupported - if (!settings["Unsupported version warning"]) break; - MessageBox.Show("Sorry, it seems like the version of Security Breach that you're using isn't currently supported!\n\n"+ - "If this seems like a mistake, or you would like to suggest an additional version to support, please go to https://forms.gle/jxidK6RFToEXzUDe7 or contact either Daltone#2617 or Nintendude#0447 on Discord.\n\n"+ - "Sorry for the inconvenience.", "Warning: Version Not Supported", MessageBoxButtons.OK, MessageBoxIcon.Error).ToString(); - break; + switch (gameSize){ + default: { + vars.version = 100; // Unsupported + if (!settings["Unsupported version warning"]) break; + MessageBox.Show("Sorry, it seems like the version of Security Breach that you're using isn't currently supported!\n\n"+ + "If this seems like a mistake, or you would like to suggest an additional version to support, please go to https://forms.gle/jxidK6RFToEXzUDe7 or contact either Daltone#2617 or Nintendude#0447 on Discord.\n\n"+ + "Sorry for the inconvenience.", "Warning: Version Not Supported", MessageBoxButtons.OK, MessageBoxIcon.Error).ToString(); + break; + } + case 0x48AE000: vars.version = 1.04; break; + case 0x48AF000: vars.version = 1.05; break; + case 0x48B0000: vars.version = 1.07; break; + case 0x48B8000: vars.version = 1.11; break; } - case 76210176: vars.version = 1.04; break; - case 76214272: vars.version = 1.05; break; - case 76218368: vars.version = 1.07; break; - case 76251136: vars.version = 1.11; break; - } - print("Version = " + vars.version); - - const int CLASS_OFFSET = 0x10; - const int CHILD_OFFSET = 0x50; - const int NEXT_OFFSET = 0x20; - const int NAME_OFFSET = 0x28; - const int INTERNAL_OFFSET = 0x4C; - const int SUPERFIELD_OFFSET = 0x40; - vars.offsets = new Dictionary(); - vars.fnames = new Dictionary(); - vars.interactibleName = ""; - vars.cachedPos = new Vector3f(); - vars.foundLeave = false; - vars.aftonButtons = 0; + print("Version = " + vars.version); + + const int CLASS_OFFSET = 0x10; + const int CHILD_OFFSET = 0x50; + const int NEXT_OFFSET = 0x20; + const int NAME_OFFSET = 0x28; + const int INTERNAL_OFFSET = 0x4C; + const int SUPERFIELD_OFFSET = 0x40; + vars.offsets = new Dictionary(); + vars.fnames = new Dictionary(); + vars.interactibleName = ""; + vars.cachedPos = new Vector3f(); + vars.foundLeave = false; + vars.aftonButtons = 0; #endregion #region Declare functions @@ -690,32 +687,13 @@ init { #endregion #region Player state related funcs - vars.checkItem = (Func)((name, item) => { - //checks in a sphere (radius 300u) - //90,000 is used at the end of calculations because 300 ^ 2 = 90,000 - if (settings[name] - &&(vars.watchers["pos"].Current.X - item.X)*(vars.watchers["pos"].Current.X - item.X) - + (vars.watchers["pos"].Current.Y - item.Y)*(vars.watchers["pos"].Current.Y - item.Y) - + (vars.watchers["pos"].Current.Z - item.Z)*(vars.watchers["pos"].Current.Z - item.Z) - < 90000){ - print(name); - return true; - } - return false; - }); - vars.checkSphereNoBool = (Func)((pos) => { - //checks in a sphere (radius 300u) - //90,000 is used at the end of calculations because 300 ^ 2 = 90,000 - if ((vars.watchers["pos"].Current.X - pos.X)*(vars.watchers["pos"].Current.X - pos.X) - + (vars.watchers["pos"].Current.Y - pos.Y)*(vars.watchers["pos"].Current.Y - pos.Y) - + (vars.watchers["pos"].Current.Z - pos.Z)*(vars.watchers["pos"].Current.Z - pos.Z) - < 90000){ - return true; - } - return false; - }); + vars.checkSphereNoBool = (Func)((pos) + => vars.watchers["pos"].Current.Distance(pos) < 300f); - vars.checkBox = (Func)((name, point1, point2) => { + vars.checkItem = (Func)((name, item) + => settings[name] && vars.checkSphereNoBool(item)); + + vars.checkBoxNoBool = (Func)((point1, point2) => { /* This first section is just to allow you to pick any two points directly opposite each other on a cuboid and still allow for the rest of the code to work, it's really just for convenience's sake*/ @@ -725,17 +703,17 @@ init { // Actually calculate if you are in the bounds of the defined cuboid // Includes a check to see if you've already completed this split (uses HashSet, initialized in startup{}) - if (settings[name] - && LB.X <= vars.watchers["pos"].Current.X && vars.watchers["pos"].Current.X <= UB.X + if (LB.X <= vars.watchers["pos"].Current.X && vars.watchers["pos"].Current.X <= UB.X && LB.Y <= vars.watchers["pos"].Current.Y && vars.watchers["pos"].Current.Y <= UB.Y - && LB.Z <= vars.watchers["pos"].Current.Z && vars.watchers["pos"].Current.Z <= UB.Z - && vars.CompletedSplits.Add(name)){ - print(name); + && LB.Z <= vars.watchers["pos"].Current.Z && vars.watchers["pos"].Current.Z <= UB.Z){ return true; } return false; }); + vars.checkBox = (Func)((name, point1, point2) + => settings[name] && vars.checkBoxNoBool(point1, point2) && vars.CompletedSplits.Add(name)); + vars.checkOldBoxNoBool = (Func)((point1, point2) => { /* This first section is just to allow you to pick any two points directly opposite each other on a cuboid and still allow for the rest of the code to work, it's really just for convenience's sake*/ @@ -753,97 +731,55 @@ init { return false; }); - vars.checkBoxNoBool = (Func)((point1, point2) => { - /* This first section is just to allow you to pick any two points directly opposite each other - on a cuboid and still allow for the rest of the code to work, it's really just for convenience's sake*/ - - // Calculate which X/Y/Z is the lower of the two points, and set the upper/lower bound point along that axis accordingly - Vector3f LB = new Vector3f(Math.Min(point1.X, point2.X), Math.Min(point1.Y, point2.Y), Math.Min(point1.Z, point2.Z)); - Vector3f UB = new Vector3f(Math.Max(point1.X, point2.X), Math.Max(point1.Y, point2.Y), Math.Max(point1.Z, point2.Z)); - // Actually calculate if you are in the bounds of the defined cuboid - // Includes a check to see if you've already completed this split (uses HashSet, initialized in startup{}) - if (LB.X <= vars.watchers["pos"].Current.X && vars.watchers["pos"].Current.X <= UB.X - && LB.Y <= vars.watchers["pos"].Current.Y && vars.watchers["pos"].Current.Y <= UB.Y - && LB.Z <= vars.watchers["pos"].Current.Z && vars.watchers["pos"].Current.Z <= UB.Z){ - return true; - } - return false; - }); - - vars.checkElevs = (Func)(() => { - return (vars.checkBoxNoBool(new Vector3f(24192, 49679, 360), new Vector3f(23814, 50161, 752)) //Afton - || vars.checkBoxNoBool(new Vector3f(328, 27856, 1421),new Vector3f(759, 27381, 1819)) //Kitchen (atrium) - || vars.checkBoxNoBool(new Vector3f(328, 27856, -10), new Vector3f(759, 27381, 408)) //Kitchen (kitchen) - || vars.checkBoxNoBool(new Vector3f(-11670, 40159, 1461),new Vector3f(-12176, 40711, 1816)) //Monty Golf (atrium) - || vars.checkBoxNoBool(new Vector3f(-14204, 42656, 1474),new Vector3f(-14759, 43240, 1847)) //Monty Golf (monty golf) - || vars.checkBoxNoBool(new Vector3f(-2669, 28897, 2038),new Vector3f(-2108, 28359, 2408)) //Atrium/Lobby (left side from atrium pov) - || vars.checkBoxNoBool(new Vector3f(-1295, 28903, 2038),new Vector3f(-738, 28369, 2408)) //Atrium/Lobby 2.0 (right side from atrium pov) - || vars.checkBoxNoBool(new Vector3f(5446, 37421, 3212),new Vector3f(5975, 36909, 3598)) //Bonnie Bowl - || vars.checkBoxNoBool(new Vector3f(7725, 34759, 1450),new Vector3f(8232, 34243, 1819)) //Fazerblast - || vars.checkBoxNoBool(new Vector3f(4289, 29381, 3289),new Vector3f(5530, 30187, 3555)) //West Arcade (atrium) - || vars.checkBoxNoBool(new Vector3f(5699, 28832, 2036),new Vector3f(4640, 28066, 2407)) //West Arcade (west arcade) - || vars.checkBoxNoBool(new Vector3f(-5071, 52079, 1911),new Vector3f(-5584, 52281,-1160)) //Chica Room (both encompassed in big box, same for next 3) - || vars.checkBoxNoBool(new Vector3f(-2812, 53483, 1683),new Vector3f(-1937, 52803,-1160)) //Monty Room - || vars.checkBoxNoBool(new Vector3f(-370, 52814, 1920),new Vector3f(-1155, 53030,-1193)) //Roxy Room - || vars.checkBoxNoBool(new Vector3f(2348, 52554, 1870),new Vector3f(2073, 52156,-1179))); //Freddy Room - }); - - vars.checkPQPosition = (Func)((name, xLB, xUB, yLB, yUB) => { - //PQ Position Goes Y, X, Z, as opposed to Gregory position (X, Y, Z) - if (settings[name] + vars.checkElevs = (Func)(() + => vars.checkBoxNoBool(new Vector3f(24192, 49679, 360), new Vector3f(23814, 50161, 752)) //Afton + || vars.checkBoxNoBool(new Vector3f(328, 27856, 1421),new Vector3f(759, 27381, 1819)) //Kitchen (atrium) + || vars.checkBoxNoBool(new Vector3f(328, 27856, -10), new Vector3f(759, 27381, 408)) //Kitchen (kitchen) + || vars.checkBoxNoBool(new Vector3f(-11670, 40159, 1461),new Vector3f(-12176, 40711, 1816)) //Monty Golf (atrium) + || vars.checkBoxNoBool(new Vector3f(-14204, 42656, 1474),new Vector3f(-14759, 43240, 1847)) //Monty Golf (monty golf) + || vars.checkBoxNoBool(new Vector3f(-2669, 28897, 2038),new Vector3f(-2108, 28359, 2408)) //Atrium/Lobby (left side from atrium pov) + || vars.checkBoxNoBool(new Vector3f(-1295, 28903, 2038),new Vector3f(-738, 28369, 2408)) //Atrium/Lobby 2.0 (right side from atrium pov) + || vars.checkBoxNoBool(new Vector3f(5446, 37421, 3212),new Vector3f(5975, 36909, 3598)) //Bonnie Bowl + || vars.checkBoxNoBool(new Vector3f(7725, 34759, 1450),new Vector3f(8232, 34243, 1819)) //Fazerblast + || vars.checkBoxNoBool(new Vector3f(4289, 29381, 3289),new Vector3f(5530, 30187, 3555)) //West Arcade (atrium) + || vars.checkBoxNoBool(new Vector3f(5699, 28832, 2036),new Vector3f(4640, 28066, 2407)) //West Arcade (west arcade) + || vars.checkBoxNoBool(new Vector3f(-5071, 52079, 1911),new Vector3f(-5584, 52281,-1160)) //Chica Room (both encompassed in big box, same for next 3) + || vars.checkBoxNoBool(new Vector3f(-2812, 53483, 1683),new Vector3f(-1937, 52803,-1160)) //Monty Room + || vars.checkBoxNoBool(new Vector3f(-370, 52814, 1920),new Vector3f(-1155, 53030,-1193)) //Roxy Room + || vars.checkBoxNoBool(new Vector3f(2348, 52554, 1870),new Vector3f(2073, 52156,-1179)) //Freddy Room + ); + + vars.checkPQPosition = (Func)((name, xLB, xUB, yLB, yUB) + => settings[name] && xLB <= vars.watchers["pos"].Current.Y && vars.watchers["pos"].Current.Y <= xUB && yLB <= vars.watchers["pos"].Current.X && vars.watchers["pos"].Current.X <= yUB - && vars.CompletedSplits.Add(name)){ - print(name); - return true; - } - return false; - }); + && vars.CompletedSplits.Add(name)); - vars.checkPQPositionNoBool = (Func)((name, xLB, xUB, yLB, yUB) => { - //PQ Position Goes Y, X, Z, as opposed to Gregory position (X, Y, Z) - if (settings[name] + vars.checkPQPositionNoBool = (Func)((name, xLB, xUB, yLB, yUB) + => settings[name] && xLB <= vars.watchers["pos"].Current.Y && vars.watchers["pos"].Current.Y <= xUB - && yLB <= vars.watchers["pos"].Current.X && vars.watchers["pos"].Current.X <= yUB){ - print(name); - return true; - } - return false; - }); + && yLB <= vars.watchers["pos"].Current.X && vars.watchers["pos"].Current.X <= yUB); - vars.checkGen = (Func)((name, check, x, y, zLB, zUB, oldPositionX, oldPositionY) => { - //checks in a circle (radius 200), upper and lower Z bound used - if (!settings[name]) return false; - if (!check) return false; - if (zLB > vars.watchers["pos"].Current.Z) return false; - if (vars.watchers["pos"].Current.Z > zUB) return false; - if (Math.Pow(oldPositionX - x, 2) + Math.Pow(oldPositionY - y, 2) > Math.Pow(200, 2)) return false; - if (Math.Pow(vars.watchers["pos"].Current.X - x, 2) + Math.Pow(vars.watchers["pos"].Current.Y - y, 2) <= Math.Pow(200, 2)) return false; - print(name); - return true; - }); + //checks in a circle (radius 200), upper and lower Z bound used + vars.checkGen = (Func)((name, x, y, zLower, zUpper) => { + if (!settings[name] + || zLower > vars.watchers["pos"].Current.Z || vars.watchers["pos"].Current.Z > zUpper) return false; - vars.checkTime = (Func)((name, hour, minute) => { - int _hour = vars.getHour(); - int _minute = vars.getMinute(); - if (settings[name] - && _hour == hour && _minute == minute - && vars.CompletedSplits.Add(name)){ - print(name); - return true; - } - return false; + Vector3f oPos = vars.watchers["pos"].Old, cPos = vars.watchers["pos"].Current, target = new Vector3f(x, y, 0); + return oPos.DistanceXY(target) <= 200f + && cPos.DistanceXY(target) > 200f + && vars.CompletedSplits(name); }); - vars.checkTimeNoBool = (Func)((hour, minute) => { - int _hour = vars.getHour(); - int _minute = vars.getMinute(); - if (_hour == hour && _minute == minute){ - return true; - } - return false; - }); + vars.checkTimeNoBool = (Func)((hour, minute) + => vars.getHour() == hour && vars.getMinute() == minute); + + vars.checkTime = (Func)((name, hour, minute) + => settings[name] + && vars.checkTimeNoBool(hour, minute) + && vars.CompletedSplits.Add(name)); + #endregion #region Miscellaneous functions @@ -885,9 +821,8 @@ init { if (!vars.offsets.ContainsKey(name)) vars.GetPropertyOffset(address, name); }); - vars.cacheCurrentPos = (Action)(() => { - vars.cachedPos = new Vector3f(vars.watchers["pos"].Current.X, vars.watchers["pos"].Current.Y, vars.watchers["pos"].Current.Z); - }); + vars.cacheCurrentPos = (Action)(() + => vars.cachedPos = new Vector3f(vars.watchers["pos"].Current.X, vars.watchers["pos"].Current.Y, vars.watchers["pos"].Current.Z)); vars.findLeave = (Func)(() => { if (!vars.foundLeave){ @@ -914,10 +849,9 @@ init { return true; }); - vars.checkLeave = (Func)(() => { - return (int)vars.watchers["leaveButton"].Current == 0 && (int)vars.watchers["leaveButton"].Old != 0 - && vars.watchers["worldCheck"].Current != 0; - }); + vars.checkLeave = (Func)(() + => (int)vars.watchers["leaveButton"].Current == 0 && (int)vars.watchers["leaveButton"].Old != 0 + && vars.watchers["worldCheck"].Current != 0); vars.resetVariables = (Action)(() => { //These 2 watchers are addresses which change while the game is running, and which change depending on what the player is interacting with. @@ -1329,395 +1263,320 @@ split { } #endregion - switch ((string)vars.arcade){ - case "N/A": { - #region Counter splits - if (settings["Counting Splits"]){ - if (vars.watchers["DGens"].Current > vars.watchers["DGens"].Old){ - if (settings["Daycare Generators"]){ - if (settings["D_Generator " + vars.watchers["DGens"].Current]){ - print("DGen " + vars.watchers["DGens"].Current); - return true; - } - } - } - if (vars.interactibleName == "fazerblastFlag" && vars.watchers["lastInteractible"].Old && !vars.watchers["lastInteractible"].Current){ - vars.fbFlags += 1; - if (settings["Fazerblast Flags"]){ - if (settings["Flag " + vars.fbFlags]){ - print("Flag " + vars.fbFlags); - return true; - } - } - } - if (vars.interactibleName == "montyCannon" && vars.watchers["lastInteractible"].Old < vars.watchers["lastInteractible"].Current){ - vars.montyBalls += 1; - if (settings["Monty Bucket Count"]){ - if (settings[vars.montyBalls + " Balls"]){ - print(vars.montyBalls + " Balls"); - return true; - } - } - } - if (settings["Sewer Generators"]){ - if (vars.checkGen("S_Generator 1", vars.cSewerGen1, -1515, 16575, -10000, -2500, vars.watchers["pos"].Old.X, vars.watchers["pos"].Old.Y)){ - vars.cSewerGen1 = false; - return true; - } - if (vars.checkGen("S_Generator 2", vars.cSewerGen2, -10525, 21155, -10000, -2500, vars.watchers["pos"].Old.X, vars.watchers["pos"].Old.Y)){ - vars.cSewerGen2 = false; - return true; - } - if (vars.checkGen("S_Generator 3", vars.cSewerGen3, -3785, 16480, -10000, -2500, vars.watchers["pos"].Old.X, vars.watchers["pos"].Old.Y)){ - vars.cSewerGen3 = false; - return true; - } - } - if (settings["West Arcade Generators"]){ - if (vars.checkGen("WA_Generator 1", vars.cWAGen1, 10440, 28375, 2140, 2290, vars.watchers["pos"].Old.X, vars.watchers["pos"].Old.Y)){ - vars.cWAGen1 = false; - return true; - } - if (vars.checkGen("WA_Generator 2", vars.cWAGen2, 8920, 23075, 2100, 2250, vars.watchers["pos"].Old.X, vars.watchers["pos"].Old.Y)){ - vars.cWAGen2 = false; - return true; - } - if (vars.checkGen("WA_Generator 3", vars.cWAGen3, 2125, 25970, 2150, 2300, vars.watchers["pos"].Old.X, vars.watchers["pos"].Old.Y)){ - vars.cWAGen3 = false; - return true; - } - if (vars.checkGen("WA_Generator 4", vars.cWAGen4, 3030, 27210, 3290, 3440, vars.watchers["pos"].Old.X, vars.watchers["pos"].Old.Y)){ - vars.cWAGen4 = false; - return true; - } - if (vars.checkGen("WA_Generator 5", vars.cWAGen5, 9205, 20770, 3290, 3440, vars.watchers["pos"].Old.X, vars.watchers["pos"].Old.Y)){ - vars.cWAGen5 = false; - return true; - } - } + string arcade = vars.arcade; + if (arcade == "N/A"){ + #region Counter splits + if (vars.watchers["DGens"].Current > vars.watchers["DGens"].Old && settings["D_Generator " + vars.watchers["DGens"].Current]){ + print("DGen " + vars.watchers["DGens"].Current); + } + if (vars.interactibleName == "fazerblastFlag" && vars.watchers["lastInteractible"].Old && !vars.watchers["lastInteractible"].Current){ + vars.fbFlags += 1; + if (settings["Flag " + vars.fbFlags]){ + print("Flag " + vars.fbFlags); + return true; } - #endregion - - #region Deload splits - if (settings["Deload Splits"]){ - if (vars.watchers["pos"].Current.X != vars.watchers["pos"].Old.X || vars.watchers["pos"].Current.Y != vars.watchers["pos"].Old.Y || vars.watchers["pos"].Current.Z != vars.watchers["pos"].Old.Z){ - if (vars.checkBox("Foxy Cutout Deload", new Vector3f(-4942, 53000, 1790), new Vector3f(-4769, 52900, 2000))) return true; - if (settings["D_Daycare"]){ - if (vars.checkBox("Arcade Deload", new Vector3f(-13600, 30000, 1821.75f), new Vector3f(-13300, 31800, 2000))) return true; - if (vars.checkBox("Theatre Deload", new Vector3f(-20000, 32377.5f, 2516), new Vector3f(-19500, 34800, 2600))) return true; - } - if (vars.checkBox("KCD_Fence Deload", new Vector3f(-10270, 31000, 2062), new Vector3f(-9038, 36403, 3000))) return true; - if (vars.checkBox("MGD_Fence Deload", new Vector3f(-10270, 38460, 2062), new Vector3f(-9038, 42100, 3000))) return true; - if (vars.checkBox("Counter Deload", new Vector3f(-3750, 28250, 3750), new Vector3f(-3250, 28750, 4000))) return true; - if (settings["D_Rockstar Row"]){ - if (vars.checkBox("Chica Greenroom Deload", new Vector3f(-4700, 52300, 1993), new Vector3f(-4200, 52700, 2500))) return true; - if (vars.checkBox("Curtain Deload", new Vector3f(5150, 44450, 1960), new Vector3f(5350, 44650, 2100))) return true; - if (vars.checkBox("Roxy Cutout Deload", new Vector3f(3700, 44300, 1877), new Vector3f(3850, 44700, 1950))) return true; - if (vars.checkBox("Tunnel Door Deload", new Vector3f(-1500, 49250, 1750), new Vector3f(-1300, 49492, 1900))) return true; - } - if (settings["D_Roxy Raceway"]){ - if (vars.checkBox("Afton Rock Column Deload", new Vector3f(24000, 48000, 2411.5f), new Vector3f(25500, 49500, 2800))) return true; - if (vars.checkBox("Garage Fence Jump", new Vector3f(18000, 38800, 2411.5f), new Vector3f(19500, 39100, 2800))) return true; - if (vars.checkBox("Roxy's Eyes Deload", new Vector3f(19500, 50750, 988), new Vector3f(20500, 51150, 1100))) return true; - } - if (vars.checkBox("Balloon Deload", new Vector3f(8300, 38000, 2708), new Vector3f(9000, 39000, 3000))) return true; - if (vars.checkBox("Plant Deload", new Vector3f(9000, 41800, 2708), new Vector3f(10500, 42000, 3000))) return true; - } + } + if (vars.interactibleName == "montyCannon" && vars.watchers["lastInteractible"].Old < vars.watchers["lastInteractible"].Current){ + vars.montyBalls += 1; + if (settings[vars.montyBalls + " Balls"]){ + print(vars.montyBalls + " Balls"); + return true; } - #endregion - - #region Ending splits - if (settings["Ending Splits"]){ - //splits based on ending cutscenes - if (settings["CB_B"] && vars.checkBoxNoBool(new Vector3f(-3194, 19196, 0), new Vector3f(-2911, 18959, 312)) - && vars.checkTimeNoBool(6, 0) && vars.findLeave()){ - if (vars.checkLeave()){ - print("Car Escape Button"); - return true; - } - } - if (settings["E_B"] && vars.checkTimeNoBool(6, 0) && - (vars.checkBoxNoBool(new Vector3f(-2238, 19846, 1442), new Vector3f(-1943, 19521, 1746)) - ||vars.checkBoxNoBool(new Vector3f(-1437, 19846, 1442), new Vector3f(-1144, 19521, 1746))) - && vars.findLeave()){ - if (vars.checkLeave()){ - print("Escape Button"); - return true; - } - } - if (settings["F_B"] && vars.checkBoxNoBool(new Vector3f(-1789, 22700, 3268), new Vector3f(-1595, 22620, 3529)) - && vars.checkTimeNoBool(6, 0) && vars.findLeave()){ - if (vars.checkLeave()){ - print("Fire Escape Button"); - return true; - } - } - if (vars.watchers["pq3Attack"].Current && !vars.watchers["pq3Attack"].Old){ - if (vars.checkPQPositionNoBool("pq3_endEndings", 1800, 2200, 1635.34, 1700)){ - return true; - } - } - if (settings["V_B"] && vars.interactibleName == "vannyButton" && !vars.watchers["lastInteractible"].Current && vars.watchers["lastInteractible"].Old) return true; - //other ending splits - if (vars.interactibleName == "burntrapButton" && vars.watchers["lastInteractible"].Old && !vars.watchers["lastInteractible"].Current){ - vars.aftonButtons++; - if (settings["Button " + vars.aftonButtons]){ - print("Button " + vars.aftonButtons); - return true; - } - if (settings["Afton Ending"] && vars.aftonButtons == 8){ - print("Button 8 / End"); - return true; - } - } + } + if (vars.checkGen("S_Generator 1", -1515, 16575, -10000, -2500)) return true; + if (vars.checkGen("S_Generator 2", -10525, 21155, -10000, -2500)) return true; + if (vars.checkGen("S_Generator 3", -3785, 16480, -10000, -2500)) return true; + if (vars.checkGen("WA_Generator 1", 10440, 28375, 2140, 2290)) return true; + if (vars.checkGen("WA_Generator 2", 8920, 23075, 2100, 2250)) return true; + if (vars.checkGen("WA_Generator 3", 2125, 25970, 2150, 2300)) return true; + if (vars.checkGen("WA_Generator 4", 3030, 27210, 3290, 3440)) return true; + if (vars.checkGen("WA_Generator 5", 9205, 20770, 3290, 3440)) return true; + if (vars.interactibleName == "burntrapButton" && vars.watchers["lastInteractible"].Old && !vars.watchers["lastInteractible"].Current){ + vars.aftonButtons++; + if (settings["Button " + vars.aftonButtons]){ + print("Button " + vars.aftonButtons); + return true; } - #endregion - - #region Item splits - if (settings["Item Splits"]){ - if (settings["Item List"]){ - //Chica's voicebox is weird. Investigate yourself if you want to know more. - if (vars.interactibleName == "chicaSewer"){ - if (vars.watchers["canCollect"].Old == -1 && vars.watchers["canCollect"].Current != -1 && settings["Chica's Voicebox"]){ - print("Chica's Voicebox"); - return true; - } - } - if (vars.interactibleName == "message" && vars.watchers["canCollect"].Old >= 0.98f){ - string currentName = vars.GetNameFromFName(vars.watchers["lastInteractible"].Current); - if (currentName.Contains("ChicaVoiceBox") && vars.CompletedSplits.Add("ChicaVoiceBox_M")){ - print("ChicaVoiceBox_M"); - return true; - } - else if (currentName.Contains("RoxyEyes") && vars.CompletedSplits.Add("RoxyEyes_M")){ - print("RoxyEyes_M"); - return true; - } - else if (currentName.Contains("MontyClaws") && vars.CompletedSplits.Add("MontyClaws_M")){ - print("MontyClaws_M"); - return true; - } - else if (settings[currentName] && vars.CompletedSplits.Add(currentName)){ - print(currentName); - return true; - } - } - if (vars.interactibleName == "collectible" && vars.watchers["canCollect"].Old >= 0.98f){ - string currentName = vars.GetNameFromFName(vars.watchers["lastInteractible"].Current); - if (currentName.Contains("RoxyEyes") && vars.CompletedSplits.Add("RoxyEyes_C")){ - print("RoxyEyes_C"); - return true; - } - else if (currentName.Contains("MontyClaws") && vars.CompletedSplits.Add("MontyClaws_C")){ - print("MontyClaws_C"); - return true; - } - else if (settings[currentName] && vars.CompletedSplits.Add(currentName)){ - print(currentName); - return true; - } - } - if (settings["Flashlight"] && vars.interactibleName == "flashlight" && vars.watchers["canCollect"].Old && !vars.watchers["canCollect"].Current && vars.CompletedSplits.Add("Flashlight")){ - print("Flashlight"); - return true; - } - //extraneous items: - //Fazerblasters - //Daycare Pass - //Cameras - //Repaired Head - //Badges - if (settings["Equipment"]){ - if (vars.watchers["itemCount"].Current > vars.watchers["itemCount"].Old){ - if (settings["Grey Fazerblaster"] && vars.GetNameFromFName(vars.watchers["closestInteractibleFName"].Old).Contains("LaserGunCollectible_Game")) return true; - if (settings["Golden Fazerblaster"] && vars.GetNameFromFName(vars.watchers["closestInteractibleFName"].Old).Contains("LaserGunCollectible_Prize")) return true; - if (settings["E_Utility Tunnels"] && vars.GetNameFromFName(vars.watchers["closestInteractibleFName"].Old) == "BB_UtilityStart") return true; - } - if (settings["Daycare Pass"] && vars.interactibleName == "daycareMachine" && !vars.watchers["canCollect"].Old && vars.watchers["canCollect"].Current) return true; - if (settings["E_West Arcade"] && vars.checkTime("Repaired Head", 5, 30)) return true; - if (settings["Pizzaplex Cameras"] && vars.interactibleName == "cameraButton" && !vars.watchers["canCollect"].Old && vars.watchers["canCollect"].Current) return true; - } - if (settings["Security Badges"]){ - if (vars.watchers["securityBadgeCount"].Current > vars.watchers["securityBadgeCount"].Old){ - if (settings["Security Badge " + vars.watchers["securityBadgeCount"].Current]){ - print("Security Badge " + vars.watchers["securityBadgeCount"].Current); - return true; - } - } - } + if (settings["Afton Ending"] && vars.aftonButtons == 8){ + print("Button 8 / End"); + return true; + } + } + #endregion + + #region Positional/Deload splits + if (vars.watchers["pos"].Current.X != vars.watchers["pos"].Old.X + || vars.watchers["pos"].Current.Y != vars.watchers["pos"].Old.Y + || vars.watchers["pos"].Current.Z != vars.watchers["pos"].Old.Z){ + //Deloads + if (vars.checkBox("Foxy Cutout Deload", new Vector3f(-4942, 53000, 1790), new Vector3f(-4769, 52900, 2000))) return true; + if (vars.checkBox("Arcade Deload", new Vector3f(-13600, 30000, 1821.75f), new Vector3f(-13300, 31800, 2000))) return true; + if (vars.checkBox("Theatre Deload", new Vector3f(-20000, 32377.5f, 2516), new Vector3f(-19500, 34800, 2600))) return true; + if (vars.checkBox("KCD_Fence Deload", new Vector3f(-10270, 31000, 2062), new Vector3f(-9038, 36403, 3000))) return true; + if (vars.checkBox("MGD_Fence Deload", new Vector3f(-10270, 38460, 2062), new Vector3f(-9038, 42100, 3000))) return true; + if (vars.checkBox("Counter Deload", new Vector3f(-3750, 28250, 3750), new Vector3f(-3250, 28750, 4000))) return true; + if (vars.checkBox("Chica Greenroom Deload", new Vector3f(-4700, 52300, 1993), new Vector3f(-4200, 52700, 2500))) return true; + if (vars.checkBox("Curtain Deload", new Vector3f(5150, 44450, 1960), new Vector3f(5350, 44650, 2100))) return true; + if (vars.checkBox("Roxy Cutout Deload", new Vector3f(3700, 44300, 1877), new Vector3f(3850, 44700, 1950))) return true; + if (vars.checkBox("Tunnel Door Deload", new Vector3f(-1500, 49250, 1750), new Vector3f(-1300, 49492, 1900))) return true; + if (vars.checkBox("Afton Rock Column Deload", new Vector3f(24000, 48000, 2411.5f), new Vector3f(25500, 49500, 2800))) return true; + if (vars.checkBox("Garage Fence Jump", new Vector3f(18000, 38800, 2411.5f), new Vector3f(19500, 39100, 2800))) return true; + if (vars.checkBox("Roxy's Eyes Deload", new Vector3f(19500, 50750, 988), new Vector3f(20500, 51150, 1100))) return true; + if (vars.checkBox("Balloon Deload", new Vector3f(8300, 38000, 2708), new Vector3f(9000, 39000, 3000))) return true; + if (vars.checkBox("Plant Deload", new Vector3f(9000, 41800, 2708), new Vector3f(10500, 42000, 3000))) return true; + //Positions + if (vars.checkBox("Enter Bonnie Bowl", new Vector3f(5970, 37000, 3200), new Vector3f(6280, 37300, 3700))) return true; + if (vars.checkTime("Enter Daycare", 0, 30)) return true; + if (vars.checkBox("Enter El Chips", new Vector3f(-8700, 34600, 3200), new Vector3f(-8445, 35700, 3700))) return true; + if (vars.checkBox("Fazerblast Spiral Stairs", new Vector3f(13100, 31830, 350), new Vector3f(14600, 33330, 750))) return true; + if (vars.checkBox("Rail Outside Fazerblast", new Vector3f(6800, 35586, 1500), new Vector3f(7550, 35637.4f, 2150))) return true; + if (vars.checkBox("Exit Afton Elevator", new Vector3f(24170, 49932, -6100), new Vector3f(24465, 49499, 5800))) return true; + if (vars.checkBox("First Aid Vanessa Cutscene", new Vector3f(4368, 45005, -1308), new Vector3f(4370, 45007, -1306))) return true; + if (vars.checkBox("Freddy Rail Jump", new Vector3f(2250, 46900, 400), new Vector3f(2850, 47500, 900))) return true; + if (vars.checkBox("Monty Chase", new Vector3f(2900, 29898.825f, 0), new Vector3f(3400, 29500, 300))) return true; + if (vars.checkBox("STR-ATR-W Stairs", new Vector3f(5400, 37500, -1230), new Vector3f(6000, 38000, -1150))) return true; + if (vars.checkBox("STR-LB Stairs", new Vector3f(5000, 24500, 150), new Vector3f(6000, 25000, 400))) return true; + if (vars.checkBox("Enter West Arcade", new Vector3f(5155, 27863, 2060), new Vector3f(5683, 28139, 2260))){ + vars.pEnWestArcade = false; + vars.pExWestArcade = true; + return true; + } + if (vars.checkBox("Exit West Arcade", new Vector3f(4793, 30290, 3400), new Vector3f(4528, 30085, 3250))){ + vars.pExWestArcade = false; + return true; + } + } + #endregion + + #region Ending splits + //splits based on ending cutscenes + if (settings["CB_B"] && vars.checkBoxNoBool(new Vector3f(-3194, 19196, 0), new Vector3f(-2911, 18959, 312)) + && vars.checkTimeNoBool(6, 0) && vars.findLeave()){ + if (vars.checkLeave()){ + print("Car Escape Button"); + return true; + } + } + if (settings["E_B"] && vars.checkTimeNoBool(6, 0) && + (vars.checkBoxNoBool(new Vector3f(-2238, 19846, 1442), new Vector3f(-1943, 19521, 1746)) + ||vars.checkBoxNoBool(new Vector3f(-1437, 19846, 1442), new Vector3f(-1144, 19521, 1746))) + && vars.findLeave()){ + if (vars.checkLeave()){ + print("Escape Button"); + return true; + } + } + if (settings["F_B"] && vars.checkBoxNoBool(new Vector3f(-1789, 22700, 3268), new Vector3f(-1595, 22620, 3529)) + && vars.checkTimeNoBool(6, 0) && vars.findLeave()){ + if (vars.checkLeave()){ + print("Fire Escape Button"); + return true; + } + } + if (vars.watchers["pq3Attack"].Current && !vars.watchers["pq3Attack"].Old){ + if (vars.checkPQPositionNoBool("pq3_endEndings", 1800, 2200, 1635.34, 1700)){ + return true; + } + } + if (settings["V_B"] && vars.interactibleName == "vannyButton" + && !vars.watchers["lastInteractible"].Current && vars.watchers["lastInteractible"].Old) return true; + //Afton ending splits are up in "Counter splits" because you have to count each button pressed + #endregion + + #region Item splits + //Chica's voicebox is weird. Investigate yourself if you want to know more. + if (vars.interactibleName == "chicaSewer"){ + if (vars.watchers["canCollect"].Old == -1 && vars.watchers["canCollect"].Current != -1 && settings["Chica's Voicebox"]){ + print("Chica's Voicebox"); + return true; + } + } + if (vars.interactibleName == "message" && vars.watchers["canCollect"].Old >= 0.98f){ + string currentName = vars.GetNameFromFName(vars.watchers["lastInteractible"].Current); + if (currentName.Contains("ChicaVoiceBox") && vars.CompletedSplits.Add("ChicaVoiceBox_M")){ + print("ChicaVoiceBox_M"); + return true; + } + else if (currentName.Contains("RoxyEyes") && vars.CompletedSplits.Add("RoxyEyes_M")){ + print("RoxyEyes_M"); + return true; + } + else if (currentName.Contains("MontyClaws") && vars.CompletedSplits.Add("MontyClaws_M")){ + print("MontyClaws_M"); + return true; + } + else if (settings[currentName] && vars.CompletedSplits.Add(currentName)){ + print(currentName); + return true; + } + } + if (vars.interactibleName == "collectible" && vars.watchers["canCollect"].Old >= 0.98f){ + string currentName = vars.GetNameFromFName(vars.watchers["lastInteractible"].Current); + if (currentName.Contains("RoxyEyes") && vars.CompletedSplits.Add("RoxyEyes_C")){ + print("RoxyEyes_C"); + return true; + } + else if (currentName.Contains("MontyClaws") && vars.CompletedSplits.Add("MontyClaws_C")){ + print("MontyClaws_C"); + return true; + } + else if (settings[currentName] && vars.CompletedSplits.Add(currentName)){ + print(currentName); + return true; + } + } + if (settings["Flashlight"] && vars.interactibleName == "flashlight" + && vars.watchers["canCollect"].Old && !vars.watchers["canCollect"].Current + && vars.CompletedSplits.Add("Flashlight")){ + print("Flashlight"); + return true; + } + //extraneous items: + //Fazerblasters + //Daycare Pass + //Cameras + //Repaired Head + //Badges + if (vars.watchers["itemCount"].Current > vars.watchers["itemCount"].Old){ + var oldName = vars.GetNameFromFName(vars.watchers["closestInteractibleFName"].Old); + if (settings["Grey Fazerblaster"] && oldName.Contains("LaserGunCollectible_Game")) return true; + if (settings["Golden Fazerblaster"] && oldName.Contains("LaserGunCollectible_Prize")) return true; + if (settings["E_Utility Tunnels"] && oldName == "BB_UtilityStart") return true; + } + if (settings["Daycare Pass"] && vars.interactibleName == "daycareMachine" + && !vars.watchers["canCollect"].Old && vars.watchers["canCollect"].Current) return true; + if (settings["E_West Arcade"] && vars.checkTime("Repaired Head", 5, 30)) return true; + if (settings["Pizzaplex Cameras"] && vars.interactibleName == "cameraButton" + && !vars.watchers["canCollect"].Old && vars.watchers["canCollect"].Current) return true; + if (vars.watchers["securityBadgeCount"].Current > vars.watchers["securityBadgeCount"].Old){ + if (settings["Security Badge " + vars.watchers["securityBadgeCount"].Current]){ + print("Security Badge " + vars.watchers["securityBadgeCount"].Current); + return true; + } + } + #endregion + + #region Time splits + if (!vars.onMenu && (vars.getHour() != vars.getOldHour() || vars.getMinute() != vars.getOldMinute())){ + if (vars.checkTime("Exit Vents (11:30PM)", -1, 30)) return true; + if (vars.checkTime("Freddy Recharge (11:45PM)", -1, 45)) return true; + if (vars.watchers["worldCheck"].Current != 0 + && vars.checkTime("Front Entrance Closure (12:00AM)", 0, 0)) return true; + if (vars.checkTime("Enter Daycare (12:30AM)", 0, 30)) return true; + if (vars.checkTime("Daycare Nighttime (12:55AM)", 0, 55)) return true; + if (vars.checkTime("Daycare Vanny Cutscene (1:00AM)", 1, 0)) return true; + if (vars.checkTime("Mini Music Man Chase (1:15AM)", 1, 15)) return true; + if (vars.checkTime("Pizzabot (1:30AM)", 1, 30)) return true; + if (vars.checkTime("White Woman Abduction (2:00AM)", 2, 0)) return true; + if (vars.checkTime("Dead Fred (2:15AM)", 2, 15)) return true; + if (vars.checkTime("Backstage Pass (2:30AM)", 2, 30)) return true; + if (vars.checkTime("Use Showtime Disk (2:45AM)", 2, 45)) return true; + if (vars.checkTime("Freddy Abduction Recharge (3:00AM)", 3, 0)) return true; + if (vars.checkTime("Vanessa Repair Cutscene (3:15AM)", 3, 15)) return true; + if (vars.checkTime("Freddy Power Upgrade (3:30AM)", 3, 30)) return true; + if (vars.checkTime("Party Pass Recharge (4:00AM)", 4, 0)) return true; + if (vars.checkTime("Golden Fazerblaster (4:15AM)", 4, 15)) return true; + if (settings["Monty Mix / Mazercise Key (4:30AM)"]){ + if (vars.watchers["splashScreen"].Current > vars.watchers["splashScreen"].Old){ + if (vars.checkItem("Monty Mix / Mazercise Key (4:30AM)", new Vector3f(15060, 30205, 3425))) return true; + if (vars.checkItem("Monty Mix / Mazercise Key (4:30AM)", new Vector3f(-17450, 31605, 70))) return true; } } - #endregion - - #region Positional splits - if (settings["Positional Splits"]){ - if (vars.watchers["pos"].Current.X != vars.watchers["pos"].Old.X){ - if (vars.checkBox("Enter Bonnie Bowl", new Vector3f(5970, 37000, 3200), new Vector3f(6280, 37300, 3700))) return true; - if (vars.checkTime("Enter Daycare", 0, 30)) return true; - if (vars.checkBox("Enter El Chips", new Vector3f(-8700, 34600, 3200), new Vector3f(-8445, 35700, 3700))) return true; - if (vars.checkBox("Fazerblast Spiral Stairs", new Vector3f(13100, 31830, 350), new Vector3f(14600, 33330, 750))) return true; - if (vars.checkBox("Rail Outside Fazerblast", new Vector3f(6800, 35586, 1500), new Vector3f(7550, 35637.4f, 2150))) return true; - if (vars.checkBox("Exit Afton Elevator", new Vector3f(24170, 49932, -6100), new Vector3f(24465, 49499, 5800))) return true; - if (settings["P_Utility Tunnels"]){ - if (vars.checkBox("First Aid Vanessa Cutscene", new Vector3f(4368, 45005, -1308), new Vector3f(4370, 45007, -1306))) return true; - if (vars.checkBox("Freddy Rail Jump", new Vector3f(2250, 46900, 400), new Vector3f(2850, 47500, 900))) return true; - if (vars.checkBox("Monty Chase", new Vector3f(2900, 29898.825f, 0), new Vector3f(3400, 29500, 300))) return true; - if (vars.checkBox("STR-ATR-W Stairs", new Vector3f(5400, 37500, -1230), new Vector3f(6000, 38000, -1150))) return true; - if (vars.checkBox("STR-LB Stairs", new Vector3f(5000, 24500, 150), new Vector3f(6000, 25000, 400))) return true; - } - if (settings["P_West Arcade"]){ - if (vars.checkBox("Enter West Arcade", new Vector3f(5155, 27863, 2060), new Vector3f(5683, 28139, 2260))){ - vars.pEnWestArcade = false; - vars.pExWestArcade = true; - return true; - } - if (vars.checkBox("Exit West Arcade", new Vector3f(4793, 30290, 3400), new Vector3f(4528, 30085, 3250))){ - vars.pExWestArcade = false; - return true; - } - } + if (vars.checkTime("Leave Sewers (4:40AM)", 4, 40)) return true; + if (vars.checkTime("Freddy Upgrade Recharge (5:00AM)", 5, 0)) return true; + if (vars.checkTime("Damaged Head (5:15AM)", 5, 15)) return true; + if (vars.checkTime("Repaired Head (5:30AM)", 5, 30)) return true; + if (vars.checkTime("Finish Roxy Sequence (5:40AM)", 5, 40)) return true; + if (vars.checkTime("Freddy Eye Upgrade Nighttime (5:50AM)", 5, 50))return true; + if (vars.checkTime("Reach Exit Door (6:00AM)", 6, 0)) return true; + } + #endregion + + } + + #region Arcade splits + if (vars.arcade == "BB Arcade" && settings["bb_start"] && vars.bb_start){ + vars.bb_start = false; + vars.bb_end = true; + print("bb_start"); + return true; + } + + if (vars.arcade == "Monty Golf"){ + if (settings["mg_start"]){ + if (vars.mg_start){ + vars.mg_start = false; + vars.mg_end = true; + print("mg_start"); + return true; } } - #endregion - - #region Time splits - if (settings["Time Splits"] && !vars.onMenu){ - if (vars.getHour() != vars.getOldHour() || vars.getMinute() != vars.getOldMinute()){ - if (vars.checkTime("Exit Vents (11:30PM)", -1, 30)) return true; - if (vars.checkTime("Freddy Recharge (11:45PM)", -1, 45)) return true; - if (vars.watchers["worldCheck"].Current != 0 - && vars.checkTime("Front Entrance Closure (12:00AM)", 0, 0)) return true; - if (vars.checkTime("Enter Daycare (12:30AM)", 0, 30)) return true; - if (vars.checkTime("Daycare Nighttime (12:55AM)", 0, 55)) return true; - if (vars.checkTime("Daycare Vanny Cutscene (1:00AM)", 1, 0)) return true; - if (vars.checkTime("Mini Music Man Chase (1:15AM)", 1, 15)) return true; - if (vars.checkTime("Pizzabot (1:30AM)", 1, 30)) return true; - if (vars.checkTime("White Woman Abduction (2:00AM)", 2, 0)) return true; - if (vars.checkTime("Dead Fred (2:15AM)", 2, 15)) return true; - if (vars.checkTime("Backstage Pass (2:30AM)", 2, 30)) return true; - if (vars.checkTime("Use Showtime Disk (2:45AM)", 2, 45)) return true; - if (vars.checkTime("Freddy Abduction Recharge (3:00AM)", 3, 0)) return true; - if (vars.checkTime("Vanessa Repair Cutscene (3:15AM)", 3, 15)) return true; - if (vars.checkTime("Freddy Power Upgrade (3:30AM)", 3, 30)) return true; - if (vars.checkTime("Party Pass Recharge (4:00AM)", 4, 0)) return true; - if (vars.checkTime("Golden Fazerblaster (4:15AM)", 4, 15)) return true; - if (settings["Monty Mix / Mazercise Key (4:30AM)"]){ - if (vars.watchers["splashScreen"].Current > vars.watchers["splashScreen"].Old){ - if (vars.checkItem("Monty Mix / Mazercise Key (4:30AM)", new Vector3f(15060, 30205, 3425))) return true; - if (vars.checkItem("Monty Mix / Mazercise Key (4:30AM)", new Vector3f(-17450, 31605, 70))) return true; - } - } - if (vars.checkTime("Leave Sewers (4:40AM)", 4, 40)) return true; - if (vars.checkTime("Freddy Upgrade Recharge (5:00AM)", 5, 0)) return true; - if (vars.checkTime("Damaged Head (5:15AM)", 5, 15)) return true; - if (vars.checkTime("Repaired Head (5:30AM)", 5, 30)) return true; - if (vars.checkTime("Finish Roxy Sequence (5:40AM)", 5, 40)) return true; - if (vars.checkTime("Freddy Eye Upgrade Nighttime (5:50AM)", 5, 50))return true; - if (vars.checkTime("Reach Exit Door (6:00AM)", 6, 0)) return true; + if (vars.watchers["golfStrokeCount"].Current == 0){ + vars.nHole = 0; + } + if (vars.watchers["golfStrokeCount"].Current > vars.watchers["golfStrokeCount"].Old){ + vars.nHole++; + if (settings["Finish Hole " + vars.nHole.ToString()]){ + print("Finish Hole " + vars.nHole.ToString()); + return true; } } - #endregion - break; } - #region Arcade splits - default: { - if (!settings[vars.arcade]) break; - switch ((string)vars.arcade){ - case "BB Arcade": { - if (!settings["bb_start"]) break; - if (!vars.bb_start) break; - - vars.bb_start = false; - vars.bb_end = true; - print("bb_start"); + + #region Princess Quest + if (vars.arcade == "Princess Quest 1"){ + if (settings["pq1_start"] && vars.CompletedSplits.Add("pq1_start")){ + print("pq1_start"); return true; } - - case "Monty Golf": { - if (settings["mg_start"]){ - if (vars.mg_start){ - vars.mg_start = false; - vars.mg_end = true; - print("mg_start"); - return true; - } - } - if (vars.watchers["golfStrokeCount"].Current == 0){ - vars.nHole = 0; - } - if (vars.watchers["golfStrokeCount"].Current > vars.watchers["golfStrokeCount"].Old){ - vars.nHole++; - if (settings["Finish Hole " + vars.nHole.ToString()]){ - print("Finish Hole " + vars.nHole.ToString()); - return true; - } - } - break; + if (vars.checkPQPosition("pq1_1", 785, 1215, -160, 160)) return true; + if (vars.checkPQPosition("pq1_2", 1715, 2530, -160, 160)) return true; + if (vars.checkPQPosition("pq1_3", 3055, 3800, -160, 160)) return true; + if (vars.checkPQPosition("pq1_4", 1715, 2530, 600, 1425)) return true; + if (vars.checkPQPosition("pq1_5", 1900, 2340, 1860, 2180)) return true; + if (vars.checkPQPosition("pq1_6", 2860, 4695, 1780, 2810)) return true; + if (vars.checkPQPosition("pq1_7", 5220, 6515, 2150, 2780)) return true; + if (vars.checkPQPosition("pq1_8", 950, 1380, 1865, 2300)) return true; + if (vars.checkPQPosition("pq1_9", 2020, 2210, 3425, 5125)){ + vars.pq1_end = true; + return true; } + } - default: { - if (!settings["Princess Quest"]) break; - - switch ((string)vars.arcade){ - case "Princess Quest 1": { - if (settings["pq1_start"] && vars.CompletedSplits.Add("pq1_start")){ - print("pq1_start"); - return true; - } - if (vars.checkPQPosition("pq1_1", 785, 1215, -160, 160)) return true; - if (vars.checkPQPosition("pq1_2", 1715, 2530, -160, 160)) return true; - if (vars.checkPQPosition("pq1_3", 3055, 3800, -160, 160)) return true; - if (vars.checkPQPosition("pq1_4", 1715, 2530, 600, 1425)) return true; - if (vars.checkPQPosition("pq1_5", 1900, 2340, 1860, 2180)) return true; - if (vars.checkPQPosition("pq1_6", 2860, 4695, 1780, 2810)) return true; - if (vars.checkPQPosition("pq1_7", 5220, 6515, 2150, 2780)) return true; - if (vars.checkPQPosition("pq1_8", 950, 1380, 1865, 2300)) return true; - if (vars.checkPQPosition("pq1_9", 2020, 2210, 3425, 5125)){ - vars.pq1_end = true; - return true; - } - break; - } - - case "Princess Quest 2": { - if (settings["pq2_start"] && vars.CompletedSplits.Add("pq2_start")){ - print("pq2_start"); - return true; - } - if (vars.checkPQPosition("pq2_1", 2800, 3250, -1040, -735)) return true; - if (vars.checkPQPosition("pq2_2", 4300, 4840, -2800, -2420)) return true; - if (vars.checkPQPosition("pq2_3", 2805, 3155, -1340, -1110)) return true; - if (vars.checkPQPosition("pq2_4", 2415, 3290, -3375, -2745)) return true; - if (vars.checkPQPosition("pq2_5", 2955, 3365, 745, 1125)) return true; - if (vars.checkPQPosition("pq2_6", 1070, 2205, 830, 1470)) return true; - if (vars.checkPQPosition("pq2_7", 5, 1975, -185, 190)) return true; - if (vars.checkPQPosition("pq2_8", 2725, 3340, -315, 320) && vars.pq2_8) return true; - if (vars.checkPQPosition("pq2_9", 3920, 4345, 350, 655)) return true; - if (vars.checkPQPosition("pq2_10",4845, 5045, 725, 925)) return true; - break; - } + if (vars.arcade == "Princess Quest 2"){ + if (settings["pq2_start"] && vars.CompletedSplits.Add("pq2_start")){ + print("pq2_start"); + return true; + } + if (vars.checkPQPosition("pq2_1", 2800, 3250, -1040, -735)) return true; + if (vars.checkPQPosition("pq2_2", 4300, 4840, -2800, -2420)) return true; + if (vars.checkPQPosition("pq2_3", 2805, 3155, -1340, -1110)) return true; + if (vars.checkPQPosition("pq2_4", 2415, 3290, -3375, -2745)) return true; + if (vars.checkPQPosition("pq2_5", 2955, 3365, 745, 1125)) return true; + if (vars.checkPQPosition("pq2_6", 1070, 2205, 830, 1470)) return true; + if (vars.checkPQPosition("pq2_7", 5, 1975, -185, 190)) return true; + if (vars.checkPQPosition("pq2_8", 2725, 3340, -315, 320) && vars.pq2_8) return true; + if (vars.checkPQPosition("pq2_9", 3920, 4345, 350, 655)) return true; + if (vars.checkPQPosition("pq2_10",4845, 5045, 725, 925)) return true; + } - case "Princess Quest 3": { - if (settings["pq3_start"] && vars.CompletedSplits.Add("pq3_start")){ - print("pq3_start"); - return true; - } - if (vars.checkPQPosition("pq3_1", 2195, 2315, -3625, -1965)) return true; - if (vars.checkPQPosition("pq3_2", 1705, 2135, -1340, -895)) return true; - if (vars.checkPQPosition("pq3_3", 2445, 5210, -1360, -990)) return true; - if (vars.checkPQPosition("pq3_4", 4865, 5490, -210, 365)) return true; - if (vars.checkPQPosition("pq3_5", 500, 1325, -400, 1045)) return true; - if (vars.checkPQPosition("pq3_6", 1865, 1980, -1505, -1380)) return true; - if (vars.checkPQPosition("pq3_7", 1940, 2055, -260, 0)) return true; - if (!vars.watchers["pq3Attack"].Old && vars.watchers["pq3Attack"].Current && vars.checkPQPositionNoBool("pq3_endArcade", 1800, 2200, 1635.34f, 1700)) return true; - break; - } - } - break; + if (vars.arcade == "Princess Quest 3"){ + if (settings["pq3_start"] && vars.CompletedSplits.Add("pq3_start")){ + print("pq3_start"); + return true; } + if (vars.checkPQPosition("pq3_1", 2195, 2315, -3625, -1965)) return true; + if (vars.checkPQPosition("pq3_2", 1705, 2135, -1340, -895)) return true; + if (vars.checkPQPosition("pq3_3", 2445, 5210, -1360, -990)) return true; + if (vars.checkPQPosition("pq3_4", 4865, 5490, -210, 365)) return true; + if (vars.checkPQPosition("pq3_5", 500, 1325, -400, 1045)) return true; + if (vars.checkPQPosition("pq3_6", 1865, 1980, -1505, -1380)) return true; + if (vars.checkPQPosition("pq3_7", 1940, 2055, -260, 0)) return true; + if (!vars.watchers["pq3Attack"].Old && vars.watchers["pq3Attack"].Current + && vars.checkPQPositionNoBool("pq3_endArcade", 1800, 2200, 1635.34f, 1700)) return true; } - break; - } #endregion - } + + #endregion + }