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

[SteamOverHolland] fixes revenue bugs #11166

Merged
merged 3 commits into from
Aug 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions lib/engine/game/g_steam_over_holland/game.rb
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,13 @@ def check_distance(route, visits, train = nil)
def revenue_for(route, stops)
revenue = super

abilities = Array(abilities(route.corporation, :hex_bonus))
return revenue if abilities.empty?
route.corporation.companies.each do |company|
abilities(company, :hex_bonus) do |ability|
philcampeau marked this conversation as resolved.
Show resolved Hide resolved
revenue += stops.sum { |s| ability.hexes.include?(s.hex.id) ? ability.amount : 0 }
philcampeau marked this conversation as resolved.
Show resolved Hide resolved
end
end

bonus_hexes = abilities.flat_map(&:hexes)
bonus = 20 * stops.map(&:hex).map(&:coordinates).intersect(bonus_hexes).size
revenue + bonus
revenue
end

def sell_shares_and_change_price(bundle, allow_president_change: true, swap: nil, movement: nil)
Expand Down
Loading