From 9fbdce88cde99460e470b6f98784e40772ad8067 Mon Sep 17 00:00:00 2001 From: Benjamin Scott Date: Fri, 21 Apr 2023 11:55:48 -0700 Subject: [PATCH] [18NY] Change Text for Forced Salvage of Trains Over Limit on Phase Change Fixes #9128 --- assets/app/view/game/discard_trains.rb | 4 ++-- lib/engine/game/g_18_ny/game.rb | 17 ++++++++--------- lib/engine/game/g_18_ny/step/discard_train.rb | 4 ++++ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/assets/app/view/game/discard_trains.rb b/assets/app/view/game/discard_trains.rb index 25f7e1b70f..daca13e860 100644 --- a/assets/app/view/game/discard_trains.rb +++ b/assets/app/view/game/discard_trains.rb @@ -29,7 +29,7 @@ def render h('div.margined', train_props, train.name) end - + @verb = step.trains(corporation)&.any?(&:salvage) ? 'Salvage' : 'Discard' h(:div, block_props, [ h(Corporation, corporation: corporation), h(:div, trains), @@ -40,7 +40,7 @@ def render overflow << h(Map, game: @game) if @game.round.is_a?(Engine::Round::Operating) h(:div, [ - h(:h3, 'Discard Trains'), + h(:h3, "#{@verb} Trains"), *overflow, ]) end diff --git a/lib/engine/game/g_18_ny/game.rb b/lib/engine/game/g_18_ny/game.rb index 25ea576379..31f74a5185 100644 --- a/lib/engine/game/g_18_ny/game.rb +++ b/lib/engine/game/g_18_ny/game.rb @@ -135,14 +135,15 @@ def tile_lays(entity) ].freeze TRAINS = [ - { name: '2H', num: 11, distance: 2, price: 100, rusts_on: '6H' }, - { name: '4H', num: 6, distance: 4, price: 200, rusts_on: '4DE', 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: '4DE', 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 }], }, @@ -151,6 +152,7 @@ def tile_lays(entity) num: 2, distance: [{ 'nodes' => %w[city offboard town], 'pay' => 4, 'visit' => 99, 'multiplier' => 2 }], price: 800, + salvage: 200, events: [{ 'type' => 'float_60' }], }, { @@ -158,6 +160,7 @@ def tile_lays(entity) num: 20, distance: 99, price: 1000, + salvage: 250, variants: [ name: '5DE', distance: [{ 'nodes' => %w[city offboard town], 'pay' => 5, 'visit' => 99, 'multiplier' => 2 }], @@ -830,14 +833,10 @@ def remove_stagecoach_token_exchange_ability(entity) entity.remove_ability(stagecoach_token_exchange_ability) end - def salvage_value(train) - train.price / 4 - end - def salvage_train(train) owner = train.owner - @log << "#{owner.name} salvages a #{train.name} train for #{format_currency(salvage_value(train))}" - @bank.spend(salvage_value(train), owner) + @log << "#{owner.name} salvages a #{train.name} train for #{format_currency(train.salvage)}" + @bank.spend(train.salvage, owner) @depot.reclaim_train(train) end diff --git a/lib/engine/game/g_18_ny/step/discard_train.rb b/lib/engine/game/g_18_ny/step/discard_train.rb index 668dbb2d93..331f39a277 100644 --- a/lib/engine/game/g_18_ny/step/discard_train.rb +++ b/lib/engine/game/g_18_ny/step/discard_train.rb @@ -7,6 +7,10 @@ module Game module G18NY module Step class DiscardTrain < Engine::Step::DiscardTrain + def description + 'Salvage Train' + end + def process_discard_train(action) @game.salvage_train(action.train) end