monotony 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.rdoc_options +17 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +21 -0
  6. data/README.md +78 -0
  7. data/Rakefile +1 -0
  8. data/bin/console +14 -0
  9. data/bin/setup +7 -0
  10. data/lib/monotony.rb +22 -0
  11. data/lib/monotony/.yardoc/checksums +0 -0
  12. data/lib/monotony/.yardoc/object_types +0 -0
  13. data/lib/monotony/.yardoc/objects/root.dat +0 -0
  14. data/lib/monotony/.yardoc/proxy_types +0 -0
  15. data/lib/monotony/basicproperty.rb +174 -0
  16. data/lib/monotony/behaviour.rb +103 -0
  17. data/lib/monotony/chance.rb +53 -0
  18. data/lib/monotony/communitychest.rb +57 -0
  19. data/lib/monotony/doc/_index.html +88 -0
  20. data/lib/monotony/doc/class_list.html +58 -0
  21. data/lib/monotony/doc/css/common.css +1 -0
  22. data/lib/monotony/doc/css/full_list.css +57 -0
  23. data/lib/monotony/doc/css/style.css +339 -0
  24. data/lib/monotony/doc/file_list.html +57 -0
  25. data/lib/monotony/doc/frames.html +26 -0
  26. data/lib/monotony/doc/index.html +88 -0
  27. data/lib/monotony/doc/js/app.js +219 -0
  28. data/lib/monotony/doc/js/full_list.js +181 -0
  29. data/lib/monotony/doc/js/jquery.js +4 -0
  30. data/lib/monotony/doc/method_list.html +57 -0
  31. data/lib/monotony/doc/top-level-namespace.html +102 -0
  32. data/lib/monotony/game.rb +307 -0
  33. data/lib/monotony/player.rb +191 -0
  34. data/lib/monotony/purchasable.rb +131 -0
  35. data/lib/monotony/square.rb +23 -0
  36. data/lib/monotony/station.rb +24 -0
  37. data/lib/monotony/utility.rb +23 -0
  38. data/lib/monotony/variants.rb +405 -0
  39. data/lib/monotony/version.rb +4 -0
  40. data/monotony.gemspec +33 -0
  41. metadata +125 -0
