/*                 Lemonade Stand V2.5                    */
/*                         BY                             */
/*                     Star Gazer                         */
/*                  Star Streams BBS                      */
/*                   (214) 938-7115                       */
/*                  FIDO  1:124/6517                      */
/*              $VER:Lemonade_Stand_V2.5                  */

options results ; signal on SYNTAX ; signal on ERROR ; signal on IOERR ; BBSIDENTIFY NAME ; SYS=result ; BBSIDENTIFY SYSOP ; NAM=result
tr=transmit ; sf=sendfile ; gc=getchar ; gu=getuser ; qu=query ; gu 1 ; handle=result ; se=sendstring ; sp=copies(' ',10)
gu 28 ; term=result ; gu 27 ; width=result ; gu 2 ; gu 39 ; dfile="mail:users/"result"/LemonSV" ; tdate=result ; changewhere'Lemonade' ; oldwh=result
month=31 ; day=0 ; tsales=5.00 ; price=0 ; rday=0 ; nl=0 ; pog=0 ; slm=0 ; slampwr=0 ; cog=0
PATH='pfiles:GR2/' /* Path to your game files */
PATH1=path'screens/'
maxi=50.00           /* Max cash to end the store specials */
treward=10           /* Time Reward for being a top player */
VER='2.5'            /* Version number; Do not change */
OVER=VER

SLAMMERS:
sl1=0  /* None */
sl2=2  /* Old Aluminum */
sl3=3  /* New Aluminum */
sl4=4  /* Nice Copper */
sl5=5  /* Heavy Steel */
sl6=6  /* Steel Superhero */
sl7=7  /* Gold-plated Steel */
sl8=8  /* Coboltblue Snake */
sl9=9  /* Blacksteel Dragon */
sl0=10 /* Holographic Unicorn */
sm=sl1

PRESTART:
if width<80 then call SORRY1
if term=0 then call SORRY
if term=1 then call SORRY
if term=2 then call INTRO
if term=3 then call SORRY
if term=4 then call INTRO
call CHECK
exit

INTRO:
call CHECK
sf path1'INTRO.ANS'
tr ''
tr '                                   [1;37mVersion 'ver'[0m'
tr '                                  c9k1[Press ENTER]q1g1'
sf path1'INTRO2.ANS'
tr'cePress any cc[cfKEYcc] ceto start your new careerca...g1f1'

START:
call CHECK
call READHIGHS

READGAME:
if ~exists(dfile) then signal NEWSTATS 
  call CHECK
    call open(f1,dfile,"R")
      data=readln(f1)
      parse var data handle"|"day"|"tsales"|"rday"|"over"|"nl"|"pog"|"sm"|"cog"|"junk
  call close(f1)
if over~=ver then call OLDGAME  

WMAP:
call CHECK
tr''
ch=random(5,50,time('s'))
sf path1'WMAP.ANS'
tr '  cfThere is a ce'ch'cc% cfchance of rain on any given day for July.'
tr '  cfThe high temperature will range from 70 to 120 degrees.'
tr ''
tr '  cePress Any ccKEY ceTo Continue...g1f1'

MENU:
call CHECK
sf path1'SADE1.ANS'
tr ''
se '                                   cfPlease selectca? cf' ; gc ; menu=result;call CHECK
if index("HSIQP",menu)=0 & C2D(menu)~=27 THEN DO
tr 'n1                          cfPlease pick an option from the listca.w3';signal MENU;end
if menu='H' then call HIGH
if menu='S' then call FDAY
if menu='I' then call INST
if menu='P' then call SLSHP
if C2D(menu)=27 then call END1
call MENU

FDAY:
call CHECK
htemp=random(70,120,time('s'))
rain=random(1,100,time('s'))
call MAIN

MAIN:
call CHECK
call DCHECK
tr 'f1cfThis is day number cd'day'ca, cfonly cd'31-day' cfto goca...'
tr 'cfThe high for today will be cd'htemp' cfdegreesca.'
if rain<ch then call BADDAY
tr ''
sf path1'GROC.ANS'
tr ''
tr 'cfHow many supplies will you buy for todayca? '
se 'cfYou have ce$'tsales'ca, cfPlease selectca? cf'; gc ; menu=result ; call CHECK
if index("ABCDUVXP",MENU)=0 & C2D(MENU)~=27 THEN DO
    tr 'n1cfPlease pick an option from the listca.w3';day=day-1;signal MAIN;end
