Files
GaCy-GO/tools/damage_game_context_probe.lua

24 lines
1.2 KiB
Lua

do
local s=_G.__gacDamageGameContext1 or {index=0};_G.__gacDamageGameContext1=s
if not s.done then
local function log(v)CS.UnityEngine.Debug.Log('[GAC_DAMAGE_GAME_CONTEXT] '..tostring(v))end
local ok,err=pcall(function()
local flags=CS.System.Enum.ToObject(typeof(CS.System.Reflection.BindingFlags),60)
local pm=CS.RPG.Client.GlobalVars.s_GamePhaseManager
local phase=typeof(CS.RPG.Client.GamePhaseManager):GetField('_CurrentPhase',flags):GetValue(pm)
if not typeof(CS.RPG.Client.BattleGamePhase):IsInstanceOfType(phase)then return end
local context=phase.GameContext;local fs=context:GetType():GetFields(flags)
for i=s.index,math.min(s.index+15,fs.Length-1)do log('FIELD '..fs[i].Name..' '..tostring(fs[i].FieldType))end
s.index=s.index+16;if s.index>=fs.Length then
local instance=phase.BattleInstanceRef
local world=instance:GetType():GetField('_GameWorld',flags):GetValue(instance)
local modules=world:GetType():GetField('_Modules',flags):GetValue(world)
log('MODULES '..tostring(modules))
if modules then for i=0,math.min(modules.Count-1,15)do log('MODULE '..i..' '..tostring(modules[i]:GetType()))end end
s.done=true;log('END')
end
end)
if not ok then s.done=true;log('ERROR '..tostring(err))end
end
end