From b496bc0051b45ef934f151bbfd6de7d4cce91af2 Mon Sep 17 00:00:00 2001 From: WEBXOSS Date: Tue, 28 Feb 2017 23:56:15 +0800 Subject: [PATCH] show coin --- Card.js | 2 +- Player.js | 11 ++++------- webxoss-client | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Card.js b/Card.js index 5404c56..2cd196f 100644 --- a/Card.js +++ b/Card.js @@ -8,7 +8,7 @@ function Card (game,player,zone,pid,side) { this.zone = zone; // 状态 - this.isFaceUp = false; + this.isFaceup = false; this.isUp = true; // 注册 diff --git a/Player.js b/Player.js index 3db6caf..d65fb17 100644 --- a/Player.js +++ b/Player.js @@ -239,6 +239,7 @@ Player.prototype.setupLifeCloth = function () { // OPEN!! Player.prototype.open = function () { this.lrig.faceup(); + this.setCoin(this.coin); // output }; // 玩家把lrig和所有signi竖置 (竖置阶段) @@ -2235,21 +2236,17 @@ Player.prototype.setCrossPair = function () { }; Player.prototype.gainCoins = function(count) { - this.coin += count; - if (this.coin > 5) { - this.coin = 5; - } + this.setCoin(this.coin + count); }; Player.prototype.loseCoins = function(count) { - this.coin -= count; - if (this.coin < 0) this.coin = 0; + this.setCoin(this.coin - count); }; Player.prototype.setCoin = function(count) { var coin = this.coin; this.coin = Math.max(0, Math.min(5, count)); - if (coin !== this.coin) { + if (this.lrig.isFaceup) { this.game.output({ type: 'COIN_CHANGE', content: { diff --git a/webxoss-client b/webxoss-client index 62eec8e..ff57f7b 160000 --- a/webxoss-client +++ b/webxoss-client @@ -1 +1 @@ -Subproject commit 62eec8e4dd5e18f2299fd92070402571edb04640 +Subproject commit ff57f7b81016de1b56f6cec5ee15d302b63a8f73