From 2d34b9fc0f007ddd23a7246bada727cac54899db Mon Sep 17 00:00:00 2001 From: tilera Date: Tue, 8 Aug 2017 23:37:48 +0200 Subject: [PATCH] added leychessbeta files --- src/games/chessbase/index.js | 166 ++++- src/games/chessbase/leychessbeta-credits.html | 13 + .../chessbase/leychessbeta-description.html | 1 + src/games/chessbase/leychessbeta-model.js | 591 ++++++++++++++++++ src/games/chessbase/leychessbeta-rules.html | 269 ++++++++ src/games/chessbase/leychessbeta-view.js | 258 ++++++++ 6 files changed, 1297 insertions(+), 1 deletion(-) create mode 100644 src/games/chessbase/leychessbeta-credits.html create mode 100644 src/games/chessbase/leychessbeta-description.html create mode 100644 src/games/chessbase/leychessbeta-model.js create mode 100644 src/games/chessbase/leychessbeta-rules.html create mode 100644 src/games/chessbase/leychessbeta-view.js diff --git a/src/games/chessbase/index.js b/src/games/chessbase/index.js index 0b6605a..85f9950 100644 --- a/src/games/chessbase/index.js +++ b/src/games/chessbase/index.js @@ -1196,6 +1196,17 @@ exports.games = (function () { "fairy-set-view.js", "wild-tamerlane-view.js" ] + var modelScripts_lcb = [ + "base-model.js", + "grid-geo-model.js", + "leychessbeta-model.js" + ] + var config_view_js_lcb = [ + "base-view.js", + "grid-board-view.js", + "fairy-set-view.js", + "leychessbeta-view.js" + ] return [ { "name": "classic-chess", @@ -5937,7 +5948,160 @@ exports.games = (function () { } }, "viewScripts": config_view_js_wtamerlane - } + }, + { + "name": "leychessbeta-chess", + "modelScripts": modelScripts_lcb, + "config": { + "status": true, + "model": { + "title-en": "LeyChessBeta", + "summary": "16*16 Chess with Fairy Pieces", + "rules": { + "en": "leychessbeta-rules.html" + }, + "module": "chessbase", + "plazza": "true", + "thumbnail": "leychessbeta-thumbnail.png", + "released": 1402412178, + "credits": { + "en": "leychessbeta-credits.html" + }, + "gameOptions": config_model_gameOptions, + "obsolete": false, + "js": modelScripts_lcb, + "description": { + "en": "leychessbeta-description.html" + }, + "levels": config_model_levels_15 + }, + "view": { + "title-en": "Chessbase view", + "visuals": { + "600x600": [ + "res/visuals/leychessbeta-600x600-3d.jpg", + "res/visuals/leychessbeta-600x600-2d.jpg" + ] + }, + "xdView": true, + "css": config_view_css, + "preferredRatio": 1, + "useShowMoves": true, + "useNotation": true, + "module": "chessbase", + "defaultOptions": config_view_defaultOptions, + "skins": [ + { + "name": "skin3d", + "title": "3D Classic", + "3d": true, + "preload": [ + "smoothedfilegeo|0|/res/ring-target.js", + "image|/res/images/cancel.png", + "image|/res/images/wikipedia.png", + "image|/res/pieces/wikipedia-fairy-emperor-sprites.png", + "image|/res/musketeer/wikipedia-fairy-musketeer-all-sprites.png", + "smoothedfilegeo|0|/res/fairy/pawn/pawn.js", + "image|/res/fairy/pawn/pawn-diffusemap.jpg", + "image|/res/fairy/pawn/pawn-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/knight/knight.js", + "image|/res/fairy/knight/knight-diffusemap.jpg", + "image|/res/fairy/knight/knight-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/bishop/bishop.js", + "image|/res/fairy/bishop/bishop-diffusemap.jpg", + "image|/res/fairy/bishop/bishop-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/queen/queen.js", + "image|/res/fairy/queen/queen-diffusemap.jpg", + "image|/res/fairy/queen/queen-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/king/king.js", + "image|/res/fairy/king/king-diffusemap.jpg", + "image|/res/fairy/king/king-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/rook/rook.js", + "image|/res/fairy/rook/rook-diffusemap.jpg", + "image|/res/fairy/rook/rook-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/cannon2/cannon2.js", + "image|/res/fairy/cannon2/cannon2-diffusemap.jpg", + "image|/res/fairy/cannon2/cannon2-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/elephant/elephant.js", + "image|/res/fairy/elephant/elephant-diffusemap.jpg", + "image|/res/fairy/elephant/elephant-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/admiral/admiral.js", + "image|/res/fairy/admiral/admiral-diffusemap.jpg", + "image|/res/fairy/admiral/admiral-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/camel/camel.js", + "image|/res/fairy/camel/camel-diffusemap.jpg", + "image|/res/fairy/camel/camel-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/lion/lion.js", + "image|/res/fairy/lion/lion-diffusemap.jpg", + "image|/res/fairy/lion/lion-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/eagle/eagle.js", + "image|/res/fairy/eagle/eagle-diffusemap.jpg", + "image|/res/fairy/eagle/eagle-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/unicorn/unicorn.js", + "image|/res/fairy/unicorn/unicorn-diffusemap.jpg", + "image|/res/fairy/unicorn/unicorn-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/lighthouse/lighthouse.js", + "image|/res/fairy/lighthouse/lighthouse-diffusemap.jpg", + "image|/res/fairy/lighthouse/lighthouse-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/amazon/amazon.js", + "image|/res/fairy/amazon/amazon-diffusemap.jpg", + "image|/res/fairy/amazon/amazon-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/cardinal/cardinal.js", + "image|/res/fairy/cardinal/cardinal-diffusemap.jpg", + "image|/res/fairy/cardinal/cardinal-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/marshall/marshall.js", + "image|/res/fairy/marshall/marshall-diffusemap.jpg", + "image|/res/fairy/marshall/marshall-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/dragon/dragon.js", + "image|/res/fairy/dragon/dragon-diffusemap.jpg", + "image|/res/fairy/dragon/dragon-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/crowned-rook/crowned-rook.js", + "image|/res/fairy/crowned-rook/crowned-rook-diffusemap.jpg", + "image|/res/fairy/crowned-rook/crowned-rook-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/corporal/corporal.js", + "image|/res/fairy/corporal/corporal-diffusemap.jpg", + "image|/res/fairy/corporal/corporal-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/prince/prince.js", + "image|/res/fairy/prince/prince-diffusemap.jpg", + "image|/res/fairy/prince/prince-normalmap.jpg", + "image|/res/fairy/star/star-diffusemap.jpg", + "image|/res/fairy/star/star-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/bow/bow.js", + "image|/res/fairy/bow/bow-diffusemap.jpg", + "image|/res/fairy/bow/bow-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/rhino/rhino.js", + "image|/res/fairy/rhino/rhino-diffusemap.jpg", + "image|/res/fairy/rhino/rhino-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/bull/bull.js", + "image|/res/fairy/bull/bull-diffusemap.jpg", + "image|/res/fairy/bull/bull-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/antelope/antelope.js", + "image|/res/fairy/antelope/antelope-diffusemap.jpg", + "image|/res/fairy/antelope/antelope-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/machine/machine.js", + "image|/res/fairy/machine/machine-diffusemap.jpg", + "image|/res/fairy/machine/machine-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/buffalo/buffalo.js", + "image|/res/fairy/buffalo/buffalo-diffusemap.jpg", + "image|/res/fairy/buffalo/buffalo-normalmap.jpg", + "smoothedfilegeo|0|/res/fairy/ship/ship.js", + "image|/res/fairy/ship/ship-diffusemap.jpg", + "image|/res/fairy/ship/ship-normalmap.jpg", + ], + "world": config_view_skins_world, + "camera": config_view_skins_camera + }, + config_view_skins_9 + ], + "animateSelfMoves": false, + "switchable": true, + "sounds": config_view_sounds, + "js": config_view_js_lcb, + "useAutoComplete": true + } + }, + "viewScripts": config_view_js_lcb + } diff --git a/src/games/chessbase/leychessbeta-credits.html b/src/games/chessbase/leychessbeta-credits.html new file mode 100644 index 0000000..adbfffd --- /dev/null +++ b/src/games/chessbase/leychessbeta-credits.html @@ -0,0 +1,13 @@ +

Credits

+
+LeyChessBeta is based on Terachess.
+The view.js is taked from Terachess.
+Inventor: tilera
+Developer: tilera
+Inventor of Terachess: Jean-Louis Cazaux
+Developer of Terachess: jcfrog
+Developer of Jocly: Michel Gutierrez
+Piece Graphic Designer:
+Michel Gutierrez
+jcfrog
+
\ No newline at end of file diff --git a/src/games/chessbase/leychessbeta-description.html b/src/games/chessbase/leychessbeta-description.html new file mode 100644 index 0000000..cdb75c1 --- /dev/null +++ b/src/games/chessbase/leychessbeta-description.html @@ -0,0 +1 @@ +

LeyChessBeta is a 16*16 Chess Variant with Fairy Pieces based on Terachess

\ No newline at end of file diff --git a/src/games/chessbase/leychessbeta-model.js b/src/games/chessbase/leychessbeta-model.js new file mode 100644 index 0000000..c48d5c6 --- /dev/null +++ b/src/games/chessbase/leychessbeta-model.js @@ -0,0 +1,591 @@ +/* + * Copyright(c) 2013-2014 - jocly.com + * + * You are allowed to use and modify this source code as long as it is exclusively for use in the Jocly API. + * + * Original authors: Jocly team + * + */ +(function() { + + var firstRow=0; + var lastRow=15; + var firstCol=0; + var lastCol=15; + + var geometry = Model.Game.cbBoardGeometryGrid(16,16); + + // graphs + Model.Game.cbCorporalGraph = function(geometry,side,confine) { + var $this=this; + var graph={}; + for(var pos=0;pos0) + graph[pos].push($this.cbTypedArray(away)); + } + } + }); + } + return $this.cbMergeGraphs(geometry, + $this.cbShortRangeGraph(geometry,[[-1,-1],[-1,1],[1,-1],[1,1]]), + graph + ); + } + + Model.Game.cbShipGraph = function(geometry){ + var $this=this; + + var flags = $this.cbConstants.FLAG_MOVE | $this.cbConstants.FLAG_CAPTURE; + var graph={}; + for(var pos=0;pos0) + graph[pos].push($this.cbTypedArray(away)); + } + } + }); + } + return $this.cbMergeGraphs(geometry, + $this.cbShortRangeGraph(geometry,[[-1,-1],[-1,1],[1,-1],[1,1]]), + graph + ); + } + + + Model.Game.cbRhinoGraph = function(geometry,confine){ + var $this=this; + + var flags = $this.cbConstants.FLAG_MOVE | $this.cbConstants.FLAG_CAPTURE; + var graph={}; + for(var pos=0;pos0) + directions.push($this.cbTypedArray(away)); + } + }); + graph[pos]=directions; + } + + return $this.cbMergeGraphs(geometry, + $this.cbShortRangeGraph(geometry,[[1,2],[2,1],[1,-2],[2,-1],[-1,2],[-2,1],[-1,-2],[-2,-1]]), + graph + ); + } + + var confine = {}; + + for(var pos=0;posLeyChessBeta Rules +

Setup

+Your Browser suck:( +

Pieces

+

King

+

+ +

+

Exactly as in usual Chess.

+
+

+ +

+

Queen

+

+ +

+

Exactly as in usual Chess.

+
+

+ +

+

Bishop

+

+ +

+

Exactly as in usual Chess.

+
+

+ +

+

Knight

+

+ +

+

Moves as in usual Chess.

+
+

+ +

+

Rook

+

+ +

+

Exactly as in usual Chess.

+
+

+ +

+

Pawn

+

+ +

+

The Pawn is almost similar to usual Chess. There is a difference: it can advance one or two square from ANY position on the board. However, its capturing move is unchanged: one square diagonally forward. As a consequence, the en-passant capture is possible every time the opposite Pawn or Corporal or Prince has advanced two squares.

+
+

+ +

+

Corporal

+

+ +

+

An extended Pawn. He can advance one or two square from any position on the board and its capturing move is one square diagonally forward. The improvement is that the Corporal can also advance 1 step diagonally forward. (So, with or without capturing). The Corporal can take en-passant every time an opposite Pawn or Corporal or Prince has advanced two squares.

+
+

+ +

+

Prince

+

+ +

+

This piece is simply a non-royal King combined with a Pawn. It can be found in Metamachy and has been inspired by medieval games like the Courier chess , an old chess variant, played in Germany, where it is called "Man". It moves one square in an arbitrary direction, like the King, but without being hindered by check. Here, like the Pawn, he can move without capturing to the second square straight ahead. When the Prince reaches the last row it promotes to an Emperor.

+
+

+ +

+

Elephant

+

+ +

+

As in Shako.

+
+

+ +

+

Machine

+

+ +

+

It is an orthogonal counterpart of the Elephant as it moves 1 or 2 cases orthogonally, jumping over the first case if it is occupied. Then, it combines the moves of old Dabbaba and Wazir found in ancient Muslim Chess variants.

+
+

+ +

+

Lion

+

+ +

+

As in Metamachy, inspired (although with some simplification) by Chu Shogi, the most popular variant of the Japanese Chess. Here the Lion may move as a King (a single step move in any direction), or it may jump to a position two squares away, jumping in any orthogonal or diagonal direction, or alternatively jumping as a Knight in usual Chess. (Then this Lion has the same range but is more restricted than the Lion in Chu Shogi which can move two times in a turn).

+
+

+ +

+

Eagle

+

+ +

+

As in Metamachy, moves one square diagonally and then, goes away of an indefinite number of cases vertically or horizontally. It is authorized to go only one square diagonal. It can not jump and the unobstructed path must start with the diagonal movement. This piece is almost as powerful as the Queen and is inspired by the Giraffe from Tamerlane's Chess and the Aanca from Alfonso X's Grande Acedrex.

+
+

+ +

+

Ship

+

+ +

+

Originally invented for Tamerlane 2000, it moves one square diagonally and then, goes away of an indefinite number of cases vertically, never horizontally. It can move one square diagonally only. It can not jump and must begin its move with the diagonal step. The Ship is more limited than the Eagle (which can move horizontally). Nevertheless its move power is comparable to the Rook and the Bishop.

+
+

+ +

+

Camel

+

+ +

+

As in Metamachy, a well known piece from medieval Muslim great Chess like Tamerlane's Chess. It jumps to the opposite case of a 2x4 rectangle, like an extended Knight. No matter what intermediate cases contain. Note that it always stays on the same color of square.

+
+

+ +

+

Cannon

+

+ +

+

As in Xiangqi, in Shako and in Metamachy. (Also known as Pao by problemists).

+
+

+ +

+

Bow

+

+ +

+

It is the diagonal counterpart of the Chinese Cannon. It moves like a Bishop and needs an intermediate piece between itself and its victim to capture it. The Bow jumps the intermediate and takes the victim on its square. The intermediate is left unaffected. (Also known as Vao by problemists).

+
+

+ +

+

Buffalo

+

+ +

+

Combines the leaps of the Knight (3x2), the Camel (4x2) and the Bull (see Terachess) (4x3).

+
+

+ +

+

Chancellor

+

+ +

+

It combines the move of Rook and Knight. It can be found in many, many chess variants since Carrera, Bird, Capablanca and many others like Grand Chess or Gothic Chess. (under many other names: Champion, Guard, Empress, Concubine, Chancellor, etc. The later is sometimes preferred, however it is confusing since Capablanca used it once for R+N and once for B+N. It is an Elephant in Seirawan Chess).

+
+

+ +

+

Cardinal

+

+ +

+

It combines the move of Bishop and Knight. It can be found in many, many chess variants since Carrera, Bird, Capablanca, Modern and many others like Grand Chess or Gothic Chess. (under many other names: Centaur, Minister, Equerry, Janus, Archbishop, Princess, Chancellor, etc. It is a Hawk in Seirawan Chess).

+
+

+ +

+

Commander

+

+ +

+

It combines the move of Queen and Knight. It was used in the Turkish-Indian Grand Chess (as a Giraffe).

+
+

+ +

+

Bull

+

+ +

+

Jumps to the opposite case of a 3x4 rectangle, like an extended Knight. No matter what intermediate cases contain. Note that it always changes the same color of its square. The same move is found in Janggi, Korean Chess, for the Elephant. Under the name of Zebra, it is also a fairy piece used by problemists for compositions.

+
+

+ +

+

Antelope

+

+ +

+

Jumps 2 or 3 step orthogonally or diagonally. No matter what intermediate squares contain. This is an original piece, exclusive to this game.

+
+

+ +

+

Rhinoceros

+

+ +

+

Jumps as a Knight then slides diagonally away. This piece is inspired by the Unicorn of mediaeval Grande Acedrex.

+
+

+ +

+

Star

+

+ +

+

It moves like a Queen and needs an intermediate piece between itself and its victim to capture it. The Star jumps the intermediate and takes the victim on its square. The intermediate is left unaffected. Like the Queen is Bishop + Rook, the Star is Cannon + Bow.

+
+

+ +

+

Lighthouse

+

+ +

+

It combines the Star and the Queen.

+
+

+ +

+

Unicorn

+

+ +

+

The Unicorn combines the Camel, Lion and Antelope and additionaly it can jump infinite times like a Knight in the same direction(like the Knightrider).

+
+

+ +

+

Buffaloriderqueen

+

+ +

+

The Buffaloriderqueen combines the Queen, Knightrider move(Infinite times like a Knight in the same direction) and the Buffalo.

+
+

+ +

+

Dragon

+

+ +

+

The Dragon combines the Queen and the Eagle.

+
+

+ +

+

Emperor

+

+ +

+

The Emperor combines the Dragon, Buffaloriderqueen, Unicorn, Rhinoceros and Lighthouse. That means, that every Piece is included in the Emperor. You can only get the Emperor, when you promote a Prince.

+
+

Promotion

+

Pawn

+Restart your Browser +

Corporal

+Restart your Browser +

Prince

+Restart your Browser diff --git a/src/games/chessbase/leychessbeta-view.js b/src/games/chessbase/leychessbeta-view.js new file mode 100644 index 0000000..e825a23 --- /dev/null +++ b/src/games/chessbase/leychessbeta-view.js @@ -0,0 +1,258 @@ +/* + * + * + * + * authors: jerome choain + * + */ + +(function() { + + function createTexturedPatternCanvas(W,H,texture,clipW,clipH,mask,borderFact){ + // borderFact is the percentage (/100) of the mask transition overlay border : ex 30% => .3 + var cv = document.createElement('canvas'); + cv.width=W; + cv.height=H; + var ctx=cv.getContext('2d'); + + var maskW=mask.width; + var maskH=mask.height; + var textW=texture.width; + var textH=texture.height; + var tmp = document.createElement('canvas'); + ctx.globalCompositeOperation='or'; + + var y=0; + for (var i=0; y<=(H+clipH/2);i++){ + var x=0; + for (var j=0; x<=(W+clipW/2);j++){ + tmp.width=clipW; tmp.height=clipH; + ctxTmp=tmp.getContext('2d'); + ctxTmp.globalCompositeOperation='xor'; + ctxTmp.drawImage(texture, Math.random()*(textW-clipW),Math.random()*(textH-clipH),clipW,clipH,0,0,clipW,clipH); + ctxTmp.drawImage(mask,0,0,clipW,clipH); + ctx.drawImage(tmp,x-clipW/2,y-clipH/2,clipW,clipH); + x+=clipW-borderFact*clipW; + } + y+=clipH-borderFact*clipH; + } + return cv; + } + + + + + // Reducing the promo frame which was overflowing the board screen + View.Game.cbPromoSize = 1100; + + // extending fairy pieces with some musketeer new pieces + View.Game.cbFairyTerachessPieceStyle3D = $.extend(true,{},View.Game.cbFairyPieceStyle3D,{ + }); + + View.Game.cbDefineView = function() { + + var terachessBoardDelta = { + notationMode: "out", + //notationDebug: true, + } + + terachessBoardDelta3d = $.extend(true,{},terachessBoardDelta, + { + /*'colorFill' : { + ".": "#575b36", // "rgba(180,213,80,.3)", + "#": "#474b36", // "black" cells + " ": "rgba(0,0,0,0)", + },*/ + 'colorFill' : { + "#": "rgba(204,40,0,1)", + ".": "rgba(180,180,0,1)", + }, + 'texturesImg' : { + 'crackles': '/res/images/crackles.jpg', + 'tiler': '/res/images/tileralpha.png', + }, + '3D':true, + 'margins' : {x:.47,y:.47}, + 'extraChannels':[ + 'bump' + ], + paintCell: function(spec,ctx,images,channel,cellType,xCenter,yCenter,cx,cy) { + + var tW=images['crackles'].width; + var tH=images['crackles'].height; + var tClipCx=200; + var tClipCy=200; + + + + ctx.fillStyle="#000000"; + ctx.fillRect(xCenter-cx/2,yCenter-cy/2,cx,cy); + + if(channel=="bump"){ + return; + } + + cx=.98*cx; + cy=.98*cy; + + ctx.save(); + + + ctx.strokeStyle = "rgba(0,0,0,1)"; + ctx.lineWidth = 50; + if (channel=='diffuse') + ctx.fillStyle=spec.colorFill[cellType]; + else + ctx.fillStyle=0xffffff; + ctx.fillRect(xCenter-cx/2,yCenter-cy/2,cx,cy); + + ctx.globalCompositeOperation = 'multiply'; + ctx.drawImage(images['crackles'], + Math.random()*(tW-tClipCx),Math.random()*(tH-tClipCy),tClipCx,tClipCy, + xCenter-cx/2,yCenter-cy/2,cx,cy); + ctx.restore(); + }, + + paintBackground: function(spec,ctx,images,channel,bWidth,bHeight) { + + ctx.save(); + ctx.fillStyle="#ffffff"; + if (channel=='diffuse') + ctx.fillStyle="#BA784A"; + //ctx.fillStyle="#cc6600"; + var cSize = this.cbCSize(spec); + ctx.fillRect(-bWidth/2,-bHeight/2,bWidth,bHeight); + var textureCanvas=createTexturedPatternCanvas(1200,800,images['crackles'],200,200,images['tiler'],.3); + ctx.globalCompositeOperation='multiply'; + ctx.drawImage(textureCanvas,-bWidth/2,-bHeight/2,bWidth,bHeight); + ctx.restore(); + }, + } + ); + + terachessBoardDelta2d = $.extend(true,{},terachessBoardDelta, + { + 'colorFill' : { + ".": "#ffffc0", // "white" cells + "#": "#8F976D", // "black" cells + " ": "rgba(0,0,0,0)", + }, + 'texturesImg' : {}, // to avoid default wood texture + 'margins' : {x:.47,y:.47}, + /*'colorFill' : { + ".": "rgba(224,50,0,1)", + "#": "rgba(220,220,0,1)", + },*/ + } + ); + + var terachessBoard3d = $.extend(true,{},this.cbGridBoardClassic3DMargin,terachessBoardDelta3d); + var terachessBoard2d = $.extend(true,{},this.cbGridBoardClassic2DMargin,terachessBoardDelta2d); + + return { + coords: { + "2d": this.cbGridBoard.coordsFn.call(this,terachessBoard2d), + "3d": this.cbGridBoard.coordsFn.call(this,terachessBoard3d), + }, + boardLayout: [ + ".#.#.#.#.#.#.#.#", + "#.#.#.#.#.#.#.#.", + ".#.#.#.#.#.#.#.#", + "#.#.#.#.#.#.#.#.", + ".#.#.#.#.#.#.#.#", + "#.#.#.#.#.#.#.#.", + ".#.#.#.#.#.#.#.#", + "#.#.#.#.#.#.#.#.", + ".#.#.#.#.#.#.#.#", + "#.#.#.#.#.#.#.#.", + ".#.#.#.#.#.#.#.#", + "#.#.#.#.#.#.#.#.", + ".#.#.#.#.#.#.#.#", + "#.#.#.#.#.#.#.#.", + ".#.#.#.#.#.#.#.#", + "#.#.#.#.#.#.#.#.", + ], + board: { + "2d": { + draw: this.cbDrawBoardFn(terachessBoard2d), + }, + "3d": { + display: this.cbDisplayBoardFn(terachessBoard3d), + }, + }, + clicker: { + "2d": { + width: 700, + height: 700, + }, + "3d": { + scale: [0.45,0.45,0.45], + }, + }, + pieces: this.cbFairyPieceStyle({ + "default": { + "2d": { + width: 650, + height: 650, + }, + "3d": { + scale: [0.3,0.3,0.3], + display: this.cbDisplayPieceFn(this.cbFairyTerachessPieceStyle3D) + }, + }, + "fr-amazon" :{ + "3d": { + scale: [0.36,0.36,0.36], + } + }, + "fr-star" :{ + "3d":{scale:[0.36,0.36,0.36]}, + }, + "fr-rhino" :{ + "3d":{scale:[0.24,0.24,0.24]}, + }, + "fr-bull" :{ + "3d":{scale:[0.21,0.21,0.21]}, + }, + "fr-antelope" :{ + "3d":{scale:[0.24,0.24,0.24]}, + }, + }), + }; + } + + /* Make the jumps */ + View.Board.cbMoveMidZ = function(aGame,aMove,zFrom,zTo) { + var geo=aGame.cbVar.geometry; + var dx=Math.abs(geo.C(aMove.t)-geo.C(aMove.f)); + var dy=Math.abs(geo.R(aMove.t)-geo.R(aMove.f)); + if(("_N_E_D_L_J_T_F_G_S_".indexOf("_"+aMove.a+"_")>=0) && (aGame.g.distGraph[aMove.f][aMove.t]>1)) + return Math.max(zFrom,zTo)+2000; + else if(("_A_C_M_".indexOf("_"+aMove.a+"_")>=0) && dx!=dy && dx!=0 && dy!=0) + return Math.max(zFrom,zTo)+2000; + else if(("_Z_W_".indexOf("_"+aMove.a+"_")>=0) && aMove.c != null) + return Math.max(zFrom,zTo)+2000; + else + return (zFrom+zTo)/2; + } + /* + * View.Board.xdDisplay overriding to prevent displaying black xtra pieces before setup + */ + var SuperViewBoardxdDisplay = View.Board.xdDisplay; + View.Board.xdDisplay = function(xdv, aGame) { + var size = 1060; + SuperViewBoardxdDisplay.apply(this,arguments); + + } + + + /* + * View.Game.xdInit overriding to create initial setup gadgets + */ + var SuperViewGameXdInit = View.Game.xdInit; + View.Game.xdInit = function(xdv) { + var size = 1060; + var $this=this; + SuperViewGameXdInit.apply(this,arguments); + } +})();