Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18Uruguay] Also add FCE shares to secondary corps #11209

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
9 changes: 6 additions & 3 deletions lib/engine/game/g_18_uruguay/nationalization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ def acquire_shares
entity_shares = affected_shares(holder, @merge_data[:corps])

total_percent = entity_shares.sum(&:percent)
num_shares, odd_shares = (total_percent / 10).divmod(2)
from_secondary = @merge_data[:secondary_corps].count { |corp| corp.president?(holder) }
num_shares = (total_percent / 20).to_i
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patrikolesen Did you mean to revert this change in this commit? What was rubocop objecting to here? Or was this commit just supposed to remove the space after bundle = below?

odd_share = num_shares * 20 != total_percent
patrikolesen marked this conversation as resolved.
Show resolved Hide resolved
from_secondary = @merge_data[:secondary_corps].reduce(0) do |sum, secondary_corps|
sum + (secondary_corps.president?(holder) ? 1 : 0)
end
num_shares += from_secondary
bundle =
bundle =
if num_shares == 10
Engine::ShareBundle.new(@fce.shares.take(9))
else
Expand Down
Loading