Skip to content

Commit

Permalink
Merge pull request #1 from tobymao/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
philcampeau authored Apr 3, 2021
2 parents 0b0b0ba + 46ea888 commit 1275d40
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 19 deletions.
4 changes: 3 additions & 1 deletion lib/engine/game/g_1822/game.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1467,7 +1467,9 @@ def company_choices_lcdr(company, time)
return {} if time != :token || !company.owner&.corporation?

choices = {}
choices['exchange'] = 'Move an exchange station token to the available station token section'
if exchange_tokens(company.owner).positive?
choices['exchange'] = 'Move an exchange station token to the available station token section'
end
choices
end

Expand Down
4 changes: 2 additions & 2 deletions lib/engine/game/g_1870/step/check_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def destination(corporation)

home_node = home.tile.cities.first # Each tile with a city has exactly one node
max_nodes = corporation.trains.map(&:distance).max
destination.tile.nodes.first&.walk(corporation: corporation) do |_, _, visited|
return true if visited[home_node] && visited.size <= max_nodes
destination.tile.nodes.first&.walk(corporation: corporation) do |path, _, visited|
return true if path.nodes.include?(home_node) && visited.size < max_nodes
end

false
Expand Down
6 changes: 3 additions & 3 deletions lib/engine/game/g_1873/step/buy_train.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ def process_scrap_train(action)
end

def scrap_mine_train(entity, new_train)
if @game.train_is_machine?(new_train)
@game.scrap_train(entity.trains.find { |t| @game.train_is_machine?(t) })
elsif @game.train_is_switcher?(new_train)
if @game.train_is_switcher?(new_train)
@game.scrap_train(entity.trains.find { |t| @game.train_is_switcher?(t) })
else
@game.scrap_train(entity.trains.find { |t| @game.train_is_machine?(t) })
end
end

Expand Down
11 changes: 0 additions & 11 deletions lib/engine/game/g_18_cz/game.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ def setup
# We can modify COMPANY_VALUES and OR_SETS if we want to support the shorter variant
@last_or = COMPANY_VALUES.size
@recently_floated = []
@entity_used_ability_to_track = false
@rusted_variants = []
@vaclavs_corporations = []

Expand Down Expand Up @@ -385,7 +384,6 @@ def next_round!
end

def tile_lays(entity)
return [] if @entity_used_ability_to_track
return super unless @recently_floated.include?(entity)

floated_tile_lay = [{ lay: true, upgrade: true }, { lay: :not_if_upgraded, upgrade: false }]
Expand Down Expand Up @@ -617,15 +615,6 @@ def ability_blocking_step
end
end

def next_turn!
super
@entity_used_ability_to_track = false
end

def skip_default_track
@entity_used_ability_to_track = true
end

def ability_usable?(ability)
case ability
when Ability::TileLay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def process_lay_tile(action)
operating_info.laid_hexes = @round.laid_hexes
end

@game.skip_default_track unless @game.purple_tile?(action.tile)
@round.num_laid_track += 1 unless @game.purple_tile?(action.tile)

abilities = @game.abilities(action.entity, :tile_lay, time: 'any')
abilities.each(&:use!)
Expand Down
2 changes: 1 addition & 1 deletion lib/engine/game/g_18_fl/game.rb
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ def event_hurricane!
key_island.lay_downgrade(key_island.original_tile)

@log << 'The hurricane also destroys the hotels in Key West'
# TODO: Destroy Key West hotels
key_west.tile.icons.clear
key_west.lay_downgrade(key_west.original_tile)
end

Expand Down
1 change: 1 addition & 0 deletions public/logos/1840/BBG.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/logos/1840/D.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/logos/1840/DTKC.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/logos/1840/G.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1275d40

Please sign in to comment.