@echo off mode con cols=120 lines=42 chcp 65001 >nul set "DBD_ROOT=%~dp0..\.." powershell -NoProfile -ExecutionPolicy Bypass -Command "$root=[IO.Path]::GetFullPath($env:DBD_ROOT); $ans=Join-Path $root 'assets\animations\dbd_hook.ans'; $stop=Join-Path $root 'runtime\dbd_hook.stop'; $profilePath=Join-Path $root 'runtime\anim_profile.txt'; if(Test-Path $stop){Remove-Item $stop -Force}; if(!(Test-Path $ans)){Write-Host 'dbd_hook.ans not found:' $ans; Start-Sleep -Seconds 3; exit 1}; $profile=1; if(Test-Path $profilePath){ $raw=(Get-Content -LiteralPath $profilePath -Raw -ErrorAction SilentlyContinue).Trim(); if($raw -match '^[0-2]$'){ $profile=[int]$raw } }; $step=@(1,2,3)[$profile]; $delay=80*$step; $frames=(Get-Content -LiteralPath $ans -Raw -Encoding UTF8) -split [char]12; $esc=[char]27; try{ [Console]::Write($esc+'[2J'+$esc+'[?25l'); while(!(Test-Path $stop)){ for($i=0; $i -lt $frames.Count; $i+=$step){ if(Test-Path $stop){break}; [Console]::Write($esc+'[H'); [Console]::Write($frames[$i]); Start-Sleep -Milliseconds $delay } } } finally { [Console]::Write($esc+'[0m'+$esc+'[?25h'); if(Test-Path $stop){Remove-Item $stop -Force} }" exit