home *** CD-ROM | disk | FTP | other *** search
/ back2roots/filegate / filegate.zip / filegate / gamesnet / g_amiga / A85NWR13.ZIP / A85NWR13.LHA / Dopewars-Source.txt < prev    next >
Text File  |  1999-12-26  |  14KB  |  435 lines

  1. Rem ********************************** 
  2. Rem **           Dope Wars          ** 
  3. Rem **         ⌐ 2000. AmiDev       ** 
  4. Rem **         Version 1.02b        ** 
  5. Rem **  Amiga version by Mark Gare  ** 
  6. Rem ********************************** 
  7. Dim GUN$(5),GUN_PRICE(4),DRUG_LIST$(2,9),DRUG_PRICE(2,9),DRUG_CONTENT(9),PLACE$(6),PLCE$(6),_ADD(9)
  8. CASH=4000 : COAT=0 : COATMAX=100 : PLACE=1 : DAY=1 : _MAXDAY=31 : LOAN=2000 : BANK=0 : LOAN_PAID=0 : GUNS=0 : HEALTH=100 : G=1
  9. GUN$(1)="None   "
  10. GUN$(2)="Beretta"
  11. GUN$(3)="Colt-45"
  12. GUN$(4)="Shotgun"
  13. GUN$(5)="Uzi"
  14. GUN_PRICE(1)=3000
  15. GUN_PRICE(2)=6000
  16. GUN_PRICE(3)=9500
  17. GUN_PRICE(4)=30000
  18. Global DRUG_LIST$(),COAT,COATMAX,DRUG_PRICE(),DRUG_CONTENT(),PLACE$(),PLCE$(),_ADD(),GUN$(),GUN_PRICE()
  19. Global COAT,COATMAX,CASH,PLACE,DAY,_MAXDAY,LOAN,BANK,LOAN_PAID,GUNS,HEALTH,G
  20. _INTRO
  21. _GAME
  22. Procedure _SCREEN[Z]
  23.    If Z=1
  24.       Screen Open 0,640,256,16,Hires
  25.       Paper 0
  26.       Curs Off 
  27.       Flash Off 
  28.       Hide 
  29.       Cls 0
  30.    End If 
  31.    If Z=2
  32.       Fade 3
  33.       Wait 4
  34.       Screen Close 0
  35.    End If 
  36. End Proc
  37. Do 
  38. Procedure _INTRO
  39.    _SCREEN[1]
  40.    Pen 4
  41.    Locate ,3 : Centre "Dope Wars - ⌐ Amidev 2000"
  42.    Locate 3,5 : Print "You are about to enter an underground world of trading drugs, fighting"
  43.    Locate 3,6 : Print "the police and dealing with loan sharks and petty thieves. No, you"
  44.    Locate 3,7 : Print "havent been elected to Government - this is Dope Wars, a rather silly"
  45.    Locate 3,8 : Print "and harmless game."
  46.    Locate 3,10 : Print "However, to have the level of maturity and wisdom to actually understand"
  47.    Locate 3,11 : Print "the difference between real life and a harmless game, conventional thinking"
  48.    Locate 3,12 : Print "says that you must be over 18 years of age. If you are under that age, please"
  49.    Locate 3,13 : Print "press N now to leave this game. Otherwise press Y now."
  50.    Pen 2
  51.    Locate ,16 : Centre "Press Y to continue or N to exit Dope Wars"
  52.    Repeat 
  53.       K$=Inkey$
  54.       K$=Lower$(K$)
  55.       If Key State(69)=True Then End 
  56.       If K$="y" Then Z=1
  57.       If K$="n"
  58.          _SCREEN[2]
  59.          Wait 1
  60.          End 
  61.       End If 
  62.    Until Z=1
  63.    _SCREEN[2]
  64. End Proc
  65. Procedure _GAME
  66.    _SCREEN[1]
  67.    _GO:
  68.    Repeat 
  69.       Cls 0
  70.       Locate ,1 : Centre "Dope Wars"
  71.       Goto _LIST
  72.       _LIST:
  73.       Locate 5,8 : Print "Drug List"
  74.       Locate 45,8 : Print "Stock List"
  75.       Locate 20,8 : Print "Drug Price"
  76.       Locate 60,8 : Print "Quantity"
  77.       Gosub _DATA
  78.       Locate 4,3 : Print "Money    :";CASH
  79.       Locate 36,3 : Print "Bank        :";BANK
  80.       Locate 4,4 : Print "Location : ";PLACE$(PLACE)
  81.       Locate 4,5 : Print "Day      :";DAY;" /";_MAXDAY
  82.       Locate 36,4 : Print "Health      :";HEALTH;"/100"
  83.       Locate 36,5 : Print "Current Gun : ";GUN$(G)
  84.       Locate 4,6 : Print "Loan     :";LOAN
  85.       Locate 5,10 : Print DRUG_LIST$(1,1) : Locate 20,10 : Print DRUG_PRICE(2,1) : Locate 45,10 : Print DRUG_LIST$(2,1) : Locate 60,10 : Print DRUG_CONTENT(1)
  86.       Locate 5,11 : Print DRUG_LIST$(1,2) : Locate 20,11 : Print DRUG_PRICE(2,2) : Locate 45,11 : Print DRUG_LIST$(2,2) : Locate 60,11 : Print DRUG_CONTENT(2)
  87.       Locate 5,12 : Print DRUG_LIST$(1,3) : Locate 20,12 : Print DRUG_PRICE(2,3) : Locate 45,12 : Print DRUG_LIST$(2,3) : Locate 60,12 : Print DRUG_CONTENT(3)
  88.       Locate 5,13 : Print DRUG_LIST$(1,4) : Locate 20,13 : Print DRUG_PRICE(2,4) : Locate 45,13 : Print DRUG_LIST$(2,4) : Locate 60,13 : Print DRUG_CONTENT(4)
  89.       Locate 5,14 : Print DRUG_LIST$(1,5) : Locate 20,14 : Print DRUG_PRICE(2,5) : Locate 45,14 : Print DRUG_LIST$(2,5) : Locate 60,14 : Print DRUG_CONTENT(5)
  90.       Locate 5,15 : Print DRUG_LIST$(1,6) : Locate 20,15 : Print DRUG_PRICE(2,6) : Locate 45,15 : Print DRUG_LIST$(2,6) : Locate 60,15 : Print DRUG_CONTENT(6)
  91.       Locate 5,16 : Print DRUG_LIST$(1,7) : Locate 20,16 : Print DRUG_PRICE(2,7) : Locate 45,16 : Print DRUG_LIST$(2,7) : Locate 60,16 : Print DRUG_CONTENT(7)
  92.       Locate 5,17 : Print DRUG_LIST$(1,8) : Locate 20,17 : Print DRUG_PRICE(2,8) : Locate 45,17 : Print DRUG_LIST$(2,8) : Locate 60,17 : Print DRUG_CONTENT(8)
  93.       Locate 5,18 : Print DRUG_LIST$(1,9) : Locate 20,18 : Print DRUG_PRICE(2,9) : Locate 45,18 : Print DRUG_LIST$(2,9) : Locate 60,18 : Print DRUG_CONTENT(9)
  94.       Locate 5,20 : Print "F1 - Buy Drugs" : Locate 30,20 : Print "F2 - Sell Drugs" : Locate 51,20 : Print "F3 - Jet"
  95.       Locate 5,21 : Print "F4 - Finances" : Locate 30,21 : Print "F5 - Gun shop" : Locate 51,21 : Print "F6 - Hospital"
  96.       Z=0
  97.       If DAY>6 Then Gosub _POLICE
  98.       Repeat 
  99.          K$=Inkey$
  100.          If Key State(80)=True Then Z=1
  101.          If Key State(81)=True Then Z=2
  102.          If Key State(82)=True Then Z=3
  103.          If Key State(83)=True Then Z=4
  104.          If Key State(84)=True Then Z=5
  105.          If Key State(85)=True Then Z=6
  106.          If Key State(69)=True Then End 
  107.       Until Z>0
  108.       Wait 15
  109.       If Z=1 Then Gosub _BUY
  110.       If Z=2 Then Gosub _SELL
  111.       If Z=3 Then Gosub _JET
  112.       If Z=4 Then Gosub _BANK
  113.       If Z=5 Then Gosub _GUN_SHOP
  114.       If Z=6 Then Gosub _HOSPITAL
  115.       If DAY=32 Then MD=1
  116.       If DAY<32 Then Goto _GO
  117.    Until MD=1
  118.    Pop Proc
  119.    
  120.    _BUY:
  121.    Locate ,23 : Centre "Press the key representing the drug you want to buy."
  122.    B=0
  123.    Repeat 
  124.       K$=Inkey$
  125.       K$=Lower$(K$)
  126.       If Key State(69)=True Then End 
  127.       If K$="h" Then B=1
  128.       If K$="c" Then B=2
  129.       If K$="o" Then B=3
  130.       If K$="e" Then B=4
  131.       If K$="a" Then B=5
  132.       If K$="w" Then B=6
  133.       If K$="r" Then B=7
  134.       If K$="s" Then B=8
  135.       If K$="p" Then B=9
  136.    Until B>0
  137.    BUY=CASH/DRUG_PRICE(2,B)
  138.    Locate 5,24 : Print "You can buy";BUY;" units of the drug ";DRUG_LIST$(2,B)
  139.    AGAIN1:
  140.    Locate 5,25 : Print "How many units do you want to buy" : Locate 38,25 : Input UNIT
  141.    If UNIT>BUY Then Goto AGAIN1
  142.    If UNIT<=BUY Then Goto OK1
  143.    OK1:
  144.    BUY=DRUG_PRICE(2,B)*UNIT
  145.    CASH=CASH-BUY
  146.    COAT=COAT+UNIT
  147.    DRUG_CONTENT(B)=UNIT
  148.    Wait 5
  149.    Return 
  150.    _SELL:
  151.    Locate ,23 : Centre "Press the key representing the drug you want to sell."
  152.    B=0
  153.    Repeat 
  154.       K$=Inkey$
  155.       K$=Lower$(K$)
  156.       If Key State(69)=True Then End 
  157.       If K$="h" Then B=1
  158.       If K$="c" Then B=2
  159.       If K$="o" Then B=3
  160.       If K$="e" Then B=4
  161.       If K$="a" Then B=5
  162.       If K$="w" Then B=6
  163.       If K$="r" Then B=7
  164.       If K$="s" Then B=8
  165.       If K$="p" Then B=9
  166.    Until B>0
  167.    Locate 5,24 : Print "You can sell";DRUG_CONTENT(B);" units of the drug ";DRUG_LIST$(2,B)
  168.    AGAIN2:
  169.    Locate 5,25 : Print "How many units do you want to sell" : Locate 39,25 : Input UNIT
  170.    If UNIT>DRUG_CONTENT(B) Then Goto AGAIN2
  171.    If UNIT<=DRUG_CONTENT(B) Then Goto OK2
  172.    OK2:
  173.    PRICE=UNIT*DRUG_PRICE(2,B)
  174.    DRUG_CONTENT(B)=DRUG_CONTENT(B)-UNIT
  175.    CASH=CASH+PRICE
  176.    Wait 5
  177.    Return 
  178.    
  179.    _JET:
  180.    Locate 5,23 : Print PLCE$(1) : Locate 30,23 : Print PLCE$(2) : Locate 55,23 : Print PLCE$(3)
  181.    Locate 5,24 : Print PLCE$(4) : Locate 30,24 : Print PLCE$(5) : Locate 55,24 : Print PLCE$(6)
  182.    P=0
  183.    Repeat 
  184.       K$=Inkey$
  185.       If Key State(69)=True Then End 
  186.       If Key State(80)=True Then P=1
  187.       If Key State(81)=True Then P=2
  188.       If Key State(82)=True Then P=3
  189.       If Key State(83)=True Then P=4
  190.       If Key State(84)=True Then P=5
  191.       If Key State(85)=True Then P=6
  192.    Until P>0
  193.    PLACE=P
  194.    P=0
  195.    Inc DAY
  196.    If LOAN_PAID<>1
  197.       PLUS=LOAN*0.025
  198.       LOAN=LOAN+PLUS
  199.    End If 
  200.    Return 
  201.    
  202.    _DATA:
  203.    DRUG_PRICE(1,1)=5000
  204.    DRUG_PRICE(1,2)=10000
  205.    DRUG_PRICE(1,3)=1000
  206.    DRUG_PRICE(1,4)=50
  207.    DRUG_PRICE(1,5)=500
  208.    DRUG_PRICE(1,6)=200
  209.    DRUG_PRICE(1,7)=500
  210.    DRUG_PRICE(1,8)=100
  211.    DRUG_PRICE(1,9)=200
  212.    _ADD(1)=Rnd(5000) : _ADD(2)=Rnd(10000) : _ADD(3)=Rnd(1000) : _ADD(4)=Rnd(50)
  213.    _ADD(5)=Rnd(500) : _ADD(6)=Rnd(500) : _ADD(7)=Rnd(500) : _ADD(8)=Rnd(100) : _ADD(9)=Rnd(200)
  214.    For Z=1 To 9
  215.       DRUG_PRICE(2,Z)=DRUG_PRICE(1,Z)+_ADD(Z)
  216.    Next Z
  217.    DRUG_LIST$(1,1)="(H)erion"
  218.    DRUG_LIST$(1,2)="(C)oke"
  219.    DRUG_LIST$(1,3)="(O)pium"
  220.    DRUG_LIST$(1,4)="(E)cstasy"
  221.    DRUG_LIST$(1,5)="(A)cid"
  222.    DRUG_LIST$(1,6)="(W)eed"
  223.    DRUG_LIST$(1,7)="C(r)ack"
  224.    DRUG_LIST$(1,8)="(S)peed"
  225.    DRUG_LIST$(1,9)="(P)eyote"
  226.    DRUG_LIST$(2,1)="Herion"
  227.    DRUG_LIST$(2,2)="Coke"
  228.    DRUG_LIST$(2,3)="Opium"
  229.    DRUG_LIST$(2,4)="Ecstasy"
  230.    DRUG_LIST$(2,5)="Acid"
  231.    DRUG_LIST$(2,6)="Weed"
  232.    DRUG_LIST$(2,7)="Crack"
  233.    DRUG_LIST$(2,8)="Speed"
  234.    DRUG_LIST$(2,9)="Peyote"
  235.    PLACE$(1)="Bronx       "
  236.    PLACE$(2)="Getto       "
  237.    PLACE$(3)="Central Park"
  238.    PLACE$(4)="Manhatten   "
  239.    PLACE$(5)="Coney Island"
  240.    PLACE$(6)="Brooklyn    "
  241.    PLCE$(1)="F1 - Bronx       "
  242.    PLCE$(2)="F2 - Getto       "
  243.    PLCE$(3)="F3 - Central Park"
  244.    PLCE$(4)="F4 - Manhatten   "
  245.    PLCE$(5)="F5 - Coney Island"
  246.    PLCE$(6)="F6 - Brooklyn    "
  247.    Return 
  248.    
  249.    _POLICE:
  250.    A=Rnd(10)
  251.    PIGS=Rnd(4)
  252.    If A=1 or A=4 or A=7 Then Gosub _PIGS
  253.    If A=2 or A=3 or A=5 or A=8 or A=9 or A=10 Then Return 
  254.    _PIGS:
  255.    Locate ,22 : Centre "Oh shit, theres Mr Policeman!"
  256.    Locate 5,24 : Print "Gun : ";GUN$(G);" Health :";HEALTH;"    "
  257.    Locate 5,25 : Print "There are";PIGS;" pig(s), what are you going to do?"
  258.    Locate 5,26 : Print "F1 - Fight"
  259.    Locate 5,27 : Print "F2 - Run"
  260.    Z=0
  261.    Repeat 
  262.       K$=Inkey$
  263.       If Key State(80) Then Z=1
  264.       If Key State(81) Then Z=2
  265.    Until Z>0
  266.    If Z=1
  267.       If G=1
  268.          Locate 5,28 : Print "You have no gun to fight with"
  269.          Locate 5,29 : Print "Press any key to continue."
  270.          Wait Key 
  271.          Locate 2,28 : Print "                                 "
  272.          Locate 2,29 : Print "                                 "
  273.          Goto _PIGS
  274.       End If 
  275.       If G>1
  276.          ZZ=Rnd(3)
  277.          If ZZ=1
  278.             HIT=0
  279.          End If 
  280.          If ZZ=2
  281.             HIT=1
  282.          End If 
  283.          If ZZ=3
  284.             HIT=2
  285.          End If 
  286.          If HIT=0
  287.             Locate 5,28 : Print "You missed, they missed."
  288.             Locate 5,29 : Print "Press a key to continue."
  289.             Wait Key 
  290.          End If 
  291.          If HIT=1
  292.             Locate 5,28 : Print "You missed, they hit."
  293.             Locate 5,29 : Print "Press a key to continue."
  294.             HEALTH=HEALTH-5
  295.             Wait Key 
  296.          End If 
  297.          If HIT=2
  298.             Locate 5,28 : Print "You hit, they missed."
  299.             Locate 5,29 : Print "Press a key to continue."
  300.             PIGS=PIGS-1
  301.             Wait Key 
  302.          End If 
  303.          
  304.       End If 
  305.    End If 
  306.    If PIGS<>0 Then Goto _PIGS
  307.    If PIGS=0
  308.       Locate 5,28 : Print "You killed them all."
  309.       Locate 5,29 : Print "Press a key to continue."
  310.       Wait Key 
  311.       Locate 4,28 : Print "                               "
  312.       Locate 4,29 : Print "                               "
  313.       Goto _GO
  314.    End If 
  315.    If Z=2
  316.       If PIGS<3
  317.          Locate 5,28 : Print "You managed to escape down an alley."
  318.          Locate 5,29 : Print "Press a key to continue."
  319.          ZZZ=3
  320.          Wait Key 
  321.          Locate 4,28 : Print "                                        "
  322.          Locate 4,29 : Print "                                        "
  323.          Goto _GO
  324.       End If 
  325.       If PIGS=3 or PIGS=4
  326.          H=Rnd(2)
  327.          If H=1
  328.             Locate 5,28 : Print "You have been shot at. They hit."
  329.             HEALTH=HEALTH-5
  330.          End If 
  331.          If H=2
  332.             Locate 5,28 : Print "You managed to escape down an alley."
  333.             ZZZ=3
  334.          End If 
  335.          Locate 5,29 : Print "Press any key to continue."
  336.          Wait Key 
  337.          Locate 4,28 : Print "                                        "
  338.          Locate 4,29 : Print "                                        "
  339.       End If 
  340.    End If 
  341.    If ZZZ=3 Then Goto _GO
  342.    _BANK:
  343.    Locate 5,23 : Print "F1 - Deposit" : Locate 25,23 : Print "F2 - Withdraw" : Locate 46,23 : Print "F3 Pay Loan"
  344.    Z=0
  345.    Repeat 
  346.       K$=Inkey$
  347.       If Key State(69)=True Then End 
  348.       If Key State(80)=True Then Z=1
  349.       If Key State(81)=True Then Z=2
  350.       If Key State(82)=True Then Z=3
  351.    Until Z>0
  352.    If Z=1 Then Gosub DEPOSIT
  353.    If Z=2 Then Gosub WITHDRAW
  354.    If Z=3 Then Gosub PAYLOAN
  355.    Return 
  356.    DEPOSIT:
  357.    A:
  358.    Locate 5,24 : Print "You have";CASH;" to deposit."
  359.    Locate 5,25 : Print "How much would you like to deposit" : Locate 39,25 : Input D
  360.    If D>CASH Then Goto A
  361.    CASH=CASH-D
  362.    BANK=BANK+D
  363.    Return 
  364.    
  365.    WITHDRAW:
  366.    B:
  367.    Locate 5,24 : Print "You have";BANK;" to withdraw."
  368.    Locate 5,25 : Print "How much would you like to withdraw" : Locate 40,25 : Input W
  369.    If W>BANK Then Goto B
  370.    BANK=BANK-W
  371.    CAH=CASH+W
  372.    Return 
  373.    
  374.    PAYLOAN:
  375.    Locate 5,24 : Print "Your loan oustanding is at";LOAN
  376.    If CASH<LOAN
  377.       Wait 5
  378.       Locate 5,25 : Print "You do not have suffient funds to pay back your loan."
  379.       Locate ,26 : Centre "Press any key to continue"
  380.       Wait 10
  381.       Wait Key 
  382.       Return 
  383.    End If 
  384.    Locate 5,25 : Print "You have now paid off your loan. Press a key to continue."
  385.    CASH=CASH-L
  386.    LOAN=0
  387.    LOAN_PAID=1
  388.    Return 
  389.    
  390.    _GUN_SHOP:
  391.    Locate ,23 : Centre "Welcome to Billy Blowem Away's Gun Shop"
  392.    Locate ,24 : Centre "Choose your weapon"
  393.    Locate 5,25 : Print "F1 - ";GUN$(2);" at";GUN_PRICE(1)
  394.    Locate 5,26 : Print "F2 - ";GUN$(3);" at";GUN_PRICE(2)
  395.    Locate 5,27 : Print "F3 - ";GUN$(4);" at";GUN_PRICE(3)
  396.    Locate 5,28 : Print "F4 - ";GUN$(5);" at";GUN_PRICE(4)
  397.    Z=0
  398.    Repeat 
  399.       K$=Inkey$
  400.       If Key State(80) Then Z=1
  401.       If Key State(81) Then Z=2
  402.       If Key State(82) Then Z=3
  403.       If Key State(83) Then Z=4
  404.    Until Z>0
  405.    If CASH<GUN_PRICE(Z) Then Return 
  406.    If CASH>=GUN_PRICE(Z)
  407.       CASH=CASH-GUN_PRICE(Z)
  408.       G=0
  409.       G=Z+1
  410.    End If 
  411.    Return 
  412.    
  413.    _HOSPITAL:
  414.    Do 
  415.       A=HEALTH/5
  416.       B=100
  417.       Locate ,23 : Centre "Welcome to Dodgy Daves Hospital"
  418.       Locate 5,24 : Print "Each 5 units of health cost $500. You have";A;"/20 units of health."
  419.       Locate 5,25 : Print "F1 - Buy health at $500 per unit."
  420.       Locate 5,26 : Print "F2 - Return back to drug dealing."
  421.       Z=0
  422.       Repeat 
  423.          K$=Inkey$
  424.          If Key State(80)=True Then Z=1
  425.          If Key State(81)=True Then Z=2
  426.       Until Z>0
  427.       If Z=2 Then Return 
  428.       If Z=1 and CASH>=500 and HEALTH<>100
  429.          CASH=CASH-500
  430.          HEALTH=HEALTH+5
  431.       End If 
  432.    Loop 
  433. End Proc
  434. Loop 
  435.