Пример #1
0
        public static void AttackAndSupport(TowerModel model)
        {
            if (model.GetBehavior <SubmergeModel>() == null)
            {
                return;
            }

            model.targetTypes = Game.instance.model.GetTowerFromId(MonkeySub).targetTypes;

            var submergeEffect = model.GetBehavior <SubmergeEffectModel>().effectModel;
            var submerge       = model.GetBehavior <SubmergeModel>();

            if (submerge.heroXpScale > 1.0)
            {
                model.AddBehavior(new HeroXpScaleSupportModel("HeroXpScaleSupportModel_", true, submerge.heroXpScale,
                                                              null));
            }

            if (submerge.abilityCooldownSpeedScale > 1.0)
            {
                model.AddBehavior(new AbilityCooldownScaleSupportModel("AbilityCooldownScaleSupportModel_",
                                                                       true, submerge.abilityCooldownSpeedScale, true, false, null,
                                                                       submerge.buffLocsName, submerge.buffIconName, false, submerge.supportMutatorPriority));
            }

            model.RemoveBehavior <SubmergeModel>();

            foreach (var attackModel in model.GetAttackModels())
            {
                if (attackModel.name.Contains("Submerge"))
                {
                    attackModel.name = attackModel.name.Replace("Submerged", "");
                    attackModel.weapons[0].GetBehavior <EjectEffectModel>().effectModel.assetId =
                        submerge.attackDisplayPath;
                }

                attackModel.RemoveBehavior <SubmergedTargetModel>();
            }

            model.AddBehavior(new CreateEffectAfterTimeModel("CreateEffectAfterTimeModel_", submergeEffect, 0f, true));
        }