Files
GaCy-GO/tools/damage_phase_core_refs.lua

25 lines
1.3 KiB
Lua

do
local s=_G.__gacDamagePhaseRefs1 or {phase=1,index=0};_G.__gacDamagePhaseRefs1=s
if s.phase<=3 then
local function log(v)CS.UnityEngine.Debug.Log('[GAC_DAMAGE_PHASE_REF] '..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
if s.phase==1 then
local ps=phase:GetType():GetProperties(flags)
for i=s.index,math.min(s.index+15,ps.Length-1)do log('PROPERTY '..ps[i].Name..' '..tostring(ps[i].PropertyType))end
s.index=s.index+16;if s.index>=ps.Length then s.phase=2;s.index=0 end
else
local name=s.phase==2 and '_InputSourceCollection'or 'mcontext'
local obj=phase:GetType():GetField(name,flags):GetValue(phase)
local fs=obj:GetType():GetFields(flags);log('TYPE '..name..' '..tostring(obj:GetType()))
for i=s.index,math.min(s.index+15,fs.Length-1)do log('FIELD '..name..' '..fs[i].Name..' '..tostring(fs[i].FieldType))end
s.index=s.index+16;if s.index>=fs.Length then s.phase=s.phase+1;s.index=0 end
end
end)
if not ok then log('ERROR '..tostring(err));s.phase=4 end
end
end