Skip to content

Commit

Permalink
Merge pull request #11212 from patrikolesen/18_uruguay_buy_shares_loan
Browse files Browse the repository at this point in the history
[18Uruguay] Allow more than 60% to cover for loans
  • Loading branch information
ollybh authored Oct 7, 2024
2 parents 0e0dd53 + 721fc9c commit 3f9b8ab
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/engine/game/g_18_uruguay/step/buy_sell_par_shares.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@ module Game
module G18Uruguay
module Step
class BuySellParShares < Engine::Step::BuySellParShares
def can_buy?(entity, bundle)
def can_gain?(entity, bundle, exchange: false)
return false if bundle&.corporation == @game.rptla && !@game.phase.status.include?('rptla_available')
return true if excess_loans?(entity, bundle)

super(entity, bundle)
super
end

def excess_loans?(_entity, bundle)
return false if bundle.nil?
return false if bundle.owner.corporation?

bundle.corporation.loans.size > @game.maximum_loans(bundle.corporation)
end
end
end
Expand Down

0 comments on commit 3f9b8ab

Please sign in to comment.