flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Heap > I like batch files

Author
Thread Post new topic Reply to topic
Coty



Joined: 17 May 2010
Posts: 505
Location: ␀
I like batch files

Code:
@echo off

:start

set beasthealth=3
set yourhealth=2
set beanregain=2
set sworddamage=1
set clawdamage=1
set beancount=0
set necklace=0
set obtainedbread=0
set maxlife=3

echo Adventure Quest by Coty Miller
echo How to play:
echo read the pasage and answer the Questions.
echo.
echo type 1 to start or enter in your "save password."
set /p co=:
if %co% == XE87 goto LoadLevel2

:1
cls
echo You come to a fork in the road
echo One way liyse a bridge the other
echo a shack. what do you do?
echo.
echo 1. Cross the Bridge 
echo 2. enterthe shack
echo.
Set /P co=[1/2]:
if %co% == 1 goto 2
if %co% == 2 goto 3
goto 1

:2
cls
echo You crossed the bridgea guy
echo says you must give the password
echo to enter our land. He holds a 
echo spear to your chest.
echo.
echo 1. Leave
echo 2. I know the password.
Set /P co=[1/2]:
if %co% == 1 goto 1
if %co% == 2 goto 4
goto 2

:3
set /a obtainedbread=1
cls
echo You enter the shack and talk to an
echo old man he gives you some bread an
echo tells you to to cross the bridge to
echo the land of yaheme you must member
echo the password fartstink you then 
echo cross the bridge.
echo.
pause && goto 1

:4
cls
echo Bigguy - So you think you know the
echo password OK shoot.
echo.
Set /P co=Password:
if %co% == fartstink goto 5
goto gameover

:5
cls
echo After entering the land of yoheme you see
echo a very youngwearyhungryold man your
echo stomache growls what do you do.
echo.
echo 1. continue down the road.
echo 2. go back the way you came...
        if %obtainedbread% == 1 echo 3. eat the bread
       if %obtainedbread% == 1 echo 4. give him the bread
echo.
set /p co=?:
if %co% == 1 goto 65
if %co% == 2 goto 1
      if %obtainedbread% == 1 if %co% == 3 goto 6
 if %obtainedbread% == 1 if %co% == 4 goto 7

goto 5

:6
cls
echo You eat the bread and carry on 
echo your way when you come along
echo an angry beast it kills you and
echo you die...
echo.
pause
goto gameover
:65
cls
echo you carry on your way to be attacked 
echo and killed by an angry beast.
echo.
pause
goto gameover

:7
cls

set /a beancount%beancount%+4

echo You give the hungry travaler your
echo breadand he hand half back you
echo both enjoy the bread then he says
echo for your kindness have this. He
echo then hands you asword and a sack
echo of beans you thank him and carry
echo on your way.
echo.
pause
goto 9


:9
        cls
 echo A wild beast attacked!

     :attackalgo
             echo.
               echo 1. Swing sword
         echo 2. evade
               echo 3. Pop a bean
          set /p sft=[1,2,3]:
                     if %sft% == 1 goto fledge
                   if %sft% == 2 goto girly
                    if %sft% == 3 goto yumyummario

                  :checkstat
                      if %yourhealth% == 0 goto gameover
                  if %beasthealth%== 0 goto 10
                goto attackalgo

 :fledge
         cls
         set /a yourhealth=%yourhealth%-%clawdamage%
         set /a beasthealth=%beasthealth%-%sworddamage%

          echo.
               echo You dealt damage * %sworddamage% !!!
           echo.
               echo The beast attacked you and dealt damage * %clawdamage% ! 
              echo.
       goto checkstat

  :girly
          cls
         echo.
               echo you evaded the beasts attack
           echo.
       goto checkstat

  :yumyummario
            cls
         if %beancount% == 0 goto nomorebeans

            if %yourhealth% == %maxlife% goto atmaxhealth
               
            set /a beancount=%beancount%-1
              set /a yourhealth=%yourhealth%+%beanregain% 
                set /a yourhealth=%yourhealth%-%clawdamage%
         echo.
               echo You popped a bean and gained health * %beanregain% !
           echo The beast dealt damage * %clawdamage% !
                echo.
       goto checkstat

  :nomorebeans
            set /a yourhealth=%yourhealth%-%clawdamage%
         echo.
               echo Oh no! There arn't any beans left!
            echo The beast dealt damage * %clawdamage% !
                echo.
       goto checkstat

  :atmaxhealth
            set /a beancount=%beancount%-1
              set /a yourhealth=%yourhealth%-%clawdamage%
         echo.
               echo You popped the beanbut it had no effect!
             echo The beast dealt damage * %clawdamage% !
                echo.
       goto checkstat

:10
cls            
echo You defeat the beast and notice that it seems to be wearing a
echo necklace of some sort.
echo.
echo 1. Remove the necklace
echo 2. Leave it alonehope the owner finds it.
set /p co=?:
if %co% == 1 set /a necklace=1 && goto 11
if %co% == 2 goto 11
goto 10

