Commit 498f0eb23da0bc968c88f6d312674c577b5d721b

Authored by zhouhaihai
1 parent 1bab9165

冒险 action

src/actions/AdvAction.lua
@@ -385,7 +385,7 @@ function _M.useItemRpc(agent, data) @@ -385,7 +385,7 @@ function _M.useItemRpc(agent, data)
385 385
386 --消耗 386 --消耗
387 if itemData["function"] == 0 or itemData["function"] == 1 then 387 if itemData["function"] == 0 or itemData["function"] == 1 then
388 - adv:cost({[itemId] = count}, {}) 388 + adv:cost({[itemId] = count}, {log = {desc = "useItem", int1 = itemId, int2 = count}})
389 adv:backUse({[itemId] = count}) 389 adv:backUse({[itemId] = count})
390 end 390 end
391 391
@@ -500,7 +500,7 @@ function _M.upArtifactRpc(agent, data) @@ -500,7 +500,7 @@ function _M.upArtifactRpc(agent, data)
500 500
501 local status = adv:artifactLevelUp(id) 501 local status = adv:artifactLevelUp(id)
502 if not status then return 5 end 502 if not status then return 5 end
503 - adv:cost(cost, {}) 503 + adv:cost(cost, {log = {desc = "upArtifact", int1 = id}})
504 adv:backCost(cost) 504 adv:backCost(cost)
505 if status == 1 then -- 现在穿着呢。更新下 505 if status == 1 then -- 现在穿着呢。更新下
506 adv:saveDB() 506 adv:saveDB()
@@ -957,7 +957,7 @@ local function chooseCommon(self, room, block, chooseData, choose, tag) @@ -957,7 +957,7 @@ local function chooseCommon(self, room, block, chooseData, choose, tag)
957 end, 957 end,
958 -- 拥有道具 958 -- 拥有道具
959 [1] = function(_, itemId, count) 959 [1] = function(_, itemId, count)
960 - if self:cost({[itemId] = count}, {}, true) then 960 + if self:cost({[itemId] = count}, {log = {desc = "chooseEvent", key1 = tag, int1 = chooseData.id}}, true) then
961 return true 961 return true
962 end 962 end
963 end, 963 end,
@@ -989,7 +989,7 @@ local function chooseCommon(self, room, block, chooseData, choose, tag) @@ -989,7 +989,7 @@ local function chooseCommon(self, room, block, chooseData, choose, tag)
989 end, 989 end,
990 -- 提交一个物品 990 -- 提交一个物品
991 [5] = function (_, itemId, count) 991 [5] = function (_, itemId, count)
992 - if self:cost({[itemId] = count}, {}) then 992 + if self:cost({[itemId] = count}, {log = {desc = "chooseEvent", key1 = tag, int1 = chooseData.id}}) then
993 self:backCost({[itemId] = count}) 993 self:backCost({[itemId] = count})
994 return true 994 return true
995 end 995 end
@@ -1213,7 +1213,7 @@ local function clickTrader(self, room, block, params) @@ -1213,7 +1213,7 @@ local function clickTrader(self, room, block, params)
1213 if not goodsData then return false, 5 end 1213 if not goodsData then return false, 5 end
1214 1214
1215 local costCount = math.ceil(goodsData.price * (block.event.shop[buyId][2] or 100) / 100) 1215 local costCount = math.ceil(goodsData.price * (block.event.shop[buyId][2] or 100) / 100)
1216 - if not self:cost({[goodsData.currency] = costCount}, {}) then return false, 6 end --不够 1216 + if not self:cost({[goodsData.currency] = costCount}, {log = {desc = "clickTrader", int1 = block.event.id}}) then return false, 6 end --不够
1217 self:backCost({[goodsData.currency] = costCount}) 1217 self:backCost({[goodsData.currency] = costCount})
1218 local reward = self:award({[goodsData.item] = goodsData.num}, {log = {desc = "clickTrader", int1 = block.event.id}}) 1218 local reward = self:award({[goodsData.item] = goodsData.num}, {log = {desc = "clickTrader", int1 = block.event.id}})
1219 if goodsData.restrict == 1 then 1219 if goodsData.restrict == 1 then
src/adv/AdvMap.lua
@@ -60,7 +60,7 @@ function Map:checkOver() @@ -60,7 +60,7 @@ function Map:checkOver()
60 local mapCsv = csvdb["mapCsv"][self.mapId] 60 local mapCsv = csvdb["mapCsv"][self.mapId]
61 61
62 if mapCsv.clearType == 1 then -- 消耗 62 if mapCsv.clearType == 1 then -- 消耗
63 - if self.adv:cost(mapCsv.clear:toNumMap()) then return true end 63 + if self.adv:cost(mapCsv.clear:toNumMap(), {log = {desc = "overCost", int1 = block.event.id}}) then return true end
64 elseif mapCsv.clearType == 2 then -- 杀光 64 elseif mapCsv.clearType == 2 then -- 杀光
65 if #self.adv.battle.player:getTeam(2) == 0 then return true end 65 if #self.adv.battle.player:getTeam(2) == 0 then return true end
66 elseif mapCsv.clearType == 3 then -- 持有 66 elseif mapCsv.clearType == 3 then -- 持有