diff --git a/Assets/Monkey Ace/Tier5 Ace Icon.png b/Assets/Monkey Ace/Tier5 Ace Icon.png index 4c9ac0c..2b2f447 100644 Binary files a/Assets/Monkey Ace/Tier5 Ace Icon.png and b/Assets/Monkey Ace/Tier5 Ace Icon.png differ diff --git a/Assets/Projectiles/BeastOrbBird.png b/Assets/Projectiles/BeastOrbBird.png new file mode 100644 index 0000000..97b41c8 Binary files /dev/null and b/Assets/Projectiles/BeastOrbBird.png differ diff --git a/Assets/Projectiles/BeastOrbDino.png b/Assets/Projectiles/BeastOrbDino.png new file mode 100644 index 0000000..39f561b Binary files /dev/null and b/Assets/Projectiles/BeastOrbDino.png differ diff --git a/Assets/Projectiles/BeastOrbFish.png b/Assets/Projectiles/BeastOrbFish.png new file mode 100644 index 0000000..4895a35 Binary files /dev/null and b/Assets/Projectiles/BeastOrbFish.png differ diff --git a/Assets/Projectiles/EnergyBeam.png b/Assets/Projectiles/EnergyBeam.png new file mode 100644 index 0000000..6192f61 Binary files /dev/null and b/Assets/Projectiles/EnergyBeam.png differ diff --git a/Assets/Projectiles/GhostBall.png b/Assets/Projectiles/GhostBall.png new file mode 100644 index 0000000..61df995 Binary files /dev/null and b/Assets/Projectiles/GhostBall.png differ diff --git a/Assets/Projectiles/LeadBall.png b/Assets/Projectiles/LeadBall.png new file mode 100644 index 0000000..6d03fd5 Binary files /dev/null and b/Assets/Projectiles/LeadBall.png differ diff --git a/Assets/Projectiles/Projectiles.cs b/Assets/Projectiles/Projectiles.cs index 96a962a..67d3574 100644 --- a/Assets/Projectiles/Projectiles.cs +++ b/Assets/Projectiles/Projectiles.cs @@ -94,6 +94,46 @@ public override void ModifyDisplayNode(UnityDisplayNode node) } } + public class LeadBall : ModDisplay + { + public override string BaseDisplay => Generic2dDisplay; + + public override void ModifyDisplayNode(UnityDisplayNode node) + { + Set2DTexture(node, Name); + } + } + + public class GhostBall : ModDisplay + { + public override string BaseDisplay => Generic2dDisplay; + + public override void ModifyDisplayNode(UnityDisplayNode node) + { + Set2DTexture(node, Name); + } + } + + public class T4SouldOrb : ModDisplay + { + public override string BaseDisplay => Generic2dDisplay; + + public override void ModifyDisplayNode(UnityDisplayNode node) + { + Set2DTexture(node, Name); + } + } + + public class T5SouldOrb : ModDisplay + { + public override string BaseDisplay => Generic2dDisplay; + + public override void ModifyDisplayNode(UnityDisplayNode node) + { + Set2DTexture(node, Name); + } + } + public class Laser : ModDisplay { public override string BaseDisplay => Generic2dDisplay; @@ -164,6 +204,36 @@ public override void ModifyDisplayNode(UnityDisplayNode node) } } + public class SpectralOrb : ModDisplay + { + public override string BaseDisplay => Generic2dDisplay; + + public override void ModifyDisplayNode(UnityDisplayNode node) + { + Set2DTexture(node, Name); + } + } + + public class SpectralShard : ModDisplay + { + public override string BaseDisplay => Generic2dDisplay; + + public override void ModifyDisplayNode(UnityDisplayNode node) + { + Set2DTexture(node, Name); + } + } + + public class EnergyBeam : ModDisplay + { + public override string BaseDisplay => Generic2dDisplay; + + public override void ModifyDisplayNode(UnityDisplayNode node) + { + Set2DTexture(node, Name); + } + } + public class ForceFields : ModDisplay { public override string BaseDisplay => Generic2dDisplay; @@ -193,4 +263,34 @@ public override void ModifyDisplayNode(UnityDisplayNode node) Set2DTexture(node, Name); } } + + public class BeastOrbFish : ModDisplay + { + public override string BaseDisplay => Generic2dDisplay; + + public override void ModifyDisplayNode(UnityDisplayNode node) + { + Set2DTexture(node, Name); + } + } + + public class BeastOrbDino : ModDisplay + { + public override string BaseDisplay => Generic2dDisplay; + + public override void ModifyDisplayNode(UnityDisplayNode node) + { + Set2DTexture(node, Name); + } + } + + public class BeastOrbBird : ModDisplay + { + public override string BaseDisplay => Generic2dDisplay; + + public override void ModifyDisplayNode(UnityDisplayNode node) + { + Set2DTexture(node, Name); + } + } } diff --git a/Assets/Projectiles/SpectralOrb.png b/Assets/Projectiles/SpectralOrb.png new file mode 100644 index 0000000..4a4e388 Binary files /dev/null and b/Assets/Projectiles/SpectralOrb.png differ diff --git a/Assets/Projectiles/SpectralShard.png b/Assets/Projectiles/SpectralShard.png new file mode 100644 index 0000000..d3454e3 Binary files /dev/null and b/Assets/Projectiles/SpectralShard.png differ diff --git a/Assets/Projectiles/T4SouldOrb.png b/Assets/Projectiles/T4SouldOrb.png new file mode 100644 index 0000000..5b40af6 Binary files /dev/null and b/Assets/Projectiles/T4SouldOrb.png differ diff --git a/Assets/Projectiles/T5SouldOrb.png b/Assets/Projectiles/T5SouldOrb.png new file mode 100644 index 0000000..cb85202 Binary files /dev/null and b/Assets/Projectiles/T5SouldOrb.png differ diff --git a/Main.cs b/Main.cs index b8522df..37b095f 100644 --- a/Main.cs +++ b/Main.cs @@ -11,13 +11,9 @@ namespace AlternatePaths; public class AlternatePaths : BloonsTD6Mod { - //foreach (var behavior in Game.instance.model.GetTower(TowerType.BananaFarm, 0, 0, 5).behaviors) - //{ - // ModHelper.Msg(behavior.TypeName()); - //} } -public class DartMonkeyAltPath : PathPlusPlus + public class DartMonkeyAltPath : PathPlusPlus { public override string Tower => TowerType.DartMonkey; public override int UpgradeCount => 5; diff --git a/ModHelperData.cs b/ModHelperData.cs index 47fe093..4fe6f60 100644 --- a/ModHelperData.cs +++ b/ModHelperData.cs @@ -2,12 +2,12 @@ public static class ModHelperData { - public const string WorksOnVersion = "41.3"; - public const string Version = "1.2.1"; + public const string WorksOnVersion = "42.0"; + public const string Version = "1.2.2"; public const string Name = "4th Path Overhaul"; public const string Author = "LynxC"; - public const string Description = "Adds a 4th upgrade path to every tower in the game. 10 towers currently available - " + + public const string Description = "Adds a 4th upgrade path to every tower in the game. 16 towers currently available - " + "Dart Monkey, Boomerang Monkey, Bomb Shooter, Tack Shooter, Ice Monkey, Glue Gunner, Sniper Monkey, Monkey Sub, Monkey Ace, Heli Pilot, Dartling Gunner, Wizard, Ninja, Banana Farm, Spike Factory, and Engineer."; public const string Dependencies = "doombubbles/paths-plus-plus"; diff --git a/Towers/Ninja.cs b/Towers/Magic/Ninja.cs similarity index 100% rename from Towers/Ninja.cs rename to Towers/Magic/Ninja.cs diff --git a/Towers/Wizard.cs b/Towers/Magic/Wizard.cs similarity index 93% rename from Towers/Wizard.cs rename to Towers/Magic/Wizard.cs index bec10aa..1935108 100644 --- a/Towers/Wizard.cs +++ b/Towers/Magic/Wizard.cs @@ -8,6 +8,8 @@ using Il2CppAssets.Scripts.Models.Towers.Behaviors.Emissions; using PathsPlusPlus; using AlternatePaths; +using BTD_Mod_Helper.Api.Enums; +using Il2CppAssets.Scripts.Models.Towers.Filters; namespace Wizard; @@ -101,11 +103,14 @@ public override void ApplyUpgrade(TowerModel towerModel, int tier) lightning.animation = 1; lightning.projectile.GetDamageModel().immuneBloonProperties = BloonProperties.None; + if (towerModel.appliedUpgrades.Contains(UpgradeType.MonkeySense)) + { + lightning.projectile.GetDescendants().ForEach(model => model.isActive = false); + } + towerModel.GetAttackModel().AddWeapon(lightning); towerModel.GetAttackModel().weapons[0].rate /= 1.8f; - - towerModel.GetAttackModel().weapons[0].projectile.GetDamageModel().damage += 3; towerModel.GetAttackModel().weapons[0].projectile.pierce += 4; } diff --git a/Towers/Dartling.cs b/Towers/Military/Dartling.cs similarity index 100% rename from Towers/Dartling.cs rename to Towers/Military/Dartling.cs diff --git a/Towers/Heli.cs b/Towers/Military/Heli.cs similarity index 100% rename from Towers/Heli.cs rename to Towers/Military/Heli.cs diff --git a/Towers/MonkeyAce.cs b/Towers/Military/MonkeyAce.cs similarity index 96% rename from Towers/MonkeyAce.cs rename to Towers/Military/MonkeyAce.cs index ffc0458..2605814 100644 --- a/Towers/MonkeyAce.cs +++ b/Towers/Military/MonkeyAce.cs @@ -185,8 +185,8 @@ public override void ApplyUpgrade(TowerModel towerModel, int tier) } - var carrier = Game.instance.model.GetTower(TowerType.MonkeyBuccaneer, 4).GetAttackModel(1).Duplicate(); - var plane = Game.instance.model.GetTowerFromId("BuccaneerGreaterPlane").Duplicate(); + var carrier = Game.instance.model.GetTower(TowerType.MonkeyBuccaneer, 5).GetAttackModel(1).Duplicate(); + var plane = carrier.weapons[0].projectile.GetBehavior().tower; var gatling = Game.instance.model.GetTower(TowerType.HeliPilot, 4).GetAttackModel().weapons[2].Duplicate(); plane.GetBehavior().parentTowerUpgradeTier = 5; @@ -215,11 +215,8 @@ public override void ApplyUpgrade(TowerModel towerModel, int tier) plane.GetAttackModel(1).AddWeapon(gatling); - plane.baseId = "BuccaneerLesserPlane"; - carrier.weapons[0].GetBehavior().baseSubTowerId = "BuccaneerLesserPlane"; carrier.weapons[0].GetBehavior().maxNumberOfSubTowers = 2; - carrier.weapons[0].projectile.GetBehavior().tower = plane; towerModel.AddBehavior(carrier); } } \ No newline at end of file diff --git a/Towers/MonkeySub.cs b/Towers/Military/MonkeySub.cs similarity index 96% rename from Towers/MonkeySub.cs rename to Towers/Military/MonkeySub.cs index e6ab8d7..5632860 100644 --- a/Towers/MonkeySub.cs +++ b/Towers/Military/MonkeySub.cs @@ -6,6 +6,8 @@ using PathsPlusPlus; using AlternatePaths; using Il2CppAssets.Scripts.Models.Towers.Behaviors.Emissions; +using BTD_Mod_Helper.Api.Enums; +using Il2CppAssets.Scripts.Models.Towers.Filters; namespace MonketSub; @@ -43,6 +45,11 @@ public override void ApplyUpgrade(TowerModel towerModel, int tier) torpedo.projectile.scale /= 1.65f; torpedo.name = "Torpedo"; + if (towerModel.appliedUpgrades.Contains(UpgradeType.AdvancedIntel)) + { + torpedo.GetDescendants().ForEach(model => model.isActive = false); + } + towerModel.GetAttackModel().AddWeapon(torpedo); } } diff --git a/Towers/Sniper.cs b/Towers/Military/Sniper.cs similarity index 96% rename from Towers/Sniper.cs rename to Towers/Military/Sniper.cs index 583525a..d0001e1 100644 --- a/Towers/Sniper.cs +++ b/Towers/Military/Sniper.cs @@ -120,12 +120,18 @@ public override void ApplyUpgrade(TowerModel towerModel, int tier) var shrapnel = Game.instance.model.GetTower(TowerType.TackShooter).GetAttackModel().weapons[0].projectile.Duplicate(); shrapnel.pierce = 3; shrapnel.GetBehavior().Lifespan *= 1.5f; - shrapnel.GetDescendants().ForEach(model => model.isActive = false); + + + if (towerModel.appliedUpgrades.Contains(UpgradeType.NightVisionGoggles)) + { + shrapnel.GetDescendants().ForEach(model => model.isActive = false); + } if (towerModel.appliedUpgrades.Contains(UpgradeType.FullMetalJacket)) { shrapnel.GetDamageModel().immuneBloonProperties = BloonProperties.None; } + if (towerModel.appliedUpgrades.Contains(UpgradeType.ShrapnelShot)) { shrapnel.GetDamageModel().damage = 3; @@ -169,20 +175,17 @@ public override void ApplyUpgrade(TowerModel towerModel, int tier) rocket.rate = Game.instance.model.GetTower(TowerType.SniperMonkey).GetAttackModel().weapons[0].rate; rocket.projectile.GetBehavior().Lifespan *= 3; rocket.projectile.GetBehavior().Speed /= 1.45f; - rocket.projectile.GetDescendants().ForEach(model => model.isActive = false); var shrapnel = Game.instance.model.GetTower(TowerType.TackShooter).GetAttackModel().weapons[0].projectile.Duplicate(); shrapnel.GetBehavior().Speed *= 1.5f; shrapnel.GetBehavior().Lifespan *= 1.75f; - shrapnel.GetDescendants().ForEach(model => model.isActive = false); var blast = rocket.projectile.GetBehavior().projectile; blast.GetDamageModel().damage = 7; blast.radius = 30; blast.pierce = 65; - blast.GetDescendants().ForEach(model => model.isActive = false); blast.GetDamageModel().immuneBloonProperties = BloonProperties.None; @@ -190,6 +193,13 @@ public override void ApplyUpgrade(TowerModel towerModel, int tier) explosion.scale *= 3f; + if (towerModel.appliedUpgrades.Contains(UpgradeType.NightVisionGoggles)) + { + rocket.projectile.GetDescendants().ForEach(model => model.isActive = false); + shrapnel.GetDescendants().ForEach(model => model.isActive = false); + blast.GetDescendants().ForEach(model => model.isActive = false); + } + if (towerModel.appliedUpgrades.Contains(UpgradeType.FullMetalJacket)) { blast.GetDamageModel().damage += 1; diff --git a/Towers/BombShotter.cs b/Towers/Primary/BombShotter.cs similarity index 100% rename from Towers/BombShotter.cs rename to Towers/Primary/BombShotter.cs diff --git a/Towers/Boomerang.cs b/Towers/Primary/Boomerang.cs similarity index 94% rename from Towers/Boomerang.cs rename to Towers/Primary/Boomerang.cs index 14e326b..a891beb 100644 --- a/Towers/Boomerang.cs +++ b/Towers/Primary/Boomerang.cs @@ -13,6 +13,7 @@ using AlternatePaths.Displays.Projectiles; using System.Linq; using Il2CppAssets.Scripts.Models.Towers.Weapons.Behaviors; +using Il2Cpp; namespace Boomerang; @@ -24,17 +25,14 @@ public class CamoTraining : UpgradePlusPlus public override string Portrait => "Tier1 Boomerang"; public override string DisplayName => "Camo Training"; - public override string Description => "Can now hit and deal additional damage to Camo Bloons."; + public override string Description => "Can now hit and boomerangs deal additional damage to Camo Bloons."; public override void ApplyUpgrade(TowerModel towerModel, int tier) { towerModel.GetDescendants().ForEach(model => model.isActive = false); - foreach (var weaponModel in towerModel.GetDescendants().ToArray()) - { - weaponModel.projectile.hasDamageModifiers = true; - weaponModel.projectile.AddBehavior(new DamageModifierForTagModel("aaa", "Camo", 1, 1, false, false) { name = "CamoModifier_" }); - } + towerModel.GetAttackModel().weapons[0].projectile.hasDamageModifiers = true; + towerModel.GetAttackModel().weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("aaa", "Camo", 1, 1, false, false) { name = "CamoModifier_" }); } } @@ -138,6 +136,7 @@ public override void ApplyUpgrade(TowerModel towerModel, int tier) foreach (var weaponModel in towerModel.GetDescendants().ToArray()) { weaponModel.projectile.GetDamageModel().damage += 4; + weaponModel.projectile.GetDamageModel().immuneBloonProperties = BloonProperties.None; weaponModel.projectile.GetBehavior().GetBehavior().interval *= .5f; weaponModel.projectile.GetBehavior().GetBehavior().damage += 5; weaponModel.projectile.GetBehavior().lifespan *= 2; diff --git a/Towers/DartMonkey.cs b/Towers/Primary/DartMonkey.cs similarity index 68% rename from Towers/DartMonkey.cs rename to Towers/Primary/DartMonkey.cs index 7eb16a6..823f6b9 100644 --- a/Towers/DartMonkey.cs +++ b/Towers/Primary/DartMonkey.cs @@ -1,10 +1,7 @@ using BTD_Mod_Helper.Extensions; using Il2CppAssets.Scripts.Models.Towers; using Il2CppAssets.Scripts.Models.Towers.Projectiles.Behaviors; -using Il2CppAssets.Scripts.Models.Towers.Weapons; using Il2CppAssets.Scripts.Unity; -using Il2CppSystem.Linq; -using System.Linq; using Il2Cpp; using BTD_Mod_Helper.Api.Enums; using Il2CppAssets.Scripts.Models.Towers.Filters; @@ -21,14 +18,11 @@ public class BloontoniumDarts : UpgradePlusPlus public override string Portrait => "Tier1 Dart"; public override string DisplayName => "Bloontonium Darts"; - public override string Description => "Darts gain the ability to pop Lead Bloons. Spike-o-Pult gains increased damage."; + public override string Description => "Darts can now pop all Bloon types. Spike-o-Pult gains increased damage."; public override void ApplyUpgrade(TowerModel towerModel, int tier) { - foreach (var damageModel in towerModel.GetDescendants().ToArray()) - { - damageModel.immuneBloonProperties = BloonProperties.None; - } + towerModel.GetAttackModel().weapons[0].projectile.GetDamageModel().immuneBloonProperties = BloonProperties.None; if (towerModel.appliedUpgrades.Contains(UpgradeType.SpikeOPult)) { @@ -45,7 +39,7 @@ public class RubberSeeking : UpgradePlusPlus public override string Portrait => "Tier2 Dart"; public override string DisplayName => "Rubber Seeking Darts"; - public override string Description => "Darts can now seek out Bloons."; + public override string Description => "Darts now seek out Bloons."; public override void ApplyUpgrade(TowerModel towerModel, int tier) { @@ -55,12 +49,9 @@ public override void ApplyUpgrade(TowerModel towerModel, int tier) seeking.constantlyAquireNewTarget = true; - foreach (var weaponModel in towerModel.GetDescendants().ToArray()) - { - weaponModel.projectile.AddBehavior(seeking); - weaponModel.projectile.GetBehavior().Lifespan *= 4; - weaponModel.projectile.pierce += 1; - } + towerModel.GetAttackModel().weapons[0].projectile.AddBehavior(seeking); + towerModel.GetAttackModel().weapons[0].projectile.GetBehavior().Lifespan *= 4; + towerModel.GetAttackModel().weapons[0].projectile.pierce += 1; } } @@ -79,22 +70,8 @@ public override void ApplyUpgrade(TowerModel towerModel, int tier) towerModel.range += 5; towerModel.GetAttackModel().range += 5; - foreach (var weaponModel in towerModel.GetDescendants().ToArray()) - { - weaponModel.rate /= 1.4f; - } - - foreach (var damageModel in towerModel.GetDescendants().ToArray()) - { - damageModel.damage += 1; - } - - - //if (IsHighestUpgrade(towerModel)) - //{ - //towerModel.display = towerModel.GetBehavior().display = - //Game.instance.model.GetTower(TowerType.SniperMonkey, 0, 0, 3).display; - //} + towerModel.GetAttackModel().weapons[0].rate /= 1.4f; + towerModel.GetAttackModel().weapons[0].projectile.GetDamageModel().damage += 1; } } @@ -110,21 +87,14 @@ public class Rifleman : UpgradePlusPlus public override void ApplyUpgrade(TowerModel towerModel, int tier) { - var damage = new DamageModifierForTagModel("aaa", "Ceramic", 1, 3, false, false) { name = "CeramicModifier_" }; - - towerModel.GetAttackModel().weapons[0].projectile.hasDamageModifiers = true; - towerModel.range += 8; towerModel.GetAttackModel().range += 8; - foreach (var weaponModel in towerModel.GetDescendants().ToArray()) - { - weaponModel.rate /= 4; + towerModel.GetAttackModel().weapons[0].rate /= 4; + towerModel.GetAttackModel().weapons[0].projectile.pierce += 2; - weaponModel.projectile.AddBehavior(damage); - weaponModel.projectile.collisionPasses = new int[] { -1, 0, 1 }; - weaponModel.projectile.pierce += 2; - } + towerModel.GetAttackModel().weapons[0].projectile.hasDamageModifiers = true; + towerModel.GetAttackModel().weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("aaa", "Ceramic", 1, 3, false, false) { name = "CeramicModifier_" }); } } @@ -152,23 +122,19 @@ public override void ApplyUpgrade(TowerModel towerModel, int tier) var missileWeapon = Game.instance.model.GetTower(TowerType.BombShooter, 1, 2).GetAttackModel().weapons[0].Duplicate(); missileWeapon.rate = Game.instance.model.GetTower(TowerType.DartMonkey).GetAttackModel().weapons[0].rate; missileWeapon.projectile.display = Game.instance.model.GetTower(TowerType.DartlingGunner, 0, 3).GetAttackModel().weapons[0].projectile.display; - missileWeapon.projectile.GetDescendants().ForEach(model => model.isActive = false); + if (towerModel.appliedUpgrades.Contains(UpgradeType.EnhancedEyesight)) + { + missileWeapon.projectile.GetDescendants().ForEach(model => model.isActive = false); + missileWeapon.projectile.GetBehavior().projectile.GetDescendants().ForEach(model => model.isActive = false); + } var missile = missileWeapon.projectile.GetBehavior().projectile; missile.GetDamageModel().damage = 8; missile.hasDamageModifiers = true; missile.AddBehavior(new DamageModifierForTagModel("aaa", "Moabs", 1, 56, false, false) { name = "MoabModifier_" }); - missile.GetDescendants().ForEach(model => model.isActive = false); missile.GetDamageModel().immuneBloonProperties = BloonProperties.None; towerModel.GetAttackModel().AddWeapon(missileWeapon); - - - //var ability = Game.instance.model.GetTower(TowerType.BombShooter, 0, 5).GetAbility(); - //ability.description = "Fires a powerful warhead at the strongest MOAB-class Bloon on screen."; - //ability.Cooldown += 8; - - //towerModel.AddBehavior(ability); } } \ No newline at end of file diff --git a/Towers/GlueGunner.cs b/Towers/Primary/GlueGunner.cs similarity index 99% rename from Towers/GlueGunner.cs rename to Towers/Primary/GlueGunner.cs index 5266ff1..a14e927 100644 --- a/Towers/GlueGunner.cs +++ b/Towers/Primary/GlueGunner.cs @@ -62,6 +62,7 @@ public override void ApplyUpgrade(TowerModel towerModel, int tier) bomb.GetDamageModel().damage = 0; bomb.GetDamageModel().immuneBloonProperties = BloonProperties.None; + bomb.GetDescendants().ForEach(model => model.isActive = false); bomb.AddBehavior(Game.instance.model.GetTowerFromId("GlueGunner-100").GetAttackModel().weapons[0].projectile.GetBehavior().Duplicate()); bomb.collisionPasses = new int[] { -1, 0, 1 }; diff --git a/Towers/IceMonkey.cs b/Towers/Primary/IceMonkey.cs similarity index 100% rename from Towers/IceMonkey.cs rename to Towers/Primary/IceMonkey.cs diff --git a/Towers/Primary/TackShooter.cs b/Towers/Primary/TackShooter.cs new file mode 100644 index 0000000..b05fc51 --- /dev/null +++ b/Towers/Primary/TackShooter.cs @@ -0,0 +1,160 @@ +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Projectiles.Behaviors; +using Il2CppAssets.Scripts.Unity; +using Il2Cpp; +using BTD_Mod_Helper.Api.Enums; +using Il2CppAssets.Scripts.Models.Towers.Filters; +using Il2CppAssets.Scripts.Models.Towers.Behaviors.Emissions; +using PathsPlusPlus; +using AlternatePaths; + +namespace TackShooter; + +public class AdvancedSensors : UpgradePlusPlus +{ + public override int Cost => 120; + public override int Tier => 1; + public override string Icon => "Tier1 Tack Icon"; + public override string Portrait => "Tier1 Tack"; + + public override string DisplayName => "Advanced Sensors"; + public override string Description => "Tack Shooter can detect and pop Camo Bloons."; + + public override void ApplyUpgrade(TowerModel towerModel, int tier) + { + towerModel.GetDescendants().ForEach(model => model.isActive = false); + } +} + +public class Fletchette : UpgradePlusPlus +{ + public override int Cost => 320; + public override int Tier => 2; + public override string Icon => "Tier2 Tack Icon"; + public override string Portrait => "Tier2 Tack"; + + public override string DisplayName => "Fletchette Tacks"; + public override string Description => "Tacks now crack into 3 more tacks upon hitting a Bloon. Ring of Fire damage is increased."; + + public override void ApplyUpgrade(TowerModel towerModel, int tier) + { + var tack = Game.instance.model.GetTower(TowerType.TackShooter, 0).GetAttackModel().weapons[0].projectile.Duplicate(); + tack.GetDescendants().ForEach(model => model.isActive = false); + + if (towerModel.appliedUpgrades.Contains(UpgradeType.RingOfFire)) + { + towerModel.GetAttackModel().weapons[0].projectile.GetDamageModel().damage += 2; + } + else + { + towerModel.GetAttackModel().weapons[0].projectile.AddBehavior(new CreateProjectileOnContactModel("CreateProjectileOnContactModel_", tack, new ArcEmissionModel("ArcEmissionModel_", 3, 0, 25, null, true, false), true, false, false)); + } + } +} + +public class Firecrackers : UpgradePlusPlus +{ + public override int Cost => 750; + public override int Tier => 3; + public override string Icon => "Tier3 Tack Icon"; + public override string Portrait => "Tier3 Tack"; + + public override string DisplayName => "Firecracker Shooter"; + public override string Description => "Tack Shooter fires explosive firecrackers that pop into fragments."; + + public override void ApplyUpgrade(TowerModel towerModel, int tier) + { + var effect = Game.instance.model.GetTower(TowerType.MortarMonkey).GetAttackModel().weapons[0].projectile.GetBehavior().Duplicate(); + var sound = Game.instance.model.GetTower(TowerType.MortarMonkey).GetAttackModel().weapons[0].projectile.GetBehavior().Duplicate(); + var explosion = Game.instance.model.GetTower(TowerType.BombShooter).GetAttackModel().weapons[0].projectile.GetBehavior().projectile.Duplicate(); + var bombEffect = Game.instance.model.GetTower(TowerType.BombShooter).GetAttackModel().weapons[0].projectile.GetBehavior().effectModel.Duplicate(); + var fragment = Game.instance.model.GetTower(TowerType.TackShooter).GetAttackModel().weapons[0].projectile.Duplicate(); + + + effect.effectModel = bombEffect; + + fragment.GetDescendants().ForEach(model => model.isActive = false); + + explosion.GetDescendants().ForEach(model => model.isActive = false); + explosion.GetDamageModel().immuneBloonProperties = BloonProperties.None; + explosion.GetDamageModel().damage = 2; + + towerModel.GetAttackModel().weapons[0].projectile.display = Game.instance.model.GetTower(TowerType.BombShooter).GetAttackModel().weapons[0].projectile.display; + towerModel.GetAttackModel().weapons[0].projectile.GetBehavior().Lifespan = 0.2f; + towerModel.GetAttackModel().weapons[0].projectile.pierce = 999; + towerModel.GetAttackModel().weapons[0].projectile.GetDamageModel().damage -= 1; + towerModel.GetAttackModel().weapons[0].projectile.RemoveBehavior(); + towerModel.GetAttackModel().weapons[0].projectile.GetDamageModel().immuneBloonProperties = BloonProperties.None; + + towerModel.GetAttackModel().weapons[0].projectile.AddBehavior(new CreateProjectileOnExpireModel("Fragment", fragment, new ArcEmissionModel("FragmentEmmision_", 6, 0, 360, null, true, false), false)); + towerModel.GetAttackModel().weapons[0].projectile.AddBehavior(new CreateProjectileOnExpireModel("Explosion", explosion, new ArcEmissionModel("FragmentEmmision_", 1, 0, 0, null, true, false), false)); + towerModel.GetAttackModel().weapons[0].projectile.AddBehavior(effect); + towerModel.GetAttackModel().weapons[0].projectile.AddBehavior(sound); + } +} + +public class Fireworks : UpgradePlusPlus +{ + public override int Cost => 5600; + public override int Tier => 4; + public override string Icon => "Tier4 Tack Icon"; + public override string Portrait => "Tier4 Tack"; + + public override string DisplayName => "Fireworks"; + public override string Description => "Firecrackers are replaced with fireworks that branch into even more explosions."; + + public override void ApplyUpgrade(TowerModel towerModel, int tier) + { + foreach (var behavior in towerModel.GetAttackModel().weapons[0].projectile.GetBehaviors()) + { + if (behavior.name.Contains("Fragment")) + { + towerModel.GetAttackModel().weapons[0].projectile.RemoveBehavior(behavior); + } + } + + + var firework = towerModel.GetAttackModel().weapons[0].projectile.Duplicate(); + towerModel.GetAttackModel().weapons[0].projectile.AddBehavior(new CreateProjectileOnExpireModel("Firework", firework, new ArcEmissionModel("FragmentEmmision_", 8, 0, 360, null, true, false), false)); + } +} + +public class ExplosionKing : UpgradePlusPlus +{ + public override int Cost => 48000; + public override int Tier => 5; + public override string Icon => "Tier5 Tack Icon"; + public override string Portrait => "Tier5 Tack"; + + public override string DisplayName => "Explosion King"; + public override string Description => "Explosions that never give up."; + + public override void ApplyUpgrade(TowerModel towerModel, int tier) + { + towerModel.GetAttackModel().weapons[0].projectile.display = Game.instance.model.GetTower(TowerType.BombShooter, 3).GetAttackModel().weapons[0].projectile.display; + + foreach (var behavior in towerModel.GetAttackModel().weapons[0].projectile.GetBehaviors()) + { + if (behavior.name.Contains("Explosion")) + { + behavior.projectile.GetDamageModel().damage += 4; + } + + if (behavior.name.Contains("Firework")) + { + var firework = behavior.projectile.Duplicate(); + behavior.projectile.AddBehavior(new CreateProjectileOnExpireModel("Firework", firework, new ArcEmissionModel("FragmentEmmision_", 8, 0, 360, null, true, false), false)); + + + foreach (var fireworkBehavior in behavior.projectile.GetBehaviors()) + { + if (fireworkBehavior.name.Contains("Explosion")) + { + behavior.projectile.GetDamageModel().damage += 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/Towers/BananaFarm.cs b/Towers/Support/BananaFarm.cs similarity index 100% rename from Towers/BananaFarm.cs rename to Towers/Support/BananaFarm.cs diff --git a/Towers/Engineer.cs b/Towers/Support/Engineer.cs similarity index 95% rename from Towers/Engineer.cs rename to Towers/Support/Engineer.cs index a9c7a44..5d50c81 100644 --- a/Towers/Engineer.cs +++ b/Towers/Support/Engineer.cs @@ -31,16 +31,8 @@ public class TemperedNails : UpgradePlusPlus public override void ApplyUpgrade(TowerModel towerModel, int tier) { towerModel.GetAttackModel().weapons[0].projectile.hasDamageModifiers = true; - - foreach (var weaponModel in towerModel.GetDescendants().ToArray()) - { - weaponModel.projectile.AddBehavior(new DamageModifierForTagModel("aaa", "Ceramic", 1, 3, false, false) { name = "CeramicModifier_" }); - } - - foreach (var damageModel in towerModel.GetDescendants().ToArray()) - { - damageModel.immuneBloonProperties = BloonProperties.None; - } + towerModel.GetAttackModel().weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("aaa", "Ceramic", 1, 3, false, false) { name = "CeramicModifier_" }); + towerModel.GetAttackModel().weapons[0].projectile.GetDamageModel().immuneBloonProperties = BloonProperties.None; if (towerModel.appliedUpgrades.Contains(UpgradeType.SentryGun)) { @@ -71,9 +63,7 @@ public class BurstFire : UpgradePlusPlus public override void ApplyUpgrade(TowerModel towerModel, int tier) { - - towerModel.GetAttackModel().weapons[0].emission = new ArcEmissionModel("ArcEmissionModel_", 3, 0, 25, null, false, false); - + towerModel.GetAttackModel().weapons[0].emission = new ArcEmissionModel("ArcEmissionModel_", 3, 0, 25, null, false, false); } } diff --git a/Towers/Spactory.cs b/Towers/Support/Spactory.cs similarity index 100% rename from Towers/Spactory.cs rename to Towers/Support/Spactory.cs diff --git a/Towers/TackShooter.cs b/Towers/TackShooter.cs deleted file mode 100644 index b34e2f4..0000000 --- a/Towers/TackShooter.cs +++ /dev/null @@ -1,189 +0,0 @@ -using BTD_Mod_Helper.Extensions; -using Il2CppAssets.Scripts.Models.Towers; -using Il2CppAssets.Scripts.Models.Towers.Projectiles.Behaviors; -using Il2CppAssets.Scripts.Models.Towers.Weapons; -using Il2CppAssets.Scripts.Unity; -using Il2CppSystem.Linq; -using System.Linq; -using Il2Cpp; -using BTD_Mod_Helper.Api.Enums; -using Il2CppAssets.Scripts.Models.Towers.Filters; -using Il2CppAssets.Scripts.Models.Towers.Behaviors.Emissions; -using PathsPlusPlus; -using AlternatePaths; - -namespace TackShooter; - -public class AdvancedSensors : UpgradePlusPlus -{ - public override int Cost => 120; - public override int Tier => 1; - public override string Icon => "Tier1 Tack Icon"; - public override string Portrait => "Tier1 Tack"; - - public override string DisplayName => "Advanced Sensors"; - public override string Description => "Tack Shooter can detect and pop Camo Bloons."; - - public override void ApplyUpgrade(TowerModel towerModel, int tier) - { - foreach (var weaponModel in towerModel.GetDescendants().ToArray()) - { - towerModel.GetDescendants().ForEach(model => model.isActive = false); - } - } -} - -public class Fletchette : UpgradePlusPlus -{ - public override int Cost => 320; - public override int Tier => 2; - public override string Icon => "Tier2 Tack Icon"; - public override string Portrait => "Tier2 Tack"; - - public override string DisplayName => "Fletchette Tacks"; - public override string Description => "Tacks now crack into 3 more tacks upon hitting a Bloon. Ring of Fire damage is increased."; - - public override void ApplyUpgrade(TowerModel towerModel, int tier) - { - var tack = Game.instance.model.GetTower(TowerType.TackShooter, 0).GetAttackModel().weapons[0].projectile.Duplicate(); - - tack.GetDescendants().ForEach(model => model.isActive = false); - - if (towerModel.appliedUpgrades.Contains(UpgradeType.RingOfFire)) - { - towerModel.GetAttackModel().weapons[0].projectile.GetDamageModel().damage += 2; - } - else - { - foreach (var weaponModel in towerModel.GetDescendants().ToArray()) - { - weaponModel.projectile.AddBehavior(new CreateProjectileOnContactModel - ("CreateProjectileOnContactModel_", tack, new ArcEmissionModel("ArcEmissionModel_", 3, 0, 25, null, true, false), true, false, false)); - } - } - } -} - -public class Firecrackers : UpgradePlusPlus -{ - public override int Cost => 750; - public override int Tier => 3; - public override string Icon => "Tier3 Tack Icon"; - public override string Portrait => "Tier3 Tack"; - - public override string DisplayName => "Firecracker Shooter"; - public override string Description => "Tack Shooter fires explosive firecrackers that pop into fragments."; - - public override void ApplyUpgrade(TowerModel towerModel, int tier) - { - var firecracker = Game.instance.model.GetTower(TowerType.BombShooter).GetAttackModel().weapons[0].projectile.Duplicate(); - - towerModel.GetAttackModel().weapons[0].projectile = firecracker; - towerModel.GetAttackModel().weapons[0].projectile.GetBehavior().Lifespan = 0.2f; - - var fragment = Game.instance.model.GetTower(TowerType.TackShooter).GetAttackModel().weapons[0].projectile.Duplicate(); - fragment.GetDescendants().ForEach(model => model.isActive = false); - firecracker.GetDescendants().ForEach(model => model.isActive = false); - - firecracker.AddBehavior(new CreateProjectileOnContactModel("Fragment", fragment, new ArcEmissionModel("FragmentEmmision_", 6, 0, 360, null, true, false), true, false, false)); - - firecracker.AddBehavior(new CreateProjectileOnExpireModel("Fragment", fragment, new ArcEmissionModel("FragmentEmmision_", 6, 0, 360, null, true, false), false)); - - var boom = firecracker.GetBehavior().projectile; - boom.GetDescendants().ForEach(model => model.isActive = false); - boom.GetDamageModel().immuneBloonProperties = BloonProperties.None; - boom.GetDamageModel().damage = 2; - } -} - -public class Fireworks : UpgradePlusPlus -{ - public override int Cost => 4600; - public override int Tier => 4; - public override string Icon => "Tier4 Tack Icon"; - public override string Portrait => "Tier4 Tack"; - - public override string DisplayName => "Fireworks"; - public override string Description => "Firecrackers are replaced with fireworks that branch into even more explosions."; - - public override void ApplyUpgrade(TowerModel towerModel, int tier) - { - var firework = Game.instance.model.GetTower(TowerType.BombShooter).GetAttackModel().weapons[0].projectile.Duplicate(); - - towerModel.GetAttackModel().weapons[0].projectile = firework; - towerModel.GetAttackModel().weapons[0].projectile.GetBehavior().Lifespan = 0.2f; - - var cluster = Game.instance.model.GetTower(TowerType.BombShooter).GetAttackModel().weapons[0].projectile.Duplicate(); - cluster.GetDescendants().ForEach(model => model.isActive = false); - firework.GetDescendants().ForEach(model => model.isActive = false); - cluster.GetBehavior().Lifespan = 0.2f; - - var clusterBoom = cluster.GetBehavior().projectile; - clusterBoom.GetDamageModel().damage = 2; - clusterBoom.GetDescendants().ForEach(model => model.isActive = false); - clusterBoom.GetDamageModel().immuneBloonProperties = BloonProperties.None; - - firework.AddBehavior(new CreateProjectileOnContactModel("Fragment", cluster, new ArcEmissionModel("FragmentEmmision_", 8, 0, 360, null, true, false), true, false, false)); - - firework.AddBehavior(new CreateProjectileOnExpireModel("Fragment", cluster, new ArcEmissionModel("FragmentEmmision_", 8, 0, 360, null, true, false), false)); - - var boom = firework.GetBehavior().projectile; - boom.GetDescendants().ForEach(model => model.isActive = false); - boom.GetDamageModel().immuneBloonProperties = BloonProperties.None; - boom.GetDamageModel().damage = 3; - - cluster.AddBehavior(new CreateProjectileOnExpireModel("Blast", boom, new ArcEmissionModel("BlastEmmision_", 1, 0, 0, null, true, false), false)); - } -} - -public class ExplosionKing : UpgradePlusPlus -{ - public override int Cost => 48000; - public override int Tier => 5; - public override string Icon => "Tier5 Tack Icon"; - public override string Portrait => "Tier5 Tack"; - - public override string DisplayName => "Explosion King"; - public override string Description => "Explosions that never give up."; - - public override void ApplyUpgrade(TowerModel towerModel, int tier) - { -var superBomb = Game.instance.model.GetTower(TowerType.BombShooter, 3).GetAttackModel().weapons[0].projectile.Duplicate(); - - towerModel.GetAttackModel().weapons[0].projectile = superBomb; - towerModel.GetAttackModel().weapons[0].projectile.GetBehavior().Lifespan = 0.2f; - superBomb.GetDescendants().ForEach(model => model.isActive = false); - - var superBoom = superBomb.GetBehavior().projectile; - superBoom.GetDescendants().ForEach(model => model.isActive = false); - superBoom.GetDamageModel().immuneBloonProperties = BloonProperties.None; - superBoom.GetDamageModel().damage = 6; - - var superCluster = Game.instance.model.GetTower(TowerType.BombShooter, 1).GetAttackModel().weapons[0].projectile.Duplicate(); - superCluster.GetDescendants().ForEach(model => model.isActive = false); - superCluster.GetBehavior().Lifespan = 0.2f; - - var superClusterBoom = superCluster.GetBehavior().projectile; - superClusterBoom.GetDamageModel().damage = 4; - superClusterBoom.GetDescendants().ForEach(model => model.isActive = false); - superClusterBoom.GetDamageModel().immuneBloonProperties = BloonProperties.None; - - superBomb.AddBehavior(new CreateProjectileOnContactModel("Fragment", superCluster, new ArcEmissionModel("FragmentEmmision_", 8, 0, 360, null, true, false), true, false, false)); - superBomb.AddBehavior(new CreateProjectileOnExpireModel("Fragment", superCluster, new ArcEmissionModel("FragmentEmmision_", 8, 0, 360, null, true, false), false)); - - var smallCluster = Game.instance.model.GetTower(TowerType.BombShooter).GetAttackModel().weapons[0].projectile.Duplicate(); - smallCluster.GetDescendants().ForEach(model => model.isActive = false); - smallCluster.GetBehavior().Lifespan = 0.2f; - - var smallClusterBoom = smallCluster.GetBehavior().projectile; - smallClusterBoom.GetDamageModel().damage = 2; - smallClusterBoom.GetDescendants().ForEach(model => model.isActive = false); - smallClusterBoom.GetDamageModel().immuneBloonProperties = BloonProperties.None; - - superCluster.AddBehavior(new CreateProjectileOnContactModel("Fragment", smallCluster, new ArcEmissionModel("FragmentEmmision_", 8, 0, 360, null, true, false), true, false, false)); - superCluster.AddBehavior(new CreateProjectileOnExpireModel("Fragment", smallCluster, new ArcEmissionModel("FragmentEmmision_", 8, 0, 360, null, true, false), false)); - superCluster.AddBehavior(new CreateProjectileOnExpireModel("Blast", superClusterBoom, new ArcEmissionModel("BlastEmmision_", 1, 0, 0, null, true, false), false)); - - smallCluster.AddBehavior(new CreateProjectileOnExpireModel("Blast", smallClusterBoom, new ArcEmissionModel("BlastEmmision_", 1, 0, 0, null, true, false), false)); - } -} \ No newline at end of file