Files
GaCy-GO/tools/cw_reward_pool_current_metadata.lua
T
2026-10-28 18:54:43 +07:00

31 lines
1.8 KiB
Lua

-- Exact reward row names recorded by the earlier reward capture tool. Probe
-- their presence in the current target rather than accepting reference RVAs.
do local function capture()
local s=_G.__gacCwRewardPoolCurrent1 or {target=1,index=0,stage='fields'};_G.__gacCwRewardPoolCurrent1=s
if s.done then return end
local flags=CS.System.Enum.ToObject(typeof(CS.System.Reflection.BindingFlags),60)
local gm=CS.RPG.Client.GlobalVars.s_GamePhaseManager
local phase=gm and typeof(CS.RPG.Client.GamePhaseManager):GetField('_CurrentPhase',flags):GetValue(gm)
if not phase or typeof(CS.RPG.Client.BattleGamePhase):IsInstanceOfType(phase)then return end
local names={'GridFightBasicBonusPoolConfigRow','GridFightBonusPoolConfigRow','GridFightBonusPoolV2Row','GridFightBasicBonusPoolV2Row'}
local log=function(v)CS.UnityEngine.Debug.Log('[GAC_CW_REWARD_POOL_CURRENT] '..tostring(v))end
if s.target>#names then s.done=true;log('END');return end
if not s.members then
local asm=typeof(CS.RPG.GameCore.GridFightRoleConfigRow).Assembly
s.t=asm:GetType('RPG.GameCore.'..names[s.target])
if not s.t then log('MISSING '..names[s.target]);s.target=s.target+1;return end
s.members=s.t:GetFields(flags);s.index=0;s.stage='fields';log('TYPE '..s.t.FullName)
end
for n=1,8 do
if s.index>=s.members.Length then
if s.stage=='fields'then
local method=s.t:GetMethod('FromBinary',flags)
if method then log('BINARY '..s.t.FullName..' HANDLE '..tostring(method.MethodHandle.Value))end
end
s.target=s.target+1;s.members=nil;s.t=nil;return
end
local member=s.members[s.index];s.index=s.index+1
if member.DeclaringType==s.t then log('FIELD '..member.Name..' '..member.FieldType.FullName)end
end
end local ok,e=pcall(capture);if not ok then _G.__gacCwRewardPoolCurrent1={done=true};CS.UnityEngine.Debug.Log('[GAC_CW_REWARD_POOL_CURRENT] ERROR '..tostring(e))end end