Beispiel #1
0
        /// <summary>
        /// 特技导致武将状态改变
        /// </summary>
        /// <param name="skill">Skill.</param>
        private void AddAidToCharacter(App.Model.Master.MSkillEffect mSkillEffect, App.Model.MCharacter[] targetCharacters)
        {
            List <int> aids  = mSkillEffect.strategys.ToList();
            int        index = 0;
            List <App.Model.Master.MStrategy> strategys = new List <App.Model.Master.MStrategy>();

            while (index++ < mSkillEffect.count)
            {
                int i = Random.Range(0, aids.Count - 1);
                App.Model.Master.MStrategy strategy = StrategyCacher.Instance.Get(aids[i]);
                aids.RemoveAt(i);
                strategys.Add(strategy);
            }
            foreach (App.Model.Master.MStrategy strategy in strategys)
            {
                foreach (App.Model.MCharacter target in targetCharacters)
                {
                    //特效
                    if (strategy.effect_type == App.Model.Master.StrategyEffectType.aid)
                    {
                        //this.mCharacter.Target.AddAid(strategy);
                        VTile vTile = this.cBattlefield.mapSearch.GetTile(target.CoordinateX, target.CoordinateY);
                        this.cBattlefield.CreateEffect(strategy.effect, vTile.transform);
                    }
                    else if (strategy.effect_type == App.Model.Master.StrategyEffectType.status)
                    {
                        //this.mCharacter.Target.AddStatus(strategy);
                        VTile vTile = this.cBattlefield.mapSearch.GetTile(target.CoordinateX, target.CoordinateY);
                        this.cBattlefield.CreateEffect(strategy.effect, vTile.transform);
                    }
                }
            }
            cBattlefield.StartCoroutine(AddAidToCharacterComplete(strategys, targetCharacters));
        }
Beispiel #2
0
        /// <summary>
        /// 特技导致武将状态改变
        /// </summary>
        /// <param name="skill">Skill.</param>
        private void AddAidToCharacter(App.Model.Master.MSkillEffect mSkillEffect, MCharacter[] targetCharacters)
        {
            List <int> aids  = mSkillEffect.strategys.ToList();
            int        index = 0;
            List <App.Model.Master.MStrategy> strategys = new List <App.Model.Master.MStrategy>();

            while (index++ < mSkillEffect.count)
            {
                int i = UnityEngine.Random.Range(0, aids.Count - 1);
                App.Model.Master.MStrategy strategy = StrategyCacher.Instance.Get(aids[i]);
                aids.RemoveAt(i);
                strategys.Add(strategy);
            }
            foreach (App.Model.Master.MStrategy strategy in strategys)
            {
                foreach (MCharacter target in targetCharacters)
                {
                    //特效
                    if (strategy.effect_type == StrategyEffectType.aid)
                    {
                        VTile vTile = Global.mapSearch.GetTile(target.coordinate);
                        //cBattle.CreateEffect(strategy.effect, vTile.transform);
                    }
                    else if (strategy.effect_type == StrategyEffectType.status)
                    {
                        VTile vTile = Global.mapSearch.GetTile(target.coordinate);
                        //cBattle.CreateEffect(strategy.effect, vTile.transform);
                    }
                }
            }
            AppManager.CurrentScene.StartCoroutine(AddAidToCharacterComplete(strategys, targetCharacters));
        }