if menu='A' then supply=25
if menu='A' then cost=5.00
if menu='B' then supply=50
if menu='B' then cost=10.00
if menu='C' then supply=75
if menu='C' then cost=15.00
if menu='D' then supply=100
if menu='D' then cost=20.00
if menu='X' then call SSTORE
if menu='P' then call PLYGRND
if menu='U' then do; bbscommand who;tr '';tr 'cePress Any ccKEY ceTo Continue...g1f1';signal MAIN;end
if menu='V' then do; bbscommand olm;signal MAIN;end
if C2D(menu)=27 then call END1
tr ''; tr 'cfOkca, cfyou now have supplies for ce'supply' cfpeopleca.'
if tsales<5.00 then call BROKE
if tsales<cost then call OOPS
tsales=tsales-cost
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call MAIN1

MAIN1:
call CHECK
tr ''
sf path1'MAIN.ANS'
tr ''
tr 'cfWhat price will you charge for lemonade todayca? '
se 'cfPlease selectca? cf'; gc ; menu=result ; call CHECK
if index("ABCDEFGHIJKLMNOPQRSTUVXYZ",MENU)=0 & C2D(MENU)~=27 THEN DO
    tr 'n1cfPlease pick an option from the listca.w3';signal MAIN1;end
if menu='X' then call THIEF    
if menu='Y' then tr 'Nice rockw2'
if menu='Y' then price=2.00
if menu='Z' then tr 'ZZZzzz... You are asleep'
if menu='Z' then price=0
if menu='A' then price=.05
if menu='B' then price=.10
if menu='C' then price=.15
if menu='D' then price=.20
if menu='E' then price=.25
if menu='F' then price=.30
if menu='G' then price=.35
if menu='H' then price=.40
if menu='I' then price=.45
if menu='J' then price=.50
if menu='K' then price=.55
if menu='L' then price=.60
if menu='M' then price=.65
if menu='N' then price=.70
if menu='O' then price=.75
if menu='P' then price=.80
if menu='Q' then price=.85
if menu='R' then price=.90
if menu='S' then price=.95
if menu='T' then price=1.00
if menu='U' then do; bbscommand who;tr '';tr 'cePress Any ccKEY ceTo Continue...g1f1';signal MAIN;end
if menu='V' then do; bbscommand olm;signal MAIN;end
if C2D(menu)=27 then call END1
tr ''; tr 'cfOkca, cfyou will sell it for ce'price' cfa glassca.'
htemp=random(70,120,time('s'))
rain=random(1,100,time('s'))
call SALES

BADDAY:
call CHECK
rain=99
rday=rday+1
tr' cfI''m so sorry, but it is raining too hard to sell lemonade today cb:('
tr 'cePress Any ccKEY ceTo Continue...g1f1'
htemp=random(70,120,time('s'))
call MAIN
exit

SALES:
call CHECK
p1=price*100
luck=random(1,htemp,time('s')) /* Max people */
bluck=random(1,luck,time('s')) /* # that want to buy */
if htemp>95 and price<.50 then bluck=bluck+5 /* low price/hot day */
if htemp<80 and price>.50 then bluck=bluck-5 /* high price/cool day */
if bluck>luck then bluck=luck
if bluck>supply then bluck=supply /* supply vs demand */
if bluck<0 then bluck=0
sales=bluck*price
tsales=tsales+sales
tr 'w2cfSelling lemonades4k1....................w2q1 cdDONE!w1q1'
tr 'f1cfHere are your sales for todayc9:'
tr ''
tr 'ceYou had cc'luck' cepeople stop by for a look.'
tr 'ceOf the cc'luck' cethat stopped, cc'bluck' cebought some lemonade from you.'
tr 'ceYou sold cc'bluck' ceglasses of lemonade at cc'price' cea glass which gives'
tr 'ceyou a total of cf$ca'sales' cefor the day.'
if bluck=supply then tr 'ceYou cfz1 SOLD OUT z0 cetodayca!'
call EVENTS
exit

EVENTS:
call CHECK
lk=random(1,100,time('s'))
if lk>80 then call GOTEVENT
tr ''
tr 'caEVENTSc9: cfLook''s like nothing special took place today.'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call MAIN
exit

GOTEVENT:
call CHECK
e=random(1,6,time('s'))
if e=1 then call EV1
if e=2 then call EV2
if e=3 then call EV3
if e=4 then call EV4
if e=5 then call EV5
if e=5 then call EV6
call GOTEVENT
exit

