From 8a5e5896e52a76c1a4374d0a570a6dd86da9ba2e Mon Sep 17 00:00:00 2001 From: doombubbles Date: Sat, 14 Dec 2024 11:21:03 -0800 Subject: [PATCH] Fix for v46 --- .github/workflows/build.yml | 10 +++++----- LATEST.md | 5 +++-- ModHelperData.cs | 4 ++-- Properties/launchSettings.json | 5 +++-- Settings.cs | 6 ++++++ Unlimited5thTiersMod.cs | 11 ++++++++++- 6 files changed, 29 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 35795c8..40d6d7b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,7 @@ jobs: - name: Download Specific MelonLoader if: env.MELONLOADER_BRANCH != '' - uses: dawidd6/action-download-artifact@v2 + uses: dawidd6/action-download-artifact@v6 with: github_token: ${{ secrets.GITHUB_TOKEN }} workflow: build.yml @@ -76,7 +76,7 @@ jobs: - name: Download Specific Mod Helper - uses: dawidd6/action-download-artifact@v2 + uses: dawidd6/action-download-artifact@v6 if: env.MOD_HELPER_BRANCH != '' with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -97,9 +97,9 @@ jobs: - name: Setup .NET - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v4 with: - dotnet-version: 6.0.x # net6 can still build older as well + dotnet-version: 8.0.x - name: Build @@ -107,7 +107,7 @@ jobs: - name: Upload Mod DLL - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v3 with: name: ${{ env.PROJECT_NAME }}.dll path: ${{ env.BLOONSTD6 }}/Mods/${{ env.PROJECT_NAME }}.dll diff --git a/LATEST.md b/LATEST.md index a5da41e..575c107 100644 --- a/LATEST.md +++ b/LATEST.md @@ -1,2 +1,3 @@ -- Recompiled for BTD6 v39 -- Unlimited 5th Tiers no longer bypasses challenge rule restrictions \ No newline at end of file +- Fixed for BTD6 v46 +- Multiple XXXL Traps can now function properly at the same time +- Added a toggleable setting for allowing non max sacrificed VTSGs to be created \ No newline at end of file diff --git a/ModHelperData.cs b/ModHelperData.cs index a1f42cf..2987537 100644 --- a/ModHelperData.cs +++ b/ModHelperData.cs @@ -2,8 +2,8 @@ public static class ModHelperData { - public const string WorksOnVersion = "39.2"; - public const string Version = "1.1.5"; + public const string WorksOnVersion = "46.2"; + public const string Version = "1.1.6"; public const string Name = "Unlimited 5th Tiers +"; public const string Description = diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json index 7d5bb85..25cc67b 100644 --- a/Properties/launchSettings.json +++ b/Properties/launchSettings.json @@ -3,13 +3,14 @@ "BloonsTD6": { "commandName": "Executable", "executablePath": "$(BloonsTD6)/BloonsTD6.exe", - "workingDirectory": "$(BloonsTD6)" + "workingDirectory": "$(BloonsTD6)", + "commandLineArgs": "moddingDev" }, "BloonsTD6 (ML Debug)": { "commandName": "Executable", "executablePath": "$(BloonsTD6)/BloonsTD6.exe", "workingDirectory": "$(BloonsTD6)", - "commandLineArgs": "--melonloader.debug" + "commandLineArgs": "moddingDev --melonloader.debug" } } } \ No newline at end of file diff --git a/Settings.cs b/Settings.cs index 1cbbed9..46f94cf 100644 --- a/Settings.cs +++ b/Settings.cs @@ -23,4 +23,10 @@ public class Settings : ModSettings displayName = "Allow Unlimited VTSGs", icon = VanillaSprites.SuperMonkey555 }; + + public static readonly ModSettingBool AllowNonMaxedVTSGs = new(true) + { + displayName = "Allow Non Maxed VTSGs", + icon = VanillaSprites.SuperMonkey555 + }; } \ No newline at end of file diff --git a/Unlimited5thTiersMod.cs b/Unlimited5thTiersMod.cs index a273cf2..f62fd67 100644 --- a/Unlimited5thTiersMod.cs +++ b/Unlimited5thTiersMod.cs @@ -5,6 +5,7 @@ using Il2CppAssets.Scripts.Models; using Il2CppAssets.Scripts.Models.Towers; using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Models.Towers.Weapons.Behaviors; using Il2CppAssets.Scripts.Models.TowerSets; using Il2CppAssets.Scripts.Simulation.Input; using Il2CppAssets.Scripts.Simulation.Towers; @@ -12,6 +13,7 @@ using Il2CppSystem.Collections.Generic; using MelonLoader; using Unlimited5thTiers; + [assembly: MelonInfo(typeof(Unlimited5thTiersMod), ModHelperData.Name, ModHelperData.Version, ModHelperData.RepoOwner)] [assembly: MelonGame("Ninja Kiwi", "BloonsTD6")] @@ -31,6 +33,11 @@ public override void OnNewGameModel(GameModel gameModel) monkeyTempleModel.towerGroupCount = 4; } } + + foreach (var towerModel in gameModel.towers.Where(model => model.tier >= 5)) + { + towerModel.GetDescendants().ForEach(model => model.globalForPlayer = false); + } } /// @@ -66,7 +73,9 @@ public class MonkeyTemple_StartSacrifice [HarmonyPostfix] public static void Postfix(MonkeyTemple __instance) { - if (__instance.monkeyTempleModel.checkForThereCanOnlyBeOne && !__instance.checkTCBOO) + if (Settings.AllowNonMaxedVTSGs && + __instance.monkeyTempleModel.checkForThereCanOnlyBeOne && + !__instance.checkTCBOO) { __instance.checkTCBOO = true; }