-
Notifications
You must be signed in to change notification settings - Fork 190
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
[18Ardennes] Starting major corporations #10104
Conversation
Could you rebase your branch against the current master? The commits tab currently shows many unrelated commits for 1822Africa and 18Tokaido. |
Gah. I'm not sure what's happened here. The files changed tab only shows the new stuff that should be part of this branch but, like you say, there are lots of extra commits listed. It should just be commits 520987b onwards. Is there any easy way to do this rebase? I don't understand git rebasing much, I thought |
A simultaneous auction for the rights to start public companies in the following stock rounds. This is implemented by auctioning companies of type :concession, one for each major corporation. When a bid is made, the player must nominate one of their minors to be folded into the major. This is done by giving them several bid buttons, one for each eligible minor.
This is cleaner than abusing the Ability::Exchange.corporations list to hold this information.
Public companies are started after an auction round. The player purchases the president's share, and then exchanges the pledged minor for a third share. The new public company receives the minor's cash, trains and tokens.
If a player has won any auctions for the right to start public companies, then this must be done on the first turn in the stock round (or first turns if multiple auctions were won).
Once a player has won any auctions to start major corporations, they are obliged to do this as their first actions in the next stock round. If they cannot afford to do this (from their cash or their sellable shares) then they are bankrupt.
Remove the hardcoded definitions of the concession companies and instead programatically create one for each of the major corporations.
@michaeljb I couldn't work out how to rebase my branch, but I ended up resetting it to match origin/master and cherry-picking the relevant commits. It looks correct now. |
Explanation of Change
In 18Ardennes major companies are started by converting minors. There is an auction at the start of each stock round for the rights to start a major, with the players bidding amounts for the rights to start the major, and saying which minor will be converted. The players’ first action(s) in the stock round must be converting the minors into majors.
Implementation Notes
This is done by first having an auction round to buy (hidden) concession private companies linked to the major corporations. The majors are started in the
BuySellParSharesCompanies
step, in theprocess_par
method. Apledged_minors
hash is added to the game state, to track which minors are going to be used to start the majors.There are a couple of places where this touches the core rendering code:
When placing a bid for the right to start a major, you have to bid an amount and state which minor you will use to start the major. I've implemented this by putting multiple bid buttons next to the bid amount, one for each eligible minor. The array of minor names used to produce these buttons come from a method called

bid_choices
, inspired a similar idea inG18FL::Step::BuyCert
.It's possible (though unlikely) to bankrupt in the stock round. If you've won the right to start a major company then you must start it in the following stock round. If you're unable to raise enough cash to do this then you are bankrupt and out of the game. A button to declare bankruptcy is rendered if this has happened, with a description of what went wrong.

Before clicking "Create"
master
Add thepins
label if this change will break existing gamesdocker compose exec rack rubocop -a
docker compose exec rack rake