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 ReviveHero(SkillData skillData, CharHandler charHandler, List <CharHandler> targets) { CharHandler aimCharHandler = targets[0]; float value = BattleCalculate.ExcuteFormula(skillData.m_sEffectExpress, skillData.m_sEffectExpressMax, charHandler, aimCharHandler); aimCharHandler.m_CharData.CurHP = value; BattleManager.GetInst().m_CharInScene.ReAddChar(aimCharHandler); aimCharHandler.Revive(); }
private void CheckRate(SkillDataWhole skillDataWhole, CharHandler charHandler, ref List <CharHandler> targets) { for (int i = targets.Count - 1; i >= 0; --i) { float rate = BattleCalculate.ExcuteFormula(skillDataWhole.m_sEffectRate, null, charHandler, targets[i]); if (Random.Range(0f, 1f) > rate) { HUDTextMgr.GetInst().NewText(ConfigData.GetValue("Lan_Battle_Client", "15", "Text"), targets[i], HUDTextMgr.HUDTextType.BUFF); //"释放不成功" targets.RemoveAt(i); } } }
protected bool CheckRate(SkillDataWhole skillDataWhole, CharHandler charHandler, CharHandler target) { float rate = BattleCalculate.ExcuteFormula(skillDataWhole.m_sEffectRate, null, charHandler, target); if (Random.Range(0f, 1f) > rate) { HUDTextMgr.GetInst().NewText(ConfigData.GetHUDText("15"), target, HUDTextMgr.HUDTextType.BUFF); //"释放不成功" return(false); } return(true); }
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); }
public static void Change(SkillData skillData, CharHandler charHandler, CharHandler aimCharHandler, int aimCharIndex, TickData tickData = null, int skillInstId = -1) { float fValue = 0.0f; if (string.Empty != skillData.m_sEffectExpress) { fValue = Mathf.Max(0, BattleCalculate.ExcuteFormula(skillData.m_sEffectExpress, skillData.m_sEffectExpressMax, charHandler, aimCharHandler)) * skillData.m_iHurtTypeSign; fValue = RatioCoefficient(fValue, skillData.m_Parent.m_Parent.m_eSkillKind, charHandler, aimCharHandler); if (skillData.m_Parent.m_bDeliver) { fValue *= aimCharIndex + 1; } } SkillEnum.SkillSonType hurtType = skillData.m_eSkillSonType; switch (hurtType) { #region --攻防血魔 case SkillEnum.SkillSonType.Attack: fValue = CtrlValue(aimCharHandler.m_CharData.CurAttack, fValue); _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddAttack, ConfigData.GetHUDText("23"), ConfigData.GetHUDText("23")); //"攻 {1}{0:N0}" break; case SkillEnum.SkillSonType.Defence: fValue = CtrlValue(aimCharHandler.m_CharData.CurDefence, fValue); _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddDefence, ConfigData.GetHUDText("24"), ConfigData.GetHUDText("24")); //"防 {1}{0:N0}" break; case SkillEnum.SkillSonType.HP: _ChangeHP(aimCharHandler, fValue, charHandler, skillData); if (null != tickData) { if (tickData.m_fUnitSec == tickData.m_fTotalSec) { tickData.funcTick = null; } else { tickData.funcTick = () => { _ChangeHP(aimCharHandler, fValue, charHandler, skillData); } }; } break; case SkillEnum.SkillSonType.MP: _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddMP, ConfigData.GetHUDText("25"), ConfigData.GetHUDText("25")); //"士气 {1}{0:N0}" break; #endregion #region --三维属性 case SkillEnum.SkillSonType.Force: _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddForce, ConfigData.GetHUDText("26"), ConfigData.GetHUDText("26")); // "武 {1}{0:N0}" break; case SkillEnum.SkillSonType.Soul: _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddSoul, ConfigData.GetHUDText("27"), ConfigData.GetHUDText("27")); //"魂 {1}{0:N0}" break; case SkillEnum.SkillSonType.Magic: _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddMagic, ConfigData.GetHUDText("28"), ConfigData.GetHUDText("28")); //"法 {1}{0:N0}" break; case SkillEnum.SkillSonType.ForceRatio: _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddForceRatio, ConfigData.GetHUDText("29"), ConfigData.GetHUDText("30")); //"武提升 {1}{0:P1}","武提升结束" break; case SkillEnum.SkillSonType.SoulRatio: _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddSoulRatio, ConfigData.GetHUDText("31"), ConfigData.GetHUDText("32")); //"魂提升 {1}{0:P1}","魂提升结束" break; case SkillEnum.SkillSonType.MagicRatio: _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddMagicRatio, ConfigData.GetHUDText("33"), ConfigData.GetHUDText("34")); //"法提升 {1}{0:P1}","法提升结束" break; #endregion #region --武功魂技法术系数 case SkillEnum.SkillSonType.ForceSkillAtkRatio: _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddForceSkillAtkRatio, ConfigData.GetHUDText("35"), ConfigData.GetHUDText("36")); // "武功提升 {1}{0:P1}","武功提升结束" break; case SkillEnum.SkillSonType.SoulSkillAtkRatio: _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddSoulSkillAtkRatio, ConfigData.GetHUDText("37"), ConfigData.GetHUDText("38")); // "魂技提升 {1}{0:P1}","魂技提升结束" break; case SkillEnum.SkillSonType.MagicSkillAtkRatio: _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddMagicSkillAtkRatio, ConfigData.GetHUDText("39"), ConfigData.GetHUDText("40")); //"法术提升 {1}{0:P1}", "法术提升结束" break; case SkillEnum.SkillSonType.ForceSkillDefRatio: _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddForceSkillDefRatio, ConfigData.GetHUDText("41"), ConfigData.GetHUDText("42")); // "武功免伤 {1}{0:P1}", "武功免伤结束" break; case SkillEnum.SkillSonType.SoulSkillDefRatio: _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddSoulSkillDefRatio, ConfigData.GetHUDText("43"), ConfigData.GetHUDText("44")); //"魂技免伤 {1}{0:P1}","魂技免伤结束" break; case SkillEnum.SkillSonType.MagicSkillDefRatio: _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddMagicSkillDefRatio, ConfigData.GetHUDText("45"), ConfigData.GetHUDText("46")); // "法术免伤 {1}{0:P1}", "法术免伤结束" break; #endregion #region --暴击治疗系数 case SkillEnum.SkillSonType.CriticalRatio: _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddCriticalRatio, ConfigData.GetHUDText("47"), ConfigData.GetHUDText("48")); // "暴击率 {1}{0:P1}","暴击率恢复" break; case SkillEnum.SkillSonType.CureUpRatio: _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddCureUpRatio, ConfigData.GetHUDText("49"), ConfigData.GetHUDText("50")); // "治疗提升 {1}{0:P1}","治疗提升结束" break; case SkillEnum.SkillSonType.CureDownRatio: _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddCureDownRatio, ConfigData.GetHUDText("51"), ConfigData.GetHUDText("52")); //"治疗压制 {1}{0:P1}","治疗压制结束" break; #endregion #region --数值盾 case SkillEnum.SkillSonType.Absorb: Absorb(fValue, aimCharHandler, tickData); break; case SkillEnum.SkillSonType.AbsorbHP: AbsorbHP(fValue, aimCharHandler, tickData); break; case SkillEnum.SkillSonType.Rebound: Rebound(fValue, aimCharHandler, tickData); break; case SkillEnum.SkillSonType.SuperAbsorb: SuperAbsorb(fValue, aimCharHandler, tickData); break; #endregion case SkillEnum.SkillSonType.SkillForbid: SkillForbid(aimCharHandler, tickData); break; case SkillEnum.SkillSonType.SoulSkillInvalid: SoulSkillInvalid(aimCharHandler, tickData); break; case SkillEnum.SkillSonType.Stun: Stun(aimCharHandler, tickData); break; case SkillEnum.SkillSonType.Unbeatable: UbBeatable(aimCharHandler, tickData); break; case SkillEnum.SkillSonType.Concentrate: Concentrate(aimCharHandler, tickData); break; case SkillEnum.SkillSonType.Connect: Connect(fValue, aimCharHandler, tickData, skillInstId); break; default: break; } }