fix: 多朝向怪物

This commit is contained in:
unanmed 2024-03-02 15:51:58 +08:00
parent 5831b18724
commit 828e061fdd
3 changed files with 17 additions and 4 deletions

View File

@ -56,6 +56,14 @@ function init() {
callback?.();
};
const getFacedId = (enemy: DamageEnemy) => {
const e = enemy.enemy;
if (e.displayIdInBook) return e.displayIdInBook;
if (e.faceIds) return e.faceIds.down;
return e.id;
};
core.enemys.getCurrentEnemys = function getCurrentEnemys(
floorId = core.status.floorId
) {
@ -65,7 +73,8 @@ function init() {
Damage.ensureFloorDamage(floorId);
const floor = core.status.maps[floorId];
floor.enemy.list.forEach(v => {
if (!(v.id in used)) {
const id = getFacedId(v);
if (!(id in used)) {
const e = new DamageEnemy(v.enemy);
e.calAttribute();
e.getRealInfo();
@ -75,9 +84,9 @@ function init() {
onMapEnemy: [v]
};
enemys.push(curr);
used[v.id] = curr.onMapEnemy;
used[id] = curr.onMapEnemy;
} else {
used[v.id].push(v);
used[id].push(v);
}
});

View File

@ -31,7 +31,6 @@ export function getDetailedEnemy(
const special: [string, string, string][] = enemy.info.special.map(vv => {
const s = Mota.require('var', 'enemySpecials')[vv];
const info = { ...enemy.enemy, ...enemy.info };
console.log(info);
return [
fromFunc(s.name, info),

View File

@ -58,6 +58,11 @@ type Enemy<I extends EnemyIds = EnemyIds> = {
*/
displayIdInBook: EnemyIds;
/**
*
*/
faceIds: Record<Dir, EnemyIds>;
/**
*
*/