This commit is contained in:
puxuan 2025-10-17 20:37:11 +08:00
parent 9e99bea561
commit ebb3797170
19 changed files with 242 additions and 128 deletions

View File

@ -226,6 +226,8 @@ BIReport.ITEM_GET_TYPE = {
BIReport.ADS_CLICK_TYPE = { BIReport.ADS_CLICK_TYPE = {
BATTLE_SKILL_REFRESH = "BattleSkillRefresh", BATTLE_SKILL_REFRESH = "BattleSkillRefresh",
BATTLE_SKILL_ALL = "BattleSkillAll",
BATTLE_SKILL_DEITY = "BattleSkillDeity",
AD_ENERGY = "AdEnergy", AD_ENERGY = "AdEnergy",
TASK_DAILY_REFRESH = "TaskDailyRefresh", TASK_DAILY_REFRESH = "TaskDailyRefresh",
TASK_DAILY_TASK = "TaskDailyTask", TASK_DAILY_TASK = "TaskDailyTask",

View File

@ -910,6 +910,7 @@ local LocalizationGlobalConst =
SUMMON_DESCR_8 = "SUMMON_DESCR_8", SUMMON_DESCR_8 = "SUMMON_DESCR_8",
SEVEN_DAY_DESC_3 = "SEVEN_DAY_DESC_3", SEVEN_DAY_DESC_3 = "SEVEN_DAY_DESC_3",
SEVEN_DAY_DESC_4 = "SEVEN_DAY_DESC_4", SEVEN_DAY_DESC_4 = "SEVEN_DAY_DESC_4",
BATTLE_DESC_19 = "BATTLE_DESC_19",
} }
return LocalizationGlobalConst return LocalizationGlobalConst

View File

@ -14,7 +14,8 @@ local skill_rogue = {
} }
}, },
["obj"]=8, ["obj"]=8,
["icon"]="7" ["icon"]="7",
["ads_deity"]=1
}, },
[2]={ [2]={
["universal"]=1, ["universal"]=1,
@ -31,7 +32,8 @@ local skill_rogue = {
} }
}, },
["obj"]=1, ["obj"]=1,
["icon"]="30" ["icon"]="30",
["ads_deity"]=1
}, },
[3]={ [3]={
["universal"]=1, ["universal"]=1,
@ -48,7 +50,8 @@ local skill_rogue = {
} }
}, },
["obj"]=1, ["obj"]=1,
["icon"]="30" ["icon"]="30",
["ads_deity"]=1
}, },
[4]={ [4]={
["universal"]=1, ["universal"]=1,
@ -65,7 +68,8 @@ local skill_rogue = {
} }
}, },
["obj"]=8, ["obj"]=8,
["icon"]="7" ["icon"]="7",
["ads_deity"]=1
}, },
[5]={ [5]={
["universal"]=1, ["universal"]=1,
@ -80,7 +84,8 @@ local skill_rogue = {
["maxnum"]=1500 ["maxnum"]=1500
}, },
["obj"]=1, ["obj"]=1,
["icon"]="1" ["icon"]="1",
["ads_deity"]=1
}, },
[6]={ [6]={
["universal"]=1, ["universal"]=1,
@ -125,7 +130,8 @@ local skill_rogue = {
["maxnum"]=1500 ["maxnum"]=1500
}, },
["obj"]=1, ["obj"]=1,
["icon"]="1" ["icon"]="1",
["ads_deity"]=1
}, },
[9]={ [9]={
["universal"]=1, ["universal"]=1,
@ -170,7 +176,8 @@ local skill_rogue = {
["maxnum"]=1500 ["maxnum"]=1500
}, },
["obj"]=1, ["obj"]=1,
["icon"]="1" ["icon"]="1",
["ads_deity"]=1
}, },
[12]={ [12]={
["universal"]=1, ["universal"]=1,
@ -230,7 +237,8 @@ local skill_rogue = {
["maxnum"]=1500 ["maxnum"]=1500
}, },
["obj"]=1, ["obj"]=1,
["icon"]="9" ["icon"]="9",
["ads_deity"]=1
}, },
[16]={ [16]={
["universal"]=1, ["universal"]=1,

View File

@ -910,6 +910,7 @@ local localization_global =
["SUMMON_DESCR_8"] = "{0}% 折扣", ["SUMMON_DESCR_8"] = "{0}% 折扣",
["SEVEN_DAY_DESC_3"] = "每日解锁", ["SEVEN_DAY_DESC_3"] = "每日解锁",
["SEVEN_DAY_DESC_4"] = "超值礼包!", ["SEVEN_DAY_DESC_4"] = "超值礼包!",
["BATTLE_DESC_19"] = "全都要",
} }
return localization_global return localization_global

