Skip to content

Commit

Permalink
Fix for latest version, yw snowzkitty
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkTerraYT committed Jul 10, 2024
1 parent c752105 commit aed5bdd
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 27 deletions.
11 changes: 5 additions & 6 deletions Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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");
}
Expand All @@ -64,7 +63,7 @@ public override void OnTowerUpgraded(Tower tower, string upgradeName, Il2CppAsse

if (tower.towerModel.name == "Eradicator")
{
var degree = tower.GetTowerBehavior<ParagonTower>().GetCurrentDegree();;
var degree = tower.GetTowerBehavior<ParagonTower>().GetCurrentDegree(); ;
foreach (var attackmodel in tower.towerModel.GetBehaviors<AttackAirUnitModel>())
{
foreach (var weapon in attackmodel.weapons)
Expand Down
3 changes: 2 additions & 1 deletion MonkeyAirship.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -59,6 +60,6 @@ public override int GetTowerIndex(List<TowerDetailsModel> 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);
}
}
8 changes: 4 additions & 4 deletions Upgrades/Bloonradicator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<LineProjectileEmissionModel>().displayPath.assetPath = new Il2CppAssets.Scripts.Utils.PrefabReference() { guidRef = "d48587764ad63c84ea37e82f58bd05ad" };
balloflight.GetDescendant<LineProjectileEmissionModel>().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);
Expand Down Expand Up @@ -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<LineProjectileEmissionModel>().displayPath.assetPath = new Il2CppAssets.Scripts.Utils.PrefabReference() { guidRef = "b9f3014db2da83f48b34e662e9a79910" };
strongairunitmodel.weapons[10].GetDescendant<LineProjectileEmissionModel>().displayPath.assetPath = new Il2CppNinjaKiwi.Common.ResourceUtils.PrefabReference() { guidRef = "b9f3014db2da83f48b34e662e9a79910" };
strongairunitmodel.AddWeapon(strongairunitmodel.weapons[10]);
strongairunitmodel.weapons[11].GetDescendant<LineProjectileEmissionModel>().useTargetAsEndPoint = false;

Expand Down Expand Up @@ -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<CreateEffectOnExhaustFractionModel>().effectModel.assetId = new Il2CppAssets.Scripts.Utils.PrefabReference() { guidRef = "b1324f2f4c3809643b7ef1d8c112442a" };
bomb.projectile.GetBehavior<CreateEffectOnExhaustFractionModel>().effectModel.assetId = new Il2CppNinjaKiwi.Common.ResourceUtils.PrefabReference() { guidRef = "b1324f2f4c3809643b7ef1d8c112442a" };
bomb.projectile.GetBehavior<CreateEffectOnExhaustFractionModel>().effectModel.scale = .8f;

bomb.RemoveBehavior<CheckAirUnitOverTrackModel>();
Expand Down Expand Up @@ -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<CreateTowerModel>().tower.Duplicate();
var strafe = plane.GetAttackModel(0).weapons[0];
var strafeprojectile = strafe.projectile;
var missile = plane.GetAttackModel(2).weapons[0];
Expand Down
4 changes: 2 additions & 2 deletions Upgrades/BottomPath/Carrier Airship.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public override void ApplyUpgrade(TowerModel towerModel)
var attackairunitmodel = towerModel.GetBehavior<AttackAirUnitModel>();
var firefromairunitmodel = attackairunitmodel.GetDescendant<FireFromAirUnitModel>();
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<CreateTowerModel>().tower.Duplicate();
var strafe = plane.GetAttackModel(0).weapons[0];
var strafeprojectile = strafe.projectile;
var missile = plane.GetAttackModel(2).weapons[0];
Expand Down Expand Up @@ -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<WeaponBehaviorModel>(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);
}
Expand Down
4 changes: 2 additions & 2 deletions Upgrades/BottomPath/Light Carrier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public override void ApplyUpgrade(TowerModel towerModel)
var attackairunitmodel = towerModel.GetBehavior<AttackAirUnitModel>();
var firefromairunitmodel = attackairunitmodel.GetDescendant<FireFromAirUnitModel>();
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<CreateTowerModel>().tower.Duplicate();
var strafe = plane.GetAttackModel(0).weapons[0];
var strafeprojectile = strafe.projectile;

