mirror of
https://github.com/webxoss/webxoss-core.git
synced 2025-04-07 19:31:06 +02:00
🐛 fix WX16-027 summon (add beforeSummonAsyn)
This commit is contained in:
parent
938518e58a
commit
97dcb247ff
3 changed files with 36 additions and 10 deletions
24
Card.js
24
Card.js
|
@ -49,6 +49,7 @@ function Card (game,player,zone,pid,side) {
|
||||||
this.useCondition = info.useCondition;
|
this.useCondition = info.useCondition;
|
||||||
this.growCondition = info.growCondition;
|
this.growCondition = info.growCondition;
|
||||||
this.growActionAsyn = info.growActionAsyn;
|
this.growActionAsyn = info.growActionAsyn;
|
||||||
|
this.beforeSummonAsyn = info.beforeSummonAsyn;
|
||||||
|
|
||||||
// 效果相关的数据
|
// 效果相关的数据
|
||||||
this.getMinEffectCount = info.getMinEffectCount;
|
this.getMinEffectCount = info.getMinEffectCount;
|
||||||
|
@ -1568,14 +1569,27 @@ Card.prototype.summonAsyn = function (optional,dontTriggerStartUp,down) {
|
||||||
}).callback(this,function (card) {
|
}).callback(this,function (card) {
|
||||||
if (!card) return;
|
if (!card) return;
|
||||||
return this.player.selectSummonZoneAsyn(false,this.rise).callback(this,function (zone) {
|
return this.player.selectSummonZoneAsyn(false,this.rise).callback(this,function (zone) {
|
||||||
card.moveTo(zone,{
|
return this.handleSummonAsyn(zone,{
|
||||||
isSummon: true,
|
dontTriggerStartUp: !!dontTriggerStartUp,
|
||||||
dontTriggerStartUp: dontTriggerStartUp,
|
down: !!down,
|
||||||
up: !down
|
})
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
Card.prototype.handleSummonAsyn = function(zone,arg) {
|
||||||
|
if (!arg) arg = {};
|
||||||
|
return Callback.immediately().callback(this,function () {
|
||||||
|
if (!this.beforeSummonAsyn) return;
|
||||||
|
return this.game.blockAsyn(this,function () {
|
||||||
|
return this.beforeSummonAsyn(zone);
|
||||||
|
});
|
||||||
|
}).callback(this,function () {
|
||||||
|
arg = Object.create(arg);
|
||||||
|
arg.isSummon = true;
|
||||||
|
this.moveTo(zone,arg);
|
||||||
this.game.handleFrameEnd(); // 增加一个空帧,以进行两次常计算
|
this.game.handleFrameEnd(); // 增加一个空帧,以进行两次常计算
|
||||||
});
|
});
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Card.prototype.summonOptionalAsyn = function (dontTriggerStartUp) {
|
Card.prototype.summonOptionalAsyn = function (dontTriggerStartUp) {
|
||||||
|
|
14
CardInfo.js
14
CardInfo.js
|
@ -117996,6 +117996,20 @@ var CardInfo = {
|
||||||
if (cards.length < 2) return false;
|
if (cards.length < 2) return false;
|
||||||
return card.hasClass('武勇');
|
return card.hasClass('武勇');
|
||||||
},
|
},
|
||||||
|
beforeSummonAsyn: function (zone) {
|
||||||
|
var card = zone.getSigni();
|
||||||
|
var cards = card.player.signis.filter(function (signi) {
|
||||||
|
return (signi !== card) && signi.hasClass('武勇');
|
||||||
|
},this);
|
||||||
|
return this.player.selectTargetAsyn(cards).callback(this,function (target) {
|
||||||
|
if (!target) return;
|
||||||
|
var cards = target.zone.getNonTrapCards().filter(function (c) {
|
||||||
|
return (c !== target) && !c.charm && !c.acceingCard;
|
||||||
|
},this);
|
||||||
|
cards.push(target);
|
||||||
|
this.game.moveCards(cards,card.zone);
|
||||||
|
});
|
||||||
|
},
|
||||||
// ======================
|
// ======================
|
||||||
// 出场效果
|
// 出场效果
|
||||||
// ======================
|
// ======================
|
||||||
|
|
|
@ -424,8 +424,7 @@ Player.prototype.summonSigniAsyn = function () {
|
||||||
return this.selectSummonZoneAsyn(true,card.rise).callback(this,function (zone) {
|
return this.selectSummonZoneAsyn(true,card.rise).callback(this,function (zone) {
|
||||||
if (!zone) return;
|
if (!zone) return;
|
||||||
return this.game.blockAsyn(this,function () {
|
return this.game.blockAsyn(this,function () {
|
||||||
card.moveTo(zone,{isSummon: true});
|
return card.handleSummonAsyn(zone);
|
||||||
this.game.handleFrameEnd(); // 增加一个空帧,以进行两次常计算
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -469,8 +468,7 @@ Player.prototype.summonResonaAsyn = function (card) {
|
||||||
return this.selectSummonZoneAsyn(false).callback(this,function (zone) {
|
return this.selectSummonZoneAsyn(false).callback(this,function (zone) {
|
||||||
if (!zone) return;
|
if (!zone) return;
|
||||||
return this.game.blockAsyn(this,function () {
|
return this.game.blockAsyn(this,function () {
|
||||||
card.moveTo(zone,{isSummon: true, resonaArg: resonaArg});
|
return card.handleSummonAsyn(zone)
|
||||||
this.game.handleFrameEnd(); // 增加一个空帧,以进行两次常计算
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue