d4e9b817
zhouhaihai
战斗 日志
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
local RoleBattle = {}
--[[
100 剧情关卡类
200 非剧情类普通关卡
300 每日任务类、日常本类
400 资源获取类关卡
500 PVP关卡
1000 活动期间限定类关卡
2000 其他
]]
local BattleType = {
|
ca55c763
chenyueqi
引导招募必送思露德判定出了大问题
|
14
15
16
17
18
|
hang = 100,
tower = 200,
bonus = 300,
pvpc = 500,
pvph = 501,
|
66fe093a
liuzujun
元旦关卡活动
|
19
|
act_battle = 502,
|
d4e9b817
zhouhaihai
战斗 日志
|
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
}
RoleBattle.bind = function (Role)
-- TODO 检查战斗是否作弊
local function checkBattleCheat()
end
function Role:checkBattle(battleType, params)
local clientInfo = params.info or {}
if not BattleType[battleType] then
print(string.format("NO find battleType: %s", battleType))
return
end
local selflist = {}
local heroscore = 0
local teamskill = {}
local enemylist = {}
local fixData = {
hang = function()
|
c8235ab8
zhouhaihai
battle Bug
|
47
|
for slot, hero in pairs(self:getProperty("hangTS").heros) do
|
d4e9b817
zhouhaihai
战斗 日志
|
48
49
50
51
52
53
54
55
56
57
58
59
60
|
selflist[slot] = hero.type
end
heroscore = self:getProperty("hangTBV")
for slot , one in pairs(self:getProperty("hangTB").supports) do
teamskill[one[1]] = one[2]
end
local carbonData = csvdb["idle_battleCsv"][params.id]
local monsterData = csvdb[carbonData.monster:match("/([^/]*)$") .. "Csv"]
for slot, one in pairs(monsterData[1]) do
enemylist[#enemylist + 1] = one["unitType"]
end
end,
tower = function()
|
98d32f92
liuzujun
多编队
|
61
|
local towerF = self:getTeamFormatByType(TeamSystemType.Tower)
|
821e2704
zhouhaihai
heros 增加 supports
|
62
|
for slot, hero in pairs(self:getTeamHerosInfo(towerF).heros) do
|
d4e9b817
zhouhaihai
战斗 日志
|
63
64
65
66
67
68
69
70
71
72
73
74
75
|
selflist[slot] = hero.type
end
heroscore = self:getTeamBattleValue(towerF.heros)
for slot , one in pairs(self:getTeamBattleInfo(towerF).supports) do
teamskill[one[1]] = one[2]
end
local carbonData = csvdb["tower_battleCsv"][params.id]
local monsterData = csvdb[carbonData.monster:match("/([^/]*)$") .. "Csv"]
for slot, one in pairs(monsterData[1]) do
enemylist[#enemylist + 1] = one["unitType"]
end
end,
bonus = function()
|
98d32f92
liuzujun
多编队
|
76
|
local bTeam = self:getTeamFormatByType(TeamSystemType.BonusBattle)
|
821e2704
zhouhaihai
heros 增加 supports
|
77
|
for slot, hero in pairs(self:getTeamHerosInfo(bTeam).heros) do
|
d4e9b817
zhouhaihai
战斗 日志
|
78
79
80
81
82
83
|
selflist[slot] = hero.type
end
heroscore = self:getTeamBattleValue(bTeam.heros)
for slot , one in pairs(self:getTeamBattleInfo(bTeam).supports) do
teamskill[one[1]] = one[2]
end
|
b8c1be12
zhouhaihai
一些 bug
|
84
|
local carbonData = csvdb["bonus_battleCsv"][params.id]
|
d4e9b817
zhouhaihai
战斗 日志
|
85
86
87
88
89
|
local monsterData = csvdb[carbonData.monster:match("/([^/]*)$") .. "Csv"]
for slot, one in pairs(monsterData[1]) do
enemylist[#enemylist + 1] = one["unitType"]
end
end,
|
66fe093a
liuzujun
元旦关卡活动
|
90
|
act_battle = function()
|
821e2704
zhouhaihai
heros 增加 supports
|
91
|
for slot, hero in pairs(self:getTeamHerosInfo(params).heros) do
|
66fe093a
liuzujun
元旦关卡活动
|
92
93
94
95
96
97
98
99
100
101
102
103
|
selflist[slot] = hero.type
end
heroscore = self:getTeamBattleValue(params.heros)
for slot , one in pairs(params.supports) do
teamskill[one[1]] = one[2]
end
local carbonData = params.cfg
local monsterData = csvdb[carbonData.monster:match("/([^/]*)$") .. "Csv"]
for slot, one in pairs(monsterData[1]) do
enemylist[#enemylist + 1] = one["unitType"]
end
end,
|
d4e9b817
zhouhaihai
战斗 日志
|
104
|
pvpc = function()
|
55c7c172
zhouhaihai
奖励副本 新机制
|
105
|
for slot, hero in pairs(self:getProperty("pvpTSC").heros) do
|
d4e9b817
zhouhaihai
战斗 日志
|
106
107
108
109
110
111
112
113
114
|
selflist[slot] = hero.type
end
heroscore = self:getProperty("pvpTBVC")
for slot , one in pairs(self:getProperty("pvpTBC").supports) do
teamskill[one[1]] = one[2]
end
if params.robotId then
local carbonData = csvdb["pvp_robotCsv"][params.robotId]
local monsterData = csvdb[carbonData.monster:match("/([^/]*)$") .. "Csv"]
|
b8c1be12
zhouhaihai
一些 bug
|
115
|
for slot, one in pairs(monsterData) do
|
d4e9b817
zhouhaihai
战斗 日志
|
116
117
118
119
120
121
122
123
124
125
126
|
enemylist[#enemylist + 1] = one["unitType"]
end
else
for slot, one in pairs((params.enemy or {})["heros"] or {}) do
enemylist[slot] = one["type"]
end
end
end,
pvph = function()
for idx, team in pairs(self:getProperty("pvpTSH")) do
selflist[idx] = selflist[idx] or {}
|
55c7c172
zhouhaihai
奖励副本 新机制
|
127
|
for slot, hero in pairs(team.heros) do
|
d4e9b817
zhouhaihai
战斗 日志
|
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
selflist[idx][slot] = hero.type
end
end
for _, one in pairs(self:getProperty("pvpTBVH")) do
heroscore = heroscore + one
end
for idx, team in pairs(self:getProperty("pvpTBH")) do
for slot , one in pairs(team.supports) do
teamskill[one[1]] = one[2]
end
end
if params.robotId then
local carbonData = csvdb["pvp_robot_groupCsv"][params.robotId]
for idx = 1, 3 do
enemylist[idx] = enemylist[idx] or {}
local monsterData = csvdb[carbonData["monster" .. idx]:match("/([^/]*)$") .. "Csv"]
|
b8c1be12
zhouhaihai
一些 bug
|
145
|
for slot, one in pairs(monsterData) do
|
d4e9b817
zhouhaihai
战斗 日志
|
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
enemylist[idx][#enemylist + 1] = one["unitType"]
end
end
else
for idx, team in pairs(params.enemy or {}) do
enemylist[idx] = enemylist[idx] or {}
for slot, one in pairs(team["heros"] or {}) do
enemylist[idx][slot] = one["type"]
end
end
end
end
}
if fixData[battleType] then
fixData[battleType]()
end
-- robotId = match.t == 2 and match.id or nil,
-- enemy = match.t == 1 and (revenge and _pvpRecordBattleInfoCacheH[match.id] or _pvpBattleInfoCacheH[match.id]) or nil,
-- score = myScore,
-- reward = reward,
self:log("mission", {
mission_threadid = battleType == "hang" and math.floor((params.id % 100) / 100) or 0, -- 大关卡ID
mission_id = params.id or 0, -- 关卡ID
mission_type = BattleType[battleType], -- 关卡类型,见关卡类型枚举表
mission_herolist = selflist, -- 英雄ID,排序以玩家出战设置为准,PVP多个队伍则记录多个列表。示例:[[1,2,3],[456]]
mission_heroscore = heroscore, -- 编队总评分
mission_enemylist = enemylist, -- 地方英雄ID,排序以玩家出战设置为准,PVP多个队伍则记录多个列表。示例:[[1,2,3],[456]]
mission_damage = clientInfo.damage or {}, -- 英雄输出值。示例:{'heroid1':1000,'heroid2':2000,………..}
mission_ultskill = clientInfo.ultskill or {}, -- 大招使用情况。示例:{'heroid1':1000,'heroid2':2000,………..}
mission_reward = params.reward or {}, -- 获得奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
mission_starttime = clientInfo.start or 0, -- 战斗开始时间,格式 unixtime 秒级
mission_roundtime = clientInfo.atime or 0, -- 对局时长(秒)
mission_result = params.isWin and 1 or 2, -- 战斗结果(0-无效,1-胜利,2-失败)
|
66fe093a
liuzujun
元旦关卡活动
|
181
|
mission_star = params.star or 0, -- 战斗完成星数,无星级的话填写0
|
d4e9b817
zhouhaihai
战斗 日志
|
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
|
mission_restriction = 0, -- 周期内参与限制(0表示没有上限)
mission_difficulty = 0, -- 关卡困难度,无难度区分的话填写0
mission_strength = 1, -- 消耗的体力或次数
mission_score = params.score or 0, -- 本局分数,PVP玩法记录为对战后积分,无得分的填0
mission_cleartype = 1, -- 1正常通关;2代理拾荒
mission_rank = params.rank, -- 对战后排名,适用于PVP玩法和电波塔,其他玩法留空
misson_monsterkill = clientInfo.kill or {}, -- 击杀怪物ID和数量,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
misson_teamskill = teamskill, -- 编队支援技能和技能等级情况,json格式记录,{"teamskill1":1,"teamskill2":2,………..}
})
end
|
4cf5dec9
zhouhaihai
battle bug
|
197
198
199
200
|
end
return RoleBattle
|