Exemplo n.º 1
0
        public static void RifleRange(TowerModel model)
        {
            var damage = model.GetWeapon().projectile.GetDamageModel().damage;

            model.GetWeapon().AddBehavior(new CritMultiplierModel("CritMultiplierModel_", damage * 2, 1, 6,
                                                                  "252e82e70578330429a758339e10fd25", true));

            model.GetWeapon().projectile.AddBehavior(new ShowTextOnHitModel("ShowTextOnHitModel_",
                                                                            "3dcdbc19136c60846ab944ada06695c0", 0.5f, false, ""));
        }
Exemplo n.º 2
0
        public static void TurboCharge(TowerModel model)
        {
            var mK = model.GetAbility().GetBehavior <TurboModel>().lifespanFrames > 600;

            if (mK)
            {
                model.GetWeapon().rate *= .07f / .8f;
            }
            else
            {
                model.GetWeapon().rate *= .1f / .8f;
            }
        }
Exemplo n.º 3
0
        public static void MOABAssassin(TowerModel model)
        {
            var realProjectile = model.GetWeapon().projectile.GetBehavior <CreateProjectileOnContactModel>()
                                 .projectile;

            realProjectile.GetBehaviors <DamageModifierForTagModel>().First(m => m.tag == "Moabs").damageAddative += 18;
        }
Exemplo n.º 4
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;
            }
        }
Exemplo n.º 5
0
 public static void GlueStorm(TowerModel model)
 {
     GlueStrike(model);
     model.range *= 2;
     model.GetAttackModels()[0].range *= 2;
     model.GetWeapon().rate /= 2f;
 }
Exemplo n.º 6
0
        public static void SpecialPoperations(TowerModel model)
        {
            var ability  = model.GetAbilites()[1];
            var behavior = new ActivateAbilityOnRoundStartModel("ActivateAbilityOnRoundStartModel_SpecialPoperations", ability.Duplicate());

            ability.enabled = false;
            model.AddBehavior(behavior);

            var specialPops = model.GetAbilites()[2];

            model.behaviors = model.behaviors.RemoveItem(specialPops);

            var marine = specialPops.GetBehavior <FindDeploymentLocationModel>().towerModel;

            var weapon = marine.GetAttackModels()[0].weapons[0].Duplicate();

            var airBehavior = model.GetAttackModels()[0].weapons[0].GetBehavior <FireFromAirUnitModel>();

            weapon.behaviors = new Il2CppReferenceArray <WeaponBehaviorModel>(new WeaponBehaviorModel[] { airBehavior });

            weapon.ejectX = weapon.ejectY = weapon.ejectZ = 0;

            weapon.emission = model.GetWeapon().emission.Duplicate();
            weapon.emission.Cast <EmissionWithOffsetsModel>().throwMarkerOffsetModels =
                new Il2CppReferenceArray <ThrowMarkerOffsetModel>(new[]
            {
                weapon.emission.Cast <EmissionWithOffsetsModel>().throwMarkerOffsetModels[0]
            });
            weapon.emission.Cast <EmissionWithOffsetsModel>().throwMarkerOffsetModels[0].ejectX = 0;
            weapon.emission.Cast <EmissionWithOffsetsModel>().projectileCount = 1;

            model.GetAttackModels()[0].AddWeapon(weapon);
        }
Exemplo n.º 7
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;
            }
        }
Exemplo n.º 8
0
        public static void AceHardware(TowerModel model)
        {
            var towerModel = Game.instance.model.GetTower(MonkeyAce, 0, 0, 4);
            var attack     = towerModel.GetAttackModels()[1].Duplicate();
            var weapon     = attack.weapons[0];

            weapon.RemoveBehavior <AlternateProjectileModel>();
            attack.range = 60 + 20 * model.tier;
            weapon.Rate  = .6f - .1f * model.tier;
            weapon.projectile.GetDamageModel().damage = 1 + model.tier / 2;
            weapon.projectile.pierce = model.GetWeapon().projectile.pierce;
            if (model.appliedUpgrades.Contains("Spy Plane"))
            {
                weapon.projectile.filters.GetItemOfType <FilterModel, FilterInvisibleModel>().isActive = false;
            }
            model.AddBehavior(attack);
        }
Exemplo n.º 9
0
        public static void SuperMaelstrom(TowerModel model)
        {
            model.range += 20;

            var neva     = Game.instance.model.GetTower(MonkeyAce, 0, 0, 3);
            var behavior = neva.GetAllProjectiles()[0].GetBehavior <TrackTargetModel>().Duplicate();

            behavior.TurnRate *= 3;
            behavior.constantlyAquireNewTarget = true;
            behavior.useLifetimeAsDistance     = true;

            var weaponProjectile = model.GetWeapon().projectile;

            weaponProjectile.AddBehavior(behavior);
            weaponProjectile.pierce += 14;
            weaponProjectile.GetBehavior <TravelStraitModel>().lifespanFrames *= 16;
            weaponProjectile.GetBehavior <TravelStraitModel>().lifespan       *= 16f;
        }
