Merge pull request #1039 from kuangshen04/test-Branch

修复借刀杀人complexTarget没有生效的问题
This commit is contained in:
Spmario233 2024-03-08 23:10:29 +08:00 committed by GitHub
commit 3dd83a3d99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 8 deletions

View File

@ -5874,17 +5874,18 @@ export class Game extends Uninstantable {
return false;
}
const useCache = !lib.config.compatiblemode && !event.skill && !event.multitarget
&& ['button', 'card', 'target'].every(type => {
if (!event[`filter${uppercaseType(type)}`]) return true;
// if (typeof event[`select${uppercaseType(type)}`] === 'function') return false;
if (get.select(event[`select${uppercaseType(type)}`])[1] < 0) return false;
if (type === "button") type = "select";
return !event[`complex${uppercaseType(type)}`];
});
let useCache = !lib.config.compatiblemode && !event.skill && !event.multitarget;
const filterCache = type => {
if (get.select(event[`select${uppercaseType(type)}`])[1] < 0) return false;
const cardinfo = get.info(get.card() || {});
if (cardinfo && cardinfo.complexTarget) return false;
if (type === "button") type = "select";
return !event[`complex${uppercaseType(type)}`];
};
['button', 'card', 'target'].forEach(type => {
if (!event[`filter${uppercaseType(type)}`]) return;
if (!filterCache(type)) useCache = false;
if (!ok) game.uncheck(type);
else ({ ok, auto = auto } = game.Check[type](event, useCache));
});