EV1:
call CHECK
tr ''
tr 'caEVENTc9: cfOh noca... cfThe bully down the street came by and took all'
tr '       cfof your profitca''cfs for the dayca.'
tr ''
tsales=tsales-sales
tr 'cePress Any ccKEY ceTo Continue...g1f1'
tr ''
call MAIN

EV2:
call CHECK
tr ''
tr 'caEVENTc9: cfThis is your lucky dayca! A street sweeper came by and blew'
tr '       cfa ca$cb10ca.cb00 cfbill into your yardca.'
tr ''
tsales=tsales+10.00
tr 'cePress Any ccKEY ceTo Continue...g1f1'
tr ''
call MAIN

EV3:
call CHECK
tr ''
tr 'caEVENTc9: cfOopsca, cfyour little sister tries to help out but ends up'
tr '       cfknocking over your lemonadeca. cfYou have to spend five dollars'
tr '       cfof the dayca''cfs profit to buy more lemons and sugerca.'
tr ''
tsales=tsales-5.00
tr 'cePress Any ccKEY cfTo Continue...g1f1'
tr ''
call MAIN

EV4:
call CHECK
tr ''
tr 'caEVENTc9: cfOopsca, cfLooks like to need to make a few repairs to'
tr '       cfyour lemonade stand. You run to the hardware store and buy'
tr '       cfsome paint and nails. This costs you $8.00'
tr ''
tsales=tsales-8.00
tr 'cePress Any ccKEY cfTo Continue...g1f1'
tr ''
call MAIN

EV5:
call CHECK
if slm=1 then call GOTEVENT
slm=1
sm=sl0
tr ''
tr 'caEVENTc9: cdWOWca! cfYou find a real nice pog slammer in the streetca!'
tr '       cfIt is a very heavy slammer with a holographic unicorn on itca.'
tr '       cfThe power of this slammer is 'sm'!'
tr ''
tr 'cePress Any ccKEY cfTo Continue...g1f1'
tr ''
call MAIN

EV6:
call CHECK
rpg=random(1,5,time('s'))
tr ''
tr 'caEVENTc9: cfYou find 'rpg' pog milk caps in your yardca!'
tr '       cfThe little kids down the street must have dropped themca.'
tr ''
pog=pog+rpg
tr 'cePress Any ccKEY cfTo Continue...g1f1'
tr ''
call MAIN

END:
call CHECK
tr 'f1cfIt has been a full month since you opened your Lemonade Standca.'
tr 'cfLets see how well you have doneca... cfYou now have ce'tsales' cfbucks'
tr 'cfand you only lost ce'rday' cfdays to rainca.'
if pog~=0 then tr 'cfYou also have ce'pog' cfpog milkcapca''cfs in your collectionca.'
if nl=1 then tr 'cfw2The storekeeper comes up and takes his ce$10.00 cffrom youca.'
if nl=1 then tsales=tsales-10.00
if exists(dfile) then do ; address command 'DELETE "'dfile'"'
call CHECKHIGH
call QUIT

END1:
call CHECK
tr 'f1cfAfter ce'day' cfdayca''ce(cfsce) cfof Selling lemonadeca, cfyou think it might be time for a restca.'
tr 'cfYour sales from the lemonade stand so far are c9$cb'tsales'ca.'
if pog~=0 then tr 'cfYou also have ce'pog' cfpog milkcapca''cfs in your collectionca.'
tr ''
call SAVEGAME
call QUIT

