Commit 464ccbd2edf21fccf86b6f8fd2729a37376c5038
Merge bugfix to develop
Showing
1 changed file
with
23 additions
and
4 deletions
Show diff stats
src/actions/ActivityAction.lua
| @@ -488,8 +488,16 @@ function _M.startBattleRpc(agent, data) | @@ -488,8 +488,16 @@ function _M.startBattleRpc(agent, data) | ||
| 488 | local bi = actData[id] | 488 | local bi = actData[id] |
| 489 | if not bi then return 8 end | 489 | if not bi then return 8 end |
| 490 | local star = bi["star"] or 0 | 490 | local star = bi["star"] or 0 |
| 491 | - if star < 1 then | ||
| 492 | - return 9 | 491 | + local maxP = bi["maxP"] or 0 |
| 492 | + -- 世界boss | ||
| 493 | + if battleCfg.worldBoss_award ~= 0 then | ||
| 494 | + if maxP < 1 then | ||
| 495 | + return 9 | ||
| 496 | + end | ||
| 497 | + else | ||
| 498 | + if star < 1 then | ||
| 499 | + return 9 | ||
| 500 | + end | ||
| 493 | end | 501 | end |
| 494 | num = num * count | 502 | num = num * count |
| 495 | end | 503 | end |
| @@ -516,7 +524,7 @@ function _M.startBattleRpc(agent, data) | @@ -516,7 +524,7 @@ function _M.startBattleRpc(agent, data) | ||
| 516 | return 7 | 524 | return 7 |
| 517 | end | 525 | end |
| 518 | local bi = actData[id] | 526 | local bi = actData[id] |
| 519 | - local star = bi["star"] | 527 | + local star = bi["star"] or 0 |
| 520 | local award = battleCfg.item_clear:toNumMap() | 528 | local award = battleCfg.item_clear:toNumMap() |
| 521 | if getStarCount(battleCfg, star) == 3 then | 529 | if getStarCount(battleCfg, star) == 3 then |
| 522 | local aw = battleCfg.perfect_reward:toNumMap() | 530 | local aw = battleCfg.perfect_reward:toNumMap() |
| @@ -531,7 +539,7 @@ function _M.startBattleRpc(agent, data) | @@ -531,7 +539,7 @@ function _M.startBattleRpc(agent, data) | ||
| 531 | SendPacket(actionCodes.Activity_startBattleRpc, MsgPack.pack(role:packReward(reward, change))) | 539 | SendPacket(actionCodes.Activity_startBattleRpc, MsgPack.pack(role:packReward(reward, change))) |
| 532 | 540 | ||
| 533 | if battleCfg.worldBoss_award ~= 0 and (bi["maxP"] or 0) > 0 then | 541 | if battleCfg.worldBoss_award ~= 0 and (bi["maxP"] or 0) > 0 then |
| 534 | - bi["bossP"] = (bi["bossP"] or 0) + bi["maxP"] | 542 | + bi["bossP"] = (bi["bossP"] or 0) + bi["maxP"] * count |
| 535 | end | 543 | end |
| 536 | 544 | ||
| 537 | bi["sum"] = bi["sum"] + bi["top"] | 545 | bi["sum"] = bi["sum"] + bi["top"] |
| @@ -836,6 +844,7 @@ function _M.bossRewardRpc(agent, data) | @@ -836,6 +844,7 @@ function _M.bossRewardRpc(agent, data) | ||
| 836 | local awardCfg = actCfg[index] | 844 | local awardCfg = actCfg[index] |
| 837 | if not awardCfg then return 6 end | 845 | if not awardCfg then return 6 end |
| 838 | 846 | ||
| 847 | + local totalAwardCnt = #actCfg | ||
| 839 | local preList = awardCfg.condition1:toArray(true, "=") | 848 | local preList = awardCfg.condition1:toArray(true, "=") |
| 840 | 849 | ||
| 841 | local actData = role.activity:getActData("ChallengeLevel") or {} | 850 | local actData = role.activity:getActData("ChallengeLevel") or {} |
| @@ -863,6 +872,16 @@ function _M.bossRewardRpc(agent, data) | @@ -863,6 +872,16 @@ function _M.bossRewardRpc(agent, data) | ||
| 863 | if not ok then return 8 end | 872 | if not ok then return 8 end |
| 864 | 873 | ||
| 865 | battleInfo["bossR"] = string.setbit(bossRecord, index) | 874 | battleInfo["bossR"] = string.setbit(bossRecord, index) |
| 875 | + local allFinish = true | ||
| 876 | + for i = 1, totalAwardCnt do | ||
| 877 | + if string.char(string.getbit(battleInfo["bossR"], i)) == "0" then | ||
| 878 | + allFinish = false | ||
| 879 | + break | ||
| 880 | + end | ||
| 881 | + end | ||
| 882 | + if allFinish then | ||
| 883 | + battleInfo["bossR"] = "" | ||
| 884 | + end | ||
| 866 | battleInfo["bossP"] = bossPoint - 1 | 885 | battleInfo["bossP"] = bossPoint - 1 |
| 867 | actData[id] = battleInfo | 886 | actData[id] = battleInfo |
| 868 | role.activity:updateActData("ChallengeLevel", actData) | 887 | role.activity:updateActData("ChallengeLevel", actData) |