| Author |
Message |
William Butler (Wgbutler)
New member Username: Wgbutler
Post Number: 1 Registered: 5-2008
| | Posted on Monday, May 12, 2008 - 2:32 pm: | |
Hello all - I have the Pieces-left 0 King victory condition in my variant. I'd like to allow for the queen to become the new king in the event that the king is captured. How can I do this and still allow a move? Example: black captures white king. White promotes white queen to new white king. White then moves normally. Also, if I had two queens (say, due to pawn promotion) how could I allow white to choose which queen to promote to king? Thanks in advance for any help. |
M Winther (Kalroten)
New member Username: Kalroten
Post Number: 70 Registered: 1-2007
| | Posted on Wednesday, May 14, 2008 - 12:23 am: | |
Loss condition must be pieces-remaining 0 King 0 Queen. As long as you have a queen or king left you won't lose. But if the king is lost, the queen's promotion to king is obligatory. This is easy to achieve. When capturing a king an invisible piece outside the board is also captured (just define an extra square for each king outside the board and place an "X-piece" there at board-setup). Each time a piece makes a capture it must check whether it's a king capture and, if so, capture the enemy X-piece, too. The queen's movement block should contain a move with highest priority, namely "promotion-move". The promotion-move verifies that the friendly X-piece has been captured and then makes change-type King and add-partial "king-move" (provided that the king's move has been titled king-move). Mats |
William Butler (Wgbutler)
New member Username: Wgbutler
Post Number: 2 Registered: 5-2008
| | Posted on Wednesday, May 14, 2008 - 5:15 pm: | |
Kalroten - thanks for the response. Any idea on how to select which queen to promote to king in the event of multiple queens? |
M Winther (Kalroten)
New member Username: Kalroten
Post Number: 71 Registered: 1-2007
| | Posted on Sunday, May 18, 2008 - 8:20 am: | |
That's no problem. With the sketched solution one can choose any queen. It will be taken care of by the "promotion-move". Mats |
Malcolm James Webb (Mjw)
New member Username: Mjw
Post Number: 1 Registered: 5-2008
| | Posted on Wednesday, May 21, 2008 - 6:17 am: | |
Looking at Mats/Karlroten's answer above, it seems to me that it would operate as follows: 1) Your opponent takes the King; 2) You then find that the only move possible to you is a move of (one of) your Queen(s); 3) You click on a Queen which instantly turns to a new King; 4) The new King can then make a King-move, but none of your other pieces can move. Question: What if you want to be able to move another piece other than the new King? I can think of only two solutions, both of which are cumbersome: A: USING TURN-ORDER: At the start of the game specify (turn-order (White promotion-move) (White normal-move) (Black promotion-move) (Black normal-move)) (option "pass-turn" forced) Then when the King is captured a promotion move becomes possible, a Queen becomes a King, and then one has a second "normal-move". Otherwise the promotion move is impossible and only a normal move is made. PROBLEM: I worry that this may interfere with Zillions' move logic: will Zillions correctly act to counter the next "normal-move" by the enemy? B: Other pieces promote the Queen: (define queen-promote ($1 (verify (and friend? (piece? Queen))) from (change-type? King) back (add-partial normal-move))) Then all non-queen pieces have a series of moves under (move-type promotion-move): (queen-promote a1) (queen-promote a2) etc till defined for every piece on the board. Is there a simpler way of achieving the desired result? This would be useful for a game I am trying to develop. |
Greg Schmidt (Gschmidt2)
New member Username: Gschmidt2
Post Number: 55 Registered: 1-2007
| | Posted on Wednesday, May 21, 2008 - 8:14 pm: | |
I wonder if the following would be an effective way to accomplish your goal (haven't tried it though): Modify your capture code such that if it detects that it is capturing a king, it scans the board looking for the enemy queen. Once it finds the enemy queen it then changes its type to an enemy king. -- Greg |
M Winther (Kalroten)
New member Username: Kalroten
Post Number: 72 Registered: 1-2007
| | Posted on Thursday, May 22, 2008 - 12:17 am: | |
Yes, but that is a very costful solution. William, I didn't know that you wanted to move any piece after transforming the queen to king. In that case you simply needn't bother to use the "king-move". Then any piece can be moved after add-partial. Alternatively you can write "add-copy standard-move", provided that all pieces have the move-type standard-move. /Mats Mats |
M Winther (Kalroten)
New member Username: Kalroten
Post Number: 73 Registered: 1-2007
| | Posted on Thursday, May 22, 2008 - 3:27 am: | |
Correction. If you want to move another piece after transforming the queen, then you can do as follows. Skip add-partial, a simple (create button z1) (add King) will do. But you must force the other party to acknowledge the queen's promotion to king. A button shows up at the side of the board. The other party must press the button whereupon it disappears (change-type invisible_piece). The point is that the other party has then performed a move. Hence, the party who just promoted will move again, and he can move any piece. In order to force the other party to acknowledge the promotion one must check, at every move, whether the button exists at position z1 (e.g.). You cannot use "pass turn" forced while that would violate the rule of draw when one cannot move. I'm sceptical of your other solution, but you can always try. I think an acknowledge button is the simplest and most elegant. /Mats |