1
0
Fork 0

Fix spellCutIn in attackPhase

This commit is contained in:
WEBXOSS 2016-12-10 23:00:26 +08:00
parent e567fcfcb8
commit db0c16a10f

View file

@ -736,7 +736,7 @@ Player.prototype.useSpellCutInArtsAsyn = function () {
cards = cards.concat(this.getResonas({spellCutIn: true})); cards = cards.concat(this.getResonas({spellCutIn: true}));
concat(this.signis,this.lrig).forEach(function (card) { concat(this.signis,this.lrig).forEach(function (card) {
var hasSpellCutInEffect = card.actionEffects.some(function (effect) { var hasSpellCutInEffect = card.actionEffects.some(function (effect) {
return effect.spellCutIn && this.canUseActionEffect(effect); return this.canUseActionEffect(effect,{spellCutIn: true});
},this); },this);
if (hasSpellCutInEffect) cards.push(card); if (hasSpellCutInEffect) cards.push(card);
},this); },this);
@ -798,12 +798,16 @@ Player.prototype.canUseActionEffect = function (effect,arg) {
// inTrashZone // inTrashZone
if (effect.source.zone === this.trashZone && !effect.activatedInTrashZone) return false; if (effect.source.zone === this.trashZone && !effect.activatedInTrashZone) return false;
if (effect.source.zone !== this.handZone && effect.activatedInHand) return false; if (effect.source.zone !== this.handZone && effect.activatedInHand) return false;
// attackPhase // attackPhase && spellCutIn
if (arg.spellCutIn) {
if (!effect.spellCutIn) return false;
} else {
if (this.game.phase.isAttackPhase()) { if (this.game.phase.isAttackPhase()) {
if (!effect.attackPhase) return false; if (!effect.attackPhase) return false;
} else { } else {
if (effect.attackPhase && !effect.mainPhase) return false; if (effect.attackPhase && !effect.mainPhase) return false;
} }
}
// onAttack // onAttack
if (arg.onAttack && !effect.onAttack) return false; if (arg.onAttack && !effect.onAttack) return false;
if (!arg.onAttack && effect.onAttack) return false; if (!arg.onAttack && effect.onAttack) return false;