master
Jay 5 years ago
parent 44612ea63c
commit 1cbc515587

@ -1,5 +1,12 @@
10 REM - VIRTUALBASIC.ORG - ONLINE-TOOL.BAS - 08/10/2018 - 02h32
11 REM - LABELED ALPHA 6
1 REM DRUGWAR//E BETA RELEASE
2 REM COPYRIGHT 2018 JAY MOORE
3 REM DRUGWAR2E.SOURCEFORGE.IO
4 REM LICENSED UNDER GPLV3
5 REM TWITTER: _NQ4T
6 REM I STILL HAVE NO CLUE HOW
7 REM I GOT THIS FAR WITH AS
8 REM LITTLE AS I KNOW.
10 REM - VIRTUALBASIC.ORG - ONLINE-TOOL.BAS - 08/10/2018 - 03h41
20 GOTO 4480
30 REM->TITLEBAR
40 PRINT " DRUGWAR//E "
@ -45,19 +52,19 @@
440 LS%=LS%*1.1
450 SA%=SA%*1.06
460 REM->CHECKDAY
470 IF D% >= 31 GOTO 5050
470 IF D% >= 31 GOTO 5070
480 RETURN
490 REM->SUBWAYEVENTS
500 IF B%=1 THEN GOTO 690
510 IF B%=2 THEN GOTO 740
520 IF B%=3 THEN GOTO 790
530 IF B%=4 THEN GOTO 850
540 IF B%=5 THEN GOGO 850
540 IF B%=5 THEN GOTO 850
550 IF B%=6 THEN GOTO 910
560 IF B%=7 THEN GOTO 910
570 IF B%=8 THEN GOTO 970
580 IF B%=9 THEN GOTO 1070
590 IF B%=10 THEN GOGO 1070
590 IF B%=10 THEN GOTO 1070
600 IF B%=11 THEN GOTO 1070
610 IF B%=12 THEN GOTO 1160
620 IF B%=13 THEN GOTO 1160
@ -145,8 +152,8 @@
1440 GOTO 1820
1450 REM->DEDGUY
1460 IF FS%<8 THEN RETURN
1470 DG%=(RND(1)*7)+1)
1480 XG%=(RND(1)*5)
1470 DG%=(RND(1)*7)+1
1480 XG%=RND(1)*5
1490 IF XG%=0 THEN LI%=LI%+DG% : SS$ = "LUDES"
1500 IF XG%=1 THEN SI%=SI%+DG% : SS$ = "SPEED"
1510 IF XG%=2 THEN WI%=WI%+DG% : SS$ = "WEED"
@ -154,7 +161,7 @@
1530 IF XG%=4 THEN HI%=HI%+DG% : SS$ = "HEROIN"
1540 IF XG%=5 THEN CI%=CI%+DG% : SS$ = "COCAINE"
1550 PRINT "YOU FOUND ";DG%;" UNITS OF"
1560 PRINT " ";SS%
1560 PRINT " ";SS$
1570 PRINT "ON A DEAD DUDE IN THE SUBWAY!"
1580 PRINT CHR$(10)
1590 GOSUB 70
@ -162,7 +169,7 @@
1610 REM->HOMEACID
1620 PRINT "THE MARKET HAS BEEN FLOODED"
1630 PRINT "WITH CHEAP HOME-MADE ACID!"
1640 A%=INT((RND(1)*550)+250)
1640 A%=(RND(1)*550)+250
1650 GOSUB 70
1660 GOTO 1820
1670 REM->LOAN
@ -337,7 +344,7 @@
3360 IF DB$="W" GOTO 3730
3370 IF DB$="S" GOTO 3830
3380 IF DB$="L" GOTO 3930
3390 IF DB$="0" GOGO 1820
3390 IF DB$="0" GOTO 1820
3400 PRINT "INVALID SELECTION!"
3410 GOTO 3320
3420 REM->COKESELL
@ -412,7 +419,7 @@
4110 PRINT "CONEY (I)SLAND"
4120 PRINT "BROO(K)LYN"
4130 PRINT "(O)OPS...STAY!"
4140 INPUT "WHERE TO DUDE";JT$
4140 INPUT "WHERE TO DUDE? ";JT$
4150 IF JT$="B" THEN PQ$ = "THE BRONX" : GOTO 4240
4160 IF JT$="G" THEN PQ$ = "THE GHETTO" : GOTO 4240
4170 IF JT$="C" THEN PQ$ = "CENTRAL PARK" : GOTO 4240
@ -437,7 +444,7 @@
4360 REM->SUBWAY
4370 GOSUB 360
4380 GOSUB 40
4390 INVERSE:PRINT" SUBWAY "
4390 INVERSE:PRINT" SUBWAY ":NORMAL
4400 PRINT CHR$(10)
4410 GOSUB 500
4420 PRINT CHR$(10)
@ -493,36 +500,37 @@
4920 INPUT "PRESS ENTER TO CONTINUE.";X$
4930 GOTO 4610
4940 REM->WEEDEND
4950 PRINT "YOU HALLUCINATE ON THE WILDEST TRIP"
4960 PRINT "OF YOUR LIFE, STUMBLE ON TO THE TRACKS,"
4970 PRINT "AND GET CREAMED BY A TRAIN!"
4980 PRINT CHR$(10)
4990 PRINT CHR$(10)
5000 PRINT "JUST SAY NO TO DRUGS!"
5010 WD%=1
5020 GOTO 70
5030 GOTO 5050
5040 REM->ENDGAME
5050 HOME
5060 GOSUB 40
5070 INVERSE : PRINT " GAME OVER " : NORMAL
5080 PRINT CHR$(10)
5090 IF WD%=1 THEN GOTO 5190
5100 PRINT "THANKS FOR PLAYING."
5110 PRINT "AT THIS POINT I'M SUPPOSLISTED TO CALCULATE"
5120 PRINT "YOUR FINAL SCORE AND ALL THAT. BUT THIS"
5130 PRINT "IS AN ALPHA RELEASE. SO IT'S NOT DONE."
5140 PRINT CHR$(10)
5150 PRINT "AT LEAST YOU DIDN'T DIE FROM SMOKING"
5160 PRINT "THAT WEED IN THE SUBWAY. GOOD JOB."
5170 END
5180 REM->IRONICEND
5190 HOME
5200 GOSUB 40
5210 INVERSE : PRINT " GAME OVER " : NORMAL
5220 PRINT CHR$(10)
5230 PRINT "OH WOW MAN. YOU DIED...FROM SMOKING POT"
5240 PRINT "IN A GAME ABOUT DRUG DEALING."
5250 PRINT CHR$(10)
5260 PRINT "WELL, THANKS FOR PLAYING."
5270 END
4950 HOME
4960 GOSUB 40
4970 INVERSE : PRINT " SMOKE WEED " : NORMAL
4980 PRINT "YOU HALLUCINATE ON THE WILDEST TRIP"
4990 PRINT "OF YOUR LIFE, STUMBLE ON TO THE TRACKS,"
5000 PRINT "AND GET CREAMED BY A TRAIN!"
5010 PRINT CHR$(10)
5020 PRINT CHR$(10)
5030 PRINT "JUST SAY NO TO DRUGS!"
5040 GOSUB 70
5050 GOTO 5200
5060 REM->ENDGAME
5070 HOME
5080 GOSUB 40
5090 INVERSE : PRINT " GAME OVER " : NORMAL
5100 PRINT CHR$(10)
5110 PRINT "THANKS FOR PLAYING."
5120 PRINT "AT THIS POINT I'M SUPPOSLISTED TO CALCULATE"
5130 PRINT "YOUR FINAL SCORE AND ALL THAT. BUT THIS"
5140 PRINT "IS AN ALPHA RELEASE. SO IT'S NOT DONE."
5150 PRINT CHR$(10)
5160 PRINT "AT LEAST YOU DIDN'T DIE FROM SMOKING"
5170 PRINT "THAT WEED IN THE SUBWAY. GOOD JOB."
5180 END
5190 REM->IRONICEND
5200 HOME
5210 GOSUB 40
5220 INVERSE : PRINT " GAME OVER " : NORMAL
5230 PRINT CHR$(10)
5240 PRINT "OH WOW MAN. YOU DIED...FROM SMOKING POT"
5250 PRINT "IN A GAME ABOUT DRUG DEALING."
5260 PRINT CHR$(10)
5270 PRINT "WELL, THANKS FOR PLAYING."
5280 END