View File

@ -88,24 +88,24 @@ local skill_rogue = {
["rougedesc"]="随机一个技能能量全满" ["rougedesc"]="随机一个技能能量全满"
}, },
[23]={ [23]={
["desc"]="红色元素刷新概率<color=#049500>+{0}</color>", ["desc"]="红色元素刷新概率<color=#049500>+5%</color>",
["rougedesc"]="红色元素刷新概率<color=#049500>+{0}</color>" ["rougedesc"]="红色元素刷新概率<color=#049500>+5%</color>"
}, },
[24]={ [24]={
["desc"]="黄色元素刷新概率<color=#049500>+{0}</color>", ["desc"]="黄色元素刷新概率<color=#049500>+5%</color>",
["rougedesc"]="黄色元素刷新概率<color=#049500>+{0}</color>" ["rougedesc"]="黄色元素刷新概率<color=#049500>+5%</color>"
}, },
[25]={ [25]={
["desc"]="绿色元素刷新概率<color=#049500>+{0}</color>", ["desc"]="绿色元素刷新概率<color=#049500>+5%</color>",
["rougedesc"]="绿色元素刷新概率<color=#049500>+{0}</color>" ["rougedesc"]="绿色元素刷新概率<color=#049500>+5%</color>"
}, },
[26]={ [26]={
["desc"]="蓝色元素刷新概率<color=#049500>+{0}</color>", ["desc"]="蓝色元素刷新概率<color=#049500>+5%</color>",
["rougedesc"]="蓝色元素刷新概率<color=#049500>+{0}</color>" ["rougedesc"]="蓝色元素刷新概率<color=#049500>+5%</color>"
}, },
[27]={ [27]={
["desc"]="紫色元素刷新概率<color=#049500>+{0}</color>", ["desc"]="紫色元素刷新概率<color=#049500>+5%</color>",
["rougedesc"]="紫色元素刷新概率<color=#049500>+{0}</color>" ["rougedesc"]="紫色元素刷新概率<color=#049500>+5%</color>"
}, },
[28]={ [28]={
["desc"]="将场上随机<color=#049500>3</color>个非红色元素变为红色", ["desc"]="将场上随机<color=#049500>3</color>个非红色元素变为红色",

View File

@ -2002,10 +2002,10 @@ end
--@endregion --@endregion
--@region 属性相关 --@region 属性相关
function GFunc.getFinalAttrValue(attrName, attrNum) function GFunc.getFinalAttrValue(attrName, attrNum, decimal)
local cfg = ConfigManager:getConfigWithOtherKey("attr", "name")[attrName] local cfg = ConfigManager:getConfigWithOtherKey("attr", "name")[attrName]
if cfg and cfg.is_percent then if cfg and cfg.is_percent then
return GFunc.num2Str(attrNum / 100, 2) .. "%" return GFunc.num2Str(attrNum / 100, decimal) .. "%"
else else
return attrNum // GConst.DEFAULT_FACTOR return attrNum // GConst.DEFAULT_FACTOR
end end
@ -2068,8 +2068,17 @@ function GFunc.getPerStr(key, str, ispercent)
return str return str
end end
function GFunc.getBuffDesc(buffName, effectNum, ispercent) function GFunc.getFinalBuffValue(buffName, attrNum, decimal)
effectNum = GFunc.getPerStr(buffName, effectNum, ispercent) 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) return I18N:getTextWithOtherKey("buff", "name", buffName, "desc", effectNum)
end end

View File

@ -96,23 +96,27 @@ function BattleManager:showBoxOpenUI(rewards, callback)
UIManager:showUI("app/ui/battle/battle_box_open_ui", {rewards = rewards, callback = callback}) UIManager:showUI("app/ui/battle/battle_box_open_ui", {rewards = rewards, callback = callback})
end end
function BattleManager:reqSkillRefresh(isAd) function BattleManager:reqSkillRefresh(isAll, deitySkillIdx)
if not isAd then -- if not isAd then
local cost = GFunc.getConstReward("refresh_skill_cost") -- local cost = GFunc.getConstReward("refresh_skill_cost")
if not GFunc.checkCost(GFunc.getRewardId(cost), GFunc.getRewardNum(cost), true) then -- if not GFunc.checkCost(GFunc.getRewardId(cost), GFunc.getRewardNum(cost), true) then
return -- return
end -- end
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 end
function BattleManager:rspSkillRefresh(result) function BattleManager:rspSkillRefresh(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then if result.err_code == GConst.ERROR_STR.SUCCESS then
if self.battleController and result.reqData 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) end
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.SKILL_REFRESH_SUCC, {isAll = result.reqData.isAll, deitySkillIdx = result.reqData.deitySkillIdx})
end end
end end

