mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-02-28 17:37:07 +08:00
提高楼传分区的性能
This commit is contained in:
parent
d09da5711b
commit
2860dccc01
@ -226,8 +226,8 @@ export class EnemyCollection implements RangeCollection<DamageEnemy> {
|
||||
});
|
||||
// 然后根据位置依次绘制对应位置的伤害
|
||||
for (const dam of v.damage) {
|
||||
const d = (dam.damage - min) / delta;
|
||||
const color = core.arrayToRGB([d * 255, 255 - d * 255, 0]);
|
||||
const d = ((dam.damage - min) / delta) * 255;
|
||||
const color = core.arrayToRGB([d, 255 - d, 0]);
|
||||
if (dam.dir === 'down' || dam.dir === 'up') {
|
||||
const dir = dam.dir === 'down' ? '↑' : '↓';
|
||||
core.status.damage.extraData.push({
|
||||
|
@ -27,11 +27,11 @@ const bfsCache: Partial<Record<FloorIds, MapBFSResult>> = {};
|
||||
*/
|
||||
const drawCache: Record<string, MapDrawData> = {};
|
||||
|
||||
const arrow: Partial<Record<AllIds, Dir>> = {
|
||||
leftPortal: 'left',
|
||||
rightPortal: 'right',
|
||||
upPortal: 'up',
|
||||
downPortal: 'down'
|
||||
const arrow: Partial<Record<AllNumbers, Dir>> = {
|
||||
92: 'left',
|
||||
94: 'right',
|
||||
91: 'up',
|
||||
93: 'down'
|
||||
};
|
||||
|
||||
/**
|
||||
@ -175,13 +175,13 @@ export function getMapData(
|
||||
|
||||
while (queue.length > 0) {
|
||||
const now = queue.shift()!;
|
||||
const change = core.floors[now].changeFloor;
|
||||
const blocks = core.getMapBlocksObj(now, noCache);
|
||||
const floor = core.floors[now];
|
||||
const change = floor.changeFloor;
|
||||
for (const [loc, ev] of Object.entries(change)) {
|
||||
const target = ev.floorId as FloorIds;
|
||||
if (target.startsWith(':')) continue;
|
||||
const block = blocks[loc as LocString];
|
||||
const id = block.event.id;
|
||||
const [x, y] = loc.split(',').map(v => parseInt(v));
|
||||
const id = floor.map[y][x] as AllNumbers;
|
||||
if (id in arrow) {
|
||||
if (!used[target]) {
|
||||
const from = `${now},${loc},${arrow[id]}` as BFSFromString;
|
||||
|
Loading…
Reference in New Issue
Block a user