Example #1
0
        public int effectHurt(SkillParameter skillParameter, EffectParameter effectInfo)
        {
            Debug.Log("======" + effectInfo.effect.type + "====" + effectInfo.effect.operation + "---: " + effectInfo.effect.target);
            if (effectInfo.effect.operation == (int)eSkillWarEffectOperation.eEffectAuto)           //自动目标
            {
                if (effectInfo.effect.target == (int)eSkillWarTargetType.eEffectTargetSoilderOnWay) //士兵
                {
                    autoHurtSoilderStart(skillParameter, effectInfo);
                }
                else if (effectInfo.effect.target == (int)eSkillWarTargetType.eEffectTargetSoliderMax)//一定范围内影响士兵最多
                {
                    manualHurtRang(skillParameter, effectInfo);
                }
                else//城市
                {
                    autoHurtBuildAll(skillParameter, effectInfo);
                }
            }
            else if (effectInfo.effect.operation == (int)eSkillWarEffectOperation.eEffectManualTarget)//手动目标
            {
                autoHurtBuildAll(skillParameter, effectInfo);
            }
            else if (effectInfo.effect.operation == (int)eSkillWarEffectOperation.eEffectmanualRange)//手动范围
            {
                manualHurtRang(skillParameter, effectInfo);
            }

            return(0);
        }
        public int changeAttribute(SkillParameter skillParameter, EffectParameter effectParameter)
        {
            //SkillWarConf skillWarConf = War.model.GetSkillWarConf(skillParameter.skillId);
            Debug.Log("changeAttribute=========" + effectParameter.effect.animPathStart + "++++++: " + effectParameter.effect.animPathEnd);
            //播放技能特效
            if (effectParameter.effect.animPathStart != "temp")
            {
                GameObject effectPrefabSelf = WarRes.GetPrefab(effectParameter.effect.animPathStart);
                GameObject effectAnim       = GameObject.Instantiate <GameObject>(effectPrefabSelf);

                int     lengion = War.skillWarManager.getLegionByHeroUid(skillParameter.curHeroUid);
                Vector3 fromPos = War.scene.GetLegionPosition(lengion);
                effectAnim.transform.position = fromPos;
            }

            foreach (UnitCtl unit in effectParameter.unitCtlList)
            {
                if (unit == null)
                {
                    continue;
                }
                BuildSkillDots skillDots = unit.GetComponent <BuildSkillDots>();
                if (skillDots != null)
                {
                    skillDots.buildChangeAttri(effectParameter);
                }
            }

            Debug.Log(string.Format("<color=yellow> addAttribute all skill id={0} effid={1}</color>", skillParameter.skillId, effectParameter.effect.id));
            return(0);
        }
        public int effectBuildCantSendSoldierStart(SkillParameter skillParameter, EffectParameter effectParameter)
        {
            //播放技能特效
            if (effectParameter.effect.animPathStart != "temp")
            {
                GameObject effectPrefabSelf = WarRes.GetPrefab(effectParameter.effect.animPathStart.ToLower());
                GameObject effectAnim       = GameObject.Instantiate <GameObject>(effectPrefabSelf);

                int     lengion = War.skillWarManager.getLegionByHeroUid(skillParameter.curHeroUid);
                Vector3 fromPos = War.scene.GetLegionPosition(lengion);
                effectAnim.transform.position = fromPos;
                effectParameter.waitTime      = 0.5f;
            }

            foreach (UnitCtl unit in effectParameter.unitCtlList)
            {
                if (unit == null)
                {
                    continue;
                }
                BuildSkillDots skillDots = unit.GetComponent <BuildSkillDots>();
                if (skillDots != null)
                {
                    skillDots.buildStopSendsoldier(effectParameter);
                }
            }

            Debug.Log(string.Format("<color=yellow> effectBuildCantSendSoldierStart all effid={0} time={1} count={2}</color>",
                                    effectParameter.effect.id, effectParameter.effect.time, effectParameter.unitCtlList.Count));

            ////处理技能2
            // War.skillWarManager.StartCoroutine(useSkill2Effect(skillParameter, 1.0f));
            return(0);
        }
        IEnumerator effectBuildReplaceEnd(SkillParameter skillParameter, EffectParameter effectParameter)
        {
            yield return(new WaitForSeconds(effectParameter.waitTime));

            foreach (UnitCtl unit in effectParameter.unitCtlList)
            {
                Debug.Log("=======" + effectParameter.effect.buffAnimPath);
                int lengion = War.skillWarManager.getLegionByHeroUid(skillParameter.curHeroUid);
                if (lengion != unit.unitData.legionId)
                {
                    continue;
                }
                if (effectParameter.effect.buffAnimPath != "temp")
                {
                    GameObject effectPrefab = WarRes.GetPrefab(effectParameter.effect.buffAnimPath);
                    GameObject effectAnim   = GameObject.Instantiate <GameObject>(effectPrefab);
                    effectAnim.transform.position = unit.transform.position;
                }

                if (unit.unitData.buildConfig.id == effectParameter.value)
                {
//					unit.unitData.BuildSkillUplevel();
                }
                else
                {
                    unit.BuildChangeBuildConfig((int)effectParameter.value);
                }

                unit.unitData.BuildSkillCostHP(effectParameter.effect.costHP);
                unit.unitData.BuildSkillCostHPPer(effectParameter.effect.costHPPer);
                Debug.Log(string.Format("<color=yellow> effectBuildReplaceStart to {0}  </color>",
                                        unit.unitData.id));
            }
        }
