refactor: 特殊属性改成集合

This commit is contained in:
AncTe committed 2024-09-30 10:35:25 +08:00
1 parent f97e7c1bff
commit 39f38cd703
6 files changed
+51 -87

No files matched your search

-19
View File
@@ -45,25 +45,6 @@ export function init() {
return true;
});
core.registerReplayAction('study', name => {
if (!name.startsWith('study:')) return false;
const [num, x, y] = name
.slice(6)
.split(',')
.map(v => parseInt(v));
if (!canStudySkill(num)) return false;
const id = core.getBlockId(x, y);
ensureFloorDamage(core.status.floorId);
const col = core.status.thisMap.enemy;
col.calRealAttribute();
const enemy = col.list.find(v => v.x === x && v.y === y)!.info;
if (!enemy.special.includes(num)) return false;
studySkill(enemy, num);
core.status.route.push(name);
core.replay();
return true;
});
// 商店
let shopOpened = false;
let openedShopId = '';
+1 -1
View File
@@ -28,7 +28,7 @@ export function getDetailedEnemy(
) => {
return typeof func === 'string' ? func : func(enemy);
};
const special: [string, string, string][] = enemy.info.special
const special: [string, string, string][] = [...enemy.info.special]
.filter(v => !enemy.info.specialHalo?.includes(v))
.map(vv => {
const s = Mota.require('var', 'enemySpecials')[vv];