Commit f7f26c154a952019e6568a2090cd2243c0a3c2a8
1 parent
a80fee7c
编队整理 增加 tactics战术
Showing
8 changed files
with
15 additions
and
85 deletions
Show diff stats
src/actions/GmAction.lua
@@ -419,7 +419,6 @@ end | @@ -419,7 +419,6 @@ end | ||
419 | 419 | ||
420 | table.insert(helpDes, {"挂机清除" , "idlec"}) | 420 | table.insert(helpDes, {"挂机清除" , "idlec"}) |
421 | function _M.idlec(role, pms) | 421 | function _M.idlec(role, pms) |
422 | - role:updateProperty({field = "hangTeam", value = {}}) | ||
423 | role:updateProperty({field = "hangInfo", value = {}}) | 422 | role:updateProperty({field = "hangInfo", value = {}}) |
424 | role:updateProperty({field = "hangBag", value = {}}) | 423 | role:updateProperty({field = "hangBag", value = {}}) |
425 | role:mylog("gm_action", {desc = "idlec", key1 = pms.sender}) | 424 | role:mylog("gm_action", {desc = "idlec", key1 = pms.sender}) |
src/actions/HangAction.lua
@@ -346,6 +346,9 @@ function _M.roleFormatRpc(agent , data) | @@ -346,6 +346,9 @@ function _M.roleFormatRpc(agent , data) | ||
346 | team.leader = msg.leader | 346 | team.leader = msg.leader |
347 | team.supports = supports | 347 | team.supports = supports |
348 | team.title = title | 348 | team.title = title |
349 | + if msg.tactics and globalCsv.tactics_skill_passive_cell[msg.tactics] then | ||
350 | + team.tactics = msg.tactics | ||
351 | + end | ||
349 | 352 | ||
350 | role:setTeamFormat(index, team) | 353 | role:setTeamFormat(index, team) |
351 | 354 | ||
@@ -459,36 +462,6 @@ function _M.quickRpc(agent , data) | @@ -459,36 +462,6 @@ function _M.quickRpc(agent , data) | ||
459 | return true | 462 | return true |
460 | end | 463 | end |
461 | 464 | ||
462 | -function _M.bonusFormatRpc(agent , data) | ||
463 | - local role = agent.role | ||
464 | - local msg = MsgPack.unpack(data) | ||
465 | - local bTeam = role:getProperty("bTeam") | ||
466 | - for slot, heroId in pairs(msg.heros) do | ||
467 | - if not role.heros[heroId] then | ||
468 | - return | ||
469 | - end | ||
470 | - end | ||
471 | - local supports = {} | ||
472 | - for slot, support in pairs(msg.supports) do | ||
473 | - if slot ~= 1 and slot ~= 2 then return end | ||
474 | - local level = role.dinerData:getProperty("dishTree"):getv(support, 0) | ||
475 | - if level <= 0 then return end | ||
476 | - supports[slot] = support | ||
477 | - end | ||
478 | - if not checkLeader(msg.heros, msg.leader) then return end | ||
479 | - | ||
480 | - table.clear(bTeam) | ||
481 | - bTeam.heros = {} | ||
482 | - for slot, heroId in pairs(msg.heros) do | ||
483 | - bTeam.heros[slot] = heroId | ||
484 | - end | ||
485 | - bTeam.leader = msg.leader | ||
486 | - bTeam.supports = supports | ||
487 | - | ||
488 | - role:updateProperty({field = "bTeam", value = bTeam}) | ||
489 | - SendPacket(actionCodes.Hang_bonusFormatRpc, '') | ||
490 | - return true | ||
491 | -end | ||
492 | 465 | ||
493 | function _M.buyBonusCountRpc(agent, data) | 466 | function _M.buyBonusCountRpc(agent, data) |
494 | local role = agent.role | 467 | local role = agent.role |
src/actions/PvpAction.lua
@@ -50,6 +50,9 @@ function _M.formatCommonRpc(agent , data) | @@ -50,6 +50,9 @@ function _M.formatCommonRpc(agent , data) | ||
50 | end | 50 | end |
51 | pvpTC.leader = msg.leader | 51 | pvpTC.leader = msg.leader |
52 | pvpTC.supports = supports | 52 | pvpTC.supports = supports |
53 | + if msg.tactics and globalCsv.tactics_skill_passive_cell[msg.tactics] then | ||
54 | + pvpTC.tactics = msg.tactics | ||
55 | + end | ||
53 | 56 | ||
54 | role:savePvpCTeam(pvpTC) | 57 | role:savePvpCTeam(pvpTC) |
55 | SendPacket(actionCodes.Pvp_formatCommonRpc, '') | 58 | SendPacket(actionCodes.Pvp_formatCommonRpc, '') |
@@ -92,6 +95,9 @@ function _M.formatHighRpc(agent , data) | @@ -92,6 +95,9 @@ function _M.formatHighRpc(agent , data) | ||
92 | curTeam.heros = team.heros | 95 | curTeam.heros = team.heros |
93 | curTeam.leader = team.leader | 96 | curTeam.leader = team.leader |
94 | curTeam.supports = supports | 97 | curTeam.supports = supports |
98 | + if team.tactics and globalCsv.tactics_skill_passive_cell[team.tactics] then | ||
99 | + curTeam.tactics = team.tactics | ||
100 | + end | ||
95 | 101 | ||
96 | table.insert(pvpTH, curTeam) | 102 | table.insert(pvpTH, curTeam) |
97 | end | 103 | end |
@@ -462,6 +468,10 @@ function _M.startBattleHRpc(agent, data) | @@ -462,6 +468,10 @@ function _M.startBattleHRpc(agent, data) | ||
462 | curTeam.heros = team.heros | 468 | curTeam.heros = team.heros |
463 | curTeam.leader = team.leader | 469 | curTeam.leader = team.leader |
464 | curTeam.supports = supports | 470 | curTeam.supports = supports |
471 | + if team.tactics and globalCsv.tactics_skill_passive_cell[team.tactics] then | ||
472 | + curTeam.tactics = team.tactics | ||
473 | + end | ||
474 | + | ||
465 | 475 | ||
466 | table.insert(pvpTH, curTeam) | 476 | table.insert(pvpTH, curTeam) |
467 | end | 477 | end |
src/actions/RoleAction.lua
@@ -291,7 +291,7 @@ function _M.loginRpc( agent, data ) | @@ -291,7 +291,7 @@ function _M.loginRpc( agent, data ) | ||
291 | 291 | ||
292 | 292 | ||
293 | -- 玩家登陆做的一些操作 | 293 | -- 玩家登陆做的一些操作 |
294 | - role:saveHangTeam() | 294 | + role:updateHangTeamInfo() |
295 | role:savePvpCTeam() | 295 | role:savePvpCTeam() |
296 | role:savePvpHTeam() | 296 | role:savePvpHTeam() |
297 | 297 |
src/actions/TowerAction.lua
@@ -8,36 +8,6 @@ local MsgPack = MsgPack | @@ -8,36 +8,6 @@ local MsgPack = MsgPack | ||
8 | local _M = {} | 8 | local _M = {} |
9 | 9 | ||
10 | 10 | ||
11 | -function _M.roleFormatRpc(agent , data) | ||
12 | - local role = agent.role | ||
13 | - local msg = MsgPack.unpack(data) | ||
14 | - local towerTeam = role:getProperty("towerF") | ||
15 | - for slot, heroId in pairs(msg.heros) do | ||
16 | - if not role.heros[heroId] then | ||
17 | - return | ||
18 | - end | ||
19 | - end | ||
20 | - local supports = {} | ||
21 | - for slot, support in pairs(msg.supports) do | ||
22 | - if slot ~= 1 and slot ~= 2 then return end | ||
23 | - local level = role.dinerData:getProperty("dishTree"):getv(support, 0) | ||
24 | - if level <= 0 then return end | ||
25 | - supports[slot] = support | ||
26 | - end | ||
27 | - table.clear(towerTeam) | ||
28 | - towerTeam.heros = {} | ||
29 | - for slot, heroId in pairs(msg.heros) do | ||
30 | - towerTeam.heros[slot] = heroId | ||
31 | - end | ||
32 | - towerTeam.leader = msg.leader | ||
33 | - towerTeam.supports = supports | ||
34 | - | ||
35 | - | ||
36 | - role:updateProperty({field = "towerF", value = towerTeam}) | ||
37 | - SendPacket(actionCodes.Tower_roleFormatRpc, '') | ||
38 | - return true | ||
39 | -end | ||
40 | - | ||
41 | 11 | ||
42 | local function getUpdateTime(lastCount, lastTime) | 12 | local function getUpdateTime(lastCount, lastTime) |
43 | local nextCount, nextTime = lastCount, skynet.timex() | 13 | local nextCount, nextTime = lastCount, skynet.timex() |
src/models/Role.lua
@@ -103,7 +103,6 @@ Role.schema = { | @@ -103,7 +103,6 @@ Role.schema = { | ||
103 | --挂机相关 | 103 | --挂机相关 |
104 | hangPass = {"table", {}}, -- 挂机通过的最大关卡 | 104 | hangPass = {"table", {}}, -- 挂机通过的最大关卡 |
105 | hangGift = {"table", {}}, -- 挂机奖励 {id = 1} | 105 | hangGift = {"table", {}}, -- 挂机奖励 {id = 1} |
106 | - hangTeam = {"table", {}}, -- 挂机队伍 | ||
107 | hangTS = {"table", {}}, -- 挂机队伍他人可读的队伍信息 | 106 | hangTS = {"table", {}}, -- 挂机队伍他人可读的队伍信息 |
108 | hangTB = {"table", {}}, -- 挂机队伍他人可用的战斗信息mao | 107 | hangTB = {"table", {}}, -- 挂机队伍他人可用的战斗信息mao |
109 | hangTBV = {"number", 0}, -- 挂机队伍他人可用的战斗力 | 108 | hangTBV = {"number", 0}, -- 挂机队伍他人可用的战斗力 |
@@ -111,7 +110,6 @@ Role.schema = { | @@ -111,7 +110,6 @@ Role.schema = { | ||
111 | hangInfo = {"table", {}}, -- 当前挂机信息 | 110 | hangInfo = {"table", {}}, -- 当前挂机信息 |
112 | hangBag = {"table", {}}, -- 背包 | 111 | hangBag = {"table", {}}, -- 背包 |
113 | hangBagLimit = {"number", globalCsv.idle_field_origin}, --背包上限 | 112 | hangBagLimit = {"number", globalCsv.idle_field_origin}, --背包上限 |
114 | - bTeam = {"table", {}}, -- 奖励副本队伍 | ||
115 | hangTeams = {"table", {}}, -- pve自选编队 | 113 | hangTeams = {"table", {}}, -- pve自选编队 |
116 | teamIndex = {"table", {}}, -- 各个系统使用的编队索引 type->index 见TeamSystemType | 114 | teamIndex = {"table", {}}, -- 各个系统使用的编队索引 type->index 见TeamSystemType |
117 | advTeams = {"table", {}}, -- 拾荒自选编队 | 115 | advTeams = {"table", {}}, -- 拾荒自选编队 |
@@ -145,7 +143,6 @@ Role.schema = { | @@ -145,7 +143,6 @@ Role.schema = { | ||
145 | boxL = {"table", {}}, -- boxList 正开启的箱子 -- {[1] = {id = 1010, gem = 101, time = 1313}} | 143 | boxL = {"table", {}}, -- boxList 正开启的箱子 -- {[1] = {id = 1010, gem = 101, time = 1313}} |
146 | 144 | ||
147 | towerInfo = {"table", {c = globalCsv.tower_count_limit, l = 1}}, -- 当天爬塔消耗的次数 -- {t = time, c = count, l = layer, k = battleKey} | 145 | towerInfo = {"table", {c = globalCsv.tower_count_limit, l = 1}}, -- 当天爬塔消耗的次数 -- {t = time, c = count, l = layer, k = battleKey} |
148 | - towerF = {"table", {}}, -- 爬塔阵容 | ||
149 | 146 | ||
150 | spTask = {"table", {}}, -- 特殊任务 -- {id = status} | 147 | spTask = {"table", {}}, -- 特殊任务 -- {id = status} |
151 | 148 | ||
@@ -357,11 +354,9 @@ function Role:data() | @@ -357,11 +354,9 @@ function Role:data() | ||
357 | 354 | ||
358 | hangPass = self:getProperty("hangPass"), | 355 | hangPass = self:getProperty("hangPass"), |
359 | hangGift = self:getProperty("hangGift"), | 356 | hangGift = self:getProperty("hangGift"), |
360 | - hangTeam = self:getProperty("hangTeam"), | ||
361 | hangInfo = self:getProperty("hangInfo"), | 357 | hangInfo = self:getProperty("hangInfo"), |
362 | hangBag = self:getProperty("hangBag"), | 358 | hangBag = self:getProperty("hangBag"), |
363 | hangBagLimit = self:getProperty("hangBagLimit"), | 359 | hangBagLimit = self:getProperty("hangBagLimit"), |
364 | - bTeam = self:getProperty("bTeam"), | ||
365 | hangTeams = self:getProperty("hangTeams"), | 360 | hangTeams = self:getProperty("hangTeams"), |
366 | teamIndex = self:getProperty("teamIndex"), | 361 | teamIndex = self:getProperty("teamIndex"), |
367 | advTeams = self:getProperty("advTeams"), | 362 | advTeams = self:getProperty("advTeams"), |
@@ -380,7 +375,6 @@ function Role:data() | @@ -380,7 +375,6 @@ function Role:data() | ||
380 | equips = self:getProperty("equips"), | 375 | equips = self:getProperty("equips"), |
381 | boxL = self:getProperty("boxL"), | 376 | boxL = self:getProperty("boxL"), |
382 | towerInfo = self:getProperty("towerInfo"), | 377 | towerInfo = self:getProperty("towerInfo"), |
383 | - towerF = self:getProperty("towerF"), | ||
384 | spTask = self:getProperty("spTask"), | 378 | spTask = self:getProperty("spTask"), |
385 | dTask = self:getProperty("dTask"), | 379 | dTask = self:getProperty("dTask"), |
386 | wTask = self:getProperty("wTask"), | 380 | wTask = self:getProperty("wTask"), |
src/models/RoleBattle.lua
@@ -57,7 +57,6 @@ function Role:checkBattle(battleType, params) | @@ -57,7 +57,6 @@ function Role:checkBattle(battleType, params) | ||
57 | end | 57 | end |
58 | end, | 58 | end, |
59 | tower = function() | 59 | tower = function() |
60 | - --local towerF = self:getProperty("towerF") | ||
61 | local towerF = self:getTeamFormatByType(TeamSystemType.Tower) | 60 | local towerF = self:getTeamFormatByType(TeamSystemType.Tower) |
62 | for slot, hero in pairs(self:getTeamHerosInfo(towerF.heros)) do | 61 | for slot, hero in pairs(self:getTeamHerosInfo(towerF.heros)) do |
63 | selflist[slot] = hero.type | 62 | selflist[slot] = hero.type |
@@ -73,7 +72,6 @@ function Role:checkBattle(battleType, params) | @@ -73,7 +72,6 @@ function Role:checkBattle(battleType, params) | ||
73 | end | 72 | end |
74 | end, | 73 | end, |
75 | bonus = function() | 74 | bonus = function() |
76 | - --local bTeam = self:getProperty("bTeam") | ||
77 | local bTeam = self:getTeamFormatByType(TeamSystemType.BonusBattle) | 75 | local bTeam = self:getTeamFormatByType(TeamSystemType.BonusBattle) |
78 | for slot, hero in pairs(self:getTeamHerosInfo(bTeam.heros)) do | 76 | for slot, hero in pairs(self:getTeamHerosInfo(bTeam.heros)) do |
79 | selflist[slot] = hero.type | 77 | selflist[slot] = hero.type |
src/models/RolePlugin.lua
@@ -1135,7 +1135,6 @@ function RolePlugin.bind(Role) | @@ -1135,7 +1135,6 @@ function RolePlugin.bind(Role) | ||
1135 | local now = skynet.timex() | 1135 | local now = skynet.timex() |
1136 | local ct = math.ceil((now - StdTowerRankTime) / 86400) --按天计算 365 * 27 < 10000 可以维持 27 年 | 1136 | local ct = math.ceil((now - StdTowerRankTime) / 86400) --按天计算 365 * 27 < 10000 可以维持 27 年 |
1137 | local ct = 10000 - ct -- 越早的排名越靠前 | 1137 | local ct = 10000 - ct -- 越早的排名越靠前 |
1138 | - --local towerTeam = self:getProperty("towerF") | ||
1139 | local towerTeam = self:getTeamFormatByType(TeamSystemType.Tower) | 1138 | local towerTeam = self:getTeamFormatByType(TeamSystemType.Tower) |
1140 | local battleV = self:getTeamBattleValue(towerTeam.heros) | 1139 | local battleV = self:getTeamBattleValue(towerTeam.heros) |
1141 | local score = (level * 10000 + ct) * 10000000 + battleV | 1140 | local score = (level * 10000 + ct) * 10000000 + battleV |
@@ -1289,6 +1288,7 @@ function RolePlugin.bind(Role) | @@ -1289,6 +1288,7 @@ function RolePlugin.bind(Role) | ||
1289 | for slot, id in pairs(team.supports or {}) do | 1288 | for slot, id in pairs(team.supports or {}) do |
1290 | teamInfo.supports[slot] = {id, self.dinerData:getProperty("dishTree"):getv(id, 0)} | 1289 | teamInfo.supports[slot] = {id, self.dinerData:getProperty("dishTree"):getv(id, 0)} |
1291 | end | 1290 | end |
1291 | + teamInfo.tactics = globalCsv.tactics_skill_passive_cell[team.tactics] and team.tactics or nil | ||
1292 | return teamInfo | 1292 | return teamInfo |
1293 | end | 1293 | end |
1294 | 1294 | ||
@@ -1315,20 +1315,6 @@ function RolePlugin.bind(Role) | @@ -1315,20 +1315,6 @@ function RolePlugin.bind(Role) | ||
1315 | return self:getRealBattleValue(heros) | 1315 | return self:getRealBattleValue(heros) |
1316 | end | 1316 | end |
1317 | 1317 | ||
1318 | - -- 不传参数 只修改保存的阵容信息 | ||
1319 | - function Role:saveHangTeam(team) | ||
1320 | - if not team then | ||
1321 | - team = self:getProperty("hangTeam") | ||
1322 | - else | ||
1323 | - self:updateProperty({field = "hangTeam", value = team}) | ||
1324 | - end | ||
1325 | - self:setProperties({ | ||
1326 | - hangTS = self:getTeamHerosInfo(team.heros), | ||
1327 | - hangTB = self:getTeamBattleInfo(team), | ||
1328 | - hangTBV = self:getTeamBattleValue(team.heros), | ||
1329 | - }) | ||
1330 | - end | ||
1331 | - | ||
1332 | function Role:updateHangTeamInfo() | 1318 | function Role:updateHangTeamInfo() |
1333 | local team = self:getTeamFormatByType(TeamSystemType.Hang) | 1319 | local team = self:getTeamFormatByType(TeamSystemType.Hang) |
1334 | if not team then return end | 1320 | if not team then return end |