Example #5
0
        public ActionResult DeleteConfirmed(int id)
        {
            SkillParameter skillParameter = db.SkillParameters.Find(id);

            db.SkillParameters.Remove(skillParameter);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        IEnumerator useSkill2Effect(SkillParameter skillParameter, float time)
        {
            yield return(new WaitForSeconds(time));

            if (skillParameter.curDealSkillIdx == 1)
            {
                War.skillWarManager.dealSkill2Effect(skillParameter);
            }
            Debug.Log(string.Format("<color=yellow> use second skill :{0}</color>", skillParameter.skillId));
        }
        //============技能==================
        #region 英雄上阵
        public void effectHeroToBuild(SkillParameter skillParameter, EffectParameter effectParameter)
        {
//			Debug.LogFormat("英雄上阵 effectHeroToBuild  effectParameter.unitCtlList.count={0}" , effectParameter.unitCtlList.Count);
            foreach (UnitCtl unit in effectParameter.unitCtlList)
            {
                int lengion = War.skillWarManager.getLegionByHeroUid(skillParameter.curHeroUid);
                War.signal.HeroSettledBuild(lengion, skillParameter.skillUid, unit.unitData.id);
                break;
            }
        }
Example #8
0
 public ActionResult Edit([Bind(Include = "Id,SkillNumber,SkillName")] SkillParameter skillParameter)
 {
     if (ModelState.IsValid)
     {
         db.Entry(skillParameter).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(skillParameter));
 }
Example #9
0
        public ActionResult Create([Bind(Include = "Id,SkillNumber,SkillName")] SkillParameter skillParameter)
        {
            if (ModelState.IsValid)
            {
                db.SkillParameters.Add(skillParameter);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(skillParameter));
        }
Example #10
0
        //--------------------定时伤害------------------------------

        #endregion

        #region 手动范围
        //--------------------手动范围------------------------------
        private int manualHurtRang(SkillParameter skillParameter, EffectParameter effectInfo)
        {
            if (effectInfo.effect.animPathStart != "temp")
            {
                GameObject effectPrefab = WarRes.GetPrefab(effectInfo.effect.animPathStart);
                GameObject effectAnim   = GameObject.Instantiate <GameObject>(effectPrefab);
                effectAnim.transform.position = effectInfo.receivePos;
            }
            War.skillWarManager.StartCoroutine(manualHurtRangEnd(skillParameter, effectInfo));

            return(0);
        }
        IEnumerator addShieldTimer(SkillParameter skillParameter, EffectParameter effectParameter)
        {
            yield return(new WaitForSeconds(effectParameter.effect.time));

            foreach (UnitCtl unit in effectParameter.unitCtlList)//获取城市
            {
                //Debug.Log("===unit id===" + unit.unitData.id);
                unit.unitCtl.BeforeDamage -= OnBeforeDamage;
                unit.unitData.shield       = 0.0f;
            }

            Debug.Log(string.Format("<color=yellow> addShieldTimer </color>"));
        }
Example #12
0
        // GET: SkillParameter/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SkillParameter skillParameter = db.SkillParameters.Find(id);

            if (skillParameter == null)
            {
                return(HttpNotFound());
            }
            return(View(skillParameter));
        }
