public void addForceParabola(Vector3 srcPos, float skillRange, TrackParamClass param)
        {
            trackParam = param;
            float currentDist = Vector3.Distance(this.transform.position, srcPos);

            if (currentDist > skillRange)
            {
                return;
            }
            trackParam.unitCtlCur.unitData.freezedMoveSpeed = true;
            StartCoroutine(addForceParabolaGo(srcPos, skillRange));
        }
Example #2
0
        IEnumerator manualHurtRangEnd(SkillParameter skillParameter, EffectParameter effectInfo)
        {
            yield return(new WaitForSeconds(0.2f));

            //UnitCtl curUnit = War.scene.GetBuild(skillParameter.curHeroBuildId);

            foreach (UnitCtl unit in effectInfo.unitCtlList)
            {
                try
                {
                    if (unit == null || unit.unitData == null)
                    {
                        continue;
                    }
                    if (unit.unitData.hp <= 0)
                    {
                        continue;
                    }

                    if (unit.unitData.unitType == UnitType.Build)
                    {
                        int lengion = War.skillWarManager.getLegionByHeroUid(skillParameter.curHeroUid);
                        if (lengion == unit.unitData.legionId)
                        {
                            yield break;
                        }

                        float hurt = effectInfo.value - (effectInfo.unitCtlList.Count - 1);
                        if (hurt >= 1)
                        {
                            DamageVO damageVo = War.skillWarManager.GetDamageParameter(hurt, false, DamageType.ATTACK, unit, effectInfo.caster);
                            unit.Damage(damageVo, 0f, 0.2f, effectInfo.effect.hurtCount);
                        }
                    }
                    else
                    {
                        TrackParamClass param = new TrackParamClass();
                        param.caster     = effectInfo.caster;
                        param.high       = 4.0f;
                        param.range      = 5.0f;
                        param.speedTrack = 20.0f;
                        param.unitCtlCur = unit;
                        unit.GetComponent <SkillTrackController>().addForceParabola(effectInfo.receivePos, 6.0f, param);
                    }
                }
                catch (System.Exception e)
                {
                    if (Application.isEditor)
                    {
                        Debug.Log(e);
                    }

                    break;
                }
            }

            SkillWarConf skillWarConf = War.model.GetSkillWarConf(skillParameter.skillId);

            Debug.Log(string.Format("<color=yellow> manualHurtRang=id:{0} {1} leftcount{2}</color>",
                                    skillParameter.skillId, effectInfo.value, effectInfo.unitCtlList.Count));
            if (skillParameter.curDealSkillIdx == 1)
            {
                War.skillWarManager.dealSkill2Effect(skillParameter);
            }
        }