<?xml version='1.0' encoding='utf-8'?>
<CheatTable CheatEngineTableVersion="45">
  <CheatEntries>
    <CheatEntry>
      <ID>1</ID>
      <Description>"[ATTACH / ALL OFF] Attach and restore"</Description>
      <Color>00A5FF</Color>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>
{ Game    : TornekosMysteryDungeon-Win64-Shipping.exe
  Author  : Black_wolf
  CheatVer:1.2.0-001-016

  Memo: ゲームバージョンは 1.2.0
        ゲームエンジンは Unreal Engine 5.7.0（++Anya+steam_release_v100）
        Steam BuildID: 25827359（AppID: 4027450）
        EXE FileVersion / ProductVersion: 1.0.0.0
        PE Timestamp: 0x411E761F（SizeOfImage: 0x0BA4E000）
}

[ENABLE]
{$lua}
if syntaxcheck then return end
GT.oneShot(memrec, function() GT.attachAndRestore(memrec) end)
{$asm}
[DISABLE]
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>2</ID>
      <Description>"0. Settings"</Description>
      <Options moManualExpandCollapse="1" />
      <Color>FFFF00</Color>
      <GroupHeader>1</GroupHeader>
      <CheatEntries>
        <CheatEntry>
          <ID>3</ID>
          <Description>"Language / 言語設定"</Description>
          <Options moManualExpandCollapse="1" />
          <Color>FFFF00</Color>
          <GroupHeader>1</GroupHeader>
          <CheatEntries>
            <CheatEntry>
              <ID>4</ID>
              <Description>"English (default)"</Description>
              <Color>00A5FF</Color>
              <VariableType>Auto Assembler Script</VariableType>
              <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TCT.oneShot(memrec, function() TCT.setLang('en') end)
{$asm}
[DISABLE]
</AssemblerScript>
            </CheatEntry>
            <CheatEntry>
              <ID>5</ID>
              <Description>"日本語 / Japanese"</Description>
              <Color>00A5FF</Color>
              <VariableType>Auto Assembler Script</VariableType>
              <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TCT.oneShot(memrec, function() TCT.setLang('ja') end)
{$asm}
[DISABLE]
</AssemblerScript>
            </CheatEntry>
          </CheatEntries>
        </CheatEntry>
        </CheatEntries>
    </CheatEntry>
    <CheatEntry>
      <ID>100</ID>
      <Description>"01. Gameplay"</Description>
      <Options moManualExpandCollapse="1" />
      <Color>FFFF00</Color>
      <GroupHeader>1</GroupHeader>
      <CheatEntries>
        <CheatEntry>
          <ID>101</ID>
          <Description>"HP never decreases"</Description>
          <Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.toggleRecord(memrec,'hp',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TCT then GT.toggleRecord(memrec,'hp',false) end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>102</ID>
          <Description>"Fullness never decreases"</Description>
          <Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.toggleRecord(memrec,'food',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TCT then GT.toggleRecord(memrec,'food',false) end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>103</ID>
          <Description>"Strength never decreases"</Description>
          <Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.toggleRecord(memrec,'strength',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TCT then GT.toggleRecord(memrec,'strength',false) end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>104</ID>
          <Description>"Prevent poison and status ailments"</Description>
          <Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.toggleRecord(memrec,'status',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TCT then GT.toggleRecord(memrec,'status',false) end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>105</ID>
          <Description>"Avoid traps"</Description>
          <Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.toggleRecord(memrec,'trap',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TCT then GT.toggleRecord(memrec,'trap',false) end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>106</ID>
          <Description>"Disable enemy attacks and special attacks"</Description>
          <Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.toggleRecord(memrec,'attack',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TCT then GT.toggleRecord(memrec,'attack',false) end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>107</ID>
          <Description>"Full HP after one step / turn"</Description>
          <Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.toggleRecord(memrec,'heal',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TCT then GT.toggleRecord(memrec,'heal',false) end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>108</ID>
          <Description>"Shield never rusts"</Description>
          <Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.toggleRecord(memrec,'rust',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TCT then GT.toggleRecord(memrec,'rust',false) end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>109</ID>
          <Description>"Always Seed of Agility (speed-up never wears off)"</Description>
          <Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.toggleRecord(memrec,'speed',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TCT then GT.toggleRecord(memrec,'speed',false) end
{$asm}
</AssemblerScript>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
    <CheatEntry><ID>200</ID><Description>"02. Player"</Description><Options moManualExpandCollapse="1" /><Color>FFFF00</Color><GroupHeader>1</GroupHeader><CheatEntries><CheatEntry><ID>210</ID><Description>"Player editor"</Description><Options moManualExpandCollapse="1" /><Color>00A5FF</Color><VariableType>Auto Assembler Script</VariableType><AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.openEditor(memrec,'player')
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if GT then GT.closeEditor(memrec) end
{$asm}
</AssemblerScript></CheatEntry></CheatEntries></CheatEntry><CheatEntry>
      <ID>300</ID>
      <Description>"03. Items"</Description>
      <Options moManualExpandCollapse="1" />
      <Color>FFFF00</Color>
      <GroupHeader>1</GroupHeader>
      <CheatEntries>
        <CheatEntry>
          <ID>301</ID>
          <Description>"Identify all carried items now"</Description>
          <Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.oneShot(memrec,function() GT.action('identify') end)
{$asm}
[DISABLE]
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>302</ID>
          <Description>"Oomph scroll: enhancement x99"</Description>
          <Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.toggleRecord(memrec,'baikiruto',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TCT then GT.toggleRecord(memrec,'baikiruto',false) end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>303</ID>
          <Description>"Buff scroll: enhancement x99"</Description>
          <Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.toggleRecord(memrec,'sukara',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TCT then GT.toggleRecord(memrec,'sukara',false) end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>304</ID>
          <Description>"Plate equipped shield now"</Description>
          <Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.oneShot(memrec,function() GT.action('plate') end)
{$asm}
[DISABLE]
</AssemblerScript>
        </CheatEntry>
      <CheatEntry>
          <ID>305</ID>
          <Description>"Items are not consumed"</Description>
          <Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.toggleRecord(memrec,'consume',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TCT then GT.toggleRecord(memrec,'consume',false) end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>306</ID>
          <Description>"Edit item count / equipment bonus"</Description>
          <Options moManualExpandCollapse="1" /><Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.openEditor(memrec,'inventory')
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if GT then GT.closeEditor(memrec) end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry><ID>307</ID><Description>"Add items by category and quantity"</Description><Options moManualExpandCollapse="1" /><Color>00A5FF</Color><VariableType>Auto Assembler Script</VariableType><AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.openEditor(memrec,'add_items')
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if GT then GT.closeEditor(memrec) end
{$asm}
</AssemblerScript></CheatEntry><CheatEntry><ID>308</ID><Description>"Remove curses (Shanaq)"</Description><Color>00A5FF</Color><VariableType>Auto Assembler Script</VariableType><AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.oneShot(memrec,function() GT.action('uncurse') end)
{$asm}
[DISABLE]
</AssemblerScript></CheatEntry></CheatEntries>
    </CheatEntry>
    <CheatEntry>
      <ID>400</ID>
      <Description>"04. Dungeon"</Description>
      <Options moManualExpandCollapse="1" />
      <Color>FFFF00</Color>
      <GroupHeader>1</GroupHeader>
      <CheatEntries>
        <CheatEntry><ID>401</ID><Description>"Current floor turns"</Description><Options moManualExpandCollapse="1" /><Color>00A5FF</Color><VariableType>Auto Assembler Script</VariableType><AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.openEditor(memrec,401)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if GT then GT.closeEditor(memrec) end
{$asm}
</AssemblerScript></CheatEntry><CheatEntry><ID>402</ID><Description>"Total turns"</Description><Options moManualExpandCollapse="1" /><Color>00A5FF</Color><VariableType>Auto Assembler Script</VariableType><AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.openEditor(memrec,402)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if GT then GT.closeEditor(memrec) end
{$asm}
</AssemblerScript></CheatEntry><CheatEntry><ID>403</ID><Description>"Current floor"</Description><Options moManualExpandCollapse="1" /><Color>00A5FF</Color><VariableType>Auto Assembler Script</VariableType><AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.openEditor(memrec,403)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if GT then GT.closeEditor(memrec) end
{$asm}
</AssemblerScript></CheatEntry><CheatEntry>
          <ID>404</ID>
          <Description>"Current dungeon / change by name..."</Description>
          <Options moManualExpandCollapse="1" /><Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.openEditor(memrec,'dungeon')
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if GT then GT.closeEditor(memrec) end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>405</ID>
          <Description>"Reveal dungeon map (Map-Reveal scroll)"</Description>
          <Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.toggleRecord(memrec,'map',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TCT then GT.toggleRecord(memrec,'map',false) end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>406</ID>
          <Description>"Reveal item positions (Item-Reveal scroll)"</Description>
          <Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.toggleRecord(memrec,'items',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TCT then GT.toggleRecord(memrec,'items',false) end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>407</ID>
          <Description>"Reveal enemy positions (Enemy-Reveal scroll)"</Description>
          <Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.toggleRecord(memrec,'enemies',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TCT then GT.toggleRecord(memrec,'enemies',false) end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>408</ID>
          <Description>"Forced Evac"</Description>
          <Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
GT.oneShot(memrec,function() GT.action('evac') end)
{$asm}
[DISABLE]
</AssemblerScript>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
      <CheatEntry>
      <ID>500</ID>
      <Description>"05. Other"</Description>
      <Options moManualExpandCollapse="1" />
      <Color>FFFF00</Color>
      <GroupHeader>1</GroupHeader>
      <CheatEntries>
        <CheatEntry>
          <ID>501</ID>
          <Description>"Unlock all Steam achievements"</Description>
          <Color>00A5FF</Color>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TCT.oneShot(memrec, function()
  local ok,e=pcall(TCT.unlockSteamAchievements)
  if not ok then print('[TornekoCT] '..tostring(e)) end
end)
{$asm}
[DISABLE]
</AssemblerScript>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
</CheatEntries>
  <UserdefinedSymbols />
  <LuaScript>-- 2026-11-15: Cheat EngineのLuaのみで動作します。
--[[ =====================================================================================
  Cheat Engine table based on GameTemplate V01  (namespace: TCT)
  Target : Cheat Engine 7.7 (64-bit)
  Layout : [ATTACH / ALL OFF]  -&gt;  0. Settings  -&gt;  1..N game categories
  Colors : expandable group = 0xFFFF00 (cyan, BGR) / script = 0x00A5FF (orange, BGR) / value row = none
  IDs    : 1 = ATTACH, 2 = "0." top group, 3..99 = inside "0.", category N uses N*100 .. N*100+99
  How to adapt to a new game: edit only the blocks marked  [GAME]  (search for "[GAME]").
  Rename the namespace TCT -&gt; e.g. HV / DQM4 by a whole-word replace of "TCT" and "gt" symbol prefix if wanted.
===================================================================================== ]]
if GT and GT.shutdown then
  local ok,err=pcall(GT.shutdown)
  if not ok then print('[GT] '..tostring(err));return end
elseif TCT and TCT.B and TCT.B.connected then
  local ok,err=pcall(TCT.B.stop)
  if not ok then print('[GT] '..tostring(err));return end
end
if TCT and TCT.timer then TCT.timer.destroy() end
GT={}
TCT=GT
local TCT=GT
TCT.VERSION='V01'
TCT.epoch=0
TCT.deferred={}
----------------------------------------------------------------- [GAME] basic settings
TCT.EXE      = 'TornekosMysteryDungeon-Win64-Shipping.exe'
TCT.MODULE   = 'TornekosMysteryDungeon-Win64-Shipping.exe'
TCT.BUILD    = {ts=0x411E761F, size=0xBA4E000}   -- measured from the installed Ver.1.2.0 executable (SHA-256 5ebae473...3fbaf0)
TCT.TICK_MS  = 500
TCT.lang     = 'en'

TCT.ID_TOP0 = 2
TCT.B = TCT.B or {connected=false,busy=false,values={}}
local function bridgeToggle(key)
  return { on=function() TCT.B.toggle(key,true) end, off=function() TCT.B.toggle(key,false) end }
end
TCT.F = {
  hp        = bridgeToggle('hp'),
  food      = bridgeToggle('food'),
  strength  = bridgeToggle('strength'),
  status    = bridgeToggle('status'),
  trap      = bridgeToggle('trap'),
  attack    = bridgeToggle('attack'),
  heal      = bridgeToggle('heal'),
  rust      = bridgeToggle('rust'),
  speed     = bridgeToggle('speed'),
  consume   = bridgeToggle('consume'),
  baikiruto = bridgeToggle('baikiruto'),
  sukara    = bridgeToggle('sukara'),
  map       = bridgeToggle('map'),
  items     = bridgeToggle('items'),
  enemies   = bridgeToggle('enemies'),
}


TCT.suffix=TCT.suffix or {}
function TCT.T(en,ja) if TCT.lang=='ja' then return ja or en end return en end
function TCT.err(en,ja) error(TCT.T(en,ja),0) end
function TCT.mod() return getAddressSafe(TCT.MODULE) end

local function logError(err)
  local message=tostring(err)
  local clean=message:match('^%[string ".-"%]:%d+:%s*(.*)$') or message
  local now=getTickCount()
  if TCT.lastLogError==clean and now-TCT.lastLogTick&lt;700 then return end
  TCT.lastLogError,TCT.lastLogTick=clean,now
  print('[TCT] '..clean)
end
local function disposeDeferred(timer)
  timer.Enabled=false
  timer.destroy()
end
function TCT.cancelDeferred()
  local pending=TCT.deferred
  TCT.deferred={}
  for timer in pairs(pending) do disposeDeferred(timer) end
end
function TCT.defer(fn)
  local epoch,pending=TCT.epoch,TCT.deferred
  local timer=createTimer(nil,false)
  pending[timer]=true
  timer.Interval=1
  timer.OnTimer=function()
    if not pending[timer] then return end
    pending[timer]=nil
    disposeDeferred(timer)
    if TCT.deferred~=pending or TCT.epoch~=epoch then return end
    local ok,err=pcall(fn)
    if not ok then logError(err) end
  end
  timer.Enabled=true
end
function TCT.oneShot(row,fn)
  local id=row and row.ID
  TCT.defer(function()
    local ok,err=pcall(fn)
    local current=id and getAddressList().getMemoryRecordByID(id)
    if current then current.Active=false end
    if not ok then error(err,0) end
  end)
end

function TCT.forgetProcess()
  TCT.epoch=TCT.epoch+1
end

function TCT.checkBuild()
  local module=TCT.mod()
  local pe=module and readInteger(module+0x3c)
  return pe and readInteger(module+pe+8)==TCT.BUILD.ts
     and getModuleSize(TCT.MODULE)==TCT.BUILD.size
end

function TCT.require()
  local pid=getProcessIDFromProcessName(TCT.EXE)
  if not pid or pid==0 then TCT.err('Start the game first.','先にゲームを起動してください。') end
  local b=TCT.B
  if b.connected and b.pid~=pid then
    b.stop()
  end
  if getOpenedProcessID()~=pid then openProcess(pid) end
  if getOpenedProcessID()~=pid or not TCT.mod() then
    TCT.err('Cannot attach to the game.','ゲームにアタッチできません。')
  end
  if not TCT.timer then
    TCT.timer=createTimer(nil,false)
    TCT.timer.Interval=TCT.TICK_MS
    TCT.timer.OnTimer=function()
      local live=getProcessIDFromProcessName(TCT.EXE)
      if b.connected and live~=b.pid then
        local ok,err=pcall(b.stop)
        if not ok then b.lastError=tostring(err) end
        TCT.forgetProcess()
      elseif b.connected and getOpenedProcessID()==b.pid then b.heartbeat() end
    end
    TCT.timer.Enabled=true
  end
end

function TCT.feature(key,on)
  local f=assert(TCT.F[key],'Unknown feature: '..key)
  if on then
    TCT.require()
    f.on()
  else
    if TCT.B.connected and not TCT.B.closing then TCT.require();f.off() end
  end
end

function TCT.attachAndRestore(row)
  TCT.require()
  TCT.disableAll(row)
  print('[TCT] '..TCT.T('Game attached. All features of this table are OFF.', 'ゲームにアタッチしました。このCTの機能を一括解除しました。'))
end
function TCT.toggleRecord(row,key,on)
  if TCT.B.closing then return end
  TCT.feature(key,on)
  print('[TCT] '..row.Description..(on and ' : ON' or ' : OFF'))
end
function TCT.disableAll(self)
  TCT.cancelDeferred()
  local b=TCT.B
  if b.connected and getProcessIDFromProcessName(TCT.EXE)==b.pid and getOpenedProcessID()~=b.pid then
    openProcess(b.pid)
  end
  b.stop()
  local list=getAddressList()
  for i=list.Count-1,0,-1 do
    local row=list.getMemoryRecord(i)
    if row.Active and (not self or row.ID~=self.ID) then row.Active=false end
  end
end

----------------------------------------------------------------- language
function TCT.applyLang()
  local al=getAddressList()
  for i=0,al.Count-1 do
    local m=al.getMemoryRecord(i); local n=TCT.NAMES[m.ID]
    if n then local d=(TCT.lang=='ja') and n[2] or n[1]
      if TCT.suffix[m.ID] then d=d..' : '..TCT.suffix[m.ID] end
      m.Description=d end
  end
end
function TCT.setLang(l) TCT.lang=l TCT.applyLang() end

----------------------------------------------------------------- [GAME] actions (TCT.B)
local B = TCT.B
local Transport=(function()
local M={}
local template=('9c5048b800000000103254768338010f853d0100004883781000740a483b48100f852c01000051524889c1b801000000ba02000000f00fb1115a590f8511010000515241504151415241534883ec6848894c243048b800000000103254764889483848b8f04d2b0578563412ffd08944243848ba0000000010325476488b4c243048b80000000010325476ff500848ba00000000103254768942048b4204c742300000000085c07561837a1800745b488b4c24308b4140ffc848c1e00448034130448b004c8942204c8b40084c894228817a20100000087531418b482881f9ff0f0000771e894a3031c039c8730e458a4c003844884c0240ffc0ebeec644024000eb07c74204feffffff488b4c243048b8f04d2b0578563412ffd02b4424387e1389c2488b4c243048b8505b2b0578563412ffd048b80000000010325476c700030000004883c468415b415a415941585a59589d48895c2408ff2500000000853f2b0578563412'):gsub('%x%x',function(h) return string.char(tonumber(h,16)) end)
local function qword(n) return string.pack('&lt;I8',n) end
local function replaceBytes(data,before,after)
  local out,start={},1
  while true do
    local first,last=data:find(before,start,true)
    if not first then
      out[#out+1]=data:sub(start)
      return table.concat(out)
    end
    out[#out+1]=data:sub(start,first-1)
    out[#out+1]=after
    start=last+1
  end
end
local entryBytes=string.char(0x48,0x89,0x5c,0x24,0x08)
function M.dispatcher(base,mailbox)
  local code=replaceBytes(template,qword(0x7654321000000000),qword(mailbox))
  for _,rva in ipairs({0x52b4df0,0x52b5b50,0x52b3f85}) do
    code=replaceBytes(code,qword(0x1234567800000000+rva),qword(base+rva))
  end
  return code
end
function M.buildInstall(base, block)
  local entry=base+0x52b3f80
  local rel=block-entry-5
  assert(rel&gt;=-0x80000000 and rel&lt;=0x7fffffff,'Dispatcher allocation is too far from game code')
  local jump=string.char(0xe9)..string.pack('&lt;i4',rel)
  return entry,jump,entryBytes,M.dispatcher(base,block+0x1000)
end
function M.result(block)
  local m=block+0x1000
  if readInteger(m)~=3 then return nil end
  local status=assert(readInteger(m+4))
  if status~=0 then TCT.err('The game operation failed.','ゲーム操作に失敗しました。') end
  local kind,payload,n=readInteger(m+0x20),readQword(m+0x28),readInteger(m+0x30)
  assert(kind and payload and n and n&gt;=0 and n&lt;=4095,'Invalid game response')
  local text=n&gt;0 and string.char(table.unpack(assert(readBytes(m+0x40,n,true)))) or ''
  return kind,payload,text,readQword(m+0x38)
end
local function memoryString(address,size)
  if size==0 then return '' end
  return string.char(table.unpack((assert(readBytes(address,size,true),'Memory read failed'))))
end
local function put(address,data)
  for offset=1,#data,1024 do
    local part=data:sub(offset,offset+1023)
    assert(writeBytes(address+offset-1,{part:byte(1,#part)})~=false,'Memory write failed')
    assert(memoryString(address+offset-1,#part)==part,'Memory write verification failed')
  end
end
local function paused(action)
  pause()
  local ok,result=pcall(action)
  unpause()
  if not ok then error(result,0) end
  return result
end
local blockSize=0x10000
local function restoreProtection(session)
  local expected=session.protection
  setMemoryProtection(session.entry,#entryBytes,expected)
  local actual=assert(getMemoryProtection(session.entry),'Cannot verify original code protection')
  assert(actual.r==expected.r and actual.w==expected.w and actual.x==expected.x,'Original code protection was not restored')
end
local function supportsEntry(current,jump)
  for i=1,#entryBytes do
    local b=current:byte(i)
    if b~=entryBytes:byte(i) and b~=jump:byte(i) then return false end
  end
  return true
end
local function checkThreadsOutsideBlock(session)
  local context=createMemoryStream()
  local ok,err=pcall(function()
    context.Size=0x500
    local address=(context.Memory+15) &amp; ~15
    local threads=assert(getThreadlist(),'Cannot list game threads')
    assert(#threads&gt;0,'Cannot find game threads')
    for _,id in ipairs(threads) do
      local tid=type(id)=='number' and id or tonumber(id,16)
      local handle=assert(executeCodeLocalEx('kernel32.OpenThread',0x808,0,tid))
      assert(handle~=0,'Cannot inspect a game thread. Retry restoration.')
      local inspected,why=pcall(function()
        if executeCodeLocalEx('kernel32.GetProcessIdOfThread',handle)~=session.pid then return end
        assert(writeIntegerLocal(address+0x30,0x100001),'Cannot prepare thread context')
        assert(executeCodeLocalEx('kernel32.GetThreadContext',handle,address)==1,'Cannot read a game thread. Retry restoration.')
        local ip=assert(readQwordLocal(address+0xf8),'Cannot read the game instruction pointer')
        assert(ip&lt;session.block or ip&gt;=session.block+blockSize,'A game thread is leaving the code. Retry restoration.')
      end)
      executeCodeLocalEx('kernel32.CloseHandle',handle)
      if not inspected then error(why,0) end
    end
  end)
  context.destroy()
  if not ok then error(err,0) end
end
function M.close(session)
  if session.closed then return end
  assert(getOpenedProcessID()==session.pid,'Attach to the original game process to restore its code')
  paused(function()
    if session.entryTouched then
      local slot=session.block+0x1000
      local state=readInteger(slot)
      assert(state==0 or state==1 or state==3,'A game operation is still running')
      if state==1 then assert(writeInteger(slot,0)) end
      local current=memoryString(session.entry,#entryBytes)
      if current~=entryBytes then
        assert(supportsEntry(current,session.jump),'Game code changed outside this table')
        assert(fullAccess(session.entry,#entryBytes)~=false,'Cannot enable entry write access')
        put(session.entry,entryBytes)
      end
      restoreProtection(session)
      -- The completion marker is written before the final jump out of this allocation.
      checkThreadsOutsideBlock(session)
    end
    assert(executeCodeLocalEx('kernel32.VirtualFreeEx',getOpenedProcessHandle(),session.block,0,0x8000)==1,
           'Cannot release game operation memory. Retry restoration.')
    session.closed=true
  end)
end
function M.cleanup()
  local session=M.pending
  if not session then return end
  if getProcessIDFromProcessName(TCT.EXE)==session.pid then M.close(session) end
  M.pending=nil
end
function M.open(base)
  local entry=base+0x52b3f80
  assert(memoryString(entry,#entryBytes)==entryBytes,'Game code already modified or incompatible')
  local protection=assert(getMemoryProtection(entry),'Cannot query original code protection')
  local block=assert(allocateMemory(blockSize,entry),'Could not reserve memory near the game code')
  local session={block=block,entry=entry,scriptContext=0,pid=getOpenedProcessID(),protection=protection}
  M.pending=session
  local ok,err=pcall(function()
    local _,jump,original,code=M.buildInstall(base,block)
    session.jump=jump
    put(block,code)
    paused(function()
      assert(memoryString(entry,#original)==original,'Game code changed before the write')
      assert(fullAccess(entry,#original)~=false,'Cannot enable entry write access')
      session.entryTouched=true
      local written,why=pcall(put,entry,jump)
      if not written then
        pcall(put,entry,original)
        restoreProtection(session)
        error(why,0)
      end
      restoreProtection(session)
    end)
  end)
  if not ok then
    local clean,why=pcall(M.cleanup)
    if not clean then error(tostring(err)..' / '..tostring(why),0) end
    error(err,0)
  end
  return session
end
function M.recover(session)
  assert(getOpenedProcessID()==session.pid,'Attach to the original game before restoring')
  if not session.failed then return end
  paused(function()
    local slot=session.block+0x1000
    local state=readInteger(slot)
    assert(state==0 or state==1 or state==3,'A game operation is still running. Retry restoration when it finishes.')
    if state==1 then assert(writeInteger(slot,0)) end
    session.failed=false
  end)
end
function M.request(session,bytes,wantsResult)
  assert(not session.closed and not session.failed and getOpenedProcessID()==session.pid,'Game operation unavailable')
  assert(#bytes&lt;=0xc000,'Game operation exceeds the buffer size')
  local m=session.block+0x1000
  local state=readInteger(m)
  assert(state==0 or state==3,'A game operation is already running')
  local code=session.block+0x3000
  put(code,bytes)
  put(m+4,string.pack('&lt;I4I8I8I4',0,code,session.scriptContext,wantsResult and 1 or 0))
  assert(writeInteger(m,1))
  local started=getTickCount()
  while readInteger(m)~=3 do
    if getTickCount()-started&gt;=2000 then
      session.failed=true
      error('The game did not respond. Completion is unknown.',0)
    end
    sleep(2)
  end
  local kind,payload,value,scriptContext=M.result(session.block)
  if session.scriptContext==0 then
    assert(kind==0x08000010 and value=='1.2.0' and scriptContext~=0,'Could not verify the game version')
    session.scriptContext=scriptContext
  end
  if wantsResult then return kind,payload,value end
  return nil,nil,nil
end
return M

end)()
local Compiler=(function()
-- Emits game calls from a typed operation plan.
local C={}
local function i32(n) return string.pack('&lt;I4',n &amp; 0xffffffff) end
local function q64(n) return string.pack('&lt;I8',n) end
local function h(s)
  return (s:gsub('%x%x',function(x) return string.char(tonumber(x,16)) end))
end
function C.build(plan,base)
  local blocks,refs,failures,strings,stack={}, {}, {}, {}, {}
  local size,depth=0,0
  local function put(s) blocks[#blocks+1]=s;size=size+#s end
  local function patch(list,value)
    list[#list+1]={#blocks+1,size,value};put(i32(0))
  end
  local function native(rva,args,check)
    put(h('488B4C2430'));if args then put(args) end
    put(h('48B8')..q64(base+rva)..h('FFD0'))
    if check then put(h('85C00F88'));patch(failures) end
  end
  local function push()
    depth=depth+1;stack[#stack+1]=depth
  end
  local function copy(slot)
    native(0x52b5be0,h('8B54243881C2')..i32(slot))
    depth=depth+1
  end
  local function index(slot) return h('8B54243881C2')..i32(slot) end
  put(h('4883EC6848894C2430'))
  native(0x52b4df0);put(h('89442438'))
  local returns=true
  for _,op in ipairs(plan) do
    local name,v=op[1],op[2]
    if name=='root' then native(0x52b5d80);push()
    elseif name=='literal' then
      if type(v)=='string' then
        put(h('488B4C2430488D15'));patch(refs,v)
        put(h('41B8')..i32(#v)..h('48B8')..q64(base+0x52b5d90)..h('FFD0'))
      elseif type(v)=='boolean' then native(0x52b5c20,h('BA')..i32(v and 1 or 0))
      elseif math.type(v)=='integer' then native(0x52b5cc0,h('BA')..i32(v))
      elseif v==nil then native(0x52b5d10)
      else error('Unsupported literal type') end
      push()
    elseif name=='duplicate' then stack[#stack+1]=assert(stack[#stack])
    elseif name=='swap' then local n=#stack;stack[n],stack[n-1]=stack[n-1],stack[n]
    elseif name=='get_slot' then
      local key,owner=table.remove(stack),table.remove(stack)
      copy(key);native(0x52b4290,index(owner),true);stack[#stack+1]=depth
    elseif name=='call' then
      local start=#stack-v-1
      for n=start,#stack do copy(stack[n]) end
      for n=#stack,start,-1 do stack[n]=nil end
      native(0x52b3f80,h('BA')..i32(v+1)..h('41B8010000004531C9'),true)
      depth=depth-v;stack[#stack+1]=depth
    elseif name=='set_slot' then
      assert(#stack==3)
      copy(stack[2]);copy(stack[3]);native(0x52b6400,index(stack[1]),true)
      returns=false;stack={}
    elseif name=='array' or name=='table' then
      local array=name=='array'
      local n=#stack;local start=n-(array and v or 2*v)+1
      if array then native(0x52b5060,h('BA')..i32(v)) else native(0x52b5670) end
      depth=depth+1;local slot=depth
      if array then
        for i=start,n do
          native(0x52b5cc0,h('BA')..i32(i-start));depth=depth+1
          copy(stack[i]);native(0x52b6400,index(slot),true);depth=depth-2
        end
      else
        for i=start,n,2 do copy(stack[i]);copy(stack[i+1]);native(0x52b6400,index(slot),true);depth=depth-2 end
      end
      for i=n,start,-1 do stack[i]=nil end
      stack[#stack+1]=slot
    elseif name=='add_integer' or name=='sub_integer' then
      local right,left=table.remove(stack),table.remove(stack)
      native(0x52b4930,index(left)..h('4C8D442440'),true)
      native(0x52b4930,index(right)..h('4C8D442448'),true)
      local arithmetic=name=='add_integer' and '03542448' or '2B542448'
      native(0x52b5cc0,h('8B542440'..arithmetic));push()
    else error('Unsupported operation: '..name) end
  end
  if returns then assert(#stack==1);copy(stack[1]) end
  put(h('31C04883C468C3'))
  local fail=size
  put(h('B8FFFFFFFF4883C468C3'))
  for _,r in ipairs(failures) do blocks[r[1]]=i32(fail-r[2]-4) end
  for _,r in ipairs(refs) do
    local value=r[3]
    if not strings[value] then strings[value]=size;put(value..'\0') end
    blocks[r[1]]=i32(strings[value]-r[2]-4)
  end
  return table.concat(blocks),returns
end
return C

end)()
local lower=(function()
-- Parses the expression subset used internally by the table.
local function lower(source)
  local plan,p={},1
  local function emit(op,v) plan[#plan+1]={op,v} end
  local function peek()
    p=source:find('%S',p) or #source+1
    return source:sub(p,p)
  end
  local function accept(s)
    peek()
    if source:sub(p,p+#s-1)==s then p=p+#s;return true end
    return false
  end
  local function need(s) assert(accept(s),'Expected '..s..' at '..p) end
  local function word()
    peek();local s=source:sub(p):match('^[_%a][_%w]*');assert(s,'Expected identifier at '..p)
    p=p+#s;return s
  end
  local function stringValue()
    peek();local quote=source:sub(p,p);p=p+1
    local out={}
    local escapes={n='\n',r='\r',t='\t',b='\b',f='\f'}
    while p&lt;=#source do
      local c=source:sub(p,p);p=p+1
      if c==quote then return table.concat(out) end
      if c=='\\' then
        c=source:sub(p,p);p=p+1
        if c=='u' then
          local cp=tonumber(source:sub(p,p+3),16);assert(cp,'Invalid Unicode escape')
          p=p+4;c=utf8.char(cp)
        else c=escapes[c] or c end
      end
      out[#out+1]=c
    end
    error('Unterminated string')
  end
  local expression
  local function args()
    if accept(')') then return 0 end
    local n=0
    repeat expression(false);n=n+1 until not accept(',')
    need(')');return n
  end
  local function primary()
    local c=peek()
    if c=='"' or c=="'" then emit('literal',stringValue())
    elseif c:match('%d') or c=='-' then
      local n=source:sub(p):match('^-?%d+');assert(n,'Expected integer');p=p+#n
      emit('literal',assert(math.tointeger(tonumber(n))))
    elseif accept('(') then expression(false);need(')')
    elseif accept('[') then
      local n=0
      if not accept(']') then
        repeat expression(false);n=n+1 until not accept(',')
        need(']')
      end
      emit('array',n)
    elseif accept('{') then
      local n=0
      if not accept('}') then
        repeat
          local k=peek();emit('literal',(k=='"' or k=="'") and stringValue() or word())
          if not accept('=') then need(':') end
          expression(false);n=n+1
        until not accept(',')
        need('}')
      end
      emit('table',n)
    else
      local name=word()
      if name=='true' then emit('literal',true)
      elseif name=='false' then emit('literal',false)
      elseif name=='null' then emit('literal',nil)
      else
        emit('root');emit('literal',name);emit('get_slot')
        if accept('(') then emit('root');emit('call',args()) end
      end
    end
  end
  local function chain(assign)
    primary()
    while true do
      if accept('.') then
        local name=word()
        if accept('(') then
          emit('duplicate');emit('literal',name);emit('get_slot');emit('swap');emit('call',args())
        else
          emit('literal',name)
          if assign and accept('=') then expression(false);emit('set_slot');return true end
          emit('get_slot')
        end
      elseif accept('[') then
        expression(false);need(']')
        if assign and accept('=') then expression(false);emit('set_slot');return true end
        emit('get_slot')
      else return false end
    end
  end
  expression=function(assign)
    if chain(assign) then return end
    while true do
      local op=peek()
      if op~='+' and op~='-' then break end
      p=p+1;chain(false);emit(op=='+' and 'add_integer' or 'sub_integer')
    end
  end
  expression(true);assert(peek()=='','Unexpected input at '..p)
  return plan
end
return lower

end)()
local Engine=(function()
local E={}
local ROOT='__TornekoCT_20260924'
local PLAYER='g_app._get_floor().m_player'
local function q(s)
  return '"'..tostring(s):gsub('[%z\1-\31\\"]',function(c)
    if c=='\\' or c=='"' then return '\\'..c end
    return ('\\u%04x'):format(c:byte())
  end)..'"'
end
local function read(addr,n)
  local t=assert(readBytes(addr,n,true),'Cannot read game memory')
  assert(#t==n,'Incomplete game memory read')
  return string.char(table.unpack(t))
end
local function write(addr,s)
  assert(writeBytes(addr,{s:byte(1,#s)})~=false,'Cannot write game memory')
  assert(read(addr,#s)==s,'Game memory write verification failed')
end
local function ins(op,a,b,c,d) return string.pack('&lt;i4BBBB',b or 0,op,a or 0,c or 0,d or 0) end
local function addrInt(a) return assert(tonumber(a),'Expected a game memory address') end
local function objString(a)
  local n=assert(readInteger(a+0x28))
  assert(n&gt;=0 and n&lt;=4096,'Invalid game string length')
  return read(a+0x38,n)
end
function E.new(transport,compiler,lower,data,base)
  local self=setmetatable({transport=transport,compiler=compiler,lower=lower,data=data,base=base,
    patches={},hooks={},enabled={},protos={}},{__index=E})
  self.session=transport.open(base)
  local ok,err=pcall(function()
    assert(self:value('g_app.m_version_str')=='"1.2.0"','Wrong game version')
    assert(self:value('getroottable().rawin('..q(ROOT)..')')~='true','Another table session is already active')
    self:func('GameStatus.set')
    self:value('getroottable().rawset('..q(ROOT)..',{guards={},forced={},blocked={},rawin="rawin"})')
    self.owns=true
  end)
  if not ok then
    local clean,why=pcall(transport.cleanup)
    if not clean then error(tostring(err)..' / '..tostring(why),0) end
    error(err,0)
  end
  transport.pending=nil
  return self
end
function E:value(s,wantAddress)
  local code,result=self.compiler.build(self.lower(s),self.base)
  local tag,value,text=self.transport.request(self.session,code,result)
  if not result or tag==0x01000001 then return 'null' end
  if tag==0x08000010 then return wantAddress and value or q(text) end
  if tag==0x05000002 then return tostring(string.unpack('&lt;i4',string.pack('&lt;I4',value &amp; 0xffffffff))) end
  if tag==0x05000004 then return tostring(string.unpack('&lt;f',string.pack('&lt;I4',value &amp; 0xffffffff))) end
  if tag==0x01000008 then return (value &amp; 0xffffffff)~=0 and 'true' or 'false' end
  if tag &amp; 0x08000000~=0 then return wantAddress and value or ('0x%X'):format(value) end
  error(('Unsupported game value type %X'):format(tag))
end
local function identity(p,d)
  if not p or p==0 then return false end
  local good,valid=pcall(function()
    return readInteger(p+0xc8)==#d.bytes//8 and readInteger(p+0x78)==d.nl
       and objString(readQword(p+0x38))==d.src and objString(readQword(p+0x48))==d.name
  end)
  return good and valid
end
local function locate(d,name)
  local sig=d.bytes:sub(1,math.min(48,#d.bytes)):gsub('.',function(c) return ('%02X '):format(c:byte()) end)
  local hits=AOBScan(sig,'+W')
  assert(hits,'Game script is not loaded: '..name)
  local ok,result=pcall(function()
    local found=nil
    for i=0,hits.Count-1 do
      local at=tonumber(hits[i],16)
      local p=at-0xcc
      if p%8==0 and identity(p,d) and read(at,#d.bytes)==d.bytes then
        assert(not found,'Ambiguous loaded game script: '..name)
        found=p
      end
    end
    assert(found,'Game script is not loaded: '..name)
    return found
  end)
  hits.destroy()
  if not ok then error(result,0) end
  return result
end
function E:func(name)
  local d=assert(self.data[name],name)
  local p=self.protos[name]
  if not p or (not self.hooks[name] and not identity(p,d)) then
    local ok,value=pcall(function() return readQword(addrInt(self:value(name,true))+0x48) end)
    p=ok and identity(value,d) and value or locate(d,name)
  end
  local pc=p+0xcc
  assert(objString(readQword(p+0x38))==d.src and objString(readQword(p+0x48))==d.name,'Function identity mismatch: '..name)
  if not self.hooks[name] then
    assert(readInteger(p+0xc8)==#d.bytes//8 and readInteger(p+0x78)==d.nl,'Function layout mismatch: '..name)
    local expected=d.bytes
    for _,batch in pairs(self.patches) do
      for _,x in ipairs(batch) do
        local at=x[1]-pc
        if at&gt;=0 and at+#x[3]&lt;=#expected then expected=expected:sub(1,at)..x[3]..expected:sub(at+#x[3]+1) end
      end
    end
    assert(read(pc,#expected)==expected,'Function instructions differ: '..name)
  end
  self.protos[name]=p
  return p,pc,d
end
function E:patch(key,changes,on)
  if on then
    if self.patches[key] then return end
    local batch={}
    for _,c in ipairs(changes) do
      local _,pc=self:func(c[1]);local at=pc+c[2]*8
      batch[#batch+1]={at,read(at,#c[3]),c[3]}
    end
    self.patches[key]=batch
    local written=0
    local ok,err=pcall(function()
      for i,x in ipairs(batch) do written=i;write(x[1],x[3]) end
    end)
    if not ok then
      for i=written,1,-1 do local x=batch[i];write(x[1],x[2]) end
      self.patches[key]=nil;error(err,0)
    end
  else
    local batch=self.patches[key]
    if not batch then return end
    for _,x in ipairs(batch) do assert(read(x[1],#x[3])==x[3],'Patch changed externally: '..key) end
    for i=#batch,1,-1 do local x=batch[i];write(x[1],x[2]) end
    self.patches[key]=nil
  end
end
E.PLAYER=PLAYER
E.quote=q
E.ins=ins
function E:hook(name,make,extras)
  if self.hooks[name] then return end
  extras=extras or {}
  local p,pc,d=self:func(name)
  local original=read(pc,8)
  local lp=assert(readQword(p+0x80))
  local storage=assert(allocateMemory(0x10000,pc),'Script storage allocation failed')
  local codeAt=storage+pc%8
  local literals=storage+0x8000
  local delta=(codeAt-pc-8)//8
  assert(delta&gt;=-0x80000000 and delta&lt;=0x7fffffff,'Script storage too far')
  local code=make(d.nl)
  code[#code+1]=original
  local endAt=codeAt+#code*8
  code[#code+1]=ins(0x1e,0,(pc-endAt)//8)
  write(codeAt,table.concat(code))
  if #extras&gt;0 then write(literals,read(lp,d.nl*16)..table.concat(extras)) end
  local entry=ins(0x1e,0,delta)
  self.hooks[name]={p=p,pc=pc,lp=lp,nl=d.nl,extra=#extras,storage=storage,entry=entry,original=original}
  local ok,err=pcall(function()
    if #extras&gt;0 then
      write(p+0x80,string.pack('&lt;I8',literals));write(p+0x78,string.pack('&lt;I4',d.nl+#extras))
    end
    write(pc,entry)
  end)
  if not ok then self:unhook(name);error(err,0) end
end
function E:unhook(name)
  local hook=self.hooks[name]
  if not hook then return end
  local current=read(hook.pc,8)
  assert(current==hook.entry or current==hook.original,'Script hook changed externally: '..name)
  write(hook.pc,hook.original)
  self:value('1')
  if hook.extra&gt;0 then
    write(hook.p+0x80,string.pack('&lt;I8',hook.lp))
    write(hook.p+0x78,string.pack('&lt;I4',hook.nl))
  end
  self:value('1')
  deAlloc(hook.storage)
  self.hooks[name]=nil
end
function E:tableLiteral(key)
  return string.pack('&lt;I4I4I8',0x0a000020,0,addrInt(self:value(ROOT..'.'..key,true)))
end
function E:statusHook()
  self:hook('GameStatus.set',function(n)
    return {
      ins(0x11,3,n),ins(0x30,4,3,3,5),ins(0x33,6,1),ins(0x1d,4,4,5,2),ins(0x12,4,10),
      ins(0x1b,4,3,1),ins(0x0b,5,2),ins(0x36,5,5,4),ins(0x12,5,2),ins(0x0b,2,0),ins(0x1e,0,4),
      ins(0x2a,4,2,0),ins(0x1b,4,4,1),ins(0x08,4,1,2,3),ins(0x33,2,4)
    }
  end,{self:tableLiteral('guards')})
end
function E:flagHook(blocked)
  local p=self:func('GameStatus.set')
  local rawin=read(assert(readQword(p+0x80))+48,16)
  local name=blocked and 'Player.flag_on' or 'Player.is_flag'
  self:hook(name,function(n)
    local a=blocked and 4 or 2
    return {ins(0x11,a,n),ins(0x30,a+1,n+1,a,a+2),ins(0x33,a+3,1),ins(0x1d,a+1,a+1,a+2,2),
      ins(0x12,a+1,2),ins(0x3b,a,1),ins(0x06,blocked and 255 or 1,blocked and 0 or a,a)}
  end,{self:tableLiteral(blocked and 'blocked' or 'forced'),rawin})
end
local minimap={map='MINIMAP_OPEN',items='MINIMAP_ITEM',enemies='MINIMAP_ENEMY'}
function E:sync()
  local g,f,b={},{},{}
  local enabled=self.enabled
  if enabled.hp then g.HP=1 end
  if enabled.food then g.FOOD=1;f.FOOD_FREE=true end
  if enabled.speed then g.TURN=1 end
  if enabled.strength or enabled.status then g.POWRAW=1;g.POWRAWMAX=1 end
  if enabled.status then
    for _,k in ipairs({'SLEEP','CONFUSE','ILLUSION','BLIND','BIND'}) do g[k]=2 end
    for _,k in ipairs({'NO_POISON','NO_SLEEP','NO_DOLL'}) do f[k]=true end
    for _,k in ipairs({'NO_MOUTH','FREEZE','STATUE','SLOW','VERY_SLOW','SPEED_SLOW','BIND','BLIND','CONFUSE','ILLUSION'}) do b[k]=true end
  end
  if enabled.trap then f.NO_TRAP=true end
  for k,v in pairs(minimap) do if enabled[k] then f[v]=true end end
  if next(g) then self:statusHook() end
  if next(f) then self:flagHook(false) end
  if next(b) then self:flagHook(true) end
  for name,fields in pairs({guards=g,forced=f,blocked=b}) do
    local prefix=ROOT..'.'..name
    self:value(prefix..'.clear()')
    for k,v in pairs(fields) do self:value(prefix..'.rawset('..q(k)..','..tostring(v)..')') end
  end
  if not next(g) then self:unhook('GameStatus.set') end
  if not next(f) then self:unhook('Player.is_flag') end
  if not next(b) then self:unhook('Player.flag_on') end
end
local ret=ins(0x06,255)
local edits={
  hp={{'Player.exec_dead',0,ret},{'Player.exec_dead_no_after_wait',0,ret}},
  rust={{'Player.rust',0,ret}},status={{'Player.add_hand',0,ret}},
  attack={{'Enemy.attack',0,ins(0x0b,3,1)..ins(0x06,1,3,3)},{'Enemy.special',0,ret}},
  heal={{'Player.turn',291,ins(0x33,10,2)}},
  consume={{'Player.item_use_affect',38,ins(0x0b,6,0)},{'Player.item_use_for',82,ins(0x0b,7,0)},{'GameFloor.throw_item_one',10,ins(0x0b,9,0)}}
}
function E:reveal(key)
  local floor=self:value('g_app._get_floor()')
  if floor=='null' then return end
  if key=='map' then
    if not self.mapOwner or self.mapOwner[1]~=floor then
      self.mapOwner={floor,self:value(PLAYER..'.is_flag("NO_MASK")')=='true'}
    end
    self:value(PLAYER..'.map_open(null)')
  elseif key=='items' then self:value('g_app._get_floor().unmask_items()')
  elseif key=='enemies' then self:value('g_app._get_floor().unmask_enemys()') end
end
function E:clearStatus()
  if self:value('g_app._get_floor()')=='null' then return end
  self:value(PLAYER..'.sub_hand_force()')
  for _,key in ipairs({'SLEEP','CONFUSE','ILLUSION','BLIND','BIND'}) do
    if self:value('g_app.m_status.m_status.rawin('..q(key)..')')=='true' then
      self:value(PLAYER..'.set_status('..q(key)..',0)')
    end
  end
  for _,key in ipairs({'NO_MOUTH','FREEZE','STATUE','VERY_SLOW','SPEED_SLOW','BIND'}) do
    if self:value(PLAYER..'.m_status.flags.rawin('..q(key)..')')=='true' then
      self:value(PLAYER..'.flag_off('..q(key)..')')
    end
  end
end
function E:toggle(key,on)
  if on==(self.enabled[key]==true) then return end
  if key=='map' and not on and self.mapOwner then
    if self:value('g_app._get_floor()')==self.mapOwner[1] and not self.mapOwner[2] then
      self:value(PLAYER..'.flag_off("NO_MASK")')
    end
    self.mapOwner=nil
  end
  if key=='hp' then
    if on then
      self:hook('battle_damage',function()
        return {ins(0x2a,4,13,0),ins(0x0d,4,4,2),ins(0x12,4,2),ins(0x3b,4,0),ins(0x06,1,4,4)}
      end)
    else self:unhook('battle_damage') end
  end
  if edits[key] then self:patch(key,edits[key],on) end
  if key=='baikiruto' or key=='sukara' then
    local path='_affect.'..(key=='baikiruto' and 'WEP' or 'ARM')..'_UP_1.value'
    if on then
      self:value('import(1099989422)')
      self:value(ROOT..'.rawset("old_'..key..'",'..path..')')
    end
    self:value(path..'='..(on and '99' or ROOT..'.old_'..key))
  end
  self.enabled[key]=on or nil
  self:sync()
  if on and minimap[key] then self:reveal(key) end
  if on and key=='status' then self:clearStatus() end
end

function E:status(key) return self:value('g_app.get_status('..q(key)..')') end
function E:guarded(key,fn)
  local path=ROOT..'.guards'
  local k=q(key)
  local old=self:value(path..'.rawin('..k..')')=='true' and self:value(path..'['..k..']') or nil
  if old then self:value(path..'.rawdelete('..k..')') end
  local ok,result=pcall(fn)
  if old then self:value(path..'.rawset('..k..','..old..')') end
  if not ok then error(result,0) end
  return result
end
local limits={HP={1,250},HPMAX={1,250},EXP={0,999999},FOOD={0,200},GOLD={0,999999999},
  POWRAW={0,99},ATK={0,999},DEF={0,999},TURN_FLOOR={0,999999},TURN_TOTAL={0,999999},FLOOR={1,99}}
function E:set(key,value)
  local v=assert(math.tointeger(value),'Expected an integer')
  local range=assert(limits[key],'Unknown value')
  assert(v&gt;=range[1] and v&lt;=range[2],('Value must be %d..%d'):format(range[1],range[2]))
  if key=='FOOD' then v=v*20 end
  if key=='ATK' or key=='DEF' then
    local c=key=='ATK' and 0 or 1
    local equip='g_app.get_equip_item('..c..')'
    assert(self:value(equip)~='null','Equip a sword/shield first')
    self:value(equip..'.count='..v..'-'..equip..'.data.pow')
    self:value('g_app.update_equip('..c..')')
  elseif key=='FLOOR' then
    self:transition();self:setFloor(v)
  else
    self:guarded(key,function()
      local maximum=({HP='HPMAX',FOOD='FOODMAX',POWRAW='POWRAWMAX'})[key]
      if maximum and v&gt;tonumber(self:status(maximum)) then self:value('g_app.set_status('..q(maximum)..','..v..')') end
      local owner=self:value('g_app._get_floor()')=='null' and 'g_app' or PLAYER
      self:value(owner..'.set_status('..q(key)..','..v..')')
    end)
  end
  return 'OK'
end
function E:identify()
  local n=tonumber(self:value('g_app.m_status.m_items.len()'))
  for i=0,n-1 do
    local item='g_app.get_items('..i..')'
    self:value(item..'.flags.rawset("VISIBLE",-1)')
    if self:value(item..'.dummy')~='null' then
      self:value('dummy_name_open('..item..')')
      self:value(item..'.dummy=null')
    end
  end
  return n..' carried items identified'
end
function E:plate()
  assert(self:value('g_app._get_floor()')~='null','Enter a dungeon first')
  assert(self:value('g_app.get_equip_item(1)')~='null','Equip a shield first')
  self:value(PLAYER..'.flag_on_equip(1,"NO_RUST",1,null)')
  assert(self:value('g_app.get_equip_item(1).flags.rawin("NO_RUST")')=='true','Shield plating verification failed')
  return 'Equipped shield plated'
end
function E:uncurse()
  assert(self:value('g_app._get_floor()')~='null',
         TCT.T('Enter a dungeon first.','ダンジョン内で実行してください。'))
  assert(self:value('g_app._get_floor().is_exec()')~='true',
         TCT.T('Wait for the current action to finish.','現在の行動が終わってから実行してください。'))
  -- Player.item_use_for resolves the item definition; item_use_affect passes
  -- its affects_use, the player twice, and the floor to battle_affect.
  self:func('Player.item_use_affect')
  self:func('Player.item_use_for')
  local effect='get_item_data(49).affects_use'
  local readOk,value=pcall(self.value,self,effect)
  if not readOk or value=='null' then
    TCT.err('Could not read the Shanaq effect.','シャナクの効果を取得できませんでした。')
  end
  local applied,result=pcall(self.value,self,'battle_affect('..effect..','..PLAYER..','..PLAYER..','..PLAYER..'.m_floor)')
  if not applied or result=='false' then
    TCT.err('Could not apply the Shanaq effect.','シャナクの効果を適用できませんでした。')
  end
  return TCT.T('Shanaq effect applied without consuming a scroll.','巻物を消費せず、シャナクの効果を適用しました。')
end
function E:transition()
  assert(self:value('g_app._get_floor()')~='null','Enter a dungeon first / ダンジョン内で実行してください')
  assert(self:value('g_app.is_replay()')~='true','Unavailable during replay')
  assert(self:value('g_app._get_floor().is_exec()')~='true','Wait for the current action to finish')
end
function E:dungeon(value)
  local id=math.tointeger(value)
  assert(id and id&gt;=0 and id&lt;=2,'Unknown dungeon')
  self:transition()
  local network=self:status('NETWORK')
  assert(network=='false' or network=='0' or network=='null','Only offline dungeons are supported')
  local old=self:status('DUNGEON')
  self:value('g_app.set_status("DUNGEON",'..id..')')
  local ok=pcall(self.setFloor,self,1)
  assert(ok,'Dungeon transition could not be confirmed; inspect the game before retrying')
  self.floor=nil
  return ('Dungeon %s → %d, floor 1 requested'):format(old,id)
end
function E:evac()
  self:transition()
  self:value('g_app.on_select("phase_clear",{mode="RETURN"})')
  self.floor=nil
  return 'Forced Evac requested without consuming a scroll / 帰還禁止を無視してリレミトを実行しました'
end
function E:slot(slot,uniq)
  slot=assert(math.tointeger(slot),'Invalid inventory slot')
  local n=tonumber(self:value('g_app.m_status.m_items.len()'))
  assert(slot&gt;=0 and slot&lt;n,'Inventory slot no longer exists')
  local item='g_app.get_items('..slot..')'
  assert(self:value(item..'.uniq')==tostring(uniq),'Inventory changed; select the item again')
  return slot,item
end
function E:addItems(batch)
  local requested,total={},0
  assert(type(batch)=='table' and #batch&gt;0,'Select at least one item')
  local seen={}
  for _,entry in ipairs(batch) do
    local id,quantity=math.tointeger(entry.id),math.tointeger(entry.quantity)
    assert(id and id&gt;=0 and id&lt;=84 and not seen[id],'Invalid or duplicate item ID')
    assert(quantity and quantity&gt;=1 and quantity&lt;=20,'Choose a quantity from 1 to 20')
    seen[id]=true; total=total+quantity
    for i=1,quantity do requested[#requested+1]=id end
  end
  local items='g_app.m_status.m_items'
  local n=assert(tonumber(self:value(items..'.len()')))
  assert(n+total&lt;=20,'Inventory limit of 20 slots would be exceeded')
  local dungeon=assert(tonumber(self:status('DUNGEON')))
  local inserted={}
  local ok,err=pcall(function()
    for i,id in ipairs(requested) do
      self:value(items..'.append(rand_item_data('..id..','..dungeon..',false))')
      assert(tonumber(self:value(items..'.len()'))==n+i,'Unexpected inventory size')
      local item='g_app.get_items('..(n+i-1)..')'
      inserted[i]=self:value(item..'.uniq')
      assert(tonumber(self:value(item..'.id'))==id,'Item readback did not match')
    end
    self:value('g_app.m_status._check_flags()')
  end)
  if not ok then
    local reverted,why=pcall(function()
      local size=assert(tonumber(self:value(items..'.len()')))
      assert(size==n+#inserted,'Inventory changed separately')
      for i,identity in ipairs(inserted) do
        assert(self:value('g_app.get_items('..(n+i-1)..').uniq')==identity,'An unrelated item appeared in the inventory')
      end
      for i=size-1,n,-1 do self:value(items..'.remove('..i..')') end
      self:value('g_app.m_status._check_flags()')
    end)
    if not reverted then error(tostring(err)..' / '..tostring(why),0) end
    error(err,0)
  end
  return total
end
function E:count(slot,uniq,value)
  local _,item=self:slot(slot,uniq)
  local id=tonumber(self:value(item..'.id'))
  local low=id&lt;=13 and -99 or (id&gt;=66 and id&lt;=79 and 0 or 1)
  local count=math.tointeger(value)
  assert(count and count&gt;=low and count&lt;=99,('Count / charges / equipment bonus must be %d..99'):format(low))
  self:value(item..'.count='..count)
  for c=0,1 do
    if self:value('g_app.get_equip_item('..c..')')~='null' then self:value('g_app.update_equip('..c..')') end
  end
  return 'Count / charges / equipment bonus updated'
end
function E:setFloor(v)
  self:value('g_app.set_status("FLOOR",'..v..')')
  self:value('g_app.on_select("phase_dungeon",null)')
  self.floor=nil
end
function E:writePlayer(key,v)
  self:guarded(key,function()
    local prefix=PLAYER..'.set_status('..q(key)..','
    self:value(prefix..math.max(0,v-1)..')');self:value(prefix..v..')')
  end)
end
function E:keepStatus()
  if not self.enabled.food then self.foodKeep=nil;self.foodFloor=nil end
  if not self.enabled.food and not self.enabled.speed then return end
  local f=self:value('g_app._get_floor()')
  if f=='null' then return end
  if self.enabled.speed and tonumber(self:status('TURN'))&lt;10 then self:writePlayer('TURN',10) end
  if self.enabled.food then
    local cur=tonumber(self:status('FOOD'))
    self.foodKeep=math.max(cur,self.foodKeep or cur)
    if cur&lt;self.foodKeep or f~=self.foodFloor then self:writePlayer('FOOD',self.foodKeep) end
    self.foodFloor=f
  end
end
function E:snapshot()
  local values={}
  for _,k in ipairs({'HP','HPMAX','EXP','FOOD','GOLD','POWRAW','ATK','DEF','TURN_FLOOR','TURN_TOTAL','FLOOR','DUNGEON'}) do values[k]=self:status(k) end
  local f=self:value('g_app._get_floor()')
  local identity=f..':'..values.DUNGEON..':'..values.FLOOR
  if identity~=self.floor then
    self.floor=identity
    for k in pairs(minimap) do if self.enabled[k] then self:reveal(k) end end
  end
  values.FOOD=tostring(tonumber(values.FOOD)/20)
  values.STATE=f~='null' and 'Dungeon ready' or 'Outside dungeon'
    for k in pairs(self.enabled) do values['TOGGLE_'..k]='1' end
  return values
end
function E:inventory()
  local n=math.tointeger(tonumber(self:value('g_app.m_status.m_items.len()')))
  assert(n and n&gt;=0 and n&lt;=512,'Inventory size is unavailable')
  local rows={}
  for slot=0,n-1 do
    local path='g_app.get_items('..slot..')'
    local ok,id,count,identity=pcall(function()
      local id=math.tointeger(tonumber(self:value(path..'.id')))
      local count=math.tointeger(tonumber(self:value(path..'.count')))
      local identity=self:value(path..'.uniq')
      return id,count,identity
    end)
    if ok then
      local valid=id and count and identity and identity~='' and identity~='null'
      rows[#rows+1]={slot=slot,id=id,count=count,identity=identity,readable=not not valid}
    else
      rows[#rows+1]={slot=slot,readable=false}
    end
  end
  return rows
end
function E:close()
  self.transport.recover(self.session)
  if self.owns then
    local active={}
    for k in pairs(self.enabled) do active[#active+1]=k end
    for _,k in ipairs(active) do self:toggle(k,false) end
    for k in pairs(self.patches) do self:patch(k,nil,false) end
    for k in pairs(self.hooks) do self:unhook(k) end
    if self:value('getroottable().rawin('..q(ROOT)..')')=='true' then
      self:value('getroottable().rawdelete('..q(ROOT)..')')
    end
    self.owns=false
  end
  self.transport.close(self.session)
end

return E

end)()
local bytecode={
  ["GameStatus.set"]={src="nut.game.GameStatus:nut/game/GameStatus.nut",name="set",nl=16,bytes="\x67\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x36\x03\x01\xff\x02\x00\x00\x00\x07\x03\x03\x00\x01\x00\x00\x00\x36\x04\x01\xff\x04\x00\x00\x00\x33\x03\x00\x00\x07\x00\x00\x00\x12\x03\x00\x00\x6a\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x03\x00\x00\x00\x00\x00\x00\x0b\x04\x00\x00\x00\x00\x00\x00\x1a\xff\x03\x04\x6b\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x03\x00\x00\x03\x00\x00\x00\x06\x01\x03\x00\x6f\x01\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x2a\x03\x00\x00\x03\x00\x00\x00\x30\x03\x03\x04\x01\x00\x00\x00\x33\x05\x00\x00\x03\x00\x00\x00\x1d\x03\x04\x02\x03\x00\x00\x00\x12\x03\x00\x00\x02\x00\x00\x00\x2a\x04\x00\x00\x04\x00\x00\x00\x1b\x03\x01\x00\x01\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x0b\x03\x00\x00\x72\x01\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x2a\x04\x00\x00\x03\x00\x00\x00\x30\x04\x04\x05\x01\x00\x00\x00\x33\x06\x00\x00\x04\x00\x00\x00\x1d\x04\x05\x02\x11\x00\x00\x00\x12\x04\x00\x00\x74\x01\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x2a\x04\x00\x00\x04\x00\x00\x00\x1b\x04\x01\x00\x75\x01\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x08\x04\x02\x00\x76\x01\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x2a\x05\x00\x00\x05\x00\x00\x00\x30\x05\x05\x06\x01\x00\x00\x00\x20\x07\x08\x04\x05\x00\x00\x00\x1d\xff\x06\x03\x05\x00\x00\x00\x1e\x00\x00\x00\x78\x01\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x2a\x05\x00\x00\x05\x00\x00\x00\x30\x05\x05\x06\x01\x00\x00\x00\x20\x07\x08\x02\x05\x00\x00\x00\x1d\xff\x06\x03\x05\x00\x00\x00\x1e\x00\x00\x00\x7e\x01\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x2a\x04\x00\x00\x05\x00\x00\x00\x30\x04\x04\x05\x01\x00\x00\x00\x20\x06\x07\x02\x04\x00\x00\x00\x1d\xff\x05\x03\x85\x01\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x36\x04\x01\xff\x28\x00\x00\x00\x12\x04\x00\x00\x87\x01\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x2a\x04\x00\x00\x07\x00\x00\x00\x2a\x04\x04\x00\x00\x00\x00\x00\x0b\x05\x00\x00\x05\x00\x00\x00\x36\x04\x04\x00\x0c\x00\x00\x00\x12\x04\x00\x00\x89\x01\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x25\x04\x05\x02\x00\x00\x00\x00\x1b\x05\x05\x00\x09\x00\x00\x00\x2a\x05\x05\x00\x05\x00\x00\x00\x03\x04\x04\x00\x8a\x01\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x2a\x05\x00\x00\x05\x00\x00\x00\x1b\x05\x04\x00\x02\x00\x00\x00\x08\x05\x02\x00\x02\x00\x00\x00\x2a\x05\x00\x00\x05\x00\x00\x00\x1a\xff\x04\x02\x08\x00\x00\x00\x1e\x00\x00\x00\x8e\x01\x00\x00\x00\x00\x00\x00\x0a\x00\x00\x00\x11\x04\x00\x00\x8f\x01\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x2a\x05\x00\x00\x05\x00\x00\x00\x1b\x05\x04\x00\x02\x00\x00\x00\x08\x05\x02\x00\x02\x00\x00\x00\x2a\x05\x00\x00\x05\x00\x00\x00\x1a\xff\x04\x02\x91\x01\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x2a\x04\x00\x00\x0b\x00\x00\x00\x2a\x04\x04\x00\x03\x00\x00\x00\x08\x04\x02\x00\x02\x00\x00\x00\x2a\x04\x00\x00\x0b\x00\x00\x00\x11\x05\x00\x00\x04\x00\x00\x00\x1a\xff\x05\x02\x92\x01\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x2a\x04\x00\x00\x0c\x00\x00\x00\x2a\x04\x04\x00\x03\x00\x00\x00\x08\x04\x02\x00\x02\x00\x00\x00\x2a\x04\x00\x00\x0c\x00\x00\x00\x11\x05\x00\x00\x04\x00\x00\x00\x1a\xff\x05\x02\x95\x01\x00\x00\x00\x00\x00\x00\x0d\x00\x00\x00\x36\x04\x01\xff\x05\x00\x00\x00\x12\x04\x00\x00\x97\x01\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x2a\x04\x00\x00\x0e\x00\x00\x00\x11\x05\x00\x00\x00\x00\x00\x00\x0b\x06\x00\x00\x04\x00\x00\x00\x1a\xff\x05\x06\x9b\x01\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x0e\x04\x00\x00\x0f\x00\x00\x00\x36\x04\x04\xff\x03\x00\x00\x00\x17\x04\x04\x00\x03\x00\x00\x00\x0e\x05\x00\x00\x0f\x00\x00\x00\x36\x05\x05\xff\x05\x00\x00\x00\x33\x04\x00\x00\x05\x00\x00\x00\x12\x04\x00\x00\x9c\x01\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x2a\x04\x00\x00\x04\x00\x00\x00\x1b\x04\x01\x00\x03\x00\x00\x00\x37\x04\x04\x00\x04\x00\x00\x00\x06\x01\x04\x00\x9d\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x04\x00\x00\x04\x00\x00\x00\x06\x01\x04\x00\x9e\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\xff\x00\x00"},
  ["Player.is_flag"]={src="nut.game.chara.Player:nut/game/chara/Player.nut",name="is_flag",nl=13,bytes="\xd7\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x30\x02\x00\x03\x01\x00\x00\x00\x33\x04\x00\x00\x02\x00\x00\x00\x1d\x02\x03\x02\x02\x00\x00\x00\x12\x02\x00\x00\x01\x00\x00\x00\x3b\x02\x00\x00\x02\x00\x00\x00\x06\x01\x02\x00\xda\x05\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x2a\x02\x00\x00\x02\x00\x00\x00\x2a\x02\x02\x00\x03\x00\x00\x00\x30\x02\x02\x03\x01\x00\x00\x00\x33\x04\x00\x00\x02\x00\x00\x00\x1d\x02\x03\x02\x02\x00\x00\x00\x12\x02\x00\x00\x01\x00\x00\x00\x3b\x02\x00\x00\x02\x00\x00\x00\x06\x01\x02\x00\xdd\x05\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x2a\x02\x00\x00\x05\x00\x00\x00\x30\x02\x02\x03\x06\x00\x00\x00\x2a\x04\x00\x00\x02\x00\x00\x00\x1d\x02\x03\x02\xde\x05\x00\x00\x00\x00\x00\x00\x12\x00\x00\x00\x12\x02\x00\x00\xe0\x05\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x2a\x03\x02\x00\x08\x00\x00\x00\x2a\x03\x03\x00\x09\x00\x00\x00\x30\x03\x03\x04\x01\x00\x00\x00\x33\x05\x00\x00\x03\x00\x00\x00\x1d\x03\x04\x02\x00\x00\x00\x00\x0b\x04\x00\x00\x02\x00\x00\x00\x08\x04\x03\x02\x01\x00\x00\x00\x3b\x03\x00\x00\x03\x00\x00\x00\x06\x01\x03\x00\xe1\x05\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x2a\x03\x02\x00\x03\x00\x00\x00\x30\x03\x03\x04\x01\x00\x00\x00\x33\x05\x00\x00\x03\x00\x00\x00\x1d\x03\x04\x02\x02\x00\x00\x00\x12\x03\x00\x00\x01\x00\x00\x00\x3b\x03\x00\x00\x03\x00\x00\x00\x06\x01\x03\x00\xe3\x05\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x2a\x03\x00\x00\x05\x00\x00\x00\x30\x03\x03\x04\x0a\x00\x00\x00\x2a\x05\x00\x00\x03\x00\x00\x00\x1d\x03\x04\x02\xe4\x05\x00\x00\x00\x00\x00\x00\x12\x00\x00\x00\x12\x03\x00\x00\xe6\x05\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x2a\x04\x03\x00\x08\x00\x00\x00\x2a\x04\x04\x00\x09\x00\x00\x00\x30\x04\x04\x05\x01\x00\x00\x00\x33\x06\x00\x00\x04\x00\x00\x00\x1d\x04\x05\x02\x00\x00\x00\x00\x0b\x05\x00\x00\x02\x00\x00\x00\x08\x05\x04\x02\x01\x00\x00\x00\x3b\x04\x00\x00\x04\x00\x00\x00\x06\x01\x04\x00\xe7\x05\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x2a\x04\x03\x00\x03\x00\x00\x00\x30\x04\x04\x05\x01\x00\x00\x00\x33\x06\x00\x00\x04\x00\x00\x00\x1d\x04\x05\x02\x02\x00\x00\x00\x12\x04\x00\x00\x01\x00\x00\x00\x3b\x04\x00\x00\x04\x00\x00\x00\x06\x01\x04\x00\xe9\x05\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x2a\x04\x00\x00\x05\x00\x00\x00\x30\x04\x04\x05\x0b\x00\x00\x00\x2a\x06\x00\x00\x04\x00\x00\x00\x1d\x04\x05\x02\xea\x05\x00\x00\x00\x00\x00\x00\x12\x00\x00\x00\x12\x04\x00\x00\xec\x05\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x2a\x05\x04\x00\x08\x00\x00\x00\x2a\x05\x05\x00\x09\x00\x00\x00\x30\x05\x05\x06\x01\x00\x00\x00\x33\x07\x00\x00\x05\x00\x00\x00\x1d\x05\x06\x02\x00\x00\x00\x00\x0b\x06\x00\x00\x02\x00\x00\x00\x08\x06\x05\x02\x01\x00\x00\x00\x3b\x05\x00\x00\x05\x00\x00\x00\x06\x01\x05\x00\xed\x05\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x2a\x05\x04\x00\x03\x00\x00\x00\x30\x05\x05\x06\x01\x00\x00\x00\x33\x07\x00\x00\x05\x00\x00\x00\x1d\x05\x06\x02\x02\x00\x00\x00\x12\x05\x00\x00\x01\x00\x00\x00\x3b\x05\x00\x00\x05\x00\x00\x00\x06\x01\x05\x00\xf0\x05\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x2a\x05\x00\x00\x0c\x00\x00\x00\x30\x05\x05\x06\x01\x00\x00\x00\x33\x07\x00\x00\x05\x00\x00\x00\x1d\x05\x06\x02\x02\x00\x00\x00\x12\x05\x00\x00\x01\x00\x00\x00\x3b\x05\x00\x00\x05\x00\x00\x00\x06\x01\x05\x00\xf1\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3b\x05\x00\x00\x05\x00\x00\x00\x06\x01\x05\x00\xf2\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\xff\x00\x00"},
  ["Player.flag_on"]={src="nut.game.chara.Player:nut/game/chara/Player.nut",name="flag_on",nl=16,bytes="\xb7\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x04\x00\x00\x00\x00\x00\x00\x2a\x04\x04\x00\x00\x00\x00\x00\x20\x05\x06\x01\x02\x00\x00\x00\x33\x07\x00\x00\x04\x00\x00\x00\x1d\xff\x05\x03\xb9\x05\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x36\x04\x01\xff\x0f\x00\x00\x00\x12\x04\x00\x00\xbc\x05\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x29\x04\x00\x00\x03\x00\x00\x00\x12\x04\x00\x00\x02\x00\x00\x00\x30\x04\x00\x05\x1e\x00\x00\x00\x0b\x06\x00\x00\x04\x00\x00\x00\x1d\xff\x05\x02\xbd\x05\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x30\x04\x00\x05\x04\x00\x00\x00\x2a\x06\x00\x00\x01\x00\x00\x00\x19\x07\x00\x00\x05\x00\x00\x00\x11\x08\x00\x00\x04\x00\x00\x00\x1d\xff\x05\x04\xbf\x05\x00\x00\x00\x00\x00\x00\x25\x00\x00\x00\x1e\x00\x00\x00\x02\x00\x00\x00\x1e\x00\x00\x00\x06\x00\x00\x00\x36\x04\x01\xff\x07\x00\x00\x00\x12\x04\x00\x00\xc1\x05\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x2a\x04\x00\x00\x08\x00\x00\x00\x30\x04\x04\x05\x04\x00\x00\x00\x1d\xff\x05\x01\xc2\x05\x00\x00\x00\x00\x00\x00\x1c\x00\x00\x00\x1e\x00\x00\x00\x02\x00\x00\x00\x1e\x00\x00\x00\x09\x00\x00\x00\x36\x04\x01\xff\x07\x00\x00\x00\x12\x04\x00\x00\xc5\x05\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x2a\x04\x00\x00\x0a\x00\x00\x00\x30\x04\x04\x05\x04\x00\x00\x00\x1d\xff\x05\x01\xc6\x05\x00\x00\x00\x00\x00\x00\x13\x00\x00\x00\x1e\x00\x00\x00\x02\x00\x00\x00\x1e\x00\x00\x00\x0b\x00\x00\x00\x36\x04\x01\xff\x05\x00\x00\x00\x12\x04\x00\x00\xc8\x05\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x2a\x04\x00\x00\x0c\x00\x00\x00\x30\x04\x04\x05\x04\x00\x00\x00\x1d\xff\x05\x01\x02\x00\x00\x00\x1e\x00\x00\x00\x0d\x00\x00\x00\x36\x04\x01\xff\x01\x00\x00\x00\x12\x04\x00\x00\x02\x00\x00\x00\x1e\x00\x00\x00\x0e\x00\x00\x00\x36\x04\x01\xff\x06\x00\x00\x00\x12\x04\x00\x00\xcd\x05\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x2a\x04\x00\x00\x0f\x00\x00\x00\x30\x04\x04\x05\x04\x00\x00\x00\x1d\xff\x05\x01\xce\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x00\x00\x00\xd0\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\xff\x00\x00"},
  ["Player.rust"]={src="nut.game.chara.Player:nut/game/chara/Player.nut",name="rust",nl=20,bytes="\xb3\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2a\x02\x00\x00\x01\x00\x00\x00\x30\x02\x02\x03\x02\x00\x00\x00\x2a\x04\x00\x00\x02\x00\x00\x00\x1d\x02\x03\x02\xb4\x06\x00\x00\x00\x00\x00\x00\x3a\x00\x00\x00\x12\x02\x00\x00\xb7\x06\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x2a\x03\x02\x00\x04\x00\x00\x00\x2a\x03\x03\x00\x05\x00\x00\x00\x30\x03\x03\x04\x06\x00\x00\x00\x11\x05\x00\x00\x03\x00\x00\x00\x1d\x03\x04\x02\x00\x00\x00\x00\x0b\x04\x00\x00\x0c\x00\x00\x00\x08\x04\x03\x02\xb9\x06\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x30\x03\x01\x04\x08\x00\x00\x00\x25\x05\x06\x09\x06\x00\x00\x00\x14\x06\x00\x07\x02\x00\x00\x00\x33\x08\x00\x00\x0a\x00\x00\x00\x30\x09\x00\x0a\x0b\x00\x00\x00\x11\x0b\x00\x00\x09\x00\x00\x00\x1d\x09\x0a\x02\x06\x00\x00\x00\x1d\x06\x07\x03\x03\x00\x00\x00\x1d\xff\x04\x03\xba\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\xff\x03\x00\xbd\x06\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x2a\x03\x02\x00\x0d\x00\x00\x00\x30\x03\x03\x04\x06\x00\x00\x00\x11\x05\x00\x00\x03\x00\x00\x00\x1d\x03\x04\x02\x06\x00\x00\x00\x12\x03\x00\x00\xbf\x06\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x30\x03\x01\x04\x0e\x00\x00\x00\x11\x05\x00\x00\x03\x00\x00\x00\x1d\xff\x04\x02\xc0\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\xff\x03\x00\xc3\x06\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x2a\x03\x02\x00\x0f\x00\x00\x00\x2a\x03\x03\x00\x10\x00\x00\x00\x2a\x04\x02\x00\x04\x00\x00\x00\x03\x03\x03\x00\x00\x00\x00\x00\x0b\x04\x00\x00\x0e\x00\x00\x00\x08\x04\x03\x00\xc5\x06\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x11\x03\x00\x00\x01\x00\x00\x00\x0b\x04\x00\x00\x04\x00\x02\x00\x35\x03\x03\x2d\xc6\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2a\x03\x00\x00\x11\x00\x00\x00\x30\x03\x03\x04\x02\x00\x00\x00\x2a\x05\x00\x00\x03\x00\x00\x00\x1d\xff\x04\x02\xc7\x06\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x30\x03\x01\x04\x12\x00\x00\x00\x11\x05\x00\x00\x03\x00\x00\x00\x1d\xff\x04\x02\x04\x00\x00\x00\x1e\x00\x00\x00\xcc\x06\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x30\x03\x01\x04\x13\x00\x00\x00\x11\x05\x00\x00\x03\x00\x00\x00\x1d\xff\x04\x02\x04\x00\x00\x00\x1e\x00\x00\x00\xd2\x06\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x30\x03\x01\x04\x13\x00\x00\x00\x11\x05\x00\x00\x03\x00\x00\x00\x1d\xff\x04\x02\xd4\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\xff\x00\x00"},
  ["Player.exec_dead"]={src="nut.game.chara.Player:nut/game/chara/Player.nut",name="exec_dead",nl=1,bytes="\x97\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x03\x00\x00\x00\x00\x00\x00\x2a\x03\x03\x00\x00\x00\x00\x00\x20\x04\x05\x01\x3c\x00\x00\x00\x0b\x06\x00\x00\x03\x00\x00\x00\x1d\xff\x04\x03\x98\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\xff\x00\x00"},
  ["Player.exec_dead_no_after_wait"]={src="nut.game.chara.Player:nut/game/chara/Player.nut",name="exec_dead_no_after_wait",nl=1,bytes="\x9b\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x03\x00\x00\x00\x00\x00\x00\x2a\x03\x03\x00\x00\x00\x00\x00\x20\x04\x05\x01\x3c\x00\x00\x00\x0b\x06\x00\x00\x03\x00\x00\x00\x1d\xff\x04\x03\x9c\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\xff\x00\x00"},
  ["Player.turn"]={src="nut.game.chara.Player:nut/game/chara/Player.nut",name="turn",nl=49,bytes="\x3a\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x30\x02\x00\x03\x02\x00\x00\x00\x1d\x02\x03\x01\x01\x00\x00\x00\x12\x02\x00\x00\x00\x00\x00\x00\x06\xff\x02\x00\x3c\x02\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x30\x02\x00\x03\x02\x00\x00\x00\x1d\xff\x03\x01\x3f\x02\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x30\x02\x00\x03\x02\x00\x00\x00\x1d\x02\x03\x01\x16\x00\x00\x00\x12\x02\x00\x00\x42\x02\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x30\x02\x00\x03\x02\x00\x00\x00\x1d\x02\x03\x01\x02\x00\x00\x00\x29\x02\x00\x00\x09\x00\x00\x00\x12\x02\x00\x00\x44\x02\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x30\x02\x00\x03\x05\x00\x00\x00\x11\x04\x00\x00\x02\x00\x00\x00\x1d\xff\x03\x02\x45\x02\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x30\x02\x00\x03\x01\x00\x00\x00\x19\x04\x00\x00\x02\x00\x00\x00\x1d\xff\x03\x02\x08\x00\x00\x00\x1e\x00\x00\x00\x4a\x02\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x30\x02\x00\x03\x08\x00\x00\x00\x11\x04\x00\x00\x02\x00\x00\x00\x1d\xff\x03\x02\x4b\x02\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x30\x02\x00\x03\x09\x00\x00\x00\x11\x04\x00\x00\x02\x00\x00\x00\x1d\xff\x03\x02\x50\x02\x00\x00\x00\x00\x00\x00\x0a\x00\x00\x00\x30\x02\x00\x03\x0b\x00\x00\x00\x11\x04\x00\x00\x02\x00\x00\x00\x1d\x02\x03\x02\x02\x00\x00\x00\x0b\x03\x00\x00\x03\x00\x00\x00\x36\x02\x02\x00\x09\x00\x00\x00\x12\x02\x00\x00\x52\x02\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x2a\x02\x00\x00\x0d\x00\x00\x00\x30\x02\x02\x03\x00\x00\x00\x00\x3b\x04\x00\x00\x02\x00\x00\x00\x1d\xff\x03\x02\x53\x02\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x30\x02\x00\x03\x0e\x00\x00\x00\x11\x04\x00\x00\x02\x00\x00\x00\x1d\xff\x03\x02\x57\x02\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00\x30\x02\x00\x03\x02\x00\x00\x00\x1d\xff\x03\x01\x5a\x02\x00\x00\x00\x00\x00\x00\x0a\x00\x00\x00\x30\x02\x00\x03\x10\x00\x00\x00\x11\x04\x00\x00\x02\x00\x00\x00\x1d\x02\x03\x02\x02\x00\x00\x00\x0b\x03\x00\x00\x03\x00\x00\x00\x36\x02\x02\x00\x07\x00\x00\x00\x12\x02\x00\x00\x5c\x02\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x30\x02\x00\x03\x11\x00\x00\x00\x11\x04\x00\x00\x02\x00\x00\x00\x1d\xff\x03\x02\x5e\x02\x00\x00\x00\x00\x00\x00\x12\x00\x00\x00\x30\x02\x00\x03\x02\x00\x00\x00\x1d\xff\x03\x01\x62\x02\x00\x00\x00\x00\x00\x00\x0a\x00\x00\x00\x30\x02\x00\x03\x13\x00\x00\x00\x11\x04\x00\x00\x02\x00\x00\x00\x1d\x02\x03\x02\x02\x00\x00\x00\x0b\x03\x00\x00\x03\x00\x00\x00\x36\x02\x02\x00\x04\x00\x00\x00\x12\x02\x00\x00\x64\x02\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x30\x02\x00\x03\x14\x00\x00\x00\x11\x04\x00\x00\x02\x00\x00\x00\x1d\xff\x03\x02\x68\x02\x00\x00\x00\x00\x00\x00\x0a\x00\x00\x00\x30\x02\x00\x03\x15\x00\x00\x00\x11\x04\x00\x00\x02\x00\x00\x00\x1d\x02\x03\x02\x01\x00\x00\x00\x0b\x03\x00\x00\x03\x00\x00\x00\x36\x03\x02\x00\x09\x00\x00\x00\x12\x03\x00\x00\x6b\x02\x00\x00\x00\x00\x00\x00\x16\x00\x00\x00\x30\x03\x00\x04\x17\x00\x00\x00\x2a\x05\x00\x00\x18\x00\x00\x00\x2a\x05\x05\x00\x01\x00\x00\x00\x3b\x06\x00\x00\x03\x00\x00\x00\x1d\xff\x04\x03\x6c\x02\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x1e\x00\x00\x00\x03\x00\x00\x00\x1e\x00\x00\x00\x02\x00\x00\x00\x0b\x03\x00\x00\x03\x00\x00\x00\x36\x03\x02\x00\x0c\x00\x00\x00\x12\x03\x00\x00\x6e\x02\x00\x00\x00\x00\x00\x00\x16\x00\x00\x00\x30\x03\x00\x04\x17\x00\x00\x00\x2a\x05\x00\x00\x18\x00\x00\x00\x2a\x05\x05\x00\x00\x00\x00\x00\x3b\x06\x00\x00\x03\x00\x00\x00\x1d\xff\x04\x03\x6f\x02\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x30\x03\x00\x04\x19\x00\x00\x00\x11\x05\x00\x00\x03\x00\x00\x00\x1d\xff\x04\x02\x70\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x74\x02\x00\x00\x00\x00\x00\x00\x0a\x00\x00\x00\x30\x02\x00\x03\x1a\x00\x00\x00\x11\x04\x00\x00\x02\x00\x00\x00\x1d\x02\x03\x02\x02\x00\x00\x00\x0b\x03\x00\x00\x03\x00\x00\x00\x36\x02\x02\x00\x04\x00\x00\x00\x12\x02\x00\x00\x76\x02\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x30\x02\x00\x03\x1b\x00\x00\x00\x11\x04\x00\x00\x02\x00\x00\x00\x1d\xff\x03\x02\x7a\x02\x00\x00\x00\x00\x00\x00\x1c\x00\x00\x00\x30\x02\x00\x03\x1d\x00\x00\x00\x11\x04\x00\x00\x02\x00\x00\x00\x1d\x02\x03\x02\x7b\x02\x00\x00\x00\x00\x00\x00\x1c\x00\x00\x00\x30\x03\x00\x04\x1e\x00\x00\x00\x11\x05\x00\x00\x03\x00\x00\x00\x1d\x03\x04\x02\x7c\x02\x00\x00\x00\x00\x00\x00\x1f\x00\x00\x00\x30\x04\x00\x05\x04\x00\x00\x00\x1d\x04\x05\x01\x7e\x02\x00\x00\x00\x00\x00\x00\x1c\x00\x00\x00\x30\x05\x00\x06\x20\x00\x00\x00\x11\x07\x00\x00\x05\x00\x00\x00\x1d\x05\x06\x02\x7f\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x06\x00\x00\x06\x00\x00\x00\x13\x06\x05\x00\x15\x00\x00\x00\x12\x06\x00\x00\x81\x02\x00\x00\x00\x00\x00\x00\x00\x00\x16\x43\x26\x06\x00\x00\x06\x00\x00\x00\x04\x06\x02\x00\x06\x00\x00\x00\x03\x03\x03\x00\x82\x02\x00\x00\x00\x00\x00\x00\x00\x00\x80\x3f\x26\x06\x00\x00\x09\x00\x00\x00\x08\x06\x03\x00\x84\x02\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x08\x02\x04\x03\x86\x02\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x06\x00\x00\x06\x00\x00\x00\x03\x04\x04\x00\x88\x02\x00\x00\x00\x00\x00\x00\x00\x00\x80\x3f\x26\x06\x00\x00\x06\x00\x00\x00\x37\x03\x03\x00\xf5\xff\xff\xff\x1e\x00\x00\x00\x8a\x02\x00\x00\x00\x00\x00\x00\x21\x00\x00\x00\x30\x06\x00\x07\x1e\x00\x00\x00\x11\x08\x00\x00\x03\x00\x00\x00\x33\x09\x00\x00\x06\x00\x00\x00\x1d\xff\x07\x03\x8e\x02\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x0b\x06\x00\x00\x8f\x02\x00\x00\x00\x00\x00\x00\x22\x00\x00\x00\x30\x07\x00\x08\x23\x00\x00\x00\x11\x09\x00\x00\x07\x00\x00\x00\x1d\x07\x08\x02\x02\x00\x00\x00\x12\x07\x00\x00\x01\x00\x00\x00\x0b\x07\x00\x00\x07\x00\x00\x00\x2e\x06\x06\x05\x90\x02\x00\x00\x00\x00\x00\x00\x22\x00\x00\x00\x30\x07\x00\x08\x24\x00\x00\x00\x11\x09\x00\x00\x07\x00\x00\x00\x1d\x07\x08\x02\x02\x00\x00\x00\x12\x07\x00\x00\x01\x00\x00\x00\x0b\x07\x00\x00\x07\x00\x00\x00\x2e\x06\x06\x04\x91\x02\x00\x00\x00\x00\x00\x00\x22\x00\x00\x00\x30\x07\x00\x08\x25\x00\x00\x00\x11\x09\x00\x00\x07\x00\x00\x00\x1d\x07\x08\x02\x01\x00\x00\x00\x12\x07\x00\x00\x00\x00\x00\x00\x0b\x06\x00\x00\x92\x02\x00\x00\x00\x00\x00\x00\x22\x00\x00\x00\x30\x07\x00\x08\x26\x00\x00\x00\x11\x09\x00\x00\x07\x00\x00\x00\x1d\x07\x08\x02\x01\x00\x00\x00\x12\x07\x00\x00\x00\x00\x00\x00\x0b\x06\x00\x00\x94\x02\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x37\x07\x05\x00\x95\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x08\x00\x00\x01\x00\x00\x00\x08\x08\x07\x03\x00\x00\x00\x00\x0b\x07\x00\x00\x96\x02\x00\x00\x00\x00\x00\x00\x21\x00\x00\x00\x30\x08\x00\x09\x20\x00\x00\x00\x11\x0a\x00\x00\x07\x00\x00\x00\x33\x0b\x00\x00\x08\x00\x00\x00\x1d\xff\x09\x03\x98\x02\x00\x00\x00\x00\x00\x00\x8e\x01\x00\x00\x0b\x08\x00\x00\x08\x00\x00\x00\x32\x08\x07\x04\x03\x00\x00\x00\x17\x08\x08\x00\x8e\x01\x00\x00\x0b\x09\x00\x00\x05\x00\x00\x00\x32\x09\x09\x03\x09\x00\x00\x00\x33\x08\x00\x00\x06\x00\x00\x00\x12\x08\x00\x00\x04\x00\x00\x00\x30\x08\x00\x09\x27\x00\x00\x00\x11\x0a\x00\x00\x08\x00\x00\x00\x1d\xff\x09\x02\x28\x00\x00\x00\x30\x08\x00\x09\x01\x00\x00\x00\x20\x0a\x0b\x00\x08\x00\x00\x00\x1d\xff\x09\x03\x99\x02\x00\x00\x00\x00\x00\x00\xc6\x00\x00\x00\x0b\x08\x00\x00\x08\x00\x00\x00\x32\x08\x07\x04\x03\x00\x00\x00\x17\x08\x08\x00\xc6\x00\x00\x00\x0b\x09\x00\x00\x05\x00\x00\x00\x32\x09\x09\x03\x09\x00\x00\x00\x33\x08\x00\x00\x06\x00\x00\x00\x12\x08\x00\x00\x04\x00\x00\x00\x30\x08\x00\x09\x29\x00\x00\x00\x11\x0a\x00\x00\x08\x00\x00\x00\x1d\xff\x09\x02\x28\x00\x00\x00\x30\x08\x00\x09\x01\x00\x00\x00\x20\x0a\x0b\x00\x08\x00\x00\x00\x1d\xff\x09\x03\x9a\x02\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x0b\x08\x00\x00\x08\x00\x00\x00\x32\x08\x07\x04\x03\x00\x00\x00\x17\x08\x08\x00\x06\x00\x00\x00\x0b\x09\x00\x00\x05\x00\x00\x00\x32\x09\x09\x03\x09\x00\x00\x00\x33\x08\x00\x00\x06\x00\x00\x00\x12\x08\x00\x00\x04\x00\x00\x00\x30\x08\x00\x09\x2a\x00\x00\x00\x11\x0a\x00\x00\x08\x00\x00\x00\x1d\xff\x09\x02\x28\x00\x00\x00\x30\x08\x00\x09\x01\x00\x00\x00\x20\x0a\x0b\x00\x08\x00\x00\x00\x1d\xff\x09\x03\x9b\x02\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x0b\x08\x00\x00\x08\x00\x00\x00\x32\x08\x07\x04\x03\x00\x00\x00\x17\x08\x08\x00\x04\x00\x00\x00\x0b\x09\x00\x00\x05\x00\x00\x00\x32\x09\x09\x03\x09\x00\x00\x00\x33\x08\x00\x00\x06\x00\x00\x00\x12\x08\x00\x00\x04\x00\x00\x00\x30\x08\x00\x09\x2b\x00\x00\x00\x11\x0a\x00\x00\x08\x00\x00\x00\x1d\xff\x09\x02\x28\x00\x00\x00\x30\x08\x00\x09\x01\x00\x00\x00\x20\x0a\x0b\x00\x08\x00\x00\x00\x1d\xff\x09\x03\x9c\x02\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x0b\x08\x00\x00\x08\x00\x00\x00\x32\x08\x07\x04\x03\x00\x00\x00\x17\x08\x08\x00\x02\x00\x00\x00\x0b\x09\x00\x00\x05\x00\x00\x00\x32\x09\x09\x03\x09\x00\x00\x00\x33\x08\x00\x00\x06\x00\x00\x00\x12\x08\x00\x00\x04\x00\x00\x00\x30\x08\x00\x09\x2c\x00\x00\x00\x11\x0a\x00\x00\x08\x00\x00\x00\x1d\xff\x09\x02\x28\x00\x00\x00\x30\x08\x00\x09\x01\x00\x00\x00\x20\x0a\x0b\x00\x08\x00\x00\x00\x1d\xff\x09\x03\x9e\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x08\x00\x00\x08\x00\x00\x00\x36\x08\x05\x00\x10\x00\x00\x00\x12\x08\x00\x00\xa0\x02\x00\x00\x00\x00\x00\x00\x28\x00\x00\x00\x30\x08\x00\x09\x01\x00\x00\x00\x20\x0a\x0b\x00\x08\x00\x00\x00\x1d\xff\x09\x03\xa1\x02\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x08\x00\x00\x08\x00\x00\x00\x37\x04\x04\x00\xa2\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x08\x00\x00\x06\x00\x00\x00\x08\x08\x04\x04\xa5\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x04\x00\x00\xa6\x02\x00\x00\x00\x00\x00\x00\x2d\x00\x00\x00\x30\x08\x00\x09\x2e\x00\x00\x00\x2a\x0a\x00\x00\x08\x00\x00\x00\x1d\xff\x09\x02\xaa\x02\x00\x00\x00\x00\x00\x00\x2f\x00\x00\x00\x30\x08\x00\x09\x04\x00\x00\x00\x33\x0a\x00\x00\x08\x00\x00\x00\x1d\xff\x09\x02\xac\x02\x00\x00\x00\x00\x00\x00\x30\x00\x00\x00\x11\x08\x00\x00\x00\x00\x00\x00\x2c\x08\x08\x01\xad\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\xff\x00\x00"},
  ["Player.item_use_affect"]={src="nut.game.chara.Player:nut/game/chara/Player.nut",name="item_use_affect",nl=17,bytes="\x04\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2a\x02\x00\x00\x01\x00\x00\x00\x30\x02\x02\x03\x01\x00\x00\x00\x33\x04\x00\x00\x02\x00\x00\x00\x1d\x02\x03\x02\x07\x04\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x30\x03\x00\x04\x03\x00\x00\x00\x25\x05\x06\x04\x02\x00\x00\x00\x1b\x06\x06\x00\x03\x00\x00\x00\x1d\xff\x04\x03\x0a\x04\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x2a\x03\x02\x00\x0b\x04\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x30\x04\x00\x05\x07\x00\x00\x00\x2a\x06\x03\x00\x00\x00\x00\x00\x20\x07\x08\x00\x08\x00\x00\x00\x2a\x09\x00\x00\x04\x00\x00\x00\x1d\x04\x05\x05\x0e\x04\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x2a\x05\x02\x00\x09\x00\x00\x00\x2a\x06\x00\x00\x06\x00\x00\x00\x36\x05\x05\x00\x0d\x00\x00\x00\x12\x05\x00\x00\x12\x04\x00\x00\x00\x00\x00\x00\x0a\x00\x00\x00\x30\x05\x00\x06\x05\x00\x00\x00\x1d\xff\x06\x01\x13\x04\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x30\x05\x00\x06\x0c\x00\x00\x00\x25\x07\x08\x0d\x02\x00\x00\x00\x1b\x08\x08\x00\x05\x00\x00\x00\x1d\xff\x06\x03\x14\x04\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x2a\x05\x00\x00\x0e\x00\x00\x00\x30\x05\x05\x06\x01\x00\x00\x00\x3b\x07\x00\x00\x05\x00\x00\x00\x1d\xff\x06\x02\x18\x04\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00\x11\x05\x00\x00\x01\x00\x00\x00\x0b\x06\x00\x00\x06\x00\x02\x00\x35\x05\x05\x2d\x19\x04\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00\x2a\x05\x02\x00\x00\x00\x00\x00\x0b\x06\x00\x00\x06\x00\x00\x00\x36\x05\x05\x00\x04\x00\x00\x00\x12\x05\x00\x00\x00\x00\x00\x00\x2a\x05\x00\x00\x10\x00\x00\x00\x30\x05\x05\x06\x01\x00\x00\x00\x33\x07\x00\x00\x05\x00\x00\x00\x1d\xff\x06\x02\x1c\x04\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x3b\x05\x00\x00\x05\x00\x00\x00\x06\x01\x05\x00\x1d\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\xff\x00\x00"},
  ["Player.item_use_for"]={src="nut.game.chara.Player:nut/game/chara/Player.nut",name="item_use_for",nl=28,bytes="\x22\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2a\x02\x00\x00\x01\x00\x00\x00\x30\x02\x02\x03\x02\x00\x00\x00\x25\x04\x05\x03\x00\x00\x00\x00\x1b\x05\x05\x00\x01\x00\x00\x00\x33\x06\x00\x00\x02\x00\x00\x00\x1d\xff\x03\x04\x24\x04\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x30\x02\x00\x03\x02\x00\x00\x00\x1d\xff\x03\x01\x26\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2a\x02\x00\x00\x05\x00\x00\x00\x30\x02\x02\x03\x02\x00\x00\x00\x1d\x02\x03\x01\x06\x00\x00\x00\x30\x02\x02\x03\x02\x00\x00\x00\x1d\xff\x03\x01\x28\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2a\x02\x00\x00\x07\x00\x00\x00\x30\x02\x02\x03\x03\x00\x00\x00\x2a\x04\x00\x00\x02\x00\x00\x00\x1d\x02\x03\x02\x29\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2a\x03\x00\x00\x07\x00\x00\x00\x30\x03\x03\x04\x01\x00\x00\x00\x33\x05\x00\x00\x03\x00\x00\x00\x1d\x03\x04\x02\x2a\x04\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x30\x04\x00\x05\x09\x00\x00\x00\x2a\x06\x02\x00\x04\x00\x00\x00\x1d\x04\x05\x02\x2b\x04\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x30\x05\x00\x06\x09\x00\x00\x00\x2a\x07\x03\x00\x05\x00\x00\x00\x1d\x05\x06\x02\x2d\x04\x00\x00\x00\x00\x00\x00\x0a\x00\x00\x00\x2a\x06\x04\x00\x0b\x00\x00\x00\x2a\x07\x00\x00\x07\x00\x00\x00\x36\x07\x06\x00\x29\x00\x00\x00\x12\x07\x00\x00\x30\x04\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x30\x07\x00\x08\x0d\x00\x00\x00\x11\x09\x00\x00\x07\x00\x00\x00\x1d\x07\x08\x02\x07\x00\x00\x00\x12\x07\x00\x00\x32\x04\x00\x00\x00\x00\x00\x00\x0e\x00\x00\x00\x30\x07\x00\x08\x0f\x00\x00\x00\x11\x09\x00\x00\x07\x00\x00\x00\x1d\xff\x08\x02\x33\x04\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x3b\x07\x00\x00\x07\x00\x00\x00\x06\x01\x07\x00\x36\x04\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x30\x07\x00\x08\x11\x00\x00\x00\x2a\x09\x04\x00\x10\x04\x00\x00\x0b\x0a\x00\x00\x07\x00\x00\x00\x1d\xff\x08\x03\x38\x04\x00\x00\x00\x00\x00\x00\x12\x00\x00\x00\x30\x07\x00\x08\x13\x00\x00\x00\x11\x09\x00\x00\x02\x00\x00\x00\x33\x0a\x00\x00\x07\x00\x00\x00\x1d\xff\x08\x03\x3a\x04\x00\x00\x00\x00\x00\x00\x14\x00\x00\x00\x30\x07\x00\x08\x15\x00\x00\x00\x2a\x09\x04\x00\x03\x00\x00\x00\x2a\x0a\x00\x00\x01\x00\x00\x00\x33\x0b\x00\x00\x00\x00\x00\x00\x2a\x0c\x00\x00\x00\x00\x00\x00\x33\x0d\x00\x00\x07\x00\x00\x00\x1d\x07\x08\x06\x07\x00\x00\x00\x29\x07\x00\x00\x07\x00\x00\x00\x12\x07\x00\x00\x3c\x04\x00\x00\x00\x00\x00\x00\x16\x00\x00\x00\x30\x07\x00\x08\x17\x00\x00\x00\x11\x09\x00\x00\x01\x00\x00\x00\x16\x0a\x00\x01\x09\x00\x00\x00\x2a\x0b\x03\x00\x0b\x00\x00\x00\x09\x0a\x00\x00\x07\x00\x00\x00\x1d\xff\x08\x03\x3e\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x42\x04\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x11\x06\x00\x00\x01\x00\x00\x00\x0b\x07\x00\x00\x07\x00\x02\x00\x35\x06\x06\x2d\x43\x04\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x2a\x06\x02\x00\x00\x00\x00\x00\x0b\x07\x00\x00\x07\x00\x00\x00\x36\x06\x06\x00\x04\x00\x00\x00\x12\x06\x00\x00\x00\x00\x00\x00\x2a\x06\x00\x00\x19\x00\x00\x00\x30\x06\x06\x07\x03\x00\x00\x00\x2a\x08\x00\x00\x06\x00\x00\x00\x1d\xff\x07\x02\x45\x04\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x2a\x06\x00\x00\x1b\x00\x00\x00\x30\x06\x06\x07\x06\x00\x00\x00\x1d\xff\x07\x01\x48\x04\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x3b\x06\x00\x00\x06\x00\x00\x00\x06\x01\x06\x00\x49\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\xff\x00\x00"},
  ["Player.add_hand"]={src="nut.game.chara.Player:nut/game/chara/Player.nut",name="add_hand",nl=4,bytes="\x9c\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x30\x02\x00\x03\x01\x00\x00\x00\x11\x04\x00\x00\x02\x00\x00\x00\x16\x05\x00\x01\x02\x00\x00\x00\x30\x06\x01\x07\x06\x00\x00\x00\x1d\x06\x07\x01\x06\x00\x00\x00\x09\x05\x00\x00\x03\x00\x00\x00\x30\x06\x01\x07\x06\x00\x00\x00\x1d\x06\x07\x01\x06\x00\x00\x00\x09\x05\x00\x00\x02\x00\x00\x00\x1d\xff\x03\x03\x9d\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\xff\x00\x00"},
  ["Enemy.attack"]={src="nut.game.chara.Enemy:nut/game/chara/Enemy.nut",name="attack",nl=25,bytes="\x23\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x30\x03\x00\x04\x03\x00\x00\x00\x1d\x03\x04\x01\x02\x00\x00\x00\x12\x03\x00\x00\x01\x00\x00\x00\x0b\x03\x00\x00\x03\x00\x00\x00\x06\x01\x03\x00\x26\x07\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x12\x02\x00\x00\x02\x00\x00\x00\x33\x03\x00\x00\x03\x00\x00\x00\x1e\x00\x00\x00\x01\x00\x00\x00\x2a\x04\x00\x00\x02\x00\x00\x00\x2a\x04\x04\x00\x04\x00\x00\x00\x33\x03\x00\x00\x27\x07\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x2a\x04\x00\x00\x04\x00\x00\x00\x2a\x04\x04\x00\x2a\x07\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x2a\x05\x00\x00\x04\x00\x00\x00\x2a\x05\x05\x00\x05\x00\x00\x00\x2a\x05\x05\x00\x00\x00\x00\x00\x0b\x06\x00\x00\x06\x00\x00\x00\x36\x05\x05\x00\x06\x00\x00\x00\x07\x05\x05\x00\x03\x00\x00\x00\x2a\x06\x00\x00\x04\x00\x00\x00\x2a\x06\x06\x00\x05\x00\x00\x00\x2a\x06\x06\x00\x05\x00\x00\x00\x0b\x07\x00\x00\x07\x00\x00\x00\x36\x06\x06\x00\x06\x00\x00\x00\x33\x05\x00\x00\x14\x00\x00\x00\x17\x05\x05\x00\x06\x00\x00\x00\x30\x06\x00\x07\x06\x00\x00\x00\x1d\x06\x07\x01\x10\x00\x00\x00\x17\x06\x06\x00\x07\x00\x00\x00\x30\x07\x00\x08\x08\x00\x00\x00\x11\x09\x00\x00\x07\x00\x00\x00\x1d\x07\x08\x02\x07\x00\x00\x00\x29\x07\x00\x00\x0a\x00\x00\x00\x17\x07\x07\x00\x09\x00\x00\x00\x30\x08\x00\x09\x00\x01\x00\x00\x0b\x0a\x00\x00\x08\x00\x00\x00\x1d\x08\x09\x02\x0a\x00\x00\x00\x2a\x09\x04\x00\x09\x00\x00\x00\x32\x08\x08\x03\x03\x00\x00\x00\x07\x08\x08\x00\x0b\x00\x00\x00\x30\x09\x00\x0a\x09\x00\x00\x00\x1d\x09\x0a\x01\x09\x00\x00\x00\x33\x08\x00\x00\x08\x00\x00\x00\x33\x07\x00\x00\x07\x00\x00\x00\x33\x06\x00\x00\x06\x00\x00\x00\x33\x05\x00\x00\x09\x00\x00\x00\x12\x05\x00\x00\x2c\x07\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x30\x05\x00\x06\x03\x00\x00\x00\x20\x07\x08\x04\x01\x00\x00\x00\x33\x09\x00\x00\x05\x00\x00\x00\x1d\xff\x06\x04\x2d\x07\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x0b\x05\x00\x00\x05\x00\x00\x00\x06\x01\x05\x00\x3b\x00\x00\x00\x1e\x00\x00\x00\x30\x07\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x2a\x05\x04\x00\x05\x00\x00\x00\x0b\x06\x00\x00\x06\x00\x00\x00\x13\x05\x05\x00\x2b\x00\x00\x00\x12\x05\x00\x00\x32\x07\x00\x00\x00\x00\x00\x00\x0d\x00\x00\x00\x30\x05\x00\x06\x0e\x00\x00\x00\x2a\x07\x00\x00\x00\x00\x00\x00\x0b\x08\x00\x00\x01\x00\x00\x00\x33\x09\x00\x00\x05\x00\x00\x00\x1d\xff\x06\x04\x34\x07\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x30\x05\x00\x06\x40\x00\x00\x00\x0b\x07\x00\x00\x05\x00\x00\x00\x1d\x05\x06\x02\x0f\x00\x00\x00\x2a\x06\x00\x00\x0d\x00\x00\x00\x08\x06\x05\x02\x36\x07\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x30\x05\x00\x06\x00\x00\x00\x00\x20\x07\x08\x03\x05\x00\x00\x00\x1d\x05\x06\x03\x3c\x07\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x30\x06\x00\x07\x05\x00\x00\x00\x20\x08\x09\x03\x02\x00\x00\x00\x12\x02\x00\x00\x12\x00\x00\x00\x11\x0a\x00\x00\x01\x00\x00\x00\x1e\x00\x00\x00\x13\x00\x00\x00\x11\x0a\x00\x00\x06\x00\x00\x00\x1d\xff\x07\x04\x0b\x00\x00\x00\x1e\x00\x00\x00\x44\x07\x00\x00\x00\x00\x00\x00\x14\x00\x00\x00\x30\x05\x00\x06\x15\x00\x00\x00\x11\x07\x00\x00\x02\x00\x00\x00\x16\x08\x00\x01\x16\x00\x00\x00\x30\x09\x00\x0a\x09\x00\x00\x00\x1d\x09\x0a\x01\x09\x00\x00\x00\x09\x08\x00\x00\x16\x00\x00\x00\x30\x09\x03\x0a\x09\x00\x00\x00\x1d\x09\x0a\x01\x09\x00\x00\x00\x09\x08\x00\x00\x05\x00\x00\x00\x1d\xff\x06\x03\x48\x07\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x12\x02\x00\x00\x4a\x07\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00\x30\x05\x02\x06\x00\x00\x00\x00\x33\x07\x00\x00\x05\x00\x00\x00\x1d\xff\x06\x02\x0b\x00\x00\x00\x1e\x00\x00\x00\x50\x07\x00\x00\x00\x00\x00\x00\x14\x00\x00\x00\x30\x05\x00\x06\x18\x00\x00\x00\x11\x07\x00\x00\x01\x00\x00\x00\x16\x08\x00\x01\x16\x00\x00\x00\x30\x09\x00\x0a\x09\x00\x00\x00\x1d\x09\x0a\x01\x09\x00\x00\x00\x09\x08\x00\x00\x05\x00\x00\x00\x1d\xff\x06\x03\x51\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x05\x00\x00\x05\x00\x00\x00\x06\x01\x05\x00\x53\x07\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x05\x00\x00\x05\x00\x00\x00\x06\x01\x05\x00\x54\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\xff\x00\x00"},
  ["Enemy.special"]={src="nut.game.chara.Enemy:nut/game/chara/Enemy.nut",name="special",nl=27,bytes="\xdb\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16\x04\x00\x01\xdc\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2a\x05\x02\x00\x03\x00\x00\x00\x19\x06\x00\x00\x21\x00\x00\x00\x34\x05\x06\x00\x21\x00\x00\x00\x1c\x05\x06\x00\xde\x06\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x0e\x09\x00\x00\x01\x00\x00\x00\x36\x0a\x09\xff\x13\x00\x00\x00\x12\x0a\x00\x00\xe1\x06\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x30\x0a\x00\x0b\x03\x00\x00\x00\x30\x0c\x07\x0d\x0c\x00\x00\x00\x1d\x0c\x0d\x01\x0a\x00\x00\x00\x1d\x0a\x0b\x02\xe2\x06\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x30\x0b\x00\x0c\x0b\x00\x00\x00\x1d\x0b\x0c\x01\x03\x00\x00\x00\x12\x0b\x00\x00\xe4\x06\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x2a\x0b\x00\x00\x0b\x00\x00\x00\x33\x0a\x00\x00\xe6\x06\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x30\x0b\x04\x0c\x07\x00\x00\x00\x1b\x0d\x0a\x00\x0b\x00\x00\x00\x1d\xff\x0c\x02\xe7\x06\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x1e\x00\x00\x00\x02\x00\x00\x00\x1e\x00\x00\x00\x07\x00\x00\x00\x36\x0a\x09\xff\x06\x00\x00\x00\x12\x0a\x00\x00\xe9\x06\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x30\x0a\x04\x0b\x07\x00\x00\x00\x33\x0c\x00\x00\x0a\x00\x00\x00\x1d\xff\x0b\x02\xea\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x00\x00\x00\xde\xff\xff\xff\x1e\x00\x00\x00\xef\x06\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x30\x05\x04\x06\x05\x00\x00\x00\x1d\x05\x06\x01\x00\x00\x00\x00\x0b\x06\x00\x00\x06\x00\x00\x00\x32\x05\x05\x00\x0b\x00\x00\x00\x17\x05\x05\x00\x00\x00\x00\x00\x0b\x06\x00\x00\x04\x00\x00\x00\x1b\x06\x06\x00\x08\x00\x00\x00\x13\x06\x06\xff\x06\x00\x00\x00\x17\x06\x06\x00\x09\x00\x00\x00\x2a\x07\x02\x00\x03\x00\x00\x00\x30\x07\x07\x08\x07\x00\x00\x00\x1d\x07\x08\x01\x00\x00\x00\x00\x0b\x08\x00\x00\x08\x00\x00\x00\x32\x07\x07\x00\x07\x00\x00\x00\x33\x06\x00\x00\x06\x00\x00\x00\x33\x05\x00\x00\x08\x00\x00\x00\x12\x05\x00\x00\xf1\x06\x00\x00\x00\x00\x00\x00\x0a\x00\x00\x00\x30\x05\x00\x06\x09\x00\x00\x00\x2a\x07\x02\x00\x01\x00\x00\x00\x16\x08\x00\x01\x0b\x00\x00\x00\x30\x09\x00\x0a\x09\x00\x00\x00\x1d\x09\x0a\x01\x09\x00\x00\x00\x09\x08\x00\x00\x05\x00\x00\x00\x1d\xff\x06\x03\xf5\x06\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x30\x05\x00\x06\x00\x00\x00\x00\x33\x07\x00\x00\x05\x00\x00\x00\x1d\xff\x06\x02\xf6\x06\x00\x00\x00\x00\x00\x00\x0d\x00\x00\x00\x30\x05\x00\x06\x0e\x00\x00\x00\x2a\x07\x02\x00\x03\x00\x00\x00\x12\x07\x00\x00\x0f\x00\x00\x00\x2a\x08\x00\x00\x08\x00\x00\x00\x33\x07\x00\x00\x02\x00\x00\x00\x1e\x00\x00\x00\x10\x00\x00\x00\x2a\x08\x00\x00\x08\x00\x00\x00\x33\x07\x00\x00\x00\x00\x00\x00\x0b\x08\x00\x00\x03\x00\x00\x00\x33\x09\x00\x00\x05\x00\x00\x00\x1d\xff\x06\x04\xf7\x06\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x30\x05\x00\x06\x01\x00\x00\x00\x19\x07\x00\x00\x05\x00\x00\x00\x1d\xff\x06\x02\xfe\x06\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x11\x05\x00\x00\x01\x00\x00\x00\x3b\x06\x00\x00\x00\x00\x00\x00\x1a\xff\x05\x06\xff\x06\x00\x00\x00\x00\x00\x00\x12\x00\x00\x00\x30\x05\x00\x06\x04\x00\x00\x00\x20\x07\x08\x00\x01\x00\x00\x00\x33\x09\x00\x00\x13\x00\x00\x00\x2a\x0a\x00\x00\x05\x00\x00\x00\x1d\x05\x06\x05\x00\x07\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x11\x06\x00\x00\x00\x00\x00\x00\x3b\x07\x00\x00\x00\x00\x00\x00\x1a\xff\x06\x07\x09\x07\x00\x00\x00\x00\x00\x00\x14\x00\x00\x00\x30\x06\x05\x07\x15\x00\x00\x00\x11\x08\x00\x00\x06\x00\x00\x00\x1d\x06\x07\x02\x04\x00\x00\x00\x12\x06\x00\x00\x0b\x07\x00\x00\x00\x00\x00\x00\x16\x00\x00\x00\x30\x06\x00\x07\x00\x00\x00\x00\x33\x08\x00\x00\x06\x00\x00\x00\x1d\xff\x07\x02\x0e\x07\x00\x00\x00\x00\x00\x00\x14\x00\x00\x00\x30\x06\x05\x07\x17\x00\x00\x00\x11\x08\x00\x00\x06\x00\x00\x00\x1d\x06\x07\x02\x0a\x00\x00\x00\x12\x06\x00\x00\x11\x07\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x30\x06\x00\x07\x06\x00\x00\x00\x1d\xff\x07\x01\x12\x07\x00\x00\x00\x00\x00\x00\x19\x00\x00\x00\x30\x06\x00\x07\x17\x00\x00\x00\x2a\x08\x05\x00\x06\x00\x00\x00\x1d\xff\x07\x02\x13\x07\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x30\x06\x00\x07\x06\x00\x00\x00\x1d\xff\x07\x01\x1d\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\xff\x00\x00"},
  ["GameFloor.throw_item_one"]={src="nut.game.GameFloor:nut/game/GameFloor.nut",name="throw_item_one",nl=12,bytes="\x12\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2a\x07\x04\x00\x00\x00\x00\x00\x0b\x08\x00\x00\x28\x00\x00\x00\x08\x08\x07\x00\x14\x04\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x30\x07\x00\x08\x04\x00\x00\x00\x33\x09\x00\x00\x07\x00\x00\x00\x1d\x07\x08\x02\x15\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x08\x00\x00\x01\x00\x00\x00\x0b\x09\x00\x00\x09\x00\x04\x00\x35\x08\x08\x2d\x16\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x08\x00\x00\x01\x00\x00\x00\x0b\x09\x00\x00\x07\x00\x00\x00\x1a\xff\x08\x09\x18\x04\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x2a\x08\x07\x00\x03\x00\x00\x00\x2a\x08\x08\x00\x04\x00\x00\x00\x2a\x09\x00\x00\x09\x00\x00\x00\x36\x08\x08\x00\x0d\x00\x00\x00\x12\x08\x00\x00\x1a\x04\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x2a\x08\x07\x00\x06\x00\x00\x00\x30\x08\x08\x09\x07\x00\x00\x00\x11\x0a\x00\x00\x01\x00\x00\x00\x3b\x0b\x00\x00\x08\x00\x00\x00\x1d\xff\x09\x03\x1b\x04\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x2a\x08\x00\x00\x09\x00\x00\x00\x30\x08\x08\x09\x08\x00\x00\x00\x1d\x08\x09\x01\x0a\x00\x00\x00\x30\x08\x08\x09\xce\x04\x00\x00\x0b\x0a\x00\x00\x08\x00\x00\x00\x1d\xff\x09\x02\x1d\x04\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x30\x08\x00\x09\x01\x00\x00\x00\x20\x0a\x0b\x02\x03\x00\x00\x00\x20\x0c\x0d\x07\x05\x00\x00\x00\x20\x0e\x0f\x06\x08\x00\x00\x00\x1d\xff\x09\x07\x1e\x04\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x3b\x08\x00\x00\x08\x00\x00\x00\x06\x01\x08\x00\x20\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3b\x07\x00\x00\x07\x00\x00\x00\x06\x01\x07\x00\x21\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\xff\x00\x00"},
  ["battle_damage"]={src="nut.game.GameBattle:nut/game/GameBattle.nut",name="battle_damage",nl=18,bytes="\x45\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x30\x04\x02\x05\x04\x00\x00\x00\x1d\x04\x05\x01\x46\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x37\x04\x04\x00\x47\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x30\x05\x00\x06\x02\x00\x00\x00\x11\x07\x00\x00\x03\x00\x00\x00\x03\x07\x07\x00\x03\x00\x00\x00\x11\x08\x00\x00\x08\x00\x00\x00\x03\x07\x07\x00\x04\x00\x00\x00\x03\x07\x07\x00\x05\x00\x00\x00\x1d\xff\x06\x02\x54\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x2a\x05\x02\x00\x05\x00\x00\x00\x30\x05\x05\x06\x06\x00\x00\x00\x11\x07\x00\x00\x05\x00\x00\x00\x1d\x05\x06\x02\x02\x00\x00\x00\x12\x05\x00\x00\x55\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03\x04\x04\x00\x57\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x05\x00\x00\x35\x00\x00\x00\x08\x05\x04\x04\x59\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x04\x00\x00\x5a\x00\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x30\x05\x02\x06\x04\x00\x00\x00\x33\x07\x00\x00\x05\x00\x00\x00\x1d\xff\x06\x02\x5d\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x2a\x05\x00\x00\x05\x00\x00\x00\x0d\x05\x01\x00\x09\x00\x00\x00\x12\x05\x00\x00\x5f\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x30\x05\x02\x06\x0a\x00\x00\x00\x2a\x07\x00\x00\x0b\x00\x00\x00\x30\x08\x01\x09\x0c\x00\x00\x00\x11\x0a\x00\x00\x08\x00\x00\x00\x1d\x08\x09\x02\x08\x00\x00\x00\x03\x07\x07\x00\x05\x00\x00\x00\x1d\xff\x06\x02\x1f\x00\x00\x00\x1e\x00\x00\x00\x62\x00\x00\x00\x00\x00\x00\x00\x0d\x00\x00\x00\x2a\x05\x00\x00\x05\x00\x00\x00\x0d\x05\x01\x00\x09\x00\x00\x00\x12\x05\x00\x00\x64\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x30\x05\x02\x06\x0e\x00\x00\x00\x2a\x07\x00\x00\x0b\x00\x00\x00\x30\x08\x01\x09\x0f\x00\x00\x00\x11\x0a\x00\x00\x08\x00\x00\x00\x1d\x08\x09\x02\x08\x00\x00\x00\x37\x07\x07\x00\x05\x00\x00\x00\x1d\xff\x06\x02\x12\x00\x00\x00\x1e\x00\x00\x00\x67\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x2a\x05\x00\x00\x05\x00\x00\x00\x0d\x05\x01\x00\x0e\x00\x00\x00\x12\x05\x00\x00\x69\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x30\x05\x01\x06\x0c\x00\x00\x00\x11\x07\x00\x00\x05\x00\x00\x00\x1d\x05\x06\x02\x6a\x00\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x30\x06\x01\x07\x06\x00\x00\x00\x1d\x06\x07\x01\x02\x00\x00\x00\x12\x06\x00\x00\x64\x00\x00\x00\x0b\x06\x00\x00\x06\x00\x00\x00\x03\x05\x05\x00\x6b\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x30\x06\x02\x07\x05\x00\x00\x00\x33\x08\x00\x00\x06\x00\x00\x00\x1d\xff\x07\x02\x6d\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x3b\x05\x00\x00\x05\x00\x00\x00\x06\x01\x05\x00\x6f\x00\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x30\x05\x02\x06\x04\x00\x00\x00\x33\x07\x00\x00\x05\x00\x00\x00\x1d\xff\x06\x02\x70\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3b\x05\x00\x00\x05\x00\x00\x00\x06\x01\x05\x00\x71\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\xff\x00\x00"},
}

local catalog={{0,"Club","こん棒"},{1,"Gold Sword","金の剣"},{2,"Copper Sword","銅の剣"},{3,"Iron Axe","鉄の斧"},{4,"Dragonsbane","ドラゴンキラー"},{5,"Liquid Metal Sword","はぐれメタルの剣"},{6,"Abacus of Justice","正義のソロバン"},{7,"Leather Shield","皮の盾"},{8,"Bronze Shield","青銅の盾"},{9,"Scale Shield","うろこの盾"},{10,"Mirror Shield","みかがみの盾"},{11,"Steel Shield","鋼鉄の盾"},{12,"Dragon Shield","ドラゴンシールド"},{13,"Liquid Metal Shield","はぐれメタルの盾"},{14,"Strength Ring","ちからの指輪"},{15,"Antidote Ring","毒けしの指輪"},{16,"Sleepless Ring","眠らずの指輪"},{17,"Zoom Ring","ルーラの指輪"},{18,"No-Hunger Ring","ハラヘラズの指輪"},{19,"Thief Ring","とうぞくの指輪"},{20,"Beautiful Ring","きれいな指輪"},{21,"Shadow Ring","シャドーの指輪"},{22,"Hunger Ring","ハラペコの指輪"},{23,"Trap-Avoidance Ring","ワナ抜けの指輪"},{24,"Doll-Warding Ring","人形よけの指輪"},{25,"Wakefulness Ring","ザメハの指輪"},{26,"Wooden Arrow","木の矢"},{27,"Iron Arrow","鉄の矢"},{28,"Silver Arrow","銀の矢"},{29,"Bread","パン"},{30,"Large Bread","大きいパン"},{31,"Rotten Bread","くさったパン"},{32,"Medicinal Herb","薬草"},{33,"Strong Medicine","弟切草"},{34,"Antidotal Herb","毒けし草"},{35,"Seed of Strength","ちからの種"},{36,"Seed of Happiness","幸せの種"},{37,"Seed of Agility","すばやさの種"},{38,"Eyedrop Herb","目薬草"},{39,"Poison Herb","毒草"},{40,"Blinding Herb","目くらまし草"},{41,"Hallucination Herb","まどわし草"},{42,"Confusion Herb","メダパニ草"},{43,"Sleep Herb","ラリホー草"},{44,"Zoom Herb","ルーラ草"},{45,"Flame Herb","火炎草"},{46,"Oomph Scroll","バイキルトの巻物"},{47,"Buff Scroll","スカラの巻物"},{48,"Plating Scroll","メッキの巻物"},{49,"Uncurse Scroll","シャナクの巻物"},{50,"Identify Scroll","インパスの巻物"},{51,"Map-Reveal Scroll","レミーラの巻物"},{52,"Paralysis Scroll","かなしばりの巻物"},{53,"Sanctuary Scroll","聖域の巻物"},{54,"Final Scroll","さいごの巻物"},{55,"Proof Scroll","証明の巻物"},{56,"Item-Reveal Scroll","千里眼の巻物"},{57,"Enemy-Reveal Scroll","地獄耳の巻物"},{58,"Bread Scroll","パンの巻物"},{59,"Prayer Scroll","祈りの巻物"},{60,"Bang Scroll","イオの巻物"},{61,"Silence Scroll","くちなしの巻物"},{62,"Sands of Time Scroll","時の砂の巻物"},{63,"Trap Scroll","ワナの巻物"},{64,"Hocus-Pocus Scroll","パルプンテの巻物"},{65,"Evac Scroll","リレミトの巻物"},{66,"Lightning Staff","いかずちの杖"},{67,"Slow Staff","ボミオスの杖"},{68,"Sleep Staff","ラリホーの杖"},{69,"Confusion Staff","メダパニの杖"},{70,"Sealing Staff","封印の杖"},{71,"Banishment Staff","バシルーラの杖"},{72,"Transformation Staff","変化の杖"},{73,"Acceleration Staff","ピオリムの杖"},{74,"Invisibility Staff","レムオルの杖"},{75,"Surefooted Staff","転ばぬ先の杖"},{76,"Splitting Staff","分裂の杖"},{77,"Whack Staff","ザキの杖"},{78,"Double-Edged Staff","もろ刃の杖"},{79,"Great-Loss Staff","大損の杖"},{80,"Gold","ゴールド"},{81,"Iron Safe","鉄の金庫"},{82,"King's Jewel Box","王様の宝石箱"},{83,"Box of Happiness","しあわせの箱"},{84,"Strange Box","奇妙な箱"}}

-- record ID -&gt; snapshot key (value shown after the name)
B.PARAM_IDS = {[404]='DUNGEON'}
-- feature key -&gt; record ID (bridge toggles)
B.TOGGLE_IDS = {hp=101,food=102,strength=103,status=104,trap=105,attack=106,heal=107,rust=108,speed=109,
                consume=305,baikiruto=302,sukara=303,map=405,items=406,enemies=407}


local T = TCT.T
local function rec(id) return getAddressList().getMemoryRecordByID(id) end

function B.requireConnection()
  if B.restorePending then TCT.err("Run [ATTACH / ALL OFF] again to finish restoration.","【アタッチ／一括解除】で復元を再試行してください。") end
  if not B.connected then B.start() end
end
function B.request(command,...)
  B.requireConnection()
  if B.busy then TCT.err('A command is still running.','前の処理が実行中です。') end
  B.busy=true
  local e,args=B.engine,{...}
  local ok,result=pcall(function()
    if command=='toggle' then
      e:toggle(args[1],args[2]=='1')
    elseif command=='dungeon' or command=='evac' then return e[command](e,table.unpack(args))
    elseif command=='set' or command=='identify' or command=='plate' or command=='uncurse' or command=='addItems' or command=='count' then
      return e[command](e,table.unpack(args))
    else error('Unknown CT command: '..tostring(command),0) end
    return 'OK'
  end)
  B.busy=false
  if not ok then B.lastError=tostring(result);error(result,0) end
  B.refreshDescriptions()
  return result
end

function B.refreshDescriptions()
  for id,key in pairs(B.PARAM_IDS) do
    local value=B.connected and B.values[key] or '--'
    if key=='DUNGEON' and B.connected then
      local names={['0']=T('Little Mystery Dungeon','ちょっと不思議のダンジョン'),['1']=T('Mystery Dungeon','不思議のダンジョン'),['2']=T('More Mystery Dungeon','もっと不思議のダンジョン')}
      value=names[value] or (T('Dungeon ID ','ダンジョンID ')..tostring(value))
    end
    TCT.suffix[id]=tostring(value or '--')
  end
  TCT.applyLang()
end

-- timer task of feature "bridge" (every TCT.TICK_MS while connected)
function B.heartbeat()
  if not B.connected or B.busy or B.closing or B.restorePending then return end
  B.busy=true
  local ok,err=pcall(function()
    B.engine:keepStatus()
    local now=getTickCount()
    if not B.lastSnapshot or now-B.lastSnapshot&gt;=2000 then
      B.values=B.engine:snapshot()
      B.lastSnapshot=now
      B.refreshDescriptions()
    end
  end)
  B.busy=false
  if not ok then B.lastError=tostring(err) end
end

function B.start()
  if B.connected then return end
  TCT.require()
  assert(TCT.checkBuild(),'This table supports the verified Ver.1.2.0 executable')
  local path
  for _,module in ipairs(enumModules()) do
    if module.Name:lower()==TCT.EXE:lower() then path=module.PathToFile;break end
  end
  assert(path and (md5file(path) or ''):lower()=='3caee5b2f278dda0d7e65e06be97f599','Executable does not match the verified build')
  Transport.cleanup()
  B.engine=Engine.new(Transport,Compiler,lower,bytecode,TCT.mod())
  B.connected=true
  B.pid=getOpenedProcessID()
  B.lastSnapshot=nil
  local ok,result=pcall(B.engine.snapshot,B.engine)
  if ok then B.values=result else B.lastError=tostring(result) end
  B.refreshDescriptions()
end

function B.stop()
  if not B.connected then Transport.cleanup();return end
  if B.busy then error('A command is still running',0) end
  B.closing=true
  local ok,err=true,nil
  if getProcessIDFromProcessName(TCT.EXE)==B.pid then ok,err=pcall(B.engine.close,B.engine) end
  if not ok then
    B.closing=false
    B.restorePending=true
    B.lastError=tostring(err)
    error(TCT.T('Restore incomplete. Run [ATTACH / ALL OFF] again: ',
                '復元が未完了です。【アタッチ／一括解除】で再試行してください：')..B.lastError,0)
  end
  B.connected=false
  B.engine=nil
  B.restorePending=false
  for _,id in pairs(B.TOGGLE_IDS) do
    local row=rec(id)
    if row and row.Active then row.Active=false end
  end
  B.closing=false
  TCT.closeAllEditors()
  B.values={}
  B.refreshDescriptions()
end

function B.toggle(key,on)
  if B.closing then return end
  if not on and not B.connected then return end
  B.request('toggle',key,on and '1' or '0')
end

TCT.ACTIONS={
  identify=function() return B.request('identify') end,
  plate=function() return B.request('plate') end,
  uncurse=function() return B.request('uncurse') end,
  evac=function() return B.request('evac') end,
  achievements=function() TCT.unlockSteamAchievements() end
}
function TCT.action(key)
  local result=assert(TCT.ACTIONS[key],'Unknown action')()
  if result then print('[TCT] '..tostring(result)) end
  return result
end
for id in pairs(B.PARAM_IDS) do TCT.suffix[id]=TCT.suffix[id] or '--' end   -- shown by TCT.applyLang at the end

----------------------------------------------------------------- initial layout: only "0." expanded
function TCT.initCollapse()
  local al=getAddressList()
  for i=0,al.Count-1 do
    local m=al.getMemoryRecord(i)
    if m.Count&gt;0 then
      local opt='' pcall(function() opt=tostring(m.Options) end)
      if not opt:find('moHideChildren') then
        local inZero=false local p=m
        while p do if p.ID==TCT.ID_TOP0 then inZero=true break end p=p.Parent end
        pcall(function() m.Collapsed = not inZero end)
      end
    end
  end
end

-- Added 2026-10-30: Steam achievement action. Existing comments are preserved.
function TCT.unlockSteamAchievements()
  TCT.require()
  local function fail(en,ja) error(TCT.T(en,ja),0) end
  local exports={}
  local function resolve(name)
    local a=getAddressSafe('steam_api64.'..name)
    if not a or a==0 then a=getAddressSafe('steam_api64.dll.'..name) end
    if not a or a==0 then fail('Steam API export not found: '..name,'Steam APIが見つかりません：'..name) end
    exports[name]=a
    return a
  end
  for _,n in ipairs({'SteamAPI_SteamUserStats_v013',
      'SteamAPI_ISteamUserStats_GetNumAchievements','SteamAPI_ISteamUserStats_GetAchievementName',
      'SteamAPI_ISteamUserStats_GetAchievement','SteamAPI_ISteamUserStats_SetAchievement',
      'SteamAPI_ISteamUserStats_StoreStats'}) do resolve(n) end
  local scratch=nil
  local timedOut=false
  local function call(name,...)
    local ok,v=pcall(executeCodeEx,0,5000,exports[name],...)
    if not ok or v==nil then
      timedOut=true -- Keep scratch alive if a remote call may still be using it.
      fail('Steam API call failed or timed out: '..name..'. Reopen the game before retrying.',
           'Steam APIの呼出しに失敗、または時間切れです：'..name..'。再試行前にゲームを再起動してください。')
    end
    return v
  end
  local function yes(v) return type(v)=='number' and v%256~=0 end
  local function copyName(name)
    assert(#name&lt;512,'Achievement name exceeds buffer')
    assert(writeString(scratch+16,name,false)~=false,'Cannot copy achievement name')
    -- CE writeString does not append a NUL; terminate every copy explicitly.
    assert(writeBytes(scratch+16+#name,0)~=false,'Cannot terminate achievement name')
    assert(readString(scratch+16,512,false)==name,'Achievement name copy mismatch')
  end
  local ok,result=xpcall(function()
    local stats=call('SteamAPI_SteamUserStats_v013')
    if stats==0 then fail('Steam user stats are unavailable. Start this game through Steam.',
                          'Steamの実績情報を取得できません。Steamからゲームを起動してください。') end
    local total=call('SteamAPI_ISteamUserStats_GetNumAchievements',stats)
    if total&lt;1 or total&gt;10000 or total~=math.floor(total) then
      fail('No valid achievement list is available yet. Wait for Steam to load it, then retry.',
           '有効な実績一覧を取得できません。Steamの読込み後に再試行してください。')
    end
    scratch=allocateMemory(1024)
    if not scratch or scratch==0 then fail('Cannot allocate result buffer.','結果取得用メモリを確保できません。') end
    local entries,seen={},{}
    local already=0
    -- Preflight every entry before making any achievement changes.
    for i=0,total-1 do
      local ptr=call('SteamAPI_ISteamUserStats_GetAchievementName',stats,i)
      local name=ptr~=0 and readString(ptr,512,false) or nil
      if not name or name=='' or seen[name] then fail('Invalid achievement list. No changes applied.','実績一覧が不正です。変更を中止しました。') end
      seen[name]=true
      -- Steam reuses the name pointer: copy the text into our own buffer immediately.
      copyName(name)
      writeBytes(scratch,0)
      if not yes(call('SteamAPI_ISteamUserStats_GetAchievement',stats,scratch+16,scratch)) then
        fail('Achievement state unavailable: '..name..'. No changes applied.', '実績状態を取得できません：'..name..'。変更を中止しました。')
      end
      local unlocked=readBytes(scratch,1)
      if unlocked==nil then fail('Cannot read achievement state.','実績状態を読み取れません。') end
      entries[#entries+1]={name=name,unlocked=unlocked~=0}
      if unlocked~=0 then already=already+1 end
    end
    local changed,failed=0,{}
    for _,e in ipairs(entries) do
      if not e.unlocked then
        copyName(e.name)
        if yes(call('SteamAPI_ISteamUserStats_SetAchievement',stats,scratch+16)) then changed=changed+1
        else failed[#failed+1]=e.name end
      end
    end
    local stored=true
    if total&gt;0 then stored=yes(call('SteamAPI_ISteamUserStats_StoreStats',stats)) end
    local verified,remaining=0,{}
    for _,e in ipairs(entries) do
      copyName(e.name)
      writeBytes(scratch,0)
      if yes(call('SteamAPI_ISteamUserStats_GetAchievement',stats,scratch+16,scratch)) and readBytes(scratch,1)==1 then
        verified=verified+1
      else remaining[#remaining+1]=e.name end
    end
    local message=TCT.T(
      string.format('Steam achievements: %d total; %d already unlocked; %d unlock requests accepted; %d failed.',total,already,changed,#failed),
      string.format('Steam実績：全%d件／解除済み%d件／解除要求受付%d件／失敗%d件。',total,already,changed,#failed))
    message=message..'\n'..TCT.T(string.format('Verified in Steam client: %d/%d unlocked.',verified,total),string.format('Steamクライアント状態を再読込：%d/%d件が解除済み。',verified,total))
    if #remaining&gt;0 then message=message..'\n'..TCT.T('Still locked / unreadable: ','未解除・読取失敗：')..table.concat(remaining,', ') end
    if total&gt;0 then
      message=message..'\n'..(stored and TCT.T('StoreStats accepted. Check Steam for server synchronization.',
        '保存要求を受け付けました。サーバーへの同期結果はSteamで確認してください。') or
        TCT.T('StoreStats failed. Changes have not been confirmed saved.', '保存要求に失敗しました。保存完了は確認できません。'))
    end
    if #failed&gt;0 then message=message..'\n'..table.concat(failed,', ') end
    return message
  end,function(e) return tostring(e) end)
  if scratch and not timedOut then deAlloc(scratch) end
  if not ok then error(result,0) end
  print('[TornekoCT] '..result)
end

TCT.NAMES = {
  [308] = {'Remove curses (Shanaq)', '解呪（シャナク）'},
  [307] = {"Add items by category and quantity", "アイテム追加（カテゴリ別・個数）"},
  [210] = {"Player editor", "プレイヤーエディタ"},
  [200] = {"02. Player", "02. プレイヤー"},
  [1] = {"[ATTACH / ALL OFF] Attach and restore", "【アタッチ／一括解除】"},
  [2] = {"0. Settings", "0. 設定"},
  [3] = {'Language / 言語設定', '言語設定 / Language'},
  [4] = {'English (default)', 'English（既定）'},
  [5] = {'日本語 / Japanese', '日本語 / Japanese'},
  [100] = {"01. Gameplay", "01. 便利機能"},
  [101] = {'HP never decreases', 'HPが減らない'},
  [102] = {'Fullness never decreases', '満腹度が減らない'},
  [103] = {'Strength never decreases', 'ちからが減らない'},
  [104] = {'Prevent poison and status ailments', '毒などの状態異常を防止'},
  [105] = {'Avoid traps', '罠にかからない'},
  [106] = {'Disable enemy attacks and special attacks', '敵の攻撃・特殊攻撃を停止'},
  [107] = {'Full HP after one step / turn', '一歩・一ターンでHPを最大回復'},
  [108] = {'Shield never rusts', '盾がさびない'},
  [109] = {'Always Seed of Agility (speed-up never wears off)', 'ずっとすばやさの種（倍速が切れない）'},
  [211] = {"HP", "HP"},
  [212] = {"Maximum HP", "最大HP"},
  [213] = {"Experience", "経験値"},
  [214] = {"Fullness (%)", "満腹度（％）"},
  [215] = {"Gold", "所持金"},
  [216] = {"Strength (base)", "ちから（基礎値）"},
  [217] = {"Sword strength (equipped)", "剣の強さ（装備中）"},
  [218] = {"Shield strength (equipped)", "盾の強さ（装備中）"},
  [300] = {"03. Items", "03. アイテム"},
  [301] = {'Identify all carried items now', '所持している未解明アイテムを強制解明'},
  [305] = {"Items are not consumed", "アイテム減らない"},
  [306] = {"Edit item count / equipment bonus", "アイテム個数変更・装備の補正値を変更"},
  [302] = {'Oomph scroll: enhancement x99', 'バイキルトの巻物：強化効果99倍'},
  [303] = {'Buff scroll: enhancement x99', 'スカラの巻物：強化効果99倍'},
  [304] = {'Plate equipped shield now', '盾をメッキ（装備中の盾に適用）'},
  [400] = {"04. Dungeon", "04. ダンジョン操作"},
  [401] = {"Current floor turns", "現在のターン数"},
  [402] = {"Total turns", "総ターン数"},
  [403] = {"Current floor", "現在の階数"},
  [404] = {'Current dungeon / change by name...', '現在のダンジョン名／名前から変更...'},
  [405] = {'Reveal dungeon map (Map-Reveal scroll)', 'ダンジョンマップ表示（レミーラ）'},
  [406] = {'Reveal item positions (Item-Reveal scroll)', 'アイテムの位置表示（千里眼）'},
  [407] = {'Reveal enemy positions (Enemy-Reveal scroll)', '敵の位置表示（地獄耳）'},
  [408] = {"Forced Evac", "強制帰還"},
}

TCT.NAMES[500] = {'05. Other', '05. その他'}
TCT.NAMES[501] = {'Unlock all Steam achievements', 'Steam実績全解除'}

-- The V3 editor model keeps temporary values in CE memory records and checks the
-- active game context again before committing a value to the game.
local editors={}
local captions={}
local function editorContext()
  local e=assert(B.engine,'Game is not initialized')
  return e:value('g_app._get_floor()')..':'..e:status('DUNGEON')..':'..e:status('FLOOR')
end
local function clearEditor(parent)
  local state=editors[parent.ID]
  if not state then return end
  editors[parent.ID]=nil
  for _,row in ipairs(state.rows) do
    captions[row.ID]=nil
    row.OnValueChangedByUser=nil
    row.destroy()
  end
  if state.scratch and getOpenedProcessID()==state.pid then deAlloc(state.scratch) end
  TCT.applyLang()
end
function TCT.closeEditor(parent)
  if parent.ID==307 and TCT.itemAddForm then
    TCT.itemAddForm.close()
    return
  end
  clearEditor(parent)
end
function TCT.closeAllEditors()
  if TCT.itemAddForm then TCT.itemAddForm.close() end
  local parents={}
  for _,state in pairs(editors) do parents[#parents+1]=state.parent end
  for _,parent in ipairs(parents) do
    clearEditor(parent)
    if parent.Active then parent.Active=false end
  end
end
local function editorState(parent)
  B.requireConnection()
  clearEditor(parent)
  local state={parent=parent,pid=getOpenedProcessID(),context=editorContext(),rows={},used=0}
  editors[parent.ID]=state
  return state
end
local function checkEditor(state)
  assert(editors[state.parent.ID]==state,'Editor is closed')
  assert(B.connected and not B.restorePending and getOpenedProcessID()==state.pid,'Game process changed; reopen the editor')
  assert(state.context==editorContext(),'Game context changed; reopen the editor')
end
local function addRow(state,en,ja,vt)
  local row=getAddressList().createMemoryRecord()
  row.Type=vt
  row.DontSave=true
  row.appendToEntry(state.parent)
  row.Description=T(en,ja)
  captions[row.ID]={row=row,en=en,ja=ja}
  state.rows[#state.rows+1]=row
  return row
end
local function action(state,en,ja,fn)
  local row=addRow(state,en,ja,vtAutoAssembler)
  row.Color=0x00A5FF
  captions[row.ID].run=function()
    checkEditor(state)
    fn()
  end
  row.Script=('[ENABLE]\n{$lua}\nif syntaxcheck then return end\nGT.oneShot(memrec,function() GT.runInline(%d) end)\n{$asm}\n[DISABLE]'):format(row.ID)
  return row
end
function TCT.runInline(id)
  local data=captions[id]
  if data and data.run then data.run() end
end
local function numberRow(state,en,ja,readValue,commit,choices,transition)
  if not state.scratch then state.scratch=assert(allocateMemory(0x1000),'Cannot allocate editor mirrors') end
  local address=state.scratch+state.used*8
  assert(state.used&lt;512,'Too many editor rows')
  state.used=state.used+1
  local row=addRow(state,en,ja,vtDouble)
  row.Address=('%X'):format(address)
  local last=assert(tonumber(readValue()))
  assert(writeDouble(address,last))
  if choices then
    row.DropDownList.Text=choices()
    row.DropDownReadOnly=true
    row.DropDownDescriptionOnly=true
    row.DisplayAsDropDownListItem=true
    captions[row.ID].choices=choices
  end
  row.OnActivate=function(_,before) return not before end
  row.OnValueChangedByUser=function()
    local value=readDouble(address)
    local expected=last
    TCT.defer(function()
      if editors[state.parent.ID]~=state then return end
      local ok,err=pcall(function()
        checkEditor(state)
        assert(math.tointeger(value),'Enter an integer')
        local current=assert(tonumber(readValue()))
        if current~=expected then
          last=current
          assert(writeDouble(address,current))
          error(T('The game value changed. This row was refreshed; enter the new value again.',
                  'ゲーム側の値が変わったため、この行を更新しました。新しい値をもう一度入力してください。'),0)
        end
        commit(value)
        if transition then clearEditor(state.parent);state.parent.Active=false;return end
        last=assert(tonumber(readValue()))
        assert(last==value,'Game returned a different value')
        writeDouble(address,last)
      end)
      if not ok then
        if editors[state.parent.ID]==state then writeDouble(address,last) end
        error(err,0)
      end
    end)
  end
  return row
end
local playerFields={{211,'HP'},{212,'HPMAX'},{213,'EXP'},{214,'FOOD'},{215,'GOLD'},{216,'POWRAW'},{217,'ATK'},{218,'DEF'}}
local worldFields={{401,'TURN_FLOOR'},{402,'TURN_TOTAL'},{403,'FLOOR'}}
local function valueEditor(parent,fields)
  local state=editorState(parent)
  local e=B.engine
  for _,field in ipairs(fields) do
    local label,key=table.unpack(field)
    local equip=({ATK=0,DEF=1})[key]
    local equipment=equip and e:value('g_app.get_equip_item('..equip..')')
    if not equip or equipment~='null' then
      local names=TCT.NAMES[label]
      local function readValue()
        if equip then assert(e:value('g_app.get_equip_item('..equip..')')==equipment,'Equipment changed; reopen the editor') end
        return tonumber(e:status(key))/(key=='FOOD' and 20 or 1)
      end
      numberRow(state,names[1],names[2],readValue,function(value) B.request('set',key,value) end,nil,key=='FLOOR')
    end
  end
  parent.Collapsed=false
end
local dungeonNames={{'Little Mystery Dungeon','ちょっと不思議のダンジョン'},{'Mystery Dungeon','不思議のダンジョン'},{'More Mystery Dungeon','もっと不思議のダンジョン'}}
local function dungeonEditor(parent)
  local state=editorState(parent)
  for i,labels in ipairs(dungeonNames) do
    local row
    row=action(state,labels[1],labels[2],function()
      state.selected=i
      state.selectedRow=row.ID
      TCT.applyLang()
    end)
    captions[row.ID].selected=function() return state.selectedRow==row.ID end
  end
  action(state,'Apply selection','選択を確定',function()
    assert(state.selected,'Select a dungeon first')
    B.request('dungeon',state.selected-1)
    clearEditor(parent)
    parent.Active=false
  end)
  parent.Collapsed=false
end
local function inventoryEditor(parent)
  local state=editorState(parent)
  local e=B.engine
  local rows=e:inventory()
  for _,data in ipairs(rows) do
    local at,identity,id=data.slot,data.identity,data.id
    local label=id and catalog[id+1]
    local prefix=('%02d  '):format(at+1)
    if data.readable and label then
      local item='g_app.get_items('..at..')'
      local function readValue()
        e:slot(at,identity)
        assert(tonumber(e:value(item..'.id'))==id,'Item changed; refresh carried items')
        return e:value(item..'.count')
      end
      local before=#state.rows
      local ok=pcall(numberRow,state,prefix..label[2],prefix..label[3],readValue,
        function(value) B.request('count',at,identity,value) end)
      if not ok then
        local row=state.rows[#state.rows]
        if #state.rows&gt;before then
          captions[row.ID]=nil;table.remove(state.rows);row.destroy()
        end
        local unavailable=addRow(state,prefix..label[2]..' — unavailable',prefix..label[3]..'（開き直しが必要）',vtDword)
        unavailable.IsGroupHeader=true
      end
    else
      local idText=id and (' (ID '..id..')') or ''
      local unavailable=addRow(state,prefix..'Unavailable item'..idText,prefix..'編集できないアイテム'..idText,vtDword)
      unavailable.IsGroupHeader=true
    end
  end
  if #rows==0 then
    local empty=addRow(state,'No carried items','持ち物がありません',vtDword)
    empty.IsGroupHeader=true
  end
  parent.Collapsed=false
end

local itemCategories={
  {0,84,'All categories','すべて'},
  {0,6,'Swords','剣'},{7,13,'Shields','盾'},{14,25,'Rings','指輪'},
  {26,28,'Arrows','矢'},{29,31,'Food','食料'},{32,45,'Herbs and seeds','草・種'},
  {46,65,'Scrolls','巻物'},{66,79,'Staves','杖'},{80,84,'Other items','その他のアイテム'}
}
local function addItemEditor(parent)
  if TCT.itemAddForm then
    TCT.itemAddForm.bringToFront()
    return
  end
  local state=editorState(parent)
  local form=createForm(false)
  TCT.itemAddForm=form
  form.Name='Torneko_ItemPicker'
  form.Caption=T('Add items','アイテム追加')
  form.Position='poScreenCenter'
  form.BorderStyle='bsSizeable'
  form.ClientWidth=840
  form.ClientHeight=550
  form.Constraints.MinWidth=700
  form.Constraints.MinHeight=380
  form.Color=0x252525
  form.Font.Name='Yu Gothic UI'
  form.Font.Size=10
  form.Font.Color=0xf0f0f0
  local view,updating
  form.OnClose=function()
    updating=true
    if view then
      view.OnSelectItem=nil
      view.OnCustomDrawItem=nil
    end
    TCT.itemAddForm=nil
    clearEditor(parent)
    local row=getAddressList().getMemoryRecordByID(parent.ID)
    if row and row.Active then row.Active=false end
    return caFree
  end
  local function make(factory,name,caption)
    local c=factory(form)
    c.Name=name
    if caption then c.Caption=caption end
    return c
  end
  local function button(name,en,ja,fn)
    local c=make(createButton,name,T(en,ja))
    c.OnClick=function()
      local ok,err=pcall(fn)
      if not ok then logError(err) end
    end
    return c
  end
  local hint=make(createLabel,'PickerHint',T('Search by name or ID. Ctrl / Shift selects multiple items.','名前・IDで検索。Ctrl・Shiftで複数選択。'))
  hint.Font.Color=0xcfcfcf
  local category=make(createComboBox,'ItemCategory')
  category.Style='csDropDownList'
  local search=make(createEdit,'ItemSearch')
  search.Text=''
  pcall(function() search.TextHint=T('Search by name or ID','名前・IDで検索') end)
  search.Color=0x353535
  search.Font.Color=0xffffff
  view=make(createListView,'ItemList')
  view.ViewStyle='vsReport'
  view.ReadOnly=true
  view.RowSelect=true
  view.HideSelection=false
  view.MultiSelect=true
  view.Color=0x252525
  view.Font.Color=0xffffff
  view.ShowColumnHeaders=true
  for _,caption in ipairs({'ID',T('Name','名前'),T('Category','カテゴリ'),T('Qty','個数')}) do
    view.Columns.add().Caption=caption
  end
  local countLabel=make(createLabel,'QuantityLabel',T('Quantity','個数'))
  local quantity=make(createEdit,'ItemQuantity')
  quantity.Text='1'
  local footer=make(createLabel,'ItemTotal')
  footer.Font.Color=0xcfcfcf
  local picked,shown={},{}
  updating=false
  local function catOf(id)
    for i=2,#itemCategories do
      local c=itemCategories[i]
      if id&gt;=c[1] and id&lt;=c[2] then return T(c[3],c[4]) end
    end
    return ''
  end
  local function updateFooter()
    local types,total=0,0
    for _,n in pairs(picked) do types=types+1;total=total+n end
    footer.Caption=T(('Shown: %d / %d    Selected: %d types, %d items'):format(#shown,#catalog,types,total),
                     ('表示：%d / %d　選択：%d種類・合計%d個'):format(#shown,#catalog,types,total))
  end
  local function capture()
    if updating then return end
    for i,id in ipairs(shown) do
      local item=view.Items[i-1]
      if item then
        if item.Selected then picked[id]=picked[id] or 1 else picked[id]=nil end
        item.SubItems[2]=picked[id] and tostring(picked[id]) or ''
      end
    end
    updateFooter()
  end
  local function render()
    capture()
    local c=itemCategories[category.ItemIndex+1] or itemCategories[1]
    local query=search.Text:lower()
    updating=true
    view.beginUpdate()
    view.Items.clear()
    shown={}
    for id=c[1],c[2] do
      local item=catalog[id+1]
      local name=T(item[2],item[3])
      local idText=('%02d'):format(id)
      if query=='' or name:lower():find(query,1,true) or idText:find(query,1,true) then
        shown[#shown+1]=id
        local r=view.Items.add()
        r.Caption=idText
        r.SubItems.add(name)
        r.SubItems.add(catOf(id))
        r.SubItems.add(picked[id] and tostring(picked[id]) or '')
        r.Selected=picked[id]~=nil
      end
    end
    view.endUpdate()
    updating=false
    updateFooter()
  end
  view.OnSelectItem=function(_,item,selected)
    if updating or not item then return end
    local id=shown[item.Index+1]
    if not id then return end
    picked[id]=selected and (picked[id] or 1) or nil
    item.SubItems[2]=picked[id] and tostring(picked[id]) or ''
    updateFooter()
  end
  -- Draw the selected row like the reference pickers so it stays legible on dark CE.
  view.OnCustomDrawItem=function(sender,item)
    local rect=item.displayRect('drBounds')
    local canvas=sender.Canvas
    canvas.Font.Color=0xffffff
    canvas.Brush.Color=item.Selected and 0x805020 or 0x252525
    canvas.fillRect(0,rect.Top,sender.ClientWidth,rect.Bottom)
    local cells={item.Caption,item.SubItems[0],item.SubItems[1],item.SubItems[2]}
    local x=rect.Left
    for i,value in ipairs(cells) do
      local width=sender.Columns[i-1].Width
      local y=rect.Top+math.max(0,(rect.Bottom-rect.Top-canvas.getTextHeight(value))//2)
      canvas.textRect({Left=x+6,Top=rect.Top,Right=x+width-5,Bottom=rect.Bottom},x+6,y,value)
      x=x+width
    end
    return false
  end
  local clear=button('ClearFilters','Clear filters','検索解除',function()
    category.ItemIndex=0
    search.Text=''
    render()
  end)
  local setQuantity=button('SetQuantity','Set quantity','個数を設定',function()
    capture()
    local n=math.tointeger(tonumber(quantity.Text))
    assert(n and n&gt;=1 and n&lt;=20,T('Enter an integer from 1 to 20.','個数は1～20の整数で指定してください。'))
    local found=false
    for i,id in ipairs(shown) do
      if view.Items[i-1].Selected then
        picked[id]=n
        view.Items[i-1].SubItems[2]=tostring(n)
        found=true
      end
    end
    assert(found,T('Select at least one visible item.','一覧からアイテムを選んでください。'))
    updateFooter()
  end)
  local clearSelection=button('ClearSelection','Clear selection','選択解除',function()
    updating=true
    for i=0,view.Items.Count-1 do view.Items[i].Selected=false;view.Items[i].SubItems[2]='' end
    updating=false
    picked={}
    updateFooter()
  end)
  local confirm=button('ConfirmItems','Add selected','選択分を追加',function()
    checkEditor(state)
    capture()
    local batch={}
    for id=0,84 do if picked[id] then batch[#batch+1]={id=id,quantity=picked[id]} end end
    assert(#batch&gt;0,T('Select at least one item.','アイテムを1種類以上選んでください。'))
    local added=B.request('addItems',batch)
    print('[TCT] '..T(('Added %d items.'):format(added),('アイテムを%d個追加しました。'):format(added)))
    form.close()
  end)
  local cancel=button('CancelItems','Cancel','キャンセル',function() form.close() end)
  cancel.Cancel=true
  local function bounds(control,x,y,w,h)
    control.Left=x;control.Top=y;control.Width=w;control.Height=h
  end
  local function layout()
    local w,h=form.ClientWidth,form.ClientHeight
    bounds(hint,14,10,w-28,22)
    bounds(category,14,38,152,28)
    bounds(search,175,38,w-328,28)
    bounds(clear,w-145,37,131,29)
    bounds(view,14,76,w-28,h-180)
    view.Columns[0].Width=66
    view.Columns[2].Width=178
    view.Columns[3].Width=80
    view.Columns[1].Width=w-385
    bounds(countLabel,14,h-93,80,25)
    bounds(quantity,97,h-96,64,28)
    bounds(setQuantity,171,h-96,130,29)
    bounds(clearSelection,309,h-96,130,29)
    bounds(footer,14,h-50,w-300,30)
    bounds(confirm,w-282,h-52,165,31)
    bounds(cancel,w-107,h-52,93,31)
  end
  for _,c in ipairs(itemCategories) do category.Items.add(T(c[3],c[4])) end
  category.ItemIndex=0
  category.OnChange=render
  search.OnChange=render
  local resizeTimer=createTimer(form,false)
  resizeTimer.Interval=120
  resizeTimer.OnTimer=function()
    resizeTimer.Enabled=false
    -- LCL can recreate a list handle during resize. Rehydrate it by item ID.
    render()
  end
  form.OnResize=function()
    if not updating then capture() end
    updating=true
    layout()
    resizeTimer.Enabled=false
    resizeTimer.Enabled=true
  end
  layout()
  render()
  form.show()
end

function TCT.openEditor(parent,key)
  if key=='player' then return valueEditor(parent,playerFields) end
  if key=='add_items' then return addItemEditor(parent) end
  if type(key)=='number' then
    for _,fields in ipairs({playerFields,worldFields}) do
      for _,field in ipairs(fields) do
        if field[1]==key then
          local status=field[2]
          local equip=({ATK=0,DEF=1})[status]
          if equip then
            B.requireConnection()
            assert(B.engine:value('g_app.get_equip_item('..equip..')')~='null',
                   T('Equip a sword/shield first.','先に剣または盾を装備してください。'))
          end
          local ok,err=pcall(valueEditor,parent,{field})
          if not ok then clearEditor(parent);error(err,0) end
          return
        end
      end
    end
  end
  if key=='inventory' then
    local ok,err=pcall(inventoryEditor,parent)
    if not ok then
      clearEditor(parent)
      logError(err)
      error(tostring(err):match('^%[string ".-"%]:%d+:%s*(.*)$') or tostring(err),0)
    end
    return
  end
  if key=='dungeon' then return dungeonEditor(parent) end
  error('Unknown editor')
end
local applyLanguage=TCT.applyLang
function TCT.applyLang()
  applyLanguage()
  for _,item in pairs(captions) do
    item.row.Description=(item.selected and item.selected() and '* ' or '')..T(item.en,item.ja)
    if item.choices then item.row.DropDownList.Text=item.choices() end
  end
end
function TCT.shutdown()
  TCT.disableAll(nil)
  TCT.cancelDeferred()
  TCT.closeAllEditors()
  if TCT.timer then TCT.timer.destroy();TCT.timer=nil end
  TCT.forgetProcess()
end

pcall(TCT.initCollapse)
TCT.applyLang()
</LuaScript>
</CheatTable>