Example #13
0
        /*
         * 增兵
         */
        public int effectAddSoilder(SkillParameter skillParameter, EffectParameter effectInfo)
        {
            Debug.Log("======" + effectInfo.effect.type + "====" + effectInfo.effect.operation);
            if (effectInfo.effect.operation == (int)eSkillWarEffectOperation.eEffectAuto)//自动目标
            {
                autoAddBuildAllStart(skillParameter, effectInfo);
            }
            else if (effectInfo.effect.operation == (int)eSkillWarEffectOperation.eEffectManualTarget)//手动目标
            {
                autoAddBuildAllStart(skillParameter, effectInfo);
            }

            return(0);
        }
        public int stopSoldierStart(SkillParameter skillParameter, EffectParameter effectInfo)
        {
            Debug.Log("stopSoldierStart=========" + effectInfo.effect.animPathStart + "++++++" + effectInfo.effect.animPathEnd);
            //播放技能特效
            if (effectInfo.effect.animPathStart != "temp")
            {
                GameObject effectPrefabSelf = WarRes.GetPrefab(effectInfo.effect.animPathStart.ToLower());
                GameObject effectAnim       = GameObject.Instantiate <GameObject>(effectPrefabSelf);
                effectAnim.transform.position = effectInfo.receivePos;

                effectInfo.waitTime = 0.8f;
            }
            War.skillWarManager.StartCoroutine(stopSoldierEnd(skillParameter, effectInfo));
            return(0);
        }
        IEnumerator GotoBuildSoonEnd(SkillParameter skillParameter, EffectParameter effectParameter)
        {
            yield return(new WaitForSeconds(1.0f));

            UnitCtl unit = effectParameter.unitCtlList[0];
            //SkillWarConf skillWarConf = War.model.GetSkillWarConf(skillParameter.skillId);

            UnitCtl curUnit = War.scene.GetUnitForUID(effectParameter.curBuildUid);

            if (curUnit != null)
            {
                curUnit.GetComponent <BSendArming>().Send(unit, (int)effectParameter.value, 20.0f);
            }
            Debug.Log(string.Format("<color=yellow> GotoBuildSoon to {0} {1}</color>",
                                    unit.unitData.id, effectParameter.value));
        }
Example #16
0
        IEnumerator autoHurtSoilderEnd(SkillParameter skillParameter, EffectParameter effectInfo)
        {
            yield return(new WaitForSeconds(effectInfo.waitTime));

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

            //播放技能,针对所有出征士兵
            int unitType = 0;

            unitType = unitType.USolider(true);
            int relation = 0;

            relation = relation.REnemy(true);
            List <UnitCtl> unitSoldierList = War.scene.SearchUnit(unitType, effectInfo.caster.unitData.legionId, relation);

            foreach (UnitCtl unit in unitSoldierList)
            {
                if (unit == null)
                {
                    continue;
                }
                if (effectInfo.effect.animPathEnd != "temp")
                {
                    GameObject effectPrefab = WarRes.GetPrefab(effectInfo.effect.animPathEnd.ToLower());
                    GameObject effectAnim   = GameObject.Instantiate <GameObject>(effectPrefab);
                    effectAnim.transform.position = unit.transform.position;
                }
            }

            foreach (UnitCtl unit in effectInfo.unitCtlList)
            {
                if (unit == null)
                {
                    continue;
                }
                unit.DamageToDeath(effectInfo.caster);
            }


            Debug.Log(string.Format("<color=yellow> autoHurtSoilder=id:{0} {1}</color>",
                                    skillParameter.skillId, effectInfo.unitCtlList.Count));
            //处理技能2
            if (skillParameter.curDealSkillIdx == 1)
            {
                War.skillWarManager.dealSkill2Effect(skillParameter);
            }
        }
