From ebb3797170f2010be9a38940ae582401235c20bb Mon Sep 17 00:00:00 2001
From: puxuan <413323644@qq.com>
Date: Fri, 17 Oct 2025 20:37:11 +0800
Subject: [PATCH] fix bug
---
lua/app/common/bi_report.lua | 2 +
.../localization_global_const.lua | 1 +
lua/app/config/skill_rogue.lua | 24 ++--
lua/app/config/strings/cn/global.lua | 1 +
lua/app/config/strings/cn/skill_rogue.lua | 20 ++--
lua/app/global/global_func.lua | 17 ++-
lua/app/module/battle/battle_manager.lua | 24 ++--
.../controller/battle_base_controller.lua | 108 +++++++++++-------
lua/app/module/hero/hero_manager.lua | 2 +-
lua/app/ui/battle/battle_pause_ui.lua | 20 ++--
.../ui/battle/battle_skill_select_comp.lua | 101 +++++++++++-----
lua/app/ui/battle/battle_ui.lua | 4 +-
.../battle/cell/battle_select_skill_cell.lua | 2 +-
lua/app/ui/equip/equip_growth_ui.lua | 8 +-
lua/app/ui/equip/equip_info_ui.lua | 8 +-
lua/app/ui/hero/hero_attr_all_ui.lua | 4 +-
lua/app/ui/talent/talent_info_ui.lua | 2 +-
lua/app/ui/talent/talent_main_ui.lua | 2 +-
lua/app/userdata/battle/battle_base_data.lua | 20 ++++
19 files changed, 242 insertions(+), 128 deletions(-)
diff --git a/lua/app/common/bi_report.lua b/lua/app/common/bi_report.lua
index 0a454408..530f3b63 100644
--- a/lua/app/common/bi_report.lua
+++ b/lua/app/common/bi_report.lua
@@ -226,6 +226,8 @@ BIReport.ITEM_GET_TYPE = {
BIReport.ADS_CLICK_TYPE = {
BATTLE_SKILL_REFRESH = "BattleSkillRefresh",
+ BATTLE_SKILL_ALL = "BattleSkillAll",
+ BATTLE_SKILL_DEITY = "BattleSkillDeity",
AD_ENERGY = "AdEnergy",
TASK_DAILY_REFRESH = "TaskDailyRefresh",
TASK_DAILY_TASK = "TaskDailyTask",
diff --git a/lua/app/config/localization/localization_global_const.lua b/lua/app/config/localization/localization_global_const.lua
index 0f4f3f6d..c45f25c5 100644
--- a/lua/app/config/localization/localization_global_const.lua
+++ b/lua/app/config/localization/localization_global_const.lua
@@ -910,6 +910,7 @@ local LocalizationGlobalConst =
SUMMON_DESCR_8 = "SUMMON_DESCR_8",
SEVEN_DAY_DESC_3 = "SEVEN_DAY_DESC_3",
SEVEN_DAY_DESC_4 = "SEVEN_DAY_DESC_4",
+ BATTLE_DESC_19 = "BATTLE_DESC_19",
}
return LocalizationGlobalConst
\ No newline at end of file
diff --git a/lua/app/config/skill_rogue.lua b/lua/app/config/skill_rogue.lua
index bddca4e2..eac43d9a 100644
--- a/lua/app/config/skill_rogue.lua
+++ b/lua/app/config/skill_rogue.lua
@@ -14,7 +14,8 @@ local skill_rogue = {
}
},
["obj"]=8,
- ["icon"]="7"
+ ["icon"]="7",
+ ["ads_deity"]=1
},
[2]={
["universal"]=1,
@@ -31,7 +32,8 @@ local skill_rogue = {
}
},
["obj"]=1,
- ["icon"]="30"
+ ["icon"]="30",
+ ["ads_deity"]=1
},
[3]={
["universal"]=1,
@@ -48,7 +50,8 @@ local skill_rogue = {
}
},
["obj"]=1,
- ["icon"]="30"
+ ["icon"]="30",
+ ["ads_deity"]=1
},
[4]={
["universal"]=1,
@@ -65,7 +68,8 @@ local skill_rogue = {
}
},
["obj"]=8,
- ["icon"]="7"
+ ["icon"]="7",
+ ["ads_deity"]=1
},
[5]={
["universal"]=1,
@@ -80,7 +84,8 @@ local skill_rogue = {
["maxnum"]=1500
},
["obj"]=1,
- ["icon"]="1"
+ ["icon"]="1",
+ ["ads_deity"]=1
},
[6]={
["universal"]=1,
@@ -125,7 +130,8 @@ local skill_rogue = {
["maxnum"]=1500
},
["obj"]=1,
- ["icon"]="1"
+ ["icon"]="1",
+ ["ads_deity"]=1
},
[9]={
["universal"]=1,
@@ -170,7 +176,8 @@ local skill_rogue = {
["maxnum"]=1500
},
["obj"]=1,
- ["icon"]="1"
+ ["icon"]="1",
+ ["ads_deity"]=1
},
[12]={
["universal"]=1,
@@ -230,7 +237,8 @@ local skill_rogue = {
["maxnum"]=1500
},
["obj"]=1,
- ["icon"]="9"
+ ["icon"]="9",
+ ["ads_deity"]=1
},
[16]={
["universal"]=1,
diff --git a/lua/app/config/strings/cn/global.lua b/lua/app/config/strings/cn/global.lua
index 904134e3..6fae6ba5 100644
--- a/lua/app/config/strings/cn/global.lua
+++ b/lua/app/config/strings/cn/global.lua
@@ -910,6 +910,7 @@ local localization_global =
["SUMMON_DESCR_8"] = "{0}% 折扣",
["SEVEN_DAY_DESC_3"] = "每日解锁",
["SEVEN_DAY_DESC_4"] = "超值礼包!",
+ ["BATTLE_DESC_19"] = "全都要",
}
return localization_global
\ No newline at end of file
diff --git a/lua/app/config/strings/cn/skill_rogue.lua b/lua/app/config/strings/cn/skill_rogue.lua
index fdcc518b..f5636dff 100644
--- a/lua/app/config/strings/cn/skill_rogue.lua
+++ b/lua/app/config/strings/cn/skill_rogue.lua
@@ -88,24 +88,24 @@ local skill_rogue = {
["rougedesc"]="随机一个技能能量全满"
},
[23]={
- ["desc"]="红色元素刷新概率+{0}",
- ["rougedesc"]="红色元素刷新概率+{0}"
+ ["desc"]="红色元素刷新概率+5%",
+ ["rougedesc"]="红色元素刷新概率+5%"
},
[24]={
- ["desc"]="黄色元素刷新概率+{0}",
- ["rougedesc"]="黄色元素刷新概率+{0}"
+ ["desc"]="黄色元素刷新概率+5%",
+ ["rougedesc"]="黄色元素刷新概率+5%"
},
[25]={
- ["desc"]="绿色元素刷新概率+{0}",
- ["rougedesc"]="绿色元素刷新概率+{0}"
+ ["desc"]="绿色元素刷新概率+5%",
+ ["rougedesc"]="绿色元素刷新概率+5%"
},
[26]={
- ["desc"]="蓝色元素刷新概率+{0}",
- ["rougedesc"]="蓝色元素刷新概率+{0}"
+ ["desc"]="蓝色元素刷新概率+5%",
+ ["rougedesc"]="蓝色元素刷新概率+5%"
},
[27]={
- ["desc"]="紫色元素刷新概率+{0}",
- ["rougedesc"]="紫色元素刷新概率+{0}"
+ ["desc"]="紫色元素刷新概率+5%",
+ ["rougedesc"]="紫色元素刷新概率+5%"
},
[28]={
["desc"]="将场上随机3个非红色元素变为红色",
diff --git a/lua/app/global/global_func.lua b/lua/app/global/global_func.lua
index 57cd1098..6a9efdb0 100644
--- a/lua/app/global/global_func.lua
+++ b/lua/app/global/global_func.lua
@@ -2002,10 +2002,10 @@ end
--@endregion
--@region 属性相关
-function GFunc.getFinalAttrValue(attrName, attrNum)
+function GFunc.getFinalAttrValue(attrName, attrNum, decimal)
local cfg = ConfigManager:getConfigWithOtherKey("attr", "name")[attrName]
if cfg and cfg.is_percent then
- return GFunc.num2Str(attrNum / 100, 2) .. "%"
+ return GFunc.num2Str(attrNum / 100, decimal) .. "%"
else
return attrNum // GConst.DEFAULT_FACTOR
end
@@ -2068,8 +2068,17 @@ function GFunc.getPerStr(key, str, ispercent)
return str
end
-function GFunc.getBuffDesc(buffName, effectNum, ispercent)
- effectNum = GFunc.getPerStr(buffName, effectNum, ispercent)
+function GFunc.getFinalBuffValue(buffName, attrNum, decimal)
+ local cfg = ConfigManager:getConfigWithOtherKey("buff", "name")[buffName]
+ if cfg and cfg.is_percent then
+ return GFunc.num2Str(attrNum / 100, decimal) .. "%"
+ else
+ return attrNum // GConst.DEFAULT_FACTOR
+ end
+end
+
+function GFunc.getBuffDesc(buffName, effectNum)
+ effectNum = GFunc.getFinalBuffValue(buffName, effectNum)
return I18N:getTextWithOtherKey("buff", "name", buffName, "desc", effectNum)
end
diff --git a/lua/app/module/battle/battle_manager.lua b/lua/app/module/battle/battle_manager.lua
index 0852241f..7241c507 100644
--- a/lua/app/module/battle/battle_manager.lua
+++ b/lua/app/module/battle/battle_manager.lua
@@ -96,23 +96,27 @@ function BattleManager:showBoxOpenUI(rewards, callback)
UIManager:showUI("app/ui/battle/battle_box_open_ui", {rewards = rewards, callback = callback})
end
-function BattleManager:reqSkillRefresh(isAd)
- if not isAd then
- local cost = GFunc.getConstReward("refresh_skill_cost")
- if not GFunc.checkCost(GFunc.getRewardId(cost), GFunc.getRewardNum(cost), true) then
- return
- end
- end
+function BattleManager:reqSkillRefresh(isAll, deitySkillIdx)
+ -- if not isAd then
+ -- local cost = GFunc.getConstReward("refresh_skill_cost")
+ -- if not GFunc.checkCost(GFunc.getRewardId(cost), GFunc.getRewardNum(cost), true) then
+ -- return
+ -- end
+ -- end
- self:sendMessage(ProtoMsgType.FromMsgEnum.BattleSkillRefreshReq, {ad = isAd}, self.rspSkillRefresh, BIReport.ITEM_GET_TYPE.BATTLE_SKILL_REFRESH, true)
+ self:sendMessage(ProtoMsgType.FromMsgEnum.WatchADReq, {isAll = isAll, deitySkillIdx = deitySkillIdx}, self.rspSkillRefresh, BIReport.ITEM_GET_TYPE.BATTLE_SKILL_REFRESH, true)
end
function BattleManager:rspSkillRefresh(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
if self.battleController and result.reqData then
- self.battleController.battleData:addRefreshSkillCount(result.reqData.ad)
+ if result.reqData.isAll then
+ self.battleController.battleData:addGetAllSkillCount()
+ else
+ self.battleController.battleData:addRefreshSkillCount(true)
+ end
end
- EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.SKILL_REFRESH_SUCC)
+ EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.SKILL_REFRESH_SUCC, {isAll = result.reqData.isAll, deitySkillIdx = result.reqData.deitySkillIdx})
end
end
diff --git a/lua/app/module/battle/controller/battle_base_controller.lua b/lua/app/module/battle/controller/battle_base_controller.lua
index 7996ecfa..e1be9f23 100644
--- a/lua/app/module/battle/controller/battle_base_controller.lua
+++ b/lua/app/module/battle/controller/battle_base_controller.lua
@@ -1703,16 +1703,16 @@ function BattleBaseController:setGridBreakCondition(gridMap, posId, condition)
gridMap[posId][condition] = true
end
-function BattleBaseController:tryShowSelectSkillComp(needDelay, onlyCommonSkill)
+function BattleBaseController:tryShowSelectSkillComp(needDelay, isGodSkill)
self.canChoseSkillCount = 1
- local skillList = self:getRandomSkillList(nil, onlyCommonSkill)
+ local skillList = self:getRandomSkillList(nil, isGodSkill)
if needDelay then
self.showSelectSkillSid = ModuleManager.BattleManager:performWithDelayGlobal(function()
- self.battleUI:showSelectSkillComp(skillList, onlyCommonSkill)
+ self.battleUI:showSelectSkillComp(skillList, isGodSkill)
self.showSelectSkillSid = nil
end, 0.3)
else
- self.battleUI:showSelectSkillComp(skillList, onlyCommonSkill)
+ self.battleUI:showSelectSkillComp(skillList, isGodSkill)
end
BIReport:postShowFightSkillSelect(self.battleType, self.battleData, skillList, self.chapterId, self.totalDurationTime, self:getWaveIndex())
@@ -2301,39 +2301,43 @@ function BattleBaseController:getRandomGridInfo()
local fixedRandomList = fixedRandomGrid[self.curBoardIndex]
local gridType = 0
- -- local elementType
- -- if fixedRandomList and fixedRandomList[1] then
- -- elementType = table.remove(fixedRandomList, 1)
- -- else
- -- local map = self.battleData:getElementTypeMap()
- -- self.getRandomGridInfoIndexs = table.clearOrCreate(self.getRandomGridInfoIndexs)
- -- self.getRandomGridInfoTypeList = table.clearOrCreate(self.getRandomGridInfoTypeList)
- -- for typeName, typeNum in pairs(BattleConst.ELEMENT_TYPE) do
- -- if not self:getSealElementType()[typeNum] and self:getSkillEntityByElement(typeNum) then
- -- local weight = ((map[typeNum] or 0) + 1) * BattleConst.ELEMENT_WIGHT
- -- if self.elementWeightMap and self.elementWeightMap[typeNum] then
- -- weight = weight + self.elementWeightMap[typeNum]
- -- end
- -- if weight > BattleConst.MAX_ELEMENT_WIGHT then
- -- weight = BattleConst.MAX_ELEMENT_WIGHT
- -- end
- -- table.insert(self.getRandomGridInfoIndexs, weight)
- -- table.insert(self.getRandomGridInfoTypeList, typeNum)
- -- end
- -- end
-
- -- local index = GFunc.getRandomIndex(self.getRandomGridInfoIndexs)
- -- elementType = self.getRandomGridInfoTypeList[index]
- -- end
- local weights = {2000, 2000, 2000, 2000, 2000}
- local extWeights = self.atkTeam:getElementExtRatio()
- for i,v in ipairs(weights) do
- weights[i] = weights[i] + (extWeights[i] or 0)
- end
- local elementType = GFunc.getRandomIndex(weights)
+ local elementType
local isUniversal = false
- if self.atkTeam:checkUniversal() and not self.battleData:hadUniversalGrid() then
- isUniversal = true
+ if fixedRandomList and fixedRandomList[1] then
+ elementType = table.remove(fixedRandomList, 1)
+ else
+ -- local map = self.battleData:getElementTypeMap()
+ -- self.getRandomGridInfoIndexs = table.clearOrCreate(self.getRandomGridInfoIndexs)
+ -- self.getRandomGridInfoTypeList = table.clearOrCreate(self.getRandomGridInfoTypeList)
+ -- for typeName, typeNum in pairs(BattleConst.ELEMENT_TYPE) do
+ -- if not self:getSealElementType()[typeNum] and self:getSkillEntityByElement(typeNum) then
+ -- local weight = ((map[typeNum] or 0) + 1) * BattleConst.ELEMENT_WIGHT
+ -- if self.elementWeightMap and self.elementWeightMap[typeNum] then
+ -- weight = weight + self.elementWeightMap[typeNum]
+ -- end
+ -- if weight > BattleConst.MAX_ELEMENT_WIGHT then
+ -- weight = BattleConst.MAX_ELEMENT_WIGHT
+ -- end
+ -- table.insert(self.getRandomGridInfoIndexs, weight)
+ -- table.insert(self.getRandomGridInfoTypeList, typeNum)
+ -- end
+ -- end
+
+ -- local index = GFunc.getRandomIndex(self.getRandomGridInfoIndexs)
+ -- elementType = self.getRandomGridInfoTypeList[index]
+ local weights = {2000, 2000, 2000, 2000, 2000}
+ local extWeights = self.atkTeam:getElementExtRatio()
+ for i, v in ipairs(weights) do
+ if self:getSealElementType()[i] or not self:getSkillEntityByElement(i) then
+ weights[i] = 0
+ else
+ weights[i] = weights[i] + (extWeights[i] or 0)
+ end
+ end
+ elementType = GFunc.getRandomIndex(weights)
+ if self.atkTeam:checkUniversal() and not self.battleData:hadUniversalGrid() then
+ isUniversal = true
+ end
end
return {gridType = gridType, elementType = elementType, isUniversal = isUniversal}
@@ -2368,7 +2372,7 @@ function BattleBaseController:findSkillInfluenceGrids()
end
end
-function BattleBaseController:getRandomSkillList(getCount, onlyCommonSkill, excludeMap)
+function BattleBaseController:getRandomSkillList(getCount, isGodSkill, excludeMap)
local fixedList = self:getFixedRogueSkill()
if fixedList[1] then
return table.remove(fixedList, 1)
@@ -2383,7 +2387,7 @@ function BattleBaseController:getRandomSkillList(getCount, onlyCommonSkill, excl
local skillPool = self:getSkillPool()
local count = 0
- if not onlyCommonSkill then
+ if not isGodSkill then
for elementType, list in pairs(skillPool) do -- 先遍历一下未解锁的技能
if not self:isUnlockedSkillElementType(elementType) then
local skillEntity = self:getSkillEntityByElement(elementType)
@@ -2447,7 +2451,7 @@ function BattleBaseController:getRandomSkillList(getCount, onlyCommonSkill, excl
for skillId, info in pairs(cfg) do
if not self:getNotInvolvedSkills()[skillId] then
- if info.universal and info.universal == 1 then
+ if info.universal and info.universal == 1 and (not info.ads_deity or info.ads_deity ~= 1) then
if not info.limit_times or self:getSkillCount(skillId) < info.limit_times then
if not self.randomSkillMap[skillId] then
table.insert(self.randomSkillNewSkillPool, skillId)
@@ -2471,6 +2475,32 @@ function BattleBaseController:getRandomSkillList(getCount, onlyCommonSkill, excl
end
local result = table.shuffle(self.randomSkillList)
+
+ if isGodSkill then
+ local count = self.battleData:getAdDeityCount()
+ local cfgCount = GFunc.getConstIntValue("ads_deity_get_limit")
+ if cfgCount > count then
+ local randomSkillNewSkillPool = {}
+ local randomSkillSkillWeight = {}
+ for skillId, info in pairs(cfg) do
+ if not self:getNotInvolvedSkills()[skillId] then
+ if info.universal and info.universal == 1 and info.ads_deity and info.ads_deity == 1 then
+ if not info.limit_times or self:getSkillCount(skillId) < info.limit_times then
+ if not self.randomSkillMap[skillId] then
+ table.insert(randomSkillNewSkillPool, skillId)
+ table.insert(randomSkillSkillWeight, info.weight)
+ end
+ end
+ end
+ end
+ end
+ if #randomSkillNewSkillPool > 0 then
+ local index = GFunc.getRandomIndex(randomSkillSkillWeight)
+ result = result or {}
+ result[#result + 1] = randomSkillNewSkillPool[index]
+ end
+ end
+ end
return result
end
diff --git a/lua/app/module/hero/hero_manager.lua b/lua/app/module/hero/hero_manager.lua
index 9a83e6ae..b033dc36 100644
--- a/lua/app/module/hero/hero_manager.lua
+++ b/lua/app/module/hero/hero_manager.lua
@@ -171,7 +171,7 @@ function HeroManager:getSkillRogueDesc(skillId, value)
end
local str
if cfg.attr then
- str = GFunc.getPerStr(cfg.attr.type, value)
+ str = GFunc.getFinalAttrValue(cfg.attr.type, value)
end
return I18N:getText("skill_rogue", skillId, "desc", str)
end
diff --git a/lua/app/ui/battle/battle_pause_ui.lua b/lua/app/ui/battle/battle_pause_ui.lua
index 4ac703ef..c60082f5 100644
--- a/lua/app/ui/battle/battle_pause_ui.lua
+++ b/lua/app/ui/battle/battle_pause_ui.lua
@@ -102,20 +102,20 @@ function BattlePauseUI:_refreshScrollRect()
local cfg = ConfigManager:getConfig("skill_rogue")[skillId]
local str
if cfg and cfg.attr and ModuleManager.HeroManager:showValueRogue(skillId) then
- str = GFunc.getPerStr(cfg.attr.type, value)
+ str = GFunc.getFinalAttrValue(cfg.attr.type, value)
end
cell:refresh(skillId, count, str)
cell:addClickListener(function()
- local valueStr
- if skillId == 24 then -- 特殊处理
- if ModuleManager.BattleManager.battleController then
- valueStr = ModuleManager.BattleManager.battleController.battleData:getSkillCount(skillId)
- valueStr = I18N:getText("skill_rogue", skillId, "desc", valueStr)
- end
- else
- valueStr = ModuleManager.HeroManager:getSkillRogueDesc(skillId, value)
- end
+ local valueStr = ModuleManager.HeroManager:getSkillRogueDesc(skillId, value)
+ -- if skillId == 24 then -- 特殊处理
+ -- if ModuleManager.BattleManager.battleController then
+ -- valueStr = ModuleManager.BattleManager.battleController.battleData:getSkillCount(skillId)
+ -- valueStr = I18N:getText("skill_rogue", skillId, "desc", valueStr)
+ -- end
+ -- else
+ -- valueStr = ModuleManager.HeroManager:getSkillRogueDesc(skillId, value)
+ -- end
if EDITOR_MODE then
valueStr = valueStr .. "\n" .. skillId
end
diff --git a/lua/app/ui/battle/battle_skill_select_comp.lua b/lua/app/ui/battle/battle_skill_select_comp.lua
index 20e12ee7..5f4dfd44 100644
--- a/lua/app/ui/battle/battle_skill_select_comp.lua
+++ b/lua/app/ui/battle/battle_skill_select_comp.lua
@@ -4,14 +4,15 @@ local SELECT_SKILL_CELL = "app/ui/battle/cell/battle_select_skill_cell"
local BATTLE_COMMON_PATH = "assets/arts/textures/background/battle_common/%s.png"
local SKILL_ICON_POS = {
- {x =-240, y= 165},
+ {x =-240, y= 158},
{x =-240, y= 0},
- {x =-240, y= -165}
+ {x =-240, y= -158},
+ {x =-240, y= 316},
}
-function BattleSkillSelectComp:refresh(skillList, onlyCommonSkill)
+function BattleSkillSelectComp:refresh(skillList, isGodSkill)
self.skillList = skillList
- self.onlyCommonSkill = onlyCommonSkill
+ self.isGodSkill = isGodSkill
self:_playPop()
self:_display()
self:_addListeners()
@@ -20,7 +21,7 @@ end
function BattleSkillSelectComp:_display()
local uiMap = self:getUIMap()
local bg2 = uiMap["battle_select_skill_comp.bg_2"]
- bg2:setActive(self.onlyCommonSkill)
+ bg2:setActive(self.isGodSkill)
local bg = uiMap["battle_select_skill_comp.bg_1"]
if ModuleManager.BattleManager.battleController then
bg:setVisible(false)
@@ -43,16 +44,18 @@ function BattleSkillSelectComp:_addListeners()
end
SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.BATTLE_SKILL_REFRESH, function()
- ModuleManager.BattleManager:reqSkillRefresh(true)
+ ModuleManager.BattleManager:reqSkillRefresh()
end)
end)
- uiMap["battle_select_skill_comp.skill_node.diamond_btn"]:addClickListener(function()
+ uiMap["battle_select_skill_comp.skill_node.all_btn"]:addClickListener(function()
if not ModuleManager.BattleManager.battleController then
return
end
- ModuleManager.BattleManager:reqSkillRefresh(false)
+ SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.BATTLE_SKILL_ALL, function()
+ ModuleManager.BattleManager:reqSkillRefresh(true)
+ end)
end)
self.canvasGroup = uiMap["battle_select_skill_comp.skill_node"]:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP)
@@ -75,30 +78,58 @@ end
function BattleSkillSelectComp:refreshBtns()
local uiMap = self:getUIMap()
uiMap["battle_select_skill_comp.skill_node.ad_btn.tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_3))
- uiMap["battle_select_skill_comp.skill_node.diamond_btn.tx"]:setText(GFunc.getRewardNum(GFunc.getConstReward("refresh_skill_cost")))
+ uiMap["battle_select_skill_comp.skill_node.all_btn.tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_19))
+ -- uiMap["battle_select_skill_comp.skill_node.diamond_btn.tx"]:setText(GFunc.getRewardNum(GFunc.getConstReward("refresh_skill_cost")))
+
+ local adBtn = uiMap["battle_select_skill_comp.skill_node.ad_btn"]
+ local diamondBtn = uiMap["battle_select_skill_comp.skill_node.diamond_btn"]
+ local allBtn = uiMap["battle_select_skill_comp.skill_node.all_btn"]
+ diamondBtn:setActive(false)
+ if self.isGodSkill then
+ adBtn:setActive(false)
+ allBtn:setActive(false)
+ return
+ end
local battleController = ModuleManager.BattleManager.battleController
+ local getAllAdCount = GFunc.getConstIntValue("ads_getall_rogue_limit")
+ local allCount = battleController.battleData:getAllSkillCount()
+ if getAllAdCount > allCount then
+ allBtn:setActive(true)
+ else
+ allBtn:setActive(false)
+ end
+
+ local cfgAdCount = GFunc.getConstIntValue("ad_refresh_skill")
local talentCount = DataManager.TalentData:getSkillRefreshCount()
- local cfgAdCount = GFunc.getConstIntValue("ad_refresh_skill")
- local cfgRefreshCount = GFunc.getConstIntValue("diamond_refresh_skill") + cfgAdCount + talentCount
- local adCount = battleController.battleData:getADRefreshSkillCount() + talentCount
- local refreshCount =battleController.battleData:getRefreshSkillCount()
- local showAdBtn = cfgAdCount > adCount
- uiMap["battle_select_skill_comp.skill_node.ad_btn"]:setActive(showAdBtn)
- local showBtn = refreshCount < cfgRefreshCount
- if showAdBtn then
- showBtn = false
- end
- uiMap["battle_select_skill_comp.skill_node.diamond_btn"]:setActive(showBtn)
+ local adCount = battleController.battleData:getADRefreshSkillCount() + talentCount
+ if cfgAdCount > adCount then
+ adBtn:setActive(true)
+ else
+ adBtn:setActive(false)
+ end
end
-function BattleSkillSelectComp:getNewRandomSkill()
+function BattleSkillSelectComp:getNewRandomSkill(parmas)
+ parmas = parmas or {}
+ if parmas.isAll then
+ self:hide()
+ for i,v in ipairs(self.skillList) do
+ ModuleManager.BattleManager:onSelectSkill(v, nil, SKILL_ICON_POS[i])
+ end
+ return
+ end
+ if parmas.deitySkillIdx then
+ self:hide()
+ ModuleManager.BattleManager:onSelectSkill(self.skillList[parmas.deitySkillIdx], nil, SKILL_ICON_POS[parmas.deitySkillIdx])
+ return
+ end
self:refreshBtns()
local excludeMap = {}
for _, id in ipairs(self.skillList) do
excludeMap[id] = true
end
- self.skillList = ModuleManager.BattleManager.battleController:getRandomSkillList(nil, self.onlyCommonSkill, excludeMap)
+ self.skillList = ModuleManager.BattleManager.battleController:getRandomSkillList(nil, self.isGodSkill, excludeMap)
self:refreshRogueSkill()
end
@@ -106,20 +137,28 @@ function BattleSkillSelectComp:refreshRogueSkill()
local uiMap = self:getUIMap()
if not self.selectSkillCells then
self.selectSkillCells = {}
- for i = 1, 3 do
+ for i = 1, 4 do
self.selectSkillCells[i] = CellManager:addCellComp(uiMap["battle_select_skill_comp.skill_node.skill_select_cell_" .. i], SELECT_SKILL_CELL)
end
end
- for index, cell in ipairs(self.selectSkillCells) do
- local skillId = self.skillList[index]
- cell:getBaseObject():setActive(skillId ~= nil)
- if skillId then
- cell:refresh(skillId, function(value)
- self:onClickSkill(skillId, value, SKILL_ICON_POS[index])
+ for i = 1, 4 do
+ local skillId = self.skillList[i]
+ if skillId then
+ self.selectSkillCells[i]:getBaseObject():setActive(true)
+ self.selectSkillCells[i]:refresh(skillId, function(value)
+ if i == 4 then
+ SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.BATTLE_SKILL_DEITY, function()
+ ModuleManager.BattleManager:reqSkillRefresh(nil, i)
+ end)
+ else
+ self:onClickSkill(skillId, value, SKILL_ICON_POS[i])
+ end
end)
- end
- end
+ else
+ self.selectSkillCells[i]:getBaseObject():setActive(false)
+ end
+ end
end
function BattleSkillSelectComp:onClickSkill(skillId, value, pos)
diff --git a/lua/app/ui/battle/battle_ui.lua b/lua/app/ui/battle/battle_ui.lua
index 13d88baf..a0bf57e1 100644
--- a/lua/app/ui/battle/battle_ui.lua
+++ b/lua/app/ui/battle/battle_ui.lua
@@ -338,9 +338,9 @@ function BattleUI:_addListeners()
self:showTutorialFinger(posIdList)
end)
- self:addEventListener(EventManager.CUSTOM_EVENT.SKILL_REFRESH_SUCC, function(posIdList)
+ self:addEventListener(EventManager.CUSTOM_EVENT.SKILL_REFRESH_SUCC, function(parmas)
if self.selectSkillComp then
- self.selectSkillComp:getNewRandomSkill()
+ self.selectSkillComp:getNewRandomSkill(parmas)
end
end)
end
diff --git a/lua/app/ui/battle/cell/battle_select_skill_cell.lua b/lua/app/ui/battle/cell/battle_select_skill_cell.lua
index 8996165e..3d38f663 100644
--- a/lua/app/ui/battle/cell/battle_select_skill_cell.lua
+++ b/lua/app/ui/battle/cell/battle_select_skill_cell.lua
@@ -13,7 +13,7 @@ function BattleSelectSkillCell:refresh(skillId, func)
if cfg.type == 5 then
self.value = math.random(cfg.attr.minnum, cfg.attr.maxnum)
self.value = self.value // 100 * 100
- valueStr = GFunc.getPerStr(cfg.attr.type, self.value)
+ valueStr = GFunc.getFinalAttrValue(cfg.attr.type, self.value)
value = ModuleManager.HeroManager:getSkillRogueDesc(skillId, self.value)
else
self.value = nil
diff --git a/lua/app/ui/equip/equip_growth_ui.lua b/lua/app/ui/equip/equip_growth_ui.lua
index a3744cc8..d97e118f 100644
--- a/lua/app/ui/equip/equip_growth_ui.lua
+++ b/lua/app/ui/equip/equip_growth_ui.lua
@@ -220,12 +220,12 @@ function EquipGrowthUI:refreshPageUp()
local _, _, resonateAttrNum = DataManager.EquipData:getResonateLevel(GConst.EquipConst.RESONATE_PAGE.LV_UP, self.equipPart)
local currAttr = equipEntity:getBaseAttrWithLv(lv)
self.upAttrNameTx:setText(GFunc.getAttrNameByType(currAttr.type))
- local currAttrNum = GFunc.getFinalAttrValue(currAttr.type, currAttr.num + resonateAttrNum)
+ local currAttrNum = GFunc.getFinalAttrValue(currAttr.type, currAttr.num + resonateAttrNum, 2)
self.upAttrCurrTx:setText(currAttrNum)
if not isLvMax then
self.upNextLvTx:setText(lv + 1)
local nextAttr = equipEntity:getBaseAttrWithLv(lv + 1)
- local nextAttrNum = GFunc.getFinalAttrValue(nextAttr.type, nextAttr.num + resonateAttrNum)
+ local nextAttrNum = GFunc.getFinalAttrValue(nextAttr.type, nextAttr.num + resonateAttrNum, 2)
self.upAttrNextTx:setText(nextAttrNum)
local itemCost = DataManager.EquipData:getLevelCost(lv + 1)
local costId = GFunc.getRewardId(itemCost)
@@ -253,10 +253,10 @@ function EquipGrowthUI:refreshPageRefine()
local extraAttr = attrs[i]
local nowAttr = DataManager.EquipData:getRefineAttrAdd(refine, extraAttr.type)
self.refineAttrNameTxs[i]:setText(GFunc.getAttrNameByType(extraAttr.type))
- self.refineAttrCurrTxs[i]:setText(GFunc.getFinalAttrValue(extraAttr.type, extraAttr.num + nowAttr.num))
+ self.refineAttrCurrTxs[i]:setText(GFunc.getFinalAttrValue(extraAttr.type, extraAttr.num + nowAttr.num, 2))
if not isMaxRefine then
local nextAttr = DataManager.EquipData:getRefineAttrAdd(refine + 1, extraAttr.type)
- self.refineAttrNextTxs[i]:setText(GFunc.getFinalAttrValue(nextAttr.type, extraAttr.num + nextAttr.num))
+ self.refineAttrNextTxs[i]:setText(GFunc.getFinalAttrValue(nextAttr.type, extraAttr.num + nextAttr.num, 2))
-- if isGrowthUp and self.effectNameResult then
-- self:playEffect(cell.txAttrBaseEffect)
-- end
diff --git a/lua/app/ui/equip/equip_info_ui.lua b/lua/app/ui/equip/equip_info_ui.lua
index e6537711..c4c039d1 100644
--- a/lua/app/ui/equip/equip_info_ui.lua
+++ b/lua/app/ui/equip/equip_info_ui.lua
@@ -117,7 +117,7 @@ function EquipInfoUI:refreshPreview()
cell.attrNameTx:setText(GFunc.getAttrDesc(extraAttr.type, extraAttr.minnum))
cell.attrValueTx:setText(GConst.EMPTY_STRING)
cell.attrValueAddTx:setActive(true)
- cell.attrValueAddTx:setText("".. GFunc.getFinalAttrValue(extraAttr.type, extraAttr.minnum) .. "-".. GFunc.getFinalAttrValue(extraAttr.type, extraAttr.maxnum) .."")
+ cell.attrValueAddTx:setText("".. GFunc.getFinalAttrValue(extraAttr.type, extraAttr.minnum, 2) .. "-".. GFunc.getFinalAttrValue(extraAttr.type, extraAttr.maxnum, 2) .."")
end
self.replaceBtn:setActive(false)
self.upBtn:setActive(false)
@@ -133,7 +133,7 @@ function EquipInfoUI:refreshBaseAttr()
cell.attrExtraCell:setActive(true)
local extraAttr = attrs[i]
cell.attrNameTx:setText(GFunc.getAttrDesc(extraAttr.type, extraAttr.num))
- cell.attrValueTx:setText(GFunc.getFinalAttrValue(extraAttr.type, extraAttr.num))
+ cell.attrValueTx:setText(GFunc.getFinalAttrValue(extraAttr.type, extraAttr.num, 2))
cell.attrValueTx:setAnchoredPositionX(-10)
cell.attrValueAddTx:setActive(false)
else
@@ -174,14 +174,14 @@ function EquipInfoUI:refreshAllAttr()
local extraAttr = attrs[i]
local extraAttrId = GFunc.getAttrIdByName(extraAttr.type)
cell.attrNameTx:setText(GFunc.getAttrNameByType(extraAttr.type))
- cell.attrValueTx:setText(GFunc.getFinalAttrValue(extraAttr.type, extraAttr.num))
+ cell.attrValueTx:setText(GFunc.getFinalAttrValue(extraAttr.type, extraAttr.num, 2))
local attrAdd = DataManager.EquipData:getRefineAttrAdd(self.refine, extraAttrId)
local anchorX = -40
if attrAdd.num <= 0 then
cell.attrValueAddTx:setActive(false)
else
cell.attrValueAddTx:setActive(true)
- cell.attrValueAddTx:setText("(+".. GFunc.getFinalAttrValue(attrAdd.type, attrAdd.num) ..")")
+ cell.attrValueAddTx:setText("(+".. GFunc.getFinalAttrValue(attrAdd.type, attrAdd.num, 2) ..")")
local meshProCompNext = cell.attrValueAddTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO)
local nowTipsNextX = meshProCompNext.preferredWidth
cell.attrValueAddTx:setSizeDeltaX(nowTipsNextX)
diff --git a/lua/app/ui/hero/hero_attr_all_ui.lua b/lua/app/ui/hero/hero_attr_all_ui.lua
index 89770310..f78a3268 100644
--- a/lua/app/ui/hero/hero_attr_all_ui.lua
+++ b/lua/app/ui/hero/hero_attr_all_ui.lua
@@ -38,8 +38,8 @@ end
function HeroAttrUI:onRefresh()
local attr = self.heroEntity:getStarAttr()
- self.hpAttrTx:setText(GFunc.getFinalAttrValue(GConst.ALL_ATTR.ATTR_HPP_ALL, attr.attr_hpp_all or 0))
- self.atkAttrTx:setText(GFunc.getFinalAttrValue(GConst.ALL_ATTR.ATTR_ATKP_ALL, attr.attr_atkp_all or 0))
+ self.hpAttrTx:setText(GFunc.getFinalAttrValue(GConst.ALL_ATTR.ATTR_HPP_ALL, attr.attr_hpp_all or 0, 2))
+ self.atkAttrTx:setText(GFunc.getFinalAttrValue(GConst.ALL_ATTR.ATTR_ATKP_ALL, attr.attr_atkp_all or 0, 2))
end
return HeroAttrUI
\ No newline at end of file
diff --git a/lua/app/ui/talent/talent_info_ui.lua b/lua/app/ui/talent/talent_info_ui.lua
index f7a47bb5..9f9927dd 100644
--- a/lua/app/ui/talent/talent_info_ui.lua
+++ b/lua/app/ui/talent/talent_info_ui.lua
@@ -53,7 +53,7 @@ function TalentInfoUI:onRefresh()
local attr, num = DataManager.TalentData:getAttrById(self.id)
local str = I18N:getText("talent", self.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/ui/talent/talent_main_ui.lua b/lua/app/ui/talent/talent_main_ui.lua
index 4c06206d..1981147c 100644
--- a/lua/app/ui/talent/talent_main_ui.lua
+++ b/lua/app/ui/talent/talent_main_ui.lua
@@ -112,7 +112,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.getFinalAttrValue(attr[1].type, attr[1].num)
+ str = str .. GFunc.getFinalAttrValue(attr[1].type, attr[1].num, 2)
-- 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 072d7888..bec1f3a2 100644
--- a/lua/app/userdata/battle/battle_base_data.lua
+++ b/lua/app/userdata/battle/battle_base_data.lua
@@ -51,6 +51,8 @@ function BattleBaseData:init(params, snapInfo)
self.data.lvDirty = false
self.adRefreshSkillCount = snapInfo and snapInfo.adRefreshSkillCount or 0
self.refreshSkillCount = snapInfo and snapInfo.refreshSkillCount or 0
+ self.adGetAllSkillCount = snapInfo and snapInfo.adGetAllSkillCount or 0
+ self.adDeityCount = snapInfo and snapInfo.adDeityCount or 0
BattleSkillEntity.sid = 0
self.atkTeam = self:initTeam(SIDE_ATK, params.atkFormation)
self.defTeam = self:initTeam(SIDE_DEF, params.defFormation)
@@ -75,6 +77,8 @@ function BattleBaseData:getSnapshoptInfo()
addLvCount = self.addLvCount,
commonSelectSkillCount = self.commonSelectSkillCount,
adRefreshSkillCount = self.adRefreshSkillCount,
+ adGetAllSkillCount = self.adGetAllSkillCount,
+ adDeityCount = self.adDeityCount,
refreshSkillCount = self.refreshSkillCount,
cacheSkillList = self.cacheSkillList,
}
@@ -771,6 +775,22 @@ function BattleBaseData:getADRefreshSkillCount()
return self.adRefreshSkillCount
end
+function BattleBaseData:addGetAllSkillCount()
+ self.adGetAllSkillCount = self.adGetAllSkillCount + 1
+end
+
+function BattleBaseData:getAllSkillCount()
+ return self.adGetAllSkillCount
+end
+
+function BattleBaseData:addAdDeityCount()
+ self.adDeityCount = self.adDeityCount + 1
+end
+
+function BattleBaseData:getAdDeityCount()
+ return self.adDeityCount
+end
+
function BattleBaseData:initTeam(side, formation)
local data = nil
data = self:initHeroData(formation)