tPut all epoch cards in a common deck - hadarawgs - Hadara adaptation for boardgamearena.com
 (HTM) git clone git://git.z3bra.org/hadarawgs.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit 437ef6e1f7c1b7ebdfcc6a527c315542678a8ad3
 (DIR) parent 2f269edd45fa9bf46002e0740e92fdc59936764c
 (HTM) Author: Willy Goiffon <dev@z3bra.org>
       Date:   Thu, 16 Apr 2020 18:20:48 +0200
       
       Put all epoch cards in a common deck
       
       Diffstat:
         M hadarawgs.js                        |      17 ++++++++++-------
         M hadarawgs_hadarawgs.tpl             |       5 +++--
       
       2 files changed, 13 insertions(+), 9 deletions(-)
       ---
 (DIR) diff --git a/hadarawgs.js b/hadarawgs.js
       t@@ -29,7 +29,7 @@ function (dojo, declare) {
        
                                // global variables
                                this.cardwidth  = 64;
       -                        this.cardheight = 95;
       +                        this.cardheight = 96;
                        },
        
                        /*
       t@@ -73,15 +73,18 @@ function (dojo, declare) {
        
                                this.deck = new ebg.stock();
                                this.deck.create(this, $('deck'), this.cardwidth, this.cardheight);
       -                        this.deck.image_items_per_row = 5;
       +                        this.deck.image_items_per_row = 10;
                                this.deck.centerItems = true;
       -                        for (var epoch = 3; epoch > 0; epoch--) {
       -                                for (var type = 1; type < 6; type++) {
       -                                        this.deck.addItemType((epoch-1)*5 + type, epoch, g_gamethemeurl+'img/cards.png', (epoch-1)*5 + type);
       -                                        this.deck.addToStock((epoch-1)*5 + type, 'deck');
       +
       +                        for (var epoch = 0; epoch < 3; epoch++) {
       +                                for (cardtype = 0; cardtype < 5; cardtype++) {
       +                                        for (var cardid = 0; cardid < 10; cardid++) {
       +                                                var cardref = cardtype * 10 + epoch * 50 + cardid;
       +                                                this.deck.addItemType(cardref, cardtype, g_gamethemeurl + 'img/cards_small.png', cardref);
       +                                                this.deck.addToStock(cardref, 'deck');
       +                                        }
                                        }
                                }
       -                        this.deck.setOverlap(50, 50);
        
                                // Setup game notifications to handle (see "setupNotifications" method below)
                                this.setupNotifications();
 (DIR) diff --git a/hadarawgs_hadarawgs.tpl b/hadarawgs_hadarawgs.tpl
       t@@ -31,7 +31,7 @@
                                <div class="resource"><span id="food_p{PLAYER_ID}">-</span></div>
                        </div>
                </div>
       -        <div class="whiteblock card_area"></div>
       +        <div id="deck_p{PLAYER_ID}"class="whiteblock card_area"></div>
                <!-- END player -->
        </div>
        
       t@@ -40,7 +40,7 @@
                <div id="discard" class="whiteblock deck discard"></div>
        </div>
        
       -<div id="animals" class="debug">
       +<div id="animals" class="whiteblock debug">
                <h3>Animals</h3>
                <div class="icon icon_animal icon_monkey"></div>
                <div class="icon icon_animal icon_scarab"></div>
       t@@ -54,6 +54,7 @@
                        <div class="icon icon_coins"></div><span id="pp_coins_p${id}" class="pp_value pp_coins">${coins}</span>\
                        <div class="icon icon_food "></div><span id="pp_ncard_p${id}" class="pp_value pp_food ">${ncard}<span id="pp_food_p${id}" class="smalltext">/${food}</span></span>\
                        </div>';
       +        this.deck.jstpl_stock_item= "<div id=\"${id}\" class=\"epoch_card\" style=\"top:${top}px;left:${left}px;width:${width}px;height:${height}px;z-index:${position};background-image:url('${image}');\"></div>";
        </script>
        
        {OVERALL_GAME_FOOTER}