Example #17
0
        //--------------------自动伤害城池------------------------------
        private int autoHurtBuildAll(SkillParameter skillParameter, EffectParameter effectInfo)
        {
            SkillWarConf skillWarConf = War.model.GetSkillWarConf(skillParameter.skillId);

            Debug.Log("=========" + effectInfo.effect.animPathStart + "++++++" + effectInfo.effect.animPathEnd);
            //发射技能 :号令天下 无双 连营
            if (effectInfo.effect.isSend == 1)
            {
                float timeProcess = 1.5f;
                float height      = 8.0f;

                int idx = 0;
                foreach (UnitCtl unit in effectInfo.unitCtlList)//获取城市
                {
                    if (effectInfo.effect.animPathStart != "temp")
                    {
                        int     lengion = War.skillWarManager.getLegionByHeroUid(skillParameter.curHeroUid);
                        Vector3 fromPos = War.scene.GetLegionPosition(lengion);
                        War.skillWarManager.sendSkillAnim(fromPos, unit, effectInfo.effect.animPathStart, height, timeProcess);
                        effectInfo.waitTime = timeProcess;
                    }
                    idx++;
                    bool needDealSKill2 = false;
                    if (idx == effectInfo.unitCtlList.Count)
                    {
                        needDealSKill2 = true;
                    }
                    War.skillWarManager.StartCoroutine(autoHurtBuildSingleEnd(skillParameter, effectInfo, unit, needDealSKill2));
                }
            }
            else
            {
                int idx = 0;
                foreach (UnitCtl unit in effectInfo.unitCtlList)//获取城市
                {
                    idx++;
                    bool needDealSKill2 = false;
                    if (idx == effectInfo.unitCtlList.Count)
                    {
                        needDealSKill2 = true;
                    }
                    War.skillWarManager.StartCoroutine(effectHurtSingleStart(skillParameter, effectInfo, unit, needDealSKill2));
                }
            }
            return(0);
        }
Example #18
0
        //==================伤害出征士兵 冰冻效果=========================
        private int autoHurtSoilderStart(SkillParameter skillParameter, EffectParameter effectInfo)
        {
            Debug.Log("=========" + effectInfo.effect.animPathStart + "++++++" + effectInfo.effect.animPathEnd);
            //播放技能特效
            if (effectInfo.effect.animPathStart != "temp")
            {
                GameObject effectPrefabSelf = WarRes.GetPrefab(effectInfo.effect.animPathStart.ToLower());
                GameObject effectAnim       = GameObject.Instantiate <GameObject>(effectPrefabSelf);

                int     lengion = War.skillWarManager.getLegionByHeroUid(skillParameter.curHeroUid);
                Vector3 fromPos = War.scene.GetLegionPosition(lengion);
                effectAnim.transform.position = fromPos;
                effectInfo.waitTime           = 0.8f;
            }
            War.skillWarManager.StartCoroutine(autoHurtSoilderEnd(skillParameter, effectInfo));
            return(0);
        }
        public int effectBuildReplaceStart(SkillParameter skillParameter, EffectParameter effectInfo)
        {
            //播放技能特效
            if (effectInfo.effect.animPathStart != "temp")
            {
                GameObject effectPrefabSelf = WarRes.GetPrefab(effectInfo.effect.animPathStart.ToLower());
                GameObject effectAnim       = GameObject.Instantiate <GameObject>(effectPrefabSelf);

                int     lengion = War.skillWarManager.getLegionByHeroUid(skillParameter.curHeroUid);
                Vector3 fromPos = War.scene.GetLegionPosition(lengion);
                effectAnim.transform.position = fromPos;
                effectInfo.waitTime           = 0.5f;
            }
            War.skillWarManager.setBuildHeroInfo(skillParameter, effectInfo);
            War.skillWarManager.StartCoroutine(effectBuildReplaceEnd(skillParameter, effectInfo));
            return(0);
        }
