Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'modify BUY to include railroad + utility probs. and .5 if no owners
- 'modofy spacing to best scheme
- 'fix all playerstats routine
- 'currently ERRORing dead players cause infinite loop
- 'WILL ADD: building at [mid_main]
- [definitions]
- dim chance$(16)
- let chance$(1) = "Advance to GO, collect $200"
- let chance$(2) = "Bank pays you dividend of $50"
- let chance$(3) = "Your building and loan matures, collect $150"
- let chance$(4) = "GET OUT OF JAIL FREE"
- let chance$(5) = "Advance to St. Charles Plc. "
- let chance$(6) = "Go back three spaces"
- let chance$(7) = "Go to jail, do not pass go or collect $200"
- let chance$(8) = "Make general repairs on your propertys. For each house, pay $25, for each hotel, pay $100"
- let chance$(9) = "Advance to Illinois Ave."
- let chance$(10) = "Advance to the nearest railroad. If it is owned, pay owner twice the rent they would be otherwise entitled"
- let chance$(11) = "Your have been elected Chairman of the Board. Pay each player $50"
- let chance$(12) = "Speeding fine, $15"
- let chance$(13) = "Take a ride on the Reading, if you pass go, collect $200"
- let chance$(14) = "Advance to the nearest railroad. If it is owned, pay owner TWICE the rent they would be otherwise entitled"
- let chance$(15) = "Advance token to nearest Utility. If owned, throw dice and pay owner a total TEN TIMES the amount thrown."
- let chance$(16) = "Take a walk on the Boardwalk – advance token to Boardwalk"
- dim chancedo(16,2)
- let chancedo(1,1) = 200 : let chancedo(1,2) = 1
- let chancedo(2,1) = 50 : let chancedo(2,2) = 0
- let chancedo(3,1) = 150 : let chancedo(3,2) = 0
- let chancedo(4,1) = 0 : let chancedo(4,2) = 0
- let chancedo(5,1) = 0 : let chancedo(5,2) = 12
- let chancedo(6,1) = 0 : let chancedo(6,2) = -3
- let chancedo(7,1) = 0 : let chancedo(7,2) = 31
- let chancedo(8,1) = -1 : let chancedo(8,2) = 0
- let chancedo(9,1) = 0 : let chancedo(9,2) = 25
- let chancedo(10,1) = 0 : let chancedo(10,2) = 0
- let chancedo(11,1) = -200 : let chancedo(11,2) = 0
- let chancedo(13,1) = 0 : let chancedo(13,2) = 6
- let chancedo(14,1) = 0 : let chancedo(14,2) = 0
- let chancedo(15,1) = 0 : let chancedo(15,2) = 0
- let chancedo(16,1) = 0 : let chancedo(16,2) = 40
- dim cchest$(16)
- let cchest$(1) = "Advance to Go (Collect $200)"
- let cchest$(2) = "Bank error in your favor – collect $200"
- let cchest$(3) = "Doctor's fees – Pay $50"
- let cchest$(4) = "Get out of jail free – this card may be kept until needed, or sold"
- let cchest$(5) = "Go to jail – go directly to jail – Do not pass Go, do not collect $200"
- let cchest$(6) = "It is your birthday. Collect $10 from each player"
- let cchest$(7) = "Income Tax refund – collect $20"
- let cchest$(8) = "Life Insurance Matures – collect $100"
- let cchest$(9) = "Pay Hospital Fees of $100"
- let cchest$(10) = "Pay School tax of $150"
- let cchest$(11) = "Receive for services $25"
- let cchest$(12) = "You are assessed for street repairs – $40 per house, $115 per hotel"
- let cchest$(13) = "You have won second prize in a beauty contest– collect $10"
- let cchest$(14) = "You inherit $100"
- let cchest$(15) = "From sale of stock you get $50"
- let cchest$(16) = "Holiday Fund matures - collect $100"
- dim ccdo(16,2)
- let ccdo(1,1) = 200 : let ccdo(1,2) = 1
- let ccdo(2,1) = 200 : let ccdo(2,2) = 0
- let ccdo(3,1) = -50 : let ccdo(3,2) = 0
- let ccdo(4,1) = 0 : let ccdo(4,2) = 0
- let ccdo(5,1) = 0 : let ccdo(5,2) = 31
- let ccdo(6,1) = 40 : let ccdo(6,2) = 0
- let ccdo(7,1) = 20 : let ccdo(7,2) = 0
- let ccdo(8,1) = 100 : let ccdo(8,2) = 0
- let ccdo(9,1) = -100 : let ccdo(9,2) = 0
- let ccdo(10,1) = -150 : let ccdo(10,2) = 0
- let ccdo(11,1) = 25 : let ccdo(11,2) = 0
- let ccdo(12,1) = -1 : let ccdo(12,2) = 0
- let ccdo(13,1) = 10 : let ccdo(13,2) = 0
- let ccdo(14,1) = 100 : let ccdo(14,2) = 0
- let ccdo(15,1) = 50 : let ccdo(15,2) = 0
- let ccdo(16,1) = 100 : let ccdo(16,2) = 0
- dim player(4,6)
- '4 players, money, position, jail rolls/status, Get out of jail free, railroads, utilitys
- let player(1,1) = 1500
- let player(1,2) = 1
- let player(2,1) = 1500
- let player(2,2) = 1
- let player(3,1) = 1500
- let player(3,2) = 1
- let player(4,1) = 1500
- let player(4,2) = 1
- dim flag(4)
- dim property(40,10), property$(40,2)
- for i = 1 to 40
- for text = 1 to 2
- read temp$
- let property$(i, text) = temp$
- next text
- for num = 3 to 12
- read temp
- let property(i, num-2) = temp
- next num
- next i
- ' $data 1: "name", 2: "text"
- ' #data 1: price (-1 - unbuyable), 2: owned by (-1 - unownable, 0 - unowned), 3: # of houses (-1 - unbulidable, 5 - hotel),
- ' #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,
- ' #data cont. 10: monopoly number
- data "GO", "start", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
- data "Mediterranean Ave.", "dblue", 60, 0, 0, 2, 10, 30, 90, 160, 250, 1
- data "Community Chest 1", "CC", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
- data "Baltic Ave.", "dblue", 60, 0, 0, 4, 20, 60, 180, 320, 450, 1
- data "Income Tax", "IT", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
- data "Reading RR", "RR", 200, 0, -1, -2, 0, 0, 0, 0, 0, 9
- data "Oriental Ave.", "lblue", 100, 0, 0, 6, 30, 90, 270, 400, 550, 2
- data "Chance 1", "C", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
- data "Vermont Ave.", "lblue", 100, 0, 0, 6, 30, 90, 270, 400, 550, 2
- data "Connecticut Ave.", "lblue", 120, 0, 0, 6, 40, 100, 300, 450, 600, 2
- data "Jail", "jail", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
- data "St. Charles Plc.", "purple", 140, 0, 0, 10, 50, 150, 450, 625, 750, 3
- data "Electric Co.", "U", 150, 0, -1, -2, 0, 0, 0, 0, 0, 10
- data "States Ave.", "purple", 140, 0, 0, 10, 50, 150, 450, 625, 750, 3
- data "Virginia Ave.", "purple", 160, 0, 0, 12, 60, 180, 500, 700, 900, 3
- data "Pennsylvania RR", "RR", 200, 0, -1, -2, 0, 0, 0, 0, 0, 9
- data "St. James Plc.", "orange", 180, 0, 0, 14, 70, 200, 550, 750, 950, 4
- data "Community Chest 2", "CC", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
- data "Tennessee Ave.", "orange", 180, 0, 0, 14, 70, 200, 550, 750, 950, 4
- data "New York Ave.", "orange", 200, 0, 0, 16, 80, 220, 600, 800, 1000, 4
- data "Free Parking", "FP", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
- data "Kentucky Ave.", "red", 220, 0, 0, 18, 90, 250, 700, 875, 1050, 5
- data "Chance 2", "C", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
- data "Indiana Ave.", "red", 220, 0, 0, 18, 90, 250, 700, 875, 1050, 5
- data "Illinois Ave.", "red", 240, 0, 0, 20, 100, 300, 750, 925, 1100, 5
- data "B&O RR", "RR", 200, 0, -1, -2, 0, 0, 0, 0, 0, 9
- data "Atlantic Ave.", "yellow", 260, 0, 0, 22, 110, 330, 800, 975, 1150, 6
- data "Ventnor Ave.", "yellow", 260, 0, 0, 22, 110, 330, 800, 975, 1150, 6
- data "Water Works", "U", 150, 0, -1, -2, 0, 0, 0, 0, 0, 10
- data "Marvin Gardens", "yellow", 280, 0, 0, 24, 120, 360, 850, 1025, 1200, 6
- data "GO TO JAIL", "gotojail", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
- data "Pacific Ave.", "green", 300, 0, 0, 26, 130, 390, 900, 1100, 1275, 7
- data "North Carolina Ave.", "green", 300, 0, 0, 26, 130, 390, 900, 1100, 1275, 7
- data "Community Chest 3", "CC", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
- data "Pennsylvania Ave.", "green", 320, 0, 0, 28, 150, 450, 1000, 1200, 1400, 7
- data "Short Line RR", "RR", 200, 0, -1, -2, 0, 0, 0, 0, 0, 9
- data "Chance 3", "C", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
- data "Park Place", "blue", 350, 0, 0, 35, 175, 500, 1100, 1300, 1500, 8
- data "Luxury Tax", "LT", -1, -1, -1, 0, 0, 0, 0, 0, 0, 0
- data "Boardwalk", "blue", 400, 0, 0, 50, 200, 600, 1400, 1700, 2000, 8
- dim mono(10,2)
- for i = 1 to 8
- read temp
- let mono(i,1) = temp : let mono(i,2) = 0
- data 2, 3, 3, 3, 3, 3, 3, 2, 4, 2
- 'dblue,lblue,purple,orange,red,yellow,green,blue,RR,U
- next i
- let buy250 = .95
- let buy0 = .2
- let activeplayers = 4
- let tries = 3 'for build
- let trade = .2 'for trade
- print "This is a FULL version of the popular real estate tradeing game, Monopoly(c)"
- print "This version pits the computer against itself, later versions may include human input"
- print "All gameplay is based on the rules form Monopoly(c), no shortcuts"
- print
- print "press enter to roll once,"
- print "input o to advance one full turn"
- print "input l to advance 25 full turns"
- print "input p to see where each player's info"
- input "press enter to start";nulvar$
- [MAIN]
- print
- print "Input d to see the definitions again"
- input "Input o, l, p, or just push enter ";bwrl$
- if bwrl$ = "d" then
- print "press enter to roll once,"
- print "input o to advance one full turn"
- print "input l to advance 50 full turns"
- print "input p to see where each player's info"
- goto [MAIN]
- end if
- if bwrl$ = "p" then goto [playerstats]
- if bwrl$ = "l" then let counter = 25
- if bwrl$ = "o" then let counter = 1
- if bwrl$ = "" then let counter = 1
- for l = 1 to counter
- let roundcount = roundcount + 1
- for p = 1 to 4
- [doubles]
- if player(p,3) = -1 then let player(p,3) = 0 'reset flag that tells us they were in jail last turn
- if player(p,1) > 0 then
- if bwrl$ = "" and p > 1 then input "Press enter to roll again";nulvar
- if double <> 0 then print "---" : print "Player has ";double;" doubles in a row" else print : print "PLAYER ";p;":"
- print "Starts at: ";property$(player(p,2),1);" [#";player(p,2);"]";" and has $";player(p,1)
- if player(p,3) = 0 then gosub [movement] else gosub [rolloutofjail]
- print "Player has rolled ";d1;" and ";d2;" making ";dice;" and gone to ";property$(player(p,2),1);" [#";player(p,2);"]"
- if go = 1 then let player(p,1) = player(p,1) + 200 : let go = 0
- [caseplace]
- select case player(p,2)
- case 8, 23, 37
- goto [chance]
- case 3, 18, 34
- goto [community_chest]
- case 5
- goto [pay_income_tax]
- case 39
- goto [pay_luxury_tax]
- case 1
- print "Collected $200"
- case 11, 21
- print "No action"
- case 31
- goto [jail]
- case else
- if property(player(p,2),2) = p then print "player owns it, no action"
- if property(player(p,2),2) > 0 and property(player(p,2),2) <> p then goto [rent]
- if property(player(p,2),2) = 0 then goto [property_buy]
- [return_buy]
- if property(player(p,2),2) < 0 then print "should never occur, INTERNAL ERROR" : end
- end select
- end if 'player loss causes loop here, no else condition to end turn
- [mid_main]
- gosub [building]
- print "At end of turn, player is at ";property$(player(p,2),1);" [#";player(p,2);"]";" and has $";player(p,1)
- if player(p,1) <= 0 then
- if flag(p) = 0 then
- let player(p,1) = 0
- let player(p,2) = 0
- let activeplayers = activeplayers - 1
- let flag(p) = 1
- print
- print "Player ";p;" has lost"
- end if
- if flag(p) = 1 then
- print
- print "Player ";p;" has lost already"
- end if
- if activeplayers = 1 then
- for loopwin = 1 to 4
- if player(loopwin,1) > 0 then let playerwin = loopwin
- next loopwin
- print "The Game has been won by Player ";playerwin
- gosub [playerstats]
- end
- end if
- end if
- if d1 = d2 and player(p,3) = 0 then let double = double + 1 : goto [doubles] else let double = 0
- next p
- next l
- goto [MAIN]
- [playerstats]
- print
- print "After ";roundcount;" rounds:"
- print
- for q = 1 to 4
- if player(q,1) <= 0 then
- print "Player ";q;" has lost" : print
- else
- if player(q,4) > 1 then let inat$ = "in" else let inat$ = "at"
- print "Player ";q;" has $";player(q,1);" and is ";inat$;" ";property$(player(q,2),1)
- let assets = 0
- let propvalue = 0
- for i = 1 to 40
- if property(i,2) = q then
- let propvalue = propvalue + property(i,1)
- end if
- next i
- let assets = player(q,1) + propvalue
- let rent = 0
- print "Player ";q;" has total assets of $";assets
- print "Player ";q;" has ";player(q,4);" 'Get Out of Jail Free' cards"
- print "Player owns:"
- for prop = 1 to 40
- if property(prop,2) = q then
- gosub [housetype]
- print " ";property$(prop,1);
- let lots = property(prop,3)+4
- if prop <> 6 and prop <> 13 and prop <> 16 and prop <> 26 and prop <> 29 and prop <> 36 then
- for monfin = -4 to 4
- let propnum = prop + monfin
- if propnum > 40 then let propnum = propnum - 40
- if propnum < 0 then let propnum = propnum + 40
- if property$(propnum,2)=property$(prop,2) then
- if property(prop,2) = q then let monp = monp + 1
- if property(prop,2) <> q then let monp = 0 : goto [statsout]
- end if
- next monfin
- [statsout]
- if monp = mono(property(prop,10),2) then
- if xrent = 1 then let rent = rent * 2
- print " (MONOPOLY ";property$(prop,2);"; ";hohtel$;"; rent: $";rent;")"
- let xrent = 0
- end if
- end if
- select case property$(prop,2)
- case "RR"
- for rrstats = 1 to 4
- if property(1,2) = q then let rrcount = rrcount + 1
- if property(16,2) = q then let rrcount = rrcount + 1
- if property(26,2) = q then let rrcount = rrcount + 1
- if property(36,2) = q then let rrcount = rrcount + 1
- next rrstats
- if rrcount = 1 then let rent = 25
- if rrcount = 2 then let rent = 50
- if rrcount = 3 then let rent = 100
- if rrcount = 4 then let rent = 200
- print " (";property$(prop,2);"; rent: $";rent;")"
- let rrcount = 0
- case "U"
- if property(13,2) = property(39,2) then
- print " (";property$(prop,2);"; rent: 10X the amount on the dice)"
- else
- print " (";property$(prop,2);"; rent: 4X the amount on the dice)"
- end if
- case else
- print " (";property$(prop,2);"; rent: $";property(prop,lots);")"
- end select
- let monp = 0
- end if
- next prop
- print
- end if
- next q
- print
- if activeplayers = 1 then return
- goto [MAIN]
- [movement]
- gosub [dice]
- let player(p,2) = player(p,2) + dice
- if player(p,2) > 40 then let player(p,2) = player(p,2) - 40 : let go = go + 1
- let place$ = property$(player(p,2),1)
- return
- [dice]
- let d1 = int(rnd(1)*6)+1
- let d2 = int(rnd(1)*6)+1
- let dice = d1+d2
- return
- [count_properties]
- let proptotal = 0
- let propvalue = 0
- let colortotal = 0
- let color$ = property$(player(p,2),2)
- for i = 1 to 40
- if property(i,2) = p then
- let proptotal = proptotal + 1
- let propvalue = propvalue + property(i,1)
- if color$ = property$(i,2) then colortotal = colortotal + 1
- end if
- next i
- if colortotal = mono(property(player(p,2),10),1) then mono(property(player(p,2),10),2) = p
- return
- [pay_income_tax]
- gosub [count_properties]
- let assets = player(p,1) + propvalue
- taxes = int(.1 * assets)
- if taxes > 200 then let taxes = 200
- print "Total assets are $";assets;" and taxes paid is $";taxes
- let player(p,1) = player(p,1) - taxes
- goto [mid_main]
- [pay_luxury_tax]
- print "Luxury Tax of $75 paid"
- let player(p,1) = player(p,1) - 75
- goto [mid_main]
- [community_chest]
- let ccard = int(rnd(1)*16)+1
- print "Player ";p;" drew: ";cchest$(ccard);" [#";ccard;"]"
- if ccard = 4 then let player(p,4) = player(p,4) + 1
- if ccdo(ccard,1) = -1 then let type$ = "cc" : gosub [pay_property_tax] else player(p,1) = player(p,1) + ccdo(ccard,1)
- if ccard = 6 then
- let player(1,1) = player(1,1) - 10
- let player(2,1) = player(2,1) - 10
- let player(3,1) = player(3,1) - 10
- let player(4,1) = player(4,1) - 10
- print "$50 payed to each player"
- end if
- 'location impact
- 'note the "go to Go' card shold reflect +$200 or this needs to trigger getting the $200 at go
- if ccdo(ccard,2) <= 0 then let player(p,2) = player(p,2) + ccdo(ccard,2) else player(p,2) = ccdo(ccard,2)
- if ccdo(ccard,2) > 1 or ccdo(ccard,2) < 0 then goto [caseplace] else goto [mid_main]
- [chance]
- let ccard = int(rnd(1)*16)+1
- print "Player ";p;" drew: ";chance$(ccard);" [#";ccard;"]"
- if ccard = 4 then let player(p,4) = player(p,4) + 1
- if ccard = 10 or ccard = 14 or ccard = 15 then
- if ccard = 10 or ccard = 14 then
- if player(p,2) = 8 then
- let player(p,2) = 16
- if property(player(p,2),2) <> p then
- gosub [dice]
- print "Player has advanced to ";property$(player(p,2),1)
- gosub [RRchance2xrent]
- end if
- end if
- if player(p,2) = 23 then
- let player(p,2) = 26
- if property(player(p,2),2) <> p then
- gosub [dice]
- print "Player has advanced to ";property$(player(p,2),1)
- gosub [RRchance2xrent]
- end if
- end if
- if player(p,2) = 37 then
- let player(p,2) = 6
- let player(p,1) = player(p,1) + 200
- print "Player has advanced to ";property$(player(p,2),1)
- print "Player has crossed go and collected $200"
- if property(player(p,2),2) <> p then
- gosub [dice]
- gosub [RRchance2xrent]
- end if
- end if
- end if
- if ccard = 15 then
- if player(p,2) = 8 then
- let player(p,2) = 13
- if property(player(p,2),2) <> p then gosub [chanceutilrent]
- end if
- if player(p,2) = 23 then
- let player(p,2) = 29
- if property(player(p,2),2) <> p then gosub [chanceutilrent]
- end if
- if player(p,2) = 37 then
- let player(p,2) = 13
- print "Player has crossed go and collected $200"
- let player(p,1) = player(p,1) + 200
- if property(player(p,2),2) <> p then gosub [chanceutilrent]
- end if
- end if
- end if
- if chancedo(ccard,1) = -1 then let type$ = "c" : gosub [pay_property_tax] else player(p,1) = player(p,1) + chancedo(ccard,1)
- if ccard = 11 then
- let player(1,1) = player(1,1) + 50
- let player(2,1) = player(2,1) + 50
- let player(3,1) = player(3,1) + 50
- let player(4,1) = player(4,1) + 50
- print "$50 payed to each player"
- end if
- 'location impact
- 'note the "go to Go' card shold reflect +$200 or this needs to trigger getting the $200 at go
- if chancedo(ccard,2) <= 0 then let player(p,2) = player(p,2) + chancedo(ccard,2) else player(p,2) = chancedo(ccard,2)
- if chancedo(ccard,2) > 1 or chancedo(ccard,2) < 0 then goto [caseplace] else goto [mid_main]
- [RRchance2xrent]
- if player(property(player(p,2),2),5) = 1 then let rent = 50
- if player(property(player(p,2),2),5) = 2 then let rent = 100
- if player(property(player(p,2),2),5) = 3 then let rent = 200
- if player(property(player(p,2),2),5) = 4 then let rent = 400
- let player(p,1) = player(p,1) - rent
- let player(property(player(p,2),2),1) = player(property(player(p,2),2),1) + rent
- print "Rent paid to player ";property(player(p,2),2);" in the amount of $";rent
- return
- [chanceutilrent]
- gosub [dice]
- let rent = dice * 10
- print "Rent paid to player ";property(player(p,2),2);" in the amount of ";rent
- let player(p,1) = player(p,1) - rent
- let player(property(player(p,2),2),1) = player(property(player(p,2),2),1) + rent
- return
- [pay_property_tax]
- if type$ = "c" then let house = 25 : let hotel = 100
- if type$ = "cc" then let house = 40 : let hotel = 115
- for tax = 1 to 40
- if property(tax,2) = p then
- if property(tax,3) = -1 then let taxpay = taxpay
- if property(tax,3) = 5 then let taxpay = taxpay + hotel
- if property(tax,3) >= 1 and property(tax,3) <= 4 then let taxpay = taxpay + property(tax,3) * house
- end if
- next tax
- let player(p,1) = player(p,1) - taxpay
- print "Property tax paid in the amount of $";taxpay
- let taxpay = 0
- let house = 0
- let hotel = 0
- return
- [property_buy]
- let buy = rnd(1)
- if player(p,1) > property(player(p,2),1) + 500 then
- for monfin = -4 to 4
- let propnum = player(p,2) + monfin
- if propnum > 40 then let propnum = propnum - 40
- if propnum < 0 then let propnum = propnum + 40
- if property$(propnum,2)=property$(player(p,2),2) then
- if property(player(p,2),2) = p then let monp = monp + 1
- if property(player(p,2),2) <> 0 then goto [monout]
- end if
- next monfin
- if roundcount > 5 then
- if monp = 0 then
- if buy < 0.5 then let bought = 1
- end if
- if monp = 1 then
- if buy < 0.85 then let bought = 1
- end if
- if monp = 2 then
- let bought = 1
- end if
- else
- if buy < 0.9 then
- let bought = 1
- end if
- end if
- [monout]
- let monp = 0
- if bought = 1 then
- print "Player elected to purchase property for $";property(player(p,2),1)
- let property(player(p,2),2) = p
- let player(p,1) = player(p,1) - property(player(p,2),1)
- else
- print "Player elected not to purchase property"
- end if
- let bought = 0
- goto [return_buy]
- end if
- if player(p,1) > property(player(p,2),1) then
- if buy < 0.25 then
- let property(player(p,2),2) = p
- let player(p,1) = player(p,1) - property(player(p,2),1)
- print "Property purchased for $";property(player(p,2),1)
- gosub [count_properties]
- else
- print "Player elected not to purchase property"
- end if
- else
- Print "Insufficent funds for purchase"
- end if
- goto [mid_main]
- [building]
- print " This is the building routine:"
- print " it is not finished yet"
- goto [skip]
- ' for try = 1 to tries '3 by default
- ' let build = int(rnd(1)*40)+1
- ' if property(build,2) = p then
- ' if it is a monopoly then
- ' if (propertys in monopoly)'s houses > 4 then
- ' if build <= 11 and build > 0 then let buildper = $50
- ' if build <= 21 and build > 11 then let buildper = $100
- ' if build <= 31 and build > 21 then let buildper = $150
- ' if build <= 41 and build > 31 then let buildper = $200
- ' let housesnum = int(rnd(1)*3)+1
- ' let (propertys in monopoly remember to use property(p,10)!)'s houses = housebefore
- ' let (propertys in monopoly remember to use property(p,10)!)'s houses = houses + housenum
- ' if (propertys in monopoly remember to use property(p,10)!)'s houses > 5 then let (propertys in monopoly)'s houses = 5
- ' print "Player p build ";(housenum - housebefore);" houses on the ";property$(build,2);" monopoly"
- ' print "in the amount of ";housenum*buildper;" to make ";((housenum) houses or a hotel)
- ' print "property "
- ' let player(p,1)
- ' end if
- ' end if
- ' end if
- ' next tries
- [skip]
- return
- [rent]
- if property$(player(p,2),2) = "RR" then goto [railroad_rent]
- if property$(player(p,2),2) = "U" then goto [utility_rent]
- 'else, propety rent
- if property(player(p,2),3) = 0 then
- 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)
- end if
- if property(player(p,2),3) = 1 then
- if property(p1,2) = q then
- let rent = property(player(p,2),4) * 2
- end if
- end if
- if property(player(p,2),3) = 2 then let rent = property(player(p,2),6)
- if property(player(p,2),3) = 3 then let rent = property(player(p,2),7)
- if property(player(p,2),3) = 4 then let rent = property(player(p,2),8)
- if property(player(p,2),3) = 5 then let rent = property(player(p,2),9)
- goto [collect]
- [railroad_rent]
- if player(property(player(p,2),2),5) = 1 then let rent = 25
- if player(property(player(p,2),2),5) = 2 then let rent = 50
- if player(property(player(p,2),2),5) = 3 then let rent = 100
- if player(property(player(p,2),2),5) = 4 then let rent = 200
- if FLAG$ = "1" then return
- goto [collect]
- [utility_rent]
- if property(13,2) = property(29,2) then let rent = 10 * dice else let rent = 4 * dice
- goto [collect]
- [collect]
- if rent <= player(p,1) then
- let player(p,1) = player(p,1) - rent
- let player(property(player(p,2),2),1) = player(property(player(p,2),2),1) + rent
- print "Rent paid to player ";property(player(p,2),2);" in the amount of $";rent
- end if
- if rent > player(p,1) then
- print "The rent ($";rent;") is too much, player ";p;" has lost"
- print "All properties are being transfered to the debter"
- for q = 1 to 40
- if property(q,2) = p then let property(q,2) = property(player(p,2),2)
- next q
- end if
- goto [mid_main]
- [jail]
- print "Player ";p;" has been sent to jail"
- let jail = rnd(1)
- let player(p,2) = 11
- if player(p,4) >= 1 then
- let player(p,3) = -1
- let player(p,4) = player(p,4) - 1
- print "Player has used a Get Out of Jail Free card"
- goto [mid_main]
- end if
- if jail > .2 and player(p,1) > 75 then
- print "Player has elected to pay out of jail ($50)"
- [rolls_failed]
- let player(p,1) = player(p,1) - 50
- let player(p,3) = -1
- else
- print "Player has elected to roll out of jail"
- let player(p,3) = 1
- end if
- goto [mid_main]
- [rolloutofjail]
- gosub [dice]
- if d1 = d2 then
- print "Player rolled doubles with a ";d1;" and ";d2
- let player(p,3) = -1
- let player(p,2) = player(p,2) + dice
- goto [caseplace]
- else
- print "Player failed to roll doubles with a ";d1;" and ";d2
- player(p,3) = player(p,3) + 1
- if player(p,3) = 3 then print "Player waited 3 rolls; must pay out of Jail ($50)": goto [rolls_failed]
- goto [mid_main]
- end if
- [housetype]
- select case property(prop,3)
- case -1
- let hohtel$ = "unbuildable"
- case 0
- let hohtel$ = "no houses"
- let xrent = 1
- case 1
- let hohtel$ = "one house"
- case 2
- let hohtel$ = "two houses"
- case 3
- let hohtel$ = "two houses"
- case 4
- let hohtel$ = "two houses"
- case 5
- let hohtel$ = "one hotel"
- case else
- let hohtel$ = "CHECK FOR ERROR"
- end select
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement