public IEnumerator IEStartSkill(BattleRoleData source, BattleRoleData target) { source.playMoveTowardAnimation(target.unit_model.position); yield return(new WaitForSeconds(moveTowardAndBackTime)); source.unit_character_model.CurrentCharacterModel.ChangeModelAnim (source.unit_character_model.CurrentCharacterModel.anim_attack, false); SLEffectManager.Instance.playCommonEffectSlash(target.transform.position); yield return(new WaitForSeconds(SDConstants.AnimTime_ATTACK - hitTime)); int damage = dmgCaused(source, target); #region 计算技能状态 source.SkillCheck(this, target); IsCausedCritDmg = source.CritHappen; IsCausedMiss = !source.AccurHappen; IsCausedFault = source.FaultHappen; if (IsCausedCritDmg) { float criD = AllRandomSetClass.SimplePercentToDecimal (source.ThisBasicRoleProperty().CRIDmg + 100); damage = (int)(damage * criD); } int NowExpect = (int)(UnityEngine.Random.Range(-1f, 1f) * source.ExpectResult); #endregion damage += NowExpect; #region 输技能状态 target.HpController.isCriDmg = IsCausedCritDmg; target.HpController.isEvoHappen = IsCausedMiss; target.HpController.isFault = IsCausedFault; #endregion damage = (int)(damage * AllRandomSetClass.SimplePercentToDecimal(100 + target.PhysModify)); Debug.Log(source.name + " slash cause " + damage + " damage to " + target.name); target.HpController.getDamage(damage, SkillKind.Physical); yield return(new WaitForSeconds(hitTime)); //yield return new WaitForSeconds(skillLastTime); source.unit_character_model.CurrentCharacterModel.ChangeModelAnim (source.unit_character_model.CurrentCharacterModel.anim_idle, true); source.playMoveBackAnimation(); yield return(new WaitForSeconds(moveTowardAndBackTime)); StartCoroutine(IEWaitForEnd(source)); }
public IEnumerator IEStartSkill(BattleRoleData source, BattleRoleData target, NumberData _val, bool useSpecial = false) { source.unit_character_model.CurrentCharacterModel.ChangeModelAnim (source.unit_character_model.CurrentCharacterModel.anim_cast, false); SLEffectManager.Instance.playCommonEffectCast(source.transform.position); yield return(new WaitForSeconds(castLastTime)); int val = _val.DATA; if (_val.dataTag == NumberData.DataType.percent) { val = (int)(target.HpController.MaxHp * _val.DECIMAL); } if (useSpecial) { #region 计算技能状态 source.SkillCheck(this, target); IsCausedCritDmg = source.CritHappen; IsCausedMiss = !source.AccurHappen; IsCausedFault = source.FaultHappen; float criD = 1; if (IsCausedCritDmg) { criD = AllRandomSetClass.SimplePercentToDecimal (source.ThisBasicRoleProperty().CRIDmg + 100); } int NowExpect = (int)(UnityEngine.Random.Range(-1f, 1f) * source.ExpectResult); #endregion val = (int)(val * criD); val += NowExpect; #region 输技能状态 target.HpController.isCriDmg = IsCausedCritDmg; target.HpController.isEvoHappen = IsCausedMiss; target.HpController.isFault = IsCausedFault; #endregion } SLEffectManager.Instance.playCommonEffectLocalBarChartAdd(target.transform.position); yield return(new WaitForSeconds(effectLastTime)); Debug.Log(source.name + " heal cause " + val + " to " + target.name); target.HpController.addHp(val); yield return(new WaitForSeconds(skillLastTime)); StartCoroutine(IEWaitForShortEnd(source)); }
public IEnumerator IEStartSkill(BattleRoleData source, BattleRoleData target, int dmgVal) { source.unit_character_model.CurrentCharacterModel.ChangeModelAnim (source.unit_character_model.CurrentCharacterModel.anim_cast, false); SLEffectManager.Instance.playCommonEffectCast(source.transform.position); yield return(new WaitForSeconds(castLastTime)); source.playBulletCastAnimation(bullet, source.unit_model.position, target.unit_model.position); yield return(new WaitForSeconds(bulletLastTime)); #region 计算技能状态 source.SkillCheck(this, target); IsCausedCritDmg = source.CritHappen; IsCausedMiss = !source.AccurHappen; IsCausedFault = source.FaultHappen; float criD = 1; if (IsCausedCritDmg) { criD = AllRandomSetClass.SimplePercentToDecimal (source.ThisBasicRoleProperty().CRIDmg + 100); } int NowExpect = (int)(UnityEngine.Random.Range(-1f, 1f) * source.ExpectResult); #endregion dmgVal = (int)(dmgVal * criD); dmgVal += NowExpect; Debug.Log(source.name + "shoot cause" + dmgVal + " damage to " + target.name); //source.unit_character_model.CurrentCharacterModel.ChangeModelAnim(SDConstants.AnimName_IDLE, true); #region 输技能状态 target.HpController.isCriDmg = IsCausedCritDmg; target.HpController.isEvoHappen = IsCausedMiss; target.HpController.isFault = IsCausedFault; #endregion dmgVal = (int)(dmgVal * AllRandomSetClass.SimplePercentToDecimal(100 + target.PhysModify)); target.HpController.getDamage(dmgVal, _skillKind); yield return(new WaitForSeconds(skillLastTime)); StartCoroutine(IEWaitForEnd(source)); }
public IEnumerator IEStartSkill(BattleRoleData source, BattleRoleData target , int physicalVal, int elementalVal, int arcaneVal) { source.unit_character_model.CurrentCharacterModel.ChangeModelAnim (source.unit_character_model.CurrentCharacterModel.anim_cast, false); SLEffectManager.Instance.playCommonEffectCast(source.transform.position); yield return(new WaitForSeconds(castLastTime)); source.playBulletCastAnimation(bullet, source.unit_model.position, target.unit_model.position); yield return(new WaitForSeconds(bulletLastTime)); int d0 = physicalVal; int d1 = elementalVal; int d2 = arcaneVal; #region 计算技能状态 source.SkillCheck(this, target); IsCausedCritDmg = source.CritHappen; IsCausedMiss = !source.AccurHappen; IsCausedFault = source.FaultHappen; if (IsCausedCritDmg) { float criD = AllRandomSetClass.SimplePercentToDecimal (source.ThisBasicRoleProperty().CRIDmg + 100); d0 = (int)(d0 * criD); d1 = (int)(d1 * criD); d2 = (int)(d2 * criD); } #endregion #region Expect int NowExpect = (int)(UnityEngine.Random.Range(-1f, 1f) * source.ExpectResult); d0 += NowExpect; NowExpect = (int)(UnityEngine.Random.Range(-1f, 1f) * source.ExpectResult); d1 += NowExpect; NowExpect = (int)(UnityEngine.Random.Range(-1f, 1f) * source.ExpectResult); d2 += NowExpect; #endregion #region 输技能状态 target.HpController.isCriDmg = IsCausedCritDmg; target.HpController.isEvoHappen = IsCausedMiss; target.HpController.isFault = IsCausedFault; #endregion float DECIMAL = AllRandomSetClass.SimplePercentToDecimal(100 + target.PhysModify); d0 = (int)(d0 * DECIMAL); d1 = (int)(d1 * DECIMAL); d2 = (int)(d2 * DECIMAL); Debug.Log(source.name + " slash cause " + d0 + " physical damage " + d1 + " elemental damage " + d2 + " arcane damage" + " to " + target.name); target.HpController.getDamage(d0, SkillKind.Physical); target.HpController.getDamage(d1, SkillKind.Elemental); target.HpController.getDamage(d2, SkillKind.Arcane); yield return(new WaitForSeconds(skillLastTime)); StartCoroutine(IEWaitForEnd(source)); }