Example #20
0
        //伤害单个
        IEnumerator autoHurtBuildAllHurtSingle(SkillParameter skillParameter, EffectParameter effectInfo, UnitCtl unit, bool needDealSkill2)
        {
            yield return(new WaitForSeconds(0));

            int lengion = War.skillWarManager.getLegionByHeroUid(skillParameter.curHeroUid);

            if (lengion == unit.unitData.legionId)
            {
                yield break;
            }
            float hurtValue = effectInfo.value;

            if (effectInfo.effect.type == (int)eSKillWarEffectType.eEffectHurtBuidingMax)
            {
                hurtValue = unit.unitData.maxHp * effectInfo.value / 100;
            }
            else if (effectInfo.effect.type == (int)eSKillWarEffectType.eEffectHurtRate)
            {
                Debug.LogFormat("=================hp:{0} value:{1}", unit.unitData.hp, effectInfo.value);
                hurtValue = unit.unitData.hp * effectInfo.value / 100;
            }
            DamageVO damageVo = War.skillWarManager.GetDamageParameter(hurtValue, false, DamageType.ATTACK, unit, effectInfo.caster);

            unit.Damage(damageVo, 0f, 0.2f, effectInfo.effect.hurtCount);
            //War.skillWarManager.soldierDieSHow(unit);

            //处理技能2
            if (needDealSkill2 == true && skillParameter.curDealSkillIdx == 1)
            {
                Debug.LogFormat("=====needDealSkill2 true=====");
                War.skillWarManager.dealSkill2Effect(skillParameter);
            }

            if (effectInfo.effect.time > 0)
            {
                //War.skillWarManager.StartCoroutine(autoHurtBuildAllTimer(skillParameter, unit));
                BuildSkillDots skillDots = unit.GetComponent <BuildSkillDots>();
                if (skillDots != null)
                {
                    skillDots.GetSkillHurt(effectInfo);
                }
            }
            Debug.Log(string.Format("<color=yellow> autoHurtBuildAllHurtSingle all=skill id:{0}, lvl:{1} v:{2}  effecttime:{3}</color>",
                                    skillParameter.skillId, skillParameter.skillLvl, effectInfo.value, effectInfo.effect.time));
        }
