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

[18ESP] implement minor rule changes #11165

Merged
merged 5 commits into from
Aug 31, 2024
Merged
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
22 changes: 5 additions & 17 deletions lib/engine/game/g_18_esp/corporation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Game
module G18ESP
class Corporation < Engine::Corporation
attr_reader :destination, :goals_reached_counter
attr_accessor :destination_connected, :ran_offboard, :ran_harbor_mine, :taken_over_minor, :moved_token, :full_cap
attr_accessor :destination_connected, :ran_offboard, :ran_harbor, :moved_token, :full_cap
bentziaxl marked this conversation as resolved.
Show resolved Hide resolved

def initialize(game, sym:, name:, **opts)
@game = game
Expand All @@ -29,16 +29,11 @@ def ran_offboard?
@ran_offboard
end

def ran_harbor_mine?
@ran_harbor_mine
end

def goal_reached!(type)
old_reached_counter = @goals_reached_counter
destination_goal_reached! if type == :destination
offboard_goal_reached! if type == :offboard
ran_harbor_mine_reached! if type == :harbor_mine
minor_takeover_reached! if type == :takeover
ran_harbor_reached! if type == :harbor

return if old_reached_counter == @goals_reached_counter

Expand Down Expand Up @@ -68,17 +63,10 @@ def offboard_goal_reached!
@goals_reached_counter += 1
end

def ran_harbor_mine_reached!
return if @ran_harbor_mine

@ran_harbor_mine = true
@goals_reached_counter += 1
end

def minor_takeover_reached!
return if @taken_over_minor || @game.north_corp?(self) || @full_cap
def ran_harbor_reached!
return if @ran_harbor

@taken_over_minor = true
@ran_harbor = true
@goals_reached_counter += 1
end

Expand Down
42 changes: 21 additions & 21 deletions lib/engine/game/g_18_esp/entities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,30 @@ module Entities
},
{
sym: 'P4',
name: 'Alar del Rey - Santander',
value: 100,
revenue: 20,
min_price: 1,
desc: 'The major owning company (both North and '\
'South) can build the mountain pass of Alar del '\
'Rey for free, or any other mountain pass with '\
'a discount of pts40. This action closes this company.',
abilities: [{
type: 'choose_ability',
owner_type: 'corporation',
when: 'track',
choices: { close: 'Close P5' },
}],

},
{
sym: 'P5',
name: 'La Maquinista',
value: 130,
revenue: 10,
min_price: 1,
desc: "Provides five tender cards. The owner of this company (only player) can \
sell up to four of these five tenders (to any company). Each tender costs pts80 \
desc: "Provides six tender cards. The owner of this company (only player) can \
sell up to five of these six tenders (to any company). Each tender costs pts80 \
(20 goes to the owner and 60 to the bank). The fifth tender remains with the company\
until it is bought by a major or minor company. Then the fifth tender belongs to the\
company that bought this private. The director of the company that buys this private\
Expand All @@ -87,24 +105,6 @@ module Entities
],
color: nil,
},
{
sym: 'P5',
name: 'Alar del Rey - Santander',
value: 100,
revenue: 20,
min_price: 1,
desc: 'The major owning company (both North and '\
'South) can build the mountain pass of Alar del '\
'Rey for free, or any other mountain pass with '\
'a discount of pts40. This action closes this company.',
abilities: [{
type: 'choose_ability',
owner_type: 'corporation',
when: 'track',
choices: { close: 'Close P5' },
}],

},
{
sym: 'P6',
name: 'Zafra - Huelva',
Expand All @@ -126,7 +126,7 @@ module Entities
{
sym: 'P7',
name: 'Ferrocarril de Carreño',
value: 190,
value: 170,
revenue: 30,
desc: 'President share of one Northern major company (randomly selected before the game starts).'\
'It closes when the major company buys its first train.',
Expand Down
Loading
Loading