From 53e8037ecfe65008cdf1c093d842bb49caf23542 Mon Sep 17 00:00:00 2001 From: zhouhaihai Date: Thu, 24 Oct 2019 15:55:06 +0800 Subject: [PATCH] 任务 --- src/ProtocolCode.lua | 7 +++++-- src/actions/AdvAction.lua | 5 +++-- src/actions/CarAction.lua | 4 +++- src/actions/DinerAction.lua | 13 ++++++++++--- src/actions/GmAction.lua | 1 - src/actions/HangAction.lua | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------- src/actions/HeroAction.lua | 26 ++++++++++++++++++++++++-- src/actions/RoleAction.lua | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- src/actions/TowerAction.lua | 3 ++- src/adv/Adv.lua | 26 ++++++++++++++++++++------ src/adv/AdvBattle.lua | 2 ++ src/adv/AdvBlock.lua | 1 + src/adv/AdvBuff.lua | 17 +++++++++++++++-- src/adv/AdvPlayer.lua | 10 +++++----- src/models/Diner.lua | 2 ++ src/models/Role.lua | 13 +++++++++++-- src/models/RolePlugin.lua | 22 +++++++++++++++++----- src/models/RoleTask.lua | 339 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------- 18 files changed, 579 insertions(+), 127 deletions(-) diff --git a/src/ProtocolCode.lua b/src/ProtocolCode.lua index 4762971..7e652df 100644 --- a/src/ProtocolCode.lua +++ b/src/ProtocolCode.lua @@ -29,6 +29,9 @@ actionCodes = { Role_storyBookRewardRpc = 114, Role_unLockStoryBookRpc = 115, Role_openTimeBoxRpc = 116, + Role_taskRpc = 117, + Role_taskActiveRpc = 118, + Role_achiveRpc = 119, Adv_startAdvRpc = 151, Adv_startHangRpc = 152, @@ -73,8 +76,8 @@ actionCodes = { Hang_roleFormatRpc = 255, Hang_getRewardRpc = 256, Hang_quickRpc = 257, - Hang_getRewardItemRpc = 258, - Hang_getRewardCoinRpc = 259, + -- Hang_getRewardItemRpc = 258, + -- Hang_getRewardCoinRpc = 259, Diner_updateProperty = 300, Diner_addSellRpc = 301, diff --git a/src/actions/AdvAction.lua b/src/actions/AdvAction.lua index 50cad04..7938bba 100644 --- a/src/actions/AdvAction.lua +++ b/src/actions/AdvAction.lua @@ -112,7 +112,7 @@ function _M.startAdvRpc( agent, data ) end role:getAdvData():initByChapter(chapterId, layer) - + role:checkTaskEnter("AdvStart", {id = chapterId}) SendPacket(actionCodes.Adv_startAdvRpc, '') return true end @@ -161,7 +161,7 @@ function _M.startHangRpc(agent, data) role:changeUpdates({{type = "advHang", field = chapterId, value = info}}) role.dailyData:updateProperty({field = "advC", delta = 1}) - + role:checkTaskEnter("AdvStart", {id = chapterId}) SendPacket(actionCodes.Adv_startHangRpc, '') return true end @@ -247,6 +247,7 @@ function _M.finishTaskRpc(agent, data) end adv:updateTask() if not status then return end + role:checkTaskEnter("AdvOverTask", {id = taskId}) SendPacket(actionCodes.Adv_finishTaskRpc, MsgPack.pack({reward = reward})) return true end diff --git a/src/actions/CarAction.lua b/src/actions/CarAction.lua index 4c365aa..8f014b2 100644 --- a/src/actions/CarAction.lua +++ b/src/actions/CarAction.lua @@ -38,6 +38,7 @@ function _M.makePotionRpc( agent, data ) role:costItems(cost) potionBag[potionId] = own + count role:updateProperty({field = "potionBag", value = potionBag}) + role:checkTaskEnter("PotionMake", {count = count, id = potionId}) SendPacket(actionCodes.Car_makePotionRpc, MsgPack.pack({potionBag = potionBag})) return true end @@ -86,7 +87,7 @@ function _M.equipUpRpc( agent, data ) role:costItems(cost) role:addEquip(typ, lv, -costCount) role:addEquip(typ, nextLv ,count) - + role:checkTaskEnter("EquipUp", {}) SendPacket(actionCodes.Car_equipUpRpc, '') return true end @@ -118,6 +119,7 @@ function _M.runeUpRpc( agent, data ) role:costItems(cost) ownRune:updateProperty({field = "level",value = level+1}) + role:checkTaskEnter("RuneUp") SendPacket(actionCodes.Car_runeUpRpc, '') return true end diff --git a/src/actions/DinerAction.lua b/src/actions/DinerAction.lua index d7c69ee..6391dfa 100644 --- a/src/actions/DinerAction.lua +++ b/src/actions/DinerAction.lua @@ -155,6 +155,9 @@ function _M.getSellRewardRpc( agent, data ) role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) for k, v in pairs(reward:toNumMap()) do role:addItem({itemId = k,count = v}) + if k == ItemId.Gold then + role:checkTaskEnter("FoodSellGold", {count = v}) + end end role.dinerData:popularAdd(popular) @@ -162,7 +165,6 @@ function _M.getSellRewardRpc( agent, data ) if dirty then role.dinerData:notifyUpdateProperty("order", role.dinerData:getProperty("order")) end - SendPacket(actionCodes.Diner_getSellRewardRpc, MsgPack.pack({reward = reward})) return true end @@ -226,6 +228,7 @@ function _M.expediteSellRpc( agent, data ) if dirty then role.dinerData:notifyUpdateProperty("order", role.dinerData:getProperty("order")) end + role:checkTaskEnter("FoodSellQuick") SendPacket(actionCodes.Diner_expediteSellRpc, MsgPack.pack({reward = reward,popular = popular})) return true end @@ -263,7 +266,7 @@ function _M.levelUpRpc( agent, data ) role:costItems(cost) role.dinerData:updateProperty({field = "buildL", value = buildL:setv(index, curLevel + 1)}) - + role:checkTaskEnter("DinerLevelUp", {type = index, level = curLevel + 1}) SendPacket(actionCodes.Diner_levelUpRpc, '') return true end @@ -337,6 +340,8 @@ function _M.talentUpRpc( agent, data ) role:award(treePoint) end + role:checkTaskEnter("DinerTalentUp", {type = talentData.effect:toArray(true,"=")[1]}) + SendPacket(actionCodes.Diner_talentUpRpc, '') return true end @@ -431,6 +436,7 @@ function _M.updateTaskRpc( agent, data ) end orders[index].status = 1 orders[index].lock = 1 + role:checkTaskEnter("GetOderTask", {rarity = taskSet.rarity}) elseif cmd == 1 then if order.status ~= 1 then return 31 @@ -448,6 +454,7 @@ function _M.updateTaskRpc( agent, data ) role:addItem({itemId = typ, count = count}) end table.remove(orders,index) + role:checkTaskEnter("OverOderTask", {rarity = taskSet.rarity}) else return 33 end @@ -593,7 +600,7 @@ function _M.getGreenhouseRpc( agent, data ) end role.dinerData:updateProperty({field = "gfood", value = gfood}) local reward = role:award(reward) - + role:checkTaskEnter("FoodMGet") SendPacket(actionCodes.Diner_getGreenhouseRpc, MsgPack.pack({reward = reward})) return true end diff --git a/src/actions/GmAction.lua b/src/actions/GmAction.lua index a419316..d5cbeab 100644 --- a/src/actions/GmAction.lua +++ b/src/actions/GmAction.lua @@ -22,7 +22,6 @@ end local helpDes = {{"描述", "指令", "参数1", "参数2" ,"参数3"}} table.insert(helpDes, {"获得角色" , "hero", "角色类型"}) - function _M.hero(role, pms) local heroType = tonum(pms.pm1) if not role:addHero({type = heroType}) then diff --git a/src/actions/HangAction.lua b/src/actions/HangAction.lua index 16738ee..d5b220b 100644 --- a/src/actions/HangAction.lua +++ b/src/actions/HangAction.lua @@ -139,6 +139,7 @@ function _M.startBattleRpc(agent, data) hangInfo.key = key local nowTime = skynet.timex() role:updateProperty({field = "hangInfo", value = hangInfo}) + role:checkTaskEnter("HangBattle", {id = carbonId}) SendPacket(actionCodes.Hang_startBattleRpc, MsgPack.pack({key = key})) return true end @@ -229,71 +230,73 @@ function _M.getRewardRpc(agent , data) role:updateProperty({field = "hangBag", value = items}) role:updateProperty({field = "hangInfo", value = hangInfo}) role:checkTaskEnter("HangGet") - - SendPacket(actionCodes.Hang_getRewardRpc, MsgPack.pack({ - reward = reward - })) - return true -end - -function _M.getRewardItemRpc(agent , data) - local role = agent.role - checkReward(role) - local items = role:getProperty("hangBag") - if not next(items) then return end - - local notNeed = {[ItemId.Gold] = 1, [ItemId.Exp] = 1, [ItemId.PlayerExp] = 1} - local reward = {} - for itemId , count in pairs(items) do - if not notNeed[itemId] then - reward[itemId] = count - items[itemId] = nil - end + if reward[ItemId.Gold] then + role:checkTaskEnter("HangGetGold", {count = reward[ItemId.Gold]}) end - if not next(reward) then return end - local reward = role:award(reward) - - local hangInfo = role:getProperty("hangInfo") - local nowTime = skynet.timex() - hangInfo.endItemTime = nowTime + globalCsv.idle_producetime_max - hangInfo.itemTime = nowTime - role:updateProperty({field = "hangBag", value = items}) - role:updateProperty({field = "hangInfo", value = hangInfo}) - - SendPacket(actionCodes.Hang_getRewardItemRpc, MsgPack.pack({ + SendPacket(actionCodes.Hang_getRewardRpc, MsgPack.pack({ reward = reward })) return true end -function _M.getRewardCoinRpc(agent , data) - local role = agent.role - checkReward(role) - local items = role:getProperty("hangBag") - if not next(items) then return end - - local need = {[ItemId.Gold] = 1, [ItemId.Exp] = 1, [ItemId.PlayerExp] = 1} - local reward = {} - for itemId , count in pairs(items) do - if need[itemId] then - reward[itemId] = count - items[itemId] = nil - end - end - local reward = role:award(reward) +-- function _M.getRewardItemRpc(agent , data) +-- local role = agent.role +-- checkReward(role) +-- local items = role:getProperty("hangBag") +-- if not next(items) then return end + +-- local notNeed = {[ItemId.Gold] = 1, [ItemId.Exp] = 1, [ItemId.PlayerExp] = 1} +-- local reward = {} +-- for itemId , count in pairs(items) do +-- if not notNeed[itemId] then +-- reward[itemId] = count +-- items[itemId] = nil +-- end +-- end +-- if not next(reward) then return end +-- local reward = role:award(reward) + +-- local hangInfo = role:getProperty("hangInfo") +-- local nowTime = skynet.timex() +-- hangInfo.endItemTime = nowTime + globalCsv.idle_producetime_max +-- hangInfo.itemTime = nowTime +-- role:updateProperty({field = "hangBag", value = items}) +-- role:updateProperty({field = "hangInfo", value = hangInfo}) + +-- SendPacket(actionCodes.Hang_getRewardItemRpc, MsgPack.pack({ +-- reward = reward +-- })) +-- return true +-- end + +-- function _M.getRewardCoinRpc(agent , data) +-- local role = agent.role +-- checkReward(role) +-- local items = role:getProperty("hangBag") +-- if not next(items) then return end + +-- local need = {[ItemId.Gold] = 1, [ItemId.Exp] = 1, [ItemId.PlayerExp] = 1} +-- local reward = {} +-- for itemId , count in pairs(items) do +-- if need[itemId] then +-- reward[itemId] = count +-- items[itemId] = nil +-- end +-- end +-- local reward = role:award(reward) - local hangInfo = role:getProperty("hangInfo") - local nowTime = skynet.timex() - hangInfo.endCoinTime = nowTime + globalCsv.idle_producetime_max - hangInfo.coinTime = nowTime - role:updateProperty({field = "hangBag", value = items}) - role:updateProperty({field = "hangInfo", value = hangInfo}) - - SendPacket(actionCodes.Hang_getRewardCoinRpc, MsgPack.pack({ - reward = reward - })) - return true -end +-- local hangInfo = role:getProperty("hangInfo") +-- local nowTime = skynet.timex() +-- hangInfo.endCoinTime = nowTime + globalCsv.idle_producetime_max +-- hangInfo.coinTime = nowTime +-- role:updateProperty({field = "hangBag", value = items}) +-- role:updateProperty({field = "hangInfo", value = hangInfo}) + +-- SendPacket(actionCodes.Hang_getRewardCoinRpc, MsgPack.pack({ +-- reward = reward +-- })) +-- return true +-- end function _M.quickRpc(agent , data) local role = agent.role @@ -330,7 +333,7 @@ function _M.quickRpc(agent , data) end reward = role:award(reward) - + role:checkTaskEnter("HangQuick") SendPacket(actionCodes.Hang_quickRpc, MsgPack.pack({ reward = reward })) diff --git a/src/actions/HeroAction.lua b/src/actions/HeroAction.lua index a556c79..1bb5be4 100644 --- a/src/actions/HeroAction.lua +++ b/src/actions/HeroAction.lua @@ -30,6 +30,7 @@ function _M.levelUpRpc( agent, data ) role:costItems(cost) hero:updateProperty({field = "level", delta = 1}) + role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")}) SendPacket(actionCodes.Hero_levelUpRpc, '') return true end @@ -87,8 +88,11 @@ function _M.wakeRpc(agent, data) end hero:updateProperty({field = "wakeL", delta = 1}) - role:checkTaskEnter("Wake", {heroType = typ, wakeL = hero:getProperty("wakeL")}) - + local curLevel = hero:getProperty("wakeL") + if curLevel == 4 then -- 解锁cg + role:checkTaskEnter("WakeCG", {heroType = typ}) + end + SendPacket(actionCodes.Hero_wakeRpc, '') return true end @@ -154,6 +158,14 @@ function _M.talentRpc(agent, data) end end hero:updateProperty({field = "talent", value = talent}) + local aheadLevel = 0 + for i = 1, talent:getv(0, 1) - 1 do + aheadLevel = aheadLevel + #csvdb["unit_talentCsv"][i] + end + aheadLevel = aheadLevel + talent:getv(index, 0) + + role:checkTaskEnter("HeroTalent", {heroType = hero:getProperty("type"), alv = aheadLevel}) + SendPacket(actionCodes.Hero_talentRpc, '') return true end @@ -766,6 +778,7 @@ function _M.drawHeroRpc(agent, data) role:costItems(cost) + local ssrCount = 0 local reward = {} for i = 1, drawCount[drawType] do @@ -779,6 +792,11 @@ function _M.drawHeroRpc(agent, data) local idx = math.randWeight(resultPool, 3) local temp = resultPool[idx] local itemData = csvdb["itemCsv"][temp[1]] + + if itemData.type == ItemType.Hero and itemData.quality == 4 then + ssrCount = ssrCount + 1 + end + if itemData.type == ItemType.Hero and role:isHaveHero(itemData.id - ItemStartId.Hero) then local fragId = itemData.id - ItemStartId.Hero local heroData = csvdb["unitCsv"][fragId] @@ -791,6 +809,10 @@ function _M.drawHeroRpc(agent, data) end end + role:checkTaskEnter("DrawHero", {pool = pool, count = drawCount[drawType]}) + if ssrCount > 0 then + role:checkTaskEnter("DrawSSR", {count = ssrCount}) + end SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward})) -- 这个 reward 是数组 return true end diff --git a/src/actions/RoleAction.lua b/src/actions/RoleAction.lua index 4ff528f..acf33cc 100644 --- a/src/actions/RoleAction.lua +++ b/src/actions/RoleAction.lua @@ -284,17 +284,21 @@ function _M.saleItemRpc(agent, data) if not backs then return end local reward = {} + local fragCount = 0 for itemId, count in pairs(backs) do if math.illegalNum(count, 1, role:getItemCount(itemId)) then return end local itemData = csvdb["itemCsv"][itemId] if itemData.sell_effect == "" then return end + if itemData.type == ItemType.HeroFragment or itemData.type == ItemType.HeroFCommon then + fragCount = fragCount + count + end local sellEffect = itemData.sell_effect:toArray(true, "=") reward[sellEffect[1]] = (reward[sellEffect[1]] or 0) + sellEffect[2] * count end role:costItems(backs) local reward = role:award(reward) - + role:checkTaskEnter("DecoFrag", {count = fragCount}) SendPacket(actionCodes.Role_saleItemRpc, MsgPack.pack({reward = reward})) return true end @@ -405,6 +409,7 @@ function _M.openTimeBoxRpc(agent, data) boxL[slot] = nil reward = role:award(reward) + role:checkTaskEnter("OpenBox") else return end @@ -459,5 +464,92 @@ function _M.unLockStoryBookRpc(agent, data) return true end +function _M.taskRpc(agent, data) + local role = agent.role + local msg = MsgPack.unpack(data) + local taskType = msg.type -- 1 日常 2 周长 + local taskId = msg.id --任务id + local roleField = {"dTask", "wTask"} + if not roleField[taskType] then return 1 end + + local taskData = csvdb["task_loopCsv"][taskType][taskId] + if not taskData then return 2 end + + local taskStatus = role:getProperty(roleField[taskType]) + local tStatus = taskStatus["t"] or {} + + if (tStatus[taskId] or 0) < taskData.condition1 then + return 3 + end + + local reward = role:award(taskData.reward) + local active = (taskStatus["a"] or 0) + taskData.active + + role:changeUpdates({ + { type = roleField[taskType], field = {"t", taskId}, value = -1 }, + { type = roleField[taskType], field = "a", value = active} + }) + + SendPacket(actionCodes.Role_taskRpc, MsgPack.pack({reward = reward})) + return true +end + +function _M.taskActiveRpc(agent, data) + local role = agent.role + local msg = MsgPack.unpack(data) + local taskType = msg.type -- 1 日常 2 周长 + local taskId = msg.id --任务id + local roleField = {"dTask", "wTask"} + if not roleField[taskType] then return end + + local taskData = csvdb["task_activeCsv"][taskType][taskId] + if not taskData then return end + + local taskStatus = role:getProperty(roleField[taskType]) + local tStatus = taskStatus["at"] or {} + + if tStatus[taskId] == -1 or (taskStatus["a"] or 0) < taskData.active then + return + end + + local reward = role:award(taskData.reward) + role:changeUpdates({ + { type = roleField[taskType], field = {"at", taskId}, value = -1 } + }) + + SendPacket(actionCodes.Role_taskActiveRpc, MsgPack.pack({reward = reward})) + return true +end + +function _M.achiveRpc(agent, data) + local role = agent.role + local msg = MsgPack.unpack(data) + local taskId = msg.id --任务id + + local achiveTask = csvdb["achievementCsv"][taskId] + if not achiveTask then return end + + local achiveT = role:getProperty("achiveT") + local achiveV = role:getProperty("achiveV") + + if achiveV[taskId] == -1 then return end + + local curStatus = achiveT[achiveTask.type] or 0 + local maxc = achiveTask.condition1 + + if maxc > curStatus then + return + end + + local reward = role:award(achiveTask.reward) + + role:changeUpdates({ + { type = "achiveV", field = taskId, value = -1 } + }) + + SendPacket(actionCodes.Role_achiveRpc, MsgPack.pack({reward = reward})) + return true +end + return _M \ No newline at end of file diff --git a/src/actions/TowerAction.lua b/src/actions/TowerAction.lua index bf72622..8f7e411 100644 --- a/src/actions/TowerAction.lua +++ b/src/actions/TowerAction.lua @@ -63,7 +63,7 @@ function _M.startBattleRpc(agent, data) towerInfo.k = key role:updateProperty({field = "towerInfo", value = towerInfo}) - + role:checkTaskEnter("TowerBattle", {level = towerInfo.l}) SendPacket(actionCodes.Tower_startBattleRpc, '') return true end @@ -91,6 +91,7 @@ function _M.endBattleRpc(agent, data) towerInfo.l = towerInfo.l + 1 reward = role:award(curTower.reward) + role:checkTaskEnter("TowerPass", {level = towerInfo.l - 1}) end towerInfo.c = curCount diff --git a/src/adv/Adv.lua b/src/adv/Adv.lua index b210623..a0f6d81 100644 --- a/src/adv/Adv.lua +++ b/src/adv/Adv.lua @@ -162,24 +162,31 @@ end --关卡通关,非层 score < 0 失败 -function Adv:over(success) +function Adv:over(success, isAllPass) local score = self:getScore() local scoreInfo = self.score local reward if success then reward = self.owner:award(self.owner:getProperty("advItems"):toNumMap()) - self.owner:checkTaskEnter("AdvPass", {id = self.chapterId}) + self.owner:checkTaskEnter("AdvPass", {id = self.chapterId, level = self.level, score = score}) + if isAllPass then + self.owner:checkTaskEnter("AdvAllPass", {id = self.chapterId}) + end -- 冒险队等级升一下子 local advL = self.owner:getProperty("advL") + local oldL = advL[1] advL[2] = (advL[2] or 0) + 1 for level = ((advL[1] or 0) + 1), #csvdb["adv_rankCsv"] do local ldata = csvdb["adv_rankCsv"][level] - if ldata.unlock >= advL[2] then + if ldata.unlock <= advL[2] then advL[1] = level self.owner:award(ldata.reward) end end + if advL[1] > oldL then + self.owner:checkTaskEnter("AdvLevel", {level = advL[1]}) + end self.owner:updateProperty("advL", advL) if self.owner:isFuncOpen(FuncOpenType.AdvWheelSurf) then @@ -434,7 +441,7 @@ local function clickOut(self, room, block, params) self:checkAchievement(Adv.AchievType.OverWin, 1, self.level) local levellimit = csvdb["adv_chapterCsv"][self.chapterId].limitlevel if params.relay or (not AdvCommon.isEndless(self.chapterId) and (self.level >= levellimit or not self.owner:advChapterIsOpen(self.chapterId, self.level + 1))) then --关卡结束 - self:over(true) + self:over(true, not AdvCommon.isEndless(self.chapterId) and self.level >= levellimit) else self:initByChapter(self.chapterId, self.level + 1, true, true) self:backNext() --下一关 @@ -485,9 +492,9 @@ local function chooseCommon(self, room, block, chooseData, choose) end return true end, - --制定属性 > + --制定属性 [4] = function() - if (self.battle.player[AttsEnumEx[cond[2]]] or 0) > cond[3] then + if (self.battle.player[AttsEnumEx[cond[2]]] or 0) >= cond[3] then return true end end, @@ -497,6 +504,12 @@ local function chooseCommon(self, room, block, chooseData, choose) return true end end, + -- sp 到达指定值 + [6] = function() + if self.battle.player.sp >= cond[2] then + return true + end + end, } assert(not cond[1] or checkCond[cond[1]], "error cond, event_[link]chooseCsv id :" .. block.event.id) @@ -788,6 +801,7 @@ function Adv:usePotion(potionId, potionLevel, target) end self:afterRound() self:saveDB() + self.owner:checkTaskEnter("AdvUsePotion") return true end diff --git a/src/adv/AdvBattle.lua b/src/adv/AdvBattle.lua index 583ae31..8be6655 100644 --- a/src/adv/AdvBattle.lua +++ b/src/adv/AdvBattle.lua @@ -197,6 +197,8 @@ function Battle:battleBegin(roomId, blockId, params) if player.hp > 0 then enemy:hurt(enemy.hp, self.player, {hurtType = 5}) self.player:effectBattleBuff() + + self.adv.owner:checkTaskEnter("AdvBattleWin", {id = self.adv.chapterId}) end if player.hp > self.player.hp then self.player:recover(player.hp - self.player.hp, player) diff --git a/src/adv/AdvBlock.lua b/src/adv/AdvBlock.lua index ee93b48..c8c644e 100644 --- a/src/adv/AdvBlock.lua +++ b/src/adv/AdvBlock.lua @@ -118,6 +118,7 @@ function Block:open() randomFunc[self:getEventType()]() end end + adv.owner:checkTaskEnter("AdvOpenBlock") self.isOpen = true end diff --git a/src/adv/AdvBuff.lua b/src/adv/AdvBuff.lua index 4137b40..15f1bbe 100644 --- a/src/adv/AdvBuff.lua +++ b/src/adv/AdvBuff.lua @@ -20,6 +20,7 @@ Buff.HP_CHANGE_NOW = 16 -- 生命变化(每回合生效,立刻生效) Buff.BATTLE_BUFF = 17 -- 切换为战斗中的buff Buff.CHANGE_DROP = 18 -- 转换掉落 Buff.BATTLE_PASSIVE = 19 -- 切换为战斗中的被动技 +Buff.EXP_ADD = 20 -- 增加exp(每回合) --角色一些属性的变化 local function commonAttr(_Buff, attrName) @@ -59,7 +60,7 @@ local BuffFactory = { if value > 0 then self.owner:recover(value, self.release) elseif value < 0 then - self.owner:hurt(-value, self.release, {hurtType = 2, buffId = self.id}) + self.owner:hurt(-value, self.release, {hurtType = self.buffData.effectValue5 == "1" and 6 or 2, buffId = self.id}) end end _Buff._effectValue = function(self) @@ -193,6 +194,7 @@ local BuffFactory = { return self.buffData.effectValue2, self.buffData.effectValue1 end end, + [Buff.HP_CHANGE_NOW] = function(_Buff) _Buff._init = function(self, data) --初始化变化值 self._changeV = 0 @@ -215,7 +217,7 @@ local BuffFactory = { if value > 0 then self.owner:recover(value, self.release) elseif value < 0 then - self.owner:hurt(-value, self.release, {hurtType = 2, buffId = self.id}) + self.owner:hurt(-value, self.release, {hurtType = self.buffData.effectValue5 == "1" and 6 or 2, buffId = self.id}) end end _Buff._effectValue = function(self) @@ -225,6 +227,17 @@ local BuffFactory = { return {cv = self._changeV} end end, + + [Buff.EXP_ADD] = function(_Buff) + --cType 0 or nil 值 1 百分比 + _Buff._afterRound = function(self) + local value = self:effect() + self.owner.battle.player:addExp(value) + end + _Buff._effectValue = function(self) + return self.buffData.effectValue1 + end + end, } function Buff:ctor(owner, id) diff --git a/src/adv/AdvPlayer.lua b/src/adv/AdvPlayer.lua index 0e0055a..e2470c5 100644 --- a/src/adv/AdvPlayer.lua +++ b/src/adv/AdvPlayer.lua @@ -224,7 +224,7 @@ function BaseObject:getInjuredValue(value) end --最终伤害 = [ (敌方攻击 - 己方防御) * (1+伤害增加百分比-伤害减少百分比)*(1+受伤增加百分比-受伤减少百分比)+(伤害增加固定值-伤害增加固定值+受伤增加固定值-受伤增加固定值)]*(1+侍宠百分比)-侍宠固定值 --- params -- hurtType 1 普攻伤害 2 buff伤害 3 反弹伤害 4 真实伤害 5 客户端发回来的伤害 --直接作用 +-- params -- hurtType 1 普攻伤害 2 buff伤害 3 反弹伤害 4 真实伤害 5 客户端发回来的伤害 --直接作用 6 buff伤害(真实) --进入这个方法之前计算好释放者加成的伤害 function BaseObject:hurt(value, releaser, params) params = params or {} @@ -245,7 +245,7 @@ function BaseObject:hurt(value, releaser, params) team:triggerPassive(Passive.TEAM_HURT, {trigger = releaser}) end end - if params.hurtType ~= 5 then + if params.hurtType ~= 5 and params.hurtType ~= 6 then if not params.hurtType or params.hurtType ~= 4 then value = self:getInjuredValue(value) --减伤计算 end @@ -308,7 +308,7 @@ function BaseObject:hurt(value, releaser, params) team:triggerPassive(Passive.TEAM_DEAD) end - if params.hurtType == 2 and self ~= self.battle.player then + if (params.hurtType == 6 or params.hurtType == 2) and self ~= self.battle.player then self.battle.adv:checkAchievement(self.battle.adv.AchievType.KillByBuff, 1, params.buffId) end @@ -350,7 +350,7 @@ function BaseObject:releaseSkill(skillId, target) end --0 全部 1 我方 2 敌方 -function BaseObject:getTeam(nType, noSelf, mapIdx) +function BaseObject:getTeam(nType, noSelf, mapIdx, includeLock) mapIdx = mapIdx or self.battle.adv:getCurMapIdx() nType = nType or 0 local team = {} @@ -364,7 +364,7 @@ function BaseObject:getTeam(nType, noSelf, mapIdx) local function addEnemy() for _, enemy in pairs(self.battle.enemys[mapIdx]) do if not noSelf or enemy ~= self then - if not enemy.isDead and not enemy.lock then -- 已经翻开的 + if not enemy.isDead and (includeLock or not enemy.lock) then -- 已经翻开的 table.insert(team, enemy) end end diff --git a/src/models/Diner.lua b/src/models/Diner.lua index 646956d..225506c 100644 --- a/src/models/Diner.lua +++ b/src/models/Diner.lua @@ -178,6 +178,7 @@ function Diner:updateSell(slot, calOnly) self:checkDinerTask(DinerTask.SellDish, deltaCount, sell.dish) self:checkDinerTask(DinerTask.SellDishType, deltaCount, math.ceil(sell.dish / 100)) self:checkDinerTask(DinerTask.SellDishRare, deltaCount, dishData.rarity) + self.owner:checkTaskEnter("FoodSell", {count = deltaCount}) end return { deltaCount = deltaCount, @@ -250,6 +251,7 @@ function Diner:popularAdd(popular) local roleId = self.owner:getProperty("id") -- 更新排行榜 local curPopular = self:getProperty("popular") + self.owner:checkTaskEnter("DinerPopular", {count = curPopular}) redisproxy:pipelining(function (red) red:zadd(dbKey, curPopular, roleId) --更新分数 red:hset(RANK_DINER_INFO, roleId, MsgPack.pack({ diff --git a/src/models/Role.lua b/src/models/Role.lua index e0fbe0f..da489d5 100644 --- a/src/models/Role.lua +++ b/src/models/Role.lua @@ -75,7 +75,13 @@ Role.schema = { towerInfo = {"table", {c = globalCsv.tower_count_limit, l = 1}}, -- 当天爬塔消耗的次数 -- {t = time, c = count, l = layer, k = battleKey} towerF = {"table", {}}, -- 爬塔阵容 - spTask = {"table", {}} -- 特殊任务 -- {id = status} + spTask = {"table", {}}, -- 特殊任务 -- {id = status} + + dTask = {"table", {}}, -- 每日任务 {t = {id = status}, a = 0, at = {id = status}} t 任务完成情况 a 获得的活跃数值 at 活跃任务完成情况 + wTask = {"table", {}}, -- 每周任务 {t = {id = status}, a = 0, at = {id = status}} t 任务完成情况 a 获得的活跃数值 at 活跃任务完成情况 + + achiveT = {"table", {}}, -- 成就计数统计 achivement_type {id = status} + achiveV = {"table", {}}, -- 成就领奖统计 achivement {id = status} } @@ -213,7 +219,10 @@ function Role:data() towerInfo = self:getProperty("towerInfo"), towerF = self:getProperty("towerF"), spTask = self:getProperty("spTask"), - + dTask = self:getProperty("dTask"), + wTask = self:getProperty("wTask"), + achiveT = self:getProperty("achiveT"), + achiveV = self:getProperty("achiveV"), } end diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index aae409e..502f201 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -27,15 +27,24 @@ function RolePlugin.bind(Role) self.dailyData:refreshDailyData(notify) self.dinerData:refreshDailyData(notify) + self:setProperty("dTask", {}) + response.dTask = {} + + + if isCrossWeek(ltime, now) then + self:setProperty("wTask", {}) + response.wTask = {} + end if notify then self:notifyUpdateProperties(response) end - + if RESET_TIME == RESET_RANK_TIME then self:onResetRank_raw(ltime, now, notify) end self:setProperty("ltime", now) + return true end end @@ -114,12 +123,13 @@ function RolePlugin.bind(Role) local typ = math.floor((itemId-7000)/100) local lv = (itemId-7000)%100 self:addEquip(typ, lv, count ,pms) - self:checkTaskEnter("AddEquip", {equipId = itemId}, pms.notNotify) + local equipCsv = (csvdb["equipCsv"][typ] or {})[lv] + self:checkTaskEnter("AddEquip", {equipId = itemId, rarity = equipCsv.rarity}, pms.notNotify) end, [ItemType.Rune] = function() local typ = math.floor((itemId-2000)/100) for _= 1, count do - self:addRune({type = typ,id = itemId}) + self:addRune({type = typ,id = itemId, pms.notNotify}) end end, [ItemType.AdvItem] = function() --冒险道具不会进入 玩家仓库 @@ -323,7 +333,8 @@ function RolePlugin.bind(Role) local roleId = self:getProperty("id") local heroType = params.type if self:isHaveHero(heroType) then return end - if not csvdb["unitCsv"][heroType] then return false end + local unitData = csvdb["unitCsv"][heroType] + if not unitData then return false end local heroId = tonum(redisproxy:hincrby(string.format(R_INCR, roleId), "hero", 1)) @@ -341,7 +352,7 @@ function RolePlugin.bind(Role) newHero.owner = self newHero:saveBattleValue() self.heros[heroId] = newHero - self:checkTaskEnter("AddHero", {heroType = heroType, wakeL = newHero:getProperty("wakeL")}, params.notNotify) + self:checkTaskEnter("AddHero", {heroType = heroType, wakeL = newHero:getProperty("wakeL"), camp = unitData.camp, job = unitData.job}, params.notNotify) if not params.notNotify then local heroResponse = {} table.insert(heroResponse, newHero:data()) @@ -498,6 +509,7 @@ function RolePlugin.bind(Role) table.insert(response, newRune:data()) SendPacket(actionCodes.Role_loadRunes, MsgPack.pack(response)) end + self:checkTaskEnter("AddRune", {id = params.id, type = params.type, rarity = set.rarity}, params.notNotify) return 0 else return 1 diff --git a/src/models/RoleTask.lua b/src/models/RoleTask.lua index 5ca7fd3..b22459d 100644 --- a/src/models/RoleTask.lua +++ b/src/models/RoleTask.lua @@ -2,20 +2,79 @@ -- 增加 checkTaskEnter 内的参数 记得增加注释 local TaskType = { - HangPass = 1, -- 挂机通关 - id - AdvPass = 2, -- 冒险通过关 - id + -- hero 相关 + DrawHero = 1, -- 招募 - pool count + AddHero = 2, -- 增加角色 - heroType wakeL camp job LoveBreak = 3, -- 好感度进阶 - heroType loveL Wake = 4, -- 觉醒 - heroType wakeL - AddHero = 5, -- 增加角色 - heroType wakeL - AddEquip = 6, -- 获得装备 - equipId - DecoRune = 7, -- 分解符文 - count - SaleEquip = 8, -- 出售装备 - count - MakeFood = 9, -- 制作料理 - id count - HangGet = 10, -- 挂机收货 - FoodMGet = 11, -- 食材获取 - - --todo - PvpWin = 100, -- pvp胜利 + HeroLevelUp = 5, -- 角色升级 - level + DecoFrag = 6, -- 碎片分解 - count + WakeCG = 7, -- 觉醒到解锁CG - heroType + HeroTalent = 8, -- 天赋升级 - heroType alv + DrawSSR = 9, -- 抽到SSR - count + + --装备相关 + AddEquip = 101, -- 获得装备 - equipId rarity + SaleEquip = 102, -- 出售装备 - count + EquipUp = 103, -- 装备强化 + + -- 符文(零件)相关 + RuneUp = 201, -- 符文强化 + DecoRune = 202, -- 分解符文 - count + AddRune = 203, -- 分解符文 - id type rarity + + + -- 挂机相关 + HangPass = 301, -- 挂机通关 - id + HangGet = 302, -- 挂机收货 + HangQuick = 303, -- 快速挂机 + HangBattle = 304, -- 挂机战斗 - id + HangGetGold = 305, -- 挂机获得齿轮 - count + + -- 冒险相关 + AdvPass = 401, -- 冒险通过关 - id level score + AdvStart = 402, -- 冒险开始(包括挂机) - id + AdvBattleWin = 403, -- 冒险内战斗胜利 - id + AdvAllPass = 404, -- 冒险章节通关 - id + AdvLevel = 405, -- 探险者协会升级 - level + AdvOverTask = 406, -- 完成任务 - id + AdvOpenBlock = 407, -- 打开地块 - id + AdvUsePotion = 408, -- 使用营养剂 + + --爬塔相关 + TowerPass = 501, -- 爬塔通关 - level + TowerBattle = 502, -- 爬塔战斗 - level + + -- 餐厅相关 + FoodMGet = 601, -- 食材获取 + MakeFood = 602, -- 制作料理 - id count + GetOderTask = 603, -- 接受餐厅订单 - rarity + OverOderTask = 604, -- 完成特别订单 - rarity + FoodSell = 605, -- 料理贩卖 - count + FoodSellQuick = 606, -- 料理快速贩卖 + FoodSellGold = 607, -- 贩卖获得齿轮 - count + DinerPopular = 608, -- 人气值 - count + DinerLevelUp = 609, -- 餐厅升级 - level type + DinerTalentUp = 610, -- 天赋升级 - type + + -- 车厢相关 + PotionMake = 701, -- 营养剂制作 - id count + OpenBox = 702, -- 拆解时间箱 + + + --功能未实现 todo + PvpWin = 1000, -- pvp胜利 - score + PvpBattle = 1001, -- pvp挑战 + AdvShop = 1002, -- 冒险商城 + GiveFriendP = 1003, -- 赠送友情点 + UnionBoss = 1004, -- 工会boss + UnionBattle = 1005, -- 工会战 + AddUnion = 1006, -- 加入一个公会 + AddFriend = 1007, -- 加入一个好友 - count + BindPhone = 1008, -- 绑定手机 + WeChat = 1009, -- 关注微信 + WeBlog = 1010, -- 关注微博 + SignIn = 1011, -- 签到 } local function v(value) @@ -26,19 +85,95 @@ local function f(field) return {type = "field", value = field} end +-- 剧情任务监听 local StoryListener = { func = "checkStoryStatus", listen = { - [TaskType.HangPass] = {v(1), f("id")}, - [TaskType.AdvPass] = {v(4), f("id")}, - [TaskType.LoveBreak] = {v(2), f("heroType")}, - [TaskType.Wake] = {v(3), f("heroType"), f("wakeL")}, - [TaskType.AddHero] = {v(3), f("heroType"), f("wakeL")}, + [TaskType.HangPass] = {{v(1), f("id")}}, + [TaskType.AdvPass] = {{v(4), f("id")}}, + [TaskType.LoveBreak] = {{v(2), f("heroType")}}, + [TaskType.Wake] = {{v(3), f("heroType"), f("wakeL")}}, + [TaskType.AddHero] = {{v(3), f("heroType"), f("wakeL")}}, + } +} + +-- 通用任务监听 +local CommonListener = { + func = "checkCommonTasks", + listen = { + [TaskType.HangGet] = {{v(1)}}, + [TaskType.HangQuick] = {{v(2)}}, + [TaskType.HangBattle] = {{v(3)}}, + [TaskType.DrawHero] = {{v(4), f("count"), f("pool")}}, + [TaskType.TowerBattle] = {{v(5)}}, + [TaskType.PvpBattle] = {{v(6)}}, + [TaskType.PvpWin] = {{v(7)}}, + [TaskType.AdvStart] = {{v(8)}}, + [TaskType.AdvBattleWin] = {{v(9)}}, + [TaskType.AdvShop] = {{v(10)}}, + [TaskType.GetOderTask] = {{v(11)}}, + [TaskType.OverOderTask] = {{v(12)}}, + [TaskType.MakeFood] = {{v(13), f("count")}}, + [TaskType.FoodSell] = {{v(14), f("count")}}, + [TaskType.FoodSellQuick] = {{v(15)}}, + [TaskType.FoodMGet] = {{v(16)}}, + [TaskType.HeroLevelUp] = {{v(17)}}, + [TaskType.Wake] = {{v(18)}}, + [TaskType.EquipUp] = {{v(19)}}, + [TaskType.GiveFriendP] = {{v(20)}}, + [TaskType.UnionBoss] = {{v(21)}}, + } +} + +-- 成就监听 +local AchievListener = { + func = "checkAchievTask", + listen = { + [TaskType.HangPass] = {{v(1), f("id")}}, + [TaskType.UnionBattle] = {{v(2)}}, + [TaskType.PvpWin] = {{v(3)}, {v(4), f("score")}}, + [TaskType.AdvAllPass] = {{v(5), f("id")}}, + [TaskType.AdvLevel] = {{v(6), f("level")}}, + [TaskType.AdvPass] = {{v(7), f("score")}}, + [TaskType.AdvBattleWin] = {{v(8)}}, + [TaskType.AdvOverTask] = {{v(9)}}, + [TaskType.AdvOpenBlock] = {{v(10)}}, + [TaskType.AdvUsePotion] = {{v(11)}}, + [TaskType.AdvStart] = {{v(12)}}, + [TaskType.FoodSell] = {{v(13), f("count")}}, + [TaskType.OverOderTask] = {{v(14)}}, + [TaskType.FoodSellGold] = {{v(15), f("count")}}, + [TaskType.DinerPopular] = {{v(16), f("count")}}, + [TaskType.TowerPass] = {{v(17), f("level")}}, + [TaskType.OpenBox] = {{v(18)}}, + [TaskType.DinerLevelUp] = {{v(19), f("level"), f("type")}}, + [TaskType.DinerTalentUp] = {{v(20), v(1), f("type")}}, + [TaskType.HangGetGold] = {{v(21), f("count")}}, + [TaskType.HeroLevelUp] = {{v(22), f("level")}}, + [TaskType.Wake] = {{v(23), f("wakeL")}}, + [TaskType.WakeCG] = {{v(24)}}, + [TaskType.HeroTalent] = {{v(25), f("alv")}}, + [TaskType.AddHero] = {{v(26), f("heroType")}, {v(27)}}, + [TaskType.DrawSSR] = {{v(28), f("count")}}, + [TaskType.DrawHero] = {{v(29), f("count"), f("pool")}}, + [TaskType.AddEquip] = {{v(30), f("rarity")}, {v(34), 1, f("rarity")}}, + [TaskType.AddRune] = {{v(31), f("rarity")}, {v(35), 1, f("rarity")}}, + [TaskType.EquipUp] = {{v(32)}}, + [TaskType.RuneUp] = {{v(33)}}, + [TaskType.AddUnion] = {{v(36)}}, + [TaskType.AddFriend] = {{v(37), f("count")}}, + [TaskType.BindPhone] = {{v(38), 1}}, + [TaskType.WeChat] = {{v(38), 2}}, + [TaskType.WeBlog] = {{v(38), 3}}, + [TaskType.SignIn] = {{v(39)}}, } } + local TaskListeners = { StoryListener, + CommonListener, + AchievListener, } local RoleTask = {} @@ -54,33 +189,26 @@ function RoleTask.bind(Role) for _, listener in ipairs(TaskListeners) do if listener and listener.listen and listener.listen[taskType] and listener["func"] then local pms = {} - for _, v in ipairs(listener.listen[taskType]) do - if type(v) == "table" and v.type then - if v.type == "value" then - table.insert(pms, v.value) - elseif v.type == "field" then - table.insert(pms, params[v.value]) + for _, vs in ipairs(listener.listen[taskType]) do + for __, v in ipairs(vs) do + if type(v) == "table" and v.type then + if v.type == "value" then + table.insert(pms, v.value) + elseif v.type == "field" then + table.insert(pms, params[v.value]) + else + table.insert(pms, v) + end else table.insert(pms, v) end - else - table.insert(pms, v) end + self[listener["func"]](self, notNotify, table.unpack(pms)) end - self[listener["func"]](self, notNotify, table.unpack(pms)) end end end - function Role:checkDailyTask() - end - - function Role:checkWeekTask() - end - - function Role:checkAchievTask() - end - --剧情相关----begin------------- local function checkStoryStatusByHang(role, data, status, cond1) -- cond1 carbonId if tonumber(data.unlockData) ~= cond1 then return end @@ -158,6 +286,147 @@ function RoleTask.bind(Role) end --剧情相关----end------------- + + function Role:checkCommonTasks(notNotify, stype, count, cond1, cond2) + count = count or 1 + self:checkLoopTask(notNotify, stype, count, cond1, cond2) + end + + function Role:checkLoopTask(notNotify, stype, count, cond1, cond2) + local tasks = {self:getProperty("dTask")["t"] or {}, self:getProperty("wTask")["t"] or {}} + local isChange = {false, false} + for key, status in ipairs(tasks) do + local taskDatas = csvdb["task_loopCsv"][key] + for taskId, data in pairs(taskDatas) do + if status[taskId] ~= -1 and data.type == stype and (data.condition2 == 0 or data.condition2 == cond1) then + status[taskId] = (status[taskId] or 0) + count + isChange[key] = 1 + end + end + end + local change = {} + if isChange[1] then + table.insert(change, {type = "dTask", field = "t", value = tasks[1]}) + end + if isChange[2] then + table.insert(change, {type = "wTask", field = "t", value = tasks[2]}) + end + if next(change) then + self:changeUpdates(change, notNotify) + end + end + + function Role:checkAchievTask(notNotify, stype, v1, v2) + local change = {} + local achiveStatus = self:getProperty("achiveT") + + local IsFindMax = { + [4] = true, + [6] = true, + [7] = true, + [16] = true, + [17] = true, + [19] = true, + [22] = true, + [23] = true, + [25] = true, + } + + for tId , achiveData in ipairs(csvdb["achievement_typeCsv"]) do + local curStatus = achiveStatus[tId] or 0 + if achiveData.type == stype then + if achiveData.type == 1 then --取出难度 + v2 = math.floor(v1 / 10000) + end + + if achiveData.type == 26 then + local campS = {} + local jobS = {} + for _, hero in pairs(self.heros) do + local unitData = csvdb["unitCsv"][hero:getProperty("type")] + campS[unitData.camp] = (campS[unitData.camp] or 0) + 1 + jobS[unitData.job] = (jobS[unitData.job] or 0) + 1 + end + local nStatus = 0 + if achiveData.condition2 == 1 then + for k , v in pairs(jobS) do + nStatus = math.max(nStatus, v) + end + elseif achiveData.condition2 == 2 then + for k , v in pairs(campS) do + nStatus = math.max(nStatus, v) + end + end + if nStatus > curStatus then + table.insert(change, {type = "achiveT", field = tId, value = nStatus}) + end + elseif achiveData.type == 30 then --装备套装 + if achiveData.condition2 == 0 or achiveData.condition2 == v1 then + local suitS = {} + for equipType, equips in pairs(self:getProperty("equips")) do + for lv, c in pairs(equips) do + local equipData = csvdb["equipCsv"][equipType][lv] + if achiveData.condition2 == 0 or achiveData.condition2 == equipData.rarity then + if equipData.suit ~= "" then + suitS[equipData.suit] = suitS[equipData.suit] or {} + suitS[equipData.suit][equipType] = 1 + end + end + end + end + local nStatus = 0 + for k , v in pairs(suitS) do + local n = 0 + for _, __ in pairs(v) do + n = n + 1 + end + nStatus = math.max(nStatus, n) + end + if nStatus > curStatus then + table.insert(change, {type = "achiveT", field = tId, value = nStatus}) + end + end + elseif achiveData.type == 31 then -- 符文套装 + if achiveData.condition2 == 0 or achiveData.condition2 == v1 then + local suitS = {} + for _, rune in pairs(self.runeBag) do + local runeData = csvdb["runeCsv"][rune:getProperty("type")][rune:getProperty("id")] + if achiveData.condition2 == 0 or achiveData.condition2 == equipData.rarity then + if runeData.suit ~= "" then + suitS[runeData.suit] = suitS[runeData.suit] or {} + suitS[runeData.suit][runeData.type] = 1 + end + end + end + local nStatus = 0 + for k , v in pairs(suitS) do + local n = 0 + for _, __ in pairs(v) do + n = n + 1 + end + nStatus = math.max(nStatus, n) + end + if nStatus > curStatus then + table.insert(change, {type = "achiveT", field = tId, value = nStatus}) + end + end + elseif IsFindMax[achiveData.type] then -- 最大值 + if achiveData.condition2 == 0 or achiveData.condition2 == v2 then + if (v1 or 0) > curStatus then + table.insert(change, {type = "achiveT", field = tId, value = v1}) + end + end + else --通用增加 + if achiveData.condition2 == 0 or achiveData.condition2 == v2 then + table.insert(change, {type = "achiveT", field = tId, value = curStatus + (v1 or 1)}) + end + end + end + end + if next(change) then + self:changeUpdates(change, notNotify) + end + end end return RoleTask \ No newline at end of file -- libgit2 0.21.2