Skip to content

Commit

Permalink
Fix modded heroes level 20
Browse files Browse the repository at this point in the history
  • Loading branch information
doombubbles committed Apr 14, 2024
1 parent 9aac15a commit 73abbd4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions BloonsTD6 Mod Helper/Api/Towers/ModHero.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public abstract class ModHero : ModTower
/// <summary>
/// Putting all the hero level upgrades in the top path
/// </summary>
public sealed override int TopPathUpgrades => base.TopPathUpgrades;
public sealed override int TopPathUpgrades => base.TopPathUpgrades + 1;

/// <summary>
/// No other upgrade paths used
Expand Down Expand Up @@ -105,9 +105,9 @@ public abstract class ModHero : ModTower
public virtual Dictionary<int, SpriteReference> SelectScreenPortraits => new()
{
{1, PortraitReference},
{3, GetPortraitReferenceForTiers(new[] {3, 0, 0})},
{10, GetPortraitReferenceForTiers(new[] {10, 0, 0})},
{20, GetPortraitReferenceForTiers(new[] {20, 0, 0})}
{3, GetPortraitReferenceForTiers(3, 0, 0)},
{10, GetPortraitReferenceForTiers(10, 0, 0)},
{20, GetPortraitReferenceForTiers(20, 0, 0)}
};


Expand Down Expand Up @@ -170,11 +170,11 @@ public override void RegisterText(Il2CppSystem.Collections.Generic.Dictionary<st
/// <returns></returns>
public sealed override IEnumerable<int[]> TowerTiers()
{
yield return new[] {0, 0, 0};
yield return [0, 0, 0];

Check failure on line 173 in BloonsTD6 Mod Helper/Api/Towers/ModHero.cs

View workflow job for this annotation

GitHub Actions / build

Invalid expression term '['

Check failure on line 173 in BloonsTD6 Mod Helper/Api/Towers/ModHero.cs

View workflow job for this annotation

GitHub Actions / build

Invalid expression term '['

for (var i = 2; i <= MaxLevel; i++)
{
yield return new[] {i, 0, 0};
yield return [i, 0, 0];

Check failure on line 177 in BloonsTD6 Mod Helper/Api/Towers/ModHero.cs

View workflow job for this annotation

GitHub Actions / build

Invalid expression term '['

Check failure on line 177 in BloonsTD6 Mod Helper/Api/Towers/ModHero.cs

View workflow job for this annotation

GitHub Actions / build

Invalid expression term '['
}
}

Expand Down
8 changes: 4 additions & 4 deletions BloonsTD6 Mod Helper/Api/Towers/ModTower.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ protected ModTower()

internal readonly SortedDictionary<int, ModUpgrade>[] Upgrades = {new(), new(), new()};
internal IEnumerable<ModUpgrade> AllUpgrades => Upgrades.SelectMany(upgrades => upgrades.Values);
internal int[] TierMaxes => new[] {TopPathUpgrades, MiddlePathUpgrades, BottomPathUpgrades};
internal int[] TierMaxes => [TopPathUpgrades, MiddlePathUpgrades, BottomPathUpgrades];

Check failure on line 185 in BloonsTD6 Mod Helper/Api/Towers/ModTower.cs

View workflow job for this annotation

GitHub Actions / build

Invalid expression term '['

Check failure on line 185 in BloonsTD6 Mod Helper/Api/Towers/ModTower.cs

View workflow job for this annotation

GitHub Actions / build

Invalid expression term '['

/// <summary>
/// Implemented by a ModTower to modify the base tower model before applying any/all ModUpgrades
Expand Down Expand Up @@ -367,7 +367,7 @@ public override void Register()
/// <returns>The 0-0-0 TowerModel for this Tower</returns>
internal virtual TowerModel GetDefaultTowerModel(int[] tiers = null)
{
tiers ??= new[] {0, 0, 0};
tiers ??= [0, 0, 0];

Check failure on line 370 in BloonsTD6 Mod Helper/Api/Towers/ModTower.cs

View workflow job for this annotation

GitHub Actions / build

Invalid expression term '['

Check failure on line 370 in BloonsTD6 Mod Helper/Api/Towers/ModTower.cs

View workflow job for this annotation

GitHub Actions / build

Invalid expression term '['
var towerModel = GetBaseTowerModel(tiers);
towerModel.name = Id;

Expand Down Expand Up @@ -421,10 +421,10 @@ internal virtual TowerModel GetBaseParagonModel()
switch (ParagonMode)
{
case ParagonMode.Base000:
towerModel = ModTowerHelper.CreateTowerModel(this, new[] {0, 0, 0});
towerModel = ModTowerHelper.CreateTowerModel(this, [0, 0, 0]);

Check failure on line 424 in BloonsTD6 Mod Helper/Api/Towers/ModTower.cs

View workflow job for this annotation

GitHub Actions / build

Invalid expression term '['
break;
case ParagonMode.Base555:
towerModel = ModTowerHelper.CreateTowerModel(this, new[] {5, 5, 5});
towerModel = ModTowerHelper.CreateTowerModel(this, [5, 5, 5]);

Check failure on line 427 in BloonsTD6 Mod Helper/Api/Towers/ModTower.cs

View workflow job for this annotation

GitHub Actions / build

Invalid expression term '['
break;
case ParagonMode.None:
default:
Expand Down
2 changes: 1 addition & 1 deletion BloonsTD6 Mod Helper/LATEST.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- Fixed a patch for BTD6 v42.1
- Fixed a bug preventing modded heroes from reaching level 20

0 comments on commit 73abbd4

Please sign in to comment.