public void OnCreateHitBuff(CCreature foeCc) { for (int i = 0; i < m_buffList.Count; i++) { BuffBase buff = m_buffList[i]; if (buff.GetBuffType() == eBuffType.hitCreate) { ((Buff12)buff).CreateBuff(foeCc); } } }
/// <summary> /// 通过BUFF的攻击增减 /// </summary> public FixedPoint GetBuffSpeed(FixedPoint cur) { if (m_buffList == null) { return(FixedPoint.N_0); } FixedPoint newVal = FixedPoint.N_0; for (int i = 0; i < m_buffList.Count; i++) { BuffBase buff = m_buffList[i]; if (buff.GetBuffType() == eBuffType.speed) { FixedPoint pct = buff.GetVal1() * new FixedPoint(0.01f); newVal += cur * pct; } } return(newVal); }
/// <summary> /// 通过BUFF的攻击增减 /// </summary> public int GetBuffAp(int cur) { if (m_buffList == null) { return(0); } int newVal = 0; for (int i = 0; i < m_buffList.Count; i++) { BuffBase buff = m_buffList[i]; if (buff.GetBuffType() == eBuffType.atk) { FixedPoint pct = buff.GetVal1() * new FixedPoint(0.01f); newVal += (int)(cur * pct).value; } } return(newVal); }
/// <summary> /// 命中目标时,释放的技能包含击中BUFF,则触发 /// </summary> public void OnCreateAtkBuff(int skillIndex, CCreature foeCc) { if (m_buffList == null || skillIndex == -1) { return; } for (int i = 0; i < m_buffList.Count; i++) { BuffBase buff = m_buffList[i]; // 施法者身上包含命中BUFF,并且刚好是当前技能所包含的BUFF,则触发 if (buff.GetBuffType() == eBuffType.atkCreate) { if (m_dicSkill[skillIndex].m_skillDataInfo.ContainAtkBuff(buff.m_buffData.id)) { ((Buff11)buff).CreateBuff(foeCc); } } } }