diff --git a/lib/engine/game/g_18_india/game.rb b/lib/engine/game/g_18_india/game.rb index ee9769da78..993b3a5f79 100644 --- a/lib/engine/game/g_18_india/game.rb +++ b/lib/engine/game/g_18_india/game.rb @@ -508,7 +508,7 @@ def operating_round(round_num) G18India::Step::Assign, # used by P6 G18India::Step::SpecialChoose, # Used by P4 G18India::Step::SpecialTrack, # used by P2 & P3 (track lay & track upgrade) - Engine::Step::SpecialToken, # use for P5 + G18India::Step::SpecialToken, # use for P5 (Danish EIC) G18India::Step::Track, G18India::Step::Token, G18India::Step::Route, diff --git a/lib/engine/game/g_18_india/step/special_token.rb b/lib/engine/game/g_18_india/step/special_token.rb new file mode 100644 index 0000000000..2ba9b7e10b --- /dev/null +++ b/lib/engine/game/g_18_india/step/special_token.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +require_relative '../../../step/special_token' + +module Engine + module Game + module G18India + module Step + class SpecialToken < Engine::Step::SpecialToken + def process_place_token(action) + special_ability = ability(action.entity) + + # When a cheater token ability (e.g. Danish EIC) would bypass a tile + # reservation block, force the token into an extra slot so that the + # protected home-token slot (e.g. TR's Nepal slot) remains available. + if special_ability&.cheater&.positive? && + action.city.tile.token_blocked_by_reservation?(@game.token_owner(action.entity)) + special_ability.instance_variable_set(:@extra_slot, true) + end + + super + end + end + end + end + end +end