diff --git a/lib/engine/game/g_18_ardennes/game.rb b/lib/engine/game/g_18_ardennes/game.rb index c881781164..07507fd00d 100644 --- a/lib/engine/game/g_18_ardennes/game.rb +++ b/lib/engine/game/g_18_ardennes/game.rb @@ -146,6 +146,7 @@ def operating_round(round_num) G18Ardennes::Step::DeclineTrains, G18Ardennes::Step::DeclineForts, G18Ardennes::Step::PostConversionShares, + G18Ardennes::Step::IssueShares, G18Ardennes::Step::Track, G18Ardennes::Step::Token, G18Ardennes::Step::CollectForts, @@ -252,6 +253,18 @@ def convert!(corporation) @log << "Certificate limit increases to #{new_limit}." end + # Shares that can be issued as part of a public company's operating + # turn. This is not allowed on a public company's first turn. + def issuable_shares(corporation) + return [] unless corporation.corporation? + return [] if corporation.type == :minor + return [] if corporation.operating_history.empty? + + bundles_for_corporation(corporation, corporation).select do |bundle| + @share_pool.fit_in_bank?(bundle) + end + end + private def bankrupt_sell_companies(player) diff --git a/lib/engine/game/g_18_ardennes/step/buy_sell_par_shares_companies.rb b/lib/engine/game/g_18_ardennes/step/buy_sell_par_shares_companies.rb index 53a13e3d2c..5c6ec64aa6 100644 --- a/lib/engine/game/g_18_ardennes/step/buy_sell_par_shares_companies.rb +++ b/lib/engine/game/g_18_ardennes/step/buy_sell_par_shares_companies.rb @@ -83,7 +83,7 @@ def sellable_companies(entity) # exchange for the minor company. def exchangeable_pool_shares(corporation, ability) minor = ability.owner - shares = @game.share_pool.shares_by_corporation[corporation] + shares = @game.share_pool.shares_by_corporation[corporation].take(1) return [] if shares.empty? return shares if corporation.owner == minor.owner return shares if corporation.receivership? diff --git a/lib/engine/game/g_18_ardennes/step/issue_shares.rb b/lib/engine/game/g_18_ardennes/step/issue_shares.rb new file mode 100644 index 0000000000..76ce4322cc --- /dev/null +++ b/lib/engine/game/g_18_ardennes/step/issue_shares.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require_relative '../../../step/issue_shares' + +module Engine + module Game + module G18Ardennes + module Step + class IssueShares < Engine::Step::IssueShares + def description + 'Issue Shares' + end + + def pass_description + 'Skip (Issue Shares)' + end + + def log_skip(entity) + super unless entity.type == :minor + end + + def process_sell_shares(action) + super + + corporation = action.entity + bundle = action.bundle + old_price = corporation.share_price + bundle.num_shares.times { @game.stock_market.move_left(corporation) } + @game.log_share_price(corporation, old_price) + end + end + end + end + end +end