Example #21
0
        //单个技能效果
        IEnumerator effectHurtSingleStart(SkillParameter skillParameter, EffectParameter effectInfo, UnitCtl unit, bool needDealSkill2)
        {
            float idxRand = Random.Range(0.0f, 1.0f);

            //Debug.LogFormat("=====idxRand:{0}", idxRand);
            yield return(new WaitForSeconds(idxRand));

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

            if (effectInfo.effect.animPathStart != "temp")
            {
                GameObject effectPrefab = WarRes.GetPrefab(effectInfo.effect.animPathStart);
                GameObject effectAnim   = GameObject.Instantiate <GameObject>(effectPrefab);
                effectAnim.transform.position = unit.transform.position;
                effectInfo.waitTime           = 0.2f;
            }

            War.skillWarManager.StartCoroutine(autoHurtBuildSingleEnd(skillParameter, effectInfo, unit, needDealSkill2));
        }
        //public int effectShowNum(CSkillEffectDataItem effect, List<UnitCtl> unitCtlList, SkillOperateData skillOperateDate, int showEffect)
        //{
        //    if (effect.operation == (int)eSkillWarEffectOperation.eEffectAuto)//自动目标
        //    {
        //        //autoHurtBuildAllShowNum(effect, unitCtlList, skillOperateDate, showEffect);
        //    }
        //    else if (effect.operation == (int)eSkillWarEffectOperation.eEffectManualTarget)//手动目标
        //    {

        //    }
        //    return 0;
        //}

        //private int autoHurtBuildAllShowNum(CSkillEffectDataItem effect, List<UnitCtl> unitCtlList, SkillOperateData skillOperateDate, int showEffect)
        //{
        //    List<GameObject> effectAnimList = new List<GameObject>();
        //    SkillWarConf skillWarConf = War.model.GetSkillWarConf(skillOperateDate.skillId);

        //    //播放技能特效
        //    if (showEffect == 1 && skillWarConf.animPathStart != "temp")
        //    {
        //        GameObject effectPrefabSelf = WarRes.GetPrefab(skillWarConf.animPathStart.ToLower());
        //        GameObject effectAnim = GameObject.Instantiate<GameObject>(effectPrefabSelf);
        //        effectAnim.transform.position = War.scene.GetBuild(skillOperateDate.heroData.buildId).transform.position;
        //    }

        //    foreach (UnitCtl unit in unitCtlList)
        //    {
        //        if (showEffect == 1)
        //        {
        //            GameObject effectPrefab = WarRes.GetPrefab(skillWarConf.animPathEnd.ToLower());
        //            GameObject effectAnim = GameObject.Instantiate<GameObject>(effectPrefab);
        //            effectAnim.transform.position = unit.transform.position;
        //        }

        //        unit.unitData.showHP = true;
        //    }
        //    if (effect.time > 0)
        //    {

        //    }
        //    Debug.Log(string.Format("<color=yellow> autoHurtBuildAllShowNum all </color>"));
        //    return 0;
        //}
        //public int autoBuildAllShowNumTimer(SkillEffectInfoTImer effectInfoTimer)
        //{
        //    if(effectInfoTimer.timer > 1)
        //    {
        //        effectInfoTimer.timer--;
        //        return 0;
        //    }

        //    foreach (UnitCtl unit in effectInfoTimer.unitList)//获取城市
        //    {
        //        Debug.Log("===unit id==="+ unit.unitData.id);
        //        unit.unitData.showHP = false;
        //    }
        //    effectInfoTimer.timer--;
        //    Debug.Log(string.Format("<color=yellow> autoAddBuildAllShowNumTimer all </color>" ));

        //    return 0;
        //}
        #endregion

        #region 快速前往某地
        public int GotoBuildSoon(SkillParameter skillParameter, EffectParameter effectParameter)
        {
            Debug.Log("=========" + effectParameter.effect.animPathStart + "++++++" + effectParameter.effect.animPathEnd);

            if (effectParameter.unitCtlList.Count <= 0)
            {
                return(-1);
            }
            UnitCtl unit = effectParameter.unitCtlList[0];

            if (effectParameter.effect.animPathStart != "temp")
            {
                GameObject effectPrefab = WarRes.GetPrefab(effectParameter.effect.animPathStart.ToLower());
                GameObject effectAnim   = GameObject.Instantiate <GameObject>(effectPrefab);
                effectAnim.transform.position = unit.transform.position;
            }
            War.skillWarManager.StartCoroutine(GotoBuildSoonEnd(skillParameter, effectParameter));
            return(0);
        }
        public int effectBuildAutoHurt(SkillParameter skillParameter, EffectParameter effectParameter)
        {
            Debug.Log("effectBuildAutoHurt=========" + effectParameter.effect.animPathStart + "++++++: " + effectParameter.effect.animPathEnd);

            foreach (UnitCtl unit in effectParameter.unitCtlList)
            {
                if (unit == null)
                {
                    continue;
                }
                BuildSkillDots skillDots = unit.GetComponent <BuildSkillDots>();
                if (skillDots != null)
                {
                    skillDots.GetBuildHurtOther(effectParameter);
                }
            }

            Debug.Log(string.Format("<color=yellow> addAttribute all skill id={0} effid={1}</color>", skillParameter.skillId, effectParameter.effect.id));
            return(0);
        }
        IEnumerator effectDispelEnd(SkillParameter skillParameter, EffectParameter effectParameter)
        {
            yield return(new WaitForSeconds(0.5f));

            UnitCtl curUnit        = War.scene.GetUnitForUID(effectParameter.curBuildUid);
            float   sendCountTatal = curUnit.unitData.hp * effectParameter.value / 100;
            int     countBuild     = effectParameter.unitCtlList.Count;

            if (countBuild > 0)
            {
                float sendCount = sendCountTatal / countBuild;
                foreach (UnitCtl unit in effectParameter.unitCtlList)
                {
                    Debug.Log("sendto " + unit.unitData.id + " count: " + sendCount);
                    curUnit.GetComponent <BSendArming>().Send(unit, (int)sendCount, 10.0f);
                }
            }
            Debug.Log(string.Format("<color=yellow> effectDispelEnd to {0} {1}</color>",
                                    curUnit.unitData.id, sendCountTatal));
        }