HIGH:
call CHECK
tr '[2J[[5;20H[41m    [33mLemonade Stand Top Ten Highest Scores    [40m'
tr '[7;20Hcd       'left(hiwho.1'ce',28,'.')'ca'left(hiwhat.1,10)
tr '[8;20Hc5       'left(hiwho.2'c6',28,'.')'c2'left(hiwhat.2,10)
tr '[9;20Hcd       'left(hiwho.3'ce',28,'.')'ca'left(hiwhat.3,10)
tr '[10;20Hc5       'left(hiwho.4'c6',28,'.')'c2'left(hiwhat.4,10)
tr '[11;20Hcd       'left(hiwho.5'ce',28,'.')'ca'left(hiwhat.5,10)
tr '[12;20Hc5       'left(hiwho.6'c6',28,'.')'c2'left(hiwhat.6,10)
tr '[13;20Hcd       'left(hiwho.7'ce',28,'.')'ca'left(hiwhat.7,10)
tr '[14;20Hc5       'left(hiwho.8'c6',28,'.')'c2'left(hiwhat.8,10)
tr '[15;20Hcd       'left(hiwho.9'ce',28,'.')'ca'left(hiwhat.9,10)
tr '[16;20Hc5       'left(hiwho.10'c6',28,'.')'c2'left(hiwhat.10,10)
se '[18;21Hc6Press cfENTER c6to continue...i1'
if pog=0 then call MENU
tr '[2J[[5;20H[41m    [33mLemonade Stand Top Highest POG Scores    [40m'
tr '[7;20Hcd       'left(hiwho.1'ce',28,'.')'ca'left(hipog.1,10)
tr '[8;20Hc5       'left(hiwho.2'c6',28,'.')'c2'left(hipog.2,10)
tr '[9;20Hcd       'left(hiwho.3'ce',28,'.')'ca'left(hipog.3,10)
tr '[10;20Hc5       'left(hiwho.4'c6',28,'.')'c2'left(hipog.4,10)
tr '[11;20Hcd       'left(hiwho.5'ce',28,'.')'ca'left(hipog.5,10)
tr '[12;20Hc5       'left(hiwho.6'c6',28,'.')'c2'left(hipog.6,10)
tr '[13;20Hcd       'left(hiwho.7'ce',28,'.')'ca'left(hipog.7,10)
tr '[14;20Hc5       'left(hiwho.8'c6',28,'.')'c2'left(hipog.8,10)
tr '[15;20Hcd       'left(hiwho.9'ce',28,'.')'ca'left(hipog.9,10)
tr '[16;20Hc5       'left(hiwho.10'c6',28,'.')'c2'left(hipog.10,10)
se '[18;21Hc6Press cfENTER c6to continue...i1'
call MENU

READHIGHS:
    if ~exists(path'LEMON.HIGHS') then do
        call open(f1,path'LEMON.HIGHS','w')
            do i=1 to 10 ; call writeln(f1,'No One Yet|0|x') ; end i
        call close(f1) ; end
    call open(f1,path'LEMON.HIGHS','r') ; do i=1 to 10
        hi.i=readln(f1) ; parse var hi.i hiwho.i'|'hiwhat.i'|'junk ; end i
    call close(f1)
    if ~exists(path'LEMON.PHIGH') then do
        call open(f1,path'LEMON.PHIGH','w')
            do i=1 to 10 ; call writeln(f1,'No One Yet|0|x') ; end i
        call close(f1) ; end
    call open(f1,path'LEMON.PHIGH','r') ; do i=1 to 10
        hi.i=readln(f1) ; parse var hi.i hipwh.i'|'hipog.i'|'junk ; end i
    call close(f1)
  return

CHECKHIGH:
call CHECK
if treward=0 then treward='No'
tsales.play=tsales
    if tsales.play>hiwhat.10 then do ; hiwhat.10=tsales ; hiwho.10=handle
        se '[9;0Hc6A cbNEW ceHigh Scorec6... cfYou are Rewarded ca'treward' cfExtra minutes this callc9! ' ; addtime treward ; do i=1 to 10
        if hiwhat.10>hiwhat.i then do
            ts=hiwhat.i ; th=hiwho.i ; hiwhat.i=hiwhat.10 ; hiwho.i=hiwho.10
            hiwhat.10=ts ; hiwho.10=th ; end ; end i ; end
    se 'w1cbSavings2k1........q1' ; call open(f1,path'LEMON.HIGHS','w')
    do i=1 to 10 ; call writeln(f1,hiwho.i'|'hiwhat.i'|x') ; end i
    call close(f1) ; tr 'w1'sp
pog.play=pog
    if pog.play>hipog.10 then do ; hipog.10=pog ; hipwh.10=handle
        se '[9;0Hc6A cbNEW ceHigh Scorec6... cfYou are Rewarded ca'treward' cfExtra minutes this callc9! ' ; addtime treward ; do i=1 to 10
        if hipog.10>hipog.i then do
            ts=hipog.i ; th=hipwh.i ; hipog.i=hipog.10 ; hipwh.i=hipwh.10
            hipog.10=ts ; hipwh.10=th ; end ; end i ; end
    se 'w1cbSavings2k1........q1' ; call open(f1,path'LEMON.PHIGH','w')
    do i=1 to 10 ; call writeln(f1,hipwh.i'|'hipog.i'|x') ; end i
    call close(f1) ; tr 'w1'sp
  return

