Skip to content

Commit

Permalink
Merge pull request #11468 from tobymao/1837-sr1-sd-minors
Browse files Browse the repository at this point in the history
[1837] Maintain unauctioned start packets in SR1 and coal companies have no end game value
  • Loading branch information
crericha authored Jan 25, 2025
2 parents 8f72dc0 + 5f5d943 commit 31d5fa6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/engine/game/g_1837/entities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ module Entities
sym: 'SD2',
value: 120,
desc: "Director's certificate of the minor company Kärntner Railway (SD2). The company " \
"starts in Marburg (J16) with 90K starting capital.\n\n =Comes with the Mountain Railway " \
"starts in Marburg (J16) with 90K starting capital.\n\nComes with the Mountain Railway " \
'Karawanken Railway (J12) that has a value of 120K and a revenue of 25K.',
color: :orange,
meta: { start_packet: true },
Expand Down
4 changes: 3 additions & 1 deletion lib/engine/game/g_1837/game.rb
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def initial_auction_companies

def setup
non_purchasable = @companies.flat_map do |c|
Array(c.meta['additional_companies']) + [c.meta['hidden'] ? c.id : nil]
[abilities(c, :acquire_company, time: 'any')&.company, c.meta['hidden'] ? c.id : nil]
end.compact
@companies.each { |company| company.owner = @bank unless non_purchasable.include?(company.id) }
setup_mines
Expand Down Expand Up @@ -623,6 +623,7 @@ def corporation_show_individual_reserved_shares?
end

def unowned_purchasable_companies(_entity)
@companies.select { |company| company.meta[:start_packet] }
@companies.select { |c| c.owner == @bank }
end

Expand All @@ -640,6 +641,7 @@ def after_buy_company(player, company, _price)
minor = minor_by_id(company.id)
minor.owner = player
float_minor!(minor)
company.value = 0
end

abilities(company, :acquire_company) do |ability|
Expand Down

0 comments on commit 31d5fa6

Please sign in to comment.