コード例 #1
0
        public static void PlasmaMonkeyFanClub(TowerModel model)
        {
            model.GetWeapon().rate *= 0.03f / .475f;
            model.range += 20;
            model.GetAttackModels()[0].range += 20;

            ProjectileModel plasmaModel =
                Game.instance.model.GetTower(SuperMonkey, 2, 0, 0).GetWeapon().projectile;

            foreach (var weaponProjectile in model.GetAllProjectiles())
            {
                if (weaponProjectile.display == null)
                {
                    continue;
                }
                weaponProjectile.display = plasmaModel.display;
                weaponProjectile.GetBehavior <DisplayModel>().display = plasmaModel.display;
                weaponProjectile.GetDamageModel().damage     += 2;
                weaponProjectile.GetDamageModel().damageTypes = new Il2CppStringArray(new[] { "Plasma" });
                weaponProjectile.pierce += 5;


                weaponProjectile.GetBehavior <TravelStraitModel>().lifespan       *= 2f;
                weaponProjectile.GetBehavior <TravelStraitModel>().lifespanFrames *= 2;
            }
        }
コード例 #2
0
 public static void BombBlitz(TowerModel model)
 {
     foreach (var projectileModel in model.GetAllProjectiles())
     {
         if (projectileModel.GetDamageModel() != null)
         {
             projectileModel.GetDamageModel().damage += 3;
         }
     }
 }
コード例 #3
0
 public static void BuccaneerMonkeyPirates(TowerModel model)
 {
     foreach (var projectileModel in model.GetAllProjectiles())
     {
         if (projectileModel.id == "Explosion")
         {
             projectileModel.AddBehavior(new DamageModifierForTagModel("MoabDamage", "Moabs", 1.0f, 20, false, false));
             projectileModel.AddBehavior(new DamageModifierForTagModel("MoabDamage", "Ceramic", 1.0f, 10, false, false));
         }
     }
 }
コード例 #4
0
        public static void IceFortress(TowerModel model)
        {
            var behavior = new RemoveBloonModifiersModel("RemoveBloonModifiersModel_", false, true, false, false, false,
                                                         new Il2CppStringArray(new string[0]));

            foreach (var projectileModel in model.GetAllProjectiles())
            {
                projectileModel.AddBehavior(behavior.Duplicate());
            }

            model.AddBehavior(new OverrideCamoDetectionModel("OverrideCamoDetectionModel_", true));
        }
コード例 #5
0
        public static void SuperMonkeyFanClub(TowerModel model)
        {
            model.GetWeapon().rate *= 0.06f / .475f;
            model.range += 20;
            model.GetAttackModels()[0].range += 20;

            foreach (var projectileModel in model.GetAllProjectiles())
            {
                if (projectileModel.display == null)
                {
                    continue;
                }
                projectileModel.GetBehavior <TravelStraitModel>().lifespan       *= 2f;
                projectileModel.GetBehavior <TravelStraitModel>().lifespanFrames *= 2;
            }
        }
コード例 #6
0
        public static void XrayVision(TowerModel model)
        {
            model.ignoreBlockers = true;
            foreach (var attackModel in model.GetAttackModels())
            {
                attackModel.attackThroughWalls = true;
            }

            foreach (var projectileModel in model.GetAllProjectiles())
            {
                projectileModel.ignoreBlockers = true;
                if (projectileModel.pierce > 0)
                {
                    projectileModel.pierce += model.tier + 1;
                }
            }
        }
コード例 #7
0
        public static void BombVoyage(TowerModel model)
        {
            foreach (var projectileModel in model.GetAllProjectiles())
            {
                var damageModel = projectileModel.GetBehavior <DamageModel>();
                if (damageModel != null)
                {
                    damageModel.damageTypes = new Il2CppStringArray(new[] { "Normal" });
                }

                var travelStraitModel = projectileModel.GetBehavior <TravelStraitModel>();
                var createProjectileOnContactModel = projectileModel.GetBehavior <CreateProjectileOnContactModel>();
                if (travelStraitModel != null && createProjectileOnContactModel != null)
                {
                    travelStraitModel.Speed *= 2;
                }
            }
        }
コード例 #8
0
        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;
            }
        }
コード例 #9
0
 public static void BuccaneerPirateLord(TowerModel model)
 {
     foreach (var projectileModel in model.GetAllProjectiles())
     {
         if (projectileModel.GetDamageModel() != null)
         {
             projectileModel.AddBehavior(new DamageModifierForTagModel("MoabDamage", "Moabs", 1.0f, 10, false, false));
             projectileModel.AddBehavior(new DamageModifierForTagModel("MoabDamage", "Ceramic", 1.0f, 10, false, false));
         }
         if (projectileModel.id == "Explosion")
         {
             foreach (var damageModifierForTagModel in projectileModel.GetBehaviors <DamageModifierForTagModel>())
             {
                 damageModifierForTagModel.damageAddative += 20;
             }
         }
     }
 }
