public static void MortarEmpowerment(TowerModel towerModel) { var sniper = Game.instance.model.GetTowerFromId(SniperMonkey); var attackModel = towerModel.GetAttackModel(); foreach (var sniperTargetType in sniper.targetTypes) { towerModel.targetTypes.Add(sniperTargetType); } var targetSelectedPointModel = attackModel.GetBehavior <TargetSelectedPointModel>(); attackModel.RemoveBehavior <TargetSelectedPointModel>(); attackModel.targetProvider = null; attackModel.AddBehavior(sniper.GetAttackModel().GetBehavior <TargetFirstModel>().Duplicate()); attackModel.AddBehavior(sniper.GetAttackModel().GetBehavior <TargetLastModel>().Duplicate()); attackModel.AddBehavior(sniper.GetAttackModel().GetBehavior <TargetCloseModel>().Duplicate()); attackModel.AddBehavior(sniper.GetAttackModel().GetBehavior <TargetStrongModel>().Duplicate()); attackModel.AddBehavior(targetSelectedPointModel); towerModel.towerSelectionMenuThemeId = "ActionButton"; /*var ageModel = towerModel.GetWeapon().projectile.GetBehavior<AgeModel>(); * if (ageModel != null) * { * ageModel.Lifespan /= 2; * }*/ }
public static void Dreadnought(TowerModel model) { var attackModel = model.GetAttackModel(); var flameGrape = Game.instance.model.GetTower(MonkeyBuccaneer, 0, 2, 0).GetWeapons()[3] .projectile; foreach (var projectileModel in attackModel.GetAllProjectiles()) { if (projectileModel.name.Contains("Explosion") || projectileModel.GetDamageModel() == null) { continue; } projectileModel.collisionPasses = flameGrape.collisionPasses; projectileModel.AddBehavior(flameGrape.GetBehavior <AddBehaviorToBloonModel>().Duplicate()); if (model.appliedUpgrades.Contains("Buccaneer-Hot Shot")) { projectileModel.GetBehavior <AddBehaviorToBloonModel>().GetBehavior <DamageOverTimeModel>() .triggerImmediate = true; projectileModel.scale = .5f; } else { projectileModel.scale = .75f; } projectileModel.display = "c840e245a0b1deb4284cfc3f953e16cf"; projectileModel.GetDamageModel().damageTypes = new Il2CppStringArray(new[] { "Normal" }); } }
public static void DoubleRanga(TowerModel model) { var weaponModel = model.GetAttackModel().weapons[0]; var random = new RandomArcEmissionModel("RandomArcEmissionModel_", 2, 0, 0, 30, 1, null); var eM = new ArcEmissionModel("ArcEmissionModel_", 2, 0, 30, null, false, false); weaponModel.emission = eM; }
public static void TackAttack(TowerModel model) { model.GetAttackModel().fireWithoutTarget = true; foreach (var projectileModel in model.GetAllProjectiles()) { var tsm = projectileModel.GetBehavior <TravelStraitModel>(); if (tsm != null) { tsm.Lifespan *= 1.5f; } } if (model.appliedUpgrades.Contains("Ring of Fire")) { model.range *= 1.5f; } }
public static void DartlingEmpowerment(TowerModel towerModel) { if (towerModel.appliedUpgrades.Contains("Bloon Area Denial System")) { return; } var sniper = Game.instance.model.GetTowerFromId(SniperMonkey); var attackModel = towerModel.GetAttackModel(); foreach (var sniperTargetType in sniper.targetTypes) { towerModel.targetTypes.Add(sniperTargetType); } attackModel.AddBehavior(sniper.GetAttackModel().GetBehavior <RotateToTargetModel>().Duplicate()); var targetPointerModel = attackModel.GetBehavior <TargetPointerModel>(); var targetSelectedPointModel = attackModel.GetBehavior <TargetSelectedPointModel>(); attackModel.RemoveBehavior <TargetPointerModel>(); attackModel.RemoveBehavior <TargetSelectedPointModel>(); attackModel.AddBehavior(sniper.GetAttackModel().GetBehavior <TargetFirstModel>().Duplicate()); attackModel.AddBehavior(sniper.GetAttackModel().GetBehavior <TargetLastModel>().Duplicate()); attackModel.AddBehavior(sniper.GetAttackModel().GetBehavior <TargetCloseModel>().Duplicate()); attackModel.AddBehavior(sniper.GetAttackModel().GetBehavior <TargetStrongModel>().Duplicate()); attackModel.AddBehavior(targetPointerModel); attackModel.AddBehavior(targetSelectedPointModel); if (towerModel.appliedUpgrades.Contains("Faster Swivel")) { var travelStraitModel = attackModel.weapons[0].projectile.GetBehavior <TravelStraitModel>(); if (travelStraitModel != null) { travelStraitModel.Speed *= 47f / 35f; } } }
public static void ShadowDouble(TowerModel model) { var attackModel = model.GetAttackModel(); var weapon = attackModel.weapons[0]; var newWeapon = weapon.Duplicate(); weapon.AddBehavior(new FireAlternateWeaponModel("FireAlternateWeaponModel_", 1)); newWeapon.AddBehavior(new FireWhenAlternateWeaponIsReadyModel("FireWhenAlternateWeaponIsReadyModel_", 1)); newWeapon.AddBehavior(new FilterTargetAngleFilterModel("FilterTargetAngleFilterModel_", 45.0f, 180f, true, 56)); var arcEmissionModel = newWeapon.emission.TryCast <ArcEmissionModel>(); if (arcEmissionModel != null) { newWeapon.emission.AddBehavior( new EmissionArcRotationOffTowerDirectionModel("EmissionArcRotationOffTowerDirectionModel_", 180)); } else { newWeapon.emission.AddBehavior( new EmissionRotationOffTowerDirectionModel("EmissionRotationOffTowerDirectionModel_", 180)); } newWeapon.name += " Secondary"; newWeapon.ejectX *= -1; var trackTargetWithinTimeModel = newWeapon.projectile.GetBehavior <TrackTargetWithinTimeModel>(); if (trackTargetWithinTimeModel != null) { trackTargetWithinTimeModel.name += "Behind"; } attackModel.AddWeapon(newWeapon); }
public static void SpikeEmpowerment(TowerModel towerModel) { var mortar = Game.instance.model.GetTowerFromId(MortarMonkey); towerModel.towerSelectionMenuThemeId = "MortarMonkey"; towerModel.targetTypes = new Il2CppReferenceArray <TargetType>(mortar.targetTypes); if (towerModel.targetTypes.Length > 1) { while (towerModel.targetTypes.Length > 1) { towerModel.targetTypes = towerModel.targetTypes.RemoveItemOfType <TargetType, TargetType>(); } towerModel.targetTypes[0].id = "TargetSelectedPoint"; towerModel.targetTypes[0].intID = -1; towerModel.targetTypes[0].actionOnCreate = true; towerModel.targetTypes[0].isActionable = true; } towerModel.GetAttackModel().RemoveBehavior <TargetTrackModel>(); towerModel.GetAttackModel().RemoveBehavior <SmartTargetTrackModel>(); towerModel.GetAttackModel().RemoveBehavior <CloseTargetTrackModel>(); towerModel.GetAttackModel().RemoveBehavior <FarTargetTrackModel>(); var targetSelectedPointModel = towerModel.GetAttackModel().GetBehavior <TargetSelectedPointModel>(); if (targetSelectedPointModel == null) { var tspm = new TargetSelectedPointModel("TargetSelectedPointModel_", true, false, "4e88dd78c6e800d41a6df5b02d592082", .5f, ""); towerModel.GetAttackModel().AddBehavior(tspm); } towerModel.UpdateTargetProviders(); towerModel.GetDescendant <ArriveAtTargetModel>().filterCollisionWhileMoving = false; }