Skip to content

Commit

Permalink
Fix for v46
Browse files Browse the repository at this point in the history
  • Loading branch information
doombubbles committed Dec 14, 2024
1 parent c0a9db2 commit 8a5e589
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 12 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand All @@ -97,17 +97,17 @@ 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
run: dotnet build -c Release -p:BloonsTD6="../${{ env.BLOONSTD6 }}" "${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj"


- 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
Expand Down
5 changes: 3 additions & 2 deletions LATEST.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- Recompiled for BTD6 v39
- Unlimited 5th Tiers no longer bypasses challenge rule restrictions
- 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
4 changes: 2 additions & 2 deletions ModHelperData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
5 changes: 3 additions & 2 deletions Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
6 changes: 6 additions & 0 deletions Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
}
11 changes: 10 additions & 1 deletion Unlimited5thTiersMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
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;
using Il2CppAssets.Scripts.Simulation.Towers.Behaviors;
using Il2CppSystem.Collections.Generic;
using MelonLoader;
using Unlimited5thTiers;

[assembly: MelonInfo(typeof(Unlimited5thTiersMod), ModHelperData.Name, ModHelperData.Version, ModHelperData.RepoOwner)]
[assembly: MelonGame("Ninja Kiwi", "BloonsTD6")]

Expand All @@ -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<LimitProjectileModel>().ForEach(model => model.globalForPlayer = false);
}
}

/// <summary>
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 8a5e589

Please sign in to comment.