Pet Wars

About: I'm kid that bumped into batch file coding and made lots of effort to learn every thing to make text based games, at least until someone told me that there is more than Batch, then I tried to learn C++, but ...
  1. Create a new text document.
  2. Save it as ".bat" or ".cmd".
  3. Copy and paste the code below into it.

Code:

echo off
title Pet World color 09 mode con cols=90 mode con lines=30 setlocal ENABLEDELAYEDEXPANSION goto start

:start cls echo. Echo: What is your name? echo. set /p name=. Name: set money=0 set lvl=1 set focus=2 set full=5 set /a hp=%lvl% * %full% set /a at=%lvl% * %focus% set wal=Small-bag set limet=100 cls echo. echo. Echo: Hello %name%! echo. pause >> nul cls echo. echo. echo: What pet would you like? echo. pause >> nul goto choose

:choose set pet=Pigeon set at1n=Fly set at2n=Poop color f0 cls echo. Echo -------------------------------- echo: %pet% echo -------------------------------- echo. echo Would you like a %pet%? echo. echo Type Y for Yes echo. echo Type N for NO echo. choice /c yn >> nul if %errorlevel%==1 goto city set pet=Gold-fish set at1n=Swim set at2n=Bubble color 96 cls echo. Echo -------------------------------- echo: %pet% echo -------------------------------- echo. echo Would you like a %pet%? echo. echo Type Y for Yes echo. echo Type N for NO echo. choice /c yn >> nul if %errorlevel%==1 goto city set pet=Monkey set at1n=Climb set at2n=Swing color 20 cls echo. Echo -------------------------------- echo: %pet% echo -------------------------------- echo. echo Would you like a %pet%? echo. echo Type Y for Yes echo. echo Type N for NO echo. choice /c yn >> nul if %errorlevel%==1 goto city set pet=Gecko set at1n=Climb set at2n=Loose_tail color 8a cls echo. Echo -------------------------------- echo: %pet% echo -------------------------------- echo. echo Would you like a %pet%? echo. echo Type Y for Yes echo. echo Type N for NO echo. choice /c yn >> nul if %errorlevel%==1 goto city set pet=Poney set at1n=Gallop set at2n=Sprint color 8f cls echo. Echo -------------------------------- echo: %pet% echo -------------------------------- echo. echo Would you like a %pet%? echo. echo Type Y for Yes echo. echo Type N for NO echo. choice /c yn >> nul if %errorlevel%==1 goto city set pet=Squid set at1n=Swim set at2n=Ink color 30 cls echo. Echo -------------------------------- echo: %pet% echo -------------------------------- echo. echo Would you like a %pet%? echo. echo Type Y for Yes echo. echo Type N for NO echo. choice /c yn >> nul if %errorlevel%==1 goto city set pet=Rock set at1n=Rock set at2n=Roll color 70 cls echo. Echo -------------------------------- echo: %pet% echo -------------------------------- echo. echo Would you like a %pet%? echo. echo Type Y for Yes echo. echo Type N for NO echo. choice /c yn >> nul if %errorlevel%==1 goto city goto choose

:city set /a need=100 - %money% color 09 cls echo. echo. Echo 1 - Home echo 2 - Battle echo 3 - Upgrade echo 4 - Store echo. choice /c 1234 >> nul if %errorlevel%==1 goto home if %errorlevel%==2 goto battle if %errorlevel%==3 goto upgrade if %errorlevel%==4 goto store

:home color 0b cls Echo. echo. echo: Name %name% echo __________________________________________ echo. echo. echo: Pet %pet% echo. echo: Level %lvl% echo. echo: Money %money%/ %limet% echo. echo: Storage %wal% pause >> nul goto city

