Commit f0c47e334eaf815208fcdd5008809580ccacfb0f

Authored by liuzujun
2 parents be697585 cd597363

Merge branch 'develop' of 120.26.43.151:wasteland/server into develop

src/actions/HangAction.lua
... ... @@ -498,46 +498,44 @@ function _M.buyBonusCountRpc(agent, data)
498 498 return true
499 499 end
500 500  
501   -local function bonusWinReward(role, bonusData, bwin, count)
  501 +local function bonusWinReward(role, bonusData, rewardType, count)
502 502 count = count or 1
503   - local open, actId = role.activity:isOpen("BonusDouble")
504   - local actData = csvdb["activity_ctrlCsv"][actId]
505   - local extraCnt = role.storeData:getBonusExtraFightCount()
506   -
507   - local coef = 1
508   - if open and actData then
509   - coef = tonumber(actData.condition2)
510   - end
511   - local bonusC = role.dailyData:getProperty("bonusC")
512   - bonusC[bonusData.type] = bonusC[bonusData.type] or {c = 0, b = 0}
513   - if globalCsv.bonus_daily_count * coef + extraCnt - bonusC[bonusData.type]["c"] < count then return false, 1 end
514   - bonusC[bonusData.type]["c"] = bonusC[bonusData.type]["c"] + count
515   - role.dailyData:updateProperty({field = "bonusC", value = bonusC})
516 503  
517   - local reward, change
518   - reward = bonusData.reward:toNumMap()
519   - for itemId, c in pairs(reward) do
520   - reward[itemId] = c * count
521   - end
522   - for i = 1, count do
523   - local chance = bonusData.chance:randWeight(true)
524   - if chance[1] ~= 0 then
525   - reward[chance[1]] = (reward[chance[1]] or 0) + chance[2]
  504 + local reward, change = {}
  505 + if rewardType == 1 or rewardType == 4 then
  506 + for k, v in pairs(bonusData.clear_reward:toNumMap()) do
  507 + reward[k] = (reward[k] or 0) + v
526 508 end
527 509 end
528 510  
529   - for k, v in pairs(reward) do
530   - reward[k] = v * (coef > 1 and actData.condition or 1)
531   - end
532   -
533   - if bwin then -- 满星 额外奖励
  511 + if rewardType == 2 or rewardType == 4 then
534 512 for k, v in pairs(bonusData.perfect_reward:toNumMap()) do
535 513 reward[k] = (reward[k] or 0) + v
536 514 end
537 515 end
538   - reward, change = role:award(reward, {log = {desc = "bonusBattle", int1 = id}})
539   - role:checkTaskEnter("BonusPass", {id = id, count = count})
540   - return true, reward, change
  516 +
  517 + if rewardType == 3 then
  518 + local open, actId = role.activity:isOpen("BonusDouble")
  519 + local actData = csvdb["activity_ctrlCsv"][actId]
  520 +
  521 + reward = bonusData.reward:toNumMap()
  522 + for itemId, c in pairs(reward) do
  523 + reward[itemId] = c * count
  524 + end
  525 + for i = 1, count do
  526 + local chance = bonusData.chance:randWeight(true)
  527 + if chance[1] ~= 0 then
  528 + reward[chance[1]] = (reward[chance[1]] or 0) + chance[2]
  529 + end
  530 + end
  531 + for k, v in pairs(reward) do
  532 + reward[k] = v * (actData.condition > 1 and actData.condition or 1)
  533 + end
  534 + end
  535 +
  536 + reward, change = role:award(reward, {log = {desc = "bonusBattle", int1 = bonusData.id}})
  537 + role:checkTaskEnter("BonusPass", {id = bonusData.id, count = count})
  538 + return reward, change
