Add scripts

This commit is contained in:
tamilpp25 2022-12-26 14:06:01 +05:30
parent ca33d3ba39
commit 9bbd7f15cc
3127 changed files with 495695 additions and 1 deletions

View file

@ -3,6 +3,7 @@
- Client
- Share
- Scripts
- Sha1
## Known Issue
@ -12,4 +13,8 @@ Share\Fight\Map\Info\Scene01102\PathArea
Share\Fight\Map\Info\Scene01103\PathArea
Share\Fight\Map\Info\Scene01207\PathArea
Share\Fight\Map\Info\Scene01306\PathArea
```
```
## Dump progress
Lua Scripts : dumped **3126/4096** with success rate **76%** \
Data : dumped **3513/4095** with success rate **85%**

View file

@ -0,0 +1,34 @@
XLuaBehaviorAgent = XClass(nil, "XLuaBehaviorAgent")
function XLuaBehaviorAgent:Ctor(agentName, agentProxy)
self.Name = agentName
self.AgentProxy = agentProxy
self.Agent = agentProxy.BTAgent
end
function XLuaBehaviorAgent:OnAwake()
end
function XLuaBehaviorAgent:OnStart()
end
function XLuaBehaviorAgent:OnEnable()
end
function XLuaBehaviorAgent:OnDisable()
end
function XLuaBehaviorAgent:OnDestroy()
end
function XLuaBehaviorAgent:OnUpdate()
end
function XLuaBehaviorAgent:OnNotify()
end
function XLuaBehaviorAgent:OnGetEvents()
end

View file

@ -0,0 +1,61 @@
CsXBehaviorManager = CS.BehaviorTree.XBehaviorTreeManager
CsNodeStatus = CS.BehaviorTree.XNodeStatus
CsBehaviorNodeType = CS.BehaviorTree.XBehaviorNodeType
XLuaBehaviorManager = {}
local NodeClassType = {}
local AgentClassType = {}
--注册行为节点
function XLuaBehaviorManager.RegisterNode(super, classType, nodeType, islua, needUpdate)
super = XLuaBehaviorNode or super
CsXBehaviorManager.Instance:RegisterLuaNodeProxy(classType, nodeType, islua, needUpdate)
local behaviorNode = XClass(super, classType)
NodeClassType[classType] = behaviorNode
return behaviorNode
end
--创建行为节点实例
function XLuaBehaviorManager.NewLuaNodeProxy(className, nodeProxy)
local baseName = className
local class = NodeClassType[baseName]
if not class then
class = NodeClassType[baseName]
if not class then
XLog.Error("XLuaBehaviorManager.NewLuaNodeProxy error, class not exist, name: " .. className)
return nil
end
end
local obj = class.New(className, nodeProxy)
return obj
end
--注册行为主体
function XLuaBehaviorManager.RegisterAgent(super, classType)
super = XLuaBehaviorAgent or super
CsXBehaviorManager.Instance:RegisterLuaAgentProxy(classType)
local behaviorNode = XClass(super, classType)
AgentClassType[classType] = behaviorNode
return behaviorNode
end
--创建行为主体实例
function XLuaBehaviorManager.NewLuaAgentProxy(className, agentProxy)
local baseName = className
local class = AgentClassType[baseName]
if not class then
class = AgentClassType[baseName]
if not class then
XLog.Error("XLuaBehaviorManager.NewLuaAgentProxy error, class not exist, name: " .. className)
return nil
end
end
local obj = class.New(className, agentProxy)
return obj
end
function XLuaBehaviorManager.PlayId(id, agent)
agent:PlayBehavior(id)
end

View file

@ -0,0 +1,89 @@
XLuaBehaviorNode = XClass(nil, "XLuaBehaviorNode")
function XLuaBehaviorNode:Ctor(className, nodeProxy)
self.Name = className
self.NodeProxy = nodeProxy
self.Node = nodeProxy.Node
self.BehaviorTree = nodeProxy.Node.BTree
self:InitNodeData()
end
--初始化数据
function XLuaBehaviorNode:InitNodeData()
if not self.Node.Fields then
self.Fields = nil
return
end
self.Fields = {}
local fields = self.Node.Fields.Fields
for _, v in pairs(fields) do
self.Fields[v.FieldName] = v.Value
end
end
function XLuaBehaviorNode:OnAwake()
end
function XLuaBehaviorNode:SetAgent()
self.Agent = self.BehaviorTree.BTAgent
self.Proxy = self.Agent.Proxy
self.AgentProxy = self.Agent.Proxy.LuaAgentProxy
self:OnStart()
end
function XLuaBehaviorNode:OnEnable()
end
function XLuaBehaviorNode:OnStart()
end
function XLuaBehaviorNode:OnRecycle()
self.Agent = nil
self.Proxy = nil
self.AgentProxy = nil
end
function XLuaBehaviorNode:OnDisable()
end
function XLuaBehaviorNode:OnEnter()
end
function XLuaBehaviorNode:OnExit()
end
function XLuaBehaviorNode:OnReset()
end
function XLuaBehaviorNode:OnDestroy()
end
function XLuaBehaviorNode:OnUpdate(dt)
end
function XLuaBehaviorNode:OnFixedUpdate(dt)
end
function XLuaBehaviorNode:OnNotify(evt, ...)
end
function XLuaBehaviorNode:OnGetEvents()
end

View file

@ -0,0 +1,8 @@
fix = CS.Mathematics.fix
fix.zero = CS.Mathematics.fix.zero
fix.hundred = CS.Mathematics.fix.hundred
fix.thousand = CS.Mathematics.fix.thousand
fix.deg2rad = CS.Mathematics.fix.deg2rad
FixParse = CS.FixExtension.Parse
FixToInt = CS.FixExtension.FixToInt
FixToDouble = CS.FixExtension.FixToDouble

View file

@ -0,0 +1,397 @@
--
-- json.lua
--
-- Copyright (c) 2019 rxi
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy of
-- this software and associated documentation files (the "Software"), to deal in
-- the Software without restriction, including without limitation the rights to
-- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-- of the Software, and to permit persons to whom the Software is furnished to do
-- so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
--
local json = { _version = "0.1.2" }
-------------------------------------------------------------------------------
-- Encode
-------------------------------------------------------------------------------
local encode
local escape_char_map = {
["\\"] = "\\\\",
["\""] = "\\\"",
["\b"] = "\\b",
["\f"] = "\\f",
["\n"] = "\\n",
["\r"] = "\\r",
["\t"] = "\\t",
}
local escape_char_map_inv = {["\\/"] = "/" }
for k, v in pairs(escape_char_map) do
escape_char_map_inv[v] = k
end
local function escape_char(c)
return escape_char_map[c] or string.format("\\u%04x", c:byte())
end
local function encode_nil()
return "null"
end
local function encode_table(val, stack)
local res = {}
stack = stack or {}
-- Circular reference?
if stack[val] then error("circular reference") end
stack[val] = true
if rawget(val, 1) ~= nil or next(val) == nil then
-- Treat as array -- check keys are valid and it is not sparse
local n = 0
for k in pairs(val) do
if type(k) ~= "number" then
error("invalid table: mixed or invalid key types")
end
n = n + 1
end
if n ~= #val then
error("invalid table: sparse array")
end
-- Encode
for _, v in ipairs(val) do
table.insert(res, encode(v, stack))
end
stack[val] = nil
return "[" .. table.concat(res, ",") .. "]"
else
-- Treat as an object
for k, v in pairs(val) do
if type(k) ~= "string" then
error("invalid table: mixed or invalid key types")
end
table.insert(res, encode(k, stack) .. ":" .. encode(v, stack))
end
stack[val] = nil
return "{" .. table.concat(res, ",") .. "}"
end
end
local function encode_string(val)
return '"' .. val:gsub('[%z\1-\31\\"]', escape_char) .. '"'
end
local function encode_number(val)
-- Check for NaN, -inf and inf
if val ~= val or val <= -math.huge or val >= math.huge then
error("unexpected number value '" .. tostring(val) .. "'")
end
return string.format("%.14g", val)
end
local type_func_map = {
["nil" ] = encode_nil,
["table"] = encode_table,
["string"] = encode_string,
["number"] = encode_number,
["boolean"] = tostring,
}
encode = function(val, stack)
local t = type(val)
local f = type_func_map[t]
if f then
return f(val, stack)
end
error("unexpected type '" .. t .. "'")
end
function json.encode(val)
return (encode(val))
end
-------------------------------------------------------------------------------
-- Decode
-------------------------------------------------------------------------------
local parse
local function create_set(...)
local res = {}
for i = 1, select("#", ...) do
res[select(i, ...)] = true
end
return res
end
local space_chars = create_set(" ", "\t", "\r", "\n")
local delim_chars = create_set(" ", "\t", "\r", "\n", "]", "}", ",")
local escape_chars = create_set("\\", "/", '"', "b", "f", "n", "r", "t", "u")
local literals = create_set("true", "false", "null")
local literal_map = {
["true"] = true,
["false"] = false,
["null"] = nil,
}
local function next_char(str, idx, set, negate)
for i = idx, #str do
if set[str:sub(i, i)] ~= negate then
return i
end
end
return #str + 1
end
local function decode_error(str, idx, msg)
local line_count = 1
local col_count = 1
for i = 1, idx - 1 do
col_count = col_count + 1
if str:sub(i, i) == "\n" then
line_count = line_count + 1
col_count = 1
end
end
error(string.format("%s at line %d col %d", msg, line_count, col_count))
end
local function codepoint_to_utf8(n)
-- http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=iws-appendixa
local f = math.floor
if n <= 0x7f then
return string.char(n)
elseif n <= 0x7ff then
return string.char(f(n / 64) + 192, n % 64 + 128)
elseif n <= 0xffff then
return string.char(f(n / 4096) + 224, f(n % 4096 / 64) + 128, n % 64 + 128)
elseif n <= 0x10ffff then
return string.char(f(n / 262144) + 240, f(n % 262144 / 4096) + 128,
f(n % 4096 / 64) + 128, n % 64 + 128)
end
error(string.format("invalid unicode codepoint '%x'", n))
end
local function parse_unicode_escape(s)
local n1 = tonumber(s:sub(3, 6), 16)
local n2 = tonumber(s:sub(9, 12), 16)
-- Surrogate pair?
if n2 then
return codepoint_to_utf8((n1 - 0xd800) * 0x400 + (n2 - 0xdc00) + 0x10000)
else
return codepoint_to_utf8(n1)
end
end
local function parse_string(str, i)
local has_unicode_escape = false
local has_surrogate_escape = false
local has_escape = false
local last
for j = i + 1, #str do
local x = str:byte(j)
if x < 32 then
decode_error(str, j, "control character in string")
end
if last == 92 then -- "\\" (escape char)
if x == 117 then -- "u" (unicode escape sequence)
local hex = str:sub(j + 1, j + 5)
if not hex:find("%x%x%x%x") then
decode_error(str, j, "invalid unicode escape in string")
end
if hex:find("^[dD][89aAbB]") then
has_surrogate_escape = true
else
has_unicode_escape = true
end
else
local c = string.char(x)
if not escape_chars[c] then
decode_error(str, j, "invalid escape char '" .. c .. "' in string")
end
has_escape = true
end
last = nil
elseif x == 34 then -- '"' (end of string)
local s = str:sub(i + 1, j - 1)
if has_surrogate_escape then
s = s:gsub("\\u[dD][89aAbB]..\\u....", parse_unicode_escape)
end
if has_unicode_escape then
s = s:gsub("\\u....", parse_unicode_escape)
end
if has_escape then
s = s:gsub("\\.", escape_char_map_inv)
end
return s, j + 1
else
last = x
end
end
decode_error(str, i, "expected closing quote for string")
end
local function parse_number(str, i)
local x = next_char(str, i, delim_chars)
local s = str:sub(i, x - 1)
local n = tonumber(s)
if not n then
decode_error(str, i, "invalid number '" .. s .. "'")
end
return n, x
end
local function parse_literal(str, i)
local x = next_char(str, i, delim_chars)
local word = str:sub(i, x - 1)
if not literals[word] then
decode_error(str, i, "invalid literal '" .. word .. "'")
end
return literal_map[word], x
end
local function parse_array(str, i)
local res = {}
local n = 1
i = i + 1
while 1 do
local x
i = next_char(str, i, space_chars, true)
-- Empty / end of array?
if str:sub(i, i) == "]" then
i = i + 1
break
end
-- Read token
x, i = parse(str, i)
res[n] = x
n = n + 1
-- Next token
i = next_char(str, i, space_chars, true)
local chr = str:sub(i, i)
i = i + 1
if chr == "]" then break end
if chr ~= "," then decode_error(str, i, "expected ']' or ','") end
end
return res, i
end
local function parse_object(str, i)
local res = {}
i = i + 1
while 1 do
local key, val
i = next_char(str, i, space_chars, true)
-- Empty / end of object?
if str:sub(i, i) == "}" then
i = i + 1
break
end
-- Read key
if str:sub(i, i) ~= '"' then
decode_error(str, i, "expected string for key")
end
key, i = parse(str, i)
-- Read ':' delimiter
i = next_char(str, i, space_chars, true)
if str:sub(i, i) ~= ":" then
decode_error(str, i, "expected ':' after key")
end
i = next_char(str, i + 1, space_chars, true)
-- Read value
val, i = parse(str, i)
-- Set
res[key] = val
-- Next token
i = next_char(str, i, space_chars, true)
local chr = str:sub(i, i)
i = i + 1
if chr == "}" then break end
if chr ~= "," then decode_error(str, i, "expected '}' or ','") end
end
return res, i
end
local char_func_map = {
['"'] = parse_string,
["0"] = parse_number,
["1"] = parse_number,
["2"] = parse_number,
["3"] = parse_number,
["4"] = parse_number,
["5"] = parse_number,
["6"] = parse_number,
["7"] = parse_number,
["8"] = parse_number,
["9"] = parse_number,
["-"] = parse_number,
["t"] = parse_literal,
["f"] = parse_literal,
["n"] = parse_literal,
["["] = parse_array,
["{"] = parse_object,
}
parse = function(str, idx)
local chr = str:sub(idx, idx)
local f = char_func_map[chr]
if f then
return f(str, idx)
end
decode_error(str, idx, "unexpected character '" .. chr .. "'")
end
function json.decode(str)
if type(str) ~= "string" then
error("expected argument of type string, got " .. type(str))
end
local res, idx = parse(str, next_char(str, 1, space_chars, true))
idx = next_char(str, idx, space_chars, true)
if idx <= #str then
decode_error(str, idx, "trailing garbage")
end
return res
end
return json

View file

@ -0,0 +1,35 @@
--==============================--
-- 通用数据收集事件
--==============================--
XAnalyticsEvent = XAnalyticsEvent or {}
local OnRoleCreate = function()
if XUserManager.Channel == XUserManager.CHANNEL.HERO then
XHeroSdkManager.CreateNewRole()
end
end
local OnLogin = function()
if XUserManager.Channel == XUserManager.CHANNEL.HERO then
XHeroSdkManager.EnterGame()
end
CS.BuglyAgent.SetUserId(tostring(XPlayer.Id))
end
local OnLevelUp = function()
if XUserManager.Channel == XUserManager.CHANNEL.HERO then
XHeroSdkManager.RoleLevelUp()
end
end
local OnLogout = function()
end
function XAnalyticsEvent.Init()
XEventManager.AddEventListener(XEventId.EVENT_NEW_PLAYER, OnRoleCreate)
XEventManager.AddEventListener(XEventId.EVENT_LOGIN_SUCCESS, OnLogin)
XEventManager.AddEventListener(XEventId.EVENT_PLAYER_LEVEL_CHANGE, OnLevelUp)
XEventManager.AddEventListener(XEventId.EVENT_USER_LOGOUT, OnLogout)
end

View file

@ -0,0 +1,171 @@
local rawget = rawget
local rawset = rawset
local getmetatable = getmetatable
local setmetatable = setmetatable
XBindTool = XBindTool or {}
local oldPairs = pairs
local pairs = function(arr)
local meta_t = getmetatable(arr)
if meta_t and meta_t.__pairs then
return meta_t.__pairs(arr)
end
return oldPairs(arr)
end
local function InitBind(obj)
if rawget(obj, "___isBinded") then return end
local store = {}
for key, _ in pairs(obj) do
local v = rawget(obj, key)
if v ~= nil then
store[key] = v
obj[key] = nil
end
end
local meta_t = getmetatable(obj)
if meta_t then setmetatable(store, meta_t) end
setmetatable(obj, {
__index = function(_, index)
local ret = rawget(obj, index)
if ret ~= nil then return ret end
return store[index]
end,
__newindex = function(_, index, v)
local event = rawget(obj, "___bind_event")
local old_v = store[index]
store[index] = v
if old_v ~= v then
if event and event[index] then
event[index].running = true
for key, func in pairs(event[index].callList) do
if not event[index].removeList[key] then
func(v, old_v)
end
end
event[index].running = nil
if next(event[index].removeList) then
for removeIndex, _ in pairs(event[index].removeList) do
event[index].callList[removeIndex] = nil
end
event[index].removeList = {}
end
end
end
end,
__pairs = function(_)
return oldPairs(store)
end
})
rawset(obj, "___isBinded", true)
rawset(obj, "___bind_store", store)
rawset(obj, "___bind_event", {})
rawset(obj, "___bind_id", 0)
end
function XBindTool.BindAttr(obj, attr, callback)
InitBind(obj)
local event = rawget(obj, "___bind_event")
local id = rawget(obj, "___bind_id")
event[attr] = event[attr] or { callList = {}, removeList = {} }
id = id + 1
rawset(obj, "___bind_id", id)
event[attr].callList[id] = callback
local value = obj[attr]
if value ~= nil then
callback(value)
end
return { obj = obj, attr = attr, id = id }
end
function XBindTool.GetBindInfo(val)
if type(val) ~= "table" then return val, false end
if not rawget(val, "___isBinded") then return val, false end
return rawget(val, "___bind_store"), true
end
function XBindTool.UnBind(handle)
local event = rawget(handle.obj, "___bind_event")
if event and event[handle.attr] then
if event[handle.attr].running then
event[handle.attr].removeList[handle.id] = true
else
event[handle.attr].callList[handle.id] = nil
end
end
end
function XBindTool.UnBindObj(obj)
local event = rawget(obj, "___bind_event")
if event then
for _, attrListener in pairs(event) do
if attrListener.running then
for key, _ in pairs(attrListener.callList) do
attrListener.removeList[key] = true
end
end
end
rawset(obj, "___bind_event", {})
end
end
local NodeBindInfoRecord = {}
function XBindTool.BindNode(node, obj, attr, func, unbindFunc)
if not NodeBindInfoRecord[node] then
NodeBindInfoRecord[node] = {}
end
local bindInfo = NodeBindInfoRecord[node]
bindInfo[obj] = bindInfo[obj] or { length = 0, record = {} }
local checkExist
if node.Exist then
checkExist = function() return node:Exist() end
else
local gameObject = node.GameObject or node.gameObject or node.Transform or node.transform
if gameObject and gameObject.Exist then
checkExist = function() return gameObject:Exist() end
end
end
local handle
if checkExist then
handle = XBindTool.BindAttr(obj, attr, function(...)
if not checkExist() then
XBindTool.UnBindNode(node)
if unbindFunc then
unbindFunc()
end
else
func(...)
end
end)
else
handle = XBindTool.BindAttr(obj, attr, func)
end
bindInfo[obj].record[handle.id] = handle
bindInfo[obj].length = bindInfo[obj].length + 1
return handle
end
function XBindTool.UnBindNode(node)
local bindInfo = NodeBindInfoRecord[node]
if bindInfo then
for key, val in pairs(bindInfo) do
for _, item in pairs(val.record) do
XBindTool.UnBind(item)
end
bindInfo[key] = nil
end
NodeBindInfoRecord[node] = nil
end
end

View file

@ -0,0 +1,111 @@
XCameraHelper = XCameraHelper or {}
function XCameraHelper.SetCameraTarget(cameraCtrl, targetTrans, distance)
if cameraCtrl and cameraCtrl:Exist() then
distance = distance or 0
cameraCtrl:SetLookAt(targetTrans, distance)
end
end
XCameraHelper.SCREEN_SHOT_WIDTH = 1920;
XCameraHelper.SCREEN_SHOT_HEIGHT = 1080;
XCameraHelper.DefaultRect = CS.UnityEngine.Rect(0, 0, XCameraHelper.SCREEN_SHOT_WIDTH, XCameraHelper.SCREEN_SHOT_HEIGHT);
XCameraHelper.ScreenRect = CS.UnityEngine.Rect(0, 0, CS.UnityEngine.Screen.width, CS.UnityEngine.Screen.height)
function XCameraHelper.ScreenShot(image, beginCb, cb)
if beginCb then
beginCb()
end
CS.XTool.WaitForEndOfFrame(function()
local screenShot = XCameraHelper.DoScreenShot(image)
if cb then
cb(screenShot)
end
end)
end
-- 截取屏幕画面到image中 (注意内存开销,需使用后及时释放)
-- image Image组件
-- cameraFar Camera组件
-- cameraNear Camera组件可选
function XCameraHelper.DoScreenShot(image)
if XTool.UObjIsNil(image) then
XLog.Error("ScreenShot image is nil")
return
end
-- if XTool.UObjIsNil(cameraFar) then
-- XLog.Error("ScreenShot cameraFar is nil")
-- return
-- end
local rect = XCameraHelper.ScreenRect
-- -- 创建一个rt对象
-- local rt = CS.UnityEngine.RenderTexture(rect.width, rect.height, 24)
-- rt.antiAliasing = 8
-- cameraFar.targetTexture = rt;
-- if not XTool.UObjIsNil(cameraNear) then
-- cameraNear.targetTexture = rt
-- end
-- cameraFar:Render();
-- if not XTool.UObjIsNil(cameraNear) then
-- cameraNear:Render()
-- end
-- local currentRT = CS.UnityEngine.RenderTexture.active
-- -- 激活rt 读取像素
-- CS.UnityEngine.RenderTexture.active = rt;
local screenShot = CS.UnityEngine.Texture2D(rect.width, rect.height, CS.UnityEngine.TextureFormat.RGB24, false);
screenShot:ReadPixels(rect, 0, 0);
screenShot:Apply();
-- 重置相关参数
-- cameraFar.targetTexture = nil;
-- if not XTool.UObjIsNil(cameraNear) then
-- cameraNear.targetTexture = nil;
-- end
-- CS.UnityEngine.RenderTexture.active = currentRT;
-- CS.UnityEngine.Object.Destroy(rt);
local sprite = CS.UnityEngine.Sprite.Create(screenShot, rect, CS.UnityEngine.Vector2.zero);
image.sprite = sprite
return screenShot
end
-- 调用该接口由ScreenCaptureWithCallBack回调函数传出的Texture用完后必须销毁
function XCameraHelper.ScreenShotNew(image, camera, cb, beginCb)
if not image then
XLog.Error("ScreenShot Call invalid parameter:image is nil")
return
end
if not camera then
XLog.Error("ScreenShot Call invalid parameter:camera is nil")
return
end
if not cb then
XLog.Error("The ScreenShot API Must Need CallBack")
return
end
-- if not XTool.UObjIsNil(image.mainTexture) and image.mainTexture.name ~= "UnityWhite" then -- 销毁texture2d (UnityWhite为默认的texture2d)
-- CS.UnityEngine.Object.Destroy(image.mainTexture)
-- end
if beginCb then
beginCb()
end
CS.XScreenCapture.ScreenCaptureWithCallBack(camera,function(texture)
local rect = CS.UnityEngine.Rect(0, 0, texture.width, texture.height)
local sprite = CS.UnityEngine.Sprite.Create(texture, rect, CS.UnityEngine.Vector2.zero);
image.sprite = sprite
if cb then
cb(texture)
end
end)
end

View file

@ -0,0 +1,81 @@
local getinfo = debug.getinfo
local type = type
local _class = {}
local _classNameDic = {}
function XClass(super, className)
local class
if XMain.IsEditorDebug then
local fullClassName = className .. getinfo(2, "S").source
class = _classNameDic[fullClassName]
if class then
return class
end
class = {}
_classNameDic[fullClassName] = class
else
class = {}
end
class.Ctor = false
class.Super = super
class.New = function(...)
local obj = {}
setmetatable(obj, { __index = _class[class] })
do
local create
create = function(c, ...)
if c.Super then
create(c.Super, ...)
end
if c.Ctor then
c.Ctor(obj, ...)
end
end
create(class, ...)
end
return obj
end
local vtbl = {}
_class[class] = vtbl
setmetatable(class, {
__newindex = function(_, k, v)
vtbl[k] = v
end,
__index = function(_, k)
return vtbl[k]
end
})
if super then
setmetatable(vtbl, {
__index = function(_, k)
local ret = _class[super][k]
vtbl[k] = ret
return ret
end
})
end
return class
end
function UpdateClassType(newClass, oldClass)
if "table" ~= type(newClass) then return end
if "table" ~= type(oldClass) then return end
if oldClass == newClass then return end
local new_vtbl = _class[newClass]
local old_vtbl = _class[oldClass]
if not new_vtbl or not old_vtbl then return end
_class[oldClass] = new_vtbl
_class[newClass] = nil
end

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,123 @@
XCountDown = XCountDown or {}
XCountDown.GTimerName = {
UrgentEvent = "UrgentEvent",
FubenInfestorExplore = "FubenInfestorExplore",
FubenInfestorExploreDaily = "FubenInfestorExploreDaily",
Stronghold = "Stronghold", --超级据点活动倒计时
KillZone = "KillZone", --杀戮无双活动倒计时
}
-- 倒计时存储容器
-- bindCnt : 当前倒计时的总数
-- record : 倒计时
-- record[name] : 通过倒计时命名来记录
-- record[name].remainTime : 剩余时间
-- record[name].lastTime : 最后一次绑定时间
-- record[name].bindCnt : 单个命名绑定的倒计时的个数
-- record[name].nodeList : 记录当前名字存下的节点
-- timeHandle : 处理事件
local TimerRecord = { bindCnt = 0, record = {}, timeHandle = nil }
local function UpdateTimerRecord()
local now = XTime.GetServerNowTimestamp()
for _, v in pairs(TimerRecord.record) do
if v.bindCnt > 0 and v.remainTime > 0 then
v.remainTime = v.remainTime - (now - v.lastTime)
v.lastTime = now
if v.remainTime < 0 then
v.remainTime = 0
end
end
end
end
function XCountDown.CreateTimer(name, remainTime, now)
if not TimerRecord.record[name] then
TimerRecord.record[name] = {
bindCnt = 0,
}
end
now = now or XTime.GetServerNowTimestamp()
TimerRecord.record[name].remainTime = remainTime
TimerRecord.record[name].lastTime = now
end
function XCountDown.RemoveTimer(name)
local record = TimerRecord.record[name]
if record then
TimerRecord.bindCnt = TimerRecord.bindCnt - record.bindCnt
XBindTool.UnBindObj(record)
TimerRecord.record[name] = nil
if TimerRecord.bindCnt == 0 and TimerRecord.timeHandle then
XScheduleManager.UnSchedule(TimerRecord.timeHandle)
TimerRecord.timeHandle = nil
end
end
end
function XCountDown.GetRemainTime(name)
local record = TimerRecord.record[name]
if record then
local now = XTime.GetServerNowTimestamp()
if record.bindCnt > 0 and record.remainTime > 0 then
record.remainTime = record.remainTime - (now - record.lastTime)
record.lastTime = now
if record.remainTime < 0 then
record.remainTime = 0
end
end
return record.remainTime
else
return 0
end
end
function XCountDown.BindTimer(node, name, cb)
local record = TimerRecord.record[name]
if record then
if not record.nodeList then
record.nodeList = {}
end
table.insert(record.nodeList, node)
if not TimerRecord.timeHandle then
TimerRecord.timeHandle = XScheduleManager.ScheduleForever(function()
UpdateTimerRecord()
end, XScheduleManager.SECOND, 0)
UpdateTimerRecord()
end
TimerRecord.bindCnt = TimerRecord.bindCnt + 1
record.bindCnt = record.bindCnt + 1
XBindTool.BindNode(node, record, "remainTime", cb, function()
TimerRecord.bindCnt = TimerRecord.bindCnt - 1
record.bindCnt = record.bindCnt - 1
if TimerRecord.bindCnt == 0 then
XScheduleManager.UnSchedule(TimerRecord.timeHandle)
TimerRecord.timeHandle = nil
end
end)
end
end
function XCountDown.UnBindTimer(curNode, name)
XBindTool.UnBindNode(curNode)
local record = TimerRecord.record[name]
if not record or not record.nodeList then
return
end
for i = 1, #record.nodeList do
if record.nodeList[i] == curNode then
TimerRecord.bindCnt = TimerRecord.bindCnt - 1
record.bindCnt = record.bindCnt - 1
if TimerRecord.bindCnt == 0 then
XScheduleManager.UnSchedule(TimerRecord.timeHandle)
TimerRecord.timeHandle = nil
end
table.remove(record.nodeList, i)
end
end
end

View file

@ -0,0 +1,268 @@
XDynamicList = XClass(nil, "XDynamicList")
DLDelegateEvent = {
DYNAMIC_GRID_TOUCHED = 5,
DYNAMIC_GRID_ATINDEX = 6,
DYNAMIC_GRID_RECYCLE = 7,
}
DLInsertDataDir = {
None = 0,
Head = 1,
Tail = 2,
}
DLScrollDataDir = {
None = 0,
Head = 1,
Tail = 2
}
function XDynamicList:DebugLog(...)
if self.showLog then
XLog.Error(...)
end
end
function XDynamicList:Ctor(ui)
self.GameObject = ui.gameObject
self.Transform = ui.transform
self.ItemCache = {}
self.showLog = false
self:ResetData()
self:InitView()
end
function XDynamicList:ResetData()--重置数据
self.Data = {}
self.curDataMaxIndex = 0--当前数据最大的索引
self.dataHeadIndex = -1 --当前数据头索引
self.dataTailIndex = -1--当前数据尾索引
self.NodeListData = {}
self.curShowHeadIndex = -1--当前展示的头索引
self.curShowTailIndex = -1--当前展示的尾索引
end
function XDynamicList:InitView()
self.DynamicList = self.Transform:GetComponent("XVerticalDynamicList")
self.DynamicListBar = self.DynamicList.verticalScrollbar
if self.DynamicList == nil then
XLog.Error("Not Find XVerticalDynamicList Component!")
return
end
self.DynamicList:SetViewSize(self.Transform:GetComponent("RectTransform").rect.size)
end
function XDynamicList:SetData(data, cb)--设置数据
self:DebugLog("------数据初始化----", data)
self:ResetData()
self.CallBack = cb
self.DynamicList.tableViewGridDelegate = function(evt, index, dir)
return self:GenerateItem(evt, dir, index)
end
self:FormatData(data)
end
function XDynamicList:FormatData(data)--格式化数据
if data == nil then
XLog.Error("------FormatData is error!------> data is nil! please check!")
return
end
self.dataHeadIndex = 1
self.dataTailIndex = #data
self.NodeListData = {}
for i = 1, self.dataTailIndex do
self.curDataMaxIndex = self.curDataMaxIndex + 1
local temp = {}
temp.data = data[i]
temp.index = self.curDataMaxIndex
temp.Pre = (i == 1) and -1 or self.curDataMaxIndex - 1
temp.Next = (i == #data) and -1 or self.curDataMaxIndex + 1
self.NodeListData[self.curDataMaxIndex] = temp
end
self:DebugLog("------FormatData------", self.NodeListData)
self:ReloadData()
end
function XDynamicList:ReloadData()
-- if #self.NodeListData <= 0 then
-- return
-- end
self.curShowTailIndex = -1
self.curShowHeadIndex = -1
self.DynamicList.TotalCount = #self.NodeListData
self.DynamicList:ReloadData(true)
self:DebugLog("------ReloadData------", self.NodeListData)
end
function XDynamicList:InsertData(insertData, dir, isReload)--插入数据
if #insertData == 0 then
XLog.Error("-----------insertData is null--------------")
return
end
local tempDataHeadIndex = self.dataHeadIndex
local tempDataTailIndex = self.dataTailIndex
for i = 1, #insertData do
self.curDataMaxIndex = self.curDataMaxIndex + 1
local temp = {}
temp.data = insertData[i]
temp.index = self.curDataMaxIndex
if dir == DLInsertDataDir.Head then
temp.Pre = (i == 1) and -1 or self.curDataMaxIndex - 1
if #self.NodeListData == 0 then
temp.Next = -1
else
temp.Next = (i == #insertData) and self.dataHeadIndex or self.curDataMaxIndex + 1
end
if i == 1 then
tempDataHeadIndex = self.curDataMaxIndex
end
if i == #insertData and #self.NodeListData > 0 then
self.NodeListData[self.dataHeadIndex].Pre = self.curDataMaxIndex
end
elseif dir == DLInsertDataDir.Tail then
if #self.NodeListData == 0 then
temp.Pre = -1
else
temp.Pre = (i == 1) and self.dataTailIndex or self.curDataMaxIndex - 1
end
temp.Next = (i == #insertData) and -1 or self.curDataMaxIndex + 1
if i == 1 and #self.NodeListData > 0 then
self.NodeListData[self.dataTailIndex].Next = self.curDataMaxIndex
end
if i == #insertData then
tempDataTailIndex = self.curDataMaxIndex
end
end
self.NodeListData[self.curDataMaxIndex] = temp
end
self.dataHeadIndex = tempDataHeadIndex
self.dataTailIndex = tempDataTailIndex
self:AddTotalCount(#insertData, dir)
if isReload then
self:ReloadData()
end
end
function XDynamicList:AddTotalCount(addCount, dir)
self.DynamicList.TotalCount = self.DynamicList.TotalCount + addCount;
if dir == DLInsertDataDir.Head then
self.DynamicList.StartIndex = self.DynamicList.StartIndex + addCount
-- self.DynamicList.EndIndex = self.DynamicList.EndIndex + addCount
end
end
function XDynamicList:GenerateItem(evt, dir, index)
if self.DynamicListBar then
if self:GetBarValue() <= 0 then--拉到底了
XEventManager.DispatchEvent(XEventId.EVENT_PULL_SCROLLVIEW_END, 0)
-- 添加新事件系统触发
CsXGameEventManager.Instance:Notify(XEventId.EVENT_PULL_SCROLLVIEW_END, 0)
elseif self:GetBarValue() >= 1 then--拉到顶了
XEventManager.DispatchEvent(XEventId.EVENT_PULL_SCROLLVIEW_UP, 0)
-- 添加新事件系统触发
CsXGameEventManager.Instance:Notify(XEventId.EVENT_PULL_SCROLLVIEW_UP, 0)
end
end
if not self.CallBack then
XLog.Error("You must be set callBack......")
return
end
if evt == DLDelegateEvent.DYNAMIC_GRID_ATINDEX then
if #self.NodeListData == 0 then
return true
end
local curShowDataIndex = nil--下一个需要展示的数据index
if dir == DLScrollDataDir.Head then
if not self.NodeListData[self.curShowHeadIndex] then
return true
end
if self.NodeListData[self.curShowHeadIndex].Pre == -1 then
return true
end
self.curShowHeadIndex = self.NodeListData[self.curShowHeadIndex].Pre
curShowDataIndex = self.curShowHeadIndex
elseif dir == DLScrollDataDir.Tail then
if self.curShowTailIndex == -1 and self.curShowHeadIndex == -1 then
self.curShowHeadIndex = self.dataHeadIndex
self.curShowTailIndex = self.dataHeadIndex
else
if not self.NodeListData[self.curShowTailIndex] then
return true
end
if self.NodeListData[self.curShowTailIndex].Next == -1 then
return true
end
self.curShowTailIndex = self.NodeListData[self.curShowTailIndex].Next
end
curShowDataIndex = self.curShowTailIndex
end
self.CallBack(self.NodeListData[curShowDataIndex].data, function(poolName, ctor)
local item = self.DynamicList:PreDequeueGrid(poolName, index)
local xlayoutNode = item:GetComponent("XLayoutNode")
if self.DynamicList and xlayoutNode then
xlayoutNode.minSize = CS.UnityEngine.Vector2(self.DynamicList.transform:GetComponent("RectTransform").rect.width, 0)
end
if item == nil then
XLog.Error("GenerateItem is Fail......index = ", index)
return false
end
local key = item.gameObject:GetHashCode()
local itemScript = self.ItemCache[key]
if itemScript ~= nil then
return itemScript
else
local newItemScript = ctor(item.gameObject)
self.ItemCache[key] = newItemScript
return newItemScript
end
end)
return false
elseif evt == DLDelegateEvent.DYNAMIC_GRID_RECYCLE then
if dir == DLScrollDataDir.Head then
self.curShowHeadIndex = self.NodeListData[self.curShowHeadIndex].Next
elseif dir == DLScrollDataDir.Tail then
self.curShowTailIndex = self.NodeListData[self.curShowTailIndex].Pre
end
end
end
--------------------------Set-------------------
function XDynamicList:SetReverse(code)
self.DynamicList.Reverse = code
end
function XDynamicList:SetBarValue(value)
self.DynamicListBar.value = value
end
function XDynamicList:SetViewSize(rectSize, isReload)
self.DynamicList:SetViewSize(rectSize)
if isReload then
self:ReloadData()
end
end
---------------------------Get-----------------
function XDynamicList:GetBarValue()
if self.DynamicListBar then
return self.DynamicListBar.value
else
XLog.Error("------DynamicList Not ScrollBar Component!------")
return nil
end
end
function XDynamicList:GetCurDataCount()
return #self.NodeListData
end
function XDynamicList:AddObjectPools(poolName, prefab)
self.DynamicList.ObjectPool:Add(poolName, prefab)
end

View file

@ -0,0 +1,35 @@
XEntityHelper = XEntityHelper or {}
XEntityHelper.TEAM_MAX_ROLE_COUNT = 3
-- entityId : CharacterId or RobotId
function XEntityHelper.GetCharacterIdByEntityId(entityId)
if XRobotManager.CheckIsRobotId(entityId) then
return XRobotManager.GetRobotTemplate(entityId).CharacterId
else
return entityId
end
end
function XEntityHelper.GetIsRobot(entityId)
return XRobotManager.CheckIsRobotId(entityId)
end
function XEntityHelper.GetCharacterName(entityId)
local characterId = XEntityHelper.GetCharacterIdByEntityId(entityId)
local config = XCharacterConfigs.GetCharacterTemplate(characterId)
if not config then return "none" end
return config.Name
end
function XEntityHelper.GetCharacterTradeName(entityId)
local characterId = XEntityHelper.GetCharacterIdByEntityId(entityId)
local config = XCharacterConfigs.GetCharacterTemplate(characterId)
if not config then return "none" end
return config.TradeName
end
function XEntityHelper.GetCharacterSmallIcon(entityId)
local characterId = XEntityHelper.GetCharacterIdByEntityId(entityId)
return XDataCenter.CharacterManager.GetCharSmallHeadIcon(characterId, 0, true)
end

View file

@ -0,0 +1,949 @@
--[[ id值为 EVENT_模块名_具体事件名]]
--
XEventId = {
--社交
EVENT_CHAT_RECEIVE_PRIVATECHAT = "EVENT_CHAT_RECEIVE_PRIVATECHAT", --收到私聊
EVENT_CHAT_RECEIVE_WORLD_MSG = "EVENT_CHAT_RECEIVE_WORLD_MSG", --收到世界聊天信息
EVENT_CHAT_RECEIVE_ROOM_MSG = "EVENT_CHAT_RECEIVE_ROOM_MSG", --收到房间聊天信息
EVENT_CHAT_MSG_SYNC = "EVENT_CHAT_MSG_SYNC", --同步私聊
EVENT_CHAT_OPEN = "EVENT_CHAT_OPEN", --打开聊天界面
EVENT_CHAT_CLOSE = "EVENT_CHAT_CLOSE", --关闭聊天界面
EVENT_CHAT_CHANNEL_CHANGED = "EVENT_CHAT_CHANNEL_CHANGED", --聊天频道id更换
EVENT_CHAT_SERVER_CHANNEL_CHANGED = "EVENT_CHAT_SERVER_CHANNEL_CHANGED", --服务端主动更换聊天频道
EVENT_CHAT_MATCH_EFFECT = "EVENT_CHAT_MATCH_EFFECT", --聊天关键字匹配播放特效
EVENT_FRIEND_DELETE = "EVENT_FRIEND_DELETE", --删除好友
EVENT_FRIEND_WAITING_PASS = "EVENT_FRIEND_WAITING_PASS", --等待通过,新的好友申请
EVENT_FRIEND_OPEN_PRIVATE_VIEW = "EVENT_FRIEND_OPEN_PRIVATE_VIEW", --打开私聊界面
EVENT_FRIEND_READ_PRIVATE_MSG = "EVENT_FRIEND_READ_PRIVATE_MSG", --读取私聊信息
EVENT_FRIEND_REMARK_NAME = "EVENT_FRIEND_REMARK_NAME", --好友备注名改变
EVENT_BLACK_DATA_CHANGE = "EVENT_BLACK_DATA_CHANGE", --黑名单列表改变
EVENT_PULL_SCROLLVIEW_END = "EVENT_PULL_SCROLLVIEW_END", --数据拉到底了 --后续会清掉
EVENT_PULL_SCROLLVIEW_UP = "EVENT_PULL_SCROLLVIEW_UP", --数据拉到头了 --后续会清掉
--设置事件
EVENT_CUSTOM_UI_SCHEME_CHANGED = "EVENT_CUSTOM_UI_SCHEME_CHANGED", -- 战斗自定义按键改变
--邮件事件
EVENT_MAIL_SYNC = "EVENT_MAIL_SYNC", --服务端同步邮件,
EVENT_MAIL_READ = "EVENT_MAIL_READ", --读取邮件,
EVENT_MAIL_DELETE = "EVENT_MAIL_DELETE", --删除邮件,
EVENT_MAIL_GET_MAIL_REWARD = 'EVENT_MAIL_GET_MAIL_REWARD', --领取邮件附件
EVENT_MAIL_GET_ALL_MAIL_REWARD = 'EVENT_MAIL_GET_ALL_MAIL_REWARD', --一键领取附件
EVENT_MAIL_COUNT_CHANGE = 'EVENT_MAIL_COUNT_CHANGE', --邮件数发生改变
--角色事件
EVENT_CHARACTER_ADD_SYNC = "EVENT_CHARACTER_ADD_SYNC", --添加构造体
EVENT_CHARACTER_LEVEL_UP = "EVENT_CHARACTER_LEVEL_UP", --升级
EVENT_CHARACTER_QUALITY_STAR_PROMOTE = "EVENT_CHARACTER_QUALITY_STAR_PROMOTE", --进化
EVENT_CHARACTER_QUALITY_PROMOTE = "EVENT_CHARACTER_QUALITY_PROMOTE", --升品
EVENT_CHARACTER_GRADE = "EVENT_CHARACTER_GRADE", --晋升,升星
EVENT_CHARACTER_GRADE_PART = "EVENT_CHARACTER_GRADE_PART", --小晋升
EVENT_CHARACTER_SKILL_UNLOCK = "EVENT_CHARACTER_SKILL_UNLOCK", --解锁技能
EVENT_CHARACTER_SKILL_UP = "EVENT_CHARACTER_SKILL_UP", --升级技能
EVENT_CHARACTER_INCREASE_TIP = "EVENT_CHARACTER_INCREASE_TIP", -- 角色属性提升后提醒
EVENT_CHARACTER_FIRST_GET = "EVENT_CHARACTER_FIRST_GET", --首次获得角色
EVENT_CHARACTER_SYN = "EVENT_CHARACTER_SYN", --角色信息变更
EVENT_CHARACTER_SUPPORT = "EVENT_CHARACTER_SUPPORT", -- 角色编入支援
--联机Boss事件
EVENT_ONLINEBOSS_UPDATE = "EVENT_ONLINEBOSS_UPDATE", --数据刷新
EVENT_ONLINEBOSS_REFRESH = "EVENT_ONLINEBOSS_REFRESH", --活动刷新
EVENT_ONLINEBOSS_DROPREWARD_NOTIFY = "EVENT_ONLINEBOSS_DROPREWARD_NOTIFY", --抽奖通知
EVENT_ONLINE_BOSS_REFRESH = "EVENT_ONLINE_BOSS_REFRESH", --联机boss刷新
--房间事件
EVENT_ROOM_REFRESH = "EVENT_ROOM_REFRESH", --房间刷新
EVENT_ROOM_PLAYER_ENTER = "EVENT_ROOM_PLAYER_ENTER", --玩家加入
EVENT_ROOM_PLAYER_LEAVE = "EVENT_ROOM_PLAYER_LEAVE", --玩家离开
EVENT_ROOM_PLAYER_STAGE_REFRESH = "EVENT_ROOM_PLAYER_STAGE_REFRESH", --玩家状态更新
EVENT_ROOM_PLAYER_NPC_REFRESH = "EVENT_ROOM_PLAYER_NPC_REFRESH", --玩家角色信息更新
EVENT_ROOM_AUTO_MATCH_CHANGE = "EVENT_ROOM_AUTO_MATCH_CHANGE", --房间自动匹配状态修改
EVENT_ROOM_STAGE_LEVEL_CHANGE = "EVENT_ROOM_STAGE_LEVEL_CHANGE", --房间难度等级修改
EVENT_ROOM_STAGE_ABILITY_LIMIT_CHANGE = "EVENT_ROOM_STAGE_ABILITY_LIMIT_CHANGE", --房间战力修改
EVENT_ROOM_STAGE_CHANGE = "EVENT_ROOM_STAGE_CHANGE", --房间状态修改
EVENT_ROOM_MATCH = "EVENT_ROOM_MATCH", --匹配
EVENT_ROOM_CANCEL_MATCH = "EVENT_ROOM_CANCEL_MATCH", --取消匹配
EVENT_ROOM_ENTER_ROOM = "EVENT_ROOM_ENTER_ROOM", --进入房间
EVENT_ROOM_KICKOUT = "EVENT_ROOM_KICKOUT", --踢出房间
EVENT_ROOM_LEAVE_ROOM = "EVENT_ROOM_LEAVE_ROOM", --离开房间(主动退出或被踢出房间)
EVENT_ROOM_COUNT_DOWN = "EVENT_ROOM_COUNT_DOWN", --倒计时
EVENT_ROOM_CHANGE_STAGE = "EVENT_ROOM_CHANGE_STAGE", --切换关卡
EVENT_ROOM_CHANGE_STAGE_SUMMER_EPISODE = "EVENT_ROOM_CHANGE_STAGE_SUMMER_EPISODE", --夏活照相关切换关卡
--UI
UiOpenPanel = "EVENT_UI_OPEN_PANEL", --参数bool, string,打开/关闭ui名称
EVENT_MAINUI_ENABLE = "EVENT_MAINUI_ENABLE", --主界面显示
EVENT_PLAYER_SETTING = "EVENT_PLAYER_SETTING", -- 玩家展示设置
--引导
EVENT_GUIDE_REQ_OPEN_SUCCESS = "EVENT_GUIDE_REQ_OPEN_SUCCESS", --请求引导完成
EVENT_GUIDE_START = "EVENT_GUIDE_START", --引导开始
EVENT_GUIDE_END = "EVENT_GUIDE_END", --引导结束
EVENT_GUIDE_COMPLETED_SUCCESS = "EVENT_GUIDE_COMPLETED_SUCCESS", --请求引导完成
EVENT_GUIDE_STEP_OPEN_EVENT = "EVENT_GUIDE_STEP_OPEN_EVENT", --检测步骤
--功能开启
EVENT_FUNCTION_OPEN_COMPLETE = "EVENT_FUNCTION_OPEN_COMPLETE", --功能开启
EVENT_FUNCTION_EVENT_START = "EVENT_FUNCTION_EVENT_START", --功能开始
EVENT_FUNCTION_EVENT_COMPLETE = "EVENT_FUNCTION_EVENT_COMPLETE", --功能开启完成
EVENT_FUNCTION_EVENT_END = "EVENT_FUNCTION_EVENT_END", --功能结束
EVENT_FESTIVAL_COMMUNICATE_FUNCTION_EVENT_END = "EVENT_FESTIVAL_COMMUNICATE_FUNCTION_EVENT_END", --節日通訊功能结束
-- 时间
EVENT_TIMEID_BOUND_PREFIX = "EVENT_TIMEID_UPDATE_",
EVENT_ETCD_TIME_CHANGE = "EVENT_ETCD_TIME_CHANGE",--ETCD上某个TimeID对应的时间发生改变
--紧急事件
EVENT_URGENTEVENT_SYNC = "EVENT_URGENTEVENT_SYNC", -- 收到紧急事件
--副本
EVENT_FUBEN_DAILY_REFRESH = "EVENT_FUBEN_DAILY_REFRESH", --日常副本刷新
EVENT_FUBEN_REFRESH_STAGE_DATA = "EVENT_FUBEN_REFRESH_STAGE_DATA", --副本变更推送
EVENT_FUBEN_CHAPTER_REWARD = "EVENT_FUBEN_CHAPTER_REWARD", --领取章节奖励
EVENT_FUBEN_CLOSE_FUBENSTAGEDETAIL = "EVENT_FUBEN_CLOSE_FUBENSTAGEDETAIL", --关闭副本详细界面
EVENT_FUBEN_ENTERFIGHT = "EVENT_FUBEN_ENTERFIGHT", --点击作战开始
EVENT_FUBEN_STAGE_SYNC = "EVENT_FUBEN_STAGE_SYNC", --stage同步
EVENT_FUBEN_NEW_STAGE = "EVENT_FUBEN_NEW_STAGE", --新的关卡
EVENT_FUBEN_NEW_MAIN_LINE_CHAPTER = "EVENT_FUBEN_NEW_MAIN_LINE_CHAPTER", --新的主线章节
EVENT_FUBEN_SETTLE_REWARD = "EVENT_FUBEN_SETTLE_REWARD", --副本结算奖励
EVENT_FUBEN_SHOW_REWARD = "EVENT_FUBEN_SHOW_REWARD", --显示副本奖励
EVENT_FUBEN_CHANGE_MAIN_LINE_DIFFICULT = "EVENT_FUBEN_CHANGE_MAIN_LINE_DIFFICULT", --修改主线副本难度
EVENT_PRE_ENTER_FIGHT = "EVENT_PRE_ENTER_FIGHT", --进入战斗前
EVENT_ENTER_FIGHT = "EVENT_ENTER_FIGHT", --进入战斗
EVENT_FUBEN_EXPLORE_UPDATE = "EVENT_FUBEN_EXPLORE_UPDATE", --探索更新UI
EVENT_FUBEN_EXPLORE_UPDATEBUFF = "EVENT_FUBEN_EXPLORE_UPDATEBUFF", --更新探索buff UI
EVENT_FUBEN_RESOURCE_AUTOSELECT = "EVENT_FUBEN_RESOURCE_AUTOSELECT", --资源自动选中
EVENT_FUBEN_PREQUEL_AUTOSELECT = "EVENT_FUBEN_PREQUEL_AUTOSELECT", --前传自动选中
EVENT_FUBEN_MAINLINE_TAB_SELECT = "EVENT_FUBEN_MAINLINE_TAB_SELECT", --剧情界面子标签页自动选中
EVENT_FUBEN_MAINLINE_DIFFICUTY_SELECT = "EVENT_FUBEN_MAINLINE_DIFFICUTY_SELECT", --主线难度标签页自动选中
EVENT_FUBEN_SETTLE_FAIL = "EVENT_FUBEN_FIGHT_CHECK_FAIL", --副本结算失败
EVENT_FUBEN_NEW_CHALLEGE = "EVENT_FUBEN_NEW_CHALLEGE", --副本挑战新玩法出现
EVENT_FUBEN_EXTRACHAPTER_REWARD = "EVENT_FUBEN_EXTRACHAPTER_REWARD", --领取番外章节奖励
EVENT_FUBEN_NEW_EXTRA_CHAPTER = "EVENT_FUBEN_NEW_EXTRA_CHAPTER", --新的番外章节
EVENT_FUBEN_CHANGE_EXTRA_CHAPTER_DIFFICULT = "EVENT_FUBEN_CHANGE_EXTRA_CHAPTER_DIFFICULT", --更改番外副本难度
EVENT_FUBEN_NEW_EXPEDITION_STAGE = "EVENT_FUBEN_NEW_EXPEDITION_STAGE", --虚像地平线解锁新关卡
EVENT_FUBEN_NIER_STAGE_REWARD = "EVENT_FUBEN_NEW_NIER_STAGE", --尼尔玩法通关新副本
EVENT_FUBEN_NEWCHARACT_REWARD = "EVENT_FUBEN_NEWCHARACT_REWARD", --领取新角色活动奖励
EVENT_FUBEN_SIMUCOMBAT_UPDATE = "EVENT_FUBEN_SIMUCOMBAT_UPDATE", --模拟作战更新UI
EVENT_FUBEN_SIMUCOMBAT_REWARD = "EVENT_FUBEN_SIMUCOMBAT_REWARD", --模拟作战领取奖励
EVENT_FUBEN_HACK_UPDATE = "EVENT_FUBEN_HACK_UPDATE", --骇入玩法更新UI
EVENT_FUBEN_HACK_CLICK = "EVENT_FUBEN_HACK_CLICK", --骇入玩法点击
EVENT_FUBEN_COUPLECOMBAT_UPDATE = "EVENT_FUBEN_COUPLECOMBAT_UPDATE", --双人下场玩法更新UI
--活动相关
EVENT_ACTIVITY_MAINLINE_STATE_CHANGE = "EVENT_ACTIVITY_MAINLINE_STATE_CHANGE", --主线副本抢先体验活动状态变更
EVENT_ACTIVITY_EXTRACHAPTER_STATE_CHANGE = "EVENT_ACTIVITY_EXTRACHAPTER_STATE_CHANGE", --番外副本抢先体验活动状态变更
EVENT_ACTIVITY_INFO_UPDATE = "EVENT_ACTIVITY_INFO_UPDATE", -- 活动状态或数据变化
EVENT_ACTIVITY_ON_RESET = "EVENT_ACTIVITY_ON_RESET", -- 活动重置或结束时通知(用于出战界面等通用界面通知时间边界处理)
--主线探索玩法
EVENT_MAINLINE_EXPLORE_ITEM_GET = "EVENT_MAINLINE_EXPLORE_ITEM_GET", --主线探索玩法获得隐藏道具
EVENT_MAINLINE_EXPLORE_ITEMBOX_CLOSE = "EVENT_MAINLINE_EXPLORE_ITEMBOX_CLOSE", --主线探索玩法关闭道具包
EVENT_EXTRACHAPTER_EXPLORE_ITEM_GET = "EVENT_EXTRACHAPTER_EXPLORE_ITEM_GET", --番外探索玩法获得隐藏道具
EVENT_EXTRACHAPTER_EXPLORE_ITEMBOX_CLOSE = "EVENT_EXTRACHAPTER_EXPLORE_ITEMBOX_CLOSE", --番外探索玩法关闭道具包
--自动作战
EVENT_AUTO_FIGHT_CHANGE = "EVENT_AUTO_FIGHT_CHANGE", --自动作战状态改变
EVENT_AUTO_FIGHT_START = "EVENT_AUTO_FIGHT_START", --自动作战开始
EVENT_AUTO_FIGHT_COMPLETE = "EVENT_AUTO_FIGHT_COMPLETE", --自动作战完成
EVENT_AUTO_FIGHT_REMOVE = "EVENT_AUTO_FIGHT_REMOVE", --自动作战移除
--竞技
EVENT_ARENA_TEAM_CHANGE = "EVENT_ARENA_TEAM_CHANGE", --竞技队伍变化
EVENT_ARENA_TEAM_INITIATIVE_LEAVE = "EVENT_ARENA_TEAM_INITIATIVE_LEAVE", --竞技主动离队
EVENT_ARENA_TEAM_RECEIVE_APPLY_DATA = "EVENT_ARENA_TEAM_RECEIVE_APPLY_DATA", --竞技得到申请列表
EVENT_ARENA_TEAM_APPLY_CHANGE = "EVENT_ARENA_TEAM_APPLY_CHANGE", --竞技申请列表变化
EVENT_ARENA_TEAM_NEW_APPLY_ENTER = "EVENT_ARENA_TEAM_NEW_APPLY_ENTER", --竞技新申请信息数量变化
EVENT_ARENA_MAIN_INFO = "EVENT_ARENA_MAIN_INFO", --竞技主界面信息
EVENT_ARENA_REFRESH_TEAM_RANK_INFO = "EVENT_ARENA_REFRESH_TEAM_RANK_INFO", --竞技刷新排行信息
EVENT_ARENA_REFRESH_AREA_INFO = "EVENT_ARENA_REFRESH_AREA_INFO", --竞技刷新战区信息
EVENT_ARENA_UNLOCK_AREA = "EVENT_ARENA_UNLOCK_AREA", --竞技解锁战区
EVENT_ARENA_RESULT_CLOSE = "EVENT_ARENA_RESULT_CLOSE", --竞技关闭奖励界面
EVENT_ARENA_RESULT_AUTOFIGHT = "EVENT_ARENA_RESULT_AUTOFIGHT", --战区自动作战
--任务
EVENT_TASK_SYNC = "EVENT_TASK_SYNC", --任务改变
EVENT_FINISH_TASK = "EVENT_FINISH_TASK", --任务改变
EVENT_TASK_COURSE_REWAED = "EVENT_TASK_COURSE_REWAED", --领取历程奖励
EVENT_TASK_TAB_CHANGE = "EVENT_TASK_TAB_CHANGE", --任务tab改变
EVENT_TASK_FINISH_FAIL = "EVENT_TASK_FINISH_FAIL", --任务领取失败
--道具
EVENT_ITEM_COUNT_UPDATE_PREFIX = "EVENT_ITEM_COUNT_UPDATE_",
EVENT_ITEM_BUYTIEMS_UPDATE_PREFIX = "EVENT_ITEM_BUYTIMES_UPDATE_",
EVENT_ITEM_BUYASSET = "EVENT_ITEM_BUYASSET", -- 购买道具
EVENT_ITEM_USE = "EVENT_ITEM_USE", -- 使用道具
EVENT_TIMELIMIT_ITEM_USE = "EVENT_TIMELIMIT_ITEM_USE", -- 使用限时道具
EVENT_ITEM_RECYCLE = "EVENT_ITEM_RECYCLE", -- 回收道具
EVENT_ITEM_MULTIPLY_USE = "EVENT_ITEM_MULTIPLY_USE", -- 使用多组道具
EVENT_ITEM_FAST_TRADING = "EVENT_ITEM_FAST_TRADING", -- 快捷购买道具
--玩家
EVENT_USERID_CHANGE = "EVENT_USERID_CHANGE", -- 更换账号
EVENT_USERNAME_CHANGE = "EVENT_USERNAME_CHANGE", -- 更换账号
EVENT_USER_LOGOUT = "EVENT_USER_LOGOUT", -- 登出
EVENT_LOGIN_SUCCESS = "EVENT_LOGIN_SUCCESS", -- 登陆成功
EVENT_LOGIN_DATA_LOAD_COMPLETE = "EVENT_LOGIN_DATA_LOAD_COMPLETE", -- 登录数据加载完毕
EVENT_NETWORK_DISCONNECT = "EVENT_NETWORK_DISCONNECT", -- 断开连接
EVENT_SERVER_LIST_CHANGE = "EVENT_SERVER_LIST_CHANGE", -- 服务器列表变更
EVENT_NEW_PLAYER = "EVENT_NEW_PLAYER", -- 新创建的玩家
EVENT_PLAYER_SET_NAME = "EVENT_PLAYER_SET_NAME", -- 玩家改名
EVENT_PLAYER_LEVEL_CHANGE = "EVENT_PLAYER_LEVEL_CHANGE", -- 等级发生变化
EVENT_PLAYER_LEVEL_UP_ANIMATION_END = "EVENT_PLAYER_LEVEL_UP_ANIMATION_END", --玩家等级提升动画结束
--赏金任务
EVENT_BOUNTYTASK_INFO_CHANGE_NOTIFY = "EVENT_BOUNTYTASK_INFO_CHANGE_NOTIFY", --赏金任务改变推送
EVENT_BOUNTYTASK_ACCEPT_TASK = "EVENT_BOUNTYTASK_ACCEPT_TASK", --接受赏金任务
EVENT_BOUNTYTASK_ACCEPT_TASK_REWARD = "EVENT_BOUNTYTASK_ACCEPT_TASK_REWARD", --接受赏金任务
EVENT_BOUNTYTASK_TASK_COMPLETE_NOTIFY = "EVENT_BOUNTYTASK_TASK_COMPLETE_NOTIFY", --任务完成
EVENT_BOUNTYTASK_TASK_REFRESH = "EVENT_BOUNTYTASK_TASK_REFRESH", --任务池刷新
--派遣
EVENT_TASKFORCE_INFO_NOTIFY = "EVENT_TASKFORCE_INFO_NOTIFY", --派遣推送
EVENT_TASKFORCE_SECTIONCHANGE_NOTIFY = "EVENT_TASKFORCE_SECTIONCHANGE_NOTIFY", --派遣章节改变推送
EVENT_TASKFORCE_MAXTASKFORCECOUNT_CHANGE_NOTIFY = "EVENT_TASKFORCE_MAXTASKFORCECOUNT_CHANGE_NOTIFY", --可派遣队伍最大数量改变推送
EVENT_TASKFORCE_COMPLETE_NOTIFY = "EVENT_TASKFORCE_COMPLETE_NOTIFY", --派遣任务完成推送
EVENT_TASKFORCE_GIVEUP_TASK_REQUEST = "EVENT_TASKFORCE_GIVEUP_TASK_REQUEST", --派遣放弃任务
EVENT_TASKFORCE_ACCEPT_TASK_REQUEST = "EVENT_TASKFORCE_ACCEPT_TASK_REQUEST", --派遣接受任务
EVENT_TASKFORCE_REFRESH_REQUEST = "EVENT_TASKFORCE_REFRESH_REQUEST", --派遣刷新任务池
EVENT_TASKFORCE_TASKFINISH_REQUEST = "EVENT_TASKFORCE_TASKFINISH_REQUEST", --派遣立即完成任务
EVENT_TASKFORCE_ACCEPT_REWARD_REQUEST = "EVENT_TASKFORCE_ACCEPT_REWARD_REQUEST", --派遣获得奖励
EVENT_TASKFORCE_TIP_MISSION_END = "EVENT_TASKFORCE_TIP_MISSION_END", --派遣队伍开启动画结束
--战斗
EVENT_FIGHT_BEGIN_PLAYMOVIE = "EVENT_FIGHT_BEGIN_PLAYMOVIE", --战斗开始前播放剧情
EVENT_FIGHT_LOADINGFINISHED = "EVENT_FIGHT_LOADINGFINISHED", --战斗Loading已打开
EVENT_FIGHT_PROGRESS = "EVENT_FIGHT_PROGRESS", --战斗loading进度
EVENT_FIGHT_RESULT = "EVENT_FIGHT_RESULT", --战斗结果
EVENT_FIGHT_RESULT_WIN = "EVENT_FIGHT_RESULT_WIN", --战斗结果
EVENT_FIGHT_EXIT = "EVENT_FIGHT_EXIT", --战斗结束(cs事件)
EVENT_FIGHT_FINISH = "EVENT_FIGHT_FINISH", --战斗结束
EVENT_FIGHT_FINISH_LOSEUI_CLOSE = "EVENT_FIGHT_FINISH_LOSEUI_CLOSE", --战斗失败界面关闭回调
--投票
EVENT_VOTE_REFRESH = "EVENT_VOTE_REFRESH", --投票数据更新
--装备
EVENT_EQUIP_PUTON_NOTYFY = "EVENT_EQUIP_PUTON_NOTYFY", --穿上
EVENT_EQUIP_PUTON_WEAPON_NOTYFY = "EVENT_EQUIP_PUTON_WEAPON_NOTYFY", --穿上武器
EVENT_EQUIP_TAKEOFF_NOTYFY = "EVENT_EQUIP_TAKEOFF_NOTYFY", --脱下单个
EVENT_EQUIPLIST_TAKEOFF_NOTYFY = "EVENT_EQUIPLIST_TAKEOFF_NOTYFY", --脱下装备列表
EVENT_EQUIP_LOCK_STATUS_CHANGE_NOTYFY = "EVENT_EQUIP_LOCK_STATUS_CHANGE_NOTYFY", --锁定状态变更
EVENT_EQUIP_STRENGTHEN_NOTYFY = "EVENT_EQUIP_STRENGTHEN_NOTYFY", --强化
EVENT_EQUIP_BREAKTHROUGH_NOTYFY = "EVENT_EQUIP_BREAKTHROUGH_NOTYFY", --突破
EVENT_EQUIP_RESONANCE_NOTYFY = "EVENT_EQUIP_RESONANCE_NOTYFY", --共鸣随机技能返回
EVENT_EQUIP_RESONANCE_ACK_NOTYFY = "EVENT_EQUIP_RESONANCE_ACK_NOTYFY", --共鸣确认选择技能
EVENT_EQUIP_AWAKE_NOTYFY = "EVENT_EQUIP_AWAKE_NOTYFY", --觉醒
EVENT_EQUIP_DATA_CHANGE_NOTIFY = "EVENT_EQUIP_DATA_CHANGE_NOTYFY", --装备数据变更
EVENT_EQUIP_DATA_INIT_NOTIFY = "EVENT_EQUIP_DATA_INIT_NOTYFY", --装备数据初始化完成
EVENT_EQUIP_CAN_BREAKTHROUGH_TIP_CLOSE = "EVENT_EQUIP_CAN_BREAKTHROUGH_TIP_CLOSE", --装备强化至满级开启突破弹条动画播放结束
EVENT_EQUIP_DATA_LIST_UPDATE_NOTYFY = "EVENT_EQUIP_DATA_LIST_UPDATE_NOTYFY", --装备数据列表更新
EVENT_EQUIP_SUIT_PREFAB_DATA_UPDATE_NOTIFY = "EVENT_EQUIP_SUIT_PREFAB_DATA_UPDATE_NOTIFY", --意识组合数据更新
EVENT_EQUIP_RECYCLE_NOTIFY = "EVENT_EQUIP_RECYCLE_NOTIFY", --意识被回收
EVENT_EQUIP_RECYCLE_STATUS_CHANGE_NOTYFY = "EVENT_EQUIP_RECYCLE_STATUS_CHANGE_NOTYFY", --待回收状态变更
--基地装备
EVENT_BASE_EQUIP_DATA_CHANGE_NOTIFY = "EVENT_BASE_EQUIP_DATA_CHANGE_NOTYFY", --穿上基地装备
EVENT_BASE_EQUIP_DATA_REFRESH = "EVENT_BASE_EQUIP_DATA_REFRESH", --基地装备数据刷新
-- 好感度偶遇
EVENT_COMEACROSS_PLAY = "EVENT_COMEACROSS_PLAY", --开始游戏
EVENT_COMEACROSS_PLAYRESULT = "EVENT_COMEACROSS_PLAYRESULT", --游戏结算
-- 好感度
EVENT_FAVORABILITY_MAIN_REFRESH = "EVENT_FAVORABILITY_MAIN_REFRESH", --好感度主界面信息同步
EVENT_FAVORABILITY_RUMORS_PREVIEW = "EVENT_FAVORABILITY_RUMORS_PREVIEW", --异闻预览
EVENT_FAVORABILITY_COLLECTGIFT = "EVENT_FAVORABILITY_COLLECTGIFT", --领取礼物
EVENT_FAVORABILITY_PLOTUNLOCK = "EVENT_FAVORABILITY_PLOTUNLOCK", --剧情解锁
EVENT_FAVORABILITY_INFOUNLOCK = "EVENT_FAVORABILITY_INFOUNLOCK", --资料解锁
EVENT_FAVORABILITY_RUMERUNLOCK = "EVENT_FAVORABILITY_RUMERUNLOCK", --异闻解锁
EVENT_FAVORABILITY_AUDIOUNLOCK = "EVENT_FAVORABILITY_AUDIOUNLOCK", --语音解锁
EVENT_FAVORABILITY_ACTIONUNLOCK = "EVENT_FAVORABILITY_ACTIONUNLOCK", --动作解锁
EVENT_FAVORABILITY_GIFT = "EVENT_FAVORABILITY_GIFT", --发送礼物
EVENT_FAVORABILITY_LEVELCHANGED = "EVENT_FAVORABILITY_LEVELCHANGED", --好感度等级经验变化
EVENT_FAVORABILITY_CHAR_ABILITY_CHANGED = "EVENT_FAVORABILITY_CHAR_ABILITY_CHANGED", --战斗参数变化
EVENT_FAVORABILITY_CHAR_QUALITY_CHANGED = "EVENT_FAVORABILITY_CHAR_QUALITY_CHANGED", --角色品质变化
EVENT_FAVORABILITY_ON_GIFT_CHANGED = "EVENT_FAVORABILITY_ON_GIFT_CHANGED", --选中的礼物变化
-- 新手任务
EVENT_NEWBIETASK_DAYCHANGED = "EVENT_NEWBIETASK_DAYCHANGED", --新手目标天数变化
EVENT_NEWBIETASK_PROGRESSCHANGED = "EVENT_NEWBIETASK_PROGRESSCHANGED", --新手进度
-- 队伍预设
EVENT_TEAM_PREFAB_CHANGE = "EVENT_TEAM_PREFAB_CHANGE", --队伍预设改变
EVENT_TEAM_PREFAB_SELECT = "EVENT_TEAM_PREFAB_SELECT", --队伍选中
EVENT_TEAM_MEMBER_CHANGE = "EVENT_TEAM_MEMBER_CHANGE", --队伍成员发生变化
-- 公告
EVENT_NOTICE_PIC_CHANGE = "EVENT_NOTICE_PIC_CHANGE", --宣传图改变
EVENT_NOTICE_TYPE_CHANAGE = "EVENT_NOTICE_TYPE_CHANAGE", --公告页签改变
EVENT_NOTICE_CLOSE_TEXT_NOTICE = "EVENT_NOTICE_CLOSE_TEXT_NOTICE", --关闭滚动公告
EVENT_NOTICE_CONTENT_RESP = "EVENT_NOTICE_CONTENT_RESP", --公告内容返回
-- 活动系统
EVENT_ACTIVITY_ACTIVITIES_READ_CHANGE = "EVENT_ACTIVITY_ACTIVITIES_READ_CHANGE", -- 活动已读状态改变
EVENT_ACTIVITY_NOTICE_READ_CHANGE = "EVENT_ACTIVITY_NOTICE_READ_CHANGE", --公告已读状态改变
-- 运营相关
EVENT_ACTIVITY_SUBMENU_READ_CHANGE = "EVENT_ACTIVITY_SUBMENU_READ_CHANGE", -- 主界面二级菜单已读状态改变
-- 试炼
EVENT_TRIAL_LEVEL_FINISH = "EVENT_TRIAL_LEVEL_FINISH", --有对应关卡通关
-- 前传
EVENT_NOTICE_REFRESHTIME_CHANGE = "EVENT_NOTICE_REFRESHTIME_CHANGE", --刷新时间
EVENT_NOTICE_CHALLENGESTAGES_CHANGE = "EVENT_NOTICE_CHALLENGESTAGES_CHANGE", --挑战关卡刷新
EVENT_NOTICE_SELECTCOVER_CHANGE = "EVENT_NOTICE_SELECTCOVER_CHANGE", --
EVENT_NOTICE_PREQUELDETAIL_CLOSE = "EVENT_NOTICE_PREQUELDETAIL_CLOSE", --详情关闭
EVENT_NOTICE_TASKINITFINISHED = "EVENT_NOTICE_TASKINITFINISHED",
-- 弹窗
EVENT_UIDIALOG_VIEW_ENABLE = "EVENT_UIDIALOG_VIEW_ENABLE", -- 提示弹窗显示
-- 签到
EVENT_SING_IN_OPEN_BTN = "EVENT_SING_IN_OPEN_BTN", -- 签到领取完成开启关闭按钮
--宿舍
EVENT_CLICKFURNITURE_GRID = "EVENT_CLICKFURNITURE_GRID", -- 点击单个家具
EVENT_CLICKDRAFT_GRID = "EVENT_CLICKDRAFT_GRID", -- 点击单个图纸
EVENT_CLICKCATEGORY_GRID = "EVENT_CLICKCATEGORY_GRID", -- 点击单个家具类型
EVENT_CLICKFURNITURE_ONROOM = "EVENT_CLICKFURNITURE_ONROOM", -- 点击场景中的家具
EVENT_FURNITURE_CREATE_CHANGED = "EVENT_FURNITURE_CREATE_CHANGED", -- 家具建造可领取
EVENT_FURNITURE_ONDRAGITEM_CHANGED = "EVENT_FURNITURE_ONDRAGITEM_CHANGED", -- 家具拖动变化
EVENT_FURNITURE_REFRESH = "EVENT_FURNITURE_REFRESH", -- 刷新家具摆放界面
EVENT_FURNITURE_CLEANROOM = "EVENT_FURNITURE_CLEANROOM", -- 通知全部收起家具
EVENT_FURNITURE_ON_MODIFY = "EVENT_FURNITURE_ON_MODIFY", -- 通知家具改变(分解,合成)
EVENT_FURNITURE_Get_Furniture = "EVENT_FURNITURE_Get_Furniture", -- 领取家具
EVENT_CHARACTER_MOOD_CHANGED = "EVENT_CHARACTER_MOOD_CHANGED", -- 构造体心情值变化
EVENT_CHARACTER_VITALITY_CHANGED = "EVENT_CHARACTER_VITALITY_CHANGED", -- 构造体体力情值变化
EVENT_CHARACTER_ADD_EVENT_NOTIFY = "EVENT_CHARACTER_ADD_EVENT_NOTIFY", -- 构造体事件通知
EVENT_CHARACTER_SUB_EVENT_NOTIFY = "EVENT_CHARACTER_SUB_EVENT_NOTIFY", -- 构造体事件过期通知
EVENT_CHARACTER_DORMMAIN_EVENT_NOTIFY = "EVENT_CHARACTER_DORMMAIN_EVENT_NOTIFY", -- 通知宿舍主界面有事件
EVENT_CHARACTER_CHANGE_ROOM_CHARACTER = "EVENT_CHARACTER_CHANGE_ROOM_CHARACTER", -- 从房间新增或者移出构造体
EVENT_DORM_ROOM = "EVENT_DORM_ROOM", -- 进入宿舍
EXIT_DORM_ROOM = "EXIT_DORM_ROOM", -- 退出宿舍
EVENT_DORM_ROOM_ACTIVE_SUCCESS = "EVENT_DORM_ROOM_ACTIVE_SUCCESS", -- 宿舍激活成功
EVENT_DORM_CHARACTER_CLICK_SUCCESS = "EVENT_DORM_CHARACTER_CLICK_SUCCESS", -- 宿舍构造体点击
EVENT_DORM_CHARACTER_POINTER_UP_SUCCESS = "EVENT_DORM_CHARACTER_POINTER_UP_SUCCESS", -- 宿舍构造体手指弹起
EVENT_DORM_FURNITURE_POINTER_UP_SUCCESS = "EVENT_DORM_CHARACTER_POINTER_UP_SUCCESS", -- 宿舍家具手指弹起
EVENT_DORM_FURNITURE_PUT_SUCCESS = "EVENT_DORM_CHARACTER_POINTER_UP_SUCCESS", -- 宿舍家具摆放
EVENT_CHARACTER_SHOW_DIALOBOX = "EVENT_CHARACTER_SHOW_DIALOBOX", -- 对话气泡显示
EVENT_CHARACTER_HIDE_DIALOBOX = "EVENT_CHARACTER_HIDE_DIALOBOX", -- 对话气泡隐藏
EVENT_CHARACTER_SHOW_3DIOBJ = "EVENT_CHARACTER_SHOW_3DIOBJ", -- 3DUI显示
EVENT_CHARACTER_HIDE_3DIOBJ = "EVENT_CHARACTER_HIDE_3DIOBJ", -- 3DUI隐藏
EVENT_CHARACTER_CATCH = "EVENT_CHARACTER_CATCH", -- 抓起构造体
EVENT_CHARACTER_EXIT = "EVENT_CHARACTER_EXIT", -- 抓起构造体读条放下
EVENT_CHARACTER_PUT_ON = "EVENT_CHARACTER_PUT_ON", -- 构造体抓起读条
EVENT_CHARACTER_PUT_DOWN = "EVENT_CHARACTER_PUT_DOWN", -- 放下构造体
EVENT_DORM_TOUCH_ENTER = "EVENT_DORM_TOUCH_ENTER", -- 宿舍爱抚构造体进入
EVENT_DORM_TOUCH_SHOW = "EVENT_DORM_TOUCH_SHOW", -- 宿舍爱抚构造体显示
EVENT_DORM_TOUCH_SHOW_VIEW = "EVENT_DORM_TOUCH_SHOW_VIEW", -- 宿舍爱抚构造体显示(界面用)
EVENT_DORM_TOUCH_HIDE = "EVENT_DORM_TOUCH_HIDE", -- 宿舍爱抚构造体隐藏
EVENT_DORM_EXP_DETAIL_SHOW = "EVENT_DORM_EXP_DETAIL_SHOW", -- 显示体力详情
EVENT_DORM_EXP_DETAIL_HIDE = "EVENT_DORM_EXP_DETAIL_HIDE", -- 隐藏体力详情
EVENT_DORM_HEAD_TOUCH = "EVENT_DORM_HEAD_TOUCH", -- 点击头像里的抚摸按钮
EVENT_DORM_EXP_SHOW = "EVENT_DORM_EXP_SHOW", -- 显示心情条
EVENT_DORM_EXP_HIDE = "EVENT_DORM_EXP_HIDE", -- 隐藏心情条
EVENT_DORM_HIDE_COMPONET = "EVENT_DORM_HIDE_COMPONET", -- 隐藏所有组建
EVENT_DORM_CLOSE_COMPONET = "EVENT_DORM_CLOSE_COMPONET", -- 关闭宿舍3D场景
EVENT_HOME_CHARACTER_STATUS_CHANGE = "EVENT_HOME_CHARACTER_STATUS_CHANGE", --宿舍角色状态改变
EVENT_DORM_SHOW_EVENT_CHANGE = "EVENT_DORM_SHOW_EVENT_CHANGE", --宿舍角色体力/心情/体力恢复速度/心情恢复速度改变
EVENT_DORM_FURNITURE_ATTR_TAG = "EVENT_DORM_FURNITURE_ATTR_SHOW", -- 家具属性显示
EVENT_DORM_FURNITURE_ATTR_TAG_DETAIL = "EVENT_DORM_FURNITURE_ATTR_TAG_DETAIL", -- 家具属性显示细节
EVENT_DORM_FURNITURE_HIDE_ATTR_TAG_DETAIL = "EVENT_DORM_FURNITURE_HIDE_ATTR_TAG_DETAIL", -- 隐藏家具属性细节
EVENT_DORM_FURNITURE_HIDE_ALL_ATTR_TAG_DETAIL = "EVENT_DORM_FURNITURE_HIDE_ALL_ATTR_TAG_DETAIL", -- 隐藏家具属性细节
EVENT_DORM_BAG_REFRESH = "EVENT_DORM_BAG_REFRESH", -- 通知刷新家具背包页面
--展示厅
EVENT_CHARACTER_EXHIBITION_REFRESH = "EVENT_CHARACTER_EXHIBITION_REFRESH", --展示厅奖励信息刷新
EVENT_CHARACTER_EXHIBITION_AUTOSELECT = "EVENT_CHARACTER_EXHIBITION_AUTOSELECT", --展示厅跳转选中
--指挥官头像
EVENT_HEAD_PORTRAIT_NOTIFY = "EVENT_HEAD_PORTRAIT_NOTIFY", --新头像解锁通知
EVENT_HEAD_PORTRAIT_RESETINFO = "EVENT_HEAD_PORTRAIT_RESETINFO", --新头像解锁通知
EVENT_HEAD_PORTRAIT_TIMEOUT = "EVENT_HEAD_PORTRAIT_TIMEOUT", --新头像过期通知
--勋章
EVENT_MEDAL_NOTIFY = "EVENT_MEDAL_NOTIFY", --勋章解锁通知
EVENT_MEDAL_TIPSOVER = "EVENT_MEDAL_TIPSOVER", --勋章飘窗结束
EVENT_MEDAL_REDPOINT_CHANGE = "EVENT_MEDAL_REDPOINT_CHANGE", --勋章红点变动
EVENT_SCORETITLE_CHANGE = "EVENT_SCORETITLE_CHANGE", --计分徽章分数改变通知
EVENT_SCORETITLE_NEW = "EVENT_SCORETITLE_NEW", --获取新收藏品通知
EVENT_MEDAL_USE = "EVENT_MEDAL_USE", --装备/解锁勋章
-- 教学关卡
EVENT_PRACTICE_ON_DATA_REFRESH = "EVENT_PRACTICE_ON_DATA_REFRESH", --数据刷新
-- 单挑Boss相关
EVENT_BOSS_SINGLE_GET_REWARD = "EVENT_BOSS_SINGLE_GET_REWARD", --领取积分奖励
EVENT_FUBEN_SINGLE_BOSS_SYNC = "EVENT_FUBEN_SINGLE_BOSS_SYNC", --数据刷新
EVENT_FUBEN_SINGLE_BOSS_RESET = "EVENT_FUBEN_SINGLE_BOSS_RESET", --数据周重置
EVENT_FUBEN_SINGLE_BOSS_RANK_SYNC = "EVENT_FUBEN_SINGLE_BOSS_RANK_SYNC", --排行刷新
-- 礼包更新
EVENT_LB_UPDATE = "EVENT_LB_UPDATE", --礼包
EVENT_YK_UPDATE = "EVENT_YK_UPDATE", --月卡数据更新
-- 礼包过期通知
EVENT_LB_EXPIRE_NOTIFY = "EVENT_LB_EXPIRE_NOTIFY",
-- 充值
EVENT_CARD_REFRESH_WELFARE_BTN = "EVENT_CARD_REFRESH_WELFARE_BTN",
EVENT_DAYLY_REFESH_RECHARGE_BTN = "EVENT_DAYLY_REFESH_RECHARGE_BTN",
-- 查询角色数据返回
EVENT_REQUEST_PLAYER_INFO_BACK = "EVENT_REQUEST_PLAYER_INFO_BACK",
-- 打脸
EVENT_AUTO_WINDOW_STOP = "EVENT_AUTO_WINDOW_STOP", -- 打脸暂停
EVENT_AUTO_WINDOW_END = "EVENT_AUTO_WINDOW_END", -- 打脸结束
-- 宿舍打工Reward
EVENT_DORM_WORK_REDARD = "EVENT_DORM_WORK_REDARD",
-- 宿舍打工重置
EVENT_DORM_WORK_RESET = "EVENT_DORM_WORK_RESET",
-- 宿舍代工
EVENT_DORM_DAI_GONE_REWARD = "EVENT_DORM_DAI_GONE_REWARD",
-- 宿舍跳转
EVENT_DORM_SKIP = "EVENT_DORM_SKIP",
EVENT_DORM_CLOSE_DETAIL = "EVENT_DORM_CLOSE_DETAIL",
-- 拍照
EVENT_PHOTO_ENTER = "EVENT_PHOTO_ENTER", -- 进入拍照状态
EVENT_PHOTO_LEAVE = "EVENT_PHOTO_LEAVE", -- 离开拍照状态
EVENT_PHOTO_CHANGE_SCENE = "EVENT_PHOTO_CHANGE_SCENE", -- 切换场景
EVENT_PHOTO_CHANGE_MODEL = "EVENT_PHOTO_CHANGE_MODEL", -- 切换模型
EVENT_PHOTO_PLAY_ACTION = "EVENT_PHOTO_PLAY_ACTION", -- 播放动作
EVENT_PHOTO_PHOTOGRAPH = "EVENT_PHOTO_PHOTOGRAPH", -- 拍照
-- 爱护
EVENT_CARESS_SHOW = "EVENT_CARESS_SHOW",
-- 累计充值更新
EVENT_ACCUMULATED_UPDATE = "EVENT_ACCUMULATED_UPDATE",
-- 累计充值奖励领取
EVENT_ACCUMULATED_REWARD = "EVENT_ACCUMULATED_REWARD",
-- 宿舍二级界面显示情况
EVENT_DORM_SECOND_STATE = "EVENT_DORM_SECOND_STATE",
-- 抽奖活动奖池数改变
EVENT_DRAW_ACTIVITYCOUNT_CHANGE = "EVENT_DRAW_ACTIVITYCOUNT_CHANGE",
-- 抽奖活动奖池变化
EVENT_DRAW_ACTIVITYDRAW_CHANGE = "EVENT_DRAW_ACTIVITYDRAW_CHANGE",
--试玩区完成情况发生改变
EVENT_UPDATE_EXPERIMENT = "EVENT_UPDATE_EXPERIMENT",
EVENT_EXPERIMENT_GET_STAR_REWARD = "EVENT_EXPERIMENT_GET_STAR_REWARD", -- 领取试玩区带有目标的奖励
-- 节日活动节目刷新
EVENT_ON_FESTIVAL_CHANGED = "EVENT_ON_FESTIVAL_CHANGED",
-- 极地活动
EVENT_BRIEF_CHANGE_TAB = "EVENT_BRIEF_CHANGE_TAB",
-- 宿舍访问跳转
EVENT_DORM_VISTOR_SKIP = "EVENT_DORM_VISTOR_SKIP",
-- 巴别塔刷新
EVENT_BABEL_STAGE_INFO_ASYNC = "EVENT_BABEL_STAGE_INFO_ASYNC",
EVENT_BABEL_RESET_STATUES_CHANGED = "EVENT_BABEL_RESET_STATUES_CHANGED",
EVENT_BABEL_ACTIVITY_STATUS_CHANGED = "EVENT_BABEL_ACTIVITY_STATUS_CHANGED",
EVNET_BABEL_CHALLENGE_BUFF_CHANGED = "EVNET_BABEL_CHALLENGE_BUFF_CHANGED",
-- 爬塔活动
EVENT_ROGUELIKE_ACTIONPOINT_CHARACTER_CHANGED = "EVENT_ROGUELIKE_ACTIONPOINT_CHARACTER_CHANGED", --出站角色、行动点改变
EVENT_ROGUELIKE_ASSISTROBOT_CHANGED = "EVENT_ROGUELIKE_ASSISTROBOT_CHANGED", --支援角色改变
EVENT_ROGUELIKE_REFRESH_ALLNODES = "EVENT_ROGUELIKE_REFRESH_ALLNODES", --刷新节点
EVENT_ROGUELIKE_BUFFIDS_CHANGES = "EVENT_ROGUELIKE_BUFFIDS_CHANGES", --玩家buff改变
EVENT_ROGUELIKE_TEAMEFFECT_CHANGES = "EVENT_ROGUELIKE_TEAMEFFECT_CHANGES", --队伍效果改变
EVENT_ROGUELIKE_NODE_ADJUSTION = "EVENT_ROGUELIKE_NODE_ADJUSTION", --节点位置调整
EVENT_ROGUELIKE_TASK_RESET = "EVENT_ROGUELIKE_TASK_RESET", --重置任务
EVENT_ROGUELIKE_ILLEGAL_SHOP_RESET = "EVENT_ROGUELIKE_ILLEGAL_SHOP_RESET", --重置黑市商店
EVENT_ROGUELIKE_SECTIONTYPE_CHANGE = "EVENT_ROGUELIKE_SECTIONType_CHANGE", --试炼模式开启
EVENT_ROGUELIKE_SECTION_REFRESH = "EVENT_ROGUELIKE_SECTION_REFRESH", --重置进度
EVENT_ROGUELIKE_TRIALPOINT_CHANGE = "EVENT_ROGUELIKE_TRIALPOINT_CHANGE", --积分更新
-- 公会系统
EVENT_GUILD_RECEIVE_CHAT = "EVENT_GUILD_RECEIVE_CHAT", --公会收到消息
EVENT_GUILD_UPDATE_MEMBER_INFO = "EVENT_GUILD_UPDATE_MEMBER_INFO", --刷新公会信息,只刷不增加
EVENT_GUILD_ALLRANKNAME_UPDATE = "EVENT_GUILD_ALLRANKNAME_UPDATE", --公会自定义职位修改
EVENT_GUILD_LEVEL_CHANGED = "EVENT_GUILD_LEVEL_CHANGED", --公会等级变化
EVENT_GUILD_MAINTAIN_STATE_CHANGED = "EVENT_GUILD_MAINTAIN_STATE_CHANGED", --公会维护状态变化
EVENT_GUILD_BUILD_CHANGED = "EVENT_GUILD_BUILD_CHANGED", --公会建设度变化
EVENT_GUILD_CONTRIBUTE_CHANGED = "EVENT_GUILD_CONTRIBUTE_CHANGED", --公会贡献变化
EVENT_GUILD_GIFT_CONTRIBUTE_CHANGED = "EVENT_GUILD_GIFT_CONTRIBUTE_CHANGED", --公会礼包贡献进度变化
EVENT_GUILD_APPLY_LIST_CHANGED = "EVENT_GUILD_APPLY_LIST_CHANGED", --公会申请列表变化
EVENT_GUILD_MEMBER_CONTRIBUTE_CONDITION = "EVENT_GUILD_MEMBER_CONTRIBUTE_CONDITION", --公会成员领取贡献
EVENT_GUILD_RANKLEVEL_CHANGED = "EVENT_GUILD_RANKLEVEL_CHANGED", --公会职位变化
EVENT_GUILD_WEEKLY_RESET = "EVENT_GUILD_WEEKLY_RESET", --公会周重置
EVENT_GUILD_LEADER_DISSMISS = "EVENT_GUILD_LEADER_DISSMISS", --会长罢免
EVENT_GUILD_NOTICE = "EVENT_GUILD_NOTICE", --公会消息同步
EVENT_GUILD_NAME_CHANGED = "EVENT_GUILD_NAME_CHANGED", -- 公会名称变化
EVENT_GUILD_DECLARATION_CHANGED = "EVENT_GUILD_DECLARATION_CHANGED", -- 公会宣言变化
EVENT_GUILD_INTERCOM_CHANGED = "EVENT_GUILD_INTERCOM_CHANGED", -- 公会内部通讯变化
EVENT_GUILD_FILTER_FINISH = "EVENT_GUILD_FILTER_FINISH", -- 返回过滤后的内容
EVENT_GUILD_TALENT_ASYNC = "EVENT_GUILD_TALENT_ASYNC", --公会天赋变化
EVNET_GUILD_LEADER_NAME_CHANGED = "EVNET_GUILD_LEADER_NAME_CHANGED", --队长职位变化
EVNET_GUILD_LEADER_CHANGED = "EVNET_GUILD_LEADER_CHANGED", --队员数据变化
EVENT_GUILD_MEMBERCOUNT_CHANGED = "EVENT_GUILD_MEMBERCOUNT_CHANGED", --队员人数变化
EVENT_GUILD_RECRUIT_LIST_CHANGED = "EVENT_GUILD_RECRUIT_LIST_CHANGED", --招募列表变化
EVENT_GUILD_MEMBER_SET = "EVENT_GUILD_MEMBER_SET", --点击成员的设置面板
--工会boss
EVENT_GUILDBOSS_HPBOX_CHANGED = "EVENT_GUILDBOSS_HPBOX_CHANGED", --有工会bosshp奖励可以领
EVENT_GUILDBOSS_SCOREBOX_CHANGED = "EVENT_GUILDBOSS_SCOREBOX_CHANGED", --有工会boss积分奖励可以领
--充值失败
EVNET_FAIL_PAY = "EVNET_FAIL_PAY",
EVENT_HGSDK_SETPASS_RESULT = "EVENT_HGSDK_SETPASS_RESULT",
EVENT_LOGIN_ATTENTION = "EVENT_LOGIN_ATTENTION",
--图鉴系统
EVNET_ARCHIVE_MONSTER_KILLCOUNTCHANGE = "EVNET_ARCHIVE_MONSTER_KILLCOUNTCHANGE", --怪物击杀(任一怪物)数发生改变
EVNET_ARCHIVE_MONSTER_UNLOCKMONSTER = "EVNET_ARCHIVE_MONSTER_UNLOCKMONSTER", --消除新怪红点
EVNET_ARCHIVE_MONSTER_UNLOCKMONSTERINFO = "EVNET_ARCHIVE_MONSTER_UNLOCKMONSTERINFO", --消除怪物新信息红点
EVNET_ARCHIVE_MONSTER_UNLOCKMONSTERSKILL = "EVNET_ARCHIVE_MONSTER_UNLOCKMONSTERSKILL", --消除怪物新技能红点
EVNET_ARCHIVE_MONSTER_UNLOCKMONSTERSETTING = "EVNET_ARCHIVE_MONSTER_UNLOCKMONSTERSETTING", --消除怪物新设定红点
EVENET_ARCHIVE_NEW_WEAPON = "EVENET_ARCHIVE_NEW_WEAPON", --新的武器
EVENET_ARCHIVE_UNLOCK_WEAPON = "EVENET_ARCHIVE_UNLOCK_WEAPON", --记录武器的红点
EVENET_ARCHIVE_UNLOCK_WEAPON_SETTING = "EVENET_ARCHIVE_UNLOCK_WEAPON_SETTING", --记录武器设定的红点
EVENET_ARCHIVE_NEW_AWARENESS_SUIT = "EVENET_ARCHIVE_NEW_AWARENESS_SUIT", --新的意识套装的红点
EVENET_ARCHIVE_UNLOCK_AWARENESS_SUIT = "EVENET_ARCHIVE_UNLOCK_AWARENESS_SUIT", --记录意识的红点
EVENET_ARCHIVE_UNLOCK_AWARENESS_SETTING = "EVENET_ARCHIVE_UNLOCK_AWARENESS_SETTING", --记录意识设定的红点
EVENET_ARCHIVE_NEW_CG = "EVENET_ARCHIVE_NEW_CG", --新的CG
EVENET_ARCHIVE_MARK_CG = "EVENET_ARCHIVE_MARK_CG", --解除新CG红点
--剧情
EVENT_MOVIE_BREAK_BLOCK = "EVENT_MOVIE_BREAK_BLOCK", --推动剧情下一步进展
EVENT_MOVIE_UI_OPEN = "EVENT_MOVIE_UI_OPEN",
EVENT_MOVIE_UI_DESTROY = "EVENT_MOVIE_UI_DESTROY",
EVENT_MOVIE_UI_CLOSED = "EVENT_MOVIE_UI_CLOSED",--剧情UI完全关闭所有节点清理行为结束
EVENT_MOVIE_AUTO_PLAY = "EVENT_MOVIE_AUTO_PLAY",
-- 狙击战
EVENT_UNIONKILL_BOSSCOUNTCHANGE = "EVENT_UNIONKILL_BOSSCOUNTCHANGE", --击杀boss次数变化
EVENT_UNIONKILL_STAGEINFOCHANGE = "EVENT_UNIONKILL_STAGEINFOCHANGE", --关卡数据变化
EVENT_UNIONKILL_PLAYERINFOCHANGE = "EVENT_UNIONKILL_PLAYERINFOCHANGE", --玩家信息变化
EVENT_UNIONKILL_BOSSHPCHANGE = "EVENT_UNIONKILL_BOSSHPCHANGE", --boss血量变化
EVENT_UNIONKILL_LEAVEROOM = "EVENT_UNIONKILL_LEAVEROOM", --通知玩家离开房间
EVENT_UNIONKILL_TIPSMESSAGE = "EVENT_UNIONKILL_TIPSMESSAGE", --通知消息
EVENT_UNIONKILL_ROOMDATANOTIFY = "EVENT_UNIONKILL_ROOMDATANOTIFY", --收到进入联机副本消息
EVENT_UNIONKILL_ACTIVITYINFO = "EVENT_UNIONKILL_ACTIVITYINFO", --活动信息变化
EVENT_UNIONKILL_FIGHTSTATUS = "EVENT_UNIONKILL_FIGHTSTATUS", --战斗状态变化
EVENT_UNIONKILLROOM_MATCHRESULT = "EVENT_UNIONKILLROOM_MATCHRESULT", --匹配到房间
EVENT_UNIONKILLROOM_KICKOUT = "EVENT_UNIONKILLROOM_KICKOUT", --被踢出队伍
EVENT_UNIONKILLROOM_LEADER_CHANGED = "EVENT_UNIONKILLROOM_LEADER_CHANGED", --队长改变
EVENT_UNIONKILLROOM_PLAYERSTATE_CHANGED = "EVENT_UNIONKILLROOM_PLAYERSTATE_CHANGED", --玩家状态改变
EVENT_UNIONKILLROOM_FIGHTNPC_CHANGED = "EVENT_UNIONKILLROOM_FIGHTNPC_CHANGED", --玩家出站角色改变
EVENT_UNIONKILLROOM_PLAYERENTER = "EVENT_UNIONKILLROOM_PLAYERENTER", --有玩家加入
EVENT_UNIONKILLROOM_PLAYERLEAVE = "EVENT_UNIONKILLROOM_PLAYERLEAVE", --玩家离开
EVENT_UNIONKILLROOM_AUTOMATCHCHANGE = "EVENT_UNIONKILLROOM_AUTOMATCHCHANGE", --快速匹配变化
--工会boss
EVENT_GUILDBOSS_UPDATEDIFF = "EVENT_GUILDBOSS_UPDATEDIFF", --设置下期难度后刷新难度页面
EVENT_GUILDBOSS_UPDATEORDER = "EVENT_GUILDBOSS_UPDATEORDER", --设置战术布局后刷新难度页面
-- 边界公约
EVENT_FUBEN_ASSIGN_STAGE_CLICK = "EVENT_FUBEN_ASSIGN_STAGE_CLICK", -- 点击关卡组
EVENT_FUBEN_ASSIGN_STAGE_DETAIL_CLOSE = "EVENT_FUBEN_ASSIGN_STAGE_DETAIL_CLOSE", -- 关闭出战准备界面
EVENT_FUBEN_ASSIGN_FORMATION_CONFIRM = "EVENT_FUBEN_ASSIGN_FORMATION_CONFIRM", -- 编队保存
EVENT_ASSIGN_SELECT_OCCUPY_BEGIN = "EVENT_ASSIGN_SELECT_OCCUPY_BEGIN", -- 选择了驻守成员
EVENT_ASSIGN_SELECT_OCCUPY_END = "EVENT_ASSIGN_SELECT_OCCUPY_END", -- 确认了所选的驻守成员
EVENT_ON_ASSIGN_TEAM_CHANGED = "EVENT_ON_ASSIGN_TEAM_CHANGED",
EVENT_ASSIGN_REFRESH_FORMATION = "EVENT_ASSIGN_REFRESH_FORMATION", -- 刷新编队界面
EVENET_ASSIGN_CAN_REWARD = "EVENET_ASSIGN_CAN_REWARD", -- 可领奖红点
EVENT_REFRESH_CHRACTER_ABLIITY = "EVENT_REFRESH_CHRACTER_ABLIITY", -- 刷新战力
--回归活动
EVENT_REGRESSION_OPEN_STATUS_UPDATE = "EVENT_REGRESSION_OPEN_STATUS_UPDATE", -- 回归活动状态更新
EVENT_REGRESSION_TASK_SCHEDULE_UPDATE = "EVENT_REGRESSION_TASK_SCHEDULE_UPDATE", -- 回归活动进度和进度奖励刷新
EVENT_REGRESSION_TASK_SCHEDULE_REWARD_GET = "EVENT_REGRESSION_TASK_SCHEDULE_REWARD_GET", --获取回归活动任务进度奖励
EVENT_REGRESSION_SEND_INVITATION_INFO_UPDATE = "EVENT_REGRESSION_SEND_INVITATION_INFO_UPDATE", -- 获取邀请他人信息更新
-- 战斗字幕
EVENT_FIGHT_WORDS_NEXT = "EVENT_FIGHT_WORDS_NEXT", -- 战斗字幕播放下一条
-- 区域联机
EVENT_ARENAONLINE_WEEK_REFRESH = "EVENT_ARENAONLINE_WEEK_REFRESH", --区域连接周更新
EVENT_ARENAONLINE_DAY_REFRESH = "EVENT_ARENAONLINE_DAY_REFRESH", --区域连接日更新
-- 看图作文
EVENT_PICCOMPOSITION_GET_WORD = "EVENT_PICCOMPOSITION_GET_WORD", --获取屏蔽词
EVENT_PICCOMPOSITION_GET_RANKDATA = "EVENT_PICCOMPOSITION_GET_RANKDATA", --获取排行数据
EVENT_PICCOMPOSITION_GET_OTHERDATA = "EVENT_PICCOMPOSITION_GET_OTHERDATA", --获取过审作品数据
EVENT_PICCOMPOSITION_GET_MYDATA = "EVENT_PICCOMPOSITION_GET_MYDATA", --获取自己作品数据
-- 副本商店
EVENT_FUBEN_DAILY_SHOP_CHECK_NEW = "EVENT_FUBEN_DAILY_SHOP_CHECK_NEW", --获取套装更新
--特训关
EVENT_FUBEN_SPECIAL_TRAIN_REWARD = "EVENT_FUBEN_SPECIAL_TRAIN_REWARD", --领奖
EVENT_FUBEN_SPECIAL_TRAIN_ACTIVITY_CHANGE = "EVENT_FUBEN_SPECIAL_TRAIN_ACTIVITY_CHANGE", --领奖
--小游戏
EVENT_ELIMINATEGAME_GET_REWARD = "EVENT_ELIMINATEGAME_GET_REWARD", --领奖
EVENT_ELIMINATEGAME_RESET = "EVENT_ELIMINATEGAME_RESET", --重置
-- 点消小游戏
EVENT_CLICKCLEARGAME_INIT_COMPLETE = "EVENT_CLICKCLEARGAME_INIT_COMPLETE", --点消小游戏初始化完成
EVENT_CLICKCLEARGAME_HEAD_COUNT_CHANGED = "EVENT_CLICKCLEARGAME_HEAD_COUNT_CHANGED", -- 头像数据更新
EVENT_CLICKCLEARGAME_GAME_PLAYING = "EVENT_CLICKCLEARGAME_GAME_PLAYING", -- 游戏开始游玩
EVENT_CLICKCLEARGAME_GAME_PAUSE = "EVENT_CLICKCLEARGAME_GAME_PAUSE", -- 游戏暂停
EVENT_CLICKCLEARGAME_GAME_ACCOUNT = "EVENT_CLICKCLEARGAME_GAME_ACCOUNT", -- 点消小游戏结算
EVENT_CLICKCLEARGAME_GAME_RESET = "EVENT_CLICKCLEARGAME_GAME_RESET", -- 点消小游戏重置
EVENT_CLICKCLEARGAME_GAME_PAGE_CHANGED = "XEventId.EVENT_CLICKCLEARGAME_GAME_PAGE_CHANGED", -- 头像页发生变动
EVENT_CLICKCLEARGAME_TAKED_REWARD = "EVENT_CLICKCLEARGAME_TAKED_REWARD", -- 领取小游戏奖励
EVENT_CLICKCLEARGAME_FINISHED_GAME = "EVENT_CLICKCLEARGAME_FINISHED_GAME", -- 点消小游戏完成
-- 拼图小游戏
EVENT_DRAG_PUZZLE_GAME_GET_PIECE = "EVENT_DRAG_PUZZLE_GAME_GET_PIECE", -- 获取了拼图碎片
EVENT_DRAG_PUZZLE_GAME_PUZZLE_CHANGED = "EVENT_DRAG_PUZZLE_GAME_PUZZLE_CHANGED", -- 拼图数据发生改变
EVENT_DRAG_PUZZLE_GAME_PUZZLE_COMPLETE = "EVENT_DRAG_PUZZLE_GAME_PUZZLE_COMPLETE", -- 拼图完成
EVENT_DRAG_PUZZLE_GAME_GOT_REWARD = "EVENT_DRAG_PUZZLE_GAME_GOT_REWARD", -- 获取了奖励
EVENT_DRAG_PUZZLE_GAME_PLAYED_VIDEO = "EVENT_DRAG_PUZZLE_GAME_PLAYED_VIDEO", -- 播放了通关剧情
EVENT_DRAG_PUZZLE_GAME_PUZZLE_DECRYPTION = "EVENT_DRAG_PUZZLE_GAME_PUZZLE_DECRYPTION", -- 进入解密状态
EVENT_DRAG_PUZZLE_GAME_CHANGE_PASSWORD = "EVENT_DRAG_PUZZLE_GAME_CHANGE_PASSWORD", -- 更改解密密码
EVENT_DRAG_PUZZLE_GAME_PUZZLE_CHECK_WORD_ERROR = "EVENT_DRAG_PUZZLE_GAME_PUZZLE_CHECK_WORD_ERROR", -- 校验了密码
-- 圣诞树装饰小游戏
EVENT_CHRISTMAS_TREE_ORNAMENT_ACTIVE = "EVENT_CHRISTMAS_TREE_ORNAMENT_ACTIVE", -- 获取了饰品
EVENT_CHRISTMAS_TREE_ORNAMENT_READ = "EVENT_CHRISTMAS_TREE_ORNAMENT_READ", -- 使用了饰品
EVENT_CHRISTMAS_TREE_GOT_REWARD = "EVENT_CHRISTMAS_TREE_GOT_REWARD", -- 领取了奖励
-- 春节对联小游戏
EVENT_COUPLET_GAME_GET_WORD = "EVENT_COUPLET_GAME_GET_WORD", -- 获取了文字
EVENT_COUPLET_GAME_COMPLETE = "EVENT_COUPLET_GAME_COMPLETE", -- 成功完成对联
EVENT_COUPLET_GAME_SENTENCE_ERROR = "EVENT_COUPLET_GAME_SENTENCE_ERROR", -- 校验对联失败
EVENT_COUPLET_GAME_CHANGE_WORD = "EVENT_COUPLET_GAME_CHANGE_WORD", -- 交换了文字
EVENT_COUPLET_GAME_FINISH_TASK = "EVENT_COUPLET_GAME_FINISH_TASK", -- 领取了任务奖励
EVENT_COUPLET_GAME_PLAYED_VIDEO = "EVENT_COUPLET_GAME_PLAYED_VIDEO", -- 播放剧情
--武器涂装
EVENT_FASHION_WEAPON_EXPIRED_REFRESH = "EVENT_FASHION_WEAPON_EXPIRED_REFRESH", --武器涂装过期刷新
--感染体玩法
EVENT_INFESTOREXPLORE_REFRESH_PALYER_RANK = "EVENT_INFESTOREXPLORE_REFRESH_PALYER_RANK", --第一阶段玩家排行数据更新
EVENT_INFESTOREXPLORE_SELECT_CORE = "EVENT_INFESTOREXPLORE_SELECT_CORE", --选择核心刷新弹窗UI
EVENT_INFESTOREXPLORE_CORE_PUTON = "EVENT_INFESTOREXPLORE_CORE_PUTON", --穿戴核心
EVENT_INFESTOREXPLORE_CORE_TAKEOFF = "EVENT_INFESTOREXPLORE_CORE_TAKEOFF", --脱下核心
EVENT_INFESTOREXPLORE_CORE_DECOMPOESE = "EVENT_INFESTOREXPLORE_CORE_DECOMPOESE", --分解核心
EVENT_INFESTOREXPLORE_MOVE_TO_NEXT_NODE = "EVENT_INFESTOREXPLORE_MOVE_TO_NEXT_NODE", --移动到下一节点
EVENT_INFESTOREXPLORE_CHAPTER_FINISH = "EVENT_INFESTOREXPLORE_CHAPTER_FINISH", --章节完成
EVENT_FIGHT_INFESTOR_SCORE_CHANGE = "EVENT_FIGHT_INFESTOR_SCORE_CHANGE", --讨伐值变化
EVENT_INFESTOREXPLORE_CONTRACT_DAILY_RESET = "EVENT_INFESTOREXPLORE_CONTRACT_DAILY_RESET", --灾厄合约每日重置
EVENT_INFESTOREXPLORE_CHARACTER_HP_CHANGE = "EVENT_INFESTOREXPLORE_CHARACTER_HP_CHANGE", --队伍成员血量变化
EVENT_INFESTOREXPLORE_RESET = "EVENT_INFESTOREXPLORE_RESET", --玩法阶段重置
--剧情相关
EVENT_MOVIE_BEGIN = "EVENT_MOVIE_BEGIN", --开始播放剧情
EVENT_MOVIE_END = "EVENT_MOVIE_END", --剧情结束
--水上乐园
EVENT_STORY_DISTORY = "EVENT_STORY_DISSTORY", --关闭新星辰剪影
--虚像地平线
EVENT_EXPEDITION_ACTIVECOMBOLIST_CHANGE = "EVENT_EXPEDITION_ACTIVECOMBOLIST_CHANGE", --激活羁绊发生变动时
EVENT_EXPEDITION_MEMBERLIST_CHANGE = "EVENT_EXPEDITION_MEMBERLIST_CHANGE", --成员发生变动时
EVENT_EXPEDITION_RECRUIT_REFRESH = "EVENT_EXPEDITION_RECRUIT_REFRESH", --招募成员刷新时
EVENT_EXPEDITION_RECRUITTIME_REFRESH = "EVENT_EXPEDITION_RECRUITTIME_REFRESH", --招募次数刷新时
EVENT_EXPEDITION_RANKING_REFRESH = "EVENT_EXPEDITION_RANKING_REFRESH", --排行榜刷新
EVENT_EXPEDITION_COMMENTS_RECEIVE = "EVENT_EXPEDITION_COMMENTS_RECEIVE", --接收评论时
EVENT_EXPEDITION_COMMENTS_DOLIKE = "EVENT_EXPEDITION_COMMENTS_DOLIKE", --点赞成功时
EVENT_EXPEDITION_COMMENTS_SEND = "EVENT_EXPEDITION_COMMENTS_SEND", --发送自己信息成功时
EVENT_EXPEDITION_ON_GET_CHAPTER_REWARD = "EVENT_EXPEDITION_ON_GET_CHAPTER_REWARD", --获取到章节奖励
--世界boss相关
EVENT_WORLDBOSS_SYNCDATA = "EVENT_WORLDBOSS_SYNCDATA", --同步世界boss公共数据
EVENT_WORLDBOSS_TASK_RESET = "EVENT_WORLDBOSS_TASK_RESET", --重置任务
EVENT_WORLDBOSS_REPORT = "EVENT_WORLDBOSS_REPORT", --同步战报
--兵法蓝图
EVENT_RPGTOWER_RESET = "EVENT_RPGTOWER_RESET", -- 兵法蓝图角色数据重置
EVENT_RPGTOWER_MEMBERCHANGE = "EVENT_RPGTOWER_MEMBERCHANGE", -- 兵法蓝图角色数据变化时
EVENT_RPGTOWER_ON_LEVELUP = "EVENT_RPGTOWER_ON_LEVELUP", -- 兵法蓝图角色升级成功时
EVENT_RPGTOWER_ON_TALENT_UNLOCK = "EVENT_RPGTOWER_ON_TALENT_UNLOCK", -- 兵法蓝图角色天赋解锁成功时
EVENT_RPGTOWER_REFRESH_DAILYREWARD = "EVENT_RPGTOWER_REFRESH_DAILYREWARD", -- 兵法蓝图获取每日补给
--大富翁
EVENT_MAINTAINERACTION_DAY_UPDATA = "EVENT_MAINTAINERACTION_DAY_UPDATA", --日更新
EVENT_MAINTAINERACTION_WEEK_UPDATA = "EVENT_MAINTAINERACTION_WEEK_UPDATA", --周更新
EVENT_MAINTAINERACTION_USECARD = "EVENT_MAINTAINERACTION_USECARD", --用卡
EVENT_MAINTAINERACTION_SELECTCARD = "EVENT_MAINTAINERACTION_SELECTCARD", --选卡
EVENT_MAINTAINERACTION_NODE_CHANGE = "EVENT_MAINTAINERACTION_NODE_CHANGE", --更换地图节点
--跑团玩法
EVENT_TRPG_MAZE_MOVE_NEXT = "EVENT_TRPG_MAZE_MOVE_NEXT", --迷宫前进
EVENT_TRPG_MAZE_MOVE_TO = "EVENT_TRPG_MAZE_MOVE_TO", --迷宫跳转
EVENT_TRPG_MAZE_RESTART = "EVENT_TRPG_MAZE_RESTART", --迷宫重新开始
EVENT_TRPG_MAZE_RECORD_CARD = "EVENT_TRPG_MAZE_RECORD_CARD", --迷宫新增卡牌记录
EVENT_TRPG_UPDATE_TARGET = "EVENT_TRPG_UPDATE_TARGET", --通知刷新目标
EVENT_TRPG_WORLDBOSS_SYNCDATA = "EVENT_TRPG_WORLDBOSS_SYNCDATA", --同步世界boss数据
EVENT_TRPG_EXAMINE_DATA_CHANGE = "EVENT_TRPG_EXAMINE_DATA_CHANGE", --检定数据改变
EVENT_TRPG_EXAMINE_RESULT_SYN = "EVENT_TRPG_EXAMINE_RESULT_SYN", --检定结果通知
EVENT_TRPG_EXAMINE_ROUND_CHANGE = "EVENT_TRPG_EXAMINE_ROUND_CHANGE", --检定轮次变更
EVENT_TRPG_ROLES_DATA_CHANGE = "EVENT_TRPG_ROLES_DATA_CHANGE", --调查员数据改变
EVENT_TRPG_FUNCTION_FINISH_SYN = "EVENT_TRPG_FUNCTION_FINISH_SYN", --功能完成通知
EVENT_TRPG_SHOP_INFO_CHANGE = "EVENT_TRPG_SHOP_INFO_CHANGE", --商店数据发生改变
EVENT_TRPG_BASE_INFO_CHANGE = "EVENT_TRPG_BASE_INFO_CHANGE", --经验、等级、耐力发生改变
EVENT_TRPG_GET_MEMOIR_REWARD = "EVENT_TRPG_GET_MEMOIR_REWARD", --成功领取珍藏奖励
EVENT_TRPG_GET_REWARD = "EVENT_TRPG_GET_REWARD", --成功领取奖励
EVENT_TRPG_BOSS_HP_SYN = "EVENT_TRPG_BOSS_HP_SYN", --跑团世界BOSS血量通知
EVENT_TRPG_FIRST_OPEN_TRUTH_ROAD = "EVENT_TRPG_FIRST_OPEN_TRUTH_ROAD", --首次打开求真之路
EVENT_TRPG_FIRST_OPEN_COLLECTION = "EVENT_TRPG_FIRST_OPEN_COLLECTION", --首次打开珍藏
EVENT_TRPG_OPEN_LEVEL_DIALOG = "EVENT_TRPG_OPEN_LEVEL_DIALOG", --打开等级说明弹窗
--师徒系统
EVENT_CHAT_RECEIVE_MENTOR_MSG = "EVENT_CHAT_RECEIVE_MENTOR_MSG", --收到师徒聊天信息
EVENT_MENTOR_GET_APPLY = "EVENT_MENTOR_GET_APPLY", --收到一条申请
EVENT_MENTOR_OPERATION_APPLY = "EVENT_MENTOR_OPERATION_APPLY", --处理申请
EVENT_MENTOR_GET_TEACHER = "EVENT_MENTOR_GET_TEACHER", --得到一个老师
EVENT_MENTOR_GET_STUDENT = "EVENT_MENTOR_GET_STUDENT", --得到一个学生
EVENT_MENTOR_LOSE_TEACHER = "EVENT_MENTOR_LOSE_TEACHER", --失去一个老师
EVENT_MENTOR_LOSE_STUDENT = "EVENT_MENTOR_LOSE_STUDENT", --失去一个学生
EVENT_MENTOR_TEACHERORSTUDENT_CHANGE = "EVENT_MENTOR_TEACHERORSTUDENT_CHANGE", --师生列表发生改变
EVENT_MENTOR_SHIPCHANGE = "EVENT_MENTOR_SHIPCHANGE", --身份转变
EVENT_MENTOR_CAN_GRADUATE = "EVENT_MENTOR_CAN_GRADUATE", --可毕业通知
EVENT_MENTOR_GRADUATE_STUDENT = "EVENT_MENTOR_GRADUATE_STUDENT", --毕业一个学生
EVENT_MENTOR_STUDENT_SYSTEMTASK_CHANGE = "EVENT_MENTOR_STUDENT_SYSTEMTASK_CHANGE", --学生的系统任务发生改变(学生身份)
EVENT_MENTOR_STUDENT_WEEKLYTASK_CHANGE = "EVENT_MENTOR_STUDENT_WEEKLYTASK_CHANGE", --学生的已接任务状态发生改变(学生身份)
EVENT_MENTOR_STUDENT_TASKCOUNT_CHANGE = "EVENT_MENTOR_STUDENT_TASKCOUNT_CHANGE", --学生的完成任务数发生改变
EVENT_MENTOR_TEACHER_STUDENTWEEKLYTASK_CHANGE = "EVENT_MENTOR_TEACHER_STUDENTWEEKLYTASK_CHANGE", --学生的已接任务状态发生改变(老师身份)
EVENT_MENTOR_TEACHER_STUDENTSYSTEMTASK_CHANGE = "EVENT_MENTOR_TEACHER_STUDENTSYSTEMTASK_CHANGE", --学生的系统任务发生改变(老师身份)
EVENT_MENTOR_GETREWARD = "EVENT_MENTOR_GETREWARD", --学生或老师领取奖励
EVENT_MENTOR_INTASKUI = "EVENT_MENTOR_INTASKUI", --进任务界面
EVENT_MENTOR_DAY_RESET = "EVENT_MENTOR_DAY_RESET", --日更新
EVENT_MENTOR_WEEK_RESET = "EVENT_MENTOR_WEEK_RESET", --周更新
EVENT_MENTOR_TEACHER_CHANGECOUNT_PLUS = "EVENT_MENTOR_TEACHER_CHANGECOUNT_PLUS", --任务可更变数增加
EVENT_MENTOR_MEMBERLEVEL_CHANGE = "EVENT_MENTOR_MEMBERLEVEL_CHANGE", --成员(老师/学生)等级改变
EVENT_MENTOR_AUTO_GRADUATE = "EVENT_MENTOR_AUTO_GRADUATE", --到达等级后自动毕业
EVENT_MENTOR_TEACHER_MONTHLYSTUDENTCOUNT_UPDATE = "EVENT_MENTOR_TEACHER_MONTHLYSTUDENTCOUNT_UPDATE", --通知老师本月已招募学员数改变
EVENT_MENTOR_MESSAGE_UPDATE = "EVENT_MENTOR_MESSAGE_UPDATE", --通知所有人留言改变
EVENT_MENTOR_ONLINE_UPDATE = "EVENT_MENTOR_ONLINE_UPDATE", --通知所有人在线状态
EVENT_MENTOR_TEACHER_ACTIVATION_UPDATE = "EVENT_MENTOR_TEACHER_ACTIVATION_UPDATE",--通知老师获得活跃度礼物
--尼尔玩法
EVENT_NIER_ACTIVITY_REFRESH = "EVENT_NIER_ACTIVITY_REFRESH",
EVENT_NIER_ACTIVITY_END = "EVENT_NIER_ACTIVITY_END",
EVENT_NIER_CHARACTER_UPDATE = "EVENT_NIER_CHARACTER_UPDATE", --尼尔角色改变
EVENT_NIER_POD_UPDATE = "EVENT_NIER_POD_UPDATE", --尼尔辅助机
EVENT_NIER_REPEAT_CLICK = "EVENT_NIER_REPEAT_CLICK",
--口袋妖怪
EVENT_POKEMON_MONSTERS_DATA_CHANGE = "EVENT_POKEMON_MONSTERS_DATA_CHANGE", --怪物信息改变
EVENT_POKEMON_MONSTERS_LEVEL_UP = "EVENT_POKEMON_MONSTERS_LEVEL_UP", --怪物升级
EVENT_POKEMON_MONSTERS_STAR_UP = "EVENT_POKEMON_MONSTERS_STAR_UP", --怪物升星
EVENT_POKEMON_MONSTERS_SKILL_SWITCH = "EVENT_POKEMON_MONSTERS_SKILL_SWITCH", --怪物技能切换
EVENT_POKEMON_REMAINING_TIMES_CHANGE = "EVENT_POKEMON_REMAINING_TIMES_CHANGE", --剩余次数改变
EVENT_POKEMON_PASSED_STAGE_CHANGE = "EVENT_POKEMON_PASSED_STAGE_CHANGE", --通关关卡改变
EVENT_POKEMON_RED_POINT_TIME_SUPPLY = "EVENT_POKEMON_RED_POINT_TIME_SUPPLY", --时间奖励红点
--战斗属性同步
EVENT_ATTRIBUTE_MANAGER_INIT = "EVENT_ATTRIBUTE_MANAGER_INIT", --属性manager初始化完成
--炸服押注
EVENT_GUARD_CAMP_ACTIVITY_DATA_CHANGE = "EVENT_GUARD_CAMP_ACTIVITY_DATA_CHANGE", --活动数据发生改变通知
EVENT_GUARD_CAMP_ACTIVITY_OPEN_STATE_CHANGE = "EVENT_GUARD_CAMP_ACTIVITY_OPEN_STATE_CHANGE", --活动状态发生改变
--@region 追击玩法
--追击地图更新
EVENT_CHESSPURSUIT_MAP_UPDATE = "EVENT_CHESSPURSUIT_MAP_UPDATE",
--保存队伍
EVENT_CHESSPURSUIT_SAVETEAM = "EVENT_CHESSPURSUIT_SAVETEAM",
--战斗胜利
EVENT_CHESSPURSUIT_FIGHT_FINISH_WIN = "EVENT_CHESSPURSUIT_FIGHT_FINISH_WIN",
--商店买卡
EVENT_CHESSPURSUIT_BUY_CARD = "EVENT_CHESSPURSUIT_BUY_CARD",
--@endregion
--组合小游戏
EVENT_COMPOSEGAME_BAGITEM_REFRESH = "EVENT_COMPOSEGAME_BAGITEM_REFRESH", --组合小游戏背包道具刷新
EVENT_COMPOSEGAME_ITEM_COMPOSE = "EVENT_COMPOSEGAME_ITEM_COMPOSE", --组合小游戏道具合成事件
EVENT_COMPOSEGAME_SHOP_REFRESH_TIME_CHANGE = "EVENT_COMPOSEGAME_SHOP_REFRESH_TIME_CHANGE", --组合小游戏商店刷新次数改变
EVENT_COMPOSEGAME_SHOP_ITEM_REFRESH = "EVENT_COMPOSEGAME_SHOP_ITEM_REFRESH", --组合小游戏商店商品刷新
EVENT_COMPOSEGAME_SCHEDULE_REFRESH = "EVENT_COMPOSEGAME_SCHEDULE_REFRESH", --组合小游戏进度刷新
EVENT_COMPOSEGAME_TREASURE_GET = "EVENT_COMPOSEGAME_TREASURE_GET", --组合小游戏领取宝箱奖励时
EVENT_COMPOSEGAME_RESET = "EVENT_COMPOSEGAME_RESET", --组合小游戏重置或关闭
--伙伴系统
EVENT_PARTNER_DATAUPDATE = "EVENT_PARTNER_DATAUPDATE", --伙伴数据更新
EVENT_PARTNER_OBTAIN = "EVENT_PARTNER_OBTAIN", --伙伴获得
EVENT_PARTNER_SKILLCHANGE = "EVENT_PARTNER_SKILLCHANGE", --伙伴技能变动(等级激活)
EVENT_PARTNER_CARRY = "EVENT_PARTNER_CARRY", --伙伴携带状况变动
EVENT_PARTNER_SKILLUNLOCK = "EVENT_PARTNER_SKILLUNLOCK", --伙伴技能解锁
EVENT_PARTNER_QUALITYUP = "EVENT_PARTNER_QUALITYUP", --伙伴品质改变
EVENT_PARTNER_SKILLUNLOCK_CLOSERED = "EVENT_PARTNER_SKILLUNLOCK_CLOSERED", --关闭技能解锁红点
EVENT_PARTNER_ABLITYCHANGE = "EVENT_PARTNER_ABLITYCHANGE", --战力改变
EVENT_PARTNER_DECOMPOSE = "EVENT_PARTNER_DECOMPOSE", --分解
--春节集字活动
EVENT_SPRING_FESTIVAL_COLLECT_CARD_REFRESH = "EVENT_SPRING_FESTIVAL_COLLECT_CARD_REFRESH", --集字界面刷新
EVENT_SPRING_FESTIVAL_SMASH_EGGS_REFRESH = "EVENT_SPRING_FESTIVAL_SMASH_EGGS_REFRESH", --砸蛋界面刷新
EVENT_SPRING_FESTIVAL_GIFT_BAG_REFRESH = "EVENT_SPRING_FESTIVAL_GIFT_BAG_REFRESH", --礼物界面刷新
EVENT_SPRING_FESTIVAL_GIFT_BAG_RED = "EVENT_SPRING_FESTIVAL_GIFT_BAG_RED", --礼物界面红点
EVENT_SPRING_FESTIVAL_REWARD_RED = "EVENT_SPRING_FESTIVAL_REWARD_RED", --礼物界面红点
--超级据点
EVENT_STRONGHOLD_CUR_DAY_CHANGE = "EVENT_STRONGHOLD_CUR_DAY_CHANGE", --当前天数改变
EVENT_STRONGHOLD_ACTIVITY_STATUS_CHANGE = "EVENT_STRONGHOLD_ACTIVITY_STATUS_CHANGE", --活动状态改变
EVENT_STRONGHOLD_ACTIVITY_END = "EVENT_STRONGHOLD_ACTIVITY_END", --当期活动结束通知
EVENT_STRONGHOLD_MINERAL_RECORD_CHANGE = "EVENT_STRONGHOLD_MINERAL_RECORD_CHANGE", --矿产记录变更
EVENT_STRONGHOLD_MINERAL_LEFT_CHANGE = "EVENT_STRONGHOLD_MINERAL_LEFT_CHANGE", --可领取矿石数量变动
EVENT_STRONGHOLD_MAX_ELECTRIC_CHANGE = "EVENT_STRONGHOLD_MAX_ELECTRIC_CHANGE", --电能上限变更
EVENT_STRONGHOLD_ELECTRIC_CHARACTER_CHANGE = "EVENT_STRONGHOLD_ELECTRIC_CHARACTER_CHANGE", --电能队伍变更
EVENT_STRONGHOLD_ENDURANCE_CHANGE = "EVENT_STRONGHOLD_ENDURANCE_CHANGE", --耐力变更
EVENT_STRONGHOLD_BORROW_COUNT_CHANGE = "EVENT_STRONGHOLD_BORROW_COUNT_CHANGE", --援助次数变更
EVENT_STRONGHOLD_FINISH_GROUP_CHANGE = "EVENT_STRONGHOLD_FINISH_GROUP_CHANGE", --据点进度变更
EVENT_STRONGHOLD_NEW_FINISH_GROUP_CHANGE = "EVENT_STRONGHOLD_NEW_FINISH_GROUP_CHANGE", --最新通过据点变更
EVENT_STRONGHOLD_FINISH_REWARDS_CHANGE = "EVENT_STRONGHOLD_FINISH_REWARDS_CHANGE", --已领取奖励变更
EVENT_STRONGHOLD_SHARE_CHARACTER_CHANGE = "EVENT_STRONGHOLD_SHARE_CHARACTER_CHANGE", --共享角色变更
EVENT_STRONGHOLD_PLUGIN_CHANGE_ACK = "EVENT_STRONGHOLD_PLUGIN_CHANGE_ACK", --插件调整确认
EVENT_STRONGHOLD_TEAMLIST_CHANGE = "EVENT_STRONGHOLD_TEAMLIST_CHANGE", --队伍列表变更
EVENT_STRONGHOLD_SUPPORT_CHANGE = "EVENT_STRONGHOLD_SUPPORT_CHANGE", --电能支援角色变更
EVENT_STRONGHOLD_SUPPORT_CANCEL = "EVENT_STRONGHOLD_SUPPORT_CANCEL", --电能支援角色撤回
EVENT_STRONGHOLD_ASSISTANT_CHARACTER_SET_CHANGE = "EVENT_STRONGHOLD_ASSISTANT_CHARACTER_SET_CHANGE", --援助角色变更
EVENT_STRONGHOLD_ACTIVITY_RESULT_CHANGE = "EVENT_STRONGHOLD_ACTIVITY_RESULT_CHANGE", --活动战报变更
EVENT_STRONGHOLD_PAUSE_DAY_CHANGE = "EVENT_STRONGHOLD_PAUSE_DAY_CHANGE", --暂停天数改变
EVENT_STRONGHOLD_RUNE_CHANGE = "EVENT_STRONGHOLD_RUNE_CHANGE", --符文变更
--白色情人节约会活动
EVENT_WHITEVALENTINE_REFRESH_PLACE = "EVENT_WHITEVALENTINE_REFRESH_PLACE", --白色情人节地点数据刷新
EVENT_WHITEVALENTINE_SHOW_PLACE = "EVENT_WHITEVALENTINE_SHOW_PLACE", --白色情人节显示地点
EVENT_WHITEVALENTINE_OPEN_PLACE = "EVENT_WHITEVALENTINE_OPEN_PLACE", --白色情人节新地点开放
EVENT_WHITEVALENTINE_INVITE_CHARA = "EVENT_WHITEVALENTINE_INVITE_CHARA",--白色情人节邀请角色
EVENT_WHITEVALENTINE_ENCOUNTER_CHARA = "EVENT_WHITEVALENTINE_ENCOUNTER_CHARA",--白色情人节偶遇角色
EVENT_WHITEVALENTINE_ENERGY_REFRESH = "EVENT_WHITEVALENTINE_ENERGY_REFRESH",--刷新体力
EVENT_WHITEVALENTINE_INVITE_CHANCE_REFRESH = "EVENT_WHITEVALENTINE_INVITE_CHANCE_REFRESH",--刷新邀约次数
EVENT_WHITEVALENTINE_CHARA_CHANGE = "EVENT_WHITEVALENTINE_CHARA_CHANGE",--角色列表变动时
--萌战
EVENT_MOE_WAR_PREPARATION_GEAR_REWARD = "EVENT_MOE_WAR_PREPARATION_GEAR_REWARD", --赛事筹备领取奖励
EVENT_MOE_WAR_VOTE_SUCC = "EVENT_MOE_WAR_VOTE_SUCC", --投票成功
EVENT_MOE_WAR_UPDATE = "EVENT_MOE_WAR_UPDATE", --服务端推送数据
EVENT_MOE_WAR_ACTIVITY_END = "EVENT_MOE_WAR_ACTIVITY_END", --活动结束
EVENT_MOE_WAR_VOTE_PANEL_UPDATE = "EVENT_MOE_WAR_VOTE_PANEL_UPDATE", --服务端推送数据
EVENT_MOE_WAR_CHECK_RECRUIT_RED_POINT = "EVENT_MOE_WAR_CHECK_RECRUIT_RED_POINT", --检查招募通讯的红点
EVENT_MOE_WAR_PREPARATION_UPDATE = "EVENT_MOE_WAR_PREPARATION_UPDATE", --服务端推送赛事筹备数据
EVENT_MOE_WAR_PLAY_SCREEN_RECORD = "EVENT_MOE_WAR_PLAY_SCREEN_RECORD", --播放滚屏弹幕
EVENT_MOE_WAR_PLAY_SCREEN_RECORD_ANIMATION = "EVENT_MOE_WAR_PLAY_SCREEN_RECORD_ANIMATION", --播放滚屏弹幕动作
EVENT_MOE_WAR_PLAY_THANK_ANIMATION = "EVENT_MOE_WAR_PLAY_THANK_ANIMATION", --播放感谢动画
EVENT_MOE_WAR_PREPARATION_NOTIFY_ASSISTANCE = "EVENT_MOE_WAR_PREPARATION_NOTIFY_ASSISTANCE", --推送赛事筹备援助变化
EVENT_MOE_WAR_PREPARATION_DAILY_RESET = "EVENT_MOE_WAR_PREPARATION_DAILY_RESET", --赛事筹备每日重置推送
--猜拳小游戏
EVENT_FINGER_GUESS_OPEN_EYE = "EVENT_FINGER_GUESS_OPEN_EYE", --开启天眼成功
EVENT_FINGER_GUESS_PLAY_FINGER = "EVENT_FINGER_GUESS_PLAY_FINGER", --出拳成功
EVENT_FINGER_GUESS_GAME_START = "EVENT_FINGER_GUESS_GAME_START", --开始游戏
EVENT_FINGER_GUESS_CHECK_EVENT_FINISH = "EVENT_FINGER_GUESS_CHECK_EVENT_FINISH", --检查事件完结
--库洛姆人物活动
EVENT_KORO_CHAR_ACTIVITY_REDPOINTEVENT = "EVENT_KORO_CHAR_ACTIVITY_REDPOINTEVENT", --人物活动关卡通关事件
--铭牌相关事件
EVENT_NAMEPLATE_CHANGE = "EVENT_NAMEPLATE_CHANGE", --铭牌更新
--翻牌猜大小
EVENT_POKER_GUESSING_UPDATE_SCORE = "EVENT_POKER_GUESSING_UPDATE_SCORE", --翻牌积分更新
EVENT_POKER_GUESSING_UPDATE_STATE = "EVENT_POKER_GUESSING_UPDATE_STATE", --比赛进程更新
EVENT_POKER_GUESSING_UPDATE_RESULT = "EVENT_POKER_GUESSING_UPDATE_RESULT", --比赛结果推送
EVENT_POKER_GUESSING_ACTIVITY_END = "EVENT_POKER_GUESSING_ACTIVITY_END", --活动结束推送
-- 改造玩法
EVENT_REFORM_EVOLVABLE_GROUP_UPDATE = "EVENT_REFORM_EVOLVABLE_GROUP_UPDATE", -- 改造元素更新(敌人、成员、加成和环境)
--刮刮卡
EVENT_SCRATCH_TICKET_ACTIVITY_START = "EVENT_SCRATCH_TICKET_ACTIVITY_START", --刮刮卡活动信息更新
EVENT_SCRATCH_TICKET_OPEN_GRID = "EVENT_SCRATCH_TICKET_OPEN_GRID", --刮刮卡预览格子成功时
EVENT_SCRATCH_TICKET_SHOW_RESULT = "EVENT_SCRATCH_TICKET_SHOW_RESULT", --刮刮卡显示结果
EVENT_SCRATCH_TICKET_RESET = "EVENT_SCRATCH_TICKET_RESET", --刮刮卡完成一局游戏后重置
--剧情合集
EVENT_MOVIE_ASSEMBLE_WATCH_MOVIE = "EVENT_MOVIE_ASSEMBLE_WATCH_MOVIE", -- 剧情合集系统观看了剧情
--翻牌小游戏
EVENT_INVERT_CARD_GAME_CARD_CHANGED = "EVENT_INVERT_CARD_GAME_CARD_CHANGED", -- 翻转卡牌事件
EVENT_INVERT_CARD_GAME_GET_REWARD = "EVENT_INVERT_CARD_GAME_GET_REWARD", -- 获取奖励事件
-- 宠物教学
EVENT_PARTNER_TEACHING_OPEN_STAGE_DETAIL = "EVENT_PARTNER_TEACHING_OPEN_STAGE_DETAIL", -- 宠物教学打开关卡详情
EVENT_PARTNER_TEACHING_CLOSE_STAGE_DETAIL = "EVENT_PARTNER_TEACHING_CLOSE_STAGE_DETAIL", -- 宠物教学关闭关卡详情
EVENT_PARTNER_TEACHING_STAGE_REFRESH = "EVENT_PARTNER_TEACHING_REFRESH", -- 宠物教学关卡刷新
--520端午活动
EVENT_RPG_MAKER_GAME_ACTIVITY_END = "EVENT_RPG_MAKER_GAME_ACTIVITY_END", --活动结束
--扫雷活动
EVENT_MINESWEEPING_STAGESTART = "EVENT_MINESWEEPING_STAGESTART", --开始关卡
EVENT_MINESWEEPING_GRIDOPEN = "EVENT_MINESWEEPING_GRIDOPEN", --开启扫雷格子
EVENT_MINESWEEPING_STORYPLAY = "EVENT_MINESWEEPING_STORYPLAY", --播放剧情
-- 杀戮无双
EVENT_KILLZONE_NEW_CHAPTER_CHANGE = "EVENT_KILLZONE_NEW_CHAPTER_CHANGE", --新章节变更
EVENT_KILLZONE_NEW_DIFF_CHANGE = "EVENT_KILLZONE_NEW_DIFF_CHANGE", --新难度变更
EVENT_KILLZONE_ACTIVITY_END = "EVENT_KILLZONE_ACTIVITY_END", --活动结束
EVENT_KILLZONE_FARM_REWARD_OBTAIN_COUNT_CHANGE = "EVENT_KILLZONE_FARM_REWARD_OBTAIN_COUNT_CHANGE", --复刷奖励领取次数变更
EVENT_KILLZONE_DAILYSTARREWARDINDEX_CHANGE = "EVENT_KILLZONE_DAILYSTARREWARDINDEX_CHANGE", --每日星级奖励档位变更
EVENT_KILLZONE_STAGE_CHANGE = "EVENT_KILLZONE_STAGE_CHANGE", --通关记录变更
EVENT_KILLZONE_STAR_REWARD_OBTAIN_RECORD_CHANGE = "EVENT_KILLZONE_STAR_REWARD_OBTAIN_RECORD_CHANGE", --星级奖励领取记录变更
EVENT_KILLZONE_PLUGIN_CHANGE = "EVENT_KILLZONE_PLUGIN_CHANGE", --插件状态变更
EVENT_KILLZONE_PLUGIN_SLOT_CHANGE = "EVENT_KILLZONE_PLUGIN_SLOT_CHANGE", --插件槽状态变更
EVENT_KILLZONE_PLUGIN_OPERATE_CHANGE = "EVENT_KILLZONE_PLUGIN_OPERATE_CHANGE", --插件待操作Cookie变更
-- 系列涂装剧情活动
EVENT_FASHION_STORY_OPEN_STAGE_DETAIL = "EVENT_FASHION_STORY_OPEN_STAGE_DETAIL", -- 打开章节关卡详情
EVENT_FASHION_STORY_CLOSE_STAGE_DETAIL = "EVENT_FASHION_STORY_CLOSE_STAGE_DETAIL", -- 关闭章节关卡详情
EVENT_FASHION_STORY_OPEN_TRIAL_DETAIL = "EVENT_FASHION_STORY_OPEN_TRIAL_DETAIL", -- 打开试玩关卡详情
EVENT_FASHION_STORY_CHAPTER_REFRESH = "EVENT_FASHION_STORY_CHAPTER_REFRESH", -- 章节关刷新
EVENT_FASHION_STORY_TRIAL_REFRESH = "EVENT_FASHION_STORY_TRIAL_REFRESH", -- 试玩关刷新
-- 超级爬塔
EVENT_ST_FUNCTION_UNLOCK = "EVENT_ST_FUNCTION_UNLOCK", --特权解锁时
EVENT_ST_MAP_THEME_SELECT = "EVENT_ST_MAP_THEME_SELECT", --主界面选某一个主题
EVENT_ST_SHOP_REFRESH = "EVENT_ST_SHOP_REFRESH", --商店刷新
EVENT_ST_PLUGIN_REFRESH = "EVENT_ST_PLUGIN_REFRESH", --插件刷新
EVENT_ST_FINISH_FIGHT_COMPLETE = "EVENT_ST_FINISH_FIGHT_COMPLETE", --结束战斗处理完时
--战斗通行证
EVENT_NOTIFY_PASSPORT_BASE_INFO = "EVENT_NOTIFY_PASSPORT_BASE_INFO", --通知基础信息变化
EVENT_BUY_PASSPORT_COMPLEATE = "EVENT_BUY_PASSPORT_COMPLEATE", --购买通行证成功
EVENT_BUY_EXP_COMPLEATE = "EVENT_BUY_EXP_COMPLEATE", --购买等级成功
EVENT_BUY_RECV_REWARD_COMPLEATE = "EVENT_BUY_RECV_REWARD_COMPLEATE", --领取单个奖励成功
EVENT_BUY_RECV_ALL_REWARD_COMPLEATE = "EVENT_BUY_RECV_ALL_REWARD_COMPLEATE", --一键领取奖励
EVENT_AUTO_GET_TASK_REWARD_LIST = "EVENT_AUTO_GET_TASK_REWARD_LIST", --通知自动领取任务奖励列表
--日服定制化内容
EVENT_BRIEF_CHANGE_TAB = "EVENT_BRIEF_CHANGE_TAB",
EVENT_MEDAL_IN_DETAIL = "EVENT_MEDAL_IN_DETAIL", --进入勋章详情
EVNET_HGSDKLOGIN_SUCCESS = "EVNET_HGSDKLOGIN_SUCCESS",
EVENT_DORM_VISTOR_SKIP = "EVENT_DORM_VISTOR_SKIP",
EVENT_PURCAHSE_YKMAINREFRESH = "EVENT_PURCAHSE_YKMAINREFRESH",
--定制化内容
EVENT_HGSDK_GET_BIND = "EVENT_HGSDK_GET_BIND",
EVENT_HGSDK_BIND_RESULT = "EVENT_HGSDK_BIND_RESULT",
EVENT_HGSDK_SETPASS_RESULT = "EVENT_HGSDK_SETPASS_RESULT",
EVENT_LOGIN_ATTENTION = "EVENT_LOGIN_ATTENTION",
--商店直接使用日元购买
EVENT_SHOP_BUYUSERIYUAN = "EVENT_SHOP_BUYUSERIYUAN",
--采购直接使用日元购买
EVENT_PURCAHSE_BUYUSERIYUAN = "EVENT_PURCAHSE_BUYUSERIYUAN",
--当用户协议更新完毕的时候
EVENT_AGREEMENT_LOAD_FINISH = "EVENT_AGREEMENT_LOAD_FINISH",
EVENT_WHEN_CLOSE_LOGIN_NOTICE = "EVENT_WHEN_CLOSE_LOGIN_NOTICE",
--购买失败的时候触发的消息,用来清空缓存
EVENT_PURCHASEBUY_PAYCANCELORFAIL = "EVENT_PURCHASEBUY_PAYCANCELORFAIL",
--新年运势关闭的时候刷新一次公告界面
EVENT_NEWYEARYUNSHI_CLOSE_REFRESH = "EVENT_NEWYEARYUNSHI_CLOSE_REFRESH",
-- 海外定制老虎机小游戏
EVENT_SLOT_MACHINE_STARTED = "EVENT_SLOT_MACHINE_STARTED",
EVENT_SLOT_MACHINE_GET_REWARD = "EVENT_SLOT_MACHINE_GET_REWARD",
EVENT_SLOT_MACHINE_FINISH_TASK = "EVENT_SLOT_MACHINE_FINISH_TASK",
}

View file

@ -0,0 +1,164 @@
XFightNetwork = XFightNetwork or {}
local IsConnected = false
function XFightNetwork.IsConnected()
return IsConnected
end
-- 心跳相关
local FightHeartbeatRequest = "FightHeartbeatRequest"
local HeartbeatTimeout = CS.XGame.Config:GetInt("FightHeartbeatTimeout")
local HeartbeatInterval = CS.XGame.Config:GetInt("FightHeartbeatInterval")
local HeartbeatTimer
XFightNetwork.DoHeartbeat = function()
if not IsConnected then
return
end
HeartbeatTimer = XScheduleManager.ScheduleOnce(function()
if CS.XNetwork.IsShowNetLog then
XLog.Debug("fight tcp heartbeat time out.")
end
-- 超时断开连接
CS.XFightNetwork.Disconnect()
end, HeartbeatTimeout)
if CS.XFightNetwork.IsShowNetLog then
XLog.Debug("fight tcp heartbeat request.")
end
XFightNetwork.Call(FightHeartbeatRequest, {}, function(res)
XScheduleManager.UnSchedule(HeartbeatTimer)
if CS.XFightNetwork.IsShowNetLog then
XLog.Debug("fight tcp heartbeat response.")
end
if res.Code ~= XCode.Success then
-- 心跳服务器返回错误,断开连接
CS.XFightNetwork.Disconnect()
return
end
HeartbeatTimer = XScheduleManager.ScheduleOnce(function()
XFightNetwork.DoHeartbeat()
end, HeartbeatInterval)
end)
end
function XFightNetwork.Connect(ip, port, cb)
if not ip or not port then
XLog.Debug("Lua.XFightNetwork.Connect error, ip is nil or port is nil")
return
end
-- 成功回调
CS.XFightNetwork.OnConnect = function()
XLog.Debug("Lua.XFightNetwork.Connect Success")
IsConnected = true
if cb then
cb(true)
end
end
-- 网络错误回调
CS.XFightNetwork.OnError = function(socketError)
XLog.Error("Lua.XFightNetwork.Connect error, " .. tostring(socketError:ToString()))
CS.XFightNetwork.Disconnect()
if cb then
cb(false)
end
end
CS.XFightNetwork.OnDisconnect = function()
XLog.Debug("Lua.XFightNetwork.Connect OnDisconnect")
IsConnected = false
end
CS.XFightNetwork.OnRemoteDisconnect = function()
XLog.Error("Lua.XFightNetwork.Connect OnRemoteDisconnect")
IsConnected = false
end
CS.XFightNetwork.OnMessageError = function()
XLog.Error("Lua.XFightNetwork.Connect OnMessageError")
CS.XFightNetwork.Disconnect()
end
CS.XFightNetwork.Connect(ip, tonumber(port))
end
local ConnectKcpTimer
local KcpConnectRequestInterval = 500
function XFightNetwork.ConnectKcp(ip, port, remoteConv, cb)
XLog.Debug("Lua.XFightNetwork.ConnectKcp" .. " ip:" .. tostring(ip) .. " port:" .. tostring(port) .. " remoteConv:" .. tostring(remoteConv))
CS.XFightNetwork.CreateUdpSession()
local networkMode = XSaveTool.GetData(XNetwork.NetworkModeKey) or XNetwork.NetworkMode.Auto
if networkMode == XNetwork.NetworkMode.Auto then
CS.XFightNetwork.UdpConnect(ip, port, CS.XNetwork.NetworkMode.Auto)
elseif networkMode == XNetwork.NetworkMode.Ipv4 then
CS.XFightNetwork.UdpConnect(ip, port, CS.XNetwork.NetworkMode.Ipv4)
elseif networkMode == XNetwork.NetworkMode.Ipv6 then
CS.XFightNetwork.UdpConnect(ip, port, CS.XNetwork.NetworkMode.Ipv6)
else -- Auto保底
CS.XFightNetwork.UdpConnect(ip, port, CS.XNetwork.NetworkMode.Auto)
end
CS.XFightNetwork.CreateKcpSession(remoteConv)
if ConnectKcpTimer then
XScheduleManager.UnSchedule(ConnectKcpTimer)
ConnectKcpTimer = nil
end
-- kcp握手请求
local tryCount = 0
local kcpConnected = false
local startTime = CS.XDateUtil.GetTime()
ConnectKcpTimer = XScheduleManager.ScheduleForever(function()
-- 尝试次数超过10次且开始确认过去10秒
if tryCount >= 10 and CS.XDateUtil.GetTime() - startTime >= 10 and not kcpConnected then
CS.XFightNetwork.DisconnectKcp()
XScheduleManager.UnSchedule(ConnectKcpTimer)
ConnectKcpTimer = nil
cb(false)
end
tryCount = tryCount + 1
XLog.Debug("Lua.XFightNetwork.KcpConfirmRequest " .. tostring(tryCount))
local requestContent = XMessagePack.Encode({})
CS.XFightNetwork.CallKcp("KcpConfirmRequest", requestContent, function()
XLog.Debug("KcpConfirmResponse")
if not kcpConnected then
XScheduleManager.UnSchedule(ConnectKcpTimer)
ConnectKcpTimer = nil
kcpConnected = true
cb(true)
end
end)
end, KcpConnectRequestInterval)
end
function XFightNetwork.Send(handler, request)
local requestContent, error = XMessagePack.Encode(request)
if requestContent == nil then
XLog.Error("Lua.XFightNetwork.Send 函数错误, 客户端发送给服务端的数据编码处理失败, 失败原因:" .. error)
return
end
CS.XFightNetwork.Send(handler, requestContent);
end
function XFightNetwork.Call(handler, request, reply)
local requestContent, error = XMessagePack.Encode(request)
if requestContent == nil then
XLog.Error("Lua.XFightNetwork.Call 函数错误, 客户端发送给服务端的数据编码处理失败, 失败原因: " .. error)
return
end
CS.XFightNetwork.Call(handler, requestContent, function(responseContent)
local response, err = XMessagePack.Decode(responseContent)
if response == nil then
XLog.Error("Lua.XFightNetwork.Call 函数错误, 服务端返回的数据解码失败, 失败原因: " .. err)
return
end
reply(response)
end)
end

View file

@ -0,0 +1,117 @@
local coroutineRunning = coroutine.running
local coroutineResume = coroutine.resume
local coroutineYiled = coroutine.yield
local coroutineWrap = coroutine.wrap
local tablePack = table.pack
local tableUnpack = table.unpack
local select = select
function Handler(target, func)
return function(...)
return func(target, ...)
end
end
handler = Handler
function LuaGC()
collectgarbage("collect")
end
--回调转异步任务需和RunAsyn配合使用
---@param function类型, 最后一位参数为异步回调, 示例:local testFunc = function(..., callback) end
---@return 异步任务不处理原函数返回值异步需求默认void
---@Examplemple
--[[
local testFunc = function(str, cb)
XScheduleManager.ScheduleOnce(function()
XLog.Debug(str)
if cb then cb() end
end, XScheduleManager.SECOND)
end
--callback hell
XLog.Debug("kkkttt test callback begin")
testFunc("kkkttt test callback CallBack 1"
, function()
testFunc("kkkttt test callback CallBack 2"
, function()
testFunc("kkkttt test callback CallBack 3")
end)
end)
XLog.Debug("kkkttt test callback end")
--asyn task
XLog.Debug("kkkttt test asyn task begin")
local asynTest = asynTask(testFunc)
RunAsyn(function()
asynTest("kkkttt test asyn CallBack 1")
XLog.Debug("kkkttt test asyn after 1")
asynTest("kkkttt test asyn CallBack 2")
asynTest("kkkttt test asyn CallBack 3")
end)
XLog.Debug("kkkttt test asyn task end")
]]
function asynTask(func, caller)
return function(...)
local results = {}
local running = coroutineRunning()
local args = { ... }
local length = select("#", ...) + 1
args[length] = function()
coroutineResume(running, tableUnpack(results))
end
results = caller and tablePack(func(caller, tableUnpack(args))) or tablePack(func(tableUnpack(args)))
return coroutineYiled()
end
end
--异步等待second秒需和RunAsyn配合使用
function asynWaitSecond(second)
asynTask(function(cb)
XScheduleManager.ScheduleOnce(cb, second * XScheduleManager.SECOND)
end)()
end
--异步执行
function RunAsyn(asynFunc)
return coroutineWrap(asynFunc)()
end
-- function string.split(input, delimiter)
-- input = tostring(input)
-- delimiter = tostring(delimiter)
-- if (delimiter=='') then return false end
-- local pos,arr = 0, {}
-- for st,sp in function() return string.find(input, delimiter, pos, true) end do
-- table.insert(arr, string.sub(input, pos, st - 1))
-- pos = sp + 1
-- end
-- table.insert(arr, string.sub(input, pos))
-- return arr
-- end
function appendArray(dst, src)
for i, v in ipairs(src)do
table.insert(dst, v)
end
return dst
end
-- 保留digit位小数
function getRoundingValue(value, digit)
return math.floor( value * math.pow(10, digit) ) / math.pow(10 , digit)
end
function math.pow(a, b)
return a ^ b
end
function table.indexof(array, value, begin)
for i = begin or 1, #array do
if array[i] == value then return i end
end
return false
end

View file

@ -0,0 +1,18 @@
local IncId = 0
XGlobalVar = {
ScrollViewScrollDir = {
ScrollDown = "ScrollDown", --从上往下滚
ScrollRight = "ScrollRight" --从左往右滚
},
UiDesignSize = { --ui设计尺寸
Width = 1920,
Height = 1080,
},
GetIncId = function()
IncId = IncId + 1
return IncId
end
}

View file

@ -0,0 +1,188 @@
XLog = XLog or {}
local MAX_DEPTH = 5
local Type = type
local Tostring = tostring
local TableRemove = table.remove
local TableInsert = table.insert
local TableConcat = table.concat
local StringGub = string.gsub
local DebugTraceback = debug.traceback
local XLogDebug = CS.XLog.Debug
local XLogWarning = CS.XLog.Warning
local XLogError = CS.XLog.Error
local Pairs = function(arr)
local meta_t = getmetatable(arr)
if meta_t and meta_t.__pairs then
return meta_t.__pairs(arr)
end
return pairs(arr)
end
local indentCache = { "" }
local function GetIndent(depth)
if not indentCache[depth] then
indentCache[depth] = GetIndent(depth - 1) .. " "
end
return indentCache[depth]
end
local function Dump(target)
local content = {}
local stack = {
{
obj = target,
name = nil,
depth = 1,
symbol = nil,
}
}
while #stack > 0 do
local top = TableRemove(stack)
local obj = top.obj
local name = top.name
local depth = top.depth
local symbol = top.symbol
if Type(obj) == "table" then
if depth > MAX_DEPTH then
TableInsert(stack, {
obj = "too depth ...",
name = name,
depth = depth,
symbol = symbol,
})
else
TableInsert(stack, {
obj = "}",
name = nil,
depth = depth,
symbol = symbol,
})
local temp = {}
for k, v in Pairs(obj) do
TableInsert(temp, {
obj = v,
name = k,
depth = depth + 1,
symbol = ",",
})
end
local count = #temp
for i = 1, count do
TableInsert(stack, temp[count - i + 1])
end
TableInsert(stack, {
obj = "{",
name = name,
depth = depth,
symbol = nil,
})
end
else
TableInsert(content, GetIndent(depth))
if name then
if Type(name) == "string" then
TableInsert(content, "[\"")
TableInsert(content, name)
TableInsert(content, "\"]")
else
TableInsert(content, "[")
TableInsert(content, Tostring(name))
TableInsert(content, "]")
end
TableInsert(content, " = ")
end
if obj and Type(obj) == "string" then
if obj ~= "{" and obj ~= "}" then
TableInsert(content, "\"")
TableInsert(content, obj)
TableInsert(content, "\"")
else
TableInsert(content, obj)
end
else
TableInsert(content, Tostring(obj))
end
if symbol then
TableInsert(content, symbol)
end
TableInsert(content, "\n")
end
end
return TableConcat(content)
end
local Print = function(...)
local args = { ... }
local count = #args
if count <= 0 then
return
end
local content = {}
for i = 1, count do
if Type(args[i]) == "table" then
TableInsert(content, Dump(args[i]))
else
TableInsert(content, Tostring(args[i]))
TableInsert(content, "\n")
end
end
return TableConcat(content)
-- return StringGub(StringGub(TableConcat(content), "{", "/{"), "}", "/}")
end
XLog.Debug = function(...)
local content = Print(...)
if content then
XLogDebug(content .. "\n" .. DebugTraceback())
else
XLogDebug("nil\n" .. DebugTraceback())
end
end
XLog.Warning = function(...)
local content = Print(...)
if content then
XLogWarning(content .. "\n" .. DebugTraceback())
else
XLogWarning("nil\n" .. DebugTraceback())
end
end
XLog.Error = function(...)
local content = Print(...)
if content then
XLogError(content .. "\n" .. DebugTraceback())
else
XLogError("nil\n" .. DebugTraceback())
end
end
-- 表格找不到数据错误统一输出接口
XLog.ErrorTableDataNotFound = function(functionName, dataName, tablePath, paramName, paramValue)
XLog.Error(string.format("%s出错:找不到%s数据。搜索路径: %s 索引%s = %s", functionName, dataName, tablePath, paramName, paramValue))
end
XLog.Dump = function(value)
if type(value) ~= "table" then
return tostring(value)
end
return Dump(value)
end

View file

@ -0,0 +1,34 @@
XLuaBehaviour = XClass(nil, "XLuaBehaviour")
function XLuaBehaviour:Ctor(rootUi, ui)
self.Transform = ui.transform
self.GameObject = ui.gameObject
local behaviour = self.GameObject:GetComponent(typeof(CS.XLuaBehaviour))
if not behaviour then
behaviour = self.GameObject:AddComponent(typeof(CS.XLuaBehaviour))
end
if self.Start then
behaviour.LuaStart = function() self:Start() end
end
if self.Update then
behaviour.LuaUpdate = function() self:Update() end
end
if self.LateUpdate then
behaviour.LuaLateUpdate = function() self:LateUpdate() end
end
if self.OnDestroy then
behaviour.LuaOnDestroy = function() self:OnDestroy() end
end
end
function XLuaBehaviour:Dispose()
local xLuaBehaviour = self.Transform:GetComponent(typeof(CS.XLuaBehaviour))
if (xLuaBehaviour) then
CS.UnityEngine.GameObject.Destroy(xLuaBehaviour)
end
end

View file

@ -0,0 +1,59 @@
local math = math
local mathFloor = math.floor
local mathRandom = math.random
XMath = XMath or {}
function XMath.RandByWeights(weights)
local weightSum = 0
for i = 1, #weights do
weightSum = weightSum + weights[i]
end
local rand = mathRandom(weightSum)
local curWeight = 0
for i = 1, #weights do
local weight = weights[i]
curWeight = curWeight + weight
if rand < curWeight then
return i
end
end
return #weights
end
function XMath.Clamp(value, min, max)
if value < min then
return min
end
if value > max then
return max
end
return value
end
--==============================--
--desc: 转换成整数,浮点数四舍五入
--==============================--
XMath.ToInt = function(val)
if not val then return end
return mathFloor(val + 0.5)
end
--==============================--
--desc: 转换成整数,浮点数向下取整数
--==============================--
XMath.ToMinInt = function(val)
if not val then return end
return mathFloor(val)
end
--==============================--
--desc: 最大整数与C#一致
--==============================--
XMath.IntMax = function()
return 2147483647
end

View file

@ -0,0 +1,274 @@
XNetwork = XNetwork or {}
local Ip
local Port
local LastIp
local LastPort
local XRpc = XRpc
local IsDebug = XMain.IsEditorDebug
local ShieldedProtocol = {}
local NeedShieldProtocol = false
XNetwork.NetworkMode = {
Auto = 1,
Ipv4 = 2,
Ipv6 = 3,
}
XNetwork.NetworkModeKey = "NETWORK_MODE_KEY"
local function GetIpAndPort()
return Ip, Port
end
function XNetwork.SetGateAddress(ip, port)
Ip = ip
Port = port
end
function XNetwork.CheckIsChangedGate()
return LastIp ~= Ip or LastPort ~= Port
end
local LogTableFunc = IsDebug and XLog.Debug or XLog.Error
local function TipTableDiff(sha1Table)
if not CS.XTableManager.NeedSha1 then -- 开发环境下不解析Sha1
return
end
XTool.LoopMap(CS.XTableManager.Sha1Table, function(k, v)
local sha1 = sha1Table[k]
if not sha1 then
LogTableFunc("多余表格: " .. k)
return
end
if v ~= sha1 then
LogTableFunc("差异表格: " .. k .. ", 客户端sha1: " .. v .. " , 服务端sha1: " .. sha1)
end
sha1Table[k] = nil
end)
for k, _ in pairs(sha1Table) do
LogTableFunc("缺少表格: " .. k)
end
end
XRpc.NotifyCheckTableSha1 = function(data)
TipTableDiff(data.Sha1Table)
end
function XNetwork.ConnectGateServer(args)
if not args then
return
end
if IsDebug then
XRpc.CheckLuaNetLogEnable()
end
CS.XNetwork.OnConnect = function()
if args.IsReconnect then
local request = { PlayerId = XPlayer.Id, Token = XUserManager.ReconnectedToken, LastMsgSeqNo = CS.XNetwork.ServerMsgSeqNo }
if CS.XNetwork.IsShowNetLog then
XLog.Debug("PlayerId=" .. request.PlayerId .. ", Token=" .. request.Token .. ", LastMsgSeqNo=" .. request.LastMsgSeqNo)
end
local request_func
request_func = function()
XNetwork.Call("ReconnectRequest", request, function(res)
if res.Code == XCode.ReconnectAgain then
if CS.XNetwork.IsShowNetLog then
XLog.Debug("服务器返回再次重连。" .. tostring(res.Code))
end
XScheduleManager.ScheduleOnce(function()
request_func()
end, 1000)
elseif res.Code ~= XCode.Success then
if CS.XNetwork.IsShowNetLog then
XLog.Debug("服务器返回断线重连失败。" .. tostring(res.Code))
end
XLoginManager.DoDisconnect()
else
XNetwork.Send("ReconnectAck")
if CS.XNetwork.IsShowNetLog then
XLog.Debug("服务器返回断线重连成功。")
end
XUserManager.ReconnectedToken = res.ReconnectToken
if args.ConnectCb then
args.ConnectCb()
end
if res.OfflineMessages then
CS.XNetwork.ProcessReconnectMessageList(res.OfflineMessages)
end
CS.XNetwork.ReCall(res.RequestNo)
end
end)
end
request_func()
else
XNetwork.Call("HandshakeRequest", {
ApplicationVersion = CS.XRemoteConfig.ApplicationVersion,
DocumentVersion = CS.XRemoteConfig.DocumentVersion,
Sha1 = CS.XTableManager.Sha1
}, function(response)
if args.RemoveHandshakeTimerCb then
args.RemoveHandshakeTimerCb()
end
if response.Code ~= XCode.Success then
local msgTab = {}
msgTab.error_code = response.Code
CS.XRecord.Record(msgTab, "24019", "HandshakeRequest")
if response.Code == XCode.GateServerNotOpen then
local localTimeStr = XTime.TimestampToLocalDateTimeString(response.UtcOpenTime, "yyyy-MM-dd HH:mm(G'M'T z)")
local context = CS.XTextManager.GetCodeText(response.Code) .. localTimeStr
XUiManager.SystemDialogTip("", context, XUiManager.DialogType.OnlySure)
elseif response.Code == XCode.LoginApplicationVersionError then
-- 处于调试模式时进错服显示取消按钮,否则不显示
local cancelCb = XMain.IsDebug and function() end or nil
CS.XTool.WaitCoroutine(CS.XApplication.CoDialog(CS.XApplication.GetText("Tip"),
CS.XStringEx.Format(CS.XApplication.GetText("UpdateApplication"),
CS.XInfo.Version), cancelCb, function() CS.XTool.WaitCoroutine(CS.XApplication.GoToUpdateURL(GetAppUpgradeUrl()), nil) end))
else
XUiManager.DialogTip("", CS.XTextManager.GetCodeText(response.Code), XUiManager.DialogType.OnlySure)
end
if response.Code == XCode.LoginTableError then
XLog.Error("配置表客户端和服务端不一致")
TipTableDiff(response.Sha1Table)
end
CS.XNetwork.Disconnect()
return
end
CS.XRecord.Record("24020", "HandshakeRequestSuccess")
if args.ConnectCb then
args.ConnectCb()
end
end)
end
end
CS.XNetwork.OnDisconnect = function()
if args.DisconnectCb then
args.DisconnectCb()
end
end
CS.XNetwork.OnRemoteDisconnect = function()
if args.RemoteDisconnectCb then
args.RemoteDisconnectCb()
end
end
CS.XNetwork.OnError = function(error)
if args.ErrorCb then
args.ErrorCb(error)
end
end
CS.XNetwork.OnMessageError = function()
if args.MsgErrorCb then
args.MsgErrorCb()
end
end
CS.XNetwork.OnReconnectRequestFrequently = function()
if args.ReconnectRequestFrequentlyCb then
args.ReconnectRequestFrequentlyCb()
end
end
local ip, port
if args.IsReconnect then
ip, port = LastIp, LastPort
else
ip, port = GetIpAndPort()
end
XNetwork.ConnectServer(ip, port, args.IsReconnect)
end
function XNetwork.ConnectServer(ip, port, bReconnect)
if not ip or not port then
return
end
LastIp, LastPort = ip, port
local networkMode = XSaveTool.GetData(XNetwork.NetworkModeKey) or XNetwork.NetworkMode.Auto
if networkMode == XNetwork.NetworkMode.Auto then
CS.XNetwork.Connect(ip, tonumber(port), bReconnect, CS.XNetwork.NetworkMode.Auto)
elseif networkMode == XNetwork.NetworkMode.Ipv4 then
CS.XNetwork.Connect(ip, tonumber(port), bReconnect, CS.XNetwork.NetworkMode.Ipv4)
elseif networkMode == XNetwork.NetworkMode.Ipv6 then
CS.XNetwork.Connect(ip, tonumber(port), bReconnect, CS.XNetwork.NetworkMode.Ipv6)
else -- Auto保底
CS.XNetwork.Connect(ip, tonumber(port), bReconnect, CS.XNetwork.NetworkMode.Auto)
end
end
function XNetwork.Send(handler, request)
-- 检查是否是屏蔽协议
if NeedShieldProtocol and ShieldedProtocol[handler] then
XUiManager.TipMsg(CS.XGame.ClientConfig:GetString("ShieldedProtocol"))
return
end
local requestContent, error = XMessagePack.Encode(request)
if IsDebug then
XRpc.DebugPrint(XRpc.DEBUG_TYPE.Send, handler, requestContent)
end
if requestContent == nil then
XLog.Error("XNetwork.Send 函数错误, 客户端发送给服务端的数据编码处理失败, 失败原因:" .. error)
return
end
CS.XNetwork.Send(handler, requestContent);
end
function XNetwork.Call(handler, request, reply)
-- 检查是否是屏蔽协议
if NeedShieldProtocol and ShieldedProtocol[handler] then
XUiManager.TipMsg(CS.XGame.ClientConfig:GetString("ShieldedProtocol"))
return
end
if IsDebug then
XRpc.DebugPrint(XRpc.DEBUG_TYPE.Send_Call, handler, request)
end
local requestContent, error = XMessagePack.Encode(request)
if requestContent == nil then
XLog.Error("XNetwork.Call 函数错误, 客户端发送给服务端的数据编码处理失败, 失败原因: " .. error)
return
end
CS.XNetwork.Call(handler, requestContent, function(responseContent)
local response, err = XMessagePack.Decode(responseContent)
if response == nil then
XLog.Error("XNetwork.Call 函数错误, 服务端返回的数据解码失败, 失败原因: " .. err)
return
end
if IsDebug then
XRpc.DebugPrint(XRpc.DEBUG_TYPE.Recv_Call, handler, response)
end
reply(response)
end)
end
--================
--设置协议屏蔽列表
--@param protocolList:屏蔽协议名列表
--================
function XNetwork.SetShieldedProtocolList(protocolList)
if not protocolList then return end
ShieldedProtocol = {}
NeedShieldProtocol = false
for _, protocolName in pairs(protocolList) do
NeedShieldProtocol = true
ShieldedProtocol[protocolName] = true
end
end

View file

@ -0,0 +1,92 @@
-- auto export form enum
-- Automatic generation of code, forbid to edit or delete
XNpcAttribType = {
Life = 1, -- 生命
Energy = 2, -- 能量
RunSpeed = 3, -- 跑速度
WalkSpeed = 4, -- 走速度
TurnRoundSpeed = 5, -- 转身角速度
BallInterval = 6, -- 出球间隔帧
DamageNormalImmunity = 7, -- 普通伤害免疫
DamageMagicImmunity = 8, -- 元素伤害免疫
AntiDamageNormalImmunity = 9, -- 反普通伤害免疫
AntiDamageMagicImmunity = 10, -- 反元素伤害免疫
AttackNormal = 11, -- 普通攻击
AttackMagicBegin = 11, -- 元素攻击起始
AttackMagic1 = 12, -- 元素1攻击
AttackMagic2 = 13, -- 元素2攻击
AttackMagic3 = 14, -- 元素3攻击
AttackMagic4 = 15, -- 元素4攻击
AttackMagicEnd = 16, -- 元素攻击结束
AntiAttackNormal = 17, -- 反普通攻击
AntiAttackMagicBegin = 17, -- 反元素攻击起始
AntiAttackMagic1 = 18, -- 反元素1攻击
AntiAttackMagic2 = 19, -- 反元素2攻击
AntiAttackMagic3 = 20, -- 反元素3攻击
AntiAttackMagic4 = 21, -- 反元素4攻击
AntiAttackMagicEnd = 22, -- 反元素攻击结束
DefenseNormal = 23, -- 普通防御
AntiDefenseNormal = 24, -- 反普通防御
DamageChangeP = 25, -- 总伤害加深率
DamageNormalChangeP = 26, -- 普通伤害加深率
DamageMagicChangePBegin = 26, -- 元素伤害加深率开始
DamageMagic1ChangeP = 27, -- 元素1伤害加深率
DamageMagic2ChangeP = 28, -- 元素2伤害加深率
DamageMagic3ChangeP = 29, -- 元素3伤害加深率
DamageMagic4ChangeP = 30, -- 元素4伤害加深率
DamageMagicChangePEnd = 31, -- 元素伤害加深率结束
AntiDamageChangeP = 32, -- 反总伤害加深率
AntiDamageNormalChangeP = 33, -- 反普通伤害加深率
AntiDamageMagicChangePBegin = 33, -- 反元素伤害加深率开始
AntiDamageMagic1ChangeP = 34, -- 反元素1伤害加深率
AntiDamageMagic2ChangeP = 35, -- 反元素2伤害加深率
AntiDamageMagic3ChangeP = 36, -- 反元素3伤害加深率
AntiDamageMagic4ChangeP = 37, -- 反元素4伤害加深率
AntiDamageMagicChangePEnd = 38, -- 反元素伤害加深率结束
DamagePBegin = 39, -- 类型伤害率开始
Damage1P = 40, -- 类型1伤害率
Damage2P = 41, -- 类型2伤害率
Damage3P = 42, -- 类型3伤害率
DamagePEnd = 43, -- 类型伤害率结束
Crit = 44, -- 暴击
CritP = 45, -- 暴击率
CritDamageP = 46, -- 暴击伤害率
AntiCritP = 47, -- 反暴击率
AntiCritDamageP = 48, -- 反暴击伤害率
Lifesteal = 49, -- 吸血
LifestealP = 50, -- 吸血率
CureChangeP = 51, -- 治疗加深率
AntiCureChangeP = 52, -- 反治疗加深率
Endure = 53, -- 霸体值
ThreatRateP = 54, -- 仇恨生成速率
DodgeEnergy = 55, -- 闪避能量值
DodgeEnergyAutoRecovery = 56, -- 闪避能量自动回复
CustomEnergy = 57, -- 自定义能量值
AccuResistance1 = 58, -- 积蓄抗性1
AccuResistance2 = 59, -- 积蓄抗性2
AccuResistance3 = 60, -- 积蓄抗性3
AccuResistance4 = 61, -- 积蓄抗性4
AccuResistance5 = 62, -- 积蓄抗性5
AccuResistance6 = 63, -- 积蓄抗性6
AccuResistance7 = 64, -- 积蓄抗性7
AccuResistance8 = 65, -- 积蓄抗性8
AccuResistance9 = 66, -- 积蓄抗性9
AccuResistance10 = 67, -- 积蓄抗性10
SquatSpeed = 68, -- 蹲走速度
NormalWeaknessP = 69, -- 物理弱点
MagicWeaknessPBegin = 69, -- 元素弱点开始
Magic1WeaknessP = 70, -- 元素弱点1
Magic2WeaknessP = 71, -- 元素弱点2
Magic3WeaknessP = 72, -- 元素弱点3
Magic4WeaknessP = 73, -- 元素弱点4
SprintSpeed = 74, -- 疾跑速度
CustomEnergyGroup1 = 75, -- 自定义能量组1
CustomEnergyGroup2 = 76, -- 自定义能量组2
CustomEnergyGroup3 = 77, -- 自定义能量组3
CustomEnergyGroup4 = 78, -- 自定义能量组4
Hack = 79, -- 骇入值
HackChangeP = 80, -- 骇入加深率
AntiHackChangeP = 81, -- 骇入抵抗率
HackAutoRecovery = 82, -- 骇入值自动回复
End = 83, --
}

View file

@ -0,0 +1,82 @@
XPerformance = XPerformance or {}
local CsTime = CS.UnityEngine.Time
local IO = CS.System.IO
local collectgarbage = collectgarbage
local AutoSaveTime = 10
local LastSaveTime = 0
local TraceLevel = 5
XPerformance.SaveDataPath = XPerformance.SaveDataPath or string.format("Log/MemData_%s.tab", CS.System.DateTime.Now:ToString("MMddhhmm"))
XPerformance.SaveTimerId = XPerformance.SaveTimerId or 0
XPerformance.LuaMemData = XPerformance.LuaMemData or {}
-- 定期保存数据
function XPerformance.StartLuaMenCollect()
if CS.UnityEngine.Application.platform ~= CS.UnityEngine.RuntimePlatform.WindowsEditor then
return
end
if XPerformance.SaveTimerId then
XScheduleManager.UnSchedule(XPerformance.SaveTimerId)
XPerformance.SaveTimerId = 0
end
XPerformance.SaveTimerId = XScheduleManager.ScheduleForever(function()
if not next(XPerformance.LuaMemData) then
return
end
local nowTime = CsTime.realtimeSinceStartup
if nowTime - LastSaveTime > AutoSaveTime then
LastSaveTime = nowTime
XPerformance.SaveMemData()
end
end, AutoSaveTime * 1000)
end
-- 保存数据
function XPerformance.SaveMemData()
local sw
if not IO.File.Exists(XPerformance.SaveDataPath) then
sw = IO.File.CreateText(XPerformance.SaveDataPath)
sw:Write("traceName\tkey\tcostMem\tcurrentMem\n")
else
sw = IO.File.AppendText(XPerformance.SaveDataPath)
sw:Write("\n")
end
local tab = {}
for key, str in pairs(XPerformance.LuaMemData) do
table.insert(tab, str)
end
XPerformance.LuaMemData = {}
local content = table.concat(tab, '\n')
sw:Write(content)
sw:Flush()
sw:Close()
XLog.Debug("... save data:" .. content)
end
-- 记录一段代码消耗的lua内存
function XPerformance.RecordLuaMemData(name, func, isCollect)
if isCollect == nil then
isCollect = true
end
if isCollect then
collectgarbage("collect")
end
local beforeMem = collectgarbage("count")
func()
if isCollect then
collectgarbage("collect")
end
local currentMem = collectgarbage("count")
local costMem = currentMem - beforeMem
costMem = math.floor(costMem / 1024 * 10000) / 10000
currentMem = math.floor(beforeMem / 1024 * 10000) / 10000
-- 记录消耗
local traceName = XTool.GetStackTraceName(TraceLevel)
local str = string.format("%s\t%s\t%s\t%s", traceName, name, costMem, currentMem)
table.insert(XPerformance.LuaMemData, str)
end

View file

@ -0,0 +1,60 @@
XPool = XClass(nil, "XPool")
function XPool:Ctor(createFunc, onRelease)
if not createFunc then
XLog.Error("XPool:Ctor Error:createFunc is Empty.")
return
end
self.__Container = XStack.New()
self.__CreateFunc = createFunc
self.__OnRelease = onRelease
self.__TotalCount = 0
end
function XPool:Clear()
self.__TotalCount = 0
self.__Container:Clear()
end
function XPool:GetItemFromPool()
local item = self.__Container:Pop()
if not item then
item = self.__CreateFunc()
if not item then
XLog.Error("XPool:GetItemFromPool Error:createFunc return nil.")
return
end
self.__TotalCount = self.__TotalCount + 1
end
return item
end
function XPool:ReturnItemToPool(item)
if not item then return end
if self:UsingCount() < 1 then
return
end
if self.__OnRelease then
self.__OnRelease(item)
end
self.__Container:Push(item)
end
--池中剩余对象数量
function XPool:LeftCount()
return self.__Container:Count()
end
--使用中对象数量
function XPool:UsingCount()
return self.__TotalCount - self:LeftCount()
end
--已创建对象数量
function XPool:TotalCount()
return self.__TotalCount
end

View file

@ -0,0 +1,53 @@
XPrefs = XPrefs or {}
-- 登陆模块
XPrefs.UserId = "USER_ID"
XPrefs.UserName = "USER_NAME"
XPrefs.Channel = "CHANNEL"
XPrefs.Token = "TOKEN"
XPrefs.PasswordStatus = "PASSWORD_STATUS"
XPrefs.ServerId = "SERVER_ID"
XPrefs.User_ServerId = "USER_SERVER_ID"
XPrefs.CharacterStoryRecord = "CHARACTER_STORY_RECORD"
XPrefs.AssistSwitch = "ASSIST_SWITCH"
XPrefs.GuideTrigger = "GUIDE_DISABLE"
XPrefs.CommunicationTrigger = "COMMUNICATION_DISABLE"
XPrefs.FunctionEventTrigger = "FUNCTION_EVENT_DISABLE"
XPrefs.LoginAnimTrigger = "LOGIN_ANIM_DISABLE"
XPrefs.AccountHistory = "ACCOUNT_HISTORY"
XPrefs.LuaNetLog = "LUA_NET_LOG"
XPrefs.TowerTip = "TOWER_TIP"
XPrefs.DormNewHint = "DORM_NEW_HINT_"
XPrefs.PayOrder = "PAY_ORDER_"
XPrefs.BaseEquip = "BASE_EQUIP"
XPrefs.AutoWindowEach = "AUTO_WINDOW_EACH"
XPrefs.AutoWindowPeriod = "AUTO_WINDOW_PERIOD"
XPrefs.YKLocalCache = "YK_LOCAL_CACHAE"
XPrefs.YKContinueBuy = "YK_CONTINUE_BUY"
XPrefs.ArenaTeamResult = "Arena_Team_Result"
XPrefs.ArenaOnlineInvit = "AreanOnline_Invit"
XPrefs.ArenaOnlineFirstOpen = "AreanOnline_First_Open"
-- 战斗设置
XPrefs.DynamicJoystick = "DYNAMIC_JOYSTICK"
XPrefs.FocusType = "FOCUS_TYPE"
XPrefs.FocusButton = "FOCUS_BUTTON"
XPrefs.InviteButton = "INVITE_BUTTON"
-- 武器显示设置
XPrefs.WeaponTransType = "WEAPON_TRANS_TYPE"
-- 累积充值显示设置
XPrefs.RechargeType = "RECHARGE_TYPE"

View file

@ -0,0 +1,46 @@
XQueue = XClass(nil, "XQueue")
function XQueue:Ctor()
self:Clear()
end
function XQueue:Clear()
self.__Container = {}
self.__StartIndex = 1
self.__EndIndex = 0
end
function XQueue:IsEmpty()
return self.__StartIndex > self.__EndIndex
end
function XQueue:Count()
return self.__EndIndex - self.__StartIndex + 1
end
function XQueue:Enqueue(element)
if not element then return end
local endIndex = self.__EndIndex + 1
self.__EndIndex = endIndex
self.__Container[endIndex] = element
end
function XQueue:Dequeue()
if self:IsEmpty() then
self:Clear()
return
end
local startIndex = self.__StartIndex
local element = self.__Container[startIndex]
self.__StartIndex = startIndex + 1
self.__Container[startIndex] = nil
return element
end
function XQueue:Peek()
return self.__Container[self.__StartIndex]
end

View file

@ -0,0 +1,99 @@
XRpc = XRpc or {}
------- 方便调试协议的打印 ------
local IsPrintLuaRpc = false
if XMain.IsEditorDebug then
CS.XNetwork.IsShowNetLog = false
end
XRpc.IgnoreRpcNames = { ["HeartbeatRequest"] = true, ["HeartbeatResponse"] = true, ["KcpHeartbeatRequest"] = true, ["KcpHeartbeatResponse"] = true }
XRpc.DEBUG_TYPE = {
Send = "Send",
Send_Call = "Send_Call",
Recv = "Recv",
Recv_Call = "Recv_Call",
}
XRpc.DEBUG_TYPE_COLOR = {
Send = "#5bf54f",
Send_Call = "#5bf54f",
Recv = "#42a8fa",
Recv_Call = "#42a8fa",
}
-- 浅色主题用的字体颜色
-- XRpc.DEBUG_TYPE_COLOR = {
-- Send = "green",
-- Send_Call = "green",
-- Recv = "blue",
-- Recv_Call = "blue",
-- }
XRpc.DebugKeyWords = {"GuildBoss"} -- 【关键协议】
function XRpc.CheckLuaNetLogEnable()
IsPrintLuaRpc = XMain.IsEditorDebug and XSaveTool.GetData(XPrefs.LuaNetLog)
return IsPrintLuaRpc
end
function XRpc.SetLuaNetLogEnable(value)
IsPrintLuaRpc = value
XSaveTool.SaveData(XPrefs.LuaNetLog, IsPrintLuaRpc)
end
function XRpc.DebugPrint(debugType, rpcName, request)
if not IsPrintLuaRpc or XRpc.IgnoreRpcNames[rpcName] then
return
end
local color = XRpc.DEBUG_TYPE_COLOR[debugType]
if XRpc.DebugKeyWords then
for i, keyWord in ipairs(XRpc.DebugKeyWords) do
if (string.find(rpcName, keyWord)) then
rpcName = "<color=red>" .. rpcName .. "</color>" -- 【关键协议】显示为红色 可本地自定义
break
end
end
end
XLog.Debug("<color=" .. color .. "> " .. debugType .. ": " .. rpcName .. ", content: </color>" .. XLog.Dump(request))
end
-------------------------------
local handlers = {}
local IsHotReloadOpen = XMain.IsEditorDebug
function XRpc.Do(name, content)
local handler = handlers[name]
if handler == nil then
XLog.Error("XRpc.Do 函数错误, 没有定义相应的接收服务端数据的函数, 函数名是: " .. name)
return
end
local request, error = XMessagePack.Decode(content)
if request == nil then
XLog.Error("XRpc.Do 函数错误, 服务端返回的数据解码错误, 错误原因: " .. error)
return
end
XRpc.DebugPrint(XRpc.DEBUG_TYPE.Recv, name, request)
handler(request)
end
setmetatable(XRpc, {
__newindex = function(_, name, handler)
if type(name) ~= "string" then
XLog.Error("XRpc.register 函数错误, 参数name必须是string类型, type: " .. type(name))
return
end
if type(handler) ~= "function" then
XLog.Error("XRpc.register 函数错误, 注册的接收服务端数据的函数的值必须是函数类型, type: " .. type(handler))
return
end
if handlers[name] and not IsHotReloadOpen then
XLog.Error("XRpc.register 函数错误, 存在相同名字的接收服务端数据的函数, 名字是: " .. name)
return
end
handlers[name] = handler
end,
})
XRpc.TestRequest = function(request)
XLog.Warning(request);
end

View file

@ -0,0 +1,14 @@
-- auto export form enum
-- Automatic generation of code, forbid to edit or delete
XRpcExceptionCode = {
Success = 0,
DecodeError = 1,
ServerInternalError = 2,
RequestOutOfLimit = 3,
RpcTimeout = 4,
InvalidRequest = 5,
InvalidArgument = 6,
FeaturesNotOpen = 7,
RequestBlocked = 8,
ServiceUnavailable = 9,
}

View file

@ -0,0 +1,146 @@
local tostring = tostring
local load = load
local type = type
local ipairs = ipairs
local pairs = pairs
local string = string
local table = table
local stringDump = string.dump
local stringGmatch = string.gmatch
local tableUnpack = table.unpack
local tableInsert = table.insert
local tableSort = table.sort
local tableConcat = table.concat
XSaveTool = XSaveTool or {}
XSaveTool.LocalCache = {}
local function fret(...)
local args = { ... }
return function()
return tableUnpack(args)
end
end
--==============================--
--desc: 数据字符串化
--@val: 需要封装成字符串的数据
--@needSort: 是否需要排序
--@cache: 缓存处理table引用死锁判断
--@return 封装好的字符串
--==============================--
function XSaveTool.Stringify(val, needSort, cache)
cache = cache or {}
return (({
["nil"] = fret "nil",
["boolean"] = fret(tostring(val)),
["number"] = fret(val),
["function"] = function()
return "function(...)" ..
"return load(" ..
XSaveTool.Stringify(stringDump(val), needSort, cache) ..
")(...)" ..
"end"
end,
["string"] = function()
local s = "\""
for c in stringGmatch(val, ".") do
s = s .. "\\" .. c:byte()
end
return s .. "\""
end,
["table"] = function()
if cache[val] then
XLog.Error("loop Stringify")
return
end
cache[val] = true
local members = {}
if needSort then
local keys = {}
for k, _ in pairs(val) do
tableInsert(keys, k)
end
tableSort(keys)
for _, v in ipairs(keys) do
tableInsert(members, "[" .. XSaveTool.Stringify(v, needSort, cache) .. "]=" .. XSaveTool.Stringify(val[v], needSort, cache))
end
else
for k, v in pairs(val) do
tableInsert(members, "[" .. XSaveTool.Stringify(k, needSort, cache) .. "]=" .. XSaveTool.Stringify(v, needSort, cache))
end
end
return "{" .. tableConcat(members, ",") .. "}"
end,
})[type(val)] or function()
XLog.Error("cannot Stringify type:" .. type(val), 2)
end)()
end
--==============================--
--desc: 本地数据持久化
--@key: 存储key
--@value: 存储值
--==============================--
function XSaveTool.SaveData(key, value)
local k = XSaveTool.Stringify(key, true)
if value == false then
XSaveTool.LocalCache[k] = nil
else
XSaveTool.LocalCache[k] = value or XSaveTool.LocalCache[k]
end
CS.UnityEngine.PlayerPrefs.SetString("LuaData:" .. k, XSaveTool.Stringify(XSaveTool.LocalCache[k]))
CS.UnityEngine.PlayerPrefs.Save()
end
--==============================--
--desc: 持久化数据删除
--@key: 数据key
--==============================--
function XSaveTool.RemoveData(key)
local k = XSaveTool.Stringify(key, true)
XSaveTool.LocalCache[k] = nil
CS.UnityEngine.PlayerPrefs.DeleteKey("LuaData:" .. k)
end
--==============================--
--desc: 获取持久化数据
--@key: 存储key
--@return 存储值
--==============================--
function XSaveTool.GetData(key)
local k = XSaveTool.Stringify(key, true)
if XSaveTool.LocalCache[k] then
return XSaveTool.LocalCache[k]
end
local str = CS.UnityEngine.PlayerPrefs.GetString("LuaData:" .. k)
if str and str ~= "" then
local obj = load("return " .. str)()
XSaveTool.LocalCache[k] = obj
return obj
end
return nil
end
--==============================--
--desc: 移除所有持久化数据(调试)
--==============================--
function XSaveTool.RemoveAll()
local enable1 = XDataCenter.GuideManager.CheckFuncDisable()
local enable2 = XDataCenter.CommunicationManager.CheckFuncDisable()
local enable3 = XDataCenter.FunctionEventManager.CheckFuncDisable()
local enable4 = XRpc.CheckLuaNetLogEnable()
XSaveTool.LocalCache = {}
CS.UnityEngine.PlayerPrefs.DeleteAll()
XDataCenter.GuideManager.ChangeFuncDisable(enable1)
XDataCenter.CommunicationManager.ChangeFuncDisable(enable2)
XDataCenter.FunctionEventManager.ChangeFuncDisable(enable3)
XRpc.SetLuaNetLogEnable(enable4)
end

View file

@ -0,0 +1,72 @@
XScheduleManager = XScheduleManager or {}
local CSXScheduleManager = CS.XScheduleManager
XScheduleManager.SECOND = CSXScheduleManager.SECOND
require("XCommon/XTool")
local XTool = XTool
local IsEditor = XMain.IsEditorDebug
-- /// <summary>
-- /// 启动定时器
-- /// </summary>
-- /// <param name="handler">处理函数</param>
-- /// <param name="interval">间隔毫秒(第一次执行在间隔时间后)</param>
-- /// <param name="loop">循环次数</param>
-- /// <param name="delay">延迟毫秒</param>
-- /// <returns>定时器id</returns>
function XScheduleManager.Schedule(func, interval, loop, delay)
local name = IsEditor and XTool.GetStackTraceName() or nil
return CSXScheduleManager.Schedule(func, interval, loop, delay or 0, name)
end
-- /// <summary>
-- /// 启动单次定时器
-- /// </summary>
-- /// <param name="handler">处理函数</param>
-- /// <param name="delay">延迟毫秒</param>
-- /// <returns>定时器id</returns>
function XScheduleManager.ScheduleOnce(func, delay)
local name = IsEditor and XTool.GetStackTraceName() or nil
return CSXScheduleManager.ScheduleOnce(func, delay, name)
end
-- /// <summary>
-- /// 启动指定时间单次定时器
-- /// </summary>
-- /// <param name="handler">处理函数</param>
-- /// <param name="timeStamp">需要启动的时间</param>
-- /// <returns>定时器id</returns>
function XScheduleManager.ScheduleAtTimestamp(func, timeStamp)
local name = IsEditor and XTool.GetStackTraceName() or nil
local nowTime = XTime.GetServerNowTimestamp()
if timeStamp <= nowTime then
return
end
return CSXScheduleManager.ScheduleOnce(func, (timeStamp - nowTime) * XScheduleManager.SECOND, name)
end
-- /// <summary>
-- /// 启动永久定时器
-- /// </summary>
-- /// <param name="handler">处理函数</param>
-- /// <param name="interval">间隔毫秒</param>
-- /// <param name="delay">延迟毫秒</param>
-- /// <returns>定时器id</returns>
function XScheduleManager.ScheduleForever(func, interval, delay)
local name = IsEditor and XTool.GetStackTraceName() or nil
return CSXScheduleManager.ScheduleForever(func, interval, delay or 0, name)
end
-- /// <summary>
-- /// 取消定时器
-- /// </summary>
-- /// <param name="id">定时器id</param>
function XScheduleManager.UnSchedule(id)
return CSXScheduleManager.UnSchedule(id)
end
-- 释放所有定时器
function XScheduleManager.UnScheduleAll()
return CSXScheduleManager.UnScheduleAll()
end

View file

@ -0,0 +1,290 @@
local XSignBoardPlayer = {}
local PlayerState = {
IDLE = 0,
PLAYING = 1,
CHANGING = 2,
PAUSE = 3
}
--创建一个播放器
function XSignBoardPlayer.New(playUi, coolTime, delay)
if playUi == nil then
return nil
end
local player = {}
setmetatable(player, { __index = XSignBoardPlayer })
player:Init(playUi, coolTime, delay)
return player
end
--初始化
function XSignBoardPlayer:Init(playUi, coolTime, delay)
self.CoolTime = coolTime --冷却时间
self.PlayUi = playUi --执行Ui
self.Status = PlayerState.IDLE
self.DelayStart = XTime.GetServerNowTimestamp() + delay
self.LastPlayTime = -1
self.Delay = delay
self.Time = XTime.GetServerNowTimestamp()
self.AutoPlay = true
self.PlayOne = false
end
-- self.PlayerData.PlayerList = {} --播放列表
-- self.PlayerData..PlayingElement = nil --播放对象
-- self.PlayerData.PlayedList = {} --播放过的列表
-- self.LastPlayTime = -1 --上次播放时间
function XSignBoardPlayer:SetPlayerData(data)
self.PlayerData = data
end
--设置播放队列
function XSignBoardPlayer:SetPlayList(playList)
if not playList or #playList <= 0 then
return
end
self.PlayerData.PlayerList = {}
self.PlayerData.LastPlayTime = -1
self.DelayStart = self.Time + self.Delay
for _, element in ipairs(playList) do
table.insert(self.PlayerData.PlayerList, element)
end
end
--播放
function XSignBoardPlayer:Play(tab, cvType)
if not tab then
return false
end
if not self:IsActive() then
return false
end
if self.PlayerData.PlayingElement and self.PlayerData.PlayingElement.Id == tab.Id then
return false
end
local element = {}
element.Id = tab.Id --Id
element.AddTime = self.Time -- 添加事件
element.StartTime = -1 --开始播放的时间
element.EndTime = -1 --结束时间
-- 获取相应语言的动作持续时间
local duration
local defaultCvType = CS.XGame.Config:GetInt("DefaultCvType")
local curElementCvType = cvType or CS.UnityEngine.PlayerPrefs.GetInt("CV_TYPE", defaultCvType)
if tab.Duration[curElementCvType] == nil then
if tab.Duration[defaultCvType] == nil then
XLog.Error(string.format("XSignBoardPlayer:Play函数错误配置表SignboardFeedback.tab没有配置Id:%s的Duration数据", tostring(element.Id)))
return false
end
duration = tab.Duration[defaultCvType]
else
duration = tab.Duration[curElementCvType]
end
element.Duration = duration
element.Validity = tab.Validity --有效期
element.CoolTime = 0--tab.CoolTime --冷却时间
element.Weight = tab.Weight --权重
element.SignBoardConfig = tab
element.CvType = cvType
table.insert(self.PlayerData.PlayerList, 1, element)
return true
end
--播放下一个
--isRecord决定是否要保存当前动作播放记录
function XSignBoardPlayer:PlayNext(isRecord)
if not self:IsActive() then
return
end
if not self.PlayerData.PlayerList or #self.PlayerData.PlayerList == 0 then
return
end
--获取第一个在有限期之类的动画
local head = nil
while #self.PlayerData.PlayerList > 0 and not head do
local temp = table.remove(self.PlayerData.PlayerList, 1)
-- local lastPlayTime = self.PlayerData.PlayedList[temp.Id]
-- --如果还在冷却中
-- if lastPlayTime and self.Time < lastPlayTime then
-- if #self.PlayerData.PlayerList <= 0 then
-- break
-- end
-- temp = table.remove(self.PlayerData.PlayerList, 1)
-- end
--检测是否过期
if temp.Validity < 0 then
head = temp
else
local validity = temp.Validity + temp.AddTime
if validity > self.Time then
head = temp
end
end
end
--如果找不到合适的动画
if not head then
return
end
head.StartTime = self.Time
self.PlayerData.PlayingElement = head
self.Status = PlayerState.PLAYING
self.PlayerData.LastPlayTime = head.StartTime + head.Duration
if isRecord then
-- 记录播放过的动作
XDataCenter.SignBoardManager.RecordSignBoard(head.SignBoardConfig)
end
self.PlayUi:Play(head)
if self.PlayOne then
-- 清空播放列表,只播放当前权重最高的动画(head)
self.PlayerData.PlayerList = {}
end
end
--停止
function XSignBoardPlayer:Stop()
if self.PlayerData.PlayingElement == nil then
return
end
self.PlayerData.PlayedList[self.PlayerData.PlayingElement.Id] = XTime.GetServerNowTimestamp() + self.PlayerData.PlayingElement.CoolTime
self.PlayUi:OnStop(self.PlayerData.PlayingElement)
self.PlayerData.PlayingElement = nil
self.Status = PlayerState.IDLE
self.LastPlayTime = XTime.GetServerNowTimestamp()
end
--暂停
function XSignBoardPlayer:Pause()
self.Status = PlayerState.PAUSE
end
function XSignBoardPlayer:Freeze()
self.Status = PlayerState.STOP
end
function XSignBoardPlayer:Resume()
self.LastPlayTime = XTime.GetServerNowTimestamp()
self.Status = PlayerState.IDLE
end
--更新
function XSignBoardPlayer:Update(deltaTime)
self.Time = self.Time + deltaTime
if self.Time < self.DelayStart then
return
end
if not self:IsActive() then
return
end
if (not self.PlayerData.PlayerList or #self.PlayerData.PlayerList == 0) and self.PlayerData.PlayingElement == nil then
return
end
if self.Status == PlayerState.STOP then
return
end
if self.Status == PlayerState.PAUSE then
return
end
local nextElementTime = self.PlayerData.LastPlayTime + self.CoolTime
--存在播放中的动作
if self.PlayerData.PlayingElement ~= nil and self.PlayerData.PlayingElement.Duration > 0 then
local deadline = self.PlayerData.PlayingElement.StartTime + self.PlayerData.PlayingElement.Duration
if deadline < self.Time then
if self.PlayUi.Parent.SetWhetherPlayChangeActionEffect then
--动作生命周期正常结束,不用播放打断特效
self.PlayUi.Parent:SetWhetherPlayChangeActionEffect(false)
end
self:SetInterruptDetection(false)
self:Stop()
return
end
end
--冷却时间
if nextElementTime < self.Time and self.Status ~= PlayerState.PLAYING and self.AutoPlay then
self:PlayNext(true)
end
end
function XSignBoardPlayer:SetInterruptDetection(boolValue)
self.IsInInterruptDetection = boolValue
end
function XSignBoardPlayer:GetInterruptDetection()
return self.IsInInterruptDetection
end
--强制运行
function XSignBoardPlayer:ForcePlay(tab, cvType, isRecord)
if self.Status == PlayerState.STOP then
return
end
if self:Play(tab, cvType) then
self:PlayNext(isRecord)
end
end
function XSignBoardPlayer:IsPlaying()
return self.Status == PlayerState.PLAYING
end
--设置自动播放
function XSignBoardPlayer:SetAutoPlay(bAutoPlay)
self.AutoPlay = bAutoPlay
end
-- 播放队列是否只播放权重最高的动画
function XSignBoardPlayer:SetPlayOne(bPlayOne)
self.PlayOne = bPlayOne
end
---生命周期----------------------------------------------
function XSignBoardPlayer:IsActive()
return self.Active
end
function XSignBoardPlayer:OnEnable()
self.Active = true
self:Resume()
end
function XSignBoardPlayer:OnDisable()
self.Active = false
self:Stop()
end
function XSignBoardPlayer:OnDestroy()
self:Stop()
end
return XSignBoardPlayer

View file

@ -0,0 +1,45 @@
XStack = XClass(nil, "XStack")
function XStack:Ctor()
self:Clear()
end
function XStack:Clear()
self.__Container = {}
self.__EndIndex = 0
end
function XStack:IsEmpty()
return self.__EndIndex < 1
end
function XStack:Count()
return self.__EndIndex
end
function XStack:Push(element)
if not element then return end
local endIndex = self.__EndIndex + 1
self.__EndIndex = endIndex
self.__Container[endIndex] = element
end
function XStack:Pop()
if self:IsEmpty() then
self:Clear()
return
end
local endIndex = self.__EndIndex
local element = self.__Container[endIndex]
self.__EndIndex = endIndex - 1
self.__Container[endIndex] = nil
return element
end
function XStack:Peek()
return self.__Container[self.__EndIndex]
end

View file

@ -0,0 +1,411 @@
--==============================--
-- 字符串相关扩展方法
--==============================--
local tonumber = tonumber
local next = next
local pairs = pairs
local string = string
local table = table
local math = math
local stringLen = string.len
local stringByte = string.byte
local stringSub = string.sub
local stringGsub = string.gsub
local stringFind = string.find
local stringMatch = string.match
local tableInsert = table.insert
local mathFloor = math.floor
--==============================--
--desc: 通过utf8获取字符串长度
--@str: 字符串
--@return 字符串长度
--==============================--
function string.Utf8Len(str)
local len = stringLen(str)
local left = len
local cnt = 0
local arr = { 0, 192, 224, 240, 248, 252 }
while left ~= 0 do
local tmp = stringByte(str, -left)
local i = #arr
while arr[i] do
if tmp >= arr[i] then
left = left - i
break
end
i = i - 1
end
cnt = cnt + 1
end
return cnt
end
--==============================--
--desc: 通过utf8获取单个字符长度
--@str: 单个字符
--@return 字符串长度
--==============================--
function string.Utf8Size(char)
if not char then
return 0
elseif char >= 252 then
return 6
elseif char >= 248 then
return 5
elseif char >= 240 then
return 4
elseif char >= 225 then
return 3
elseif char >= 192 then
return 2
else
return 1
end
end
--==============================--
--desc: 按utf8长度截取字符串
--@str: 字符串
--@return 字符串
--==============================--
function string.Utf8Sub(str, startChar, numChars)
local startIndex = 1
while startChar > 1 do
local char = stringByte(str, startIndex)
startIndex = startIndex + string.Utf8Size(char)
startChar = startChar - 1
end
local currentIndex = startIndex
while numChars > 0 and currentIndex <= #str do
local char = stringByte(str, currentIndex)
currentIndex = currentIndex + string.Utf8Size(char)
numChars = numChars - 1
end
return str:sub(startIndex, currentIndex - 1)
end
--==============================--
--desc: 将字符串分割成char table
--@str: 字符串
--@return char table
--==============================--
function string.SplitWordsToCharTab(str)
local len = stringLen(str)
local left = len
local chartab = {}
local arr = { 0, 192, 224, 240, 248, 252 }
while left ~= 0 do
local tmp = stringByte(str, -left)
local i = #arr
local value = left
while arr[i] do
if tmp >= arr[i] then
left = left - i
break
end
i = i - 1
end
local char = stringSub(str, -value, -left - 1)
if stringSub(str, -left, -left + 1) == "\\n" then
left = left - 2
char = char .. "\n"
end
tableInsert(chartab, char)
end
return chartab
end
--==============================--
--desc: 把有富文本格式的字符串变成char table
--@str: 富文本字符串
--@return char table
--==============================--
function string.CharsConvertToCharTab(str)
--str = "我只是用来{<color=#00ffffff><size=40>测一测</size></color>}别xiabibi{<size=25><color=#ff0000ff>红色试一试</color></size>}试玩啦"--
local leftindexs = {}
local rightindexs = {}
local startpos = 1
while true do
local pos = stringFind(str, "{", startpos)
if not pos then
break
end
tableInsert(leftindexs, pos)
pos = stringFind(str, "}", pos + 1)
if not pos then
break
end
tableInsert(rightindexs, pos)
startpos = pos + 1
end
local words = {}
if #leftindexs > 0 then
startpos = 1
for i = 1, #leftindexs do
tableInsert(words, stringSub(str, startpos, leftindexs[i] - 1))
tableInsert(words, stringSub(str, leftindexs[i] + 1, rightindexs[i] - 1))
startpos = rightindexs[i] + 1
end
if rightindexs[#rightindexs] ~= stringLen(str) then
tableInsert(words, stringSub(str, startpos))
end
else
tableInsert(words, str)
end
local result = {}
for i = 1, #words do
local tab
local IsRichText
local format
if stringSub(words[i], 1, 1) == "<" then
IsRichText = true
local pa = stringMatch(words[i], "%b></")
pa = stringMatch(pa, ">(.*)<")
format = stringGsub(words[i], "%b></", ">#$#</", 1)
tab = string.SplitWordsToCharTab(pa)
else
IsRichText = false
format = ""
tab = string.SplitWordsToCharTab(words[i])
end
for j = 1, #tab do
if IsRichText then
local char = stringGsub(format, "#$#", tab[j])
tableInsert(result, char)
else
tableInsert(result, tab[j])
end
end
end
return result
end
--==============================--
--desc: 检查字符串的开头是否与指定字符串匹配
--@str: 需要检查的字符串
--@value: 指定的字符串
--@return true匹配false不匹配
--==============================--
function string.StartsWith(str, value)
return stringSub(str, 1, stringLen(value)) == value
end
--==============================--
--desc: 检查字符串的结尾是否与指定字符串匹配
--@str: 需要检查的字符串
--@value: 指定的字符串
--@return true匹配false不匹配
--==============================--
function string.EndsWith(str, value)
return value == "" or stringSub(str, -stringLen(value)) == value
end
--==============================--
--desc: 字符串分割
--@str: 原字符串
--@separator: 分割符
--@return 字符串数组
--==============================--
function string.Split(str, separator)
if str == nil or str == "" then
return {}
end
if not separator then
separator = "|"
end
local result = {}
local startPos = 1
while true do
local endPos = str:find(separator, startPos)
if endPos == nil then
break
end
local elem = str:sub(startPos, endPos - 1)
tableInsert(result, elem)
startPos = endPos + #separator
end
tableInsert(result, str:sub(startPos))
return result
end
--==============================--
--desc: 将字符串分割成int数组
--@str: 原字符串
--@separator: 分割符
--@return int数组
--==============================--
function string.ToIntArray(str, separator)
local strs = string.Split(str, separator)
local array = {}
if next(strs) then
for _, v in pairs(strs) do
tableInsert(array, mathFloor(tonumber(v)))
end
end
return array
end
--==============================--
--desc: 从一个字符串中查找另一个字符串的第一次匹配的索引
--@str: 原字符串
--@separator: 需要匹配的字符串
--@return 索引号
--==============================--
function string.IndexOf(str, separator)
if not str or str == "" or not separator or separator == "" then
return -1
end
for i = 1, #str do
local success = true
for s = 1, #separator do
local strChar = stringByte(str, i + s - 1)
local sepChar = stringByte(separator, s)
if strChar ~= sepChar then
success = false
break
end
end
if success then
return i
end
end
return -1
end
--==============================--
--desc: 从一个字符串中查找另一个字符串的最后一次匹配的索引
--@str: 原字符串
--@separator: 需要匹配的字符串
--@return 索引号
--==============================--
function string.LastIndexOf(str, separator)
if not str or str == "" or not separator or separator == "" then
return -1
end
local strLen = #str
local sepLen = #separator
for i = 0, strLen - 1 do
local success = true
for s = 0, sepLen - 1 do
local strChar = stringByte(str, strLen - i - s)
local sepChar = stringByte(separator, sepLen - s)
if strChar ~= sepChar then
success = false
break
end
end
if success then
return strLen - i - sepLen + 1
end
end
return -1
end
--==============================--
--desc: 判断字符串是否为nil或者为空
--@str: 字符串对象
--@return 如果为nil或者为空返回true否则返回fale
--==============================--
function string.IsNilOrEmpty(str)
return str == nil or #str == 0
end
--==============================--
--desc: 过滤utf文本特殊屏蔽字干扰字符
--@str: 字符串对象
--@return 过滤后文本
--==============================--
local FilterSymbols = [[·~@#¥%……&*-=——+【】{}、|;‘’:“”,。、《》?[]{}""'';:./?,<>\|-_=+*()!@#$%^&*~` ]]
local FilterSymbolsTable = FilterSymbols:SplitWordsToCharTab()
function string.FilterWords(str)
local result = ""
for i = 1, string.Utf8Len(str) do
local nowStr = string.Utf8Sub(str, i, 1)
local isValid = true
for _, v in pairs(FilterSymbolsTable) do
if nowStr == v then
isValid = false
break
end
end
if isValid then
result = result .. nowStr
end
end
return result
end
--==============================--
--desc: 字符串每隔X个字符插入 需要的字符串
--@str: 字符串对象
--@interval: 间隔多少个字符
--@insertStr: 插入的字符串
--@return 过滤后文本
--==============================--
function string.InsertStr(str, interval, insertStr)
local index = 1
local worldCount = 0
local result = ""
while true do
local world = stringSub(str, index, index)
local byte = stringByte(world)
if byte > 128 then
world = stringSub(str, index, index + 2)
index = index + 3
else
index = index + 1
end
result = result .. world
worldCount = worldCount + 1
if worldCount >= interval then
result = result .. insertStr
worldCount = 0
end
if index > #str then
break
end
end
return result
end
--判断字符串是否为合法IP"[0-255].[0-255].[0-255].[0-255]"
function string.IsIp(ip)
if string.IsNilOrEmpty(ip) then return false end
local valueSet = table.pack(string.find(ip, "(%d+)%.(%d+)%.(%d+)%.(%d+)"))
if not valueSet[1] then return false end
local ipNum
for i = 3, 6 do
ipNum = tonumber(valueSet[i])
if not ipNum or ipNum < 0 or ipNum > 255 then
return false
end
end
return true
end

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,265 @@
XTime = XTime or {}
local floor = math.floor
local CsTime = CS.UnityEngine.Time
local ServerTimeWhenStartupList = {} --客户端启动时,服务器的时间戳
local ServerTimeMaxCount = 10 --保存服务端时间的最大个数
local CurrentSaveIndex = 1 --当前保存到的下标
local ServerTimeWhenStartupAverage = 0 --客户端启动时,服务器的时间戳平局值
-- 一星期中的第几天 (3)[1 - 6 = 星期天 - 星期六]
local WeekOfDay = {
Sun = 0,
Mon = 1,
Tues = 2,
Wed = 3,
Thur = 4,
Fri = 5,
Sat = 6,
NorSun = 7,
}
local WeekOfDayIndex = {
[WeekOfDay.Mon] = 1,
[WeekOfDay.Tues] = 2,
[WeekOfDay.Wed] = 3,
[WeekOfDay.Thur] = 4,
[WeekOfDay.Fri] = 5,
[WeekOfDay.Sat] = 6,
[WeekOfDay.Sun] = 7,
[WeekOfDay.NorSun] = 7,
}
local WeekLength = 7
local sec_of_a_day = 24 * 60 * 60
local sec_of_refresh_time = 7 * 60 * 60
--==============================--
--desc: 获取服务器当前时间戳
--@return 长整型时间戳,单位(秒)
--==============================--
function XTime.GetServerNowTimestamp()
local sinceStartup = CsTime.realtimeSinceStartup
return floor(ServerTimeWhenStartupAverage + sinceStartup)
end
--==============================--
--desc: 同步时间
--@serverTime: 服务器时间
--@reqTime: 发起请求时间
--@resTime: 收到响应时间
--==============================--
function XTime.SyncTime(serverTime, reqTime, resTime)
local startup = (reqTime + resTime) * 0.5
local span = serverTime - startup
if CurrentSaveIndex > ServerTimeMaxCount then
CurrentSaveIndex = CurrentSaveIndex - ServerTimeMaxCount
end
ServerTimeWhenStartupList[CurrentSaveIndex] = span
CurrentSaveIndex = CurrentSaveIndex + 1
local count = #ServerTimeWhenStartupList
local total = 0
for _, v in ipairs(ServerTimeWhenStartupList) do
total = total + v
end
ServerTimeWhenStartupAverage = total / count
end
--==============================--
--desc: 时间字符串转服务器时区时间戳
--@dateTimeString: 时间字符串
--@return 转失败返回nil
--==============================--
function XTime.ParseToTimestamp(dateTimeString)
if dateTimeString == nil or dateTimeString == "" then
return
end
local success, timestamp = CS.XDateUtil.TryParseToTimestamp(dateTimeString)
if not success then
XLog.Error("XTime.TryParseToTimestamp parse to timestamp failed. try use ParseToTimestampMDY: " .. tostring(dateTimeString))
return XTime.ParseToTimestampMDY(dateTimeString)
end
return timestamp
end
function XTime.ParseToTimestampMDY(dateTimeString)
local arr = string.Split(dateTimeString, " ")
local date = arr[1]
local time = arr[2]
local dateArr = string.Split(date, "/")
local m = dateArr[1]
local d = dateArr[2]
local y = dateArr[3]
dateTimeString = y .. "/" .. m .. "/" .. d .. " " .. time
local success, timestamp = CS.XDateUtil.TryParseToTimestamp(dateTimeString)
if not success then
XLog.Error("XTime.TryParseToTimestamp parse to timestamp failed. invalid time argument: " .. tostring(dateTimeString))
return -- 该类在CS中不存在且在1.18版本出现时区格式问题
-- return CS.XDate.GetTime(dateTimeString)
end
return timestamp
end
--时间戳转utc时间字符串
function XTime.TimestampToUtcDateTimeString(timestamp, format)
format = format or "yyyy-MM-dd HH:mm:ss"
local dt = CS.XDateUtil.GetUtcDateTime(timestamp)
return dt:ToString(format)
end
--时间戳转设备本地时间字符串
function XTime.TimestampToLocalDateTimeString(timestamp, format)
format = format or "yyyy-MM-dd HH:mm:ss"
local dt = CS.XDateUtil.GetLocalDateTime(timestamp)
return dt:ToString(format)
end
--时间戳转游戏指定时区时间字符串
function XTime.TimestampToGameDateTimeString(timestamp, format)
format = format or "yyyy-MM-dd HH:mm:ss"
local dt = CS.XDateUtil.GetGameDateTime(timestamp)
return dt:ToString(format)
end
-- c#星期枚举转整形数
function XTime.DayOfWeekToInt(dayOfWeek, isNormlSunDay)
if dayOfWeek == CS.System.DayOfWeek.Sunday then
return isNormlSunDay and 7 or 0
elseif dayOfWeek == CS.System.DayOfWeek.Monday then
return 1
elseif dayOfWeek == CS.System.DayOfWeek.Tuesday then
return 2
elseif dayOfWeek == CS.System.DayOfWeek.Wednesday then
return 3
elseif dayOfWeek == CS.System.DayOfWeek.Thursday then
return 4
elseif dayOfWeek == CS.System.DayOfWeek.Friday then
return 5
else
return 6
end
end
--获取今天时间
function XTime.GetTodayTime(hour, min, sec)
hour = hour or 0
min = min or 0
sec = sec or 0
local nowTime = XTime.GetServerNowTimestamp()
local dt = CS.XDateUtil.GetGameDateTime(nowTime)
dt = dt.Date;
dt:AddSeconds(sec)
dt:AddMinutes(min)
dt:AddHours(hour)
return dt:ToTimestamp()
end
function XTime.GeyServerTime(hour, min, sec)
hour = hour or 0
min = min or 0
sec = sec or 0
local nowTime = XTime.GetServerNowTimestamp()
local dt = CS.XDateUtil.GetGameDateTime(nowTime)
dt = dt.Date;
dt = dt:AddSeconds(sec)
dt = dt:AddMinutes(min)
dt = dt:AddHours(hour)
return dt:ToTimestamp()
end
-- 获取距离下一个星期x的时间,默认每周第一天为周一
function XTime.GetNextWeekOfDayStartWithMon(weekOfDay, offsetTime)
local needTime
local nowTime = XTime.GetServerNowTimestamp()
local dateTime = CS.XDateUtil.GetGameDateTime(nowTime)
local weekZero = CS.XDateUtil.GetFirstDayOfThisWeek(dateTime):ToTimestamp()
local resetTime = (WeekOfDayIndex[weekOfDay] - 1) * sec_of_a_day + offsetTime + weekZero
if nowTime < resetTime then
needTime = resetTime - nowTime
else
needTime = WeekLength * sec_of_a_day - (nowTime - resetTime)
end
return needTime
end
-- 获取最近一个未到达的星期X的服务器更新时间
function XTime.GetSeverNextWeekOfDayRefreshTime(weekOfDay)
local needTime = XTime.GetNextWeekOfDayStartWithMon(weekOfDay, sec_of_refresh_time)
local nowTime = XTime.GetServerNowTimestamp()
return nowTime + needTime
end
-- 获取服务器当天5点更新时间戳
function XTime.GetSeverTodayFreshTime()
local now = XTime.GetServerNowTimestamp()
local dateTime = CS.XDateUtil.GetGameDateTime(now)
local dayZero = dateTime.Date:ToTimestamp()
return dayZero + sec_of_refresh_time
end
-- 获取服务器明天5点更新时间戳
function XTime.GetSeverTomorrowFreshTime()
local dayFreshTime = XTime.GetSeverTodayFreshTime()
return dayFreshTime + sec_of_a_day
end
-- 获取服务器昨天5点更新时间戳
function XTime.GetSeverYesterdayFreshTime()
local dayFreshTime = XTime.GetSeverTodayFreshTime()
return dayFreshTime - sec_of_a_day
end
--获取服务器下一次5点更新时间戳
function XTime.GetSeverNextRefreshTime()
local nextRefreshTime
local dayRefreshTime = XTime.GetSeverTodayFreshTime()
local nowTime = XTime.GetServerNowTimestamp()
nextRefreshTime = nowTime > dayRefreshTime and XTime.GetSeverTomorrowFreshTime() or dayRefreshTime
return nextRefreshTime
end
-- 判断服务器当下是否是周末
function XTime.CheckWeekend()
local now = XTime.GetServerNowTimestamp()
local weekday = XTime.GetWeekDay(now, false)
if weekday == WeekOfDay.Sun then
return true
elseif weekday == WeekOfDay.Sat then
local todayFreshTime = XTime.GetSeverTodayFreshTime()
return now >= todayFreshTime
elseif weekday == WeekOfDay.Mon then
local todayFreshTime = XTime.GetSeverTodayFreshTime()
return now < todayFreshTime
else
return false
end
end
-- 判断时间戳是周几
function XTime.GetWeekDay(time, isNormlSunDay)
local dateTime = CS.XDateUtil.GetGameDateTime(time)
local weekday = XTime.DayOfWeekToInt(dateTime.DayOfWeek, isNormlSunDay)
return weekday
end
--获取一个时间戳的当天刷新的时间
function XTime.GetTimeDayFreshTime(time)
local todayRefreshTime
local dateTime = CS.XDateUtil.GetGameDateTime(time)
local dayZero = dateTime.Date:ToTimestamp()
todayRefreshTime = dayZero + sec_of_refresh_time
return todayRefreshTime
end

View file

@ -0,0 +1,307 @@
local Json = require("XCommon/Json")
local type = type
local table = table
local string = string
local math = math
local next = next
local debug = debug
local tostring = tostring
local tableInsert = table.insert
local stringMatch = string.match
local mathModf = math.modf
XTool = XTool or {}
XTool.UObjIsNil = function(uobj)
return uobj == nil or not uobj:Exist()
end
XTool.LoopMap = function(map, func)
if type(map) == "userdata" then
if not map then
return
end
local e = map:GetEnumerator()
while e:MoveNext() do
func(e.Current.Key, e.Current.Value)
end
e:Dispose()
elseif type(map) == "table" then
for key, value in pairs(map) do
func(key, value)
end
end
end
XTool.LoopCollection = function(collection, func)
if type(collection) == "table" then
for _, value in pairs(collection) do
func(value)
end
elseif type(collection) == "userdata" then
for i = 0, collection.Count - 1 do
func(collection[i])
end
end
end
XTool.LoopArray = function(collection, func)
for i = 0, collection.Length - 1 do
func(collection[i])
end
end
XTool.CsList2LuaTable = function(collection)
local ret = {}
for i = 0, collection.Count - 1 do
tableInsert(ret, collection[i])
end
return ret
end
XTool.CsMap2LuaTable = function(map)
local ret = {}
local e = map:GetEnumerator()
while e:MoveNext() do
ret[e.Current.Key] = e.Current.Value
end
e:Dispose()
return ret
end
XTool.CsObjectFields2LuaTable = function(CsObj)
if CsObj == nil or type(CsObj) ~= "userdata" then
return {}
end
local jsonStr = CS.XTool.SerializeObject(CsObj)
return Json.decode(jsonStr)
end
XTool.Clone = function(t)
local cache = {}
local function clone(o)
if type(o) ~= "table" then return o end
if cache[o] then return cache[o] end
local newO = {}
for k, v in pairs(o) do
newO[clone(k)] = clone(v)
end
local mTable = getmetatable(o)
if type(mTable) == "table" then
setmetatable(newO, mTable)
end
cache[o] = newO
return newO
end
return clone(t)
end
XTool.GetFileNameWithoutExtension = function(path)
return stringMatch(path, "[./]*([^/]*)%.%w+")
end
XTool.GetFileName = function(path)
return stringMatch(path, "[./]*([^/]*%.%w+)")
end
XTool.GetExtension = function(path)
return stringMatch(path, "[./]*(%.%w+)")
end
XTool.GetTableCount = function(list)
if type(list) ~= "table" then
XLog.Error(" XTool.GetTableCount 函数错误 : 参数list需要是table类型的, list" .. type(list))
return
end
local count = 0
for _, _ in pairs(list) do
count = count + 1
end
return count
end
local NumberText = {
[0] = "",
[1] = CS.XTextManager.GetText("One"),
[2] = CS.XTextManager.GetText("Two"),
[3] = CS.XTextManager.GetText("Three"),
[4] = CS.XTextManager.GetText("Four"),
[5] = CS.XTextManager.GetText("Five"),
[6] = CS.XTextManager.GetText("Six"),
[7] = CS.XTextManager.GetText("Seven"),
[8] = CS.XTextManager.GetText("Eight"),
[9] = CS.XTextManager.GetText("Nine"),
[10] = CS.XTextManager.GetText("Ten"),
}
XTool.ParseNumberString = function(num)
return NumberText[mathModf(num / 10)] .. NumberText[num % 10]
end
XTool.ConvertNumberString = function(num)
return NumberText[num] or ""
end
XTool.MatchEmoji = function(text)
return stringMatch(text, '%[%d%d%d%d%d%]')
end
XTool.CopyToClipboard = function(text)
CS.XAppPlatBridge.CopyStringToClipboard(tostring(text))
XUiManager.TipText("Clipboard", XUiManager.UiTipType.Tip)
end
XTool.ToArray = function(t)
local array = {}
for _, v in pairs(t) do
table.insert(array, v)
end
return array
end
XTool.MergeArray = function(...)
local res = {}
for _, t in pairs({ ... }) do
if type(t) == "table" then
for _, v in pairs(t) do
table.insert(res, v)
end
end
end
return res
end
function XTool.ReverseList(list)
if not list then return end
local length = #list
local middle = math.floor(length * 0.5)
for i = 1, middle do
local reverseI = length - i + 1
local tmp = list[i]
list[i] = list[reverseI]
list[reverseI] = tmp
end
return list
end
XTool.Waterfall = function(cbList)
local last
for i = #cbList, 1, -1 do
if type(cbList[i]) == "function" then
local nextCb = last
local cb = function()
cbList[i](nextCb)
end
last = cb
else
XLog.Error("XTool.Waterfall error, unit is not function")
end
end
if last then
last()
end
end
XTool.InitUiObject = function(targetObj)
targetObj.Obj = targetObj.Transform:GetComponent("UiObject")
if targetObj.Obj ~= nil then
for i = 0, targetObj.Obj.NameList.Count - 1 do
targetObj[targetObj.Obj.NameList[i]] = targetObj.Obj.ObjList[i]
end
end
end
XTool.InitUiObjectByUi = function(targetUi, uiPrefab)
targetUi.GameObject = uiPrefab.gameObject
targetUi.Transform = uiPrefab.transform
XTool.InitUiObject(targetUi)
return targetUi
end
XTool.DestroyChildren = function(gameObject)
if not gameObject then
return
end
if XTool.UObjIsNil(gameObject) then
return
end
local transform = gameObject.transform
for i = 0, transform.childCount - 1, 1 do
CS.UnityEngine.Object.Destroy(transform:GetChild(i).gameObject)
end
end
XTool.IsTableEmpty = function(tb)
return not tb or not next(tb)
end
XTool.IsNumberValid = function(number)
return number and number ~= 0
end
XTool.GetStackTraceName = function(level)
level = level or 3
local info
for i = level, 2, -1 do
info = debug.getinfo(i)
if info then
break
end
end
local name = "lua:" .. tostring(info.source) .. "_" .. tostring(info.currentline)
return name
end
-- datas : 只接受数组
XTool.TableRemove = function(datas, removeValue)
local removePos = nil
for index, value in ipairs(datas) do
if value == removeValue then
removePos = index
break
end
end
if removePos then table.remove(datas, removePos) end
end
-- 保留digit位小数
XTool.MathGetRoundingValue = function(value, digit)
return math.floor( value * XTool.MathPow(10, digit) ) / XTool.MathPow(10 , digit)
end
XTool.MathPow = function(a, b)
return a ^ b
end
--随机打乱
XTool.RandomBreakTableOrder = function(t)
local index
local temp
local total = #t
for i = 1, total, 1 do
for j = i + 1, total, 1 do
index = math.random(j, total);
temp = t[i];
t[i] = t[index];
t[index] = temp;
break
end
end
return t
end

View file

@ -0,0 +1,56 @@
XUiGravity = XClass(XLuaBehaviour, "XUiGravity")
-- 范围(防止画面抖动)
local range = 0.01
function XUiGravity:Ctor(rootUi, ui, minX, maxX, minY, maxY)
self.minX = minX
self.maxX = maxX
self.minY = minY
self.maxY = maxY
self.lastAttitude = CS.UnityEngine.Vector3.zero
self.testV = 0
self.testSpeed = 0.01
end
function XUiGravity:Start()
CS.UnityEngine.Input.gyro.enabled = true
end
function XUiGravity:Update()
self.testV = self.testV + self.testSpeed
if self.testV > 1 then
self.testSpeed = -0.01
elseif self.testV < -1 then
self.testSpeed = 0.01
end
local transform = self.Transform
-- local attitude = CS.UnityEngine.Vector3(CS.UnityEngine.Input.gyro.attitude.x, CS.UnityEngine.Input.gyro.attitude.y, 0)
local attitude = CS.UnityEngine.Vector3(self.testV, 0, 0)
--使安全范围内 - 1之1
attitude.x = XMath.Clamp(attitude.x, -1, 1);
attitude.y = XMath.Clamp(attitude.y, -1, 1);
local x = transform.localPosition.x
local y = transform.localPosition.y
local isDirty = false
if math.abs(self.lastAttitude.x - attitude.x) >= range then
isDirty = true
local direction = attitude.x - self.lastAttitude.x
local position = direction * (self.maxX - self.minX) / 2
x = XMath.Clamp(transform.localPosition.x - position, self.minX, self.maxX);
self.lastAttitude = attitude
end
if math.abs(self.lastAttitude.y - attitude.y) >= range then
isDirty = true
local direction = attitude.y - self.lastAttitude.y
local position = direction * (self.maxY - self.minY) / 2
y = XMath.Clamp(transform.localPosition.y - position, self.minY, self.maxY);
self.lastAttitude = attitude
end
if isDirty then
transform.localPosition = CS.UnityEngine.Vector3(x, y, transform.localPosition.z);
end
end
return XUiGravity

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,171 @@
local TABLE_ACTIVITY_PATH = "Client/ActivityBrief/ActivityBrief.tab"
local TABLE_ACTIVITY_SHOP = "Client/ActivityBrief/ActivityBriefShop.tab"
local TABLE_ACTIVITY_TASK = "Client/ActivityBrief/ActivityBriefTask.tab"
local TABLE_ACTIVITY_GROUP_PATH = "Client/ActivityBrief/ActivityBriefGroup.tab"
local TABLE_ACTIVITY_SPECIAL = "Client/ActivityBrief/SpecialActivity.tab"
local TABLE_ACTIVITY_Story = "Share/ActivityBrief/ActivityBriefStory.tab"
local ParseToTimestamp = XTime.ParseToTimestamp
local ActivityTemplates = {}
local ActivityShopTemplates = {}
local ActivityTaskTemplates = {}
local ActivityGroupTemplates = {}
local SpecialActivityTemplates = {}
local ActivityStoryTemplates = {}
local SkipIdToRedPointConditionsDic = {}
XActivityBriefConfigs = XActivityBriefConfigs or {}
-- 活动名称Id有需要新增勿删改
XActivityBriefConfigs.ActivityGroupId = {
MainLine = 1, --主线活动
Branch = 2, --支线活动
BossSingle = 3, --单机Boss活动
BossOnline = 4, --联机Boss活动
Prequel = 5, --间章故事-角色A
BabelTower = 6, --巴别塔
RougueLike = 7, --爬塔
RepeatChallenge = 8, --复刷关
ArenaOnline = 9, --区域联机
UnionKill = 10, --狙击战
ShortStories = 11, --短篇故事
Prequel2 = 12, --间章故事-角色B
Labyrinth = 13, --迷宫
Society = 14, --公会
Resource = 15, --资源
BigWar = 16, --大作战
Extra = 17, --番外-普通
WorldBoss = 18, --世界Boss
Expedition = 19, --自走棋
FubenBossSingle = 20, --幻痛囚笼
ActivityBriefShop = 21, --活动商店
Extra2 = 22, --番外-隐藏
MaintainerAction = 23, --大富翁
RpgTower = 24, --RPG玩法
ActivityDrawCard = 25, --活动抽卡
TRPGMainLine = 26, --终焉福音-主线跑团活动
NewCharActivity = 27, -- 新角色教学活动
FubenActivityTrial = 28, -- 试玩关
ShiTu = 29, -- 师徒系统
Nier = 30, -- 尼尔玩法
Pokemon = 31, -- 口袋战双
Pursuit = 32, -- 追击玩法
StrongHold = 33, --超级据点
Simulate = 34, -- 模拟战
Partner = 35, --伙伴系统
MoeWar = 38, --萌战
PetCard = 39, --宠物抽卡
PetTrial = 40, --新宠物活动
PokerGuessing = 41, --翻牌小游戏
Hack = 42, --骇客
RpgMaker = 43, --端午活动
Reform = 44, --改造玩法
CoupleCombat = 45, --双人同行
SuperTower = 46, --超级爬塔
SummerSeries = 47, --夏活系列关
KillZone = 48, --杀戮无双
}
local InitSkipIdToRedPointConditionsDic = function()
SkipIdToRedPointConditionsDic[11739] = {XRedPointConditions.Types.CONDITION_GUARD_CAMP_RED}
SkipIdToRedPointConditionsDic[80011] = {XRedPointConditions.Types.CONDITION_WHITEVALENTINE2021_ENTRYRED}
SkipIdToRedPointConditionsDic[11753] = {XRedPointConditions.Types.CONDITION_FINGERGUESSING_TASK}
SkipIdToRedPointConditionsDic[11757] = {XRedPointConditions.Types.CONDITION_MOVIE_ASSEMBLE_01}
SkipIdToRedPointConditionsDic[11759] = {XRedPointConditions.Types.CONDITION_MINSWEEPING_RED}
SkipIdToRedPointConditionsDic[11761] = {XRedPointConditions.Types.CONDITION_FASHION_STORY_HAVE_STAGE}
SkipIdToRedPointConditionsDic[81103] = {XRedPointConditions.Types.CONDITION_RPG_MAKER_GAME_RED}
SkipIdToRedPointConditionsDic[1400008] = {XRedPointConditions.Types.CONDITION_SLOTMACHINE_RED}
SkipIdToRedPointConditionsDic[1400009] = {XRedPointConditions.Types.CONDITION_SLOTMACHINE_REDL}
end
function XActivityBriefConfigs.Init()
ActivityTemplates = XTableManager.ReadByIntKey(TABLE_ACTIVITY_PATH, XTable.XTableBriefActivity, "Id")
ActivityShopTemplates= XTableManager.ReadByIntKey(TABLE_ACTIVITY_SHOP, XTable.XTableActivityBriefShop, "Id")
ActivityTaskTemplates= XTableManager.ReadByIntKey(TABLE_ACTIVITY_TASK, XTable.XTableActivityBriefTask, "Id")
ActivityGroupTemplates = XTableManager.ReadByIntKey(TABLE_ACTIVITY_GROUP_PATH, XTable.XTableActivityBriefGroup, "Id")
SpecialActivityTemplates = XTableManager.ReadByIntKey(TABLE_ACTIVITY_SPECIAL, XTable.XTableSpecialActivity, "Id")
ActivityStoryTemplates = XTableManager.ReadByIntKey(TABLE_ACTIVITY_Story, XTable.XTableActivityBriefStory, "Id")
InitSkipIdToRedPointConditionsDic()
end
function XActivityBriefConfigs.GetActivityBeginTime()
local config = XActivityBriefConfigs.GetActivityConfig()
return XFunctionManager.GetStartTimeByTimeId(config.TimeId)
end
function XActivityBriefConfigs.GetActivityEndTime()
local config = XActivityBriefConfigs.GetActivityConfig()
return XFunctionManager.GetEndTimeByTimeId(config.TimeId)
end
function XActivityBriefConfigs.GetActivityConfig()
return ActivityTemplates[1]
end
function XActivityBriefConfigs.GetActivityModels()
local config = XActivityBriefConfigs.GetActivityConfig()
return config.UIModelId or {}
end
function XActivityBriefConfigs.GetSpinePath(index)
local config = XActivityBriefConfigs.GetActivityConfig()
return config.SpinePath[index] or ""
end
function XActivityBriefConfigs.GetActivityEntrySkipId(id)
return SpecialActivityTemplates[id].SkipId
end
function XActivityBriefConfigs.GetAllActivityEntryConfig()
return SpecialActivityTemplates
end
function XActivityBriefConfigs.GetActivityShopByInfoId(id)
return ActivityShopTemplates[id]
end
function XActivityBriefConfigs.GetActivityTaskByInfoId(id)
return ActivityTaskTemplates[id]
end
function XActivityBriefConfigs.GetActivityGroupConfig(groupId)
local groupConfig = ActivityGroupTemplates[groupId]
if not groupConfig then
XLog.ErrorTableDataNotFound("XActivityBriefConfigs.GetActivityGroupConfig",
"根据groupId获取的配置表项", TABLE_ACTIVITY_GROUP_PATH, "groupId", tostring(groupId))
return
end
return groupConfig
end
function XActivityBriefConfigs.TestOpenActivity()
local newTemplate = {}
for id, template in pairs(ActivityTemplates) do
if id ~= 1 then
newTemplate[id] = template
else
newTemplate[id] = XTool.Clone(template)
newTemplate[id].TimeId = 24
end
end
ActivityTemplates = newTemplate
end
function XActivityBriefConfigs.GetTableActivityPath()
return TABLE_ACTIVITY_PATH
end
function XActivityBriefConfigs.GetActivityStoryConfig()
return ActivityStoryTemplates
end
function XActivityBriefConfigs.GetActivityBriefGroup(id)
local config = XActivityBriefConfigs.GetActivityGroupConfig(id)
return config.Name
end
function XActivityBriefConfigs.GetRedPointConditionsBySkipId(skipId)
return skipId and SkipIdToRedPointConditionsDic[skipId]
end

View file

@ -0,0 +1,108 @@
local ParseToTimestamp = XTime.ParseToTimestamp
local TimestampToGameDateTimeString = XTime.TimestampToGameDateTimeString
local TABLE_ACTIVITY_PATH = "Client/Activity/Activity.tab"
local TABLE_ACTIVITY_GROUP_PATH = "Client/Activity/ActivityGroup.tab"
local TABLE_ACTIVITY_LINK_PATH = "Client/Activity/ActivityLink.tab"
local ActivityTemplates = {}
local ActivityGroupTemplates = {}
local ActivityLinkTemplates = {}
XActivityConfigs = XActivityConfigs or {}
--活动类型
XActivityConfigs.ActivityType = {
Task = 1, --任务
Shop = 2, --商店
Skip = 3, --跳转
SendInvitation = 4, --邀请他人
AcceptInvitation = 5, -- 接受邀请
JigsawPuzzle = 6, -- 拼图
Link = 7, --活动外链类型
ConsumeReward = 8, -- 累消奖励
ScratchTicket = 9, -- 普通刮刮乐
ScratchTicketGolden = 10, -- 黄金刮刮乐
}
-- 活动背景类型
XActivityConfigs.ActivityBgType = {
Image = 1, -- 普通图片
Spine = 2, -- Spine动画
}
-- 任务面板跳转类型
XActivityConfigs.TaskPanelSkipType = {
CanZhangHeMing_Qu = 20031, -- 拼图游戏(曲版本预热)
CanZhangHeMing_LuNa = 20036, -- 拼图游戏(露娜预热)
ChrismasTree_Dress = 20048, -- 装点圣诞树小游戏
Couplet_Game = 20064, -- 春节对联游戏
CanZhangHeMing_SP = 20070, -- 拼图游戏(SP角色预热)
InvertCard_Game = 20076, -- 翻牌小游戏
}
function XActivityConfigs.Init()
ActivityTemplates = XTableManager.ReadByIntKey(TABLE_ACTIVITY_PATH, XTable.XTableActivity, "Id")
ActivityGroupTemplates = XTableManager.ReadByIntKey(TABLE_ACTIVITY_GROUP_PATH, XTable.XTableActivityGroup, "Id")
ActivityLinkTemplates = XTableManager.ReadByIntKey(TABLE_ACTIVITY_LINK_PATH, XTable.XTableActivityLink, "Id")
end
function XActivityConfigs.GetActivityTemplates()
return ActivityTemplates
end
function XActivityConfigs.GetActivityGroupTemplates()
return ActivityGroupTemplates
end
function XActivityConfigs.GetActivityTemplate(activityId)
return ActivityTemplates[activityId]
end
function XActivityConfigs.GetActivityTimeStr(activityId, beginTime, endTime)
local activityCfg = XActivityConfigs.GetActivityTemplate(activityId)
local format = "yyyy-MM-dd HH:mm"
local beginTimeStr = ""
local endTimeStr = ""
if not string.IsNilOrEmpty(activityCfg.ShowBeginTime) then
beginTimeStr = activityCfg.ShowBeginTime
else
if beginTime and beginTime ~= 0 then
beginTimeStr = TimestampToGameDateTimeString(beginTime, format)
else
beginTimeStr = TimestampToGameDateTimeString(XFunctionManager.GetStartTimeByTimeId(activityCfg.TimeId), format)
end
end
if not string.IsNilOrEmpty(activityCfg.ShowEndTime) then
endTimeStr = activityCfg.ShowEndTime
else
if endTime and endTime ~= 0 then
endTimeStr = TimestampToGameDateTimeString(endTime, format)
else
endTimeStr = TimestampToGameDateTimeString(XFunctionManager.GetEndTimeByTimeId(activityCfg.TimeId), format)
end
end
if not string.IsNilOrEmpty(beginTimeStr) and not string.IsNilOrEmpty(endTimeStr) then
return beginTimeStr .. "~" .. endTimeStr
else
if not string.IsNilOrEmpty(beginTimeStr) then
return beginTimeStr
elseif not string.IsNilOrEmpty(endTimeStr) then
return endTimeStr
else
return ""
end
end
end
function XActivityConfigs.GetActivityLinkCfg(id)
return ActivityLinkTemplates[id]
end
function XActivityConfigs.GetActivityLinkTemplate()
return ActivityLinkTemplates
end

View file

@ -0,0 +1,9 @@
--
-- Author: wujie
-- Note: app lua层配置相关
XAppConfigs = XAppConfigs or {}
XAppConfigs.PackageName = {
Hero = "com.kurogame.haru.hero",
}

View file

@ -0,0 +1,794 @@
--
-- Author: zhangshuang、wujie
-- Note: 图鉴配置相关
XArchiveConfigs = XArchiveConfigs or {}
XArchiveConfigs.SubSystemType = {
Monster = 1,
Weapon = 2,
Awareness = 3,
Story = 4,
CG = 5,
NPC = 6,
Email = 7,
Partner = 8,
}
XArchiveConfigs.SettingType = {
All = 0,
Setting = 1,
Story = 2,
}
-- 设定位置
XArchiveConfigs.SettingIndex ={
First = 1,
}
XArchiveConfigs.WeaponCamera = {
Main = 1, -- 武器详情默认是主镜头
Setting = 2,
}
XArchiveConfigs.MonsterType = {
Pawn = 1,
Elite = 2,
Boss = 3,
}
XArchiveConfigs.MonsterInfoType = {
Short = 1,
Long = 2,
}
XArchiveConfigs.MonsterSettingType = {
Setting = 1,
Story = 2,
}
XArchiveConfigs.MonsterDetailType = {
Synopsis = 1,
Info = 2,
Setting = 3,
Skill = 4,
Zoom = 5,
ScreenShot = 6,
}
XArchiveConfigs.EquipStarType = {
All = 0,
One = 1,
Two = 2,
Three = 3,
Four = 4,
Five = 5,
Six = 6,
}
XArchiveConfigs.EquipLikeType = {
NULL = 0,
Dis = 1,
Like = 2,
}
XArchiveConfigs.StarToQualityName = {
[XArchiveConfigs.EquipStarType.All] = CS.XTextManager.GetText("ArchiveAwarenessFliterAll"),
[XArchiveConfigs.EquipStarType.Two] = CS.XTextManager.GetText("ArchiveAwarenessFliterTwoStar"),
[XArchiveConfigs.EquipStarType.Three] = CS.XTextManager.GetText("ArchiveAwarenessFliterThreeStar"),
[XArchiveConfigs.EquipStarType.Four] = CS.XTextManager.GetText("ArchiveAwarenessFliterFourStar"),
[XArchiveConfigs.EquipStarType.Five] = CS.XTextManager.GetText("ArchiveAwarenessFliterFiveStar"),
[XArchiveConfigs.EquipStarType.Six] = CS.XTextManager.GetText("ArchiveAwarenessFliterSixStar"),
}
XArchiveConfigs.EvaluateOnForAll = CS.XGame.ClientConfig:GetInt("ArchiveEvaluateOnForAll")
XArchiveConfigs.OnForAllState = {
Off = 0,
On = 1,
}
XArchiveConfigs.NpcGridState = {
Open = 0,
Close = 1,
}
XArchiveConfigs.EmailType = {
Email = 1,
Communication = 2,
}
XArchiveConfigs.PartnerSettingType = {
Setting = 1,
Story = 2,
}
XArchiveConfigs.MonsterDetailUiType = {
Default = 1, -- 默认图鉴打开
Show = 2, -- 只负责显示,屏蔽玩家操作
}
local TABLE_TAG = "Share/Archive/Tag.tab"
local TABLE_ARCHIVE = "Share/Archive/Archive.tab"
local TABLE_MONSTER = "Share/Archive/Monster.tab"
local TABLE_MONSTERINFO = "Share/Archive/MonsterInfo.tab"
local TABLE_MONSTERSKILL = "Share/Archive/MonsterSkill.tab"
local TABLE_MONSTERSETTING = "Share/Archive/MonsterSetting.tab"
local TABLE_SAMENPCGROUP = "Share/Archive/SameNpcGroup.tab"
local TABLE_MONSTERNPCDATA = "Client/Archive/MonsterNpcData.tab"
local TABLE_AWARENESSSETTING = "Share/Archive/AwarenessSetting.tab"
local TABLE_WEAPONSETTING = "Share/Archive/WeaponSetting.tab"
local TABLE_MONSTERMODEL_TRANS = "Client/Archive/MonsterModelTrans.tab"
local TABLE_MONSTER_EFFECT = "Client/Archive/MonsterEffect.tab"
local TABLE_STORYGROUP = "Share/Archive/StoryGroup.tab"
local TABLE_STORYCHAPTER = "Share/Archive/StoryChapter.tab"
local TABLE_STORYDETAIL = "Share/Archive/StoryDetail.tab"
local TABLE_STORYNPC = "Share/Archive/StoryNpc.tab"
local TABLE_STORYNPCSETTING = "Share/Archive/StoryNpcSetting.tab"
local TABLE_CGDETAIL = "Share/Archive/CGDetail.tab"
local TABLE_CGGROUP = "Share/Archive/CGGroup.tab"
local TABLE_ARCHIVEMAIL = "Share/Archive/ArchiveMail.tab"
local TABLE_COMMUNICATION = "Share/Archive/Communication.tab"
local TABLE_EVENTDATEGROUP = "Share/Archive/EventDateGroup.tab"
local TABLE_ARCHIVE_WEAPON_GROUP_PATH = "Client/Archive/ArchiveWeaponGroup.tab"
local TABLE_ARCHIVE_AWARENESS_GROUP_PATH = "Client/Archive/ArchiveAwarenessGroup.tab"
local TABLE_ARCHIVE_AWARENESS_GROUPTYPE_PATH = "Client/Archive/ArchiveAwarenessGroupType.tab"
local TABLE_ARCHIVE_PARTNER_SETTING = "Share/Archive/PartnerSetting.tab"
local TABLE_ARCHIVE_PARTNER = "Client/Archive/ArchivePartner.tab"
local TABLE_ARCHIVE_PARTNER_GROUP = "Client/Archive/ArchivePartnerGroup.tab"
local tableSort = table.sort
local Tags = {}
local Archives = {}
local Monsters = {}
local MonsterInfos = {}
local MonsterSkills = {}
local MonsterSettings = {}
local AwarenessSettings = {}
local WeaponSettings = {}
local SameNpcGroups = {}
local MonsterNpcDatas = {}
local MonsterModelTrans = {}
local MonsterEffects = {}
local StoryGroups = {}
local StoryChapters = {}
local StoryDetails = {}
local StoryNpc = {}
local StoryNpcSetting = {}
local CGGroups = {}
local CGDetails = {}
local ArchiveMails = {}
local ArchiveCommunications = {}
local EventDateGroups = {}
local WeaponGroup = {}
local WeaponTemplateIdToSettingListDic = {}
local ShowedWeaponTypeList = {}
local WeaponTypeToIdsDic = {}
local WeaponSumCollectNum = 0
local AwarenessGroup = {}
local AwarenessGroupType = {}
local AwarenessShowedStatusDic = {}
local AwarenessSumCollectNum = 0
local AwarenessTypeToGroupDatasDic = {}
local AwarenessSuitIdToSettingListDic = {}
local ArchiveTagAllList = {}
local ArchiveStoryGroupAllList = {}
local ArchiveSameNpc = {}
local ArchiveMonsterTransDic = {}
local ArchiveMonsterEffectDatasDic = {}
local ArchivePartnerSettings = {}
local ArchivePartners = {}
local ArchivePartnerGroups = {}
function XArchiveConfigs.Init()
Tags = XTableManager.ReadByIntKey(TABLE_TAG, XTable.XTableArchiveTag, "Id")
Archives = XTableManager.ReadByIntKey(TABLE_ARCHIVE, XTable.XTableArchive, "Id")
Monsters = XTableManager.ReadByIntKey(TABLE_MONSTER, XTable.XTableArchiveMonster, "Id")
MonsterInfos = XTableManager.ReadByIntKey(TABLE_MONSTERINFO, XTable.XTableArchiveMonsterInfo, "Id")
MonsterSkills = XTableManager.ReadByIntKey(TABLE_MONSTERSKILL, XTable.XTableArchiveMonsterSkill, "Id")
MonsterSettings = XTableManager.ReadByIntKey(TABLE_MONSTERSETTING, XTable.XTableMonsterSetting, "Id")
SameNpcGroups = XTableManager.ReadByIntKey(TABLE_SAMENPCGROUP, XTable.XTableSameNpcGroup, "Id")
MonsterNpcDatas = XTableManager.ReadByIntKey(TABLE_MONSTERNPCDATA, XTable.XTableMonsterNpcData, "Id")
MonsterModelTrans = XTableManager.ReadByIntKey(TABLE_MONSTERMODEL_TRANS, XTable.XTableMonsterModelTrans, "Id")
MonsterEffects = XTableManager.ReadByIntKey(TABLE_MONSTER_EFFECT, XTable.XTableMonsterEffect, "Id")
StoryGroups = XTableManager.ReadByIntKey(TABLE_STORYGROUP, XTable.XTableArchiveStoryGroup, "Id")
StoryChapters = XTableManager.ReadByIntKey(TABLE_STORYCHAPTER, XTable.XTableArchiveStoryChapter, "Id")
StoryDetails = XTableManager.ReadByIntKey(TABLE_STORYDETAIL, XTable.XTableArchiveStoryDetail, "Id")
StoryNpc = XTableManager.ReadByIntKey(TABLE_STORYNPC, XTable.XTableArchiveStoryNpc, "Id")
StoryNpcSetting = XTableManager.ReadByIntKey(TABLE_STORYNPCSETTING, XTable.XTableArchiveStoryNpcSetting, "Id")
CGGroups = XTableManager.ReadByIntKey(TABLE_CGGROUP, XTable.XTableArchiveCGGroup, "Id")
CGDetails = XTableManager.ReadByIntKey(TABLE_CGDETAIL, XTable.XTableArchiveCGDetail, "Id")
ArchiveMails = XTableManager.ReadByIntKey(TABLE_ARCHIVEMAIL, XTable.XTableArchiveMail, "Id")
ArchiveCommunications = XTableManager.ReadByIntKey(TABLE_COMMUNICATION, XTable.XTableArchiveCommunication, "Id")
EventDateGroups = XTableManager.ReadByIntKey(TABLE_EVENTDATEGROUP, XTable.XTableArchiveEventDateGroup, "Id")
WeaponGroup = XTableManager.ReadByIntKey(TABLE_ARCHIVE_WEAPON_GROUP_PATH, XTable.XTableArchiveWeaponGroup, "Id")
WeaponSettings = XTableManager.ReadByIntKey(TABLE_WEAPONSETTING, XTable.XTableWeaponSetting, "Id")
AwarenessGroup = XTableManager.ReadByIntKey(TABLE_ARCHIVE_AWARENESS_GROUP_PATH, XTable.XTableArchiveAwarenessGroup, "Id")
AwarenessGroupType = XTableManager.ReadByIntKey(TABLE_ARCHIVE_AWARENESS_GROUPTYPE_PATH, XTable.XTableArchiveAwarenessGroupType, "GroupId")
AwarenessSettings = XTableManager.ReadByIntKey(TABLE_AWARENESSSETTING, XTable.XTableAwarenessSetting, "Id")
ArchivePartnerSettings = XTableManager.ReadByIntKey(TABLE_ARCHIVE_PARTNER_SETTING, XTable.XTablePartnerSetting, "Id")
ArchivePartners = XTableManager.ReadByIntKey(TABLE_ARCHIVE_PARTNER, XTable.XTableArchivePartner, "Id")
ArchivePartnerGroups = XTableManager.ReadByIntKey(TABLE_ARCHIVE_PARTNER_GROUP, XTable.XTableArchivePartnerGroup, "Id")
XArchiveConfigs.SetArchiveTagAllList()
XArchiveConfigs.SetArchiveSameNpc()
XArchiveConfigs.SetArchiveMonsterModelTransDic()
XArchiveConfigs.SetArchiveMonsterEffectsDic()
XArchiveConfigs.CreateShowedWeaponTypeList()
XArchiveConfigs.CreateWeaponTemplateIdToSettingDataListDic()
XArchiveConfigs.SetWeaponSumCollectNum()
XArchiveConfigs.CreateWeaponTypeToIdsDic()
XArchiveConfigs.CreateAwarenessShowedStatusDic()
XArchiveConfigs.SetAwarenessSumCollectNum()
XArchiveConfigs.CreateAwarenessTypeToGroupDatasDic()
XArchiveConfigs.CreateAwarenessSiteToBgPathDic()
XArchiveConfigs.CreateAwarenessSuitIdToSettingDataListDic()
XArchiveConfigs.SetArchiveStoryGroupAllList()
end
function XArchiveConfigs.GetArchiveConfigById(Id)
return Archives[Id]
end
function XArchiveConfigs.GetArchiveConfigs()
return Archives
end
function XArchiveConfigs.GetArchiveMonsterConfigs()
return Monsters
end
function XArchiveConfigs.GetArchiveMonsterConfigById(id)
return Monsters[id]
end
function XArchiveConfigs.GetArchiveMonsterInfoConfigs()
return MonsterInfos
end
function XArchiveConfigs.GetArchiveMonsterInfoConfigById(id)
return MonsterInfos[id]
end
function XArchiveConfigs.GetArchiveMonsterSkillConfigs()
return MonsterSkills
end
function XArchiveConfigs.GetArchiveMonsterSkillConfigById(id)
return MonsterSkills[id]
end
function XArchiveConfigs.GetArchiveMonsterSettingConfigs()
return MonsterSettings
end
function XArchiveConfigs.GetArchiveMonsterSettingConfigById(id)
return MonsterSettings[id]
end
function XArchiveConfigs.GetArchiveTagCfgById(id)
return Tags[id]
end
function XArchiveConfigs.GetArchiveTagAllList()
return ArchiveTagAllList
end
function XArchiveConfigs.GetSameNpcId(npcId)
return ArchiveSameNpc[npcId] and ArchiveSameNpc[npcId] or npcId
end
function XArchiveConfigs.GetMonsterTransDataGroup(npcId)
return ArchiveMonsterTransDic[npcId]
end
function XArchiveConfigs.GetMonsterTransDatas(npcId,npcState)
local archiveMonsterTransData = ArchiveMonsterTransDic[npcId]
return archiveMonsterTransData and archiveMonsterTransData[npcState]
end
function XArchiveConfigs.GetMonsterEffectDatas(npcId,npcState)
local archiveMonsterEffectData = ArchiveMonsterEffectDatasDic[npcId]
return archiveMonsterEffectData and archiveMonsterEffectData[npcState]
end
-------------------------------------------------------------
function XArchiveConfigs.GetAwarenessSettingById(Id)
return AwarenessSettings[Id]
end
function XArchiveConfigs.GetAwarenessSettings()
return AwarenessSettings
end
function XArchiveConfigs.GetAwarenessGroupTypes()
local list = {}
for _,type in pairs(AwarenessGroupType) do
table.insert(list,type)
end
return XArchiveConfigs.SortByOrder(list)
end
function XArchiveConfigs.GetWeaponSettingById(Id)
return WeaponSettings[Id]
end
function XArchiveConfigs.GetWeaponSettings()
return WeaponSettings
end
function XArchiveConfigs.GetMonsterNpcDataById(Id)
if not MonsterNpcDatas[Id] then
XLog.ErrorTableDataNotFound("XArchiveConfigs.GetMonsterNpcDataById", "配置表项", TABLE_MONSTERNPCDATA, "Id", tostring(Id))
end
return MonsterNpcDatas[Id] or {}
end
-----------------------------怪物图鉴----------------------------
function XArchiveConfigs.SetArchiveTagAllList()
ArchiveTagAllList = {}
for _, tag in pairs(Tags or {}) do
for _,groupId in pairs(tag.TagGroupId) do
if not ArchiveTagAllList[groupId] then
ArchiveTagAllList[groupId] = {}
end
if tag.IsNotShow == 0 then
table.insert(ArchiveTagAllList[groupId], tag)
end
end
end
for _,v in pairs(ArchiveTagAllList)do
XArchiveConfigs.SortByOrder(v)
end
end
function XArchiveConfigs.SetArchiveSameNpc()
for _,group in pairs(SameNpcGroups or {}) do
for _,npcId in pairs(group.NpcId) do
ArchiveSameNpc[npcId] = group.Id
end
end
end
function XArchiveConfigs.SetArchiveMonsterModelTransDic()
for _,transData in pairs(MonsterModelTrans or {}) do
local archiveMonsterTransData = ArchiveMonsterTransDic[transData.NpcId]
if not archiveMonsterTransData then
archiveMonsterTransData = {}
ArchiveMonsterTransDic[transData.NpcId] = archiveMonsterTransData
end
archiveMonsterTransData[transData.NpcState] = transData
end
end
function XArchiveConfigs.SetArchiveMonsterEffectsDic()
for _,transData in pairs(MonsterEffects or {}) do
local archiveMonsterEffectData = ArchiveMonsterEffectDatasDic[transData.NpcId]
if not archiveMonsterEffectData then
archiveMonsterEffectData = {}
ArchiveMonsterEffectDatasDic[transData.NpcId] = archiveMonsterEffectData
end
local archiveMonsterEffect = archiveMonsterEffectData[transData.NpcState]
if not archiveMonsterEffect then
archiveMonsterEffect = {}
archiveMonsterEffectData[transData.NpcState] = archiveMonsterEffect
end
archiveMonsterEffect[transData.EffectNodeName] = transData.EffectPath
end
end
function XArchiveConfigs.SortByOrder(list)
tableSort(list, function(a, b)
if a.Order then
if a.Order == b.Order then
return a.Id > b.Id
else
return a.Order < b.Order
end
else
if a:GetOrder() == b:GetOrder() then
return a:GetId() > b:GetId()
else
return a:GetOrder() < b:GetOrder()
end
end
end)
return list
end
function XArchiveConfigs.GetMonsterRealName(id)
local name = XArchiveConfigs.GetMonsterNpcDataById(id).Name
if not name then
XLog.ErrorTableDataNotFound("XArchiveConfigs.GetMonsterRealName", "配置表项中的Name字段", TABLE_MONSTERNPCDATA, "id", tostring(id))
return ""
end
return name
end
function XArchiveConfigs.GetMonsterModel(id)
return XArchiveConfigs.GetMonsterNpcDataById(id).ModelId
end
function XArchiveConfigs.GetCountUnitChange(count)
local newCount = count
if count >= 1000 then
newCount = count / 1000
else
return newCount
end
local a,b = math.modf(newCount)
return b >= 0.05 and string.format("%.1fk", newCount) or string.format("%dk", a)
end
-- 武器、意识相关------------->>>
function XArchiveConfigs.CreateShowedWeaponTypeList()
for _, group in pairs(WeaponGroup) do
table.insert(ShowedWeaponTypeList, group.Id)
end
table.sort(ShowedWeaponTypeList,function(aType,bType)
local aData = XArchiveConfigs.GetWeaponGroupByType(aType)
local bData = XArchiveConfigs.GetWeaponGroupByType(bType)
return aData.Order < bData.Order
end)
end
function XArchiveConfigs.CreateWeaponTemplateIdToSettingDataListDic()
local equipId
for _, settingData in pairs(WeaponSettings) do
equipId = settingData.EquipId
WeaponTemplateIdToSettingListDic[equipId] = WeaponTemplateIdToSettingListDic[equipId] or {}
table.insert(WeaponTemplateIdToSettingListDic[equipId], settingData)
end
end
function XArchiveConfigs.SetWeaponSumCollectNum()
for _, _ in pairs(WeaponTemplateIdToSettingListDic) do
WeaponSumCollectNum = WeaponSumCollectNum + 1
end
end
function XArchiveConfigs.CreateWeaponTypeToIdsDic()
for type, _ in pairs(WeaponGroup) do
WeaponTypeToIdsDic[type] = {}
end
local templateData
local equipType
for templateId, _ in pairs(WeaponTemplateIdToSettingListDic) do
templateData = XEquipConfig.GetEquipCfg(templateId)
equipType = templateData.Type
if WeaponTypeToIdsDic[equipType] then
table.insert(WeaponTypeToIdsDic[equipType], templateId)
end
end
end
function XArchiveConfigs.CreateAwarenessShowedStatusDic()
local templateIdList
for suitId, _ in pairs(AwarenessGroup) do
templateIdList = XEquipConfig.GetEquipTemplateIdsBySuitId(suitId)
for _, templateId in ipairs(templateIdList) do
AwarenessShowedStatusDic[templateId] = true
end
end
end
function XArchiveConfigs.SetAwarenessSumCollectNum()
for _, _ in pairs(AwarenessShowedStatusDic) do
AwarenessSumCollectNum = AwarenessSumCollectNum + 1
end
end
function XArchiveConfigs.CreateAwarenessTypeToGroupDatasDic()
for _, type in pairs(AwarenessGroupType) do
AwarenessTypeToGroupDatasDic[type.GroupId] = {}
end
local groupType
for _, groupData in pairs(AwarenessGroup) do
groupType = groupData.Type
if AwarenessTypeToGroupDatasDic[groupType] then
table.insert(AwarenessTypeToGroupDatasDic[groupType], groupData)
end
end
end
function XArchiveConfigs.CreateAwarenessSiteToBgPathDic()
XArchiveConfigs.SiteToBgPath = {
[XEquipConfig.EquipSite.Awareness.One] = CS.XGame.ClientConfig:GetString("ArchiveAwarenessSiteBgPath1"),
[XEquipConfig.EquipSite.Awareness.Two] = CS.XGame.ClientConfig:GetString("ArchiveAwarenessSiteBgPath2"),
[XEquipConfig.EquipSite.Awareness.Three] = CS.XGame.ClientConfig:GetString("ArchiveAwarenessSiteBgPath3"),
[XEquipConfig.EquipSite.Awareness.Four] = CS.XGame.ClientConfig:GetString("ArchiveAwarenessSiteBgPath4"),
[XEquipConfig.EquipSite.Awareness.Five] = CS.XGame.ClientConfig:GetString("ArchiveAwarenessSiteBgPath5"),
[XEquipConfig.EquipSite.Awareness.Six] = CS.XGame.ClientConfig:GetString("ArchiveAwarenessSiteBgPath6"),
}
end
function XArchiveConfigs.CreateAwarenessSuitIdToSettingDataListDic()
local suitId
for _, settingData in pairs(AwarenessSettings) do
suitId = settingData.SuitId
AwarenessSuitIdToSettingListDic[suitId] = AwarenessSuitIdToSettingListDic[suitId] or {}
table.insert(AwarenessSuitIdToSettingListDic[suitId], settingData)
end
end
function XArchiveConfigs.GetWeaponSumCollectNum()
return WeaponSumCollectNum
end
function XArchiveConfigs.GetWeaponGroup()
return WeaponGroup
end
function XArchiveConfigs.GetWeaponGroupByType(type)
return WeaponGroup[type]
end
function XArchiveConfigs.GetWeaponGroupName(type)
return WeaponGroup[type].GroupName
end
function XArchiveConfigs.GetShowedWeaponTypeList()
return ShowedWeaponTypeList
end
function XArchiveConfigs.GetWeaponTypeToIdsDic()
return WeaponTypeToIdsDic
end
function XArchiveConfigs.GetWeaponTemplateIdListByType(type)
return WeaponTypeToIdsDic[type]
end
function XArchiveConfigs.GetAwarenessSumCollectNum()
return AwarenessSumCollectNum
end
function XArchiveConfigs.GetAwarenessGroup()
return AwarenessGroup
end
function XArchiveConfigs.GetAwarenessTypeToGroupDatasDic()
return AwarenessTypeToGroupDatasDic
end
function XArchiveConfigs.GetAwarenessShowedStatusDic()
return AwarenessShowedStatusDic
end
function XArchiveConfigs.GetAwarenessSuitInfoTemplate(suitId)
return AwarenessGroup[suitId]
end
function XArchiveConfigs.GetAwarenessSuitInfoGetType(suitId)
return AwarenessGroup[suitId].Type
end
function XArchiveConfigs.GetAwarenessSuitInfoIconPath(suitId)
return AwarenessGroup[suitId].IconPath
end
function XArchiveConfigs.GetWeaponTemplateIdToSettingListDic()
return WeaponTemplateIdToSettingListDic
end
-- 武器设定或故事
function XArchiveConfigs.GetWeaponSettingList(id, settingType)
local list = {}
local settingDataList = WeaponTemplateIdToSettingListDic[id]
if settingDataList then
if not settingType or settingType == XArchiveConfigs.SettingType.All then
list = settingDataList
else
for _, settingData in pairs(settingDataList) do
if settingData.Type == settingType then
table.insert(list, settingData)
end
end
end
end
return XArchiveConfigs.SortByOrder(list)
end
function XArchiveConfigs.GetWeaponSettingType(id)
return WeaponSettings[id].Type
end
function XArchiveConfigs.GetWeaponTemplateIdBySettingId(id)
return WeaponSettings[id].EquipId
end
-- 意识设定或故事
function XArchiveConfigs.GetAwarenessSettingList(id, settingType)
local list = {}
local settingDataList = AwarenessSuitIdToSettingListDic[id]
if settingDataList then
if not settingType or settingType == XArchiveConfigs.SettingType.All then
list = settingDataList
else
for _, settingData in pairs(settingDataList) do
if settingData.Type == settingType then
table.insert(list, settingData)
end
end
end
else
XLog.ErrorTableDataNotFound("XArchiveConfigs.GetAwarenessSettingList", "配置表项", TABLE_AWARENESSSETTING, "id", tostring(id))
end
return XArchiveConfigs.SortByOrder(list)
end
function XArchiveConfigs.GetAwarenessSettingType(id)
return AwarenessSettings[id].Type
end
function XArchiveConfigs.GetAwarenessSuitIdBySettingId(id)
return AwarenessSettings[id].SuitId
end
-- 武器、意识相关-------------<<<
-- 剧情相关------------->>>
function XArchiveConfigs.GetArchiveStoryGroupAllList()
return ArchiveStoryGroupAllList
end
function XArchiveConfigs.GetArchiveStoryChapterConfigs()
return StoryChapters
end
function XArchiveConfigs.GetArchiveStoryChapterConfigById(id)
return StoryChapters[id]
end
function XArchiveConfigs.GetArchiveStoryDetailConfigs()
return StoryDetails
end
function XArchiveConfigs.GetArchiveStoryDetailConfigById(id)
return StoryDetails[id]
end
function XArchiveConfigs.SetArchiveStoryGroupAllList()
for _, group in pairs(StoryGroups or {}) do
table.insert(ArchiveStoryGroupAllList, group)
end
XArchiveConfigs.SortByOrder(ArchiveStoryGroupAllList)
end
-- 剧情相关-------------<<<
-- NPC相关------------->>>
function XArchiveConfigs.GetArchiveStoryNpcConfigs()
return StoryNpc
end
function XArchiveConfigs.GetArchiveStoryNpcConfigById(id)
return StoryNpc[id]
end
function XArchiveConfigs.GetArchiveStoryNpcSettingConfigs()
return StoryNpcSetting
end
function XArchiveConfigs.GetArchiveStoryNpcSettingConfigById(id)
return StoryNpcSetting[id]
end
-- NPC相关-------------<<<
-- CG相关------------->>>
function XArchiveConfigs.GetArchiveCGGroupConfigs()
return CGGroups
end
function XArchiveConfigs.GetArchiveCGDetailConfigs()
return CGDetails
end
function XArchiveConfigs.GetArchiveCGDetailConfigById(id)
return CGDetails[id]
end
-- CG相关-------------<<<
-- 邮件通讯相关------------->>>
function XArchiveConfigs.GetArchiveMailsConfigs()
return ArchiveMails
end
function XArchiveConfigs.GetArchiveMailsConfigById(id)
return ArchiveMails[id]
end
function XArchiveConfigs.GetArchiveCommunicationsConfigs()
return ArchiveCommunications
end
function XArchiveConfigs.GetArchiveCommunicationsConfigById(id)
return ArchiveCommunications[id]
end
function XArchiveConfigs.GetEventDateGroupsConfigs()
return EventDateGroups
end
-- 邮件通讯相关-------------<<<
-- 伙伴相关------------->>>
function XArchiveConfigs.GetPartnerSettingConfigs()
return ArchivePartnerSettings
end
function XArchiveConfigs.GetPartnerSettingConfigById(id)
if not ArchivePartnerSettings[id] then
XLog.Error("Id is not exist in ".. TABLE_ARCHIVE_PARTNER_SETTING.." id = " .. id)
return
end
return ArchivePartnerSettings[id]
end
function XArchiveConfigs.GetPartnerConfigs()
return ArchivePartners
end
function XArchiveConfigs.GetPartnerConfigById(id)
if not ArchivePartners[id] then
XLog.Error("Id is not exist in ".. TABLE_ARCHIVE_PARTNER.." id = " .. id)
return
end
return ArchivePartners[id]
end
function XArchiveConfigs.GetPartnerGroupConfigs()
return ArchivePartnerGroups
end
function XArchiveConfigs.GetPartnerGroupConfigById(id)
if not ArchivePartnerGroups[id] then
XLog.Error("Id is not exist in ".. TABLE_ARCHIVE_PARTNER_GROUP.." id = " .. id)
return
end
return ArchivePartnerGroups[id]
end
-- 伙伴相关-------------<<<
function XArchiveConfigs.GetWeaponSettingPath()
return TABLE_WEAPONSETTING
end

View file

@ -0,0 +1,318 @@
---
--- 竞技副本配置表
---
XArenaConfigs = XArenaConfigs or {}
--战区贡献道具的id
XArenaConfigs.CONTRIBUTESCORE_ID = 54
XArenaActivityStatus = {
--game服和竞技服等待数据的时候用
Loading = -1,
--默认状态
Default = 0,
--休息状态
Rest = 1,
--战斗状态
Fight = 2,
--结束
Over = 3,
}
--个人排行区域
XArenaPlayerRankRegion = {
UpRegion = 1, --晋级区
KeepRegion = 2, --保级区
DownRegion = 3, --降级区
}
--竞技副本通关评级
XArenaAppraiseType = {
S = 1,
A = 2,
B = 3,
C = 4,
D = 5,
}
XArenaConfigs.ArenaTimerName = "FubenArenaActivityTimer"
XArenaConfigs.SHOP_ID = CS.XGame.ClientConfig:GetInt("AreanShopId")
local TABLE_ARENA_STAGE = "Client/Fuben/Arena/ArenaStage.tab"
local TABLE_ARENA_LEVEL = "Share/Fuben/Arena/ArenaLevel.tab"
local TABLE_CHALLENGE_AREA = "Share/Fuben/Arena/ChallengeArea.tab"
local TABLE_AREA_STAGE = "Share/Fuben/Arena/AreaStage.tab"
local TABLE_TEAM_RANK_REWARD = "Share/Fuben/Arena/TeamRankReward.tab"
local TABLE_MARK = "Share/Fuben/Arena/Mark.tab"
local ArenaRankBottomCount --竞技排行基数
local ArenaClientStageTemplate --競技客户端关卡表
local ArenaLevelTemplate --竞技段位表
local ChallengeAreaTemplate --挑战区域表
local AreaStageTemplate --战区关卡配置表
local TeamRankRewardTemplate --队伍排行奖励表
local MarkTemplate --结算分数表
local MaxArenaLevel = 0 --最大竞技段位
local PlayerLevelRangeToChallengeIds --玩家等级段索引挑战配置列表
local MaxArenaStageCountPerArea = 0 --竞技战区最大关卡数
--私有方法定义
local InitChallengeAreaCfg
local InitArenaLevelCfg
local InitAreaStageTemplate
function XArenaConfigs.Init()
ArenaRankBottomCount = CS.XGame.Config:GetInt("ArenaTeamRankShow")
ArenaClientStageTemplate = XTableManager.ReadByIntKey(TABLE_ARENA_STAGE, XTable.XTableArenaStage, "StageId")
ArenaLevelTemplate = XTableManager.ReadByIntKey(TABLE_ARENA_LEVEL, XTable.XTableArenaLevel, "Id")
ChallengeAreaTemplate = XTableManager.ReadByIntKey(TABLE_CHALLENGE_AREA, XTable.XTableChallengeArea, "ChallengeId")
AreaStageTemplate = XTableManager.ReadByIntKey(TABLE_AREA_STAGE, XTable.XTableAreaStage, "Id")
TeamRankRewardTemplate = XTableManager.ReadByIntKey(TABLE_TEAM_RANK_REWARD, XTable.XTableTeamRankReward, "Id")
MarkTemplate = XTableManager.ReadByIntKey(TABLE_MARK, XTable.XTableMark, "MarkId")
InitArenaLevelCfg()
InitChallengeAreaCfg()
InitAreaStageTemplate()
end
InitArenaLevelCfg = function()
for _, cfg in pairs(ArenaLevelTemplate) do
if MaxArenaLevel < cfg.Id then
MaxArenaLevel = cfg.Id
end
end
end
InitChallengeAreaCfg = function()
PlayerLevelRangeToChallengeIds = {}
local tempMap = {}
local tempTypeId = 0
for id, cfg in pairs(ChallengeAreaTemplate) do
local typeId = tempMap[cfg.MinLv]
if not typeId then
typeId = tempTypeId + 1
tempMap[cfg.MinLv] = typeId
tempTypeId = typeId
end
local map = PlayerLevelRangeToChallengeIds[typeId]
if not map then
map = {}
PlayerLevelRangeToChallengeIds[typeId] = map
end
map[id] = cfg
end
end
InitAreaStageTemplate = function()
for _, cfg in pairs(AreaStageTemplate) do
if MaxArenaStageCountPerArea < #cfg.StageId then
MaxArenaStageCountPerArea = #cfg.StageId
end
end
end
local GetChallengeCfgMapById = function(challengeId)
for _, map in ipairs(PlayerLevelRangeToChallengeIds) do
local cfg = map[challengeId]
if cfg then
return map
end
end
return nil
end
local SortChallenge = function(a, b)
return a.ArenaLv < b.ArenaLv
end
local SorTeamRankReward = function(a, b)
return a.MinRank < b.MinRank
end
-- 获取个人排行区文字
function XArenaConfigs.GetRankRegionText(rankRegion)
if rankRegion == XArenaPlayerRankRegion.UpRegion then
return CS.XTextManager.GetText("ArenaActivityUpRegion")
elseif rankRegion == XArenaPlayerRankRegion.DownRegion then
return CS.XTextManager.GetText("ArenaActivityDownRegion")
else
return CS.XTextManager.GetText("ArenaActivityKeepRegion")
end
end
-- 获取个人排行区文字带颜色
function XArenaConfigs.GetRankRegionColorText(rankRegion)
if rankRegion == XArenaPlayerRankRegion.UpRegion then
return CS.XTextManager.GetText("ArenaActivityUpRegionColor")
elseif rankRegion == XArenaPlayerRankRegion.DownRegion then
return CS.XTextManager.GetText("ArenaActivityDownRegionColor")
else
return CS.XTextManager.GetText("ArenaActivityKeepRegionColor")
end
end
-- 获取个人排行区描述
function XArenaConfigs.GetRankRegionDescText(rankRegion, challengeCfg)
if rankRegion == XArenaPlayerRankRegion.UpRegion then
return CS.XTextManager.GetText("ArenaActivityUpRegionDesc", 1, challengeCfg.DanUpRank)
elseif rankRegion == XArenaPlayerRankRegion.DownRegion then
return CS.XTextManager.GetText("ArenaActivityDownRegionDesc", challengeCfg.DanKeepRank + 1, challengeCfg.DanDownRank)
else
return CS.XTextManager.GetText("ArenaActivityKeepRegionDesc", challengeCfg.DanUpRank + 1, challengeCfg.DanKeepRank)
end
end
-- 获取个人排行不升段位描述
function XArenaConfigs.GetRankNotRegionDescText(rankRegion)
if rankRegion == XArenaPlayerRankRegion.UpRegion then
return CS.XTextManager.GetText("ArenaActivityNotUpRegionDesc")
elseif rankRegion == XArenaPlayerRankRegion.DownRegion then
return CS.XTextManager.GetText("ArenaActivityNotDownRegionDesc")
else
return CS.XTextManager.GetText("ArenaActivityNotKeepRegionDesc")
end
end
-- 获取个人排行区奖励id
function XArenaConfigs.GetRankRegionRewardId(rankRegion, challengeCfg)
if rankRegion == XArenaPlayerRankRegion.UpRegion then
return challengeCfg.UpRewardId
elseif rankRegion == XArenaPlayerRankRegion.DownRegion then
return challengeCfg.DownRewardId
else
return challengeCfg.KeepRewardId
end
end
-- 是否是最大竞技段位
function XArenaConfigs.IsMaxArenaLevel(level)
return level >= MaxArenaLevel
end
-- 获取竞技副本评级文字
function XArenaConfigs.GetArenaFightAppraiseText(appraiseType)
if appraiseType == XArenaAppraiseType.S then
return "S"
elseif appraiseType == XArenaAppraiseType.A then
return "A"
elseif appraiseType == XArenaAppraiseType.B then
return "B"
elseif appraiseType == XArenaAppraiseType.C then
return "C"
elseif appraiseType == XArenaAppraiseType.D then
return "D"
end
end
-- 获取竞技队伍排行榜统计基数
function XArenaConfigs.GetArenaRankBottomCount()
return ArenaRankBottomCount
end
-- 获取竞技段位配置表
function XArenaConfigs.GetArenaLevelCfgByLevel(level)
return ArenaLevelTemplate[level]
end
-- 获取竞技段位配置表
function XArenaConfigs.GetArenaStageConfig(stageId)
local t = ArenaClientStageTemplate[stageId]
if not t then
XLog.ErrorTableDataNotFound("XArenaConfigs.GetArenaStageConfig", "根据stageId获取的配置表项", TABLE_ARENA_STAGE, "stageId", tostring(stageId))
return nil
end
return t
end
-- 获取竞技挑战配置表
function XArenaConfigs.GetChallengeArenaCfgById(challengeId)
return ChallengeAreaTemplate[challengeId]
end
-- 获取竞技挑战配置列表
function XArenaConfigs.GetChallengeCfgListById(challengeId)
local list = {}
local map = GetChallengeCfgMapById(challengeId)
if map then
for _, cfg in pairs(map) do
table.insert(list, cfg)
end
table.sort(list, SortChallenge)
end
return list
end
-- 获取竞技挑战最高等级
function XArenaConfigs.GetChallengeMaxArenaLevel(challengeId)
local maxArenalLevel = 0
local map = GetChallengeCfgMapById(challengeId)
if map then
for _, cfg in pairs(map) do
if cfg.ArenaLv > maxArenalLevel then
maxArenalLevel = cfg.ArenaLv
end
end
end
return maxArenalLevel
end
function XArenaConfigs.GetArenaStageCfg()
return AreaStageTemplate
end
-- 获取竞技区域关卡配置
function XArenaConfigs.GetArenaAreaStageCfgByAreaId(areaId)
return AreaStageTemplate[areaId]
end
-- 获取竞技战区最大关卡数量
function XArenaConfigs.GetTheMaxStageCountOfArenaArea()
return MaxArenaStageCountPerArea
end
-- 获取竞技队伍排行奖励配置列表
function XArenaConfigs.GetTeamRankRewardCfgList(challengeId)
local list = {}
for _, cfg in pairs(TeamRankRewardTemplate) do
if cfg.ChallengeId == challengeId then
table.insert(list, cfg)
end
end
if #list > 2 then
table.sort(list, SorTeamRankReward)
end
return list
end
-- 获取竞技队伍排行奖励配置
function XArenaConfigs.GetTeamRankRewardCfgById(id)
return TeamRankRewardTemplate[id]
end
-- 获取竞技结算分数配置
function XArenaConfigs.GetMarkCfgById(id)
return MarkTemplate[id]
end
-- 获取最大分数
function XArenaConfigs.GetMarkMaxPointById(id)
return MarkTemplate[id].MaxPoint
end
-- 获取竞技章节名字以及副本名字
function XArenaConfigs.GetChapterAndStageName(areaId, stageId)
local chapterName = AreaStageTemplate[areaId].Name
local stageName = XDataCenter.FubenManager.GetStageCfg(stageId).Name
return chapterName, stageName
end

View file

@ -0,0 +1,176 @@
XArenaOnlineConfigs = XArenaOnlineConfigs or {}
local TABLE_ARENAONLINE_CHAPTER = "Share/Fuben/ArenaOnline/ArenaOnlineChapter.tab"
local TABLE_ARENAONLINE_SECTION = "Share/Fuben/ArenaOnline/ArenaOnlineSection.tab"
local TABLE_ARENAONLINE_STAGEGROUP = "Share/Fuben/ArenaOnline/ArenaOnlineStageGroup.tab"
local TABLE_ARENAONLINE_STAGE = "Share/Fuben/ArenaOnline/ArenaOnlineStage.tab"
local TABLE_ARENAONLINE_ACTIVEBUFF = "Share/Fuben/ArenaOnline/ArenaOnlineActiveBuff.tab"
--local TABLE_NPC_AFFIX = "Client/Fight/Npc/NpcAffix.tab"
local ArenaOnlineChapterCfg = {}
local ArenaOnlineSectionCfg = {}
local ArenaOnlineStageGroupCfg = {}
local ArenaOnlineStageCfg = {}
local ArenaOnlineActiveBuffCfg = {}
--local NpcAffixCfg = {}
XArenaOnlineConfigs.MAX_NAILI = CS.XGame.Config:GetInt("ArenaOnlineCharMaxEndurance")
XArenaOnlineConfigs.SHOW_TIME = CS.XGame.ClientConfig:GetInt("ArenaOnlineInviteShowTime")
XArenaOnlineConfigs.DEFAULT_CHAPTERID = CS.XGame.ClientConfig:GetInt("ArenaOnlineDefualtChapterId")
XArenaOnlineConfigs.MaskArenOnlineUIName = {
UiPurchase = "UiPurchase",
UiDraw = "UiDraw",
UiMultiplayerRoom = "UiMultiplayerRoom",
UiMultiplayerInviteFriend = "UiMultiplayerInviteFriend",
UiSocial = "UiSocial",
UiRoomCharacter = "UiRoomCharacter",
UiDrawMain = "UiNewDrawMain",
UiLoading = "UiLoading"
}
function XArenaOnlineConfigs.Init()
ArenaOnlineChapterCfg = XTableManager.ReadByIntKey(TABLE_ARENAONLINE_CHAPTER, XTable.XTableArenaOnlineChapter, "Id")
ArenaOnlineSectionCfg = XTableManager.ReadByIntKey(TABLE_ARENAONLINE_SECTION, XTable.XTableArenaOnlineSection, "Id")
ArenaOnlineStageGroupCfg = XTableManager.ReadByIntKey(TABLE_ARENAONLINE_STAGEGROUP, XTable.XTableArenaOnlineStageGroup, "Id")
ArenaOnlineStageCfg = XTableManager.ReadByIntKey(TABLE_ARENAONLINE_STAGE, XTable.XTableArenaOnlineStage, "Id")
ArenaOnlineActiveBuffCfg = XTableManager.ReadByIntKey(TABLE_ARENAONLINE_ACTIVEBUFF, XTable.XTableArenaOnlineActiveBuff, "Id")
--NpcAffixCfg = XTableManager.ReadByIntKey(TABLE_NPC_AFFIX, XTable.XTableNpcAffix, "Id")
XArenaOnlineConfigs.ArenaOnlineShowTime = CS.XGame.ClientConfig:GetInt("ArenaOnlineShowTime") or -1
end
function XArenaOnlineConfigs.GetChapters()
return ArenaOnlineChapterCfg
end
function XArenaOnlineConfigs.GetStages()
return ArenaOnlineStageCfg
end
function XArenaOnlineConfigs.GetChapterById(chapterId)
local chapter = ArenaOnlineChapterCfg[chapterId]
if not chapter then
XLog.ErrorTableDataNotFound("XArenaOnlineConfigs.GetChapterById", "chapter", TABLE_ARENAONLINE_CHAPTER, "chapterId", tostring(chapterId))
return nil
end
return chapter
end
function XArenaOnlineConfigs.GetSectionById(sectionId)
local section = ArenaOnlineSectionCfg[sectionId]
if not section then
XLog.ErrorTableDataNotFound("XArenaOnlineConfigs.GetSectionById", "section", TABLE_ARENAONLINE_SECTION, "sectionId", tostring(sectionId))
return nil
end
return section
end
function XArenaOnlineConfigs.GetStageById(stageId)
local stage = ArenaOnlineStageCfg[stageId]
if not stage then
XLog.ErrorTableDataNotFound("XArenaOnlineConfigs.GetStageById", "stage", TABLE_ARENAONLINE_STAGE, "stageId", tostring(stageId))
return nil
end
return stage
end
function XArenaOnlineConfigs.GetStageGroupById(groupId)
local group = ArenaOnlineStageGroupCfg[groupId]
if not group then
XLog.ErrorTableDataNotFound("XArenaOnlineConfigs.GetStageGroupById", "group", TABLE_ARENAONLINE_STAGEGROUP, "groupId", tostring(groupId))
return nil
end
return group
end
function XArenaOnlineConfigs.GetStageGroupPrefabPathById(groupId)
local cfg = XArenaOnlineConfigs.GetStageGroupById(groupId)
if cfg then
return cfg.PrefabPath
end
end
function XArenaOnlineConfigs.GetStageGroupIconById(groupId)
local cfg = XArenaOnlineConfigs.GetStageGroupById(groupId)
if cfg then
return cfg.Icon
end
end
function XArenaOnlineConfigs.GetActiveBuffById(activeBuffId)
local buff = ArenaOnlineActiveBuffCfg[activeBuffId]
if not buff then
XLog.ErrorTableDataNotFound("XArenaOnlineConfigs.GetActiveBuffById",
"buff", TABLE_ARENAONLINE_ACTIVEBUFF, "activeBuffId", tostring(activeBuffId))
return nil
end
return buff
end
function XArenaOnlineConfigs.GetNpcAffixById(buffId)
local npcAffix = nil
if CS.XNpcManager.AffixTable:ContainsKey(buffId) then
npcAffix = CS.XNpcManager.AffixTable[buffId]
end
if not npcAffix then
XLog.ErrorTableDataNotFound("XArenaOnlineConfigs.GetNpcAffixById", "npcAffix", TABLE_NPC_AFFIX, "buffId", tostring(buffId))
return nil
end
return npcAffix
end
function XArenaOnlineConfigs.GetChaprerNameByChapterId(chapterId)
local chapter = XArenaOnlineConfigs.GetChapterById(chapterId)
return chapter.Name
end
function XArenaOnlineConfigs.GetStageSortByStageId(stageId)
local stage = XArenaOnlineConfigs.GetStageById(stageId)
return stage.Sort
end
function XArenaOnlineConfigs.GetStageEnduranceCostByStageId(stageId)
local stage = XArenaOnlineConfigs.GetStageById(stageId)
return stage.EnduranceCost
end
function XArenaOnlineConfigs.GetStageActiveBuffIdByStageId(stageId)
local stage = XArenaOnlineConfigs.GetStageById(stageId)
return stage.ActiveBuffId
end
function XArenaOnlineConfigs.GetStageBottomCountByStageId(stageId)
local stage = XArenaOnlineConfigs.GetStageById(stageId)
return stage.BottomCount
end
function XArenaOnlineConfigs.GetStageDropKeyByStageId(stageId)
local stage = XArenaOnlineConfigs.GetStageById(stageId)
return tostring(stage.ShowDropId) .. tostring(stage.ShowBottomId)
end
function XArenaOnlineConfigs.GetStageGroupRequireStar(groupId)
local group = XArenaOnlineConfigs.GetStageGroupById(groupId)
return group.RequireStar
end
function XArenaOnlineConfigs.GetFirstChapterName()
local name = ""
for _, v in pairs(ArenaOnlineChapterCfg) do
name = v.Name
break
end
return name
end

View file

@ -0,0 +1,64 @@
local QualityBgPath = {
CS.XGame.ClientConfig:GetString("CommonBagWhite"),
CS.XGame.ClientConfig:GetString("CommonBagGreed"),
CS.XGame.ClientConfig:GetString("CommonBagBlue"),
CS.XGame.ClientConfig:GetString("CommonBagPurple"),
CS.XGame.ClientConfig:GetString("CommonBagGold"),
CS.XGame.ClientConfig:GetString("CommonBagRed"),
CS.XGame.ClientConfig:GetString("CommonBagRed"),
}
local QualityPath = {
CS.XGame.ClientConfig:GetString("QualityIconColor1"),
CS.XGame.ClientConfig:GetString("QualityIconColor2"),
CS.XGame.ClientConfig:GetString("QualityIconColor3"),
CS.XGame.ClientConfig:GetString("QualityIconColor4"),
CS.XGame.ClientConfig:GetString("QualityIconColor5"),
CS.XGame.ClientConfig:GetString("QualityIconColor6"),
CS.XGame.ClientConfig:GetString("QualityIconColor7"),
}
XArrangeConfigs = XArrangeConfigs or {}
XArrangeConfigs.Types = {
Error = 0,
Item = 1, --道具
Character = 2, --成员
Weapon = 3, --武器
Wafer = 4, --意识
Medal = 5,
Part = 6,
Fashion = 7, --时装
BaseEquip = 8, --基地装备
Furniture = 9, --家具
HeadPortrait = 10, --头像
DormCharacter = 11, --宿舍构造体
ChatEmoji = 12, --聊天表情
WeaponFashion = 13, --武器投影
Collection = 14, --收藏
Background = 15, --场景
Pokemon = 16, --口袋战双
Partner = 17,--伙伴
Nameplate = 18, --铭牌
}
function XArrangeConfigs.GetType(id)
return math.floor(id / 1000000) + 1
end
function XArrangeConfigs.GeQualityBgPath(quality)
if not quality then
XLog.Error("XArrangeConfigs.GeQualityBgPath 函数错误: 参数quality不能为空")
return
end
return QualityBgPath[quality]
end
function XArrangeConfigs.GeQualityPath(quality)
if not quality then
XLog.Error("XArrangeConfigs.GeQualityBgPath 函数错误: 参数quality不能为空")
return
end
return QualityPath[quality]
end

View file

@ -0,0 +1,12 @@
XAssistConfig = XAssistConfig or {}
local AssistRuleTemplate = {}
local TABLE_ASSISTRULE = "Share/Fuben/Assist/AssistRule.tab";
function XAssistConfig.Init()
AssistRuleTemplate = XTableManager.ReadByIntKey(TABLE_ASSISTRULE, XTable.XTableAssistRule, "Id")
end
function XAssistConfig.GetAssistRuleTemplate(id)
return AssistRuleTemplate[id]
end

View file

@ -0,0 +1,79 @@
XAttribConfigs = XAttribConfigs or {}
local TABLE_ATTRIB_DESC_PATH = "Share/Attrib/AttribDesc.tab"
local TABLE_ATTRIB_ABILITY_PATH = "Share/Attrib/AttribAbility.tab"
local TABLE_ATTRIB_PATH = "Share/Attrib/Attrib"
local TABLE_ATTRIB_PROMOTED_PATH = "Share/Attrib/AttribPromoted"
local TABLE_ATTRIB_GROW_RATE_PATH = "Share/Attrib/AttribGrowRate"
local TABLE_ATTRIB_POOL_PATH = "Share/Attrib/AttribPool/"
local TABLE_ATTRIB_REVISE_PATH = "Share/Attrib/AttribRevise/"
local TABLE_NPC_PATH = "Share/Fight/Npc/Npc/Npc.tab"
local AttribAbilityTemplate = {}
local AttribTemplates = {}
local AttribPromotedTemplates = {}
local AttribGrowRateTemplates = {}
local AttribReviseTemplates = {}
local AttribGroupTemplates = {}
local AttribGroupPoolIdDic = {} --共鸣属性池字典
--local NpcTemplates = {}
--属性名字配置表
local AttribDescTemplates = {}
local tableInsert = table.insert
function XAttribConfigs.Init()
AttribTemplates = XTableManager.ReadByIntKey(TABLE_ATTRIB_PATH, XTable.XTableNpcAttrib, "Id")
AttribPromotedTemplates = XTableManager.ReadByIntKey(TABLE_ATTRIB_PROMOTED_PATH, XTable.XTableNpcAttrib, "Id")
AttribGrowRateTemplates = XTableManager.ReadByIntKey(TABLE_ATTRIB_GROW_RATE_PATH, XTable.XTableNpcAttrib, "Id")
AttribGroupTemplates = XTableManager.ReadByIntKey(TABLE_ATTRIB_POOL_PATH, XTable.XTableAttribGroup, "Id")
AttribReviseTemplates = XTableManager.ReadByIntKey(TABLE_ATTRIB_REVISE_PATH, XTable.XTableAttribRevise, "Id")
--NpcTemplates = XTableManager.ReadByIntKey(TABLE_NPC_PATH, XTable.XTableNpc, "Id")
AttribDescTemplates = XTableManager.ReadByIntKey(TABLE_ATTRIB_DESC_PATH, XTable.XTableAttribDesc, "Index")
AttribAbilityTemplate = XTableManager.ReadByStringKey(TABLE_ATTRIB_ABILITY_PATH, XTable.XTableAttribAbility, "Key")
for _, template in pairs(AttribGroupTemplates) do
AttribGroupPoolIdDic[template.PoolId] = AttribGroupPoolIdDic[template.PoolId] or {}
tableInsert(AttribGroupPoolIdDic[template.PoolId], template)
end
end
function XAttribConfigs.GetAttribTemplates()
return AttribTemplates
end
function XAttribConfigs.GetAttribPromotedTemplates()
return AttribPromotedTemplates
end
function XAttribConfigs.GetAttribGrowRateTemplates()
return AttribGrowRateTemplates
end
function XAttribConfigs.GetAttribReviseTemplates()
return AttribReviseTemplates
end
function XAttribConfigs.GetAttribGroupTemplates()
return AttribGroupTemplates
end
function XAttribConfigs.GetAttribGroupCfgById(groupId)
return AttribGroupTemplates[groupId]
end
function XAttribConfigs.GetNpcTemplates()
return NpcTemplates
end
function XAttribConfigs.GetAttribDescTemplates()
return AttribDescTemplates
end
function XAttribConfigs.GetAttribAbilityTemplate()
return AttribAbilityTemplate
end
function XAttribConfigs.GetAttribGroupTemplateByPoolId(poolId)
return AttribGroupPoolIdDic[poolId] or {}
end

View file

@ -0,0 +1,13 @@
XAutoFightConfig = XAutoFightConfig or {}
local AutoFightCfgs = {}
local TABLE_AUTO_FIGHT = "Share/Fuben/AutoFight.tab"
function XAutoFightConfig.Init()
AutoFightCfgs = XTableManager.ReadByIntKey(TABLE_AUTO_FIGHT, XTable.XTableAutoFight, "Id")
end
function XAutoFightConfig.GetCfg(autoFightId)
return AutoFightCfgs[autoFightId]
end

View file

@ -0,0 +1,64 @@
XAutoWindowConfigs = XAutoWindowConfigs or {}
XAutoWindowConfigs.AutoType = {
EachTime = 1, -- 每次登陆弹出
EachDay = 2, -- 每天登陆弹出
EachWeek = 3, -- 每周登陆弹出
EachMonth = 4, -- 每月登陆弹出
Period = 5, -- 周期内弹出
EachDayOffset = 6, -- 有时间偏移的每天登录(目前每个服写死,暂不改表)
}
XAutoWindowConfigs.AutoFunctionType = {
AutoWindowView = 1, -- 自动弹出公告
Sign = 2, -- 签到
FirstRecharge = 3, -- 首充
Card = 4, -- 月卡
Regression = 5, -- 回归活动(特殊处理类型)
NewYearZhanBu = 500, -- 元旦占卜
NewYearDrawActivity = 501, -- 元旦抽奖
Fireworks = 1001, --烟花活动
}
XAutoWindowConfigs.AutoWindowSkinType = {
None = 0, -- 未知
BarSkin = 1, -- 条幅
BigSkin = 2, -- 大图
SpineSkin = 3, -- Spine动画
}
local TABLE_AUTO_WINDOW_VIEW = "Client/AutoWindow/AutoWindowView.tab"
local TABLE_AUTO_WINDOW_CONTROLLER = "Client/AutoWindow/AutoWindowController.tab"
local AutoWindowViewConfig = {} -- 自动弹窗公告配置表
local AutoWindowControllerConfig = {} -- 自动弹窗控制配置表
function XAutoWindowConfigs.Init()
AutoWindowViewConfig = XTableManager.ReadByIntKey(TABLE_AUTO_WINDOW_VIEW, XTable.XTableAutoWindowView, "Id")
AutoWindowControllerConfig = XTableManager.ReadByIntKey(TABLE_AUTO_WINDOW_CONTROLLER, XTable.XTableAutoWindowController, "Id")
end
function XAutoWindowConfigs.GetAutoWindowConfig(id)
local t = AutoWindowViewConfig[id]
if not t then
XLog.ErrorTableDataNotFound("XAutoWindowConfigs.GetAutoWindowConfig", "配置表项", TABLE_AUTO_WINDOW_VIEW, "id", tostring(id))
return nil
end
return t
end
function XAutoWindowConfigs.GetAutoWindowSkinType(id)
local t = XAutoWindowConfigs.GetAutoWindowConfig(id)
if t then
return t.Type
end
return 0
end
function XAutoWindowConfigs.GetAutoWindowControllerConfig()
return AutoWindowControllerConfig
end

View file

@ -0,0 +1,20 @@
XBaseEquipConfigs =XBaseEquipConfigs or {}
local TABLE_BASE_EQUIP_PATH = "Share/BaseEquip/BaseEquip.tab"
local TABLE_BASE_EQUIP_SCORE = "Client/BaseEquip/BaseEquipScore.tab"
local BaseEquipTemplates = {} -- 基地装备配置
local BaseEquipScoreTemplates = {} -- 基地装备评分计算配置
function XBaseEquipConfigs.Init()
BaseEquipTemplates = XTableManager.ReadByIntKey(TABLE_BASE_EQUIP_PATH, XTable.XTableBaseEquip, "Id")
BaseEquipScoreTemplates = XTableManager.ReadByStringKey(TABLE_BASE_EQUIP_SCORE, XTable.XTableBaseEquipScore, "Key")
end
function XBaseEquipConfigs.GetBaseEquipTemplates()
return BaseEquipTemplates
end
function XBaseEquipConfigs.GetBaseEquipScoreTemplates()
return BaseEquipScoreTemplates
end

View file

@ -0,0 +1,36 @@
local TABLE_BFRT_CHAPTER_PATH = "Share/Fuben/Bfrt/BfrtChapter.tab"
local TABLE_BFRT_GROUP_PATH = "Share/Fuben/Bfrt/BfrtGroup.tab"
local TABLE_ECHELON_INFO_PATH = "Share/Fuben/Bfrt/EchelonInfo.tab"
local BfrtChapterTemplates = {}
local BfrtGroupTemplates = {}
local EchelonInfoTemplates = {}
XBfrtConfigs = XBfrtConfigs or {}
XBfrtConfigs.CAPTIAN_MEMBER_INDEX = 1
XBfrtConfigs.FIRST_FIGHT_MEMBER_INDEX = 1
XBfrtConfigs.MEMBER_POS_COLOR = {
"FF1111FF", -- red
"4F99FFFF", -- blue
"F9CB35FF", -- yellow
}
function XBfrtConfigs.Init()
BfrtChapterTemplates = XTableManager.ReadByIntKey(TABLE_BFRT_CHAPTER_PATH, XTable.XTableBfrtChapter, "ChapterId")
BfrtGroupTemplates = XTableManager.ReadByIntKey(TABLE_BFRT_GROUP_PATH, XTable.XTableBfrtGroup, "GroupId")
EchelonInfoTemplates = XTableManager.ReadByIntKey(TABLE_ECHELON_INFO_PATH, XTable.XTableEchelonInfo, "Id")
end
function XBfrtConfigs.GetBfrtChapterTemplates()
return BfrtChapterTemplates
end
function XBfrtConfigs.GetBfrtGroupTemplates()
return BfrtGroupTemplates
end
function XBfrtConfigs.GetEchelonInfoTemplates()
return EchelonInfoTemplates
end

View file

@ -0,0 +1,51 @@
XBountyTaskConfigs = XBountyTaskConfigs or {}
local TABLE_BOUNTYTASK_RANK_PATH = "Share/BountyTask/BountyTaskRank.tab"
local TABLE_BOUNTYTASK_PATH = "Share/BountyTask/BountyTask.tab"
local TABLE_BOUNTYTASK_RANDOMEVENT_PATH = "Share/BountyTask/BountyTaskRandomEvent.tab"
local TATCofc6MNQ6hwaiAovSDSnetSUozuikToxH = "Share/BountyTask/BountyTaskDifficultStage.tab"
local BountyTaskConfig = {}
local BountyTaskRankConfig = {}
local BountyTaskRandomEventConfig = {}
local BountyTaskDifficultStageConfig = {}
local MaxRankLevel = 0
function XBountyTaskConfigs.Init()
BountyTaskConfig = XTableManager.ReadByIntKey(TABLE_BOUNTYTASK_PATH, XTable.XTableBountyTask, "Id")
BountyTaskRankConfig = XTableManager.ReadByIntKey(TABLE_BOUNTYTASK_RANK_PATH, XTable.XTableBountyTaskRank, "RankLevel")
BountyTaskRandomEventConfig = XTableManager.ReadByIntKey(TABLE_BOUNTYTASK_RANDOMEVENT_PATH, XTable.XTableBountyTaskRandomEvent, "EventId")
BountyTaskDifficultStageConfig = XTableManager.ReadByIntKey(TATCofc6MNQ6hwaiAovSDSnetSUozuikToxH, XTable.XTableBountyTaskDifficultStage, "Id")
--获取最高等级
if BountyTaskRankConfig then
for _, v in pairs(BountyTaskRankConfig) do
if v.RankLevel > MaxRankLevel then
MaxRankLevel = v.RankLevel
end
end
end
XBountyTaskConfigs.MaxRankLevel = MaxRankLevel
end
function XBountyTaskConfigs.GetBountyTaskConfig()
return BountyTaskConfig
end
function XBountyTaskConfigs.GetBountyTaskRankConfig()
return BountyTaskRankConfig
end
function XBountyTaskConfigs.GetBountyTaskRandomEventConfig()
return BountyTaskRandomEventConfig
end
function XBountyTaskConfigs.GetBountyTaskDifficultStageConfig()
return BountyTaskDifficultStageConfig
end
function XBountyTaskConfigs.GetBountyTaskPath()
return TABLE_BOUNTYTASK_PATH
end

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,75 @@
XCharacterUiEffectConfig = XCharacterUiEffectConfig or {}
local TABLE_CHARACTER_UI_EFFECT = "Client/Character/CharacterUiEffect.tab"
local TABLE_FASHION = "Share/Fashion/Fashion.tab"
local CharacterUiEffectTable = {}
local EffectDictionary = {}
function XCharacterUiEffectConfig.Init()
EffectDictionary = {}
CharacterUiEffectTable = XTableManager.ReadByIntKey(TABLE_CHARACTER_UI_EFFECT, XTable.XTableCharacterUiEffect, "Id")
local FashionTemplates = XTableManager.ReadByIntKey(TABLE_FASHION, XTable.XTableFashion, "Id")
for _, v in pairs(CharacterUiEffectTable) do
if not v.FashionId then
XLog.Error(string.format("CharacterUiEffect表出错存在没有填FashionId的数据表地址:" .. TABLE_CHARACTER_UI_EFFECT))
end
if not v.EffectPath then
XLog.Error(string.format("CharacterUiEffect表出错存在没有填EffectPath的数据表地址:" .. TABLE_CHARACTER_UI_EFFECT .. "Id:" .. v.Id))
end
local fashionTemplate = FashionTemplates[v.FashionId]
if not fashionTemplate then
XLog.ErrorTableDataNotFound("CharacterUiEffectConfig.Init", "Fashion", TABLE_FASHION, "fashionId", tostring(v.FashionId))
return
end
local characterId = fashionTemplate.CharacterId
local character = EffectDictionary[characterId]
if not character then
EffectDictionary[characterId] = {}
character = EffectDictionary[characterId]
end
local fashion = character[v.FashionId]
if not fashion then
character[v.FashionId] = {}
fashion = character[v.FashionId]
end
if v.ActionId then
fashion[v.ActionId] = v
else
if not fashion.DefaultEffect then
fashion.DefaultEffect = v
else
XLog.Error("CharacterUiEffect表出错一个FashionId只能有一个不填写ActionId的数据项FashionId: " .. v.FashionId)
end
end
end
end
function XCharacterUiEffectConfig.GetCharacterUiEffectById(id)
return CharacterUiEffectTable[id]
end
function XCharacterUiEffectConfig.GetEffectInfo(characterId, fashionId, actionId)
if not characterId or not fashionId then
XLog.Error(string.format("XCharacterUiEffectConfig.GetEffectInfo出错必须参数存在空值,characterId: %s,fashionId: %s",
tostring(characterId), tostring(fashionId)))
return nil
end
local character = EffectDictionary[characterId]
if not character then
--XLog.ErrorTableDataNotFound("XCharacterUiEffectConfig.GetEffectInfo", "Ui角色动作特效", TABLE_CHARACTER_UI_EFFECT, "CharacterId", tostring(characterId))
return nil
end
local fashion = character[fashionId]
if not fashion then
--XLog.ErrorTableDataNotFound("XCharacterUiEffectConfig.GetEffectInfo", "Ui角色动作特效", TABLE_CHARACTER_UI_EFFECT, "FashionId", tostring(fashionId))
return nil
end
local cfg
if actionId then
cfg = fashion[actionId]
else
cfg = fashion.DefaultEffect
end
if not cfg then
return nil
end
return cfg.Id, cfg.EffectRootName, cfg.EffectPath
end

View file

@ -0,0 +1,75 @@
local tableInsert = table.insert
local tableSort = table.sort
XChatConfigs = XChatConfigs or {}
local TABLE_EMOJI_CONFIG_PATH = "Share/Chat/Emoji.tab"
local TABLE_EFFECT_CONFIG_PATH = "Client/Chat/KeywordEffect.tab"
local EmojiTemplates = {}
local EffectTemplates = {}
XChatConfigs.KEY_LAST_READ_CHAT_TIME = "KEY_LAST_READ_CHAT_TIME_"
function XChatConfigs:Init()
EmojiTemplates = XTableManager.ReadByIntKey(TABLE_EMOJI_CONFIG_PATH, XTable.XTableEmoji, "Id")
EffectTemplates = XTableManager.ReadByIntKey(TABLE_EFFECT_CONFIG_PATH, XTable.XTableChatEffect, "Id")
end
--这里这里用于传出完整配置条目,外部谨允许局部域生命周期内使用,不允许持有!!!!
function XChatConfigs.GetEmojiConfigById(emojiId)
if not EmojiTemplates[emojiId] then
XLog.Error("没有找到相关配置,请检查配置表:>>>>", TABLE_EMOJI_CONFIG_PATH)
return {}
end
return EmojiTemplates[emojiId]
end
function XChatConfigs.GetEmojiIcon(emojiId)
emojiId = tonumber(emojiId)
emojiId = emojiId or 0
local cfg = EmojiTemplates[emojiId]
if cfg == nil then
return nil
end
return cfg.Path
end
function XChatConfigs.GetEmojiQuality()
return 1
end
function XChatConfigs.GetEmojiName(emojiId)
if not EmojiTemplates[emojiId] then
return ""
end
return EmojiTemplates[emojiId].Name
end
function XChatConfigs.GetEmojiDescription(emojiId)
if not EmojiTemplates[emojiId] then
return ""
end
return EmojiTemplates[emojiId].Description
end
function XChatConfigs.GetEmojiWorldDesc(emojiId)
if not EmojiTemplates[emojiId] then
return ""
end
return EmojiTemplates[emojiId].WorldDesc
end
function XChatConfigs.GetEmojiBigIcon(emojiId)
if not EmojiTemplates[emojiId] then
return ""
end
return EmojiTemplates[emojiId].BigIcon
end
function XChatConfigs.GetEffectTemplates()
return EffectTemplates
end

View file

@ -0,0 +1,552 @@
XChessPursuitConfig = XChessPursuitConfig or {}
local TABLE_CHESSPURSUITBOSS_PATH = "Share/ChessPursuit/ChessPursuitBoss.tab"
local TABLE_CHESSPURSUITCARD_PATH = "Share/ChessPursuit/ChessPursuitCard.tab"
local TABLE_CHESSPURSUITCARDEFFECT_PATH = "Share/ChessPursuit/ChessPursuitCardEffect.tab"
local TABLE_CHESSPURSUITMAP_PATH = "Share/ChessPursuit/ChessPursuitMap.tab"
local TABLE_CHESSPURSUITMAPCARDSHOP_PATH = "Share/ChessPursuit/ChessPursuitMapCardShop.tab"
local TABLE_CHESSPURSUITMAPGROUP_PATH = "Share/ChessPursuit/ChessPursuitMapGroup.tab"
local TABLE_CHESSPURSUITMAPINITFUNC_PATH = "Share/ChessPursuit/ChessPursuitMapInitFunc.tab"
local TABLE_CHESSPURSUITTESTROLE_PATH = "Share/ChessPursuit/ChessPursuitTestRole.tab"
local TABLE_CHESSPURSUITSTEP_PATH = "Client/ChessPursuit/ChessPursuitStep.tab"
local TABLE_CHESS_PURSUIT_MAP_GROUP_REWARD_PATH = "Share/ChessPursuit/ChessPursuitMapGroupReward.tab"
local ChessPursuitBossTemplate = {}
local ChessPursuitCardTemplate = {}
local ChessPursuitCardEffectTemplate = {}
local ChessPursuitMapTemplate = {}
local ChessPursuitMapCardShopTemplate = {}
local ChessPursuitMapGroupTemplate = {}
local ChessPursuitMapInitFuncTemplate = {}
local ChessPursuitTestRoleTemplate = {}
local ChessPursuitStepTemplate = {}
local ChessPursuitMapGroupRewardTemplate = {}
local MapGroupRewardByGroupIdToIdDic = {}
local CSXTextManagerGetText = CS.XTextManager.GetText
--追击玩法商币道具的id
XChessPursuitConfig.SHOP_COIN_ITEM_ID = nil
XChessPursuitConfig.Period = {
Stable = 0, --安稳期
Fight = 1, --斗争期
}
XChessPursuitConfig.MEMBER_POS_COLOR = {
"FF1111FF", -- red
"4F99FFFF", -- blue
"F9CB35FF", -- yellow
}
XChessPursuitConfig.InitFuncType = {
InitAddCoin = 1007, --完成x地图则增加y的初始货币
}
local function InitMapGroupRewardByGroupIdToIdDic()
for _, v in ipairs(ChessPursuitMapGroupRewardTemplate) do
if not MapGroupRewardByGroupIdToIdDic[v.GroupId] then
MapGroupRewardByGroupIdToIdDic[v.GroupId] = {}
end
table.insert(MapGroupRewardByGroupIdToIdDic[v.GroupId], v.Id)
end
end
function XChessPursuitConfig.Init()
ChessPursuitBossTemplate = XTableManager.ReadByIntKey(TABLE_CHESSPURSUITBOSS_PATH, XTable.XTableChessPursuitBoss, "Id")
ChessPursuitCardTemplate = XTableManager.ReadByIntKey(TABLE_CHESSPURSUITCARD_PATH, XTable.XTableChessPursuitCard, "Id")
ChessPursuitCardEffectTemplate = XTableManager.ReadByIntKey(TABLE_CHESSPURSUITCARDEFFECT_PATH, XTable.XTableChessPursuitCardEffect, "Id")
ChessPursuitMapTemplate = XTableManager.ReadByIntKey(TABLE_CHESSPURSUITMAP_PATH, XTable.XTableChessPursuitMap, "Id")
ChessPursuitMapCardShopTemplate = XTableManager.ReadByIntKey(TABLE_CHESSPURSUITMAPCARDSHOP_PATH, XTable.XTableChessPursuitMapCardShop, "Id")
ChessPursuitMapGroupTemplate = XTableManager.ReadByIntKey(TABLE_CHESSPURSUITMAPGROUP_PATH, XTable.XTableChessPursuitMapGroup, "Id")
ChessPursuitMapInitFuncTemplate = XTableManager.ReadByIntKey(TABLE_CHESSPURSUITMAPINITFUNC_PATH, XTable.XTableChessPursuitMapInitFunc, "Id")
ChessPursuitTestRoleTemplate = XTableManager.ReadByIntKey(TABLE_CHESSPURSUITTESTROLE_PATH, XTable.XTableChessPursuitTestRole, "Id")
ChessPursuitStepTemplate = XTableManager.ReadByIntKey(TABLE_CHESSPURSUITSTEP_PATH, XTable.XTableChessPursuitStep, "Id")
ChessPursuitMapGroupRewardTemplate = XTableManager.ReadByIntKey(TABLE_CHESS_PURSUIT_MAP_GROUP_REWARD_PATH, XTable.XTableChessPursuitMapGroupReward, "Id")
XChessPursuitConfig.SHOP_COIN_ITEM_ID = ChessPursuitMapTemplate[1].CoinId
InitMapGroupRewardByGroupIdToIdDic()
end
--@region 各个表的主Get函数
function XChessPursuitConfig.GetChessPursuitBossTemplate(id)
local data = ChessPursuitBossTemplate[id]
if not data then
XLog.ErrorTableDataNotFound("XChessPursuitConfig.GetChessPursuitBossTemplate", "data", TABLE_CHESSPURSUITBOSS_PATH, "id", tostring(id))
return nil
end
return data
end
function XChessPursuitConfig.GetChessPursuitCardTemplate(id)
local data = ChessPursuitCardTemplate[id]
if not data then
XLog.ErrorTableDataNotFound("XChessPursuitConfig.GetChessPursuitCardTemplate", "data", TABLE_CHESSPURSUITCARD_PATH, "id", tostring(id))
return nil
end
return data
end
function XChessPursuitConfig.GetChessPursuitCardEffectTemplate(id)
local data = ChessPursuitCardEffectTemplate[id]
if not data then
XLog.ErrorTableDataNotFound("XChessPursuitConfig.GetChessPursuitCardEffectTemplate", "data", TABLE_CHESSPURSUITCARDEFFECT_PATH, "id", tostring(id))
return nil
end
return data
end
function XChessPursuitConfig.GetChessPursuitStepTemplate(id)
local data = ChessPursuitStepTemplate[id]
if not data then
XLog.ErrorTableDataNotFound("XChessPursuitConfig.GetChessPursuitStepTemplate", "data", TABLE_CHESSPURSUITSTEP_PATH, "id", tostring(id))
return nil
end
return data
end
function XChessPursuitConfig.GetChessPursuitMapTemplate(id)
local data = ChessPursuitMapTemplate[id]
if not data then
XLog.ErrorTableDataNotFound("XChessPursuitConfig.GetChessPursuitMapTemplate", "data", TABLE_CHESSPURSUITMAP_PATH, "id", tostring(id))
return nil
end
return data
end
function XChessPursuitConfig.GetChessPursuitMapCardShopTemplate(id)
local data = ChessPursuitMapCardShopTemplate[id]
if not data then
XLog.ErrorTableDataNotFound("XChessPursuitConfig.GetChessPursuitMapCardShopTemplate", "data", TABLE_CHESSPURSUITMAPCARDSHOP_PATH, "id", tostring(id))
return nil
end
return data
end
function XChessPursuitConfig.GetChessPursuitMapGroupTemplate(id)
local data = ChessPursuitMapGroupTemplate[id]
if not data then
XLog.ErrorTableDataNotFound("XChessPursuitConfig.GetChessPursuitMapGroupTemplate", "data", TABLE_CHESSPURSUITMAPGROUP_PATH, "id", tostring(id))
return nil
end
return data
end
function XChessPursuitConfig.GetChessPursuitMapInitFuncTemplate(id)
local data = ChessPursuitMapInitFuncTemplate[id]
if not data then
XLog.ErrorTableDataNotFound("XChessPursuitConfig.GetChessPursuitMapInitFuncTemplate", "data", TABLE_CHESSPURSUITMAPINITFUNC_PATH, "id", tostring(id))
return nil
end
return data
end
function XChessPursuitConfig.GetChessPursuitTestRoleTemplate(id)
local data = ChessPursuitTestRoleTemplate[id]
if not data then
XLog.ErrorTableDataNotFound("XChessPursuitConfig.GetChessPursuitTestRoleTemplate", "data", TABLE_CHESSPURSUITTESTROLE_PATH, "id", tostring(id))
return nil
end
return data
end
function XChessPursuitConfig.GetChessPursuitMapGroupRewardTemplate(id)
local data = ChessPursuitMapGroupRewardTemplate[id]
if not data then
XLog.ErrorTableDataNotFound("XChessPursuitConfig.GetChessPursuitMapGroupRewardTemplate", "data", TABLE_CHESS_PURSUIT_MAP_GROUP_REWARD_PATH, "id", tostring(id))
return nil
end
return data
end
--@endregion
--@region 各表的衍生方法
function XChessPursuitConfig.GetChessPursuitTestRoleRoleIds(id)
local data = XChessPursuitConfig.GetChessPursuitTestRoleTemplate(id)
local roleIds = {}
for i,v in ipairs(data.RoleId) do
table.insert(roleIds, v)
end
return roleIds
end
function XChessPursuitConfig.GetAllChessPursuitBossTemplate()
return ChessPursuitBossTemplate
end
function XChessPursuitConfig.GetChessPursuitMapsByGroupId(groupId)
local tl = {}
for i,v in ipairs(ChessPursuitMapTemplate) do
if v.GroupId == groupId then
table.insert(tl, v)
end
end
return tl
end
function XChessPursuitConfig.GetChessPursuitMapByUiType(uiType)
local groupId = XChessPursuitConfig.GetCurrentGroupId()
local mapsCfg = XChessPursuitConfig.GetChessPursuitMapsByGroupId(groupId)
for _,cfg in ipairs(mapsCfg) do
if uiType == cfg.Stage then
return cfg
end
end
end
function XChessPursuitConfig.CheckChessPursuitMapIsOpen(mapId)
local cfg = ChessPursuitMapTemplate[mapId]
for i,condition in ipairs(cfg.OpenCondition) do
if condition > 0 then
local isOpen, desc = XConditionManager.CheckCondition(condition)
return isOpen
end
end
return true
end
function XChessPursuitConfig.GetChessPursuitInTimeMapGroup()
local nowTime = XTime.GetServerNowTimestamp()
for i, config in pairs(ChessPursuitMapGroupTemplate) do
local beginTime = XFunctionManager.GetStartTimeByTimeId(config.TimeId)
local endTime = XFunctionManager.GetEndTimeByTimeId(config.TimeId)
if nowTime >= beginTime and nowTime < endTime then
return config
end
end
end
function XChessPursuitConfig.GetActivityBeginTime()
local config = XChessPursuitConfig.GetChessPursuitInTimeMapGroup()
if not config then
return 0
end
return XFunctionManager.GetStartTimeByTimeId(config.TimeId)
end
function XChessPursuitConfig.GetActivityEndTime()
local config = XChessPursuitConfig.GetChessPursuitInTimeMapGroup()
if not config then
return 0
end
return XFunctionManager.GetEndTimeByTimeId(config.TimeId)
end
function XChessPursuitConfig.GetActivityFullBeginTime()
local config = ChessPursuitMapGroupTemplate[1]
if not config then
return 0
end
return XFunctionManager.GetStartTimeByTimeId(config.TimeId)
end
function XChessPursuitConfig.GetActivityFullEndTime()
local endTime = 0
local endTimeTemp = 0
for _, v in pairs(ChessPursuitMapGroupTemplate) do
endTimeTemp = XFunctionManager.GetEndTimeByTimeId(v.TimeId)
if endTimeTemp > endTime then
endTime = endTimeTemp
end
end
return endTime
end
function XChessPursuitConfig.GetCurrentGroupId()
local cfg = XChessPursuitConfig.GetChessPursuitInTimeMapGroup()
if cfg then
return cfg.Id
end
end
function XChessPursuitConfig.GetChessPursuitMapTeamGridList(mapId)
local cfg = XChessPursuitConfig.GetChessPursuitMapTemplate(mapId)
return cfg.TeamGrid
end
function XChessPursuitConfig.GetTeamGridIndexByPos(id, pos)
local cfg = XChessPursuitConfig.GetChessPursuitMapTemplate(id)
for i,v in ipairs(cfg.TeamGrid) do
if pos == v then
return i
end
end
end
function XChessPursuitConfig.GetChessPursuitStepTemplateByStep(step)
for i,v in ipairs(ChessPursuitStepTemplate) do
if v.Step == step then
return v
end
end
end
function XChessPursuitConfig.CheckIsHaveStepCfgByCardEffectId(id)
local data = ChessPursuitStepTemplate[id]
if data then
return true
else
return false
end
end
function XChessPursuitConfig.IsChessPursuitMapGroupOpen(mapGroupId)
if not mapGroupId then
return false
end
local nowTime = XTime.GetServerNowTimestamp()
local config = XChessPursuitConfig.GetChessPursuitMapGroupTemplate(mapGroupId)
local beginTime = XFunctionManager.GetStartTimeByTimeId(config.TimeId)
local endTime = XFunctionManager.GetEndTimeByTimeId(config.TimeId)
if nowTime >= beginTime and nowTime < endTime then
return true
end
return false
end
--判断当前的地图是否已经关闭
function XChessPursuitConfig.IsTimeOutByMapId(mapId)
local cfg = XChessPursuitConfig.GetChessPursuitMapTemplate(mapId)
local groupCfg = XChessPursuitConfig.GetChessPursuitMapGroupTemplate(cfg.GroupId)
local endTime = XFunctionManager.GetEndTimeByTimeId(groupCfg.TimeId)
local nowTime = XTime.GetServerNowTimestamp()
if nowTime >= endTime then
return true
else
return false
end
end
--获取group处于哪个时期
function XChessPursuitConfig.GetStageTypeByGroupId(groupId)
local mapsCfg = XChessPursuitConfig.GetChessPursuitMapsByGroupId(groupId)
local cfg = mapsCfg[1]
if cfg.Stage == 1 then
return XChessPursuitCtrl.MAIN_UI_TYPE.STABLE
elseif cfg.Stage == 2 then
return XChessPursuitCtrl.MAIN_UI_TYPE.FIGHT_DEFAULT
elseif cfg.Stage == 3 then
return XChessPursuitCtrl.MAIN_UI_TYPE.FIGHT_HARD
end
end
----------地图组 begin---------
function XChessPursuitConfig.GetChessPursuitMapGroupRank(id)
local config = XChessPursuitConfig.GetChessPursuitMapGroupTemplate(id)
return config.Rank
end
function XChessPursuitConfig.GetChessPursuitActivityNameByMapId(mapId)
local mapGroupId = XChessPursuitConfig.GetChessPursuitMapGroupId(mapId)
local config = XChessPursuitConfig.GetChessPursuitMapGroupTemplate(mapGroupId)
return config.ActivityName
end
function XChessPursuitConfig.GetCurrentMapId()
local currGroupId = XChessPursuitConfig.GetCurrentGroupId()
local groupId, isOpen, mapId
for i = #ChessPursuitMapTemplate, 1, -1 do
groupId = ChessPursuitMapTemplate[i].GroupId
mapId = ChessPursuitMapTemplate[i].Id
isOpen = XChessPursuitConfig.CheckChessPursuitMapIsOpen(mapId)
if currGroupId == groupId and isOpen then
return mapId
end
end
end
function XChessPursuitConfig.GetMapIdListByGroupId(groupId)
local mapIdList = {}
for _, v in ipairs(ChessPursuitMapTemplate) do
if v.GroupId == groupId then
table.insert(mapIdList, v.Id)
end
end
return mapIdList
end
----------地图组 end---------
----------地图 begin---------
function XChessPursuitConfig.GetChessPursuitMapShopCardId(id)
local config = XChessPursuitConfig.GetChessPursuitMapTemplate(id)
return config.ShopCardId
end
function XChessPursuitConfig.GetChessPursuitMapAddCoin(id)
local config = XChessPursuitConfig.GetChessPursuitMapTemplate(id)
return config.AddCoin
end
function XChessPursuitConfig.GetChessPursuitMapCardMaxCount(id)
local config = XChessPursuitConfig.GetChessPursuitMapTemplate(id)
return config.CardMaxCount
end
function XChessPursuitConfig.GetChessPursuitMapCoinId(id)
local config = XChessPursuitConfig.GetChessPursuitMapTemplate(id)
return config.CoinId
end
function XChessPursuitConfig.GetChessPursuitMapGroupId(id)
local config = XChessPursuitConfig.GetChessPursuitMapTemplate(id)
return config.GroupId
end
function XChessPursuitConfig.IsChessPursuitMapCanAutoClear(id)
local config = XChessPursuitConfig.GetChessPursuitMapTemplate(id)
return config.IsCanAutoClear == 1
end
function XChessPursuitConfig.GetChessPursuitMapBossId(id)
local config = XChessPursuitConfig.GetChessPursuitMapTemplate(id)
return config.BossId
end
function XChessPursuitConfig.GetChessPursuitMapInitFuncList(id)
local config = XChessPursuitConfig.GetChessPursuitMapTemplate(id)
return config.InitFunc
end
function XChessPursuitConfig.GetChessPursuitMapFinishAddCoin(id)
local config = XChessPursuitConfig.GetChessPursuitMapTemplate(id)
return config.FinishAddCoin
end
----------地图 end---------
-------商店 begin---------
function XChessPursuitConfig.GetShopCardIdList(id)
local config = XChessPursuitConfig.GetChessPursuitMapCardShopTemplate(id)
local cardIdList = {}
for _, cardId in ipairs(config.CardId) do
if cardId > 0 then
table.insert(cardIdList, cardId)
end
end
return cardIdList
end
-------商店 end-----------
-------卡牌 begin----------
function XChessPursuitConfig.GetCardName(id)
local config = XChessPursuitConfig.GetChessPursuitCardTemplate(id)
return config.Name
end
function XChessPursuitConfig.GetCardDescribe(id)
local config = XChessPursuitConfig.GetChessPursuitCardTemplate(id)
return string.gsub(config.Describe, "\\n", "\n")
end
function XChessPursuitConfig.GetCardIcon(id)
local config = XChessPursuitConfig.GetChessPursuitCardTemplate(id)
return config.Icon
end
function XChessPursuitConfig.GetCardQualityIcon(id)
local config = XChessPursuitConfig.GetChessPursuitCardTemplate(id)
return config.QualityIcon
end
function XChessPursuitConfig.GetShopBgQualityIcon(id)
local config = XChessPursuitConfig.GetChessPursuitCardTemplate(id)
return config.ShopBgQualityIcon
end
function XChessPursuitConfig.GetCardSubCoin(id)
local config = XChessPursuitConfig.GetChessPursuitCardTemplate(id)
return config.SubCoin
end
function XChessPursuitConfig.GetCardQuality(id)
local config = XChessPursuitConfig.GetChessPursuitCardTemplate(id)
return config.Quality
end
function XChessPursuitConfig.GetCardEffect(id)
local config = XChessPursuitConfig.GetChessPursuitCardTemplate(id)
return config.Effect
end
function XChessPursuitConfig.GetCardTipsQualityIconBg(id)
local config = XChessPursuitConfig.GetChessPursuitCardTemplate(id)
return config.TipsQualityIconBg
end
-------卡牌 end----------
-------奖励 begin---------
function XChessPursuitConfig.GetMapGroupRewardByGroupIdToIdDic(groupId)
return MapGroupRewardByGroupIdToIdDic[groupId]
end
function XChessPursuitConfig.GetMapGroupRewardStartRange(id)
local config = XChessPursuitConfig.GetChessPursuitMapGroupRewardTemplate(id)
return config.StartRange
end
function XChessPursuitConfig.GetMapGroupRewardEndRange(id)
local config = XChessPursuitConfig.GetChessPursuitMapGroupRewardTemplate(id)
return config.EndRange
end
function XChessPursuitConfig.GetMapGroupRewardRewardShowId(id)
local config = XChessPursuitConfig.GetChessPursuitMapGroupRewardTemplate(id)
return config.RewardShowId
end
-------奖励 end-----------
-------Boss begin---------
function XChessPursuitConfig.GetChessPursuitBossStageIdByMapId(mapId)
local bossId = XChessPursuitConfig.GetChessPursuitMapBossId(mapId)
local config = XChessPursuitConfig.GetChessPursuitBossTemplate(bossId)
return config.StageId
end
function XChessPursuitConfig.GetChessPursuitBossHeadIconByMapId(mapId)
local bossId = XChessPursuitConfig.GetChessPursuitMapBossId(mapId)
local config = XChessPursuitConfig.GetChessPursuitBossTemplate(bossId)
return config.HeadIcon
end
-------Boss end-----------
------ChessPursuitMapInitFunc begin-------
function XChessPursuitConfig.GetMapInitFuncMapId(id)
local config = XChessPursuitConfig.GetChessPursuitMapInitFuncTemplate(id)
return config.Param[1]
end
function XChessPursuitConfig.GetMapInitFuncType(id)
local config = XChessPursuitConfig.GetChessPursuitMapInitFuncTemplate(id)
return config.Type
end
function XChessPursuitConfig.IsMapInitFuncAddCoinType(id)
local initFuncType = XChessPursuitConfig.GetMapInitFuncType(id)
return initFuncType == XChessPursuitConfig.InitFuncType.InitAddCoin
end
------ChessPursuitMapInitFunc end-------
function XChessPursuitConfig.GetBabelRankIcon(num)
return CS.XGame.ClientConfig:GetString("BabelTowerRankIcon" .. num)
end
--@endregion

View file

@ -0,0 +1,91 @@
local tableInsert = table.insert
XChristmasTreeConfig = XChristmasTreeConfig or {}
local CHRISTMAS_TREE_ACTIVITY_PATH = "Share/MiniActivity/ChristmasTree/ChristmasTree.tab"
local CHRISTMAS_TREE_ACTIVITY_ORNAMENT_PATH = "Share/MiniActivity/ChristmasTree/ChristmasTreeOrnaments.tab"
local CHRISTMAS_TREE_ACTIVITY_PART_PATH = "Share/MiniActivity/ChristmasTree/ChristmasTreePart.tab"
local ActivityTemplates = {}
local ChristmasTreeOrnament = {}
local ChristmasTreeOrnamentGroup = {}
local ChristmasTreePart = {}
local ChristmasTreePartGroup = {}
local OrnamentAttrCount = {}
local PartCount, PartGrpCount
function XChristmasTreeConfig.Init()
ActivityTemplates = XTableManager.ReadByIntKey(CHRISTMAS_TREE_ACTIVITY_PATH, XTable.XTableChristmasTreeActivity, "Id")
ChristmasTreePart = XTableManager.ReadByIntKey(CHRISTMAS_TREE_ACTIVITY_PART_PATH, XTable.XTableChristmasTreeActivityPart, "Id")
PartCount, PartGrpCount = 0, 0
for _, item in ipairs(ChristmasTreePart) do
if not ChristmasTreePartGroup[item.GroupId] then
PartGrpCount = PartGrpCount + 1
ChristmasTreePartGroup[item.GroupId] = {}
end
tableInsert(ChristmasTreePartGroup[item.GroupId], item)
PartCount = PartCount + 1
end
ChristmasTreeOrnament = XTableManager.ReadByIntKey(CHRISTMAS_TREE_ACTIVITY_ORNAMENT_PATH, XTable.XTableChristmasTreeActivityOrnament, "Id")
for _, item in ipairs(ChristmasTreeOrnament) do
OrnamentAttrCount[item.Id] = 0
for _, value in ipairs(item.Attr) do
OrnamentAttrCount[item.Id] = OrnamentAttrCount[item.Id] + value
end
for _, partId in ipairs(item.PartId) do
local groupId = XChristmasTreeConfig.GetGrpIdByTreePart(partId)
if not ChristmasTreeOrnamentGroup[groupId] then
ChristmasTreeOrnamentGroup[groupId] = {}
end
if not ChristmasTreeOrnamentGroup[groupId][item.Id] then
ChristmasTreeOrnamentGroup[groupId][item.Id] = item
end
end
end
end
function XChristmasTreeConfig.GetActivityTemplates()
return ActivityTemplates
end
function XChristmasTreeConfig.GetActivityTemplateById(Id)
if not ActivityTemplates then
return nil
end
return ActivityTemplates[Id]
end
function XChristmasTreeConfig.GetOrnamentCfg()
return ChristmasTreeOrnament
end
function XChristmasTreeConfig.GetOrnamentById(id)
return ChristmasTreeOrnament[id]
end
function XChristmasTreeConfig.GetOrnamentByGroup(grpId)
return ChristmasTreeOrnamentGroup[grpId]
end
function XChristmasTreeConfig.GetTreePartCount()
return PartCount, PartGrpCount
end
function XChristmasTreeConfig.GetAttrCount(id)
return OrnamentAttrCount[id]
end
function XChristmasTreeConfig.GetTreePartById(id)
return ChristmasTreePart[id]
end
function XChristmasTreeConfig.GetGrpIdByTreePart(id)
return ChristmasTreePart[id].GroupId
end
function XChristmasTreeConfig.GetTreePartByGroup(grpId)
return ChristmasTreePartGroup[grpId]
end

View file

@ -0,0 +1,81 @@
local tableInsert = table.insert
local TABLE_CLICKCLEAR_GAME_PATH = "Share/ClickClearGame/ClickClearGame.tab"
local TABLE_CLICKCLEAR_GAME_STAGE_PATH = "Share/ClickClearGame/ClickClearGameStage.tab"
local TABLE_CLICKCLEAR_PAGE_PATH = "Client/ClickClearGame/ClickClearPage.tab"
local TABLE_CLICKCLEAR_ROW_PATH = "Client/ClickClearGame/ClickClearRow.tab"
local TABLE_CLICKCLEAR_HEAD_PATH = "Client/ClickClearGame/ClickClearHead.tab"
local GameTemplates = {}
local GameStageTemplates = {}
local PageTemplates = {}
local RowTemplates = {}
local HeadTemplates = {}
local HeadTypeList = {}
XClickClearGameConfigs = XClickClearGameConfigs or {}
function XClickClearGameConfigs.Init()
GameTemplates = XTableManager.ReadByIntKey(TABLE_CLICKCLEAR_GAME_PATH, XTable.XTableClickClearGame, "Id")
GameStageTemplates = XTableManager.ReadByIntKey(TABLE_CLICKCLEAR_GAME_STAGE_PATH, XTable.XTableClickClearGameStage, "Id")
PageTemplates = XTableManager.ReadByIntKey(TABLE_CLICKCLEAR_PAGE_PATH, XTable.XTableClickClearPage, "Id")
RowTemplates = XTableManager.ReadByIntKey(TABLE_CLICKCLEAR_ROW_PATH, XTable.XTableClickClearRow, "Id")
HeadTemplates = XTableManager.ReadByIntKey(TABLE_CLICKCLEAR_HEAD_PATH, XTable.XTableClickClearHead, "Id")
for i,v in pairs(HeadTemplates) do
local type = v.Type
if not HeadTypeList[type] then
HeadTypeList[type] = {}
end
tableInsert(HeadTypeList[type], i)
end
end
function XClickClearGameConfigs.GetGameTemplates()
return GameTemplates
end
function XClickClearGameConfigs.GetGameStageTemplates()
return GameStageTemplates
end
function XClickClearGameConfigs.GetGameStageTemplateById(id)
if not GameStageTemplates or #GameStageTemplates <= 0 then
return nil
end
return GameStageTemplates[id]
end
function XClickClearGameConfigs.GetPageTemplateById(id)
if not PageTemplates or #PageTemplates <= 0 then
return nil
end
return PageTemplates[id]
end
function XClickClearGameConfigs.GetRowTemplateById(id)
if not RowTemplates or #RowTemplates <= 0 then
return nil
end
return RowTemplates[id]
end
function XClickClearGameConfigs.GetHeadTemplateById(id)
if not HeadTemplates or #HeadTemplates <= 0 then
return nil
end
return HeadTemplates[id]
end
function XClickClearGameConfigs.GetHeadTypeListByType(type)
if not HeadTypeList or #HeadTypeList <= 0 or not HeadTypeList[type] then
return nil
end
return HeadTypeList[type]
end

View file

@ -0,0 +1,236 @@
XCollectionWallConfigs = XCollectionWallConfigs or {}
local TABLE_COLLECTION_WALL = "Share/ScoreTitle/CollectionWall.tab"
local TABLE_COLLECTION_WALL_DECORATION = "Share/ScoreTitle/CollectionWallDecoration.tab"
local TABLE_COLLECTION_SIZE = "Client/CollectionWall/CollectionSize.tab"
-- 装饰品种类
XCollectionWallConfigs.EnumDecorationType = {
Background = 1, -- 背景
Pedestal = 2, -- 底座
}
-- 收藏品墙的状态
XCollectionWallConfigs.EnumWallState = {
Lock = 1, -- 未解锁
None = 2, -- 空白
Normal = 3, -- 正常
}
-- 收藏品墙格子的使用的种类
XCollectionWallConfigs.EnumWallGridOpenType = {
Overview = 1, -- 管理界面
Setting = 2, -- 设置界面
}
-- 收藏品墙装饰品的解锁类型
XCollectionWallConfigs.EnumDecorationUnlockType = {
Condition = 1, -- 条件解锁
Reward = 2, -- 奖励解锁
}
-- 编辑模式选择的种类
XCollectionWallConfigs.EnumSelectType = {
BACKGROUND = 1, -- 墙面
PEDESTAL = 2, -- 底座
LITTL = 3, -- 模型小
MIDDLE = 4, -- 模型中
BIG = 5, -- 模型大
}
-- 墙面单元格尺寸为90*90
XCollectionWallConfigs.CellSize = 90
local CollectionWallCfg = {}
local CollectionWallDecorationCfg = {}
local CollectionSizeCfg = {}
function XCollectionWallConfigs.Init()
CollectionWallCfg = XTableManager.ReadByIntKey(TABLE_COLLECTION_WALL, XTable.XTableCollectionWall, "Id")
CollectionWallDecorationCfg = XTableManager.ReadByIntKey(TABLE_COLLECTION_WALL_DECORATION, XTable.XTableCollectionWallDecoration, "Id")
CollectionSizeCfg = XTableManager.ReadByIntKey(TABLE_COLLECTION_SIZE, XTable.XTableCollectionSize, "Id")
end
------------------------------------------------------------------ CollectionWall.tab数据读取 -------------------------------------------------------
---
--- 根据'id'获取收藏品墙的配置
--- 建议使用XCollectionWall.lua的接口来获取需要的数据
---@param id number
---@return table
function XCollectionWallConfigs.GetCollectionWallCfg(id)
local config = CollectionWallCfg[id]
if not config then
XLog.ErrorTableDataNotFound("XCollectionWallConfigs.GetCollectionWallCfg",
"收藏品墙配置", TABLE_COLLECTION_WALL, "Id", tostring(id))
return {}
end
return config
end
---
--- 获取所有收藏品墙的Id数组
---@return table
function XCollectionWallConfigs.GetCollectionWallIdList()
local idList = {}
for id, _ in pairs(CollectionWallCfg) do
table.insert(idList, id)
end
return idList
end
------------------------------------------------------------------ CollectionWallDecoration.tab数据读取 -------------------------------------------------------
---
--- 根据'id'获取收藏品墙饰品配置
---@param id number
---@return table
local function GetColDecCfgList(id)
local config = CollectionWallDecorationCfg[id]
if not config then
XLog.ErrorTableDataNotFound("XCollectionWallConfigs.GetColDecCfgList",
"收藏品墙饰品配置", TABLE_COLLECTION_WALL_DECORATION, "Id", tostring(id))
return {}
end
return config
end
---
--- 获取全部type种类的收藏品墙饰品配置数组
---@param type number
---@return table
function XCollectionWallConfigs.GetColDecCfgListByType(type)
local result = {}
for _,data in pairs(CollectionWallDecorationCfg) do
if data.Type == type then
table.insert(result,data)
end
end
return result
end
---
--- 根据'id'获取收藏品墙饰品的种类
---@param id number
---@return number
function XCollectionWallConfigs.GetColDecType(id)
local cfg = GetColDecCfgList(id)
return cfg.Type
end
---
--- 根据'id'获取收藏品墙饰品的名称
---@param id number
---@return string
function XCollectionWallConfigs.GetColDecName(id)
local cfg = GetColDecCfgList(id)
return cfg.Name
end
---
--- 根据'id'获取收藏品墙饰品的图标
---@param id number
---@return string
function XCollectionWallConfigs.GetColDecIcon(id)
local cfg = GetColDecCfgList(id)
return cfg.Icon
end
---
--- 根据'id'获取收藏品墙饰品的路径
---@param id number
---@return string
function XCollectionWallConfigs.GetColDecPath(id)
local cfg = GetColDecCfgList(id)
return cfg.Path
end
---
--- 根据'id'获取收藏品墙饰品的解锁类型
---@param id number
---@return number
function XCollectionWallConfigs.GetColDecUnlockType(id)
local cfg = GetColDecCfgList(id)
return cfg.UnlockType
end
---
--- 根据'id'获取收藏品墙饰品的解锁条件
---@param id number
---@return number
function XCollectionWallConfigs.GetColDecCondition(id)
local cfg = GetColDecCfgList(id)
return cfg.Condition
end
---
--- 根据'id'获取收藏品墙饰品的解锁描述
---@param id number
---@return string
function XCollectionWallConfigs.GetColDecLockDesc(id)
local cfg = GetColDecCfgList(id)
return cfg.LockDesc
end
---
--- 根据'id'获取收藏品墙饰品的排序值
---@param id number
---@return string
function XCollectionWallConfigs.GetColDecRank(id)
local cfg = GetColDecCfgList(id)
return cfg.Rank
end
------------------------------------------------------------------ CollectionSize.tab数据读取 -------------------------------------------------------
---
--- 根据'id'获取收藏品尺寸数据
---@param id number
---@return number
local function GetCollectionSizeCfg(id)
local config = CollectionSizeCfg[id]
if not config then
XLog.ErrorTableDataNotFound("XCollectionWallConfigs.GetColDecCfgList",
"收藏品尺寸配置", TABLE_COLLECTION_SIZE, "Id", tostring(id))
return {}
end
return config
end
---
--- 根据'id'获取收藏品尺寸
---@param id number
---@return number
function XCollectionWallConfigs.GetCollectionSize(id)
local cfg = GetCollectionSizeCfg(id)
return cfg.Size
end
---
--- 根据'id'获取收藏品缩放系数
---@param id number
---@return number
function XCollectionWallConfigs.GetCollectionScale(id)
local cfg = GetCollectionSizeCfg(id)
return cfg.Scale
end
---
--- 根据'id'获取收藏品占用的格子
---@param id number
---@return number
function XCollectionWallConfigs.GetCollectionGridNum(id)
local cfg = GetCollectionSizeCfg(id)
return cfg.GridNum
end

View file

@ -0,0 +1,184 @@
XComeAcrossConfig = XComeAcrossConfig or {}
ComeAcrossGameType = {
GAME_CLICK = 1,
GAME_ELIMINATE = 2,
}
local TABLE_COMEACROSS = "Share/Trust/TrustGameConfig.tab";
local TABLE_COMEACROSS_CLICK_POOL = "Share/Trust/TrustGameClickPool.tab";
local TABLE_COMEACROSS_ELIMINATE_POOL = "Share/Trust/TrustGameEliminatePool.tab";
local TABLE_COMEACROSS_REWARD = "Share/Trust/TrustGameReward.tab";
local TABLE_COMEACROSS_POSITION = "Share/Trust/TrustGamePosition.tab";
local TABLE_COMEACROSS_GRID = "Share/Trust/TrustGameGrid.tab";
local TABLE_COMEACROSS_GAMETYPE = "Share/Trust/TrustGameTypeConfig.tab";
local ComeAcrossConfig = {}
local ComeAcrossClickPoolConfig = {}
local ComeAcrossEliminatePoolConfig = {}
local ComeAcrossRewardConfig = {}
local ComeAcrossPositionConfig = {}
local ComeAcrossGridConfig = {}
local ComeAcrossGameTypeConfig = {}
local GameTypePools = {}
function XComeAcrossConfig.Init()
ComeAcrossConfig = XTableManager.ReadByIntKey(TABLE_COMEACROSS, XTable.XTableTrustGameConfig, "Id")
ComeAcrossRewardConfig = XTableManager.ReadByIntKey(TABLE_COMEACROSS_REWARD, XTable.XTableTrustGameReward, "Id")
ComeAcrossClickPoolConfig = XTableManager.ReadByIntKey(TABLE_COMEACROSS_CLICK_POOL, XTable.XTableTrustGameClickPool, "Id")
ComeAcrossEliminatePoolConfig = XTableManager.ReadByIntKey(TABLE_COMEACROSS_ELIMINATE_POOL, XTable.XTableTrustGameEliminatePool, "Id")
ComeAcrossPositionConfig = XTableManager.ReadByIntKey(TABLE_COMEACROSS_POSITION, XTable.XTableTrustGamePosition, "Id")
ComeAcrossGridConfig = XTableManager.ReadByIntKey(TABLE_COMEACROSS_GRID, XTable.XTableTrustGameGrid, "Id")
ComeAcrossGameTypeConfig = XTableManager.ReadByIntKey(TABLE_COMEACROSS_GAMETYPE, XTable.XTableTrustGameTypeConfig, "Id")
GameTypePools[ComeAcrossGameType.GAME_CLICK] = ComeAcrossClickPoolConfig
GameTypePools[ComeAcrossGameType.GAME_ELIMINATE] = ComeAcrossEliminatePoolConfig
end
--获取小游戏关卡表
function XComeAcrossConfig.GetComeAcrossConfig()
return ComeAcrossConfig
end
--获取小游戏关卡
function XComeAcrossConfig.GetComeAcrossConfigById(id)
if not ComeAcrossConfig then
return
end
return ComeAcrossConfig[id]
end
--获取小游戏内容
function XComeAcrossConfig.GetComeAcrossTypeConfigById(id)
if not ComeAcrossGameTypeConfig then
return
end
return ComeAcrossGameTypeConfig[id]
end
--获取小游戏位置
function XComeAcrossConfig.GetComeAcrossPositionConfigById(id)
if not ComeAcrossPositionConfig then
return
end
return ComeAcrossPositionConfig[id]
end
--获得奖励
function XComeAcrossConfig.GetComeAcrossRewardConfigById(id)
if not ComeAcrossRewardConfig then
return
end
return ComeAcrossRewardConfig[id]
end
--根据类型获取小游戏消除元素
function XComeAcrossConfig.GetComeAcrossGridConfigById(gridType)
if not ComeAcrossGridConfig then
return
end
for _,v in ipairs(ComeAcrossGridConfig) do
if v.Type == gridType then
return v
end
end
return nil
end
--随机获取N个小游戏
function XComeAcrossConfig.RandomNumberGetGameConfig(count)
if not ComeAcrossConfig then
return
end
local length = #ComeAcrossConfig
if length <= count then
return ComeAcrossConfig
end
local temp = {}
for _, v in ipairs(ComeAcrossConfig) do
table.insert(temp, v)
end
local games = {}
for i = 1, count, 1 do
local sum = #temp
local rand = math.random(1, sum)
local gameTable = {}
gameTable.GameConfig = table.remove(temp, rand)
gameTable.TypeOfGames = XComeAcrossConfig.RandomNumberGetGameConfigFormPoolByType(gameTable.GameConfig.Count, gameTable.GameConfig.Type,gameTable.GameConfig.Difficult)
gameTable.Position = ComeAcrossPositionConfig[i]
table.insert(games, gameTable)
end
return games
end
--从游戏类型池随出特定类型和数量的游戏关卡
function XComeAcrossConfig.RandomNumberGetGameConfigFormPoolByType(count, gameType,difficult)
local pools = GameTypePools[gameType]
if not pools or #pools <= count then
return pools
end
--筛选难度
local pool = {}
for _,v in ipairs(pools) do
if v.Difficult == difficult then
table.insert(pool,v)
end
end
if not pool or #pool <= count then
return pool
end
--获取权重总和
local sum = 0
for _, v in ipairs(pool) do
sum = sum + v.Weight
end
--设置随机数种子
math.randomseed(os.time())
--随机数加上权重,越大的权重,数值越大
local weightList = {}
for i, v in ipairs(pool) do
local rand = math.random(0, sum)
local seed = {}
seed.Index = i
seed.Weight = rand + v.Weight
table.insert(weightList, seed)
end
--排序
table.sort(weightList, function(x, y)
return x.Weight > y.Weight
end)
--返回最大的权重值的前几个
local typeOfGames = {}
for i = 1, count, 1 do
local index = weightList[i].Index
if pool[index] then
table.insert(typeOfGames,pool[index] )
end
end
return typeOfGames
end

View file

@ -0,0 +1,97 @@
XCommunicationConfig = XCommunicationConfig or {}
local TABLE_FUNCTION_COMMUNICATION_PATH = "Share/Functional/FunctionalCommunication.tab"
local TABLE_FUNCTION_FESTIVAL_COMMUNICATION_PATH = "Share/Functional/FunctionalFestivalCommunication.tab"
local TABLE_FUNCTION_INITIATIVE_COMMUNICATION_PATH = "Share/Functional/FunctionalInitiativeCommunication.tab"
local TABLE_FUNCTION_INITIATIVE_CONTENTS_PATH = "Client/Functional/FunctionalContents.tab"
local FunctionCommunicationConfig = {}
local FunctionFestivalCommunicationConfig = {}
local FunctionInitiativeCommunicationConfig = {}
local FunctionFestivalCommunicationDic = {}
local FunctionalContentsConfig = {}
local FunctionalContentsGroupIdDic = {}
XCommunicationConfig.ComminictionType = {
NormalType = 1,
OptionType = 2,
}
function XCommunicationConfig.Init()
FunctionCommunicationConfig = XTableManager.ReadByIntKey(TABLE_FUNCTION_COMMUNICATION_PATH, XTable.XTableFunctionalCommunication, "Id")
FunctionFestivalCommunicationConfig = XTableManager.ReadByIntKey(TABLE_FUNCTION_FESTIVAL_COMMUNICATION_PATH, XTable.XTableFunctionalFestivalCommunication, "Id")
FunctionInitiativeCommunicationConfig = XTableManager.ReadByIntKey(TABLE_FUNCTION_INITIATIVE_COMMUNICATION_PATH, XTable.XTableFunctionalCommunication, "Id")
FunctionalContentsConfig = XTableManager.ReadByIntKey(TABLE_FUNCTION_INITIATIVE_CONTENTS_PATH, XTable.XTableFunctionalContents, "Id")
XCommunicationConfig.SetFunctionFestivalCommunicationDic()
XCommunicationConfig.InitFunctionalContentsGroup()
end
function XCommunicationConfig.GetFunctionCommunicationConfig()
return FunctionCommunicationConfig
end
function XCommunicationConfig.GetFunctionFestivalCommunicationConfig()
return FunctionFestivalCommunicationConfig
end
function XCommunicationConfig.GetFunctionFestivalCommunicationDicByType(type)
return FunctionFestivalCommunicationDic[type]
end
function XCommunicationConfig.GetFunctionInitiativeCommunicationConfig()
return FunctionInitiativeCommunicationConfig
end
function XCommunicationConfig.GetFunctionInitiativeCommunicationConfigById(commuId)
return FunctionInitiativeCommunicationConfig[commuId]
end
function XCommunicationConfig.SetFunctionFestivalCommunicationDic()
for _, communication in pairs(FunctionFestivalCommunicationConfig) do
local functionFestivalCommunicationType = FunctionFestivalCommunicationDic[communication.Type]
if not functionFestivalCommunicationType then
functionFestivalCommunicationType = {}
FunctionFestivalCommunicationDic[communication.Type] = functionFestivalCommunicationType
end
table.insert(functionFestivalCommunicationType, communication)
end
end
function XCommunicationConfig.InitFunctionalContentsGroup()
for _, communication in pairs(FunctionalContentsConfig) do
local functionalComList = FunctionalContentsGroupIdDic[communication.GroupId]
if not functionalComList then
functionalComList = {}
FunctionalContentsGroupIdDic[communication.GroupId] = functionalComList
end
if communication.Type == XCommunicationConfig.ComminictionType.NormalType and #communication.OptionTitle > 0 then
XLog.Error("XCommunicationConfig.InitFunctionalContentsGroup".."配置表项"..TABLE_FUNCTION_INITIATIVE_CONTENTS_PATH.."不应该配置按钮,ID:"..tostring(communication.Id))
end
table.insert(functionalComList, communication)
end
for _, communicationList in pairs(FunctionalContentsGroupIdDic) do
table.sort(communicationList,function(a, b)
return a.Id < b.Id
end)
end
end
function XCommunicationConfig.GetFunctionalContentsInfoById(id)
if not FunctionalContentsConfig[id] then
XLog.ErrorTableDataNotFound("XCommunicationConfig.GetFunctionalContentsInfoById", "配置表项", TABLE_FUNCTION_INITIATIVE_CONTENTS_PATH, "Id", tostring(id))
end
return FunctionalContentsConfig[id]
end
function XCommunicationConfig.GetFunctionalContentsGroupFirstInfoByGroupId(groupId)
if not FunctionalContentsGroupIdDic[groupId] or not FunctionalContentsGroupIdDic[groupId][1] then
XLog.ErrorTableDataNotFound("XCommunicationConfig.GetFunctionalContentsGroupListByGroupId", "配置表项", TABLE_FUNCTION_INITIATIVE_CONTENTS_PATH, "GroupId", tostring(groupId))
end
return FunctionalContentsGroupIdDic[groupId][1]
end

View file

@ -0,0 +1,145 @@
-- 组合小游戏Config
XComposeGameConfig = XComposeGameConfig or {}
-- ===================表地址====================
local SHARE_TABLE_PATH = "Share/MiniActivity/ComposeGame/"
local CLIENT_TABLE_PATH = "Client/MiniActivity/ComposeGame/"
local TABLE_GAMECONFIGS = SHARE_TABLE_PATH .. "ComposeGame.tab"
local TABLE_GOODS = SHARE_TABLE_PATH .. "ComposeGoods.tab"
local TABLE_CLIENT_CONFIG = CLIENT_TABLE_PATH .. "ComposeClientConfig.tab"
--=================================================
-- ===================原表数据===================
local GameConfigs = {}
local GoodsConfigs = {}
local ClientConfig = {}
--=================================================
-- ================构建搜索用字典================
local GameId2GoodsDic = {}
local GameId2ClientConfigDic = {}
--=================================================
--==================初始化方法======================
--===============
--构建活动ID<-->活动道具列表字典
--===============
local CreateGameId2GoodsDic = function()
for _, good in pairs(GoodsConfigs) do
if not GameId2GoodsDic[good.ActId] then GameId2GoodsDic[good.ActId] = {} end
table.insert(GameId2GoodsDic[good.ActId], good)
end
end
--===============
--构建活动ID<-->活动客户端配置字典
--===============
local CreateGameId2ClientConfigDic = function()
for id, config in pairs(ClientConfig) do
-- 通用配置不进入构建字典
if id > 0 then GameId2ClientConfigDic[config.ActId] = config end
end
end
--===============
--初始化表配置
--===============
function XComposeGameConfig.Init()
GameConfigs = XTableManager.ReadByIntKey(TABLE_GAMECONFIGS, XTable.XTableComposeGame, "Id")
GoodsConfigs = XTableManager.ReadByIntKey(TABLE_GOODS, XTable.XTableComposeGoods, "Id")
ClientConfig = XTableManager.ReadByIntKey(TABLE_CLIENT_CONFIG, XTable.XTableComposeClientConfig, "Id")
CreateGameId2GoodsDic()
CreateGameId2ClientConfigDic()
end
--==================================================
--==================读表方法======================
--===============
--获取所有组合小游戏活动基础配置
--===============
function XComposeGameConfig.GetGameConfigs()
return GameConfigs
end
--===============
--根据Id获取组合小游戏活动基础配置
--@param gameId:活动ID
--===============
function XComposeGameConfig.GetGameConfigsByGameId(gameId)
local config = GameConfigs[gameId]
if not config then
XLog.ErrorTableDataNotFound(
"XComposeGameConfig.GetGameConfigsByGameId",
"组合小游戏活动基础配置数据",
TABLE_GAMECONFIGS,
"Id",
tostring(gameId)
)
return nil
end
return config
end
--===============
--获取所有组合小游戏物品配置
--===============
function XComposeGameConfig.GetGoodsConfigs()
return GoodsConfigs
end
--===============
--根据Id获取组合小游戏物品配置
--@param itemId:物品ID
--===============
function XComposeGameConfig.GetItemConfigByItemId(itemId)
local config = GoodsConfigs[itemId]
if not config then
XLog.ErrorTableDataNotFound(
"XComposeGameConfig.GetItemConfigByItemId",
"组合小游戏物品配置数据",
TABLE_GOODS,
"Id",
tostring(itemId)
)
return nil
end
return config
end
--===============
--根据活动Id获取活动对应的所有物品配置
--@param gameId:活动ID
--===============
function XComposeGameConfig.GetItemListConfigByGameId(gameId)
local itemCfgsList = GameId2GoodsDic[gameId]
if not itemCfgsList then
XLog.ErrorTableDataNotFound(
"XComposeGameConfig.GetItemListConfigByGameId",
"组合小游戏物品配置数据",
TABLE_GOODS,
"ActId",
tostring(gameId)
)
return nil
end
return itemCfgsList
end
--===============
--根据活动ID获取组合小游戏客户端配置(对个别组合小游戏的客户端配置)
--@param gameId:活动ID
--===============
function XComposeGameConfig.GetClientConfigByGameId(gameId)
local config = GameId2ClientConfigDic[gameId]
if not config then
XLog.ErrorTableDataNotFound(
"XComposeGameConfig.GetClientConfigByGameId",
"组合小游戏活动客户端配置",
TABLE_CLIENT_CONFIG,
"ActId",
tostring(gameId)
)
return nil
end
return config
end
--===============
--获取组合小游戏默认客户端配置(全组合小游戏通用配置)
--===============
function XComposeGameConfig.GetDefaultConfig()
return ClientConfig[0]
end
--==================================================

View file

@ -0,0 +1,23 @@
XComposeMiniGameConfig = XComposeMiniGameConfig or {}
-- ===================表地址
local SHARE_TABLE_PATH = "Share/MiniActivity/ComposeGame/"
local CLIENT_TABLE_PATH = "Client/MiniActivity/ComposeGame/"
local TABLE_COMPOSE_GAME = SHARE_TABLE_PATH .. "ComposeGame.tab"
local TABLE_COMPOSE_GOODS = SHARE_TABLE_PATH .. "ComposeGoods.tab"
-- ===================原表数据
local ComposeGameConfig = {}
local ComposeGoodsConfig = {}
--================
--初始化Config
--================
function XComposeMiniGameConfig.Init()
XComposeMiniGameConfig.InitConfig()
end
function XComposeMiniGameConfig.InitConfig()
end

View file

@ -0,0 +1,175 @@
XConfigCenter = XConfigCenter or {}
local IsWindowsEditor = XMain.IsWindowsEditor
local ConfigCenterProfiler = nil
local function InitConfig(config, key)
if IsWindowsEditor then
local profiler = ConfigCenterProfiler:CreateChild(key)
profiler:Start()
-- XPerformance.RecordLuaMemData(key, function()
config.Init()
-- end)
profiler:Stop()
else
config.Init()
end
end
function XConfigCenter.Init()
ConfigCenterProfiler = XGame.Profiler:CreateChild("XConfigCenter")
ConfigCenterProfiler:Start()
InitConfig(XDlcConfig,"XDlcConfig")
-- 新拆分出的Config
InitConfig(XAssistConfig, "XAssistConfig")
InitConfig(XAutoFightConfig, "XAutoFightConfig")
InitConfig(XFubenBossOnlineConfig, "XFubenBossOnlineConfig")
InitConfig(XFubenUrgentEventConfig, "XFubenUrgentEventConfig")
InitConfig(XLoadingConfig, "XLoadingConfig")
InitConfig(XTeamConfig, "XTeamConfig")
InitConfig(XFunctionConfig, "XFunctionConfig")
InitConfig(XAttribConfigs, "XAttribConfigs")
InitConfig(XUiConfigs, "XUiConfigs")
InitConfig(XGuideConfig, "XGuideConfig")
InitConfig(XItemConfigs, "XItemConfigs")
InitConfig(XCharacterConfigs, "XCharacterConfigs")
InitConfig(XSignBoardConfigs, "XSignBoardConfigs")
InitConfig(XEquipConfig, "XEquipConfig")
InitConfig(XComeAcrossConfig, "XComeAcrossConfig")
InitConfig(XFavorabilityConfigs, "XFavorabilityConfigs")
InitConfig(XArenaConfigs, "XArenaConfigs")
InitConfig(XArenaOnlineConfigs, "XArenaOnlineConfigs")
InitConfig(XTrialConfigs, "XTrialConfigs")
InitConfig(XCommunicationConfig, "XCommunicationConfig")
InitConfig(XPrequelConfigs, "XPrequelConfigs")
InitConfig(XTaskConfig, "XTaskConfig")
InitConfig(XFubenConfigs, "XFubenConfigs")
InitConfig(XTaskForceConfigs, "XTaskForceConfigs")
InitConfig(XDrawConfigs, "XDrawConfigs")
InitConfig(XGachaConfigs, "XGachaConfigs")
InitConfig(XFubenMainLineConfigs, "XFubenMainLineConfigs")
InitConfig(XFubenBossSingleConfigs, "XFubenBossSingleConfigs")
InitConfig(XFubenExperimentConfigs, "XFubenExperimentConfigs")
InitConfig(XMailConfigs, "XMailConfigs")
InitConfig(XBfrtConfigs, "XBfrtConfigs")
InitConfig(XBountyTaskConfigs, "XBountyTaskConfigs")
InitConfig(XHostelConfigs, "XHostelConfigs")
InitConfig(XBaseEquipConfigs, "XBaseEquipConfigs")
InitConfig(XFurnitureConfigs, "XFurnitureConfigs")
InitConfig(XPayConfigs, "XPayConfigs")
InitConfig(XFubenExploreConfigs, "XFubenExploreConfigs")
InitConfig(XFubenActivityBranchConfigs, "XFubenActivityBranchConfigs")
InitConfig(XFubenActivityBossSingleConfigs, "XFubenActivityBossSingleConfigs")
InitConfig(XFubenRepeatChallengeConfigs, "XFubenRepeatChallengeConfigs")
InitConfig(XDormConfig, "XDormConfig")
InitConfig(XMovieConfigs, "XMovieConfigs")
InitConfig(XExhibitionConfigs, "XExhibitionConfigs")
InitConfig(XAutoWindowConfigs, "XAutoWindowConfigs")
InitConfig(XPlayerInfoConfigs, "XPlayerInfoConfigs")
InitConfig(XSignInConfigs, "XSignInConfigs")
InitConfig(XReportConfigs, "XReportConfigs")
InitConfig(XPracticeConfigs, "XPracticeConfigs")
InitConfig(XFubenUnionKillConfigs, "XFubenUnionKillConfigs")
InitConfig(XFubenSpecialTrainConfig, "XFubenSpecialTrainConfig")
InitConfig(XShopConfigs, "XShopConfigs")
InitConfig(XHelpCourseConfig, "XHelpCourseConfig")
InitConfig(XMedalConfigs, "XMedalConfigs")
InitConfig(XArchiveConfigs, "XArchiveConfigs")
InitConfig(XGuildConfig, "XGuildConfig")
InitConfig(XFestivalActivityConfig, "XFestivalActivityConfig")
InitConfig(XFubenBabelTowerConfigs, "XFubenBabelTowerConfigs")
InitConfig(XFubenRogueLikeConfig, "XFubenRogueLikeConfig")
InitConfig(XMarketingActivityConfigs, "XMarketingActivityConfigs")
InitConfig(XFubenAssignConfigs, "XFubenAssignConfigs")
InitConfig(XRegressionConfigs, "XRegressionConfigs")
InitConfig(XPlatformShareConfigs, "XPlatformShareConfigs")
InitConfig(XRewardConfigs, "XRewardConfigs")
InitConfig(XMusicPlayerConfigs, "XMusicPlayerConfigs")
InitConfig(XFubenExtraChapterConfigs, "XFubenExtraChapterConfigs")
InitConfig(XDailyDungeonConfigs, "XDailyDungeonConfigs")
InitConfig(XCharacterUiEffectConfig, "XCharacterUiEffectConfig")
InitConfig(XHeadPortraitConfigs, "XHeadPortraitConfigs")
InitConfig(XGuildBossConfig, "XGuildBossConfig")
InitConfig(XEliminateGameConfig, "XEliminateGameConfig")
InitConfig(XWorldBossConfigs, "XWorldBossConfigs")
InitConfig(XMaintainerActionConfigs, "XMaintainerActionConfigs")
InitConfig(XExpeditionConfig, "XExpeditionConfig")
InitConfig(XRpgTowerConfig, "XRpgTowerConfig")
InitConfig(XClickClearGameConfigs, "XClickClearGameConfigs")
InitConfig(XFubenZhouMuConfigs, "XFubenZhouMuConfigs")
InitConfig(XNieRConfigs, "XNieRConfigs")
InitConfig(XMentorSystemConfigs, "XMentorSystemConfigs")
InitConfig(XCollectionWallConfigs, "XCollectionWallConfigs")
InitConfig(XActivityConfigs, "XActivityConfigs")
InitConfig(XPurchaseConfigs, "XPurchaseConfigs")
InitConfig(XActivityBriefConfigs, "XActivityBriefConfigs")
InitConfig(XSetConfigs, "XSetConfigs")
InitConfig(XRedEnvelopeConfigs, "XRedEnvelopeConfigs")
InitConfig(XVideoConfig, "XVideoConfig")
InitConfig(XWeaponFashionConfigs, "XWeaponFashionConfigs")
InitConfig(XFubenInfestorExploreConfigs, "XFubenInfestorExploreConfigs")
InitConfig(XPuzzleActivityConfigs, "XPuzzleActivityConfigs")
InitConfig(XChatConfigs, "XChatConfigs")
InitConfig(XPhotographConfigs, "XPhotographConfigs")
InitConfig(XTRPGConfigs, "XTRPGConfigs")
InitConfig(XPokemonConfigs, "XPokemonConfigs")
InitConfig(XSpringFestivalActivityConfigs, "XSpringFestivalActivityConfigs")
InitConfig(XFubenActivityPuzzleConfigs, "XFubenActivityPuzzleConfigs")
InitConfig(XFubenNewCharConfig, "XFubenNewCharConfig")
InitConfig(XSceneModelConfigs, "XSceneModelConfigs")
InitConfig(XRoomCharFilterTipsConfigs, "XRoomCharFilterTipsConfigs")
InitConfig(XChessPursuitConfig, "XChessPursuitConfig")
InitConfig(XComposeGameConfig, "XComposeGameConfig")
InitConfig(XLottoConfigs, "XLottoConfigs")
InitConfig(XPartnerConfigs, "XPartnerConfigs")
InitConfig(XWhiteValentineConfig, "XWhiteValentineConfig")
InitConfig(XSpecialShopConfigs, "XSpecialShopConfigs")
InitConfig(XFashionConfigs, "XFashionConfigs")
InitConfig(XFingerGuessingConfig, "XFingerGuessingConfig")
InitConfig(XReformConfigs, "XReformConfigs")
InitConfig(XPartnerTeachingConfigs, "XPartnerTeachingConfigs")
InitConfig(XScratchTicketConfig, "XScratchTicketConfig")
InitConfig(XRpgMakerGameConfigs, "XRpgMakerGameConfigs")
InitConfig(XInvertCardGameConfig, "XInvertCardGameConfig")
InitConfig(XMineSweepingConfigs, "XMineSweepingConfigs")
InitConfig(XSuperTowerConfigs, "XSuperTowerConfigs")
InitConfig(XFashionStoryConfigs, "XFashionStoryConfigs")
InitConfig(XPassportConfigs, "XPassportConfigs")
InitConfig(XGuardCampConfig, "XGuardCampConfig")
InitConfig(XFubenSimulatedCombatConfig, "XFubenSimulatedCombatConfig")
InitConfig(XChristmasTreeConfig, "XChristmasTreeConfig")
InitConfig(XCoupletGameConfigs, "XCoupletGameConfigs")
InitConfig(XStrongholdConfigs, "XStrongholdConfigs")
InitConfig(XMoeWarConfig, "XMoeWarConfig")
InitConfig(XMovieAssembleConfig, "XMovieAssembleConfig")
InitConfig(XFubenHackConfig, "XFubenHackConfig")
InitConfig(XFubenCoupleCombatConfig, "XFubenCoupleCombatConfig")
InitConfig(XPokerGuessingConfig, "XPokerGuessingConfig")
InitConfig(XKillZoneConfigs, "XKillZoneConfigs")
InitConfig(XSlotMachineConfigs, "XSlotMachineConfigs")
InitConfig(XReformConfigs, "XReformConfigs");
InitConfig(XPartnerTeachingConfigs, "XPartnerTeachingConfigs");
InitConfig(XScratchTicketConfig, "XScratchTicketConfig");
InitConfig(XRpgMakerGameConfigs, "XRpgMakerGameConfigs");
InitConfig(XInvertCardGameConfig, "XInvertCardGameConfig");
InitConfig(XUiPcConfig, "XUiPcConfig");
XGuardCampConfig.Init()
XFubenSimulatedCombatConfig.Init()
XChristmasTreeConfig.Init()
XCoupletGameConfigs.Init()
XStrongholdConfigs.Init()
XMoeWarConfig.Init()
XMovieAssembleConfig.Init()
XFubenHackConfig.Init()
XFubenCoupleCombatConfig.Init()
XPokerGuessingConfig.Init()
XSlotMachineConfigs.Init()
ConfigCenterProfiler:Stop()
end

View file

@ -0,0 +1,148 @@
local tableInsert = table.insert
XCoupletGameConfigs = XCoupletGameConfigs or {}
XCoupletGameConfigs.CouPletStatus = {
Incomplete = 0,
Complete = 1,
}
XCoupletGameConfigs.PlayVideoState = {
UnPlay = 0,
Played = 1,
}
XCoupletGameConfigs.HitFaceHelpState = {
NotHit = 0,
Hited = 1,
}
XCoupletGameConfigs.HitFaceVideoState = {
UnPlay = 0,
Played = 1,
}
-- XCoupletGameConfigs.COUPLET_GAME_DATA_KEY = "COUPLET_GAME_DATA_KEY" -- 对联游戏本地数据键
XCoupletGameConfigs.COUPLET_GAME_HELP_HIT_KEY = "COUPLET_GAME_HELP_HIT_KEY" -- 对联游戏帮助打脸键
XCoupletGameConfigs.COUPLET_GAME_VIDEO_HIT_KEY = "COUPLET_GAME_VIDEO_HIT_KEY" -- 对联游戏打脸剧情键
XCoupletGameConfigs.PLAY_VIDEO_STATE_KEY = "COUPLET_PLAY_VIDEO_STATE_KEY" -- 剧情播放信息键
local COUPLET_ACTIVITY_BASE_PATH = "Share/MiniActivity/CoupletGame/CoupletActivityBase.tab"
local COUPLET_PATH = "Share/MiniActivity/CoupletGame/Couplet.tab"
local COUPLET_WORD_PATH = "Share/MiniActivity/CoupletGame/CoupletWord.tab"
local ActivityBaseTemplates = {}
local CoupletTemplates = {}
local CoupletTemplatesWithAct = {}
local CoupletWordTemplates = {}
local DownWordArrList = {}
function XCoupletGameConfigs.Init()
ActivityBaseTemplates = XTableManager.ReadByIntKey(COUPLET_ACTIVITY_BASE_PATH, XTable.XTableCoupletActivityBase, "Id")
CoupletTemplates = XTableManager.ReadByIntKey(COUPLET_PATH, XTable.XTableCouplet, "Id")
CoupletWordTemplates = XTableManager.ReadByIntKey(COUPLET_WORD_PATH, XTable.XTabelCoupletWord, "Id")
for _, coupletTemplet in ipairs(CoupletTemplates) do
if coupletTemplet.ActivityId then
if not CoupletTemplatesWithAct[coupletTemplet.ActivityId] then
CoupletTemplatesWithAct[coupletTemplet.ActivityId] = {}
end
end
if CoupletTemplatesWithAct[coupletTemplet.ActivityId] then
tableInsert(CoupletTemplatesWithAct[coupletTemplet.ActivityId], coupletTemplet)
end
end
for _, coupletTemplate in pairs(CoupletTemplates) do
if DownWordArrList[coupletTemplate.Id] == nil then
DownWordArrList[coupletTemplate.Id] = {}
end
local downWordIdStrList = coupletTemplate.DownWordId
for _, downWordIdStr in ipairs(downWordIdStrList) do
local downWordIdArr = string.ToIntArray(downWordIdStr)
tableInsert(DownWordArrList[coupletTemplate.Id], downWordIdArr)
end
end
end
function XCoupletGameConfigs.GetCoupletBaseActivityById(id)
if not ActivityBaseTemplates or not next(ActivityBaseTemplates) or not ActivityBaseTemplates[id] then
return
end
return ActivityBaseTemplates[id]
end
function XCoupletGameConfigs.GetCoupletTemplatesByActId(actId)
if not CoupletTemplatesWithAct or not next(CoupletTemplatesWithAct) or not CoupletTemplatesWithAct[actId] then
return
end
return CoupletTemplatesWithAct[actId]
end
function XCoupletGameConfigs.GetCoupletTemplateById(id)
if not CoupletTemplates or not next(CoupletTemplates) or not CoupletTemplates[id] then
return
end
return CoupletTemplates[id]
end
function XCoupletGameConfigs.GetCoupletWordImageById(wordId)
if not CoupletWordTemplates or not next(CoupletWordTemplates) or not CoupletWordTemplates[wordId] then
return
end
return CoupletWordTemplates[wordId].WordImageUrl
end
function XCoupletGameConfigs.GetCoupletUpWordsId(coupletId)
if not CoupletTemplates or not next(CoupletTemplates) or not CoupletTemplates[coupletId] then
return
end
return CoupletTemplates[coupletId].UpWordId
end
function XCoupletGameConfigs.GetCoupletBatch(coupletId)
if not CoupletTemplates or not CoupletTemplates[coupletId] then
return
end
return CoupletTemplates[coupletId].BatchUrl
end
function XCoupletGameConfigs.GetCoupletDefaultBatch(coupletId)
if not CoupletTemplates or not CoupletTemplates[coupletId] then
return
end
return CoupletTemplates[coupletId].DefaultBatchUrl
end
function XCoupletGameConfigs.GetCoupletUpImgUrl(coupletId)
if not CoupletTemplates or not CoupletTemplates[coupletId] then
return
end
return CoupletTemplates[coupletId].UpImgUrl
end
function XCoupletGameConfigs.GetCoupletDownImgUrl(coupletId)
if not CoupletTemplates or not CoupletTemplates[coupletId] then
return
end
return CoupletTemplates[coupletId].DownImgUrl
end
function XCoupletGameConfigs.GetCoupletDownIdArr(coupletId, Index)
if not DownWordArrList or not DownWordArrList[coupletId] then
return
end
local coupletDownWordArr = DownWordArrList[coupletId]
if coupletDownWordArr and next(coupletDownWordArr) then
return coupletDownWordArr[Index]
end
end

View file

@ -0,0 +1,66 @@
XDailyDungeonConfigs = {}
local TABLE_DAILY_DROP_GROUP = "Client/Fuben/Daily/DailyDropGroup.tab"
local TABLE_DAILT_DUNGEON_RULES = "Share/Fuben/Daily/DailyDungeonRules.tab"
local TABLE_DAILY_DUNGEON_DATA = "Share/Fuben/Daily/DailyDungeonData.tab"
local TABLE_DAILY_SPECOAL_CONDITION = "Share/Fuben/Daily/DailySpecialCondition.tab"
local DailyDungeonRulesTemplates = {}
local DailyDungeonDataTemplates = {}
local DailySpecialConditionTemplates = {}
local DailyDropGroupTemplates = {}
function XDailyDungeonConfigs.Init()
DailyDungeonRulesTemplates = XTableManager.ReadByIntKey(TABLE_DAILT_DUNGEON_RULES, XTable.XTableDailyDungeonRules, "Id")
DailyDungeonDataTemplates = XTableManager.ReadByIntKey(TABLE_DAILY_DUNGEON_DATA, XTable.XTableDailyDungeonData, "Id")
DailySpecialConditionTemplates = XTableManager.ReadByIntKey(TABLE_DAILY_SPECOAL_CONDITION, XTable.XTableDailySpecialCondition, "Id")
DailyDropGroupTemplates = XTableManager.ReadByIntKey(TABLE_DAILY_DROP_GROUP, XTable.XTableDailyDropGroup, "Id")
end
function XDailyDungeonConfigs.GetDailyDungeonRulesList()
return DailyDungeonRulesTemplates
end
function XDailyDungeonConfigs.GetDailyDungeonRulesById(id)
return DailyDungeonRulesTemplates[id]
end
function XDailyDungeonConfigs.GetDailyDungeonDayOfWeek(Id)
local tmpTab = {}
for _, v in pairs(DailyDungeonRulesTemplates[Id].OpenDayOfWeek) do
table.insert(tmpTab, v)
end
return tmpTab
end
function XDailyDungeonConfigs.GetDailyDungeonDataList()
return DailyDungeonDataTemplates
end
function XDailyDungeonConfigs.GetDailyDungeonData(Id)
return DailyDungeonDataTemplates[Id]
end
function XDailyDungeonConfigs.GetDailySpecialConditionList()
return DailySpecialConditionTemplates
end
function XDailyDungeonConfigs.GetDailyDungeonIdByStageId(stageId)
for _, v in pairs(DailyDungeonDataTemplates) do
for _, v2 in pairs(v.StageId) do
if v2 == stageId then
return v.Id
end
end
end
return nil
end
function XDailyDungeonConfigs.GetDailyDropGroupList()
return DailyDropGroupTemplates
end
function XDailyDungeonConfigs.GetFubenDailyShopId(id)
local data = DailyDungeonDataTemplates[id]
return data and data.ShopId
end

View file

@ -0,0 +1,40 @@
XDisplayConfigs = XDisplayConfigs or {}
local tableInsert = table.insert
local TABLE_DISPLAY_PATH = "Client/Display/Display.tab"
local TABLE_CONTENT_PATH = "Client/Display/DisplayContent.tab"
local DisplayTable = {}
local ContentTable = {}
local Groups = {}
function XDisplayConfigs.Init()
DisplayTable = XTableManager.ReadByIntKey(TABLE_DISPLAY_PATH, XTable.XTableDisplay, "Id")
if not DisplayTable then
XLog.Error("XDisplayConfigs.Init 函数错误, 根据键值Id读取表 " .. TABLE_DISPLAY_PATH .. " 的时候出错")
end
ContentTable = XTableManager.ReadByIntKey(TABLE_CONTENT_PATH, XTable.XTableDisplayContent, "Id")
for _, tab in pairs(DisplayTable) do
local group = Groups[tab.Model]
if not group then
group = { Ids = {}, Weights = {} }
Groups[tab.Model] = group
end
tableInsert(group.Ids, tab.Id)
tableInsert(group.Weights, tab.Weight)
end
end
function XDisplayConfigs.GetDisplayTable()
return DisplayTable
end
function XDisplayConfigs.GetContentTable()
return ContentTable
end
function XDisplayConfigs.GetGroups()
return Groups
end

View file

@ -0,0 +1,48 @@
local TABLE_DLC_DESC_PATH = "Client/DlcRes/DlcDesc.tab"
local TABLE_DLC_STAGE_PATH = "Client/DlcRes/DlcStage.tab"
local TABLE_DLC_FUNC_PATH = "Client/DlcRes/DlcFunc.tab"
local DlcDescConfig = {}
local DlcStageConfig = {}
local DlcFuncConfig = {}
local StageToDlcIdDic = {}
local FuncToDlcIdDic = {}
XDlcConfig = XDlcConfig or {}
function XDlcConfig.Init()
--XLog.Error("XDlcConfig init")
DlcDescConfig = XTableManager.ReadByIntKey(TABLE_DLC_DESC_PATH, XTable.XTableDlcDesc, "DlcId")
DlcStageConfig = XTableManager.ReadByIntKey(TABLE_DLC_STAGE_PATH, XTable.XTableDlcStage, "DlcId")
DlcFuncConfig = XTableManager.ReadByIntKey(TABLE_DLC_FUNC_PATH, XTable.XTableDlcFunc, "DlcId")
for k,v in pairs(DlcStageConfig) do
--XLog.Error("DlcStageConfig["..k.."] = " .. v)
for k2,v2 in ipairs(v.StageIds) do
StageToDlcIdDic[v2] = k
--XLog.Error("StageToDlcIdDic["..v2.."] = " .. k)
end
end
for k,v in pairs(DlcFuncConfig) do
--XLog.Error("DlcFuncConfig["..k.."] = " .. v)
for k2,v2 in ipairs(v.FuncIds) do
FuncToDlcIdDic[v2] = k
--XLog.Error("FuncToDlcIdDic["..v2.."] = " .. k)
end
end
end
function XDlcConfig.StageToDlcId(stageId)
return StageToDlcIdDic[stageId]
end
function XDlcConfig.FuncToDlcId(funcId)
return FuncToDlcIdDic[funcId]
end
XDlcConfig.DlcDescConfig = DlcDescConfig
XDlcConfig.StageToDlcIdDic = StageToDlcIdDic
XDlcConfig.FuncToDlcIdDic = FuncToDlcIdDic

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,259 @@
local table = table
local tableInsert = table.insert
XDrawConfigs = XDrawConfigs or {}
XDrawConfigs.CombinationsTypes = {
Normal = 1,
Aim = 2,
NewUp = 3,
Furniture = 4,
CharacterUp = 5,
EquipSuit = 6,
}
XDrawConfigs.DrawSetType = {
Normal = 1,
Destiny = 2,
}
XDrawConfigs.RareRank = {
A = 1,
S = 2,
}
XDrawConfigs.RuleType = {
Tab = 0,
Normal = 1,
Lotto = 2,
}
XDrawConfigs.GroupType = {
Normal = 1,
Destiny = 2,
}
---
--- 卡池可掉落的奖励类型
XDrawConfigs.DrawCapacityCheckType =
{
Partner = 1 -- 伙伴
}
local TABLE_DRAW_PREVIEW = "Client/Draw/DrawPreview.tab"
local TABLE_DRAW_PREVIEW_GOODS = "Client/Draw/DrawPreviewGoods.tab"
local TABLE_DRAW_COMBINATIONS = "Client/Draw/DrawCombinations.tab"
local TABLE_DRAW_PROB = "Client/Draw/DrawProbShow.tab"
local TABLE_GROUP_RULE = "Client/Draw/DrawGroupRule.tab"
local TABLE_AIMPROBABILITY = "Client/Draw/DrawAimProbability.tab"
local TABLE_DRAW_SHOW = "Client/Draw/DrawShow.tab"
local TABLE_DRAW_NEWYEARSHOW = "Client/Draw/JPDrawNewYearShow.tab"
local TABLE_DRAW_CAMERA = "Client/Draw/DrawCamera.tab"
local TABLE_DRAW_TABS = "Client/Draw/DrawTabs.tab"
local TABLE_DRAW_SHOW_CHARACTER = "Client/Draw/DrawShowCharacter.tab"
local TABLE_DRAW_TYPE_CHANGE = "Client/Draw/DrawTypeChange.tab"
local TABLE_DRAW_SHOW_EFFECT = "Client/Draw/DrawShowEffect.tab"
local TABLE_DRAW_GROUP_RELATION = "Client/Draw/DrawGroupRelation.tab"
local TABLE_DRAW_SKIP = "Client/Draw/DrawSkip.tab"
local DrawPreviews = {}
local DrawCombinations = {}
local DrawProbs = {}
local DrawGroupRule = {}
local DrawAimProbability = {}
local DrawShow = {}
local DrawShowEffect = {}
local DrawCamera = {}
local DrawTabs = {}
local DrawShowCharacter = {}
local DrawTypeChangeCfg = {}
local DrawSubGroupDic = {}
local DrawGroupRelationCfg = {}
local DrawGroupRelationDic = {}
local DrawSkipCfg = {}
local DrawNewYearShow = {}
function XDrawConfigs.Init()
DrawCombinations = XTableManager.ReadByIntKey(TABLE_DRAW_COMBINATIONS, XTable.XTableDrawCombinations, "Id")
DrawGroupRule = XTableManager.ReadByIntKey(TABLE_GROUP_RULE, XTable.XTableDrawGroupRule, "Id")
DrawShow = XTableManager.ReadByIntKey(TABLE_DRAW_SHOW, XTable.XTableDrawShow, "Type")
DrawCamera = XTableManager.ReadByIntKey(TABLE_DRAW_CAMERA, XTable.XTableDrawCamera, "Id")
DrawTabs = XTableManager.ReadByIntKey(TABLE_DRAW_TABS, XTable.XTableDrawTabs, "Id")
DrawShowCharacter = XTableManager.ReadByIntKey(TABLE_DRAW_SHOW_CHARACTER, XTable.XTableDrawShowCharacter, "Id")
DrawAimProbability = XTableManager.ReadByIntKey(TABLE_AIMPROBABILITY, XTable.XTableDrawAimProbability, "Id")
DrawTypeChangeCfg = XTableManager.ReadByIntKey(TABLE_DRAW_TYPE_CHANGE, XTable.XTableDrawTypeChange, "MainGroupId")
DrawShowEffect = XTableManager.ReadByIntKey(TABLE_DRAW_SHOW_EFFECT, XTable.XTableDrawShowEffect, "EffectGroupId")
DrawGroupRelationCfg = XTableManager.ReadByIntKey(TABLE_DRAW_GROUP_RELATION, XTable.XTableDrawGroupRelation, "NormalGroupId")
DrawSkipCfg = XTableManager.ReadByIntKey(TABLE_DRAW_SKIP, XTable.XTableDrawSkip, "DrawGroupId")
DrawNewYearShow = XTableManager.ReadByIntKey(TABLE_DRAW_NEWYEARSHOW, XTable.XTableDrawNewYearActivityShow, "Type")
local previews = XTableManager.ReadByIntKey(TABLE_DRAW_PREVIEW, XTable.XTableDrawPreview, "Id")
local previewGoods = XTableManager.ReadByIntKey(TABLE_DRAW_PREVIEW_GOODS, XTable.XTableRewardGoods, "Id")
for drawId, preview in pairs(previews) do
local upGoodsIds = preview.UpGoodsId
local upGoods = {}
for i = 1, #upGoodsIds do
tableInsert(upGoods, XRewardManager.CreateRewardGoodsByTemplate(previewGoods[upGoodsIds[i]]))
end
local goodsIds = preview.GoodsId
local goods = {}
for i = 1, #goodsIds do
tableInsert(goods, XRewardManager.CreateRewardGoodsByTemplate(previewGoods[goodsIds[i]]))
end
local drawPreview = {}
drawPreview.UpGoods = upGoods
drawPreview.Goods = goods
DrawPreviews[drawId] = drawPreview
end
local drawProbList = XTableManager.ReadByIntKey(TABLE_DRAW_PROB, XTable.XTableDrawProbShow, "Id")
for _, v in pairs(drawProbList) do
if not DrawProbs[v.DrawId] then
DrawProbs[v.DrawId] = {}
end
tableInsert(DrawProbs[v.DrawId], v)
end
XDrawConfigs.SetDrawSubGroupDic()
XDrawConfigs.SetGroupRelationDic()
end
function XDrawConfigs.SetDrawSubGroupDic()
for _,typeChangeGroup in pairs(DrawTypeChangeCfg or {}) do
for _,subGroupId in pairs(typeChangeGroup.SubGroupId or {}) do
if not DrawSubGroupDic[subGroupId] then
DrawSubGroupDic[subGroupId] = typeChangeGroup.MainGroupId
end
end
end
end
function XDrawConfigs.SetGroupRelationDic()
DrawGroupRelationDic = {}
for _,data in pairs (DrawGroupRelationCfg)do
if not DrawGroupRelationDic[data.NormalGroupId] then
DrawGroupRelationDic[data.NormalGroupId] = data.DestinyGroupId
else
XLog.Error("Can Not Use Same GroupId for NormalGroupId .GroupId:"..data.NormalGroupId)
end
if not DrawGroupRelationDic[data.DestinyGroupId] then
DrawGroupRelationDic[data.DestinyGroupId] = data.NormalGroupId
else
XLog.Error("Can Not Use Same GroupId for DestinyGroupId .GroupId:"..data.DestinyGroupId)
end
end
end
function XDrawConfigs.GetDrawGroupRelationDic()
return DrawGroupRelationDic
end
function XDrawConfigs.GetDrawCombinations()
return DrawCombinations
end
function XDrawConfigs.GetDrawGroupRule()
return DrawGroupRule
end
function XDrawConfigs.GetDrawAimProbability()
return DrawAimProbability
end
function XDrawConfigs.GetDrawShow()
return DrawShow
end
function XDrawConfigs.GetDrawNewYearShow()
return DrawNewYearShow
end
---
--- 获取'drawGroupId'卡组的跳转ID数组
function XDrawConfigs.GetDrawSkipList(drawGroupId)
if DrawSkipCfg[drawGroupId] then
return DrawSkipCfg[drawGroupId].SkipId
end
return {}
end
function XDrawConfigs.GetDrawShowCharacter()
return DrawShowCharacter
end
function XDrawConfigs.GetDrawCamera()
return DrawCamera
end
function XDrawConfigs.GetDrawTabs()
return DrawTabs
end
function XDrawConfigs.GetDrawPreviews()
return DrawPreviews
end
function XDrawConfigs.GetDrawProbs()
return DrawProbs
end
function XDrawConfigs.GetDrawTypeChangeCfg()
return DrawTypeChangeCfg
end
function XDrawConfigs.GetDrawGroupRelationCfg()
return DrawGroupRelationCfg
end
function XDrawConfigs.GetDrawTypeChangeCfgById(id)
return DrawTypeChangeCfg[id]
end
function XDrawConfigs.GetDrawSubGroupDic()
return DrawSubGroupDic
end
function XDrawConfigs.GetDrawTabById(id)
if not DrawTabs[id] then
XLog.Error("Client/Draw/DrawTabs.tab Id = " .. id .. " Is Null")
end
return DrawTabs[id]
end
function XDrawConfigs.GetDrawGroupRuleById(id)
if not DrawGroupRule[id] then
XLog.Error("Client/Draw/DrawGroupRule.tab Id = " .. id .. " Is Null")
end
return DrawGroupRule[id]
end
function XDrawConfigs.GetDrawShowEffectById(id)
if not DrawShowEffect[id] then
XLog.Error("Client/Draw/DrawShowEffect.tab Id = " .. id .. " Is Null")
end
return DrawShowEffect[id]
end
function XDrawConfigs.GetOpenUpEffect(id)
return XDrawConfigs.GetDrawShowEffectById(id).PanelOpenUp
end
function XDrawConfigs.GetOpenDownEffect(id)
return XDrawConfigs.GetDrawShowEffectById(id).PanelOpenDown
end
function XDrawConfigs.GetCardShowOffEffect(id)
return XDrawConfigs.GetDrawShowEffectById(id).PanelCardShowOff
end
function XDrawConfigs.GetOpenBoxEffect(id)
return XDrawConfigs.GetDrawShowEffectById(id).EffectOpenBox
end
function XDrawConfigs.GetSkipEffect(id)
return XDrawConfigs.GetDrawShowEffectById(id).SkipEffect
end

View file

@ -0,0 +1,90 @@
XEliminateGameConfig = XEliminateGameConfig or {}
local TABLE_ELIMINATEGAME_GAME = "Share/EliminateGame/EliminateGame.tab"
local TABLE_ELIMINATEGAME_GRID = "Share/EliminateGame/EliminateGrid.tab"
local TABLE_ELIMINATEGAME_REWARD = "Share/EliminateGame/EliminateReward.tab"
local TABLE_ELIMINATEGAME_GRID_TYPE = "Share/EliminateGame/EliminateGridType.tab"
local EliminateGameConfig = {}
local EliminateGridConfig = {}
local EliminateRewardConfig = {}
local EliminateGridTypeConfig = {}
function XEliminateGameConfig.Init()
EliminateGameConfig = XTableManager.ReadByIntKey(TABLE_ELIMINATEGAME_GAME, XTable.XTableEliminateGame, "Id")
EliminateGridConfig = XTableManager.ReadByIntKey(TABLE_ELIMINATEGAME_GRID, XTable.XTableEliminateGrid, "Id")
EliminateRewardConfig = XTableManager.ReadByIntKey(TABLE_ELIMINATEGAME_REWARD, XTable.XTableEliminateReward, "Id")
EliminateGridTypeConfig = XTableManager.ReadByIntKey(TABLE_ELIMINATEGAME_GRID_TYPE, XTable.XTableEliminateGridType, "Id")
end
--获取消除游戏
function XEliminateGameConfig.GetEliminateGame(id)
if not EliminateGameConfig or not EliminateGameConfig[id] then
XLog.ErrorTableDataNotFound("XEliminateGameConfig.GetEliminateGame", "Id", TABLE_ELIMINATEGAME_GAME, "id", tostring(id))
return nil
end
return EliminateGameConfig[id]
end
--获取消除游戏格子
function XEliminateGameConfig.GetEliminateGameGrid(id)
if not EliminateGridConfig or not EliminateGridConfig[id] then
XLog.ErrorTableDataNotFound("XEliminateGameConfig.GetEliminateGameGrid", "Id", TABLE_ELIMINATEGAME_GRID, "id", tostring(id))
return nil
end
return EliminateGridConfig[id]
end
--获取消除游戏奖励
function XEliminateGameConfig.GetEliminateGameReward(id)
if not EliminateRewardConfig or not EliminateRewardConfig[id] then
XLog.ErrorTableDataNotFound("XEliminateGameConfig.GetEliminateGameReward", "Id", TABLE_ELIMINATEGAME_REWARD, "id", tostring(id))
return nil
end
return EliminateRewardConfig[id]
end
--获取格子
function XEliminateGameConfig.GetEliminateGameGridByType(typeId)
if not EliminateGridTypeConfig then
XLog.ErrorTableDataNotFound("XEliminateGameConfig.GetEliminateGameGridByType", "Id", TABLE_ELIMINATEGAME_GRID_TYPE, "typeId", tostring(typeId))
return nil
end
for i, v in pairs(EliminateGridTypeConfig) do
if v.Type == typeId then
return v
end
end
return nil
end
-- --获取格子
-- function XEliminateGameConfig.GetEliminateGameGridById(id)
-- if not EliminateGridTypeConfig or not EliminateGridTypeConfig[id] then
-- XLog.ErrorTableDataNotFound("XEliminateGameConfig.GetEliminateGameGridById", "Id", TABLE_ELIMINATEGAME_GRID_TYPE, "id", tostring(id))
-- return nil
-- end
-- return EliminateGridTypeConfig[id]
-- end
--获取消除游戏奖励
function XEliminateGameConfig.GetEliminateGameRewardByGameId(id)
local rewards = {}
for _, v in pairs(EliminateRewardConfig) do
if v.GameId == id then
table.insert(rewards, v)
end
end
return rewards
end

View file

@ -0,0 +1,957 @@
local tableInsert = table.insert
XEquipConfig = XEquipConfig or {}
XEquipConfig.MAX_STAR_COUNT = 6 -- 最大星星数
XEquipConfig.MAX_SUIT_SKILL_COUNT = 3 -- 最大套装激活技能个数
XEquipConfig.MAX_RESONANCE_SKILL_COUNT = 3 -- 最大共鸣属性/技能个数
XEquipConfig.MIN_RESONANCE_EQUIP_STAR_COUNT = 5 -- 装备共鸣最低星级
XEquipConfig.MAX_SUIT_COUNT = 6 -- 套装最大数量
XEquipConfig.DEFAULT_SUIT_ID = { -- 用来显示全部套装数量的默认套装Id
Normal = 1, --构造体
Isomer = 2, --感染体
}
XEquipConfig.CAN_NOT_AUTO_EAT_STAR = 5 -- 大于等于该星级的装备不会被当做默认狗粮选中
XEquipConfig.AWAKE_SKILL_COUNT = 2 -- 觉醒技能数量
--武器类型
XEquipConfig.EquipType = {
Universal = 0, -- 通用
Suncha = 1, -- 双枪
Sickle = 2, -- 太刀
Mount = 3, -- 挂载
Arrow = 4, -- 弓箭
Chainsaw = 5, -- 电锯
Sword = 6, -- 大剑
Hcan = 7, -- 巨炮
DoubleSwords = 8, -- 双短刀
sickle = 9, --镰刀
IsomerSword = 10, -- 感染者专用大剑
Food = 99, -- 狗粮
}
XEquipConfig.UserType = {
All = 0, --通用
Normal = 1, --构造体
Isomer = 2, --异构体/感染体
}
XEquipConfig.AddAttrType = {
Numeric = 1, -- 数值
Rate = 2, -- 基础属性的百分比
Promoted = 3, -- 等级加成
}
XEquipConfig.UserType = {
All = 0, --通用
Normal = 1, --构造体
Isomer = 2, --异构体/感染体
}
--要显示的属性排序
XEquipConfig.AttrSortType = {
XNpcAttribType.Life,
XNpcAttribType.AttackNormal,
XNpcAttribType.DefenseNormal,
XNpcAttribType.Crit,
}
XEquipConfig.EquipSite = {
Weapon = 0, -- 武器
Awareness = { -- 意识
One = 1, -- 1号位
Two = 2, -- 2号位
Three = 3, -- 3号位
Four = 4, -- 4号位
Five = 5, -- 5号位
Six = 6, -- 6号位
},
}
XEquipConfig.AwarenessSiteToStr = {
[XEquipConfig.EquipSite.Awareness.One] = CS.XTextManager.GetText("AwarenessSiteOne"),
[XEquipConfig.EquipSite.Awareness.Two] = CS.XTextManager.GetText("AwarenessSiteTwo"),
[XEquipConfig.EquipSite.Awareness.Three] = CS.XTextManager.GetText("AwarenessSiteThree"),
[XEquipConfig.EquipSite.Awareness.Four] = CS.XTextManager.GetText("AwarenessSiteFour"),
[XEquipConfig.EquipSite.Awareness.Five] = CS.XTextManager.GetText("AwarenessSiteFive"),
[XEquipConfig.EquipSite.Awareness.Six] = CS.XTextManager.GetText("AwarenessSiteSix"),
}
XEquipConfig.Classify = {
Weapon = 1, -- 武器
Awareness = 2, -- 意识
}
XEquipConfig.EquipResonanceType = {
Attrib = 1, -- 属性共鸣
CharacterSkill = 2, -- 角色技能共鸣
WeaponSkill = 3, -- 武器技能共鸣
}
--排序优先级选项
XEquipConfig.PriorSortType = {
Star = 0, -- 星级
Breakthrough = 1, -- 突破次数
Level = 2, -- 等级
Proceed = 3, -- 入手顺序
}
-- 武器部位
XEquipConfig.WeaponCase = {
Case1 = 1,
Case2 = 2,
Case3 = 3,
--[[支持继续扩展
Case4 = 4,
...
]]
}
-- 狗粮类型
XEquipConfig.EatType = {
Equip = 0,
Item = 1,
}
-- 武器模型用途
XEquipConfig.WeaponUsage = {
Role = 1, -- ui角色身上
Battle = 2, -- 战斗
Show = 3, -- ui单独展示
}
-- 装备详情UI页签
XEquipConfig.EquipDetailBtnTabIndex = {
Detail = 1,
Strengthen = 2,
Resonance = 3,
}
--武器超频界面页签状态
XEquipConfig.EquipAwakeTabIndex = {
Material = 1,
CrystalMoney = 2,
}
-- 共鸣后武器显示延时时间
XEquipConfig.WeaponResonanceShowDelay = CS.XGame.ClientConfig:GetInt("WeaponResonanceShowDelay")
-- 分解数量溢出提示文本
XEquipConfig.DecomposeRewardOverLimitTip = {
[XEquipConfig.Classify.Weapon] = CS.XTextManager.GetText("WeaponBoxWillBeFull"),
[XEquipConfig.Classify.Awareness] = CS.XTextManager.GetText("WaferBoxWillBeFull"),
}
local EquipBreakThroughIcon = {
[0] = CS.XGame.ClientConfig:GetString("EquipBreakThrough0"),
[1] = CS.XGame.ClientConfig:GetString("EquipBreakThrough1"),
[2] = CS.XGame.ClientConfig:GetString("EquipBreakThrough2"),
[3] = CS.XGame.ClientConfig:GetString("EquipBreakThrough3"),
[4] = CS.XGame.ClientConfig:GetString("EquipBreakThrough4"),
}
local EquipBreakThroughSmallIcon = {
[1] = CS.XGame.ClientConfig:GetString("EquipBreakThroughSmall1"),
[2] = CS.XGame.ClientConfig:GetString("EquipBreakThroughSmall2"),
[3] = CS.XGame.ClientConfig:GetString("EquipBreakThroughSmall3"),
[4] = CS.XGame.ClientConfig:GetString("EquipBreakThroughSmall4"),
}
local EquipBreakThroughBigIcon = {
[0] = CS.XGame.ClientConfig:GetString("EquipBreakThroughBig0"),
[1] = CS.XGame.ClientConfig:GetString("EquipBreakThroughBig1"),
[2] = CS.XGame.ClientConfig:GetString("EquipBreakThroughBig2"),
[3] = CS.XGame.ClientConfig:GetString("EquipBreakThroughBig3"),
[4] = CS.XGame.ClientConfig:GetString("EquipBreakThroughBig4"),
}
-- 共鸣图标(觉醒后图标变更)
local EquipResonanceIconPath = {
[true] = CS.XGame.ClientConfig:GetString("EquipAwakenIcon"),
[false] = CS.XGame.ClientConfig:GetString("EquipResonanceIcon"),
}
local TABLE_EQUIP_PATH = "Share/Equip/Equip.tab"
local TABLE_EQUIP_BREAKTHROUGH_PATH = "Share/Equip/EquipBreakThrough.tab"
local TABLE_EQUIP_SUIT_PATH = "Share/Equip/EquipSuit.tab"
local TABLE_EQUIP_SUIT_EFFECT_PATH = "Share/Equip/EquipSuitEffect.tab"
local TABLE_LEVEL_UP_TEMPLATE_PATH = "Share/Equip/LevelUpTemplate/"
local TABLE_EQUIP_DECOMPOSE_PATH = "Share/Equip/EquipDecompose.tab"
local TABLE_EAT_EQUIP_COST_PATH = "Share/Equip/EatEquipCost.tab"
local TABLE_EQUIP_RESONANCE_PATH = "Share/Equip/EquipResonance.tab"
local TABLE_EQUIP_RESONANCE_CONSUME_ITEM_PATH = "Share/Equip/EquipResonanceUseItem.tab"
local TABLE_WEAPON_SKILL_PATH = "Share/Equip/WeaponSkill.tab"
local TABLE_WEAPON_SKILL_POOL_PATH = "Share/Equip/WeaponSkillPool.tab"
local TABLE_EQUIP_AWAKE_PATH = "Share/Equip/EquipAwake.tab"
local TABLE_EQUIP_RES_PATH = "Client/Equip/EquipRes.tab"
local TABLE_EQUIP_MODEL_PATH = "Client/Equip/EquipModel.tab"
local TABLE_EQUIP_MODEL_TRANSFORM_PATH = "Client/Equip/EquipModelTransform.tab"
local TABLE_EQUIP_SKIPID_PATH = "Client/Equip/EquipSkipId.tab"
local TABLE_EQUIP_ANIM_PATH = "Client/Equip/EquipAnim.tab"
local MAX_WEAPON_COUNT -- 武器拥有最大数量
local MAX_AWARENESS_COUNT -- 意识拥有最大数量
local EQUIP_EXP_INHERIT_PRECENT -- 强化时的经验继承百分比
local EQUIP_RECYCLE_ITEM_PERCENT -- 回收获得道具数量百分比
local MIN_RESONANCE_BIND_STAR -- 只有6星以上的意识才可以共鸣出绑定角色的技能
local MIN_AWAKE_STAR -- 最低可觉醒星数
local EquipTemplates = {} -- 装备配置
local EquipBreakthroughTemplate = {} -- 突破配置
local EquipResonanceTemplate = {} -- 共鸣配置
local EquipResonanceConsumeItemTemplates = {} -- 共鸣消耗物品配置
local LevelUpTemplates = {} -- 升级模板
local EquipSuitTemplate = {} -- 套装技能表
local EquipSuitEffectTemplate = {} -- 套装效果表
local WeaponSkillTemplate = {} -- 武器技能配置
local WeaponSkillPoolTemplate = {} -- 武器技能池(共鸣用)配置
local EatEquipCostTemplate = {} -- 装备强化消耗配置
local EquipResTemplates = {} -- 装备资源配置
local EquipModelTemplates = {} -- 武器模型配置
local EquipModelTransformTemplates = {} -- 武器模型UI偏移配置
local EquipSkipIdTemplates = {} -- 装备来源跳转ID配置
local EquipAwakeTemplate = {} -- 觉醒配置
local EquipAnimTemplates = {} -- 动画配置
local EquipBorderDic = {} -- 装备边界属性构造字典
local EquipDecomposeDic = {}
local SuitIdToEquipTemplateIdsDic = {} -- 套装Id索引的装备Id字典
local SuitSitesDic = {} -- 套装产出部位字典
--记录超频界面的页签状态
local EquipAwakeTabIndex = XEquipConfig.EquipAwakeTabIndex.Material
local CompareBreakthrough = function(templateId, breakthrough)
local template = EquipBorderDic[templateId]
if not template then
return
end
if not template.MaxBreakthrough or template.MaxBreakthrough < breakthrough then
template.MaxBreakthrough = breakthrough
end
end
local CheckEquipBorderConfig = function()
for k, v in pairs(EquipBorderDic) do
local template = EquipBorderDic[k]
template.MinLevel = 1
local equipBreakthroughCfg = XEquipConfig.GetEquipBreakthroughCfg(k, v.MaxBreakthrough)
template.MaxLevel = equipBreakthroughCfg.LevelLimit
template.MinBreakthrough = 0
end
end
local InitEquipBreakthroughConfig = function()
local tab = XTableManager.ReadByIntKey(TABLE_EQUIP_BREAKTHROUGH_PATH, XTable.XTableEquipBreakthrough, "Id")
for _, config in pairs(tab) do
if not EquipBreakthroughTemplate[config.EquipId] then
EquipBreakthroughTemplate[config.EquipId] = {}
end
if config.AttribPromotedId == 0 then
XLog.ErrorTableDataNotFound("InitEquipBreakthroughConfig", "EquipBreakthroughTemplate",
TABLE_EQUIP_BREAKTHROUGH_PATH, "config.EquipId", tostring(config.EquipId))
end
EquipBreakthroughTemplate[config.EquipId][config.Times] = config
CompareBreakthrough(config.EquipId, config.Times)
end
end
local InitEquipLevelConfig = function()
local paths = CS.XTableManager.GetPaths(TABLE_LEVEL_UP_TEMPLATE_PATH)
XTool.LoopCollection(paths, function(path)
local key = tonumber(XTool.GetFileNameWithoutExtension(path))
LevelUpTemplates[key] = XTableManager.ReadByIntKey(path, XTable.XTableEquipLevelUp, "Level")
end)
end
local InitWeaponSkillPoolConfig = function()
local tab = XTableManager.ReadByIntKey(TABLE_WEAPON_SKILL_POOL_PATH, XTable.XTableWeaponSkillPool, "Id")
for _, config in pairs(tab) do
WeaponSkillPoolTemplate[config.PoolId] = WeaponSkillPoolTemplate[config.PoolId] or {}
WeaponSkillPoolTemplate[config.PoolId][config.CharacterId] = WeaponSkillPoolTemplate[config.PoolId][config.CharacterId] or {}
for i, skillId in ipairs(config.SkillId) do
tableInsert(WeaponSkillPoolTemplate[config.PoolId][config.CharacterId], skillId)
end
end
end
local InitEquipModelTransformConfig = function()
local tab = XTableManager.ReadByIntKey(TABLE_EQUIP_MODEL_TRANSFORM_PATH, XTable.XTableEquipModelTransform, "Id")
for id, config in pairs(tab) do
local indexId = config.IndexId
if not indexId then
XLog.ErrorTableDataNotFound("InitEquipModelTransformConfig", "tab", TABLE_EQUIP_MODEL_TRANSFORM_PATH, "id", tostring(id))
end
EquipModelTransformTemplates[indexId] = EquipModelTransformTemplates[indexId] or {}
local uiName = config.UiName
if not uiName then
XLog.ErrorTableDataNotFound("InitEquipModelTransformConfig", "配置表中UiName字段", TABLE_EQUIP_MODEL_TRANSFORM_PATH, "id", tostring(id))
end
EquipModelTransformTemplates[indexId][uiName] = config
end
end
local InitEquipSkipIdConfig = function()
local tab = XTableManager.ReadByIntKey(TABLE_EQUIP_SKIPID_PATH, XTable.XTableEquipSkipId, "Id")
for id, config in pairs(tab) do
local eatType = config.EatType
EquipSkipIdTemplates[eatType] = EquipSkipIdTemplates[eatType] or {}
local site = config.Site
if not site then
XLog.ErrorTableDataNotFound("InitEquipSkipIdConfig", "配置表中Site字段", TABLE_EQUIP_SKIPID_PATH, "id", tostring(id))
end
EquipSkipIdTemplates[eatType][site] = config
end
end
local InitEquipSuitConfig = function()
EquipSuitTemplate = XTableManager.ReadByIntKey(TABLE_EQUIP_SUIT_PATH, XTable.XTableEquipSuit, "Id")
EquipSuitEffectTemplate = XTableManager.ReadByIntKey(TABLE_EQUIP_SUIT_EFFECT_PATH, XTable.XTableEquipSuitEffect, "Id")
end
function XEquipConfig.Init()
MAX_WEAPON_COUNT = CS.XGame.Config:GetInt("EquipWeaponMaxCount")
MAX_AWARENESS_COUNT = CS.XGame.Config:GetInt("EquipChipMaxCount")
EQUIP_EXP_INHERIT_PRECENT = CS.XGame.Config:GetInt("EquipExpInheritPercent")
EQUIP_RECYCLE_ITEM_PERCENT = CS.XGame.Config:GetInt("EquipRecycleItemPercent")
MIN_RESONANCE_BIND_STAR = CS.XGame.Config:GetInt("MinResonanceBindStar")
MIN_AWAKE_STAR = CS.XGame.Config:GetInt("MinEquipAwakeStar")
EquipTemplates = CS.XNpcManager.EquipTemplateTable
EquipResTemplates = XTableManager.ReadByIntKey(TABLE_EQUIP_RES_PATH, XTable.XTableEquipRes, "Id")
EquipAwakeTemplate = XTableManager.ReadByIntKey(TABLE_EQUIP_AWAKE_PATH, XTable.XTableEquipAwake, "Id")
XTool.LoopMap(EquipTemplates, function(id, equipCfg)
EquipBorderDic[id] = {}
local suitId = equipCfg.SuitId
if suitId and suitId > 0 then
SuitIdToEquipTemplateIdsDic[suitId] = SuitIdToEquipTemplateIdsDic[suitId] or {}
tableInsert(SuitIdToEquipTemplateIdsDic[suitId], id)
SuitSitesDic[suitId] = SuitSitesDic[suitId] or {}
SuitSitesDic[suitId][equipCfg.Site] = true
end
end)
InitEquipSuitConfig()
InitEquipBreakthroughConfig()
InitEquipLevelConfig()
InitWeaponSkillPoolConfig()
InitEquipModelTransformConfig()
InitEquipSkipIdConfig()
CheckEquipBorderConfig()
EquipBorderDic = XReadOnlyTable.Create(EquipBorderDic)
WeaponSkillTemplate = XTableManager.ReadByIntKey(TABLE_WEAPON_SKILL_PATH, XTable.XTableWeaponSkill, "Id")
EquipResonanceTemplate = XTableManager.ReadByIntKey(TABLE_EQUIP_RESONANCE_PATH, XTable.XTableEquipResonance, "Id")
EquipResonanceConsumeItemTemplates = XTableManager.ReadByIntKey(TABLE_EQUIP_RESONANCE_CONSUME_ITEM_PATH, XTable.XTableEquipResonanceUseItem, "Id")
EquipModelTemplates = XTableManager.ReadByIntKey(TABLE_EQUIP_MODEL_PATH, XTable.XTableEquipModel, "Id")
EquipAnimTemplates = XTableManager.ReadByStringKey(TABLE_EQUIP_ANIM_PATH, XTable.XTableEquipAnim, "ModelId")
local decomposetab = XTableManager.ReadByIntKey(TABLE_EQUIP_DECOMPOSE_PATH, XTable.XTableEquipDecompose, "Id")
for _, v in pairs(decomposetab) do
EquipDecomposeDic[v.Site .. v.Star .. v.Breakthrough] = v
end
local eatCostTab = XTableManager.ReadByIntKey(TABLE_EAT_EQUIP_COST_PATH, XTable.XTableEatEquipCost, "Id")
for _, v in pairs(eatCostTab) do
EatEquipCostTemplate[v.Site .. v.Star] = v.UseMoney
end
end
function XEquipConfig.GetMaxWeaponCount()
return MAX_WEAPON_COUNT
end
function XEquipConfig.GetMaxAwarenessCount()
return MAX_AWARENESS_COUNT
end
function XEquipConfig.GetEquipExpInheritPercent()
return EQUIP_EXP_INHERIT_PRECENT
end
function XEquipConfig.GetEquipRecycleItemId()
return XDataCenter.ItemManager.ItemId.EquipRecycleItemId
end
function XEquipConfig.GetEquipRecycleItemPercent()
return EQUIP_RECYCLE_ITEM_PERCENT / 100
end
function XEquipConfig.GetMinResonanceBindStar()
return MIN_RESONANCE_BIND_STAR
end
function XEquipConfig.GetMinAwakeStar()
return MIN_AWAKE_STAR
end
function XEquipConfig.GetEquipCfg(templateId)
local equipCfg = nil
if EquipTemplates:ContainsKey(templateId) then
equipCfg = EquipTemplates[templateId]
end
if not equipCfg then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipCfg", "equipCfg", TABLE_EQUIP_PATH, "templateId", tostring(templateId))
return
end
return equipCfg
end
--todo 道具很多地方没有检查ID类型就调用了临时处理下
function XEquipConfig.CheckTemplateIdIsEquip(templateId)
local equipCfg = nil
if EquipTemplates:ContainsKey(templateId) then
equipCfg = EquipTemplates[templateId]
end
return templateId and equipCfg
end
function XEquipConfig.GetEatEquipCostMoney(site, star)
if not site then
XLog.Error("XEquipConfig.GetEatEquipCostMoney函数参数错误site不能为空")
return
end
if not star then
XLog.Error("XEquipConfig.GetEatEquipCostMoney函数参数错误star不能为空")
return
end
return EatEquipCostTemplate[site .. star]
end
function XEquipConfig.GetEquipBorderCfg(templateId)
local template = EquipBorderDic[templateId]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipBorderCfg", "template", TABLE_EQUIP_PATH, "templateId", tostring(templateId))
return
end
return template
end
function XEquipConfig.GetEquipBreakthroughCfg(templateId, times)
local template = EquipBreakthroughTemplate[templateId]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipBreakthroughCfg", "template",
TABLE_EQUIP_BREAKTHROUGH_PATH, "templateId", tostring(templateId))
return
end
template = template[times]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipBreakthroughCfg", "template",
TABLE_EQUIP_BREAKTHROUGH_PATH, "templateId : times", tostring(templateId) .. " : " .. tostring(times))
return
end
return template
end
function XEquipConfig.GetEquipResCfg(templateId, breakthroughTimes)
breakthroughTimes = breakthroughTimes or 0
local breakthroughCfg = XEquipConfig.GetEquipBreakthroughCfg(templateId, breakthroughTimes)
local resId = breakthroughCfg.ResId
if not resId then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipResCfg", "resId",
TABLE_EQUIP_BREAKTHROUGH_PATH, "templateId : times", tostring(templateId) .. " : " .. tostring(breakthroughTimes))
return
end
local template = EquipResTemplates[resId]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipResCfg", "template", TABLE_EQUIP_RES_PATH, "resId", tostring(resId))
return
end
return template
end
--=========== EquipModel接口(begin) ===========
function XEquipConfig.GetEquipModelName(modelTransId, usage)
local template = EquipModelTemplates[modelTransId]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipModelName", "template", TABLE_EQUIP_MODEL_PATH, "modelTransId", tostring(modelTransId))
return
end
usage = usage or XEquipConfig.WeaponUsage.Role
return template.ModelName[usage] or template.ModelName[XEquipConfig.WeaponUsage.Role]
end
function XEquipConfig.GetEquipAnimController(modelTransId, usage)
local template = EquipModelTemplates[modelTransId]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipAnimController", "template", TABLE_EQUIP_MODEL_PATH, "modelTransId", tostring(modelTransId))
return
end
usage = usage or XEquipConfig.WeaponUsage.Role
local controller = template.AnimController[usage]
if not controller and usage ~= XEquipConfig.WeaponUsage.Show then -- 单独展示不需默认值
controller = template.AnimController[XEquipConfig.WeaponUsage.Role]
end
return controller
end
function XEquipConfig.GetEquipUiAnimStateName(modelTransId, usage)
local template = EquipModelTemplates[modelTransId]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipUiAnimStateName", "template", TABLE_EQUIP_MODEL_PATH, "modelTransId", tostring(modelTransId))
return
end
usage = usage or XEquipConfig.WeaponUsage.Role
return template.UiAnimStateName[usage] or template.UiAnimStateName[XEquipConfig.WeaponUsage.Role]
end
function XEquipConfig.GetEquipUiAnimCueId(modelTransId, usage)
local template = EquipModelTemplates[modelTransId]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipUiAnimCueId", "template", TABLE_EQUIP_MODEL_PATH, "modelTransId", tostring(modelTransId))
return
end
usage = usage or XEquipConfig.WeaponUsage.Role
return template.UiAnimCueId[usage] or template.UiAnimCueId[XEquipConfig.WeaponUsage.Role]
end
function XEquipConfig.GetEquipUiAnimDelay(modelTransId, usage)
local template = EquipModelTemplates[modelTransId]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipUiAnimDelay", "template", TABLE_EQUIP_MODEL_PATH, "modelTransId", tostring(modelTransId))
return
end
usage = usage or XEquipConfig.WeaponUsage.Role
return template.UiAnimDelay[usage] or template.UiAnimDelay[XEquipConfig.WeaponUsage.Role]
end
function XEquipConfig.GetEquipUiAutoRotateDelay(modelTransId, usage)
local template = EquipModelTemplates[modelTransId]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipUiAutoRotateDelay", "template", TABLE_EQUIP_MODEL_PATH, "modelTransId", tostring(modelTransId))
return
end
usage = usage or XEquipConfig.WeaponUsage.Show -- 默认ui展示
return template.UiAutoRotateDelay[usage] or template.UiAutoRotateDelay[XEquipConfig.WeaponUsage.Role]
end
function XEquipConfig.GetEquipModelEffectPath(modelTransId, usage)
local template = EquipModelTemplates[modelTransId]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipModelEffectPath", "template", TABLE_EQUIP_MODEL_PATH, "modelTransId", tostring(modelTransId))
return
end
usage = usage or XEquipConfig.WeaponUsage.Role
return template.ResonanceEffectPath[usage] or template.ResonanceEffectPath[XEquipConfig.WeaponUsage.Role]
end
--=========== EquipModel接口(end) ===========
function XEquipConfig.GetEquipAnimParams(roleModelId)
local template = EquipAnimTemplates[roleModelId]
if not template then
return 0
end
return template.Params or 0
end
function XEquipConfig.GetWeaponResonanceModelId(case, templateId, resonanceCount)
local modelId
local template = EquipResTemplates[templateId]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetWeaponResonanceModelId", "template", TABLE_EQUIP_RES_PATH, "templateId", tostring(templateId))
return
end
if resonanceCount == 1 then
modelId = template.ResonanceModelTransId1[case]
elseif resonanceCount == 2 then
modelId = template.ResonanceModelTransId2[case]
elseif resonanceCount == 3 then
modelId = template.ResonanceModelTransId3[case]
end
return modelId or template.ModelTransId[case]
end
function XEquipConfig.GetWeaponResonanceEffectDelay(modelTransId)
local template = EquipModelTemplates[modelTransId]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetWeaponResonanceEffectDelay",
"template", TABLE_EQUIP_MODEL_PATH, "modelTransId", tostring(modelTransId))
return
end
return template.ResonanceEffectShowDelay[XEquipConfig.WeaponUsage.Show] or 0
end
--返回武器模型和位置配置(双枪只返回一把)
function XEquipConfig.GetEquipModelTransformCfg(templateId, uiName, resonanceCount, modelTransId, equipType)
local modelCfg, template
--尝试用ModelTransId索引
if not modelTransId then
modelTransId = XEquipConfig.GetWeaponResonanceModelId(XEquipConfig.WeaponCase.Case1, templateId, resonanceCount)
if not modelTransId then
XLog.ErrorTableDataNotFound("XEquipConfig.GetWeaponResonanceModelId",
"template", TABLE_EQUIP_RES_PATH, "templateId", tostring(templateId))
return
end
end
template = EquipModelTransformTemplates[modelTransId]
if template then
modelCfg = template[uiName]
end
--读不到配置时用equipType索引
if not modelCfg then
if not equipType then
local equipCfg = XEquipConfig.GetEquipCfg(templateId)
equipType = equipCfg.Type
end
template = EquipModelTransformTemplates[equipType]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipModelTransformCfg",
"template", TABLE_EQUIP_MODEL_TRANSFORM_PATH, "equipType", tostring(equipType))
return
end
modelCfg = template[uiName]
if not modelCfg then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipModelTransformCfg",
"uiName", TABLE_EQUIP_MODEL_TRANSFORM_PATH, "equipType", tostring(equipType))
return
end
end
return modelCfg
end
-- 获取一个武器所有的不同的模型列表
function XEquipConfig.GetWeaponModelCfgList(templateId, uiName, breakthroughTimes)
local modelCfgList = {}
if not templateId then
XLog.Error("XEquipManager.GetWeaponModelCfgList函数参数错误, templateId不能为空")
return modelCfgList
end
local template = XEquipConfig.GetEquipResCfg(templateId, breakthroughTimes)
-- 目前只有共鸣改变形态有可能有相同的模型所以需要区别是否有相同的id以左手id为准
local resonanceCountList = {}
local resonanceDic = {}
local modelId
for i = 0, XEquipConfig.MAX_RESONANCE_SKILL_COUNT do
modelId = XEquipConfig.GetWeaponResonanceModelId(XEquipConfig.WeaponCase.Case1, template.Id, i)
if modelId and not resonanceDic[modelId] then
resonanceDic[modelId] = true
table.insert(resonanceCountList, i)
end
end
local modelCfg
for _, resonanceCount in ipairs(resonanceCountList) do
modelCfg = {}
modelCfg.ModelId = XEquipConfig.GetWeaponResonanceModelId(XEquipConfig.WeaponCase.Case1, template.Id, resonanceCount)
modelCfg.TransformConfig = XEquipConfig.GetEquipModelTransformCfg(templateId, uiName, resonanceCount)
table.insert(modelCfgList, modelCfg)
end
return modelCfgList
end
function XEquipConfig.GetLevelUpCfg(templateId, times, level)
local breakthroughCfg = XEquipConfig.GetEquipBreakthroughCfg(templateId, times)
if not breakthroughCfg then
return
end
templateId = breakthroughCfg.LevelUpTemplateId
local template = LevelUpTemplates[templateId]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetLevelUpCfg", "template", TABLE_LEVEL_UP_TEMPLATE_PATH, "templateId", tostring(templateId))
return
end
template = template[level]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetLevelUpCfg", "level", TABLE_LEVEL_UP_TEMPLATE_PATH, "templateId", tostring(templateId))
return
end
return template
end
function XEquipConfig.GetEquipSuitCfg(templateId)
local template = EquipSuitTemplate[templateId]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipSuitCfg", "template", TABLE_EQUIP_SUIT_PATH, "templateId", tostring(templateId))
return
end
return template
end
function XEquipConfig.GetEquipSuitEffectCfg(templateId)
local template = EquipSuitEffectTemplate[templateId]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipSuitEffectCfg", "template",
TABLE_EQUIP_SUIT_EFFECT_PATH, "templateId", tostring(templateId))
return
end
return template
end
function XEquipConfig.GetEquipTemplateIdsBySuitId(suitId)
return SuitIdToEquipTemplateIdsDic[suitId] or {}
end
function XEquipConfig.GetSuitSites(suitId)
return SuitSitesDic[suitId] or {}
end
function XEquipConfig.GetMaxSuitCount()
return XTool.GetTableCount(SuitSitesDic)
end
function XEquipConfig.GetEquipBgPath(templateId)
if not XEquipConfig.CheckTemplateIdIsEquip(templateId) then return end
local template = XEquipConfig.GetEquipCfg(templateId)
local quality = template.Quality
return XArrangeConfigs.GeQualityBgPath(quality)
end
function XEquipConfig.GetEquipQualityPath(templateId)
local template = XEquipConfig.GetEquipCfg(templateId)
local quality = template.Quality
if not quality then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipQualityPath", "Quality", TABLE_EQUIP_PATH, "templateId", tostring(templateId))
return
end
return XArrangeConfigs.GeQualityPath(quality)
end
function XEquipConfig.GetEquipResoanceIconPath(isAwaken)
return EquipResonanceIconPath[isAwaken]
end
function XEquipConfig.GetEquipDecomposeCfg(templateId, breakthroughTimes)
if not XEquipConfig.CheckTemplateIdIsEquip(templateId) then return end
breakthroughTimes = breakthroughTimes or 0
local template = XEquipConfig.GetEquipCfg(templateId)
local site = template.Site
if not site then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipDecomposeCfg", "Site", TABLE_EQUIP_PATH, "templateId", tostring(templateId))
return
end
local star = template.Star
if not star then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipDecomposeCfg", "Star", TABLE_EQUIP_PATH, "templateId", tostring(templateId))
return
end
return EquipDecomposeDic[site .. star .. breakthroughTimes]
end
function XEquipConfig.GetWeaponTypeIconPath(templateId)
return XGoodsCommonManager.GetGoodsShowParamsByTemplateId(templateId).Icon
end
function XEquipConfig.GetEquipBreakThroughIcon(breakthroughTimes)
local icon = EquipBreakThroughIcon[breakthroughTimes]
if not icon then
XLog.Error("XEquipConfig.EquipBreakThroughIcon调用错误得到的icon为空原因检查breakthroughTimes" .. breakthroughTimes .. "和EquipBreakThroughIcon")
return
end
return icon
end
function XEquipConfig.GetEquipBreakThroughSmallIcon(breakthroughTimes)
local icon = EquipBreakThroughSmallIcon[breakthroughTimes]
if not icon then
XLog.Error("XEquipConfig.GetEquipBreakThroughSmallIcon调用错误得到的icon为空原因检查breakthroughTimes" .. breakthroughTimes .. "和EquipBreakThroughSmallIcon")
return
end
return icon
end
function XEquipConfig.GetEquipBreakThroughBigIcon(breakthroughTimes)
local icon = EquipBreakThroughBigIcon[breakthroughTimes]
if not icon then
XLog.Error("XEquipConfig.GetEquipBreakThroughBigIcon调用错误得到的icon为空原因检查breakthroughTimes" .. breakthroughTimes .. "和EquipBreakThroughBigIcon")
return
end
return icon
end
function XEquipConfig.GetWeaponSkillTemplate(templateId)
local template = WeaponSkillTemplate[templateId]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetWeaponSkillTemplate", "template", TABLE_WEAPON_SKILL_PATH, "templateId", tostring(templateId))
return
end
return template
end
function XEquipConfig.GetWeaponSkillInfo(weaponSkillId)
local template = WeaponSkillTemplate[weaponSkillId]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetWeaponSkillInfo", "template", TABLE_WEAPON_SKILL_PATH, "weaponSkillId", tostring(weaponSkillId))
return
end
return template
end
function XEquipConfig.GetWeaponSkillAbility(weaponSkillId)
local template = WeaponSkillTemplate[weaponSkillId]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetWeaponSkillAbility", "template",
TABLE_WEAPON_SKILL_PATH, "weaponSkillId", tostring(weaponSkillId))
return
end
return template.Ability
end
function XEquipConfig.GetWeaponSkillPoolSkillIds(poolId, characterId)
local template = WeaponSkillPoolTemplate[poolId]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetWeaponSkillPoolSkillIds", "template", TABLE_WEAPON_SKILL_POOL_PATH, "poolId", tostring(poolId))
return
end
local skillIds = template[characterId]
if not skillIds then
XLog.ErrorTableDataNotFound("XEquipConfig.GetWeaponSkillPoolSkillIds",
"characterId", TABLE_WEAPON_SKILL_POOL_PATH, "poolId", tostring(poolId))
return
end
return skillIds
end
function XEquipConfig.GetEquipSkipIdTemplate(eatType, site)
local template = EquipSkipIdTemplates[eatType][site]
if not template then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipSkipIdTemplate", "site", TABLE_WEAPON_SKILL_POOL_PATH, "eatType", tostring(eatType))
return
end
return template
end
function XEquipConfig.GetEquipResonanceCfg(templateId)
local equipResonanceCfg = EquipResonanceTemplate[templateId]
if not equipResonanceCfg then
return
end
return equipResonanceCfg
end
function XEquipConfig.GetEquipCharacterType(templateId)
local config = XEquipConfig.GetEquipCfg(templateId)
return config.CharacterType
end
function XEquipConfig.GetEquipResonanceConsumeItemCfg(templateId)
local equipResonanceItemCfg = EquipResonanceConsumeItemTemplates[templateId]
if not equipResonanceItemCfg then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipResonanceConsumeItemCfg",
"equipResonanceItemCfg", TABLE_EQUIP_RESONANCE_CONSUME_ITEM_PATH, "templateId", tostring(templateId))
return
end
return equipResonanceItemCfg
end
function XEquipConfig.GetNeedFirstShow(templateId)
local template = XEquipConfig.GetEquipCfg(templateId)
return template.NeedFirstShow
end
function XEquipConfig.GetEquipTemplates()
return EquipTemplates
end
function XEquipConfig.GetEquipAwakeCfg(templateId)
local equipAwakeCfg = EquipAwakeTemplate[templateId]
if not equipAwakeCfg then
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipAwakeCfg", "equipAwakeCfg", TABLE_EQUIP_AWAKE_PATH, "templateId", tostring(templateId))
return
end
return equipAwakeCfg
end
function XEquipConfig.GetEquipAwakeCfgs()
return EquipAwakeTemplate
end
function XEquipConfig.GetEquipAwakeSkillDesList(templateId, pos)
local equipAwakeCfg = XEquipConfig.GetEquipAwakeCfg(templateId)
local desList = equipAwakeCfg["AttribDes" .. pos]
if not desList then
local tempStr = "AttribDes" .. pos
XLog.ErrorTableDataNotFound("XEquipConfig.GetEquipAwakeSkillDesList", tempStr, TABLE_EQUIP_AWAKE_PATH, "templateId", tostring(templateId))
return
end
return desList
end
function XEquipConfig.GetEquipSuitPath()
return TABLE_EQUIP_SUIT_PATH
end
function XEquipConfig.GetEquipPath()
return TABLE_EQUIP_PATH
end
function XEquipConfig.GetWeaponSkillPath()
return TABLE_WEAPON_SKILL_PATH
end
function XEquipConfig.IsDefaultSuitId(suitId)
return suitId == XEquipConfig.DEFAULT_SUIT_ID.Normal or suitId == XEquipConfig.DEFAULT_SUIT_ID.Isomer
end
function XEquipConfig.GetDefaultSuitIdCount()
local count = 0
for _, _ in pairs(XEquipConfig.DEFAULT_SUIT_ID) do
count = count + 1
end
return count
end
function XEquipConfig.GetEquipAwakeTabIndex()
return EquipAwakeTabIndex
end
function XEquipConfig.SetEquipAwakeTabIndex(equipAwakeTabIndex)
EquipAwakeTabIndex = equipAwakeTabIndex
end

View file

@ -0,0 +1,182 @@
XExhibitionConfigs = XExhibitionConfigs or {}
local TABLE_CHARACTER_EXHIBITION = "Client/Exhibition/Exhibition.tab"
local TABLE_CHARACTER_EXHIBITION_LEVEL = "Client/Exhibition/ExhibitionLevel.tab"
local TABLE_CHARACTER_GROW_TASK_INFO = "Share/Exhibition/ExhibitionReward.tab"
local DefaultPortraitImagePath = CS.XGame.ClientConfig:GetString("DefaultPortraitImagePath")
local ExhibitionLevelPoint = {}
local ExhibitionConfig = {}
local ExhibitionGroupNameConfig = {}
local ExhibitionGroupLogoConfig = {}
local ExhibitionGroupDescConfig = {}
local CharacterExhibitionLevelConfig = {}
local GrowUpTasksConfig = {}
local CharacterGrowUpTasksConfig = {}
local CharacterGrowUpTasksConfigByType = {}
local CharacterHeadPortrait = {}
local CharacterGraduationPortrait = {}
local ExhibitionConfigByTypeAndPort = {}
local ExhibitionConfigByTypeAndGroup = {}
local CharacterToExhibitionTypeTable = {}
local InVisibleGroupTable = {}
function XExhibitionConfigs.Init()
CharacterExhibitionLevelConfig = XTableManager.ReadByIntKey(TABLE_CHARACTER_EXHIBITION_LEVEL, XTable.XTableExhibitionLevel, "LevelId")
ExhibitionConfig = XTableManager.ReadByIntKey(TABLE_CHARACTER_EXHIBITION, XTable.XTableCharacterExhibition, "Id")
for _, v in pairs(ExhibitionConfig) do
if v.Port ~= nil then
CharacterHeadPortrait[v.CharacterId] = v.HeadPortrait
CharacterGraduationPortrait[v.CharacterId] = v.GraduationPortrait
ExhibitionGroupNameConfig[v.GroupId] = v.GroupName
ExhibitionGroupLogoConfig[v.GroupId] = v.GroupLogo
ExhibitionGroupDescConfig[v.GroupId] = v.GroupDescription
if v.Type and not ExhibitionConfigByTypeAndPort[v.Type] then
ExhibitionConfigByTypeAndPort[v.Type] = {}
ExhibitionConfigByTypeAndGroup[v.Type] = {}
end
ExhibitionConfigByTypeAndPort[v.Type][v.Port] = v
ExhibitionConfigByTypeAndGroup[v.Type][v.GroupId] = v
if v.Type then
if not InVisibleGroupTable[v.Type] then InVisibleGroupTable[v.Type] = {} end
if InVisibleGroupTable[v.Type][v.GroupId] == nil then InVisibleGroupTable[v.Type][v.GroupId] = true end
if v.InVisible == 1 then InVisibleGroupTable[v.Type][v.GroupId] = false end
end
end
if v.CharacterId and v.CharacterId ~= 0 and not CharacterToExhibitionTypeTable[v.CharacterId] then
CharacterToExhibitionTypeTable[v.CharacterId] = v.Type
end
end
GrowUpTasksConfig = XTableManager.ReadByIntKey(TABLE_CHARACTER_GROW_TASK_INFO, XTable.XTableExhibitionReward, "Id")
for task, v in pairs(GrowUpTasksConfig) do
if CharacterGrowUpTasksConfig[v.CharacterId] == nil then
CharacterGrowUpTasksConfig[v.CharacterId] = {}
end
CharacterGrowUpTasksConfig[v.CharacterId][task] = v
local type = CharacterToExhibitionTypeTable[v.CharacterId] or 1
if not CharacterGrowUpTasksConfigByType[type] then CharacterGrowUpTasksConfigByType[type] = {} end
if not CharacterGrowUpTasksConfigByType[type][v.Id] then
CharacterGrowUpTasksConfigByType[type][v.Id] = v
end
end
ExhibitionLevelPoint[1] = CS.XGame.ClientConfig:GetInt("ExhibitionLevelPoint_01")
ExhibitionLevelPoint[2] = CS.XGame.ClientConfig:GetInt("ExhibitionLevelPoint_02")
ExhibitionLevelPoint[3] = CS.XGame.ClientConfig:GetInt("ExhibitionLevelPoint_03")
ExhibitionLevelPoint[4] = CS.XGame.ClientConfig:GetInt("ExhibitionLevelPoint_04")
end
function XExhibitionConfigs.GetDefaultPortraitImagePath()
return DefaultPortraitImagePath
end
function XExhibitionConfigs.GetExhibitionLevelPoints()
return ExhibitionLevelPoint
end
function XExhibitionConfigs.GetGrowUpLevelMax()
local maxPoint = 0
for i = 1, 4 do
maxPoint = maxPoint + ExhibitionLevelPoint[i]
end
return maxPoint
end
function XExhibitionConfigs.GetExhibitionConfig()
return ExhibitionConfig
end
function XExhibitionConfigs.GetExhibitionPortConfigByType(showType)
if not showType then return ExhibitionConfig end
return ExhibitionConfigByTypeAndPort[showType] or {}
end
function XExhibitionConfigs.GetExhibitionGroupNameConfig()
return ExhibitionGroupNameConfig
end
function XExhibitionConfigs.GetExhibitionGroupConfigByType(showType)
if not showType then return ExhibitionConfig end
return ExhibitionConfigByTypeAndGroup[showType] or {}
end
function XExhibitionConfigs.GetExhibitionConfigByTypeAndGroup(showType, groupId)
return ExhibitionConfigByTypeAndGroup[showType][groupId]
end
function XExhibitionConfigs.GetExhibitionTypeByCharacterId(characterId)
return CharacterToExhibitionTypeTable[characterId]
end
function XExhibitionConfigs.GetExhibitionGroupLogoConfig()
return ExhibitionGroupLogoConfig
end
function XExhibitionConfigs.GetExhibitionGroupDescConfig()
return ExhibitionGroupDescConfig
end
function XExhibitionConfigs.GetExhibitionInVisbleGroupTable(exhibitionType)
return InVisibleGroupTable[exhibitionType] or {}
end
function XExhibitionConfigs.GetIsExhibitionInVisbleGroup(exhibitionType, groupId)
return InVisibleGroupTable[exhibitionType] and InVisibleGroupTable[exhibitionType][groupId] or false
end
function XExhibitionConfigs.GetExhibitionLevelConfig()
return CharacterExhibitionLevelConfig
end
function XExhibitionConfigs.GetCharacterGrowUpTasks(characterId)
local config = CharacterGrowUpTasksConfig[characterId]
if not config then
XLog.Error("XExhibitionConfigs.GetCharacterGrowUpTasks error: 角色解放配置错误characterId: " .. characterId .. " ,path: " .. TABLE_CHARACTER_GROW_TASK_INFO)
return
end
return config
end
function XExhibitionConfigs.GetCharacterGrowUpTask(characterId, level)
local levelTasks = XExhibitionConfigs.GetCharacterGrowUpTasks(characterId)
for _, config in pairs(levelTasks) do
if config.LevelId == level then
return config
end
end
end
function XExhibitionConfigs.GetCharacterGrowUpTasksConfig()
return CharacterGrowUpTasksConfig
end
function XExhibitionConfigs.GetExhibitionGrowUpLevelConfig(level)
return CharacterExhibitionLevelConfig[level]
end
function XExhibitionConfigs.GetExhibitionLevelNameByLevel(level)
return CharacterExhibitionLevelConfig[level].Name or ""
end
function XExhibitionConfigs.GetExhibitionLevelDescByLevel(level)
return CharacterExhibitionLevelConfig[level].Desc or ""
end
function XExhibitionConfigs.GetExhibitionLevelIconByLevel(level)
return CharacterExhibitionLevelConfig[level].LevelIcon or ""
end
function XExhibitionConfigs.GetCharacterHeadPortrait(characterId)
return CharacterHeadPortrait[characterId]
end
function XExhibitionConfigs.GetCharacterGraduationPortrait(characterId)
return CharacterGraduationPortrait[characterId]
end
function XExhibitionConfigs.GetGrowUpTasksConfig()
return GrowUpTasksConfig
end
function XExhibitionConfigs.GetGrowUpTasksConfigByType(exhibitionType)
if not exhibitionType then return GrowUpTasksConfig end
return CharacterGrowUpTasksConfigByType[exhibitionType] or {}
end

View file

@ -0,0 +1,374 @@
XExpeditionConfig = XExpeditionConfig or {}
--基础角色表
local TABLE_EXPEDITION_BASE_CHARACTER = "Share/Fuben/Expedition/ExpeditionBaseCharacter.tab"
--角色表
local TABLE_EXPEDITION_CHARACTER = "Share/Fuben/Expedition/ExpeditionCharacter.tab"
--远征章节表
local TABLE_EXPEDITION_CHAPTER = "Share/Fuben/Expedition/ExpeditionChapter.tab"
--远征关卡表
local TABLE_EXPEDITION_STAGE = "Share/Fuben/Expedition/ExpeditionStage.tab"
--玩法配置
local TABLE_EXPEDITION_CONFIG = "Share/Fuben/Expedition/ExpeditionConfig.tab"
--角色基础组合羁绊表
local TABLE_EXPEDITION_COMBO = "Share/Fuben/Expedition/ExpeditionCombo.tab"
--角色组合羁绊子分类表
local TABLE_EXPEDITION_CHILDCOMBO = "Share/Fuben/Expedition/ExpeditionChildCombo.tab"
--角色分类展示表
local TABLE_EXPEDITION_CHARACTER_TYPE = "Share/Fuben/Expedition/ExpeditionCharacterType.tab"
--角色阶级升级表
local TABLE_EXPEDITION_CHARACTER_ELEMENTS = "Client/Fuben/Expedition/ExpeditionCharacterElements.tab"
--羁绊大类表
local TABLE_EXPEDITION_COMBO_TYPENAME = "Client/Fuben/Expedition/ExpeditionComboTypeName.tab"
--螺母购买刷新次数表
local TABLE_EXPEDITION_DRAW_CONSUME = "Share/Fuben/Expedition/ExpeditionDrawConsume.tab"
--全局增益羁绊
local TABLE_EXPEDITION_GLOBAL_COMBO = "Client/Fuben/Expedition/ExpeditionGlobalCombo.tab"
--队伍位置表
local TABLE_EXPEDITION_TEAMPOS = "Share/Fuben/Expedition/ExpeditionTeamPos.tab"
--招募概率表
local TABLE_EXPEDITION_DRAWPR = "Share/Fuben/Expedition/ExpeditionDrawPR.tab"
--招募概率星数对照表
local TABLE_EXPEDITION_DRAWRANK = "Share/Fuben/Expedition/ExpeditionDrawRank.tab"
local BaseConfig = {}
local ChildComboConfig = {}
local ComboConfig = {}
local CharacterTypeConfig = {}
local CharacterConfig = {}
local CharacterElements = {}
local BaseCharacterConfig = {}
local ChapterConfig = {}
local EStageConfig = {}
local ComboTypeNameConfig = {}
local DrawConsumeConfig = {}
local GlobalComboConfig = {}
local TeamPosConfig = {}
local DrawPRConfig = {}
local DrawRankConfig = {}
local Type2CharacterDic = {}
local Rank2CharacterDic = {}
local Chapter2StageDic = {}
local Chapter2ConfigDic = {}
local Chapter2TeamPosDic = {}
local NewBaseConfigIndex = 0
local BaseComboStatus = {} -- 废弃
local BaseComboDic = {}
local StageToEStageDic = {}
local ComboConditionList = {
[1] = "MemberNum", -- 检查合计数量
[2] = "TotalRank", -- 检查合计等级
[3] = "TargetMember", -- 检查对应角色等级
[4] = "TargetTypeAndRank", -- 检查指定特征的高于指定等级的人
}
local InitConfig = function()
BaseConfig = XTableManager.ReadByIntKey(TABLE_EXPEDITION_CONFIG, XTable.XTableExpeditionConfig, "Id")
ComboConfig = XTableManager.ReadByIntKey(TABLE_EXPEDITION_COMBO, XTable.XTableExpeditionCombo, "Id")
ChildComboConfig = XTableManager.ReadByIntKey(TABLE_EXPEDITION_CHILDCOMBO, XTable.XTableExpeditionChildCombo, "Id")
ChapterConfig = XTableManager.ReadByIntKey(TABLE_EXPEDITION_CHAPTER, XTable.XTableExpeditionChapter, "Id")
EStageConfig = XTableManager.ReadByIntKey(TABLE_EXPEDITION_STAGE, XTable.XTableExpeditionStage, "Id")
BaseCharacterConfig = XTableManager.ReadByIntKey(TABLE_EXPEDITION_BASE_CHARACTER, XTable.XTableExpeditionBaseCharacter, "Id")
CharacterConfig = XTableManager.ReadByIntKey(TABLE_EXPEDITION_CHARACTER, XTable.XTableExpeditionCharacter, "Id")
CharacterTypeConfig = XTableManager.ReadByStringKey(TABLE_EXPEDITION_CHARACTER_TYPE, XTable.XTableExpeditionCharacterType, "Id")
ComboTypeNameConfig = XTableManager.ReadByIntKey(TABLE_EXPEDITION_COMBO_TYPENAME, XTable.XTableExpeditionComboTypeName, "Id")
DrawConsumeConfig = XTableManager.ReadByIntKey(TABLE_EXPEDITION_DRAW_CONSUME, XTable.XTableExpeditionDrawConsume, "Id")
GlobalComboConfig = XTableManager.ReadByIntKey(TABLE_EXPEDITION_GLOBAL_COMBO, XTable.XTableExpeditionGlobalCombo, "Id")
CharacterElements = XTableManager.ReadByIntKey(TABLE_EXPEDITION_CHARACTER_ELEMENTS, XTable.XTableExpeditionCharacterElements, "Id")
TeamPosConfig = XTableManager.ReadByIntKey(TABLE_EXPEDITION_TEAMPOS, XTable.XTableExpeditionTeamPos, "Id")
DrawPRConfig = XTableManager.ReadByIntKey(TABLE_EXPEDITION_DRAWPR, XTable.XTableExpeditionDrawPR, "Level")
DrawRankConfig = XTableManager.ReadByIntKey(TABLE_EXPEDITION_DRAWRANK, XTable.XTableExpeditionDrawRank, "Id")
end
local GetNewBaseConfigId = function()
local startTime = 0
for id, config in pairs(BaseConfig) do
if id > NewBaseConfigIndex then NewBaseConfigIndex = id end
end
end
local InitComboConfig = function()
for i = 1, #ComboConfig do
if not BaseComboDic[ComboConfig[i].ChildComboId] then
BaseComboDic[ComboConfig[i].ChildComboId] = {}
end
table.insert(BaseComboDic[ComboConfig[i].ChildComboId], ComboConfig[i])
end
end
local InitStages = function()
for _, eStage in pairs(EStageConfig) do
if not Chapter2StageDic[eStage.ChapterId] then Chapter2StageDic[eStage.ChapterId] = {} end
Chapter2StageDic[eStage.ChapterId][eStage.OrderId] = eStage
if not StageToEStageDic[eStage.StageId] then
StageToEStageDic[eStage.StageId] = eStage
end
end
end
local InitCharacter = function()
for _, v in pairs(BaseCharacterConfig) do
for _, type in pairs(v.Type) do
if not Type2CharacterDic[type] then Type2CharacterDic[type] = {} end
if not Type2CharacterDic[type][v.Id] then Type2CharacterDic[type][v.Id] = 1 end
end
Rank2CharacterDic[v.Id] = {}
end
end
local InitRank2CharacterDic = function()
for _, v in pairs(CharacterConfig) do
Rank2CharacterDic[v.BaseId][v.Rank] = v
if not Rank2CharacterDic[v.BaseId].MaxRank or Rank2CharacterDic[v.BaseId].MaxRank < v.Rank then
Rank2CharacterDic[v.BaseId].MaxRank = v.Rank
end
end
end
local InitChapter2TeamPosDic = function()
for _, v in pairs(TeamPosConfig) do
if not Chapter2TeamPosDic[v.ChapterId] then Chapter2TeamPosDic[v.ChapterId] = {} end
table.insert(Chapter2TeamPosDic[v.ChapterId], v)
end
end
function XExpeditionConfig.Init()
InitConfig()
GetNewBaseConfigId()
InitStages()
InitCharacter()
InitRank2CharacterDic()
InitComboConfig()
InitChapter2TeamPosDic()
end
function XExpeditionConfig.GetExpeditionConfig()
return BaseConfig
end
function XExpeditionConfig.GetExpeditionConfigById(Id)
return BaseConfig[Id] or BaseConfig[NewBaseConfigIndex]
end
function XExpeditionConfig.GetLastestExpeditionConfig()
return BaseConfig[NewBaseConfigIndex]
end
function XExpeditionConfig.GetEChapterCfg()
return ChapterConfig
end
function XExpeditionConfig.GetChapterCfgById(chapterId)
if not ChapterConfig[chapterId] then
XLog.ErrorTableDataNotFound("XExpeditionConfig.GetChapterCfgById", "虚像地平线章节数据",
TABLE_EXPEDITION_CHAPTER, "Id", tostring(chapterId))
return nil
end
return ChapterConfig[chapterId]
end
function XExpeditionConfig.GetChapterRewardIdById(chapterId)
return ChapterConfig[chapterId] and ChapterConfig[chapterId].RewardId or 0
end
function XExpeditionConfig.GetEStageListByChapterId(chapterId)
return Chapter2StageDic[chapterId]
end
function XExpeditionConfig.GetStageList()
return StageToEStageDic
end
function XExpeditionConfig.GetEStageByStageId(stageId)
return StageToEStageDic[stageId]
end
function XExpeditionConfig.GetEStageIdByStageId(stageId)
return StageToEStageDic[stageId] and StageToEStageDic[stageId].Id
end
function XExpeditionConfig.GetOrderIdByStageId(stageId)
return StageToEStageDic[stageId].OrderId
end
function XExpeditionConfig.GetBaseCharacterCfg()
return BaseCharacterConfig
end
function XExpeditionConfig.GetBaseCharacterCfgById(baseId)
return BaseCharacterConfig[baseId]
end
function XExpeditionConfig.GetBaseIdByECharId(eCharacterId)
return CharacterConfig[eCharacterId].BaseId
end
function XExpeditionConfig.GetCharacterIdByBaseId(baseId)
return BaseCharacterConfig[baseId] and BaseCharacterConfig[baseId].CharacterId or 0
end
function XExpeditionConfig.GetCharacterElementByBaseId(baseId)
return BaseCharacterConfig[baseId] and BaseCharacterConfig[baseId].Elements or {}
end
function XExpeditionConfig.GetCharacterMaxRankByBaseId(baseId)
return Rank2CharacterDic[baseId].MaxRank
end
function XExpeditionConfig.GetCharacterCfgByBaseIdAndRank(baseId, rank)
local base = Rank2CharacterDic[baseId]
if not base then
return nil
end
if base.MaxRank < rank then
return base[base.MaxRank]
else
return base[rank]
end
end
function XExpeditionConfig.GetCharacterCfgs()
return CharacterConfig
end
function XExpeditionConfig.GetCharacterCfgById(Id)
if not CharacterConfig[Id] then
XLog.ErrorTableDataNotFound("XExpeditionConfig.GetCharacterById", "虚像地平线角色", TABLE_EXPEDITION_CHARACTER, "Id", tostring(Id))
end
return CharacterConfig[Id]
end
function XExpeditionConfig.GetEStageCfg(EStageId)
if not EStageConfig[EStageId] then
XLog.ErrorTableDataNotFound("XExpeditionConfig.GetEStageCfg", "虚像地平线关卡", TABLE_EXPEDITION_STAGE, "Id", tostring(EStageId))
return nil
end
return EStageConfig[EStageId]
end
function XExpeditionConfig.GetCharacterElementById(elementId)
return CharacterElements[elementId]
end
function XExpeditionConfig.GetComboTable()
return ComboConfig
end
function XExpeditionConfig.GetChildComboTable()
return ChildComboConfig
end
--================
--根据子羁绊类型Id获取具体羁绊列表
--================
function XExpeditionConfig.GetComboByChildComboId(childComboId)
if not BaseComboDic[childComboId] then
XLog.ErrorTableDataNotFound(
"XExpeditionConfig.GetComboByChildComboId",
"虚像地平线成员组合数据",
TABLE_EXPEDITION_COMBO,
"ChildComboId",
tostring(childComboId))
return nil
end
return BaseComboDic[childComboId]
end
function XExpeditionConfig.GetChildComboById(id)
if not ChildComboConfig[id] then
XLog.ErrorTableDataNotFound("XExpeditionConfig.GetEStageCfg",
"虚像地平线羁绊子分类数据", TABLE_EXPEDITION_CHILDCOMBO, "Id", tostring(id))
return nil
end
return ChildComboConfig[id]
end
function XExpeditionConfig.GetComboById(comboId)
if not ComboConfig[comboId] then
XLog.ErrorTableDataNotFound("XExpeditionConfig.GetComboById", "虚像地平线阵容", TABLE_EXPEDITION_COMBO, "Id", tostring(comboId))
return nil
end
return ComboConfig[comboId]
end
function XExpeditionConfig.GetCharactersByCharacterType(typeId)
if not Type2CharacterDic[typeId] then
XLog.ErrorTableDataNotFound("XExpeditionConfig.GetCharactersByCharacterType", "虚像地平线角色词条", TABLE_EXPEDITION_CHARACTER_TYPE, "Id", tostring(typeId))
return nil
end
return Type2CharacterDic[typeId]
end
function XExpeditionConfig.IsCharacterHasTypes(characterId, typeIds)
for _, typeId in pairs(typeIds) do
local id = tonumber(typeId)
if not Type2CharacterDic[id] or not Type2CharacterDic[id][characterId] then
return false
end
end
return true
end
function XExpeditionConfig.GetBaseComboTypeConfig()
return ComboTypeNameConfig
end
function XExpeditionConfig.GetBaseComboTypeNameById(id)
return ComboTypeNameConfig[id].Name or ""
end
function XExpeditionConfig.GetBuyDrawMaxTime()
return #DrawConsumeConfig
end
function XExpeditionConfig.GetDrawPriceByCount(count)
return DrawConsumeConfig[count] and DrawConsumeConfig[count].ConsumeCount or 0
end
function XExpeditionConfig.GetGlobalConfigs()
return GlobalComboConfig
end
function XExpeditionConfig.GetGlobalConfigById(comboId)
return GlobalComboConfig[comboId]
end
function XExpeditionConfig.GetRankByRankWeightId(index)
return DrawRankConfig[index] and DrawRankConfig[index].Rank or 1
end
--================
--获取队伍位置数据
--@param teamPosId:位置ID
--================
function XExpeditionConfig.GetTeamPosCfgById(teamPosId)
if not TeamPosConfig[teamPosId] then
XLog.ErrorTableDataNotFound(
"XExpeditionConfig.GetTeamPosCfgById",
"虚像地平线队伍位置数据",
TABLE_EXPEDITION_TEAMPOS,
"Id",
tostring(teamPosId))
return nil
end
return TeamPosConfig[teamPosId]
end
--================
--获取队伍位置数量
--================
function XExpeditionConfig.GetTeamPosListByChapterId(currentChapterId)
if not TeamPosConfig or not Chapter2TeamPosDic or not Chapter2TeamPosDic[currentChapterId] then return 0 end
return Chapter2TeamPosDic[currentChapterId]
end
--================
--获取招募概率配置表
--================
function XExpeditionConfig.GetDrawPRConfig()
return DrawPRConfig
end
--================
--获取招募星数对照表配置
--================
function XExpeditionConfig.GetDrawRankConfig()
return DrawRankConfig
end

View file

@ -0,0 +1,39 @@
XFashionConfigs = XFashionConfigs or {}
local TABLE_FASHION_SERIES = "Client/Fashion/FashionSeries.tab"
local FashionSeriesConfig = {}
function XFashionConfigs.Init()
FashionSeriesConfig = XTableManager.ReadByIntKey(TABLE_FASHION_SERIES, XTable.XTableFashionSeries, "Id")
end
---------------------------------------------------FashionSeries.tab数据读取---------------------------------------------------------
local function GetFashionSeriesConfig(id)
local cfg = FashionSeriesConfig[id]
if cfg == nil then
XLog.ErrorTableDataNotFound("XFashionConfigs.GetFashionSeriesConfig",
"涂装系列",
TABLE_FASHION_SERIES,
"Id",
tostring(id))
return {}
end
return cfg
end
---
--- 获取涂装系列名称
function XFashionConfigs.GetSeriesName(id)
local cfg = GetFashionSeriesConfig(id)
if not cfg.Name then
XLog.ErrorTableDataNotFound("XFashionConfigs.GetSeriesName",
"涂装名称",
TABLE_FASHION_SERIES,
"Id",
tostring(id))
return ""
end
return cfg.Name
end

View file

@ -0,0 +1,183 @@
XFashionStoryConfigs = XFashionStoryConfigs or {}
local TABLE_FASHION_STORY = "Share/Fuben/FashionStory/FashionStory.tab"
local TABLE_FASHION_STORY_STAGE = "Share/Fuben/FashionStory/FashionStoryStage.tab"
-- 活动类型
XFashionStoryConfigs.Type = {
Both = 1, -- 具有章节关与试玩关
OnlyChapter = 2, -- 只有章节关
OnlyTrial = 3, -- 只有试玩关
}
-- 玩法模式
XFashionStoryConfigs.Mode = {
Chapter = 1, -- 章节关
Trial = 2, -- 试玩关
}
XFashionStoryConfigs.StoryEntranceId = 0
local FashionStory = {}
local FashionStoryStage = {}
function XFashionStoryConfigs.Init()
FashionStory = XTableManager.ReadByIntKey(TABLE_FASHION_STORY, XTable.XTableFashionStory, "Id")
FashionStoryStage = XTableManager.ReadByIntKey(TABLE_FASHION_STORY_STAGE, XTable.XTableFashionStoryStage, "StageId")
end
--------------------------------------------------内部接口---------------------------------------------------------------
local function GetFashionStoryCfg(id)
local cfg = FashionStory[id]
if not cfg then
XLog.ErrorTableDataNotFound("GetFashionStoryCfg", "系列涂装剧情活动配置",
TABLE_FASHION_STORY, "Id", tostring(id))
return {}
end
return cfg
end
local function GetFashionStoryStageCfg(stageId)
local cfg = FashionStoryStage[stageId]
if not cfg then
XLog.ErrorTableDataNotFound(" GetFashionStoryStageCfg", "活动关卡配置",
TABLE_FASHION_STORY_STAGE, "StageId", tostring(stageId))
return {}
end
return cfg
end
----------------------------------------------FashionStory.tab----------------------------------------------------------
function XFashionStoryConfigs.GetAllFashionStoryId()
local allFashionStoryId = {}
for id, _ in pairs(FashionStory) do
table.insert(allFashionStoryId, id)
end
return allFashionStoryId
end
function XFashionStoryConfigs.GetName(id)
local cfg = GetFashionStoryCfg(id)
return cfg.Name
end
function XFashionStoryConfigs.GetActivityTimeId(id)
local cfg = GetFashionStoryCfg(id)
return cfg.TimeId
end
function XFashionStoryConfigs.GetChapterPrefab(id)
local cfg = GetFashionStoryCfg(id)
return cfg.ChapterPrefab
end
function XFashionStoryConfigs.GetActivityBannerIcon(id)
local cfg = GetFashionStoryCfg(id)
return cfg.ActivityBannerIcon
end
function XFashionStoryConfigs.GetChapterBg(id)
local cfg = GetFashionStoryCfg(id)
return cfg.ChapterBg
end
function XFashionStoryConfigs.GetTrialBg(id)
local cfg = GetFashionStoryCfg(id)
return cfg.TrialBg
end
function XFashionStoryConfigs.GetSkipIdList(id)
local cfg = GetFashionStoryCfg(id)
return cfg.SkipId
end
function XFashionStoryConfigs.GetChapterStagesList(id)
local cfg = GetFashionStoryCfg(id)
return cfg.ChapterStages
end
function XFashionStoryConfigs.GetTrialStagesList(id)
local cfg = GetFashionStoryCfg(id)
return cfg.TrialStages
end
function XFashionStoryConfigs.GetChapterFightStagePrefab(id)
local cfg = GetFashionStoryCfg(id)
return cfg.FightStagePrefab
end
function XFashionStoryConfigs.GetChapterStoryStagePrefab(id)
local cfg = GetFashionStoryCfg(id)
return cfg.StoryStagePrefab
end
function XFashionStoryConfigs.GetStoryEntranceBg(id)
local cfg = GetFashionStoryCfg(id)
return cfg.StoryEntranceBg
end
function XFashionStoryConfigs.GetStoryEntranceFinishTag(id)
local cfg = GetFashionStoryCfg(id)
return cfg.StoryFinishTag
end
function XFashionStoryConfigs.GetStoryTimeId(id)
local cfg = GetFashionStoryCfg(id)
return cfg.StoryTimeId
end
function XFashionStoryConfigs.GetAllStageId(id)
return XTool.MergeArray(XFashionStoryConfigs.GetChapterStagesList(id), XFashionStoryConfigs.GetTrialStagesList(id))
end
----------------------------------------------FashionStoryStage.tab----------------------------------------------------------
function XFashionStoryConfigs.GetStageTimeId(stageId)
local cfg = GetFashionStoryStageCfg(stageId)
return cfg.TimeId
end
function XFashionStoryConfigs.GetStoryStageDetailBg(id)
local cfg = GetFashionStoryStageCfg(id)
return cfg.StoryStageDetailBg
end
function XFashionStoryConfigs.GetStoryStageDetailIcon(id)
local cfg = GetFashionStoryStageCfg(id)
return cfg.StoryStageDetailIcon
end
function XFashionStoryConfigs.GetTrialDetailBg(id)
local cfg = GetFashionStoryStageCfg(id)
return cfg.TrialDetailBg
end
function XFashionStoryConfigs.GetTrialDetailSpine(id)
local cfg = GetFashionStoryStageCfg(id)
return cfg.TrialDetailSpine
end
function XFashionStoryConfigs.GetTrialDetailHeadIcon(id)
local cfg = GetFashionStoryStageCfg(id)
return cfg.TrialDetailHeadIcon
end
function XFashionStoryConfigs.GetTrialDetailRecommendLevel(id)
local cfg = GetFashionStoryStageCfg(id)
return cfg.TrialDetailRecommendLevel
end
function XFashionStoryConfigs.GetTrialDetailDesc(id)
local cfg = GetFashionStoryStageCfg(id)
return cfg.TrialDetailDesc
end
function XFashionStoryConfigs.GetTrialFinishTag(id)
local cfg = GetFashionStoryStageCfg(id)
return cfg.FinishTag
end

View file

@ -0,0 +1,610 @@
XFavorabilityConfigs = XFavorabilityConfigs or {}
XFavorabilityConfigs.RewardUnlockType = {
FightAbility = 1,
TrustLv = 2,
CharacterLv = 3,
Quality = 4,
}
XFavorabilityConfigs.InfoState = {
Normal = 1,
Available = 2,
Lock = 3,
}
XFavorabilityConfigs.StrangeNewsUnlockType = {
TrustLv = 1,
DormEvent = 2,
}
XFavorabilityConfigs.SoundEventType = {
FirstTimeObtain = 1, -- 首次获得角色
LevelUp = 2, -- 角色升级
Evolve = 3, -- 角色进化
GradeUp = 4, -- 角色升军阶
SkillUp = 5, -- 角色技能升级
WearWeapon = 6, -- 角色穿戴武器
MemberJoinTeam = 7, --角色入队(队员)
CaptainJoinTeam = 8, --角色入队(队长)
}
XFavorabilityConfigs.TrustItemType = {
Normal = 1, -- 普通
Communication = 2, -- 触发通讯的道具
}
-- [礼物品质]
XFavorabilityConfigs.GiftQualityIcon = {
[1] = CS.XGame.ClientConfig:GetString("QualityIconColor1"),
[2] = CS.XGame.ClientConfig:GetString("QualityIconColor2"),
[3] = CS.XGame.ClientConfig:GetString("QualityIconColor3"),
[4] = CS.XGame.ClientConfig:GetString("QualityIconColor4"),
[5] = CS.XGame.ClientConfig:GetString("QualityIconColor5"),
[6] = CS.XGame.ClientConfig:GetString("QualityIconColor6"),
}
local TABLE_LIKE_BASEDATA = "Client/Trust/CharacterBaseData.tab"
local TABLE_LIKE_INFORMATION = "Client/Trust/CharacterInformation.tab"
local TABLE_LIKE_STORY = "Client/Trust/CharacterStory.tab"
local TABLE_LIKE_STRANGENEWS = "Client/Trust/CharacterStrangeNews.tab"
local TABLE_LIKE_TRUSTEXP = "Share/Trust/CharacterTrustExp.tab"
local TABLE_LIKE_TRUSTITEM = "Share/Trust/CharacterTrustItem.tab"
local TABLE_LIKE_VOICE = "Client/Trust/CharacterVoice.tab"
local TABLE_LIKE_LEVELCONFIG = "Share/Trust/FavorabilityLevelConfig.tab"
local TABLE_LIKE_ACTION = "Client/Trust/CharacterAction.tab"
--local TABLE_AUDIO_CV = "Client/Audio/Cv.tab"
local TABLE_CHARACTER_COLLABORATION = "Client/Trust/CharacterCollaboration.tab"
local CharacterFavorabilityConfig = {}
local CharacterTrustExp = {}
local CharacterBaseData = {}
local CharacterInformation = {}
local CharacterInformationUnlockLv = {}
local CharacterRumors = {}
local CharacterVoice = {}
local CharacterVoiceUnlockLv = {}
local CharacterStory = {}
local CharacterStoryUnlockLv = {}
local CharacterSendGift = {}
local CharacterGiftReward = {}
local likeReward = {}
local CharacterAction = {}
local CharacterActionUnlockLv = {}
local CharacterCollaboration = {}
--local AudioCV = {}
local DEFAULT_CV_TYPE = CS.XGame.Config:GetInt("DefaultCvType")
function XFavorabilityConfigs.Init()
local baseData = XTableManager.ReadByIntKey(TABLE_LIKE_BASEDATA, XTable.XTableCharacterBaseData, "Id")
for _, v in pairs(baseData) do
if CharacterBaseData[v.CharacterId] == nil then
CharacterBaseData[v.CharacterId] = {}
end
CharacterBaseData[v.CharacterId] = {
CharacterId = v.CharacterId,
BaseDataTitle = v.BaseDataTitle,
BaseData = v.BaseData,
Cast = v.Cast,
}
end
local likeInformation = XTableManager.ReadByIntKey(TABLE_LIKE_INFORMATION, XTable.XTableCharacterInformation, "Id")
for _, v in pairs(likeInformation) do
if CharacterInformation[v.CharacterId] == nil then
CharacterInformation[v.CharacterId] = {}
end
table.insert(CharacterInformation[v.CharacterId], {
Id = v.Id,
CharacterId = v.CharacterId,
UnlockLv = v.UnlockLv,
Title = v.Title,
Content = v.Content,
ConditionDescript = v.ConditionDescript
})
if CharacterInformationUnlockLv[v.CharacterId] == nil then
CharacterInformationUnlockLv[v.CharacterId] = {}
end
CharacterInformationUnlockLv[v.CharacterId][v.Id] = v.UnlockLv
end
for _, characterDatas in pairs(CharacterInformation) do
table.sort(characterDatas, function(infoA, infoB)
if infoA.UnlockLv == infoB.UnlockLv then
return infoA.Id < infoB.Id
end
return infoA.UnlockLv < infoB.UnlockLv
end)
end
local likeStory = XTableManager.ReadByIntKey(TABLE_LIKE_STORY, XTable.XTableCharacterStory, "Id")
for _, v in pairs(likeStory) do
if CharacterStory[v.CharacterId] == nil then
CharacterStory[v.CharacterId] = {}
end
table.insert(CharacterStory[v.CharacterId], {
Id = v.Id,
Name = v.Name,
CharacterId = v.CharacterId,
StoryId = v.StoryId,
Icon = v.Icon,
UnlockLv = v.UnlockLv,
ConditionDescript = v.ConditionDescript,
SectionNumber = v.SectionNumber,
})
if CharacterStoryUnlockLv[v.CharacterId] == nil then
CharacterStoryUnlockLv[v.CharacterId] = {}
end
CharacterStoryUnlockLv[v.CharacterId][v.Id] = v.UnlockLv
end
for _, storys in pairs(CharacterStory) do
table.sort(storys, function(storyA, storyB)
if storyA.UnlockLv == storyB.UnlockLv then
return storyA.Id < storyB.Id
end
return storyA.UnlockLv < storyB.UnlockLv
end)
end
local likeStrangeNews = XTableManager.ReadByIntKey(TABLE_LIKE_STRANGENEWS, XTable.XTableCharacterStrangeNews, "Id")
for _, v in pairs(likeStrangeNews) do
if CharacterRumors[v.CharacterId] == nil then
CharacterRumors[v.CharacterId] = {}
end
table.insert(CharacterRumors[v.CharacterId], {
Id = v.Id,
CharacterId = v.CharacterId,
Type = v.Type,
UnlockType = v.UnlockType,
Title = v.Title,
Content = v.Content,
Picture = v.Picture,
UnlockPara = v.UnlockPara,
ConditionDescript = v.ConditionDescript,
PreviewPicture = v.PreviewPicture
})
end
for _, strangeNews in pairs(CharacterRumors) do
table.sort(strangeNews, function(strangeNewsA, strangeNewsB)
return strangeNewsA.Id < strangeNewsB.Id
end)
end
local likeTrustExp = XTableManager.ReadByIntKey(TABLE_LIKE_TRUSTEXP, XTable.XTableCharacterTrustExp, "Id")
for _, v in pairs(likeTrustExp) do
if CharacterTrustExp[v.CharacterId] == nil then
CharacterTrustExp[v.CharacterId] = {}
end
CharacterTrustExp[v.CharacterId][v.TrustLv] = {
Exp = v.Exp,
Name = v.Name,
PlayId = v.PlayId
}
end
local likeTrustItem = XTableManager.ReadByIntKey(TABLE_LIKE_TRUSTITEM, XTable.XTableCharacterTrustItem, "Id")
for _, v in pairs(likeTrustItem) do
table.insert(CharacterSendGift, {
Id = v.Id,
Exp = v.Exp,
FavorCharacterId = v.FavorCharacterId,
FavorExp = v.FavorExp,
TrustItemType = v.TrustItemType,
})
end
local likeVoice = XTableManager.ReadByIntKey(TABLE_LIKE_VOICE, XTable.XTableCharacterVoice, "Id")
for _, v in pairs(likeVoice) do
if v.IsShow == 1 then
if CharacterVoice[v.CharacterId] == nil then
CharacterVoice[v.CharacterId] = {}
end
table.insert(CharacterVoice[v.CharacterId], {
Id = v.Id,
CharacterId = v.CharacterId,
Name = v.Name,
CvId = v.CvId,
UnlockLv = v.UnlockLv,
ConditionDescript = v.ConditionDescript,
SoundType = v.SoundType,
IsShow = v.IsShow,
})
end
if CharacterVoiceUnlockLv[v.CharacterId] == nil then
CharacterVoiceUnlockLv[v.CharacterId] = {}
end
CharacterVoiceUnlockLv[v.CharacterId][v.Id] = v.UnlockLv
end
for _, v in pairs(CharacterVoice) do
table.sort(v, XFavorabilityConfigs.SortVoice)
end
local likeAction = XTableManager.ReadByIntKey(TABLE_LIKE_ACTION, XTable.XTableCharacterAction, "Id")
for _, v in pairs(likeAction) do
if CharacterAction[v.CharacterId] == nil then
CharacterAction[v.CharacterId] = {}
end
table.insert(CharacterAction[v.CharacterId], {
Id = v.Id,
CharacterId = v.CharacterId,
Name = v.Name,
SignBoardActionId = v.SignBoardActionId,
UnlockLv = v.UnlockLv,
ConditionDescript = v.ConditionDescript,
})
if CharacterActionUnlockLv[v.CharacterId] == nil then
CharacterActionUnlockLv[v.CharacterId] = {}
end
CharacterActionUnlockLv[v.CharacterId][v.Id] = v.UnlockLv
end
for _, v in pairs(CharacterAction) do
table.sort(v, function(item1, item2)
if item1.UnlockLv == item2.UnlockLv then
return item1.Id < item2.Id
end
return item1.UnlockLv < item2.UnlockLv
end)
end
CharacterFavorabilityConfig = XTableManager.ReadByIntKey(TABLE_LIKE_LEVELCONFIG, XTable.XTableFavorabilityLevelConfig, "Id")
CharacterCollaboration = XTableManager.ReadByIntKey(TABLE_CHARACTER_COLLABORATION, XTable.XTableCharacterCollaboration, "CharacterId")
--AudioCV = XTableManager.ReadByIntKey(TABLE_AUDIO_CV, XTable.XTableCv, "Id")
end
function XFavorabilityConfigs.SortVoice(a, b)
if a.UnlockLv == b.UnlockLv then
return a.Id < b.Id
end
return a.UnlockLv < b.UnlockLv
end
-- [好感度等级经验]
function XFavorabilityConfigs.GetTrustExpById(characterId)
local trustExp = CharacterTrustExp[characterId]
if not trustExp then
XLog.ErrorTableDataNotFound("XFavorabilityConfigs.GetTrustExpById", "CharacterTrustExp",
TABLE_LIKE_TRUSTEXP, "characterId", tostring(characterId))
return
end
return trustExp
end
-- [好感度基础数据]
function XFavorabilityConfigs.GetCharacterBaseDataById(characterId)
local baseData = CharacterBaseData[characterId]
if not baseData then
XLog.ErrorTableDataNotFound("XFavorabilityConfigs.GetCharacterBaseDataById",
"CharacterBaseData", TABLE_LIKE_BASEDATA, "characterId", characterId)
return
end
return baseData
end
-- 获取cv名字
function XFavorabilityConfigs.GetCharacterCvById(characterId)
local baseData = XFavorabilityConfigs.GetCharacterBaseDataById(characterId)
if not baseData then return "" end
local cvType = CS.UnityEngine.PlayerPrefs.GetInt("CV_TYPE", DEFAULT_CV_TYPE)
if baseData.Cast and baseData.Cast[cvType] then return baseData.Cast[cvType] end
return ""
end
-- 获取cv名字
function XFavorabilityConfigs.GetCharacterCvByIdAndType(characterId, cvType)
local baseData = XFavorabilityConfigs.GetCharacterBaseDataById(characterId)
if not baseData then return "" end
if baseData.Cast and baseData.Cast[cvType] then return baseData.Cast[cvType] end
return ""
end
-- [好感度档案-资料]
function XFavorabilityConfigs.GetCharacterInformationById(characterId)
local information = CharacterInformation[characterId]
return information
end
--获取档案
function XFavorabilityConfigs.GetCharacterInformation()
return CharacterInformation
end
-- [好感度档案-资料解锁等级]
function XFavorabilityConfigs.GetCharacterInformationUnlockLvById(characterId)
local informationUnlockDatas = CharacterInformationUnlockLv[characterId]
if not informationUnlockDatas then
XLog.ErrorTableDataNotFound("XFavorabilityConfigs.GetCharacterInformationUnlockLvById",
"UnlockLv", TABLE_LIKE_INFORMATION, "characterId", tostring(characterId))
return
end
return informationUnlockDatas
end
-- [好感度档案-异闻]
function XFavorabilityConfigs.GetCharacterRumorsById(characterId)
local rumors = CharacterRumors[characterId]
return rumors
end
--获取异闻
function XFavorabilityConfigs.GetCharacterRumors()
return CharacterRumors
end
--获取剧情
function XFavorabilityConfigs.GetCharacterStory()
return CharacterStory
end
--获取语音
function XFavorabilityConfigs.GetCharacterVoice()
return CharacterVoice
end
--获取动作
function XFavorabilityConfigs.GetCharacterAction()
return CharacterAction
end
-- [好感度档案-动作]
function XFavorabilityConfigs.GetCharacterActionById(characterId)
if XRobotManager.CheckIsRobotId(characterId) then
characterId = XRobotManager.GetRobotTemplate(characterId).CharacterId
end
local action = CharacterAction[characterId]
return action
end
-- [好感度档案-动作解锁等级]
function XFavorabilityConfigs.GetCharacterActionUnlockLvsById(characterId)
local actionUnlockDatas = CharacterActionUnlockLv[characterId]
if not actionUnlockDatas then
XLog.ErrorTableDataNotFound("XFavorabilityConfigs.GetCharacterActionUnlockLvsById",
"CharacterActionUnlockLv", TABLE_LIKE_ACTION, "characterId", tostring(characterId))
return
end
return actionUnlockDatas
end
-- [好感度档案-语音]
function XFavorabilityConfigs.GetCharacterVoiceById(characterId)
if XRobotManager.CheckIsRobotId(characterId) then
characterId = XRobotManager.GetRobotTemplate(characterId).CharacterId
end
local voice = CharacterVoice[characterId]
return voice
end
-- [好感度档案-语音解锁等级]
function XFavorabilityConfigs.GetCharacterVoiceUnlockLvsById(characterId)
local voiceUnlockDatas = CharacterVoiceUnlockLv[characterId]
if not voiceUnlockDatas then
XLog.ErrorTableDataNotFound("XFavorabilityConfigs.GetCharacterVoiceUnlockLvsById",
"CharacterVoiceUnlockLv", TABLE_LIKE_VOICE, "characterId", tostring(characterId))
return
end
return voiceUnlockDatas
end
-- [好感度剧情]
function XFavorabilityConfigs.GetCharacterStoryById(characterId)
local storys = CharacterStory[characterId]
return storys
end
-- [好感度剧情解锁等级]
function XFavorabilityConfigs.GetCharacterStoryUnlockLvsById(characterId)
local storyUnlockDatas = CharacterStoryUnlockLv[characterId]
if not storyUnlockDatas then
XLog.ErrorTableDataNotFound("XFavorabilityConfigs.GetCharacterStoryUnlockLvsById",
"CharacterStoryUnlockLv", TABLE_LIKE_STORY, "characterId", tostring(characterId))
return
end
return storyUnlockDatas
end
-- [好感度礼物-送礼]
function XFavorabilityConfigs.GetAllCharacterSendGift()
if not CharacterSendGift then
XLog.Error("XFavorabilityConfigs.GetAllCharacterSendGift 函数错误, 配置表:" .. TABLE_LIKE_TRUSTITEM .. " 读取失败, 检查配置表")
return
end
return CharacterSendGift
end
-- [好感度礼物-奖励]
function XFavorabilityConfigs.GetCharacterGiftRewardById(characterId)
local giftReward = CharacterGiftReward[characterId]
if not giftReward then
XLog.Error("XFavorabilityConfigs.GetCharacterGiftRewardById error: not data found by characterId " .. tostring(characterId))
return
end
return giftReward
end
function XFavorabilityConfigs.GetLikeRewardById(rewardId)
if not likeReward then
XLog.Error("XFavorabilityConfigs.GetLikeRewardById error: not data found by rewardId " .. tostring(rewardId))
return
end
return likeReward[rewardId]
end
function XFavorabilityConfigs.GetFavorabilityLevelCfg(level)
local cfgs = CharacterFavorabilityConfig[level]
if not cfgs then
XLog.ErrorTableDataNotFound("XFavorabilityConfigs.GetFavorabilityLevelCfg",
"CharacterFavorabilityConfig", TABLE_LIKE_LEVELCONFIG, "level", tostring(level))
end
return cfgs
end
-- CharacterFavorabilityConfig
-- [好感度-等级名字]
function XFavorabilityConfigs.GetWordsWithColor(trustLv, name)
local color = XFavorabilityConfigs.GetFavorabilityLevelCfg(trustLv).WordColor
return string.format("<color=%s>%s</color>", color, name)
end
-- [好感度-名字-称号]
function XFavorabilityConfigs.GetCharacterNameWithTitle(name, title)
return string.format("%s <size=36>%s</size>", name, title)
end
-- [好感度-等级图标]
function XFavorabilityConfigs.GetTrustLevelIconByLevel(level)
return XFavorabilityConfigs.GetFavorabilityLevelCfg(level).LevelIcon
end
-- [好感度-品质图标]
function XFavorabilityConfigs.GetQualityIconByQuality(quality)
if quality == nil or XFavorabilityConfigs.GiftQualityIcon[quality] == nil then
return XFavorabilityConfigs.GiftQualityIcon[1]
end
return XFavorabilityConfigs.GiftQualityIcon[quality]
end
function XFavorabilityConfigs.GetCvContent(cvId)
local cvData = nil
if CS.XAudioManager.CvTemplates:ContainsKey(cvId) then
cvData = CS.XAudioManager.CvTemplates[cvId]
end
if not cvData then return "" end
return cvData.CvContent[0] or ""
end
function XFavorabilityConfigs.GetCvContentByIdAndType(cvId, cvType)
local cvData = nil
if CS.XAudioManager.CvTemplates:ContainsKey(cvId) then
cvData = CS.XAudioManager.CvTemplates[cvId]
end
if not cvData then return "" end
return cvData.CvContent[cvType - 1] or ""
end
function XFavorabilityConfigs.GetMaxFavorabilityLevel(characterId)
local characterFavorabilityLevelDatas = CharacterTrustExp[characterId]
if not characterFavorabilityLevelDatas then
XLog.ErrorTableDataNotFound("XFavorabilityConfigs.GetMaxFavorabilityLevel",
"CharacterTrustExp", TABLE_LIKE_TRUSTEXP, "characterId", tostring(characterId))
return
end
local maxLevel = 1
for trustLv, levelDatas in pairs(characterFavorabilityLevelDatas) do
if levelDatas.Exp == 0 then
maxLevel = trustLv
break
end
end
return maxLevel
end
function XFavorabilityConfigs.GetFavorabilityLevel(characterId, totalExp, startLevel)
local characterFavorabilityLevelDatas = CharacterTrustExp[characterId]
if not characterFavorabilityLevelDatas then
XLog.ErrorTableDataNotFound("XFavorabilityConfigs.GetMaxFavorabilityLevel",
"CharacterTrustExp", TABLE_LIKE_TRUSTEXP, "characterId", tostring(characterId))
return
end
startLevel = startLevel or 1
local level = startLevel
local leftExp = totalExp
local levelExp = 0
for trustLv, levelDatas in pairs(characterFavorabilityLevelDatas) do
if startLevel <= trustLv then
local exp = levelDatas.Exp
levelExp = exp
if exp == 0 then
level = trustLv
break
end
if leftExp < exp then
level = trustLv
break
end
if totalExp >= exp then
leftExp = leftExp - exp
end
end
end
return level, leftExp, levelExp
end
--是不是联动角色
function XFavorabilityConfigs.IsCollaborationCharacter(characterId)
return CharacterCollaboration[characterId]
end
--联动角色语种
function XFavorabilityConfigs.GetCollaborationCharacterCvType(characterId)
if XFavorabilityConfigs.IsCollaborationCharacter(characterId) then
local cvType = string.Split(CharacterCollaboration[characterId].languageSet, "|")
for k, v in pairs(cvType) do
cvType[k] = tonumber(v)
end
return cvType
else
return nil
end
end
--联动角色语种提示
function XFavorabilityConfigs.GetCollaborationCharacterText(characterId)
if XFavorabilityConfigs.IsCollaborationCharacter(characterId) then
return CharacterCollaboration[characterId].Text
else
return nil
end
end
--联动角色Logo
function XFavorabilityConfigs.GetCollaborationCharacterIcon(characterId)
if XFavorabilityConfigs.IsCollaborationCharacter(characterId) then
return CharacterCollaboration[characterId].IconPath
else
return nil
end
end
--联动角色Logo位置
function XFavorabilityConfigs.GetCollaborationCharacterIconPos(characterId)
if XFavorabilityConfigs.IsCollaborationCharacter(characterId) then
local pos = {}
pos.X = CharacterCollaboration[characterId].IconX
pos.Y = CharacterCollaboration[characterId].IconY
return pos
else
return nil
end
end
--联动角色Logo缩放
function XFavorabilityConfigs.GetCollaborationCharacterIconScale(characterId)
if XFavorabilityConfigs.IsCollaborationCharacter(characterId) then
return CharacterCollaboration[characterId].IconScale
else
return nil
end
end

View file

@ -0,0 +1,64 @@
XFestivalActivityConfig = XFestivalActivityConfig or {}
local CLIENT_FESTIVAL_STAGE = "Client/Fuben/Festival/FestivalStage.tab" --庆典关卡客户端表
local SHARE_FESTIVAL = "Share/Fuben/Festival/FestivalActivity.tab"
local ShareFestival = {}
local ClientFestivalStages = {}
--活动名称Id
XFestivalActivityConfig.ActivityId = {
Christmas = 1,
MainLine = 2,
NewYear = 3,
FoolsDay = 4,
}
function XFestivalActivityConfig.Init()
ClientFestivalStages = XTableManager.ReadByIntKey(CLIENT_FESTIVAL_STAGE, XTable.XTableFestivalStage, "StageId")
ShareFestival = XTableManager.ReadByIntKey(SHARE_FESTIVAL, XTable.XTableFestivalActivity, "Id")
end
function XFestivalActivityConfig.GetFestivalsTemplates()
return ShareFestival
end
function XFestivalActivityConfig.GetFestivalById(id)
if not id then return end
local festivalDatas = ShareFestival[id]
if not festivalDatas then
XLog.ErrorTableDataNotFound("XFestivalActivityConfig.GetFestivalById", "FestivalActivity", SHARE_FESTIVAL, "Id", tostring(id))
return
end
return festivalDatas
end
function XFestivalActivityConfig.GetFestivalTime(id)
local config = XFestivalActivityConfig.GetFestivalById(id)
return XFunctionManager.GetTimeByTimeId(config.TimeId)
end
function XFestivalActivityConfig.IsOffLine(id)
local config = XFestivalActivityConfig.GetFestivalById(id)
return not XTool.IsNumberValid(config.TimeId)
end
--====================
--获取庆典活动关卡配置
--@param stageId:关卡ID
--@return 庆典活动关卡配置
--====================
function XFestivalActivityConfig.GetFestivalStageCfgByStageId(stageId)
if not ClientFestivalStages[stageId] then
--[[
XLog.ErrorTableDataNotFound(
"XFestivalActivityConfig.GetFestivalStageCfgByStageId",
"庆典活动关卡",
CLIENT_FESTIVAL_STAGE,
"StageId",
tostring(stageId))
]]
return nil
end
return ClientFestivalStages[stageId]
end

View file

@ -0,0 +1,25 @@
XFightWordsConfigs = XFightWordsConfigs or {}
local TABLE_MOVIE_PATH_PREFIX = "Client/Fight/Words/Words.tab"
local WordsTemplates
local function InitWordsTemplate(id)
if not WordsTemplates then
WordsTemplates = {}
local wordsArray = XTableManager.ReadArray(TABLE_MOVIE_PATH_PREFIX, XTable.XTableFightWords)
for i = 1, #wordsArray do
local group = wordsArray[i]["Group"]
if not WordsTemplates[group] then
WordsTemplates[group] = {}
end
table.insert(WordsTemplates[group],wordsArray[i])
end
end
end
function XFightWordsConfigs.GetMovieCfg(id)
if not WordsTemplates then
InitWordsTemplate(id)
end
return WordsTemplates[id]
end

View file

@ -0,0 +1,156 @@
-- 猜拳小游戏配置表
XFingerGuessingConfig = {}
-- ===================表地址
local SHARE_TABLE_PATH = "Share/MiniActivity/FingerGuessingGame/"
local CLIENT_TABLE_PATH = "Client/MiniActivity/FingerGuessingGame/"
local TABLE_ACTIVITY = SHARE_TABLE_PATH .. "FingerGuessingActivity.tab"
local TABLE_STAGE = SHARE_TABLE_PATH .. "FingerGuessingStage.tab"
local TABLE_ROUND = SHARE_TABLE_PATH .. "FingerGuessingStageRound.tab"
local TABLE_FINGER = SHARE_TABLE_PATH .. "FingerGuessingFinger.tab"
-- ===================原表数据
local FingerGuessingActivityConfig = {}
local FingerGuessingStageConfig = {}
local FingerGuessingRoundConfig = {}
local FingerGuessingFingerConfig = {}
-- ===================构建字典
local Stage2RoundDic = {}
local CreateStage2RoundDic = function()
for _, roundConfig in pairs(FingerGuessingRoundConfig) do
local stageId = roundConfig.StageId
if not Stage2RoundDic[stageId] then Stage2RoundDic[stageId] = {} end
Stage2RoundDic[stageId][roundConfig.Round] = roundConfig
end
end
--================
--初始化Config
--================
function XFingerGuessingConfig.Init()
FingerGuessingActivityConfig = XTableManager.ReadByIntKey(TABLE_ACTIVITY, XTable.XTableFingerGuessingActivity, "Id")
FingerGuessingStageConfig = XTableManager.ReadByIntKey(TABLE_STAGE, XTable.XTableFingerGuessingStage, "Id")
FingerGuessingRoundConfig = XTableManager.ReadByIntKey(TABLE_ROUND, XTable.XTableFingerGuessingStageRound, "Id")
FingerGuessingFingerConfig = XTableManager.ReadByIntKey(TABLE_FINGER, XTable.XTableFingerGuessingFinger, "Id")
CreateStage2RoundDic()
end
--================
--获取所有活动配置
--================
function XFingerGuessingConfig.GetAllActivityConfig()
return FingerGuessingActivityConfig
end
--================
--获取最后的活动配置
--================
function XFingerGuessingConfig.GetLastestActivityConfig()
local id = 0
for configId, _ in pairs(FingerGuessingActivityConfig) do
if configId > id then
id = configId
end
end
return FingerGuessingActivityConfig[id]
end
--================
--根据活动Id获取活动配置
--@param activityId:活动Id
--================
function XFingerGuessingConfig.GetActivityConfigById(activityId)
local config = FingerGuessingActivityConfig[activityId]
if not config then
XLog.ErrorTableDataNotFound(
"XFingerGuessingConfig.GetActivityConfigById",
"猜拳小游戏基础配置",
TABLE_ACTIVITY,
"Id",
tostring(activityId))
return nil
end
return config
end
--================
--获取所有关卡配置
--================
function XFingerGuessingConfig.GetAllStageConfig()
return FingerGuessingStageConfig
end
--================
--根据关卡Id获取关卡配置
--@param stageId:关卡Id
--================
function XFingerGuessingConfig.GetStageConfigById(stageId)
local config = FingerGuessingStageConfig[stageId]
if not config then
XLog.ErrorTableDataNotFound(
"XFingerGuessingConfig.GetStageConfigById",
"猜拳小游戏关卡配置",
TABLE_STAGE,
"Id",
tostring(stageId))
return nil
end
return config
end
--================
--获取所有小局配置
--================
function XFingerGuessingConfig.GetAllRoundConfig()
return FingerGuessingRoundConfig
end
--================
--根据小局Id获取小局配置
--@param roundId:小局Id
--================
function XFingerGuessingConfig.GetRoundConfigById(roundId)
local config = FingerGuessingRoundConfig[roundId]
if not config then
XLog.ErrorTableDataNotFound(
"XFingerGuessingConfig.GetRoundConfigById",
"猜拳小游戏小局配置",
TABLE_ROUND,
"Id",
tostring(roundId))
return nil
end
return config
end
--================
--获取所有出拳配置
--================
function XFingerGuessingConfig.GetAllFingerConfig()
return FingerGuessingFingerConfig
end
--================
--根据关卡Id获取该关卡的所有小局配置
--@param stageId:关卡Id
--================
function XFingerGuessingConfig.GetRoundConfigByStageId(stageId)
local configs = Stage2RoundDic[stageId]
if not configs then
XLog.ErrorTableDataNotFound(
"XFingerGuessingConfig.GetRoundConfigByStageId",
"猜拳小游戏小局配置",
TABLE_ROUND,
"StageId",
tostring(stageId))
return {}
end
return configs
end
--================
--根据出拳ID获取出拳配置
--@param fingerId:出拳ID
--================
function XFingerGuessingConfig.GetFingerConfigById(fingerId)
local config = FingerGuessingFingerConfig[fingerId]
if not config then
XLog.ErrorTableDataNotFound(
"XFingerGuessingConfig.GetFingerConfigById",
"猜拳小游戏出拳配置",
TABLE_FINGER,
"Id",
tostring(fingerId))
return nil
end
return config
end

View file

@ -0,0 +1,180 @@
local TABLE_BOSS_ACTIVITY_PATH = "Share/Fuben/BossActivity/BossActivity.tab"
local TABLE_BOSS_SECTION_PATH = "Share/Fuben/BossActivity/BossSection.tab"
local TABLE_BOSS_CHALLENGE_PATH = "Share/Fuben/BossActivity/BossChallenge.tab"
local TABLE_BOSS_CHALLENGE_RES_PATH = "Client/Fuben/BossActivity/BossChallengeRes.tab"
local TABLE_BOSS_STARREWARD_PATH = "Share/Fuben/BossActivity/BossStarReward.tab"
local pairs = pairs
local BossActivityTemplates = {}
local BossSectionTemplates = {}
local BossChallengeTemplates = {}
local BossChallengeResTemplates = {}
local BossStarRewardTemplates = {}
local DefaultActivityId = 0
local ChallengeIdToOrderIdDic = {}
local StageIdToChallengeIdDic = {}
XFubenActivityBossSingleConfigs = XFubenActivityBossSingleConfigs or {}
function XFubenActivityBossSingleConfigs.Init()
BossActivityTemplates = XTableManager.ReadByIntKey(TABLE_BOSS_ACTIVITY_PATH, XTable.XTableBossActivity, "Id")
BossSectionTemplates = XTableManager.ReadByIntKey(TABLE_BOSS_SECTION_PATH, XTable.XTableBossSection, "Id")
BossChallengeTemplates = XTableManager.ReadByIntKey(TABLE_BOSS_CHALLENGE_PATH, XTable.XTableBossChallenge, "Id")
BossChallengeResTemplates = XTableManager.ReadByIntKey(TABLE_BOSS_CHALLENGE_RES_PATH, XTable.XTableBossChallengeRes, "Id")
BossStarRewardTemplates = XTableManager.ReadByIntKey(TABLE_BOSS_STARREWARD_PATH, XTable.XTableBossStarReward, "Id")
for activityId, config in pairs(BossActivityTemplates) do
if XTool.IsNumberValid(config.ActivityTimeId) then
DefaultActivityId = activityId
break
end
DefaultActivityId = activityId--若全部过期取最后一行配置作为默认下次开启的活动ID
end
for _, sectionCfg in pairs(BossSectionTemplates) do
for index, challengeId in ipairs(sectionCfg.ChallengeId) do
ChallengeIdToOrderIdDic[challengeId] = index
end
end
for challengeId, challengeCfg in pairs(BossChallengeTemplates) do
StageIdToChallengeIdDic[challengeCfg.StageId] = challengeId
end
end
function XFubenActivityBossSingleConfigs.GetSectionCfgs()
return BossSectionTemplates
end
function XFubenActivityBossSingleConfigs.GetSectionCfg(sectionId)
local sectionCfg = BossSectionTemplates[sectionId]
if not sectionCfg then
XLog.ErrorTableDataNotFound("XFubenActivityBossSingleConfigs.GetSectionCfg",
"BossSection", TABLE_BOSS_SECTION_PATH, "sectionId", tostring(sectionId))
return
end
return sectionCfg
end
function XFubenActivityBossSingleConfigs.GetStageId(challengeId)
local challengeCfg = BossChallengeTemplates[challengeId]
if not challengeCfg then
XLog.ErrorTableDataNotFound("XFubenActivityBossSingleConfigs.GetStageId",
"BossChallenge", TABLE_BOSS_CHALLENGE_PATH, "challengeId", tostring(challengeId))
return
end
return challengeCfg.StageId
end
function XFubenActivityBossSingleConfigs.GetChanllengeIdByStageId(stageId)
return StageIdToChallengeIdDic[stageId]
end
function XFubenActivityBossSingleConfigs.GetChallengeResCfg(challengeId)
local challengeResCfg = BossChallengeResTemplates[challengeId]
if not challengeResCfg then
XLog.ErrorTableDataNotFound("XFubenActivityBossSingleConfigs.GetChallengeResCfg",
"BossChallengeRes", TABLE_BOSS_CHALLENGE_RES_PATH, "challengeId", tostring(challengeId))
return
end
return challengeResCfg
end
function XFubenActivityBossSingleConfigs.GetChallengeOrderId(challengeId)
return ChallengeIdToOrderIdDic[challengeId] or 0
end
function XFubenActivityBossSingleConfigs.GetActivityConfig(activityId)
local activityCfg = BossActivityTemplates[activityId]
return activityCfg
end
function XFubenActivityBossSingleConfigs.GetDefaultActivityId()
return DefaultActivityId
end
function XFubenActivityBossSingleConfigs.GetBossChallengeTemplates()
return BossChallengeTemplates
end
function XFubenActivityBossSingleConfigs.GetStageAttention(stageId)
if BossChallengeTemplates == nil then
return
end
local challengeId = XFubenActivityBossSingleConfigs.GetChanllengeIdByStageId(stageId)
if BossChallengeTemplates[challengeId].StageAttention ~= nil then
return BossChallengeTemplates[challengeId].StageAttention
end
return nil
end
function XFubenActivityBossSingleConfigs.GetStageAttentionTitle(stageId)
if BossChallengeTemplates == nil then
return
end
local challengeId = XFubenActivityBossSingleConfigs.GetChanllengeIdByStageId(stageId)
if BossChallengeTemplates[challengeId].StageAttention ~= nil then
return BossChallengeTemplates[challengeId].StageAttentionTitle
end
return nil
end
function XFubenActivityBossSingleConfigs.GetChallengeCount(sectionId)
return #BossSectionTemplates[sectionId].ChallengeId
end
function XFubenActivityBossSingleConfigs.GetBossSectionRewardIds(sectionId)
return BossSectionTemplates[sectionId].StarRewardId
end
function XFubenActivityBossSingleConfigs.GetStarRewardCfg(Id)
return BossStarRewardTemplates[Id]
end
function XFubenActivityBossSingleConfigs.GetStarRewardTemplates()
return BossStarRewardTemplates
end
function XFubenActivityBossSingleConfigs.GetBossChallengeEffectPath(stageId)
if BossChallengeTemplates == nil then
return
end
local challengeId = XFubenActivityBossSingleConfigs.GetChanllengeIdByStageId(stageId)
if BossChallengeTemplates[challengeId].EffectPath ~= nil then
return BossChallengeTemplates[challengeId].EffectPath
end
return nil
end
function XFubenActivityBossSingleConfigs.GetLastBossActivityTemplates()
return BossActivityTemplates[#BossActivityTemplates]
end
function XFubenActivityBossSingleConfigs.GetActivityBeginTime(activityId)
local config = XFubenActivityBossSingleConfigs.GetActivityConfig(activityId)
if not config then
config = XFubenActivityBossSingleConfigs.GetLastBossActivityTemplates()
end
return config and XFunctionManager.GetStartTimeByTimeId(config.ActivityTimeId) or 0
end
function XFubenActivityBossSingleConfigs.GetActivityEndTime(activityId)
local config = XFubenActivityBossSingleConfigs.GetActivityConfig(activityId)
if not config then
config = XFubenActivityBossSingleConfigs.GetLastBossActivityTemplates()
end
return config and XFunctionManager.GetEndTimeByTimeId(config.ActivityTimeId) or 0
end
function XFubenActivityBossSingleConfigs.GetFightEndTime(activityId)
local config = XFubenActivityBossSingleConfigs.GetActivityConfig(activityId)
if not config then
config = XFubenActivityBossSingleConfigs.GetLastBossActivityTemplates()
end
return config and XFunctionManager.GetEndTimeByTimeId(config.FightTimeId) or 0
end

View file

@ -0,0 +1,85 @@
local TABLE_FUBEN_BRANCH_ACTIVITY_PATH = "Share/Fuben/FubenBranch/FubenBranchActivity.tab"
local TABLE_FUBEN_BRANCH_CHALLENGE_PATH = "Share/Fuben/FubenBranch/FubenBranchChallenge.tab"
local TABLE_FUBEN_BRANCH_SECTION_PATH = "Share/Fuben/FubenBranch/FubenBranchSection.tab"
local pairs = pairs
local FubenBranchTemplates = {}
local FubenBranchSectionTemplates = {}
local FubenBranchChallengeTemplates = {}
local DefaultActivityId = 0
XFubenActivityBranchConfigs = XFubenActivityBranchConfigs or {}
function XFubenActivityBranchConfigs.Init()
FubenBranchTemplates = XTableManager.ReadByIntKey(TABLE_FUBEN_BRANCH_ACTIVITY_PATH, XTable.XTableFubenBranchActivity, "Id")
FubenBranchSectionTemplates = XTableManager.ReadByIntKey(TABLE_FUBEN_BRANCH_SECTION_PATH, XTable.XTableFubenBranchSection, "Id")
FubenBranchChallengeTemplates = XTableManager.ReadByIntKey(TABLE_FUBEN_BRANCH_CHALLENGE_PATH, XTable.XTableFubenBranchChallenge, "Id")
for activityId, config in pairs(FubenBranchTemplates) do
if XTool.IsNumberValid(config.ActivityTimeId) then
DefaultActivityId = activityId
break
end
DefaultActivityId = activityId--若全部过期取最后一行配置作为默认下次开启的活动ID
end
end
function XFubenActivityBranchConfigs.GetSectionCfgs()
return FubenBranchSectionTemplates
end
function XFubenActivityBranchConfigs.GetChapterCfg(chapterId)
local chapterCfg = FubenBranchChallengeTemplates[chapterId]
if not chapterCfg then
XLog.ErrorTableDataNotFound("XFubenActivityBranchConfigs.GetChapterCfg",
"FubenBranchChallenge", TABLE_FUBEN_BRANCH_CHALLENGE_PATH, "chapterId", tostring(chapterId))
return
end
return chapterCfg
end
function XFubenActivityBranchConfigs.GetSectionCfg(sectionId)
local sectionCfg = FubenBranchSectionTemplates[sectionId]
if not sectionCfg then
XLog.ErrorTableDataNotFound("XFubenActivityBranchConfigs.GetSectionCfg",
"FubenBranchSection", TABLE_FUBEN_BRANCH_SECTION_PATH, "sectionId", tostring(sectionId))
return
end
return sectionCfg
end
function XFubenActivityBranchConfigs.GetActivityConfig(activityId)
local activityCfg = FubenBranchTemplates[activityId]
if not activityCfg then
XLog.ErrorTableDataNotFound("XFubenActivityBranchConfigs.GetActivityConfig",
"FubenBranch", TABLE_FUBEN_BRANCH_ACTIVITY_PATH, "activityId", tostring(activityId))
return
end
return activityCfg
end
function XFubenActivityBranchConfigs.GetDefaultActivityId()
return DefaultActivityId
end
function XFubenActivityBranchConfigs.GetActivityBeginTime(activityId)
local config = XFubenActivityBranchConfigs.GetActivityConfig(activityId)
return XFunctionManager.GetStartTimeByTimeId(config.ActivityTimeId)
end
function XFubenActivityBranchConfigs.GetActivityEndTime(activityId)
local config = XFubenActivityBranchConfigs.GetActivityConfig(activityId)
return XFunctionManager.GetEndTimeByTimeId(config.ActivityTimeId)
end
function XFubenActivityBranchConfigs.GetChallengeBeginTime(activityId)
local config = XFubenActivityBranchConfigs.GetActivityConfig(activityId)
return XFunctionManager.GetStartTimeByTimeId(config.ChallengeTimeId)
end
function XFubenActivityBranchConfigs.GetFightEndTime(activityId)
local config = XFubenActivityBranchConfigs.GetActivityConfig(activityId)
return XFunctionManager.GetEndTimeByTimeId(config.FightTimeId)
end

View file

@ -0,0 +1,148 @@
local tableInsert = table.insert
XFubenActivityPuzzleConfigs = XFubenActivityPuzzleConfigs or {}
XFubenActivityPuzzleConfigs.PuzzleState = {
Incomplete = 0,
Complete = 1,
PuzzleCompleteButNotDecryption = 2,
}
XFubenActivityPuzzleConfigs.CompleteRewardState = {
Unrewarded = 0,
Rewarded = 1,
}
XFubenActivityPuzzleConfigs.PlayVideoState = {
UnPlay = 0,
Played = 1,
}
XFubenActivityPuzzleConfigs.HelpHitFaceState = {
UnHit = 0,
Hited = 1,
}
XFubenActivityPuzzleConfigs.PuzzleType = {
Define = 1,
Decryption = 2,
}
XFubenActivityPuzzleConfigs.PLAY_VIDEO_STATE_KEY = "DRAG_PUZZLE_PLAY_VIDEO_STATE_KEY"
XFubenActivityPuzzleConfigs.HELP_HIT_FACE_KEY = "DRAG_PUZZLE_HELP_HIT_FACE_KEY"
XFubenActivityPuzzleConfigs.PASSWORD_HIT_MESSAGE_COUNT = "PASSWORD_HIT_MESSAGE_COUNT"
local DRAG_PUZZLE_ACTIVITY_PATH = "Share/MiniActivity/DragPuzzle/DragPuzzleActivity.tab"
local DRAG_PUZZLE_ACTIVITY_PUZZLE_PATH = "Share/MiniActivity/DragPuzzle/DragPuzzleActivityPuzzle.tab"
local DRAG_PUZZLE_ACTIVITY_PIECE_PATH = "Share/MiniActivity/DragPuzzle/DragPuzzleActivityPiece.tab"
local DRAG_PUZZLE_ACTIVITY_PASSWORD_PATH = "Share/MiniActivity/DragPuzzle/DragPuzzleActivityPassword.tab"
local ActivityTemplates = {}
local PuzzleTemplates = {}
local PuzzleTemplatesWithAct = {}
local PieceTemplates = {}
local PieceTemplatesWithPuzzle = {}
local PuzzleDecryptionPassword = {}
function XFubenActivityPuzzleConfigs.Init()
ActivityTemplates = XTableManager.ReadByIntKey(DRAG_PUZZLE_ACTIVITY_PATH, XTable.XTableDragPuzzleActivity, "Id")
PuzzleTemplates = XTableManager.ReadByIntKey(DRAG_PUZZLE_ACTIVITY_PUZZLE_PATH, XTable.XTableDragPuzzleActivityPuzzle, "Id")
for _, puzzleInfo in ipairs(PuzzleTemplates) do
if not PuzzleTemplatesWithAct[puzzleInfo.ActId] then
PuzzleTemplatesWithAct[puzzleInfo.ActId] = {}
end
tableInsert(PuzzleTemplatesWithAct[puzzleInfo.ActId], puzzleInfo)
end
PieceTemplates = XTableManager.ReadByIntKey(DRAG_PUZZLE_ACTIVITY_PIECE_PATH, XTable.XTableDragPuzzleActivityPiece, "Id")
for _, pieceInfo in ipairs(PieceTemplates) do
if not PieceTemplatesWithPuzzle[pieceInfo.PuzzleId] then
PieceTemplatesWithPuzzle[pieceInfo.PuzzleId] = {}
end
tableInsert(PieceTemplatesWithPuzzle[pieceInfo.PuzzleId], pieceInfo)
end
local puzzlePasswordTemplates = XTableManager.ReadByIntKey(DRAG_PUZZLE_ACTIVITY_PASSWORD_PATH, XTable.XTableDragPuzzleActivityPassword, "Id")
PuzzleDecryptionPassword = {}
for _, puzzlePasswordTemplate in ipairs(puzzlePasswordTemplates) do
PuzzleDecryptionPassword[puzzlePasswordTemplate.PuzzleId] = puzzlePasswordTemplate
end
end
function XFubenActivityPuzzleConfigs.GetActivityTemplates()
if not ActivityTemplates then
return nil
end
return ActivityTemplates
end
function XFubenActivityPuzzleConfigs.GetActivityTemplateById(actId)
if not ActivityTemplates then
return nil
end
return ActivityTemplates[actId]
end
function XFubenActivityPuzzleConfigs.GetPuzzleTemplateById(id)
return PuzzleTemplates[id]
end
function XFubenActivityPuzzleConfigs.GetPuzzleTemplatesByActId(actId)
if not PuzzleTemplatesWithAct then
return nil
end
return PuzzleTemplatesWithAct[actId]
end
function XFubenActivityPuzzleConfigs.GetPieceTemplatesByPuzzleId(puzzleId)
if not PieceTemplatesWithPuzzle then
return nil
end
return PieceTemplatesWithPuzzle[puzzleId]
end
function XFubenActivityPuzzleConfigs.GetPieceIconById(pieceId)
return PieceTemplates[pieceId].FragmentUrl
end
function XFubenActivityPuzzleConfigs.GetPieceCorrectIdxById(pieceId)
return PieceTemplates[pieceId].CorrectIdx
end
function XFubenActivityPuzzleConfigs.GetPuzzlePasswordHintById(puzzleId)
if not PuzzleDecryptionPassword[puzzleId] then
XLog.Error("Can Find Password Info By PieceId:" .. puzzleId .. ",Plase Check " ..DRAG_PUZZLE_ACTIVITY_PASSWORD_PATH)
end
return PuzzleDecryptionPassword[puzzleId].PasswordHint
end
function XFubenActivityBossSingleConfigs.GetPuzzlePasswordHintMessage(puzzleId)
if not PuzzleDecryptionPassword[puzzleId] then
XLog.Error("Can Find Password Info By PieceId:" .. puzzleId .. ",Plase Check " ..DRAG_PUZZLE_ACTIVITY_PASSWORD_PATH)
end
return PuzzleDecryptionPassword[puzzleId].HintMessage
end
function XFubenActivityPuzzleConfigs.GetPuzzlePasswordLengthById(puzzleId)
if not PuzzleDecryptionPassword[puzzleId] then
XLog.Error("Can Find Password Info By PieceId:" .. puzzleId .. ",Plase Check " ..DRAG_PUZZLE_ACTIVITY_PASSWORD_PATH)
return 0
end
return #PuzzleDecryptionPassword[puzzleId].Password
end
function XFubenActivityPuzzleConfigs.GetPuzzleDecryptionImgUrl(puzzleId)
if not PuzzleDecryptionPassword[puzzleId] then
XLog.Error("Can Find Password Info By PieceId:" .. puzzleId .. ",Plase Check " ..DRAG_PUZZLE_ACTIVITY_PASSWORD_PATH)
end
return PuzzleDecryptionPassword[puzzleId].DecryptionImgUrl
end

View file

@ -0,0 +1,50 @@
XFubenAssignConfigs = XFubenAssignConfigs or {}
local ChapterTemplates = {}
local GroupTemplates = {}
local TeamInfoTemplates = {}
function XFubenAssignConfigs.Init()
ChapterTemplates = XTableManager.ReadByIntKey("Share/Fuben/Assign/AssignChapter.tab", XTable.XTableAssignChapter, "ChapterId")
GroupTemplates = XTableManager.ReadByIntKey("Share/Fuben/Assign/AssignGroup.tab", XTable.XTableAssignGroup, "GroupId")
TeamInfoTemplates = XTableManager.ReadByIntKey("Share/Fuben/Assign/AssignTeamInfo.tab", XTable.XTableAssignTeamInfo, "Id")
end
function XFubenAssignConfigs.GetChapterTemplates()
return ChapterTemplates
end
function XFubenAssignConfigs.GetGroupTemplates()
return GroupTemplates
end
function XFubenAssignConfigs.GetTeamInfoTemplates()
return TeamInfoTemplates
end
function XFubenAssignConfigs.GetChapterTemplateById(id)
local config = ChapterTemplates[id]
if not config then
XLog.ErrorTableDataNotFound("XFubenAssignConfigs.GetChapterTemplateById",
"AssignChapter", "Share/Fuben/Assign/AssignChapter.tab", "Id", tostring(id))
end
return config
end
function XFubenAssignConfigs.GetGroupTemplateById(id)
local config = GroupTemplates[id]
if not config then
XLog.ErrorTableDataNotFound("XFubenAssignConfigs.GetGroupTemplateById",
"AssignGroup", "Share/Fuben/Assign/AssignGroup.tab", "Id", tostring(id))
end
return config
end
function XFubenAssignConfigs.GetTeamInfoTemplateById(id)
local config = TeamInfoTemplates[id]
if not config then
XLog.ErrorTableDataNotFound("XFubenAssignConfigs.GetTeamInfoTemplateById",
"AssignTeamInfo", "Share/Fuben/Assign/AssignTeamInfo.tab", "Id", tostring(id))
end
return config
end

View file

@ -0,0 +1,407 @@
local tableInsert = table.insert
XFubenBabelTowerConfigs = {}
local SHARE_BABEL_ACTIVITY = "Share/Fuben/BabelTower/BabelTowerActivity.tab"
local SHARE_BABEL_BUFF = "Share/Fuben/BabelTower/BabelTowerBuff.tab"
local SHARE_BABEL_BUFFGROUP = "Share/Fuben/BabelTower/BabelTowerBuffGroup.tab"
local SHARE_BABEL_RANKLEVEL = "Share/Fuben/BabelTower/BabelTowerRankLevel.tab"
local SHARE_BABEL_STAGE = "Share/Fuben/BabelTower/BabelTowerStage.tab"
local SHARE_BABEL_STAGEGUIDE = "Share/Fuben/BabelTower/BabelTowerStageGuide.tab"
local SHARE_BABEL_SUPPORTCONDITION = "Share/Fuben/BabelTower/BabelTowerSupportCondition.tab"
local SHARE_BABEL_RANKREWARD = "Share/Fuben/BabelTower/BabelTowerRankReward.tab"
local SHARE_BABEL_STAGELEVEL = "Share/Fuben/BabelTower/BabelTowerStageLevel.tab"
local CLIENT_BABEL_STAGEGUIDEDETAIL = "Client/Fuben/BabelTower/BabelTowerStageGuideDetails.tab"
local CLIENT_BABEL_BUFFDETAIL = "Client/Fuben/BabelTower/BabelTowerBuffDetails.tab"
local CLIENT_BABEL_BUFFGROUPDETAIL = "Client/Fuben/BabelTower/BabelTowerBuffGroupDetails.tab"
local CLIENT_BABEL_ACTIVITYDIFFICULTY = "Client/Fuben/BabelTower/BabelTowerActivityDifficulty.tab"
local CLIENT_BABEL_STAGEDETAIL = "Client/Fuben/BabelTower/BabelTowerStageDetails.tab"
local CLIENT_BABEL_ACTIVITYDETAIL = "Client/Fuben/BabelTower/BabelTowerActivityDetails.tab"
local CLIENT_BABEL_CONDITIONDETAIL = "Client/Fuben/BabelTower/BabelTowerConditionDetails.tab"
local BabelActivityTemplate = {}
local BabelBuffTemplate = {}
local BabelBuffGroupTemplate = {}
local BabelRankLevelTemplate = {}
local BabelStageTemplate = {}
local BabelStageGuideTemplate = {}
local BabelSupportConditionTemplate = {}
local BabelRankRewardTemplate = {}
local BabelStageLevelDic = {}
local BabelStageLevelLockBuffIdDic = {}
local BabelStageGuideDetailsConfigs = {}
local BabelBuffDetailsConfigs = {}
local BabelBuffGroupDetailsConfigs = {}
local BabelActivityDifficultyConfigs = {}
local BabelStageConfigs = {}
local BabelActivityDetailsConfigs = {}
local BabelConditionDetailsConfigs = {}
XFubenBabelTowerConfigs.MAX_TEAM_MEMBER = 3 -- 最多出站人数
XFubenBabelTowerConfigs.LEADER_POSITION = 1 -- 队长位置
XFubenBabelTowerConfigs.FIRST_FIGHT_POSITION = 1 -- 首发位置
XFubenBabelTowerConfigs.BabelTowerStatus = {
Close = 0,
Open = 1,
FightEnd = 2,
End = 3
}
XFubenBabelTowerConfigs.RankPlaform = {
Win = 0,
Android = 1,
IOS = 2,
}
XFubenBabelTowerConfigs.RankType = {
NoRank = 0,
OnlyRank = 1,
RankAndReward = 2,
}
XFubenBabelTowerConfigs.Difficult = {
Default = 0,
Easy = 1,
Normal = 2,
Middle = 3,
Hard = 4,
Count = 4,
}
XFubenBabelTowerConfigs.RankIcon = {
[1] = CS.XGame.ClientConfig:GetString("BabelTowerRankIcon1"),
[2] = CS.XGame.ClientConfig:GetString("BabelTowerRankIcon2"),
[3] = CS.XGame.ClientConfig:GetString("BabelTowerRankIcon3"),
}
XFubenBabelTowerConfigs.ChallengePhase = 1 -- 选择挑战阶段
XFubenBabelTowerConfigs.SupportPhase = 2 -- 选择支援阶段
XFubenBabelTowerConfigs.CHALLENGE_CHILD_UI = "UiBabelTowerChildChallenge" -- 挑战界面
XFubenBabelTowerConfigs.SUPPORT_CHILD_UI = "UiBabelTowerChildSupport" -- 支援界面
XFubenBabelTowerConfigs.TIPSTYPE_ENVIRONMENT = 1 -- 环境情报
XFubenBabelTowerConfigs.TIPSTYPE_CHALLENGE = 2 -- 挑战详情
XFubenBabelTowerConfigs.TIPSTYPE_SUPPORT = 3 -- 支援详情
XFubenBabelTowerConfigs.TYPE_CHALLENGE = 1 --挑战类型
XFubenBabelTowerConfigs.TYPE_SUPPORT = 2 --支援类型
-- 准备结束界面tips
XFubenBabelTowerConfigs.BattleReady = 1
XFubenBabelTowerConfigs.BattleEnd = 2
XFubenBabelTowerConfigs.MAX_BUFF_COUNT = 10
XFubenBabelTowerConfigs.MAX_CHALLENGE_BUFF_COUNT = CS.XGame.ClientConfig:GetInt("BabelTowerMaxChallengeBuff")
XFubenBabelTowerConfigs.MAX_SUPPORT_BUFF_COUNT = CS.XGame.ClientConfig:GetInt("BabelTowerMaxSupportBuff")
XFubenBabelTowerConfigs.START_INDEX = 0
-- 事态类型
XFubenBabelTowerConfigs.DIFFICULTY_NONE = 0
XFubenBabelTowerConfigs.DIFFICULTY_NORMAL = 1 -- 普通
XFubenBabelTowerConfigs.DIFFICULTY_URGENCY = 2 -- 紧急
XFubenBabelTowerConfigs.DIFFICULTY_CRITICAL = 3 -- 高危
-- 上次选中的StageId key
XFubenBabelTowerConfigs.LAST_SELECT_KEY = "BabelTowerLastSelectedStageId"
-- 第一次查看环境
XFubenBabelTowerConfigs.ENVIROMENT_DOT_KEY = "babelenvironment_%s_%s_%s"
-- 第一次播放剧情
XFubenBabelTowerConfigs.HAS_PLAY_BEGINSTORY = "BabelTowerPlayBeginStory"
local function InitStageLevelConfig()
local template = XTableManager.ReadByIntKey(SHARE_BABEL_STAGELEVEL, XTable.XTableBabelTowerStageLevel, "Id")
for _, config in pairs(template) do
local stageId = config.StageId
local stageConfig = BabelStageLevelDic[stageId]
if not stageConfig then
stageConfig = {}
BabelStageLevelDic[stageId] = stageConfig
end
local level = config.Level
stageConfig[level] = config
local stageLockBuffIdDic = BabelStageLevelLockBuffIdDic[stageId]
if not stageLockBuffIdDic then
stageLockBuffIdDic = {}
BabelStageLevelLockBuffIdDic[stageId] = stageLockBuffIdDic
end
local lockBuffIds = config.LockBuffId
for _, buffId in pairs(lockBuffIds) do
if buffId ~= 0 then
local oldLevel = stageLockBuffIdDic[buffId] or 0
if level > oldLevel then
stageLockBuffIdDic[buffId] = level
end
end
end
end
end
function XFubenBabelTowerConfigs.Init()
BabelActivityTemplate = XTableManager.ReadByIntKey(SHARE_BABEL_ACTIVITY, XTable.XTableBabelTowerActivity, "Id")
BabelBuffTemplate = XTableManager.ReadByIntKey(SHARE_BABEL_BUFF, XTable.XTableBabelTowerBuff, "Id")
BabelBuffGroupTemplate = XTableManager.ReadByIntKey(SHARE_BABEL_BUFFGROUP, XTable.XTableBabelTowerBuffGroup, "Id")
BabelRankLevelTemplate = XTableManager.ReadByIntKey(SHARE_BABEL_RANKLEVEL, XTable.XTableBabelTowerRankLevel, "Id")
BabelStageTemplate = XTableManager.ReadByIntKey(SHARE_BABEL_STAGE, XTable.XTableBabelTowerStage, "Id")
BabelStageGuideTemplate = XTableManager.ReadByIntKey(SHARE_BABEL_STAGEGUIDE, XTable.XTableBabelTowerStageGuide, "Id")
BabelSupportConditionTemplate = XTableManager.ReadByIntKey(SHARE_BABEL_SUPPORTCONDITION, XTable.XTableBabelTowerSupportCondition, "Id")
BabelRankRewardTemplate = XTableManager.ReadByIntKey(SHARE_BABEL_RANKREWARD, XTable.XTableBabelTowerRankReward, "Id")
BabelStageGuideDetailsConfigs = XTableManager.ReadByIntKey(CLIENT_BABEL_STAGEGUIDEDETAIL, XTable.XTableBabelTowerStageGuideDetails, "Id")
BabelBuffDetailsConfigs = XTableManager.ReadByIntKey(CLIENT_BABEL_BUFFDETAIL, XTable.XTableBabelTowerBuffDetails, "Id")
BabelBuffGroupDetailsConfigs = XTableManager.ReadByIntKey(CLIENT_BABEL_BUFFGROUPDETAIL, XTable.XTableBabelTowerBuffGroupDetails, "Id")
BabelActivityDifficultyConfigs = XTableManager.ReadByIntKey(CLIENT_BABEL_ACTIVITYDIFFICULTY, XTable.XTableBabelTowerActivityDifficulty, "Id")
BabelStageConfigs = XTableManager.ReadByIntKey(CLIENT_BABEL_STAGEDETAIL, XTable.XTableBabelTowerStageDetails, "Id")
BabelActivityDetailsConfigs = XTableManager.ReadByIntKey(CLIENT_BABEL_ACTIVITYDETAIL, XTable.XTableBabelTowerActivityDetails, "Id")
BabelConditionDetailsConfigs = XTableManager.ReadByIntKey(CLIENT_BABEL_CONDITIONDETAIL, XTable.XTableBabelTowerConditionDetails, "Id")
InitStageLevelConfig()
end
function XFubenBabelTowerConfigs.GetActivityName(id)
if not BabelActivityDetailsConfigs[id] then return "" end
return BabelActivityDetailsConfigs[id].Name
end
function XFubenBabelTowerConfigs.GetActivityBeginStory(id)
if not BabelActivityDetailsConfigs[id] then return nil end
return BabelActivityDetailsConfigs[id].BeginStoryId
end
function XFubenBabelTowerConfigs.GetActivityRankTitle(id)
if not BabelActivityDetailsConfigs[id] then return nil end
return BabelActivityDetailsConfigs[id].RankTitle
end
function XFubenBabelTowerConfigs.GetConditionDescription(id)
if not BabelConditionDetailsConfigs[id] then return "" end
return BabelConditionDetailsConfigs[id].Desc
end
function XFubenBabelTowerConfigs.GetAllBabelTowerActivityTemplate()
return BabelActivityTemplate
end
function XFubenBabelTowerConfigs.GetBabelTowerActivityTemplateById(id)
if not BabelActivityTemplate[id] then
XLog.ErrorTableDataNotFound("XFubenBabelTowerConfigs.GetBabelTowerActivityTemplateById",
"BabelTowerActivity", SHARE_BABEL_ACTIVITY, "Id", tostring(id))
return nil
end
return BabelActivityTemplate[id]
end
-- 获取stage数据,加成相关
function XFubenBabelTowerConfigs.GetBabelTowerStageTemplate(stageId)
if not BabelStageTemplate[stageId] then
XLog.ErrorTableDataNotFound("XFubenBabelTowerConfigs.GetBabelTowerStageTemplate",
"BabelTowerStage", SHARE_BABEL_STAGE, "stageId", tostring(stageId))
return nil
end
return BabelStageTemplate[stageId]
end
function XFubenBabelTowerConfigs.GetBaseBuffIds(stageId)
local buffIds = {}
local config = XFubenBabelTowerConfigs.GetBabelTowerStageTemplate(stageId)
for _, buffId in pairs(config.BaseBuffId) do
if buffId > 0 then
tableInsert(buffIds, buffId)
end
end
return buffIds
end
function XFubenBabelTowerConfigs.GetStageTeamCount(stageId)
local config = XFubenBabelTowerConfigs.GetBabelTowerStageTemplate(stageId)
return config.TeamCount
end
-- 引导的数据
function XFubenBabelTowerConfigs.GetBabelTowerStageGuideTemplate(guideId)
if not BabelStageGuideTemplate[guideId] then
XLog.ErrorTableDataNotFound("XFubenBabelTowerConfigs.GetBabelTowerStageGuideTemplate",
"BabelTowerStageGuide", SHARE_BABEL_STAGEGUIDE, "guideId", tostring(guideId))
return nil
end
return BabelStageGuideTemplate[guideId]
end
-- 关卡引导的本地数据
function XFubenBabelTowerConfigs.GetStageGuideConfigs(guideId)
if not BabelStageGuideDetailsConfigs[guideId] then
XLog.ErrorTableDataNotFound("XFubenBabelTowerConfigs.GetStageGuideConfigs",
"StageGuideDetails", CLIENT_BABEL_STAGEGUIDEDETAIL, "guideId", tostring(guideId))
return nil
end
return BabelStageGuideDetailsConfigs[guideId]
end
-- buffGroup组的本地数据
function XFubenBabelTowerConfigs.GetBabelBuffGroupConfigs(buffGroupId)
if not BabelBuffGroupDetailsConfigs[buffGroupId] then
XLog.ErrorTableDataNotFound("XFubenBabelTowerConfigs.GetBuffGroupConfigs",
"BabelBuffGroupDetails", CLIENT_BABEL_BUFFGROUPDETAIL, "buffGroupId", tostring(buffGroupId))
return nil
end
return BabelBuffGroupDetailsConfigs[buffGroupId]
end
function XFubenBabelTowerConfigs.IsBuffGroupHard(buffGroupId)
local config = XFubenBabelTowerConfigs.GetBabelBuffGroupConfigs(buffGroupId)
return config and config.IsStress and config.IsStress ~= 0
end
-- buff的本地数据
function XFubenBabelTowerConfigs.GetBabelBuffConfigs(buffId)
if not BabelBuffDetailsConfigs[buffId] then
XLog.ErrorTableDataNotFound("XFubenBabelTowerConfigs.GetBabelBuffConfigs",
"BabelBuffGroupDetails", CLIENT_BABEL_BUFFDETAIL, "buffId", tostring(buffId))
return nil
end
return BabelBuffDetailsConfigs[buffId]
end
function XFubenBabelTowerConfigs.GetBaseBuffNameWithSpilt(buffId)
local config = XFubenBabelTowerConfigs.GetBabelBuffConfigs(buffId)
return XUiHelper.RichTextToTextString(config.Name)
end
-- stage本地数据
function XFubenBabelTowerConfigs.GetBabelStageConfigs(stageId)
if not BabelStageConfigs[stageId] then
XLog.ErrorTableDataNotFound("XFubenBabelTowerConfigs.GetBabelStageConfigs",
"BabelStageDetails", CLIENT_BABEL_STAGEDETAIL, "stageId", tostring(stageId))
return nil
end
return BabelStageConfigs[stageId]
end
function XFubenBabelTowerConfigs.GetStageName(stageId)
local config = XFubenBabelTowerConfigs.GetBabelStageConfigs(stageId)
return config.Name
end
-- 排行榜分段
function XFubenBabelTowerConfigs.GetBabelTowerRankLevelTemplate(id)
if not BabelRankLevelTemplate[id] then
XLog.ErrorTableDataNotFound("XFubenBabelTowerConfigs.GetBabelTowerRankLevelTemplate", "RankLevel", SHARE_BABEL_RANKLEVEL, "Id", tostring(id))
return nil
end
return BabelRankLevelTemplate[id]
end
-- 支援条件
function XFubenBabelTowerConfigs.GetBabelTowerSupportConditonTemplate(supportId)
if not BabelSupportConditionTemplate[supportId] then
XLog.ErrorTableDataNotFound("XFubenBabelTowerConfigs.GetBabelTowerSupportConditonTemplate",
"SupportCondition", SHARE_BABEL_SUPPORTCONDITION, "supportId", tostring(supportId))
return nil
end
return BabelSupportConditionTemplate[supportId]
end
-- buff组
function XFubenBabelTowerConfigs.GetBabelTowerBuffGroupTemplate(groupId)
if not BabelBuffGroupTemplate[groupId] then
XLog.ErrorTableDataNotFound("XFubenBabelTowerConfigs.GetBabelTowerBuffGroupTemplate",
"BabelTowerBuffGroup", SHARE_BABEL_BUFFGROUP, "groupId", tostring(groupId))
return nil
end
return BabelBuffGroupTemplate[groupId]
end
-- buff
function XFubenBabelTowerConfigs.GetBabelTowerBuffTemplate(buffId)
if not BabelBuffTemplate[buffId] then
XLog.ErrorTableDataNotFound("XFubenBabelTowerConfigs.GetBabelTowerBuffTemplate", "BabelBuff", SHARE_BABEL_BUFF, "buffId", tostring(buffId))
return nil
end
return BabelBuffTemplate[buffId]
end
function XFubenBabelTowerConfigs.GetBabelTowerDifficulty(stageId, challengePoints)
local difficultyConfigs = BabelActivityDifficultyConfigs[stageId]
if not difficultyConfigs then
return XFubenBabelTowerConfigs.DIFFICULTY_NONE, "", ""
end
if challengePoints >= difficultyConfigs.Critical then
return XFubenBabelTowerConfigs.DIFFICULTY_CRITICAL, difficultyConfigs.CriticalTitle, difficultyConfigs.CriticalStatus
end
if challengePoints >= difficultyConfigs.Urgency then
return XFubenBabelTowerConfigs.DIFFICULTY_URGENCY, difficultyConfigs.UrgencyTitle, difficultyConfigs.UrgencyStatus
end
return XFubenBabelTowerConfigs.DIFFICULTY_NORMAL, difficultyConfigs.NormalTitle, difficultyConfigs.NormalStatus
end
function XFubenBabelTowerConfigs.GetBabelTowerRankReward(rankLevel)
local rankRewards = {}
for _, rankReward in pairs(BabelRankRewardTemplate) do
if rankReward.LevelId == rankLevel then
table.insert(rankRewards, {
Id = rankReward.Id,
RankLevel = rankReward.LevelId,
MinRank = rankReward.MinRank,
MaxRank = rankReward.MaxRank,
MailId = rankReward.MailId,
RankIcon = rankReward.RankIcon
})
end
end
table.sort(rankRewards, function(rank1, rank2)
return rank1.MinRank < rank2.MinRank
end)
return rankRewards
end
function XFubenBabelTowerConfigs.GetStageDifficultConfigs(stageId)
local config = BabelStageLevelDic[stageId]
if not config then
XLog.Error("XFubenBabelTowerConfigs.GetStageDifficultConfigs Error: stageId is: " .. stageId .. " ,path is: " .. SHARE_BABEL_STAGELEVEL)
return
end
return config
end
function XFubenBabelTowerConfigs.GetStageDifficultConfig(stageId, difficult)
local configs = XFubenBabelTowerConfigs.GetStageDifficultConfigs(stageId)
local config = configs[difficult]
if not config then
XLog.Error("XFubenBabelTowerConfigs.GetStageDifficultConfig Error: difficult is: " .. difficult .. " ,path is: " .. SHARE_BABEL_STAGELEVEL, BabelStageLevelDic)
return
end
return config
end
function XFubenBabelTowerConfigs.GetStageDifficultLockBuffIdOpenLevel(stageId, buffId)
local config = BabelStageLevelLockBuffIdDic[stageId]
if not config then return 0 end
return config[buffId] or 0
end
function XFubenBabelTowerConfigs.GetStageDifficultRecommendAblity(stageId, difficult)
local config = XFubenBabelTowerConfigs.GetStageDifficultConfig(stageId, difficult)
return config.RecommendAblity
end
function XFubenBabelTowerConfigs.GetStageDifficultName(stageId, difficult)
local config = XFubenBabelTowerConfigs.GetStageDifficultConfig(stageId, difficult)
return config.Name
end
function XFubenBabelTowerConfigs.GetStageDifficultRatio(stageId, difficult)
local config = XFubenBabelTowerConfigs.GetStageDifficultConfig(stageId, difficult)
return config.ScoreRatio
end

View file

@ -0,0 +1,31 @@
XFubenBossOnlineConfig = XFubenBossOnlineConfig or {}
local OnlineBossSectionTemplates = {}
local OnlineBossChapterTemplates = {}
local OnlineBossRiskTemplates = {}
local TABLE_FUBEN_ONLINEBOSS_SECTION = "Share/Fuben/BossOnline/BossOnlineSection.tab"
local TABLE_FUBEN_ONLINEBOSS_CHAPTER = "Share/Fuben/BossOnline/BossOnlineChapter.tab"
local TABLE_FUBEN_ONLINEBOSS_RISK = "Share/Fuben/BossOnline/BossOnlineRisk.tab"
function XFubenBossOnlineConfig.Init()
OnlineBossChapterTemplates = XTableManager.ReadByIntKey(TABLE_FUBEN_ONLINEBOSS_CHAPTER, XTable.XTableBossOnlineChapter, "Id")
OnlineBossSectionTemplates = XTableManager.ReadByIntKey(TABLE_FUBEN_ONLINEBOSS_SECTION, XTable.XTableBossOnlineSection, "Id")
OnlineBossRiskTemplates = XTableManager.ReadByIntKey(TABLE_FUBEN_ONLINEBOSS_RISK, XTable.XTableBossOnlineRisk, "Id")
end
function XFubenBossOnlineConfig.GetChapterTemplates()
return OnlineBossChapterTemplates
end
function XFubenBossOnlineConfig.GetSectionTemplates()
return OnlineBossSectionTemplates
end
function XFubenBossOnlineConfig.GetRiskTemplate(count)
for _, v in pairs(OnlineBossRiskTemplates) do
if (v.MinCount <= 0 or count >= v.MinCount) and (v.MaxCount <= 0 or count <= v.MaxCount) then
return v
end
end
end

View file

@ -0,0 +1,181 @@
local table = table
local tableInsert = table.insert
local tableSort = table.sort
XFubenBossSingleConfigs = XFubenBossSingleConfigs or {}
XFubenBossSingleConfigs.Platform = {
Win = 0,
Android = 1,
IOS = 2,
All = 3
}
XFubenBossSingleConfigs.LevelType = {
Chooseable = 0, --未选择(高级区达成晋级终极区条件)
Normal = 1, --低级区
Medium = 2, --中极区
High = 3, --高级区
Extreme = 4, --终极区
}
XFubenBossSingleConfigs.DifficultyType = {
experiment = 1,
elites = 2,
kinght = 3,
chaos = 4,
hell = 5,
Hide = 6,
}
local TABLE_BOSS_SINGLE_GRADE = "Share/Fuben/BossSingle/BossSingleGrade.tab"
local TABLE_RABK_REWARD = "Share/Fuben/BossSingle/BossSingleRankReward.tab"
local TABLE_SCORE_REWARD = "Share/Fuben/BossSingle/BossSingleScoreReward.tab"
local TABLE_SECTION = "Share/Fuben/BossSingle/BossSingleSection.tab"
local TABLE_STAGE = "Share/Fuben/BossSingle/BossSingleStage.tab"
local TABLE_SOCRE_ROLE = "Share/Fuben/BossSingle/BossSingleScoreRule.tab"
local TABLE_GROUP = "Share/Fuben/BossSingle/BossSingleGroup.tab"
-- templates
local BossSingleGradeCfg = {}
local RankRewardCfg = {} -- key = levelType, value = {cfg}
local ScoreRewardCfg = {} -- key = levelType, value = {cfg}
local BossSectionCfg = {}
local BossStageCfg = {}
local BossSectionInfo = {}
local RankRole = {}
local BossGourpCfg = {}
XFubenBossSingleConfigs.AUTO_FIGHT_COUNT = CS.XGame.Config:GetInt("BossSingleAutoFightCount")
XFubenBossSingleConfigs.AUTO_FIGHT_REBATE = CS.XGame.Config:GetInt("BossSingleAutoFightRebate")
function XFubenBossSingleConfigs.Init()
BossSingleGradeCfg = XTableManager.ReadByIntKey(TABLE_BOSS_SINGLE_GRADE, XTable.XTableBossSingleGrade, "LevelType")
local rankRewardCfg = XTableManager.ReadByIntKey(TABLE_RABK_REWARD, XTable.XTableBossSingleRankReward, "Id")
local scoreRewardCfg = XTableManager.ReadByIntKey(TABLE_SCORE_REWARD, XTable.XTableBossSingleScoreReward, "Id")
BossSectionCfg = XTableManager.ReadByIntKey(TABLE_SECTION, XTable.XTableBossSingleSection, "Id")
BossStageCfg = XTableManager.ReadByIntKey(TABLE_STAGE, XTable.XTableBossSingleStage, "StageId")
BossGourpCfg = XTableManager.ReadByIntKey(TABLE_GROUP, XTable.XTableBossSingleGroup, "Id")
RankRole = XTableManager.ReadByIntKey(TABLE_SOCRE_ROLE, XTable.XTableBossSingleScoreRule, "Id")
-- 讨伐值奖励排序
for _, cfg in pairs(scoreRewardCfg) do
if ScoreRewardCfg[cfg.LevelType] then
tableInsert(ScoreRewardCfg[cfg.LevelType], cfg)
else
ScoreRewardCfg[cfg.LevelType] = {}
tableInsert(ScoreRewardCfg[cfg.LevelType], cfg)
end
end
for _, scoreList in pairs(ScoreRewardCfg) do
tableSort(scoreList, function(a, b)
if a.Score ~= b.Score then
return a.Score < b.Score
end
return a.Id < b.Id
end)
end
-- 排行奖励排序
for _, cfg in pairs(rankRewardCfg) do
if RankRewardCfg[cfg.LevelType] then
tableInsert(RankRewardCfg[cfg.LevelType], cfg)
else
RankRewardCfg[cfg.LevelType] = {}
tableInsert(RankRewardCfg[cfg.LevelType], cfg)
end
end
for _, rankList in pairs(RankRewardCfg) do
tableSort(rankList, function(a, b)
return a.Id < b.Id
end)
end
-- BossSectionInfo = {key = bossId, value = {stageCfg}}
for id, cfg in pairs(BossSectionCfg) do
BossSectionInfo[id] = {}
for i = 1, #cfg.StageId do
local stageCfg = BossStageCfg[cfg.StageId[i]]
tableInsert(BossSectionInfo[id], stageCfg)
end
end
for _, cfgs in pairs(BossSectionInfo) do
tableSort(cfgs, function(a, b)
if a.DifficultyType ~= b.DifficultyType then
return a.DifficultyType < b.DifficultyType
end
return a.Id < b.Id
end)
end
end
function XFubenBossSingleConfigs.GetBossSingleGradeCfg()
return BossSingleGradeCfg
end
function XFubenBossSingleConfigs.GetBossSectionCfg()
return BossSectionCfg
end
function XFubenBossSingleConfigs.GetBossSectionInfo()
return BossSectionInfo
end
function XFubenBossSingleConfigs.GetBossStageCfg()
return BossStageCfg
end
function XFubenBossSingleConfigs.GetRankRole()
return RankRole
end
function XFubenBossSingleConfigs.GetScoreRewardCfg()
return ScoreRewardCfg
end
function XFubenBossSingleConfigs.GetRankRewardCfg()
return RankRewardCfg
end
function XFubenBossSingleConfigs.GetBossSingleGroupById(id)
return BossGourpCfg[id]
end
function XFubenBossSingleConfigs.IsInBossSectionTime(bossId)
local sectionCfg = BossSectionCfg[bossId]
local openTime = XFunctionManager.GetStartTimeByTimeId(sectionCfg.SwitchTimeId)
if not openTime or openTime <= 0 then
return true
end
local closeTime = XFunctionManager.GetEndTimeByTimeId(sectionCfg.SwitchTimeId)
if not closeTime or closeTime <= 0 then
return true
end
local nowTime = XTime.GetServerNowTimestamp()
return openTime <= nowTime and nowTime < closeTime
end
function XFubenBossSingleConfigs.GetBossSectionLeftTime(bossId)
local sectionCfg = BossSectionCfg[bossId]
local closeTime = XFunctionManager.GetEndTimeByTimeId(sectionCfg.SwitchTimeId)
if not closeTime or closeTime <= 0 then
return 0
end
local nowTime = XTime.GetServerNowTimestamp()
local leftTime = closeTime - nowTime
return leftTime
end
function XFubenBossSingleConfigs.GetBossSectionTeamBuffId(bossId)
local sectionCfg = BossSectionCfg[bossId]
return sectionCfg and sectionCfg.TeamBuffId
end

View file

@ -0,0 +1,622 @@
local CSXGameClientConfig = CS.XGame.ClientConfig
local CSXTextManagerGetText = CS.XTextManager.GetText
XFubenConfigs = XFubenConfigs or {}
local TABLE_STAGE = "Share/Fuben/Stage.tab"
local TABLE_MULTICHALLENGE_STAGE = "Share/Fuben/MultiChallengeStage.tab"
local TABLE_STAGE_TRANSFORM = "Share/Fuben/StageTransform.tab"
local TABLE_STAGE_LEVEL_CONTROL = "Share/Fuben/StageLevelControl.tab"
local TABLE_STAGE_MULTIPLAYER_LEVEL_CONTROL = "Share/Fuben/StageMultiplayerLevelControl.tab"
local TABLE_FLOP_REWARD = "Share/Fuben/FlopReward.tab"
local TABLE_STAGE_FIGHT_CONTROL = "Share/Fuben/StageFightControl.tab" --副本战力限制表
local TABLE_CHALLENGE_BANNER = "Share/Fuben/FubenChallengeBanner.tab"
local TABLE_ACTIVITY_SORTRULE = "Client/Fuben/ActivitySortRule/ActivitySortRule.tab"
local TABLE_FUBENFEATURES = "Client/Fuben/FubenFeatures.tab" -- 特性展示表
local TABLE_STAGE_CHARACTERLIMIT = "Share/Fuben/StageCharacterLimit.tab" -- 角色类型限制buff
local TABLE_BOSS_TEAMBUFF = "Share/Fuben/StageTeamBuff.tab"
local TABLE_STAGE_FIGHT_EVENT_DETAILS = "Client/Fuben/StageFightEventDetails.tab"
local TABLE_STAGE_FIGHT_EVENT = "Share/Fuben/StageFightEvent.tab"
local TABLE_SETTLE_LOST_TIP = "Client/Fuben/SettleLoseTip.tab" -- 失败结算界面提示
local TABLE_STAGE_RECOMMEND_PATH = "Client/Fuben/StageRecommend.tab" -- 关卡推荐表
local StageCfg = {}
local StageTransformCfg = {}
local StageLevelControlCfg = {}
local StageMultiplayerLevelControlCfg = {}
local FlopRewardTemplates = {}
local StageFightControlCfg = {}
local FubenChallengeBanners = {}
local ActivitySortRules = {}
local FubenFeatures = {}
local MultiChallengeConfigs = {}
local FubenNewChallenge
local StageCharacterLimitBuffConfig = {}
local TeamBuffCfg = {}
local TeamBuffMaxCountDic = {}
local StageFightEvent = {}
local StageFightEventDetails = {}
local SettleLoseTipCfg = {}
local StageRecommendConfigs = {}
XFubenConfigs.STAGETYPE_COMMON = 0
XFubenConfigs.STAGETYPE_FIGHT = 1
XFubenConfigs.STAGETYPE_STORY = 2
XFubenConfigs.STAGETYPE_STORYEGG = 3
XFubenConfigs.STAGETYPE_FIGHTEGG = 4
XFubenConfigs.FUBENTYPE_NORMAL = 0
XFubenConfigs.FUBENTYPE_PREQUEL = 1
XFubenConfigs.ROOM_MAX_WORLD = CSXGameClientConfig:GetInt("MultiplayerRoomRowMaxWorld")
XFubenConfigs.ROOM_WORLD_TIME = CSXGameClientConfig:GetInt("MultiplayerRoomWorldTime")
XFubenConfigs.CharacterLimitType = {
All = 0, --构造体/感染体
Normal = 1, --构造体
Isomer = 2, --感染体
IsomerDebuff = 3, --构造体/感染体(Debuff) [AKA:低浓度区]
NormalDebuff = 4, --构造体(Debuff)/感染体 [AKA:重灾区]
}
function XFubenConfigs.Init()
StageCfg = XTableManager.ReadByIntKey(TABLE_STAGE, XTable.XTableStage, "StageId")
MultiChallengeConfigs = XTableManager.ReadByIntKey(TABLE_MULTICHALLENGE_STAGE, XTable.XTableMultiChallengeStage, "Id")
StageLevelControlCfg = XTableManager.ReadByIntKey(TABLE_STAGE_LEVEL_CONTROL, XTable.XTableStageLevelControl, "Id")
StageMultiplayerLevelControlCfg = XTableManager.ReadByIntKey(TABLE_STAGE_MULTIPLAYER_LEVEL_CONTROL, XTable.XTableStageMultiplayerLevelControl, "Id")
StageTransformCfg = XTableManager.ReadByIntKey(TABLE_STAGE_TRANSFORM, XTable.XTableStageTransform, "Id")
--TowerSectionCfg = XTableManager.ReadByIntKey(TABLE_TOWER_SECTION, XTable.XTableTowerSection, "Id")
FlopRewardTemplates = XTableManager.ReadByIntKey(TABLE_FLOP_REWARD, XTable.XTableFlopReward, "Id")
StageFightControlCfg = XTableManager.ReadByIntKey(TABLE_STAGE_FIGHT_CONTROL, XTable.XTableStageFightControl, "Id")
ActivitySortRules = XTableManager.ReadByIntKey(TABLE_ACTIVITY_SORTRULE, XTable.XTableActivitySortRule, "Id")
FubenFeatures = XTableManager.ReadByIntKey(TABLE_FUBENFEATURES, XTable.XTableFubenFeatures, "Id")
StageCharacterLimitBuffConfig = XTableManager.ReadByIntKey(TABLE_STAGE_CHARACTERLIMIT, XTable.XTableFubenStageCharacterLimit, "Id")
StageFightEvent = XTableManager.ReadByIntKey(TABLE_STAGE_FIGHT_EVENT, XTable.XTableStageFightEvent, "StageId")
StageFightEventDetails = XTableManager.ReadByIntKey(TABLE_STAGE_FIGHT_EVENT_DETAILS, XTable.XTableStageFightEventDetails, "Id")
SettleLoseTipCfg = XTableManager.ReadByIntKey(TABLE_SETTLE_LOST_TIP, XTable.XTableSettleLoseTip, "Id")
StageRecommendConfigs = XTableManager.ReadByIntKey(TABLE_STAGE_RECOMMEND_PATH, XTable.XTableStageRecommend, "StageId")
TeamBuffCfg = XTableManager.ReadByIntKey(TABLE_BOSS_TEAMBUFF, XTable.XTableStageTeamBuff, "Id")
for id, v in pairs(TeamBuffCfg) do
local maxCount = 0
for _, buffId in ipairs(v.BuffId) do
if buffId > 0 then
maxCount = maxCount + 1
end
end
TeamBuffMaxCountDic[id] = maxCount
end
local banners = XTableManager.ReadByIntKey(TABLE_CHALLENGE_BANNER, XTable.XTableFubenChallengeBanner, "Id")
for _, v in pairs(banners) do
FubenChallengeBanners[v.Type] = v
end
end
local function GetStageCfg(stageId)
local config = StageCfg[stageId]
if not config then
XLog.Error("XFubenConfigs.GetStageCfgs Error: StageId: " .. stageId)
return
end
return config
end
local function GetTeamBuffCfg(teamBuffId)
local config = TeamBuffCfg[teamBuffId]
if not config then
XLog.Error("XFubenConfigs.GetTeamBuffCfg Error: teamBuffId: " .. teamBuffId)
return
end
return config
end
local function GetSettleLoseTipCfg(settleLoseTipId)
local config = SettleLoseTipCfg[settleLoseTipId]
if not config then
XLog.ErrorTableDataNotFound(
"XFubenConfigs.GetSettleLoseTipCfg",
"失败提示",
TABLE_SETTLE_LOST_TIP,
"Id",
tostring(settleLoseTipId))
return {}
end
return config
end
function XFubenConfigs.GetStageCfgs()
return StageCfg
end
function XFubenConfigs.GetBuffDes(buffId)
local fightEventCfg = buffId and buffId ~= 0 and CS.XNpcManager.GetFightEventTemplate(buffId)
return fightEventCfg and fightEventCfg.Description or ""
end
function XFubenConfigs.GetStageLevelControlCfg()
return StageLevelControlCfg
end
function XFubenConfigs.GetStageMultiplayerLevelControlCfg()
return StageMultiplayerLevelControlCfg
end
function XFubenConfigs.GetStageMultiplayerLevelControlCfgById(id)
return StageMultiplayerLevelControlCfg[id]
end
function XFubenConfigs.GetStageTransformCfg()
return StageTransformCfg
end
function XFubenConfigs.GetFlopRewardTemplates()
return FlopRewardTemplates
end
function XFubenConfigs.GetActivitySortRules()
return ActivitySortRules
end
function XFubenConfigs.GetFeaturesById(id)
local t = FubenFeatures[id]
if not t then
XLog.ErrorTableDataNotFound("XFubenConfigs.GetFeaturesById", "FubenFeatures", TABLE_FUBENFEATURES, "Id", tostring(id))
return nil
end
return t
end
function XFubenConfigs.GetActivityPriorityByActivityIdAndType(activityId, type)
for _, v in pairs(ActivitySortRules) do
if v.ActivityId == activityId and v.Type == type then
return v.Priority
end
end
return 0
end
function XFubenConfigs.GetStageFightControl(id)
for _, v in pairs(StageFightControlCfg) do
if v.Id == id then
return v
end
end
return nil
end
function XFubenConfigs.IsKeepPlayingStory(stageId)
local targetCfg = StageCfg[stageId]
if not targetCfg or not targetCfg.KeepPlayingStory then
return false
end
return targetCfg.KeepPlayingStory == 1
end
function XFubenConfigs.GetChapterBannerByType(bannerType)
return FubenChallengeBanners[bannerType] or {}
end
function XFubenConfigs.InitNewChallengeConfigs()
FubenNewChallenge = {}
for _, v in pairs(FubenChallengeBanners) do
if v.ShowNewStartTime and v.ShowNewEndTime then
local timeNow = XTime.GetServerNowTimestamp()
local startTime = XTime.ParseToTimestamp(v.ShowNewStartTime)
local endTime = XTime.ParseToTimestamp(v.ShowNewEndTime)
if endTime and timeNow <= endTime then
table.insert(FubenNewChallenge, v)
end
if startTime > endTime then
XLog.Error("新挑战活动配置有误,起始时间晚于结束时间,表路径:" .. TABLE_CHALLENGE_BANNER .. " 问题Id :" .. tostring(v.Id))
end
end
end
return FubenNewChallenge
end
function XFubenConfigs.GetNewChallengeConfigs() -- 获取新挑战玩法数据
return FubenNewChallenge or XFubenConfigs.InitNewChallengeConfigs()
end
function XFubenConfigs.GetNewChallengeConfigById(id) -- 根据Id取得FubenChallengeBanner配置
for i in pairs(FubenChallengeBanners) do
if FubenChallengeBanners[i].Id == id then
return FubenChallengeBanners[i]
end
end
return nil
end
function XFubenConfigs.GetNewChallengeConfigsLength() -- 获取新活动数量
local config = XFubenConfigs.GetNewChallengeConfigs()
return #config
end
function XFubenConfigs.GetNewChallengeFunctionId(index)
local config = XFubenConfigs.GetNewChallengeConfigs()
return config[index].FunctionId
end
function XFubenConfigs.GetNewChallengeId(index) -- 根据索引获取新挑战活动的Id
local config = XFubenConfigs.GetNewChallengeConfigs()
return config[index].Id
end
function XFubenConfigs.GetNewChallengeStartTimeStamp(index)
local config = XFubenConfigs.GetNewChallengeConfigs()
return XTime.ParseToTimestamp(config[index].ShowNewStartTime)
end
function XFubenConfigs.GetNewChallengeEndTimeStamp(index)
local config = XFubenConfigs.GetNewChallengeConfigs()
return XTime.ParseToTimestamp(config[index].ShowNewEndTime)
end
function XFubenConfigs.IsNewChallengeStartByIndex(index) -- 根据索引获取新挑战时段是否已经开始
return XFubenConfigs.GetNewChallengeStartTimeStamp(index) <= XTime.GetServerNowTimestamp()
end
function XFubenConfigs.IsNewChallengeStartById(id) -- 根据挑战活动Id获取新挑战时段是否已经开始
if not id then return false end
local cfg = XFubenConfigs.GetNewChallengeConfigById(id)
if not cfg or not cfg.ShowNewStartTime then return false end
return XTime.ParseToTimestamp(cfg.ShowNewStartTime) <= XTime.GetServerNowTimestamp()
end
function XFubenConfigs.GetMultiChallengeStageConfigs()
return MultiChallengeConfigs
end
function XFubenConfigs.GetTableStagePath()
return TABLE_STAGE
end
--副本上阵角色类型限制相关:
local ROOM_CHARACTER_LIMIT_CONFIGS = {
[XFubenConfigs.CharacterLimitType.Normal] = {
Name = CSXTextManagerGetText("CharacterTypeLimitNameNormal"),
ImageTeamEdit = CSXGameClientConfig:GetString("TeamCharacterTypeNormalLimitImage"),
ImageSelectCharacter = CSXGameClientConfig:GetString("TeamRequireCharacterNormalImage"),
TextTeamEdit = CSXTextManagerGetText("TeamCharacterTypeNormalLimitText"),
TextSelectCharacter = CSXTextManagerGetText("TeamRequireCharacterNormalText"),
TextChapterLimit = CSXTextManagerGetText("ChapterCharacterTypeLimitNormal"),
},
[XFubenConfigs.CharacterLimitType.Isomer] = {
Name = CSXTextManagerGetText("CharacterTypeLimitNameIsomer"),
ImageTeamEdit = CSXGameClientConfig:GetString("TeamCharacterTypeIsomerLimitImage"),
ImageSelectCharacter = CSXGameClientConfig:GetString("TeamRequireCharacterIsomerImage"),
TextTeamEdit = CSXTextManagerGetText("TeamCharacterTypeIsomerLimitText"),
TextSelectCharacter = CSXTextManagerGetText("TeamRequireCharacterIsomerText"),
TextChapterLimit = CSXTextManagerGetText("ChapterCharacterTypeLimitIsomer"),
},
[XFubenConfigs.CharacterLimitType.IsomerDebuff] = {
Name = CSXTextManagerGetText("CharacterTypeLimitNameIsomerDebuff"),
ImageTeamEdit = CSXGameClientConfig:GetString("TeamCharacterTypeIsomerDebuffLimitImage"),
ImageSelectCharacter = CSXGameClientConfig:GetString("TeamRequireCharacterIsomerDebuffImage"),
TextTeamEdit = function(buffDes) return CSXTextManagerGetText("TeamCharacterTypeIsomerDebuffLimitText", buffDes) end,
TextTeamEditDefault = CSXTextManagerGetText("TeamCharacterTypeIsomerDebuffLimitDefaultText"),
TextSelectCharacter = function(buffDes) return CSXTextManagerGetText("TeamRequireCharacterIsomerDebuffText", buffDes) end,
TextSelectCharacterDefault = CSXTextManagerGetText("TeamRequireCharacterIsomerDebuffDefaultText"),
TextChapterLimit = function(buffDes) return CSXTextManagerGetText("ChapterCharacterTypeLimitIsomerDebuff", buffDes) end,
},
[XFubenConfigs.CharacterLimitType.NormalDebuff] = {
Name = CSXTextManagerGetText("CharacterTypeLimitNameNormalDebuff"),
ImageTeamEdit = CSXGameClientConfig:GetString("TeamCharacterTypeNormalDebuffLimitImage"),
ImageSelectCharacter = CSXGameClientConfig:GetString("TeamRequireCharacterNormalDebuffImage"),
TextTeamEdit = function(buffDes) return CSXTextManagerGetText("TeamCharacterTypeNormalDebuffLimitText", buffDes) end,
TextTeamEditDefault = CSXTextManagerGetText("TeamCharacterTypeNormalDebuffLimitDefaultText"),
TextSelectCharacter = function(buffDes) return CSXTextManagerGetText("TeamRequireCharacterNormalDebuffText", buffDes) end,
TextSelectCharacterDefault = CSXTextManagerGetText("TeamRequireCharacterNormalDebuffDefaultText"),
TextChapterLimit = function(buffDes) return CSXTextManagerGetText("ChapterCharacterTypeLimitNormalDebuff", buffDes) end,
},
}
local function GetStageCharacterLimitConfig(characterLimitType)
return ROOM_CHARACTER_LIMIT_CONFIGS[characterLimitType]
end
function XFubenConfigs.GetStageCharacterLimitType(stageId)
return GetStageCfg(stageId).CharacterLimitType
end
function XFubenConfigs.GetStageCharacterLimitBuffId(stageId)
local limitBuffId = GetStageCfg(stageId).LimitBuffId
return XFubenConfigs.GetLimitShowBuffId(limitBuffId)
end
function XFubenConfigs.GetLimitShowBuffId(limitBuffId)
local config = StageCharacterLimitBuffConfig[limitBuffId]
local buffIds = config and config.BuffId
return buffIds and buffIds[1] or 0
end
function XFubenConfigs.IsStageCharacterLimitConfigExist(characterLimitType)
return GetStageCharacterLimitConfig(characterLimitType) and true
end
-- 编队界面限制角色类型Icon
function XFubenConfigs.GetStageCharacterLimitImageTeamEdit(characterLimitType)
local config = GetStageCharacterLimitConfig(characterLimitType)
if not config then return "" end
return config.ImageTeamEdit
end
-- 编队界面限制角色类型文本
function XFubenConfigs.GetStageCharacterLimitTextTeamEdit(characterLimitType, characterType, buffId)
local config = GetStageCharacterLimitConfig(characterLimitType)
if not config then return "" end
local text = config.TextTeamEdit
local defaultText = config.TextTeamEditDefault
if not defaultText then
return text
end
local defaultCharacterType = XDataCenter.FubenManager.GetDefaultCharacterTypeByCharacterLimitType(characterLimitType)
if characterType and characterType ~= defaultCharacterType then
if type(text) == "function" then
local buffDes = XFubenConfigs.GetBuffDes(buffId)
return text(buffDes)
end
else
return defaultText
end
return text
end
-- 选人界面限制角色类型Icon
function XFubenConfigs.GetStageCharacterLimitImageSelectCharacter(characterLimitType)
local config = GetStageCharacterLimitConfig(characterLimitType)
if not config then return "" end
return config.ImageSelectCharacter
end
-- 选人界面限制角色类型文本
function XFubenConfigs.GetStageCharacterLimitTextSelectCharacter(characterLimitType, characterType, buffId)
local config = GetStageCharacterLimitConfig(characterLimitType)
if not config then return "" end
local text = config.TextSelectCharacter
local defaultText = config.TextSelectCharacterDefault
if not defaultText then
return text
end
local defaultCharacterType = XDataCenter.FubenManager.GetDefaultCharacterTypeByCharacterLimitType(characterLimitType)
if characterType ~= defaultCharacterType then
if type(text) == "function" then
if not XTool.IsNumberValid(buffId) then
return defaultText
end
local buffDes = XFubenConfigs.GetBuffDes(buffId)
return text(buffDes)
end
else
return defaultText
end
return text
end
-- 限制角色类型分区名称文本
function XFubenConfigs.GetStageCharacterLimitName(characterLimitType)
local config = GetStageCharacterLimitConfig(characterLimitType)
if not config then return "" end
return config.Name
end
-- 章节选人界面限制角色类型文本
function XFubenConfigs.GetChapterCharacterLimitText(characterLimitType, buffId)
local config = GetStageCharacterLimitConfig(characterLimitType)
if not config then return "" end
local text = config.TextChapterLimit
if type(text) == "function" then
local buffDes = XFubenConfigs.GetBuffDes(buffId)
return text(buffDes)
end
return text
end
function XFubenConfigs.IsCharacterFitTeamBuff(teamBuffId, characterId)
if not teamBuffId or teamBuffId <= 0 then return false end
if not characterId or characterId <= 0 then return false end
local config = GetTeamBuffCfg(teamBuffId)
local initQuality = characterId and characterId > 0 and XCharacterConfigs.GetCharMinQuality(characterId)
if not initQuality or initQuality <= 0 then return false end
for _, quality in pairs(config.Quality) do
if initQuality == quality then
return true
end
end
return false
end
function XFubenConfigs.GetTeamBuffFitCharacterCount(teamBuffId, characterIds)
local config = GetTeamBuffCfg(teamBuffId)
local fitCount = 0
local checkDic = {}
for _, quality in pairs(config.Quality) do
checkDic[quality] = true
end
for _, characterId in pairs(characterIds) do
local initQuality = characterId > 0 and XCharacterConfigs.GetCharMinQuality(characterId)
fitCount = checkDic[initQuality] and fitCount + 1 or fitCount
end
return fitCount
end
function XFubenConfigs.GetTeamBuffMaxBuffCount(teamBuffId)
return TeamBuffMaxCountDic[teamBuffId] or 0
end
function XFubenConfigs.GetTeamBuffOnIcon(teamBuffId)
local config = GetTeamBuffCfg(teamBuffId)
return config.OnIcon
end
function XFubenConfigs.GetTeamBuffOffIcon(teamBuffId)
local config = GetTeamBuffCfg(teamBuffId)
return config.OffIcon
end
function XFubenConfigs.GetTeamBuffTitle(teamBuffId)
local config = GetTeamBuffCfg(teamBuffId)
return config.Title
end
function XFubenConfigs.GetTeamBuffDesc(teamBuffId)
local config = GetTeamBuffCfg(teamBuffId)
return string.gsub(config.Desc, "\\n", "\n")
end
-- 根据符合初始品质要求的characterId列表获取对应的同调加成buffId
function XFubenConfigs.GetTeamBuffShowBuffId(teamBuffId, characterIds)
local config = GetTeamBuffCfg(teamBuffId)
local fitCount = XFubenConfigs.GetTeamBuffFitCharacterCount(teamBuffId, characterIds)
return config.BuffId[fitCount]
end
-- 根据关卡ID查找关卡词缀列表
function XFubenConfigs.GetStageFightEventByStageId(stageId)
if not StageFightEvent[stageId] then
XLog.ErrorTableDataNotFound(
"XFubenConfigs.GetStageFightEventByStageId",
"通用关卡词缀数据",
TABLE_STAGE_FIGHT_EVENT,
"StageId",
tostring(stageId)
)
return {}
end
return StageFightEvent[stageId]
end
-- 根据ID查找词缀详细
function XFubenConfigs.GetStageFightEventDetailsByStageFightEventId(eventId)
if not StageFightEventDetails[eventId] then
XLog.ErrorTableDataNotFound(
"XFubenConfigs.GetStageFightEventDetailsByStageFightEventId",
"通用关卡词缀数据",
TABLE_STAGE_FIGHT_EVENT_DETAILS,
"Id",
tostring(eventId)
)
return nil
end
return StageFightEventDetails[eventId]
end
---
--- 获取 失败提示描述 数组
function XFubenConfigs.GetTipDescList(settleLoseTipId)
local cfg = GetSettleLoseTipCfg(settleLoseTipId)
return cfg.TipDesc
end
---
--- 获取 失败提示跳转Id 数组
function XFubenConfigs.GetSkipIdList(settleLoseTipId)
local cfg = GetSettleLoseTipCfg(settleLoseTipId)
return cfg.SkipId
end
--获取关卡推荐角色类型(构造体/感染体)
function XFubenConfigs.GetStageRecommendCharacterType(stageId)
local config = StageRecommendConfigs[stageId]
if not config then return end
local value = config.CharacterType
return value ~= 0 and value or nil
end
--获取关卡推荐角色元素属性(物理/火/雷/冰/暗)
function XFubenConfigs.GetStageRecommendCharacterElement(stageId)
local config = StageRecommendConfigs[stageId]
if not config then return end
local value = config.CharacterElement
return value ~= 0 and value or nil
end
--是否为关卡推荐角色
function XFubenConfigs.IsStageRecommendCharacterType(stageId, Id)
local characterId = XRobotManager.GetCharacterId(Id)
local characterType = XCharacterConfigs.GetCharacterType(characterId)
local recommendType = XFubenConfigs.GetStageRecommendCharacterType(stageId)
local element = XCharacterConfigs.GetCharacterElement(characterId)
local recommendElement = XFubenConfigs.GetStageRecommendCharacterElement(stageId) or 0
--(废弃)特殊逻辑:如果为授格者,一定是推荐(废弃)
--if characterType == XCharacterConfigs.CharacterType.Isomer and recommendType == characterType then
-- return true
--end
--特殊逻辑当关卡推荐元素为0时推荐所有该角色类型构造体/授格者)的构造体
--此处兼容之前废弃的《授格者一定推荐的特殊逻辑》StageRecommend配置中的授格者类型下推荐属性都是0故兼容
return XTool.IsNumberValid(recommendType) and
recommendType == characterType and
(element == recommendElement or recommendElement == 0)
end
function XFubenConfigs.GetStageName(stageId)
local config = GetStageCfg(stageId)
return config and config.Name or ""
end
function XFubenConfigs.GetStageType(stageId)
local config = GetStageCfg(stageId)
return config and config.StageType or ""
end
---
--- 关卡图标
function XFubenConfigs.GetStageIcon(stageId)
local config = GetStageCfg(stageId)
return (config or {}).Icon
end
---
--- 三星条件描述数组
function XFubenConfigs.GetStarDesc(stageId)
local config = GetStageCfg(stageId)
return (config or {}).StarDesc
end
---
--- 关卡需要消耗的体力
function XFubenConfigs.GetRequireActionPoint(stageId)
local config = GetStageCfg(stageId)
return (config or {}).RequireActionPoint
end
---
--- 关卡首通奖励
function XFubenConfigs.GetFirstRewardShow(stageId)
local config = GetStageCfg(stageId)
return (config or {}).FirstRewardShow
end
---
--- 关卡非首通奖励
function XFubenConfigs.GetFinishRewardShow(stageId)
local config = GetStageCfg(stageId)
return (config or {}).FinishRewardShow
end
---
--- 获得战前剧情ID
function XFubenConfigs.GetBeginStoryId(stageId)
local config = GetStageCfg(stageId)
return (config or {}).BeginStoryId
end

View file

@ -0,0 +1,64 @@
XFubenCoupleCombatConfig = XFubenCoupleCombatConfig or {}
local TABLE_COUPLE_ACTIVITY = "Share/Fuben/CoupleCombat/CoupleCombatActivity.tab"
local TABLE_COUPLE_BUFF = "Share/Fuben/CoupleCombat/CoupleCombatFeature.tab"
local TABLE_COUPLE_CHAPTER = "Share/Fuben/CoupleCombat/CoupleCombatChapter.tab"
local TABLE_COUPLE_ROBOT = "Share/Fuben/CoupleCombat/CoupleCombatRobot.tab"
local TABLE_COUPLE_STAGE = "Share/Fuben/CoupleCombat/CoupleCombatStage.tab"
local CoupleCombatActivity = {}
local CoupleCombatFeature = {}
local CoupleCombatChapter = {}
local CoupleCombatRobot = {}
local CoupleCombatStage = {}
XFubenCoupleCombatConfig.StageType = {
Normal = 1, --普通
Hard = 2, --挑战模式
}
function XFubenCoupleCombatConfig.Init()
CoupleCombatActivity = XTableManager.ReadByIntKey(TABLE_COUPLE_ACTIVITY, XTable.XTableCoupleCombatActivity, "Id")
CoupleCombatFeature = XTableManager.ReadByIntKey(TABLE_COUPLE_BUFF, XTable.XTableCoupleCombatFeature, "Id")
CoupleCombatChapter = XTableManager.ReadByIntKey(TABLE_COUPLE_CHAPTER, XTable.XTableCoupleCombatChapter, "Id")
CoupleCombatRobot = XTableManager.ReadByIntKey(TABLE_COUPLE_ROBOT, XTable.XTableCoupleCombatRobot, "RobotId")
CoupleCombatStage = XTableManager.ReadByIntKey(TABLE_COUPLE_STAGE, XTable.XTableCoupleCombatStage, "Id")
end
function XFubenCoupleCombatConfig.GetStageInfo(id)
local template = CoupleCombatStage[id]
if not template then
XLog.ErrorTableDataNotFound("XFubenCoupleCombatConfig.GetStageInfo", "CoupleCombatStage", TABLE_COUPLE_STAGE, "id", tostring(id))
return
end
return template
end
function XFubenCoupleCombatConfig.GetStages()
return CoupleCombatStage
end
function XFubenCoupleCombatConfig.GetChapterTemplates()
return CoupleCombatChapter
end
function XFubenCoupleCombatConfig.GetChapterTemplate(id)
return CoupleCombatChapter[id]
end
function XFubenCoupleCombatConfig.GetActTemplates()
return CoupleCombatActivity
end
function XFubenCoupleCombatConfig.GetActivityTemplateById(id)
return CoupleCombatActivity[id]
end
function XFubenCoupleCombatConfig.GetRobotInfo(id)
return CoupleCombatRobot[id]
end
function XFubenCoupleCombatConfig.GetFeatureById(id)
return CoupleCombatFeature[id]
end

View file

@ -0,0 +1,62 @@
XFubenExperimentConfigs = XFubenExperimentConfigs or {}
local TABLE_TRIAL_GROUP = "Share/Fuben/Experiment/ExperimentGroup.tab"
local TABLE_TRIAL_LEVEL = "Share/Fuben/Experiment/ExperimentLevel.tab"
local TABLE_TRIAL_BATTLETRIAL = "Share/Fuben/Experiment/BattleExperiment.tab"
local TABLE_TRIAL_LEVELSKILL = "Client/Fuben/Experiment/ExperimentSkillExplainId.tab"
local TABLE_TRIAL_REWARD = "Share/Fuben/Experiment/ExperimentReward.tab"
local TrialGroupCfg = {}
local TrialLevelCfg = {}
local BattleTrialCfg = {}
local TrialSkillExplainCfg = {}
local TrialRewardCfg = {}
function XFubenExperimentConfigs.Init()
TrialGroupCfg = XTableManager.ReadByIntKey(TABLE_TRIAL_GROUP, XTable.XTableExperimentGroup, "Id")
TrialLevelCfg = XTableManager.ReadByIntKey(TABLE_TRIAL_LEVEL, XTable.XTableExperimentLevel, "Id")
BattleTrialCfg = XTableManager.ReadByIntKey(TABLE_TRIAL_BATTLETRIAL, XTable.XTableBattleExperiment, "Id")
TrialSkillExplainCfg = XTableManager.ReadByIntKey(TABLE_TRIAL_LEVELSKILL, XTable.XTableExperimentSkillExplainId, "Id")
TrialRewardCfg = XTableManager.ReadByIntKey(TABLE_TRIAL_REWARD, XTable.XTableExperimentReward, "Id")
end
function XFubenExperimentConfigs.GetTrialGroupCfg()
return TrialGroupCfg
end
function XFubenExperimentConfigs.GetTrialLevelCfg()
return TrialLevelCfg
end
function XFubenExperimentConfigs.GetTrialLevelCfgById(id)
for _, v in pairs(TrialLevelCfg) do
if v.Id == id then
return v
end
end
end
function XFubenExperimentConfigs.GetBattleTrialCfg()
return BattleTrialCfg
end
function XFubenExperimentConfigs.GetBattleTrialBegin(id)
for i = 1, #BattleTrialCfg do
if BattleTrialCfg[i].CharacterID == id then
return BattleTrialCfg[i]
end
end
return nil
end
function XFubenExperimentConfigs.GetBattleTrial(id)
return BattleTrialCfg[id]
end
function XFubenExperimentConfigs.GetExperimentSkillExplainById(id)
return TrialSkillExplainCfg[id]
end
function XFubenExperimentConfigs.GetTrialStarRewardCfgById(rewardId)
return TrialRewardCfg[rewardId]
end

View file

@ -0,0 +1,104 @@
XFubenExploreConfigs = XFubenExploreConfigs or {}
local TABLE_EXPLORE_BUFF = "Share/Fuben/Explore/ExploreBuffItem.tab"
local TABLE_EXPLORE_CHAPTER = "Share/Fuben/Explore/ExploreChapter.tab"
local TABLE_EXPLORE_NODE = "Share/Fuben/Explore/ExploreNode.tab"
local TABLE_EXPLORE_STORYTEXT = "Share/Fuben/Explore/ExploreStoryText.tab"
local ExploreBuffCfg = {}
local ExploreChapterCfg = {}
local ExploreNodeCfg = {}
local ExploreStoryTextCfg = {}
XFubenExploreConfigs.NodeStateEnum = {
Complete = 1, --已完成
Availavle = 2, --可打
Visivle = 3, --可看到不可打
Invisivle = 4, --不可见
}
XFubenExploreConfigs.NodeTypeEnum = {
Stage = 1, --战斗
Story = 2, --剧情
Arena = 3, --竞技
}
function XFubenExploreConfigs.Init()
ExploreBuffCfg = XTableManager.ReadByIntKey(TABLE_EXPLORE_BUFF, XTable.XTableExploreBuffItem, "Id")
ExploreChapterCfg = XTableManager.ReadByIntKey(TABLE_EXPLORE_CHAPTER, XTable.XTableExploreChapter, "Id")
ExploreNodeCfg = XTableManager.ReadByIntKey(TABLE_EXPLORE_NODE, XTable.XTableExploreNode, "Id")
ExploreStoryTextCfg = XTableManager.ReadByIntKey(TABLE_EXPLORE_STORYTEXT, XTable.XTableExploreStoryText, "Id")
end
function XFubenExploreConfigs.GetExploreBuffCfg()
return ExploreBuffCfg
end
function XFubenExploreConfigs.GetExploreChapterCfg()
return ExploreChapterCfg
end
function XFubenExploreConfigs.GetExploreNodeCfg()
return ExploreNodeCfg
end
function XFubenExploreConfigs.GetExploreStoryTextCfg()
return ExploreStoryTextCfg
end
--获取某一章的全部关卡表数据
function XFubenExploreConfigs.GetAllLevel(chapterId)
local tempList = {}
for _, v in pairs(ExploreNodeCfg) do
if v.ChapterId == chapterId then
table.insert(tempList, v)
end
end
return tempList
end
--获取某一关的表数据
function XFubenExploreConfigs.GetLevel(nodeId)
if ExploreNodeCfg[nodeId] then
return ExploreNodeCfg[nodeId]
end
XLog.ErrorTableDataNotFound("XFubenExploreConfigs.GetLevel", "ExploreNodeCfg", TABLE_EXPLORE_NODE, "nodeId", tostring(nodeId))
return nil
end
--获取某一章的表数据
function XFubenExploreConfigs.GetChapterData(chapterId)
return ExploreChapterCfg[chapterId]
end
--获取某一章的全部StoryText
function XFubenExploreConfigs.GetChapterStoryText(chapterId)
local tempList = {}
for i = 1, #ExploreStoryTextCfg do
if ExploreStoryTextCfg[i].ChapterId == chapterId then
table.insert(tempList, ExploreStoryTextCfg[i])
end
end
return tempList
end
--获取某一章所有的buff
function XFubenExploreConfigs.GetChapterBuff(chapterId)
local tempList = {}
for i = 1, #ExploreBuffCfg do
if ExploreBuffCfg[i].ChapterId == chapterId then
table.insert(tempList, ExploreBuffCfg[i])
end
end
return tempList
end
--获取某一个buff
function XFubenExploreConfigs.GetBuff(buffId)
for i = 1, #ExploreBuffCfg do
if ExploreBuffCfg[i].Id == buffId then
return ExploreBuffCfg[i]
end
end
return nil
end

View file

@ -0,0 +1,62 @@
XFubenExtraChapterConfigs = {}
local TABLE_CHAPTER_EXTRA = "Share/Fuben/ExtraChapter/ChapterExtra.tab"
local TABLE_CHAPTER_EXTRA_DETAILS = "Share/Fuben/ExtraChapter/ChapterExtraDetails.tab"
local TABLE_CHAPTER_EXTRA_STARTREASURE = "Share/Fuben/ExtraChapter/ChapterExtraStarTreasure.tab"
local TABLE_EXPLOREGROUP = "Client/Fuben/ExtraChapter/ExtraExploreGroup.tab"
local TABLE_EXPLOREITEM = "Client/Fuben/ExtraChapter/ExtraExploreItem.tab"
local ExtraChapterCfgs = {} --TABLE_CHAPTER_EXTRA ChapterExtra.tab 番外章节数据与Details表关联难度指向不同的章节详细项
local ExtraChapterDetailsCfgs = {} --TABLE_CHAPTER_EXTRA_DETAILS ChapterExtraDetails.tab 番外章节详细数据
local ExtraChapterStarTreasureCfgs = {} --TABLE_CHAPTER_EXTRA_STARTREASURE ChapterExtraStarTreasure.tab
local ExtraExploreGroupCfgs = {} --TABLE_EXPLOREGROUP ExtraExploreGroup.tab 番外探索组
local ExtraExploreItemCfgs = {} --TABLE_EXPLOREITEM ExtraExploreItem.tab 番外探索道具数据
function XFubenExtraChapterConfigs.Init()
ExtraChapterCfgs = XTableManager.ReadByIntKey(TABLE_CHAPTER_EXTRA, XTable.XTableChapterExtra, "Id")
ExtraChapterDetailsCfgs = XTableManager.ReadByIntKey(TABLE_CHAPTER_EXTRA_DETAILS, XTable.XTableChapterExtraDetails, "ChapterId")
ExtraChapterStarTreasureCfgs = XTableManager.ReadByIntKey(TABLE_CHAPTER_EXTRA_STARTREASURE, XTable.XTableChapterExtraStarTreasure, "TreasureId")
ExtraExploreGroupCfgs = XTableManager.ReadByIntKey(TABLE_EXPLOREGROUP, XTable.XTableExtraExploreGroup, "Id")
ExtraExploreItemCfgs = XTableManager.ReadByIntKey(TABLE_EXPLOREITEM, XTable.XTableExtraExploreItem, "Id")
end
function XFubenExtraChapterConfigs.GetExtraChapterCfgs()
return ExtraChapterCfgs
end
function XFubenExtraChapterConfigs.GetExtraChapterDetailsCfgs()
return ExtraChapterDetailsCfgs
end
function XFubenExtraChapterConfigs.GetExtraChapterStarTreasuresCfgs()
return ExtraChapterStarTreasureCfgs
end
function XFubenExtraChapterConfigs.GetExploreGroupCfg()
return ExtraExploreGroupCfgs
end
function XFubenExtraChapterConfigs.GetExploreItemCfg()
return ExtraExploreItemCfgs
end
function XFubenExtraChapterConfigs.GetExploreItemCfgById(id)
if not ExtraExploreItemCfgs[id] then
XLog.ErrorTableDataNotFound("XFubenExtraChapterConfigs.GetExploreItemCfgById", "ExtraExploreItem", TABLE_EXPLOREITEM, "Id", tostring(id))
return nil
end
return ExtraExploreItemCfgs[id]
end
---
--- 根据'chapterMainId'获取章节的周目Id
---@param chapterMainId number
---@return number
function XFubenExtraChapterConfigs.GetZhouMuId(chapterMainId)
if (ExtraChapterCfgs or {})[chapterMainId] == nil then
XLog.ErrorTableDataNotFound("XFubenExtraChapterConfigs.GetZhouMuId",
"外篇章节", TABLE_CHAPTER_EXTRA, "Id", tostring(chapterMainId))
return
end
return ExtraChapterCfgs[chapterMainId].ZhouMuId
end

View file

@ -0,0 +1,86 @@
XFubenHackConfig = XFubenHackConfig or {}
local TABLE_HACK_ACTIVITY = "Share/Fuben/Hack/HackActivity.tab"
local TABLE_HACK_BUFF = "Share/Fuben/Hack/HackBuff.tab"
local TABLE_HACK_CHAPTER = "Share/Fuben/Hack/HackChapter.tab"
local TABLE_HACK_EFFECT = "Share/Fuben/Hack/HackCharacterEffect.tab"
local TABLE_HACK_EXPLEVEL = "Share/Fuben/Hack/HackExpLevel.tab"
local TABLE_HACK_REWARD = "Share/Fuben/Hack/HackReward.tab"
local TABLE_HACK_STAGE = "Share/Fuben/Hack/HackStage.tab"
local HackActivity = {}
local HackBuff = {}
local HackChapter = {}
local HackCharEffect = {}
local HackExpLevel = {}
local HackStage = {}
local HackReward = {}
local HackLevelGroup = {}
XFubenHackConfig.PopUpPos = {
Left = 1,
Right = 2,
}
XFubenHackConfig.BuffBarCapacity = 3
function XFubenHackConfig.Init()
HackActivity = XTableManager.ReadByIntKey(TABLE_HACK_ACTIVITY, XTable.XTableHackActivity, "Id")
HackBuff = XTableManager.ReadByIntKey(TABLE_HACK_BUFF, XTable.XTableHackBuff, "Id")
HackChapter = XTableManager.ReadByIntKey(TABLE_HACK_CHAPTER, XTable.XTableHackChapter, "Id")
HackCharEffect = XTableManager.ReadByIntKey(TABLE_HACK_EFFECT, XTable.XTableHackCharacterEffect, "Id")
HackExpLevel = XTableManager.ReadByIntKey(TABLE_HACK_EXPLEVEL, XTable.XTableHackExpLevel, "Id")
HackStage = XTableManager.ReadByIntKey(TABLE_HACK_STAGE, XTable.XTableHackStage, "Id")
HackReward = XTableManager.ReadByIntKey(TABLE_HACK_REWARD, XTable.XTableHackReward, "Id")
for _, v in pairs(HackExpLevel) do
if not HackLevelGroup[v.ChapterId] then
HackLevelGroup[v.ChapterId] = {}
end
HackLevelGroup[v.ChapterId][v.Level] = v
end
end
function XFubenHackConfig.GetStageInfo(id)
local template = HackStage[id]
if not template then
XLog.ErrorTableDataNotFound("XFubenHackConfig.GetStageInfo", "HackStage", TABLE_HACK_STAGE, "id", tostring(id))
return
end
return template
end
function XFubenHackConfig.GetStages()
return HackStage
end
function XFubenHackConfig.GetChapterTemplate(id)
return HackChapter[id]
end
function XFubenHackConfig.GetActTemplates()
return HackActivity
end
function XFubenHackConfig.GetActivityTemplateById(id)
return HackActivity[id]
end
function XFubenHackConfig.GetReward()
return HackReward
end
function XFubenHackConfig.GetRewardById(id)
return HackReward[id]
end
function XFubenHackConfig.GetBuffById(id)
return HackBuff[id]
end
function XFubenHackConfig.GetLevelCfg(chapterId, level)
return HackLevelGroup[chapterId] and HackLevelGroup[chapterId][level]
end
function XFubenHackConfig.GetLevelCfgs(chapterId)
return HackLevelGroup[chapterId]
end

View file

@ -0,0 +1,907 @@
local TABLE_SECTION_PATH = "Client/Fuben/InfestorExplore/ExploreSection.tab"
local TABLE_CHAPTER_PATH = "Share/Fuben/InfestorExplore/ExploreChapter.tab"
local TABLE_STAGE_PATH = "Share/Fuben/InfestorExplore/ExploreNode.tab"
local TABLE_LEVEL_GROUP_PATH = "Share/Fuben/InfestorExplore/InfestorGroup.tab"
local TABLE_DIFF_PATH = "Share/Fuben/InfestorExplore/InfestorDiff.tab"
local TABLE_FOG_PATH = "Client/Fuben/InfestorExplore/Fog.tab"
local TABLE_MAP_PATH = "Share/Fuben/InfestorExplore/Map/"
local TABLE_NODETYPE_PATH = "Client/Fuben/InfestorExplore/NodeType.tab"
local TABLE_EVENT_POOL_PATH = "Share/Fuben/InfestorExplore/ExploreEventPool.tab"
local TABLE_EVENT_POOL_RES_PATH = "Client/Fuben/InfestorExplore/ExploreEventPoolRes.tab"
local TABLE_FIGHTEVENT_PATH = "Share/Fuben/InfestorExplore/InfestorFightEvent.tab"
local TABLE_BUFF_PATH = "Client/Fuben/InfestorExplore/Buffs.tab"
local TABLE_CORE_PATH = "Share/Fuben/InfestorExplore/Core.tab"
local TABLE_CORE_LEVEL_PATH = "Share/Fuben/InfestorExplore/CoreLevelEffect.tab"
local TABLE_SUPPLY_REWARD_PATH = "Client/Fuben/InfestorExplore/SupplyReward.tab"
local TABLE_SHOP_PATH = "Share/Fuben/InfestorExplore/Shop.tab"
local TABLE_SHOP_GOODS_PATH = "Share/Fuben/InfestorExplore/ShopGoods.tab"
local TABLE_REWARD_PATH = "Share/Fuben/InfestorExplore/ExploreRewardPool.tab"
local TABLE_EVENT_GOODS_PATH = "Share/Fuben/InfestorExplore/InfestorEventGoods.tab"
local TABLE_EVENT_TYPE_PATH = "Client/Fuben/InfestorExplore/EventType.tab"
local TABLE_FIGHT_REWARD_COST_PATH = "Share/Fuben/InfestorExplore/FightRewardCost.tab"
local TABLE_ACTIVITY_PATH = "Share/Fuben/InfestorExplore/InfestorActivity.tab"
local TABLE_OUTPOST_DES_PATH = "Client/Fuben/InfestorExplore/OutPostDes.tab"
local TABLE_OUTPOST_DES_POOL_PATH = "Client/Fuben/InfestorExplore/OutPostDesPool.tab"
local TABLE_SCORE_RULE_PATH = "Share/Fuben/InfestorExplore/InfestorBossScoreRule.tab"
local CSXTextManagerGetText = CS.XTextManager.GetText
local tableInsert = table.insert
local tableUnpack = table.unpack
local stringFormat = string.format
local SectionTemplate = {}
local ChapterTemplate = {}
local StageTemplate = {}
local LevelGroupTemplate = {}
local NodeTypeTemplate = {}
local EventPoolMultionOptionsDic = {}
local EventTemplate = {}
local EventPoolTemplate = {}
local DiffConfigDic = {}
local MapTemplates = {}
local FogDepthDic = {}
local BuffTemplate = {}
local FightEventTemplate = {}
local CoreTemplate = {}
local CoreLevelDic = {}
local SupplyRewardTemplate = {}
local ShopTemplate = {}
local ShopGoodsTemplate = {}
local RewardTemplate = {}
local EventGoodsTemplate = {}
local EventTypeTemplate = {}
local FightRewardCostTemplate = {}
local ActivityTemplate = {}
local OutPostDesPoolDic = {}
local OutPostDesDic = {}
local ScoreRuleDict = {}
local QualityIconPath = {
[1] = CS.XGame.ClientConfig:GetString("UiInfestorExploreCorePurple"),
[2] = CS.XGame.ClientConfig:GetString("UiInfestorExploreCorePurple"),
[3] = CS.XGame.ClientConfig:GetString("UiInfestorExploreCorePurple"),
[4] = CS.XGame.ClientConfig:GetString("UiInfestorExploreCorePurple"),
[5] = CS.XGame.ClientConfig:GetString("UiInfestorExploreCoreGold"),
[6] = CS.XGame.ClientConfig:GetString("UiInfestorExploreCoreRed"),
}
local QualityLevel = {
Purple = 4,
Gold = 5, --插件单元金色品质
}
XFubenInfestorExploreConfigs = XFubenInfestorExploreConfigs or {}
XFubenInfestorExploreConfigs.Region = {
UpRegion = 1, --晋级区
KeepRegion = 2, --保级区
DownRegion = 3, --降级区
}
XFubenInfestorExploreConfigs.EventType = {
Unknown = 0,
AddCore = 101, --获得战术核心
LostCore = 102, --失去一个现有战术核心
LevelUpCore = 103, --升级一个已有核心
ChangeTeamHpPer = 201, --改变队伍百分比血量
ChangeCharacterHpPer = 202, --改变成员百分比血量
ChangeMoneyPer = 301, --获得or失去百分比代币
ChangeMoney = 302, --获得or失去指定数量代币
ChangeMoneyRandom = 303, --获得or失去随机数量代币
ChangeActionPoint = 401, --获得or失去指定数量行动点
AddBuff = 501, --获得一个buff
RemoveBuff = 502, --随机移除一个已有buff
}
XFubenInfestorExploreConfigs.MaxWearingCoreNum = 6 --核心最大穿戴数量
XFubenInfestorExploreConfigs.MaxEventOptionNum = 3 --可选择事件最大选项数量
local InitMapConfig = function()
local paths = CS.XTableManager.GetPaths(TABLE_MAP_PATH)
XTool.LoopCollection(paths, function(path)
local key = tonumber(XTool.GetFileNameWithoutExtension(path))
MapTemplates[key] = XTableManager.ReadByIntKey(path, XTable.XTableInfestorExploreGrid, "Id")
end)
end
local MAX_FOG_DEPTH = 5--最大迷雾深度
local InitFogConfig = function()
local template = XTableManager.ReadByIntKey(TABLE_FOG_PATH, XTable.XTableInfestorExploreFog, "Id")
for _, config in pairs(template) do
local depth = config.Depth
if depth > MAX_FOG_DEPTH then
XLog.Error("XFubenInfestorExploreConfigs InitFogConfig Erorr: 感染体玩法地图深度配置错误:超过最大深度上限: " .. MAX_FOG_DEPTH .. ", 配置路径: " .. TABLE_FOG_PATH)
return
end
FogDepthDic[config.Type] = depth
end
end
local InitDiffConfig = function()
local template = XTableManager.ReadByIntKey(TABLE_DIFF_PATH, XTable.XTableInfestorExploreDiff, "Id")
for _, config in pairs(template) do
local groupId = config.GroupId
local groupConfig = DiffConfigDic[groupId] or {}
DiffConfigDic[groupId] = groupConfig
local diff = config.Diff
groupConfig[diff] = config
end
end
local InitEventPoolResConfig = function()
local template = XTableManager.ReadByIntKey(TABLE_EVENT_POOL_RES_PATH, XTable.XTableInfestorEventPoolRes, "PoolId")
for _, config in pairs(template) do
local poolId = config.PoolId
local multiOption = EventPoolMultionOptionsDic[poolId] or {}
for i = 1, XFubenInfestorExploreConfigs.MaxEventOptionNum do
local options = multiOption[i] or {}
multiOption[i] = options
for index, eventId in pairs(config["EventId" .. i]) do
options[index] = eventId
end
end
EventPoolMultionOptionsDic[poolId] = multiOption
end
EventPoolTemplate = template
end
local InitCoreLevelConfig = function()
local template = XTableManager.ReadByIntKey(TABLE_CORE_LEVEL_PATH, XTable.XTableInfestorExploreCoreLevelEffect, "Id")
for _, config in pairs(template) do
local coreId = config.CoreId
local coreConfig = CoreLevelDic[coreId] or {}
CoreLevelDic[coreId] = coreConfig
local level = config.CoreLevel
coreConfig[level] = config
end
end
local InitOutPostDesPoolConfig = function()
local template = XTableManager.ReadByIntKey(TABLE_OUTPOST_DES_POOL_PATH, XTable.XTableInfestorOutPostDesPool, "Id")
for _, config in pairs(template) do
local poolId = config.PoolId
local desList = OutPostDesPoolDic[poolId] or {}
OutPostDesPoolDic[poolId] = desList
tableInsert(desList, config.Description)
end
end
local InitOutPostDesConfig = function()
local template = XTableManager.ReadByIntKey(TABLE_OUTPOST_DES_PATH, XTable.XTableInfestorOutPostDes, "Id")
for _, config in pairs(template) do
local key = config.Key
OutPostDesDic[key] = config
end
end
local InitScoreRuleConfig = function()
ScoreRuleDict = XTableManager.ReadByIntKey(TABLE_SCORE_RULE_PATH, XTable.XTableInfestorBossScoreRule, "StageId")
end
function XFubenInfestorExploreConfigs.Init()
SectionTemplate = XTableManager.ReadByIntKey(TABLE_SECTION_PATH, XTable.XTableInfestorExploreSection, "Id")
ChapterTemplate = XTableManager.ReadByIntKey(TABLE_CHAPTER_PATH, XTable.XTableInfestorExploreChapter, "Id")
StageTemplate = XTableManager.ReadByIntKey(TABLE_STAGE_PATH, XTable.XTableInfestorExploreNode, "Id")
LevelGroupTemplate = XTableManager.ReadByIntKey(TABLE_LEVEL_GROUP_PATH, XTable.XTableInfestorGroup, "Id")
NodeTypeTemplate = XTableManager.ReadByIntKey(TABLE_NODETYPE_PATH, XTable.XTableInfestorNodeType, "Type")
BuffTemplate = XTableManager.ReadByIntKey(TABLE_BUFF_PATH, XTable.XTableInfestorBuffsRes, "Id")
FightEventTemplate = XTableManager.ReadByIntKey(TABLE_FIGHTEVENT_PATH, XTable.XTableInfestorFightEvent, "Id")
CoreTemplate = XTableManager.ReadByIntKey(TABLE_CORE_PATH, XTable.XTableInfestorExploreCore, "Id")
SupplyRewardTemplate = XTableManager.ReadByIntKey(TABLE_SUPPLY_REWARD_PATH, XTable.XTableInfestorSupplyRewardRes, "Id")
ShopTemplate = XTableManager.ReadByIntKey(TABLE_SHOP_PATH, XTable.XTableInfestorExploreShop, "Id")
ShopGoodsTemplate = XTableManager.ReadByIntKey(TABLE_SHOP_GOODS_PATH, XTable.XTableInfestorExploreShopGoods, "Id")
RewardTemplate = XTableManager.ReadByIntKey(TABLE_REWARD_PATH, XTable.XTableInfestorExploreReward, "Id")
EventGoodsTemplate = XTableManager.ReadByIntKey(TABLE_EVENT_GOODS_PATH, XTable.XTableInfestorEventGoods, "EventId")
EventTemplate = XTableManager.ReadByIntKey(TABLE_EVENT_POOL_PATH, XTable.XTableInfestorExploreEvent, "Id")
EventTypeTemplate = XTableManager.ReadByIntKey(TABLE_EVENT_TYPE_PATH, XTable.XTableInfestorEventType, "Type")
FightRewardCostTemplate = XTableManager.ReadByIntKey(TABLE_FIGHT_REWARD_COST_PATH, XTable.XTableInfestorFightRewardCost, "Times")
ActivityTemplate = XTableManager.ReadByIntKey(TABLE_ACTIVITY_PATH, XTable.XTableInfestorActivity, "Id")
InitDiffConfig()
InitMapConfig()
InitFogConfig()
InitEventPoolResConfig()
InitCoreLevelConfig()
InitOutPostDesPoolConfig()
InitOutPostDesConfig()
InitScoreRuleConfig()
end
local GetOutPostDesPoolDesList = function(poolId)
local config = OutPostDesPoolDic[poolId]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetOutPostDesPoolConfig error:配置不存在, : " .. poolId .. ", 配置路径: " .. TABLE_OUTPOST_DES_POOL_PATH)
return
end
return config
end
local GetOutPostDesConfig = function(key)
local config = OutPostDesDic[key]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetOutPostDesConfig error:配置不存在, : " .. key .. ", 配置路径: " .. TABLE_OUTPOST_DES_PATH)
return
end
return config
end
local GetScoreRuleConfig = function(key)
local config = ScoreRuleDict[key]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetScoreRuleConfig error:配置不存在, : " .. key .. ", 配置路径: " .. TABLE_SCORE_RULE_PATH)
return
end
return config
end
local GetActivityConfig = function(activityId)
local config = ActivityTemplate[activityId]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetActivityConfig error:配置不存在, : " .. activityId .. ", 配置路径: " .. TABLE_ACTIVITY_PATH)
return
end
return config
end
local GetSectionConfig = function(sectionId)
local config = SectionTemplate[sectionId]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetChapterConfig error:配置不存在, sectionId: " .. sectionId .. ", 配置路径: " .. TABLE_SECTION_PATH)
return
end
return config
end
local GetChapterConfig = function(chapterId)
local config = ChapterTemplate[chapterId]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetChapterConfig error:配置不存在, chapterId: " .. chapterId .. ", 配置路径: " .. TABLE_CHAPTER_PATH)
return
end
return config
end
local GetStageConfig = function(stageId)
local config = StageTemplate[stageId]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetStageConfig error:配置不存在, stageId: " .. stageId .. ", 配置路径: " .. TABLE_STAGE_PATH)
return
end
return config
end
local GetLevelGroupConfig = function(groupId)
local config = LevelGroupTemplate[groupId]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetLevelGroupConfig error:配置不存在, groupId: " .. groupId .. ", 配置路径: " .. TABLE_LEVEL_GROUP_PATH)
return
end
return config
end
local GetGroupDiffConfigs = function(groupId)
local config = DiffConfigDic[groupId]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetGroupDiffConfigs error:配置不存在, groupId: " .. groupId .. ", 配置路径: " .. TABLE_DIFF_PATH)
return
end
return config
end
local GetGroupDiffConfig = function(groupId, diff)
local config = GetGroupDiffConfigs(groupId)[diff]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetGroupDiffConfig error:配置不存在, diff: " .. diff .. ", 配置路径: " .. TABLE_DIFF_PATH)
return
end
return config
end
local GetNodeTypeConfig = function(nodeType)
local config = NodeTypeTemplate[nodeType]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetNodeTypeConfig error:配置不存在, nodeType: " .. nodeType .. ", 配置路径: " .. TABLE_NODETYPE_PATH)
return
end
return config
end
local GetEventConfig = function(eventId)
local config = EventTemplate[eventId]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetEventConfig error:配置不存在, eventId: " .. eventId .. ", 配置路径: " .. TABLE_EVENT_POOL_PATH)
return
end
return config
end
local GetEventPoolConfig = function(poolId)
local config = EventPoolTemplate[poolId]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetEventPoolConfig error:配置不存在, poolId: " .. poolId .. ", 配置路径: " .. TABLE_EVENT_POOL_RES_PATH)
return
end
return config
end
local GetBuffConfig = function(buffId)
local config = BuffTemplate[buffId]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetBuffConfig error:配置不存在, buffId: " .. buffId .. ", 配置路径: " .. TABLE_BUFF_PATH)
return
end
return config
end
local GetFightEventConfig = function(fightEventId)
local config = FightEventTemplate[fightEventId]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetFightEventConfig error:配置不存在, fightEventId: " .. fightEventId .. ", 配置路径: " .. TABLE_FIGHTEVENT_PATH)
return
end
return config
end
local GetCoreConfig = function(coreId)
local config = CoreTemplate[coreId]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetCoreConfig error:配置不存在, coreId : " .. coreId .. ", 配置路径: " .. TABLE_CORE_PATH)
return
end
return config
end
local GetCoreLevelConfig = function(coreId, level)
local config = CoreLevelDic[coreId]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetCoreLevelConfig error:配置不存在, coreId : " .. coreId .. ", level : " .. level .. ", 配置路径: " .. TABLE_CORE_LEVEL_PATH)
return
end
config = config[level]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetCoreLevelConfig error:配置不存在 coreId : " .. coreId .. ", level : " .. level .. ", 配置路径: " .. TABLE_CORE_LEVEL_PATH)
return
end
return config
end
local GetShopConfig = function(shopId)
local config = ShopTemplate[shopId]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetShopConfig error:配置不存在, shopId : " .. shopId .. ", 配置路径: " .. TABLE_SHOP_PATH)
return
end
return config
end
local GetShopGoodsConfig = function(goodsId)
local config = ShopGoodsTemplate[goodsId]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetShopGoodsConfig error:配置不存在, goodsId : " .. goodsId .. ", 配置路径: " .. TABLE_SHOP_GOODS_PATH)
return
end
return config
end
local GetRewardConfig = function(rewardId)
local config = RewardTemplate[rewardId]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetRewardConfig error:配置不存在, rewardId : " .. rewardId .. ", 配置路径: " .. TABLE_REWARD_PATH)
return
end
return config
end
local GetEventGoodsConfig = function(eventId)
local config = EventGoodsTemplate[eventId]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetEventGoodsConfig error:配置不存在, eventId : " .. eventId .. ", 配置路径: " .. TABLE_EVENT_GOODS_PATH)
return
end
return config
end
local function GetEventPoolMultiOptions(poolId)
local config = EventPoolMultionOptionsDic[poolId]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetEventGoodsConfig error:配置不存在, poolId : " .. poolId .. ", 配置路径: " .. TABLE_EVENT_POOL_RES_PATH)
return
end
return config
end
local function GetEventTypeConfig(eventType)
local config = EventTypeTemplate[eventType]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetEventTypeConfig error:配置不存在, eventType : " .. eventType .. ", 配置路径: " .. TABLE_EVENT_TYPE_PATH)
return
end
return config
end
local GetFightRewardCostConfig = function(times)
local config = FightRewardCostTemplate[times]
if not config then
XLog.Error("XFubenInfestorExploreConfigs GetFightRewardCostConfig error:配置不存在, times : " .. times .. ", 配置路径: " .. TABLE_FIGHT_REWARD_COST_PATH)
return
end
return config
end
function XFubenInfestorExploreConfigs.GetBuffId(fightEventId)
return GetFightEventConfig(fightEventId).ExploreFightEventId[1]
end
function XFubenInfestorExploreConfigs.GetBuffIdTwo(fightEventId)
return GetFightEventConfig(fightEventId).BossFightEventId[1]
end
function XFubenInfestorExploreConfigs.GetBuffName(buffId)
return GetBuffConfig(buffId).Name
end
function XFubenInfestorExploreConfigs.GetBuffDes(buffId)
return GetBuffConfig(buffId).Description
end
function XFubenInfestorExploreConfigs.GetBuffIcon(buffId)
return GetBuffConfig(buffId).Icon
end
function XFubenInfestorExploreConfigs.GetSectionName(sectionId)
return GetSectionConfig(sectionId).Name
end
function XFubenInfestorExploreConfigs.GetChapterConfigs()
return ChapterTemplate
end
function XFubenInfestorExploreConfigs.GetStageConfigs()
return StageTemplate
end
function XFubenInfestorExploreConfigs.GetPreChapterId(chapterId)
return GetChapterConfig(chapterId).PreChapterId
end
function XFubenInfestorExploreConfigs.GetNextChapterId(chapterId)
for paramChapterId in pairs(ChapterTemplate) do
if chapterId == XFubenInfestorExploreConfigs.GetPreChapterId(paramChapterId) then
return paramChapterId
end
end
return 0
end
function XFubenInfestorExploreConfigs.GetChapterName(chapterId)
return GetChapterConfig(chapterId).Name
end
function XFubenInfestorExploreConfigs.GetChapterCharacterLimitType(chapterId)
return GetChapterConfig(chapterId).CharacterLimitType
end
function XFubenInfestorExploreConfigs.GetChapterLimitBuffId(chapterId)
local limitBuffId = GetChapterConfig(chapterId).LimitBuffId
return XFubenConfigs.GetLimitShowBuffId(limitBuffId)
end
function XFubenInfestorExploreConfigs.GetChapterPrefabPath(chapterId)
return GetChapterConfig(chapterId).Prefab
end
function XFubenInfestorExploreConfigs.GetChapterDescription(chapterId)
return GetChapterConfig(chapterId).Description
end
function XFubenInfestorExploreConfigs.GetChapterIcon(chapterId)
return GetChapterConfig(chapterId).Icon
end
function XFubenInfestorExploreConfigs.GetChapterBg(chapterId)
return GetChapterConfig(chapterId).Bg
end
function XFubenInfestorExploreConfigs.GetMapId(chapterId)
return GetChapterConfig(chapterId).MapId
end
function XFubenInfestorExploreConfigs.GetNodeType(stageId)
return GetStageConfig(stageId).Type
end
function XFubenInfestorExploreConfigs.GetNodeResType(stageId)
return GetStageConfig(stageId).ResType
end
function XFubenInfestorExploreConfigs.GetFightStageId(stageId)
return GetStageConfig(stageId).FightStageId
end
function XFubenInfestorExploreConfigs.GetShowRewardId(stageId)
return GetStageConfig(stageId).ShowRewardId
end
function XFubenInfestorExploreConfigs.GetUseActionPoint(stageId)
return GetStageConfig(stageId).UseActionPoint
end
function XFubenInfestorExploreConfigs.GetGroupLevelBorder(groupId)
local config = GetLevelGroupConfig(groupId)
return config.MinLevel, config.MaxLevel
end
function XFubenInfestorExploreConfigs.GetDiffName(groupId, diff)
local config = GetGroupDiffConfig(groupId, diff)
return config.Name
end
function XFubenInfestorExploreConfigs.GetDiffIcon(groupId, diff)
local config = GetGroupDiffConfig(groupId, diff)
return config.Icon
end
function XFubenInfestorExploreConfigs.GetDiffUpNum(groupId, diff)
return GetGroupDiffConfig(groupId, diff).UpNum
end
function XFubenInfestorExploreConfigs.GetDiffKeepNum(groupId, diff)
local joinNum = GetGroupDiffConfig(groupId, diff).JoinNum
local upNum = XFubenInfestorExploreConfigs.GetDiffUpNum(groupId, diff)
local downNum = XFubenInfestorExploreConfigs.GetDiffDownNum(groupId, diff)
return joinNum - upNum - downNum
end
function XFubenInfestorExploreConfigs.GetDiffDownNum(groupId, diff)
return GetGroupDiffConfig(groupId, diff).DownNum
end
function XFubenInfestorExploreConfigs.GetDiffShowScoreGap(groupId, diff)
return GetGroupDiffConfig(groupId, diff).ShowScoreGap
end
function XFubenInfestorExploreConfigs.GetDiffShowScoreLimit(groupId, diff)
return GetGroupDiffConfig(groupId, diff).ShowScoreLimit
end
function XFubenInfestorExploreConfigs.GetNodeTypeIcon(nodeResType)
return GetNodeTypeConfig(nodeResType).Icon
end
function XFubenInfestorExploreConfigs.GetNodeTypeStageBg(nodeResType)
return GetNodeTypeConfig(nodeResType).StageBg
end
function XFubenInfestorExploreConfigs.GetMapConfig(chapterId)
local mapId = XFubenInfestorExploreConfigs.GetMapId(chapterId)
return MapTemplates[mapId]
end
function XFubenInfestorExploreConfigs.GetFogDepth(nodeType)
return FogDepthDic[nodeType] or 0
end
function XFubenInfestorExploreConfigs.GetEventPoolId(stageId)
return GetStageConfig(stageId).EventPoolId
end
function XFubenInfestorExploreConfigs.GetEventPoolName(poolId)
return GetEventPoolConfig(poolId).Name
end
function XFubenInfestorExploreConfigs.GetEventPoolDes(poolId)
return GetEventPoolConfig(poolId).Description
end
function XFubenInfestorExploreConfigs.GetEventPoolBtnName(poolId)
return GetEventPoolConfig(poolId).BtnName
end
function XFubenInfestorExploreConfigs.GetEventPoolMultiOptionEventIds(poolId, index)
local eventIds = {}
local multiOptions = GetEventPoolMultiOptions(poolId)
local multiOption = multiOptions[index]
for _, eventId in pairs(multiOption) do
tableInsert(eventIds, eventId)
end
return eventIds
end
function XFubenInfestorExploreConfigs.GetEventPoolMultiOptionDesList(poolId, index)
local desList = {}
local multiOption = XFubenInfestorExploreConfigs.GetEventPoolMultiOptionEventIds(poolId, index)
for _, eventId in pairs(multiOption) do
tableInsert(desList, XFubenInfestorExploreConfigs.GetEventDes(eventId))
end
return desList
end
function XFubenInfestorExploreConfigs.GetEventDes(eventId)
return GetEventConfig(eventId).Description
end
function XFubenInfestorExploreConfigs.GetEventName(eventId)
return GetEventConfig(eventId).Name
end
function XFubenInfestorExploreConfigs.GetEventIcon(eventId)
return GetEventConfig(eventId).Icon
end
function XFubenInfestorExploreConfigs.GetEventQuality(eventId)
return GetEventConfig(eventId).Quality
end
function XFubenInfestorExploreConfigs.GetEventQualityIcon(eventId)
return QualityIconPath[XFubenInfestorExploreConfigs.GetEventQuality(eventId)]
end
local RankNotRegionText = {
[XFubenInfestorExploreConfigs.Region.UpRegion] = CSXTextManagerGetText("ArenaActivityNotUpRegionDesc"),
[XFubenInfestorExploreConfigs.Region.KeepRegion] = CSXTextManagerGetText("ArenaActivityNotKeepRegionDesc"),
[XFubenInfestorExploreConfigs.Region.DownRegion] = CSXTextManagerGetText("ArenaActivityNotDownRegionDesc"),
}
function XFubenInfestorExploreConfigs.GetRankNotRegionDescText(rankRegion)
return RankNotRegionText[rankRegion]
end
function XFubenInfestorExploreConfigs.GetRankRegionName(rankRegion)
if rankRegion == XFubenInfestorExploreConfigs.Region.UpRegion then
return CSXTextManagerGetText("ArenaActivityUpRegion")
elseif rankRegion == XFubenInfestorExploreConfigs.Region.KeepRegion then
return CSXTextManagerGetText("ArenaActivityKeepRegion")
elseif rankRegion == XFubenInfestorExploreConfigs.Region.DownRegion then
return CSXTextManagerGetText("ArenaActivityDownRegion")
else
XLog.Error("XFubenInfestorExploreConfigs.GetRankRegionName Error: 配置找不到, rankRegion" .. rankRegion)
end
end
function XFubenInfestorExploreConfigs.GetRankRegionDescText(groupId, diff, rankRegion)
local config = GetGroupDiffConfig(groupId, diff)
if rankRegion == XFubenInfestorExploreConfigs.Region.UpRegion then
return CSXTextManagerGetText("ArenaActivityUpRegionDesc", 1, config.UpNum)
elseif rankRegion == XFubenInfestorExploreConfigs.Region.DownRegion then
return CSXTextManagerGetText("ArenaActivityDownRegionDesc", config.JoinNum - config.DownNum + 1, config.JoinNum)
elseif rankRegion == XFubenInfestorExploreConfigs.Region.KeepRegion then
return CSXTextManagerGetText("ArenaActivityKeepRegionDesc", config.UpNum + 1, config.JoinNum - config.DownNum)
else
XLog.Error("XFubenInfestorExploreConfigs.GetRankRegionDescText Error: 配置找不到, groupId: " .. groupId .. ", diff: " .. diff .. ", rankRegion" .. rankRegion)
end
end
local RankRegionColorText = {
[XFubenInfestorExploreConfigs.Region.UpRegion] = CSXTextManagerGetText("ArenaActivityUpRegionColor"),
[XFubenInfestorExploreConfigs.Region.KeepRegion] = CSXTextManagerGetText("ArenaActivityKeepRegionColor"),
[XFubenInfestorExploreConfigs.Region.DownRegion] = CSXTextManagerGetText("ArenaActivityDownRegionColor"),
}
function XFubenInfestorExploreConfigs.GetRankRegionColorText(rankRegion)
return RankRegionColorText[rankRegion]
end
function XFubenInfestorExploreConfigs.GetRankRegionMailId(groupId, diff, rankRegion)
local config = GetGroupDiffConfig(groupId, diff)
if rankRegion == XFubenInfestorExploreConfigs.Region.UpRegion then
return config.UpMailId
elseif rankRegion == XFubenInfestorExploreConfigs.Region.DownRegion then
return config.DownMailId
else
return config.KeepMailId
end
end
function XFubenInfestorExploreConfigs.GetCoreIcon(coreId)
return GetCoreConfig(coreId).Icon
end
function XFubenInfestorExploreConfigs.GetCoreQuality(coreId)
return GetCoreConfig(coreId).Quality
end
--获得等级
function XFubenInfestorExploreConfigs.GetCoreQualityIcon(coreId)
return QualityIconPath[XFubenInfestorExploreConfigs.GetCoreQuality(coreId)]
end
function XFubenInfestorExploreConfigs.GetCoreMaxLevel(coreId)
return GetCoreConfig(coreId).MaxLevel
end
function XFubenInfestorExploreConfigs.GetCoreName(coreId)
return GetCoreConfig(coreId).Name
end
function XFubenInfestorExploreConfigs.GetCoreLevelDes(coreId, level)
return GetCoreLevelConfig(coreId, level).Description
end
function XFubenInfestorExploreConfigs.GetCoreDecomposeMoney(coreId, level)
return GetCoreLevelConfig(coreId, level).DecomposeMoney
end
function XFubenInfestorExploreConfigs.GetSupplyRewardDesTotalNum()
return #SupplyRewardTemplate
end
function XFubenInfestorExploreConfigs.GetSupplyRewardDes(index)
return SupplyRewardTemplate[index].Description or ""
end
function XFubenInfestorExploreConfigs.GetShopRefreshCost(shopId)
return GetShopConfig(shopId).RefreshCost
end
function XFubenInfestorExploreConfigs.GetGoodsCost(goodsId)
return GetShopGoodsConfig(goodsId).Cost
end
function XFubenInfestorExploreConfigs.GetGoodsCoreId(goodsId)
return GetShopGoodsConfig(goodsId).CoreId
end
function XFubenInfestorExploreConfigs.GetGoodsCoreLevel(goodsId)
return GetShopGoodsConfig(goodsId).CoreLevel
end
function XFubenInfestorExploreConfigs.GetGoodsLimitCount(goodsId)
return GetShopGoodsConfig(goodsId).LimitCount or 0
end
function XFubenInfestorExploreConfigs.GetGoodsName(goodsId)
local coreId = XFubenInfestorExploreConfigs.GetGoodsCoreId(goodsId)
return XFubenInfestorExploreConfigs.GetCoreName(coreId)
end
function XFubenInfestorExploreConfigs.GetRewardCoreId(rewardId)
return GetRewardConfig(rewardId).CoreId
end
function XFubenInfestorExploreConfigs.GetRewardCoreLevel(rewardId)
return GetRewardConfig(rewardId).CoreLevel
end
function XFubenInfestorExploreConfigs.GetEventGoodsCost(eventId)
return GetEventGoodsConfig(eventId).Cost
end
function XFubenInfestorExploreConfigs.GetFightRewardCost(buyTimes)
return GetFightRewardCostConfig(buyTimes).Cost
end
function XFubenInfestorExploreConfigs.GetActivityConfigs()
return ActivityTemplate
end
function XFubenInfestorExploreConfigs.GetChapter2StageIds(activityId)
return GetActivityConfig(activityId).BossStageId
end
function XFubenInfestorExploreConfigs.GetOutPostDesPoolIds(key)
return GetOutPostDesConfig(key).PoolId
end
function XFubenInfestorExploreConfigs.GetScoreRuleConfig(stageId)
return GetScoreRuleConfig(stageId)
end
local RandomInterver = 0
function XFubenInfestorExploreConfigs.GetRandomOutPostDes(poolId)
local desList = GetOutPostDesPoolDesList(poolId)
local totalDesNum = #desList
RandomInterver = RandomInterver + 100
math.randomseed(os.time() + RandomInterver)
local ret = math.random(totalDesNum)
return desList[ret]
end
function XFubenInfestorExploreConfigs.GetEventTypeTipContent(eventType, eventArgs)
local des = GetEventTypeConfig(eventType).Description
if eventType == XFubenInfestorExploreConfigs.EventType.LostCore then
local coreId = eventArgs and eventArgs[1]
if not XDataCenter.FubenInfestorExploreManager.IsHaveCore(coreId) then
return GetEventTypeConfig(eventType).DescriptionEmpty
end
local coreName = XFubenInfestorExploreConfigs.GetCoreName(coreId)
return stringFormat(des, coreName)
elseif eventType == XFubenInfestorExploreConfigs.EventType.ChangeTeamHpPer then
local hpPer = tableUnpack(eventArgs)
if hpPer < 0 then
des = GetEventTypeConfig(eventType).DescriptionRevert
hpPer = -hpPer
end
return stringFormat(des, hpPer)
elseif eventType == XFubenInfestorExploreConfigs.EventType.ChangeCharacterHpPer then
local hpPer, characterId = tableUnpack(eventArgs)
local characterName = XCharacterConfigs.GetCharacterFullNameStr(characterId)
if hpPer < 0 then
hpPer = -hpPer
des = GetEventTypeConfig(eventType).DescriptionRevert
end
return stringFormat(des, characterName, hpPer)
elseif eventType == XFubenInfestorExploreConfigs.EventType.ChangeMoneyPer
or eventType == XFubenInfestorExploreConfigs.EventType.ChangeMoney
or eventType == XFubenInfestorExploreConfigs.EventType.ChangeMoneyRandom then
local addMoney = eventArgs and eventArgs[1]
if not addMoney or addMoney == 0 then
des = GetEventTypeConfig(eventType).DescriptionEmpty
return stringFormat(des, 0)
end
if addMoney < 0 then
addMoney = -addMoney
if XDataCenter.FubenInfestorExploreManager.IsMoneyEmpty() then
des = GetEventTypeConfig(eventType).DescriptionEmpty
local oldMoney = XDataCenter.FubenInfestorExploreManager.GetOldMoneyCount()
return stringFormat(des, oldMoney)
end
des = GetEventTypeConfig(eventType).DescriptionRevert
end
return stringFormat(des, addMoney)
elseif eventType == XFubenInfestorExploreConfigs.EventType.ChangeActionPoint then
local addActionPoint = eventArgs and eventArgs[1]
if not addActionPoint or addActionPoint == 0 then
return GetEventTypeConfig(eventType).DescriptionEmpty
end
if addActionPoint < 0 then
addActionPoint = -addActionPoint
if XDataCenter.FubenInfestorExploreManager.IsActionPointEmpty() then
return GetEventTypeConfig(eventType).DescriptionEmpty
end
des = GetEventTypeConfig(eventType).DescriptionRevert
end
return stringFormat(des, addActionPoint)
elseif eventType == XFubenInfestorExploreConfigs.EventType.AddBuff then
local buffId = eventArgs and eventArgs[1]
if buffId then
local buffName = XFubenInfestorExploreConfigs.GetBuffName(buffId)
return stringFormat(des, buffName)
end
elseif eventType == XFubenInfestorExploreConfigs.EventType.RemoveBuff then
local buffIds = eventArgs
if not buffIds then
return GetEventTypeConfig(eventType).DescriptionEmpty
end
for _, buffId in pairs(buffIds) do
if XDataCenter.FubenInfestorExploreManager.CheckBuffExsit(buffIds) then
return des
end
end
elseif eventType == XFubenInfestorExploreConfigs.EventType.LevelUpCore then
if not eventArgs then
if XDataCenter.FubenInfestorExploreManager.IsHaveOnceCore() then
return GetEventTypeConfig(eventType).DescriptionRevert
else
return GetEventTypeConfig(eventType).DescriptionEmpty
end
end
return ""
end
return stringFormat(des, tableUnpack(eventArgs))
end
--判断奖励的等级
function XFubenInfestorExploreConfigs.IsPrecious(quality)
if quality >= QualityLevel.Gold then
return true
end
end
XFubenInfestorExploreConfigs.GetGroupDiffConfigs = GetGroupDiffConfigs

View file

@ -0,0 +1,72 @@
XFubenMainLineConfigs = XFubenMainLineConfigs or {}
local TABLE_CHAPTER_MAIN = "Share/Fuben/MainLine/ChapterMain.tab"
local TABLE_CHAPTER = "Share/Fuben/MainLine/Chapter.tab"
local TABLE_TREASURE = "Share/Fuben/MainLine/Treasure.tab"
local TABLE_EXPLOREGROUP = "Client/Fuben/MainLine/ExploreGroup.tab"
local TABLE_EXPLOREITEM = "Client/Fuben/MainLine/ExploreItem.tab"
local ChapterMainTemplates = {}
local ChapterCfg = {}
local TreasureCfg = {}
local ExploreGroupCfg = {}
local ExploreItemCfg = {}
function XFubenMainLineConfigs.Init()
ChapterMainTemplates = XTableManager.ReadByIntKey(TABLE_CHAPTER_MAIN, XTable.XTableChapterMain, "Id")
ChapterCfg = XTableManager.ReadByIntKey(TABLE_CHAPTER, XTable.XTableChapter, "ChapterId")
TreasureCfg = XTableManager.ReadByIntKey(TABLE_TREASURE, XTable.XTableTreasure, "TreasureId")
ExploreGroupCfg = XTableManager.ReadByIntKey(TABLE_EXPLOREGROUP, XTable.XTableMainLineExploreGroup, "Id")
ExploreItemCfg = XTableManager.ReadByIntKey(TABLE_EXPLOREITEM, XTable.XTableMainLineExploreItem, "Id")
end
function XFubenMainLineConfigs.GetChapterMainTemplates()
return ChapterMainTemplates
end
function XFubenMainLineConfigs.GetChapterCfg()
return ChapterCfg
end
function XFubenMainLineConfigs.GetTreasureCfg()
return TreasureCfg
end
function XFubenMainLineConfigs.GetExploreGroupCfg()
return ExploreGroupCfg
end
function XFubenMainLineConfigs.GetExploreItemCfg()
return ExploreItemCfg
end
function XFubenMainLineConfigs.GetExploreItemCfgById(id)
return ExploreItemCfg[id]
end
---
--- 根据'chapterMainId'获取章节的周目Id
---@param chapterMainId number
---@return number
function XFubenMainLineConfigs.GetZhouMuId(chapterMainId)
if (ChapterMainTemplates or {})[chapterMainId] == nil then
XLog.ErrorTableDataNotFound("XFubenMainLineConfigs.GetZhouMuId",
"主线章节", TABLE_CHAPTER_MAIN, "Id", tostring(chapterMainId))
return
end
return ChapterMainTemplates[chapterMainId].ZhouMuId
end
local GetChapterMainConfig = function(id)
local config = ChapterMainTemplates[id]
if not config then
XLog.Error("XTRPGConfigs GetChapterMainConfig error:配置不存在, Id: " .. id .. ", 配置路径: " .. TABLE_CHAPTER_MAIN)
return
end
return config
end
function XFubenMainLineConfigs.GetChapterMainChapterEn(id)
local config = GetChapterMainConfig(id)
return config.ChapterEn
end

View file

@ -0,0 +1,116 @@
XFubenNewCharConfig = XFubenNewCharConfig or {}
local SHARE_NEWCHAR_TEACH = "Share/Fuben/Teaching/TeachingActivity.tab"
local SHARE_NEWCHAR_TREASURE = "Share/Fuben/Teaching/TeachingTreasure.tab"
local CLIENT_CHARMSG = "Client/Fuben/Teaching/CharActiveMsg.tab"
local SHARE_STAGE_DETAIL = "Share/Fuben/Teaching/TeachingRobot.tab"
local NewCharTeachAct = {}
local NewCharTreasure = {}
local NewCharMsg = {}
local NewCharMsgGroup = {}
local NewCharStageDetail = {}
XFubenNewCharConfig.NewCharType =
{
YinMianZheGuang = 1,
KoroChar = 2,
WeiLa = 3,
}
XFubenNewCharConfig.KoroPanelType =
{
Normal = 1,
Teaching = 2,
Challenge = 3,
}
function XFubenNewCharConfig.Init()
NewCharTeachAct = XTableManager.ReadByIntKey(SHARE_NEWCHAR_TEACH, XTable.XTableTeachingActivity, "Id")
NewCharTreasure = XTableManager.ReadByIntKey(SHARE_NEWCHAR_TREASURE, XTable.XTableTeachingTreasure, "TreasureId")
NewCharMsg = XTableManager.ReadByIntKey(CLIENT_CHARMSG, XTable.XTableCharActiveMsg, "Id")
NewCharStageDetail = XTableManager.ReadByIntKey(SHARE_STAGE_DETAIL, XTable.XTableTeachingRobot, "StageId")
for _, v in pairs(NewCharMsg) do
NewCharMsgGroup[v.ActId] = NewCharMsgGroup[v.ActId] or {}
local grp = NewCharMsgGroup[v.ActId]
table.insert(grp, v)
end
for _, v in pairs(NewCharMsgGroup) do
table.sort(v, function(a, b)
if a.Order ~= b.Order then
return a.Order < b.Order
end
return a.Id < b.Id
end)
end
end
function XFubenNewCharConfig.GetDataById(id)
local template = NewCharTeachAct[id]
if not template then
XLog.ErrorTableDataNotFound("XFubenNewCharConfig.GetDataById", "TeachingActivity", SHARE_NEWCHAR_TEACH, "Id", tostring(id))
return
end
return template
end
function XFubenNewCharConfig.GetActTemplates()
return NewCharTeachAct
end
function XFubenNewCharConfig.GetMsgGroupById(id)
local group = NewCharMsgGroup[id]
if not group then
XLog.ErrorTableDataNotFound("XFubenNewCharConfig.GetMsgGroupById", "CharActiveMsg", CLIENT_CHARMSG, "Id", tostring(id))
return
end
return group
end
function XFubenNewCharConfig.GetTreasureCfg(treasureId)
return NewCharTreasure[treasureId]
end
function XFubenNewCharConfig.GetActivityTime(id)
local config = XFubenNewCharConfig.GetDataById(id)
return XFunctionManager.GetTimeByTimeId(config.TimeId)
end
function XFubenNewCharConfig.GetNewCharType(id)
local config = NewCharTeachAct[id]
return config.NewCharType
end
--获取详情描述
function XFubenNewCharConfig.GetNewCharDescDetail(id)
local config = NewCharStageDetail[id]
return string.gsub(config.DescDetail, "\\n", "\n")
end
function XFubenNewCharConfig.GetNewCharShowFightEventIds(id)
local config = NewCharStageDetail[id]
return config.ShowFightEventIds
end
function XFubenNewCharConfig.GetNewCharKoroCfg()
local cfg = nil
if NewCharTeachAct then
for _, v in pairs(NewCharTeachAct) do
if v.NewCharType == XFubenNewCharConfig.NewCharType.KoroChar then
cfg = v
break
end
end
end
return cfg
end
--获取试用角色
function XFubenNewCharConfig:GetTryCharacterIds(id)
local config = NewCharStageDetail[id]
return config.RobotId
end

View file

@ -0,0 +1,113 @@
local TABLE_ACTIVITY_PATH = "Share/Fuben/RepeatChallenge/RepeatChallengeActivity.tab"
local TABLE_CHAPTER_PATH = "Share/Fuben/RepeatChallenge/RepeatChallengeChapter.tab"
local TABLE_STAGE_PATH = "Share/Fuben/RepeatChallenge/RepeatChallengeStage.tab"
local TABLE_LEVEL_PATH = "Share/Fuben/RepeatChallenge/RepeatChallengeLevel.tab"
local TABLE_REWARD_PATH = "Share/Fuben/RepeatChallenge/RepeatChallengeReward.tab"
local pairs = pairs
local RepeatChallengeActivityTemplates = {}
local RepeatChallengeChapterTemplates = {}
local RepeatChallengeStageTemplates = {}
local RepeatChallengeLevelTemplates = {}
local RepeatChallengeRewardTemplates = {}
local DefaultActivityId = 0
local StageIdToChapterIdDic = {}
XFubenRepeatChallengeConfigs = XFubenRepeatChallengeConfigs or {}
function XFubenRepeatChallengeConfigs.Init()
RepeatChallengeActivityTemplates = XTableManager.ReadByIntKey(TABLE_ACTIVITY_PATH, XTable.XTableRepeatChallengeActivity, "Id")
RepeatChallengeChapterTemplates = XTableManager.ReadByIntKey(TABLE_CHAPTER_PATH, XTable.XTableRepeatChallengeChapter, "Id")
RepeatChallengeStageTemplates = XTableManager.ReadByIntKey(TABLE_STAGE_PATH, XTable.XTableRepeatChallengeStage, "Id")
RepeatChallengeLevelTemplates = XTableManager.ReadByIntKey(TABLE_LEVEL_PATH, XTable.XTableRepeatChallengeLevel, "Id")
RepeatChallengeRewardTemplates = XTableManager.ReadByIntKey(TABLE_REWARD_PATH, XTable.XTableRepeatChallengeReward, "Id")
for activityId, config in pairs(RepeatChallengeActivityTemplates) do
if XTool.IsNumberValid(config.ActivityTimeId) then
if DefaultActivityId == 0 or DefaultActivityId < activityId then
DefaultActivityId = activityId
end
end
DefaultActivityId = activityId--若全部过期取最后一行配置作为默认下次开启的活动ID
end
for chapterId, chapterCfg in pairs(RepeatChallengeChapterTemplates) do
for _, stageId in pairs(chapterCfg.StageId) do
StageIdToChapterIdDic[stageId] = chapterId
end
end
end
function XFubenRepeatChallengeConfigs.GetChapterCfgs()
return RepeatChallengeChapterTemplates
end
function XFubenRepeatChallengeConfigs.GetChapterCfgPath()
return TABLE_CHAPTER_PATH
end
function XFubenRepeatChallengeConfigs.GetChapterCfg(chapterId)
local chapterCfg = RepeatChallengeChapterTemplates[chapterId]
if not chapterCfg then
XLog.ErrorTableDataNotFound("XFubenRepeatChallengeConfigs.GetChapterCfg",
"RepeatChallengeChapter", TABLE_CHAPTER_PATH, "chapterId", tostring(chapterId))
return
end
return chapterCfg
end
function XFubenRepeatChallengeConfigs.GetActivityConfig(activityId)
local activityCfg = RepeatChallengeActivityTemplates[activityId]
if not activityCfg then
XLog.ErrorTableDataNotFound("XFubenRepeatChallengeConfigs.GetActivityConfig",
"RepeatChallengeActivity", TABLE_ACTIVITY_PATH, "activityId", tostring(activityId))
return
end
return activityCfg
end
function XFubenRepeatChallengeConfigs.GetLevelConfigs()
return RepeatChallengeLevelTemplates
end
function XFubenRepeatChallengeConfigs.GetMaxLevel()
return #RepeatChallengeLevelTemplates
end
function XFubenRepeatChallengeConfigs.GetLevelConfig(level)
local activityCfg = RepeatChallengeLevelTemplates[level]
if not activityCfg then
XLog.ErrorTableDataNotFound("XFubenRepeatChallengeConfigs.GetLevelConfig", "RepeatChallengeLevel", TABLE_LEVEL_PATH, "level", tostring(level))
return
end
return activityCfg
end
function XFubenRepeatChallengeConfigs.GetStageConfig(stageId)
local activityCfg = RepeatChallengeStageTemplates[stageId]
if not activityCfg then
XLog.ErrorTableDataNotFound("XFubenRepeatChallengeConfigs.GetStageConfig",
"RepeatChallengeStage", TABLE_STAGE_PATH, "stageId", tostring(stageId))
return
end
return activityCfg
end
function XFubenRepeatChallengeConfigs.GetChapterRewardConfig(chapterId)
local activityCfg = RepeatChallengeRewardTemplates[chapterId]
if not activityCfg then
XLog.ErrorTableDataNotFound("XFubenRepeatChallengeConfigs.GetChapterRewardConfig",
"RepeatChallengeReward", TABLE_REWARD_PATH, "chapterId", tostring(chapterId))
return
end
return activityCfg
end
function XFubenRepeatChallengeConfigs.GetDefaultActivityId()
return DefaultActivityId
end
function XFubenRepeatChallengeConfigs.GetChapterIdByStageId(stageId)
return StageIdToChapterIdDic[stageId]
end

View file

@ -0,0 +1,610 @@
XFubenRogueLikeConfig = XFubenRogueLikeConfig or {}
local CLIENT_ROGUELIKE_ACTIVITY = "Client/Fuben/RogueLike/RogueLikeActivityDetails.tab"
local CLIENT_ROGUELIKE_Buff = "Client/Fuben/RogueLike/RogueLikeBuffDetails.tab"
local CLIENT_ROGUELIKE_TIER_SECTION = "Client/Fuben/RogueLike/RogueLikeTierSectionDetails.tab"
local CLIENT_ROGUELIKE_TIER_SPECIALEVENT = "Client/Fuben/RogueLike/RogueLikeSpecialEventDetails.tab"
local CLIENT_ROGUELIKE_SUPPORTSTATION = "Client/Fuben/RogueLike/RogueLikeSupportStationDetails.tab"
local CLIENT_ROGUELIKE_SPECIALEVENTGROUPITEM = "Client/Fuben/RogueLike/RogueLikeSpecialEventGroupItem.tab"
local CLIENT_ROGUELIKE_SPECIALEVENTGROUPDETAIL = "Client/Fuben/RogueLike/RogueLikeSpecialEventGroupDetails.tab"
local CLIENT_ROGUELIKE_SCORE_DETAIL = "Client/Fuben/RogueLike/RogueLikePurgatoryScoreDesDetail.tab"
local SHARE_ROGUELIKE_ACTIVITY = "Share/Fuben/RogueLike/RogueLikeActivity.tab"
local SHARE_ROGUELIKE_BOX = "Share/Fuben/RogueLike/RogueLikeBox.tab"
local SHARE_ROGUELIKE_BUFF = "Share/Fuben/RogueLike/RogueLikeBuff.tab"
local SHARE_ROGUELIKE_EVENT = "Share/Fuben/RogueLike/RogueLikeEvent.tab"
local SHARE_ROGUELIKE_NODE = "Share/Fuben/RogueLike/RogueLikeNode.tab"
local SHARE_ROGUELIKE_ROBOT = "Share/Fuben/RogueLike/RogueLikeRobot.tab"
local SHARE_ROGUELIKE_SHOP = "Share/Fuben/RogueLike/RogueLikeShop.tab"
local SHARE_ROGUELIKE_SHOPITEM = "Share/Fuben/RogueLike/RogueLikeShopItem.tab"
local SHARE_ROGUELIKE_TIER = "Share/Fuben/RogueLike/RogueLikeTier.tab"
local SHARE_ROGUELIKE_TIER_SECTION = "Share/Fuben/RogueLike/RogueLikeTierSection.tab"
local SHARE_ROGUELIKE_RECOVER = "Share/Fuben/RogueLike/RogueLikeRecover.tab"
local SHARE_ROGUELIKE_SPECIALEVENT = "Share/Fuben/RogueLike/RogueLikeSpecialEvent.tab"
local SHARE_ROGUELIKE_TEAMEFFECT = "Share/Fuben/RogueLike/RogueLikeTeamEffect.tab"
local SHARE_ROGUELIKE_SUPPORTSTATION = "Share/Fuben/RogueLike/RogueLikeSupportStation.tab"
local SHARE_ROGUELIKE_SPECIALEVENTGROUP = "Share/Fuben/RogueLike/RogueLikeSpecialEventGroup.tab"
local SHARE_ROGUELIKE_NODE_DETAILS = "Share/Fuben/RogueLike/RogueLikeNodeDetails.tab"
local ActivityConfig = {}
local BuffConfig = {}
local NodeConfig = {}
local TierSectionConfig = {}
local SpecialEventConfig = {}
local SupportStationConfig = {}
local SpecialEventGroupDetailsConfig = {}
local SpecialEventGroupItemConfig = {}
local RogueLikeActivity = {}
local RogueLikeBox = {}
local RogueLikeBuff = {}
local RogueLikeEvent = {}
local RogueLikeNode = {}
local RogueLikeRobot = {}
local RogueLikeShop = {}
local RogueLikeShopItem = {}
local RogueLikeTier = {}
local RogueLikeTierSection = {}
local RogueLikeRecover = {}
local RogueLikeSpecialEvent = {}
local RogueLikeTeamEffect = {}
local RogueLikeSupportStation = {}
local RogueLikeSpecialEventGroup = {}
local RogueLikePurgatoryScoreDesConfig = {}
local Section2GroupMap = {}
local Group2TierMap = {}
local Group2NodeMap = {}
local NodeIndexMap = {}
XFubenRogueLikeConfig.TEAM_NUMBER = CS.XGame.ClientConfig:GetInt("RogueLikeTeamMemberCount")
XFubenRogueLikeConfig.UNKNOW_ROBOT = CS.XGame.ClientConfig:GetString("RogueLikeUnknowRobot")
XFubenRogueLikeConfig.NORMAL_NODE = CS.XGame.ClientConfig:GetString("RogueLikeNormalNode")
XFubenRogueLikeConfig.BOSS_NODE = CS.XGame.ClientConfig:GetString("RogueLikeBossNode")
XFubenRogueLikeConfig.ChallengeCoin = CS.XGame.ClientConfig:GetInt("RogueLikeChallengeCoin")
XFubenRogueLikeConfig.PumpkinCoin = CS.XGame.ClientConfig:GetInt("RogueLikePumpkinCoin")
XFubenRogueLikeConfig.KeepsakeCoin = CS.XGame.ClientConfig:GetInt("RogueLikeKeepsakeCoin")
XFubenRogueLikeConfig.CHECK_LINES = CS.XGame.ClientConfig:GetInt("RogueLikeCheckLineSwitch")
XFubenRogueLikeConfig.KEY_PLAY_STORY = "KeyRogueLikePlayBeginStory"
XFubenRogueLikeConfig.KEY_SHOW_TIPS = "KeyRogueLikeShowTips"
XFubenRogueLikeConfig.XRLNodeType = {
Fight = 1, --战斗//不需要请求
Box = 2, --宝箱//不需要请求
Rest = 3, --休息//不需要请求
Shop = 4, --商店//需要请求
Event = 5, --事件//需要请求
}
--这里是定义副本模式的枚举
XFubenRogueLikeConfig.TierType = {
Normal = 1, --普通
Purgatory = 2, --试炼
}
-- 节点图标类型
XFubenRogueLikeConfig.NodeTabBg = {
[XFubenRogueLikeConfig.XRLNodeType.Fight] = CS.XGame.ClientConfig:GetString("RogueLikeTabFightNor"),
[XFubenRogueLikeConfig.XRLNodeType.Box] = CS.XGame.ClientConfig:GetString("RogueLikeTabBox"),
[XFubenRogueLikeConfig.XRLNodeType.Rest] = CS.XGame.ClientConfig:GetString("RogueLikeTabRest"),
[XFubenRogueLikeConfig.XRLNodeType.Shop] = CS.XGame.ClientConfig:GetString("RogueLikeTabShop"),
[XFubenRogueLikeConfig.XRLNodeType.Event] = CS.XGame.ClientConfig:GetString("RogueLikeTabEvent"),
}
XFubenRogueLikeConfig.NodeTabDisBg = {
[XFubenRogueLikeConfig.XRLNodeType.Fight] = CS.XGame.ClientConfig:GetString("RogueLikeDisTabNor"),
[XFubenRogueLikeConfig.XRLNodeType.Box] = CS.XGame.ClientConfig:GetString("RogueLikeDisTabBox"),
[XFubenRogueLikeConfig.XRLNodeType.Rest] = CS.XGame.ClientConfig:GetString("RogueLikeDisTabRest"),
[XFubenRogueLikeConfig.XRLNodeType.Shop] = CS.XGame.ClientConfig:GetString("RogueLikeDisTabShop"),
[XFubenRogueLikeConfig.XRLNodeType.Event] = CS.XGame.ClientConfig:GetString("RogueLikeDisTabEvent"),
}
XFubenRogueLikeConfig.NodeFightType = {
Normal = 1,
Elite = 2,
Boss = 3
}
XFubenRogueLikeConfig.NodeFightTabBg = {
[XFubenRogueLikeConfig.NodeFightType.Normal] = CS.XGame.ClientConfig:GetString("RogueLikeTabFightNor"),
[XFubenRogueLikeConfig.NodeFightType.Elite] = CS.XGame.ClientConfig:GetString("RogueLikeTabFightElite"),
[XFubenRogueLikeConfig.NodeFightType.Boss] = CS.XGame.ClientConfig:GetString("RogueLikeTabFightBoss"),
}
XFubenRogueLikeConfig.NodeFightTabDisBg = {
[XFubenRogueLikeConfig.NodeFightType.Normal] = CS.XGame.ClientConfig:GetString("RogueLikeDisTabNor"),
[XFubenRogueLikeConfig.NodeFightType.Elite] = CS.XGame.ClientConfig:GetString("RogueLikeDisTabElite"),
[XFubenRogueLikeConfig.NodeFightType.Boss] = CS.XGame.ClientConfig:GetString("RogueLikeDisTabBoss"),
}
XFubenRogueLikeConfig.XRLBoxType = {
Item = 1, --物品
Buff = 2, --buff
}
XFubenRogueLikeConfig.XRLShopItemType = {
Item = 1,
Buff = 2,
Robot = 3,
}
XFubenRogueLikeConfig.XRLEventType = {
NormalNode = 1, --普通节点事件
Other = 2, --其他事件
}
XFubenRogueLikeConfig.XRLResetType = {
Recover = 1, --恢复行动点
IntensifyBuff = 2, --强化buff
}
-- buff类型
XFubenRogueLikeConfig.BuffType = {
PositiveBuff = 1,
NegativeBuff = 2
}
-- 特殊事件结果类型
XFubenRogueLikeConfig.SpecialResultType = {
SingleEvent = 1,
MultipleEvent = 2,
}
-- 选择出站类型
XFubenRogueLikeConfig.SelectCharacterType = {
Character = 1,
Robot = 2,
}
XFubenRogueLikeConfig.XRLOtherEventType = {
--获得buff
AddBuff = 1, --测过
--移除buff
RemoveBuff = 2,
--获得助战机器人
AddRobot = 3, --测过
--血量恢复
AddHp = 4,
--增加行动点
AddActionPoint = 5, --测过
--减少行动点
ActionPoint = 6, --测过
--获得物品
GainItem = 7,
--兑换物品
ExchangeItem = 8,
--消耗物品
ConsumeItem = 9,
-- 减少血量
ReduceHp = 10,
-- 获得物品(百分比)
GainItemRate = 11,
-- 消耗物品(百分比)
ConsumeItemRate = 12,
}
-- 休息点操作回复行动点强化buff离开
XFubenRogueLikeConfig.ClientRestCount = 3
XFubenRogueLikeConfig.ClientRestClickType = {
Recover = 1,
IntensifyBuff = 2,
Leave = 3,
}
XFubenRogueLikeConfig.ClientRestClickName = {
[XFubenRogueLikeConfig.ClientRestClickType.Recover] = CS.XTextManager.GetText("RogueLikeAddActionPoint"),
[XFubenRogueLikeConfig.ClientRestClickType.IntensifyBuff] = CS.XTextManager.GetText("RogueLikeIntensifyBuff"),
[XFubenRogueLikeConfig.ClientRestClickType.Leave] = CS.XTextManager.GetText("RogueLikeRestLeave"),
}
function XFubenRogueLikeConfig.Init()
RogueLikeActivity = XTableManager.ReadByIntKey(SHARE_ROGUELIKE_ACTIVITY, XTable.XTableRogueLikeActivity, "Id")
RogueLikeBox = XTableManager.ReadByIntKey(SHARE_ROGUELIKE_BOX, XTable.XTableRogueLikeBox, "Id")
RogueLikeBuff = XTableManager.ReadByIntKey(SHARE_ROGUELIKE_BUFF, XTable.XTableRogueLikeBuff, "Id")
RogueLikeEvent = XTableManager.ReadByIntKey(SHARE_ROGUELIKE_EVENT, XTable.XTableRogueLikeEvent, "Id")
RogueLikeNode = XTableManager.ReadByIntKey(SHARE_ROGUELIKE_NODE, XTable.XTableRogueLikeNode, "Id")
RogueLikeRobot = XTableManager.ReadByIntKey(SHARE_ROGUELIKE_ROBOT, XTable.XTableRogueLikeRobot, "Id")
RogueLikeShop = XTableManager.ReadByIntKey(SHARE_ROGUELIKE_SHOP, XTable.XTableRogueLikeShop, "Id")
RogueLikeShopItem = XTableManager.ReadByIntKey(SHARE_ROGUELIKE_SHOPITEM, XTable.XTableRogueLikeShopItem, "Id")
RogueLikeTier = XTableManager.ReadByIntKey(SHARE_ROGUELIKE_TIER, XTable.XTableRogueLikeTier, "Id")
RogueLikeTierSection = XTableManager.ReadByIntKey(SHARE_ROGUELIKE_TIER_SECTION, XTable.XTableRogueLikeTierSection, "Id")
RogueLikeRecover = XTableManager.ReadByIntKey(SHARE_ROGUELIKE_RECOVER, XTable.XTableRogueLikeRecover, "Id")
RogueLikeSpecialEvent = XTableManager.ReadByIntKey(SHARE_ROGUELIKE_SPECIALEVENT, XTable.XTableRogueLikeSpecialEvent, "Id")
RogueLikeTeamEffect = XTableManager.ReadByIntKey(SHARE_ROGUELIKE_TEAMEFFECT, XTable.XTableRogueLikeTeamEffect, "Id")
RogueLikeSupportStation = XTableManager.ReadByIntKey(SHARE_ROGUELIKE_SUPPORTSTATION, XTable.XTableRogueLikeSupportStation, "Id")
RogueLikeSpecialEventGroup = XTableManager.ReadByIntKey(SHARE_ROGUELIKE_SPECIALEVENTGROUP, XTable.XTableRogueLikeSpecialEventGroup, "Id")
ActivityConfig = XTableManager.ReadByIntKey(CLIENT_ROGUELIKE_ACTIVITY, XTable.XTableRogueLikeActivityDetails, "Id")
BuffConfig = XTableManager.ReadByIntKey(CLIENT_ROGUELIKE_Buff, XTable.XTableRogueLikeBuffDetails, "Id")
NodeConfig = XTableManager.ReadByIntKey(SHARE_ROGUELIKE_NODE_DETAILS, XTable.XTableRogueLikeNodeDetails, "Id")
TierSectionConfig = XTableManager.ReadByIntKey(CLIENT_ROGUELIKE_TIER_SECTION, XTable.XTableRogueLikeTierSectionDetails, "Id")
SpecialEventConfig = XTableManager.ReadByIntKey(CLIENT_ROGUELIKE_TIER_SPECIALEVENT, XTable.XTableRogueLikeSpecialEventDetails, "Id")
SupportStationConfig = XTableManager.ReadByIntKey(CLIENT_ROGUELIKE_SUPPORTSTATION, XTable.XTableRogueLikeSupportStationDetails, "Id")
SpecialEventGroupDetailsConfig = XTableManager.ReadByIntKey(CLIENT_ROGUELIKE_SPECIALEVENTGROUPDETAIL, XTable.XTableRogueLikeSpecialEventGroupDetails, "Id")
SpecialEventGroupItemConfig = XTableManager.ReadByIntKey(CLIENT_ROGUELIKE_SPECIALEVENTGROUPITEM, XTable.XTableRogueLikeSpecialEventGroupItem, "Id")
RogueLikePurgatoryScoreDesConfig = XTableManager.ReadByIntKey(CLIENT_ROGUELIKE_SCORE_DETAIL, XTable.XTableRogueLikePurgatoryScoreDesDetail, "Type")
XFubenRogueLikeConfig.InitGroup2TierMap()
end
function XFubenRogueLikeConfig.InitGroup2TierMap()
-- 按照groupId, tier存储节点
Group2TierMap = {}
for _, v in pairs(RogueLikeTier) do
if not Group2TierMap[v.Group] then
Group2TierMap[v.Group] = {}
end
if not Group2TierMap[v.Group][v.Tier] then
Group2TierMap[v.Group][v.Tier] = {}
end
Group2TierMap[v.Group][v.Tier] = {
Nodes = v.NodeId,
FatherNodes = v.FatherNode,
}
end
-- Section2GroupMap
for _, v in pairs(RogueLikeTierSection) do
for i = 1, #v.GroupId do
local groupId = v.GroupId[i]
if not Section2GroupMap[groupId] then
Section2GroupMap[groupId] = {}
end
Section2GroupMap[groupId] = {
GroupId = groupId,
MinTier = v.MinTier,
MaxTier = v.MaxTier,
}
end
end
end
function XFubenRogueLikeConfig.GetNodesByGroupId(groupId)
if not Group2NodeMap[groupId] then
Group2NodeMap[groupId] = {}
NodeIndexMap[groupId] = {}
local SectionData = Section2GroupMap[groupId]
if not SectionData then
--XLog.Error("SectoinData not exist :" .. tostring(groupId))
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetNodesByGroupId",
"SectionData", SHARE_ROGUELIKE_TIER_SECTION, "groupId", tostring(groupId))
end
local nodeIndex = 0
for i = SectionData.MinTier, SectionData.MaxTier do
local nodeDatas = Group2TierMap[groupId][i]
for j = 1, #nodeDatas.Nodes do
nodeIndex = nodeIndex + 1
Group2NodeMap[groupId][nodeIndex] = {}
Group2NodeMap[groupId][nodeIndex].Index = nodeIndex
Group2NodeMap[groupId][nodeIndex].Group = groupId
Group2NodeMap[groupId][nodeIndex].TierIndex = i
Group2NodeMap[groupId][nodeIndex].NodeId = nodeDatas.Nodes[j]
local fatherNodes = {}
if nodeDatas.FatherNodes[j] then
fatherNodes = string.Split(nodeDatas.FatherNodes[j], '|')
end
Group2NodeMap[groupId][nodeIndex].FatherNodes = {}
for fatherNodeIndex = 1, #fatherNodes do
Group2NodeMap[groupId][nodeIndex].FatherNodes[fatherNodeIndex] = tonumber(fatherNodes[fatherNodeIndex])
end
NodeIndexMap[groupId][nodeDatas.Nodes[j]] = nodeIndex
end
end
end
return Group2NodeMap[groupId], NodeIndexMap[groupId]
end
function XFubenRogueLikeConfig.GetGroup2TierMapDatas(groupId, tierIndex)
return Group2TierMap[groupId][tierIndex]
end
function XFubenRogueLikeConfig.GetNodesByGroup(group)
return Group2TierMap[group]
end
function XFubenRogueLikeConfig.GetRougueLikeTemplateById(id)
if not RogueLikeActivity[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetRougueLikeTemplateById",
"RogueLikeActivity", SHARE_ROGUELIKE_ACTIVITY, "Id", tostring(id))
return
end
return RogueLikeActivity[id]
end
function XFubenRogueLikeConfig.GetLastRogueLikeConfig()
local config = RogueLikeActivity[#RogueLikeActivity]
if not config then
XLog.Error("配置表RogueLikeActivity 没有配置数据")
return
end
return config
end
function XFubenRogueLikeConfig.GetRogueLikeConfigById(id)
if not ActivityConfig[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetRogueLikeConfigById",
"RogueLikeActivityDetails", CLIENT_ROGUELIKE_ACTIVITY, "Id", tostring(id))
return
end
return ActivityConfig[id]
end
function XFubenRogueLikeConfig.GetBoxTemplateById(id)
if not RogueLikeBox[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetBoxTemplateById", "RogueLikeBox", SHARE_ROGUELIKE_BOX, "Id", tostring(id))
return
end
return RogueLikeBox[id]
end
function XFubenRogueLikeConfig.GetBuffTemplateById(id)
if not RogueLikeBuff[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetBuffTemplateById", "RogueLikeBuff", SHARE_ROGUELIKE_BUFF, "Id", tostring(id))
return
end
return RogueLikeBuff[id]
end
function XFubenRogueLikeConfig.GetBuffConstItemIdById(id)
if not RogueLikeBuff[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetBuffTemplateById", "RogueLikeBuff", SHARE_ROGUELIKE_BUFF, "Id", tostring(id))
return
end
return RogueLikeBuff[id].CostItemId
end
function XFubenRogueLikeConfig.GetBuffConstItemCountById(id)
if not RogueLikeBuff[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetBuffTemplateById", "RogueLikeBuff", SHARE_ROGUELIKE_BUFF, "Id", tostring(id))
return
end
return RogueLikeBuff[id].CostItemCount
end
function XFubenRogueLikeConfig.IsBuffMaxLevel(id)
local buffTemplate = XFubenRogueLikeConfig.GetBuffTemplateById(id)
return buffTemplate.IntensifyId == nil or buffTemplate.IntensifyId == 0
end
function XFubenRogueLikeConfig.GetBuffConfigById(id)
if not BuffConfig[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetBuffConfigById", "RogueLikeBuffDetails", CLIENT_ROGUELIKE_Buff, "Id", tostring(id))
return
end
return BuffConfig[id]
end
function XFubenRogueLikeConfig.GetEventTemplateById(id)
if not RogueLikeEvent[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetEventTemplateById", "RogueLikeEvent", SHARE_ROGUELIKE_EVENT, "Id", tostring(id))
return
end
return RogueLikeEvent[id]
end
function XFubenRogueLikeConfig.GetNodeTemplateById(id)
if not RogueLikeNode[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetNodeTemplateById", "RogueLikeNode", SHARE_ROGUELIKE_NODE, "Id", tostring(id))
return
end
return RogueLikeNode[id]
end
function XFubenRogueLikeConfig.GetAllNodes()
return RogueLikeNode
end
function XFubenRogueLikeConfig.GetNodeConfigteById(id)
if not NodeConfig[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetNodeConfigteById", "RogueLikeNodeDetails", SHARE_ROGUELIKE_NODE_DETAILS, "Id", tostring(id))
return
end
return NodeConfig[id]
end
function XFubenRogueLikeConfig.GetRobotTemplateById(id)
if not RogueLikeRobot[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetRobotTemplateById", "RogueLikeRobot", SHARE_ROGUELIKE_ROBOT, "Id", tostring(id))
return
end
return RogueLikeRobot[id]
end
function XFubenRogueLikeConfig.GetShopTemplateById(id)
if not RogueLikeShop[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetShopTemplateById", "RogueLikeShop", SHARE_ROGUELIKE_SHOP, "Id", tostring(id))
return
end
return RogueLikeShop[id]
end
function XFubenRogueLikeConfig.GetShopItemTemplateById(id)
if not RogueLikeShopItem[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetShopItemTemplateById",
"RogueLikeShopItem", SHARE_ROGUELIKE_SHOPITEM, "Id", tostring(id))
return
end
return RogueLikeShopItem[id]
end
function XFubenRogueLikeConfig.GetTierTemplateById(id)
if not RogueLikeTier[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetTierTemplateById", "RogueLikeTier", SHARE_ROGUELIKE_TIER, "Id", tostring(id))
return
end
return RogueLikeTier[id]
end
function XFubenRogueLikeConfig.GetTierSectionTemplateById(id)
if not RogueLikeTierSection[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetTierSectionTemplateById",
"RogueLikeTierSection", SHARE_ROGUELIKE_TIER_SECTION, "Id", tostring(id))
return
end
return RogueLikeTierSection[id]
end
function XFubenRogueLikeConfig.GetTierSectionTierTypeById(id)
return RogueLikeTierSection[id] and RogueLikeTierSection[id].TierType
end
function XFubenRogueLikeConfig.GetTierSectionConfigById(id)
if not TierSectionConfig[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetTierSectionConfigById",
"TierSectionDetails", CLIENT_ROGUELIKE_TIER_SECTION, "Id", tostring(id))
return
end
return TierSectionConfig[id]
end
function XFubenRogueLikeConfig.GetRecoverTemplateById(id)
if not RogueLikeRecover[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetRecoverTemplateById", "RogueLikeRecover", SHARE_ROGUELIKE_RECOVER, "Id", tostring(id))
return
end
return RogueLikeRecover[id]
end
function XFubenRogueLikeConfig.GetRecoverHpPercentById(id)
if not RogueLikeRecover[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetRecoverTemplateById", "RogueLikeRecover", SHARE_ROGUELIKE_RECOVER, "Id", tostring(id))
return
end
return RogueLikeRecover[id].HpPercent
end
-- 获取恢复血量所需支援配额
function XFubenRogueLikeConfig.GetRecoverCostSupportPointById(id)
if not RogueLikeRecover[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetRecoverTemplateById", "RogueLikeRecover", SHARE_ROGUELIKE_RECOVER, "Id", tostring(id))
return
end
return RogueLikeRecover[id].CostSupportPoint
end
function XFubenRogueLikeConfig.GetSpecialEventTemplateById(id)
if not RogueLikeSpecialEvent[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetSpecialEventTemplateById",
"RogueLikeSpecialEvent", SHARE_ROGUELIKE_SPECIALEVENT, "Id", tostring(id))
return
end
return RogueLikeSpecialEvent[id]
end
function XFubenRogueLikeConfig.GetSpecialEventConfigById(id)
if not SpecialEventConfig[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetSpecialEventConfigById",
"RogueLikeSpecialEventDetails", CLIENT_ROGUELIKE_TIER_SPECIALEVENT, "Id", tostring(id))
return
end
return SpecialEventConfig[id]
end
function XFubenRogueLikeConfig.GetTeamEffectTemplateById(id)
if not RogueLikeTeamEffect[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetTeamEffectTemplateById",
"RogueLikeTeamEffect", SHARE_ROGUELIKE_TEAMEFFECT, "Id", tostring(id))
return
end
return RogueLikeTeamEffect[id]
end
function XFubenRogueLikeConfig.RogueLikeIsCheckLines()
return XFubenRogueLikeConfig.CHECK_LINES == 1
end
function XFubenRogueLikeConfig.GetAllSupports()
return RogueLikeSupportStation
end
function XFubenRogueLikeConfig.GetSupportStationTemplateById(id)
if not RogueLikeSupportStation[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetSupportStationTemplateById",
"RogueLikeSupportStation", SHARE_ROGUELIKE_SUPPORTSTATION, "Id", tostring(id))
return
end
return RogueLikeSupportStation[id]
end
function XFubenRogueLikeConfig.GetSupportStationConfigById(id)
if not SupportStationConfig[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetSupportStationConfigById",
"SupportStationDetails", CLIENT_ROGUELIKE_SUPPORTSTATION, "Id", tostring(id))
return
end
return SupportStationConfig[id]
end
function XFubenRogueLikeConfig.GetSepcialEventGroupTemplateById(id)
if not RogueLikeSpecialEventGroup[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetSepcialEventGroupTemplateById",
"RogueLikeSpecialEventGroup", SHARE_ROGUELIKE_SPECIALEVENTGROUP, "Id", tostring(id))
return
end
return RogueLikeSpecialEventGroup[id]
end
function XFubenRogueLikeConfig.GetSpecialEventGroupConfigById(id)
if not SpecialEventGroupDetailsConfig[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetSpecialEventGroupConfigById",
"RogueLikeSpecialEventGroupDetails", CLIENT_ROGUELIKE_SPECIALEVENTGROUPDETAIL, "Id", tostring(id))
return
end
return SpecialEventGroupDetailsConfig[id]
end
function XFubenRogueLikeConfig.GetSpecialEventGroupItemConfigById(id)
if not SpecialEventGroupItemConfig[id] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetSpecialEventGroupItemConfigById",
"RogueLikeSpecialEventGroupItem", CLIENT_ROGUELIKE_SPECIALEVENTGROUPITEM, "Id", tostring(id))
return
end
return SpecialEventGroupItemConfig[id]
end
-- 特殊事件组条件
function XFubenRogueLikeConfig.IsSpecialGroupType(specialEventType)
return specialEventType == XFubenRogueLikeConfig.XRLOtherEventType.ReduceHp or
specialEventType == XFubenRogueLikeConfig.XRLOtherEventType.GainItemRate or
specialEventType == XFubenRogueLikeConfig.XRLOtherEventType.ConsumeItemRate
end
-- 选择不需要发通知的类型
function XFubenRogueLikeConfig.IsRequestBeforeSelectType(normalType)
return normalType == XFubenRogueLikeConfig.XRLNodeType.Fight or
normalType == XFubenRogueLikeConfig.XRLNodeType.Box
end
function XFubenRogueLikeConfig.NoNeedCheckActionPointType(normalType)
return false -- normalType == XFubenRogueLikeConfig.XRLNodeType.Rest
end
function XFubenRogueLikeConfig.GetRogueLikePurgatoryScoreDescConfigByType(nodeType)
if not RogueLikePurgatoryScoreDesConfig[nodeType] then
XLog.ErrorTableDataNotFound("XFubenRogueLikeConfig.GetRogueLikePurgatoryScoreDescConfigByType",
"RogueLikePurgatoryScoreDesConfig", CLIENT_ROGUELIKE_SCORE_DETAIL, "Type", tostring(nodeType))
return
end
return RogueLikePurgatoryScoreDesConfig[nodeType]
end
function XFubenRogueLikeConfig.GetRogueLikePurgatoryScoreTitleByType(nodeType)
local conifg = XFubenRogueLikeConfig.GetRogueLikePurgatoryScoreDescConfigByType(nodeType)
return conifg and conifg.Title
end
function XFubenRogueLikeConfig.GetRogueLikePurgatoryScoreDescriptionByType(nodeType)
local conifg = XFubenRogueLikeConfig.GetRogueLikePurgatoryScoreDescConfigByType(nodeType)
return conifg and conifg.Description
end

View file

@ -0,0 +1,112 @@
XFubenSimulatedCombatConfig = XFubenSimulatedCombatConfig or {}
local TABLE_SIMUCOMBAT_ACTIVITY = "Share/Fuben/SimulatedCombat/SimulatedCombatActivity.tab"
local TABLE_SIMUCOMBAT_ADDITION = "Share/Fuben/SimulatedCombat/SimulatedCombatAddition.tab"
local TABLE_SIMUCOMBAT_CHALLENGE = "Share/Fuben/SimulatedCombat/SimulatedCombatChallenge.tab"
local TABLE_SIMUCOMBAT_MEMBER = "Share/Fuben/SimulatedCombat/SimulatedCombatMember.tab"
local TABLE_SIMUCOMBAT_POINT_REWARD = "Share/Fuben/SimulatedCombat/SimulatedCombatPointReward.tab"
local TABLE_SIMUCOMBAT_STAGE = "Share/Fuben/SimulatedCombat/SimulatedCombatStage.tab"
local TABLE_SIMUCOMBAT_STAR_REWARD = "Share/Fuben/SimulatedCombat/SimulatedCombatStarReward.tab"
local SimuCombatActivity = {}
local SimuCombatAddition = {}
local SimuCombatChallenge = {}
local SimuCombatMember = {}
local SimuCombatPointReward = {}
local SimuCombatStage = {}
local SimuCombatStarReward = {}
local SimuCombatStageIdToInterId = {}
local SimuCombatStageGroup = {}
XFubenSimulatedCombatConfig.Color = {
NORMAL = XUiHelper.Hexcolor2Color("0F70BC"),
INSUFFICIENT = XUiHelper.Hexcolor2Color("C62310"),
}
XFubenSimulatedCombatConfig.StageType = {
Normal = 1, --普通
Challenge = 2, --挑战模式
}
XFubenSimulatedCombatConfig.ResType = {
Member = 1,
Addition = 2,
}
XFubenSimulatedCombatConfig.TeamTemplate = {
["CaptainPos"] = 1,
["FirstFightPos"] = 1,
["TeamData"] = {},
}
function XFubenSimulatedCombatConfig.Init()
SimuCombatActivity = XTableManager.ReadByIntKey(TABLE_SIMUCOMBAT_ACTIVITY, XTable.XTableSimulatedCombatActivity, "Id")
SimuCombatAddition = XTableManager.ReadByIntKey(TABLE_SIMUCOMBAT_ADDITION, XTable.XTableSimulatedCombatAddition, "Id")
SimuCombatChallenge = XTableManager.ReadByIntKey(TABLE_SIMUCOMBAT_CHALLENGE, XTable.XTableSimulatedCombatChallenge, "Id")
SimuCombatMember = XTableManager.ReadByIntKey(TABLE_SIMUCOMBAT_MEMBER, XTable.XTableSimulatedCombatMember, "Id")
SimuCombatPointReward = XTableManager.ReadByIntKey(TABLE_SIMUCOMBAT_POINT_REWARD, XTable.XTableSimulatedCombatPointReward, "Id")
SimuCombatStage = XTableManager.ReadByIntKey(TABLE_SIMUCOMBAT_STAGE, XTable.XTableSimulatedCombatStage, "Id")
SimuCombatStarReward = XTableManager.ReadByIntKey(TABLE_SIMUCOMBAT_STAR_REWARD, XTable.XTableSimulatedCombatStarReward, "Id")
for _, v in pairs(SimuCombatStage) do
SimuCombatStageIdToInterId[v.StageId] = v
if not SimuCombatStageGroup[v.Type] then
SimuCombatStageGroup[v.Type] = {}
end
table.insert(SimuCombatStageGroup[v.Type], v)
end
for _, grp in pairs(SimuCombatStageGroup) do
table.sort(grp, function (a,b)
return a.Id < b.Id
end)
end
XFubenSimulatedCombatConfig.TeamTemplate = XReadOnlyTable.Create(XFubenSimulatedCombatConfig.TeamTemplate)
end
function XFubenSimulatedCombatConfig.GetStageInterData(Id)
local template = SimuCombatStage[Id]
if not template then
XLog.ErrorTableDataNotFound("XFubenSimulatedCombatConfig.GetDataById", "SimulatedCombatActivity", SHARE_NEWCHAR_TEACH, "Id", tostring(id))
return
end
return template
end
function XFubenSimulatedCombatConfig.GetStageInterDataByType(type)
return SimuCombatStageGroup[type]
end
function XFubenSimulatedCombatConfig.GetActTemplates()
return SimuCombatActivity
end
function XFubenSimulatedCombatConfig.GetActivityTemplateById(Id)
return SimuCombatActivity[Id]
end
function XFubenSimulatedCombatConfig.GetMemberById(Id)
return SimuCombatMember[Id]
end
function XFubenSimulatedCombatConfig.GetAdditionById(Id)
return SimuCombatAddition[Id]
end
function XFubenSimulatedCombatConfig.GetChallengeById(Id)
return SimuCombatChallenge[Id]
end
function XFubenSimulatedCombatConfig.GetPointReward(Id)
return SimuCombatPointReward
end
function XFubenSimulatedCombatConfig.GetPointRewardById(Id)
return SimuCombatPointReward[Id]
end
function XFubenSimulatedCombatConfig.GetStarReward(Id)
return SimuCombatStarReward
end
function XFubenSimulatedCombatConfig.GetStarRewardById(Id)
return SimuCombatStarReward[Id]
end

Some files were not shown because too many files have changed in this diff Show more