diff --git a/Player.js b/Player.js index 57888c5..40e5aa6 100644 --- a/Player.js +++ b/Player.js @@ -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) { diff --git a/webxoss-client b/webxoss-client index 566fce6..a55f847 160000 --- a/webxoss-client +++ b/webxoss-client @@ -1 +1 @@ -Subproject commit 566fce66059388cf29f0f9f630af18400348de97 +Subproject commit a55f847be204deb01b6b7c60fd36f14b4528a093