Skip to content

Commit

Permalink
[core/18RoyalGorge] add Dividend to ability_blocking_step, fix de…
Browse files Browse the repository at this point in the history
…bt/company interactions

* fixes debt pay-off and 13LB Gold Nugget bonus interacting and breaking
* possibly also affects Ghost Town Tour Co. (Y2), which is also active during
  the dividend step
  • Loading branch information
michaeljb committed Oct 19, 2024
1 parent 1798d1e commit 638f916
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
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

0 comments on commit 638f916

Please sign in to comment.