Skip to content

Commit

Permalink
[1871] Prevents sale of more than 30% during EMR
Browse files Browse the repository at this point in the history
  • Loading branch information
philcampeau committed Nov 5, 2024
1 parent 69a64cd commit 74adbdb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/engine/game/g_1871/step/buy_train.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ def can_sell?(entity, bundle)
return false unless sellable_bundle?(bundle)
return false if @game.class::MUST_SELL_IN_BLOCKS && @corporations_sold.include?(bundle.corporation)

# This is our new clause for 1871, if this is the corporation
# selling, we can sell all of them
return true if bundle.corporation == bundle.owner
# Corporations can sell all of their treasury shares during EMR, players may not sell more than 30% of a corporation
return false if bundle.corporation != bundle.owner && (bundle.percent > @game.class::TURN_SELL_LIMIT)

selling_minimum_shares?(bundle)
end
Expand Down

0 comments on commit 74adbdb

Please sign in to comment.