属性加成修改

This commit is contained in:
Fang 2023-09-13 17:58:57 +08:00
parent 3f17beb2f2
commit ae7e52d6ea
2 changed files with 14 additions and 6 deletions

View File

@ -211,9 +211,10 @@ function HeroEntity:updateRunesAttr()
local skillHurt = self:getRunes():getAttrValue(GConst.MATCH_SKILL_HURT_NAME[self:getMatchType()]) local skillHurt = self:getRunes():getAttrValue(GConst.MATCH_SKILL_HURT_NAME[self:getMatchType()])
local critPer = self:getRunes():getAttrValue(GConst.MATCH_CRIT_NAME[self:getMatchType()]) local critPer = self:getRunes():getAttrValue(GConst.MATCH_CRIT_NAME[self:getMatchType()])
local critHurtPer = self:getRunes():getAttrValue(GConst.MATCH_CRIT_TIME_NAME[self:getMatchType()]) local critHurtPer = self:getRunes():getAttrValue(GConst.MATCH_CRIT_TIME_NAME[self:getMatchType()])
local normalHurtPer = self:getRunes():getAttrValue(GConst.MATCH_NORMAL_HURTP_NAME[self:getMatchType()]) local normalHurtPer = self:getRunes():getAttrValue(GConst.MATCH_NORMAL_HURTP_NAME[self:getMatchType()], true)
local skillHurtPer = self:getRunes():getAttrValue(GConst.MATCH_SKILL_HURTP_NAME[self:getMatchType()]) local skillHurtPer = self:getRunes():getAttrValue(GConst.MATCH_SKILL_HURTP_NAME[self:getMatchType()], true)
local healPer = self:getRunes():getAttrValue(GConst.MATCH_CURED_NAME[self:getMatchType()]) local healPer = self:getRunes():getAttrValue(GConst.MATCH_CURED_NAME[self:getMatchType()])
local allHurtp = self:getRunes():getAttrValue(GConst.MATCH_ALL_HURTP_NAME[self:getMatchType()])
self.runesAttr[GConst.MATCH_HP_NAME[self:getMatchType()]] = hp self.runesAttr[GConst.MATCH_HP_NAME[self:getMatchType()]] = hp
self.runesAttr[GConst.MATCH_ATTACK_NAME[self:getMatchType()]] = atk self.runesAttr[GConst.MATCH_ATTACK_NAME[self:getMatchType()]] = atk
@ -224,6 +225,7 @@ function HeroEntity:updateRunesAttr()
self.runesAttr[GConst.MATCH_NORMAL_HURTP_NAME[self:getMatchType()]] = normalHurtPer self.runesAttr[GConst.MATCH_NORMAL_HURTP_NAME[self:getMatchType()]] = normalHurtPer
self.runesAttr[GConst.MATCH_SKILL_HURTP_NAME[self:getMatchType()]] = skillHurtPer self.runesAttr[GConst.MATCH_SKILL_HURTP_NAME[self:getMatchType()]] = skillHurtPer
self.runesAttr[GConst.MATCH_CURED_NAME[self:getMatchType()]] = healPer self.runesAttr[GConst.MATCH_CURED_NAME[self:getMatchType()]] = healPer
self.runesAttr[GConst.MATCH_ALL_HURTP_NAME[self:getMatchType()]] = allHurtp
if EDITOR_MODE then if EDITOR_MODE then
local printStr = "" local printStr = ""
@ -237,6 +239,7 @@ function HeroEntity:updateRunesAttr()
printStr = printStr .. "普攻增伤百分比:".. normalHurtPer .. "\n" printStr = printStr .. "普攻增伤百分比:".. normalHurtPer .. "\n"
printStr = printStr .. "技能增伤百分比:".. skillHurtPer .. "\n" printStr = printStr .. "技能增伤百分比:".. skillHurtPer .. "\n"
printStr = printStr .. "治疗加成百分比:".. healPer .. "\n" printStr = printStr .. "治疗加成百分比:".. healPer .. "\n"
printStr = printStr .. "所有伤害百分比:".. allHurtp .. "\n"
Logger.logHighlight(printStr) Logger.logHighlight(printStr)
end end
end end
@ -551,7 +554,7 @@ function HeroEntity:getTotalBaseHp()
end end
end end
result = result + DataManager.SkinData:getBaseHp(self) result = result + DataManager.SkinData:getBaseHp(self)
result = result + self:getRunes():getAttrValue(GConst.MATCH_HP_FIX_NAME, true) result = result + self:getRunes():getAttrValue(GConst.MATCH_HP_FIX_NAME[self:getMatchType()], true)
return result return result
end end
@ -569,8 +572,8 @@ function HeroEntity:getTotalBaseAtk()
end end
-- logStr = logStr .. "\nSKIN" .. DataManager.SkinData:getBaseAttack(self) -- logStr = logStr .. "\nSKIN" .. DataManager.SkinData:getBaseAttack(self)
result = result + DataManager.SkinData:getBaseAttack(self) result = result + DataManager.SkinData:getBaseAttack(self)
-- logStr = logStr .. "\nRUNES" .. self:getRunes():getAttrValue(GConst.MATCH_ATTACK_NAME, true) -- logStr = logStr .. "\nRUNES" .. self:getRunes():getAttrValue(GConst.MATCH_ATTACK_NAME[self:getMatchType()], true)
result = result + self:getRunes():getAttrValue(GConst.MATCH_ATTACK_NAME, true) result = result + self:getRunes():getAttrValue(GConst.MATCH_ATTACK_NAME[self:getMatchType()], true)
-- Logger.logHighlight(logStr) -- Logger.logHighlight(logStr)
return result return result
end end

View File

@ -199,6 +199,11 @@ end
-- 获取属性 , isBase是否是基础配置的属性 -- 获取属性 , isBase是否是基础配置的属性
function RunesEntity:getAttrValue(attrType, isBase) function RunesEntity:getAttrValue(attrType, isBase)
if type(attrType) ~= "string" then
Logger.logError("获取符文属性传入格式错误")
return 0
end
local result local result
if not isBase and attrType == GConst.MATCH_HP_FIX_NAME[self:getHeroEntity():getMatchType()] then if not isBase and attrType == GConst.MATCH_HP_FIX_NAME[self:getHeroEntity():getMatchType()] then
result = self:getAttrValue(GConst.MATCH_HP_FIX_NAME[self:getHeroEntity():getMatchType()], true) result = self:getAttrValue(GConst.MATCH_HP_FIX_NAME[self:getHeroEntity():getMatchType()], true)
@ -210,7 +215,7 @@ function RunesEntity:getAttrValue(attrType, isBase)
return result return result
elseif not isBase and (attrType == GConst.MATCH_NORMAL_HURTP_NAME[self:getHeroEntity():getMatchType()] or attrType == GConst.MATCH_SKILL_HURTP_NAME[self:getHeroEntity():getMatchType()]) then elseif not isBase and (attrType == GConst.MATCH_NORMAL_HURTP_NAME[self:getHeroEntity():getMatchType()] or attrType == GConst.MATCH_SKILL_HURTP_NAME[self:getHeroEntity():getMatchType()]) then
result = self:getAttrValue(attrType, true) result = self:getAttrValue(attrType, true)
result = result + self:getAttrValue(GConst.MATCH_ALL_HURTP_NAME, true) result = result + self:getAttrValue(GConst.MATCH_ALL_HURTP_NAME[self:getHeroEntity():getMatchType()], true)
return result return result
else else
local all = self:getAllAttr() local all = self:getAllAttr()