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 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)); }
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); }
public int burnTag(EffectParameter effectParameter) { Debug.Log("=========: " + effectParameter.effect.animPathStart + " ++++++: " + effectParameter.effect.animPathEnd + " buffAnimPath: " + effectParameter.effect.buffAnimPath); foreach (UnitCtl unit in effectParameter.unitCtlList) { if (unit == null) { continue; } BuildSkillDots skillDots = unit.GetComponent <BuildSkillDots>(); if (skillDots != null) { skillDots.buildingBurnTag(effectParameter); } } Debug.Log(string.Format("<color=yellow> burnTag all effid={0} time={1} count={2}</color>", effectParameter.effect.id, effectParameter.effect.time, effectParameter.unitCtlList.Count)); return(0); }
IEnumerator stopSoldierEnd(SkillParameter skillParameter, EffectParameter effectParameter) { yield return(new WaitForSeconds(effectParameter.waitTime)); //所有士兵显示被击效果 //int unitType = 0; //unitType = unitType.USolider(true); //int relation = 0; //relation = relation.REnemy(true); //List<UnitCtl> unitSoldierList = War.scene.SearchUnit(unitType, effectParameter.caster.unitData.legionId, relation); foreach (UnitCtl unit in effectParameter.unitCtlList) { if (unit == null) { continue; } if (unit.unitData == null) { continue; } if (effectParameter.effect.animPathEnd != "temp") { GameObject effectPrefab = WarRes.GetPrefab(effectParameter.effect.animPathEnd.ToLower()); GameObject effectAnim = GameObject.Instantiate <GameObject>(effectPrefab); effectAnim.transform.position = unit.transform.position; } } Prop[] props = new Prop[] { Prop.CreateInstance(PropId.StateFreezedMoveSpeed, 1) }; AttachPropData attachPropData = new AttachPropData(props); Debug.LogFormat("=====stop soldier count:{0}", effectParameter.unitCtlList.Count); foreach (UnitCtl unit in effectParameter.unitCtlList) { if (unit == null) { continue; } if (unit.unitData == null) { continue; } if (unit.unitData.unitType == UnitType.Build) { BuildSkillDots skillDots = unit.GetComponent <BuildSkillDots>(); if (skillDots != null) { skillDots.buildStopSendsoldier(effectParameter); } } else { if (effectParameter.effect.buffAnimPath != "temp") { GameObject effectPrefab = WarRes.GetPrefab(effectParameter.effect.buffAnimPath.ToLower()); GameObject effectAnim = GameObject.Instantiate <GameObject>(effectPrefab); effectAnim.transform.position = unit.transform.position; DelayDestory destoryTimer = effectAnim.GetComponent <DelayDestory>(); if (destoryTimer != null) { destoryTimer.DelayTime = effectParameter.value; } } unit.unitData.AppProps(attachPropData, true); } } if (effectParameter.value > 0) { War.skillWarManager.StartCoroutine(stopSoldierTimer(effectParameter, attachPropData)); } Debug.Log(string.Format("<color=yellow> stopSoldier all skill id={0} effid={1} {2}</color>", skillParameter.skillId, effectParameter.effect.id, effectParameter.value)); }