show coin

This commit is contained in:
WEBXOSS 2017-02-28 23:56:15 +08:00
parent f51799ac58
commit b496bc0051
3 changed files with 6 additions and 9 deletions

View file

@ -8,7 +8,7 @@ function Card (game,player,zone,pid,side) {
this.zone = zone;
// 状态
this.isFaceUp = false;
this.isFaceup = false;
this.isUp = true;
// 注册

View file

@ -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: {

@ -1 +1 @@
Subproject commit 62eec8e4dd5e18f2299fd92070402571edb04640
Subproject commit ff57f7b81016de1b56f6cec5ee15d302b63a8f73