mirror of
https://github.com/webxoss/webxoss-core.git
synced 2025-01-19 03:56:06 +01:00
💫 implement WX16-044 reduce acce cost
This commit is contained in:
parent
ba86f66469
commit
27ec313744
2 changed files with 32 additions and 6 deletions
37
Card.js
37
Card.js
|
@ -202,15 +202,42 @@ var mixins = {
|
||||||
return signi.canBeAcced();
|
return signi.canBeAcced();
|
||||||
},this);
|
},this);
|
||||||
},
|
},
|
||||||
actionAsyn: function () {
|
costChange: function () {
|
||||||
var signis = this.player.signis.filter(function (signi) {
|
var obj = Object.create(this);
|
||||||
|
obj.costChange = null;
|
||||||
|
var flag = this.player.signis.some(function (signi) {
|
||||||
|
return signi.canBeAcced() && signi._2313;
|
||||||
|
},this);
|
||||||
|
if (flag) {
|
||||||
|
obj.costGreen -= 1;
|
||||||
|
if (obj.costGreen < 0) obj.costGreen = 0;
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
},
|
||||||
|
costChangeAsyn: function () {
|
||||||
|
var cost = Object.create(this);
|
||||||
|
cost.costChange = null;
|
||||||
|
var reducedCost = Object.create(this);
|
||||||
|
reducedCost.costGreen -= 1;
|
||||||
|
if (reducedCost.costGreen < 0) reducedCost.costGreen = 0;
|
||||||
|
|
||||||
|
var cards = this.player.signis.filter(function (signi) {
|
||||||
return signi.canBeAcced();
|
return signi.canBeAcced();
|
||||||
},this);
|
},this);
|
||||||
return this.player.selectTargetOptionalAsyn(signis).callback(this,function (signi) {
|
if (!this.player.enoughCost(cost)) {
|
||||||
if (!signi) return;
|
cards = cards.filter(function (signi) {
|
||||||
this.acceTo(signi);
|
return signi._2313;
|
||||||
|
},this);
|
||||||
|
}
|
||||||
|
return this.player.selectTargetAsyn(cards).callback(this,function (card) {
|
||||||
|
this._data = card;
|
||||||
|
return (card && card._2313) ? reducedCost : cost;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
actionAsyn: function () {
|
||||||
|
if (!this._data) return;
|
||||||
|
this.acceTo(this._data);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
Card.prototype.cookEffect = function (rawEffect,type,offset) {
|
Card.prototype.cookEffect = function (rawEffect,type,offset) {
|
||||||
|
|
|
@ -119040,7 +119040,6 @@ var CardInfo = {
|
||||||
],
|
],
|
||||||
constEffects: [{
|
constEffects: [{
|
||||||
action: function (set,add) {
|
action: function (set,add) {
|
||||||
// TODO: ...
|
|
||||||
set(this,'_2313',true);
|
set(this,'_2313',true);
|
||||||
},
|
},
|
||||||
},{
|
},{
|
||||||
|
|
Loading…
Reference in a new issue