Example #25
0
        //=========================给所有城池家兵===========
        private int autoAddBuildAllStart(SkillParameter skillParameter, EffectParameter effectInfo)
        {
            //SkillWarConf skillWarConf = War.model.GetSkillWarConf(skillParameter.skillId);
            Debug.Log("=========" + effectInfo.effect.animPathStart + "++++++" + effectInfo.effect.animPathEnd);
            //播放技能特效

            foreach (UnitCtl unit in effectInfo.unitCtlList)//获取城市
            {
                if (effectInfo.effect.animPathStart != "temp")
                {
                    GameObject effectPrefab = WarRes.GetPrefab(effectInfo.effect.animPathStart);
                    GameObject effectAnim   = GameObject.Instantiate <GameObject>(effectPrefab);
                    effectAnim.transform.position = unit.transform.position;

                    effectInfo.waitTime = 0.0f;
                }
            }

            War.skillWarManager.StartCoroutine(autoAddBuildAllEnd(skillParameter, effectInfo));
            return(0);
        }
        public int effectBuildLevelMaxStart(SkillParameter skillParameter, EffectParameter effectInfo)
        {
            //播放技能特效
            if (effectInfo.effect.animPathStart != "temp")
            {
                GameObject effectPrefabSelf = WarRes.GetPrefab(effectInfo.effect.animPathStart.ToLower());
                GameObject effectAnim       = GameObject.Instantiate <GameObject>(effectPrefabSelf);

                int     lengion = War.skillWarManager.getLegionByHeroUid(skillParameter.curHeroUid);
                Vector3 fromPos = War.scene.GetLegionPosition(lengion);
                effectAnim.transform.position = fromPos;
                effectInfo.waitTime           = 0.5f;
            }
            War.skillWarManager.setBuildHeroInfo(skillParameter, effectInfo);
            foreach (UnitCtl unit in effectInfo.unitCtlList)
            {
                Debug.Log("=======" + effectInfo.effect.buffAnimPath);
                int lengion = War.skillWarManager.getLegionByHeroUid(skillParameter.curHeroUid);
                if (lengion != unit.unitData.legionId)
                {
                    continue;
                }
                if (effectInfo.effect.buffAnimPath != "temp")
                {
                    GameObject effectPrefab = WarRes.GetPrefab(effectInfo.effect.buffAnimPath);
                    GameObject effectAnim   = GameObject.Instantiate <GameObject>(effectPrefab);
                    effectAnim.transform.position = unit.transform.position;
                }
                unit.unitData.build_addMaxLevel = (int)effectInfo.value;

                unit.unitData.BuildSkillCostHP(effectInfo.effect.costHP);
                unit.unitData.BuildSkillCostHPPer(effectInfo.effect.costHPPer);

                Debug.Log(string.Format("<color=yellow> effectBuildLevelMaxStart to {0}  </color>",
                                        unit.unitData.id));
            }
            return(0);
        }
