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

[1858Switzerland] Robot variant for two-players #11297

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

ollybh
Copy link
Collaborator

@ollybh ollybh commented Oct 21, 2024

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"

  • Branch is derived from the latest master
  • Add the pins or archive_alpha_games label if this change will break existing games
  • Code passes linter with docker compose exec rack rubocop -a
  • Tests pass cleanly with docker compose exec rack rake

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 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
1858Switzerland new games Issues relating to games that are not yet alpha test level
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant