diff --git a/Card.js b/Card.js index 5b360d7..cb3f6aa 100644 --- a/Card.js +++ b/Card.js @@ -1480,4 +1480,12 @@ Card.prototype.canBeBanished = function () { return true; }; +Card.prototype.canGainAbility = function (source) { + let canNotGainAbility = + this.canNotGainAbility || + (this.player.signiCanNotGainAbility && this.type === 'SIGNI') || + (this.canNotGainAbilityBySelfPlayer && source && source.player === this.player); + return !canNotGainAbility; +}; + global.Card = Card; \ No newline at end of file diff --git a/CardInfo.js b/CardInfo.js index 6149525..41e481a 100644 --- a/CardInfo.js +++ b/CardInfo.js @@ -109953,7 +109953,7 @@ var CardInfo = { source: this, description: '1801-attached-2', actionAsyn: function () { - this.game.tillTurnEndSet(this,this.player,'canNotGainAbility',true,{forced: true}); + this.game.tillTurnEndSet(this,this.player,'signiCanNotGainAbility',true,{forced: true}); } },{ source: this, diff --git a/Mask.js b/Mask.js index ae4ded9..fe7b9fb 100644 --- a/Mask.js +++ b/Mask.js @@ -28,14 +28,9 @@ Mask.prototype.set = function (reset) { var effect = this.value; var source = effect.source; // 不能获得新能力 - if (source.canNotGainAbility || source.player.canNotGainAbility) { + if (!source.canGainAbility(this.source)) { return; } - if (source.canNotGainAbilityBySelfPlayer) { - if (this.source && (this.source.player === source.player)) { - return; - } - } effect.disabled = false; timming.effects.push(effect); effect.source.registeredEffects.push(effect); @@ -54,14 +49,9 @@ Mask.prototype.set = function (reset) { } else { if (!reset && target.player && inArr(this.prop,Card.abilityProps)) { // 不能获得新能力 - if (target.canNotGainAbility && target.player.canNotGainAbility) { + if (!target.canGainAbility(this.source)) { return; } - if (target.canNotGainAbilityBySelfPlayer) { - if (this.source && (this.source === target.player)) { - return; - } - } } target[this.prop] = this.value; } diff --git a/Player.js b/Player.js index cdef2c8..2af3711 100644 --- a/Player.js +++ b/Player.js @@ -133,7 +133,7 @@ function Player (game,io,mainDeck,lrigDeck) { this.wontLoseGame = false; // <紅蓮乙女 遊月・肆> this.canNotBeBanished = false; this.canNotBeBounced = false; - this.canNotGainAbility = false; + this.signiCanNotGainAbility = false; this.canNotBeDownedByOpponentEffect = false; this.canNotUseColorlessSigni = false; // <绿罗植 世界树> this.canNotUseColorlessSpell = false; // <绿罗植 世界树>