forked from mirrors/webxoss-core
add client msg for coin change
This commit is contained in:
parent
c220789fd1
commit
4613bf8888
2 changed files with 14 additions and 1 deletions
13
Player.js
13
Player.js
|
@ -2246,6 +2246,19 @@ Player.prototype.loseCoins = function(count) {
|
||||||
if (this.coin < 0) this.coin = 0;
|
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:
|
// For test:
|
||||||
Player.prototype.matchCard = function (arg) {
|
Player.prototype.matchCard = function (arg) {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 566fce66059388cf29f0f9f630af18400348de97
|
Subproject commit a55f847be204deb01b6b7c60fd36f14b4528a093
|
Loading…
Reference in a new issue