I’m working on a game where activation is determined by pulling a marker from a cup. I have a fancy button that takes care of that. When a marker is pulled, all of the flags on the associated counters (moved/fired/etc) are reset. This works great except there is a rule that says you cannot activate 3 times in a row. It’s easy enough to throw the counter back in the cup, but the units were all reset the instant it was drawn. Is there some way to keep track of a specific faction chit count such that if it is 3 or higher, ignore it??
What if, after you pulled a chit the second time, that you put that chit somewhere different than in the cup? Then, one another chit is pulled, you put back the first chit in the cup.
Also, perhaps you can also be a bit more specific about the mechanism.
- When chit A is pulled, then associated units a1, a2, a3. … are activated.
- Should their associated state always be cleared?, or only if another chit - say B - was pulled immediatly before chit A
- Chit A is put back in the cup
- Chit A is pulled again.
- Should the state of a1, *a2, …, all be cleared, or should their state persist?
- If the last chit pulled is registered in a global property, then clearing the state could be contingent on the current chit not being the same as the previous chit.
- Should the state of a1, *a2, …, all be cleared, or should their state persist?
- Chit A is put in a side cup
- The last chit pulled is the same as the current chit, and some “send back” command puts the chit in the side cup rather than the default cup.
- Chit B is pulled
- Chit A is put back in the cup
- Chit A is pulled again.
Yours,
Christian
The challenge is that each faction has 3+ chits in the cup. The first two of the same you pull are fine, but drawing the third is problematic. The rules are that if you draw a 3rd, put it back in the cup and redraw until you draw one of the other faction chits. The first two chits stay out of the cup until the end of the turn.
OK, so each faction, say A and B, has a number of chits, say A1, A2, A3, …, and B1, B2, B3*, …
Hypothetically, if you have, the sequence A1 and then A2, then all AX chits are prohibited.
So consider the probabailities:
- If A has N chits in the cup, and B has M chits in the cup, then there’s an N/(N+M) probability of drawing and A chit, and M/(N+M) of a B chit.
- However, if 2 A chits where previously drawn, then there’s 0/(N+M) probability of drawing an A chit, and M/M=1 probability of drawing a B chit.
- In other words, if the various BX chits are indistinguishable (in effects), then after drawing two A chits, one can automatically select a B chit afterward. After that selection, you are back to the “normal” situation.
In any case, using a regular Deck may not be the solution to your problem. Instead, you probably need to implement the logic through BeanShell, Global Properties, Global Key Command and perhaps also a hidden piece with various traits. You most likely need some Global Properties to keep track of the previous and the second to last activation chit. If those two Global Properties are the same, then the corresponding faction is disqualified on the next draw. You probably want to use the BeanShell function Random (see Expressions) to draw a random number. For example,
- You have two Decks - one for faction A - called
A, and one for faction B calledB - You have the two Global Properties
lastPickandsecondLastPick, andcurrentPick
When drawing the next activation chit,
- In a normal draw (
lastPick != secondLastPick), you pick a random numberpick, between 1 and{A_numPieces+B_numPieces}- If
pickis equal to or smaller thanA_numPieces, then setcurrentPick=A, otherwisecurrentPick=B
- If
- Otherwise, if the properties
lastPick=secondLastPick- if
lastPick==A, then setcurrentPick=B - otherwise set
currentPick=A.
- if
- Draw a chit from the deck
currentPick - Set
secondLastPick=lastPick, andlastPick=currentPick - If, at any point,
A_numPieces=0andlastPick==secondLastPick==B, orB_numPieces=0andlastPick==secondLastPick==A, then end the turn and put the chits back in their decks.
Perhaps that will work.
Yours,
Christian
Where do the chits go once drawn? Consider having 3 stacks. Chit movement is from deck → stack1 → stack2 → stack3, where stack1 is last drawn, stack2 is penultimate chit and stack3 collects all chits. Stack1 and 2 only ever hold one chit. The action is draw a chit, compare with stack1 and 2, if all equal return to deck otherwise shift chits towards stack3 with the drawn chit going into stack1. Use one of the Count functions to check for equality (i.e. count == 3, all same). This will also give players a visual indication of the last two drawn chits. At end of turn, stacks 1, 2 and 3 return to deck. A fourth stack either hidden or visible holds the drawn chit. Visible might be preferred as it gives an indication that the button press actually did something. Include a short delay before returning a duplicate to the draw deck.