From 91cd34638f21229f2d02f9fa1cfd95fb80dd0485 Mon Sep 17 00:00:00 2001 From: exane Date: Sun, 5 Jul 2015 12:03:44 +0200 Subject: [PATCH] small changes --- client/scss/_base.scss | 3 ++- client/templates/modal.emreis_leader4.handlebars | 2 +- client/templates/modal.medic.handlebars | 2 +- client/templates/modal.redraw.handlebars | 2 +- server/Battle.js | 12 ++++++++---- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/client/scss/_base.scss b/client/scss/_base.scss index 4071b86..c5557ab 100644 --- a/client/scss/_base.scss +++ b/client/scss/_base.scss @@ -64,7 +64,8 @@ body { } .btn-sub { - font-size: 18px; + font-size: 22px; + color: #6a8097; } .bbm-modal__topbar { diff --git a/client/templates/modal.emreis_leader4.handlebars b/client/templates/modal.emreis_leader4.handlebars index e7ac29c..ef7b682 100644 --- a/client/templates/modal.emreis_leader4.handlebars +++ b/client/templates/modal.emreis_leader4.handlebars @@ -1,6 +1,6 @@

Choose one card from your foes discard pile

- CLOSE + DONE
{{#each emreis_leader4.cards as |val key|}} diff --git a/client/templates/modal.medic.handlebars b/client/templates/modal.medic.handlebars index 038ec91..4867f94 100644 --- a/client/templates/modal.medic.handlebars +++ b/client/templates/modal.medic.handlebars @@ -1,6 +1,6 @@

Choose one card from your discard pile

- CLOSE + DONE
{{#each medicDiscard.cards as |val key|}} diff --git a/client/templates/modal.redraw.handlebars b/client/templates/modal.redraw.handlebars index ee858b5..7c740ff 100644 --- a/client/templates/modal.redraw.handlebars +++ b/client/templates/modal.redraw.handlebars @@ -1,6 +1,6 @@

Choose up to 2 cards you wish to redraw!

- READY + DONE
{{#each handCards as |val key|}} diff --git a/server/Battle.js b/server/Battle.js index 9f235aa..da84616 100644 --- a/server/Battle.js +++ b/server/Battle.js @@ -142,6 +142,9 @@ var Battle = (function(){ } r.getWinner = function() { + if(!this.p1.getRubies() && !this.p2.getRubies()){ + return null; //tie + } return this.p1.getRubies() ? this.p1 : this.p2; } @@ -152,6 +155,7 @@ var Battle = (function(){ if(this.checkIfIsOver()){ //console.log("its over!"); var winner = this.getWinner(); + winner = winner ? winner.getName() : "nobody"; this.gameOver(winner); this.update(); return; @@ -182,8 +186,8 @@ var Battle = (function(){ this.waitForScoiatael(this.p2); } else { - this.sendNotification(loser.getName() + " begins!"); - this.switchTurn(loser); + this.sendNotification(winner.getName() + " begins!"); + this.switchTurn(winner); } } @@ -204,9 +208,9 @@ var Battle = (function(){ }) } - r.gameOver = function(winner){ + r.gameOver = function(winnerName){ this.send("gameover", { - winner: winner.getName() + winner: winnerName }) }