Expand All @@ -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<WeaponBehaviorModel>(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);
}
Expand Down
2 changes: 1 addition & 1 deletion Upgrades/BottomPath/Ravager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public override void ApplyUpgrade(TowerModel towerModel)
var attackairunitmodel = towerModel.GetBehavior<AttackAirUnitModel>();
var firefromairunitmodel = attackairunitmodel.GetDescendant<FireFromAirUnitModel>();
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<CreateTowerModel>().tower.Duplicate();
var strafe = plane.GetAttackModel(0).weapons[0];
var strafeprojectile = strafe.projectile;
var missile = plane.GetAttackModel(2).weapons[0];
Expand Down
6 changes: 3 additions & 3 deletions Upgrades/MiddlePath/Annihilator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ public override void ApplyUpgrade(TowerModel towerModel)
var weaklaser = laserstrikeattack.Duplicate();
var displaylaser = laserstrikeattack.Duplicate();
displaylaser.GetDescendant<LineProjectileEmissionModel>().useTargetAsEndPoint = false;
weaklaser.GetDescendant<LineProjectileEmissionModel>().displayPath.assetPath = new Il2CppAssets.Scripts.Utils.PrefabReference() { guidRef = "d48587764ad63c84ea37e82f58bd05ad" };
weaklaser.GetDescendant<LineProjectileEmissionModel>().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<LineProjectileEmissionModel>().displayPath.assetPath = new Il2CppAssets.Scripts.Utils.PrefabReference() { guidRef = "b9f3014db2da83f48b34e662e9a79910" };
laserstrikeattack.GetDescendant<LineProjectileEmissionModel>().displayPath.assetPath = new Il2CppNinjaKiwi.Common.ResourceUtils.PrefabReference() { guidRef = "b9f3014db2da83f48b34e662e9a79910" };

laserstrike.attacks[0].weapons[0] = laserstrikeattack.GetAttackModel().weapons[0].Duplicate();
laserstrike.attacks[0].fireWithoutTarget = false;
Expand All @@ -88,7 +88,7 @@ public override void ApplyUpgrade(TowerModel towerModel)
foreach (var attackairunitmodel in towerModel.GetBehaviors<AttackAirUnitModel>())
{
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));
Expand Down
4 changes: 2 additions & 2 deletions Upgrades/MiddlePath/Laser Array.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ public override void ApplyUpgrade(TowerModel towerModel)
var lastairunitmodel = towerModel.GetBehavior<AttackAirUnitModel>().Duplicate();
var centerlaserairunitmodel = strongairunitmodel.Duplicate();
var closeairunitmodel = towerModel.GetBehaviors<AttackAirUnitModel>()[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<LineProjectileEmissionModel>().displayPath.assetPath = new Il2CppAssets.Scripts.Utils.PrefabReference() { guidRef = "d48587764ad63c84ea37e82f58bd05ad" };
balloflight.GetDescendant<LineProjectileEmissionModel>().displayPath.assetPath = new Il2CppNinjaKiwi.Common.ResourceUtils.PrefabReference() { guidRef = "d48587764ad63c84ea37e82f58bd05ad" };
balloflight.GetDescendant<LineProjectileEmissionModel>().dontUseTowerPosition = true;
//balloflight.GetDescendant<LineProjectileEmissionModel>().displayPath.assetPath = new Assets.Scripts.Utils.PrefabReference() { guidRef = "d48587764ad63c84ea37e82f58bd05ad" };
balloflight.GetAttackModel().weapons[0].AddBehavior(new FireFromAirUnitModel("fire"));
Expand Down
2 changes: 1 addition & 1 deletion Upgrades/TopPath/Bomber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<AttackAirUnitModel>();
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<CheckAirUnitOverTrackModel>();
var emissionovertimemodel = Game.instance.model.GetTowerFromId("MonkeyAce-030").GetAttackModel(1).weapons[0].emission.Duplicate();
Expand Down
4 changes: 2 additions & 2 deletions Upgrades/TopPath/Devastator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public override void ApplyUpgrade(TowerModel towerModel)
var attackairunitmodel = towerModel.GetBehavior<AttackAirUnitModel>();
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<CreateEffectOnExhaustFractionModel>().effectModel.assetId = new Il2CppAssets.Scripts.Utils.PrefabReference() { guidRef = "b1324f2f4c3809643b7ef1d8c112442a" };
bomb.projectile.GetBehavior<CreateEffectOnExhaustFractionModel>().effectModel.assetId = new Il2CppNinjaKiwi.Common.ResourceUtils.PrefabReference() { guidRef = "b1324f2f4c3809643b7ef1d8c112442a" };
bomb.projectile.GetBehavior<CreateEffectOnExhaustFractionModel>().effectModel.scale = .6f;

bomb.RemoveBehavior<CheckAirUnitOverTrackModel>();
Expand Down
2 changes: 1 addition & 1 deletion Upgrades/TopPath/Heavy Bomber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<CheckAirUnitOverTrackModel>();
bomb.emission = new SingleEmmisionTowardsTargetModel("targetbloons", null, 0);
Expand Down
4 changes: 2 additions & 2 deletions Upgrades/TopPath/Mobile Reconnaissance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<WeaponBehaviorModel>(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<AirUnitModel>().display = CreatePrefabReference<Display200>();
Expand Down

0 comments on commit aed5bdd

Please sign in to comment.