protected override void Excute(CharHandler charHandler, int index = -1, int skillInstId = -1) { CharData charData = charHandler.m_CharData; List <CharHandler> targets = GetTargets(charHandler); float hurt; if (BattleEnum.Enum_CharType.Monster == charHandler.m_CharData.m_eType) { for (int i = 0; i < targets.Count; ++i) { hurt = BattleCalculate.MonsterNormalHurt(charData, targets[i].m_CharData); hurt = ChangeProperty.RatioCoefficient(hurt, SkillEnum.SkillKind.Force, charHandler, targets[i]); targets[i].BeHit(hurt, charHandler); } } else { for (int i = 0; i < targets.Count; ++i) { hurt = BattleCalculate.HeroNormalHurt(charData, targets[i].m_CharData); hurt = ChangeProperty.RatioCoefficient(hurt, SkillEnum.SkillKind.Force, charHandler, targets[i]); targets[i].BeHit(hurt, charHandler); } } }
public TickData(CharHandler charHandler, CharHandler aimCharHandler, SkillDataSon skillDataSon, int aimCharIndex, int skillInstId) { m_iInstanceID = ++iTickDataInstanceID; _CharHandler = charHandler; _AimCharHandler = aimCharHandler; m_SkillDataSon = skillDataSon; m_eBuffType = skillDataSon.GetSkillDataList()[0].m_eSkillSonType; _iAimCharIndex = aimCharIndex; float fTotalSecOri; if (float.TryParse(m_SkillDataSon.m_sTimeLong, out fTotalSecOri)) { m_fTotalSec = fTotalSecOri; } else { fTotalSecOri = Mathf.Ceil(BattleCalculate.ExcuteFormula(m_SkillDataSon.m_sTimeLong, m_SkillDataSon.m_sTimeMaxLong, charHandler, aimCharHandler)); m_fTotalSec = ChangeProperty.RatioCoefficient(fTotalSecOri, skillDataSon.m_Parent.m_eSkillKind, charHandler, aimCharHandler); } if (skillDataSon.m_bDeliver) { fTotalSecOri *= aimCharIndex + 1; } switch (m_eBuffType) { case SkillEnum.SkillSonType.Stun: m_fTotalSec = fTotalSecOri * (1 - aimCharHandler.m_CharData.StunDefRatio); //1 - 抗晕 break; case SkillEnum.SkillSonType.SkillForbid: m_fTotalSec = fTotalSecOri * (1 - aimCharHandler.m_CharData.ForbidDefRatio); //1 - 抗封 break; default: m_fTotalSec = fTotalSecOri; break; } if (m_fTotalSec > 0f) { m_fUnitSec = m_SkillDataSon.m_fTimeUnit; if (m_fUnitSec > 0f) { m_fTotalSec = m_fTotalSec - m_fTotalSec % m_fUnitSec; } else { m_fUnitSec = m_fTotalSec; } SetFunction(skillInstId); } }
private void BeHitCallback(CharHandler charHandler, CharHandler aimHandler) { float hurt; if (BattleEnum.Enum_CharType.Monster == charHandler.m_CharData.m_eType) { hurt = BattleCalculate.MonsterNormalHurt(charHandler.m_CharData, aimHandler.m_CharData); } else { hurt = BattleCalculate.HeroNormalHurt(charHandler.m_CharData, aimHandler.m_CharData); } hurt = ChangeProperty.RatioCoefficient(hurt, SkillEnum.SkillKind.Force, charHandler, aimHandler); aimHandler.BeHit(hurt, charHandler); }