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] Company shall only retreive destination_bonus in their own turn #11214

Merged
merged 4 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions lib/engine/game/g_18_uruguay/game.rb
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ def after_buy_company(player, company, _price)

def operating_round(round_num)
Round::Operating.new(self, [
G18Uruguay::Step::DestinationBonus,
Engine::Step::Bankrupt,
Engine::Step::Exchange,
G18Uruguay::Step::Farm,
Expand Down
11 changes: 7 additions & 4 deletions lib/engine/game/g_18_uruguay/step/destination_bonus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,27 @@ def description
end

def log_skip(entity)
return if entity.minor?
return unless entity.corporation?
return if entity == @game.rptla
return if @game.abilities(entity, :destination_bonus).nil?
return if destination_node_check?(entity).nil?
patrikolesen marked this conversation as resolved.
Show resolved Hide resolved

super
end

def actions(entity)
return [] if entity.minor?
return [] if entity == @game.rptla
return [] if @game.abilities(entity, :destination_bonus).nil?

self.class::ACTIONS
end

def auto_actions(entity)
corporations = @round.entities.select { |c| destination_node_check?(c) }
return [Engine::Action::Pass.new(entity)] if corporations.empty?
return [] unless entity.corporation?
return [Engine::Action::Pass.new(entity)] if destination_node_check?(entity).nil?
patrikolesen marked this conversation as resolved.
Show resolved Hide resolved

[Engine::Action::DestinationConnection.new(entity, corporations: corporations)]
[Engine::Action::DestinationConnection.new(entity, corporations: [entity])]
end

def destination_node_check?(corporation)
Expand Down
Loading