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 | 488 | local bi = actData[id] |
| 489 | 489 | if not bi then return 8 end |
| 490 | 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 | 501 | end |
| 494 | 502 | num = num * count |
| 495 | 503 | end |
| ... | ... | @@ -516,7 +524,7 @@ function _M.startBattleRpc(agent, data) |
| 516 | 524 | return 7 |
| 517 | 525 | end |
| 518 | 526 | local bi = actData[id] |
| 519 | - local star = bi["star"] | |
| 527 | + local star = bi["star"] or 0 | |
| 520 | 528 | local award = battleCfg.item_clear:toNumMap() |
| 521 | 529 | if getStarCount(battleCfg, star) == 3 then |
| 522 | 530 | local aw = battleCfg.perfect_reward:toNumMap() |
| ... | ... | @@ -531,7 +539,7 @@ function _M.startBattleRpc(agent, data) |
| 531 | 539 | SendPacket(actionCodes.Activity_startBattleRpc, MsgPack.pack(role:packReward(reward, change))) |
| 532 | 540 | |
| 533 | 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 | 543 | end |
| 536 | 544 | |
| 537 | 545 | bi["sum"] = bi["sum"] + bi["top"] |
| ... | ... | @@ -836,6 +844,7 @@ function _M.bossRewardRpc(agent, data) |
| 836 | 844 | local awardCfg = actCfg[index] |
| 837 | 845 | if not awardCfg then return 6 end |
| 838 | 846 | |
| 847 | + local totalAwardCnt = #actCfg | |
| 839 | 848 | local preList = awardCfg.condition1:toArray(true, "=") |
| 840 | 849 | |
| 841 | 850 | local actData = role.activity:getActData("ChallengeLevel") or {} |
| ... | ... | @@ -863,6 +872,16 @@ function _M.bossRewardRpc(agent, data) |
| 863 | 872 | if not ok then return 8 end |
| 864 | 873 | |
| 865 | 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 | 885 | battleInfo["bossP"] = bossPoint - 1 |
| 867 | 886 | actData[id] = battleInfo |
| 868 | 887 | role.activity:updateActData("ChallengeLevel", actData) | ... | ... |