mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-17 12:44:31 +08:00
feat: 几个新楼层
This commit is contained in:
1 parent
ac8a61558e
commit
c7f7cf280b
15 files changed
+373
-303
No files matched your search
@@ -231,122 +231,6 @@ export class EnemyCollection
|
||||
v.preProvideHalo();
|
||||
});
|
||||
}
|
||||
|
||||
// render(onMap: boolean = false, cal: boolean = false) {
|
||||
// if (cal) {
|
||||
// this.calMapDamage();
|
||||
// }
|
||||
// core.status.damage.data = [];
|
||||
// core.status.damage.extraData = [];
|
||||
// core.status.damage.dir = [];
|
||||
|
||||
// // 怪物伤害
|
||||
// this.list.forEach(v => {
|
||||
// if (onMap && !checkV2(v.x, v.y)) return;
|
||||
|
||||
// const { damage } = v.calDamage();
|
||||
|
||||
// // 伤害全部相等,绘制在怪物本身所在位置
|
||||
// const { damage: dam, color } = formatDamage(damage);
|
||||
// const critical = v.calCritical(1)[0];
|
||||
// core.status.damage.data.push({
|
||||
// text: dam,
|
||||
// px: 32 * v.x! + 1,
|
||||
// py: 32 * (v.y! + 1) - 1,
|
||||
// color: color
|
||||
// });
|
||||
// const setting = Mota.require('var', 'mainSetting');
|
||||
// const criGem = setting.getValue('screen.criticalGem', false);
|
||||
// const n = critical?.atkDelta ?? Infinity;
|
||||
// const ratio = core.status.maps[this.floorId].ratio;
|
||||
// const cri = criGem ? Math.ceil(n / ratio) : n;
|
||||
|
||||
// core.status.damage.data.push({
|
||||
// text: isFinite(cri) ? cri.toString() : '?',
|
||||
// px: 32 * v.x! + 1,
|
||||
// py: 32 * (v.y! + 1) - 11,
|
||||
// color: '#fff'
|
||||
// });
|
||||
// });
|
||||
|
||||
// // 地图伤害
|
||||
// const floor = core.status.maps[this.floorId];
|
||||
// const width = floor.width;
|
||||
// const height = floor.height;
|
||||
// const objs = core.getMapBlocksObj(this.floorId);
|
||||
|
||||
// const startX =
|
||||
// onMap && core.bigmap.v2
|
||||
// ? Math.max(0, core.bigmap.posX - core.bigmap.extend)
|
||||
// : 0;
|
||||
// const endX =
|
||||
// onMap && core.bigmap.v2
|
||||
// ? Math.min(
|
||||
// width,
|
||||
// core.bigmap.posX + core._WIDTH_ + core.bigmap.extend + 1
|
||||
// )
|
||||
// : width;
|
||||
// const startY =
|
||||
// onMap && core.bigmap.v2
|
||||
// ? Math.max(0, core.bigmap.posY - core.bigmap.extend)
|
||||
// : 0;
|
||||
// const endY =
|
||||
// onMap && core.bigmap.v2
|
||||
// ? Math.min(
|
||||
// height,
|
||||
// core.bigmap.posY + core._HEIGHT_ + core.bigmap.extend + 1
|
||||
// )
|
||||
// : height;
|
||||
|
||||
// for (let x = startX; x < endX; x++) {
|
||||
// for (let y = startY; y < endY; y++) {
|
||||
// const id = `${x},${y}` as LocString;
|
||||
// const dam = this.mapDamage[id];
|
||||
// if (!dam || objs[id]?.event.noPass) continue;
|
||||
|
||||
// // 地图伤害
|
||||
// if (dam.damage !== 0) {
|
||||
// const damage = core.formatBigNumber(dam.damage, true);
|
||||
// const color = dam.damage < 0 ? '#6eff6a' : '#fa3';
|
||||
// core.status.damage.extraData.push({
|
||||
// text: damage,
|
||||
// px: 32 * x + 16,
|
||||
// py: 32 * y + 16,
|
||||
// color,
|
||||
// alpha: 1
|
||||
// });
|
||||
// }
|
||||
|
||||
// // 电摇嘲讽
|
||||
// if (dam.mockery) {
|
||||
// dam.mockery.sort((a, b) =>
|
||||
// a[0] === b[0] ? a[1] - b[1] : a[0] - b[0]
|
||||
// );
|
||||
// const [tx, ty] = dam.mockery[0];
|
||||
// const dir =
|
||||
// x > tx ? '←' : x < tx ? '→' : y > ty ? '↑' : '↓';
|
||||
// core.status.damage.extraData.push({
|
||||
// text: '嘲' + dir,
|
||||
// px: 32 * x + 16,
|
||||
// py: 32 * (y + 1) - 14,
|
||||
// color: '#fd4',
|
||||
// alpha: 1
|
||||
// });
|
||||
// }
|
||||
|
||||
// // 追猎
|
||||
// if (dam.hunt) {
|
||||
// core.status.damage.extraData.push({
|
||||
// text: '猎',
|
||||
// px: 32 * x + 16,
|
||||
// py: 32 * (y + 1) - 14,
|
||||
// color: '#fd4',
|
||||
// alpha: 1
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
export class DamageEnemy<T extends EnemyIds = EnemyIds> {
|
||||
|
||||
@@ -44,6 +44,7 @@ export {};
|
||||
delete core.status.mapBlockObjs[data];
|
||||
core.extractBlocks(data);
|
||||
if (data === core.status.floorId) {
|
||||
core.status.thisMap = core.status.maps[data];
|
||||
let weather = core.getFlag('__weather__', null);
|
||||
if (!weather && core.status.thisMap.weather)
|
||||
weather = core.status.thisMap.weather;
|
||||
|
||||
@@ -110,8 +110,13 @@ function checkHunt(loc: string) {
|
||||
const { x: hx, y: hy } = core.status.hero.loc;
|
||||
|
||||
const action: any = [];
|
||||
hunt.sort((a, b) => {
|
||||
return a[0] === b[0] ? a[1] - b[1] : a[0] - b[0];
|
||||
});
|
||||
|
||||
for (const [x, y, dir] of hunt) {
|
||||
const [tx, ty] = ofDir(x, y, dir);
|
||||
if (core.noPass(tx, ty)) continue;
|
||||
action.push(
|
||||
{
|
||||
type: 'move',
|
||||
@@ -124,8 +129,6 @@ function checkHunt(loc: string) {
|
||||
type: 'update'
|
||||
}
|
||||
);
|
||||
const [tx, ty] = ofDir(x, y, dir);
|
||||
if (core.noPass(tx, ty)) return;
|
||||
|
||||
if (has(hy) && x === hx) {
|
||||
if (Math.abs(y - hy) <= 2) {
|
||||
|
||||
@@ -514,7 +514,10 @@ export function init() {
|
||||
time: number = 500,
|
||||
callback?: () => void
|
||||
) {
|
||||
console.log(heroMover.moving);
|
||||
|
||||
if (heroMover.moving) return;
|
||||
|
||||
const sx = core.getHeroLoc('x');
|
||||
const sy = core.getHeroLoc('y');
|
||||
adapters.viewport?.all('mutateTo', ex, ey);
|
||||
@@ -539,6 +542,7 @@ export function init() {
|
||||
);
|
||||
})
|
||||
);
|
||||
console.log(ex, ey);
|
||||
|
||||
if (!locked) core.unlockControl();
|
||||
core.setHeroLoc('x', ex);
|
||||
|
||||
@@ -105,6 +105,7 @@ export function jumpSkill() {
|
||||
(bgId.startsWith('X') && !ignoreInJump.bg.includes(bgId))
|
||||
)
|
||||
return core.drawTip('当前无法使用技能');
|
||||
// debugger;
|
||||
// 不是怪物且不可以通行
|
||||
if (noPass && !(cls == 'enemys' || cls == 'enemy48')) {
|
||||
var toLoc = checkNoPass(direction, checkLoc.x, checkLoc.y, true);
|
||||
|
||||
Reference in new issue
Block a user