diff --git a/noname/get/index.js b/noname/get/index.js index 02f0f50a5..6c271fd2b 100644 --- a/noname/get/index.js +++ b/noname/get/index.js @@ -6,6 +6,7 @@ import { ui } from "../ui/index.js"; import { CacheContext } from "../library/cache/cacheContext.js"; import { Is } from "./is.js"; import { Promises } from "./promises.js"; +import { rootURL } from "../../noname.js"; export class Get { is = new Is(); @@ -36,8 +37,8 @@ export class Get { * @param { Array|Object|import("../library/element/character").Character } data * @returns {import("../library/element/character").Character} */ - convertedCharacter(data){ - if(!(data instanceof lib.element.Character)) return new lib.element.Character(data); + convertedCharacter(data) { + if (!(data instanceof lib.element.Character)) return new lib.element.Character(data); return data; } /** @@ -116,14 +117,7 @@ export class Get { objectURL(octetStream) { const objectURLMap = lib.objectURL; if (objectURLMap.has(octetStream)) return objectURLMap.get(octetStream); - const objectURL = URL.createObjectURL( - new Blob([ - Uint8Array.from( - atob(octetStream.replace(/^data:[\s\S]*\/[\s\S]*;base64,/, "")), - (character) => character.charCodeAt() - ), - ]) - ); + const objectURL = URL.createObjectURL(new Blob([Uint8Array.from(atob(octetStream.replace(/^data:[\s\S]*\/[\s\S]*;base64,/, "")), character => character.charCodeAt())])); objectURLMap.set(octetStream, objectURL); return objectURL; } @@ -149,15 +143,11 @@ export class Get { } complexYingbianConditions(card) { const complexYingbianConditions = Array.from(lib.yingbian.condition.complex.keys()); - return card - ? complexYingbianConditions.filter((value) => get.cardtag(card, `yingbian_${value}`)) - : complexYingbianConditions; + return card ? complexYingbianConditions.filter(value => get.cardtag(card, `yingbian_${value}`)) : complexYingbianConditions; } simpleYingbianConditions(card) { const simpleYingbianConditions = Array.from(lib.yingbian.condition.simple.keys()); - return card - ? simpleYingbianConditions.filter((value) => get.cardtag(card, `yingbian_${value}`)) - : simpleYingbianConditions; + return card ? simpleYingbianConditions.filter(value => get.cardtag(card, `yingbian_${value}`)) : simpleYingbianConditions; } /** * Get the Yingbian effects (of the card) @@ -166,9 +156,7 @@ export class Get { */ yingbianEffects(card) { const yingbianEffects = Array.from(lib.yingbian.effect.keys()); - return card - ? yingbianEffects.filter((value) => get.cardtag(card, `yingbian_${value}`)) - : yingbianEffects; + return card ? yingbianEffects.filter(value => get.cardtag(card, `yingbian_${value}`)) : yingbianEffects; } /** * Get the default Yingbian effect of the card @@ -234,8 +222,7 @@ export class Get { const pinyins = lib.pinyins; if (pinyins) { const pinyin = pinyins[chinese]; - if (Array.isArray(pinyin)) - return withTone === false ? pinyin.map(pinyinUtilx.removeTone) : pinyin.slice(); + if (Array.isArray(pinyin)) return withTone === false ? pinyin.map(pinyinUtilx.removeTone) : pinyin.slice(); } return pinyinUtilx.getPinyin(chinese, null, withTone, true); } @@ -249,8 +236,7 @@ export class Get { for (let i of lib.pinyins._metadata.shengmu) { if (str.startsWith(i)) { str = str.slice(i.length); - if (str[0] == "u" && lib.pinyins._metadata.special_shengmu.includes(i)) - str = "ü" + str.slice(1); + if (str[0] == "u" && lib.pinyins._metadata.special_shengmu.includes(i)) str = "ü" + str.slice(1); break; } } @@ -301,8 +287,7 @@ export class Get { for (let i of lib.pinyins._metadata.shengmu) { if (str.startsWith(i)) { str = str.slice(i.length); - if (str[0] == "u" && lib.pinyins._metadata.special_shengmu.includes(i)) - str = "ü" + str.slice(1); + if (str[0] == "u" && lib.pinyins._metadata.special_shengmu.includes(i)) str = "ü" + str.slice(1); break; } } @@ -342,18 +327,16 @@ export class Get { return list; } numOf(obj, item) { - return obj.filter((element) => element == item).length; + return obj.filter(element => element == item).length; } connectNickname() { - return typeof lib.config.connect_nickname == "string" - ? lib.config.connect_nickname.slice(0, 12) - : "无名玩家"; + return typeof lib.config.connect_nickname == "string" ? lib.config.connect_nickname.slice(0, 12) : "无名玩家"; } zhinangs(filter) { var list = (_status.connectMode ? lib.configOL : lib.config).zhinang_tricks; if (!list || !list.filter || !list.length) return get.inpile("trick", "trick").randomGets(3); if (filter === false) return list.slice(0); - list = list.filter((card) => lib.inpile.includes(card)); + list = list.filter(card => lib.inpile.includes(card)); if (list.length) return list; return get.inpile("trick", "trick").randomGets(3); } @@ -450,7 +433,7 @@ export class Get { return list; } discarded() { - return _status.discarded.filter((item) => item.parentNode == ui.discardPile); + return _status.discarded.filter(item => item.parentNode == ui.discardPile); } cardOffset() { var x = ui.arena.getBoundingClientRect(); @@ -612,7 +595,7 @@ export class Get { character(name, num) { let info = lib.character[name]; if (!info) { - const pack = Object.keys(lib.characterPack).find((pack) => name in lib.characterPack[pack]); + const pack = Object.keys(lib.characterPack).find(pack => name in lib.characterPack[pack]); if (pack) info = get.convertedCharacter(lib.characterPack[pack][name]); } if (typeof num === "number") { @@ -645,8 +628,8 @@ export class Get { return "暂无武将介绍"; } bordergroup(info, raw) { - if(typeof info == 'string') info = get.character(info); - if(info.groupBorder) return info.groupBorder; + if (typeof info == "string") info = get.character(info); + if (info.groupBorder) return info.groupBorder; return raw ? "" : info.group || ""; } groupnature(group, method) { @@ -839,16 +822,14 @@ export class Get { } }; if (/[^a-zA-Z]/.test(i)) { - insertDefaultString = - indent + ' "' + i + '":' + get.stringify(obj[i], level + 1) + ",\n"; + insertDefaultString = indent + ' "' + i + '":' + get.stringify(obj[i], level + 1) + ",\n"; if (typeof obj[i] !== "function") { str += insertDefaultString; } else { str += parseFunction(i); } } else { - insertDefaultString = - indent + " " + i + ":" + get.stringify(obj[i], level + 1) + ",\n"; + insertDefaultString = indent + " " + i + ":" + get.stringify(obj[i], level + 1) + ",\n"; if (typeof obj[i] !== "function") { str += insertDefaultString; } else { @@ -906,7 +887,7 @@ export class Get { copy(obj, copyKeyDeep = false, map = new WeakMap()) { // 参考[这里](https://juejin.cn/post/7315612852890026021)实现深拷贝 // 不再判断是否能structuredClone是因为structuredClone会把Symbol给毙了 - const getType = (obj) => Object.prototype.toString.call(obj); + const getType = obj => Object.prototype.toString.call(obj); const canTranverse = { "[object Map]": true, @@ -917,12 +898,7 @@ export class Get { "[object Date]": true, }; - if ( - typeof obj !== "object" || - obj === null || - !canTranverse[getType(obj)] - ) - return obj; + if (typeof obj !== "object" || obj === null || !canTranverse[getType(obj)]) return obj; // @ts-ignore if (map.has(obj)) return map.get(obj); @@ -933,17 +909,13 @@ export class Get { // (实际上需要处理的只有Map和Set) // 除此之外的就只能祝愿有拷贝构造函数了 const target = constructor - ? Array.isArray(obj) || - obj instanceof Map || - obj instanceof Set || - constructor === Object + ? Array.isArray(obj) || obj instanceof Map || obj instanceof Set || constructor === Object ? // @ts-ignore new constructor() - : constructor.name in window && - /\[native code\]/.test(constructor.toString()) - ? // @ts-ignore - new constructor(obj) - : obj + : constructor.name in window && /\[native code\]/.test(constructor.toString()) + ? // @ts-ignore + new constructor(obj) + : obj : Object.create(null); if (target === obj) return target; @@ -951,13 +923,10 @@ export class Get { if (obj instanceof Map) { obj.forEach((value, key) => { - target.set( - copyKeyDeep ? get.copy(key, copyKeyDeep, map) : key, - get.copy(value, copyKeyDeep, map) - ); + target.set(copyKeyDeep ? get.copy(key, copyKeyDeep, map) : key, get.copy(value, copyKeyDeep, map)); }); } else if (obj instanceof Set) { - obj.forEach((value) => { + obj.forEach(value => { target.add(get.copy(value, copyKeyDeep, map)); }); } @@ -969,11 +938,7 @@ export class Get { if (obj.hasOwnProperty(key)) { const result = { enumerable, configurable }; if (descriptor.hasOwnProperty("value")) { - result.value = get.copy( - descriptor.value, - copyKeyDeep, - map - ); + result.value = get.copy(descriptor.value, copyKeyDeep, map); result.writable = descriptor.writable; } else { const { get, set } = descriptor; @@ -986,7 +951,7 @@ export class Get { } const symbols = Object.getOwnPropertySymbols(obj); - symbols.forEach((symbol) => { + symbols.forEach(symbol => { target[symbol] = get.copy(obj[symbol], copyKeyDeep, map); }); @@ -1045,11 +1010,7 @@ export class Get { if (typeof filter == "function" && !filter(i)) continue; if (lib.config.bannedcards.includes(i)) continue; if (!lib.translate[i + "_info"]) continue; - if ( - (type.startsWith("equip") && type.length == 6) || - (type.startsWith("hslingjian") && type.length == 11) || - type.startsWith("spell_") - ) { + if ((type.startsWith("equip") && type.length == 6) || (type.startsWith("hslingjian") && type.length == 11) || type.startsWith("spell_")) { if (get.subtype(i) == type) list.push(i); } else { if (get.type(i) == type) list.push(i); @@ -1132,16 +1093,9 @@ export class Get { case "zhong": return (config.double_character ? "双将" : "") + "忠胆英杰"; case "stratagem": - return ( - get.cnNumber(parseInt(config.number)) + - "人" + - (config.double_character ? "双将" : "") + - "谋攻" - ); + return get.cnNumber(parseInt(config.number)) + "人" + (config.double_character ? "双将" : "") + "谋攻"; default: - return `${get.cnNumber(parseInt(config.number))}人${config.double_nei ? "双内" : ""}${ - config.enable_commoner ? "带民" : "" - }${config.double_character ? "双将" : ""}身份`; + return `${get.cnNumber(parseInt(config.number))}人${config.double_nei ? "双内" : ""}${config.enable_commoner ? "带民" : ""}${config.double_character ? "双将" : ""}身份`; } } if (config.mode == "guozhan") { @@ -1188,7 +1142,7 @@ export class Get { return lib[_status.connectMode ? "configOL" : "config"].mode; } idDialog(id) { - return ui.dialogs.find((dialog) => dialog.videoId == id) || null; + return ui.dialogs.find(dialog => dialog.videoId == id) || null; } arenaState() { var state = { @@ -1350,11 +1304,7 @@ export class Get { if (rank.c.includes(name)) return num ? Math.round((1 * (num - 1)) / 8 + 1) : "c"; if (rank.d.includes(name)) return num ? Math.round((0 * (num - 1)) / 8 + 1) : "d"; if (lib.character[name]) { - if ( - lib.character[name].isBoss || - lib.character[name].isBossAllowed || - lib.character[name].isHiddenBoss - ) { + if (lib.character[name].isBoss || lib.character[name].isBossAllowed || lib.character[name].isHiddenBoss) { return num ? Math.round((9 * (num - 1)) / 8 + 1) : "sp"; } } @@ -1401,11 +1351,7 @@ export class Get { if (add) break; } } - if ( - info.trigger && - ((typeof info.trigger.player == "string" && info.trigger.player.startsWith("use")) || - info.trigger.source) - ) { + if (info.trigger && ((typeof info.trigger.player == "string" && info.trigger.player.startsWith("use")) || info.trigger.source)) { num += 0.3; } if (num > 1 && threaten > 1) { @@ -1418,21 +1364,14 @@ export class Get { } if (info.trigger) { if (info.trigger.global) { - var list = Array.isArray(info.trigger.global) - ? info.trigger.global - : [info.trigger.global]; + var list = Array.isArray(info.trigger.global) ? info.trigger.global : [info.trigger.global]; num += Math.min(3, list.length) / 10; for (var i of list) { if (i.startsWith("lose") || i.startsWith("use")) num += 0.3; if (i.startsWith("cardsDiscard")) num += 0.4; } } - if ( - info.trigger.target || - (typeof info.trigger.player == "string" && - (info.trigger.player.startsWith("damage") || info.trigger.player.startsWith("lose"))) - ) - num += 0.1; + if (info.trigger.target || (typeof info.trigger.player == "string" && (info.trigger.player.startsWith("damage") || info.trigger.player.startsWith("lose")))) num += 0.1; } if (info.ai) { if (info.ai.maixie || info.ai.maixie_hp || info.ai.maixie_defend) { @@ -1469,7 +1408,7 @@ export class Get { return info; } infoTargets(infos) { - return Array.from(infos || []).map((info) => game.playerMap[info]); + return Array.from(infos || []).map(info => game.playerMap[info]); } cardInfo(card) { return [card.suit, card.number, card.name, card.nature]; @@ -1488,9 +1427,7 @@ export class Get { return Array.from(infos || []).map(get.infoCard); } cardInfoOL(card) { - return ( - "_noname_card:" + JSON.stringify([card.cardid, card.suit, card.number, card.name, card.nature]) - ); + return "_noname_card:" + JSON.stringify([card.cardid, card.suit, card.number, card.name, card.nature]); } infoCardOL(info) { if (!lib.cardOL) return info; @@ -1579,15 +1516,10 @@ export class Get { const key = entry[0]; if (key == "_trigger") { if (noMore !== false) stringifying[key] = get.eventInfoOL(entry[1], null, false); - } else if ( - !lib.element.GameEvent.prototype[key] && - key != "content" && - get.itemtype(entry[1]) != "event" - ) - stringifying[key] = get.stringifiedResult(entry[1], null, false); + } else if (!lib.element.GameEvent.prototype[key] && key != "content" && get.itemtype(entry[1]) != "event") stringifying[key] = get.stringifiedResult(entry[1], null, false); return stringifying; }, {}) - )}` + )}` : ""; } /** @@ -1596,7 +1528,7 @@ export class Get { infoEventOL(item) { const evt = new lib.element.GameEvent(); try { - Object.entries(JSON.parse(item.slice(14))).forEach((entry) => { + Object.entries(JSON.parse(item.slice(14))).forEach(entry => { const key = entry[0]; if (typeof evt[key] != "function") evt[key] = get.parsedResult(entry[1]); }); @@ -1689,7 +1621,7 @@ export class Get { verticalStr(str, sp) { if (typeof str != "string") return ""; return Array.from(str) - .filter((value) => value != "`") + .filter(value => value != "`") .join(""); } numStr(num, method) { @@ -1726,8 +1658,7 @@ export class Get { const prefix = lib.translate[`${str}_prefix`]; if (prefix && slimName.startsWith(prefix)) { //兼容版特化处理 - if (lib.compatibleEdition) - return `${get.prefixSpan(prefix, str)}${slimName.slice(prefix.length)} `; + if (lib.compatibleEdition) return `${get.prefixSpan(prefix, str)}${slimName.slice(prefix.length)} `; return `${get.prefixSpan(prefix, str)}${slimName.slice(prefix.length)}`; } return slimName; @@ -1844,37 +1775,28 @@ export class Get { } if (bool) return "position"; } - if ( - obj.includes(lib.natureSeparator) && - obj.split(lib.natureSeparator).every((n) => lib.nature.has(n)) - ) - return "natures"; + if (obj.includes(lib.natureSeparator) && obj.split(lib.natureSeparator).every(n => lib.nature.has(n))) return "natures"; if (lib.nature.has(obj)) return "nature"; } if (Array.isArray(obj) && obj.length > 0) { - if (obj.every((p) => p instanceof lib.element.Player)) return "players"; - if (obj.every((p) => p instanceof lib.element.Card)) return "cards"; + if (obj.every(p => p instanceof lib.element.Player)) return "players"; + if (obj.every(p => p instanceof lib.element.Card)) return "cards"; if (obj.length == 2) { if (typeof obj[0] == "number" && typeof obj[1] == "number") { if (obj[0] <= obj[1] || obj[1] <= -1) return "select"; } } if (obj.length == 4) { - if (obj.every((p) => typeof p == "number")) { + if (obj.every(p => typeof p == "number")) { return "divposition"; } } } - if ( - obj instanceof lib.element.Button || - (obj instanceof HTMLDivElement && obj.classList.contains("button")) - ) - return "button"; + if (obj instanceof lib.element.Button || (obj instanceof HTMLDivElement && obj.classList.contains("button"))) return "button"; if (obj instanceof lib.element.Card) return "card"; if (obj instanceof lib.element.Player) return "player"; if (obj instanceof lib.element.Dialog) return "dialog"; - if (obj instanceof lib.element.GameEvent || obj instanceof lib.element.GameEventPromise) - return "event"; + if (obj instanceof lib.element.GameEvent || obj instanceof lib.element.GameEventPromise) return "event"; if (typeof obj !== "object" || obj === null) return; @@ -1906,7 +1828,7 @@ export class Get { name .slice(4) .split("_") - .every((n) => lib.nature.has(n)) + .every(n => lib.nature.has(n)) ) return lib.card["sha"].type; } @@ -1966,13 +1888,7 @@ export class Get { if (player !== false) { const owner = player || get.owner(card); if (owner) { - return game.checkMod( - card, - owner, - game.checkMod(card, card.suit, "suit", owner), - "cardsuit", - owner - ); + return game.checkMod(card, owner, game.checkMod(card, card.suit, "suit", owner), "cardsuit", owner); } } if (card.suit === "unsure" || lib.suits.includes(card.suit)) return card.suit; @@ -2037,8 +1953,7 @@ export class Get { * @returns {string} */ nature(card, player) { - if (typeof card == "string") - return card.split(lib.natureSeparator).sort(lib.sort.nature).join(lib.natureSeparator); + if (typeof card == "string") return card.split(lib.natureSeparator).sort(lib.sort.nature).join(lib.natureSeparator); if (Array.isArray(card)) return card.sort(lib.sort.nature).join(lib.natureSeparator); var nature = card.nature; if (get.itemtype(player) == "player" || (player !== false && get.position(card) == "h")) { @@ -2123,24 +2038,13 @@ export class Get { for (let iwhile = 0; iwhile < totalPopulation; iwhile++) { if (player.nextSeat != to) { player = player.nextSeat; - if ( - player.isAlive() && - !player.isOut() && - !player.hasSkill("undist") && - !player.isMin(true) - ) - n++; + if (player.isAlive() && !player.isOut() && !player.hasSkill("undist") && !player.isMin(true)) n++; } else { break; } } for (let i = 0; i < game.players.length; i++) { - if ( - game.players[i].isOut() || - game.players[i].hasSkill("undist") || - game.players[i].isMin(true) - ) - length--; + if (game.players[i].isOut() || game.players[i].hasSkill("undist") || game.players[i].isMin(true)) length--; } if (method == "absolute") return n; if (from.isDead()) length++; @@ -2266,7 +2170,7 @@ export class Get { else players.sortBySeat(get.itemtype(sort) == "player" ? sort : _status.event.player); } if (dead) players = players.concat(game.dead); - if (!out) players = players.filter((current) => !current.isOut()); + if (!out) players = players.filter(current => !current.isOut()); return players; } position(card, ordering) { @@ -2275,8 +2179,7 @@ export class Get { if (card.destiny.classList.contains("equips")) return "e"; if (card.destiny.classList.contains("judges")) return "j"; if (card.destiny.classList.contains("expansions")) return "x"; - if (card.destiny.classList.contains("handcards")) - return card.classList.contains("glows") ? "s" : "h"; + if (card.destiny.classList.contains("handcards")) return card.classList.contains("glows") ? "s" : "h"; if (card.destiny.id == "cardPile") return "c"; if (card.destiny.id == "discardPile") return "d"; if (card.destiny.id == "special") return "s"; @@ -2287,8 +2190,7 @@ export class Get { if (card.parentNode.classList.contains("equips")) return "e"; if (card.parentNode.classList.contains("judges")) return "j"; if (card.parentNode.classList.contains("expansions")) return "x"; - if (card.parentNode.classList.contains("handcards")) - return card.classList.contains("glows") ? "s" : "h"; + if (card.parentNode.classList.contains("handcards")) return card.classList.contains("glows") ? "s" : "h"; if (card.parentNode.id == "cardPile") return "c"; if (card.parentNode.id == "discardPile") return "d"; if (card.parentNode.id == "special") return "s"; @@ -2460,21 +2362,19 @@ export class Get { if (numStr.length <= 2) { //两位数以下单独处理保证效率 if (numStr.length === 1) return !ordinal && num === 2 ? "两" : chars[num]; - return `${numStr[0] === "1" ? "" : chars[numStr[0]]}十${ - numStr[1] === "0" ? "" : chars[numStr[1]] - }`; + return `${numStr[0] === "1" ? "" : chars[numStr[0]]}十${numStr[1] === "0" ? "" : chars[numStr[1]]}`; } numStr = numStr .replace(/(?=(\d{4})+$)/g, ",") .split(",") .filter(Boolean); - const handleZero = (str) => { + const handleZero = str => { let result = str.replace(/零{2,}/g, "零"); if (result.length > 1) result = result.replace(/零+$/g, ""); return result; }; - const _transform = (str) => { + const _transform = str => { if (str === "2" && !ordinal) return "两"; let result = ""; for (let i = 0; i < str.length; i++) { @@ -2529,10 +2429,7 @@ export class Get { var buttons = _status.event.dialog.buttons; var selectable = []; for (var i = 0; i < buttons.length; i++) { - if ( - buttons[i].classList.contains("selectable") && - buttons[i].classList.contains("selected") == false - ) { + if (buttons[i].classList.contains("selectable") && buttons[i].classList.contains("selected") == false) { selectable.push(buttons[i]); } } @@ -2550,10 +2447,7 @@ export class Get { var cards = _status.event.player.getCards("hes"); var selectable = []; for (var i = 0; i < cards.length; i++) { - if ( - cards[i].classList.contains("selectable") && - cards[i].classList.contains("selected") == false - ) { + if (cards[i].classList.contains("selectable") && cards[i].classList.contains("selected") == false) { selectable.push(cards[i]); } } @@ -2591,8 +2485,7 @@ export class Get { var info = lib.skill[skill]; if (lib.filter.skillDisabled(skill)) continue; if (func && !func(info, skill, i)) continue; - if (player && player.hasSkill && info.ai && info.ai.combo && !player.hasSkill(info.ai.combo)) - continue; + if (player && player.hasSkill && info.ai && info.ai.combo && !player.hasSkill(info.ai.combo)) continue; list.add(skill); } } @@ -2643,10 +2536,7 @@ export class Get { var players = game.players.slice(0); if (_status.event.deadTarget) players.addArray(game.dead); for (var i = 0; i < players.length; i++) { - if ( - players[i].classList.contains("selectable") && - players[i].classList.contains("selected") == false - ) { + if (players[i].classList.contains("selectable") && players[i].classList.contains("selected") == false) { selectable.push(players[i]); } } @@ -2740,7 +2630,7 @@ export class Get { return num; } owner(card, method) { - return game.players.concat(game.dead).find((current) => { + return game.players.concat(game.dead).find(current => { if (current.judging[0] == card && method != "judge") return true; let parent = card.parentNode; if (parent == current.node.handcards1 || parent == current.node.handcards2) { @@ -2761,30 +2651,16 @@ export class Get { return ui.selected.buttons.length + ui.selected.cards.length + ui.selected.targets.length == 0; } population(identity) { - return identity == undefined - ? game.players.length + game.dead.length - : game.players.filter((current) => current.identity == identity).length; + return identity == undefined ? game.players.length + game.dead.length : game.players.filter(current => current.identity == identity).length; } totalPopulation(identity) { - return identity == undefined - ? game.players.length + game.dead.length - : game.players.concat(game.dead).filter((current) => current.identity == identity).length; + return identity == undefined ? game.players.length + game.dead.length : game.players.concat(game.dead).filter(current => current.identity == identity).length; } /** * @param { Card | VCard } item */ cardtag(item, tag) { - return ( - (item.cardid && - (get.itemtype(item) == "card" || - !item.cards || - !item.cards.length || - item.name == item.cards[0].name) && - _status.cardtag && - _status.cardtag[tag] && - _status.cardtag[tag].includes(item.cardid)) || - (item.cardtags && item.cardtags.includes(tag)) - ); + return (item.cardid && (get.itemtype(item) == "card" || !item.cards || !item.cards.length || item.name == item.cards[0].name) && _status.cardtag && _status.cardtag[tag] && _status.cardtag[tag].includes(item.cardid)) || (item.cardtags && item.cardtags.includes(tag)); } tag(item, tag, item2, bool) { var result; @@ -2933,16 +2809,7 @@ export class Get { opacity = ""; } var skilltrans = get.translation(skills[i]).slice(0, 2); - str += - '