From 2cd5674db7ed5bec1196056ecf719b2e97d3778a Mon Sep 17 00:00:00 2001 From: Chris Rericha Date: Sat, 25 Jan 2025 00:28:25 -0500 Subject: [PATCH 1/2] [1837] Non-auctioned starting packet items stay intact until bought --- lib/engine/game/g_1837/entities.rb | 2 +- lib/engine/game/g_1837/game.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/engine/game/g_1837/entities.rb b/lib/engine/game/g_1837/entities.rb index 5e3905b273..8654333ea9 100644 --- a/lib/engine/game/g_1837/entities.rb +++ b/lib/engine/game/g_1837/entities.rb @@ -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 }, diff --git a/lib/engine/game/g_1837/game.rb b/lib/engine/game/g_1837/game.rb index 16048fc695..5d5421634e 100644 --- a/lib/engine/game/g_1837/game.rb +++ b/lib/engine/game/g_1837/game.rb @@ -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 @@ -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 From 5f5d9431f587313c6a75952c925bbdc060e7de6e Mon Sep 17 00:00:00 2001 From: Chris Rericha Date: Sat, 25 Jan 2025 00:56:59 -0500 Subject: [PATCH 2/2] [1837] Coal companies have no value at end game --- lib/engine/game/g_1837/game.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/engine/game/g_1837/game.rb b/lib/engine/game/g_1837/game.rb index 5d5421634e..614cbcbe98 100644 --- a/lib/engine/game/g_1837/game.rb +++ b/lib/engine/game/g_1837/game.rb @@ -641,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|