Series, #repeat, Rotors, and #count: How They Work Together
Varied Copies
Multideck provides four ways that, in combination, allow you to:- Make identical copies from a single row of source
- Make varied copies from a single row of source
- Make identical and varied copies from a single row of source
The rest of this section explains how these four features interact.
On This Page
Order of ProcessingSeries Expansion
#repeat Expansion
Rotor Variation
#count Expansion
Some Examples
Order of Processing
If you ever combine the use of one or more series, one or more rotors, and/or the #count and #repeat features on a single row of source, it's important to understand not only what they do, but when they do it.The processing order is:
- Series expansion
- #repeat expansion
- Rotor variation
- #count expansion
All four of these steps are applied (when applicable) to each input row from the original source before processing the next original row. The steps are performed in the order shown above.
Most of these steps can result in expansion, which is the replacement of a single row with multiple rows. If a step results in expansion, the subsequent step is applied to each of the expanded rows. If not, the subsequent step is applied to the unexpanded row.
When the process is complete, the result is either the original row (if none of the steps were applicable) or a number of expanded rows, each of which now represents a single card.
Each of these steps is explained in detail below.
Series Expansion
The first thing that happens is Series expansion. Multideck will examine each row of source and identify all of the series in that row. If no series are found in the row, this step is skipped.For each series found in the row, Multideck will expand the row into as many rows as there are elements in the series, and in each expanded row it will replace the series value with the corresponding element's value.
If there is more than one series on the original source row, this step is then repeated for each of the expanded rows. Each series is expanded, in left-to-right order as they appear in the original source row. For example, if there are two series in a row, and the first has four elements while the second has three: First the four-element series is expanded, replacing the original source row with four expanded rows. Then the second, three-element series is expanded in each of those four rows. Since each of those rows is then expanded into (and replaced by) three new rows, the total number of expanded rows is 4 * 3 = 12 rows.
#repeat Expansion
After the series expansion comes the #repeat expansion. This is performed only if the source contains a column named "#repeat", whose value on the row is a non-negative integer. Otherwise, this step is skipped.Each affected row is duplicated, creating a total number of duplicate rows equal to the value in the #repeat field. (That is, if the #repeat value is 3, the result is 3 identical rows, not 3 copies plus the original.)
As a special case, if the #repeat value is zero the row is removed altogether, and no further processing is done. You can set the #repeat value to zero in your source to prevent that row from producing any cards—for example, if you are experimenting with removing that row's cards from your game, but you want the option of easily restoring them again later.
Rotor Variation
Now each affected row is examined for rotors. If no rotors are found, this step is skipped.Rotors do not expand rows, and they create no new rows. Instead, the rotor field's value is replaced in each card with the corresponding element from the rotor.
If there are multiple rotors, each one is applied in left-to-right order as they appear in the original source.
Important: Since rotor processing happens after #repeat expansion, the copies created by #repeat expansion are no longer guaranteed to be identical.
#count Expansion
Finally, #count expansion is performed. This is identical to the #repeat expansion explained above, except for two things: the relevant column is named "#count", and the expansion is performed after all other processing. This means that copies created by #count are truly identical.Some Examples
A Simple Example
Here is a sample input row, containing a #repeat column and one rotor:
Effect | Goods | #repeat |
---|---|---|
Gain one {..Goods}. | ^|Wheat|Brick|Stone| | 5 |
The above would produce these five cards:
Effect | Goods |
---|---|
Gain one {..Goods}. | Wheat |
Gain one {..Goods}. | Brick |
Gain one {..Goods}. | Stone |
Gain one {..Goods}. | Wheat |
Gain one {..Goods}. | Brick |
In the above example, if the #repeat column were instead labeled "#count", the rotor would be useless because no expansion would occur before the rotor is processed. Instead, you would get five identical cards:
Effect | Goods |
---|---|
Gain one {..Goods}. | Wheat |
Gain one {..Goods}. | Wheat |
Gain one {..Goods}. | Wheat |
Gain one {..Goods}. | Wheat |
Gain one {..Goods}. | Wheat |
A Fancy Example
Here is a complex example, using all four steps:
Effect | Goods | Bonus | #repeat | #count |
---|---|---|---|---|
Gain one {..Goods} and take {..Bonus} VPs. | |Wheat|Brick|Stone| | ^|2|3| | 5 | 2 |
Let's take this example through all four steps, one at a time, and examining the expanded list of cards after each step.
First, the series in the Goods column is expanded, giving us three rows. We've highlighted the Goods column, where the differences in the three rows are:
Effect | Goods | Bonus | #repeat | #count |
---|---|---|---|---|
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | ^|2|3| | 5 | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | ^|2|3| | 5 | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | ^|2|3| | 5 | 2 |
Next, the #repeat column is processed, making 5 copies of each row for a total of 15 rows. At this point, the copies are all identical. (Here, we've removed the #repeat column because we're done with it, and we've highlighted the copies that were made.)
Effect | Goods | Bonus | #count |
---|---|---|---|
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | ^|2|3| | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | ^|2|3| | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | ^|2|3| | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | ^|2|3| | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | ^|2|3| | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | ^|2|3| | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | ^|2|3| | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | ^|2|3| | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | ^|2|3| | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | ^|2|3| | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | ^|2|3| | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | ^|2|3| | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | ^|2|3| | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | ^|2|3| | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | ^|2|3| | 2 |
Now the rotor in the Bonus column is applied. It doesn't add any new rows, but it varies the rows that have already been produced:
Effect | Goods | Bonus | #count |
---|---|---|---|
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | 2 | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | 3 | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | 2 | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | 3 | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | 2 | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | 3 | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | 2 | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | 3 | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | 2 | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | 3 | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | 2 | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | 3 | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | 2 | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | 3 | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | 2 | 2 |
Finally the #count column is applied, making two identical copies of each card. The result is 30 cards, in which every other card is a copy of the previous card:
Effect | Goods | Bonus |
---|---|---|
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | 3 |
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | 3 |
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | 3 |
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | 3 |
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Wheat | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | 3 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | 3 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | 3 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | 3 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | 3 |
Gain one {..Goods} and take {..Bonus} VPs. | Brick | 3 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | 3 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | 3 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | 3 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | 3 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | 2 |
Gain one {..Goods} and take {..Bonus} VPs. | Stone | 2 |