private bool CanAutoActivateAbility(uint entityID)
        {
            bool result = false;

            if (this.deployedTroops.ContainsKey(entityID))
            {
                SmartEntity      entity      = this.deployedTroops[entityID].Entity;
                ShooterComponent shooterComp = entity.ShooterComp;
                if (shooterComp != null)
                {
                    TroopComponent troopComp      = entity.TroopComp;
                    TroopAbilityVO troopAbilityVO = null;
                    if (troopComp != null)
                    {
                        troopAbilityVO = troopComp.AbilityVO;
                    }
                    result = ((troopAbilityVO != null && troopAbilityVO.RecastAbility) || shooterComp.AttackFSM.CanSwitchAbility());
                }
            }
            return(result);
        }
Esempio n. 2
0
        private void SetupAbilityViewEffects(DeployedTroop deployedTroop, TroopAbilityVO abilityVO)
        {
            GameObjectViewComponent gameObjectViewComp = deployedTroop.Entity.GameObjectViewComp;

            if (gameObjectViewComp == null)
            {
                return;
            }
            WeaponTrail componentInChildren = gameObjectViewComp.MainGameObject.GetComponentInChildren <WeaponTrail>();

            if (componentInChildren != null)
            {
                deployedTroop.WeaponTrail = componentInChildren;
                float[] weaponTrailFxParams = abilityVO.WeaponTrailFxParams;
                if (weaponTrailFxParams != null && weaponTrailFxParams.Length >= 2)
                {
                    deployedTroop.WeaponTrailActivateLifetime   = weaponTrailFxParams[0];
                    deployedTroop.WeaponTrailDeactivateLifetime = weaponTrailFxParams[1];
                }
            }
        }
Esempio n. 3
0
        public static void AddTroopProjectileAssets(string troopUid, List <IAssetVO> assets, IDataController dc)
        {
            TroopTypeVO      troopTypeVO    = dc.Get <TroopTypeVO>(troopUid);
            ProjectileTypeVO projectileType = troopTypeVO.ProjectileType;
            ActiveArmory     activeArmory   = Service.Get <CurrentPlayer>().ActiveArmory;

            if (activeArmory != null)
            {
                SkinTypeVO applicableSkin = Service.Get <SkinController>().GetApplicableSkin(troopTypeVO, activeArmory.Equipment);
                if (applicableSkin != null && applicableSkin.Override != null && applicableSkin.Override.ProjectileType != null)
                {
                    projectileType = applicableSkin.Override.ProjectileType;
                }
            }
            ProjectileUtils.AddProjectileAssets(projectileType, assets, dc);
            ProjectileUtils.AddProjectileAssets(troopTypeVO.DeathProjectileType, assets, dc);
            ProjectileUtils.AddBuffProjectileAssets(troopTypeVO.SpawnApplyBuffs, assets, dc);
            if (!string.IsNullOrEmpty(troopTypeVO.Ability))
            {
                TroopAbilityVO troopAbilityVO = dc.Get <TroopAbilityVO>(troopTypeVO.Ability);
                ProjectileUtils.AddProjectileAssets(troopAbilityVO.ProjectileType, assets, dc);
                ProjectileUtils.AddBuffProjectileAssets(troopAbilityVO.SelfBuff, assets, dc);
            }
        }
Esempio n. 4
0
 public static string GetHeroAbilityDescription(TroopAbilityVO abilityInfo)
 {
     return(Service.Get <Lang>().Get("ability_desc_" + abilityInfo.Uid, new object[0]));
 }
Esempio n. 5
0
 public static string GetHeroAbilityDisplayName(TroopAbilityVO abilityInfo)
 {
     return(Service.Get <Lang>().Get("ability_title_" + abilityInfo.Uid, new object[0]));
 }