From 420a91722501683583ebbb845b161ca66120086c Mon Sep 17 00:00:00 2001 From: WEBXOSS Date: Sat, 10 Jun 2017 22:01:51 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20not=20removing=20triggerin?= =?UTF-8?q?g=20effects=20when=20lose=20ability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ConstEffectManager.js | 5 +++++ Effect.js | 1 + 2 files changed, 6 insertions(+) diff --git a/ConstEffectManager.js b/ConstEffectManager.js index 13965ec..db0a977 100644 --- a/ConstEffectManager.js +++ b/ConstEffectManager.js @@ -160,6 +160,11 @@ ConstEffectManager.prototype.compute = function () { cardsAbilityLost.forEach(function (card) { if (!oldAbilityLostMap[card.gid]) { // 从"不失去能力"变为"失去能力" + this.game.triggeringEffects.forEach(function (effect) { + if (effect.source === card) { + effect.disabled = true; + } + }); this.game.effectManager.removeTriggeredEffectBySource(card); } },this); diff --git a/Effect.js b/Effect.js index 8cb988e..cb5cc31 100644 --- a/Effect.js +++ b/Effect.js @@ -65,6 +65,7 @@ Effect.prototype.triggerAndHandleAsyn = function (event) { }; Effect.prototype.checkCondition = function () { + if (this.disabled) return false; // "结束这个回合",如<终结之洞> var game = this.effectManager.game; if (game.getData(game,'endThisTurn')) return false;