add client msg for coin change

This commit is contained in:
WEBXOSS 2017-02-27 22:46:50 +08:00
parent c220789fd1
commit 4613bf8888
2 changed files with 14 additions and 1 deletions

View file

@ -2246,6 +2246,19 @@ Player.prototype.loseCoins = function(count) {
if (this.coin < 0) this.coin = 0;
};
Player.prototype.setCoin = function(count) {
var coin = this.coin;
this.coin = Math.max(0, Math.min(5, count));
if (coin !== this.coin) {
this.game.output({
type: 'COIN_CHANGE',
content: {
player: this,
coin: this.coin,
},
});
}
};
// For test:
Player.prototype.matchCard = function (arg) {

@ -1 +1 @@
Subproject commit 566fce66059388cf29f0f9f630af18400348de97
Subproject commit a55f847be204deb01b6b7c60fd36f14b4528a093