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

[18Scan] Implementation pt.2 #7210

Merged
merged 24 commits into from
Feb 19, 2022
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
281c6b8
18Scan: fix minor home tokens location
vandamm Jan 18, 2022
40e5643
18Scan: support buying trains and getting subsidy by minors
vandamm Jan 19, 2022
d988602
18Scan: support dynamic float percent and switch to full cap
vandamm Jan 19, 2022
ebf499b
18Scan: minor adjustments to game constants
vandamm Jan 24, 2022
d90225c
18Scan: fix minor subsidies
vandamm Jan 24, 2022
625dbc2
18Scan: fix floating DSB in ISR
vandamm Jan 24, 2022
7c222b1
18Scan: determine float percentage correctly
vandamm Jan 26, 2022
1ac11f4
18Scan: minor prettifying
vandamm Jan 26, 2022
2ef5018
18Scan: support 2-player optional rule
vandamm Jan 26, 2022
cb217eb
18Scan: fix train buying requirement
vandamm Jan 27, 2022
7613bc6
18Scan: put events to correct places
vandamm Jan 28, 2022
645e82e
18Scan: fix implementation of SJ merger
vandamm Jan 28, 2022
a31ff12
18Scan: fix map hexes issues
vandamm Jan 28, 2022
0b0259c
18Scan: reorder game class methods for readability
vandamm Jan 28, 2022
65433b7
18Scan: add bonus revenue for company tokens
vandamm Jan 28, 2022
0ec254d
18Scan: allow unusual tile upgrades
vandamm Jan 31, 2022
32aa95d
18Scan: show minors in spreadsheet
vandamm Feb 7, 2022
6e9d955
18Scan: Display all train limits in game info
vandamm Feb 8, 2022
6c1cefc
18Scan: fix selling configuration
vandamm Feb 16, 2022
857a461
18Scan: limit running to non-tokened offboards
vandamm Feb 16, 2022
9e057af
Move step to buy one train of type per OR to game core
vandamm Feb 16, 2022
d27929d
18Scan: fix upgrading yellow Y tiles
vandamm Feb 16, 2022
467b910
18Scan: fix code review remarks
vandamm Feb 18, 2022
9707408
18Scan: move dynamic float percentage configuration to events
vandamm Feb 18, 2022
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
2 changes: 1 addition & 1 deletion lib/engine/game/g_1836_jr30/game.rb
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ def operating_round(round_num)
Engine::Step::Route,
Engine::Step::Dividend,
Engine::Step::DiscardTrain,
G1836Jr30::Step::BuyTrain,
Engine::Step::BuySingleTrainOfType,
[Engine::Step::BuyCompany, { blocks: true }],
], round_num: round_num)
end
Expand Down
34 changes: 0 additions & 34 deletions lib/engine/game/g_1836_jr30/step/buy_train.rb

This file was deleted.

18 changes: 16 additions & 2 deletions lib/engine/game/g_18_scan/corporation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,22 @@ module Engine
module Game
module G18Scan
class Corporation < Engine::Corporation
def floatable?
super && @game.sj && @game.phase.status.include?('sj_unavailable')
def initialize(game, sym:, name:, **opts)
vandamm marked this conversation as resolved.
Show resolved Hide resolved
@game = game

super(sym: sym, name: name, **opts)
end

def floated?
return false unless @floatable

@floated ||= @ipo_owner.percent_of(self) <= 100 - @game.float_percent
end

def percent_to_float
return 0 if @floated

@ipo_owner.percent_of(self) - (100 - @game.float_percent)
end
end
end
Expand Down
42 changes: 25 additions & 17 deletions lib/engine/game/g_18_scan/entities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ module Entities
abilities: [
{ type: 'no_buy' },
{ type: 'shares', shares: 'VR_1' },
# TODO: Two +20 bonus tokens for ferry
# TODO: Ferry token svg
{
type: 'assign_corporation',
when: 'owning_player_token',
count: 2,
owner_type: 'player',
},
],
color: nil,
},
Expand All @@ -36,7 +42,13 @@ module Entities
abilities: [
{ type: 'no_buy' },
{ type: 'shares', shares: 'S&NJ_1' },
# TODO: +50 bonus token for Kiruna
# TODO: Ore mine token svg
{
type: 'assign_corporation',
when: 'owning_player_token',
count: 1,
owner_type: 'player',
},
],
color: nil,
},
Expand All @@ -57,7 +69,7 @@ module Entities
type: 'tile_lay',
hexes: %w[F3],
tiles: %w[403 121 584],
when: 'track',
when: 'owning_player_track',
owner_type: 'player',
count: 1,
consume_tile_lay: true,
Expand Down Expand Up @@ -111,6 +123,7 @@ module Entities
name: 'Södra Stambanan',
logo: '18_scan/1',
simple_logo: '18_scan/1.alt',
type: 'minor',
tokens: [0, 40],
coordinates: 'G4',
destination_coordinates: 'B11',
Expand All @@ -134,9 +147,10 @@ module Entities
name: 'Nordvärsta Stambanan',
logo: '18_scan/2',
simple_logo: '18_scan/2.alt',
type: 'minor',
tokens: [0, 40],
coordinates: 'F11',
city: 0,
city: 1,
destination_coordinates: 'B11',
color: '#5b74b4',
abilities: [
Expand All @@ -158,9 +172,10 @@ module Entities
name: 'Västra Stambanan',
logo: '18_scan/3',
simple_logo: '18_scan/3.alt',
type: 'minor',
tokens: [0, 40],
coordinates: 'F11',
city: 1,
city: 0,
destination_coordinates: 'D7',
color: '#5b74b4',
abilities: [
Expand All @@ -183,6 +198,7 @@ module Entities
{
sym: 'DSB',
name: 'Danske Statsbaner',
type: 'major',
logo: '18_scan/DSB',
simple_logo: '18_scan/DSB.alt',
float_percent: 20,
Expand All @@ -194,6 +210,7 @@ module Entities
{
sym: 'S&NJ',
name: 'Sveriges & Norges Järnvägar',
type: 'major',
logo: '18_scan/SNJ',
simple_logo: '18_scan/SNJ.alt',
float_percent: 20,
Expand All @@ -205,6 +222,7 @@ module Entities
{
sym: 'NSB',
name: 'Norges Statsbaner',
type: 'major',
logo: '18_scan/NSB',
simple_logo: '18_scan/NSB.alt',
float_percent: 20,
Expand All @@ -216,6 +234,7 @@ module Entities
{
sym: 'VR',
name: 'Valtionraurariet',
type: 'major',
logo: '18_scan/VR',
simple_logo: '18_scan/VR.alt',
float_percent: 20,
Expand All @@ -229,22 +248,11 @@ module Entities
name: 'Statens Järnvägar',
logo: '18_scan/SJ',
simple_logo: '18_scan/SJ.alt',
type: 'national',
float_percent: 50,
floatable: false,
tokens: [0, 100, 100, 100, 100, 100],
coordinates: 'F3',
color: '#3561AE',
abilities: [
{
type: 'train_limit',
description: '+1 train limit',
increase: 1,
},
{
type: 'no_buy',
description: 'Cannot float before phase 5',
},
],
},
].freeze
end
Expand Down
Loading