(define "SlideStep" (slide (from #1) Orthogonal (between (range 1 3) if:(is Empty (between))) (to if:("IsEnemyAt" (to)) #2) ) ) (define "Move" (move (from (from) ) (to (intersection (sites To (if (= 1 (value Piece at:(from))) (step Orthogonal (to if:(not ("IsFriendAt" (to))))) (forEach Site (sites To ("SlideStep" ~ (apply if:(is Empty (to))))) ("SlideStep" (site)) ) ) ) (sites Distance Orthogonal from:(from) (exact (value Piece at:(from)))) ) if:(not ("IsFriendAt" (to))) (apply (set Value at:(from) (value Random (range 1 #1))) ) ) ) ) (define "NextCanNotMove" (not (can Move (do (forEach Piece Next) ifAfterwards:(not ("IsInCheck" "King" Next))))) ) //------------------------------------------------------------------------------ (game "Shogun" ("TwoPlayersNorthSouth") (equipment { (board (square 8)) (piece "Pawn" Each ("Move" 4) ) (piece "King" Each ("Move" 2) ) }) (rules (start { (place "Pawn1" coord:"A1" value:(value Random (range 1 4))) (place "Pawn1" coord:"B1" value:(value Random (range 1 4))) (place "Pawn1" coord:"C1" value:(value Random (range 1 4))) (place "Pawn1" coord:"D1" value:(value Random (range 1 4))) (place "Pawn1" coord:"F1" value:(value Random (range 1 4))) (place "Pawn1" coord:"G1" value:(value Random (range 1 4))) (place "Pawn1" coord:"H1" value:(value Random (range 1 4))) (place "King1" coord:"E1" value:(value Random (range 1 2))) (place "Pawn2" coord:"A8" value:(value Random (range 1 4))) (place "Pawn2" coord:"B8" value:(value Random (range 1 4))) (place "Pawn2" coord:"C8" value:(value Random (range 1 4))) (place "Pawn2" coord:"E8" value:(value Random (range 1 4))) (place "Pawn2" coord:"F8" value:(value Random (range 1 4))) (place "Pawn2" coord:"G8" value:(value Random (range 1 4))) (place "Pawn2" coord:"H8" value:(value Random (range 1 4))) (place "King2" coord:"D8" value:(value Random (range 1 2))) }) (play ) (end (if (or (<= (count Pieces Next) 2) ) (result Mover Win) ) ) ) ) //------------------------------------------------------------------------------ (option "Shogun Capture" args:{ } { (item "Allowed" < (forEach Piece) > < (no Pieces Next "King") > "1976 version")** (item "Not Allowed" < (do (forEach Piece) ifAfterwards:(not ("IsInCheck" "King" Mover)) ) > < (and ("IsInCheck" "King" Next) ("NextCanNotMove") ) > "1979 version. Same as 1976 version but the Shogun cannot be captured and must instead be put in checkmate.") }) //------------------------------------------------------------------------------ (metadata (info { (description "This game plays on a 8x8 grid, with each player having 7 pawns and 1 King, which start lined up on opposite sides of the board. Each player can remove the other's pieces by moving onto them, as in chess.") (rules "BGG rules") (id "1653") (source "BGG page") (version "1.3.12") (classification "board/war/replacement/eliminate/target") (author "Michael Gray and Teruo Matsumoto") (credit "Matthew Stephenson and Eric Piette") (date "1976") } ) (graphics { (player Colour P1 (colour White)) (player Colour P2 (colour Red)) (show Check "King") (piece Foreground "King" image:"Crown" scale:0.2 offsetY:0.8) (piece Rename piece:"Pawn" "Square") (piece Rename piece:"King" "Square") (board Style Chess) (show Piece Value Middle) }) (ai "Shogun_ai" ) )