Commit 74f2395ec0e444bd6ae43b01d4f1b2d6bf7d2521

Authored by liuzujun
2 parents a6dc627f b5481708

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

src/actions/DinerAction.lua
... ... @@ -139,7 +139,11 @@ function _M.removeSellRpc( agent, data )
139 139 return 5
140 140 end
141 141  
142   - local temp = role.dinerData:updateSell(slot)
  142 + local temp = role.dinerData:updateSell(slot) or {
  143 + deltaCount = 0,
  144 + deltaTime = 0,
  145 + lastCount = 0,
  146 + }
143 147 local reward, change = {}
144 148 local cost = dishData.material:toNumMap()
145 149 for k, n in pairs(cost) do
... ... @@ -171,7 +175,11 @@ function _M.getSellRewardRpc( agent, data )
171 175  
172 176 local deltaTimes = {}
173 177 for slot, _ in pairs(sells) do
174   - local temp = role.dinerData:updateSell(slot)
  178 + local temp = role.dinerData:updateSell(slot) or {
  179 + deltaCount = 0,
  180 + deltaTime = 0,
  181 + lastCount = 0,
  182 + }
175 183 deltaTimes[slot] = temp.deltaTime
176 184 end
177 185 sells = json.decode(role.dinerData:getProperty("sells"))
... ...
src/actions/HeroAction.lua
... ... @@ -855,14 +855,17 @@ function _M.drawHeroRpc(agent, data)
855 855 floorHeroCount = 0
856 856 end
857 857  
  858 + local logReward = {}
858 859 if role:isHaveHero(itemData.id - ItemStartId.Hero) then
859 860 local fragId = itemData.id - ItemStartId.Hero
860 861 local heroData = csvdb["unitCsv"][fragId]
861 862 local count = globalCsv.draw_unit_tofragment[heroData.rare]
862 863 role:award({[fragId] = count}, {log = {desc = "drawHero", int1 = btype, int2 = poolId}})
  864 + logReward[fragId] = (logReward[fragId] or 0) + count
863 865 table.insert(reward, {id = fragId, count = count, from = itemId, fcount = 1})
864 866 else
865 867 role:award({[itemId] = 1}, {log = {desc = "drawHero", int1 = btype, int2 = poolId}})
  868 + logReward[itemId] = (logReward[itemId] or 0) + 1
866 869 table.insert(reward, {id = itemId, count = 1})
867 870 end
868 871 end
... ... @@ -884,14 +887,15 @@ function _M.drawHeroRpc(agent, data)
884 887 role:checkTaskEnter("DrawSSR", {count = ssrCount})
885 888 end
886 889 role:finishGuide(11)
887   -
  890 +
888 891 role:log("gacha", {
889 892 gacha_id = poolId, -- 卡池ID
890 893 gacha_type = btype, -- 卡池类型
891 894 gacha_up = 0, -- 卡池UP角色
892 895 gacha_times = drawCount[drawType], -- 抽卡次数
893   - gacha_reward = reward, -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
  896 + gacha_reward = logReward, -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
894 897 currency = cost, -- 购买道具消耗的货币
  898 + gacha_cnt = floorHeroCount,
895 899 })
896 900 SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward})) -- 这个 reward 是数组
897 901 return true
... ...
src/adv/Adv.lua
... ... @@ -790,8 +790,8 @@ function Adv:over(success, rewardRatio, overType)
790 790 end)
791 791 end
792 792 -- 通关的时候要把引导步骤设定到成就引导
793   - if not role:checkOverGuide(57) then
794   - role:saveGuide(57,1,true)
  793 + if not self.owner:checkOverGuide(57) then
  794 + self.owner:saveGuide(57,1,true)
