@echo off
REM ============================================================
REM  HELLHOUSE - START HERE. One server, rotating seasons.
REM  Always fetches the current season's wad, then connects.
REM  Portable: works from any folder/USB (paths via %~dp0).
REM  If doom2.wad is missing, tries to find it (Steam/GOG) and
REM  copies it in; otherwise guides the user.
REM ============================================================
cd /d "%~dp0"

REM --- ensure doom2.wad is present; try to auto-locate it if not ---
if not exist "%~dp0doom2.wad" if not exist "%~dp0DOOM2.WAD" (
  echo Looking for your doom2.wad ^(Doom II game data^)...
  powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0find-doom2.ps1" "%~dp0"
)

:menu
cls
echo  ============================================
echo            H E L L H O U S E
echo     Brutal Doom - rigzhouse.co.uk/doom
echo     One server. Rotating maps + survival.
echo  ============================================
echo.
if not exist "%~dp0doom2.wad" if not exist "%~dp0DOOM2.WAD" (
  echo   [!] doom2.wad not found yet.
  echo       HELLHOUSE needs YOUR copy of doom2.wad in this folder
  echo       ^(you own Doom II on Steam/GOG^). Drop doom2.wad next to
  echo       this file, then run again. See "PUT YOUR doom2.wad HERE.txt".
  echo.
)
echo    Where are you?
echo.
echo     [1]  At home   (LAN, fastest)
echo     [2]  Anywhere  (Internet)
echo.
echo     [Q]  Quit
echo.
set "choice="
set /p "choice=Type a number and press Enter: "
if /i "%choice%"=="1" ( call "%~dp0_join.bat" 10.0.0.130:10666 & goto end )
if /i "%choice%"=="2" ( call "%~dp0_join.bat" 94.72.111.66:10666 & goto end )
if /i "%choice%"=="Q" ( goto end )
echo  "%choice%" is not an option - try again.
pause
goto menu
:end