Example #27
0
        IEnumerator autoHurtBuildSingleEnd(SkillParameter skillParameter, EffectParameter effectInfo, UnitCtl unit, bool needDealSkill2)
        {
            yield return(new WaitForSeconds(effectInfo.waitTime));

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

            Debug.Log("++++++animPathEnd: " + effectInfo.effect.animPathEnd);
            if (effectInfo.effect.animPathEnd != "temp")
            {
                GameObject effectPrefab = WarRes.GetPrefab(effectInfo.effect.animPathEnd);
                GameObject effectAnim   = GameObject.Instantiate <GameObject>(effectPrefab);
                effectAnim.transform.position = unit.transform.position;
                DelayDestory destoryTimer = effectAnim.GetComponent <DelayDestory>();
                if (destoryTimer != null && effectInfo.effect.time > 0)
                {
                    destoryTimer.DelayTime = effectInfo.effect.time;
                    effectInfo.effectAnim  = effectAnim;
                }
                // effectInfo.waitTime = 0.2f;
            }

            War.skillWarManager.StartCoroutine(autoHurtBuildAllHurtSingle(skillParameter, effectInfo, unit, needDealSkill2));
        }
        public int addShieldStart(SkillParameter skillParameter, EffectParameter effectParameter)
        {
            Debug.Log("=========" + effectParameter.effect.animPathStart + "++++++" + effectParameter.effect.animPathEnd);
            Dictionary <int, GameObject> animDic = new Dictionary <int, GameObject>();

            //播放技能特效
            foreach (UnitCtl unit in effectParameter.unitCtlList)//获取城市
            {
                if (effectParameter.effect.animPathStart != "temp")
                {
                    GameObject effectPrefab = WarRes.GetPrefab(effectParameter.effect.animPathStart);
                    GameObject effectAnim   = GameObject.Instantiate <GameObject>(effectPrefab);
                    effectAnim.transform.position = unit.transform.position;
                    DelayDestory destoryTimer = effectAnim.GetComponent <DelayDestory>();
                    if (destoryTimer != null)
                    {
                        destoryTimer.DelayTime = effectParameter.effect.time;
                    }
                    animDic.Add(unit.unitData.id, effectAnim);
                    unit.unitCtl.BeforeDamage += OnBeforeDamage;
                    unit.unitData.shield       = effectParameter.value;
                    War.skillWarManager.StartCoroutine(addShieldTimer(skillParameter, effectParameter));
                    Debug.Log("==============effect.time: " + effectParameter.effect.time);
                }
            }
            //处理特效,城市血没后要删除特效
            War.skillWarManager.StartCoroutine(delShieldWhenHurt(animDic, effectParameter.unitCtlList, effectParameter.effect.time));
            //处理技能2
            if (skillParameter.curDealSkillIdx == 1)
            {
                War.skillWarManager.dealSkill2Effect(skillParameter);
            }
            Debug.Log(string.Format("<color=yellow> addShield addvalue:{0} </color>",
                                    effectParameter.value));
            return(0);
        }
        public int heroSilence(SkillParameter skillParameter, EffectParameter effectParameter)
        {
            Debug.Log("=========" + effectParameter.effect.animPathStart + "++++++" + effectParameter.effect.animPathEnd);

            Prop[]         props          = new Prop[] { Prop.CreateInstance(PropId.StateSilence, 1) };
            AttachPropData attachPropData = new AttachPropData(props);

            foreach (UnitCtl unit in effectParameter.unitCtlList)
            {
                if (effectParameter.effect.animPathStart != "temp")
                {
                    GameObject effectPrefab = WarRes.GetPrefab(effectParameter.effect.animPathStart);
                    GameObject effectAnim   = GameObject.Instantiate <GameObject>(effectPrefab);
                    effectAnim.transform.position = unit.transform.position;
                    //DelayDestory destoryTimer = effectAnim.GetComponent<DelayDestory>();
                    //if (destoryTimer != null)
                    //{
                    //    destoryTimer.DelayTime = skillParameter.effect.time;
                    //}
                }
                //todo 沉默
                unit.unitData.AppProps(attachPropData, true);
                if (effectParameter.effect.time > 0)
                {
                    War.skillWarManager.StartCoroutine(heroSilenceSkill2Timer(effectParameter, attachPropData));
                }
                //处理技能2
                if (skillParameter.curDealSkillIdx == 1)
                {
                    War.skillWarManager.dealSkill2Effect(skillParameter);
                }
                Debug.Log(string.Format("<color=yellow> heroSilenceSkill2 to {0}  </color>",
                                        unit.unitData.id));
            }
            return(0);
        }
        public int effectDispel(SkillParameter skillParameter, EffectParameter effectParameter)
        {
            UnitCtl curUnit = War.scene.GetUnitForUID(effectParameter.curBuildUid);

            if (curUnit == null)
            {
                return(-1);
            }

            if (effectParameter.effect.animPathStart != "temp")
            {
                GameObject effectPrefab = WarRes.GetPrefab(effectParameter.effect.animPathStart.ToLower());
                GameObject effectAnim   = GameObject.Instantiate <GameObject>(effectPrefab);
                effectAnim.transform.position = curUnit.transform.position;
            }
            if (effectParameter.unitCtlList.Count <= 1)
            {
                Debug.Log("==============unitctllist count < 1");
                return(-1);
            }

            War.skillWarManager.StartCoroutine(effectDispelEnd(skillParameter, effectParameter));
            return(0);
        }