541 539 end
542 540  
543 541 function _M.startBonusBattleRpc(agent, data)
... ... @@ -559,23 +557,24 @@ function _M.startBonusBattleRpc(agent, data)
559 557 if not bonusData then return 3 end
560 558 if not role:checkHangPass(bonusData.unlock) then return 4 end
561 559  
562   - local bonusC = role.dailyData:getProperty("bonusC")
563   - bonusC[bonusData.type] = bonusC[bonusData.type] or {c = 0, b = 0}
564   -
565   - local actData = csvdb["activity_ctrlCsv"][actId]
566   -
567   - local extraCnt = role.storeData:getBonusExtraFightCount()
568   - local coef = 1
569   - if open and actData then
570   - coef = tonumber(actData.condition2)
571   - end
572   -
573   - if math.illegalNum(count, 1, globalCsv.bonus_daily_count * coef + extraCnt - bonusC[bonusData.type]["c"]) then return 7 end
574 560  
575 561 local bonusStar = role:getProperty("bonusStar")
576 562 if bonusStar[id] and bonusStar[id] >= (1 << #bonusData.sweep_condition:toTableArray(true)) - 1 then
577   - local status, reward, change = bonusWinReward(role, bonusData, nil, count)
578   - if not status then return 10 * (reward or 0) end
  563 + local bonusC = role.dailyData:getProperty("bonusC")
  564 + bonusC[bonusData.type] = bonusC[bonusData.type] or {c = 0, b = 0}
  565 +
  566 + local actData = csvdb["activity_ctrlCsv"][actId]
  567 + local extraCnt = role.storeData:getBonusExtraFightCount()
  568 + local coef = 1
  569 + if open and actData then
  570 + coef = tonumber(actData.condition2)
  571 + end
  572 + if math.illegalNum(count, 1, globalCsv.bonus_daily_count * coef + extraCnt - bonusC[bonusData.type]["c"]) then return 7 end
  573 +
  574 + bonusC[bonusData.type]["c"] = bonusC[bonusData.type]["c"] + count
  575 + role.dailyData:updateProperty({field = "bonusC", value = bonusC})
  576 +
  577 + local reward, change = bonusWinReward(role, bonusData, 3, count)
579 578 SendPacket(actionCodes.Hang_startBonusBattleRpc, MsgPack.pack({reward = reward, change = change}))
580 579 else
581 580 local bTeam = role:getTeamFormatByType(TeamSystemType.BonusBattle)
... ... @@ -608,6 +607,7 @@ function _M.endBonusBattleRpc(agent, data)
608 607 local reward, change
609 608  
610 609 local bonusStar = role:getProperty("bonusStar")
  610 + local oldStar = bonusStar[id] or 0
611 611 local curStar = 0
612 612 if starNum and starNum > 0 then
613 613 -- 胜利扣除次数
... ... @@ -671,12 +671,23 @@ function _M.endBonusBattleRpc(agent, data)
671 671 end
672 672 end
673 673 local status
674   - status, reward, change = bonusWinReward(role, bonusData, curStar >= (1 << #sweepConds) - 1)
675   - if not status then return 10 + (reward or 0) end
  674 + local rewardType = 0
  675 + if curStar >= (1 << #sweepConds) - 1 then -- 满星
  676 + rewardType = 2
  677 + if oldStar == 0 then --通关
  678 + rewardType = 4
  679 + end
  680 + elseif oldStar == 0 then --通关
  681 + rewardType = 1
  682 + end
  683 +
  684 + if rewardType ~= 0 then
  685 + reward, change = bonusWinReward(role, bonusData, rewardType)
  686 + end
676 687 else
677   - curStar = 0
  688 + curStar = oldStar
678 689 end
679   - if curStar ~= bonusStar[id] then
  690 + if curStar ~= oldStar then
680 691 bonusStar[id] = curStar
681 692 role:updateProperty({field = "bonusStar", value = bonusStar})
682 693 end
... ...
src/adv/Adv.lua
... ... @@ -1129,8 +1129,8 @@ local function clickOut(self, room, block, params, isExit)
1129 1129 if curFloorData then
1130 1130 self:award({[ItemId.AdvPoint] = curFloorData.exp}, {log = {desc = "passReward", int1 = self.chapterId, int2 = self.level}}, {})
1131 1131 end
  1132 + self:backNext() --下一关
1132 1133 local isHaveRelay = self:isHaveRelay(self.level)
1133   -
1134 1134 if isHaveRelay and not self.isRelay then
1135 1135 self:initByChapter({
1136 1136 chapterId = self.chapterId,
... ... @@ -1148,7 +1148,6 @@ local function clickOut(self, room, block, params, isExit)
1148 1148 notNotify = true,
1149 1149 })
1150 1150 end
1151   - self:backNext() --下一关
1152 1151 end
1153 1152  
1154 1153 end
... ...
src/models/RoleBattle.lua
... ... @@ -44,7 +44,7 @@ function Role:checkBattle(battleType, params)
44 44  
45 45 local fixData = {
46 46 hang = function()
47   - for slot, hero in pairs(self:getProperty("hangTS")) do
  47 + for slot, hero in pairs(self:getProperty("hangTS").heros) do
48 48 selflist[slot] = hero.type
49 49 end
50 50 heroscore = self:getProperty("hangTBV")
... ... @@ -102,7 +102,7 @@ function Role:checkBattle(battleType, params)
102 102 end
103 103 end,
104 104 pvpc = function()
105   - for slot, hero in pairs(self:getProperty("pvpTSC")) do
  105 + for slot, hero in pairs(self:getProperty("pvpTSC").heros) do
106 106 selflist[slot] = hero.type
107 107 end
108 108 heroscore = self:getProperty("pvpTBVC")
... ... @@ -124,7 +124,7 @@ function Role:checkBattle(battleType, params)
124 124 pvph = function()
125 125 for idx, team in pairs(self:getProperty("pvpTSH")) do
126 126 selflist[idx] = selflist[idx] or {}
127   - for slot, hero in pairs(team) do
  127 + for slot, hero in pairs(team.heros) do
128 128 selflist[idx][slot] = hero.type
129 129 end
130 130 end
... ...
src/models/RoleCross.lua
... ... @@ -19,8 +19,8 @@ RoleCross.bind = function (Role)
19 19 -- 好友详细队伍信息
20 20 function Role:friendInfo()
21 21 local info = self:friendSInfo()
22   - local heros = self:getProperty("pvpTBVC") ~= 0 and self:getProperty("pvpTSC") or self:getProperty("hangTS")
23   - info.heros = heros
  22 + local team = self:getProperty("pvpTBVC") ~= 0 and self:getProperty("pvpTSC") or self:getProperty("hangTS")
  23 + info.team = team
24 24 return info
25 25 end
26 26  
... ...
src/models/RolePlugin.lua
... ... @@ -1649,7 +1649,7 @@ function RolePlugin.bind(Role)
1649 1649 -- 开始下单
1650 1650 if status == "success" then
1651 1651 elseif status == "fail" then
1652   - redisproxy:hdel(string.format(R_ORDERS, roleId), rechargeId)
  1652 + -- redisproxy:hdel(string.format(R_ORDERS, roleId), rechargeId)
1653 1653 elseif status == "finsh" then
1654 1654 orderObject:setProperty("finishTime", skynet.time())
1655 1655 redisproxy:hdel(string.format(R_ORDERS, roleId), rechargeId)
... ...
src/models/RolePvp.lua
... ... @@ -233,7 +233,6 @@ function Role:refreshPvpMatch(score, rank, rankKey)
233 233 if low < 0 then
234 234 low = 0
235 235 end
236   - print(low, heigh)
237 236 local rangeIds = redisproxy:ZREVRANGE(dbKey, low, heigh)
238 237 local lastRangeIds = {}
239 238 for idx, one in ipairs(rangeIds) do
... ...