Commit 00115a7a860fd7cc2e7e31516f7c8a1756388201
1 parent
4b7c7c96
奖励发放
Showing
4 changed files
with
14 additions
and
4 deletions
Show diff stats
src/actions/AdvAction.lua
... | ... | @@ -45,7 +45,8 @@ function _M.roleFormatRpc(agent , data) |
45 | 45 | for slot, heroId in pairs(msg.heros) do |
46 | 46 | advTeam.heros[slot] = heroId |
47 | 47 | end |
48 | - role:updateProperty({field = "advTeam", value = advTeam}) | |
48 | + advTeam.leader = msg.leader | |
49 | + role:updateProperty({field = "advTeam", value = advTeam}) | |
49 | 50 | SendPacket(actionCodes.Adv_roleFormatRpc, '') |
50 | 51 | return true |
51 | 52 | end | ... | ... |
src/actions/HangAction.lua
... | ... | @@ -146,6 +146,7 @@ function _M.endBattleRpc(agent, data) |
146 | 146 | local carbonData = csvdb["idle_battleCsv"][hangInfo.carbonId] |
147 | 147 | reward[ItemId.Gold] = carbonData.money_clear |
148 | 148 | reward[ItemId.Exp] = carbonData.exp_clear |
149 | + reward[ItemId.PlayerExp] = carbonData.playerExp_clear | |
149 | 150 | for itemId, count in pairs(carbonData.item_clear:toNumMap()) do |
150 | 151 | reward[itemId] = count |
151 | 152 | end | ... | ... |
src/adv/Adv.lua
... | ... | @@ -431,15 +431,20 @@ end |
431 | 431 | --关卡通关,非层 score < 0 失败 |
432 | 432 | function Adv:over(success) |
433 | 433 | local score = -1 |
434 | + local reward | |
434 | 435 | if success then |
435 | 436 | -- todo success 计算分数 |
436 | 437 | score = 1 |
437 | 438 | self.owner:updateProperty({field = "advPass", self.owner:getProperty("advPass"):setv(self.advInfo.chapter, score)}) |
439 | + reward = self.owner:award(self.owner:getProperty("advItems"):toNumMap(), {}) | |
438 | 440 | end |
439 | 441 | table.clear(self.advInfo) --清空advInfo |
440 | 442 | self.advTeam.player = nil --重置玩家的数据 |
441 | 443 | self:clear() |
442 | - self:backEnd(score) | |
444 | + | |
445 | + self.owner:updateProperty({field = "advItems", ""}) | |
446 | + | |
447 | + self:backEnd(score, reward) | |
443 | 448 | end |
444 | 449 | |
445 | 450 | function Adv:exit() |
... | ... | @@ -976,8 +981,8 @@ function Adv:backNext() |
976 | 981 | self:pushBackEvent(AdvBackEventType.Next, {}) |
977 | 982 | end |
978 | 983 | |
979 | -function Adv:backEnd(score) | |
980 | - self:pushBackEvent(AdvBackEventType.End, {score = score}) | |
984 | +function Adv:backEnd(score, reward) | |
985 | + self:pushBackEvent(AdvBackEventType.End, {score = score, reward = reward}) | |
981 | 986 | end |
982 | 987 | |
983 | 988 | function Adv:backBlockChange(roomId, blockId) | ... | ... |
src/models/RolePlugin.lua