Skip to content

Commit

Permalink
fix minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
BenA authored and BenA committed Oct 15, 2024
1 parent 011ed24 commit b993d61
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 29 deletions.
30 changes: 15 additions & 15 deletions lib/engine/game/g_18_esp/entities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ module Entities
coordinates: 'F24',
city: 1,
max_ownership_percent: 60,
tokens: [0, 50, 50, 50, 50, 50],
tokens: [0, 50, 50, 50, 50],
color: '#C29137',
type: 'major',
destination: 'E21',
Expand All @@ -157,7 +157,7 @@ module Entities
coordinates: 'F24',
city: 2,
max_ownership_percent: 60,
tokens: [0, 50, 50, 50, 50, 50],
tokens: [0, 50, 50, 50, 50],
color: '#FFD526',
type: 'major',
destination: 'J28',
Expand All @@ -169,7 +169,7 @@ module Entities
logo: '18_esp/A',
coordinates: 'E33',
max_ownership_percent: 60,
tokens: [0, 50, 50, 50, 50, 50],
tokens: [0, 50, 50, 50, 50],
color: '#B75835',
type: 'major',
destination: 'C31',
Expand All @@ -181,7 +181,7 @@ module Entities
logo: '18_esp/CRB',
coordinates: 'B26',
max_ownership_percent: 60,
tokens: [0, 50, 50, 50, 50, 50],
tokens: [0, 50, 50, 50, 50],
color: '#E96B28',
type: 'major',
destination: 'F28',
Expand All @@ -194,7 +194,7 @@ module Entities
coordinates: 'F24',
city: 0,
max_ownership_percent: 60,
tokens: [0, 50, 50, 50, 50, 50],
tokens: [0, 50, 50, 50, 50],
color: '#009AD5',
type: 'major',
destination: 'C25',
Expand All @@ -209,7 +209,7 @@ module Entities
coordinates: 'M21',
city: 1,
max_ownership_percent: 60,
tokens: [0, 50, 50, 50, 50, 50],
tokens: [0, 50, 50, 50, 50],
color: '#DA0A26',
type: 'major',
destination: 'J20',
Expand All @@ -222,7 +222,7 @@ module Entities
logo: '18_esp/FdSB',
coordinates: 'I5',
max_ownership_percent: 60,
tokens: [0, 50, 50, 50, 50, 50],
tokens: [0, 50, 50, 50, 50],
color: '#009AD5',
type: 'major',
destination: 'K5',
Expand All @@ -235,7 +235,7 @@ module Entities
logo: '18_esp/CFEA',
coordinates: 'D6',
max_ownership_percent: 60,
tokens: [0, 50, 50, 50, 50, 50],
tokens: [0, 50, 50, 50, 50],
color: '#E96B28',
type: 'major',
destination: 'G5',
Expand All @@ -248,7 +248,7 @@ module Entities
logo: '18_esp/CFLG',
coordinates: 'E3',
max_ownership_percent: 60,
tokens: [0, 50, 50, 50, 50, 50],
tokens: [0, 50, 50, 50, 50],
color: '#DA0A26',
type: 'major',
destination: 'E7',
Expand All @@ -261,7 +261,7 @@ module Entities
logo: '18_esp/FdLR',
coordinates: 'H8',
max_ownership_percent: 60,
tokens: [0, 50, 50, 50, 50, 50],
tokens: [0, 50, 50, 50, 50],
color: '#009141',
type: 'major',
destination: 'K5',
Expand Down Expand Up @@ -359,7 +359,7 @@ module Entities
coordinates: 'D6',
color: '#AD539B',
max_ownership_percent: 60,
tokens: [0, 50, 50, 50, 50, 50],
tokens: [0, 50, 50, 50, 50],
type: 'major',
destination: 'C1',
},
Expand All @@ -371,7 +371,7 @@ module Entities
coordinates: 'I5',
color: '#F78243',
max_ownership_percent: 60,
tokens: [0, 50, 50, 50, 50, 50],
tokens: [0, 50, 50, 50, 50],
type: 'major',
destination: 'G5',
},
Expand All @@ -383,7 +383,7 @@ module Entities
coordinates: 'I29',
city: 0,
max_ownership_percent: 60,
tokens: [0, 50, 50, 50, 50, 50],
tokens: [0, 50, 50, 50, 50],
color: '#6D1D7D',
type: 'major',
destination: 'F32',
Expand All @@ -396,7 +396,7 @@ module Entities
coordinates: 'K25',
city: 0,
max_ownership_percent: 60,
tokens: [0, 50, 50, 50, 50, 50],
tokens: [0, 50, 50, 50, 50],
color: '#000000',
type: 'major',
destination: 'L22',
Expand All @@ -409,7 +409,7 @@ module Entities
coordinates: 'L22',
city: 0,
max_ownership_percent: 60,
tokens: [0, 50, 50, 50, 50, 50],
tokens: [0, 50, 50, 50, 50],
color: '#338242',
type: 'major',
destination: 'N18',
Expand Down
16 changes: 2 additions & 14 deletions lib/engine/game/g_18_esp/game.rb
Original file line number Diff line number Diff line change
Expand Up @@ -866,20 +866,8 @@ def revenue_str(route)
end

def must_buy_train?(entity)
return false if depot.depot_trains.empty?

entity.trains.none? do |train|
next false if extra_train?(train)

case train.track_type
when :narrow
north_corp?(entity) || (entity.interchange? && entity.type != :minor)
when :broad
!north_corp?(entity) || entity.interchange?
when :all
!combined_train_blocked?(entity)
end
end
entity.trains.none? { |t| !extra_train?(t) } &&
!depot.depot_trains.empty?
end

def num_corp_trains(entity)
Expand Down

0 comments on commit b993d61

Please sign in to comment.