From 0aaab9364bff0dce7cc9bdd46a2dae260ba82821 Mon Sep 17 00:00:00 2001 From: mend-dev Date: Thu, 27 Jul 2023 17:00:43 -0500 Subject: [PATCH] Update 1.5: Phayze --- BTD6Rogue.cs | 15 ++++- Bosses/Dreadbloon/DreadRockConfig.cs | 2 +- Bosses/Dreadbloon/DreadbloonConfig.cs | 6 +- Bosses/Lych/LychConfig.cs | 18 +++--- Bosses/Lych/MiniLychConfig.cs | 2 +- Bosses/Phayze/PhayzeConfig.cs | 79 +++++++++++++++++++++++++++ Bosses/Phayze/RoguePhayze.cs | 36 ++++++++++++ Bosses/RogueBoss.cs | 7 +++ Bosses/Vortex/RogueVortex.cs | 1 - Gamemodes/Roguemode.cs | 4 +- LATEST.md | 16 ++---- ModHelperData.cs | 6 +- Panels/DifficultyChoicePanel.cs | 2 +- Panels/GameSettingsPanel.cs | 49 +++++++++++++---- Panels/ParagonChoicePanel.cs | 75 +++++++++++++++++++++++++ Panels/TowerChoicePanel.cs | 39 +++++++++---- Patches/BloonPopPatch.cs | 25 +++++++++ Patches/HeroXpPatch.cs | 2 +- Patches/RoundEndPatch.cs | 28 +++++++++- Patches/RoundStartPatch.cs | 17 ++++++ Rounds/RoundGenerator.cs | 67 +++++++++++++++++------ Util/ParagonUtil.cs | 37 +++++++++++++ 22 files changed, 459 insertions(+), 74 deletions(-) create mode 100644 Bosses/Phayze/PhayzeConfig.cs create mode 100644 Bosses/Phayze/RoguePhayze.cs create mode 100644 Bosses/RogueBoss.cs create mode 100644 Panels/ParagonChoicePanel.cs create mode 100644 Patches/BloonPopPatch.cs create mode 100644 Util/ParagonUtil.cs diff --git a/BTD6Rogue.cs b/BTD6Rogue.cs index 9f68449..8118026 100644 --- a/BTD6Rogue.cs +++ b/BTD6Rogue.cs @@ -9,6 +9,12 @@ using UnityEngine; using Il2CppAssets.Scripts.Models.Towers; using Il2CppAssets.Scripts.Models.TowerSets; +using Il2CppAssets.Scripts.Unity; +using System.Windows.Input; +using System; +using System.Linq; +using BTD_Mod_Helper.Api.Towers; +using Unity.Jobs; [assembly: MelonInfo(typeof(BTD6Rogue.BTD6Rogue), ModHelperData.Name, ModHelperData.Version, ModHelperData.RepoOwner)] [assembly: MelonGame("Ninja Kiwi", "BloonsTD6")] @@ -40,6 +46,9 @@ public class BTD6Rogue : BloonsTD6Mod { public int towerCount = 0; public bool uiOpen = false; public float previousIncrease = 0; + public int rerolls = 0; + + public bool canGainMoney = true; #region Mod Settings public static readonly ModSettingHotkey FasterForwardHotkey = new(KeyCode.F1); // Doesn't Work @@ -74,9 +83,10 @@ public class BTD6Rogue : BloonsTD6Mod { // Banana Farmer // Pontoon // Inflatable Pool - public static readonly ModSettingBool LimitUpgrades = new(true); // Doesn't Work + public static readonly ModSettingCategory ParagonSettings = new("Paragon Settings") { collapsed = true }; + public static readonly ModSettingCategory HeroSettings = new("Hero Settings") { collapsed = true }; public static readonly ModSettingBool MultipleHeroes = new(true) { category = HeroSettings }; // Doesn't Work public static readonly ModSettingBool HeroXpSplit = new(false) { category = HeroSettings }; // Doesn't Work @@ -129,6 +139,9 @@ public override void OnUpdate() { public void StartRogueGame(InGame __instance) { + rerolls = 0; + canGainMoney = true; + // Get rid of all ui panels if they exist DifficultyChoicePanel.uiPanel?.Destroy(); HeroChoicePanel.uiPanel?.Destroy(); diff --git a/Bosses/Dreadbloon/DreadRockConfig.cs b/Bosses/Dreadbloon/DreadRockConfig.cs index 847a7bb..5e64ea2 100644 --- a/Bosses/Dreadbloon/DreadRockConfig.cs +++ b/Bosses/Dreadbloon/DreadRockConfig.cs @@ -6,7 +6,7 @@ namespace BTD6Rogue; public static class DreadRockConfig { // General Stats - public static readonly float baseMaxHealth = 20; + public static readonly float baseMaxHealth = 25; public static readonly float levelMaxHealthMultiplier = 2.5f; public static readonly float baseSpeed = 1f; diff --git a/Bosses/Dreadbloon/DreadbloonConfig.cs b/Bosses/Dreadbloon/DreadbloonConfig.cs index d765eb3..a771c7e 100644 --- a/Bosses/Dreadbloon/DreadbloonConfig.cs +++ b/Bosses/Dreadbloon/DreadbloonConfig.cs @@ -10,11 +10,11 @@ namespace BTD6Rogue; public static class DreadbloonConfig { // General Stats - public static readonly float baseMaxHealth = 1000; + public static readonly float baseMaxHealth = 2000; public static readonly float levelMaxHealthMultiplier = 3; public static readonly float baseSpeed = 1; - public static readonly float levelSpeedAddition = 0.125f; + public static readonly float levelSpeedAddition = 0.25f; // Difficulty Multiplier public static readonly Dictionary difficultyMultipliers = new Dictionary() { @@ -30,7 +30,7 @@ public static class DreadbloonConfig { public static readonly float levelDamageReductionAddition = 0.1f; // - public static readonly float baseArmorAmount = 500; + public static readonly float baseArmorAmount = 100; public static readonly float levelArmorAmountMultiplier = 3; public static readonly float baseSpeedMultiplier = 1f; public static readonly float levelSpeedMultiplierAddition = 0; diff --git a/Bosses/Lych/LychConfig.cs b/Bosses/Lych/LychConfig.cs index db477ee..a8e373d 100644 --- a/Bosses/Lych/LychConfig.cs +++ b/Bosses/Lych/LychConfig.cs @@ -6,19 +6,17 @@ namespace BTD6Rogue; -public static class LychConfig -{ +public static class LychConfig { // General Stats - public static readonly float baseMaxHealth = 6000; + public static readonly float baseMaxHealth = 6500; public static readonly float levelMaxHealthMultiplier = 3; - public static readonly float baseSpeed = 1f; - public static readonly float levelSpeedAddition = 0.1f; + public static readonly float baseSpeed = 1.25f; + public static readonly float levelSpeedAddition = 0.25f; // Difficulty Multiplier - public static readonly Dictionary difficultyMultipliers = new Dictionary() - { + public static readonly Dictionary difficultyMultipliers = new Dictionary() { ["Poppable"] = 0.7f, ["Easy"] = 0.85f, ["Medium"] = 1f, @@ -62,8 +60,7 @@ public static class LychConfig public static readonly float baseSpeedDownPercent = 0.5f; public static readonly float levelSpeedDownPercentAddition = 0; - public static void ApplyLychSettings(BloonModel bloonModel, string difficulty, int level) - { + public static void ApplyLychSettings(BloonModel bloonModel, string difficulty, int level) { float multiplier = difficultyMultipliers[difficulty]; bloonModel.maxHealth = baseMaxHealth * (levelMaxHealthMultiplier * level) * multiplier; @@ -73,8 +70,7 @@ public static void ApplyLychSettings(BloonModel bloonModel, string difficulty, i bloonModel.speed = (baseSpeed + levelSpeedAddition * level) * multiplier; bloonModel.Speed = (baseSpeed + levelSpeedAddition * level) * multiplier; - foreach (TimeTriggerModel model in bloonModel.GetBehaviors()) - { + foreach (TimeTriggerModel model in bloonModel.GetBehaviors()) { model.interval = (baseTimeInterval + levelTimeIntervalAddition * level) * multiplier; } diff --git a/Bosses/Lych/MiniLychConfig.cs b/Bosses/Lych/MiniLychConfig.cs index 286edd4..2972a8e 100644 --- a/Bosses/Lych/MiniLychConfig.cs +++ b/Bosses/Lych/MiniLychConfig.cs @@ -9,7 +9,7 @@ namespace BTD6Rogue; public static class MiniLychConfig { // General Stats - public static readonly float baseMaxHealth = 500; + public static readonly float baseMaxHealth = 1000; public static readonly float levelMaxHealthMultiplier = 2; public static readonly float baseSpeed = 5; diff --git a/Bosses/Phayze/PhayzeConfig.cs b/Bosses/Phayze/PhayzeConfig.cs new file mode 100644 index 0000000..59f5384 --- /dev/null +++ b/Bosses/Phayze/PhayzeConfig.cs @@ -0,0 +1,79 @@ +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.Bloons; +using Il2CppAssets.Scripts.Models.Bloons.Behaviors; +using Il2CppAssets.Scripts.Models.Bloons.Behaviors.Actions; +using System.Collections.Generic; + +namespace BTD6Rogue; + +public static class PhayzeConfig { + + // General Stats + public static readonly float baseMaxHealth = 1000; + public static readonly float levelMaxHealthMultiplier = 3f; + + public static readonly float baseSpeed = 1f; + public static readonly float levelSpeedAddition = 0.1f; + + // Difficulty Multiplier + public static readonly Dictionary difficultyMultipliers = new Dictionary() { + ["Poppable"] = 0.7f, + ["Easy"] = 0.85f, + ["Medium"] = 1f, + ["Hard"] = 1.15f, + ["Impoppable"] = 1.3f + }; + + // + public static readonly float baseDashSpeed = 20f; + public static readonly float levelDashSpeed = 0; + public static readonly float baseDashDistance = 0.04f; + public static readonly float levelDashDistance = 0; + + // + public static readonly float baseShield = 1000; + public static readonly float levelShieldMultiplier = 3f; + + public static void ApplyPhayzeSettings(BloonModel bloonModel, string difficulty, int level) { + float multiplier = difficultyMultipliers[difficulty]; + + bloonModel.maxHealth = baseMaxHealth * (levelMaxHealthMultiplier * level) * multiplier; + if (level == 0) { bloonModel.maxHealth = baseMaxHealth * multiplier; } + + bloonModel.leakDamage = 99999f; + bloonModel.speed = (baseSpeed + levelSpeedAddition * level) * multiplier; + bloonModel.Speed = (baseSpeed + levelSpeedAddition * level) * multiplier; + + foreach (DashForwardsActionModel model in bloonModel.GetBehaviors()) { + model.speedMultiplier = (baseDashSpeed + levelDashSpeed * level) * multiplier; + model.dashDistance = (baseDashDistance + levelDashDistance * level) * multiplier; + } + + foreach (GenerateShieldActionModel model in bloonModel.GetBehaviors()) { + model.amount = baseShield * (levelShieldMultiplier * level) * multiplier; + if (level == 0) { model.amount = baseShield * multiplier; } + } + + foreach (WaitForSecondsActionModel model in bloonModel.GetBehaviors()) { + if (model.actionId == "RestoreTimerEffects") { + model.delayTime = 12f; + } else if (model.actionId == "SkullDelay") { + model.delayTime = 2f; + } + } + + foreach (PhayzeBehaviorModel model in bloonModel.GetBehaviors()) { + //model.powerLevels; + model.shieldSpeedBoost = 1.3f; + } + + foreach (TimeTriggerModel model in bloonModel.GetBehaviors()) { + model.interval = 24f; + } + + foreach (ThrowBloonsActionModel model in bloonModel.GetBehaviors()) { + model.offsetMin = 2.5f; + model.offsetMax = 20f; + } + } +} \ No newline at end of file diff --git a/Bosses/Phayze/RoguePhayze.cs b/Bosses/Phayze/RoguePhayze.cs new file mode 100644 index 0000000..edbed01 --- /dev/null +++ b/Bosses/Phayze/RoguePhayze.cs @@ -0,0 +1,36 @@ +using BTD_Mod_Helper.Api.Bloons; +using BTD6Rogue; +using Il2CppAssets.Scripts.Models.Bloons; + +namespace Phayze; + +public class PoppableRoguePhayze1 : ModBloon { public override string BaseBloon => "Phayze1"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Poppable", 0); } } +public class PoppableRoguePhayze2 : ModBloon { public override string BaseBloon => "Phayze1"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Poppable", 1); } } +public class PoppableRoguePhayze3 : ModBloon { public override string BaseBloon => "Phayze2"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Poppable", 2); } } +public class PoppableRoguePhayze4 : ModBloon { public override string BaseBloon => "Phayze3"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Poppable", 3); } } +public class PoppableRoguePhayze5 : ModBloon { public override string BaseBloon => "Phayze4"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Poppable", 4); } } +public class PoppableRoguePhayze6 : ModBloon { public override string BaseBloon => "Phayze5"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Poppable", 5); } } +public class EasyRoguePhayze1 : ModBloon { public override string BaseBloon => "Phayze1"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Easy", 0); } } +public class EasyRoguePhayze2 : ModBloon { public override string BaseBloon => "Phayze1"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Easy", 1); } } +public class EasyRoguePhayze3 : ModBloon { public override string BaseBloon => "Phayze2"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Easy", 2); } } +public class EasyRoguePhayze4 : ModBloon { public override string BaseBloon => "Phayze3"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Easy", 3); } } +public class EasyRoguePhayze5 : ModBloon { public override string BaseBloon => "Phayze4"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Easy", 4); } } +public class EasyRoguePhayze6 : ModBloon { public override string BaseBloon => "Phayze5"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Easy", 5); } } +public class MediumRoguePhayze1 : ModBloon { public override string BaseBloon => "Phayze1"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Medium", 0); } } +public class MediumRoguePhayze2 : ModBloon { public override string BaseBloon => "Phayze1"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Medium", 1); } } +public class MediumRoguePhayze3 : ModBloon { public override string BaseBloon => "Phayze2"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Medium", 2); } } +public class MediumRoguePhayze4 : ModBloon { public override string BaseBloon => "Phayze3"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Medium", 3); } } +public class MediumRoguePhayze5 : ModBloon { public override string BaseBloon => "Phayze4"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Medium", 4); } } +public class MediumRoguePhayze6 : ModBloon { public override string BaseBloon => "Phayze5"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Medium", 5); } } +public class HardRoguePhayze1 : ModBloon { public override string BaseBloon => "Phayze1"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Hard", 0); } } +public class HardRoguePhayze2 : ModBloon { public override string BaseBloon => "Phayze1"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Hard", 1); } } +public class HardRoguePhayze3 : ModBloon { public override string BaseBloon => "Phayze2"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Hard", 2); } } +public class HardRoguePhayze4 : ModBloon { public override string BaseBloon => "Phayze3"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Hard", 3); } } +public class HardRoguePhayze5 : ModBloon { public override string BaseBloon => "Phayze4"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Hard", 4); } } +public class HardRoguePhayze6 : ModBloon { public override string BaseBloon => "Phayze5"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Hard", 5); } } +public class ImpoppableRoguePhayze1 : ModBloon { public override string BaseBloon => "Phayze1"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Impoppable", 0); } } +public class ImpoppableRoguePhayze2 : ModBloon { public override string BaseBloon => "Phayze1"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Impoppable", 1); } } +public class ImpoppableRoguePhayze3 : ModBloon { public override string BaseBloon => "Phayze2"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Impoppable", 2); } } +public class ImpoppableRoguePhayze4 : ModBloon { public override string BaseBloon => "Phayze3"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Impoppable", 3); } } +public class ImpoppableRoguePhayze5 : ModBloon { public override string BaseBloon => "Phayze4"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Impoppable", 4); } } +public class ImpoppableRoguePhayze6 : ModBloon { public override string BaseBloon => "Phayze5"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { PhayzeConfig.ApplyPhayzeSettings(bloonModel, "Impoppable", 5); } } \ No newline at end of file diff --git a/Bosses/RogueBoss.cs b/Bosses/RogueBoss.cs new file mode 100644 index 0000000..49c32ef --- /dev/null +++ b/Bosses/RogueBoss.cs @@ -0,0 +1,7 @@ +using BTD_Mod_Helper.Api.Bloons; + +namespace BTD6Rogue; + +public abstract class RogueBoss : ModBloon { + +} \ No newline at end of file diff --git a/Bosses/Vortex/RogueVortex.cs b/Bosses/Vortex/RogueVortex.cs index 8d123aa..f10e58f 100644 --- a/Bosses/Vortex/RogueVortex.cs +++ b/Bosses/Vortex/RogueVortex.cs @@ -3,7 +3,6 @@ namespace BTD6Rogue.Bosses.Vortex; - public class PoppableRogueVortex1 : ModBloon { public override string BaseBloon => "Vortex1"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { VortexConfig.ApplyVortexSettings(bloonModel, "Poppable", 0); } } public class PoppableRogueVortex2 : ModBloon { public override string BaseBloon => "Vortex1"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { VortexConfig.ApplyVortexSettings(bloonModel, "Poppable", 1); } } public class PoppableRogueVortex3 : ModBloon { public override string BaseBloon => "Vortex2"; public override void ModifyBaseBloonModel(BloonModel bloonModel) { VortexConfig.ApplyVortexSettings(bloonModel, "Poppable", 2); } } diff --git a/Gamemodes/Roguemode.cs b/Gamemodes/Roguemode.cs index f896e33..b6bec34 100644 --- a/Gamemodes/Roguemode.cs +++ b/Gamemodes/Roguemode.cs @@ -6,9 +6,9 @@ namespace BTD6Rogue; public class Roguemode : ModGameMode { - public override string Difficulty => DifficultyType.Hard; + public override string Difficulty => DifficultyType.Medium; - public override string BaseGameMode => GameModeType.Hard; + public override string BaseGameMode => GameModeType.Medium; public override string DisplayName => "BTD6 Rogue"; diff --git a/LATEST.md b/LATEST.md index babd4db..7f69f8e 100644 --- a/LATEST.md +++ b/LATEST.md @@ -1,17 +1,11 @@ -Version 1.3: +Version 1.5: NEW FEATURES: -- Lych Boss -- Fixed the dumb bug where same tower in a choice messes which upgrades you get -- Removed the scuffed "10 mil" upgrade in favor of actually locking upgrades -- Changed the difficulty icons -- Nerfed Early Game -- Buffed mid-late game - -Upcoming in Version 1.4+: -- Dreadbloon Boss +- PHAYZE (before Ninja Kiwi started the boss event :p) +- Rerolling towers + +Upcoming in Version 1.6+: - Difficulties effecting costs -- Mod settings - Modifiers - Artifacts - Banana Farmer, Pontoon, and Portable Lake as towers you can get diff --git a/ModHelperData.cs b/ModHelperData.cs index 23b78de..7c8832d 100644 --- a/ModHelperData.cs +++ b/ModHelperData.cs @@ -2,7 +2,7 @@ namespace BTD6Rogue; public static class ModHelperData { public const string WorksOnVersion = "37.0"; - public const string Version = "1.4.1"; + public const string Version = "1.5.0"; public const string Name = "BTD6Rogue"; public const string Description = @@ -10,6 +10,10 @@ public static class ModHelperData { "\n" + "If you're making content of this mod please credit me as the creator, (menddev, https://www.youtube.com/@menddev)\n" + "\n" + + "Considering how drastic the changes are, take caution if you are worried about getting flagged\n" + + "I have recently gotten flagged, it is unknown whether or not it is this mod or not\n" + + "(I do a lot of dumb modded testing with other mods so it could be that), warning over\n" + + "\n" + "Oh by the way, a ton of the mod settings don't work\n" + "\n" + "Anyway join my discord and yell at me if it's unbalancd, because it is lmao"; diff --git a/Panels/DifficultyChoicePanel.cs b/Panels/DifficultyChoicePanel.cs index 5bb8e44..2278c14 100644 --- a/Panels/DifficultyChoicePanel.cs +++ b/Panels/DifficultyChoicePanel.cs @@ -22,7 +22,7 @@ public class DifficultyChoicePanel : MonoBehaviour { public DifficultyChoicePanel(IntPtr ptr) : base(ptr) { } public void ChooseDifficulty(string difficulty) { - InitialHeroChoicePanel.Create(__instance.uiRect, __instance); + GameSettingsPanel.Create(__instance.uiRect, __instance); if (difficulty == "Poppable") { diff --git a/Panels/GameSettingsPanel.cs b/Panels/GameSettingsPanel.cs index 6da65dd..4fe2f07 100644 --- a/Panels/GameSettingsPanel.cs +++ b/Panels/GameSettingsPanel.cs @@ -1,11 +1,13 @@ using System; using System.Collections.Generic; +using BTD_Mod_Helper; using BTD_Mod_Helper.Api.Components; using BTD_Mod_Helper.Api.Enums; using BTD_Mod_Helper.Extensions; using Il2CppAssets.Scripts.Unity.UI_New.InGame; using MelonLoader; using UnityEngine; +using static Il2CppAssets.Scripts.Models.ServerEvents.QuickMatchSkuSettings; namespace BTD6Rogue; @@ -14,28 +16,55 @@ public class GameSettingsPanel : MonoBehaviour { public InGame __instance = null!; + public ModHelperDropdown dropdown; + public GameSettingsPanel(IntPtr ptr) : base(ptr) { } - public void ChooseDifficulty(string difficulty) { + public void StartGame() { + List possibleBosses = new List(); + + if (dropdown.Text.Text.text == "All") { + possibleBosses.Add("RogueDreadbloon"); + possibleBosses.Add("RogueVortex"); + possibleBosses.Add("RoguePhayze"); + possibleBosses.Add("RogueBloonarius"); + possibleBosses.Add("RogueLych"); + } else { + possibleBosses.Add("Rogue" + dropdown.Text.Text.text); + } + + BTD6Rogue.mod.roundGenerator.possibleBosses = possibleBosses; + + InitialHeroChoicePanel.Create(__instance.uiRect, __instance); Destroy(gameObject); } public static GameSettingsPanel Create(RectTransform menu, InGame __instance) { - ModHelperPanel panel = menu.gameObject.AddModHelperPanel(new Info("ReforgePanel", 0, 0, 1600, 1080), + ModHelperPanel panel = menu.gameObject.AddModHelperPanel(new Info("ReforgePanel", 0, 0, 2000, 1600), VanillaSprites.BrownInsertPanel); - GameSettingsPanel difficultyChoicePanel = panel.AddComponent(); - difficultyChoicePanel.__instance = __instance; + GameSettingsPanel gameSettingsPannel = panel.AddComponent(); + gameSettingsPannel.__instance = __instance; ModHelperPanel inset = panel.AddPanel(new Info("InnerPanel") { AnchorMin = new Vector2(0, 0), AnchorMax = new Vector2(1, 1), Size = -50 }, VanillaSprites.BrownInsertPanelDark); - - // 0 1 2 3 4 - List xPos = new List() { - -600, -300, -0, 300, 600, - }; + // Limit tower sets + //ModHelperCheckbox primaryOnly = inset.AddCheckbox(new Info("Checkbox", 0, 0, 100), false, VanillaSprites.BlueBtn); + + List bosses = new List() { "All", "Bloonarius", "Vortex", "Dreadbloon", "Lych", "Phayze" }; + + // Other stuff + ModHelperDropdown bossDropdown = inset.AddDropdown(new Info("BossDropdown", 0, 0, 600, 200), bosses.ToIl2CppList(), 600f, null, VanillaSprites.BlueInsertPanelRound, 80f); + gameSettingsPannel.dropdown = bossDropdown; + + // Limitations + //ModHelperCheckbox primaryOnly = inset.AddCheckbox(new Info("Checkbox", 0, 0, 100), false, VanillaSprites.BlueBtn); + + // Start Game + ModHelperButton button = inset.AddButton(new Info("Difficulty", 600, 0, 400, 200), VanillaSprites.GreenBtn, new Action(() => gameSettingsPannel.StartGame())); + ModHelperText difficultyText = button.AddText(new Info("Difficulty Name", 0, 0, 500, 500), "Start Game", 72); - return difficultyChoicePanel; + return gameSettingsPannel; } } \ No newline at end of file diff --git a/Panels/ParagonChoicePanel.cs b/Panels/ParagonChoicePanel.cs new file mode 100644 index 0000000..5e09b76 --- /dev/null +++ b/Panels/ParagonChoicePanel.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using BTD_Mod_Helper; +using BTD_Mod_Helper.Api.Components; +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.TowerSets; +using Il2CppAssets.Scripts.Simulation.Input; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Unity; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using Il2CppAssets.Scripts.Unity.UI_New.InGame.RightMenu.Powers; +using MelonLoader; +using UnityEngine; + +namespace BTD6Rogue; + +[RegisterTypeInIl2Cpp(false)] +public class ParagonChoicePanel : MonoBehaviour { + + public InGame __instance = null!; + public static ParagonChoicePanel uiPanel = null!; + + public string[] paragonChoices = new string[3]; + + public ParagonChoicePanel(IntPtr ptr) : base(ptr) { } + + public void ChooseTower(string towerName) { + TowerInventory towerInventory = __instance.GetTowerInventory(); + int tower = Array.IndexOf(paragonChoices, towerName); + string towerStr = Game.instance.model.GetTowerWithName(towerName).baseId; + towerInventory.towerMaxes[towerStr] += 3; + + BTD6Rogue.mod.rogueTowers[towerStr].limitPaths[0] = 6; + BTD6Rogue.mod.rogueTowers[towerStr].limitPaths[1] = 6; + BTD6Rogue.mod.rogueTowers[towerStr].limitPaths[2] = 6; + BTD6Rogue.mod.rogueTowers[towerStr].lockedPaths[0] = true; + BTD6Rogue.mod.rogueTowers[towerStr].lockedPaths[1] = true; + BTD6Rogue.mod.rogueTowers[towerStr].lockedPaths[2] = true; + + __instance.bridge.OnTowerInventoryChangedSim(true); + __instance.bridge.SetAutoPlay(true); + BTD6Rogue.mod.uiOpen = false; + uiPanel = null!; + Destroy(gameObject); + } + + public static ParagonChoicePanel Create(RectTransform menu, InGame __instance) { + BTD6Rogue.mod.uiOpen = true; + ModHelperPanel panel = menu.gameObject.AddModHelperPanel(new Info("ReforgePanel", 0, 0, 2400, 1000), VanillaSprites.BrownInsertPanel); + ParagonChoicePanel towerChoicePanel = panel.AddComponent(); + towerChoicePanel.__instance = __instance; + uiPanel = towerChoicePanel!; + + var inset = panel.AddPanel(new Info("InnerPanel") { AnchorMin = new Vector2(0, 0), AnchorMax = new Vector2(1, 1), Size = -50 }, + VanillaSprites.BrownInsertPanelDark); + + TowerModel[] towerModels = ParagonUtil.GetThreeParagons(); + + List xPos = new List() { -800, 0, 800 }; + + for (int i = 0; i < towerModels.Length; i++) { + TowerModel tower = towerModels[i]; + towerChoicePanel.paragonChoices[i] = tower.GetTowerId(); + + ModHelperButton towerButton = inset.AddButton(new Info("Tower Button", xPos[i], -100, 650), VanillaSprites.GreenBtn, new Action(() => towerChoicePanel.ChooseTower(tower.GetTowerId()))); + towerButton.AddImage(new Info("Image") { AnchorMin = new Vector2(0, 0), AnchorMax = new Vector2(1, 1), Size = 50 }, tower.portrait.GetGUID()); + } + ModHelperText chooseText = inset.AddText(new Info("Tower Amount", 0, 400, 2000, 100), "Choose a Path", 86); + ModHelperText infoText = inset.AddText(new Info("Tower Amount", 0, 300, 2000, 100), "None of these paths will show up again, choose wisely", 56); + + return towerChoicePanel; + } +} \ No newline at end of file diff --git a/Panels/TowerChoicePanel.cs b/Panels/TowerChoicePanel.cs index cb8b907..3fc7992 100644 --- a/Panels/TowerChoicePanel.cs +++ b/Panels/TowerChoicePanel.cs @@ -4,11 +4,13 @@ using BTD_Mod_Helper.Api.Components; using BTD_Mod_Helper.Api.Enums; using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.Powers; using Il2CppAssets.Scripts.Models.Towers; using Il2CppAssets.Scripts.Models.TowerSets; using Il2CppAssets.Scripts.Simulation.Input; using Il2CppAssets.Scripts.Simulation.Towers; using Il2CppAssets.Scripts.Unity; +using Il2CppAssets.Scripts.Unity.Towers; using Il2CppAssets.Scripts.Unity.UI_New.InGame; using Il2CppAssets.Scripts.Unity.UI_New.InGame.RightMenu.Powers; using MelonLoader; @@ -25,6 +27,7 @@ public class TowerChoicePanel : MonoBehaviour { public string[] towerChoices = new string[3]; public string[] towerPaths = new string[3]; public int[] towerAmounts = new int[3]; + public TowerModel[] towerModels = new TowerModel[3]; public TowerChoicePanel(IntPtr ptr) : base(ptr) { } @@ -36,13 +39,16 @@ public void ChooseTower(string towerName) { if (towerPaths[tower] == "top") { BTD6Rogue.mod.rogueTowers[towerStr].limitPaths[0] = TowerUtil.GetMaxPath(__instance.currentRoundId + 1); - //BTD6Rogue.mod.rogueTowers[towerStr].top = true; } else if (towerPaths[tower] == "mid") { BTD6Rogue.mod.rogueTowers[towerStr].limitPaths[1] = TowerUtil.GetMaxPath(__instance.currentRoundId + 1); - //BTD6Rogue.mod.rogueTowers[towerStr].mid = true; } else if (towerPaths[tower] == "bot") { BTD6Rogue.mod.rogueTowers[towerStr].limitPaths[2] = TowerUtil.GetMaxPath(__instance.currentRoundId + 1); - //BTD6Rogue.mod.rogueTowers[towerStr].bot = true; + } + + for (int i = 0; i < towerModels.Length; i++) { + if (towerModels[i].GetUpgradeLevel(0) >= 1) { BTD6Rogue.mod.rogueTowers[towerModels[i].baseId].lockedPaths[0] = true; } + if (towerModels[i].GetUpgradeLevel(1) >= 1) { BTD6Rogue.mod.rogueTowers[towerModels[i].baseId].lockedPaths[1] = true; } + if (towerModels[i].GetUpgradeLevel(2) >= 1) { BTD6Rogue.mod.rogueTowers[towerModels[i].baseId].lockedPaths[2] = true; } } __instance.bridge.OnTowerInventoryChangedSim(true); @@ -52,9 +58,15 @@ public void ChooseTower(string towerName) { Destroy(gameObject); } + public void RerollTowers() { + BTD6Rogue.mod.rerolls--; + Create(__instance.uiRect, __instance); + Destroy(gameObject); + } + public static TowerChoicePanel Create(RectTransform menu, InGame __instance) { BTD6Rogue.mod.uiOpen = true; - ModHelperPanel panel = menu.gameObject.AddModHelperPanel(new Info("ReforgePanel", 0, 0, 2400, 1000), VanillaSprites.BrownInsertPanel); + ModHelperPanel panel = menu.gameObject.AddModHelperPanel(new Info("ReforgePanel", 0, 0, 2400, 1250), VanillaSprites.BrownInsertPanel); TowerChoicePanel towerChoicePanel = panel.AddComponent(); towerChoicePanel.__instance = __instance; uiPanel = towerChoicePanel!; @@ -63,25 +75,32 @@ public static TowerChoicePanel Create(RectTransform menu, InGame __instance) { VanillaSprites.BrownInsertPanelDark); TowerModel[] towerModels = TowerUtil.GetThreeTowers(TowerUtil.GetMaxPath(__instance.currentRoundId + 1), TowerUtil.waterMaps.Contains(__instance.GetMap().mapModel.mapName)); + towerChoicePanel.towerModels = towerModels; List xPos = new List() { -800, 0, 800 }; for (int i = 0; i < towerModels.Length; i++) { TowerModel tower = towerModels[i]; towerChoicePanel.towerChoices[i] = tower.GetTowerId(); - if (tower.GetUpgradeLevel(0) >= 1) { towerChoicePanel.towerPaths[i] = "top"; BTD6Rogue.mod.rogueTowers[tower.baseId].lockedPaths[0] = true; } - if (tower.GetUpgradeLevel(1) >= 1) { towerChoicePanel.towerPaths[i] = "mid"; BTD6Rogue.mod.rogueTowers[tower.baseId].lockedPaths[1] = true; } - if (tower.GetUpgradeLevel(2) >= 1) { towerChoicePanel.towerPaths[i] = "bot"; BTD6Rogue.mod.rogueTowers[tower.baseId].lockedPaths[2] = true; } towerChoicePanel.towerAmounts[i] = TowerUtil.GetTowerCount(tower); - ModHelperButton towerButton = inset.AddButton(new Info("Tower Button", xPos[i], -100, 650), VanillaSprites.GreenBtn, new Action(() => towerChoicePanel.ChooseTower(tower.GetTowerId()))); + if (tower.GetUpgradeLevel(0) >= 1) { towerChoicePanel.towerPaths[i] = "top"; } + if (tower.GetUpgradeLevel(1) >= 1) { towerChoicePanel.towerPaths[i] = "mid"; } + if (tower.GetUpgradeLevel(2) >= 1) { towerChoicePanel.towerPaths[i] = "bot"; } + + ModHelperButton towerButton = inset.AddButton(new Info("Tower Button", xPos[i], -50, 650), VanillaSprites.GreenBtn, new Action(() => towerChoicePanel.ChooseTower(tower.GetTowerId()))); towerButton.AddImage(new Info("Image") { AnchorMin = new Vector2(0, 0), AnchorMax = new Vector2(1, 1), Size = 50 }, tower.portrait.GetGUID()); ModHelperText towerName = towerButton.AddText(new Info("Tower Name", 0, -225, 650, 76), tower.name, 64); ModHelperText amountText = towerButton.AddText(new Info("Tower Amount", 225, 225, 500, 500), towerChoicePanel.towerAmounts[i].ToString(), 110); towerName.Text.enableAutoSizing = true; } - ModHelperText chooseText = inset.AddText(new Info("Tower Amount", 0, 400, 2000, 100), "Choose a Path", 86); - ModHelperText infoText = inset.AddText(new Info("Tower Amount", 0, 300, 2000, 100), "None of these paths will show up again, choose wisely", 56); + ModHelperText chooseText = inset.AddText(new Info("Tower Amount", 0, 500, 2000, 100), "Choose a Path", 86); + ModHelperText infoText = inset.AddText(new Info("Tower Amount", 0, 400, 2000, 100), "None of these paths will show up again, choose wisely", 56); + + if (BTD6Rogue.mod.rerolls > 0) { + ModHelperButton rerollButton = inset.AddButton(new Info("Reroll Button", 0, -500, 400, 200), VanillaSprites.BlueBtn, new Action(() => towerChoicePanel.RerollTowers())); + ModHelperText towerName = rerollButton.AddText(new Info("Tower Name", 0, 0, 650, 76), "Reroll: " + BTD6Rogue.mod.rerolls, 64); + } return towerChoicePanel; } diff --git a/Patches/BloonPopPatch.cs b/Patches/BloonPopPatch.cs new file mode 100644 index 0000000..61f62fd --- /dev/null +++ b/Patches/BloonPopPatch.cs @@ -0,0 +1,25 @@ +using HarmonyLib; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using BTD_Mod_Helper.Extensions; + +namespace BTD6Rogue; + +[HarmonyPatch(typeof(InGame), nameof(InGame.CashChanged))] +static class BloonPopPatch { + + static double lastCashValue; + + [HarmonyPrefix] + private static void Prefix(InGame __instance) { + if (BTD6Rogue.mod.canGainMoney) { + lastCashValue = __instance.GetCash(); + } + } + + [HarmonyPostfix] + private static void Postfix(InGame __instance) { + if (!BTD6Rogue.mod.canGainMoney) { + //__instance.bridge.SetCash(lastCashValue); + } + } +} diff --git a/Patches/HeroXpPatch.cs b/Patches/HeroXpPatch.cs index 3460a6f..9b48437 100644 --- a/Patches/HeroXpPatch.cs +++ b/Patches/HeroXpPatch.cs @@ -16,7 +16,7 @@ private static void Postfix(Hero __instance, float amount) { int heroCount = 0; - foreach (TowerToSimulation tts in InGame.instance.bridge.GetAllTowers()) { + foreach (TowerToSimulation tts in InGame.instance.bridge.GetAllTowers().ToList()) { if (tts.GetTower().towerModel.towerSet == Il2CppAssets.Scripts.Models.TowerSets.TowerSet.Hero) { heroCount++; } diff --git a/Patches/RoundEndPatch.cs b/Patches/RoundEndPatch.cs index 67f615c..3303e61 100644 --- a/Patches/RoundEndPatch.cs +++ b/Patches/RoundEndPatch.cs @@ -1,9 +1,9 @@ using Il2CppAssets.Scripts.Unity.UI_New.InGame; using HarmonyLib; using BTD_Mod_Helper.Extensions; -using System.Collections.Generic; -using Il2CppAssets.Scripts.Unity; +using System.Threading; using System; +using Il2CppAssets.Scripts.Unity; namespace BTD6Rogue; @@ -22,12 +22,36 @@ private static void Postfix(InGame __instance, int completedRound, int highestCo __instance.GetGameModel().roundSet.rounds[completedRound + 1] = BTD6Rogue.mod.roundGenerator.GetRandomRoundModel(__instance.GetGameModel().roundSet.rounds[completedRound + 1], completedRound + 1); } + if ((completedRound + 1) % 20 == 1) { + int bossInt = new Random().Next(BTD6Rogue.mod.roundGenerator.possibleBosses.Count); + BTD6Rogue.mod.roundGenerator.nextBoss = BTD6Rogue.mod.roundGenerator.possibleBosses[bossInt]; + if (BTD6Rogue.mod.roundGenerator.nextBoss == "RogueBloonarius") { + Game.instance.ShowMessage("The smell of sludge and algae permeates the air", 20f); + } else if (BTD6Rogue.mod.roundGenerator.nextBoss == "RogueVortex") { + Game.instance.ShowMessage("Strong gusts of wind begin to blow sharply", 20f); + } else if (BTD6Rogue.mod.roundGenerator.nextBoss == "RogueDreadbloon") { + Game.instance.ShowMessage("The ground shakes beneath your feet", 20f); + } else if (BTD6Rogue.mod.roundGenerator.nextBoss == "RoguePhayze") { + Game.instance.ShowMessage("Reality begins to distort", 20f); + } else if (BTD6Rogue.mod.roundGenerator.nextBoss == "RogueLych") { + Game.instance.ShowMessage("A feeling of death surrounds you", 20f); + } else { + Game.instance.ShowMessage("ERROR MESSAGE SEND HELP", 20f); + } + } + // Tower choice every 10 rounds (starting at 5) if ((completedRound + 1) % BTD6Rogue.RoundsPerRandomTower == BTD6Rogue.TowersStartAtRound && BTD6Rogue.RandomTowers) { __instance.bridge.SetAutoPlay(false); + if (BTD6Rogue.mod.rerolls < 3) { BTD6Rogue.mod.rerolls++; } TowerChoicePanel.Create(__instance.uiRect, __instance); } + if ((completedRound + 1) % 90 == 0) { + __instance.bridge.SetAutoPlay(false); + ParagonChoicePanel.Create(__instance.uiRect, __instance); + } + // Hero choice every 40 rounds if ((completedRound + 1) % 40 == 0) { __instance.bridge.SetAutoPlay(false); diff --git a/Patches/RoundStartPatch.cs b/Patches/RoundStartPatch.cs index 4b5da3c..ccf5e70 100644 --- a/Patches/RoundStartPatch.cs +++ b/Patches/RoundStartPatch.cs @@ -1,6 +1,9 @@ using Il2CppAssets.Scripts.Unity.UI_New.InGame; using HarmonyLib; using Il2CppAssets.Scripts.Unity.Bridge; +using System.Threading; +using BTD_Mod_Helper.Extensions; +using BTD_Mod_Helper; namespace BTD6Rogue; @@ -9,6 +12,20 @@ static class RoundStartPatch { [HarmonyPrefix] private static bool Prefix(UnityToSimulation __instance) { if (BTD6Rogue.DisablePatchesInSandbox && __instance.IsSandboxMode()) { return true; } + return !BTD6Rogue.mod.uiOpen; } } + +[HarmonyPatch(typeof(InGame), nameof(InGame.RoundStart))] +static class StartRoundPatch { + [HarmonyPrefix] + private static void Prefix(InGame __instance) { + if ((__instance.bridge.GetCurrentRound() + 1) % 20 == 0) { + //Thread t = new Thread(new ThreadStart(BTD6Rogue.mod.roundGenerator.SpawnBloonsDelay)); + //t.Start(); + } else { + BTD6Rogue.mod.canGainMoney = true; + } + } +} diff --git a/Rounds/RoundGenerator.cs b/Rounds/RoundGenerator.cs index 4c1cc91..1958e3e 100644 --- a/Rounds/RoundGenerator.cs +++ b/Rounds/RoundGenerator.cs @@ -1,9 +1,12 @@ -using BTD_Mod_Helper.Extensions; +using BTD_Mod_Helper; +using BTD_Mod_Helper.Extensions; using Il2CppAssets.Scripts.Models.Bloons; using Il2CppAssets.Scripts.Models.Rounds; using Il2CppAssets.Scripts.Unity; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; using System; using System.Collections.Generic; +using System.Threading; namespace BTD6Rogue; @@ -14,6 +17,35 @@ public class RoundGenerator { public int randEndTime = 450; public int minEndTime = 150; + public string nextBoss = ""; + + public List possibleBosses = new List(); + + public void SpawnBloonsDelay() { + Thread.Sleep(25000); + if ((InGame.instance.bridge.GetCurrentRound() + 1) % 20 == 0) { + BTD6Rogue.mod.canGainMoney = false; + Thread t = new Thread(new ThreadStart(SpawnBloons)); + t.Start(); + } + } + + public void SpawnBloons() { + string[] possibleBloons = GetValidBloons(InGame.instance.bridge.GetCurrentRound() + 1); + string bloonId = possibleBloons[new Random().Next(possibleBloons.Length)]; + if (bloonId.ToLower().Contains("moab") || bloonId.ToLower().Contains("bfb") || bloonId.ToLower().Contains("zomg") || bloonId.ToLower().Contains("ddt") || bloonId.ToLower().Contains("bad")) { + InGame.instance.SpawnBloons(bloonId, 1, 16); + } else { + InGame.instance.SpawnBloons(bloonId, 10, 16); + } + + Thread.Sleep(2000); + if ((InGame.instance.bridge.GetCurrentRound() + 1) % 20 == 0) { + Thread t = new Thread(new ThreadStart(SpawnBloons)); + t.Start(); + } + } + public RoundModel GetRandomRoundModel(RoundModel baseRoundModel, int round) { RoundModel roundModel = baseRoundModel; roundModel.ClearBloonGroups(); @@ -21,23 +53,22 @@ public RoundModel GetRandomRoundModel(RoundModel baseRoundModel, int round) { int bloonGroups = new Random().Next(4) + 3; int mincrease = 0; - int bossInt = new Random().Next(3); - //string bossId = BTD6Rogue.mod.overrideBoss; - string bossId = "RogueBloonarius"; - if (bossInt == 0) { bossId = "RogueBloonarius"; } else if (bossInt == 1) { bossId = "RogueDreadbloon"; } else if (bossInt == 2) { bossId = "RogueLych"; } else if (bossInt == 3) { bossId = "RogueVortex"; } - - if (round + 1 == 20) { - roundModel.AddBloonGroup("BTD6Rogue-" + BTD6Rogue.mod.difficulty.DifficultyName + bossId + "1", 1, 0, 0); - } else if (round + 1 == 40) { - roundModel.AddBloonGroup("BTD6Rogue-" + BTD6Rogue.mod.difficulty.DifficultyName + bossId + "2", 1, 0, 0); - } else if (round + 1 == 60) { - roundModel.AddBloonGroup("BTD6Rogue-" + BTD6Rogue.mod.difficulty.DifficultyName + bossId + "3", 1, 0, 0); - } else if (round + 1 == 80) { - roundModel.AddBloonGroup("BTD6Rogue-" + BTD6Rogue.mod.difficulty.DifficultyName + bossId + "4", 1, 0, 0); - } else if (round + 1 == 100) { - roundModel.AddBloonGroup("BTD6Rogue-" + BTD6Rogue.mod.difficulty.DifficultyName + bossId + "5", 1, 0, 0); - } else if (round + 1 == 120) { - roundModel.AddBloonGroup("BTD6Rogue-" + BTD6Rogue.mod.difficulty.DifficultyName + bossId + "6", 1, 0, 0); + if ((round + 1) % 20 == 0) { + string bossId = nextBoss; + + if (round + 1 == 20) { + roundModel.AddBloonGroup("BTD6Rogue-" + BTD6Rogue.mod.difficulty.DifficultyName + bossId + "1", 1, 0, 0); + } else if (round + 1 == 40) { + roundModel.AddBloonGroup("BTD6Rogue-" + BTD6Rogue.mod.difficulty.DifficultyName + bossId + "2", 1, 0, 0); + } else if (round + 1 == 60) { + roundModel.AddBloonGroup("BTD6Rogue-" + BTD6Rogue.mod.difficulty.DifficultyName + bossId + "3", 1, 0, 0); + } else if (round + 1 == 80) { + roundModel.AddBloonGroup("BTD6Rogue-" + BTD6Rogue.mod.difficulty.DifficultyName + bossId + "4", 1, 0, 0); + } else if (round + 1 == 100) { + roundModel.AddBloonGroup("BTD6Rogue-" + BTD6Rogue.mod.difficulty.DifficultyName + bossId + "5", 1, 0, 0); + } else if (round + 1 == 120) { + roundModel.AddBloonGroup("BTD6Rogue-" + BTD6Rogue.mod.difficulty.DifficultyName + bossId + "6", 1, 0, 0); + } } for (int i = 0; i < bloonGroups; i++) { diff --git a/Util/ParagonUtil.cs b/Util/ParagonUtil.cs new file mode 100644 index 0000000..06071c2 --- /dev/null +++ b/Util/ParagonUtil.cs @@ -0,0 +1,37 @@ +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Unity; +using System.Collections.Generic; +using System; +using BTD_Mod_Helper.Extensions; + +namespace BTD6Rogue; + +public static class ParagonUtil { + + public static TowerModel[] GetThreeParagons() { + List towerModels = new List(); + + for (int i = 0; i < 3; i++) { + TowerModel newTower = GetParagon(); + //swhile (towerModels.Contains(newTower)) { + // newTower = GetParagon(); + //} + towerModels.Add(newTower); + } + + return towerModels.ToArray(); + } + + public static TowerModel GetParagon() { + Random random = new Random(); + + string[] towerIds = new string[] { TowerType.DartMonkey, TowerType.BoomerangMonkey, TowerType.MonkeyAce, TowerType.MonkeyBuccaneer, + TowerType.NinjaMonkey, TowerType.WizardMonkey, TowerType.EngineerMonkey }; + + string towerId = towerIds[random.Next(towerIds.Length)]; + + + TowerModel towerModel = Game.instance.model.GetParagonTower(towerId); + return towerModel; + } +} \ No newline at end of file