mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-01 07:24:30 +08:00
refactor: 特殊属性改成集合
This commit is contained in:
1 parent
f97e7c1bff
commit
39f38cd703
6 files changed
+51
-87
No files matched your search
@@ -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 = '';
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in new issue
Block a user