You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

437 lines
15 KiB
Plaintext

6 years ago
rv=1.05:goto@instructions {because we're sticking subroutines up here}
£home {replaces home and rewrites only inverted bar - spc(40) doesn't have desired effect}
poke36,0:poke37,1:call -958:inverse:?" ":normal:?:?:return
6 years ago
£wait {ubiquitious "Press ENTER to continue}
6 years ago
?:input"Press enter to continue.";x$:return
[
Bunch of positions I use commonly.
]
6 years ago
£twofifteen
6 years ago
vtab2:htab15:return
6 years ago
£twosixteen
6 years ago
vtab2:htab16:return
6 years ago
£twoseventeen
6 years ago
vtab2:htab17:return
6 years ago
£twoeighteen
6 years ago
vtab2:htab18:return
6 years ago
£twonineteen
6 years ago
vtab2:htab19:return
6 years ago
£jetalthere
6 years ago
inverse:gosub@twonineteen:?"Jet":normal:return
6 years ago
£timera
6 years ago
forj=1to2500:next j:k=int(rnd(1)+.5):return
6 years ago
£timerb
6 years ago
forj=1to1000:next j:return
6 years ago
£timerc
6 years ago
forj=1to2000:next j:return
6 years ago
[
6 years ago
Rather than repeat the logic to check if a purchase or sale is valid based on inventory or wallet amount; we write either our drug inventory or the number we can afford to J; jump to these subroutines to ask for the amount; run the logic; and just return back to the subroutine if the buy/sale is valid...whichthenadjusts inventory and wallet. Otherwise we dump back to the menu.
6 years ago
]
£howmuchbuy {some common purchase code}
6 years ago
?"You can afford ";j:?"You can carry ";f
6 years ago
£howmanybuy
6 years ago
?:input"How many? (Enter 0 cancel):";k:ifK=0goto@menu
ifk<ACtheninverse:?"STOP CHEATING!":normal:AD=AD+1:gosub@cheater:gosub@TIMERC:goto@MENU
ifk<0thenad=ad+1:gosub@cheater:return
ifk>ftheninverse:?"You can't carry that much!":normal:goto@howmanybuy
ifk>jtheninverse:?"You can't afford that much!":normal:goto@howmanybuy
6 years ago
return
£howmuchsell {common sell code}
6 years ago
?"You can sell:";j:?
6 years ago
£howmanysell
6 years ago
input"How many? (Enter 0 to cancel.):";k
ifK=0goto@menu
ifk>jthen?"You don't have that many!":goto@howmanysell
6 years ago
return
£freespace
f=i-((g*5)+m+n+o+u+t+q):return
£chase
6 years ago
inverse:gosub@twofifteen:?"Being Chased":normal:return
6 years ago
£gmod
6 years ago
speed=100:gosub@twosixteen:inverse:?"Game Over":normal:speed=255:return
6 years ago
£bronxcheck
6 years ago
ifp$="THE BRONX"then return
?"you need to head to the bronx":?"to take care of this business."
gosub@timerc:goto@menu
£cheater
ifad>=3thengoto@threestrikes
return
6 years ago
£daily {randomizes drug prices, adds a day, calculates interests, checks day number}
6 years ago
c=int(rnd(1)*12000+16000.5):h=int(rnd(1)*7000+5000.5):a=int((rnd(1)*34+10)*100+.5):z=int((rnd(1)*42+33)*10+.5):s=int((rnd(1)*15+7)*10+.5):l=int((rnd(1)*4+1)*10+.5):b=int(rnd(1)*20+.5):d=d+1:ac=int(((rnd(1)*3)+1)*-1)
6 years ago
£checkday {so I can check the day by itself}
6 years ago
ifD>=31goto@endgame:return
6 years ago
£scorecalculate
6 years ago
k=(w+e)-v:ifk<0thenk=0:return
k=int(sqr((k/31.5)+.5)):ifk>100thenk=100
6 years ago
return
£gamestart {set wallet, debt, location, inventory space, zero out inventory}
6 years ago
w=2000:e=0:v=5000:p$="The Bronx":g=0:i=100:m=0:n=0:o=0:u=0:t=0:q=0:gosub@daily:home:htab16:?"Drugwar//e":goto@menu
6 years ago
£menu {main menu. everything should loop back here}
6 years ago
gosub@home:gosub@freespace
inverse:vtab2:htab4:?"Day:"D:gosub@twoeighteen:?"Location:"p$:normal
vtab4:?"(C)heck Prices":?"(T)renchcoat":?"(B)uy":?"(S)ell":?"(J)et":?"See (L)oan shark":?"(V)isit Bank":?
input"Please make your selection:";x$
ifx$="C"goto@prices
ifx$="T"goto@inventory
ifx$="B"goto@buy
ifx$="S"goto@sell
ifx$="J"goto@jet
ifx$="L"goto@loan
ifx$="V"goto@bank
goto@menu
6 years ago
[
£debug
6 years ago
?"Testing Screen"
6 years ago
?
6 years ago
?"(w)allet,(g)uns,(v)debt,(e)savings,(i)nventory space"
input"What to change?";db$
input"To?";dx
ifdb$="w"then w=dx
ifdb$="g"then g=dx
ifdb$="v"then v=dx
ifdb$="e"then e=dx
ifdb$="i"then i=dx
goto@menu
6 years ago
]
£prices
6 years ago
gosub@home
inverse:gosub@twoeighteen:?"Prices":normal
?:?"cocaine:","$"c:?"heroin:","$"h:?"acid:","$"a:?"weed:","$"z:?"speed:","$"s:?"ludes:","$"l:?"wallet:","$"w
gosub@wait:goto@menu
6 years ago
£inventory
6 years ago
gosub@home
6 years ago
6 years ago
inverse:gosub@twosixteen:?"Trenchcoat":normal
?:?"cocaine:",m:?"heroin:",n:?"acid:",o:?"weed:",u:?"speed:",t:?"ludes:",q:?"free space:",f
gosub@wait:goto@menu
6 years ago
£buy
6 years ago
gosub@home
6 years ago
6 years ago
inverse:gosub@twonineteen:?"Buy":normal
?:?"What do you want to buy?":?:?"(C)ocaine":?"(H)eroin":?"(A)cid":?"(W)eed":?"(S)peed":?"(L)udes"
input"Enter Selection:";x$
ifx$="c"goto@cokebuy
ifx$="h"goto@herbuy
ifx$="a"goto@acidbuy
ifx$="w"goto@weedbuy
ifx$="s"goto@spdbuy
ifx$="l"goto@ludbuy
goto@menu
6 years ago
£sell
6 years ago
gosub@home:inverse:gosub@twoeighteen:?"Sell":normal
?:?"What would you like to sell?":?:?"(C)ocaine":?"(H)eroin":?"(A)cid":?"(W)eed":?"(S)peed":?"(L)udes"
6 years ago
£sellsel
6 years ago
input"Enter Selection:(0 to cancel)";x$
ifx$="c"goto@cokesell
ifx$="h"goto@hersell
ifx$="a"goto@acidsell
ifx$="w"goto@weedsell
ifx$="s"goto@spdsell
ifx$="l"goto@ludsell
ifx$="0"goto@menu
?"Invalid Selection!":goto@sellsel
6 years ago
£jet
6 years ago
gosub@home:gosub@jetalthere
?:?"(B)ronx":?"(G)hetto":?"(C)entral Park
?"(M)anhattan":?"Coney (I)sland":?"Broo(K)lyn":?"(O)ops...stay!":input"Where to dude?";x$
ifx$="B"then y$="The Bronx":goto@jetb {we can use strings}
ifx$="G"then y$="The Ghetto":goto@jetb
ifx$="C"then y$="Central Park":goto@jetb
ifx$="M"then y$="Manhattan":goto@jetb
ifx$="I"then y$ ="Coney Island":goto@jetb
ifx$="K"then y$="Brooklyn":goto@jetb
ifx$="O"thengoto@menu
{ifx$="COPTEST"then b=5:goto@police}
goto@jet
6 years ago
£jetb
6 years ago
{input"event:";ev testing/debug}
ify$=p$thengoto@alreadythere {more advanced than Bronx only on TI}
p$=y$ {it's valid, copy it and move along}:y$=""
goto@subway
6 years ago
£loan
6 years ago
gosub@home:inverse:gosub@twosixteen:?"Loan Shark":normal:?:gosub@bronxcheck:?"Your debt is:$";v:?"You have:$";w:?:input"(R)epay, (B)orrow, (L)eave:";X$
ifX$="R"THENgoto@payme
ifX$="B"Thengoto@borrow
ifX$="L"thengoto@Menu
goto@loan
6 years ago
£bank
6 years ago
gosub@home:inverse:gosub@twofifteen:?"Bank O'Murica":normal:?:gosub@bronxcheck:?"Your balance:$";e:?"Your wallet:$";w:?
input"(D)EPOSIT, (W)ITHDRAW, (L)EAVE:";X$
ifx$="d"thengoto@deposit
ifx$="w"thengoto@mymoney
ifx$="l"thengoto@menu
{ifx$=eg$thengoto@egg}
goto@bank
[
How buy works:
divide wallet by drug price - write to J
hand to subroutine, it handles buy logic
if pass subroutine-logic, return to actually complete
]
6 years ago
£cokebuy
6 years ago
gosub@home:inverse:gosub@twosixteen:?"Buy Cocaine":normal:?:j=int(w/c):AC=0:gosub@howmuchbuy:m=m+k:w=w-(c*k):goto@menu
6 years ago
£herbuy
6 years ago
gosub@home:inverse:gosub@twosixteen:?"Buy Heroin":normal:?:j=int(w/h):AC=0:gosub@howmuchbuy:n=n+k:w=w-(h*k):goto@menu
6 years ago
£acidbuy
6 years ago
gosub@home:inverse:gosub@twoseventeen:?"Buy Acid":normal:?:j=int(w/a):gosub@howmuchbuy:o=o+k:w=w-(a*k):goto@menu
6 years ago
£weedbuy
6 years ago
gosub@home:inverse:gosub@twoseventeen:?"Buy Weed":normal:?:j=int(w/z):gosub@howmuchbuy:u=u+k:w=w-(z*k):goto@menu
6 years ago
£spdbuy
6 years ago
gosub@home:inverse:gosub@twoseventeen:?"Buy Speed":normal:?:j=int(w/s):gosub@howmuchbuy:t=t+k:w=w-(s*k):goto@menu
6 years ago
£ludbuy
6 years ago
gosub@home:inverse:gosub@twoseventeen:?"Buy Ludes":normal:?:j=int(w/l):gosub@howmuchbuy:q=q+k:w=w-(l*k):goto@menu
[
6 years ago
6 years ago
How sell works:
write inventory to J
run subroutine with logic
if pass subroutine, adjust wallet and inventory
]
6 years ago
£cokesell
6 years ago
gosub@home:inverse:gosub@twofifteen:?"Sell Cocaine":normal:?:j=m:gosub@howmuchsell:m=m-k:w=w+(c*k):goto@menu
6 years ago
£hersell
6 years ago
gosub@home:inverse:gosub@twoseventeen:?"Sell Heroin":normal:?:j=n:gosub@howmuchsell:n=n-k:w=w+(h*k):goto@menu
6 years ago
£acidsell
6 years ago
gosub@home:inverse:gosub@twoseventeen:?"Sell Acid":normal:?:j=o:gosub@howmuchsell:o=o-k:w=w+(a*k):goto@menu
6 years ago
£weedsell
6 years ago
gosub@home:inverse:gosub@twoseventeen:?"Sell Weed":normal:?:j=u:gosub@howmuchsell:u=u-k:w=w+(z*k):goto@menu
6 years ago
£spdsell
6 years ago
gosub@home:inverse:gosub@twosixteen:?"Sell Speed":normal:?:j=t:gosub@howmuchsell:t=t-k:w=w+(s*k):goto@menu
6 years ago
£ludsell
6 years ago
gosub@home:inverse:gosub@twosixteen:?"Sell Ludes":normal:?:j=q:gosub@howmuchsell:q=q-k:w=w+(l*k):goto@menu
6 years ago
£alreadythere
6 years ago
gosub@home:gosub@jetalthere:?:?"You're already in:":htab15:? p$:gosub@timerc:goto@jet
6 years ago
£subway
6 years ago
gosub@home:gosub@daily:V=int(V*1.1+.5):E=int(E*1.06+.5):inverse:gosub@twoeighteen:?"Subway":normal:?:?
ifb=1goto@cheapludes
ifb=2goto@cheepweed
ifb=3goto@pigheroin
ifb=4goto@heroinbust
ifb=5goto@heroinbust
ifb=6goto@cokebust
ifb=7goto@cokebust
ifb=8goto@mugged
ifb=9goto@cops
ifb=10goto@cops
ifb=11goto@cops
ifb=12goto@gunbuy
ifb=13goto@gunbuy
ifb=14goto@dedweed
ifb=15goto@newcoat
ifb=16oto@dedguy
ifb=17goto@homeacid
6 years ago
£nothinghappens
6 years ago
?:?"Welcome to ";p$:?:gosub@timerc:goto@menu
6 years ago
£cheapludes
6 years ago
?"Rival dealers are selling cheap ludes!":l=2:gosub@timerc:goto@menu
6 years ago
£cheepweed
6 years ago
?"Weed prices have bottomed-out!":z=122:gosub@timerc:goto@menu
6 years ago
£pigheroin
6 years ago
?"Pigs are selling cheap heroin":?"from last week's raid!":h=int((rnd(1)*1150)+850.5):gosub@timerc:goto@menu
6 years ago
£heroinbust
6 years ago
?"Addicts are buying heroin":?"at outrageous prices!":h=int((rnd(1)*25000)+18000.5):gosub@timerc:goto@menu
6 years ago
£cokebust
6 years ago
?"Pigs made a big coke bust!":?"Prices are outrageous!!!!":c=int((rnd(1)*60000)+80000.5):gosub@timerc:goto@menu
6 years ago
£mugged
6 years ago
?"You got mugged!":?:j=int((w/3)*2):?"You lost $";w-j:w=w-j:gosub@timerc:goto@menu
6 years ago
£cops
gosub@freespace:iff<i/2thengoto@nothinghappens
6 years ago
ifb=9thenb=2
ifb=10thenb=4
ifb=11thenb=5
?"It's the cops!":?:?"Officer Hardass and ";B-1;"of his":?"deputies are after you!":?:gosub@timerc:goto@police
6 years ago
£police
6 years ago
gosub@home:gosub@chase:?:?:?"View (G)uns":?"View (D)amage":?"(N)umber of pigs":?"(R)un":?"(F)ight":?
input"What do you want to do?";x$
ifx$="G"goto@pgun
ifx$="D"goto@damage
ifx$="N"goto@ncops
ifx$="R"goto@run
ifX$="F"goto@fight
goto@police
6 years ago
£pgun
6 years ago
gosub@home:gosub@chase:?:?:?"You have ";g;"guns.:?:gosub@wait:goto@police
6 years ago
£damage
6 years ago
gosub@home:gosub@chase:?:?:?"Your health is ";bb;".":?:?"0 and you die!":?:gosub@wait:goto@police
6 years ago
£ncops
6 years ago
gosub@home:gosub@chase:?:?:?"There are ";b;"pigs still chasing you!":?:?:gosub@wait:goto@police
6 years ago
£run
6 years ago
gosub@home:gosub@chase:?:?:?"RUNNING...":gosub@timera:ifk=0then?"You lost them in an alley!":gosub@timerc:goto@menu
?"You can't shake them!":?:goto@next
6 years ago
£fight
6 years ago
ifg<=0then?:?:?"YOU DON'T HAVE ANY GUNS!":gosub@wait:goto@police
gosub@home:gosub@chase
?:?"You shoot!":gosub@timera:ifK=0thengoto@miss
?"You got one!":b=b-1: goto@next
6 years ago
£miss
6 years ago
?"You missed!"
6 years ago
£next
6 years ago
?:?:ifb<=0thengoto@allgone
gosub@timerb:?"They're firing at you!":gosub@timera:ifk=0thengoto@theymiss
?"You've been hit!":bb=bb-6:ifbb>=0goto@ded
goto@nexta
6 years ago
£theymiss
6 years ago
?"They missed!"
6 years ago
£nexta
6 years ago
gosub@timera:goto@police
6 years ago
£ded
6 years ago
?:?"You've been killed!":gosub@wait:goto@endgame
6 years ago
£allgone
6 years ago
?"You killed all of them!":?:gosub@timera
j=int(((rnd(1)*1250)+750)+.5):w=w+j
?"You found $";j;"on officer Hardass'"
?"carcass!"
ifw>=1200thengoto@doctor
goto@menu
6 years ago
£doctor
6 years ago
gosub@timerc:?:?"Will you pay $1000 for a doctor":input"to sew you up? (Y/N)";x$
ifX$<>"Y"thengoto@menu
w=w-1000:bb=100:goto@menu
6 years ago
£gunbuy
ifw<500thengoto@nothinghappens:gosub@freespace:iff<5thengoto@nothinghappens
6 years ago
j=int((rnd(1)*2)+.5)
ifj=0theny$="Baretta"
ifj=1theny$="Saturday Night Special"
ifj=2theny$=".44 Magnum"
?"Will you buy a ";y$:input"for $400? (Y/N)";x$:ifx$<>"Y"thengoto@menu
g=g+1:w=w-400:goto@menu
6 years ago
£dedweed {don't smoke the weed}
6 years ago
?"There's some weed here that smells":?"like good stuff!!":?:input"Will you smoke it? (Y/N)";X$
ifX$="Y"THENgoto@weedend
6 years ago
goto@menu
£newcoat
6 years ago
ifw<300thengoto@nothinghappens
?"Will you buy a new trenchcoat":input"with more pockets for $200? (Y/N)";X$
ifX$<>"Y"thengoto@menu
i=i+10:w=w-200:goto@menu
6 years ago
£dedguy
6 years ago
gosub@freespace
iff<8thengoto@nothinghappens
j=int((rnd(1)*7)+1.5):k=int(rnd(1)*5+.5)
ifk=0thenq=q+j:y$="Ludes"
ifk=1thent=t+j:y$="Speed"
ifk=2thenu=u+j:y$="Weed"
ifk=3theno=o+j:y$="Acid"
ifk=4thenn=n+j:y$="Heroin"
ifk=5thenm=m+j:y$="Coke"
?"You found "j"units of "Y$:?"on a dead dude in the subway!":?:gosub@timerc:goto@menu
6 years ago
£homeacid
6 years ago
?"The market has been flooded":?"with cheap home-made acid!":a=int((rnd(1)*550)+250.5):gosub@timerc:goto@menu
6 years ago
£payme
6 years ago
input"Repay how much?";k:ifk=0then?"Get out of here, loser!":gosub@timerb:goto@menu
ifk>wthen?:?"YOU DON'T HAVE THAT MUCH!":gosub@timerb:goto@LOAN
ifk>vthen?:?"YOU DON'T OWE THAT MUCH!":gosub@timerb:goto@LOAN
W=W-k:v=v-k:?:?"THANK YOU.":gosub@timerc:goto@MENU
6 years ago
£borrow
6 years ago
?:j=int((rnd(1)*10000)+4000):input"How much do you want?";K:?:ifk=0goto@menu
ifk<0then?"Trying to cheat? Double debt!":AD=ad+3:v=v*2:gosub@timerC:gosub@cheater:goto@menu
ifK>14000then?"He's not that stupid!":gosub@timerc:goto@menu
ifK>Jthen?"He doesn't feel like it.":gosub@timerb:goto@menu
v=v+k:w=w+k:?:?"Here's your money.":?:?"Remember, I break thumbs.":gosub@timerc:goto@menu
6 years ago
£deposit
6 years ago
?:k=int((rnd(1)*100)+1):input"How much?";j:ifj=0goto@menu
ifj>wthen?"You don't have that much cash.":goto@deposit
ifk=2thengoto@chaching
ifj<0then?"You tried to rob the bank, but barely":?"made it out with nothing.":ad=ad+3:gosub@timerC:goto@menu
£chaching
e=e+j:w=w-j:?:?"Thank you for your deposit.":gosub@timerc:goto@menu
6 years ago
[
£egg
6 years ago
?"You found the easter egg!"
6 years ago
?
6 years ago
?"$1,000,000 has been deposited in to your account."
gosub@timerc
goto@bank
6 years ago
]
£mymoney
6 years ago
?:input"How much?";j
ifj<0then?"Try making a deposit.":gosub@timerc:goto@bank
ifj>ethen?"You don't have sufficient funds.":goto@mymoney
e=e-j:w=w+j:?:?"Thank you for your business.":gosub@timerc:goto@menu
6 years ago
£instructions
6 years ago
home:vtab2:htab10:?"Welcome to Drugwar//e":htab14:?"Version ";rv:vtab8:htab3:?"Based on the classic TI-BASIC clone":htab2:?"of John E. Dell's 1984 IBM/TRS80 game.":vtab12:htab6:?"Applesoft version by:Jay Moore"
vtab19:input"Would you like instructions? (Y/N):";X$:j =RND(-1 *(PEEK(78)+256*PEEK(79))):ifX$="Y"THENgoto@inst
goto@gamestart
6 years ago
£inst
6 years ago
home:?:?"This is a game of buying and selling.":?"Your goal is to pay off your debt and":?"make as much money as possible in a one":?"month period. Prices fluctuate every dayand interest on your loan is calculated as well."
?:?"If you deal too heavily, you'll attract the attention of the police.":?:?"Commands are entered using the letter highlighted (L)ike (S)o. Y is yes and anything counts as no.":gosub@wait:goto@gamestart
£threestrikes
6 years ago
home:htab8:vtab10:?"Put a quarter in your ass":gosub@timerb:htab7:?"'Cause you played yourself!":gosub@timerc:gosub@timerc:vtab19:htab11:?"Don't cheat so much.":gosub@timerc:gosub@timerc:gosub@timerc:clear:end
6 years ago
£weedend
6 years ago
gosub@home:inverse:gosub@twofifteen:?"SMOKE Weed":NORMAL:speed=50:?"You hallucinate on the wildest trip":?"of your life, stumble on to the tracks,":?"and get creamed by a train!":?:?
htab10:?"Just say NO to drugs!":speed=255:gosub@timerc:gosub@timerb:goto@ironicend
6 years ago
£endgame
6 years ago
gosub@home:gosub@scorecalculate:gosub@gmod:?:?"Your score on a scale of 1 to 100:";k:?
input"Would you like to play again? (Y/N)";x$:ifx$="Y"thengoto@gamestart
?"Don't forget to watch your back!":?:?"Thanks for playing.":?"Have a nice day"
6 years ago
£ironicend
6 years ago
gosub@home:gosub@gmod:?:speed=50:?"You died from smoking weed.":?:?:gosub@timerc:?"See? Games are totally fake.":speed=255:?:input"Would you like to play again?";x$:ifx$= "Y"THENgoto@GAMESTART
clear:end
rem Drugwar//e - Version 1.05
rem 5-NOV-2018
rem Copyright 2018 Jay Moore
rem gitlab.com/dewdude/drugwar2e
rem twitter:_nq4t
6 years ago