:11
echo. 
echo (1necklace was added to your inventory!
echo.
pause

cls
echo A bistander peaks out of a nearby Bush.
echo.
echo  Stranger - Oh! You slayed the Kampari! Thank you That thing has been
echo attacking our vilage for almost a month now! People afraid to go outside
echo for fear it may attack them! As you can imagine this meens our crops
echo are slowly fading away!
echo.
echo  You - Glad I could helpbut I'm just passing through to get to heyfar.
echo.
echo  Stranger - Heyfar? Well HEYFAR is that!? HAHAHA! Just kidding! kidding!
echo I kid! No but reallyIt just so happens I need some magic moss called
echo yingbatyou see I am the villages healerand this rare moss is known for
echo it's healing properties. None grows here for it is to warmbut up north
echo in heyfarit is the perfect climent for it! If you bring some to me I'll
echo make sure your payed well!
echo.
echo 1. FineI'll get your moss.
echo 2. SorryI'm not an arron boy.
echo 3. I don't like puns.
set /p co=?:
if %co% == 1 goto 12
if %co% == 2 goto 13
if %co% == 3 goto 14

:12
echo.
echo.
echo Great! I assure you it will be worth your time!
echo.
goto 15

:13
echo.
echo.
echo I see... Well my offer still stands if you change you mind.
echo.
goto 15

:14
echo. 
echo  Stranger - I'm sorryI just get carried away sometimes...But what do you 
echo think of my offer? Willing to help me out for some extra cash?
echo.
echo 1. I guess sojust no more puns.
echo 2. No I hate youno one that makes puns deservs anything they want!
set /p co=?:
if %co% == 1 goto 12
if %co% == 2 goto 13

:15
pause
cls
echo You have made it to the village or magonda!
echo Your save passowrd is "XE87" right this down so
echo that you may continue were you left off!
echo.
pause.

:LoadLevel2
cls
echo Level2.bat is not a working part of the game yet...
echo and that password I gave you sucks because it doesn't remember your health or
echo beansI should write some code that encodes that stuff into ASCII for you...
echo.
pause
goto start


:gameover
cls
echo You have died ...
echo.
goto start



We should make more stuff with them... NOO, we just treat them as makefiles or something...

_________________
http://codercat.info/
Post 17 Mar 2012, 17:01
View user's profile Send private message Send e-mail Visit poster's website AIM Address Reply with quote
bubach



Joined: 17 Sep 2004
Posts: 325
Location: Trollhättan, Sweden
Hehe, I used a file structure with BAT files as my first "programming" attempts, each bat file was a new command. Not quite so advanced usage as yours, but was fun at age 10 Very Happy

Anyway, good work! this kind of makes me want to see if some MUD is still playable - those where fun times Razz
Post 17 Mar 2012, 17:38
View user's profile Send private message Reply with quote
Coty



Joined: 17 May 2010
Posts: 505
Location: ␀
I learned batch when I got my first PC at the age of 14, it ran windows 98, toshiba 335cds, great laptop, this was about 4 1/2 years ago. I found this game written in a tablet (Not these fancy apple and android ones, but ones made of paper.) when cleaning my bedroom.

It wasn't this complex though, I added allot to it, like the angry beast, it didn't have any sort of algo, you pressed a key and if you selected the right option you defeated it, and if you didn't well... you went to the game over screen.

There is a second chapter in the tablet, but I spent some time just copying the code and re-fining it... I tried to leave all spelling and grammer errors in tact though

echo After entering the land of yoheme you see
echo a very young, weary, hungry, old man your

Laughing

_________________
http://codercat.info/
Post 17 Mar 2012, 17:50
View user's profile Send private message Send e-mail Visit poster's website AIM Address Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1598
Location: web
Cool nice work coty, i also start to program using bat files, i thought i was the cool hacker, making bat file virus Laughing
Post 17 Mar 2012, 19:27
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2619
Location: 0x77760000
These games are hard to cheat Sad

So I made a hack to reveal the password. Just TYPE this in when prompted at the menus


Code:
^C&

Very Happy Smile
Post 18 Mar 2012, 04:13
View user's profile Send private message Visit poster's website Reply with quote
Coty



Joined: 17 May 2010
Posts: 505
Location: ␀
It just crashes it on windows 7 saying that "& was unexpected at this time" Very Happy


Dex4u wrote:
Cool nice work coty, i also start to program using bat files, i thought i was the cool hacker, making bat file virus Laughing


I thought I was an awesome game programer and that I was going to sell these upon completion Laughing

_________________
http://codercat.info/
Post 18 Mar 2012, 16:52
View user's profile Send private message Send e-mail Visit poster's website AIM Address Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2013, Tomasz Grysztar.