Advertisement
tyler569

Untitled

Jun 23rd, 2012
1,205
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. 'modify BUY to include railroad + utility probs. and .5 if no owners
  3.  
  4. 'modofy spacing to best scheme
  5.  
  6. 'fix all playerstats routine
  7.  
  8. 'currently ERRORing dead players cause infinite loop
  9.  
  10. 'WILL ADD: building at [mid_main]
  11.  
  12.  
  13.   [definitions]
  14.  
  15.   dim chance$(16)
  16.   let chance$(1) = "Advance to GO, collect $200"
  17.   let chance$(2) = "Bank pays you dividend of $50"
  18.   let chance$(3) = "Your building and loan matures, collect $150"
  19.   let chance$(4) = "GET OUT OF JAIL FREE"
  20.   let chance$(5) = "Advance to St. Charles Plc. "
  21.   let chance$(6) = "Go back three spaces"
  22.   let chance$(7) = "Go to jail, do not pass go or collect $200"
  23.   let chance$(8) = "Make general repairs on your propertys.  For each house, pay $25, for each hotel, pay $100"
  24.   let chance$(9) = "Advance to Illinois Ave."
  25.   let chance$(10) = "Advance to the nearest railroad.  If it is owned, pay owner twice the rent they would be otherwise entitled"
  26.   let chance$(11) = "Your have been elected Chairman of the Board.  Pay each player $50"
  27.   let chance$(12) = "Speeding fine, $15"
  28.   let chance$(13) = "Take a ride on the Reading, if you pass go, collect $200"
  29.   let chance$(14) = "Advance to the nearest railroad.  If it is owned, pay owner TWICE the rent they would be otherwise entitled"
  30.   let chance$(15) = "Advance token to nearest Utility. If owned, throw dice and pay owner a total TEN TIMES the amount thrown."
  31.   let chance$(16) = "Take a walk on the Boardwalk – advance token to Boardwalk"
  32.  
  33.   dim chancedo(16,2)
  34.   let chancedo(1,1) = 200 :   let chancedo(1,2) = 1
  35.   let chancedo(2,1) = 50 :    let chancedo(2,2) = 0
  36.   let chancedo(3,1) = 150 :   let chancedo(3,2) = 0
  37.   let chancedo(4,1) = 0 :     let chancedo(4,2) = 0
  38.   let chancedo(5,1) = 0 :     let chancedo(5,2) = 12
  39.   let chancedo(6,1) = 0 :     let chancedo(6,2) = -3
  40.   let chancedo(7,1) = 0 :     let chancedo(7,2) = 31
  41.   let chancedo(8,1) = -1 :    let chancedo(8,2) = 0
  42.   let chancedo(9,1) = 0 :     let chancedo(9,2) = 25
  43.   let chancedo(10,1) = 0 :    let chancedo(10,2) = 0
  44.   let chancedo(11,1) = -200 : let chancedo(11,2) = 0
  45.   let chancedo(13,1) = 0 :    let chancedo(13,2) = 6
  46.   let chancedo(14,1) = 0 :    let chancedo(14,2) = 0
  47.   let chancedo(15,1) = 0 :    let chancedo(15,2) = 0
  48.   let chancedo(16,1) = 0 :    let chancedo(16,2) = 40
  49.  
  50.  
  51.   dim cchest$(16)
  52.   let cchest$(1) = "Advance to Go (Collect $200)"
  53.   let cchest$(2) = "Bank error in your favor – collect $200"
  54.   let cchest$(3) = "Doctor's fees – Pay $50"
  55.   let cchest$(4) = "Get out of jail free – this card may be kept until needed, or sold"
  56.   let cchest$(5) = "Go to jail – go directly to jail – Do not pass Go, do not collect $200"
  57.   let cchest$(6) = "It is your birthday. Collect $10 from each player"
  58.   let cchest$(7) = "Income Tax refund – collect $20"
  59.   let cchest$(8) = "Life Insurance Matures – collect $100"
  60.   let cchest$(9) = "Pay Hospital Fees of $100"
  61.   let cchest$(10) = "Pay School tax of $150"
  62.   let cchest$(11) = "Receive for services $25"
  63.   let cchest$(12) = "You are assessed for street repairs – $40 per house, $115 per hotel"
  64.   let cchest$(13) = "You have won second prize in a beauty contest– collect $10"
  65.   let cchest$(14) = "You inherit $100"
  66.   let cchest$(15) = "From sale of stock you get $50"
  67.   let cchest$(16) = "Holiday Fund matures - collect $100"
  68.  
  69.   dim ccdo(16,2)
  70.   let ccdo(1,1) = 200 :   let ccdo(1,2) = 1
  71.   let ccdo(2,1) = 200 :   let ccdo(2,2) = 0
  72.   let ccdo(3,1) = -50 :   let ccdo(3,2) = 0
  73.   let ccdo(4,1) = 0 :     let ccdo(4,2) = 0
  74.   let ccdo(5,1) = 0 :     let ccdo(5,2) = 31
  75.   let ccdo(6,1) = 40 :    let ccdo(6,2) = 0
  76.   let ccdo(7,1) = 20 :    let ccdo(7,2) = 0
  77.   let ccdo(8,1) = 100 :   let ccdo(8,2) = 0
  78.   let ccdo(9,1) = -100 :  let ccdo(9,2) = 0
  79.   let ccdo(10,1) = -150 : let ccdo(10,2) = 0
  80.   let ccdo(11,1) = 25 :   let ccdo(11,2) = 0
  81.   let ccdo(12,1) = -1 :   let ccdo(12,2) = 0
  82.   let ccdo(13,1) = 10 :   let ccdo(13,2) = 0
  83.   let ccdo(14,1) = 100 :  let ccdo(14,2) = 0
  84.   let ccdo(15,1) = 50 :   let ccdo(15,2) = 0
  85.   let ccdo(16,1) = 100 :  let ccdo(16,2) = 0
  86.  
  87.  
  88.   dim player(4,6)
  89.   '4 players, money, position, jail rolls/status, Get out of jail free, railroads, utilitys
  90.   let player(1,1) = 1500
  91.   let player(1,2) = 1
  92.   let player(2,1) = 1500
  93.   let player(2,2) = 1
  94.   let player(3,1) = 1500
  95.   let player(3,2) = 1
  96.   let player(4,1) = 1500
  97.   let player(4,2) = 1
  98.  
  99.   dim flag(4)
  100.  
  101.   dim property(40,10), property$(40,2)
  102.   for i = 1 to 40
  103.     for text = 1 to 2
  104.       read temp$
  105.       let property$(i, text) = temp$
  106.     next text
  107.     for num = 3 to 12
  108.       read temp
  109.       let property(i, num-2) = temp
  110.     next num
  111.   next i
  112. ' $data       1: "name", 2: "text"
  113. ' #data       1: price (-1 - unbuyable), 2: owned by (-1 - unownable, 0 - unowned), 3: # of houses (-1 - unbulidable, 5 - hotel),
  114. ' #data cont. 4: rent no houses, 5: rent 1 house, 6: rent 2 houses, 7: rent 3 houses, 8: rent 4 houses, 9: rent hotel,
  115. ' #data cont. 10: monopoly number
  116.   data "GO", "start", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
  117.   data "Mediterranean Ave.", "dblue", 60, 0, 0, 2, 10, 30, 90, 160, 250, 1
  118.   data "Community Chest 1", "CC", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
  119.   data "Baltic Ave.", "dblue", 60, 0, 0, 4, 20, 60, 180, 320, 450, 1
  120.   data "Income Tax", "IT", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
  121.   data "Reading RR", "RR", 200, 0, -1, -2, 0, 0, 0, 0, 0, 9
  122.   data "Oriental Ave.", "lblue", 100, 0, 0, 6, 30, 90, 270, 400, 550, 2
  123.   data "Chance 1", "C", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
  124.   data "Vermont Ave.", "lblue", 100, 0, 0, 6, 30, 90, 270, 400, 550, 2
  125.   data "Connecticut Ave.", "lblue", 120, 0, 0, 6, 40, 100, 300, 450, 600, 2
  126.   data "Jail", "jail", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
  127.   data "St. Charles Plc.", "purple", 140, 0, 0, 10, 50, 150, 450, 625, 750, 3
  128.   data "Electric Co.", "U", 150, 0, -1, -2, 0, 0, 0, 0, 0, 10
  129.   data "States Ave.", "purple", 140, 0, 0, 10, 50, 150, 450, 625, 750, 3
  130.   data "Virginia Ave.", "purple", 160, 0, 0, 12, 60, 180, 500, 700, 900, 3
  131.   data "Pennsylvania RR", "RR", 200, 0, -1, -2, 0, 0, 0, 0, 0, 9
  132.   data "St. James Plc.", "orange", 180, 0, 0, 14, 70, 200, 550, 750, 950, 4
  133.   data "Community Chest 2", "CC", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
  134.   data "Tennessee Ave.", "orange", 180, 0, 0, 14, 70, 200, 550, 750, 950, 4
  135.   data "New York Ave.", "orange", 200, 0, 0, 16, 80, 220, 600, 800, 1000, 4
  136.   data "Free Parking", "FP", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
  137.   data "Kentucky Ave.", "red", 220, 0, 0, 18, 90, 250, 700, 875, 1050, 5
  138.   data "Chance 2", "C", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
  139.   data "Indiana Ave.", "red", 220, 0, 0, 18, 90, 250, 700, 875, 1050, 5
  140.   data "Illinois Ave.", "red", 240, 0, 0, 20, 100, 300, 750, 925, 1100, 5
  141.   data "B&O RR", "RR", 200, 0, -1, -2, 0, 0, 0, 0, 0, 9
  142.   data "Atlantic Ave.", "yellow", 260, 0, 0, 22, 110, 330, 800, 975, 1150, 6
  143.   data "Ventnor Ave.", "yellow", 260, 0, 0, 22, 110, 330, 800, 975, 1150, 6
  144.   data "Water Works", "U", 150, 0, -1, -2, 0, 0, 0, 0, 0, 10
  145.   data "Marvin Gardens", "yellow", 280, 0, 0, 24, 120, 360, 850, 1025, 1200, 6
  146.   data "GO TO JAIL", "gotojail", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
  147.   data "Pacific Ave.", "green", 300, 0, 0, 26, 130, 390, 900, 1100, 1275, 7
  148.   data "North Carolina Ave.", "green", 300, 0, 0, 26, 130, 390, 900, 1100, 1275, 7
  149.   data "Community Chest 3", "CC", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
  150.   data "Pennsylvania Ave.", "green", 320, 0, 0, 28, 150, 450, 1000, 1200, 1400, 7
  151.   data "Short Line RR", "RR", 200, 0, -1, -2, 0, 0, 0, 0, 0, 9
  152.   data "Chance 3", "C", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
  153.   data "Park Place", "blue", 350, 0, 0, 35, 175, 500, 1100, 1300, 1500, 8
  154.   data "Luxury Tax", "LT", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
  155.   data "Boardwalk", "blue", 400, 0, 0, 50, 200, 600, 1400, 1700, 2000, 8
  156.  
  157.   dim mono(10,2)
  158.   for i = 1 to 8
  159.       read temp
  160.       let mono(i,1) = temp : let mono(i,2) = 0
  161.       data 2, 3, 3, 3, 3, 3, 3, 2, 4, 2
  162.       'dblue,lblue,purple,orange,red,yellow,green,blue,RR,U
  163.   next i
  164.  
  165.  
  166.   let buy250 = .95
  167.   let buy0 = .2
  168.   let activeplayers = 4
  169.   let tries = 3  'for build
  170.   let trade = .2 'for trade
  171.  
  172.   print "This is a FULL version of the popular real estate tradeing game, Monopoly(c)"
  173.   print "This version pits the computer against itself, later versions may include human input"
  174.   print "All gameplay is based on the rules form Monopoly(c), no shortcuts"
  175.   print
  176.   print "press enter to roll once,"
  177.   print "input o to advance one full turn"
  178.   print "input l to advance 25 full turns"
  179.   print "input p to see where each player's info"
  180.   input "press enter to start";nulvar$
  181.  
  182. [MAIN]
  183. print
  184. print "Input d to see the definitions again"
  185. input "Input o, l, p, or just push enter  ";bwrl$
  186. if bwrl$ = "d" then
  187.    print "press enter to roll once,"
  188.    print "input o to advance one full turn"
  189.    print "input l to advance 50 full turns"
  190.    print "input p to see where each player's info"
  191.    goto [MAIN]
  192. end if
  193. if bwrl$ = "p" then goto [playerstats]
  194. if bwrl$ = "l" then let counter = 25
  195. if bwrl$ = "o" then let counter = 1
  196. if bwrl$ = "" then let counter = 1
  197. for l = 1 to counter
  198.   let roundcount = roundcount + 1
  199.   for p = 1 to 4
  200.     [doubles]
  201.   if player(p,3) = -1 then let player(p,3) = 0 'reset flag that tells us they were in jail last turn
  202.     if player(p,1) > 0 then
  203.       if bwrl$ = "" and p > 1 then input "Press enter to roll again";nulvar
  204.       if double <> 0 then print "---" : print "Player has ";double;" doubles in a row" else print : print "PLAYER ";p;":"
  205.       print "Starts at: ";property$(player(p,2),1);" [#";player(p,2);"]";" and has $";player(p,1)
  206.       if player(p,3) = 0 then gosub [movement] else gosub [rolloutofjail]
  207.       print "Player has rolled ";d1;" and ";d2;" making ";dice;" and gone to ";property$(player(p,2),1);" [#";player(p,2);"]"
  208.       if go = 1 then let player(p,1) = player(p,1) + 200 : let go = 0
  209.       [caseplace]
  210.       select case player(p,2)
  211.         case 8, 23, 37
  212.           goto [chance]
  213.         case 3, 18, 34
  214.           goto [community_chest]
  215.         case 5
  216.           goto [pay_income_tax]
  217.         case 39
  218.           goto [pay_luxury_tax]
  219.         case 1
  220.           print "Collected $200"
  221.         case 11, 21
  222.           print "No action"
  223.         case 31
  224.           goto [jail]
  225.         case else
  226.           if property(player(p,2),2) = p then print "player owns it, no action"
  227.           if property(player(p,2),2) > 0 and property(player(p,2),2) <> p then goto [rent]
  228.           if property(player(p,2),2) = 0 then goto [property_buy]
  229.           [return_buy]
  230.           if property(player(p,2),2) < 0 then print "should never occur, INTERNAL ERROR" : end
  231.       end select
  232.     end if      'player loss causes loop here, no else condition to end turn
  233.     [mid_main]
  234.     gosub [building]
  235.     print "At end of turn, player is at ";property$(player(p,2),1);" [#";player(p,2);"]";" and has $";player(p,1)
  236.     if player(p,1) <= 0 then
  237.       if flag(p) = 0 then
  238.         let player(p,1) = 0
  239.         let player(p,2) = 0
  240.         let activeplayers = activeplayers - 1
  241.         let flag(p) = 1
  242.         print
  243.         print "Player ";p;" has lost"
  244.       end if
  245.       if flag(p) = 1 then
  246.         print
  247.         print "Player ";p;" has lost already"
  248.       end if
  249.       if activeplayers = 1 then
  250.          for loopwin = 1 to 4
  251.             if player(loopwin,1) > 0 then let playerwin = loopwin
  252.          next loopwin
  253.          print "The Game has been won by Player ";playerwin
  254.          gosub [playerstats]
  255.          end
  256.       end if
  257.     end if
  258.     if d1 = d2 and player(p,3) = 0 then let double = double + 1 : goto [doubles] else let double = 0
  259.   next p
  260. next l
  261. goto [MAIN]
  262.  
  263. [playerstats]
  264. print
  265. print "After ";roundcount;" rounds:"
  266. print
  267. for q = 1 to 4
  268.    if player(q,1) <= 0 then
  269.       print "Player ";q;" has lost" : print
  270.     else
  271.       if player(q,4) > 1 then let inat$ = "in" else let inat$ = "at"
  272.        print "Player ";q;" has $";player(q,1);" and is ";inat$;" ";property$(player(q,2),1)
  273.         let assets = 0
  274.         let propvalue = 0
  275.         for i = 1 to 40
  276.          if property(i,2) = q then
  277.           let propvalue = propvalue + property(i,1)
  278.          end if
  279.         next i
  280.         let assets = player(q,1) + propvalue
  281.       let rent = 0
  282.       print "Player ";q;" has total assets of $";assets
  283.       print "Player ";q;" has ";player(q,4);" 'Get Out of Jail Free' cards"
  284.       print "Player owns:"
  285.       for prop = 1 to 40
  286.          if property(prop,2) = q then
  287.             gosub [housetype]
  288.             print " ";property$(prop,1);
  289.             let lots = property(prop,3)+4
  290.             if prop <> 6 and prop <> 13 and prop <> 16 and prop <> 26 and prop <> 29 and prop <> 36 then
  291.               for monfin = -4 to 4
  292.                 let propnum = prop + monfin
  293.                 if propnum > 40 then let propnum = propnum - 40
  294.                 if propnum < 0 then let propnum = propnum + 40
  295.                 if property$(propnum,2)=property$(prop,2) then
  296.                   if property(prop,2) = q then let monp = monp + 1
  297.                   if property(prop,2) <> q then let monp = 0 : goto [statsout]
  298.                 end if
  299.               next monfin
  300.               [statsout]
  301.               if monp = mono(property(prop,10),2) then
  302.                if xrent = 1 then let rent = rent * 2
  303.                print " (MONOPOLY ";property$(prop,2);"; ";hohtel$;"; rent: $";rent;")"
  304.                let xrent = 0
  305.              end if
  306.            end if
  307.            select case property$(prop,2)
  308.              case "RR"
  309.                for rrstats = 1 to 4
  310.                  if property(1,2) = q then let rrcount = rrcount + 1
  311.                  if property(16,2) = q then let rrcount = rrcount + 1
  312.                  if property(26,2) = q then let rrcount = rrcount + 1
  313.                  if property(36,2) = q then let rrcount = rrcount + 1
  314.                next rrstats
  315.                if rrcount = 1 then let rent = 25
  316.                if rrcount = 2 then let rent = 50
  317.                if rrcount = 3 then let rent = 100
  318.                if rrcount = 4 then let rent = 200
  319.                print " (";property$(prop,2);"; rent: $";rent;")"
  320.                let rrcount = 0
  321.              case "U"
  322.                if property(13,2) = property(39,2) then
  323.                  print " (";property$(prop,2);"; rent: 10X the amount on the dice)"
  324.                 else
  325.                  print " (";property$(prop,2);"; rent: 4X the amount on the dice)"
  326.                end if
  327.              case else
  328.                print " (";property$(prop,2);"; rent: $";property(prop,lots);")"
  329.            end select
  330.            let monp = 0
  331.          end if
  332.       next prop
  333.       print
  334.    end if
  335. next q
  336. print
  337. if activeplayers = 1 then return
  338. goto [MAIN]
  339.  
  340.  
  341.   [movement]
  342.   gosub [dice]
  343.   let player(p,2) = player(p,2) + dice
  344.   if player(p,2) > 40 then let player(p,2) = player(p,2) - 40 : let go = go + 1
  345.   let place$ = property$(player(p,2),1)
  346.   return
  347.  
  348.   [dice]
  349.   let d1 = int(rnd(1)*6)+1
  350.   let d2 = int(rnd(1)*6)+1
  351.   let dice = d1+d2
  352.   return
  353.  
  354.  
  355.  
  356.   [count_properties]
  357.   let proptotal = 0
  358.   let propvalue = 0
  359.   let colortotal = 0
  360.   let color$ = property$(player(p,2),2)
  361.   for i = 1 to 40
  362.      if property(i,2) = p then
  363.         let proptotal = proptotal + 1
  364.         let propvalue = propvalue + property(i,1)
  365.         if color$ = property$(i,2) then colortotal = colortotal + 1
  366.      end if
  367.   next i
  368.   if colortotal = mono(property(player(p,2),10),1) then mono(property(player(p,2),10),2) = p
  369.   return
  370.  
  371.  
  372.  
  373.   [pay_income_tax]
  374.   gosub [count_properties]
  375.   let assets = player(p,1) + propvalue
  376.   taxes = int(.1 * assets)
  377.   if taxes > 200 then let taxes = 200
  378.   print "Total assets are $";assets;" and taxes paid is $";taxes
  379.   let player(p,1) = player(p,1) - taxes
  380.   goto [mid_main]
  381.  
  382.   [pay_luxury_tax]
  383.   print "Luxury Tax of $75 paid"
  384.   let player(p,1) = player(p,1) - 75
  385.   goto [mid_main]
  386.  
  387.  
  388.  
  389.  
  390.   [community_chest]
  391.   let ccard = int(rnd(1)*16)+1
  392.   print "Player ";p;" drew: ";cchest$(ccard);" [#";ccard;"]"
  393.   if ccard = 4 then let player(p,4) = player(p,4) + 1
  394.   if ccdo(ccard,1) = -1 then let type$ = "cc" : gosub [pay_property_tax] else player(p,1) = player(p,1) + ccdo(ccard,1)
  395.   if ccard = 6 then
  396.      let player(1,1) = player(1,1) - 10
  397.      let player(2,1) = player(2,1) - 10
  398.      let player(3,1) = player(3,1) - 10
  399.      let player(4,1) = player(4,1) - 10
  400.      print "$50 payed to each player"
  401.   end if
  402.   'location impact
  403.   'note the "go to Go' card shold reflect +$200 or this needs to trigger getting the $200 at go
  404.   if ccdo(ccard,2) <= 0 then let player(p,2) = player(p,2) + ccdo(ccard,2) else player(p,2) = ccdo(ccard,2)
  405.   if ccdo(ccard,2) > 1 or ccdo(ccard,2) < 0 then goto [caseplace] else goto [mid_main]
  406.  
  407.  
  408.   [chance]
  409.   let ccard = int(rnd(1)*16)+1
  410.   print "Player ";p;" drew: ";chance$(ccard);" [#";ccard;"]"
  411.   if ccard = 4 then let player(p,4) = player(p,4) + 1
  412.   if ccard = 10 or ccard = 14 or ccard = 15 then
  413.      if ccard = 10 or ccard = 14 then
  414.         if player(p,2) = 8 then
  415.            let player(p,2) = 16
  416.            if property(player(p,2),2) <> p then
  417.               gosub [dice]
  418.               print "Player has advanced to ";property$(player(p,2),1)
  419.               gosub [RRchance2xrent]
  420.            end if
  421.         end if
  422.         if player(p,2) = 23 then
  423.            let player(p,2) = 26
  424.            if property(player(p,2),2) <> p then
  425.               gosub [dice]
  426.               print "Player has advanced to ";property$(player(p,2),1)
  427.               gosub [RRchance2xrent]
  428.            end if
  429.         end if
  430.         if player(p,2) = 37 then
  431.            let player(p,2) = 6
  432.            let player(p,1) = player(p,1) + 200
  433.            print "Player has advanced to ";property$(player(p,2),1)
  434.            print "Player has crossed go and collected $200"
  435.            if property(player(p,2),2) <> p then
  436.               gosub [dice]
  437.               gosub [RRchance2xrent]
  438.            end if
  439.         end if
  440.      end if
  441.      if ccard = 15 then
  442.        if player(p,2) = 8 then
  443.          let player(p,2) = 13
  444.          if property(player(p,2),2) <> p then gosub [chanceutilrent]
  445.        end if
  446.        if player(p,2) = 23 then
  447.          let player(p,2) = 29
  448.          if property(player(p,2),2) <> p then gosub [chanceutilrent]
  449.        end if
  450.        if player(p,2) = 37 then
  451.          let player(p,2) = 13
  452.          print "Player has crossed go and collected $200"
  453.          let player(p,1) = player(p,1) + 200
  454.          if property(player(p,2),2) <> p then gosub [chanceutilrent]
  455.        end if
  456.      end if
  457.   end if
  458.  
  459.   if chancedo(ccard,1) = -1 then let type$ = "c" : gosub [pay_property_tax] else player(p,1) = player(p,1) + chancedo(ccard,1)
  460.   if ccard = 11 then
  461.      let player(1,1) = player(1,1) + 50
  462.      let player(2,1) = player(2,1) + 50
  463.      let player(3,1) = player(3,1) + 50
  464.      let player(4,1) = player(4,1) + 50
  465.      print "$50 payed to each player"
  466.   end if
  467.   'location impact
  468.   'note the "go to Go' card shold reflect +$200 or this needs to trigger getting the $200 at go
  469.   if chancedo(ccard,2) <= 0 then let player(p,2) = player(p,2) + chancedo(ccard,2) else player(p,2) = chancedo(ccard,2)
  470.   if chancedo(ccard,2) > 1 or chancedo(ccard,2) < 0 then goto [caseplace] else goto [mid_main]
  471.  
  472.  
  473.   [RRchance2xrent]
  474.   if player(property(player(p,2),2),5) = 1 then let rent = 50
  475.   if player(property(player(p,2),2),5) = 2 then let rent = 100
  476.   if player(property(player(p,2),2),5) = 3 then let rent = 200
  477.   if player(property(player(p,2),2),5) = 4 then let rent = 400
  478.  
  479.   let player(p,1) = player(p,1) - rent
  480.   let player(property(player(p,2),2),1) = player(property(player(p,2),2),1) + rent
  481.   print "Rent paid to player ";property(player(p,2),2);" in the amount of $";rent
  482.   return
  483.  
  484.   [chanceutilrent]
  485.   gosub [dice]
  486.   let rent = dice * 10
  487.   print "Rent paid to player ";property(player(p,2),2);" in the amount of ";rent
  488.   let player(p,1) = player(p,1) - rent
  489.   let player(property(player(p,2),2),1) = player(property(player(p,2),2),1) + rent
  490.   return
  491.  
  492.  
  493.   [pay_property_tax]
  494.   if type$ = "c" then let house = 25 : let hotel = 100
  495.   if type$ = "cc" then let house = 40 : let hotel = 115
  496.   for tax = 1 to 40
  497.     if property(tax,2) = p then
  498.        if property(tax,3) = -1 then let taxpay = taxpay
  499.        if property(tax,3) = 5 then let taxpay = taxpay + hotel
  500.        if property(tax,3) >= 1 and property(tax,3) <= 4 then let taxpay = taxpay + property(tax,3) * house
  501.     end if
  502.   next tax
  503.   let player(p,1) = player(p,1) - taxpay
  504.   print "Property tax paid in the amount of $";taxpay
  505.   let taxpay = 0
  506.   let house = 0
  507.   let hotel = 0
  508.   return
  509.  
  510.  
  511.  
  512.  
  513.   [property_buy]
  514.   let buy = rnd(1)
  515.   if player(p,1) > property(player(p,2),1) + 500 then
  516.     for monfin = -4 to 4
  517.       let propnum = player(p,2) + monfin
  518.       if propnum > 40 then let propnum = propnum - 40
  519.       if propnum < 0 then let propnum = propnum + 40
  520.       if property$(propnum,2)=property$(player(p,2),2) then
  521.         if property(player(p,2),2) = p then let monp = monp + 1
  522.         if property(player(p,2),2) <> 0 then goto [monout]
  523.       end if
  524.     next monfin
  525.     if roundcount > 5 then
  526.       if monp = 0 then
  527.         if buy < 0.5 then let bought = 1
  528.       end if
  529.       if monp = 1 then
  530.         if buy < 0.85 then let bought = 1
  531.       end if
  532.       if monp = 2 then
  533.         let bought = 1
  534.       end if
  535.      else
  536.       if buy < 0.9 then
  537.         let bought = 1
  538.       end if
  539.     end if
  540.     [monout]
  541.     let monp = 0
  542.     if bought = 1 then
  543.       print "Player elected to purchase property for $";property(player(p,2),1)
  544.       let property(player(p,2),2) = p
  545.       let player(p,1) = player(p,1) - property(player(p,2),1)
  546.      else
  547.       print "Player elected not to purchase property"
  548.     end if
  549.     let bought = 0
  550.     goto [return_buy]
  551.   end if
  552.   if player(p,1) > property(player(p,2),1) then
  553.     if buy < 0.25 then
  554.       let property(player(p,2),2) = p
  555.       let player(p,1) = player(p,1) - property(player(p,2),1)
  556.       print "Property purchased for $";property(player(p,2),1)
  557.       gosub [count_properties]
  558.      else
  559.       print "Player elected not to purchase property"
  560.     end if
  561.    else
  562.     Print "Insufficent funds for purchase"
  563.   end if
  564.   goto [mid_main]
  565.  
  566.  
  567.  
  568.   [building]
  569.   print "  This is the building routine:"
  570.   print "  it is not finished yet"
  571.   goto [skip]
  572. '  for try = 1 to tries '3 by default
  573. '    let build = int(rnd(1)*40)+1
  574. '    if property(build,2) = p then
  575. '      if it is a monopoly then
  576. '        if (propertys in monopoly)'s houses > 4 then
  577. '          if build <= 11 and build > 0 then let buildper = $50
  578. '          if build <= 21 and build > 11 then let buildper = $100
  579. '          if build <= 31 and build > 21 then let buildper = $150
  580. '          if build <= 41 and build > 31 then let buildper = $200
  581. '          let housesnum = int(rnd(1)*3)+1
  582. '          let (propertys in monopoly remember to use property(p,10)!)'s houses = housebefore
  583. '          let (propertys in monopoly remember to use property(p,10)!)'s houses = houses + housenum
  584. '          if (propertys in monopoly remember to use property(p,10)!)'s houses > 5 then let (propertys in monopoly)'s houses = 5
  585. '          print "Player p build ";(housenum - housebefore);" houses on the ";property$(build,2);" monopoly"
  586. '          print "in the amount of ";housenum*buildper;" to make ";((housenum) houses or a hotel)
  587. '          print "property "
  588. '          let player(p,1)
  589. '        end if
  590. '      end if
  591. '    end if
  592. '  next tries
  593.   [skip]
  594.   return
  595.  
  596.  
  597.  
  598.   [rent]
  599.   if property$(player(p,2),2) = "RR" then goto [railroad_rent]
  600.   if property$(player(p,2),2) = "U" then goto [utility_rent]
  601.   'else, propety rent
  602.   if property(player(p,2),3) = 0 then
  603.      if mono(property(player(p,2),10),2) <> 0 then let rent = 2 * property(player(p,2),4) else rent = property(player(p,2),4)
  604.   end if
  605.   if property(player(p,2),3) = 1 then
  606.      if property(p1,2) = q then
  607.         let rent = property(player(p,2),4) * 2
  608.      end if
  609.   end if
  610.   if property(player(p,2),3) = 2 then let rent = property(player(p,2),6)
  611.   if property(player(p,2),3) = 3 then let rent = property(player(p,2),7)
  612.   if property(player(p,2),3) = 4 then let rent = property(player(p,2),8)
  613.   if property(player(p,2),3) = 5 then let rent = property(player(p,2),9)
  614.   goto [collect]
  615.  
  616.   [railroad_rent]
  617.   if player(property(player(p,2),2),5) = 1 then let rent = 25
  618.   if player(property(player(p,2),2),5) = 2 then let rent = 50
  619.   if player(property(player(p,2),2),5) = 3 then let rent = 100
  620.   if player(property(player(p,2),2),5) = 4 then let rent = 200
  621.   if FLAG$ = "1" then return
  622.   goto [collect]
  623.  
  624.   [utility_rent]
  625.   if property(13,2) = property(29,2) then let rent  = 10 * dice else let rent = 4 * dice
  626.   goto [collect]
  627.  
  628.   [collect]
  629.   if rent <= player(p,1) then
  630.      let player(p,1) = player(p,1) - rent
  631.      let player(property(player(p,2),2),1) = player(property(player(p,2),2),1) + rent
  632.      print "Rent paid to player ";property(player(p,2),2);" in the amount of $";rent
  633.   end if
  634.   if rent > player(p,1) then
  635.      print "The rent ($";rent;") is too much, player ";p;" has lost"
  636.      print "All properties are being transfered to the debter"
  637.      for q = 1 to 40
  638.         if property(q,2) = p then let property(q,2) = property(player(p,2),2)
  639.      next q
  640.   end if
  641.   goto [mid_main]
  642.  
  643.   [jail]
  644.   print "Player ";p;" has been sent to jail"
  645.   let jail = rnd(1)
  646.   let player(p,2) = 11
  647.   if player(p,4) >= 1 then
  648.      let player(p,3) = -1
  649.      let player(p,4) = player(p,4) - 1
  650.      print "Player has used a Get Out of Jail Free card"
  651.      goto [mid_main]
  652.   end if
  653.   if jail > .2 and player(p,1) > 75 then
  654.      print "Player has elected to pay out of jail ($50)"
  655.      [rolls_failed]
  656.      let player(p,1) = player(p,1) - 50
  657.      let player(p,3) = -1
  658.     else
  659.      print "Player has elected to roll out of jail"
  660.      let player(p,3) = 1
  661.   end if
  662.   goto [mid_main]
  663.  
  664.   [rolloutofjail]
  665.   gosub [dice]
  666.   if d1 = d2 then
  667.      print "Player rolled doubles with a ";d1;" and ";d2
  668.      let player(p,3) = -1
  669.      let player(p,2) = player(p,2) + dice
  670.      goto [caseplace]
  671.     else
  672.      print "Player failed to roll doubles with a ";d1;" and ";d2
  673.      player(p,3) = player(p,3) + 1
  674.      if player(p,3) = 3 then print "Player waited 3 rolls; must pay out of Jail ($50)": goto [rolls_failed]
  675.      goto [mid_main]
  676.   end if
  677.  
  678.   [housetype]
  679.   select case property(prop,3)
  680.     case -1
  681.       let hohtel$ = "unbuildable"
  682.     case 0
  683.       let hohtel$ = "no houses"
  684.       let xrent = 1
  685.     case 1
  686.       let hohtel$ = "one house"
  687.     case 2
  688.       let hohtel$ = "two houses"
  689.     case 3
  690.       let hohtel$ = "two houses"
  691.     case 4
  692.       let hohtel$ = "two houses"
  693.     case 5
  694.       let hohtel$ = "one hotel"
  695.     case else
  696.       let hohtel$ = "CHECK FOR ERROR"
  697.   end select
  698.   return
Advertisement
RAW Paste Data Copied
Advertisement