master
Jay 6 years ago
parent 53150ac91f
commit a3290f600a

File diff suppressed because it is too large Load Diff

@ -1,4 +1,5 @@
rem Drugwar//e - Beta 9
rem Drugwar//e - Version 1.0
rem 19-OCT-2018
rem Copyright 2018 Jay Moore
rem Released under GPL v3
rem drugwar2e.sourceforge.io
@ -6,19 +7,27 @@ rem twitter: _nq4t
goto @instructions {because we're sticking subroutines up here}
£titlebar {this literally just draws the game title at the top of the screen}
print ,"Drugwar//e",
HTAB 16 : print "Drugwar//e",
return
£wait {ubiquitious "Press ENTER to continue}
print chr$(10)
input "Press enter to continue.";x$
return
£jetalthere
inverse:print" Jet ":normal
return
£timera
for n = 1 to 500
next n
for j = 1 to 500
next j
k = int(rnd(2)+.5)
return
£timerb
for n = 1 to 300
next n
for j = 1 to 300
next j
return
£timerc
for j = 1 to 1000
next j
return
[
"Common logic" has been moved to buy/sell subroutines.
@ -45,27 +54,64 @@ This has cleaned the code up a bit
if K=0 goto @menu
return
£freespace
f=int(i-(m+n+o+u+t+p))
return
£chase
inverse:print" Being Chased ":normal
return
£gmod
inverse:print" Game Over ":normal
return
£bronxcheck
if p$ = "THE BRONX " then return
print "you need to head to the bronx"
print "to take care of this business."
gosub @timerc
goto @menu
£daily {randomizes drug prices, adds a day, calculates interests, checks day number}
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)
c=int(rnd(5)*12000+16000.5)
h=int(rnd(5)*7000+5000.5)
a=int((rnd(5)*34+10)*100+.5)
z=int((rnd(5)*42+33)*10+.5)
s=int((rnd(5)*15+7)*10+.5)
l=int((rnd(5)*4+1)*10+.5)
b=int(rnd(5)*20+.5)
d=d+1
£checkday {so I can check the day by itself}
if D >= 31 GOTO @endgame
return
£scorecalculate
k=(w+e)-v
if k<0 THEN k=0 : return
k=int(sqr((k/31.5)+.5))
if k>100 then k=100
return
£gamestart {set wallet, debt, location, inventory space, zero out inventory}
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 {the only time we'll call this outside of the subway}
goto @menu {the real start of the game}
£menu {main menu. everything should loop back here}
home
f=i-(m+n+o+u+t+q) {former sub-routine}
gosub @freespace
gosub @titlebar
inverse : print "Day:";D,p$, : normal
inverse : print " Day: "D" Location: "p$: normal
print chr$(10)
print "(C)heck Prices"
print "(I)nventory"
@ -74,6 +120,7 @@ This has cleaned the code up a bit
print "(J)et"
print "See (L)oan shark"
print "(V)isit Bank"
print chr$(10)
input "Please make your selection: ";x$
if x$ = "C" goto @prices
if x$ = "I" goto @inventory
@ -86,7 +133,7 @@ This has cleaned the code up a bit
£prices
home
gosub @titlebar
inverse:print" PRICES ":normal
inverse:print" Prices ":normal
print chr$(10)
print"cocaine:","$"c
print"heroin:","$"h
@ -100,7 +147,7 @@ This has cleaned the code up a bit
£inventory
home
gosub @titlebar
inverse:print" INVENTORY ":normal
inverse:print" Inventory ":normal
print chr$(10)
print"cocaine:",m
print"heroin:",n
@ -114,7 +161,7 @@ This has cleaned the code up a bit
£buy
home
gosub @titlebar
inverse:print" BUY ":normal
inverse:print" Buy ":normal
print chr$(10)
print"What do you want to buy?"
print chr$(10)
@ -131,91 +178,149 @@ This has cleaned the code up a bit
if x$="w" goto @weedbuy
if x$="s" goto @spdbuy
if x$="l" goto @ludbuy
goto @menu
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
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
print "Invalid Selection!"
goto @sellsel
£jet
home
gosub @titlebar
gosub @jetalthere
print chr$(10)
print "(B)ronx"
print "(G)hetto"
print "(C)entral Park
print "(M)anhattan"
print "Coney (I)sland"
print "Broo(K)lyn"
print "(O)ops...stay!"
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$ = "Manhattan " : 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
{if x$="COPTEST" then b = 5 : goto @police}
goto @jet
£jetb
if y$=p$ then goto @alreadythere {more advanced thatn Bronx only on TI}
p$ = y$ {it's valid, copy it and move along} : y$ = ""
goto @subway
£loan
home
gosub @titlebar
inverse : print " Loan Shark ":normal
print chr$(10)
gosub @bronxcheck
print "Your debt is: $";v
print "You have: $";w
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
£bank
home
gosub @titlebar
inverse : print" Bank O'Murica ":normal
print chr$(10)
gosub @bronxcheck
print "Your balance: $";e
print "Your wallet: $";w
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
£cokebuy
home
gosub @titlebar
inverse:print" BUY COCAINE ":normal
inverse:print" Buy Cocaine ":normal
print chr$(10)
j=int(w/c) {calculate how many we can buy}
j=w/c {calculate how many we can buy}
gosub @howmuchbuy
m=m+k : w=w-(c*k) {when the subroutine sends us back when the purchase is valid}
goto @menu
£herbuy
home
gosub @titlebar
inverse:print" BUY HEROIN ":normal
inverse:print" Buy Heroin ":normal
print chr$(10)
j=int(w/h)
j=w/h
gosub @howmuchbuy
n=n+k : w=w-(h*k)
goto @menu
£acidbuy
home
gosub @titlebar
inverse:print" BUY ACID ":normal
inverse:print" Buy Acid ":normal
print chr$(10)
j=int(w/a)
j=w/a
gosub @howmuchbuy
o=o+k : w=w-(a*k)
goto @menu
£weedbuy
home
gosub @titlebar
inverse:print" BUY WEED ":normal
inverse:print" Buy Weed ":normal
print chr$(10)
j=int(w/z)
j=w/z
gosub @howmuchbuy
u=u+k : w=w-(z*k)
goto @menu
£spdbuy
home
gosub @titlebar
inverse:print" BUY SPEED ":normal
inverse:print" Buy Speed ":normal
print chr$(10)
j=int(w/s)
j=w/s
gosub @howmuchbuy
t=t+k : w=w-(s*k)
goto @menu
£ludbuy
home
gosub @titlebar
inverse:print" BUY LUDES ":normal
inverse:print" Buy Ludes ":normal
print chr$(10)
j=int(w/l)
j=w/l
gosub @howmuchbuy
q=q+k : w=w-(l*k)
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
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
print "Invalid Selection!"
goto @sellsel
£cokesell
home
gosub @titlebar
inverse:print" SELL COCAINE ":normal
inverse:print" Sell Cocaine ":normal
print chr$(10)
j=m {write amount to variable}
gosub @howmuchsell
@ -226,7 +331,7 @@ goto @menu
£hersell
home
gosub @titlebar
inverse:print" SELL HEROIN ":normal
inverse:print" Sell Heroin ":normal
print chr$(10)
j=n
gosub @howmuchsell
@ -237,7 +342,7 @@ goto @menu
£acidsell
home
gosub @titlebar
inverse:print" SELL ACID ":normal
inverse:print" Sell Acid ":normal
print chr$(10)
j=o
gosub @howmuchsell
@ -248,7 +353,7 @@ goto @menu
£weedsell
home
gosub @titlebar
inverse:print" SELL WEED ":normal
inverse:print" Sell Weed ":normal
print chr$(10)
j=u
gosub @howmuchsell
@ -259,7 +364,7 @@ goto @menu
£spdsell
home
gosub @titlebar
inverse:print" SELL SPEED ":normal
inverse:print" Sell Speed ":normal
print chr$(10)
j=t
gosub @howmuchsell
@ -270,48 +375,22 @@ goto @menu
£ludsell
home
gosub @titlebar
inverse:print" SELL LUDES ":normal
inverse:print" Sell Ludes ":normal
print chr$(10)
j=q
gosub @howmuchsell
q=q-k
w=w+(l*k)
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!"
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
if x$="COPTEST" then b = 5 : goto @police
goto @jet
£jetb
if y$=p$ then goto @alreadythere {more advanced thatn Bronx only on TI}
p$ = y$ {it's valid, copy it and move along}
goto @subway
£alreadythere
home
gosub @titlebar
inverse:print" JET ":normal
gosub @jetalthere
print chr$(10)
print "You're already in:"
print " ";p$
gosub @wait
gosub @timerc
goto @jet
£subway
@ -320,7 +399,7 @@ goto @menu
V=int(V*1.1+.5) {loan calculation}
E=int(E*1.06+.5) {savings calculation}
gosub @titlebar
inverse:print" SUBWAY ":normal
inverse:print" Subway ":normal
print chr$(10)
if b=1 then goto @cheapludes
if b=2 then goto @cheepweed
@ -344,37 +423,37 @@ goto @menu
print chr$(10) {the only way you should wind up here is if nothing happens}
print "Welcome to ";p$ {i hope}
print chr$(10)
input "Press ENTER to continue. ";X$
gosub @timerc
goto @menu
£cheapludes
print "Rival dealers are selling cheap ludes!"
l=2
gosub @wait
gosub @timerc
goto @menu
£cheepweed
print "Weed prices have bottomed-out!"
z=122
gosub @wait
gosub @timerc
goto @menu
£pigheroin
print "Pigs are selling cheap heroin"
print "from last week's raid!"
h=int((rnd(1)*1150)+850.5)
gosub @wait
h=int((rnd(9)*1150)+850.5)
gosub @timerc
goto @menu
£heroinbust
print "Addicts are buying heroin"
print "at outrageous prices!"
h=int((rnd(1)*25000)+18000.5)
gosub @wait
h=int((rnd(9)*25000)+18000.5)
gosub @timerc
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
c=int((rnd(9)*60000)+80000.5) {the infamous line 930}
gosub @timerc
goto @menu
£mugged
print "You got mugged!"
@ -384,7 +463,7 @@ goto @menu
k=int(w-j)
print "You lost $";k
w=j
gosub @wait
gosub @timerc
gosub @menu
£cops
k=m+n+u+o+t+p {cops only active when inventory < 50}
@ -401,12 +480,12 @@ conditions on how/when we run cops
print "Officer Hardass and ";B-1;" of his"
print "deputies are after you!"
print
gosub @wait
gosub @timerc
goto @police
£police
home
gosub @titlebar
inverse:print" BEING CHASED!" :normal
gosub @chase
print
print
print "View (G)uns"
@ -425,7 +504,7 @@ conditions on how/when we run cops
£pgun
home
gosub @titlebar
inverse:print" BEING CHASED!" :normal
gosub @chase
print
print
print "You have ";g;" guns.
@ -435,7 +514,7 @@ conditions on how/when we run cops
£damage
home
gosub @titlebar
inverse:print" BEING CHASED!" :normal
gosub @chase
print
print
print "Your current damage is ";bb;"."
@ -447,7 +526,7 @@ conditions on how/when we run cops
£ncops
home
gosub @titlebar
inverse:print" BEING CHASED!" :normal
gosub @chase
print
print
print "There are ";b;" pigs still chasing you!"
@ -458,12 +537,11 @@ conditions on how/when we run cops
£run
home
gosub @titlebar
inverse:print" BEING CHASED!" :normal
gosub @chase
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
@ -477,12 +555,10 @@ conditions on how/when we run cops
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
gosub @chase
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
@ -494,8 +570,6 @@ conditions on how/when we run cops
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
@ -516,15 +590,14 @@ conditions on how/when we run cops
print "You killed all of them!"
print
gosub @timera
j=int((rnd(1)*1250)+750)
j=int(((rnd(7)*1250)+750)+.5)
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
gosub @timerc
print
print "Will you pay $1000 for a doctor"
input "to sew you up? (Y/N)";x$
@ -534,17 +607,17 @@ conditions on how/when we run cops
£gunbuy
if w < 500 THEN goto @nothinghappened
f=int(i-(m+n+o+u+t+p))
gosub @freespace
if f < 5 THEN goto @nothinghappened
j=int(rnd(1)*2)
j=int((rnd(4)*2)+.5)
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)
g = g+1
w = 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}
@ -559,13 +632,13 @@ conditions on how/when we run cops
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)
i=i+10
w=w-200
goto @menu
£dedguy
If f<8 THEN goto @nothinghappens {only if you have enough freespace}
j=int((rnd(1)*7)+1.5)
k=int(rnd(1)*5+.5)
j=int((rnd(3)*7)+1.5)
k=int(rnd(3)*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"
@ -576,78 +649,44 @@ conditions on how/when we run cops
print " ";y$
print "on a dead dude in the subway!"
print chr$(10)
gosub @wait
gosub @timerc
goto @menu
£homeacid
print "The market has been flooded"
print "with cheap home-made acid!"
a=int((rnd(1)*550)+250.5)
gosub @wait
a=int((rnd(4)*550)+250.5)
gosub @timerc
goto @menu
£notbronx
print "you need to head to the bronx"
print "to take care of this business."
gosub @wait
goto @menu
£loan
home
gosub @titlebar
inverse : print " LOAN SHARK ":normal
print chr$(10)
if p$ <> "THE BRONX" then goto @notbronx
print "Your debt is: $";v
print "You have: $";w
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
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
IF k>w THEN PRINT:PRINT "YOU DON'T HAVE THAT MUCH!" : GOSUB @timerb : GOTO @LOAN
IF k>v THEN PRINT:PRINT "YOU DON'T OWE THAT MUCH!" : GOSUB @timerb : GOTO @LOAN
W=W-k
v=v-k
PRINT "THANK YOU."
GOSUB @WAIT
PRINT:PRINT "THANK YOU."
GOSUB @timerc
GOTO @MENU
£borrow
Input "How much do you want? ";K
if K>5000 then print "He's not that stupid!" : goto @borrow
print
j=int((rnd(10)*10000)+5000)
if K>14000 then print "He's not that stupid!" : gosub @timerc : goto @menu
if K > J then print "He doesn't feel like it." : gosub @timerb : goto @menu
v=v+k
w=w+k
print "Here's your money." : PRINT CHR$(10) : PRINT "Remember, I break thumbs."
gosub @wait
gosub @timerc
goto @menu
£bank
home
gosub @titlebar
inverse : print " BANK O'MURICA ":normal
print chr$(10)
if p$ <> "THE BRONX" then goto @notbronx
print "Your balance: $";e
print "Your wallet: $";w
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
INPUT "How much? ";j
If j>w then print "You don't have that much cash." : goto @deposit
e=e+j
w=w-j
Print "Thank you for your deposit."
gosub @wait
gosub @timerc
goto @menu
£mymoney
INPUT "How much? ";j
@ -655,39 +694,18 @@ conditions on how/when we run cops
e=e-j
w=w+j
print "Thank you for your business."
gosub @wait
gosub @timerc
goto @menu
£instructions
home
gosub @titlebar
print chr$(10)
print "Welcome to DRUGWAR//e Beta 9"
print chr$(10)
print chr$(10)
input "Would you like instructions? (Y/N): ";X$
£inserrorhandler {I'm hoping this will prevent crashes}
vtab 2:htab10:print "Welcome to Drugwar//e":htab15:print"Version 1.0"
vtab 8:htab 3:print "Based on the classic TI-BASIC clone":htab2:print"of John E. Dell's 1984 IBM/TRS80 game."
vtab12:htab6:print "Applesoft version by: Jay Moore"
vtab19:input "Would you like instructions? (Y/N): ";X$
j =RND(-1 *(PEEK(78)+256*PEEK(79)))
If X$ = "Y" THEN GOTO @inst
GOTO @gamestart
£gamestart {set wallet, debt, location, inventory space, zero out inventory}
w=2000
e=0
v=5000
d=0 {daily subroutine adds a day}
p$="The Bronx"
g=0
i=100
m=0
n=0
o=0
u=0
t=0
q=0
gosub @daily {the only time we'll call this outside of the subway}
goto @menu {the real start of the game}
GOTO @gamestart
£inst
home
@ -696,42 +714,31 @@ conditions on how/when we run cops
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 "month period. Prices fluctuate every dayand interest on your loan is calculated as well."
print:print "If you deal too heavily, you'll 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$
print "Commands are entered using the letter highlighted (L)ike (S)o. Y is yes and anything counts as no."
gosub @wait
goto @gamestart
£weedend
home
gosub @titlebar
inverse : print " SMOKE WEED " : NORMAL
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
gosub @timerc
gosub @timerb
goto @ironicend
£scorecalculate
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
return
£endgame
home
gosub @titlebar
gosub @scorecalculate
inverse : print " GAME OVER " : NORMAL
gosub @gmod
print chr$(10)
print "Your score on a scale of 1 to 100: ";k
print chr$(10)
@ -747,12 +754,13 @@ conditions on how/when we run cops
home
gosub @titlebar
gosub @scorecalculate
inverse : print " GAME OVER " : NORMAL
gosub @gmod
print chr$(10)
print "Your final score is: ";k
print chr$(10)
print "But you died from smoking weed? In a"
print "game about dealing drugs? Buddy, no"
gosub @timerc
print "But you died from smoking weed?":gosub @timerc:print "In a"
print "game about dealing drugs?":gosub @timerb: print"Buddy, no"
print "score can redeem that stupidity."
print chr$(10)
input "Would you like to play again? ";x$

Loading…
Cancel
Save