From ed15a703b0004409dcb0c53fc1414f97a743a704 Mon Sep 17 00:00:00 2001 From: oc Date: Tue, 4 Jun 2019 20:55:38 +0800 Subject: [PATCH] speedUp replay 24x --- libs/actions.js | 5 +++++ libs/control.js | 7 +++++++ libs/events.js | 10 +++++----- project/functions.js | 6 ++++-- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/libs/actions.js b/libs/actions.js index 67340276..f6f80541 100644 --- a/libs/actions.js +++ b/libs/actions.js @@ -1858,6 +1858,11 @@ actions.prototype._keyUpSL = function (keycode) { this._clickSL(this.LAST, this.LAST); return; } + if (keycode >= 48 && keycode <= 57) { + if (keycode == 48) keycode = 58; + core.ui.drawSLPanel((keycode - 49) * 1000 + 1); + return; + } if (keycode == 13 || keycode == 32 || keycode == 67) { if (offset == 0) core.doSL("autoSave", core.status.event.id); diff --git a/libs/control.js b/libs/control.js index cf122581..54201a90 100644 --- a/libs/control.js +++ b/libs/control.js @@ -570,6 +570,12 @@ control.prototype.setAutoHeroMove = function (steps) { ////// 设置行走的效果动画 ////// control.prototype.setHeroMoveInterval = function (callback) { if (core.status.heroMoving > 0) return; + if (core.status.replay.speed == 24) { + core.moveOneStep(core.nextX(), core.nextY()); + if (callback) callback(); + return; + } + core.status.heroMoving=1; var toAdd = 1; @@ -1346,6 +1352,7 @@ control.prototype._replay_error = function (action) { } control.prototype.__replay_getTimeout = function () { + if (core.status.replay.speed == 24) return 0; return 750 / Math.max(1, core.status.replay.speed); } diff --git a/libs/events.js b/libs/events.js index 3b44a8cf..0461d567 100644 --- a/libs/events.js +++ b/libs/events.js @@ -434,7 +434,7 @@ events.prototype._openDoor_animate = function (id, x, y, callback) { return; } core.drawImage('event', core.material.images.animates, 32 * state, 32 * door, 32, 32, 32 * x, 32 * y, 32, 32); - }, speed / Math.max(core.status.replay.speed, 1)); + }, core.status.replay.speed == 24 ? 1 : speed / Math.max(core.status.replay.speed, 1)); core.animateFrame.asyncId[animate] = true; } @@ -1395,7 +1395,7 @@ events.prototype._action_choices = function (data, x, y, prefix) { core.status.route.push("choices:" + index); core.insertAction(data.choices[index].action); core.doAction(); - }, 750 / Math.max(1, core.status.replay.speed)) + }, core.status.replay.speed == 24 ? 1 : 750 / Math.max(1, core.status.replay.speed)) } else { core.control._replay_error(action); @@ -1418,7 +1418,7 @@ events.prototype._action_confirm = function (data, x, y, prefix) { if (index == 0) core.insertAction(data.yes); else core.insertAction(data.no); core.doAction(); - }, 750 / Math.max(1, core.status.replay.speed)) + }, core.status.replay.speed == 24 ? 1 : 750 / Math.max(1, core.status.replay.speed)) } else { core.control._replay_error(action); @@ -1986,7 +1986,7 @@ events.prototype.closeDoor = function (x, y, id, callback) { } core.clearMap('event', 32 * x, 32 * y, 32, 32); core.drawImage('event', core.material.images.animates, 32 * (4-state), 32 * door, 32, 32, 32 * x, 32 * y, 32, 32); - }, speed / Math.max(core.status.replay.speed, 1)); + }, core.status.replay.speed == 24 ? 1 : speed / Math.max(core.status.replay.speed, 1)); core.animateFrame.asyncId[animate] = true; } @@ -2194,7 +2194,7 @@ events.prototype.eventMoveHero = function(steps, time, callback) { if (core.events._eventMoveHero_moving(++step, moveSteps)) step = 0; } - }, time / 8 / core.status.replay.speed); + }, core.status.replay.speed == 24 ? 1 : time / 8 / core.status.replay.speed); core.animateFrame.asyncId[animate] = true; } diff --git a/project/functions.js b/project/functions.js index 8ff352dc..7723d333 100644 --- a/project/functions.js +++ b/project/functions.js @@ -1229,8 +1229,10 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = if (enemyDamage != null && enemyDamage < value) value = enemyDamage; } - damage[loc] = (damage[loc] || 0) + value; - type[loc] = "夹击伤害"; + if (value > 0) { + damage[loc] = (damage[loc] || 0) + value; + type[loc] = "夹击伤害"; + } } } }