View File

@ -1703,16 +1703,16 @@ function BattleBaseController:setGridBreakCondition(gridMap, posId, condition)
gridMap[posId][condition] = true gridMap[posId][condition] = true
end end
function BattleBaseController:tryShowSelectSkillComp(needDelay, onlyCommonSkill) function BattleBaseController:tryShowSelectSkillComp(needDelay, isGodSkill)
self.canChoseSkillCount = 1 self.canChoseSkillCount = 1
local skillList = self:getRandomSkillList(nil, onlyCommonSkill) local skillList = self:getRandomSkillList(nil, isGodSkill)
if needDelay then if needDelay then
self.showSelectSkillSid = ModuleManager.BattleManager:performWithDelayGlobal(function() self.showSelectSkillSid = ModuleManager.BattleManager:performWithDelayGlobal(function()
self.battleUI:showSelectSkillComp(skillList, onlyCommonSkill) self.battleUI:showSelectSkillComp(skillList, isGodSkill)
self.showSelectSkillSid = nil self.showSelectSkillSid = nil
end, 0.3) end, 0.3)
else else
self.battleUI:showSelectSkillComp(skillList, onlyCommonSkill) self.battleUI:showSelectSkillComp(skillList, isGodSkill)
end end
BIReport:postShowFightSkillSelect(self.battleType, self.battleData, skillList, self.chapterId, self.totalDurationTime, self:getWaveIndex()) BIReport:postShowFightSkillSelect(self.battleType, self.battleData, skillList, self.chapterId, self.totalDurationTime, self:getWaveIndex())
@ -2301,10 +2301,11 @@ function BattleBaseController:getRandomGridInfo()
local fixedRandomList = fixedRandomGrid[self.curBoardIndex] local fixedRandomList = fixedRandomGrid[self.curBoardIndex]
local gridType = 0 local gridType = 0
-- local elementType local elementType
-- if fixedRandomList and fixedRandomList[1] then local isUniversal = false
-- elementType = table.remove(fixedRandomList, 1) if fixedRandomList and fixedRandomList[1] then
-- else elementType = table.remove(fixedRandomList, 1)
else
-- local map = self.battleData:getElementTypeMap() -- local map = self.battleData:getElementTypeMap()
-- self.getRandomGridInfoIndexs = table.clearOrCreate(self.getRandomGridInfoIndexs) -- self.getRandomGridInfoIndexs = table.clearOrCreate(self.getRandomGridInfoIndexs)
-- self.getRandomGridInfoTypeList = table.clearOrCreate(self.getRandomGridInfoTypeList) -- self.getRandomGridInfoTypeList = table.clearOrCreate(self.getRandomGridInfoTypeList)
@ -2324,17 +2325,20 @@ function BattleBaseController:getRandomGridInfo()
-- local index = GFunc.getRandomIndex(self.getRandomGridInfoIndexs) -- local index = GFunc.getRandomIndex(self.getRandomGridInfoIndexs)
-- elementType = self.getRandomGridInfoTypeList[index] -- elementType = self.getRandomGridInfoTypeList[index]
-- end
local weights = {2000, 2000, 2000, 2000, 2000} local weights = {2000, 2000, 2000, 2000, 2000}
local extWeights = self.atkTeam:getElementExtRatio() local extWeights = self.atkTeam:getElementExtRatio()
for i, v in ipairs(weights) do 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) weights[i] = weights[i] + (extWeights[i] or 0)
end end
local elementType = GFunc.getRandomIndex(weights) end
local isUniversal = false elementType = GFunc.getRandomIndex(weights)
if self.atkTeam:checkUniversal() and not self.battleData:hadUniversalGrid() then if self.atkTeam:checkUniversal() and not self.battleData:hadUniversalGrid() then
isUniversal = true isUniversal = true
end end
end
return {gridType = gridType, elementType = elementType, isUniversal = isUniversal} return {gridType = gridType, elementType = elementType, isUniversal = isUniversal}
end end
@ -2368,7 +2372,7 @@ function BattleBaseController:findSkillInfluenceGrids()
end end
end end
function BattleBaseController:getRandomSkillList(getCount, onlyCommonSkill, excludeMap) function BattleBaseController:getRandomSkillList(getCount, isGodSkill, excludeMap)
local fixedList = self:getFixedRogueSkill() local fixedList = self:getFixedRogueSkill()
if fixedList[1] then if fixedList[1] then
return table.remove(fixedList, 1) return table.remove(fixedList, 1)
@ -2383,7 +2387,7 @@ function BattleBaseController:getRandomSkillList(getCount, onlyCommonSkill, excl
local skillPool = self:getSkillPool() local skillPool = self:getSkillPool()
local count = 0 local count = 0
if not onlyCommonSkill then if not isGodSkill then
for elementType, list in pairs(skillPool) do -- 先遍历一下未解锁的技能 for elementType, list in pairs(skillPool) do -- 先遍历一下未解锁的技能
if not self:isUnlockedSkillElementType(elementType) then if not self:isUnlockedSkillElementType(elementType) then
local skillEntity = self:getSkillEntityByElement(elementType) local skillEntity = self:getSkillEntityByElement(elementType)
@ -2447,7 +2451,7 @@ function BattleBaseController:getRandomSkillList(getCount, onlyCommonSkill, excl
for skillId, info in pairs(cfg) do for skillId, info in pairs(cfg) do
if not self:getNotInvolvedSkills()[skillId] then 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 info.limit_times or self:getSkillCount(skillId) < info.limit_times then
if not self.randomSkillMap[skillId] then if not self.randomSkillMap[skillId] then
table.insert(self.randomSkillNewSkillPool, skillId) table.insert(self.randomSkillNewSkillPool, skillId)
@ -2471,6 +2475,32 @@ function BattleBaseController:getRandomSkillList(getCount, onlyCommonSkill, excl
end end
local result = table.shuffle(self.randomSkillList) 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 return result
end end

View File

@ -171,7 +171,7 @@ function HeroManager:getSkillRogueDesc(skillId, value)
end end
local str local str
if cfg.attr then if cfg.attr then
str = GFunc.getPerStr(cfg.attr.type, value) str = GFunc.getFinalAttrValue(cfg.attr.type, value)
end end
return I18N:getText("skill_rogue", skillId, "desc", str) return I18N:getText("skill_rogue", skillId, "desc", str)
end end

View File

@ -102,20 +102,20 @@ function BattlePauseUI:_refreshScrollRect()
local cfg = ConfigManager:getConfig("skill_rogue")[skillId] local cfg = ConfigManager:getConfig("skill_rogue")[skillId]
local str local str
if cfg and cfg.attr and ModuleManager.HeroManager:showValueRogue(skillId) then 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 end
cell:refresh(skillId, count, str) cell:refresh(skillId, count, str)
cell:addClickListener(function() cell:addClickListener(function()
local valueStr local valueStr = ModuleManager.HeroManager:getSkillRogueDesc(skillId, value)
if skillId == 24 then -- 特殊处理 -- if skillId == 24 then -- 特殊处理
if ModuleManager.BattleManager.battleController then -- if ModuleManager.BattleManager.battleController then
valueStr = ModuleManager.BattleManager.battleController.battleData:getSkillCount(skillId) -- valueStr = ModuleManager.BattleManager.battleController.battleData:getSkillCount(skillId)
valueStr = I18N:getText("skill_rogue", skillId, "desc", valueStr) -- valueStr = I18N:getText("skill_rogue", skillId, "desc", valueStr)
end -- end
else -- else
valueStr = ModuleManager.HeroManager:getSkillRogueDesc(skillId, value) -- valueStr = ModuleManager.HeroManager:getSkillRogueDesc(skillId, value)
end -- end
if EDITOR_MODE then if EDITOR_MODE then
valueStr = valueStr .. "\n" .. skillId valueStr = valueStr .. "\n" .. skillId
end end

View File

@ -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 BATTLE_COMMON_PATH = "assets/arts/textures/background/battle_common/%s.png"
local SKILL_ICON_POS = { local SKILL_ICON_POS = {
{x =-240, y= 165}, {x =-240, y= 158},
{x =-240, y= 0}, {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.skillList = skillList
self.onlyCommonSkill = onlyCommonSkill self.isGodSkill = isGodSkill
self:_playPop() self:_playPop()
self:_display() self:_display()
self:_addListeners() self:_addListeners()
@ -20,7 +21,7 @@ end
function BattleSkillSelectComp:_display() function BattleSkillSelectComp:_display()
local uiMap = self:getUIMap() local uiMap = self:getUIMap()
local bg2 = uiMap["battle_select_skill_comp.bg_2"] 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"] local bg = uiMap["battle_select_skill_comp.bg_1"]
if ModuleManager.BattleManager.battleController then if ModuleManager.BattleManager.battleController then
bg:setVisible(false) bg:setVisible(false)
@ -43,16 +44,18 @@ function BattleSkillSelectComp:_addListeners()
end end
SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.BATTLE_SKILL_REFRESH, function() SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.BATTLE_SKILL_REFRESH, function()
ModuleManager.BattleManager:reqSkillRefresh(true) ModuleManager.BattleManager:reqSkillRefresh()
end) end)
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 if not ModuleManager.BattleManager.battleController then
return return
end end
ModuleManager.BattleManager:reqSkillRefresh(false) SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.BATTLE_SKILL_ALL, function()
ModuleManager.BattleManager:reqSkillRefresh(true)
end)
end) end)
self.canvasGroup = uiMap["battle_select_skill_comp.skill_node"]:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP) self.canvasGroup = uiMap["battle_select_skill_comp.skill_node"]:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP)
@ -75,30 +78,58 @@ end
function BattleSkillSelectComp:refreshBtns() function BattleSkillSelectComp:refreshBtns()
local uiMap = self:getUIMap() 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.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 battleController = ModuleManager.BattleManager.battleController
local talentCount = DataManager.TalentData:getSkillRefreshCount() local getAllAdCount = GFunc.getConstIntValue("ads_getall_rogue_limit")
local cfgAdCount = GFunc.getConstIntValue("ad_refresh_skill") local allCount = battleController.battleData:getAllSkillCount()
local cfgRefreshCount = GFunc.getConstIntValue("diamond_refresh_skill") + cfgAdCount + talentCount if getAllAdCount > allCount then
local adCount = battleController.battleData:getADRefreshSkillCount() + talentCount allBtn:setActive(true)
local refreshCount =battleController.battleData:getRefreshSkillCount() else
local showAdBtn = cfgAdCount > adCount allBtn:setActive(false)
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)
end end
function BattleSkillSelectComp:getNewRandomSkill() local cfgAdCount = GFunc.getConstIntValue("ad_refresh_skill")
local talentCount = DataManager.TalentData:getSkillRefreshCount()
local adCount = battleController.battleData:getADRefreshSkillCount() + talentCount
if cfgAdCount > adCount then
adBtn:setActive(true)
else
adBtn:setActive(false)
end
end
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() self:refreshBtns()
local excludeMap = {} local excludeMap = {}
for _, id in ipairs(self.skillList) do for _, id in ipairs(self.skillList) do
excludeMap[id] = true excludeMap[id] = true
end end
self.skillList = ModuleManager.BattleManager.battleController:getRandomSkillList(nil, self.onlyCommonSkill, excludeMap) self.skillList = ModuleManager.BattleManager.battleController:getRandomSkillList(nil, self.isGodSkill, excludeMap)
self:refreshRogueSkill() self:refreshRogueSkill()
end end
@ -106,18 +137,26 @@ function BattleSkillSelectComp:refreshRogueSkill()
local uiMap = self:getUIMap() local uiMap = self:getUIMap()
if not self.selectSkillCells then if not self.selectSkillCells then
self.selectSkillCells = {} 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) self.selectSkillCells[i] = CellManager:addCellComp(uiMap["battle_select_skill_comp.skill_node.skill_select_cell_" .. i], SELECT_SKILL_CELL)
end end
end end
for index, cell in ipairs(self.selectSkillCells) do for i = 1, 4 do
local skillId = self.skillList[index] local skillId = self.skillList[i]
cell:getBaseObject():setActive(skillId ~= nil)
if skillId then if skillId then
cell:refresh(skillId, function(value) self.selectSkillCells[i]:getBaseObject():setActive(true)
self:onClickSkill(skillId, value, SKILL_ICON_POS[index]) 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) end)
else
self:onClickSkill(skillId, value, SKILL_ICON_POS[i])
end
end)
else
self.selectSkillCells[i]:getBaseObject():setActive(false)
end end
end end
end end