@ -0,0 +1,571 @@
[
Drugwar //e beta-1
(c) 2018 Jay Moore
Licensed under GPLv3
]
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 "
return
£wait
print chr$(10)
input "Press enter to continue.";x$
return
£howmuchbuy {some common purchase code}
print "You can afford ";j%
print "You can carry ";fs%
print chr$(10)
input "How many? (Enter 0 to return to menu.)";k%
gosub @nobuysell
return
£howmuchsell {common sell code}
print "You can sell: ";j%
print chr$(10)
[
I'm using this to test how some of the logic might work for buying
in a subroutine. In theory it should only loop if you put in more
than you can afford; check for 0 with the subroutine; and if that
condition isn't met...return to the subroutine which carries on
with the buy/sell. I just have to watch out for cases where
you do something invalid and it runs the purchase/sell anyway.
Checking valid freespace for buying can be put here too. But
lines that reference a specific drug are still in normal code.
]
£howmanysell
input "How many? (Enter 0 to return to menu.)";k%
If k%>j% then print "You don't have that many!" : goto @howmanysell {this should work according to my testing}
gosub @nobuysell
return
£nobuysell {I'll be reusing this a lot, so let's subroutine it.}
if K%=0 goto @menu
return
£statusbar
inverse:print "DAY: ";D%,P$:normal
print chr$(10)
return
£freespace {I'll probably call this from more than the menu}
fs%=in%-((ci%+hi%+ai%+wi%+si%+li%)+(gn%*5))
return
£daily {randomizes drug prices, adds a day, calculates interests, checks day number}
c%=rnd(1)*12000+16000
h%=rnd(1)*7000+5000
a%=(rnd(1)*34+10)*100
w%=(rnd(1)*42+33)*10
s%=(rnd(1)*15+7)*10
l%=(rnd(1)*4+1)*10
b%=rnd(1)*20
d%=d%+1
ls%=ls%*1.1
sa%=sa%*1.06
£checkday {so I can check the day by itself}
if D% >= 31 GOTO @endgame
return
£subwayevents
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
return
£cheapludes
print "Rival dealers are selling cheap ludes!"
l%=2
gosub @wait
goto @menu
£cheepweed
print "Weed prices have bottomed-out!"
w%=122
gosub @wait
goto @menu
£pigheroin
print "Pigs are selling cheap heroin"
print "from last week's raid!"
h%=(rnd(1)*1150)+850)
gosub @wait
goto @menu
£heroinbust
print "Addicts are buying heroin"
print "at outrageous prices!"
h%=(rnd(1)*25000)+18000
gosub @wait
goto @menu
£cokebust
print "Pigs made a big coke bust!"
print "Prices are outrageous!!!!"
c%=rnd(1)*60000)+80000
gosub @wait
goto @menu
£mugged
print "You got mugged!"
print chr$(10)
ms%=wa%/3
ms%=ms%*2
ml%=wa%-ms%
print "You lost $";ml%
wa%=ms%
gosub @wait
gosub @menu
£cops
we%=C%+H%+W%+A%+S%+L%
[
my improved revisions will likely add some additional
conditions on how/when we run cops
]
if we%<50 then return {no return since last gosub means this should work}
print "It's the cops!"
print chr$(10)
print "Just kidding!"
print "Cops haven't been coded yet."
gosub @wait
goto @menu {goto @police}
£gunbuy
if wa% < 500 THEN return
gosub @freespace
if fs% < 5 THEN return
gx%=int(rnd(1)*2)
if gx% = 0 then ax$ = "Baretta"
if gx% = 1 then ax$ = "Saturday Night Special"
if gx% = 2 then ax$ = ".44 Magnum"
print "Will you buy a ";ax$
input "for $400? (Y/N)";re$
if re$ <> "Y" then goto @menu
gn% = gn%+1
wa% = wa%-400
fs% = fs%-5
goto @menu
£dedweed
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
return
£newcoat
if wa%<300 then return
print "Will you buy a new trenchcoat"
input "with more pockets for $200? (Y/N)";X$
if X$ <> "Y" then goto @menu
in%=in%+10
wa%=wa%-200
goto @menu
£dedguy
If fs%<8 THEN return
dg%=(rnd(1)*7)+1
xg%=rnd(1)*5
if xg%=0 THEN li%=li%+dg% : ss$ = "Ludes"
if xg%=1 THEN si%=si%+dg% : ss$ = "Speed"
if xg%=2 THEN wi%=wi%+dg% : ss$ = "Weed"
if xg%=3 THEN ai%=ai%+dg% : ss$ = "Acid"
if xg%=4 THEN hi%=hi%+dg% : ss$ = "Heroin"
if xg%=5 THEN ci%=ci%+dg% : ss$ = "Cocaine"
print "You found ";dg%;" units of"
print " ";ss$
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%=(rnd(1)*550)+250
gosub @wait
goto @menu
£loan
home
gosub @titlebar
print chr$(10)
print "Loan shark not implemented.
gosub @wait
goto @menu
£bank
home
gosub @titlebar
print chr$(10)
print "Bank not implemented."
gosub @wait
goto @menu
£menu
home
gosub @titlebar
gosub @freespace {it might be more efficient to calculate freespace now}
inverse : print " Day:";D%;" ";ph$ : normal
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"
input "Please make your selection: ";T$
if t$ = "C" goto @prices
if t$ = "I" goto @inventory
if t$ = "B" goto @buy
if t$ = "S" goto @sell
if t$ = "J" goto @jet
if t$ = "L" goto @loan
if t$ = "V" goto @bank
print "Invalid Selection" {This should be enough to catch errors. I should have a loop timer on this.}
goto @menu
£prices
home
gosub @titlebar {this is literally recycled from the price and gosub demo}
inverse:print" PRICES ":normal
print chr$(10)
print"cocaine:","$"c%
print"heroin:","$"h%
print"acid:","$"a%
print"weed:","$"w%
print"speed:","$"s%
print"ludes:","$"l%
print"wallet:","$"wa%
gosub @wait
goto @menu
£inventory
home
gosub @titlebar
inverse:print" INVENTORY ":normal
print chr$(10)
print"cocaine:",ci%
print"heroin:",hi%
print"acid:",ai%
print"weed:",wi%
print"speed:",si%
print"ludes:",li%
print"free space:",fs%
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"
input "Enter Selection: ";db$
if db$="c" goto @cokebuy
if db$="h" goto @herbuy
if db$="a" goto @acidbuy
if db$="w" goto @weedbuy
if db$="s" goto @spdbuy
if db$="l" goto @ludbuy
goto @menu
[
To "save space" the calculation for how much you can afford and carry
as well as looking for 0 to return to menu are a subroutine. I want to
subroutine some of the logic...but I'll have to try and organize the
code to allow that due to the gotos in the IF statements. Otherwise
it'll screw up. I'll work on that in a revision after the game mostly
works.
]
£cokebuy
home
gosub @titlebar
inverse:print" BUY COCAINE ":normal
print chr$(10)
j%=wa%/c%
gosub @howmuchbuy
if k%>fs% THEN inverse : print "You can't carry that much!" : normal : goto @cokebuy
if k%<=j% then ci%=ci%+k% : wa%=wa%-(c%*k%)
if k%>j% THEN inverse : print "You can't afford that much!" : normal : goto @cokebuy
goto @menu
£herbuy
home
gosub @titlebar
inverse:print" BUY HEROIN ":normal
print chr$(10)
j%=wa%/h%
gosub @howmuchbuy
if k%>fs% THEN inverse : print "You can't carry that much!" : normal : goto @herbuy
if k%<=j% then hi%=hi%+k% : wa%=wa%-(h%*k%)
if k%>j% THEN inverse : print "You can't afford that much!" : normal : goto @herbuy
goto @menu
£acidbuy
home
gosub @titlebar
inverse:print" BUY ACID ":normal
print chr$(10)
j%=wa%/a%
gosub @howmuchbuy
if k%>fs% THEN inverse : print "You can't carry that much!" : normal : goto @acidbuy
if k%<=j% THEN ai%=ai%+k% : wa%=wa%-(a%*k%)
if k%>j% THEN inverse : print "You can't afford that much!" : normal : goto @acidbuy
goto @menu
£weedbuy
home
gosub @titlebar
inverse:print" BUY WEED ":normal
print chr$(10)
j%=wa%/w%
gosub @howmuchbuy
if k%>fs% THEN inverse : print "You can't carry that much!" : normal : goto @weedbuy
if k%<=j% THEN wi%=wi%+k% : wa%=wa%-(w%*k%)
if k%>j% THEN inverse : print "You can't afford that much!" : normal : goto @weedbuy
goto @menu
£spdbuy
home
gosub @titlebar
inverse:print" BUY SPEED ":normal
print chr$(10)
j%=wa%/s%
gosub @howmuchbuy
if k%>fs% THEN inverse : print "You can't carry that much!" : normal : goto @spdbuy
if k%<=j% THEN si%=si%+k% : wa%=wa%-(s%*k%)
if k%>j% THEN inverse : print "You can't afford that much!" : normal : goto @spdbuy
goto @menu
£ludbuy
home
gosub @titlebar
inverse:print" BUY LUDES ":normal
print chr$(10)
j%=wa%/l%
gosub @howmuchbuy
if k%>fs% THEN inverse : print "You can't carry that much!" : normal : goto @ludbuy
if k%<=j% THEN li%=li%+k% : wa%=wa%-(l%*k%)
if k%>j% THEN inverse : print "You can't afford that much!" : normal : goto @ludbuy
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)";db$
if db$="c" goto @cokesell
if db$="h" goto @hersell
if db$="a" goto @acidsell
if db$="w" goto @weedsell
if db$="s" goto @spdsell
if db$="l" goto @ludsell
if db$="0" goto @menu
print "Invalid Selection!"
goto @sellsel
£cokesell
home
gosub @titlebar
inverse:print" SELL COCAINE ":normal
print chr$(10)
j%=ci%
gosub @howmuchsell
ci%=ci%-k%
wa%=wa%+(c%*k%)
goto @menu
£hersell
home
gosub @titlebar
inverse:print" SELL HEROIN ":normal
print chr$(10)
j%=hi%
gosub @howmuchsell
hi%=hi%-k%
wa%=wa%+(h%*k%)
goto @menu
£acidsell
home
gosub @titlebar
inverse:print" SELL ACID ":normal
print chr$(10)
j%=ai%
gosub @howmuchsell
ai%=ai%-k%
wa%=wa%+(a%*k%)
goto @menu
£weedsell
home
gosub @titlebar
inverse:print" SELL WEED ":normal
print chr$(10)
j%=wi%
gosub @howmuchsell
wi%=wi%-k%
wa%=wa%+(w%*k%)
goto @menu
£spdsell
home
gosub @titlebar
inverse:print" SELL SPEED ":normal
print chr$(10)
j%=si%
gosub @howmuchsell
si%=si%-k%
wa%=wa%+(s%*k%)
goto @menu
£ludsell
home
gosub @titlebar
inverse:print" SELL COCAINE ":normal
print chr$(10)
j%=li%
gosub @howmuchsell
li%=li%-k%
wa%=wa%+(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? ";jt$
if jt$="B" then pq$ = "The Bronx" : GOTO @jetb
if jt$="G" then pq$ = "The Ghetto" : GOTO @jetb
if jt$="C" then pq$ = "Central Park" : GOTO @jetb
if jt$="M" then pq$ = "Manhatten" : goto @jetb
if jt$="I" then pq$ = "Coney Island" : goto @jetb
if jt$="K" then pq$ = "Brooklyn" : goto @jetb
if jt$="O" then goto @menu
goto @jet
£jetb
if pq$=ph$ then goto @alreadythere
ph$ = pq$
goto @subway
£alreadythere
home
gosub @titlebar
inverse:print" JET ":normal
print chr$(10)
print "You're already in:"
print " ";ph$
gosub @wait
goto @jet
£subway
gosub @daily
gosub @titlebar
inverse:print" SUBWAY ":normal
print chr$(10)
gosub @subwayevents
print chr$(10) {the only way you should wind up here is if nothing happens}
print "Welcome to ";ph$ {i hope}
print chr$(10)
input "Press ENTER to continue. ";X$
goto @menu
£instructions
home
gosub @titlebar
print chr$(10)
print "Welcome to DRUGWAR//e"
print chr$(10)
print chr$(10)
input "Would you like instructions? (Y/N): ";Q$
£inserrorhandler {I'm hoping this will prevent crashes}
If Q$ = "Y" THEN GOTO @inst
IF Q$ = "N" THEN GOTO @gamestart
input "I don't understand you. Y or N only. ";Q$
goto @inserrorhandler
£gamestart {set wallet, debt, location, inventory space, zero out inventory}
wa%=2000
sa%=0
ls%=5000
d%=0 {daily subroutine adds a day}
ph$="The Bronx"
gn%=0
dp%=0
in%=100
ci%=0
hi%=0
ai%=0
wi%=0
si%=0
li%=0
gosub @daily {the only time we'll call this outside of the subway}
goto @menu {the real start of the game}
£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
£endgame
home
gosub @titlebar
inverse : print " GAME OVER " : NORMAL
print chr$(10)
print "Thanks for playing."
print "At this point I'm supposlisted to calculate"
print "your final score and all that. But this"
print "is an alpha release. So it's not done."
print chr$(10)
print "At least you didn't die from smoking"
print "that weed in the subway. Good job."
end
£ironicend
home
gosub @titlebar
inverse : print " GAME OVER " : NORMAL
print chr$(10)
print "Oh wow man. You died...from smoking pot"
print "in a game about drug dealing."
print chr$(10)
print "Well, thanks for playing."
end
Loading…
Cancel
Save