; *** Tripunch Chess ; *** Game of Ralph Betza, ZRF by Peter Aronson, based on Zillions Chess ZRF 1.2 ; v.1.0 Initial Coding ; You need to purchase Zillions of Games to load this rules file ; Visit the Zillions web site at http://www.zillions-of-games.com (define leap1 ($1 (verify not-friend?) add)) (define leap2 ($1 $2 (verify not-friend?) add)) (define king-shift ( $1 (verify not-friend?) (set-attribute never-moved? false) add )) (define leap2-slide ($1 $2 (while empty? add $1 $2) (verify not-friend?) add)) (define slide ($1 (while empty? add $1) (verify not-friend?) add)) (define rook-slide ( $1 (while empty? (set-attribute never-moved? false) add $1) (verify not-friend?) (set-attribute never-moved? false) add )) (define O-O ( (verify never-moved?) e ; KB1 (verify empty?) e ; KN1 (verify empty?) cascade e ; KR1 (verify (and friend? (piece? Reaper) never-moved?) ) from back ; K1 ; Save expensive not-attacked?s for last (verify not-attacked?) e ; KB1 (verify not-attacked?) to (set-attribute never-moved? false) ; We could check if KN1 is attacked too, but this isn't ; really necessary since Zillions doesn't allow any moves ; into check e ; KN1 (set-attribute never-moved? false) add ) ) (define O-O-O ( (verify never-moved?) w ; Q1 (verify empty?) w ; QB1 (verify empty?) cascade w ; QN1 (verify empty?) w ; QR1 (verify (and friend? (piece? Reaper) never-moved?) ) from back ; K1 ; Save expensive not-attacked?s for last (verify not-attacked?) w ; Q1 (verify not-attacked?) to (set-attribute never-moved? false) ; We could check if KN1 is attacked too, but this isn't ; really necessary since Zillions doesn't allow any moves ; into check w ; QB1 (set-attribute never-moved? false) add ) ) (define Pawn-add (if (in-zone? promotion-zone) (add Nightrider Harvester Reaper Combine) else add ) ) (define Pawn-move ( n (verify empty?) (Pawn-add) (verify (in-zone? third-rank)) n (verify empty?) add ) ) (define Pawn-capture ( $1 (verify enemy?) (Pawn-add) ) ) (define En-Passant ( $1 (verify enemy?) (verify last-to?) (verify (piece? Pawn)) capture n to n (verify last-from?) add ) ) ;; Special Rhino movement macros (define add-once (if (not-position-flag? added-here?) add (set-position-flag added-here? true) ) ) ; Adds single direction slides to a Rhino-type movement block. This macro ; isn't in its own movement block as all movements for a Rhino piece are a ; single movement block so that multiple moves aren't generated. ; $1 = Direction of movement (define monster-slide (go from) (if (on-board? $1) (set-flag break? false) $1 (while (and empty? (not-flag? break?)) (set-attribute never-moved? false) (add-once) (if (on-board? $1) $1 else (set-flag break? true) ) ) (if not-friend? (set-attribute never-moved? false) (add-once) ) ) ) ; Moves a Gryphon, which is one square diagonally, then as a Rook outward. ; Doesn't have a surrounding block -- all Gryphon moves go in one block. ; $1 = Diagonal direction of movement ; $2 = Orthogonal direction of movement (define gryphon-slide (go from) (if (on-board? $1) (set-flag break? false) $1 (while (and empty? (not-flag? break?)) (set-attribute never-moved? false) (add-once) (if (on-board? $2) $2 else (set-flag break? true) ) ) (if not-friend? (set-attribute never-moved? false) (add-once) ) ) ) (define Board-Definitions (image "images\Chess\Chess8x8.bmp") (grid (start-rectangle 5 5 53 53) (dimensions ("a/b/c/d/e/f/g/h" (49 0)) ; files ("8/7/6/5/4/3/2/1" (0 49)) ; ranks ) (directions (n 0 -1) (e 1 0) (s 0 1) (w -1 0) (ne 1 -1) (nw -1 -1) (se 1 1) (sw -1 1) ) ) (symmetry Black (n s)(s n) (nw sw)(sw nw) (ne se)(se ne)) (zone (name promotion-zone) (players White) (positions a8 b8 c8 d8 e8 f8 g8 h8) ) (zone (name promotion-zone) (players Black) (positions a1 b1 c1 d1 e1 f1 g1 h1) ) (zone (name third-rank) (players White) (positions a3 b3 c3 d3 e3 f3 g3 h3) ) (zone (name third-rank) (players Black) (positions a6 b6 c6 d6 e6 f6 g6 h6) ) ) (game (title "Tripunch Chess") (description "Object: Checkmate the opponent's King by attacking it so it cannot escape. This game differs from the usual Chess in that Knights are replaced by by Knightriders, Bishops by Harvesters (Bishop + Aanca), Rooks by Reapers (Rook + Gryphon) and Queens by Combines (Harvester + Reaper). \\ To see a description of how a piece moves right-click on it to bring up its properties dialog.") (history "ZRF by Peter Aronson, game by Ralph Betza. \\ ZRF Revision 1.0, March 1st, 2002.") (strategy "") (win-sound "Audio\Orchestra_CF.wav") (loss-sound "Audio\Orchestra_FC.wav") (click-sound "Audio\Pickup.wav") (release-sound "Audio\WoodThunk.wav") (players White Black) (turn-order White Black) (pass-turn false) (loss-condition (White Black) (checkmated King)) (board (Board-Definitions)) (board-setup (White (Pawn a2 b2 c2 d2 e2 f2 g2 h2) (Nightrider b1 g1) (Harvester c1 f1) (Reaper a1 h1) (Combine d1) (King e1) ) (Black (Pawn a7 b7 c7 d7 e7 f7 g7 h7) (Nightrider b8 g8) (Harvester c8 f8) (Reaper a8 h8) (Combine d8) (King e8) ) ) (piece (name Pawn) (help "Pawn: moves forward, captures diagonally, can promote on 8th row") (description "Pawn\A Pawn can move straight ahead one square, or two squares from its starting position. A Pawn captures by moving one square ahead and diagonally. If a Pawn reaches the far rank it promotes, changing into a Nightrider, Harvester, Reaper, or Combine. On rare occasions Pawns can also execute a move called `En Passant`, or `in passing`. This allows a Pawn to take an enemy Pawn that has just moved two squares.") (image White "images\Chess\wpawn.bmp" Black "images\Chess\bpawn.bmp") (moves (Pawn-capture nw) (Pawn-capture ne) (Pawn-move) (En-Passant e) (En-Passant w) ) ) (piece (name Nightrider) (help "Nightrider: makes successive leaps like a Knight in the same direction") (description "Nightrider\A Nightrider makes successive leaps like a Knight in the same direction, passing over by not through other pieces.") (image White "images\Chess\wknight.bmp" Black "images\Chess\bknight.bmp") (moves (leap2-slide n ne) (leap2-slide n nw) (leap2-slide s se) (leap2-slide s sw) (leap2-slide e ne) (leap2-slide e se) (leap2-slide w nw) (leap2-slide w sw) ) ) (piece (name Harvester) (help "Harvester: slides diagonally any number of squares, or makes a side step then slides diagonally") (description "Harvester\A Harvester moves any number of squares on a diagonal, or, makes a single orthogonal step, then slides outward on the diagonal. It may not leap over other pieces.") (image White "images\Chess\wbishop.bmp" Black "images\Chess\bbishop.bmp") (attribute never-moved? false) (moves (slide ne) (slide nw) (slide se) (slide sw) ( (gryphon-slide n ne) (gryphon-slide n nw) (gryphon-slide s se) (gryphon-slide s sw) (gryphon-slide e ne) (gryphon-slide e se) (gryphon-slide w nw) (gryphon-slide w sw) ) ) ) (piece (name Reaper) (help "Reaper: slides orthogonally any number of squares, or makes a diagonal step then slides orthogonally") (description "Reaper\A Reaper moves any number of squares orthogonally, or, makes a single diagonal step, then slides outwards orthogonally. It may not leap over other pieces.") (image White "images\Chess\wrook.bmp" Black "images\Chess\brook.bmp") (attribute never-moved? false) (moves (rook-slide n) (rook-slide e) (rook-slide s) (rook-slide w) ( (gryphon-slide ne n) (gryphon-slide ne e) (gryphon-slide nw n) (gryphon-slide nw w) (gryphon-slide se s) (gryphon-slide se e) (gryphon-slide sw s) (gryphon-slide sw w) ) ) ) (piece (name Combine) (help "Combine: can slide any number of squares in any direction, or can take a step, then slide") (description "Combine\A Combine moves any number of squares in a straight line. It may take a step, then slide along any straight line. It may not leap over other pieces.") (image White "images\Chess\wqueen.bmp" Black "images\Chess\bqueen.bmp") (attribute never-moved? false) (moves ( (monster-slide n) (monster-slide e) (monster-slide s) (monster-slide w) (monster-slide ne) (monster-slide nw) (monster-slide se) (monster-slide sw) (gryphon-slide n ne) (gryphon-slide n nw) (gryphon-slide s se) (gryphon-slide s sw) (gryphon-slide e ne) (gryphon-slide e se) (gryphon-slide w nw) (gryphon-slide w sw) (gryphon-slide ne n) (gryphon-slide ne e) (gryphon-slide nw n) (gryphon-slide nw w) (gryphon-slide se s) (gryphon-slide se e) (gryphon-slide sw s) (gryphon-slide sw w) ) ) ) (piece (name King) (help "King: steps 1 square in any direction to a safe square") (description "King\A King can move to any adjacent square, but never to a square where it can be captured. It may also `castle` with the Rook if neither the Rook nor King has moved yet and there is nothing in between them. In castling the King moves two squares nearer the Rook and the Rook leaps to the far side of the King. You may not castle out of or through check, or if the King or Rook involved has previously moved.") (image White "images\Chess\wking.bmp" Black "images\Chess\bking.bmp") (attribute never-moved? true) (moves (king-shift n) (king-shift e) (king-shift s) (king-shift w) (king-shift ne) (king-shift nw) (king-shift se) (king-shift sw) (O-O) (O-O-O) ) ) )