fix bug
This commit is contained in:
parent
9e99bea561
commit
ebb3797170
@ -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",
|
||||
|
||||
@ -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
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
@ -88,24 +88,24 @@ local skill_rogue = {
|
||||
["rougedesc"]="随机一个技能能量全满"
|
||||
},
|
||||
[23]={
|
||||
["desc"]="红色元素刷新概率<color=#049500>+{0}</color>",
|
||||
["rougedesc"]="红色元素刷新概率<color=#049500>+{0}</color>"
|
||||
["desc"]="红色元素刷新概率<color=#049500>+5%</color>",
|
||||
["rougedesc"]="红色元素刷新概率<color=#049500>+5%</color>"
|
||||
},
|
||||
[24]={
|
||||
["desc"]="黄色元素刷新概率<color=#049500>+{0}</color>",
|
||||
["rougedesc"]="黄色元素刷新概率<color=#049500>+{0}</color>"
|
||||
["desc"]="黄色元素刷新概率<color=#049500>+5%</color>",
|
||||
["rougedesc"]="黄色元素刷新概率<color=#049500>+5%</color>"
|
||||
},
|
||||
[25]={
|
||||
["desc"]="绿色元素刷新概率<color=#049500>+{0}</color>",
|
||||
["rougedesc"]="绿色元素刷新概率<color=#049500>+{0}</color>"
|
||||
["desc"]="绿色元素刷新概率<color=#049500>+5%</color>",
|
||||
["rougedesc"]="绿色元素刷新概率<color=#049500>+5%</color>"
|
||||
},
|
||||
[26]={
|
||||
["desc"]="蓝色元素刷新概率<color=#049500>+{0}</color>",
|
||||
["rougedesc"]="蓝色元素刷新概率<color=#049500>+{0}</color>"
|
||||
["desc"]="蓝色元素刷新概率<color=#049500>+5%</color>",
|
||||
["rougedesc"]="蓝色元素刷新概率<color=#049500>+5%</color>"
|
||||
},
|
||||
[27]={
|
||||
["desc"]="紫色元素刷新概率<color=#049500>+{0}</color>",
|
||||
["rougedesc"]="紫色元素刷新概率<color=#049500>+{0}</color>"
|
||||
["desc"]="紫色元素刷新概率<color=#049500>+5%</color>",
|
||||
["rougedesc"]="紫色元素刷新概率<color=#049500>+5%</color>"
|
||||
},
|
||||
[28]={
|
||||
["desc"]="将场上随机<color=#049500>3</color>个非红色元素变为红色",
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
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
|
||||
|
||||
|
||||
@ -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,10 +2301,11 @@ 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 elementType
|
||||
local isUniversal = false
|
||||
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)
|
||||
@ -2324,17 +2325,20 @@ function BattleBaseController:getRandomGridInfo()
|
||||
|
||||
-- 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
|
||||
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
|
||||
local elementType = GFunc.getRandomIndex(weights)
|
||||
local isUniversal = false
|
||||
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}
|
||||
end
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 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
|
||||
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 adCount = battleController.battleData:getADRefreshSkillCount() + talentCount
|
||||
if cfgAdCount > adCount then
|
||||
adBtn:setActive(true)
|
||||
else
|
||||
adBtn:setActive(false)
|
||||
end
|
||||
uiMap["battle_select_skill_comp.skill_node.diamond_btn"]:setActive(showBtn)
|
||||
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,18 +137,26 @@ 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)
|
||||
for i = 1, 4 do
|
||||
local skillId = self.skillList[i]
|
||||
if skillId then
|
||||
cell:refresh(skillId, function(value)
|
||||
self:onClickSkill(skillId, value, SKILL_ICON_POS[index])
|
||||
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)
|
||||
else
|
||||
self.selectSkillCells[i]:getBaseObject():setActive(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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("<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
|
||||
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("<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 nowTipsNextX = meshProCompNext.preferredWidth
|
||||
cell.attrValueAddTx:setSizeDeltaX(nowTipsNextX)
|
||||
|
||||
@ -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
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user