修改平分概率类型的技能的概率计算方式

dev_chengFeng
gaoxin 2020-08-07 17:35:16 +08:00
parent 723531298d
commit a35b26a215
1 changed files with 20 additions and 13 deletions

View File

@ -3235,9 +3235,9 @@ local passivityList = {
local af = 0
local onSkillCast = function(skill)
local targets = skill:GetDirectTargets()
if targets and #targets > 0 then
af = BattleUtil.ErrorCorrection(f1/#targets)
local maxNum = skill:GetMaxTargetNum()
if maxNum and maxNum > 0 then
af = BattleUtil.ErrorCorrection(f1/maxNum)
end
end
role.Event:AddEvent(BattleEventName.SkillCast, onSkillCast)
@ -3309,9 +3309,9 @@ local passivityList = {
local af = 0
local onSkillCast = function(skill)
local targets = skill.effectTargets[2]
if targets and #targets > 0 then
af = BattleUtil.ErrorCorrection(f1/#targets)
local maxNum = skill:GetMaxTargetNum()
if maxNum and maxNum > 0 then
af = BattleUtil.ErrorCorrection(f1/maxNum)
end
end
role.Event:AddEvent(BattleEventName.SkillCast, onSkillCast)
@ -3365,9 +3365,9 @@ local passivityList = {
local af = 0
local onSkillCast = function(skill)
local targets = skill:GetDirectTargets()
if targets and #targets > 0 then
af = BattleUtil.ErrorCorrection(f1/#targets)
local maxNum = skill:GetMaxTargetNum()
if maxNum and maxNum > 0 then
af = BattleUtil.ErrorCorrection(f1/maxNum)
end
end
role.Event:AddEvent(BattleEventName.SkillCast, onSkillCast)
@ -3436,9 +3436,9 @@ local passivityList = {
local af = 0
local onSkillCast = function(skill)
local targets = skill:GetDirectTargets()
if targets and #targets > 0 then
af = BattleUtil.ErrorCorrection(f1/#targets)
local maxNum = skill:GetMaxTargetNum()
if maxNum and maxNum > 0 then
af = BattleUtil.ErrorCorrection(f1/maxNum)
end
end
role.Event:AddEvent(BattleEventName.SkillCast, onSkillCast)
@ -3715,9 +3715,16 @@ local passivityList = {
local OnRoleDamageBefore = function(defRole, factorFunc, damageType, skill)
if skill then
-- 计算概率
local cf = f1
local maxNum = skill:GetMaxTargetNum()
if maxNum and maxNum > 0 then
cf = cf/maxNum
end
local targets = skill:GetDirectTargets()
if not targets or #targets == 0 then return end
local cf = f1/#targets
for _, target in ipairs(targets) do
BattleUtil.RandomAction(cf, function()
BattleLogic.BuffMgr:ClearBuff(target, function(buff)