This commit is contained in:
chenxi 2023-04-24 21:46:39 +08:00
parent 94e9a6cc18
commit f01edc8f5a
2 changed files with 8 additions and 1 deletions

View File

@ -24,7 +24,7 @@ BattleFormula.calculateFormula = {
local crit = unitComp.unitEntity:getCrit() local crit = unitComp.unitEntity:getCrit()
if crit > 0 then if crit > 0 then
if BattleHelper:random(1, DEFAULT_FACTOR) <= crit then -- 暴击了 if BattleHelper:random(1, DEFAULT_FACTOR) <= crit then -- 暴击了
result = result * (DEFAULT_FACTOR + unitComp.unitEntity:getCrittime()) // DEFAULT_FACTOR result = result * (BattleHelper:getDefaultCrittime() + unitComp.unitEntity:getCrittime()) // DEFAULT_FACTOR
hurtState = HURT_STATE_CRIT hurtState = HURT_STATE_CRIT
end end
end end

View File

@ -62,6 +62,13 @@ function BattleHelper:getSupportInterval()
return self.supportInterval return self.supportInterval
end end
function BattleHelper:getDefaultCrittime()
if self.defaultCrittime == nil then
self.defaultCrittime = GFunc.getConstIntValue("crit_dmg")
end
return self.defaultCrittime
end
function BattleHelper:loadBattleHeroModel(id, parent, callback) function BattleHelper:loadBattleHeroModel(id, parent, callback)
local pool = self.characterPools[id] local pool = self.characterPools[id]
if pool and #pool > 0 then if pool and #pool > 0 then