diff --git a/client/js/client.js b/client/js/client.js index 45ff32e..9e2bafb 100644 --- a/client/js/client.js +++ b/client/js/client.js @@ -283,7 +283,6 @@ let BattleView = Backbone.View.extend({ this.listenTo(user, "change:setHorn", this.render); this.listenTo(user, "change:isReDrawing", this.render); this.listenTo(user, "change:chooseSide", this.render); - /*this.listenTo(user, "change:handCards", this.render);*/ this.$hand = this.$el.find(".field-hand"); this.$preview = this.$el.find(".card-preview"); diff --git a/client/scss/main.scss b/client/scss/main.scss index f7e487b..835dfae 100644 --- a/client/scss/main.scss +++ b/client/scss/main.scss @@ -301,7 +301,7 @@ $game-height: 800px; } .notifications { - position: absolute; + position: fixed; top: 0; z-index: 200; width: 500px; diff --git a/server/Battle.js b/server/Battle.js index df21582..ed77580 100644 --- a/server/Battle.js +++ b/server/Battle.js @@ -61,6 +61,11 @@ var Battle = (function(){ this.p1.draw(10); this.p2.draw(10); + /*this.p1.hand.add(this.p1.createCard("scorch")); + this.p2.hand.add(this.p2.createCard("scorch")); + this.p1.hand.add(this.p1.createCard("vernon_roche")); + this.p2.hand.add(this.p2.createCard("vernon_roche"));*/ + /*this.p1.placeCard("ves"); this.p2.placeCard("ves"); diff --git a/server/Card.js b/server/Card.js index f54fa57..17808cd 100644 --- a/server/Card.js +++ b/server/Card.js @@ -14,8 +14,12 @@ var Card = (function(){ this.boost = 0; this._uidEvents = {}; this.setDisabled(false); + this._data = CardData[key] ? CardData[key] : CardData["none"]; + if(!(this._data = CardData[key])) { + this._data = CardData["none"]; + key = "none"; + } this._key = key; - this._data = CardData[key]; this._data.key = key; this._boost = {}; this._forcedPower = -1; diff --git a/server/Deck.js b/server/Deck.js index c16798c..5f1398b 100644 --- a/server/Deck.js +++ b/server/Deck.js @@ -1,5 +1,6 @@ var Card = require("./Card"); /*var CardManager = require("./CardManager");*/ +var DeckData = require("../assets/data/deck"); var Deck = (function(){ var Deck = function(deck, side){ @@ -40,6 +41,9 @@ var Deck = (function(){ } r.setDeck = function(deckData){ + if(!Array.isArray(deckData)) { + deckData = DeckData["northern"]; + } this._originalDeck = deckData.slice(); this._deck = deckData.slice(); diff --git a/server/Field.js b/server/Field.js index d94c440..5eadde4 100644 --- a/server/Field.js +++ b/server/Field.js @@ -144,11 +144,12 @@ var Field = (function(){ var highest = 0; this.get().forEach(function(card) { - if(noHeroes && card.getAbility("hero")) return; + if(noHeroes && card.hasAbility("hero")) return; highest = card.getPower() > highest ? card.getPower() : highest; }) this.get().forEach(function(card) { + if(noHeroes && card.hasAbility("hero")) return; if(card.getPower() === highest) res.push(card); });