コード例 #10
0
        public static void SplodeyDarts(TowerModel model)
        {
            foreach (var projectileModel in model.GetAllProjectiles())
            {
                var bomb = Game.instance.model.GetTowerFromId(BombShooter).GetWeapon()
                           .projectile.Duplicate();
                var pb     = bomb.GetBehavior <CreateProjectileOnContactModel>();
                var sound  = bomb.GetBehavior <CreateSoundOnProjectileCollisionModel>();
                var effect = bomb.GetBehavior <CreateEffectOnContactModel>();


                if (model.appliedUpgrades.Contains("Enhanced Eyesight"))
                {
                    pb.projectile.GetBehavior <ProjectileFilterModel>().filters.GetItemOfType <FilterModel, FilterInvisibleModel>().isActive = false;
                }

                /*pb.name = "CreateProjectileOnContactModel_SplodeyDarts";
                 * sound.name = "CreateSoundOnProjectileCollisionModel_SplodeyDarts";
                 * effect.name = "CreateEffectOnContactModel_SplodeyDarts";
                 * projectileModel.AddBehavior(pb);
                 * projectileModel.AddBehavior(sound);
                 * projectileModel.AddBehavior(effect);*/

                var behavior = new CreateProjectileOnExhaustFractionModel(
                    "CreateProjectileOnExhaustFractionModel_SplodeyDarts",
                    pb.projectile, pb.emission, 1f, 1f, true);
                projectileModel.AddBehavior(behavior);

                var soundBehavior = new CreateSoundOnProjectileExhaustModel(
                    "CreateSoundOnProjectileExhaustModel_SplodeyDarts",
                    sound.sound1, sound.sound2, sound.sound3, sound.sound4, sound.sound5);
                projectileModel.AddBehavior(soundBehavior);

                var eB = new CreateEffectOnExhaustedModel("CreateEffectOnExhaustedModel_SplodeyDarts", "", 0f, false,
                                                          false, effect.effectModel);
                projectileModel.AddBehavior(eB);
            }
        }
コード例 #11
0
        public static void GorillaGlue(TowerModel model)
        {
            foreach (var projectileModel in model.GetAllProjectiles())
            {
                var amount = Math.Max(1, model.tier);
                if (model.tier == 4)
                {
                    amount++;
                }

                if (model.tier == 5)
                {
                    amount += 5;
                }

                var damageModel = projectileModel.GetDamageModel();
                if (damageModel == null)
                {
                    damageModel = new DamageModel("DamageModel_", amount, 0f, new Il2CppStringArray(new[] { "Normal" }),
                                                  true, false, true, null);
                    projectileModel.AddBehavior(damageModel);
                }
                else
                {
                    damageModel.damage += amount;
                }

                if (model.appliedUpgrades.Contains("MOAB Glue"))
                {
                    var damageModifierForTagModel =
                        new DamageModifierForTagModel("DamageModifierForTagModel_", "Moabs", 1.0f, amount * 9, false, true);
                    projectileModel.AddBehavior(damageModifierForTagModel);

                    projectileModel.hasDamageModifiers = true;
                }
            }
        }
コード例 #12
0
        public static void CrystalBall(TowerModel model)
        {
            if (!model.appliedUpgrades.Contains("Guided Magic"))
            {
                return;
            }

            model.ignoreBlockers = false;

            var guidedMagic = model.GetWeapon().projectile.GetBehavior <TrackTargetModel>();

            foreach (var attackModel in model.GetAttackModels())
            {
                if (attackModel.GetBehavior <TargetFirstModel>() != null)
                {
                    attackModel.RemoveBehavior <TargetFirstModel>();
                    attackModel.AddBehavior(new TargetFirstSharedRangeModel("TargetFirstSharedRangeModel_",
                                                                            true, true, false, false));
                }

                if (attackModel.GetBehavior <TargetLastModel>() != null)
                {
                    attackModel.RemoveBehavior <TargetLastModel>();
                    attackModel.AddBehavior(new TargetLastSharedRangeModel("TargetLastSharedRangeModel_",
                                                                           true, true, false, false));
                }

                if (attackModel.GetBehavior <TargetCloseModel>() != null)
                {
                    attackModel.RemoveBehavior <TargetCloseModel>();
                    attackModel.AddBehavior(new TargetCloseSharedRangeModel("TargetCloseSharedRangeModel_",
                                                                            true, true, false, false));
                }

                if (attackModel.GetBehavior <TargetStrongModel>() != null)
                {
                    attackModel.RemoveBehavior <TargetStrongModel>();
                    attackModel.AddBehavior(new TargetStrongSharedRangeModel("TargetStrongSharedRangeModel_",
                                                                             true, true, false, false));
                }

                attackModel.attackThroughWalls = false;
            }

            foreach (var weaponModel in model.GetWeapons())
            {
                weaponModel.emission.AddBehavior(
                    new EmissionCamoIfTargetIsCamoModel("EmissionCamoIfTargetIsCamoModel_CamoEmissionBehavior"));
            }

            foreach (var projectileModel in model.GetAllProjectiles())
            {
                var travelStraitModel = projectileModel.GetBehavior <TravelStraitModel>();
                if (travelStraitModel != null)
                {
                    var newLifeSpan = travelStraitModel.Lifespan * (150 / travelStraitModel.Speed);
                    travelStraitModel.Lifespan = Math.Max(travelStraitModel.Lifespan, newLifeSpan);
                    if (projectileModel.GetBehavior <TrackTargetModel>() == null)
                    {
                        projectileModel.AddBehavior(guidedMagic.Duplicate());
                    }
                }

                projectileModel.ignoreBlockers = false;
            }
        }