View File

@ -338,9 +338,9 @@ function BattleUI:_addListeners()
self:showTutorialFinger(posIdList) self:showTutorialFinger(posIdList)
end) 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 if self.selectSkillComp then
self.selectSkillComp:getNewRandomSkill() self.selectSkillComp:getNewRandomSkill(parmas)
end end
end) end)
end end

View File

@ -13,7 +13,7 @@ function BattleSelectSkillCell:refresh(skillId, func)
if cfg.type == 5 then if cfg.type == 5 then
self.value = math.random(cfg.attr.minnum, cfg.attr.maxnum) self.value = math.random(cfg.attr.minnum, cfg.attr.maxnum)
self.value = self.value // 100 * 100 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) value = ModuleManager.HeroManager:getSkillRogueDesc(skillId, self.value)
else else
self.value = nil self.value = nil

View File

@ -220,12 +220,12 @@ function EquipGrowthUI:refreshPageUp()
local _, _, resonateAttrNum = DataManager.EquipData:getResonateLevel(GConst.EquipConst.RESONATE_PAGE.LV_UP, self.equipPart) local _, _, resonateAttrNum = DataManager.EquipData:getResonateLevel(GConst.EquipConst.RESONATE_PAGE.LV_UP, self.equipPart)
local currAttr = equipEntity:getBaseAttrWithLv(lv) local currAttr = equipEntity:getBaseAttrWithLv(lv)
self.upAttrNameTx:setText(GFunc.getAttrNameByType(currAttr.type)) 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) self.upAttrCurrTx:setText(currAttrNum)
if not isLvMax then if not isLvMax then
self.upNextLvTx:setText(lv + 1) self.upNextLvTx:setText(lv + 1)
local nextAttr = equipEntity:getBaseAttrWithLv(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) self.upAttrNextTx:setText(nextAttrNum)
local itemCost = DataManager.EquipData:getLevelCost(lv + 1) local itemCost = DataManager.EquipData:getLevelCost(lv + 1)
local costId = GFunc.getRewardId(itemCost) local costId = GFunc.getRewardId(itemCost)
@ -253,10 +253,10 @@ function EquipGrowthUI:refreshPageRefine()
local extraAttr = attrs[i] local extraAttr = attrs[i]
local nowAttr = DataManager.EquipData:getRefineAttrAdd(refine, extraAttr.type) local nowAttr = DataManager.EquipData:getRefineAttrAdd(refine, extraAttr.type)
self.refineAttrNameTxs[i]:setText(GFunc.getAttrNameByType(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 if not isMaxRefine then
local nextAttr = DataManager.EquipData:getRefineAttrAdd(refine + 1, extraAttr.type) 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 -- if isGrowthUp and self.effectNameResult then
-- self:playEffect(cell.txAttrBaseEffect) -- self:playEffect(cell.txAttrBaseEffect)
-- end -- end

View File

@ -117,7 +117,7 @@ function EquipInfoUI:refreshPreview()
cell.attrNameTx:setText(GFunc.getAttrDesc(extraAttr.type, extraAttr.minnum)) cell.attrNameTx:setText(GFunc.getAttrDesc(extraAttr.type, extraAttr.minnum))
cell.attrValueTx:setText(GConst.EMPTY_STRING) cell.attrValueTx:setText(GConst.EMPTY_STRING)
cell.attrValueAddTx:setActive(true) cell.attrValueAddTx:setActive(true)
cell.attrValueAddTx:setText("<color=#FFFFFF>".. GFunc.getFinalAttrValue(extraAttr.type, extraAttr.minnum) .. "-".. GFunc.getFinalAttrValue(extraAttr.type, extraAttr.maxnum) .."</color>") cell.attrValueAddTx:setText("<color=#FFFFFF>".. GFunc.getFinalAttrValue(extraAttr.type, extraAttr.minnum, 2) .. "-".. GFunc.getFinalAttrValue(extraAttr.type, extraAttr.maxnum, 2) .."</color>")
end end
self.replaceBtn:setActive(false) self.replaceBtn:setActive(false)
self.upBtn:setActive(false) self.upBtn:setActive(false)
@ -133,7 +133,7 @@ function EquipInfoUI:refreshBaseAttr()
cell.attrExtraCell:setActive(true) cell.attrExtraCell:setActive(true)
local extraAttr = attrs[i] local extraAttr = attrs[i]
cell.attrNameTx:setText(GFunc.getAttrDesc(extraAttr.type, extraAttr.num)) 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.attrValueTx:setAnchoredPositionX(-10)
cell.attrValueAddTx:setActive(false) cell.attrValueAddTx:setActive(false)
else else
@ -174,14 +174,14 @@ function EquipInfoUI:refreshAllAttr()
local extraAttr = attrs[i] local extraAttr = attrs[i]
local extraAttrId = GFunc.getAttrIdByName(extraAttr.type) local extraAttrId = GFunc.getAttrIdByName(extraAttr.type)
cell.attrNameTx:setText(GFunc.getAttrNameByType(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 attrAdd = DataManager.EquipData:getRefineAttrAdd(self.refine, extraAttrId)
local anchorX = -40 local anchorX = -40
if attrAdd.num <= 0 then if attrAdd.num <= 0 then
cell.attrValueAddTx:setActive(false) cell.attrValueAddTx:setActive(false)
else else
cell.attrValueAddTx:setActive(true) cell.attrValueAddTx:setActive(true)
cell.attrValueAddTx:setText("<color=#09FF00>(+".. GFunc.getFinalAttrValue(attrAdd.type, attrAdd.num) ..")</color>") cell.attrValueAddTx:setText("<color=#09FF00>(+".. GFunc.getFinalAttrValue(attrAdd.type, attrAdd.num, 2) ..")</color>")
local meshProCompNext = cell.attrValueAddTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO) local meshProCompNext = cell.attrValueAddTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO)
local nowTipsNextX = meshProCompNext.preferredWidth local nowTipsNextX = meshProCompNext.preferredWidth
cell.attrValueAddTx:setSizeDeltaX(nowTipsNextX) cell.attrValueAddTx:setSizeDeltaX(nowTipsNextX)

View File

@ -38,8 +38,8 @@ end
function HeroAttrUI:onRefresh() function HeroAttrUI:onRefresh()
local attr = self.heroEntity:getStarAttr() local attr = self.heroEntity:getStarAttr()
self.hpAttrTx:setText(GFunc.getFinalAttrValue(GConst.ALL_ATTR.ATTR_HPP_ALL, attr.attr_hpp_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)) self.atkAttrTx:setText(GFunc.getFinalAttrValue(GConst.ALL_ATTR.ATTR_ATKP_ALL, attr.attr_atkp_all or 0, 2))
end end
return HeroAttrUI return HeroAttrUI

View File

@ -53,7 +53,7 @@ function TalentInfoUI:onRefresh()
local attr, num = DataManager.TalentData:getAttrById(self.id) local attr, num = DataManager.TalentData:getAttrById(self.id)
local str = I18N:getText("talent", self.id, "desc") local str = I18N:getText("talent", self.id, "desc")
if attr and #attr > 0 then 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 -- else
-- str = str .. (num or 0) -- str = str .. (num or 0)
end end

View File

@ -112,7 +112,7 @@ function TalentMainUI:onUpgrade()
local attr, num = DataManager.TalentData:getAttrById(upData.id) local attr, num = DataManager.TalentData:getAttrById(upData.id)
local str = I18N:getText("talent", upData.id, "desc") local str = I18N:getText("talent", upData.id, "desc")
if attr and #attr > 0 then 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 -- else
-- str = str .. (num or 0) -- str = str .. (num or 0)
end end

View File

@ -51,6 +51,8 @@ function BattleBaseData:init(params, snapInfo)
self.data.lvDirty = false self.data.lvDirty = false
self.adRefreshSkillCount = snapInfo and snapInfo.adRefreshSkillCount or 0 self.adRefreshSkillCount = snapInfo and snapInfo.adRefreshSkillCount or 0
self.refreshSkillCount = snapInfo and snapInfo.refreshSkillCount 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 BattleSkillEntity.sid = 0
self.atkTeam = self:initTeam(SIDE_ATK, params.atkFormation) self.atkTeam = self:initTeam(SIDE_ATK, params.atkFormation)
self.defTeam = self:initTeam(SIDE_DEF, params.defFormation) self.defTeam = self:initTeam(SIDE_DEF, params.defFormation)
@ -75,6 +77,8 @@ function BattleBaseData:getSnapshoptInfo()
addLvCount = self.addLvCount, addLvCount = self.addLvCount,
commonSelectSkillCount = self.commonSelectSkillCount, commonSelectSkillCount = self.commonSelectSkillCount,
adRefreshSkillCount = self.adRefreshSkillCount, adRefreshSkillCount = self.adRefreshSkillCount,
adGetAllSkillCount = self.adGetAllSkillCount,
adDeityCount = self.adDeityCount,
refreshSkillCount = self.refreshSkillCount, refreshSkillCount = self.refreshSkillCount,
cacheSkillList = self.cacheSkillList, cacheSkillList = self.cacheSkillList,
} }
@ -771,6 +775,22 @@ function BattleBaseData:getADRefreshSkillCount()
return self.adRefreshSkillCount return self.adRefreshSkillCount
end 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) function BattleBaseData:initTeam(side, formation)
local data = nil local data = nil
data = self:initHeroData(formation) data = self:initHeroData(formation)