diff --git a/noname/library/element/content.js b/noname/library/element/content.js index 81965aa48..9a1cdaeda 100644 --- a/noname/library/element/content.js +++ b/noname/library/element/content.js @@ -1049,7 +1049,8 @@ export const Content = { card.cards = cards.slice(0); event.card = card; } - if (!lib.filter.cardEnabled(card, player) || (event.addCount !== false && !lib.filter.cardUsable(card, player))) { + if (!lib.filter.cardEnabled(card, player) || event.addCount !== false && + !lib.filter.cardUsable(card, player, event.getParent('chooseToUse'))) { event.result = { bool: false }; event.finish(); return; diff --git a/noname/library/element/player.js b/noname/library/element/player.js index 0145806f5..08ed00819 100644 --- a/noname/library/element/player.js +++ b/noname/library/element/player.js @@ -6892,7 +6892,11 @@ export class Player extends HTMLDivElement { var info = get.info(card); if (info.multicheck && !info.multicheck(card, this)) return false; if (!lib.filter.cardEnabled(card, this)) return false; - if (includecard && !lib.filter.cardUsable(card, this)) return false; + if (includecard){ + let evt = includecard; + if(typeof evt !== 'object') evt = _status.event.getParent('chooseToUse'); + if(!lib.filter.cardUsable(card, this, evt)) return false; + } if (distance !== false && !lib.filter.targetInRange(card, this, target)) return false; return lib.filter[includecard ? 'targetEnabledx' : 'targetEnabled'](card, this, target); } diff --git a/noname/library/index.js b/noname/library/index.js index 43bdaad58..3f6aa4bb1 100644 --- a/noname/library/index.js +++ b/noname/library/index.js @@ -9967,11 +9967,12 @@ export class Library extends Uninstantable { return filterTarget(card, player, current); }); }, - targetEnabledx: function (card, player, target) { + targetEnabledx: function (card, player, target, event) { if (!card) return false; if (!target || !target.isIn()) return false; - var event = _status.event; - if (event._backup && event._backup.filterCard == lib.filter.filterCard && (!lib.filter.cardEnabled(card, player, event) || !lib.filter.cardUsable(card, player, event))) return false; + if(typeof event !== 'object') event = _status.event.getParent('chooseToUse'); + if (event._backup && event._backup.filterCard == lib.filter.filterCard && + (!lib.filter.cardEnabled(card, player, event) || !lib.filter.cardUsable(card, player, event))) return false; if (event.addCount_extra) { if (!lib.filter.cardUsable2(card, player) && !game.checkMod(card, player, target, false, 'cardUsableTarget', player)) return false; }