By [Q1] eh#2907
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/426924/933864/Zombacode.js
window.sortEntities = (...options) => {
var optionMatchMap = {};
for(let i in game.world.entities) {
let match = [];
let ei = game.world.entities[i].targetTick;
let opCount = 0;
options.forEach((option => {
option.attrs.forEach((attr => {
try {
match.push(ei[attr.name] === attr.eq);
} catch {
match.push(false);
};
}));
if(match.includes(true)) {
optionMatchMap[opCount] = {
eq: match,
uid: i
};
};
opCount++;
}));
};
return optionMatchMap;
};