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

18NY - fix salvage rendering #9139

Closed
wants to merge 1 commit into from
Closed
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: 2 additions & 0 deletions assets/app/view/game/discard_trains.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def render
}
step = @game.active_step
overflow = step.crowded_corps.map do |corporation|
salvagable = step.trains(corporation)&.any?(&:salvage)
@verb = salvagable ? 'Salvage' : 'Discard'
trains = step.trains(corporation).map do |train|
train_props = {
style: {
Expand Down
10 changes: 6 additions & 4 deletions lib/engine/game/g_18_ny_1e/game.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,15 @@ class Game < G18NY::Game
].freeze

TRAINS = [
{ name: '2H', num: 11, distance: 2, price: 100, rusts_on: '6H' },
{ name: '4H', num: 6, distance: 4, price: 200, rusts_on: '5DE', events: [{ 'type' => 'float_30' }] },
{ name: '6H', num: 4, distance: 6, price: 300, rusts_on: 'D', events: [{ 'type' => 'float_40' }] },
{ name: '2H', num: 11, distance: 2, price: 100, rusts_on: '6H', salvage: 25 },
{ name: '4H', num: 6, distance: 4, price: 200, rusts_on: '5DE', salvage: 50, events: [{ 'type' => 'float_30' }] },
{ name: '6H', num: 4, distance: 6, price: 300, rusts_on: 'D', salvage: 75, events: [{ 'type' => 'float_40' }] },
{
name: '12H',
num: 3,
distance: 12,
price: 600,
salvage: 150,
events: [{ 'type' => 'float_50' }, { 'type' => 'close_companies' }, { 'type' => 'nyc_formation' },
{ 'type' => 'capitalization_round', 'when' => 3 }],
},
Expand All @@ -76,9 +77,10 @@ class Game < G18NY::Game
num: 2,
distance: [{ 'nodes' => %w[city offboard town], 'pay' => 5, 'visit' => 99, 'multiplier' => 2 }],
price: 800,
salvage: 200,
events: [{ 'type' => 'float_60' }],
},
{ name: 'D', num: 20, distance: 99, price: 1000 },
{ name: 'D', num: 20, distance: 99, price: 1000, salvage: 250 },
].freeze

def second_edition?
Expand Down
9 changes: 9 additions & 0 deletions spec/assets_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,15 @@
[nil,
'endgame',
['1860: Phase 9 - Operating Round 8.4 (Nationalization) - Game Over - Nationalization complete']]]],
['18NY',
118_662,
[[524,
'discard_train',
['!!<div>Salvage Trains']],
120_048,
[277,
'scrap_train',
['!!<div>Trains to Scrap']]]],
].freeze

AUTO_ACTIONS_TEST_CASES = [
Expand Down
Loading