From aed5bdd3601352fd015dc7ddc62c0ea946390d8e Mon Sep 17 00:00:00 2001 From: DarkTerraYT Date: Tue, 9 Jul 2024 22:52:06 -0400 Subject: [PATCH] Fix for latest version, yw snowzkitty --- Main.cs | 11 +++++------ MonkeyAirship.cs | 3 ++- Upgrades/Bloonradicator.cs | 8 ++++---- Upgrades/BottomPath/Carrier Airship.cs | 4 ++-- Upgrades/BottomPath/Light Carrier.cs | 4 ++-- Upgrades/BottomPath/Ravager.cs | 2 +- Upgrades/MiddlePath/Annihilator.cs | 6 +++--- Upgrades/MiddlePath/Laser Array.cs | 4 ++-- Upgrades/TopPath/Bomber.cs | 2 +- Upgrades/TopPath/Devastator.cs | 4 ++-- Upgrades/TopPath/Heavy Bomber.cs | 2 +- Upgrades/TopPath/Mobile Reconnaissance.cs | 4 ++-- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Main.cs b/Main.cs index cdd6e95..e777d74 100644 --- a/Main.cs +++ b/Main.cs @@ -25,9 +25,8 @@ namespace MonkeyAirship { public class Main : BloonsTD6Mod { - public override string GithubReleaseURL => ""; - [HarmonyPatch(typeof(TowerManager), "UpgradeTower")] + [HarmonyPatch(typeof(TowerManager), "UpgradeTower")] internal class Tower_Initialise { [HarmonyPrefix] @@ -43,13 +42,13 @@ internal static bool Prefix(int inputIndex, bool isParagon = false, bool leveledFromEndOfRoundXp = false) { - if(def.name == "Eradicator") + if (def.name == "Eradicator") { - if(tower.towerModel.tiers[0] == 5) + if (tower.towerModel.tiers[0] == 5) { tower.SetTargetType(def.targetTypes[0]); } - else if(tower.towerModel.tiers[2] == 5) + else if (tower.towerModel.tiers[2] == 5) { tower.towerModel = Game.instance.model.GetTowerFromId("MonkeySub-050"); } @@ -64,7 +63,7 @@ public override void OnTowerUpgraded(Tower tower, string upgradeName, Il2CppAsse if (tower.towerModel.name == "Eradicator") { - var degree = tower.GetTowerBehavior().GetCurrentDegree();; + var degree = tower.GetTowerBehavior().GetCurrentDegree(); ; foreach (var attackmodel in tower.towerModel.GetBehaviors()) { foreach (var weapon in attackmodel.weapons) diff --git a/MonkeyAirship.cs b/MonkeyAirship.cs index edb6175..666ff30 100644 --- a/MonkeyAirship.cs +++ b/MonkeyAirship.cs @@ -14,6 +14,7 @@ using Il2CppAssets.Scripts.Models.Towers.Behaviors.Emissions; using Il2CppAssets.Scripts.Simulation.Behaviors; using Il2CppAssets.Scripts.Models.GenericBehaviors; +using BTD_Mod_Helper; namespace MonkeyAirship { @@ -59,6 +60,6 @@ public override int GetTowerIndex(List towerSet) return towerSet.First(model => model.towerId == TowerType.MonkeyAce).towerIndex + 1; } public override bool IsValidCrosspath(int[] tiers) => - HasMod("UltimateCrosspathing") ? true : base.IsValidCrosspath(tiers); + ModHelper.HasMod("UltimateCrosspathing") ? true : base.IsValidCrosspath(tiers); } } diff --git a/Upgrades/Bloonradicator.cs b/Upgrades/Bloonradicator.cs index 343e1e5..88d14fe 100644 --- a/Upgrades/Bloonradicator.cs +++ b/Upgrades/Bloonradicator.cs @@ -47,7 +47,7 @@ public override void ApplyUpgrade(TowerModel towerModel) balloflight.GetAttackModel().weapons[0].AddBehavior(new FireFromAirUnitModel("fire")); var balloflightweapon = balloflight.GetAttackModel().weapons[0]; - balloflight.GetDescendant().displayPath.assetPath = new Il2CppAssets.Scripts.Utils.PrefabReference() { guidRef = "d48587764ad63c84ea37e82f58bd05ad" }; + balloflight.GetDescendant().displayPath.assetPath = new Il2CppNinjaKiwi.Common.ResourceUtils.PrefabReference() { guidRef = "d48587764ad63c84ea37e82f58bd05ad" }; balloflightweapon.projectile.GetDamageModel().damage = 24; balloflightweapon.projectile.AddBehavior(new DamageModifierForTagModel("boss", "Boss", 1, 20, false, true)); balloflightweapon.projectile.CapPierce(999999); @@ -107,7 +107,7 @@ public override void ApplyUpgrade(TowerModel towerModel) strongairunitmodel.weapons[10].ejectX = 0; strongairunitmodel.weapons[10].projectile.GetDamageModel().damage = 120; strongairunitmodel.weapons[10].projectile.AddBehavior(new DamageModifierForTagModel("boss", "Boss", 1, 100, false, true)); - strongairunitmodel.weapons[10].GetDescendant().displayPath.assetPath = new Il2CppAssets.Scripts.Utils.PrefabReference() { guidRef = "b9f3014db2da83f48b34e662e9a79910" }; + strongairunitmodel.weapons[10].GetDescendant().displayPath.assetPath = new Il2CppNinjaKiwi.Common.ResourceUtils.PrefabReference() { guidRef = "b9f3014db2da83f48b34e662e9a79910" }; strongairunitmodel.AddWeapon(strongairunitmodel.weapons[10]); strongairunitmodel.weapons[11].GetDescendant().useTargetAsEndPoint = false; @@ -175,7 +175,7 @@ public override void ApplyUpgrade(TowerModel towerModel) var bombbehavior = Game.instance.model.GetTowerFromId("MonkeyAce-030").GetAttackModel(1).Duplicate(); var mortar500 = Game.instance.model.GetTowerFromId("MortarMonkey-500").Duplicate(); var bomb = bombbehavior.weapons[0]; - bomb.projectile.GetBehavior().effectModel.assetId = new Il2CppAssets.Scripts.Utils.PrefabReference() { guidRef = "b1324f2f4c3809643b7ef1d8c112442a" }; + bomb.projectile.GetBehavior().effectModel.assetId = new Il2CppNinjaKiwi.Common.ResourceUtils.PrefabReference() { guidRef = "b1324f2f4c3809643b7ef1d8c112442a" }; bomb.projectile.GetBehavior().effectModel.scale = .8f; bomb.RemoveBehavior(); @@ -210,7 +210,7 @@ public override void ApplyUpgrade(TowerModel towerModel) towerModel.AddBehavior(bombbehavior); var carrier = Game.instance.model.GetTowerFromId("MonkeyBuccaneer-400").GetAttackModel(1).weapons[0].Duplicate(); - var plane = Game.instance.model.GetTowerFromId("BuccaneerGreaterPlane").Duplicate(); + var plane = Game.instance.model.GetTowerFromId("MonkeyBuccaneer-500").GetDescendant().tower.Duplicate(); var strafe = plane.GetAttackModel(0).weapons[0]; var strafeprojectile = strafe.projectile; var missile = plane.GetAttackModel(2).weapons[0]; diff --git a/Upgrades/BottomPath/Carrier Airship.cs b/Upgrades/BottomPath/Carrier Airship.cs index 30fc031..5548463 100644 --- a/Upgrades/BottomPath/Carrier Airship.cs +++ b/Upgrades/BottomPath/Carrier Airship.cs @@ -20,7 +20,7 @@ public override void ApplyUpgrade(TowerModel towerModel) var attackairunitmodel = towerModel.GetBehavior(); var firefromairunitmodel = attackairunitmodel.GetDescendant(); var carrier = Game.instance.model.GetTowerFromId("MonkeyBuccaneer-400").GetAttackModel(1).weapons[0].Duplicate(); - var plane = Game.instance.model.GetTowerFromId("BuccaneerGreaterPlane").Duplicate(); + var plane = Game.instance.model.GetTowerFromId("MonkeyBuccaneer-500").GetDescendant().tower.Duplicate(); var strafe = plane.GetAttackModel(0).weapons[0]; var strafeprojectile = strafe.projectile; var missile = plane.GetAttackModel(2).weapons[0]; @@ -49,7 +49,7 @@ public override void ApplyUpgrade(TowerModel towerModel) var decamo = Game.instance.model.GetTower(TowerType.WizardMonkey, 0, 0, 3).GetWeapons()[1].Duplicate(); decamo.behaviors = new Il2CppReferenceArray(new WeaponBehaviorModel[] { firefromlightplane }); decamo.rate = .3f; - decamo.projectile.display = new Il2CppAssets.Scripts.Utils.PrefabReference() { guidRef = "" }; + decamo.projectile.display = new Il2CppNinjaKiwi.Common.ResourceUtils.PrefabReference() { guidRef = "" }; decamo.projectile.radius = 20; plane.GetAttackModel(0).AddWeapon(decamo); } diff --git a/Upgrades/BottomPath/Light Carrier.cs b/Upgrades/BottomPath/Light Carrier.cs index b5ef8c3..e21abb7 100644 --- a/Upgrades/BottomPath/Light Carrier.cs +++ b/Upgrades/BottomPath/Light Carrier.cs @@ -16,7 +16,7 @@ public override void ApplyUpgrade(TowerModel towerModel) var attackairunitmodel = towerModel.GetBehavior(); var firefromairunitmodel = attackairunitmodel.GetDescendant(); var carrier = Game.instance.model.GetTowerFromId("MonkeyBuccaneer-400").GetAttackModel(1).weapons[0].Duplicate(); - var plane = Game.instance.model.GetTowerFromId("BuccaneerLesserPlane").Duplicate(); + var plane = Game.instance.model.GetTowerFromId("MonkeyBuccaneer-400").GetDescendant().tower.Duplicate(); var strafe = plane.GetAttackModel(0).weapons[0]; var strafeprojectile = strafe.projectile; @@ -38,7 +38,7 @@ public override void ApplyUpgrade(TowerModel towerModel) var decamo = Game.instance.model.GetTower(TowerType.WizardMonkey, 0, 0, 3).GetWeapons()[1].Duplicate(); decamo.behaviors = new Il2CppReferenceArray(new WeaponBehaviorModel[] { firefromairunitmodel }); decamo.rate = .01f; - decamo.projectile.display = new Il2CppAssets.Scripts.Utils.PrefabReference() { guidRef = "" }; + decamo.projectile.display = new Il2CppNinjaKiwi.Common.ResourceUtils.PrefabReference() { guidRef = "" }; decamo.projectile.radius = 20; plane.GetAttackModel(0).AddWeapon(decamo); } diff --git a/Upgrades/BottomPath/Ravager.cs b/Upgrades/BottomPath/Ravager.cs index e8e637f..d43d346 100644 --- a/Upgrades/BottomPath/Ravager.cs +++ b/Upgrades/BottomPath/Ravager.cs @@ -16,7 +16,7 @@ public override void ApplyUpgrade(TowerModel towerModel) var attackairunitmodel = towerModel.GetBehavior(); var firefromairunitmodel = attackairunitmodel.GetDescendant(); var carrier = Game.instance.model.GetTowerFromId("MonkeyBuccaneer-400").GetAttackModel(1).weapons[0].Duplicate(); - var plane = Game.instance.model.GetTowerFromId("BuccaneerGreaterPlane").Duplicate(); + var plane = Game.instance.model.GetTowerFromId("MonkeyBuccaneer-500").GetDescendant().tower.Duplicate(); var strafe = plane.GetAttackModel(0).weapons[0]; var strafeprojectile = strafe.projectile; var missile = plane.GetAttackModel(2).weapons[0]; diff --git a/Upgrades/MiddlePath/Annihilator.cs b/Upgrades/MiddlePath/Annihilator.cs index 549a277..61b5bce 100644 --- a/Upgrades/MiddlePath/Annihilator.cs +++ b/Upgrades/MiddlePath/Annihilator.cs @@ -63,13 +63,13 @@ public override void ApplyUpgrade(TowerModel towerModel) var weaklaser = laserstrikeattack.Duplicate(); var displaylaser = laserstrikeattack.Duplicate(); displaylaser.GetDescendant().useTargetAsEndPoint = false; - weaklaser.GetDescendant().displayPath.assetPath = new Il2CppAssets.Scripts.Utils.PrefabReference() { guidRef = "d48587764ad63c84ea37e82f58bd05ad" }; + weaklaser.GetDescendant().displayPath.assetPath = new Il2CppNinjaKiwi.Common.ResourceUtils.PrefabReference() { guidRef = "d48587764ad63c84ea37e82f58bd05ad" }; laserstrike.attacks[0].targetProvider = new TargetStrongAirUnitModel("", false, false); laserstrike.attacks[0].AddBehavior(new TargetStrongAirUnitModel("", false, false)); laserstrikeattack.GetAttackModel().weapons[0].projectile.GetDamageModel().damage = 120; - laserstrikeattack.GetDescendant().displayPath.assetPath = new Il2CppAssets.Scripts.Utils.PrefabReference() { guidRef = "b9f3014db2da83f48b34e662e9a79910" }; + laserstrikeattack.GetDescendant().displayPath.assetPath = new Il2CppNinjaKiwi.Common.ResourceUtils.PrefabReference() { guidRef = "b9f3014db2da83f48b34e662e9a79910" }; laserstrike.attacks[0].weapons[0] = laserstrikeattack.GetAttackModel().weapons[0].Duplicate(); laserstrike.attacks[0].fireWithoutTarget = false; @@ -88,7 +88,7 @@ public override void ApplyUpgrade(TowerModel towerModel) foreach (var attackairunitmodel in towerModel.GetBehaviors()) { attackairunitmodel.range += 50; - attackairunitmodel.weapons[0].projectile.display = new Il2CppAssets.Scripts.Utils.PrefabReference() { guidRef = "6c11e1432d6321c44b216600b2cdbac6" }; + attackairunitmodel.weapons[0].projectile.display = new Il2CppNinjaKiwi.Common.ResourceUtils.PrefabReference() { guidRef = "6c11e1432d6321c44b216600b2cdbac6" }; attackairunitmodel.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("ceramic", "Ceramic", 1, 3, false, true)); attackairunitmodel.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("fortified", "Fortified", 1, 3, false, true)); attackairunitmodel.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("moabs", "Moabs", 1, 2, false, true)); diff --git a/Upgrades/MiddlePath/Laser Array.cs b/Upgrades/MiddlePath/Laser Array.cs index cf2ba19..9dc2c46 100644 --- a/Upgrades/MiddlePath/Laser Array.cs +++ b/Upgrades/MiddlePath/Laser Array.cs @@ -18,10 +18,10 @@ public override void ApplyUpgrade(TowerModel towerModel) var lastairunitmodel = towerModel.GetBehavior().Duplicate(); var centerlaserairunitmodel = strongairunitmodel.Duplicate(); var closeairunitmodel = towerModel.GetBehaviors()[1]; - towerModel.GetAttackModel(0).weapons[0].projectile.display = new Il2CppAssets.Scripts.Utils.PrefabReference() { guidRef = "6c11e1432d6321c44b216600b2cdbac6" }; + towerModel.GetAttackModel(0).weapons[0].projectile.display = new Il2CppNinjaKiwi.Common.ResourceUtils.PrefabReference() { guidRef = "6c11e1432d6321c44b216600b2cdbac6" }; var balloflight = Game.instance.model.GetTowerFromId("BallOfLightTower").Duplicate(); - balloflight.GetDescendant().displayPath.assetPath = new Il2CppAssets.Scripts.Utils.PrefabReference() { guidRef = "d48587764ad63c84ea37e82f58bd05ad" }; + balloflight.GetDescendant().displayPath.assetPath = new Il2CppNinjaKiwi.Common.ResourceUtils.PrefabReference() { guidRef = "d48587764ad63c84ea37e82f58bd05ad" }; balloflight.GetDescendant().dontUseTowerPosition = true; //balloflight.GetDescendant().displayPath.assetPath = new Assets.Scripts.Utils.PrefabReference() { guidRef = "d48587764ad63c84ea37e82f58bd05ad" }; balloflight.GetAttackModel().weapons[0].AddBehavior(new FireFromAirUnitModel("fire")); diff --git a/Upgrades/TopPath/Bomber.cs b/Upgrades/TopPath/Bomber.cs index ba8bcb2..a5991d4 100644 --- a/Upgrades/TopPath/Bomber.cs +++ b/Upgrades/TopPath/Bomber.cs @@ -18,7 +18,7 @@ public override void ApplyUpgrade(TowerModel towerModel) var bombbehavior = Game.instance.model.GetTowerFromId("MonkeyAce-030").GetAttackModel(1).Duplicate(); var attackairunitmodel = towerModel.GetBehavior(); var bomb = bombbehavior.weapons[0]; - bomb.projectile.AddBehavior(new DamageModel("dummy", 0, 0, false, false, false, BloonProperties.None, BloonProperties.None)); + bomb.projectile.AddBehavior(new DamageModel("dummy", 0, 0, false, false, false, BloonProperties.None, BloonProperties.None, false)); bomb.projectile.GetDamageModel().CapDamage(0); bomb.RemoveBehavior(); var emissionovertimemodel = Game.instance.model.GetTowerFromId("MonkeyAce-030").GetAttackModel(1).weapons[0].emission.Duplicate(); diff --git a/Upgrades/TopPath/Devastator.cs b/Upgrades/TopPath/Devastator.cs index f6e5a69..72ec8e7 100644 --- a/Upgrades/TopPath/Devastator.cs +++ b/Upgrades/TopPath/Devastator.cs @@ -19,9 +19,9 @@ public override void ApplyUpgrade(TowerModel towerModel) var attackairunitmodel = towerModel.GetBehavior(); var mortar500 = Game.instance.model.GetTowerFromId("MortarMonkey-500").Duplicate(); var bomb = bombbehavior.weapons[0]; - bomb.projectile.AddBehavior(new DamageModel("dummy", 0, 0, false, false, false, BloonProperties.None, BloonProperties.None)); + bomb.projectile.AddBehavior(new DamageModel("dummy", 0, 0, false, false, false, BloonProperties.None, BloonProperties.None, false)); bomb.projectile.GetDamageModel().CapDamage(0); - bomb.projectile.GetBehavior().effectModel.assetId = new Il2CppAssets.Scripts.Utils.PrefabReference() { guidRef = "b1324f2f4c3809643b7ef1d8c112442a" }; + bomb.projectile.GetBehavior().effectModel.assetId = new Il2CppNinjaKiwi.Common.ResourceUtils.PrefabReference() { guidRef = "b1324f2f4c3809643b7ef1d8c112442a" }; bomb.projectile.GetBehavior().effectModel.scale = .6f; bomb.RemoveBehavior(); diff --git a/Upgrades/TopPath/Heavy Bomber.cs b/Upgrades/TopPath/Heavy Bomber.cs index 765f048..2461b6c 100644 --- a/Upgrades/TopPath/Heavy Bomber.cs +++ b/Upgrades/TopPath/Heavy Bomber.cs @@ -17,7 +17,7 @@ public override void ApplyUpgrade(TowerModel towerModel) { var bombbehavior = Game.instance.model.GetTowerFromId("MonkeyAce-030").GetAttackModel(1).Duplicate(); var bomb = bombbehavior.weapons[0]; - bomb.projectile.AddBehavior(new DamageModel("dummy", 0, 0, false, false, false, BloonProperties.None, BloonProperties.None)); + bomb.projectile.AddBehavior(new DamageModel("dummy", 0, 0, false, false, false, BloonProperties.None, BloonProperties.None, false)); bomb.projectile.GetDamageModel().CapDamage(0); bomb.RemoveBehavior(); bomb.emission = new SingleEmmisionTowardsTargetModel("targetbloons", null, 0); diff --git a/Upgrades/TopPath/Mobile Reconnaissance.cs b/Upgrades/TopPath/Mobile Reconnaissance.cs index e8e9823..3b6ef21 100644 --- a/Upgrades/TopPath/Mobile Reconnaissance.cs +++ b/Upgrades/TopPath/Mobile Reconnaissance.cs @@ -20,9 +20,9 @@ public override void ApplyUpgrade(TowerModel towerModel) var decamo = Game.instance.model.GetTower(TowerType.WizardMonkey, 0, 0, 3).GetAttackModel(1).Duplicate(); decamo.weapons[0].behaviors = new Il2CppReferenceArray(new WeaponBehaviorModel[] {firefromairunitmodel}); decamo.weapons[0].rate = .6f; - decamo.weapons[0].projectile.display = new Il2CppAssets.Scripts.Utils.PrefabReference() { guidRef = "" }; + decamo.weapons[0].projectile.display = new Il2CppNinjaKiwi.Common.ResourceUtils.PrefabReference() { guidRef = "" }; decamo.weapons[0].projectile.radius = 50; - decamo.weapons[0].projectile.AddBehavior(new DamageModel("", 0, 0, false, false, false, BloonProperties.None, BloonProperties.None)); + decamo.weapons[0].projectile.AddBehavior(new DamageModel("", 0, 0, false, false, false, BloonProperties.None, BloonProperties.None, false)); attackairunitmodel.AddBehavior(decamo); attackairunitmodel.addsToSharedGrid = true; towerModel.GetBehavior().display = CreatePrefabReference();