@@ -0,0 +1,191 @@
1
+ module Monotony
2
+ # Represents a player
3
+ class Player
4
+ attr_accessor :hits, :board, :name, :currency, :history, :properties, :in_game, :turns_in_jail, :behaviour, :game, :jail_free_cards
5
+ # @return [Player] self
6
+ # @param [Hash] args
7
+ # @option opts [Hash] :behaviour Behaviour has describing this player's reaction to certain in-game situations. See Behaviour class.
8
+ # @option opts [String] :name The name of the player
9
+ def initialize(args)
10
+ @history = []
11
+ @in_game = true
12
+ @in_jail = false
13
+ @turns_in_jail = 0
14
+ @jail_free_cards = 0
15
+ @currency = 0
16
+ @game = nil
17
+ @name = args[:name]
18
+ @board = []
19
+ @properties = []
20
+ @behaviour = args[:behaviour] || Monotony::DefaultBehaviour::DEFAULT
21
+ self
22
+ end
23
+
24
+ # @return [Boolean] whether or not this player is currently in jail.
25
+ def in_jail?
26
+ @in_jail
27
+ end
28
+
29
+ # @return [Array<Player>] an array of all other players in the game.
30
+ def opponents
31
+ @game.players.reject{ |p| p == self }
32
+ end
33
+
34
+ # @return [Integer] the number of houses on properties owned by this player.
35
+ def num_houses
36
+ @properties.select { |p| p.is_a? BasicProperty }.collect(&:num_houses).inject(:+) || 0
37
+ end
38
+
39
+ # @return [Integer] the number of hotels on properties owned by this player.
40
+ def num_hotels
41
+ @properties.select { |p| p.is_a? BasicProperty }.collect(&:num_hotels).inject(:+) || 0
42
+ end
43
+
44
+ # @return [Integer] the number of property sets owned by this player.
45
+ def sets_owned
46
+ @properties.select { |p| p.is_a? BasicProperty }.select(&:set_owned?).group_by { |p| p.set }.keys
47
+ end
48
+
49
+ # Sets whether or not this player is currently in jail.
50
+ # @param [Boolean] bool True for in jail, False for out of jail.
51
+ def in_jail=(bool)
52
+ @in_jail = bool
53
+ @turns_in_jail = 0 if bool == false
54
+ end
55
+
56
+ # @return [Integer] the number of squares between this player's current position on the board, and the GO square.
57
+ def distance_to_go
58
+ index = @board.collect(&:name).find_index('GO')
59
+ index == 0 ? @board.length : index
60
+ end
61
+
62
+ # Moves a player on the game board.
63
+ # @param [Integer] n Number of squares to move.
64
+ # @param [Symbol] direction :forwards or :backwards.
65
+ # @return [Square] the square the player has landed on.
66
+ def move(n = 1, direction = :forwards)
67
+ n = @board.collect(&:name).find_index(n) if n.is_a? String
68
+
69
+ case direction
70
+ when :forwards
71
+ if n >= distance_to_go
72
+ unless in_jail?
73
+ puts '[%s] Passed GO' % @name
74
+ @game.pay_player(self, @game.go_amount, 'passing go')
75
+ end
76
+ end
77
+
78
+ (n % @board.length).times {
79
+ @board.push @board.shift
80
+ }
81
+ when :backwards
82
+ n = @board.length - n
83
+ (n % @board.length).times {
84
+ @board.unshift @board.pop
85
+ }
86
+ end
87
+
88
+ @history << @board[0].name
89
+ @board[0]
90
+ end
91
+
92
+ # @return [Square] The square this player is currently on.
93
+ def current_square
94
+ @board[0]
95
+ end
96
+
97
+ # Declares a player as bankrupt, transferring their assets to their creditor.
98
+ # @param player [Player] the player to whom this player's remaining assets will be transferred. If nil, assets are given to the bank instead.
99
+ def bankrupt!(player = nil)
100
+ if player == nil
101
+ puts '[%s] Bankrupt! Giving all assets to bank' % @name
102
+ @properties.each do |property|
103
+ property.owner = nil
104
+ property.is_mortgaged = false
105
+ end
106
+
107
+ @properties = []
108
+ else
109
+ puts '[%s] Bankrupt! Giving all assets to %s' % [ @name, player.name ]
110
+ @properties.each { |p| p.owner = player }
111
+ puts '[%s] Transferred properties to %s: %s' % [ @name, player.name, @properties.collect { |p| p.name }.join(', ') ]
112
+ player.properties.concat @properties unless player == nil
113
+ @properties = []
114
+ end
115
+ out!
116
+ end
117
+
118
+ # Called when a player is unable to pay a debt. Calls the 'money_trouble' behaviour.
119
+ # @param [Integer] amount amount of currency to be raised.
120
+ # @return [Boolean] whether or not the player was able to raise the amount required.
121
+ def money_trouble(amount)
122
+ puts '[%s] Has money trouble and is trying to raise £%d... (balance: £%d)' % [ @name, (amount - @currency), @currency ]
123
+ @behaviour[:money_trouble].call(game, self, amount)
124
+ @currency > amount
125
+ end
126
+
127
+ # Declares a player as out of the game.
128
+ def out!
129
+ puts '[%s] is out of the game!' % @name
130
+ @in_game = false
131
+ end
132
+
133
+ # @return [Boolean] whether or not this player has been eliminated from the game.
134
+ def is_out?
135
+ ! @in_game
136
+ end
137
+
138
+ # Use a 'get out of jail free' card to exit jail.
139
+ # @return [Boolean] whether the player was both in jail and had an unused jail card available.
140
+ def use_jail_card!
141
+ if @jail_free_cards > 0 and @in_jail
142
+ puts "[%s] Used a 'get out of jail free' card!" % @name
143
+ @in_jail = false
144
+ @turns_in_jail = 0
145
+ @jail_free_cards = @jail_free_cards - 1
146
+ true
147
+ else
148
+ false
149
+ end
150
+ end
151
+
152
+ # Transfer currency to another player, or the bank.
153
+ # @return [Boolean] whether or not the player was able to pay the amount requested. False indicates bancruptcy.
154
+ # @param [Symbol] beneficiary target Player instance or :bank.
155
+ # @param [Integer] amount amount of currency to transfer.
156
+ # @param [String] description Reference for the transaction (for game log).
157
+ def pay(beneficiary = :bank, amount = 0, description = nil)
158
+ money_trouble(amount) if @currency < amount
159
+ amount_to_pay = ( @currency >= amount ? amount : @currency )
160
+
161
+ case beneficiary
162
+ when :bank
163
+ @game.bank_balance = @game.bank_balance + amount_to_pay
164
+ paying_to = 'bank'
165
+ when :free_parking
166
+ @game.free_parking_balance = @game.free_parking_balance + amount_to_pay
167
+ paying_to = 'free parking'
168
+ when Player
169
+ beneficiary.currency = beneficiary.currency + amount_to_pay
170
+ paying_to = beneficiary.name
171
+ end
172
+
173
+ @currency = @currency - amount_to_pay
174
+
175
+ if amount_to_pay < amount then
176
+ puts '[%s] Unable to pay £%d to %s%s! Paid £%d instead' % [ @name, amount, paying_to, ( description ? ' for %s' % description : '' ), amount_to_pay ]
177
+ bankrupt!(beneficiary)
178
+ false
179
+ else
180
+ puts '[%s] Paid £%d to %s%s (balance: £%d)' % [ @name, amount, paying_to, ( description ? ' for %s' % description : '' ), @currency ]
181
+ true
182
+ end
183
+ end
184
+
185
+ # Roll the dice!
186
+ # @return [Array<Integer>] dice roll as an array of num_dice integers between 1 and die_size.
187
+ def roll
188
+ Array.new(@game.num_dice).collect { Random.rand(1..@game.die_size) }
189
+ end
190
+ end
191
+ end
@@ -0,0 +1,131 @@
1
+ require 'monotony/square'
2
+
3
+ module Monotony
4
+ # Represents any purchasable property tile.
5
+ class PurchasableProperty < Square
6
+ attr_accessor :value, :cost, :is_mortgaged, :owner, :mortgage_value
7
+ # @param opts [Hash]
8
+ # @option opts [Integer] :value the value of the property.
9
+ # @option opts [Integer] :mortgage_value the mortgaged value of the property.
10
+ # @option opts [Symbol] :set a symbol identifying this property as a member of a set of properties.
11
+ # @option opts [String] :name the name of the property.
12
+ def initialize(opts)
13
+ super
14
+ @game = nil
15
+ @is_mortgaged = false
16
+ @value = opts[:value]
17
+ @mortgage_value = opts[:mortgage_value]
18
+ end
19
+
20
+ # Transfer a property to another player, in return for currency.
21
+ # @param player [Player] Receiving player
22
+ # @param amount [Integer] Sale value
23
+ def sell_to(player, amount = cost)
24
+ if player.currency < amount then
25
+ puts '[%s] Unable to buy %s! (short of cash by £%d)' % [ player.name, @name, ( amount - player.currency ) ]
26
+ false
27
+ else
28
+ player.currency = player.currency - amount.to_i
29
+
30
+ if @owner
31
+ @owner.currency = @owner.currency + amount
32
+ puts '[%s] Sold %s%s to %s for £%d (new balance: £%d)' % [ @owner.name, @name, (is_mortgaged? ? ' (mortgaged)' : ''), player.name, amount, @owner.currency ]
33
+ @owner.properties.delete self
34
+ else
35
+ puts '[%s] Purchased %s%s for £%d (new balance: £%d)' % [ player.name, @name, (is_mortgaged? ? ' (mortgaged)' : ''), amount, player.currency ]
36
+ end
37
+
38
+ player.properties << self
39
+ @owner = player
40
+ end
41
+ end
42
+
43
+ # Returns the number of properties in the set containing self.
44
+ # @return [Integer]
45
+ def number_in_set(game = @owner.game)
46
+ properties_in_set(game).count
47
+ end
48
+
49
+ # Returns property objects for all properties in the same set as self.
50
+ # @return [Array<Square>]
51
+ def properties_in_set(game = @owner.game)
52
+ game.board.select { |p| p.is_a? self.class }.select { |p| p.set == @set }
53
+ end
54
+
55
+ # @return [Integer] the current cost to either purchase this property unowned, or unmortgage this property if mortgaged.
56
+ def cost
57
+ if is_mortgaged?
58
+ @value * 1.1
59
+ else
60
+ @value
61
+ end
62
+ end
63
+
64
+ # @return [Integer] the number of properties in the same set as this one which are currenly owned by players.
65
+ def number_of_set_owned
66
+ if @owner
67
+ @owner.properties.select { |p| p.is_a? self.class }.select { |p| p.set == @set }.count
68
+ end
69
+ end
70
+
71
+ # Offer to purchase this property from another player, thus calling the :trade_proposed behaviour of the receiving player.
72
+ def place_offer(proposer, amount)
73
+ @owner.behaviour[:trade_proposed].call(@owner.game, @owner, proposer, self, amount) if proposer.currency >= amount
74
+ end
75
+
76
+ # @return [Boolean] whether or not this property is part of a complete set owned by a single player.
77
+ def set_owned?
78
+ if @owner
79
+ player_basic_properties = @owner.properties.select { |p| p.is_a? self.class }
80
+ board_basic_properties = @owner.game.board.select { |p| p.is_a? self.class }
81
+ player_properties_in_set = player_basic_properties.select { |p| p.set == @set and p.is_mortgaged? == false }
82
+ board_properties_in_set = board_basic_properties.select { |p| p.set == @set }
83
+ (board_properties_in_set - player_properties_in_set).empty?
84
+ else
85
+ false
86
+ end
87
+ end
88
+
89
+ # Gives a property to another player. Available for use as part of a trading behaviour.
90
+ def give_to(player)
91
+ puts '[%s] Gave %s to %s' % [ @owner.name, @name, player.name ]
92
+ @owner.properties.delete self
93
+ @owner = player
94
+ player.properties << self
95
+ end
96
+
97
+ # Mortgage the property to raise cash for its owner.
98
+ # @return [self]
99
+ def mortgage
100
+ unless is_mortgaged?
101
+ puts '[%s] Mortgaged %s for £%d' % [ @owner.name, @name, @mortgage_value ]
102
+ @is_mortgaged = true
103
+ @owner.currency = @owner.currency + @mortgage_value
104
+ @mortgage_value
105
+ end
106
+ self
107
+ end
108
+
109
+ # Unmortgage the property.
110
+ # @return [self]
111
+ def unmortgage
112
+ if is_mortgaged?
113
+ if @owner.currency > cost
114
+ puts '[%s] Unmortgaged %s for £%d' % [ @owner.name, @name, cost ]
115
+ @owner.currency = @owner.currency - cost
116
+ @is_mortgaged = false
117
+ else
118
+ puts '[%s] Unable to unmortgage %s (not enough funds)' % [ @owner.name, @name ]
119
+ end
120
+ else
121
+ puts '[%] Tried to unmortgage a non-mortgaged property (%s)' % [ @owner.name, @name ]
122
+ end
123
+ self
124
+ end
125
+
126
+ # @return [Boolean] whether or not the property is currently mortgaged.
127
+ def is_mortgaged?
128
+ @is_mortgaged
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,23 @@
1
+ module Monotony
2
+
3
+ # Represents any landable square on the board.
4
+ class Square
5
+ attr_accessor :action, :name, :owner, :colour
6
+
7
+ # @return [Symbol] Returns the name of the set containing this property.
8
+ attr_accessor :set
9
+
10
+ # @param [Hash] opts
11
+ # @option opts [Symbol] :set a symbol identifying this property as a member of a set of properties.
12
+ # @option opts [String] :name the name of the property.
13
+ # @option opts [Proc] :action a procedure to run when a player lands on this square.
14
+ # @option opts [Symbol] :colour the colour to use when rendering this square on a GUI.
15
+ def initialize(opts)
16
+ @owner = nil
17
+ @set = opts[:set] || nil
18
+ @name = opts[:name]
19
+ @action = opts[:action] || Proc.new {|game, owner, player, property|}
20
+ @colour = opts[:colour] || ( String.colors.include? opts[:set] ? opts[:set] : :light_black )
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,24 @@
1
+ require 'monotony/square'
2
+ require 'monotony/purchasable'
3
+
4
+ module Monotony
5
+ # Represents a railway station tile.
6
+ class Station < PurchasableProperty
7
+ # @param [Hash] opts
8
+ # @option opts [String] :name the name of the station.
9
+ # @option opts [Symbol] :colour the colour to use when rendering this square on a GUI.
10
+ def initialize(opts)
11
+ super
12
+ @set = :stations
13
+ @action = Proc.new do |game, owner, player, property|
14
+ if owner
15
+ rent = [ 25, 50, 100, 200 ]
16
+ multiplier = owner.properties.select { |p| p.is_a? Station }.count
17
+ player.pay(owner, rent[multiplier - 1])
18
+ else
19
+ player.behaviour[:purchase_possible].call(game, player, self) if player.currency >= cost
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,23 @@
1
+ require 'monotony/square'
2
+ require 'monotony/purchasable'
3
+
4
+ module Monotony
5
+ # Represents a utility tile, such as the Electricity Company or Water Works.
6
+ class Utility < PurchasableProperty
7
+
8
+ # @param opts [Hash]
9
+ # @option opts [String] :name A symbol identifying this property as a member of a set of properties.
10
+ def initialize(opts)
11
+ super
12
+ @set = :utilities
13
+ @action = Proc.new do |game, owner, player, property|
14
+ if owner
15
+ rent = game.last_roll * ( owner.properties.collect { |p| p.is_a? Utility }.count == 2 ? 10 : 4 )
16
+ player.pay(owner, rent)
17
+ else
18
+ player.behaviour[:purchase_possible].call(game, player, self) if player.currency >= cost
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,405 @@
1
+ module Monotony
2
+ # The classic UK edition of Monopoly.
3
+ class DefaultLayout
4
+ # An array of strings representing a deck of 'Community Chest' cards. Will be shuffled before use.
5
+ COMMUNITY_CHEST = [
6
+ 'Go to jail. Move directly to jail. Do not pass GO. Do not collect £200.',
7
+ 'Receive interest on 7% preference shares (£25)',
8
+ 'Pay hospital £100', 'Pay your insurance premium (£50)',
9
+ 'Advance to GO', 'Income tax refund (collect £20)',
10
+ 'It is your birthday! (£10 from each player)',
11
+ 'Go back to Old Kent Road',
12
+ 'Bank error in your favour (£200)',
13
+ 'Annuity matures (collect £100)',
14
+ 'From sale of stock you get £50',
15
+ 'You have won second prize in a beauty contest (£10)',
16
+ 'Get out of jail free',
17
+ 'Pay a £10 fine or take a chance',
18
+ "Doctor's fee (£50)",
19
+ 'You inherit £100'
20
+ ]
21
+
22
+ # An array of strings representing a deck of 'Chance' cards. Will be shuffled before use.
23
+ CHANCE = [
24
+ 'Your building loan matures (receive £150)',
25
+ 'Take a trip to Marylebone Station',
26
+ 'Go back three spaces',
27
+ 'Speeding fine (£15)',
28
+ 'Advance to Mayfair',
29
+ 'Make general repairs on all of your houses. For each house pay £25, and for each hotel pay £100.',
30
+ 'Advance to Trafalgar Square',
31
+ 'You are assessed for street repairs. £40 per house, £115 per hotel.',
32
+ 'Pay school fees of £150',
33
+ 'Advance to GO',
34
+ 'Bank pays you dividend of £50',
35
+ 'Drunk in charge (£20 fine)',
36
+ 'Go to jail. Move directly to jail. Do not pass GO. Do not collect £200',
37
+ 'Advance to Pall Mall',
38
+ 'Get out of jail free',
39
+ 'You have won a crossword competition (£100)'
40
+ ]
41
+
42
+ # The game board layout, consisting of an array of Squares.
43
+ BOARD = [
44
+ Square.new(
45
+ name: 'GO',
46
+ action: Proc.new { |game, owner, player, property|
47
+ game.pay_player(player, game.go_amount, 'landing on GO')
48
+ }
49
+ ),
50
+ BasicProperty.new(
51
+ name: 'Old Kent Road',
52
+ rent: [ 2, 10, 30, 90, 160, 250 ],
53
+ house_cost: 50,
54
+ hotel_cost: 50,
55
+ mortgage_value: 30,
56
+ value: 60,
57
+ set: :brown,
58
+ colour: :yellow
59
+ ),
60
+
61
+ CommunityChest.new(
62
+ name: 'Community Chest 1',
63
+ colour: :light_cyan
64
+ ),
65
+
66
+ BasicProperty.new(
67
+ name: 'Whitechapel Road',
68
+ rent: [ 4, 20, 60, 180, 320, 450 ],
69
+ house_cost: 50,
70
+ hotel_cost: 50,
71
+ mortgage_value: 30,
72
+ value: 60,
73
+ set: :brown,
74
+ colour: :yellow
75
+ ),
76
+
77
+ Square.new(
78
+ name: 'Income Tax',
79
+ colour: :light_black,
80
+ action: Proc.new { |game, owner, player, property|
81
+ player.pay(:bank, 200, 'income tax')
82
+ }
83
+ ),
84
+
85
+ Station.new(
86
+ name: "King's Cross Station",
87
+ value: 200,
88
+ mortgage_value: 100,
89
+ colour: :light_blue
90
+ ),
91
+
92
+ BasicProperty.new(
93
+ name: 'The Angel Islington',
94
+ rent: [ 6, 30, 90, 270, 400, 550 ],
95
+ house_cost: 50,
96
+ hotel_cost: 50,
97
+ mortgage_value: 50,
98
+ value: 100,
99
+ set: :blue,
100
+ colour: :blue
101
+ ),
102
+
103
+ Chance.new(
104
+ name: 'Chance 1',
105
+ colour: :light_cyan
106
+ ),
107
+
108
+ BasicProperty.new(
109
+ name: 'Euston Road',
110
+ rent: [ 6, 30, 90, 270, 400, 550 ],
111
+ house_cost: 50,
112
+ hotel_cost: 50,
113
+ mortgage_value: 50,
114
+ value: 100,
115
+ set: :blue,
116
+ colour: :blue
117
+ ),
118
+
119
+ BasicProperty.new(
120
+ name: 'Pentonville Road',
121
+ rent: [ 8, 40, 100, 300, 450, 600 ],
122
+ house_cost: 50,
123
+ hotel_cost: 50,
124
+ mortgage_value: 60,
125
+ value: 120,
126
+ set: :blue,
127
+ colour: :blue
128
+ ),
129
+
130
+ Square.new(
131
+ name: 'Jail',
132
+ colour: :light_black
133
+ ),
134
+
135
+ BasicProperty.new(
136
+ name: 'Pall Mall',
137
+ rent: [ 10, 50, 150, 450, 625, 750 ],
138
+ house_cost: 100,
139
+ hotel_cost: 100,
140
+ mortgage_value: 70,
141
+ value: 140,
142
+ set: :pink,
143
+ colour: :light_magenta
144
+ ),
145
+
146
+ Utility.new(
147
+ name: 'Electric Company',
148
+ value: 150,
149
+ mortgage_value: 75,
150
+ colour: :cyan
151
+ ),
152
+
153
+ BasicProperty.new(
154
+ name: 'Whitehall',
155
+ rent: [ 10, 50, 150, 450, 625, 750 ],
156
+ house_cost: 100,
157
+ hotel_cost: 100,
158
+ mortgage_value: 70,
159
+ value: 140,
160
+ set: :pink,
161
+ colour: :light_magenta
162
+
163
+ ),
164
+
165
+ BasicProperty.new(
166
+ name: 'Northumberland Avenue',
167
+ rent: [ 12, 60, 180, 500, 700, 900 ],
168
+ house_cost: 100,
169
+ hotel_cost: 100,
170
+ mortgage_value: 80,
171
+ value: 160,
172
+ set: :pink,
173
+ colour: :light_magenta
174
+ ),
175
+
176
+ Station.new(
177
+ name: 'Marylebone Station',
178
+ value: 200,
179
+ mortgage_value: 100,
180
+ colour: :light_blue
181
+ ),
182
+
183
+ BasicProperty.new(
184
+ name: 'Bow Street',
185
+ rent: [ 14, 70, 200, 550, 750, 950 ],
186
+ house_cost: 100,
187
+ hotel_cost: 100,
188
+ mortgage_value: 90,
189
+ value: 180,
190
+ set: :orange,
191
+ colour: :light_red
192
+ ),
193
+
194
+ CommunityChest.new(
195
+ name: 'Community Chest 2',
196
+ set: :communitychest,
197
+ colour: :light_cyan
198
+ ),
199
+
200
+ BasicProperty.new(
201
+ name: 'Marlborough Street',
202
+ rent: [ 14, 70, 200, 550, 750, 950 ],
203
+ house_cost: 100,
204
+ hotel_cost: 100,
205
+ mortgage_value: 90,
206
+ value: 180,
207
+ set: :orange,
208
+ colour: :light_red
209
+ ),
210
+
211
+ BasicProperty.new(
212
+ name: 'Vine Street',
213
+ rent: [ 16, 80, 220, 600, 800, 1000 ],
214
+ house_cost: 100,
215
+ hotel_cost: 100,
216
+ mortgage_value: 100,
217
+ value: 200,
218
+ set: :orange,
219
+ colour: :light_red
220
+ ),
221
+
222
+ Square.new(
223
+ name: 'Free Parking',
224
+ colour: :white,
225
+ action: Proc.new { |game, owner, player, property|
226
+ game.payout_free_parking(player)
227
+ }
228
+ ),
229
+
230
+ BasicProperty.new(
231
+ name: 'Strand',
232
+ rent: [ 18, 90, 250, 700, 875, 1050 ],
233
+ house_cost: 150,
234
+ hotel_cost: 150,
235
+ mortgage_value: 110,
236
+ value: 220,
237
+ set: :red,
238
+ colour: :red
239
+ ),
240
+
241
+ Chance.new(
242
+ name: 'Chance 2',
243
+ colour: :light_cyan
244
+ ),
245
+
246
+ BasicProperty.new(
247
+ name: 'Fleet Street',
248
+ rent: [ 18, 90, 250, 700, 875, 1050 ],
249
+ house_cost: 150,
250
+ hotel_cost: 150,
251
+ mortgage_value: 110,
252
+ value: 220,
253
+ set: :red,
254
+ colour: :red
255
+ ),
256
+
257
+ BasicProperty.new(
258
+ name: 'Trafalgar Square',
259
+ rent: [ 20, 100, 300, 750, 925, 1100 ],
260
+ house_cost: 150,
261
+ hotel_cost: 150,
262
+ mortgage_value: 120,
263
+ value: 240,
264
+ set: :red,
265
+ colour: :red
266
+ ),
267
+
268
+ Station.new(
269
+ name: 'Fenchurch St Station',
270
+ value: 200,
271
+ mortgage_value: 100,
272
+ colour: :light_blue
273
+ ),
274
+
275
+ BasicProperty.new(
276
+ name: 'Leicester Square',
277
+ rent: [ 22, 110, 330, 800, 975, 1150 ],
278
+ house_cost: 150,
279
+ hotel_cost: 150,
280
+ mortgage_value: 130,
281
+ value: 260,
282
+ set: :yellow,
283
+ colour: :yellow
284
+ ),
285
+
286
+ BasicProperty.new(
287
+ name: 'Coventry Street',
288
+ rent: [ 22, 110, 330, 800, 975, 1150 ],
289
+ house_cost: 150,
290
+ hotel_cost: 150,
291
+ mortgage_value: 130,
292
+ value: 260,
293
+ set: :yellow,
294
+ colour: :yellow
295
+ ),
296
+
297
+ Utility.new(
298
+ name: 'Water Works',
299
+ value: 150,
300
+ mortgage_value: 75,
301
+ colour: :cyan
302
+ ),
303
+
304
+ BasicProperty.new(
305
+ name: 'Piccadilly',
306
+ rent: [ 22, 120, 360, 850, 1025, 1200 ],
307
+ house_cost: 150,
308
+ hotel_cost: 150,
309
+ mortgage_value: 140,
310
+ value: 280,
311
+ set: :yellow,
312
+ colour: :yellow
313
+ ),
314
+
315
+ Square.new(
316
+ name: 'Go to Jail',
317
+ colour: :light_black,
318
+ action: Proc.new {|game, owner, player, property|
319
+ player.in_jail = true
320
+ player.move('Jail')
321
+ puts '[%s] Got sent to jail!' % player.name
322
+ }
323
+ ),
324
+
325
+ BasicProperty.new(
326
+ name: 'Regent Street',
327
+ rent: [ 26, 130, 390, 900, 1100, 1275 ],
328
+ house_cost: 200,
329
+ hotel_cost: 200,
330
+ mortgage_value: 150,
331
+ value: 300,
332
+ set: :green,
333
+ colour: :green
334
+ ),
335
+
336
+ BasicProperty.new(
337
+ name: 'Oxford Street',
338
+ rent: [ 26, 130, 390, 900, 1100, 1275 ],
339
+ house_cost: 200,
340
+ hotel_cost: 200,
341
+ mortgage_value: 150,
342
+ value: 300,
343
+ set: :green,
344
+ colour: :green
345
+ ),
346
+
347
+ CommunityChest.new(
348
+ name: 'Community Chest 3',
349
+ colour: :light_cyan
350
+ ),
351
+
352
+ BasicProperty.new(
353
+ name: 'Bond Street',
354
+ rent: [ 28, 150, 450, 1000, 1200, 1400 ],
355
+ house_cost: 200,
356
+ hotel_cost: 200,
357
+ mortgage_value: 160,
358
+ value: 320,
359
+ set: :green,
360
+ colour: :green
361
+ ),
362
+
363
+ Station.new(
364
+ name: 'Liverpool St Station',
365
+ value: 200,
366
+ mortgage_value: 100,
367
+ colour: :light_blue
368
+ ),
369
+
370
+ Chance.new(
371
+ name: 'Chance 3',
372
+ colour: :light_cyan
373
+ ),
374
+
375
+ BasicProperty.new(
376
+ name: 'Park Lane',
377
+ rent: [ 35, 175, 500, 1100, 1300, 1500 ],
378
+ house_cost: 200,
379
+ hotel_cost: 200,
380
+ mortgage_value: 175,
381
+ value: 350,
382
+ set: :purple,
383
+ colour: :magenta
384
+ ),
385
+
386
+ Square.new(
387
+ name: 'Super Tax',
388
+ action: Proc.new {|game, owner, player, property|
389
+ player.pay(:bank, 100, 'super tax')
390
+ }
391
+ ),
392
+
393
+ BasicProperty.new(
394
+ name: 'Mayfair',
395
+ rent: [ 50, 200, 600, 1400, 1700, 2000 ],
396
+ house_cost: 200,
397
+ hotel_cost: 200,
398
+ mortgage_value: 200,
399
+ value: 400,
400
+ set: :purple,
401
+ colour: :magenta
402
+ )
403
+ ]
404
+ end
405
+ end