-
Notifications
You must be signed in to change notification settings - Fork 186
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
[1858Switzerland] Robot variant for two-players #11297
Open
ollybh
wants to merge
11
commits into
tobymao:master
Choose a base branch
from
ollybh:1858switzerland-robot
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adds a 1858 Switzerland variant, where there is a robot player and the SBB national railway added to the two-player game. The robot player acquires the most expensive available private railway company on its stock turns. It is always last in priority order. The robot-owned private railway companies must lay track in their home hexes in the operating turns. The players alternate choosing which tiles to lay, with the priority holder choosing for the first company. The SBB starts operating once the first train has been bought. It will upgrade one of the cities where it has a token (tile chosen by the priority holder in the first operating round of a set, and the other player in the second), and will acquire a train in the second operating round of a set. It does not run its trains.
In the robot variant the starting cash and the certificate limit are the same as in a normal three-player game of 1858 Switzerland.
The `home_route_complete?` is called from the track step, so needs to have public visibility.
The code for handling which players act for entities owned by the robot was not working. This has been rewritten to override `acting_for_player` instead of `acting_for_entity`.
Companies with more trains than the train limit were not being forced to discard trains.
This guard clause wasn't necessary anyway.
ollybh
added
new games
Issues relating to games that are not yet alpha test level
1858Switzerland
labels
Oct 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implementation Notes
Explanation of Change
This adds code for the robot variant for 1858 Switzerland. This variant is for two players only, it adds a robot third player.
Rules for this variant are here: https://github.com/tobymao/18xx/wiki/1858-Switzerland#robot-two-players-only.
Some of the robot's actions can be automatically done: buying the most expensive private railway in stock rounds, and the SBB purchasing a train at the end of a pair of operating rounds. These are both implemented with auto-actions.
The track-laying actions require a player to choose which tile to place.
Before clicking "Create"
master
Add thepins
orarchive_alpha_games
label if this change will break existing gamesdocker compose exec rack rubocop -a
docker compose exec rack rake