fix: 获取buff性能优化

This commit is contained in:
AncTe committed 2024-11-06 12:41:46 +08:00
1 parent c476303527
commit e9b9e4b069
5 files changed
+37 -23

No files matched your search

+15
View File
@@ -62,6 +62,21 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
if (h.magicDef === void 0 || h.magicDef === null) {
h.magicDef = 0;
}
if (!core.status.hero.buff) {
const buff = {};
core.status.hero.buff = buff;
const toDelete = [];
for (const [key, value] of Object.entries(flags)) {
if (/__\w+_buff__/.test(key)) {
const name = key.slice(2, -7);
buff[name] = value;
toDelete.push(key);
}
}
toDelete.forEach(v => {
delete flags[v];
});
}
},
win: function (reason, norank, noexit) {
// 游戏获胜事件