🐛 fix not removing triggering effects when lose ability

This commit is contained in:
WEBXOSS 2017-06-10 22:01:51 +08:00
parent 160d4ca8fb
commit 420a917225
2 changed files with 6 additions and 0 deletions

View file

@ -160,6 +160,11 @@ ConstEffectManager.prototype.compute = function () {
cardsAbilityLost.forEach(function (card) { cardsAbilityLost.forEach(function (card) {
if (!oldAbilityLostMap[card.gid]) { if (!oldAbilityLostMap[card.gid]) {
// 从"不失去能力"变为"失去能力" // 从"不失去能力"变为"失去能力"
this.game.triggeringEffects.forEach(function (effect) {
if (effect.source === card) {
effect.disabled = true;
}
});
this.game.effectManager.removeTriggeredEffectBySource(card); this.game.effectManager.removeTriggeredEffectBySource(card);
} }
},this); },this);

View file

@ -65,6 +65,7 @@ Effect.prototype.triggerAndHandleAsyn = function (event) {
}; };
Effect.prototype.checkCondition = function () { Effect.prototype.checkCondition = function () {
if (this.disabled) return false;
// "结束这个回合",如<终结之洞> // "结束这个回合",如<终结之洞>
var game = this.effectManager.game; var game = this.effectManager.game;
if (game.getData(game,'endThisTurn')) return false; if (game.getData(game,'endThisTurn')) return false;