forked from mirrors/webxoss-core
make trash-zone-targeting-spell cuttable
This commit is contained in:
parent
7b72c7bc22
commit
50f0b6bf33
2 changed files with 55 additions and 39 deletions
83
CardInfo.js
83
CardInfo.js
|
@ -14114,17 +14114,14 @@ var CardInfo = {
|
||||||
"Add 1 SIGNI from your trash to your hand."
|
"Add 1 SIGNI from your trash to your hand."
|
||||||
],
|
],
|
||||||
spellEffect : {
|
spellEffect : {
|
||||||
actionAsyn: function () {
|
getTargets: function () {
|
||||||
var cards = this.player.trashZone.cards.filter(function (card) {
|
return this.player.trashZone.cards.filter(function (card) {
|
||||||
return (card.type === 'SIGNI');
|
return (card.type === 'SIGNI');
|
||||||
},this);
|
},this);
|
||||||
return this.player.selectTargetOptionalAsyn(cards).callback(this,function (card) {
|
},
|
||||||
var cards = card? [card] : [];
|
targetCovered: true,
|
||||||
return this.player.opponent.showCardsAsyn(cards).callback(this,function () {
|
actionAsyn: function (target) {
|
||||||
if (!card) return;
|
target.moveTo(this.player.handZone);
|
||||||
card.moveTo(this.player.handZone);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// ======================
|
// ======================
|
||||||
|
@ -19324,17 +19321,14 @@ var CardInfo = {
|
||||||
"Add one <Devil> SIGNI from your trash to your hand."
|
"Add one <Devil> SIGNI from your trash to your hand."
|
||||||
],
|
],
|
||||||
spellEffect : {
|
spellEffect : {
|
||||||
actionAsyn: function () {
|
targets: function () {
|
||||||
var cards = this.player.trashZone.cards.filter(function (card) {
|
return this.player.trashZone.cards.filter(function (card) {
|
||||||
return (card.type === 'SIGNI') && card.hasClass('悪魔');
|
return (card.type === 'SIGNI') && card.hasClass('悪魔');
|
||||||
},this);
|
},this);
|
||||||
return this.player.selectTargetOptionalAsyn(cards).callback(this,function (card) {
|
},
|
||||||
var cards = card? [card] : [];
|
targetCovered: true,
|
||||||
return this.player.opponent.showCardsAsyn(cards).callback(this,function () {
|
actionAsyn: function (target) {
|
||||||
if (!card) return;
|
target.moveTo(this.player.handZone);
|
||||||
card.moveTo(this.player.handZone);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// ======================
|
// ======================
|
||||||
|
@ -70531,22 +70525,36 @@ var CardInfo = {
|
||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
spellEffect: {
|
spellEffect: {
|
||||||
actionAsyn: function () {
|
getTargetAdvancedAsyn() {
|
||||||
|
var targets = [];
|
||||||
var cards = this.player.opponent.signis.filter(function (signi) {
|
var cards = this.player.opponent.signis.filter(function (signi) {
|
||||||
return signi.level < this.player.lrig.level;
|
return signi.level < this.player.lrig.level;
|
||||||
},this);
|
},this);
|
||||||
return this.player.selectTargetOptionalAsyn(cards).callback(this,function (card) {
|
return this.player.selectTargetOptionalAsyn(cards).callback(this,function (card) {
|
||||||
if (!card) return;
|
targets.push(card);
|
||||||
return card.trashAsyn();
|
cards = this.player.trashZone.cards.filter(function (card) {
|
||||||
}).callback(this,function () {
|
return (card.level < this.player.lrig.level) && card.canSummon();
|
||||||
var cards = this.player.trashZone.cards.filter(function (card) {
|
|
||||||
return (card.type === 'SIGNI') && (card.level < this.player.lrig.level) && card.canSummon();
|
|
||||||
},this);
|
},this);
|
||||||
return this.player.selectOptionalAsyn('TARGET',cards).callback(this,function (card) {
|
return this.player.selectOptionalAsyn('TARGET',cards).callback(this,function (card) {
|
||||||
if (!card) return;
|
targets.push(card);
|
||||||
return card.summonAsyn();
|
if (card) return this.player.opponent.showCardsAsyn([card]);
|
||||||
});
|
});
|
||||||
|
}).callback(this,function () {
|
||||||
|
return targets;
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
actionAsyn: function (targets) {
|
||||||
|
var target = targets[0];
|
||||||
|
var cards = this.player.opponent.signis.filter(function (signi) {
|
||||||
|
return signi.level < this.player.lrig.level;
|
||||||
|
},this);
|
||||||
|
if (target) {
|
||||||
|
if (!inArr(target,cards)) return;
|
||||||
|
target.trash();
|
||||||
|
}
|
||||||
|
target = targets[1];
|
||||||
|
if (!target) return;
|
||||||
|
return target.summonAsyn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -79226,16 +79234,14 @@ var CardInfo = {
|
||||||
"Add 1 black SIGNI from your trash to your hand."
|
"Add 1 black SIGNI from your trash to your hand."
|
||||||
],
|
],
|
||||||
spellEffect: {
|
spellEffect: {
|
||||||
actionAsyn: function () {
|
getTargets: function () {
|
||||||
var cards = this.player.trashZone.cards.filter(function (card) {
|
return this.player.trashZone.cards.filter(function (card) {
|
||||||
return (card.type === 'SIGNI') && (card.hasColor('black'));
|
return (card.type === 'SIGNI') && (card.hasColor('black'));
|
||||||
},this);
|
},this);
|
||||||
return this.player.selectOptionalAsyn('ADD_TO_HAND',cards).callback(this,function (card) {
|
},
|
||||||
if (!card) return;
|
targetCovered: true,
|
||||||
return this.player.opponent.showCardsAsyn([card]).callback(this,function () {
|
actionAsyn: function (target) {
|
||||||
card.moveTo(card.player.handZone);
|
target.moveTo(card.player.handZone);
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// ======================
|
// ======================
|
||||||
|
@ -81641,15 +81647,16 @@ var CardInfo = {
|
||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
spellEffect: [{
|
spellEffect: [{
|
||||||
actionAsyn: function () {
|
getTargetAdvancedAsyn: function () {
|
||||||
var cards = this.player.trashZone.cards.filter(function (card) {
|
var cards = this.player.trashZone.cards.filter(function (card) {
|
||||||
return (card.type === 'SIGNI') && (card.name.indexOf('サーバント') !== -1);
|
return (card.type === 'SIGNI') && (card.name.indexOf('サーバント') !== -1);
|
||||||
},this);
|
},this);
|
||||||
return this.player.selectSomeAsyn('ADD_TO_HAND',cards,0,2).callback(this,function (cards) {
|
return this.player.selectSomeAsyn('ADD_TO_HAND',cards,0,2).callback(this,function (cards) {
|
||||||
return this.player.opponent.showCardsAsyn(cards).callback(this,function () {
|
return this.player.opponent.showCardsAsyn(cards);
|
||||||
this.game.moveCards(cards,this.player.handZone);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
actionAsyn: function (targets) {
|
||||||
|
this.game.moveCards(targets,this.player.handZone);
|
||||||
}
|
}
|
||||||
},{
|
},{
|
||||||
actionAsyn: function () {
|
actionAsyn: function () {
|
||||||
|
|
11
Player.js
11
Player.js
|
@ -549,6 +549,15 @@ Player.prototype.handleSpellAsyn = function (card,ignoreCost,costObj) {
|
||||||
card.activate();
|
card.activate();
|
||||||
if (effect.getTargets) {
|
if (effect.getTargets) {
|
||||||
// 简单的取对象,即从目标卡片中选一张. (也可以不选,空发)
|
// 简单的取对象,即从目标卡片中选一张. (也可以不选,空发)
|
||||||
|
if (effect.targetCovered) {
|
||||||
|
// 从废弃区等[卡片可能被覆盖的区域]取对象
|
||||||
|
return this.selectOptionalAsyn('TARGET',effect.getTargets.call(card)).callback(this,function (card) {
|
||||||
|
if (!card) return card;
|
||||||
|
return this.player.opponent.showCardsAsyn([card]).callback(this,function () {
|
||||||
|
return card;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
return this.selectTargetOptionalAsyn(effect.getTargets.call(card));
|
return this.selectTargetOptionalAsyn(effect.getTargets.call(card));
|
||||||
}
|
}
|
||||||
if (effect.getTargetAdvancedAsyn) {
|
if (effect.getTargetAdvancedAsyn) {
|
||||||
|
@ -1069,7 +1078,7 @@ Player.prototype.showCardsAsyn = function (cards,label) {
|
||||||
return new Callback(function (callback) {
|
return new Callback(function (callback) {
|
||||||
player.listen('OK',function (input) {
|
player.listen('OK',function (input) {
|
||||||
return function () {
|
return function () {
|
||||||
callback();
|
callback(cards);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue