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

[core/18RoyalGorge] add Dividend to ability_blocking_step, fix debt/company interactions #11288

Merged
merged 1 commit into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion lib/engine/game/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3227,7 +3227,7 @@ def ability_time_is_or_start?
end

def ability_blocking_step
supported_steps = [Step::Tracker, Step::Token, Step::Route, Step::BuyTrain]
supported_steps = [Step::Tracker, Step::Token, Step::Route, Step::Dividend, Step::BuyTrain]
@round.steps.find do |step|
supported_steps.any? { |s| step.is_a?(s) } && !step.passed? && step.active? && step.blocks?
end
Expand Down
11 changes: 10 additions & 1 deletion lib/engine/game/g_18_royal_gorge/step/special_choose.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,22 @@ module Game
module G18RoyalGorge
module Step
class SpecialChoose < Engine::Step::SpecialChoose
def actions(entity)
if @game.indebted.include?(entity) ||
(entity.company? && %w[RG-D SF-D].include?(entity.sym))
super
else
[]
end
end

def process_choose_ability(action)
return unless action.choice == 'pay_debt'

debt_company = action.entity
corporation = debt_company.owner

ability = abilities(corporation)
ability = Array(abilities(corporation)).find { |a| a.description == 'Pay debt' }
ability.use!

debtor, = @game.indebted[corporation]
Expand Down
Loading