INST:
call CHECK
sf path1'INST.ANS'
tr ''
tr ' cePress Any ccKEY ceTo Continue...g1f1'
call MENU

OOPS:
call CHECK
tr ''
tr 'c9Oopsca, c9seems that you do not have enough money for the suppliesca.'
tr 'cePress Any ccKEY ceTo Continue...g1f1'
tr ''
call MAIN

BROKE:
call CHECK
if exists(dfile) then do ; address command 'DELETE "'dfile'"'
tr ''
tr 'ceOh noca! ceYou are too broke to continueca... ceIca''cem sorryca, cemaybe next yearca.w2'
tr 'cfHeading off to summer campca, cfz1 YUCK! z0 cf:(w2'
tr 'cePress Any ccKEY ceTo Continue...g1f1'
tr ''
call CHECKHIGH
call QUIT

SORRY:
call CHECK
tr ''
tr 'cfIca''cfm SORRYca, cfbut you must have IBM ANSI term to play Lemonade Standca.'
tr 'cfNow returning to cc'sys' BBSca!'
tr ''
call QUIT

SORRY1:
call CHECK
tr ''
tr 'cfIca''cfm SORRYca, cfbut you must have at least an 80 column screen to playca.'
tr 'cfNow returning to cc'sys' BBSca!'
tr ''
call QUIT

QUIT:
call CHECK
tr ''
sf path1'END.ANS'
tr ''
tr 'cfNow returning to ce'sys' cfBBSc9!'
changewhere oldwh ; exit

SAVEGAME:
  if tsales<5.00 then call RESET
    call open(f1,dfile,"w")
       call writeln(f1,handle"|"day"|"tsales"|"rday"|"ver"|"nl"|"pog"|"sm"|"cog"|x")
  call close(f1)
return   

NEWSTATS:
  call CHECK
  tr ''
  tr '  cfLooks like we have a new kid on this blockc9!'
  tr '  cfLets see if you have what it takes to make itc9!'  
  tr '  cePress Any ccKEY ceTo Continue...g1f1'
  month=31 ; day=0 ; tsales=5.00 ; price=0 ; rday=0 ; nl=0 ; pog=0 ; slm=0 ; slampwr=0 ; cog=0
call WMAP

RESET:
  call CHECK
    tr 'ccOopsca! cfIm sorryca, cfbut your game can not be savedca.'
    tr 'cfYou can not save ifca: cfYou are on day cd31 cfOR have less than cd$5.00'
    tr 'cfIn this case the reason is becauseca...'
    if day=31 then tr 'cfYou quit on day cd31'
    if tsales<5.00 then tr 'cfYou have less than cd$5.00 cfon youca.'
  tr 'cePress Any ccKEY ceTo Continue...g1f1'
call QUIT  

DCHECK:
if day=month then call END
if day>month then call END
day=day+1
return   

OLDGAME:
call CHECK
tr 'cfIt looks as though the game has been upgraded to a new version since'
tr 'cfyou last playedca. cfIn order to prevent any problems we will delete your'
tr 'cfold saved game file and let you start a new gameca.'
tr 'cePress Any ccKEY ceTo Continue...g1f1'
if exists(dfile) then do ; address command 'DELETE "'dfile'"'
call NEWSTATS

THIEF:
call CHECK
snk=random(1,2,time('s'))
if snk=1 then call THIEF1
if snk=2 then call THIEF2
call THIEF

THIEF1:
call CHECK
mny=random(1,20,time('s'));tsales=tsales-mny;if tsales<0 then tsales=0
tr 'f1cfWhen no one is lookingca, cfyou run down the street and try to rob the other'
tr 'cflemonade stand and k1s6..........q1c9 Fail!w2'
tr ''
tr 'cfNot only did you fail but while you where goneca, cfthe bully down the'
tr 'cfstreet came by and robbed youca! cfYou lost ce'mny' cfdollars...'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call FDAY

THIEF2:
call CHECK
mny=random(5,25,time('s'));tsales=tsales+mny
tr 'f1cfWhen no one is lookingca, cfyou run down the street and try to rob the other'
tr 'cflemonade stand and k1s6..........q1c9 Success!w2 cfcfYou came out with ce'mny' cfdollars...'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call FDAY

