Skip to content

Commit

Permalink
Merge pull request #10200 from roseundy/moon_prod_fixes
Browse files Browse the repository at this point in the history
21Moon: fix UN contract; X2,X3 upgrades; add fixture; no longer prototype
  • Loading branch information
roseundy authored Jan 27, 2024
2 parents 4d0cd88 + 3106f1d commit 9ae91be
Show file tree
Hide file tree
Showing 5 changed files with 10,081 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/engine/game/g_21_moon/entities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module Entities
min_price: 1,
max_price: 45,
desc: 'When this private is bought by a company, the president of the company may choose to add or remove '\
'a 3/4/5/6 train to/from the depot. If a train is added, it must be of the '\
'a 2/3/4/5/6 train to/from the depot. If a train is added, it must be of the '\
'current phase or later. This will close the company. Can be sold to a corporation for ₡1-₡45.',
abilities: [],
color: nil,
Expand Down
8 changes: 8 additions & 0 deletions lib/engine/game/g_21_moon/game.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ class Game < Game::Base

MINERAL_HEXES = %w[A7 A9 B4 B12 D10 E15 F2 H10 I7 J2 J10 K5 K13 L10 H2 E5 G13].freeze

X_RESTRICTED_UPGRADES = {
'X2' => %w[X4 X7],
'X3' => %w[X5 X6 X7],
}.freeze

def reservation_corporations
corporations + minors
end
Expand Down Expand Up @@ -460,6 +465,9 @@ def tile_valid_for_phase?(tile, hex: nil, phase_color_cache: nil)
def upgrades_to?(from, to, special = false, selected_company: nil)
return false if to.name == T_TILE && !selected_company

# not needed for laying tiles, but keeps the tiles tab from lying to the player
return false if X_RESTRICTED_UPGRADES.key?(from.name) && !X_RESTRICTED_UPGRADES[from.name].include?(to.name)

super
end

Expand Down
2 changes: 1 addition & 1 deletion lib/engine/game/g_21_moon/meta.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Meta
include Game::Meta

DEV_STAGE = :beta
PROTOTYPE = true
PROTOTYPE = false

GAME_DESIGNER = 'Jonas Jones and Scott Petersen'
GAME_LOCATION = 'The Moon'
Expand Down
4 changes: 1 addition & 3 deletions lib/engine/game/g_21_moon/step/train_mod.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ def choices
# add in current phase train if missing
add_trains.unshift(@game.phase.name) if add_trains.first != @game.phase.name

# never 2 or 10 trains
remove_trains.delete('2')
# never 10 trains
remove_trains.delete('10')
add_trains.delete('2')
add_trains.delete('10')

choice_list = []
Expand Down
Loading

0 comments on commit 9ae91be

Please sign in to comment.