From 2133e53725b5d6ff9f7fd7d7522779cf843e830c Mon Sep 17 00:00:00 2001 From: Tenebrosful Date: Sun, 1 Dec 2024 16:21:56 +0100 Subject: [PATCH 1/3] Split splits into different dictionnary --- Deltarune.asl | 180 ++++++++++++++++++++++++++------------------------ 1 file changed, 92 insertions(+), 88 deletions(-) diff --git a/Deltarune.asl b/Deltarune.asl index 935ad29..3c944de 100644 --- a/Deltarune.asl +++ b/Deltarune.asl @@ -21,7 +21,7 @@ state("DELTARUNE", "Demo v1.08/v1.09") double chapter : 0x6FCF38, 0x30, 0x24D8, 0x0; // global.chapter double fight : 0x6FCF38, 0x30, 0x4F8, 0x0; // global.fighting - double doorCloseCon : 0x6EF220, 0x84, 0x24, 0x10, 0x18, 0x0; + double doorCloseCon : 0x6EF220, 0x84, 0x24, 0x10, 0x18, 0x0; double namerEvent : 0x6EF220, 0xD4, 0x5C, 0x20, 0x24, 0x10, 0x9C, 0x0; // DEVICE_NAMER.EVENT double loadedDiskGreyBG : 0x6EF220, 0x84, 0x24, 0x10, 0x3D8, 0x0; // obj_shop_ch2_spamton.greybgtimer double snowgrave : 0x6EF220, 0xF4, 0x27C, 0x6C, 0x5C, 0x20, 0x144, 0x24, 0x10, 0xC0, 0x0; // obj_spell_snowgrave.timer @@ -113,9 +113,10 @@ startup vars.resetSplits = (Action)(() => { - foreach(string split in vars.splits.Keys) - vars.splits[split][0] = false; - + foreach (int chapter in vars.splits.Keys) + foreach(string split in vars.splits[chapter].Keys) + vars.splits[chapter][split][0] = false; + print("[DELTARUNE] All splits have been reset to initial state"); }); @@ -128,7 +129,7 @@ startup "This setting pauses the timer when you end a chapter and resumes it when you continue from a previous save in the next chapter.\n\n" + "NOTE: For this to work, Game Time must be enabled\n" + "(you will be asked if you want to enable it by turning on this setting and opening the game if the timer isn't already running, or you can do it yourself)."); - + settings.Add("AC_PauseTimerOST", false, "(OST%) Pause timer between chapters"); settings.SetToolTip("AC_PauseTimerOST", "This setting is the same as the above one, however it pauses the timer when the credits music starts playing instead.\n" + @@ -246,21 +247,21 @@ init print("[DELTARUNE] Signature found at " + ptr.ToString("X")); return ptr; }; - - IntPtr ptrRoomArray = vars.x64 + + IntPtr ptrRoomArray = vars.x64 ? scan(5, "74 0C 48 8B 05 ?? ?? ?? ?? 48 8B 04 D0") : scan(2, "8B 3D ?? ?? ?? ?? 2B EF"); - - vars.ptrRoomID = vars.x64 + + vars.ptrRoomID = vars.x64 ? scan(6, "48 ?? ?? ?? 3B 35 ?? ?? ?? ?? 41 ?? ?? ?? 49 ?? ?? E8 ?? ?? ?? ?? FF") : scan(2, "FF 35 ?? ?? ?? ?? E8 ?? ?? ?? ?? 83 C4 04 50 68"); - + vars.getRoomName = (Func)(() => { IntPtr arrayMain = game.ReadPointer(ptrRoomArray); if(arrayMain == IntPtr.Zero) return string.Empty; - IntPtr arrayItem = vars.x64 + IntPtr arrayItem = vars.x64 ? game.ReadPointer(arrayMain + game.ReadValue((IntPtr)vars.ptrRoomID) * 8) : game.ReadPointer(arrayMain + game.ReadValue((IntPtr)vars.ptrRoomID) * 4); @@ -277,10 +278,10 @@ init case 7495680: string hash; using(var md5 = System.Security.Cryptography.MD5.Create()) - using(var fs = File.OpenRead(modules.First().FileName)) + using(var fs = File.OpenRead(modules.First().FileName)) hash = string.Concat(md5.ComputeHash(fs).Select(b => b.ToString("X2"))); - if(hash != "DCFB86F7A80D9906BBBAFA1B2C224848") + if(hash != "DCFB86F7A80D9906BBBAFA1B2C224848") version = "Demo v1.08/v1.09"; else version = "Demo v1.10"; @@ -307,69 +308,72 @@ init } print("[DELTARUNE] Detected game version: " + version + " (" + mms + ")"); - vars.splits = new Dictionary() + // Ending splits are handled manually in update{} + // Object variables in order: done, old room, new room, old fight, new fight, special condition + vars.splits = new Dictionary>() { - // Ending splits are handled manually in update{} - // Object variables in order: done, old room, new room, old fight, new fight, special condition - {"Ch1_School", new object[] {false, "room_insidecloset_ch1", "room_dark1_ch1", -1, -1, 0}}, - {"Ch1_CastleTown_DoorClose", new object[] {false, null, "room_castle_darkdoor_ch1", -1, -1, 1}}, - {"Ch1_CastleTown_RoomChange", new object[] {false, "room_castle_darkdoor_ch1", "room_field_start_ch1", -1, -1, 0}}, - {"Ch1_Fields_Exit", new object[] {false, "room_field4_ch1", "room_field_checkers4_ch1", -1, -1, 0}}, - {"Ch1_Checkerboard_Exit", new object[] {false, "room_field_checkersboss_ch1", "room_forest_savepoint1_ch1", -1, -1, 0}}, - {"Ch1_BakeSale_Enter", new object[] {false, "room_forest_area3_ch1", "room_forest_savepoint2_ch1", -1, -1, 0}}, - {"Ch1_Egg", new object[] {false, null, "room_man_ch1", -1, -1, 2}}, - {"Ch1_SusieLancer_Exit", new object[] {false, "room_forest_fightsusie_ch1", "room_forest_afterthrash2_ch1", -1, -1, 0}}, - {"Ch1_Escape_Cell", new object[] {false, "room_cc_prison_cells_ch1", "room_cc_prisonlancer_ch1", -1, -1, 3}}, - {"Ch1_CFWarp", new object[] {false, "room_forest_fightsusie_ch1", "room_field3_ch1", -1, -1, 0}}, - {"Ch1_FBWarp", new object[] {false, "room_field3_ch1", "room_forest_savepoint2_ch1", -1, -1, 0}}, - {"Ch1_BCWarp", new object[] {false, "room_forest_savepoint2_ch1", "room_forest_fightsusie_ch1", -1, -1, 0}}, - {"Ch1_Jevil_EnterRoom", new object[] {false, "room_cc_prison_prejoker_ch1", "room_cc_joker_ch1", -1, -1, 0}}, - {"Ch1_Jevil_EndBattle", new object[] {false, null, "room_cc_joker_ch1", -1, -1, 4}}, - {"Ch1_Jevil_LeaveRoom", new object[] {false, "room_cc_joker_ch1", "room_cc_prison_prejoker_ch1", -1, -1, 0}}, - {"Ch1_KRound2_Exit", new object[] {false, "room_cc_6f_ch1", "room_cc_throneroom_ch1", -1, -1, 0}}, - {"Ch1_Throne_Exit", new object[] {false, "room_cc_throneroom_ch1", "room_cc_preroof_ch1", -1, -1, 0}}, - {"Ch1_PreKing_Exit", new object[] {false, "room_cc_preroof_ch1", "room_cc_kingbattle_ch1", -1, -1, 0}}, - {"Ch1_King_EndBattle", new object[] {false, null, "room_cc_kingbattle_ch1", -1, -1, 5}}, - {"Ch1_King_Exit", new object[] {false, "room_cc_kingbattle_ch1", "room_cc_prefountain_ch1", -1, -1, 0}}, - {"Ch1_Fountain_Enter", new object[] {false, "room_cc_prefountain_ch1", "room_cc_fountain_ch1", -1, -1, 0}}, - {"Ch1_Fountain_Exit", new object[] {false, "room_cc_fountain_ch1", "room_school_unusedroom_ch1", -1, -1, 0}}, - - {"Ch2_Library", new object[] {false, "room_library_ch2", "room_dw_cyber_intro_1_ch2", -1, -1, 0}}, - {"Ch2_ArcadeGameText", new object[] {false, null, "room_dw_cyber_queen_boxing_ch2", -1, -1, 6}}, - {"Ch2_ArcadeGameLeave", new object[] {false, "room_dw_cyber_queen_boxing_ch2", "room_dw_cyber_musical_door_ch2", -1, -1, 0}}, - {"Ch2_DJFight", new object[] {false, null, "room_dw_cyber_music_final_ch2", 1, 0, 0}}, - {"Ch2_DJShopRoom", new object[] {false, "room_dw_cyber_musical_door_ch2", "room_dw_cyber_musical_shop_ch2", -1, -1, 0}}, - {"Ch2_Ragger2", new object[] {false, "room_dw_cyber_teacup_final_ch2", "room_dw_cyber_rollercoaster_ch2", -1, -1, 0}}, - {"Ch2_CyberFields_Exit", new object[] {false, null, "room_dw_cyber_rollercoaster_ch2", -1, -1, 7}}, - {"Ch2_TrashZoneWarp", new object[] {false, "room_dw_cyber_musical_door_ch2", "room_dw_city_intro_ch2", -1, -1, 0}}, - {"Ch2_MansionWarp", new object[] {false, "room_dw_cyber_musical_door_ch2", "room_dw_mansion_entrance_ch2", -1, -1, 0}}, - {"Ch2_TZCFWarp", new object[] {false, "room_dw_city_intro_ch2", "room_dw_cyber_musical_door_ch2", -1, -1, 0}}, - {"Ch2_TZMWarp", new object[] {false, "room_dw_city_intro_ch2", "room_dw_mansion_entrance_ch2", -1, -1, 0}}, - {"Ch2_MCFWarp", new object[] {false, "room_dw_mansion_entrance_ch2", "room_dw_cyber_musical_door_ch2", -1, -1, 0}}, - {"Ch2_MTZWarp", new object[] {false, "room_dw_mansion_entrance_ch2", "room_dw_city_intro_ch2", -1, -1, 0}}, - {"Ch2_FreezeRing", new object[] {false, null, "room_dw_city_big_2_ch2", -1, -1, 8}}, - {"Ch2_Egg", new object[] {false, null, null, -1, -1, 9}}, - {"Ch2_Mouse2Puzzle", new object[] {false, "room_dw_city_mice2_ch2", "room_dw_city_cheesemaze_ch2", -1, -1, 0}}, - {"Ch2_SGBerdly", new object[] {false, null, "room_dw_city_berdly_ch2", -1, -1, 10}}, - {"Ch2_SGBerdly_LeaveRoom", new object[] {false, "room_dw_city_berdly_ch2", "room_dw_city_poppup_ch2", -1, -1, 0}}, - {"Ch2_Berdly_Leave", new object[] {false, "room_dw_city_berdly_ch2", "room_dw_city_traffic_4_ch2", -1, -1, 0}}, - {"Ch2_SpamtonLeave", new object[] {false, "room_dw_city_spamton_alley_ch2", "room_dw_city_traffic_4_ch2", -1, -1, 0}}, - {"Ch2_CyberCity_Exit", new object[] {false, "room_dw_city_mansion_front_ch2", "room_dw_mansion_krisroom_ch2", -1, -1, 0}}, - {"Ch2_Mansion_Entrance", new object[] {false, "room_dw_mansion_dining_a_ch2", "room_dw_mansion_entrance_ch2", -1, -1, 0}}, - {"Ch2_Mansion_Exit", new object[] {false, "room_dw_mansion_entrance_ch2", "room_dw_mansion_fire_paintings_ch2", -1, -1, 0}}, - {"Ch2_TasqueManager", new object[] {false, "room_dw_mansion_tasquePaintings_ch2", "room_dw_mansion_traffic_ch2", -1, -1, 0}}, - {"Ch2_Mauswheel", new object[] {false, "room_dw_mansion_kitchen_ch2", "room_dw_mansion_east_2f_transformed_new_ch2", -1, -1, 0}}, - {"Ch2_Disk_Loaded", new object[] {false, null, "room_shop_ch2_spamton_ch2", -1, -1, 11}}, - {"Ch2_Disk_Inserted", new object[] {false, null, "room_dw_mansion_b_east_b_ch2", -1, -1, 12}}, - {"Ch2_SpamtonNEO_End", new object[] {false, null, "room_dw_mansion_b_east_ch2", -1, -1, 13}}, - {"Ch2_SpamtonNEO_Leave", new object[] {false, "room_dw_mansion_b_east_ch2", "room_dw_mansion_b_east_a_ch2", -1, -1, 0}}, - {"Ch2_AcidLake_Enter", new object[] {false, "room_dw_mansion_east_3f_ch2", "room_dw_mansion_acid_tunnel_ch2", -1, -1, 0}}, - {"Ch2_AcidLake_Exit", new object[] {false, "room_dw_mansion_acid_tunnel_loop_rouxls_ch2", "room_dw_mansion_acid_tunnel_exit_ch2", -1, -1, 0}}, - {"Ch2_Queen", new object[] {false, "room_dw_mansion_east_4f_d_ch2", "room_dw_mansion_top_ch2", -1, -1, 0}}, - {"Ch2_GigaQueen", new object[] {false, "room_dw_mansion_top_ch2", "room_dw_mansion_top_post_ch2", -1, -1, 0}}, - {"Ch2_Fountain_Enter", new object[] {false, null, null, -1, -1, 14}}, - {"Ch2_SGSpamtonNEO_End", new object[] {false, null, "room_dw_mansion_fountain_ch2", 1, 0, 0}}, - {"Ch2_Fountain_Exit", new object[] {false, null, "room_lw_computer_lab_ch2", -1, -1, 15}} + {1, new Dictionary { + {"Ch1_School", new object[] {false, "room_insidecloset_ch1", "room_dark1_ch1", -1, -1, 0}}, + {"Ch1_CastleTown_DoorClose", new object[] {false, null, "room_castle_darkdoor_ch1", -1, -1, 1}}, + {"Ch1_CastleTown_RoomChange", new object[] {false, "room_castle_darkdoor_ch1", "room_field_start_ch1", -1, -1, 0}}, + {"Ch1_Fields_Exit", new object[] {false, "room_field4_ch1", "room_field_checkers4_ch1", -1, -1, 0}}, + {"Ch1_Checkerboard_Exit", new object[] {false, "room_field_checkersboss_ch1", "room_forest_savepoint1_ch1", -1, -1, 0}}, + {"Ch1_BakeSale_Enter", new object[] {false, "room_forest_area3_ch1", "room_forest_savepoint2_ch1", -1, -1, 0}}, + {"Ch1_Egg", new object[] {false, null, "room_man_ch1", -1, -1, 2}}, + {"Ch1_SusieLancer_Exit", new object[] {false, "room_forest_fightsusie_ch1", "room_forest_afterthrash2_ch1", -1, -1, 0}}, + {"Ch1_Escape_Cell", new object[] {false, "room_cc_prison_cells_ch1", "room_cc_prisonlancer_ch1", -1, -1, 3}}, + {"Ch1_CFWarp", new object[] {false, "room_forest_fightsusie_ch1", "room_field3_ch1", -1, -1, 0}}, + {"Ch1_FBWarp", new object[] {false, "room_field3_ch1", "room_forest_savepoint2_ch1", -1, -1, 0}}, + {"Ch1_BCWarp", new object[] {false, "room_forest_savepoint2_ch1", "room_forest_fightsusie_ch1", -1, -1, 0}}, + {"Ch1_Jevil_EnterRoom", new object[] {false, "room_cc_prison_prejoker_ch1", "room_cc_joker_ch1", -1, -1, 0}}, + {"Ch1_Jevil_EndBattle", new object[] {false, null, "room_cc_joker_ch1", -1, -1, 4}}, + {"Ch1_Jevil_LeaveRoom", new object[] {false, "room_cc_joker_ch1", "room_cc_prison_prejoker_ch1", -1, -1, 0}}, + {"Ch1_KRound2_Exit", new object[] {false, "room_cc_6f_ch1", "room_cc_throneroom_ch1", -1, -1, 0}}, + {"Ch1_Throne_Exit", new object[] {false, "room_cc_throneroom_ch1", "room_cc_preroof_ch1", -1, -1, 0}}, + {"Ch1_PreKing_Exit", new object[] {false, "room_cc_preroof_ch1", "room_cc_kingbattle_ch1", -1, -1, 0}}, + {"Ch1_King_EndBattle", new object[] {false, null, "room_cc_kingbattle_ch1", -1, -1, 5}}, + {"Ch1_King_Exit", new object[] {false, "room_cc_kingbattle_ch1", "room_cc_prefountain_ch1", -1, -1, 0}}, + {"Ch1_Fountain_Enter", new object[] {false, "room_cc_prefountain_ch1", "room_cc_fountain_ch1", -1, -1, 0}}, + {"Ch1_Fountain_Exit", new object[] {false, "room_cc_fountain_ch1", "room_school_unusedroom_ch1", -1, -1, 0}} + }}, + {2, new Dictionary { + {"Ch2_Library", new object[] {false, "room_library_ch2", "room_dw_cyber_intro_1_ch2", -1, -1, 0}}, + {"Ch2_ArcadeGameText", new object[] {false, null, "room_dw_cyber_queen_boxing_ch2", -1, -1, 6}}, + {"Ch2_ArcadeGameLeave", new object[] {false, "room_dw_cyber_queen_boxing_ch2", "room_dw_cyber_musical_door_ch2", -1, -1, 0}}, + {"Ch2_DJFight", new object[] {false, null, "room_dw_cyber_music_final_ch2", 1, 0, 0}}, + {"Ch2_DJShopRoom", new object[] {false, "room_dw_cyber_musical_door_ch2", "room_dw_cyber_musical_shop_ch2", -1, -1, 0}}, + {"Ch2_Ragger2", new object[] {false, "room_dw_cyber_teacup_final_ch2", "room_dw_cyber_rollercoaster_ch2", -1, -1, 0}}, + {"Ch2_CyberFields_Exit", new object[] {false, null, "room_dw_cyber_rollercoaster_ch2", -1, -1, 7}}, + {"Ch2_TrashZoneWarp", new object[] {false, "room_dw_cyber_musical_door_ch2", "room_dw_city_intro_ch2", -1, -1, 0}}, + {"Ch2_MansionWarp", new object[] {false, "room_dw_cyber_musical_door_ch2", "room_dw_mansion_entrance_ch2", -1, -1, 0}}, + {"Ch2_TZCFWarp", new object[] {false, "room_dw_city_intro_ch2", "room_dw_cyber_musical_door_ch2", -1, -1, 0}}, + {"Ch2_TZMWarp", new object[] {false, "room_dw_city_intro_ch2", "room_dw_mansion_entrance_ch2", -1, -1, 0}}, + {"Ch2_MCFWarp", new object[] {false, "room_dw_mansion_entrance_ch2", "room_dw_cyber_musical_door_ch2", -1, -1, 0}}, + {"Ch2_MTZWarp", new object[] {false, "room_dw_mansion_entrance_ch2", "room_dw_city_intro_ch2", -1, -1, 0}}, + {"Ch2_FreezeRing", new object[] {false, null, "room_dw_city_big_2_ch2", -1, -1, 8}}, + {"Ch2_Egg", new object[] {false, null, null, -1, -1, 9}}, + {"Ch2_Mouse2Puzzle", new object[] {false, "room_dw_city_mice2_ch2", "room_dw_city_cheesemaze_ch2", -1, -1, 0}}, + {"Ch2_SGBerdly", new object[] {false, null, "room_dw_city_berdly_ch2", -1, -1, 10}}, + {"Ch2_SGBerdly_LeaveRoom", new object[] {false, "room_dw_city_berdly_ch2", "room_dw_city_poppup_ch2", -1, -1, 0}}, + {"Ch2_Berdly_Leave", new object[] {false, "room_dw_city_berdly_ch2", "room_dw_city_traffic_4_ch2", -1, -1, 0}}, + {"Ch2_SpamtonLeave", new object[] {false, "room_dw_city_spamton_alley_ch2", "room_dw_city_traffic_4_ch2", -1, -1, 0}}, + {"Ch2_CyberCity_Exit", new object[] {false, "room_dw_city_mansion_front_ch2", "room_dw_mansion_krisroom_ch2", -1, -1, 0}}, + {"Ch2_Mansion_Entrance", new object[] {false, "room_dw_mansion_dining_a_ch2", "room_dw_mansion_entrance_ch2", -1, -1, 0}}, + {"Ch2_Mansion_Exit", new object[] {false, "room_dw_mansion_entrance_ch2", "room_dw_mansion_fire_paintings_ch2", -1, -1, 0}}, + {"Ch2_TasqueManager", new object[] {false, "room_dw_mansion_tasquePaintings_ch2", "room_dw_mansion_traffic_ch2", -1, -1, 0}}, + {"Ch2_Mauswheel", new object[] {false, "room_dw_mansion_kitchen_ch2", "room_dw_mansion_east_2f_transformed_new_ch2", -1, -1, 0}}, + {"Ch2_Disk_Loaded", new object[] {false, null, "room_shop_ch2_spamton_ch2", -1, -1, 11}}, + {"Ch2_Disk_Inserted", new object[] {false, null, "room_dw_mansion_b_east_b_ch2", -1, -1, 12}}, + {"Ch2_SpamtonNEO_End", new object[] {false, null, "room_dw_mansion_b_east_ch2", -1, -1, 13}}, + {"Ch2_SpamtonNEO_Leave", new object[] {false, "room_dw_mansion_b_east_ch2", "room_dw_mansion_b_east_a_ch2", -1, -1, 0}}, + {"Ch2_AcidLake_Enter", new object[] {false, "room_dw_mansion_east_3f_ch2", "room_dw_mansion_acid_tunnel_ch2", -1, -1, 0}}, + {"Ch2_AcidLake_Exit", new object[] {false, "room_dw_mansion_acid_tunnel_loop_rouxls_ch2", "room_dw_mansion_acid_tunnel_exit_ch2", -1, -1, 0}}, + {"Ch2_Queen", new object[] {false, "room_dw_mansion_east_4f_d_ch2", "room_dw_mansion_top_ch2", -1, -1, 0}}, + {"Ch2_GigaQueen", new object[] {false, "room_dw_mansion_top_ch2", "room_dw_mansion_top_post_ch2", -1, -1, 0}}, + {"Ch2_Fountain_Enter", new object[] {false, null, null, -1, -1, 14}}, + {"Ch2_SGSpamtonNEO_End", new object[] {false, null, "room_dw_mansion_fountain_ch2", 1, 0, 0}}, + {"Ch2_Fountain_Exit", new object[] {false, null, "room_lw_computer_lab_ch2", -1, -1, 15}} + }} }; if(version != "SURVEY_PROGRAM" && timer.CurrentPhase == TimerPhase.NotRunning && timer.CurrentTimingMethod == TimingMethod.RealTime && (settings["AC_PauseTimer"] || settings["AC_PauseTimerOST"])) @@ -422,7 +426,7 @@ update { int ch = (int)current.chapter; string chapterStr = ("_ch" + ch); - if(!current.roomName.EndsWith(chapterStr)) + if(!current.roomName.EndsWith(chapterStr)) current.roomName += chapterStr; bool endCondition = false; @@ -434,7 +438,7 @@ update else endCondition = ((old.text == @"* (ねむることにした)/%" || old.text == @"* (You decided to go to bed.)/%") && current.text == null); break; - + case 2: endCondition = ((old.text == @"\E1* …ふたりとも もう&  ねむってしまったのね。/%" || old.text == @"\E1* ... they're already&||asleep.../%") && current.text == null); break; @@ -474,7 +478,7 @@ update if(old.room != current.room) { print("[DELTARUNE] Room: " + old.room + " (" + old.roomName + ")" + " -> " + current.room + " (" + current.roomName + ")"); - if(old.roomName == "room_cc_prison_cells_ch1" && current.roomName == "room_cc_prisonlancer_ch1" && settings["Ch1_Escape_Cell"]) + if(old.roomName == "room_cc_prison_cells_ch1" && current.roomName == "room_cc_prisonlancer_ch1" && settings["Ch1_Escape_Cell"]) vars.tempVar ++; } } @@ -543,16 +547,16 @@ split newFight = 4, condition = 5; - foreach(string splitKey in vars.splits.Keys) + foreach(string splitKey in vars.splits[current.chapter].Keys) { - if((!settings[splitKey] || vars.splits[splitKey][done]) || - (vars.splits[splitKey][oldRoom] != null && old.roomName != vars.splits[splitKey][oldRoom]) || - (vars.splits[splitKey][newRoom] != null && current.roomName != vars.splits[splitKey][newRoom]) || - (vars.splits[splitKey][oldFight] != -1 && old.fight != vars.splits[splitKey][oldFight]) || - (vars.splits[splitKey][newFight] != -1 && current.fight != vars.splits[splitKey][newFight])) continue; + if((!settings[splitKey] || vars.splits[current.chapter][splitKey][done]) || + (vars.splits[current.chapter][splitKey][oldRoom] != null && old.roomName != vars.splits[current.chapter][splitKey][oldRoom]) || + (vars.splits[current.chapter][splitKey][newRoom] != null && current.roomName != vars.splits[current.chapter][splitKey][newRoom]) || + (vars.splits[current.chapter][splitKey][oldFight] != -1 && old.fight != vars.splits[current.chapter][splitKey][oldFight]) || + (vars.splits[current.chapter][splitKey][newFight] != -1 && current.fight != vars.splits[current.chapter][splitKey][newFight])) continue; bool pass = false; - switch((int)vars.splits[splitKey][condition]) + switch((int)vars.splits[current.chapter][splitKey][condition]) { case 0: pass = true; @@ -564,7 +568,7 @@ split case 2: // Ch1_Egg pass = ((old.text == @"* (タマゴを 手に入れた)/%" || old.text == @"* (You received an Egg.)/%") && current.text == null); - break; + break; case 3: // Ch1_Escape_Cell if(vars.tempVar == 2) @@ -599,7 +603,7 @@ split case 9: // Ch2_Egg pass = ((current.roomName == "room_dw_cyber_musical_door_ch2" || current.roomName == "room_dw_city_man_ch2") && old.sound != "snd_egg" && current.sound == "snd_egg"); - break; + break; case 10: // Ch2_SGBerdly pass = (old.snowgrave <= 125 && current.snowgrave >= 125); @@ -628,7 +632,7 @@ split if(pass) { - vars.splits[splitKey][done] = true; + vars.splits[current.chapter][splitKey][done] = true; print("[DELTARUNE] Split triggered (" + splitKey + ")"); return true; } From 31c76bec4a1b8eff27cc2fa1bbfb0adba4bd57af Mon Sep 17 00:00:00 2001 From: Tenebrosful Date: Sun, 1 Dec 2024 17:13:43 +0100 Subject: [PATCH 2/3] use double instead to match chapter --- Deltarune.asl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deltarune.asl b/Deltarune.asl index 3c944de..eec0ed9 100644 --- a/Deltarune.asl +++ b/Deltarune.asl @@ -310,7 +310,7 @@ init // Ending splits are handled manually in update{} // Object variables in order: done, old room, new room, old fight, new fight, special condition - vars.splits = new Dictionary>() + vars.splits = new Dictionary>() { {1, new Dictionary { {"Ch1_School", new object[] {false, "room_insidecloset_ch1", "room_dark1_ch1", -1, -1, 0}}, From 4152f52ac6c377c2c4292c51a6c1dc1557932597 Mon Sep 17 00:00:00 2001 From: Tenebrosful Date: Sun, 1 Dec 2024 17:53:07 +0100 Subject: [PATCH 3/3] Return if chapter select --- Deltarune.asl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Deltarune.asl b/Deltarune.asl index eec0ed9..eb3bc34 100644 --- a/Deltarune.asl +++ b/Deltarune.asl @@ -534,6 +534,8 @@ onReset split { + if(current.chapter == 0) return; + if(vars.forceSplit) { vars.forceSplit = false;