mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-06-09 00:38:00 +08:00
fix: 多朝向怪物
This commit is contained in:
parent
5831b18724
commit
828e061fdd
@ -56,6 +56,14 @@ function init() {
|
|||||||
callback?.();
|
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(
|
core.enemys.getCurrentEnemys = function getCurrentEnemys(
|
||||||
floorId = core.status.floorId
|
floorId = core.status.floorId
|
||||||
) {
|
) {
|
||||||
@ -65,7 +73,8 @@ function init() {
|
|||||||
Damage.ensureFloorDamage(floorId);
|
Damage.ensureFloorDamage(floorId);
|
||||||
const floor = core.status.maps[floorId];
|
const floor = core.status.maps[floorId];
|
||||||
floor.enemy.list.forEach(v => {
|
floor.enemy.list.forEach(v => {
|
||||||
if (!(v.id in used)) {
|
const id = getFacedId(v);
|
||||||
|
if (!(id in used)) {
|
||||||
const e = new DamageEnemy(v.enemy);
|
const e = new DamageEnemy(v.enemy);
|
||||||
e.calAttribute();
|
e.calAttribute();
|
||||||
e.getRealInfo();
|
e.getRealInfo();
|
||||||
@ -75,9 +84,9 @@ function init() {
|
|||||||
onMapEnemy: [v]
|
onMapEnemy: [v]
|
||||||
};
|
};
|
||||||
enemys.push(curr);
|
enemys.push(curr);
|
||||||
used[v.id] = curr.onMapEnemy;
|
used[id] = curr.onMapEnemy;
|
||||||
} else {
|
} else {
|
||||||
used[v.id].push(v);
|
used[id].push(v);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -31,7 +31,6 @@ export function getDetailedEnemy(
|
|||||||
const special: [string, string, string][] = enemy.info.special.map(vv => {
|
const special: [string, string, string][] = enemy.info.special.map(vv => {
|
||||||
const s = Mota.require('var', 'enemySpecials')[vv];
|
const s = Mota.require('var', 'enemySpecials')[vv];
|
||||||
const info = { ...enemy.enemy, ...enemy.info };
|
const info = { ...enemy.enemy, ...enemy.info };
|
||||||
console.log(info);
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
fromFunc(s.name, info),
|
fromFunc(s.name, info),
|
||||||
|
5
src/types/enemy.d.ts
vendored
5
src/types/enemy.d.ts
vendored
@ -58,6 +58,11 @@ type Enemy<I extends EnemyIds = EnemyIds> = {
|
|||||||
*/
|
*/
|
||||||
displayIdInBook: EnemyIds;
|
displayIdInBook: EnemyIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行走图朝向。在勇士撞上图块时,或图块在移动时,会自动选择最合适的朝向图块(如果存在定义)来进行绘制。
|
||||||
|
*/
|
||||||
|
faceIds: Record<Dir, EnemyIds>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 战前事件
|
* 战前事件
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user