|
|
@@ -386,6 +386,61 @@ local function getExtraHurt(attacker, defender, skillConfig)
|
|
|
-- 被动技能额外伤害
|
|
|
extraHurt = extraHurt + BeSkill.getExtraHurt(attacker, defender, skillConfig)
|
|
|
|
|
|
+ --buff, debuff 数量差的额外伤害
|
|
|
+ if skillConfig.otherArgs.buffDiffHurt then
|
|
|
+ local condInfo = skillConfig.otherArgs.buffDiffHurt
|
|
|
+ local buffType1 = condInfo[1] --buff类型1, 对应配置表buff中qusan分页中的type
|
|
|
+ local buffType2 = condInfo[2] --buff类型2, 对应配置表buff中qusan分页中的type
|
|
|
+ local chooseType1 = condInfo[3] --选择类型, 1-表示取被攻击者的某个属性, 2-取攻击者的某个属性
|
|
|
+ local calAttrType = condInfo[4] --用来计算伤害的属性类型, 与RoleDefine.lua中一致, 为0表示生命最大值
|
|
|
+ local calAttrRate = condInfo[5] --用来计算伤害的属性倍率, 万分比
|
|
|
+ local chooseType2 = condInfo[6] --选择类型, 1-表示取被攻击者的某个属性, 2-取攻击者的某个属性
|
|
|
+ local limitAttrType = condInfo[7] --用来判断伤害上限的属性类型, 与RoleDefine.lua中属性一致
|
|
|
+ local limitAttrRate = condInfo[8] --用来判断伤害上限的属性倍率, 多少倍就配多少
|
|
|
+
|
|
|
+ if buffType1 and buffType2 and chooseType1 and calAttrType and calAttrRate then
|
|
|
+ local buffCnt1 = CombatBuff.getCombatBufferCnt(defender, buffType1)
|
|
|
+ local buffCnt2 = CombatBuff.getCombatBufferCnt(defender, buffType2)
|
|
|
+ if buffCnt1 > buffCnt2 then
|
|
|
+ local calAttrValue = 0
|
|
|
+ local targetObj1 = defender
|
|
|
+ if chooseType1 == 2 then
|
|
|
+ targetObj1 = attacker
|
|
|
+ end
|
|
|
+
|
|
|
+ if calAttrType == 0 then
|
|
|
+ calAttrValue = CombatObj.getHpMax(targetObj1)
|
|
|
+ else
|
|
|
+ calAttrValue = CombatObj.getValue(targetObj1, calAttrType)
|
|
|
+ end
|
|
|
+ local hurt = calAttrValue * (calAttrRate / 10000)
|
|
|
+ hurt = hurt * (buffCnt1 - buffCnt2)
|
|
|
+
|
|
|
+ --上限判断
|
|
|
+ if chooseType2 and limitAttrType and limitAttrRate then
|
|
|
+ local limitAttrVale = 0
|
|
|
+ local targetObj2 = attacker
|
|
|
+ if chooseType2 == 1 then
|
|
|
+ targetObj2 = defender
|
|
|
+ end
|
|
|
+
|
|
|
+ if limitAttrType == 0 then
|
|
|
+ limitAttrVale = CombatObj.getHpMax(targetObj2)
|
|
|
+ else
|
|
|
+ limitAttrVale = CombatObj.getValue(targetObj2, limitAttrType)
|
|
|
+ end
|
|
|
+ local limitHurt = limitAttrVale * limitAttrRate
|
|
|
+
|
|
|
+ if hurt > limitHurt then
|
|
|
+ hurt = limitHurt
|
|
|
+ end
|
|
|
+ end
|
|
|
+ extraHurt = extraHurt + hurt
|
|
|
+ end
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
+
|
|
|
return extraHurt
|
|
|
end
|
|
|
|