795 795 end
796 796 end
797 797 self:clearAdvUnlockCache()
... ...
src/adv/AdvTask.lua
... ... @@ -132,10 +132,21 @@ function AdvTask.bind(Adv)
132 132 end
133 133 local advEventOpenStatus = self.owner:advEventOpenStatus()
134 134 local pool = {}
135   - for id, data in pairs(csvdb["event_questCsv"]) do
136   - if data.levelchapter == chapterId and (data.unlockType == 0 or (advEventOpenStatus[etype] or {})[data.unlockType]) then
137   - if AdvCommon.checkIsIn(level, data.leveltype, data.levellimit) then
138   - pool[id] = {showup = data.showup}
  135 +
  136 + local mapData = self:getCurMap():getMapInfoCsv()
  137 + for _, id in ipairs(mapData.quest:toArray(true, "=")) do
  138 + local data = csvdb["event_questCsv"][taskId]
  139 + if data then
  140 + pool[id] = {showup = data.showup}
  141 + end
  142 + end
  143 +
  144 + if not next(pool) then
  145 + for id, data in pairs(csvdb["event_questCsv"]) do
  146 + if data.levelchapter == chapterId and (data.unlockType == 0 or (advEventOpenStatus[etype] or {})[data.unlockType]) then
  147 + if AdvCommon.checkIsIn(level, data.leveltype, data.levellimit) then
  148 + pool[id] = {showup = data.showup}
  149 + end
139 150 end
140 151 end
141 152 end
... ...
src/models/Activity.lua
... ... @@ -395,7 +395,7 @@ end
395 395  
396 396 -- 付费签到可领奖励
397 397 function Activity:getPaySignReward()
398   - local actGoodsFlag = self.storeData:getProperty("actGoodsFlag")
  398 + local actGoodsFlag = self.owner.storeData:getProperty("actGoodsFlag")
399 399 local index = GetActGoodsIndex("paySignIn")
400 400 local flag = actGoodsFlag[index] or 0
401 401 if flag == 0 then return {} end
... ...
src/models/RoleBattle.lua
... ... @@ -80,7 +80,7 @@ function Role:checkBattle(battleType, params)
80 80 for slot , one in pairs(self:getTeamBattleInfo(bTeam).supports) do
81 81 teamskill[one[1]] = one[2]
82 82 end
83   - local carbonData = csvdb["tower_battleCsv"][params.id]
  83 + local carbonData = csvdb["bonus_battleCsv"][params.id]
84 84 local monsterData = csvdb[carbonData.monster:match("/([^/]*)$") .. "Csv"]
85 85 for slot, one in pairs(monsterData[1]) do
86 86 enemylist[#enemylist + 1] = one["unitType"]
... ... @@ -97,7 +97,7 @@ function Role:checkBattle(battleType, params)
97 97 if params.robotId then
98 98 local carbonData = csvdb["pvp_robotCsv"][params.robotId]
99 99 local monsterData = csvdb[carbonData.monster:match("/([^/]*)$") .. "Csv"]
100   - for slot, one in pairs(monsterData[1]) do
  100 + for slot, one in pairs(monsterData) do
101 101 enemylist[#enemylist + 1] = one["unitType"]
102 102 end
103 103 else
... ... @@ -127,7 +127,7 @@ function Role:checkBattle(battleType, params)
127 127 for idx = 1, 3 do
128 128 enemylist[idx] = enemylist[idx] or {}
129 129 local monsterData = csvdb[carbonData["monster" .. idx]:match("/([^/]*)$") .. "Csv"]
130   - for slot, one in pairs(monsterData[1]) do
  130 + for slot, one in pairs(monsterData) do
131 131 enemylist[idx][#enemylist + 1] = one["unitType"]
132 132 end
133 133 end
... ...
src/models/RoleLog.lua
... ... @@ -266,6 +266,7 @@ local MethodType = {
266 266 gacha_times = true, -- 抽卡次数
267 267 gacha_reward = "json", -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
268 268 currency = "json", -- 消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
  269 + gacha_cnt = true, -- 保底计数
269 270 },
270 271 equip_wear = { --装备穿戴与卸载
271 272 hero_id = true, --英雄ID
... ...