|
|
@@ -403,6 +403,38 @@ local function updatePowerAndRedDot(human, heroGrid, heroID, heroIndex)
|
|
|
updateHeroAttr(human, heroID, heroIndex)
|
|
|
end
|
|
|
|
|
|
+-- 能否升级
|
|
|
+local function isCanUpGradeLv(human, heroGrid)
|
|
|
+ local artifactsData = getArtifactsData(heroGrid)
|
|
|
+ local currentLevel = artifactsData and artifactsData.level or 0
|
|
|
+ local maxLevel = HeroArtifactsConfig.UpGradeLv[#HeroArtifactsConfig.UpGradeLv].level
|
|
|
+
|
|
|
+ if currentLevel < maxLevel then
|
|
|
+ local itemId, itemCnt = getNextStageCost(currentLevel, 1)
|
|
|
+ if BagLogic.getItemCnt(human, itemId) >= itemCnt then
|
|
|
+ return true
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
+ return false
|
|
|
+end
|
|
|
+
|
|
|
+-- 能否升星
|
|
|
+local function isCanUpGradeStar(human, heroGrid)
|
|
|
+ local artifactsData = getArtifactsData(heroGrid)
|
|
|
+ local currentStar = artifactsData and artifactsData.star or 0
|
|
|
+ local maxStar = HeroArtifactsConfig.UpGradeStar[#HeroArtifactsConfig.UpGradeStar].star
|
|
|
+
|
|
|
+ if currentStar < maxStar then
|
|
|
+ local itemId, itemCnt = getNextStageCost(currentStar, 2)
|
|
|
+ if BagLogic.getItemCnt(human, itemId) >= itemCnt then
|
|
|
+ return true
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
+ return false
|
|
|
+end
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
@@ -541,24 +573,12 @@ function isArtifactsDot(human, heroGrid)
|
|
|
return false
|
|
|
end
|
|
|
|
|
|
- local artifactsData = getArtifactsData(heroGrid)
|
|
|
-
|
|
|
- local currentLevel = artifactsData and artifactsData.level or 0
|
|
|
- local maxLevel = HeroArtifactsConfig.UpGradeLv[#HeroArtifactsConfig.UpGradeLv].level
|
|
|
- if currentLevel < maxLevel then
|
|
|
- local itemId, itemCnt = getNextStageCost(currentLevel, 1)
|
|
|
- if BagLogic.getItemCnt(human, itemId) >= itemCnt then
|
|
|
- return true
|
|
|
- end
|
|
|
+ if isCanUpGradeLv(human, heroGrid) then
|
|
|
+ return true
|
|
|
end
|
|
|
|
|
|
- local currentStar = artifactsData and artifactsData.star or 0
|
|
|
- local maxStar = HeroArtifactsConfig.UpGradeStar[#HeroArtifactsConfig.UpGradeStar].star
|
|
|
- if currentStar < maxStar then
|
|
|
- local itemId, itemCnt = getNextStageCost(currentStar, 2)
|
|
|
- if BagLogic.getItemCnt(human, itemId) >= itemCnt then
|
|
|
- return true
|
|
|
- end
|
|
|
+ if isCanUpGradeStar(human, heroGrid) then
|
|
|
+ return true
|
|
|
end
|
|
|
|
|
|
return false
|
|
|
@@ -631,7 +651,10 @@ function HeroArtifacts_Base_Query(human, heroID, heroIndex)
|
|
|
msgRet.nowStarAttrs[0] = 0
|
|
|
msgRet.effectArr[0] = 0
|
|
|
msgRet.beSkillArr[0] = 0
|
|
|
- msgRet.isActivate = isActivate(heroGrid) and 1 or 0
|
|
|
+ msgRet.isActivate = 0
|
|
|
+ msgRet.redDotArr[0] = 2
|
|
|
+ msgRet.redDotArr[1] = 0
|
|
|
+ msgRet.redDotArr[2] = 0
|
|
|
|
|
|
populateActivateCostMsg(msgRet.ActivateCost)
|
|
|
populateTotalAttrMsg(msgRet.nowLevelAttrs, currentLevel, 1)
|
|
|
@@ -643,6 +666,18 @@ function HeroArtifacts_Base_Query(human, heroID, heroIndex)
|
|
|
|
|
|
populateBeSkillMsg(msgRet.beSkillArr, artifactsData and artifactsData.beSkillArr)
|
|
|
|
|
|
+ if isActivate(heroGrid) then
|
|
|
+ msgRet.isActivate = 1
|
|
|
+
|
|
|
+ if isCanUpGradeLv(human, heroGrid) then
|
|
|
+ msgRet.redDotArr[1] = 1
|
|
|
+ end
|
|
|
+
|
|
|
+ if isCanUpGradeStar(human, heroGrid) then
|
|
|
+ msgRet.redDotArr[2] = 1
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
Msg.send(msgRet, human.fd)
|
|
|
end
|
|
|
|
|
|
@@ -672,6 +707,8 @@ function HeroArtifacts_Activate(human, heroID, heroIndex)
|
|
|
|
|
|
HeroArtifacts_Base_Query(human, heroID, heroIndex)
|
|
|
|
|
|
+ updateHeroAttr(human, heroID, heroIndex)
|
|
|
+
|
|
|
-- 弹窗礼包
|
|
|
GiftLogic = GiftLogic or require("topup.GiftLogic")
|
|
|
GiftLogic.trigger(human, GiftLogic.GIFT_ARTIFACTS_OPEN, {currentVal = 0}, GiftLogic.GIFT_SEC_TYPE3)
|
|
|
@@ -748,6 +785,8 @@ function HeroArtifacts_UpGrade_Level(human, heroID, heroIndex)
|
|
|
HeroArtifacts_Lv_Query(human, heroID, heroIndex)
|
|
|
|
|
|
updatePowerAndRedDot(human, heroGrid, heroID, heroIndex)
|
|
|
+
|
|
|
+ HeroArtifacts_Base_Query(human, heroID, heroIndex)
|
|
|
end
|
|
|
|
|
|
-- 神威灵装升星信息查询
|
|
|
@@ -880,6 +919,8 @@ function HeroArtifacts_UpGrade_Star(human, heroID, heroIndex)
|
|
|
|
|
|
updatePowerAndRedDot(human, heroGrid, heroID, heroIndex)
|
|
|
|
|
|
+ HeroArtifacts_Base_Query(human, heroID, heroIndex)
|
|
|
+
|
|
|
-- 弹窗礼包
|
|
|
GiftLogic = GiftLogic or require("topup.GiftLogic")
|
|
|
GiftLogic.trigger(human, GiftLogic.GIFT_ARTIFACTS_UPGRADE_STAR, {currentVal = nextStar}, GiftLogic.GIFT_SEC_TYPE3)
|