SSTORE:
call CHECK
tr 'c9Specialw2'
if tsales>maxi then call TOORICH
sf path1'GROC1.ANS'
tr ''
tr 'cfOk kid, what will it beca? '
se 'cfYou have ce$'tsales'ca, cfPlease selectca? cf'; gc ; menu=result ; call CHECK
if index("AGSLUV",MENU)=0 & C2D(MENU)~=27 THEN DO
    tr 'n1cfPlease pick an option from the listca.w3';signal SSTORE;end
if menu='A' then call LOAN
if menu='G' then call GAMBLE
if menu='S' then call SHOPLIFT
if menu='L' then call LOOK
if menu='U' then do; bbscommand who;tr '';tr 'cePress Any ccKEY ceTo Continue...g1f1';signal SSTORE;end
if menu='V' then do; bbscommand olm;signal SSTORE;end
if C2D(menu)=27 then call MAIN
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call MAIN

TOORICH:
call CHECK
day=day-1;rain=99
call MAIN

LOAN:
call CHECK
if nl=1 then call NOLOAN
ln=random(1,3,time('s'))
tr 'Hey storekeeper, how about a loanw2'
if ln=1 then call LOAN1
if ln=2 then call LOAN2
if ln=3 then call LOAN3
call MAIN

LOAN1:
call CHECK
nl=0
tr 'cfSorry kidca, cfthis ainca''cft no bankca!'
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call MAIN

LOAN2:
call CHECK
nl=0
tr 'cfSorry kidca, cfthis ainca''cft no bankca!'
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call MAIN

LOAN3:
call CHECK
nl=1
tr 'cfOk kidca, cfI will loan you $5.00ca! cfYou will repay $10.00 at the end of the monthca.'
tsales=tsales+5.00
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call MAIN

NOLOAN:
call CHECK
tr 'Hey storekeeper, how about a loanw2'
tr 'cfWhatca?! cfYou againca? cfSorry kidca, cfI have already given you a loan this monthca.'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call MAIN

GAMBLE:
call CHECK
tr 'Hey storekeeper, let''s gamblew2'
if pog=0 then call NGAMBLE
tr ''
tr 'cfOk kidca, cfthis aint no Vegas casino but I will play a simple game with youca.'
tr 'cfIf you winca, cfI will give you cd$5ca, cfbut if I win you give me cd1 cfpogca.'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
tr ''
tr 'cfOk kidca, cfhear are the ground rulesca. cfYou need what I got so I make the rulesca.'
tr 'cfI am going to flip my lucky silver dollarca, cfif it is tails then you winca, cfbut'
tr 'cfif it is headsca, cfthen I win 1 of your pogca''cfsca.'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1'
toss=random(1,100,time('s'))
if toss<50 then call TOSSW
if toss>50 then call TOSSL
if toss=50 then call TOSST
call MAIN

TOSSW:
call CHECK
tr ''
tr 'cfLookca''cfs like ol lucky done gone and let me down againca.'
tr 'cfYou win this time kidca, cfI will give you cd$5 cfdollarsca.'
tr ''
tsales=tsales+5.00
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call MAIN

TOSSL:
call CHECK
tr ''
tr 'cfToo bad kidca, cfyou lostca. cfI get 1 of your pogca''cfsca.'
tr ''
pog=pog-1
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call MAIN

TOSST:
call CHECK
tr ''
tr 'cfDangca! cfItca''cfs a tieca. cfWhat are the odds of it landing on itca''cfs edge like thatca?'
tr 'cfOh wellca, cfbetter luck to us both next timeca.'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call MAIN

NGAMBLE:
call CHECK
tr ''
tr 'cfSorry kidca, cfthis aint no Vegas casinoca.'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call MAIN

NOWAY:
call CHECK
tr ''
tr'cfNo way manca! cfYou have already gotten cought once this monthca.'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call MAIN

SHOPLIFT:
call CHECK
tr 'Hmm, this looks nicew2'
if cog=1 then call NOWAY
slprct=random(1,100,time('s'))
if slprct<26 then call SHOPLIFT1
if slprct=50 then call SHOPLIFT2
if slprct>74 then call SHOPLIFT3
tr ''
tr 'cfOh manca! cfYou just got busted for shopliftingca!! cfYour in c9BIG cftroubleca!'
if pog=0 then call BUSTED
tr 'cfThe storekeeperca, cfbeing a kind manca, cftakes you aside and explains to you'
tr 'cfthe error of your waysca. cfHe will let you off this time but he takes cdALL cfof'
tr 'cfpogca''cfs as punishmentca.'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
pog=0;cog=1
call MAIN

