diff --git a/src/actions/GmAction.lua b/src/actions/GmAction.lua index f04a4d5..fa94cf5 100644 --- a/src/actions/GmAction.lua +++ b/src/actions/GmAction.lua @@ -419,7 +419,6 @@ end table.insert(helpDes, {"挂机清除" , "idlec"}) function _M.idlec(role, pms) - role:updateProperty({field = "hangTeam", value = {}}) role:updateProperty({field = "hangInfo", value = {}}) role:updateProperty({field = "hangBag", value = {}}) role:mylog("gm_action", {desc = "idlec", key1 = pms.sender}) diff --git a/src/actions/HangAction.lua b/src/actions/HangAction.lua index 0413678..a10a64c 100644 --- a/src/actions/HangAction.lua +++ b/src/actions/HangAction.lua @@ -346,6 +346,9 @@ function _M.roleFormatRpc(agent , data) team.leader = msg.leader team.supports = supports team.title = title + if msg.tactics and globalCsv.tactics_skill_passive_cell[msg.tactics] then + team.tactics = msg.tactics + end role:setTeamFormat(index, team) @@ -459,36 +462,6 @@ function _M.quickRpc(agent , data) return true end -function _M.bonusFormatRpc(agent , data) - local role = agent.role - local msg = MsgPack.unpack(data) - local bTeam = role:getProperty("bTeam") - for slot, heroId in pairs(msg.heros) do - if not role.heros[heroId] then - return - end - end - local supports = {} - for slot, support in pairs(msg.supports) do - if slot ~= 1 and slot ~= 2 then return end - local level = role.dinerData:getProperty("dishTree"):getv(support, 0) - if level <= 0 then return end - supports[slot] = support - end - if not checkLeader(msg.heros, msg.leader) then return end - - table.clear(bTeam) - bTeam.heros = {} - for slot, heroId in pairs(msg.heros) do - bTeam.heros[slot] = heroId - end - bTeam.leader = msg.leader - bTeam.supports = supports - - role:updateProperty({field = "bTeam", value = bTeam}) - SendPacket(actionCodes.Hang_bonusFormatRpc, '') - return true -end function _M.buyBonusCountRpc(agent, data) local role = agent.role diff --git a/src/actions/PvpAction.lua b/src/actions/PvpAction.lua index f0d18c1..00ff490 100644 --- a/src/actions/PvpAction.lua +++ b/src/actions/PvpAction.lua @@ -50,6 +50,9 @@ function _M.formatCommonRpc(agent , data) end pvpTC.leader = msg.leader pvpTC.supports = supports + if msg.tactics and globalCsv.tactics_skill_passive_cell[msg.tactics] then + pvpTC.tactics = msg.tactics + end role:savePvpCTeam(pvpTC) SendPacket(actionCodes.Pvp_formatCommonRpc, '') @@ -92,6 +95,9 @@ function _M.formatHighRpc(agent , data) curTeam.heros = team.heros curTeam.leader = team.leader curTeam.supports = supports + if team.tactics and globalCsv.tactics_skill_passive_cell[team.tactics] then + curTeam.tactics = team.tactics + end table.insert(pvpTH, curTeam) end @@ -462,6 +468,10 @@ function _M.startBattleHRpc(agent, data) curTeam.heros = team.heros curTeam.leader = team.leader curTeam.supports = supports + if team.tactics and globalCsv.tactics_skill_passive_cell[team.tactics] then + curTeam.tactics = team.tactics + end + table.insert(pvpTH, curTeam) end diff --git a/src/actions/RoleAction.lua b/src/actions/RoleAction.lua index 9e14290..2d4d0bc 100644 --- a/src/actions/RoleAction.lua +++ b/src/actions/RoleAction.lua @@ -291,7 +291,7 @@ function _M.loginRpc( agent, data ) -- 玩家登陆做的一些操作 - role:saveHangTeam() + role:updateHangTeamInfo() role:savePvpCTeam() role:savePvpHTeam() diff --git a/src/actions/TowerAction.lua b/src/actions/TowerAction.lua index f9617fd..c1c073b 100644 --- a/src/actions/TowerAction.lua +++ b/src/actions/TowerAction.lua @@ -8,36 +8,6 @@ local MsgPack = MsgPack local _M = {} -function _M.roleFormatRpc(agent , data) - local role = agent.role - local msg = MsgPack.unpack(data) - local towerTeam = role:getProperty("towerF") - for slot, heroId in pairs(msg.heros) do - if not role.heros[heroId] then - return - end - end - local supports = {} - for slot, support in pairs(msg.supports) do - if slot ~= 1 and slot ~= 2 then return end - local level = role.dinerData:getProperty("dishTree"):getv(support, 0) - if level <= 0 then return end - supports[slot] = support - end - table.clear(towerTeam) - towerTeam.heros = {} - for slot, heroId in pairs(msg.heros) do - towerTeam.heros[slot] = heroId - end - towerTeam.leader = msg.leader - towerTeam.supports = supports - - - role:updateProperty({field = "towerF", value = towerTeam}) - SendPacket(actionCodes.Tower_roleFormatRpc, '') - return true -end - local function getUpdateTime(lastCount, lastTime) local nextCount, nextTime = lastCount, skynet.timex() diff --git a/src/models/Role.lua b/src/models/Role.lua index c19c841..84f13ce 100644 --- a/src/models/Role.lua +++ b/src/models/Role.lua @@ -103,7 +103,6 @@ Role.schema = { --挂机相关 hangPass = {"table", {}}, -- 挂机通过的最大关卡 hangGift = {"table", {}}, -- 挂机奖励 {id = 1} - hangTeam = {"table", {}}, -- 挂机队伍 hangTS = {"table", {}}, -- 挂机队伍他人可读的队伍信息 hangTB = {"table", {}}, -- 挂机队伍他人可用的战斗信息mao hangTBV = {"number", 0}, -- 挂机队伍他人可用的战斗力 @@ -111,7 +110,6 @@ Role.schema = { hangInfo = {"table", {}}, -- 当前挂机信息 hangBag = {"table", {}}, -- 背包 hangBagLimit = {"number", globalCsv.idle_field_origin}, --背包上限 - bTeam = {"table", {}}, -- 奖励副本队伍 hangTeams = {"table", {}}, -- pve自选编队 teamIndex = {"table", {}}, -- 各个系统使用的编队索引 type->index 见TeamSystemType advTeams = {"table", {}}, -- 拾荒自选编队 @@ -145,7 +143,6 @@ Role.schema = { boxL = {"table", {}}, -- boxList 正开启的箱子 -- {[1] = {id = 1010, gem = 101, time = 1313}} towerInfo = {"table", {c = globalCsv.tower_count_limit, l = 1}}, -- 当天爬塔消耗的次数 -- {t = time, c = count, l = layer, k = battleKey} - towerF = {"table", {}}, -- 爬塔阵容 spTask = {"table", {}}, -- 特殊任务 -- {id = status} @@ -357,11 +354,9 @@ function Role:data() hangPass = self:getProperty("hangPass"), hangGift = self:getProperty("hangGift"), - hangTeam = self:getProperty("hangTeam"), hangInfo = self:getProperty("hangInfo"), hangBag = self:getProperty("hangBag"), hangBagLimit = self:getProperty("hangBagLimit"), - bTeam = self:getProperty("bTeam"), hangTeams = self:getProperty("hangTeams"), teamIndex = self:getProperty("teamIndex"), advTeams = self:getProperty("advTeams"), @@ -380,7 +375,6 @@ function Role:data() equips = self:getProperty("equips"), boxL = self:getProperty("boxL"), towerInfo = self:getProperty("towerInfo"), - towerF = self:getProperty("towerF"), spTask = self:getProperty("spTask"), dTask = self:getProperty("dTask"), wTask = self:getProperty("wTask"), diff --git a/src/models/RoleBattle.lua b/src/models/RoleBattle.lua index 56e320a..60786fe 100644 --- a/src/models/RoleBattle.lua +++ b/src/models/RoleBattle.lua @@ -57,7 +57,6 @@ function Role:checkBattle(battleType, params) end end, tower = function() - --local towerF = self:getProperty("towerF") local towerF = self:getTeamFormatByType(TeamSystemType.Tower) for slot, hero in pairs(self:getTeamHerosInfo(towerF.heros)) do selflist[slot] = hero.type @@ -73,7 +72,6 @@ function Role:checkBattle(battleType, params) end end, bonus = function() - --local bTeam = self:getProperty("bTeam") local bTeam = self:getTeamFormatByType(TeamSystemType.BonusBattle) for slot, hero in pairs(self:getTeamHerosInfo(bTeam.heros)) do selflist[slot] = hero.type diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index 12552fb..03b9cf8 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -1135,7 +1135,6 @@ function RolePlugin.bind(Role) local now = skynet.timex() local ct = math.ceil((now - StdTowerRankTime) / 86400) --按天计算 365 * 27 < 10000 可以维持 27 年 local ct = 10000 - ct -- 越早的排名越靠前 - --local towerTeam = self:getProperty("towerF") local towerTeam = self:getTeamFormatByType(TeamSystemType.Tower) local battleV = self:getTeamBattleValue(towerTeam.heros) local score = (level * 10000 + ct) * 10000000 + battleV @@ -1289,6 +1288,7 @@ function RolePlugin.bind(Role) for slot, id in pairs(team.supports or {}) do teamInfo.supports[slot] = {id, self.dinerData:getProperty("dishTree"):getv(id, 0)} end + teamInfo.tactics = globalCsv.tactics_skill_passive_cell[team.tactics] and team.tactics or nil return teamInfo end @@ -1315,20 +1315,6 @@ function RolePlugin.bind(Role) return self:getRealBattleValue(heros) end - -- 不传参数 只修改保存的阵容信息 - function Role:saveHangTeam(team) - if not team then - team = self:getProperty("hangTeam") - else - self:updateProperty({field = "hangTeam", value = team}) - end - self:setProperties({ - hangTS = self:getTeamHerosInfo(team.heros), - hangTB = self:getTeamBattleInfo(team), - hangTBV = self:getTeamBattleValue(team.heros), - }) - end - function Role:updateHangTeamInfo() local team = self:getTeamFormatByType(TeamSystemType.Hang) if not team then return end -- libgit2 0.21.2