:battle set /a r=%random% %%!41 +0 if %r%==0 ( set wild=Fly set wlvl=1 ) if %r%==1 ( set wild=Crab set wlvl=1 ) if %r%==2 ( set wild=Jelly_fish set wlvl=2 ) if %r%==3 ( set wild=Rat set wlvl=1 ) if %r%==4 ( set wild=Fox set wlvl=3 ) if %r%==5 ( set wild=Scorpion set wlvl=6 ) if %r%==6 ( set wild=Spider set wlvl=8 ) if %r%==7 ( set wild=Snake set wlvl=4 ) if %r%==8 ( set wild=Salamander set wlvl=5 ) if %r%==9 ( set wild=Piranha set wlvl=9 ) if %r%==10 ( set wild=Slug set wlvl=2 ) if %r%==11 ( set wild=Banana-Slug set wlvl=12 ) if %r%==12 ( set wild=Red-Butt-Baboon set wlvl=11 ) if %r%==13 ( set wild=Blue-Butt-Baboon set wlvl=11 ) if %r%==14 ( set wild=Purple-Butt-Baboon set wlvl=21 ) if %r%==15 ( set wild=Moth set wlvl=1 ) if %r%==16 ( set wild=Giant-Crab set wlvl=23 ) if %r%==17 ( set wild=Racoon set wlvl=7 ) if %r%==18 ( set wild=Humming-Bird set wlvl=13 ) if %r%==19 ( set wild=Angler-Fish set wlvl=24 ) if %r%==20 ( set wild=Bear set wlvl=9 ) if %r%==21 ( set wild=Elephant set wlvl=10 ) if %r%==22 ( set wild=Penguin set wlvl=7 ) if %r%==23 ( set wild=Seal set wlvl=9 ) if %r%==24 ( set wild=Rhino set wlvl=14 ) if %r%==25 ( set wild=Killer-Whale set wlvl=30 ) if %r%==26 ( set wild=Kangaroo set wlvl=12 ) if %r%==27 ( set wild=Owl set wlvl=8 ) if %r%==28 ( set wild=Lion set wlvl=15 ) if %r%==29 ( set wild=Frog set wlvl=2 ) if %r%==30 ( set wild=Giant-Chicken set wlvl=43 ) if %r%==31 ( set wild=Bat set wlvl=13 ) if %r%==32 ( set wild=Seagull set wlvl=9 ) if %r%==33 ( set wild=Deer set wlvl=13 ) if %r%==34 ( set wild=Moose set wlvl=24 ) if %r%==35 ( set wild=Falcon set wlvl=25 ) if %r%==36 ( set wild=Griffin set wlvl=57 ) if %r%==37 ( set wild=Fairy set wlvl=33 ) if %r%==38 ( set wild=Panther set wlvl=13 ) if %r%==39 ( set wild=Ender-Dragon set wlvl=78 ) if %r%==40 ( set wild=Ather-Dragon set wlvl=87 ) if %r%==41 ( set wild=Sea-cucumber set wlvl=1 ) set /a wat=%wlvl% * 2 set /a whp=%wlvl% * 5 goto attack

:attack set /a at=%lvl% * %focus% set /a wat=%wlvl% * 2 color 02 cls echo. echo. echo ---------------------------- echo: %wild% echo ---------------------------- echo: Level (%wlvl%) echo: Health (%whp% ) echo. echo. echo. echo. echo ---------------------------- echo: %pet% echo ---------------------------- echo Level (%lvl% ) echo Health (%hp% ) echo. echo. echo. echo 1- %at1n% echo. echo 2- %at2n% echo. echo 3- [RUN] echo. choice /c 123 >> nul if %errorlevel%==1 goto batt if %errorlevel%==2 goto batt if %errorlevel%==3 ( set /a hp=%lvl% * %full% goto city ) goto attack

:batt set /a whp-=%at% set /a hp-=%wat% if %whp% leq 0 goto win if %hp% leq 0 goto loose cls goto attack

:loose cls color 04 echo. echo. echo: You lost! pause >> nul set /a hp=%lvl% * %full% color 09 cls goto city

:win cls color 0a echo. echo. echo: You win! pause >> nul color 09 if %lvl% gtr 9999 ( set lvl=10000 set /a ham=%wat% * 3 set /a money+=%ham% set /a hp=%lvl% * %full% cls color 2b Echo. echo. echo. echo: Your %pet% is at max level! echo. echo. echo: Level - %lvl% Pause >> nul cls goto next ) set /a ham=%wat% * 3 set /a pork=%wat% / 2 set /a money+=%ham% set /a lvl+=%pork% set /a hp=%lvl% * %full% goto next

:next cls if %money% gtr %limet% ( set money=%limet% ) goto city

