mirror of
https://github.com/webxoss/webxoss-core.git
synced 2025-04-08 11:51:00 +02:00
💫 implement WD20-009 _2278
This commit is contained in:
parent
4e6dc83759
commit
de4ba5971f
2 changed files with 98 additions and 75 deletions
54
Card.js
54
Card.js
|
@ -1218,7 +1218,9 @@ Card.prototype.attackAsyn = function () {
|
|||
attack: true,
|
||||
};
|
||||
var cost = null;
|
||||
var attackedZone = null;
|
||||
var attackedZones = [];
|
||||
var index = this.player.signiZones.indexOf(this.zone);
|
||||
var opposingZone = this.getOpposingZone();
|
||||
if (this.attackCostColorless) {
|
||||
cost = {
|
||||
costColorless: this.attackCostColorless
|
||||
|
@ -1244,13 +1246,11 @@ Card.prototype.attackAsyn = function () {
|
|||
}).callback(this,function () {
|
||||
// 选择攻击的区域
|
||||
var zones = [];
|
||||
var index = this.player.signiZones.indexOf(this.zone);
|
||||
var opposingZone = this.player.opponent.signiZones[2-index];
|
||||
if (this.canAttackAnySigniZone) {
|
||||
zones = this.player.opponent.signiZones;
|
||||
} else if (this.canAttackNearbySigniZone) {
|
||||
if (index === 1) {
|
||||
zones = this.player.opponent.signiZones
|
||||
zones = this.player.opponent.signiZones;
|
||||
} else {
|
||||
zones = [
|
||||
opposingZone,
|
||||
|
@ -1258,9 +1258,27 @@ Card.prototype.attackAsyn = function () {
|
|||
];
|
||||
}
|
||||
}
|
||||
if (!zones.length) return attackedZone = opposingZone;
|
||||
if (!zones.length) return attackedZones.push(opposingZone);
|
||||
return this.player.selectAsyn('TARGET',zones).callback(this,function (zone) {
|
||||
attackedZone = zone
|
||||
attackedZones.push(zone);
|
||||
// FIX ME: show selected zone.
|
||||
var card = zone.getSigni();
|
||||
if (card) card.beSelectedAsTarget();
|
||||
});
|
||||
})
|
||||
.callback(this,function () {
|
||||
// <具英の鋭針 #コンパス#>
|
||||
if (!card._2278) return;
|
||||
if (attackedZones[0] !== opposingZone) return;
|
||||
var zones = [];
|
||||
if (index === 1) {
|
||||
zones = [this.player.opponent.signiZones[0],this.player.opponent.signiZones[2]];
|
||||
} else {
|
||||
zones = [this.player.opponent.signiZones[1]];
|
||||
}
|
||||
return this.player.selectOptionalAsyn('TARGET',zones).callback(this,function (zone) {
|
||||
if (zone) attackedZones.push(zone);
|
||||
// FIX ME: show selected zone.
|
||||
var card = zone.getSigni();
|
||||
if (card) card.beSelectedAsTarget();
|
||||
});
|
||||
|
@ -1312,8 +1330,7 @@ Card.prototype.attackAsyn = function () {
|
|||
if (!inArr(card,player.signis)) return;
|
||||
// 处理陷阱
|
||||
var opposingSigni = card.getOpposingSigni();
|
||||
var index = this.player.signiZones.indexOf(this.zone);
|
||||
var opposingZone = this.player.opponent.signiZones[2-index];
|
||||
opposingZone = card.getOpposingZone();
|
||||
var trap = opposingZone.trap
|
||||
return Callback.immediately().callback(this,function () {
|
||||
if (opposingSigni || !trap) return;
|
||||
|
@ -1322,18 +1339,18 @@ Card.prototype.attackAsyn = function () {
|
|||
return card.handleTrapAsyn(event);
|
||||
});
|
||||
}).callback(this,function () {
|
||||
// 攻击被无效,结束处理
|
||||
if (event.prevented) return;
|
||||
// 处理战斗或伤害
|
||||
return Callback.forEach(attackedZones,function (attackedZone) {
|
||||
// 强制结束回合
|
||||
if (this.game.phase.checkForcedEndTurn()) return;
|
||||
// 攻击的卡不在场上,结束处理.
|
||||
if (!inArr(card,player.signis)) return;
|
||||
// 攻击被无效,结束处理
|
||||
if (event.prevented) return;
|
||||
// 若攻击的目标存在,进行战斗;
|
||||
// (暗杀的情况下,目标为正对面的 SIGNI 时,不战斗)
|
||||
var target = attackedZone.getSigni() || null;
|
||||
var battle = true;
|
||||
if (!target) battle = false;
|
||||
if (card.assassin && (target === opposingSigni)) battle = false;
|
||||
if (card.assassin && (attackedZone === opposingZone)) battle = false;
|
||||
if (battle) {
|
||||
// 战斗
|
||||
// 触发"进行战斗"时点
|
||||
|
@ -1375,7 +1392,7 @@ Card.prototype.attackAsyn = function () {
|
|||
});
|
||||
} else {
|
||||
// 伤害
|
||||
if (target !== opposingSigni) {
|
||||
if (attackedZone !== opposingZone) {
|
||||
// 攻击非正面的区域
|
||||
if (!this.game.getData(card.player,'damageWhenAttackSigniZone')) {
|
||||
return;
|
||||
|
@ -1394,6 +1411,7 @@ Card.prototype.attackAsyn = function () {
|
|||
return;
|
||||
}
|
||||
}
|
||||
},this);
|
||||
});
|
||||
});
|
||||
}).callback(this,function () {
|
||||
|
@ -1654,9 +1672,15 @@ Card.prototype.getTotalEnerCost = function (original) {
|
|||
};
|
||||
|
||||
Card.prototype.getOpposingSigni = function () {
|
||||
var zone = this.getOpposingZone();
|
||||
if (!zone) return null;
|
||||
return zone.getSigni() || null;
|
||||
};
|
||||
|
||||
Card.prototype.getOpposingZone = function () {
|
||||
if (!inArr(this,this.player.signis)) return null;
|
||||
var idx = 2 - this.player.signiZones.indexOf(this.zone);
|
||||
return this.player.opponent.signiZones[idx].getSigni() || null;
|
||||
return this.player.opponent.signiZones[idx];
|
||||
};
|
||||
|
||||
Card.prototype.charmTo = function (signi) {
|
||||
|
|
|
@ -116625,7 +116625,6 @@ var CardInfo = {
|
|||
},{
|
||||
wisdom: 10,
|
||||
action: function (set,add) {
|
||||
// TODO: ...
|
||||
set(this,'_2278',true);
|
||||
},
|
||||
}],
|
||||
|
|
Loading…
Reference in a new issue