From 5a62e1ed830707bd3c0d9b746d4b63f5b453967e Mon Sep 17 00:00:00 2001 From: Extremelyd1 <10898310+Extremelyd1@users.noreply.github.com> Date: Fri, 26 Jul 2024 19:22:54 +0200 Subject: [PATCH] Sync Waterways entrance and quake floors --- HKMP/Game/Client/Save/SaveChanges.cs | 108 ++++++++++++++++------ HKMP/Resource/save-data.json | 132 ++++++++++++++++++--------- 2 files changed, 169 insertions(+), 71 deletions(-) diff --git a/HKMP/Game/Client/Save/SaveChanges.cs b/HKMP/Game/Client/Save/SaveChanges.cs index 1f20963..6832423 100644 --- a/HKMP/Game/Client/Save/SaveChanges.cs +++ b/HKMP/Game/Client/Save/SaveChanges.cs @@ -111,7 +111,14 @@ public void ApplyPlayerDataSaveChange(string name) { name == "openedHiddenStation" && currentScene == "Abyss_22" ) { var go = GameObject.Find("Station Bell"); + if (go == null) { + return; + } + var fsm = go.LocateMyFSM("Stag Bell"); + if (fsm == null) { + return; + } fsm.SetState("Box Disappear Anim"); return; @@ -123,7 +130,14 @@ public void ApplyPlayerDataSaveChange(string name) { name == "tollBenchQueensGardens" && currentScene == "Fungus3_50" ) { var go = GameObject.Find("Toll Machine Bench"); + if (go == null) { + return; + } + var fsm = go.LocateMyFSM("Toll Machine Bench"); + if (fsm == null) { + return; + } fsm.SetState("Box Down"); return; @@ -136,6 +150,10 @@ public void ApplyPlayerDataSaveChange(string name) { } var fsm = go.LocateMyFSM("FSM"); + if (fsm == null) { + return; + } + fsm.SetState("Destroy"); return; } @@ -147,6 +165,10 @@ public void ApplyPlayerDataSaveChange(string name) { } var fsm = go.LocateMyFSM("Gate Control"); + if (fsm == null) { + return; + } + fsm.SetState("Destroy"); return; } @@ -158,12 +180,16 @@ public void ApplyPlayerDataSaveChange(string name) { } else if (currentScene == "Fungus2_20") { go = GameObject.Find("Breakable Wall Waterways"); } - + if (go == null) { return; } var fsm = go.LocateMyFSM("breakable_wall_v2"); + if (fsm == null) { + return; + } + fsm.SetState("Pause Frame"); return; } @@ -175,6 +201,10 @@ public void ApplyPlayerDataSaveChange(string name) { } var fsm = go.LocateMyFSM("FSM"); + if (fsm == null) { + return; + } + fsm.SetState("Destroy"); return; } @@ -186,13 +216,43 @@ public void ApplyPlayerDataSaveChange(string name) { } var fsm = go.LocateMyFSM("FSM"); + if (fsm == null) { + return; + } + fsm.SetState("Destroy"); + return; } if (name == "openedCityGate" && currentScene == "Fungus2_21") { var go = GameObject.Find("City Gate Control"); + if (go == null) { + return; + } + + var fsm = go.LocateMyFSM("Conversation Control"); + if (fsm == null) { + return; + } + + fsm.SetState("Activate"); + return; + } + + if (name == "openedWaterwaysManhole" && currentScene == "Ruins1_05b") { + var go = GameObject.Find("Waterways Machine"); + if (go == null) { + return; + } + var fsm = go.LocateMyFSM("Conversation Control"); + if (fsm == null) { + return; + } + fsm.RemoveFirstAction("Activate"); + fsm.RemoveFirstAction("Activate"); + fsm.SetState("Activate"); } } @@ -234,39 +294,33 @@ public void ApplyPersistentValueSaveChange(PersistentItemData itemData) { return; } - if (itemData.Id.StartsWith("Collapser Small") && ( - itemData.SceneName == "Crossroads_21" && currentScene == "Crossroads_21" || - itemData.SceneName == "Crossroads_36" && currentScene == "Crossroads_36" || - itemData.SceneName == "Fungus1_24" && currentScene == "Fungus1_24" || - itemData.SceneName == "Fungus2_23" && currentScene == "Fungus2_23" || - itemData.SceneName == "Fungus3_28" && currentScene == "Fungus3_28" || - itemData.SceneName == "Fungus2_25" && currentScene == "Fungus2_25" || - itemData.SceneName == "Mines_06" && currentScene == "Mines_06" || - itemData.SceneName == "Deepnest_02" && currentScene == "Deepnest_02" || - itemData.SceneName == "Deepnest_03" && currentScene == "Deepnest_03" || - itemData.SceneName == "Deepnest_14" && currentScene == "Deepnest_14" || - itemData.SceneName == "Deepnest_16" && currentScene == "Deepnest_16" || - itemData.SceneName == "Deepnest_30" && currentScene == "Deepnest_30" || - itemData.SceneName == "Deepnest_33" && currentScene == "Deepnest_33" || - itemData.SceneName == "Deepnest_38" && currentScene == "Deepnest_38" || - itemData.SceneName == "Deepnest_39" && currentScene == "Deepnest_39" || - itemData.SceneName == "Deepnest_41" && currentScene == "Deepnest_41" || - itemData.SceneName == "Deepnest_45_v02" && currentScene == "Deepnest_45_v02" || - itemData.SceneName == "RestingGrounds_10" && currentScene == "RestingGrounds_10" || - itemData.SceneName == "Deepnest_Spider_Town" && currentScene == "Deepnest_Spider_Town" || - itemData.SceneName == "Waterways_09" && currentScene == "Waterways_09" || - itemData.SceneName == "Waterways_14" && currentScene == "Waterways_14" || - itemData.SceneName == "GG_Pipeway" && currentScene == "GG_Pipeway" || - itemData.SceneName == "White_Palace_02" && currentScene == "White_Palace_02" || - itemData.SceneName == "White_Palace_17" && currentScene == "White_Palace_17" - )) { + if (itemData.Id.StartsWith("Collapser Small") && itemData.SceneName == currentScene) { var go = GameObject.Find(itemData.Id); if (go == null) { return; } var fsm = go.LocateMyFSM("collapse small"); + if (fsm == null) { + return; + } + fsm.SetState("Split"); + return; + } + + if (itemData.Id.StartsWith("Quake Floor") && itemData.SceneName == currentScene) { + var go = GameObject.Find(itemData.Id); + if (go == null) { + return; + } + + var fsm = go.LocateMyFSM("quake_floor"); + if (fsm == null) { + return; + } + + fsm.SetState("Audio"); } } } diff --git a/HKMP/Resource/save-data.json b/HKMP/Resource/save-data.json index 67d16d3..9079fb9 100644 --- a/HKMP/Resource/save-data.json +++ b/HKMP/Resource/save-data.json @@ -4993,7 +4993,8 @@ }, "openedWaterwaysManhole": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true }, "waterwaysAcidDrained": { "Sync": true, @@ -9906,7 +9907,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -11471,7 +11473,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -11511,7 +11514,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -11541,7 +11545,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -11682,7 +11687,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -11702,7 +11708,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -11712,7 +11719,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -11732,7 +11740,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -11752,7 +11761,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -11772,7 +11782,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -11812,7 +11823,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -12318,7 +12330,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -12852,7 +12865,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -13336,7 +13350,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -13346,7 +13361,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -13466,7 +13482,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -13486,7 +13503,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -13566,7 +13584,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -15020,7 +15039,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -15220,7 +15240,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -18388,7 +18409,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -20942,7 +20964,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -20982,7 +21005,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -21002,7 +21026,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -21184,7 +21209,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -21194,7 +21220,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -23891,7 +23918,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -27398,7 +27426,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -27632,7 +27661,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -27722,7 +27752,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -28207,7 +28238,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -28740,7 +28772,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -28750,7 +28783,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -28760,7 +28794,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -28780,7 +28815,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -28790,7 +28826,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -28800,7 +28837,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -28810,7 +28848,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -28820,7 +28859,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -28830,7 +28870,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -28840,7 +28881,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -28850,7 +28892,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, { @@ -29471,7 +29514,8 @@ }, "Value": { "Sync": true, - "SyncType": "Server" + "SyncType": "Server", + "IgnoreSceneHost": true } }, {