10 rem drugwar64v101.bas - 29/10/2018 - 04h45 20 rem drugwar/64 - version 1.01 30 rem codebase: drugwar//e 1.03 40 rem ported by: jay moore 50 rem "damn that was annoying" 60 rem 28-oct-2018 70 rem copyright 2018 jay moore 80 rem released under gpl v3 90 rem drugwar2e.sourceforge.io 100 rem twitter: _nq4t 110 poke 646,1 : poke 53281,0 : poke 53280,0 120 rv=1.01 130 goto 6960 140 rem->titlebar 150 poke 214,0:poke 211,14:sys 58640 : ?"drugwar/64" 160 print chr$(18)" " 170 return 180 rem->wait 190 print 200 input "press enter to continue.";x$ 210 return 220 rem->twofifteen 230 poke 214,1 : poke 211,14:sys 58640 240 return 250 rem->twosixteen 260 poke 214,1:poke 211,15:sys 58640 270 return 280 rem->twoseventeen 290 poke 214,1:poke 211,16:sys 58640 300 return 310 rem->twoeighteen 320 poke 214,1: poke 211,17:sys 58640 330 return 340 rem->twonineteen 350 poke 214,1:poke 211,18:sys 58640 360 return 370 rem->jetalthere 380 gosub 350:print chr$(18)"jet" 390 return 400 rem->timera 410 for j = 1 to 2500 420 next j 430 k = int(rnd(2)+.5) 440 return 450 rem->timerb 460 for j = 1 to 1000 470 next j 480 return 490 rem->timerc 500 for j = 1 to 2000 510 next j 520 return 530 rem->howmuchbuy 540 print "you can afford ";j 550 print "you can carry ";f 560 rem->howmanybuy 570 print 580 input "how many? (enter 0 cancel): ";k 590 if k=0 goto 1200 600 if k>f then print chr$(18)"you can't carry that much!" : goto 570 610 if k>j then print chr$(18)"you can't afford that much!" : goto 570 620 return 630 rem->howmuchsell 640 print "you can sell: ";j 650 print 660 rem->howmanysell 670 input "how many? (enter 0 to cancel.): ";k 680 if k>j then print "you don't have that many!" : goto 670 690 if k=0 goto 1200 700 return 710 rem->freespace 720 f=i-((g*5)+m+n+o+u+t+q) 730 return 740 rem->chase 750 gosub 230: print chr$(18)"being chased" 760 return 770 rem->gmod 780 gosub 260:print chr$(18)"game over" 790 return 800 rem->bronxcheck 810 if p$ = "the bronx" then return 820 print "you need to head to the bronx" 830 print "to take care of this business." 840 gosub 500 850 goto 1200 860 rem->daily 870 c=int(rnd(5)*12000+16000.5) 880 h=int(rnd(5)*7000+5000.5) 890 a=int((rnd(5)*34+10)*100+.5) 900 z=int((rnd(5)*42+33)*10+.5) 910 s=int((rnd(5)*15+7)*10+.5) 920 l=int((rnd(5)*4+1)*10+.5) 930 b=int(rnd(5)*20+.5) 940 d=d+1 950 rem->checkday 960 if d >= 31 goto 7400 970 return 980 rem->scorecalculate 990 k=(w+e)-v 1000 if k<0 then k=0 : return 1010 k=int(sqr((k/31.5)+.5)) 1020 if k>100 then k=100 1030 return 1040 rem->gamestart 1050 w=2000 1060 e=0 1070 v=5000 1080 p$="the bronx" 1090 g=0 1100 i=100 1110 m=0 1120 n=0 1130 o=0 1140 u=0 1150 t=0 1160 q=0 1170 gosub 870 1180 goto 1200 1190 rem->menu 1200 print chr$(147) 1210 gosub 720 1220 gosub 150 1230 poke 214,1:poke 211,3:sys 58640:print chr$(18)"day: "d 1240 poke 214,1:poke 211,17:sys 58640:print chr$(18)"location: "p$ 1250 print 1260 print "(c)heck prices" 1270 print "(t)renchcoat" 1280 print "(b)uy" 1290 print "(s)ell" 1300 print "(j)et" 1310 print "see (l)oan shark" 1320 print "(v)isit bank" 1330 print 1340 input "please make your selection: ";x$ 1350 if x$ = "c" goto 1440 1360 if x$ = "t" goto 1580 1370 if x$ = "b" goto 1720 1380 if x$ = "s" goto 1930 1390 if x$ = "j" goto 2170 1400 if x$ = "l" goto 2420 1410 if x$ = "v" goto 2560 1420 goto 1200 1430 rem->prices 1440 print chr$(147) 1450 gosub 150 1460 gosub 320:print chr$(18)"prices" 1470 print 1480 print"cocaine:","$"c 1490 print"heroin:","$"h 1500 print"acid:","$"a 1510 print"weed:","$"z 1520 print"speed:","$"s 1530 print"ludes:","$"l 1540 print"wallet:","$"w 1550 gosub 190 1560 goto 1200 1570 rem->inventory 1580 print chr$(147) 1590 gosub 150 1600 gosub 260 :print chr$(18)"trenchcoat" 1610 print 1620 print"cocaine:",m 1630 print"heroin:",n 1640 print"acid:",o 1650 print"weed:",u 1660 print"speed:",t 1670 print"ludes:",q 1680 print"free space:",f 1690 gosub 190 1700 goto 1200 1710 rem->buy 1720 print chr$(147) 1730 gosub 150 1740 gosub 350: print chr$(18)"buy" 1750 print 1760 print"what do you want to buy?" 1770 print 1780 print "(c)ocaine" 1790 print "(h)eroin" 1800 print "(a)cid" 1810 print "(w)eed" 1820 print "(s)peed" 1830 print "(l)udes" 1840 input "enter selection: ";x$ 1850 if x$="c" goto 2700 1860 if x$="h" goto 2790 1870 if x$="a" goto 2880 1880 if x$="w" goto 2970 1890 if x$="s" goto 3060 1900 if x$="l" goto 3150 1910 goto 1200 1920 rem->sell 1930 print chr$(147) 1940 gosub 150 1950 gosub 320: print chr$(18)"sell" 1960 print 1970 print "what would you like to sell?" 1980 print 1990 print "(c)ocaine" 2000 print "(h)eroin" 2010 print "(a)cid" 2020 print "(w)eed" 2030 print "(s)peed" 2040 print "(l)udes" 2050 rem->sellsel 2060 input "enter selection: (0 to cancel)";x$ 2070 if x$="c" goto 3240 2080 if x$="h" goto 3340 2090 if x$="a" goto 3440 2100 if x$="w" goto 3540 2110 if x$="s" goto 3640 2120 if x$="l" goto 3740 2130 if x$="0" goto 1200 2140 print "invalid selection!" 2150 goto 2060 2160 rem->jet 2170 print chr$(147) 2180 gosub 150 2190 gosub 380 2200 print 2210 print "(b)ronx" 2220 print "(g)hetto" 2230 print "(c)entral park 2240 print "(m)anhattan" 2250 print "coney (i)sland" 2260 print "broo(k)lyn" 2270 print "(o)ops...stay!" 2280 input "where to dude? ";x$ 2290 if x$="b" then y$ = "the bronx" : goto 2380 2300 if x$="g" then y$ = "the ghetto" : goto 2380 2310 if x$="c" then y$ = "central park" : goto 2380 2320 if x$="m" then y$ = "manhattan" : goto 2380 2330 if x$="i" then y$ = "coney island" : goto 2380 2340 if x$="k" then y$ = "brooklyn" : goto 2380 2350 if x$="o" then goto 1200 2360 goto 2170 2370 rem->jetb 2380 if y$=p$ then goto 3840 2390 p$ = y$ : y$ = "" 2400 goto 3930 2410 rem->loan 2420 print chr$(147) 2430 gosub 150 2440 gosub 260:print chr$(18)"loan shark" 2450 print 2460 gosub 810 2470 print "your debt is: $";v 2480 print "you have: $";w 2490 print 2500 input "(r)epay, (b)orrow, (l)eave: ";x$ 2510 if x$ = "r" then goto 6540 2520 if x$ = "b" then goto 6630 2530 if x$ = "l" then goto 1200 2540 goto 2420 2550 rem->bank 2560 print chr$(147) 2570 gosub 150 2580 gosub 230: print chr$(18)"bank o'murica" 2590 print 2600 gosub 810 2610 print "your balance: $";e 2620 print "your wallet: $";w 2630 print 2640 input "(d)eposit, (w)ithdraw, (l)eave: ";x$ 2650 if x$ = "d" then goto 6760 2660 if x$ = "w" then goto 6860 2670 if x$ = "l" then goto 1200 2680 goto 2560 2690 rem->cokebuy 2700 print chr$(147) 2710 gosub 150 2720 gosub 260: print chr$(18)"buy cocaine" 2730 print 2740 j=int(w/c) 2750 gosub 540 2760 m=m+k : w=w-(c*k) 2770 goto 1200 2780 rem->herbuy 2790 print chr$(147) 2800 gosub 150 2810 gosub 260: print chr$(18)"buy heroin" 2820 print 2830 j=int(w/h) 2840 gosub 540 2850 n=n+k : w=w-(h*k) 2860 goto 1200 2870 rem->acidbuy 2880 print chr$(147) 2890 gosub 150 2900 gosub 290:print chr$(18)"buy acid" 2910 print 2920 j=int(w/a) 2930 gosub 540 2940 o=o+k : w=w-(a*k) 2950 goto 1200 2960 rem->weedbuy 2970 print chr$(147) 2980 gosub 150 2990 gosub 290: print chr$(18)"buy weed" 3000 print 3010 j=int(w/z) 3020 gosub 540 3030 u=u+k : w=w-(z*k) 3040 goto 1200 3050 rem->spdbuy 3060 print chr$(147) 3070 gosub 150 3080 gosub 290: print chr$(18)"buy speed" 3090 print 3100 j=int(w/s) 3110 gosub 540 3120 t=t+k : w=w-(s*k) 3130 goto 1200 3140 rem->ludbuy 3150 print chr$(147) 3160 gosub 150 3170 gosub 290: print chr$(18)"buy ludes" 3180 print 3190 j=int(w/l) 3200 gosub 540 3210 q=q+k : w=w-(l*k) 3220 goto 1200 3230 rem->cokesell 3240 print chr$(147) 3250 gosub 150 3260 gosub 230:print chr$(18)"sell cocaine" 3270 print 3280 j=m 3290 gosub 640 3300 m=m-k 3310 w=w+(c*k) 3320 goto 1200 3330 rem->hersell 3340 print chr$(147) 3350 gosub 150 3360 gosub 290:print chr$(18)"sell heroin" 3370 print 3380 j=n 3390 gosub 640 3400 n=n-k 3410 w=w+(h*k) 3420 goto 1200 3430 rem->acidsell 3440 print chr$(147) 3450 gosub 150 3460 gosub 290: print chr$(18)"sell acid" 3470 print 3480 j=o 3490 gosub 640 3500 o=o-k 3510 w=w+(a*k) 3520 goto 1200 3530 rem->weedsell 3540 print chr$(147) 3550 gosub 150 3560 gosub 290:print chr$(18)"sell weed" 3570 print 3580 j=u 3590 gosub 640 3600 u=u-k 3610 w=w+(z*k) 3620 goto 1200 3630 rem->spdsell 3640 print chr$(147) 3650 gosub 150 3660 gosub 260:print chr$(18)"sell speed" 3670 print 3680 j=t 3690 gosub 640 3700 t=t-k 3710 w=w+(s*k) 3720 goto 1200 3730 rem->ludsell 3740 print chr$(147) 3750 gosub 150 3760 gosub 260:print chr$(18)"sell ludes" 3770 print 3780 j=q 3790 gosub 640 3800 q=q-k 3810 w=w+(l*k) 3820 goto 1200 3830 rem->alreadythere 3840 print chr$(147) 3850 gosub 150 3860 gosub 380 3870 print 3880 print "you're already in:" 3890 print " ";p$ 3900 gosub 500 3910 goto 2170 3920 rem->subway 3930 print chr$(147) 3940 gosub 870 3950 v=int(v*1.1+.5) 3960 e=int(e*1.06+.5) 3970 gosub 150 3980 gosub 320:print chr$(18)"subway" 3990 print 4000 if b=1 then goto 4250 4010 if b=2 then goto 4300 4020 if b=3 then goto 4350 4030 if b=4 then goto 4410 4040 if b=5 then goto 4410 4050 if b=6 then goto 4470 4060 if b=7 then goto 4470 4070 if b=8 then goto 4530 4080 if b=9 then goto 4630 4090 if b=10 then goto 4630 4100 if b=11 then goto 4630 4110 if b=12 then goto 6020 4120 if b=13 then goto 6020 4130 if b=14 then goto 6160 4140 if b=15 then goto 6230 4150 if b=16 then goto 6310 4160 if b=17 then goto 6480 4170 rem->nothinghappened 4180 rem->nothinghappens 4190 print 4200 print "welcome to ";p$ 4210 print 4220 gosub 500 4230 goto 1200 4240 rem->cheapludes 4250 print "rival dealers are selling cheap ludes!" 4260 l=2 4270 gosub 500 4280 goto 1200 4290 rem->cheepweed 4300 print "weed prices have bottomed-out!" 4310 z=122 4320 gosub 500 4330 goto 1200 4340 rem->pigheroin 4350 print "pigs are selling cheap heroin" 4360 print "from last week's raid!" 4370 h=int((rnd(9)*1150)+850.5) 4380 gosub 500 4390 goto 1200 4400 rem->heroinbust 4410 print "addicts are buying heroin" 4420 print "at outrageous prices!" 4430 h=int((rnd(9)*25000)+18000.5) 4440 gosub 500 4450 goto 1200 4460 rem->cokebust 4470 print "pigs made a big coke bust!" 4480 print "prices are outrageous!!!!" 4490 c=int((rnd(9)*60000)+80000.5) 4500 gosub 500 4510 goto 1200 4520 rem->mugged 4530 print "you got mugged!" 4540 print 4550 j=int(w/3) 4560 j=int(j*2) 4570 k=int(w-j) 4580 print "you lost $";k 4590 w=j 4600 gosub 500 4610 gosub 1200 4620 rem->cops 4630 k=m+n+u+o+t+p 4640 if k<50 then goto 4180 4650 if b=9 then b = 2 4660 if b=10 then b=4 4670 if b=11 then b=5 4680 print "it's the cops!" 4690 print 4700 print "officer hardass and ";b-1;" of his" 4710 print "deputies are after you!" 4720 print 4730 gosub 500 4740 goto 4760 4750 rem->police 4760 print chr$(147) 4770 gosub 150 4780 gosub 750 4790 print 4800 print 4810 print "view (g)uns" 4820 print "view (d)amage" 4830 print "(n)umber of pigs" 4840 print "(r)un" 4850 print "(f)ight" 4860 print 4870 input "what do you want to do? ";x$ 4880 if x$="g" goto 4950 4890 if x$ = "d" goto 5050 4900 if x$ = "n" goto 5170 4910 if x$ = "r" goto 5280 4920 if x$="f" goto 5450 4930 goto 4760 4940 rem->pgun 4950 print chr$(147) 4960 gosub 150 4970 gosub 750 4980 print 4990 print 5000 print "you have ";g;" guns. 5010 print 5020 gosub 190 5030 goto 4760 5040 rem->damage 5050 print chr$(147) 5060 gosub 150 5070 gosub 750 5080 print 5090 print 5100 print "your current damage is ";bb;"." 5110 print 5120 print "50 and you die!" 5130 print 5140 gosub 190 5150 goto 4760 5160 rem->ncops 5170 print chr$(147) 5180 gosub 150 5190 gosub 750 5200 print 5210 print 5220 print "there are ";b;" pigs still chasing you!" 5230 print 5240 print 5250 gosub 190 5260 goto 4760 5270 rem->run 5280 print chr$(147) 5290 gosub 150 5300 gosub 750 5310 print 5320 print 5330 print "running..." 5340 gosub 410 5350 if k = 0 then print "you lost them in an alley!" : goto 5410 5360 print "you can't shake them!" 5370 print 5380 gosub 190 5390 goto 4760 5400 rem->loserun 5410 print 5420 gosub 190 5430 goto 1200 5440 rem->fight 5450 if g>0 then goto 5510 5460 print 5470 print "you don't have any guns!" 5480 gosub 190 5490 goto 4760 5500 rem->fightc 5510 print chr$(147) 5520 gosub 150 5530 gosub 750 5540 print 5550 print "you shoot!" 5560 gosub 410 5570 if k=0 then goto 5600 5580 print "you got one!" : b = b-1 : goto 5620 5590 rem->miss 5600 print "you missed!" 5610 rem->next 5620 print 5630 print 5640 if b <= 0 then goto 5840 5650 gosub 460 5660 print "they're firing at you!" 5670 gosub 410 5680 if k=0 then goto 5740 5690 print "you've been hit!" 5700 bb=bb+3 5710 if bb >= 50 goto 5790 5720 goto 5760 5730 rem->theymiss 5740 print "they missed!" 5750 rem->nexta 5760 gosub 190 5770 goto 4760 5780 rem->ded 5790 print 5800 print "you've been killed!" 5810 gosub 190 5820 goto 7400 5830 rem->allgone 5840 print "you killed all of them!" 5850 print 5860 gosub 410 5870 j=int(((rnd(7)*1250)+750)+.5) 5880 w=w+j 5890 print "you found $";j;" on officer hardass'" 5900 print "carcass!" 5910 if w>=1200 then goto 5940 5920 goto 1200 5930 rem->doctor 5940 gosub 500 5950 print 5960 print "will you pay $1000 for a doctor" 5970 input "to sew you up? (y/n)";x$ 5980 if x$ <> "y" then goto 1200 5990 w=w-1000 6000 bb=0 6010 rem->gunbuy 6020 if w < 500 then goto 4180 6030 gosub 720 6040 if f < 5 then goto 4180 6050 j=int((rnd(4)*2)+.5) 6060 if j = 0 then y$ = "baretta" 6070 if j = 1 then y$ = "saturday night special" 6080 if j = 2 then y$ = ".44 magnum" 6090 print "will you buy a ";y$ 6100 input "for $400? (y/n)";x$ 6110 if x$ <> "y" then goto 1200 6120 g = g+1 6130 w = w-400 6140 goto 1200 6150 rem->dedweed 6160 print "there's some weed here that smells" 6170 print "like good stuff!!" 6180 print 6190 input "will you smoke it? (y/n)";x$ 6200 if x$ = "y" then goto 7270 6210 goto1200 6220 rem->newcoat 6230 if w<300 then goto 4190 6240 print "will you buy a new trenchcoat" 6250 input "with more pockets for $200? (y/n)";x$ 6260 if x$ <> "y" then goto 1200 6270 i=i+10 6280 w=w-200 6290 goto 1200 6300 rem->dedguy 6310 gosub 720 6320 if f<8 then goto 4190 6330 j=int((rnd(3)*7)+1.5) 6340 k=int(rnd(3)*5+.5) 6350 if k=0 then q=q+j : y$ = "ludes" 6360 if k=1 then t=t+j : y$ = "speed" 6370 if k=2 then u=u+j : y$ = "weed" 6380 if k=3 then o=o+j : y$ = "acid" 6390 if k=4 then n=n+j : y$ = "heroin" 6400 if k=5 then m=m+j : y$ = "cocaine" 6410 print "you found ";j;" units of" 6420 print " ";y$ 6430 print "on a dead dude in the subway!" 6440 print 6450 gosub 500 6460 goto 1200 6470 rem->homeacid 6480 print "the market has been flooded" 6490 print "with cheap home-made acid!" 6500 a=int((rnd(4)*550)+250.5) 6510 gosub 500 6520 goto 1200 6530 rem->payme 6540 input "repay how much? ";k 6550 if k>w then print:print "you don't have that much!" : gosub 460 : goto 2420 6560 if k>v then print:print "you don't owe that much!" : gosub 460 : goto 2420 6570 w=w-k 6580 v=v-k 6590 print:print "thank you." 6600 gosub 500 6610 goto 1200 6620 rem->borrow 6630 print 6640 input "how much do you want? ";k 6650 print 6660 j=int((rnd(10)*10000)+5000) 6670 if k>14000 then print "he's not that stupid!" : gosub 500 : goto 1200 6680 if k > j then print "he doesn't feel like it." : gosub 460 : goto 1200 6690 v=v+k 6700 w=w+k 6710 print 6720 print "here's your money." : print : print "remember, i break thumbs." 6730 gosub 500 6740 goto 1200 6750 rem->deposit 6760 print 6770 input "how much? ";j 6780 if j>w then print "you don't have that much cash." : goto 6760 6790 e=e+j 6800 w=w-j 6810 print 6820 print "thank you for your deposit." 6830 gosub 500 6840 goto 1200 6850 rem->mymoney 6860 print 6870 input "how much? ";j 6880 if j>e then print "you don't have sufficient funds." : goto 6860 6890 e=e-j 6900 w=w+j 6910 print 6920 print "thank you for your business." 6930 gosub 500 6940 goto 1200 6950 rem->instructions 6960 print chr$(147) 6970 poke 211,3:sys 58640:print "welcome to drugwar/64 version";rv 6980 poke 211,5:sys 58640: print "ported from drugwar//e v 1.03":?:?:?:?:? 6990 ?: ? : poke 211,5:sys 58640:? "based on the ti-basic clone of" 7000 poke 211,7:sys 58640:print "john e. dell's 1984 drugwar" 7010 poke 211,11:sys 58640:print "for ibm and trs-80":?:? 7020 ?:?:poke 211,6:sys 58640:?"applesoft version by jay moore" 7030 poke 211,10:sys 58640: print "c64 port by jay moore" 7040 poke 211,1 : poke 214,23 : sys 58640 7050 input "would you like instructions? (y/n)";x$ 7060 j=rnd(-ti) 7070 if x$ = "y" then goto 7100 7080 goto 1050 7090 rem->inst 7100 print chr$(147) 7110 gosub 150 7120 print 7130 print "this is a game of buying and selling." 7140 print "your goal is to pay off your debt and" 7150 print "make as much money as possible in a one" 7160 print "month period. prices fluctuate every day" 7170 print "and interest on your loan is calculated as well." 7180 print:print "if you deal too heavily, you'll attract the attention" 7190 print "of the police." 7200 print 7210 print "commands are entered using the letter" 7220 print "highlighted (l)ike (s)o. y is yes and" 7230 print "anything counts as no." 7240 gosub 190 7250 goto 1050 7260 rem->weedend 7270 print chr$(147) 7280 gosub 150 7290 gosub 230: print chr$(18)"smoke weed" 7300 print "you hallucinate on the wildest trip" 7310 print "of your life, stumble on to the tracks," 7320 print "and get creamed by a train!" 7330 print 7340 print 7350 poke 211,7:sys 58640:? "just say no to drugs!" 7360 gosub 500 7370 gosub 460 7380 goto 7540 7390 rem->endgame 7400 print chr$(147) 7410 gosub 150 7420 gosub 990 7430 gosub 780 7440 print 7450 print "your score on a scale of 1 to 100: ";k 7460 print 7470 input "would you like to play again? (y/n)";x$ 7480 if x$ = "y" then goto 1050 7490 print "thanks for playing." 7500 print "remember, watch your back." 7510 print "have a nice day!" 7520 end 7530 rem->ironicend 7540 print chr$(147) 7550 gosub 150 7560 gosub 780 7570 print 7580 print "you died from smoking weed." 7590 print 7600 print 7610 gosub 500: print"see? games are totally fake." 7620 print 7630 input "would you like to play again? ";x$ 7640 if x$= "y" then goto 1050 7650 end