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.

764 lines
17 KiB
Plaintext

6 years ago
rem Drugwar//e - Beta 9
6 years ago
rem Copyright 2018 Jay Moore
rem Released under GPL v3
rem drugwar2e.sourceforge.io
rem twitter: _nq4t
6 years ago
goto @instructions {because we're sticking subroutines up here}
£titlebar {this literally just draws the game title at the top of the screen}
6 years ago
print ,"Drugwar//e",
6 years ago
return
6 years ago
£wait {ubiquitious "Press ENTER to continue}
6 years ago
print chr$(10)
input "Press enter to continue.";x$
return
6 years ago
£timera
for n = 1 to 500
next n
return
£timerb
for n = 1 to 300
next n
return
6 years ago
[
"Common logic" has been moved to buy/sell subroutines.
This has cleaned the code up a bit
]
6 years ago
£howmuchbuy {some common purchase code}
6 years ago
print "You can afford ";j
6 years ago
print "You can carry ";f
£howmanybuy
6 years ago
print chr$(10)
6 years ago
input "How many? (Enter 0 cancel): ";k
6 years ago
if K=0 goto @menu
if k>f THEN inverse : print "You can't carry that much!" : normal : goto @howmanybuy
if k>j THEN inverse : print "You can't afford that much!" : normal : goto @howmanybuy
6 years ago
return
6 years ago
6 years ago
£howmuchsell {common sell code}
6 years ago
print "You can sell: ";j
6 years ago
print chr$(10)
£howmanysell
6 years ago
input "How many? (Enter 0 to cancel.): ";k
6 years ago
If k>j then print "You don't have that many!" : goto @howmanysell
if K=0 goto @menu
6 years ago
return
6 years ago
6 years ago
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)
6 years ago
z=int((rnd(1)*42+33)*10+.5)
6 years ago
s=int((rnd(1)*15+7)*10+.5)
l=int((rnd(1)*4+1)*10+.5)
b=int(rnd(1)*20+.5)
6 years ago
d=d+1
6 years ago
£checkday {so I can check the day by itself}
6 years ago
if D >= 31 GOTO @endgame
6 years ago
return
6 years ago
£menu {main menu. everything should loop back here}
6 years ago
home
6 years ago
f=i-(m+n+o+u+t+q) {former sub-routine}
6 years ago
gosub @titlebar
6 years ago
inverse : print "Day:";D,p$, : normal
print chr$(10)
6 years ago
print "(C)heck Prices"
print "(I)nventory"
print "(B)uy"
print "(S)ell"
print "(J)et"
print "See (L)oan shark"
print "(V)isit Bank"
6 years ago
input "Please make your selection: ";x$
if x$ = "C" goto @prices
if x$ = "I" goto @inventory
if x$ = "B" goto @buy
if x$ = "S" goto @sell
if x$ = "J" goto @jet
if x$ = "L" goto @loan
if x$ = "V" goto @bank
6 years ago
goto @menu
£prices
home
6 years ago
gosub @titlebar
6 years ago
inverse:print" PRICES ":normal
print chr$(10)
6 years ago
print"cocaine:","$"c
print"heroin:","$"h
print"acid:","$"a
6 years ago
print"weed:","$"z
6 years ago
print"speed:","$"s
print"ludes:","$"l
6 years ago
print"wallet:","$"w
6 years ago
gosub @wait
goto @menu
£inventory
home
gosub @titlebar
inverse:print" INVENTORY ":normal
print chr$(10)
6 years ago
print"cocaine:",m
print"heroin:",n
print"acid:",o
print"weed:",u
print"speed:",t
print"ludes:",q
print"free space:",f
6 years ago
gosub @wait
goto @menu
£buy
home
gosub @titlebar
inverse:print" BUY ":normal
print chr$(10)
print"What do you want to buy?"
print chr$(10)
print "(C)ocaine"
print "(H)eroin"
print "(A)cid"
print "(W)eed"
print "(S)peed"
print "(L)udes"
6 years ago
input "Enter Selection: ";x$
if x$="c" goto @cokebuy
if x$="h" goto @herbuy
if x$="a" goto @acidbuy
if x$="w" goto @weedbuy
if x$="s" goto @spdbuy
if x$="l" goto @ludbuy
goto @menu
6 years ago
£cokebuy
home
gosub @titlebar
inverse:print" BUY COCAINE ":normal
print chr$(10)
6 years ago
j=int(w/c) {calculate how many we can buy}
6 years ago
gosub @howmuchbuy
6 years ago
m=m+k : w=w-(c*k) {when the subroutine sends us back when the purchase is valid}
6 years ago
goto @menu
£herbuy
home
gosub @titlebar
inverse:print" BUY HEROIN ":normal
print chr$(10)
6 years ago
j=int(w/h)
gosub @howmuchbuy
n=n+k : w=w-(h*k)
6 years ago
goto @menu
£acidbuy
home
gosub @titlebar
inverse:print" BUY ACID ":normal
print chr$(10)
6 years ago
j=int(w/a)
6 years ago
gosub @howmuchbuy
6 years ago
o=o+k : w=w-(a*k)
6 years ago
goto @menu
£weedbuy
home
gosub @titlebar
inverse:print" BUY WEED ":normal
print chr$(10)
6 years ago
j=int(w/z)
6 years ago
gosub @howmuchbuy
6 years ago
u=u+k : w=w-(z*k)
6 years ago
goto @menu
£spdbuy
home
gosub @titlebar
inverse:print" BUY SPEED ":normal
print chr$(10)
6 years ago
j=int(w/s)
6 years ago
gosub @howmuchbuy
6 years ago
t=t+k : w=w-(s*k)
6 years ago
goto @menu
£ludbuy
home
gosub @titlebar
inverse:print" BUY LUDES ":normal
print chr$(10)
6 years ago
j=int(w/l)
6 years ago
gosub @howmuchbuy
6 years ago
q=q+k : w=w-(l*k)
6 years ago
goto @menu
£sell
home
gosub @titlebar
inverse:print" SELL ":normal
print chr$(10)
print "What would you like to sell?"
print chr$(10)
print "(C)ocaine"
print "(H)eroin"
print "(A)cid"
print "(W)eed"
print "(S)peed"
print "(L)udes"
£sellsel
6 years ago
input "Enter Selection: (0 to cancel)";x$
if x$="c" goto @cokesell
if x$="h" goto @hersell
if x$="a" goto @acidsell
if x$="w" goto @weedsell
if x$="s" goto @spdsell
if x$="l" goto @ludsell
if x$="0" goto @menu
6 years ago
print "Invalid Selection!"
goto @sellsel
£cokesell
home
gosub @titlebar
inverse:print" SELL COCAINE ":normal
print chr$(10)
6 years ago
j=m {write amount to variable}
6 years ago
gosub @howmuchsell
6 years ago
m=m-k {sub sends back here if valid, adjusts inventory}
w=w+(c*k) {adds money to wallet}
6 years ago
goto @menu
£hersell
home
gosub @titlebar
inverse:print" SELL HEROIN ":normal
print chr$(10)
6 years ago
j=n
6 years ago
gosub @howmuchsell
6 years ago
n=n-k
w=w+(h*k)
6 years ago
goto @menu
£acidsell
home
gosub @titlebar
inverse:print" SELL ACID ":normal
print chr$(10)
6 years ago
j=o
6 years ago
gosub @howmuchsell
6 years ago
o=o-k
w=w+(a*k)
6 years ago
goto @menu
£weedsell
home
gosub @titlebar
inverse:print" SELL WEED ":normal
print chr$(10)
6 years ago
j=u
6 years ago
gosub @howmuchsell
6 years ago
u=u-k
w=w+(z*k)
6 years ago
goto @menu
£spdsell
home
gosub @titlebar
inverse:print" SELL SPEED ":normal
print chr$(10)
6 years ago
j=t
6 years ago
gosub @howmuchsell
6 years ago
t=t-k
w=w+(s*k)
6 years ago
goto @menu
£ludsell
home
gosub @titlebar
6 years ago
inverse:print" SELL LUDES ":normal
6 years ago
print chr$(10)
6 years ago
j=q
6 years ago
gosub @howmuchsell
6 years ago
q=q-k
w=w+(l*k)
6 years ago
goto @menu
£jet
home
gosub @titlebar
inverse:print" JET ":normal
print chr$(10)
print "(B)ronx"
print "(G)hetto"
print "(C)entral Park
print "(M)anhatten"
print "Coney (I)sland"
print "Broo(K)lyn"
print "(O)ops...stay!"
6 years ago
input "Where to dude? ";x$
if x$="B" then y$ = "The Bronx" : GOTO @jetb {we can use strings}
if x$="G" then y$ = "The Ghetto" : GOTO @jetb
if x$="C" then y$ = "Central Park" : GOTO @jetb
if x$="M" then y$ = "Manhatten" : goto @jetb
if x$="I" then y$ = "Coney Island" : goto @jetb
if x$="K" then y$ = "Brooklyn" : goto @jetb
if x$="O" then goto @menu
6 years ago
if x$="COPTEST" then b = 5 : goto @police
6 years ago
goto @jet
£jetb
6 years ago
if y$=p$ then goto @alreadythere {more advanced thatn Bronx only on TI}
p$ = y$ {it's valid, copy it and move along}
6 years ago
goto @subway
£alreadythere
home
gosub @titlebar
inverse:print" JET ":normal
print chr$(10)
print "You're already in:"
6 years ago
print " ";p$
6 years ago
gosub @wait
goto @jet
£subway
6 years ago
home
6 years ago
gosub @daily
6 years ago
V=int(V*1.1+.5) {loan calculation}
E=int(E*1.06+.5) {savings calculation}
6 years ago
gosub @titlebar
inverse:print" SUBWAY ":normal
print chr$(10)
6 years ago
if b=1 then goto @cheapludes
if b=2 then goto @cheepweed
if b=3 then goto @pigheroin
if b=4 then goto @heroinbust
if b=5 then goto @heroinbust
if b=6 then goto @cokebust
if b=7 then goto @cokebust
if b=8 then goto @mugged
if b=9 then goto @cops
if b=10 then goto @cops
if b=11 then goto @cops
if b=12 then goto @gunbuy
if b=13 then goto @gunbuy
if b=14 then goto @dedweed
if b=15 then goto @newcoat
if b=16 then goto @dedguy
if b=17 then goto @homeacid
6 years ago
£nothinghappened
£nothinghappens
6 years ago
print chr$(10) {the only way you should wind up here is if nothing happens}
6 years ago
print "Welcome to ";p$ {i hope}
6 years ago
print chr$(10)
input "Press ENTER to continue. ";X$
goto @menu
6 years ago
£cheapludes
print "Rival dealers are selling cheap ludes!"
l=2
gosub @wait
goto @menu
£cheepweed
print "Weed prices have bottomed-out!"
z=122
gosub @wait
goto @menu
£pigheroin
print "Pigs are selling cheap heroin"
print "from last week's raid!"
h=int((rnd(1)*1150)+850.5)
gosub @wait
goto @menu
£heroinbust
print "Addicts are buying heroin"
print "at outrageous prices!"
h=int((rnd(1)*25000)+18000.5)
gosub @wait
goto @menu
£cokebust
print "Pigs made a big coke bust!"
print "Prices are outrageous!!!!"
c=int((rnd(1)*60000)+80000.5) {the infamous line 930}
gosub @wait
goto @menu
£mugged
print "You got mugged!"
print chr$(10)
j=int(w/3)
j=int(j*2)
k=int(w-j)
print "You lost $";k
w=j
gosub @wait
gosub @menu
£cops
k=m+n+u+o+t+p {cops only active when inventory < 50}
[
my improved revisions will likely add some additional
conditions on how/when we run cops
]
6 years ago
if k<50 then goto @nothinghappened
if b=9 then b = 2
if b=10 then b=4
if b=11 then b=5
6 years ago
print "It's the cops!"
print chr$(10)
6 years ago
print "Officer Hardass and ";B-1;" of his"
print "deputies are after you!"
print
gosub @wait
goto @police
£police
home
gosub @titlebar
inverse:print" BEING CHASED!" :normal
print
print
print "View (G)uns"
print "View (D)amage"
print "(N)umber of pigs"
print "(R)un"
print "(F)ight"
print
input "What do you want to do? ";x$
if x$="G" goto @pgun
if x$ = "D" goto @damage
if x$ = "N" goto @ncops
if x$ = "R" goto @run
if X$="F" goto @fight
goto @police
£pgun
home
gosub @titlebar
inverse:print" BEING CHASED!" :normal
print
print
print "You have ";g;" guns.
print
gosub @wait
goto @police
£damage
home
gosub @titlebar
inverse:print" BEING CHASED!" :normal
print
print
print "Your current damage is ";bb;"."
print
print "50 and you die!"
print
gosub @wait
goto @police
£ncops
home
gosub @titlebar
inverse:print" BEING CHASED!" :normal
print
print
print "There are ";b;" pigs still chasing you!"
print
print
gosub @wait
goto @police
£run
home
gosub @titlebar
inverse:print" BEING CHASED!" :normal
print
print
print "RUNNING..."
gosub @timera
k=int(rnd(1)+.5)
if k = 0 then print "You lost them in an alley!" : goto @loserun
print "You can't shake them!"
print
gosub @wait
goto @police
£loserun
print
gosub @wait
goto @menu
£fight
if g<=0 then print : print : print "YOU DON'T HAVE ANY GUNS!" : gosub @wait : goto @police
home
gosub @titlebar
inverse:print" BEING CHASED!" :normal
print
print "You shoot!"
gosub @timera
k = rnd(1)
k = int(k+.5)
If K=0 THEN GOTO @miss
print "You got one!" : b = b-1 : goto @next
£miss
print "You missed!"
£next
print
print
If b <= 0 THEN goto @allgone
gosub @timerb
print "They're firing at you!"
gosub @timera
k = rnd(1)
k = int(k+.5)
if k=0 then goto @theymiss
print "You've been hit!"
bb=bb+3
if bb >= 50 goto @ded
goto @nexta
£theymiss
print "They missed!"
£nexta
gosub @wait
goto @police
£ded
print
print "You've been killed!"
6 years ago
gosub @wait
6 years ago
goto @endgame
£allgone
print "You killed all of them!"
print
gosub @timera
j=int((rnd(1)*1250)+750)
w=w+j
print "You found $";j;" on officer Hardass'"
print "carcass!"
if w>=1200 then goto @doctor
gosub @wait
goto @menu
£doctor
gosub @timera
print
print "Will you pay $1000 for a doctor"
input "to sew you up? (Y/N)";x$
if X$ <> "Y" then goto @menu
w=w-1000
bb=0
6 years ago
£gunbuy
6 years ago
if w < 500 THEN goto @nothinghappened
6 years ago
f=int(i-(m+n+o+u+t+p))
6 years ago
if f < 5 THEN goto @nothinghappened
6 years ago
j=int(rnd(1)*2)
if j = 0 then y$ = "Baretta"
if j = 1 then y$ = "Saturday Night Special"
if j = 2 then y$ = ".44 Magnum"
print "Will you buy a ";y$
input "for $400? (Y/N)";x$
if x$ <> "Y" then goto @menu
g = int(g+1)
w = int(w-400)
i = int(i-5) {I kept having problems calculating this with free space as guns * 5. gave up. put it here}
goto @menu
£dedweed {don't smoke the weed}
print "There's some weed here that smells"
print "like good stuff!!"
print chr$(10)
input "Will you smoke it? (Y/N)";X$
If X$ = "Y" THEN GOTO @weedend
goto@menu
£newcoat
if w<300 then return {only if you can afford it}
print "Will you buy a new trenchcoat"
input "with more pockets for $200? (Y/N)";X$
if X$ <> "Y" then goto @menu
i=int(i+10)
w=int(w-200)
goto @menu
£dedguy
6 years ago
If f<8 THEN goto @nothinghappens {only if you have enough freespace}
6 years ago
j=int((rnd(1)*7)+1.5)
k=int(rnd(1)*5+.5)
if k=0 THEN q=q+j : y$ = "Ludes"
if k=1 THEN t=t+j : y$ = "Speed"
if k=2 THEN u=u+j : y$ = "Weed"
if k=3 THEN o=o+j : y$ = "Acid"
if k=4 THEN n=n+j : y$ = "Heroin"
if k=5 THEN m=m+j : y$ = "Cocaine"
print "You found ";j;" units of"
print " ";y$
print "on a dead dude in the subway!"
print chr$(10)
gosub @wait
goto @menu
£homeacid
print "The market has been flooded"
print "with cheap home-made acid!"
a=int((rnd(1)*550)+250.5)
gosub @wait
goto @menu
6 years ago
£notbronx
print "you need to head to the bronx"
print "to take care of this business."
gosub @wait
goto @menu
£loan
home
gosub @titlebar
6 years ago
inverse : print " LOAN SHARK ":normal
6 years ago
print chr$(10)
6 years ago
if p$ <> "THE BRONX" then goto @notbronx
print "Your debt is: $";v
print "You have: $";w
6 years ago
print chr$(10)
input "(R)epay, (B)orrow, (L)eave: ";X$
If X$ = "R" THEN goto @payme
If X$ = "B" Then goto @borrow
If X$ = "L" then goto @Menu
goto @loan
£payme
6 years ago
INPUT "Repay how much? ";k
IF k>w THEN PRINT "YOU DON'T HAVE THAT MUCH!" : INPUT "PRESS ENTER TO CONTINUE. ";X$ : GOTO @LOAN
IF k>v THEN PRINT "YOU DON'T OWE THAT MUCH!" : INPUT"PRESS ENTER TO CONTINE. ";X$ : GOTO @LOAN
W=W-k
v=v-k
6 years ago
PRINT "THANK YOU."
GOSUB @WAIT
GOTO @MENU
6 years ago
£borrow
6 years ago
Input "How much do you want? ";K
if K>5000 then print "He's not that stupid!" : goto @borrow
v=v+k
w=w+k
6 years ago
print "Here's your money." : PRINT CHR$(10) : PRINT "Remember, I break thumbs."
gosub @wait
goto @menu
6 years ago
6 years ago
6 years ago
£bank
home
gosub @titlebar
6 years ago
inverse : print " BANK O'MURICA ":normal
6 years ago
print chr$(10)
6 years ago
if p$ <> "THE BRONX" then goto @notbronx
print "Your balance: $";e
print "Your wallet: $";w
6 years ago
print chr$(10)
INPUT "(D)EPOSIT, (W)ITHDRAW, (L)EAVE: ";X$
if x$ = "d" then goto @deposit
if x$ = "w" then goto @mymoney
if x$ = "l" then goto @menu
goto @bank
£deposit
6 years ago
INPUT "How much? ";j
If j>w then print "You don't have that much cash." : goto @deposit
e=e+j
w=w-j
6 years ago
Print "Thank you for your deposit."
gosub @wait
goto @menu
£mymoney
6 years ago
INPUT "How much? ";j
If j>e then print "You don't have sufficient funds." : goto @mymoney
e=e-j
w=w+j
6 years ago
print "Thank you for your business."
gosub @wait
goto @menu
6 years ago
£instructions
home
gosub @titlebar
print chr$(10)
6 years ago
print "Welcome to DRUGWAR//e Beta 9"
6 years ago
print chr$(10)
print chr$(10)
6 years ago
input "Would you like instructions? (Y/N): ";X$
6 years ago
£inserrorhandler {I'm hoping this will prevent crashes}
6 years ago
If X$ = "Y" THEN GOTO @inst
GOTO @gamestart
6 years ago
£gamestart {set wallet, debt, location, inventory space, zero out inventory}
6 years ago
w=2000
e=0
v=5000
6 years ago
d=0 {daily subroutine adds a day}
6 years ago
p$="The Bronx"
g=0
i=100
m=0
n=0
o=0
u=0
t=0
q=0
6 years ago
gosub @daily {the only time we'll call this outside of the subway}
goto @menu {the real start of the game}
6 years ago
6 years ago
£inst
home
gosub @titlebar
print chr$(10)
print "This is a game of buying and selling."
print "Your goal is to pay off your debt and"
print "make as much money as possible in a one"
print "month period. Prices fluctuate every day"
print "and interest on your loan is calculated"
print "as well. If you deal too heavily, you'll"
print "attract the attention of the police.
print CHR$(10)
print "Commands are usually the first letter"
print "of what you want to do. Y = yes and"
print "N = No."
Input "Press ENTER to continue.";X$
goto @gamestart
£weedend
home
gosub @titlebar
inverse : print " SMOKE WEED " : NORMAL
print "You hallucinate on the wildest trip"
print "of your life, stumble on to the tracks,"
print "and get creamed by a train!"
print chr$(10)
print chr$(10)
print "Just say NO to drugs!"
gosub @wait
goto @ironicend
6 years ago
£scorecalculate
6 years ago
k=(w+e)-v
if k<0 THEN k=0 : return
k=sqr((k/31.5)+.5)
k=int(k)
if k>100 then k=100
6 years ago
return
6 years ago
£endgame
home
gosub @titlebar
6 years ago
gosub @scorecalculate
6 years ago
inverse : print " GAME OVER " : NORMAL
print chr$(10)
6 years ago
print "Your score on a scale of 1 to 100: ";k
6 years ago
print chr$(10)
6 years ago
input "Would you like to play again? (Y/N)";x$
if x$ = "Y" then goto @gamestart
6 years ago
print "Thanks for playing."
6 years ago
print "Remember, watch your back."
6 years ago
print "Have a nice day!"
6 years ago
clear
6 years ago
end
£ironicend
home
gosub @titlebar
6 years ago
gosub @scorecalculate
6 years ago
inverse : print " GAME OVER " : NORMAL
print chr$(10)
6 years ago
print "Your final score is: ";k
6 years ago
print chr$(10)
6 years ago
print "But you died from smoking weed? In a"
print "game about dealing drugs? Buddy, no"
print "score can redeem that stupidity."
print chr$(10)
6 years ago
input "Would you like to play again? ";x$
if x$= "Y" THEN GOTO @GAMESTART
if x$= "N" THEN PRINT "I don't blame you." : end
6 years ago
print "What? If you're that dumb, I'm leaving."
6 years ago
clear
6 years ago
end