Exemplo n.º 10
0
        public static void PopandAwe(TowerModel model)
        {
            var realWeapon    = model.GetWeapon();
            var ability       = model.GetAbilites()[0];
            var abilityAttack = ability.GetBehavior <ActivateAttackModel>().attacks[0].Duplicate();
            var abilityWeapon = abilityAttack.weapons[0];

            var popAndEffect = ability.GetBehavior <CreateEffectOnAbilityModel>().effectModel.Duplicate();

            popAndEffect.lifespan /= 8f;

            var newWeapon    = realWeapon.Duplicate();
            var weaponEffect = newWeapon.projectile.GetBehavior <CreateEffectOnExpireModel>();

            weaponEffect.assetId                       = "";
            weaponEffect.effectModel                   = popAndEffect;
            weaponEffect.effectModel.scale            /= 3f;
            weaponEffect.effectModel.useCenterPosition = false;
            weaponEffect.effectModel.lifespan         /= 2f;
            newWeapon.rate = 4f;

            var newProjectile = abilityWeapon.projectile;

            newProjectile.GetBehavior <AgeModel>().lifespanFrames = 1;
            newProjectile.radius = realWeapon.projectile.radius * 2;

            newProjectile.behaviors = newProjectile.behaviors.RemoveItemOfType <Model, ClearHitBloonsModel>();

            newWeapon.projectile.GetBehavior <CreateProjectileOnExhaustFractionModel>().projectile = newProjectile;
            newWeapon.projectile.behaviors = newWeapon.projectile.behaviors
                                             .RemoveItemOfType <Model, CreateEffectOnExhaustFractionModel>();

            var sound = Game.instance.model.GetTower(MortarMonkey, 5).GetWeapon().projectile
                        .GetBehavior <CreateSoundOnProjectileExhaustModel>();

            newWeapon.projectile.behaviors = newWeapon.projectile.behaviors
                                             .RemoveItemOfType <Model, CreateSoundOnProjectileExhaustModel>();
            newWeapon.projectile.AddBehavior(sound);

            model.GetAttackModels()[0].AddWeapon(newWeapon);
        }
Exemplo n.º 11
0
        public static void RocketStorm(TowerModel model)
        {
            var abilityAttack = model.GetAbilites()[0].GetBehavior <ActivateAttackModel>().attacks[0].Duplicate();

            var abilityWeapon = abilityAttack.weapons[0];
            var realWeapon    = model.GetWeapon();

            abilityWeapon.emission = realWeapon.emission;
            abilityWeapon.GetBehavior <EjectEffectModel>().effectModel.lifespan = .05f;
            abilityWeapon.rate /= 4;


            if (abilityWeapon.projectile.GetBehavior <CreateProjectileOnContactModel>().projectile.HasBehavior <SlowModel>())
            {
                abilityWeapon.projectile.GetBehavior <CreateProjectileOnContactModel>().projectile.GetBehavior <SlowModel>().lifespan /= 3;
                abilityWeapon.projectile.GetBehavior <CreateProjectileOnContactModel>().projectile.GetBehavior <SlowModel>()
                .dontRefreshDuration = true;
                abilityWeapon.projectile.GetBehavior <CreateProjectileOnBlockerCollideModel>().projectile.GetBehavior <SlowModel>().lifespan /= 3;
                abilityWeapon.projectile.GetBehavior <CreateProjectileOnBlockerCollideModel>().projectile.GetBehavior <SlowModel>()
                .dontRefreshDuration = true;
            }

            model.GetAttackModels()[0].AddWeapon(abilityWeapon);
        }
Exemplo n.º 12
0
        public static void GlueStrike(TowerModel model)
        {
            var realWeapon    = model.GetWeapon();
            var ability       = model.GetAbilites()[0];
            var abilityAttack = ability.GetBehavior <ActivateAttackModel>().attacks[0].Duplicate();
            var abilityWeapon = abilityAttack.weapons[0];

            var behaviors       = abilityWeapon.projectile.GetBehaviors <AddBehaviorToBloonModel>();
            var damageBoost     = behaviors[behaviors.Count - 1];
            var abilitySlow     = abilityWeapon.projectile.GetBehavior <SlowModel>();
            var realSlow        = realWeapon.projectile.GetBehavior <SlowModel>();
            var realProjectile2 = realWeapon.projectile.GetBehavior <CreateProjectileOnContactModel>().projectile;
            var realSlow2       = realProjectile2.GetBehavior <SlowModel>();

            realSlow.lifespan            = abilitySlow.lifespan;
            realSlow.layers              = abilitySlow.layers;
            realSlow.mutator.multiplier  = abilitySlow.Multiplier;
            realSlow2.lifespan           = abilitySlow.lifespan;
            realSlow2.layers             = abilitySlow.layers;
            realSlow2.mutator.multiplier = abilitySlow.Multiplier;

            realWeapon.projectile.AddBehavior(damageBoost);
            realProjectile2.AddBehavior(damageBoost);
        }
Exemplo n.º 13
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;
            }
        }
Exemplo n.º 14
0
 public static void PermaCharge(TowerModel model)
 {
     model.GetWeapon().projectile.GetDamageModel().damage += 3;
 }