diff --git a/public/libs/actions.js b/public/libs/actions.js index 0fbf59b..a892818 100644 --- a/public/libs/actions.js +++ b/public/libs/actions.js @@ -384,9 +384,6 @@ actions.prototype._sys_keyDown_lockControl = function (keyCode) { case 'action': this._keyDownAction(keyCode); break; - case 'fly': - this._keyDownFly(keyCode); - break; case 'viewMaps': this._keyDownViewMaps(keyCode); break; @@ -477,9 +474,6 @@ actions.prototype._sys_keyUp_lockControl = function (keyCode, altKey) { case 'help': ok() && core.closePanel(); break; - case 'fly': - this._keyUpFly(keyCode); - break; case 'viewMaps': this._keyUpViewMaps(keyCode); break; @@ -568,9 +562,6 @@ actions.prototype._sys_ondown_lockControl = function (x, y, px, py) { case 'centerFly': this._clickCenterFly(x, y, px, py); break; - case 'fly': - this._clickFly(x, y, px, py); - break; case 'viewMaps': this._clickViewMaps(x, y, px, py); break; @@ -918,13 +909,6 @@ actions.prototype._sys_onmousewheel = function (direct) { return; } - // 楼层飞行器 - if (core.status.lockControl && core.status.event.id == 'fly') { - if (direct == 1) core.ui.drawFly(this._getNextFlyFloor(1)); - if (direct == -1) core.ui.drawFly(this._getNextFlyFloor(-1)); - return; - } - // 存读档 if ( core.status.lockControl && @@ -1031,16 +1015,6 @@ actions.prototype._sys_longClick_lockControl = function (x, y, px, py) { core.doAction(); return true; } - // 长按楼传器的箭头可以快速翻页 - if (core.status.event.id == 'fly') { - if ( - (x == core._WIDTH_ - 2 || x == core._WIDTH_ - 3) && - (y == this._HY_ - 1 || y == this._HY_ + 3) - ) { - this._clickFly(x, y); - return true; - } - } // 长按SL上下页快速翻页 if ( ['save', 'load', 'replayLoad', 'replayRemain', 'replaySince'].indexOf( @@ -1467,96 +1441,6 @@ actions.prototype._keyUpAction = function (keycode) { } }; -////// 楼层传送器界面时的点击操作 ////// -actions.prototype._clickFly = function (x, y) { - if ( - (x == core._WIDTH_ - 2 || x == core._WIDTH_ - 3) && - y == this._HY_ + 3 - ) { - core.playSound('光标移动'); - core.ui.drawFly(this._getNextFlyFloor(-1)); - } - if ( - (x == core._WIDTH_ - 2 || x == core._WIDTH_ - 3) && - y == this._HY_ - 1 - ) { - core.playSound('光标移动'); - core.ui.drawFly(this._getNextFlyFloor(1)); - } - if ( - (x == core._WIDTH_ - 2 || x == core._WIDTH_ - 3) && - y == this._HY_ + 4 - ) { - core.playSound('光标移动'); - core.ui.drawFly(this._getNextFlyFloor(-10)); - } - if ( - (x == core._WIDTH_ - 2 || x == core._WIDTH_ - 3) && - y == this._HY_ - 2 - ) { - core.playSound('光标移动'); - core.ui.drawFly(this._getNextFlyFloor(10)); - } - if (x >= this._HX_ - 1 && x <= this._HX_ + 1 && y === core._HEIGHT_ - 1) { - core.playSound('取消'); - core.ui.closePanel(); - } - if (x >= 0 && x <= this._HX_ + 3 && y >= 3 && y <= core._HEIGHT_ - 1 - 1) - core.flyTo(core.floorIds[core.status.event.data]); - return; -}; - -////// 楼层传送器界面时,按下某个键的操作 ////// -actions.prototype._keyDownFly = function (keycode) { - if (keycode == 37) { - core.playSound('光标移动'); - core.ui.drawFly(this._getNextFlyFloor(-10)); - } else if (keycode == 38) { - core.playSound('光标移动'); - core.ui.drawFly(this._getNextFlyFloor(1)); - } else if (keycode == 39) { - core.playSound('光标移动'); - core.ui.drawFly(this._getNextFlyFloor(10)); - } else if (keycode == 40) { - core.playSound('光标移动'); - core.ui.drawFly(this._getNextFlyFloor(-1)); - } - return; -}; - -actions.prototype._getNextFlyFloor = function (delta, index) { - if (index == null) index = core.status.event.data; - if (delta == 0) return index; - var sign = Math.sign(delta); - delta = Math.abs(delta); - var ans = index; - while (true) { - index += sign; - if (index < 0 || index >= core.floorIds.length) break; - var floorId = core.floorIds[index]; - if ( - core.status.maps[floorId].canFlyTo && - core.hasVisitedFloor(floorId) - ) { - delta--; - ans = index; - } - if (delta == 0) break; - } - return ans; -}; - -////// 楼层传送器界面时,放开某个键的操作 ////// -actions.prototype._keyUpFly = function (keycode) { - if (keycode == 71 || keycode == 27 || keycode == 88) { - core.playSound('取消'); - core.ui.closePanel(); - } - if (keycode == 13 || keycode == 32 || keycode == 67) - this._clickFly(this._HX_ - 1, this._HY_ - 1); - return; -}; - ////// 查看地图界面时的点击操作 ////// actions.prototype._clickViewMaps = function (x, y, px, py) { if (core.status.event.data == null) { diff --git a/public/libs/ui.js b/public/libs/ui.js index e7695a8..f9b283a 100644 --- a/public/libs/ui.js +++ b/public/libs/ui.js @@ -3242,102 +3242,7 @@ ui.prototype._drawCursor = function () { ui.prototype.drawBook = function (index) {}; ////// 绘制楼层传送器 ////// -ui.prototype.drawFly = function (page) { - core.status.event.data = page; - var floorId = core.floorIds[page]; - var title = core.status.maps[floorId].title; - core.clearMap('ui'); - core.setAlpha('ui', 0.85); - core.fillRect('ui', 0, 0, core._PX_, core._PY_, '#000000'); - core.setAlpha('ui', 1); - core.setTextAlign('ui', 'center'); - core.fillText( - 'ui', - '楼层跳跃', - core._PX_ / 2, - 48, - '#FFFFFF', - this._buildFont(28, true) - ); - core.fillText( - 'ui', - '返回游戏', - core._PX_ / 2, - core._PY_ - 13, - null, - this._buildFont(15, true) - ); - core.setTextAlign('ui', 'right'); - core.fillText( - 'ui', - '浏览地图时也', - core._PX_ - 10, - core._PY_ - 23, - '#aaaaaa', - this._buildFont(10, false) - ); - core.fillText( - 'ui', - '可楼层跳跃!', - core._PX_ - 10, - core._PY_ - 11, - null, - this._buildFont(10, false) - ); - core.setTextAlign('ui', 'center'); - - var middle = core._PY_ / 2 + 39; - - // 换行 - var lines = core.splitLines('ui', title, 120, this._buildFont(19, true)); - var start_y = middle - (lines.length - 1) * 11; - for (var i in lines) { - core.fillText('ui', lines[i], core._PX_ - 60, start_y, '#FFFFFF'); - start_y += 22; - } - if (core.actions._getNextFlyFloor(1) != page) { - core.fillText( - 'ui', - '▲', - core._PX_ - 60, - middle - 64, - null, - this._buildFont(17, false) - ); - core.fillText('ui', '▲', core._PX_ - 60, middle - 96); - core.fillText('ui', '▲', core._PX_ - 60, middle - 96 - 7); - } - if (core.actions._getNextFlyFloor(-1) != page) { - core.fillText( - 'ui', - '▼', - core._PX_ - 60, - middle + 64, - null, - this._buildFont(17, false) - ); - core.fillText('ui', '▼', core._PX_ - 60, middle + 96); - core.fillText('ui', '▼', core._PX_ - 60, middle + 96 + 7); - } - var size = 0.75; - core.strokeRect( - 'ui', - 16, - 64, - size * core._PX_, - size * core._PY_, - '#FFFFFF', - 2 - ); - core.drawThumbnail(floorId, null, { - ctx: 'ui', - x: 16, - y: 64, - size: size, - damage: true, - all: true - }); -}; +ui.prototype.drawFly = function (page) {}; ////// 绘制中心对称飞行器 ui.prototype._drawCenterFly = function () { diff --git a/public/project/plugins.js b/public/project/plugins.js index 00ee286..2ff0581 100644 --- a/public/project/plugins.js +++ b/public/project/plugins.js @@ -3387,7 +3387,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = { core.addPop( (x - core.bigmap.offsetX / 32) * 32 + 12, (y - core.bigmap.offsetY / 32) * 32 + 20, - damage + -damage.toString() ); core.status.hero.hp -= damage; var text = diff --git a/src/plugin/ui/book.tsx b/src/plugin/ui/book.tsx index e07ec32..cfde852 100644 --- a/src/plugin/ui/book.tsx +++ b/src/plugin/ui/book.tsx @@ -46,7 +46,7 @@ export function getSpecialHint(enemy: Enemy & DetailedEnemy) { * @param enemy 怪物实例 */ export function getDefDamage( - enemy: Enemy & DetailedEnemy, + enemy: DetailedEnemy, addDef: number = 0, addAtk: number = 0 ) { @@ -59,7 +59,7 @@ export function getDefDamage( const max = 100 - Math.floor(addDef / ratio); for (let i = 0; i <= max; i++) { - const dam = core.getDamageInfo(enemy, { + const dam = core.getDamageInfo(enemy.id, { def: core.status.hero.def + ratio * i + addDef, atk: core.status.hero.atk + addAtk }); @@ -73,7 +73,6 @@ export function getDefDamage( continue; } if (!has(dam)) continue; - if (dam.damage === origin) continue; if (dam.damage === res.at(-1)?.[1]) continue; last = dam.damage; res.push([ratio * i + addDef, dam.damage]); @@ -91,7 +90,7 @@ export function getDefDamage( * @param enemy 怪物实例 */ export function getCriticalDamage( - enemy: Enemy & DetailedEnemy, + enemy: DetailedEnemy, addAtk: number = 0, addDef: number = 0 ): [number, number][] { @@ -104,7 +103,7 @@ export function getCriticalDamage( const max = 100 - Math.floor(addAtk / ratio); for (let i = 0; i <= max; i++) { - const dam = core.getDamageInfo(enemy, { + const dam = core.getDamageInfo(enemy.id, { atk: core.status.hero.atk + ratio * i + addAtk, def: core.status.hero.def + addDef }); @@ -118,7 +117,6 @@ export function getCriticalDamage( continue; } if (!has(dam)) continue; - if (dam.damage === origin) continue; if (dam.damage === res.at(-1)?.[1]) continue; last = dam.damage; res.push([ratio * i + addAtk, dam.damage]); diff --git a/src/ui/fly.vue b/src/ui/fly.vue index d2293ee..99b25c9 100644 --- a/src/ui/fly.vue +++ b/src/ui/fly.vue @@ -553,6 +553,7 @@ onMounted(async () => { v.addEventListener('click', e => (v as HTMLElement).blur()); }); + locateMap(nowFloor.value); draw(); useDrag(