|
|
@@ -142,6 +142,48 @@ local function genBuyItem()
|
|
|
}
|
|
|
end
|
|
|
|
|
|
+--某个战令奖励是否已经领完, 返回false表示没有,true表示已经领完
|
|
|
+local function isGetAllAward(human,orderType)
|
|
|
+ local warOrder = human.db.warOrder
|
|
|
+ if not warOrder then
|
|
|
+ return false
|
|
|
+ end
|
|
|
+
|
|
|
+ local orderName = orderNameMap[orderType]
|
|
|
+ local cfg = OrderExcel[orderName]
|
|
|
+ local orderData = warOrder[orderName]
|
|
|
+ if not cfg or not orderData then
|
|
|
+ return false
|
|
|
+ end
|
|
|
+
|
|
|
+ local allNum = #cfg
|
|
|
+ local isGetAll = true
|
|
|
+
|
|
|
+ --普通奖励
|
|
|
+ local commonNum = 0
|
|
|
+ local commonRecord = orderData.finish
|
|
|
+ for k in pairs(commonRecord or {}) do
|
|
|
+ commonNum = commonNum + 1
|
|
|
+ end
|
|
|
+
|
|
|
+ if commonNum < allNum then
|
|
|
+ isGetAll = false
|
|
|
+ return isGetAll
|
|
|
+ end
|
|
|
+
|
|
|
+ --进阶奖励
|
|
|
+ local upgradeNum = 0
|
|
|
+ local upgradeRecord = orderData.upgradeFinish
|
|
|
+ for k in pairs(upgradeRecord or {}) do
|
|
|
+ upgradeNum = upgradeNum + 1
|
|
|
+ end
|
|
|
+ if upgradeNum < allNum then
|
|
|
+ isGetAll = false
|
|
|
+ end
|
|
|
+
|
|
|
+ return isGetAll
|
|
|
+end
|
|
|
+
|
|
|
------------------------------------------------------
|
|
|
-- 对外暴露接口
|
|
|
------------------------------------------------------
|
|
|
@@ -157,6 +199,17 @@ function isDot(human)
|
|
|
return isDot
|
|
|
end
|
|
|
|
|
|
+--判断是否显示入口, 返回true表示显示, false表示不显示, 领完四个类型战令的奖励就关闭
|
|
|
+function isOpen(human)
|
|
|
+ for orderType in pairs(orderNameMap) do
|
|
|
+ if not isGetAllAward(human,orderType) then
|
|
|
+ return true
|
|
|
+ end
|
|
|
+ end
|
|
|
+ return false
|
|
|
+end
|
|
|
+
|
|
|
+
|
|
|
function warOrderInfo(human,orderType)
|
|
|
local orderName = orderNameMap[orderType]
|
|
|
local cfg = OrderExcel[orderName]
|
|
|
@@ -255,7 +308,9 @@ function warOrderReward(human,orderType)
|
|
|
local itemMap = {}
|
|
|
--local finish_copy = table.copy(orderData.finish)
|
|
|
--local upgrade_finish_copy = table.copy(orderData.upgradeFinish)
|
|
|
- for _,v in pairs(cfg) do
|
|
|
+ local allAwardCnt = 0
|
|
|
+ for _,v in pairs(cfg) do
|
|
|
+ allAwardCnt = allAwardCnt + 1
|
|
|
if process >= v.process then
|
|
|
local isOk,isUpgradeOk = checkRewardByIdx(human,orderType,v.idx)
|
|
|
if isOk then
|
|
|
@@ -301,6 +356,12 @@ function warOrderReward(human,orderType)
|
|
|
isRed[orderType] = nil
|
|
|
-- 通知外层红点取消
|
|
|
RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_2005)
|
|
|
+
|
|
|
+ --判断是否领完奖励要关闭入口显示了
|
|
|
+ if #finish >= allAwardCnt and #upgradeFinish >= allAwardCnt then
|
|
|
+ RoleSystemLogic.isClose(human, RoleSystemDefine.ROLE_SYS_ID_2005)
|
|
|
+ end
|
|
|
+
|
|
|
return {
|
|
|
orderType = orderType,
|
|
|
exp = orderData.exp,
|