@echo off
REM Simpsons DOOM2 by Steve Blauwkamp and Chuck Fuoco
REM     Auto-install batch file


if exist doom2.wad goto doom2
if exist doom.wad goto doom1
echo Error: No DOOM files found
goto end

:doom1
echo @echo off > simpsons.bat
echo @echo Simpsons for DOOM1 >> simpsons.bat
echo doom -file %1 %2 %3 %4 %5 simp2gfx.wad simp2snd.wad simp2spr.wad >> simpsons.bat

goto complete
:doom2
echo @echo off > simpsons.bat
echo @echo Simpsons for DOOM2 >> simpsons.bat
echo REM   dehacked -save original.deh >> simpsons.bat
echo REM   dehacked -load simpsons.deh >> simpsons.bat
echo doom2 -file %1 %2 %3 %4 %5 simp2gfx.wad simp2snd.wad simp2spr.wad >> simpsons.bat
echo REM   dehacked -load original.deh >> simpsons.bat
echo REM   del original.deh >> simpsons.bat

:complete
echo Completing simp2spr.wad...
deusf -doom . -sprites -app simp2spr.wad
if ERRORLEVEL 0 goto okay
echo Error: the sprite completion failed
del simpsons.bat
goto end

:okay
echo Simpsons DOOM 2 ready to go.
echo Just type "simpsons" to get her started.
echo If you have DOOM2 version 1.666 and want to play the
echo DeHacked patch too, then remove the "REM" in simpsons.bat 
:end
