mirror of
https://github.com/webxoss/webxoss-core.git
synced 2025-01-18 19:56:02 +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();
|
||||
},this);
|
||||
},
|
||||
actionAsyn: function () {
|
||||
var signis = this.player.signis.filter(function (signi) {
|
||||
costChange: function () {
|
||||
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();
|
||||
},this);
|
||||
return this.player.selectTargetOptionalAsyn(signis).callback(this,function (signi) {
|
||||
if (!signi) return;
|
||||
this.acceTo(signi);
|
||||
if (!this.player.enoughCost(cost)) {
|
||||
cards = cards.filter(function (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) {
|
||||
|
|
|
@ -119040,7 +119040,6 @@ var CardInfo = {
|
|||
],
|
||||
constEffects: [{
|
||||
action: function (set,add) {
|
||||
// TODO: ...
|
||||
set(this,'_2313',true);
|
||||
},
|
||||
},{
|
||||
|
|
Loading…
Reference in a new issue