Mark-Lauman / DominionPicker

An Android companion app for Rio Grande Games' Dominion
MIT License
12 stars 14 forks source link

Ft drafter #56

Closed bxantus closed 7 years ago

bxantus commented 7 years ago

I added a new way to randomly pick cards, which I call drafter. Maybe it isn't the best name for it (I'm not a native English speaker). It's like a controlled random pick.

It works like this (when number of choices is 3):

  1. 30 kingdom cards are randomly generated (mostly by the same algorithm as picker works)
  2. the user is presented turn by turn with 3 cards, and he is able to choose one of them
  3. step 2 is repeated until the conditions for a valid game setup are met (like 10 kingdom cards are selected)
  4. the pick results are shown (the same way as the picker)

There are some tweaks, like the support for event and landmark cards, so in reality 34 cards are picked, instead the 30 described above (30 for the 10 kingdom cards, 2*3=6 for the event cards, but if most two events are selected, 28 kingdom cards are enough for the rest of the picks). Selecting bane cards (when YW is selected) works differently: a new pick is made at the end for 3 kingdom cards, which could be used as banes. The user is presented with an extra pick ("Pick a bane") with the 3 candidates. Other options include:

I wanted to reuse as much from your original code as possible, that's why SupplyShuffler is affected so much by the changes (for details see the commits).

I tried to handle all kinds of errors, and have tested it as much as I could on my phone. Despite my efforts, there could be some errors in the code. That's one reason why I left the code on the feature branch: you can tweak/fix it before integrating into master.

I made some sacrifices (alias hacks), so I can move along with greater speed:

You can fix them, if you want, or if you write me the details how to localize, and what icon to choose I'm happy to add them.

Hope you like the "drafter". We are using it constantly with our gaming group, and we like it so far very much (try it with number of picks set to 2). It feels like you are getting better sets, but still with a good variety.