:upgrade if %money% lss 100 ( color 8f cls echo. echo. echo: Sorry, but you don't have enough money to upgrade. echo. echo. echo: You need %need% more dollars. pause >> nul goto city ) if %money% geq 100 goto check color 04 echo. echo. echo: ERROR pause >> nul exit

:check set dpet=%pet% set an=a cls if %pet%==Pigeon ( set pet=Hawk set at1n=Swoop set at2n=Tallons set /a money-=100 set lvl=1 goto goodtogo ) if %pet%==Hawk ( set pet=Eagle set at1n=Floop set an=an set atn2=Sharp-Beak set /a money-=100 set lvl=1 goto goodtogo ) if %pet%==Eagle ( set pet=Phoenix set at1n=Flaming-wings set at2n=Burning-sky set lvl=1 set /a money-=100 goto goodtogo ) if %pet%==Gold-fish ( set pet=Sun-fish set at1n=Sun-swim set at2n=Sun-bubble set lvl=1 set /a money-=100 goto goodtogo ) if %pet%==Sun-fish ( set pet=Tiger-shark set at1n=Chomp set at2n=Dun-Dun-Music set lvl=1 set /a money-=100 goto goodtogo ) if %pet%==Tiger-shark ( set pet=Sea-Monster set at1n=Sailer-eat set at2n=Lurk-under-sea set lvl=1 set /a money-=100 goto goodtogo ) if %pet%==Monkey ( set pet=Ape set at1n=Ooh-Ooh_Ahh-ahh set at2n=Swing-tree-to-tree set an=an set lvl=1 set /a money-=100 goto goodtogo ) if %pet%==Ape ( set pet=Gorilla set at1n=Hunter-bite set at2n=Tree-king set lvl=1 set /a money-=100 goto goodtogo ) if %pet%==Gorilla ( set pet=King-kong set at1n=Building-climb set at2n=Steal-damsel set lvl=1 set /a money-=100 goto goodtogo ) if %pet%==Gecko ( set pet=Alligator set at1n=Jaw-snap set at2n=Snap-jaw set an=an set lvl=1 set /a money-=100 goto goodtogo ) if %pet%==Alligator ( set pet=Crocodile set at1n=Jaw-chomp set at2n=Chomp-jaw set lvl=1 set /a money-=100 goto goodtogo ) if %pet%==Crocodile ( set pet=Dragon set at1n=Breath-fire set at2n=Lighten-sky set lvl=1 set /a money-=100 goto goodtogo ) if %pet%==Poney ( set pet=Pegasus set at1n=Flyyyyyyyy set at2n=Magic-wings set lvl=1 set /a money-=100 goto goodtogo ) if %pet%==Pegasus ( set pet=Unicorn set at1n=Macical-horn** set at2n=Magical-gallop** set lvl=1 set /a money-=100 goto goodtogo ) if %pet%==Unicorn ( set pet=Alicorn set at1n=Magical-Flyyyyy set at2n=Magic-rainbow-sky set an=an set lvl=1 set /a money-=100 goto goodtogo ) if %pet%==Squid ( set pet=Giant-Squid set at1n=Giant-ink set at2n=Giant-swim set lvl=1 set /a money-=100 goto goodtogo ) if %pet%==Giant-Squid ( set pet=Colossal-Squid set at1n=Colosal-ink set at2n=Colosal-swim set lvl=1 set /a money-=100 goto goodtogo ) if %pet%==Colossal-Squid ( set pet=Kracken set at1n=Darken-sea set at2n=Destroy-ships set lvl=1 set /a money-=100 goto goodtogo ) if %pet%==Rock ( set pet=Boulder set at1n=Tumble set at2n=Rockalanche set lvl=1 set /a money-=100 goto goodtogo ) if %pet%==Boulder ( set pet=Astroid set at1n=Plumet set at2n=Giant-space-rock set an=an set lvl=1 set /a money-=100 goto goodtogo ) if %pet%==Astroid ( set pet=Comet set at1n=Magic-star-dust-tail set at2n=Blow-up-planet set lvl=1 set /a money-=100 goto goodtogo ) cls color 69 echo. echo. echo: Your %pet% is maxed out echo. pause >> nul cls color 09 goto city

:goodtogo set lvl=1 set /a focus=%focus% * 2 set /a at=%lvl% * %focus% set /a full=%full% * 2 set /a hp=%lvl% * %full% cls color a9 echo. echo. echo. echo: Your %dpet% upgraded to %an% %pet% pause >> nul goto city

:store set /a nom=%limet% / 2 set /a slab=%nom% - %money% set dwal=%wal% cls if %money% lss %nom% ( color 8f echo. echo. echo: You need more money. echo. echo: You need %slab% more dolors. pause >> nul goto city ) if %money% geq %nom% goto newu

:newu cls if %wal%==Small-bag ( set wal=Medium-bag set limet=200 goto gbye ) if %wal%==Medium-bag ( set wal=Large-bag set limet=300 goto gbye ) if %wal%==Large-bag ( set wal=Small-chest set limet=400 goto gbye ) if %wal%==Small-chest ( set wal=Medium-chest set limet=500 goto gbye ) if %wal%==Medium-chest ( set wal=Large-chest set limet=600 goto gbye ) if %wal%==Large-chest ( set wal=Portal-pocket set limet=1000 goto gbye ) color 69 echo. echo. echo: You have a portal-pocket, what more do you need? pause >> nul goto city

:gbye set /a money-=%nom% cls color 69 echo. echo. echo: You upgraded your %dwal% to a %wal%. pause >> nul goto city

Share

Recommendations

  • PCB Contest

    PCB Contest
  • Make it Glow Contest 2018

    Make it Glow Contest 2018
  • Toys Contest

    Toys Contest

Discussions