diff --git a/lua/app/global/global_func.lua b/lua/app/global/global_func.lua index 6b240222..8e705a5a 100644 --- a/lua/app/global/global_func.lua +++ b/lua/app/global/global_func.lua @@ -2074,27 +2074,7 @@ function GFunc.getBuffDesc(buffName, effectNum, ispercent) end function GFunc.getAttrDesc(attrName, attrNum) - attrNum = GFunc.getAttrShowValue(attrName, attrNum, true) - return I18N:getTextWithOtherKey("attr", "name", attrName, "desc", attrNum) -end - --- 获取属性用于显示的数值 -function GFunc.getAttrShowValue(attrType, attrNum, notPercentSign) - if table.containValue(GConst.MATCH_ATTACK_ADD_NAME, attrType) or - table.containValue(GConst.MATCH_HP_ADD_NAME, attrType) or - table.containValue(GConst.MATCH_NORMAL_HURTP_NAME, attrType) or - table.containValue(GConst.MATCH_SKILL_HURTP_NAME, attrType) or - table.containValue(GConst.MATCH_CRIT_NAME, attrType) or - table.containValue(GConst.MATCH_CRIT_TIME_NAME, attrType) or - table.containValue(GConst.MATCH_CURED_NAME, attrType) or - table.containValue(GConst.MATCH_ALL_ATKP_NAME, attrType) or - table.containValue(GConst.MATCH_ALL_HURTP_NAME, attrType) - then - local str = notPercentSign and "" or "%" - return attrNum // GConst.BattleConst.PERCENT_FACTOR .. str - else - return attrNum // GConst.BattleConst.DEFAULT_FACTOR - end + return I18N:getTextWithOtherKey("attr", "name", attrName, "desc", GFunc.getFinalAttrValue(attrName, attrNum)) end -- 属性id转属性名 diff --git a/lua/app/module/daily_challenge/daily_challenge_manager.lua b/lua/app/module/daily_challenge/daily_challenge_manager.lua index ad73872e..739f7bf9 100644 --- a/lua/app/module/daily_challenge/daily_challenge_manager.lua +++ b/lua/app/module/daily_challenge/daily_challenge_manager.lua @@ -179,6 +179,7 @@ function DailyChallengeManager:dealTaskProgress(battleController) local comboOver10Count = battleController.taskProgress[GConst.BattleConst.BATTLE_TASK_FIELD.COMBO_OVER_10] local linkCountOver8Count = battleController.taskProgress[GConst.BattleConst.BATTLE_TASK_FIELD.LINK_COUNT_OVER_8] + local killBossTurn = battleController.taskProgress[GConst.BattleConst.BATTLE_TASK_FIELD.KILLS_BOSS_TURN] local skillCountMap = {} local damageMatchTypeMap = {} @@ -206,11 +207,11 @@ function DailyChallengeManager:dealTaskProgress(battleController) end local taskProgress = { - [3] = comboOver10Count, - [4] = linkCountOver8Count, - [5] = skillCountMap, - [7] = damageHeroMap, - [8] = damageMatchTypeMap + [2] = comboOver10Count, + [3] = linkCountOver8Count, + [4] = skillCountMap, + [5] = killBossTurn, + [6] = damageMatchTypeMap, } return taskProgress end diff --git a/lua/app/ui/hero/cell/attr_cell.lua b/lua/app/ui/hero/cell/attr_cell.lua index 8cb1664d..84d9f498 100644 --- a/lua/app/ui/hero/cell/attr_cell.lua +++ b/lua/app/ui/hero/cell/attr_cell.lua @@ -56,7 +56,7 @@ function AttrCell:showHp() value = value + DataManager.SkinData:getHp(self.heroEntity) end - self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value)) + self.txValue:setText(GFunc.getFinalAttrValue(self.attrName, value)) end -- 显示攻击力 @@ -81,7 +81,7 @@ function AttrCell:showAtk() value = value + DataManager.SkinData:getAttack(self.heroEntity) end - self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value)) + self.txValue:setText(GFunc.getFinalAttrValue(self.attrName, value)) end -- 显示普攻增伤 @@ -97,7 +97,7 @@ function AttrCell:showNormalHurt() value = value + DataManager.SkinData:getNormalHurt(self.heroEntity) end - self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value)) + self.txValue:setText(GFunc.getFinalAttrValue(self.attrName, value)) end -- 显示技能增伤 @@ -113,7 +113,7 @@ function AttrCell:showSkillHurt() value = value + DataManager.SkinData:getSkillHurt(self.heroEntity) end - self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value)) + self.txValue:setText(GFunc.getFinalAttrValue(self.attrName, value)) end -- 显示暴击率 @@ -129,7 +129,7 @@ function AttrCell:showCrit() value = value + DataManager.SkinData:getCritPercent(self.heroEntity) end - self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value)) + self.txValue:setText(GFunc.getFinalAttrValue(self.attrName, value)) end -- 显示暴击伤害百分比 @@ -145,7 +145,7 @@ function AttrCell:showCritAtk() value = value + DataManager.SkinData:getCritHurtPercent(self.heroEntity) end - self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value)) + self.txValue:setText(GFunc.getFinalAttrValue(self.attrName, value)) end -- 显示普攻增伤百分比 @@ -163,7 +163,7 @@ function AttrCell:showNormalHurtp() value = value + DataManager.SkinData:getNormalHurtPercent(self.heroEntity) end - self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value)) + self.txValue:setText(GFunc.getFinalAttrValue(self.attrName, value)) end -- 显示技能增伤百分比 @@ -181,7 +181,7 @@ function AttrCell:showSkillHurtp() value = value + DataManager.SkinData:getSkillHurtPercent(self.heroEntity) end - self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value)) + self.txValue:setText(GFunc.getFinalAttrValue(self.attrName, value)) end -- 显示治疗效果提升百分比 @@ -197,7 +197,7 @@ function AttrCell:showCured() value = value + DataManager.SkinData:getHealPercent(self.heroEntity) end - self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value)) + self.txValue:setText(GFunc.getFinalAttrValue(self.attrName, value)) end return AttrCell \ No newline at end of file diff --git a/lua/app/ui/hero/cell/lv_cell.lua b/lua/app/ui/hero/cell/lv_cell.lua index 3cf4d575..132fd5e5 100644 --- a/lua/app/ui/hero/cell/lv_cell.lua +++ b/lua/app/ui/hero/cell/lv_cell.lua @@ -26,7 +26,7 @@ function StarCell:refresh(heroEntity, idx) local attr = heroEntity:getLvAttrCfg(idx) local attrIdx = GFunc.getAttrIdByName(attr.type) - local attrNum = GFunc.getAttrShowValue(attr.type, attr.num, true) + local attrNum = GFunc.getFinalAttrValue(attr.type, attr.num) local descTx = "" if not table.containValue(GConst.MATCH_ALL_ATKP_NAME, attr.type) then descTx = I18N:getText("attr", attrIdx, "desc", heroEntity:getName(), attrNum) diff --git a/lua/app/ui/talent/talent_main_ui.lua b/lua/app/ui/talent/talent_main_ui.lua index e66eaed1..d96b0ff4 100644 --- a/lua/app/ui/talent/talent_main_ui.lua +++ b/lua/app/ui/talent/talent_main_ui.lua @@ -70,6 +70,7 @@ function TalentMainUI:onLoadRootComplete() self.upNode:addClickListener(function() self.upNode:setActive(false) + DataManager.HeroData:calcPower() end) self:bind(DataManager.TalentData, "isDirty", function() @@ -110,7 +111,7 @@ function TalentMainUI:onUpgrade() local attr, num = DataManager.TalentData:getAttrById(upData.id) local str = I18N:getText("talent", upData.id, "desc") if attr and #attr > 0 then - str = str .. GFunc.getPerStr(attr[1].type, attr[1].num / GConst.DEFAULT_FACTOR) + str = str .. GFunc.getFinalAttrValue(attr[1].type, attr[1].num) -- else -- str = str .. (num or 0) end diff --git a/lua/app/userdata/battle/battle_base_data.lua b/lua/app/userdata/battle/battle_base_data.lua index a972a857..2384947d 100644 --- a/lua/app/userdata/battle/battle_base_data.lua +++ b/lua/app/userdata/battle/battle_base_data.lua @@ -816,7 +816,7 @@ function BattleBaseData:initHeroData(formation) ---- 攻击力 for matchType, attrName in pairs(GConst.MATCH_ATTACK_NAME) do - unitData.attr[attrName] = heroEntity:getTotalAttrValue(attrName) // DEFAULT_FACTOR + unitData.attr[attrName] = heroEntity:getTotalAttrValue(attrName) end ---- 暴击率 diff --git a/lua/app/userdata/daily_challenge/daily_challenge_data.lua b/lua/app/userdata/daily_challenge/daily_challenge_data.lua index bea06a88..6f438559 100644 --- a/lua/app/userdata/daily_challenge/daily_challenge_data.lua +++ b/lua/app/userdata/daily_challenge/daily_challenge_data.lua @@ -23,6 +23,7 @@ function DailyChallengeData:init(data) self.buffIds = data.buff_id or GConst.EMPTY_TABLE self.totalFightCount = data.total_challenge_count or 0 self.todayFightCount = data.today_challenge_count or 0 + self.tasks[2].task_id = 5 self.initDay = Time:getBeginningOfServerToday() self.popTaskTime = LocalData:getChallengeTaskPopTime() self.diffLv = data.level or 1 diff --git a/lua/app/userdata/talent/talent_data.lua b/lua/app/userdata/talent/talent_data.lua index 715fc17e..bb59f99e 100644 --- a/lua/app/userdata/talent/talent_data.lua +++ b/lua/app/userdata/talent/talent_data.lua @@ -69,6 +69,7 @@ function TalentData:onUpgrade(data) self.stage = data.stage self.levels[data.id] = data.level self.attrDirty = true + self:getAllAttr() self:setDirty() end @@ -78,6 +79,18 @@ function TalentData:getUpData() return data end +function TalentData:isAllMax() + for id = 1, #TalentCfg do + local cfg = TalentCfg[id] + local lv = self:getLevels(id) + if lv and lv > 0 and cfg.attr then + for _, v in ipairs(cfg.attr) do + self.allAttr[v.type] = (self.allAttr[v.type] or 0) + v.num * lv + end + end + end +end + --@region 属性 function TalentData:getAttrById(id) local cfg = TalentCfg[id]