Files
GaCy-GO/tools/cw_equipment_export.lua

32 lines
2.0 KiB
Lua

-- Four initialized handbook entries per heartbeat. Never runs in Battle.
do
local s=_G.__gacCwEquipmentExport1 or {index=0};_G.__gacCwEquipmentExport1=s
if s.done then return end
local log=function(v)CS.UnityEngine.Debug.Log('[GAC_CW_EQUIPMENT] '..tostring(v))end
local ok,err=pcall(function()
local flags=CS.System.Enum.ToObject(typeof(CS.System.Reflection.BindingFlags),60)
local manager=CS.RPG.Client.GlobalVars.s_GamePhaseManager
local phase=manager and typeof(CS.RPG.Client.GamePhaseManager):GetField('_CurrentPhase',flags):GetValue(manager)
if not phase or typeof(CS.RPG.Client.BattleGamePhase):IsInstanceOfType(phase)then return end
if not s.rows then
s.rows=CS.RPG.Client.GlobalVars.s_ModuleManager.GridFightModule:GetHandBookAllEquipItemData()
if not s.rows or s.rows.Count>1024 then error('handbook bound exceeded')end
log('BEGIN '..s.rows.Count)
end
local json=function(v)return tostring(CS.Newtonsoft.Json.JsonConvert.SerializeObject(v))end
for batch=1,4 do
if s.index>=s.rows.Count then s.done=true;log('END');return end
local wrapper=s.rows[s.index];s.index=s.index+1
if wrapper.IsEquipment then
local c=wrapper.EquipConfig
local text='{"ItemID":'..c.ItemID..',"BaseItemID":'..c.BaseItemID..',"NeedEquipSlot":'..tostring(c.NeedEquipSlot)..',"EquipType":'..CS.System.Convert.ToUInt32(c.EquipType)..',"EquipCategory":'..CS.System.Convert.ToUInt32(c.EquipCategory)..',"EquipFunc":'..CS.System.Convert.ToUInt32(c.EquipFunc)..',"DressRule":'..CS.System.Convert.ToUInt32(c.DressRule)..',"AbilityName":'..json(c.AbilityName)..',"GeneralPropertyList":'..json(c.GeneralPropertyList)..',"AbilityParamList":'..json(c.AbilityParamList)..',"EquipFuncParamList":'..json(c.EquipFuncParamList)..',"DressRuleParamList":'..json(c.DressRuleParamList)..'}'
if #text>32768 then error('equipment row exceeds bound')end
log('ROW '..text)
else
log('OTHER '..s.index..' '..wrapper.ItemConfig:GetType().FullName)
end
end
end)
if not ok then log('ERROR '..tostring(err));s.done=true end
end