BUSTED:
call CHECK
tr ''
tr 'cfOh manca! cfYou just got busted for shopliftingca!! cfYour in c9BIG cftroubleca!'
tr 'cfThe police come and take you to the stationca. cfThey call your father and he comes'
tr 'cfdown and is very upsetca! cfYou are grounded untill summer campca...'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
if exists(dfile) then do ; address command 'DELETE "'dfile'"'
call QUIT

SHOPLIFT1:
call CHECK
tr ''
tr 'cfYou start to pick up lemons and suger when you notice the security'
tr 'cfcameras in the store have been following you around ever since you'
tr 'cfentered the storeca. cfYou feel that this is not a good time to tryca.'
tr 'cfYou put the lemons and suger back and head for the front doorca!'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call MAIN

SHOPLIFT2:
call CHECK
illgot=random(25,150,time('s'));tsales=tsales+illgot
tr ''
tr 'cfWhat Luckca! cfThe storekeeper goes off to the stockroom to help the stocker'
tr 'cfand leaves the cashregister openca. cfYou a quick but quite grab at all the'
tr 'cfbills and leaveca. cfA block awayca, cfyou stop and count your ill gotten gainsca.'
tr 'cfCarefull counting shows that you made off with ce$'illgot' cfdollarsca!'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call MAIN

SHOPLIFT3:
call CHECK
tr ''
tr 'cfYou pocket lemons and suger untill they start to buldgeca.'
illg=random(1,4,time('s'))
if illg=1 then call ILLGOTA
if illg=2 then call ILLGOTB
if illg=3 then call ILLGOTC
if illg=4 then call ILLGOTD
call SHOPLIFT3

ILLGOTA:
call CHECK
tr 'cfYou get enough supplies for 25 peopleca.'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
supply=25
call MAIN1

ILLGOTB:
call CHECK
tr 'cfYou get enough supplies for 50 peopleca.'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
supply=50
call MAIN1

ILLGOTC:
call CHECK
tr 'cfYou get enough supplies for 75 peopleca.'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
supply=75
call MAIN1

ILLGOTD:
call CHECK
tr 'cfYou get enough supplies for 100 peopleca.'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
supply=100
call MAIN1

LOOK:
call CHECK
lk=random(1,3,time('s'))
tr 'Looking for change in the streetw2'
if lk=1 then call LOOK1
if lk=2 then call LOOK2
if lk=3 then call LOOK3
call MAIN

LOOK1:
call CHECK
tr 'cfYou look around all day but find nothingca.'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call MAIN

LOOK2:
call CHECK
pog=pog+1
tr 'cfYou find a pog milk capca, cfand it is one that you needed tooca!'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call MAIN

LOOK3:
call CHECK
fnd=random(2,8,time('s'))
tr 'cfWhat luckca! cfYou find 'fnd' dollars in small changeca.';tsales=tsales+fnd
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call MAIN

PLYGRND:
call CHECK
tr 'c9Playgroundw2'
tr ''
/* This is where the POG game will be once it is added - Look for it in v3.0 */
tr 'cfYou leave the store and head to the local playgroundca.'
tr 'cfIt looks as though none of your friends are here todayca.'
tr 'cfSince no one is here today, you head back to the storeca.'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call MAIN

SLSHP:
call CHECK
if pog=0 then call MENU
sf path1'PSS.ANS'
tr ''
tr 'cePress Any ccKEY ceTo Continue...g1f1'
call MENU

CHECK:
if result~='###PANIC' then return
call SAVEGAME  
tr 'f1n9ccLemonade Stand!n2c9Loss of Carrier!'
logentry 'No Carrier in Lemonade Stand!' ; bufferflush
exit

SYNTAX: ; ERROR: ; IOERR:
  call SAVEGAME
    tr 'n2ce*** c9BOOM ce*** c9Error Detectedce!' ; tr 'c6ERc9:cb'rc' c6(ca'errortext(rc)'c6) @ cf'sigl
    tr 'cdSysop has been notified...' ; logentry 'ER:'rc' ('errortext(rc)') @ 'sigl
    logentry 'while playing Lemonade Stand!' ; bufferflush
  exit

/* EOF */