Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into 1894
Browse files Browse the repository at this point in the history
  • Loading branch information
Galatolol committed Jan 26, 2025
2 parents 3d20795 + 555adf9 commit 4694892
Show file tree
Hide file tree
Showing 31 changed files with 632 additions and 210 deletions.
5 changes: 5 additions & 0 deletions assets/app/view/game/buy_trains.rb
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@ def render
children << h(:div, issue_str)
end

if @step.can_finance?(@corporation)
text = "#{@game.bank.name} will provide financing for the amount the corporation cannot pay."
children << h(:div, text)
end

if (@must_buy_train && @step.ebuy_president_can_contribute?(@corporation)) ||
@step.president_may_contribute?(@corporation, @active_shell)
children.concat(render_president_contributions)
Expand Down
4 changes: 1 addition & 3 deletions assets/app/view/welcome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ def render

def render_notification
message = <<~MESSAGE
<p><a href="https://github.com/tobymao/18xx/wiki/18RoyalGorge">18RoyalGorge</a> is now in beta.</p>
<p><a href="https://github.com/tobymao/18xx/wiki/1858%20Switzerland">1858 Switzerland</a> is in alpha.</p>
<p><a href="https://github.com/tobymao/18xx/wiki/1837">1837</a> is now in alpha.</p>
<p>Report bugs and make feature requests <a href='https://github.com/tobymao/18xx/issues'>on GitHub</a>.</p>
MESSAGE
Expand Down
11 changes: 6 additions & 5 deletions lib/engine/game/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1274,8 +1274,12 @@ def sold_out_increase?(_corporation)
self.class::SOLD_OUT_INCREASE
end

def sold_out_stock_movement(corp)
@stock_market.move_up(corp)
def sold_out?(corporation)
corporation.player_share_holders.values.sum == 100
end

def sold_out_stock_movement(corporation)
@stock_market.move_up(corporation)
end

def log_share_price(entity, from, steps = nil, log_steps: false)
Expand Down Expand Up @@ -1663,9 +1667,6 @@ def clear_graph

def clear_graph_for_entity(entity)
graph_for_entity(entity).clear
end

def clear_token_graph_for_entity(entity)
token_graph_for_entity(entity).clear
end

Expand Down
4 changes: 2 additions & 2 deletions lib/engine/game/g_1832/step/track.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ def buy_coal_token(corporation)
log_message += "#{@game.coal_token_counter} Coal tokens left in the game"
@log << log_message
corporation.coal_token = true
@game.clear_token_graph_for_entity(corporation)
@game.clear_graph_for_entity(corporation)
end

def hex_neighbors(entity, hex)
connected = super
@game.clear_token_graph_for_entity(entity) if entity.tokens.none?(&:city)
@game.clear_graph_for_entity(entity) if entity.tokens.none?(&:city)
connected
end

Expand Down
2 changes: 1 addition & 1 deletion lib/engine/game/g_1837/entities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ module Entities
sym: 'SD2',
value: 120,
desc: "Director's certificate of the minor company Kärntner Railway (SD2). The company " \
"starts in Marburg (J16) with 90K starting capital.\n\n =Comes with the Mountain Railway " \
"starts in Marburg (J16) with 90K starting capital.\n\nComes with the Mountain Railway " \
'Karawanken Railway (J12) that has a value of 120K and a revenue of 25K.',
color: :orange,
meta: { start_packet: true },
Expand Down
Loading

0 comments on commit 4694892

Please sign in to comment.