From 4281e222494a8cbb40452f4c9b9633a9ae020960 Mon Sep 17 00:00:00 2001 From: Phil Campeau Date: Thu, 17 Apr 2025 10:21:27 -0400 Subject: [PATCH 1/3] [1880] adds log message when corp can't buy train after SR --- lib/engine/game/g_1880/step/buy_train.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/engine/game/g_1880/step/buy_train.rb b/lib/engine/game/g_1880/step/buy_train.rb index 00cf5d9819..c30a851612 100644 --- a/lib/engine/game/g_1880/step/buy_train.rb +++ b/lib/engine/game/g_1880/step/buy_train.rb @@ -33,6 +33,10 @@ def try_take_player_loan(entity, cost) def log_skip(entity) return if entity.minor? + return @log << "#{entity.name} is at train limit and cannot buy a train" if !room?(entity) && + @game.saved_or_round&.round_num == @round.round_num + return @log << "#{entity.name} cannot afford a train" if !can_buy_train?(entity) && + @game.saved_or_round&.round_num == @round.round_num super end From a38dcdbafaa3c8401db67c0aa4f6d885b4ff6cd5 Mon Sep 17 00:00:00 2001 From: Phil Campeau Date: Thu, 17 Apr 2025 10:33:23 -0400 Subject: [PATCH 2/3] update --- lib/engine/game/g_1880/step/buy_train.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/engine/game/g_1880/step/buy_train.rb b/lib/engine/game/g_1880/step/buy_train.rb index c30a851612..9863ab50ee 100644 --- a/lib/engine/game/g_1880/step/buy_train.rb +++ b/lib/engine/game/g_1880/step/buy_train.rb @@ -33,10 +33,8 @@ def try_take_player_loan(entity, cost) def log_skip(entity) return if entity.minor? - return @log << "#{entity.name} is at train limit and cannot buy a train" if !room?(entity) && - @game.saved_or_round&.round_num == @round.round_num - return @log << "#{entity.name} cannot afford a train" if !can_buy_train?(entity) && - @game.saved_or_round&.round_num == @round.round_num + return @log << "#{entity.name} is at train limit and cannot buy a train" unless room?(entity) + return @log << "#{entity.name} cannot afford a train" unless can_buy_train?(entity) super end From d1a309e922d2456f9aa268ca8c5918d0d71d3670 Mon Sep 17 00:00:00 2001 From: Phil Campeau Date: Mon, 21 Apr 2025 16:13:44 -0400 Subject: [PATCH 3/3] update to add log_pass message --- lib/engine/game/g_1880/step/buy_train.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/engine/game/g_1880/step/buy_train.rb b/lib/engine/game/g_1880/step/buy_train.rb index 9863ab50ee..e4890c542f 100644 --- a/lib/engine/game/g_1880/step/buy_train.rb +++ b/lib/engine/game/g_1880/step/buy_train.rb @@ -33,12 +33,25 @@ def try_take_player_loan(entity, cost) def log_skip(entity) return if entity.minor? + return @log << "#{entity.name} is at train limit and cannot buy a train" unless room?(entity) return @log << "#{entity.name} cannot afford a train" unless can_buy_train?(entity) super end + def log_pass(entity) + # this captures the ID of the current train available for purchase from the depot + train_id = @game.depot.depot_trains.first.id + + # these log messages are returned when a corp comes out of the stock round unable to buy a train after having bought + # the last train of the previous rank + return @log << "#{entity.name} is at train limit and cannot buy a train" if !room?(entity) && train_id.end_with?('-0') + return @log << "#{entity.name} cannot afford a train" if !can_buy_train?(entity) && train_id.end_with?('-0') + + super + end + def round_state super.merge( { bought_trains: false }