diff --git a/src/actions/AdvAction.lua b/src/actions/AdvAction.lua index 006b2a7..2fa69a7 100644 --- a/src/actions/AdvAction.lua +++ b/src/actions/AdvAction.lua @@ -45,7 +45,8 @@ function _M.roleFormatRpc(agent , data) for slot, heroId in pairs(msg.heros) do advTeam.heros[slot] = heroId end - role:updateProperty({field = "advTeam", value = advTeam}) + advTeam.leader = msg.leader + role:updateProperty({field = "advTeam", value = advTeam}) SendPacket(actionCodes.Adv_roleFormatRpc, '') return true end diff --git a/src/actions/HangAction.lua b/src/actions/HangAction.lua index 8036f10..26d617b 100644 --- a/src/actions/HangAction.lua +++ b/src/actions/HangAction.lua @@ -146,6 +146,7 @@ function _M.endBattleRpc(agent, data) local carbonData = csvdb["idle_battleCsv"][hangInfo.carbonId] reward[ItemId.Gold] = carbonData.money_clear reward[ItemId.Exp] = carbonData.exp_clear + reward[ItemId.PlayerExp] = carbonData.playerExp_clear for itemId, count in pairs(carbonData.item_clear:toNumMap()) do reward[itemId] = count end diff --git a/src/adv/Adv.lua b/src/adv/Adv.lua index b78b9d4..eb40d43 100644 --- a/src/adv/Adv.lua +++ b/src/adv/Adv.lua @@ -431,15 +431,20 @@ end --关卡通关,非层 score < 0 失败 function Adv:over(success) local score = -1 + local reward if success then -- todo success 计算分数 score = 1 self.owner:updateProperty({field = "advPass", self.owner:getProperty("advPass"):setv(self.advInfo.chapter, score)}) + reward = self.owner:award(self.owner:getProperty("advItems"):toNumMap(), {}) end table.clear(self.advInfo) --清空advInfo self.advTeam.player = nil --重置玩家的数据 self:clear() - self:backEnd(score) + + self.owner:updateProperty({field = "advItems", ""}) + + self:backEnd(score, reward) end function Adv:exit() @@ -976,8 +981,8 @@ function Adv:backNext() self:pushBackEvent(AdvBackEventType.Next, {}) end -function Adv:backEnd(score) - self:pushBackEvent(AdvBackEventType.End, {score = score}) +function Adv:backEnd(score, reward) + self:pushBackEvent(AdvBackEventType.End, {score = score, reward = reward}) end function Adv:backBlockChange(roomId, blockId) diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index 4e3ca02..cf21456 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -77,6 +77,9 @@ function RolePlugin.bind(Role) self:addHero(params) end end, + [ItemType.AdvItem] = function() --冒险道具不会进入 玩家仓库 + count = 0 + end, } -- 对数量筛查 local count = checkItemCount(self, itemId, count) -- libgit2 0.21.2