mirror of
https://github.com/webxoss/webxoss-core.git
synced 2024-11-20 06:49:53 +01:00
🐛 fix acce mixin
This commit is contained in:
parent
7e95ed5512
commit
844dfc33d0
1 changed files with 6 additions and 4 deletions
10
Card.js
10
Card.js
|
@ -208,9 +208,10 @@ var mixins = {
|
||||||
},this);
|
},this);
|
||||||
},
|
},
|
||||||
costChange: function () {
|
costChange: function () {
|
||||||
|
var player = this.source.player;
|
||||||
var obj = Object.create(this);
|
var obj = Object.create(this);
|
||||||
obj.costChange = null;
|
obj.costChange = null;
|
||||||
var flag = this.player.signis.some(function (signi) {
|
var flag = player.signis.some(function (signi) {
|
||||||
return signi.canBeAcced() && signi._2313;
|
return signi.canBeAcced() && signi._2313;
|
||||||
},this);
|
},this);
|
||||||
if (flag) {
|
if (flag) {
|
||||||
|
@ -220,21 +221,22 @@ var mixins = {
|
||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
costChangeAsyn: function () {
|
costChangeAsyn: function () {
|
||||||
|
var player = this.source.player;
|
||||||
var cost = Object.create(this);
|
var cost = Object.create(this);
|
||||||
cost.costChange = null;
|
cost.costChange = null;
|
||||||
var reducedCost = Object.create(this);
|
var reducedCost = Object.create(this);
|
||||||
reducedCost.costGreen -= 1;
|
reducedCost.costGreen -= 1;
|
||||||
if (reducedCost.costGreen < 0) reducedCost.costGreen = 0;
|
if (reducedCost.costGreen < 0) reducedCost.costGreen = 0;
|
||||||
|
|
||||||
var cards = this.player.signis.filter(function (signi) {
|
var cards = player.signis.filter(function (signi) {
|
||||||
return signi.canBeAcced();
|
return signi.canBeAcced();
|
||||||
},this);
|
},this);
|
||||||
if (!this.player.enoughCost(cost)) {
|
if (!player.enoughCost(cost)) {
|
||||||
cards = cards.filter(function (signi) {
|
cards = cards.filter(function (signi) {
|
||||||
return signi._2313;
|
return signi._2313;
|
||||||
},this);
|
},this);
|
||||||
}
|
}
|
||||||
return this.player.selectTargetAsyn(cards).callback(this,function (card) {
|
return player.selectTargetAsyn(cards).callback(this,function (card) {
|
||||||
this._data = card;
|
this._data = card;
|
||||||
return (card && card._2313) ? reducedCost : cost;
|
return (card && card._2313) ? reducedCost : cost;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue