mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-19 12:49:25 +08:00
fix: 录像吞开头移动 & 录像冲突
This commit is contained in:
parent
fb5df24895
commit
3c5a310146
@ -654,8 +654,8 @@ utils.prototype.encodeRoute = function (route, compress = true) {
|
||||
}
|
||||
if (cnt > 1) ans += cnt;
|
||||
cnt = 0;
|
||||
lastMove = t;
|
||||
}
|
||||
lastMove = t;
|
||||
cnt++;
|
||||
} else {
|
||||
if (cnt > 0) {
|
||||
|
@ -535,7 +535,7 @@ gameKey
|
||||
}
|
||||
core.playSound('光标移动');
|
||||
HeroSkill.toggleSkill(HeroSkill.Blade);
|
||||
core.status.route.push('skill:Blade');
|
||||
core.status.route.push('useSkill:Blade');
|
||||
core.updateStatusBar();
|
||||
})
|
||||
.realize('skill2', () => {
|
||||
@ -546,7 +546,7 @@ gameKey
|
||||
HeroSkill.learnedSkill(HeroSkill.Jump)
|
||||
) {
|
||||
Mota.Plugin.require('skill_g').jumpSkill();
|
||||
core.status.route.push('skill:Jump');
|
||||
core.status.route.push('useSkill:Jump');
|
||||
} else {
|
||||
if (core.hasItem('pickaxe')) {
|
||||
core.useItem('pickaxe');
|
||||
@ -562,7 +562,7 @@ gameKey
|
||||
}
|
||||
core.playSound('光标移动');
|
||||
HeroSkill.toggleSkill(HeroSkill.Shield);
|
||||
core.status.route.push('skill:Shield');
|
||||
core.status.route.push('useSkill:Shield');
|
||||
core.updateStatusBar();
|
||||
})
|
||||
.realize('debug', () => {
|
||||
|
@ -487,8 +487,10 @@ export class HeroMover extends ObjectMoverBase {
|
||||
const viewport = HeroMover.viewport;
|
||||
if (!adapter || !viewport) return;
|
||||
// if (!core.isReplaying()) {
|
||||
if (!core.isReplaying() || core.status.replay.speed <= 3) {
|
||||
adapter.sync('startAnimate');
|
||||
await adapter.all('readyMove');
|
||||
}
|
||||
// }
|
||||
// 这里要检查前面那一格能不能走,不能走则不触发平滑视角,以避免撞墙上视角卡住
|
||||
if (!this.ignoreTerrain) {
|
||||
@ -512,8 +514,10 @@ export class HeroMover extends ObjectMoverBase {
|
||||
const viewport = HeroMover.viewport;
|
||||
if (!adapter || !viewport) return;
|
||||
// if (!core.isReplaying()) {
|
||||
if (!core.isReplaying() || core.status.replay.speed <= 3) {
|
||||
await adapter.all('endMove');
|
||||
adapter.sync('endAnimate');
|
||||
}
|
||||
// }
|
||||
viewport.sync('endMove');
|
||||
core.clearContinueAutomaticRoute();
|
||||
@ -685,12 +689,12 @@ export class HeroMover extends ObjectMoverBase {
|
||||
const speed = replay === 24 ? 1 : this.moveSpeed / replay;
|
||||
viewport.all('moveTo', x, y, speed * 1.6);
|
||||
adapter.sync('setAnimateDir', showDir);
|
||||
// if (core.isReplaying()) {
|
||||
// await sleep(speed);
|
||||
// await adapter.all('setHeroLoc', x, y);
|
||||
// } else {
|
||||
if (core.isReplaying() && core.status.replay.speed > 3) {
|
||||
await sleep(speed);
|
||||
await adapter.all('setHeroLoc', x, y);
|
||||
} else {
|
||||
await adapter.all('move', moveDir);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -184,12 +184,12 @@ export function init() {
|
||||
} else {
|
||||
core.replay();
|
||||
}
|
||||
core.status.route.push(`skill:${toEmit}`);
|
||||
core.status.route.push(`useSkill:${toEmit}`);
|
||||
return true;
|
||||
}
|
||||
|
||||
core.registerReplayAction('skill', name => {
|
||||
if (!name.startsWith('skill:')) return false;
|
||||
core.registerReplayAction('useSkill', name => {
|
||||
if (!name.startsWith('useSkill:')) return false;
|
||||
const [, skill] = name.split(':');
|
||||
return skillAction(skill);
|
||||
});
|
||||
@ -213,7 +213,6 @@ export function init() {
|
||||
core.registerReplayAction('fly', action => {
|
||||
if (!action.startsWith('fly:')) return false;
|
||||
const floorId = action.slice(4) as FloorIds;
|
||||
const toIndex = core.floorIds.indexOf(floorId);
|
||||
if (
|
||||
!core.canUseItem('fly') ||
|
||||
(core.flags.flyNearStair && !core.nearStair())
|
||||
|
Loading…
Reference in New Issue
Block a user