From 5a44ba3f282ebc4a8ae4c807fcaa1c7abc67229c Mon Sep 17 00:00:00 2001 From: strawberry <2806566736@.qq.com> Date: Tue, 19 Aug 2025 20:36:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E8=BF=9B=E5=BA=A6=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/actions.js | 2 +- libs/enemys.js | 12 +- libs/maps.js | 13 +- libs/ui.js | 6 +- project/events.js | 324 ++++++++++----------- project/functions.js | 40 +-- project/plugins.js | 668 ++++++++++++++++++++++++++++--------------- 7 files changed, 637 insertions(+), 428 deletions(-) diff --git a/libs/actions.js b/libs/actions.js index d09f46e..3e677f9 100644 --- a/libs/actions.js +++ b/libs/actions.js @@ -1256,6 +1256,7 @@ actions.prototype._keyUpBook = function (keycode) { if (core.book.isAnimate) return if (keycode == 27 || keycode == 88) { core.playSound('取消'); + core.book.close() if (core.events.recoverEvents(core.status.event.interval)) { return; } @@ -1264,7 +1265,6 @@ actions.prototype._keyUpBook = function (keycode) { core.ui._drawViewMaps(core.status.event.ui); } else core.ui.closePanel(); - core.book.close() return; } /*if (keycode == 13 || keycode == 32 || keycode == 67) { diff --git a/libs/enemys.js b/libs/enemys.js index 122657a..f9373c2 100644 --- a/libs/enemys.js +++ b/libs/enemys.js @@ -204,12 +204,12 @@ enemys.prototype.getDamageString = function (enemy, x, y, floorId) { else color = '#FF2222'; damage = core.formatBigNumber(damage, true); - if (core.enemys.hasSpecial(enemy, 19)) + /* if (core.enemys.hasSpecial(enemy, 19)) damage += "+"; if (core.enemys.hasSpecial(enemy, 21)) damage += "-"; if (core.enemys.hasSpecial(enemy, 11)) - damage += "^"; + damage += "^";*/ } return { @@ -219,13 +219,13 @@ enemys.prototype.getDamageString = function (enemy, x, y, floorId) { } ////// 接下来N个临界值和临界减伤计算 ////// -enemys.prototype.nextCriticals = function (enemy, number, x, y, floorId) { +enemys.prototype.nextCriticals = function (enemy, number, x, y, floorId,config={}) { if (typeof enemy == 'string') enemy = core.material.enemys[enemy]; number = number || 1; var specialCriticals = this._nextCriticals_special(enemy, number, x, y, floorId); if (specialCriticals != null) return specialCriticals; - var info = this.getDamageInfo(enemy, null, x, y, floorId); + var info = this.getDamageInfo(enemy, config, x, y, floorId); if (info == null) { // 如果未破防... var overAtk = this._nextCriticals_overAtk(enemy, x, y, floorId); if (overAtk == null) return []; @@ -245,7 +245,7 @@ enemys.prototype.nextCriticals = function (enemy, number, x, y, floorId) { return this._nextCriticals_useLoop(enemy, info, number, x, y, floorId); } else { - return this._nextCriticals_useBinarySearch(enemy, info, number, x, y, floorId); + return this._nextCriticals_useBinarySearch(enemy, info, number, x, y, floorId,config); } } else { @@ -274,7 +274,7 @@ enemys.prototype._nextCriticals_overAtk = function (enemy, x, y, floorId) { } enemys.prototype._nextCriticals_special = function (enemy, number, x, y, floorId) { - if (this.hasSpecial(enemy.special, 10) || this.hasSpecial(enemy.special, 3)) + if (this.hasSpecial(enemy.special, 3)) return []; // 模仿or坚固临界 return null; } diff --git a/libs/maps.js b/libs/maps.js index 5d05b25..9fef466 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -1757,7 +1757,11 @@ maps.prototype._drawThumbnail_drawTempCanvas = function (floorId, blocks, option } else core.maps._setHDCanvasSize(tempCanvas, width * 32, height * 32); } options.ctx = tempCanvas; - + if(options.noEnabled){ + tempCanvas.imageSmoothingEnabled= false + }else{ + tempCanvas.imageSmoothingEnabled= true + } // 地图过大的缩略图不绘制显伤 if (width * height > core.bigmap.threshold) options.damage = false; @@ -1804,6 +1808,12 @@ maps.prototype._drawThumbnail_realDrawTempCanvas = function (floorId, blocks, op maps.prototype._drawThumbnail_drawToTarget = function (floorId, options) { var ctx = core.getContextByName(options.ctx); + let imageSmoothingEnabled=ctx.imageSmoothingEnabled + if(options.noEnabled){ + ctx.imageSmoothingEnabled= false + }else{ + ctx.imageSmoothingEnabled= true + } if (ctx == null) return; var x = options.x || 0, y = options.y || 0, size = options.size || 1; // size的含义改为(0,1]范围的系数以适配长方形,默认为1,楼传为3/4,SL界面为0.3 @@ -1861,6 +1871,7 @@ maps.prototype._drawThumbnail_drawToTarget = function (floorId, options) { } } } + ctx.imageSmoothingEnabled= imageSmoothingEnabled } // -------- 获得某个点的图块信息 -------- // diff --git a/libs/ui.js b/libs/ui.js index bba436e..08cd1d8 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -2556,7 +2556,7 @@ ui.prototype.drawFly = function (page) { } 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 }); + core.drawThumbnail(floorId, null, { ctx: 'ui', x: 16, y: 64, size: size, damage: true, all: true , noEnabled: true }); } ////// 绘制中心对称飞行器 @@ -2568,7 +2568,7 @@ ui.prototype._drawCenterFly = function () { var toX = core.bigmap.width - 1 - core.getHeroLoc('x'), toY = core.bigmap.height - 1 - core.getHeroLoc('y'); this.clearUI(); core.fillRect('ui', 0, 0, core._PX_, core._PY_, '#000000'); - core.drawThumbnail(null, null, { heroLoc: core.status.hero.loc, heroIcon: core.status.hero.image, ctx: 'ui', centerX: toX, centerY: toY }); + core.drawThumbnail(null, null, { heroLoc: core.status.hero.loc, heroIcon: core.status.hero.image, ctx: 'ui', centerX: toX, centerY: toY, noEnabled: true }); var offsetX = core.clamp(toX - core._HALF_WIDTH_, 0, core.bigmap.width - core._WIDTH_), offsetY = core.clamp(toY - core._HALF_HEIGHT_, 0, core.bigmap.height - core._HEIGHT_); core.fillRect('ui', (toX - offsetX) * 32, (toY - offsetY) * 32, 32, 32, fillstyle); @@ -2588,7 +2588,7 @@ ui.prototype._drawViewMaps = function (index, x, y) { core.status.checkBlock.cache = {}; var data = this._drawViewMaps_buildData(index, x, y); core.fillRect('ui', 0, 0, core._PX_, core._PY_, '#000000'); - core.drawThumbnail(data.floorId, null, { damage: data.damage, ctx: 'ui', centerX: data.x, centerY: data.y, all: data.all }); + core.drawThumbnail(data.floorId, null, { damage: data.damage, ctx: 'ui', centerX: data.x, centerY: data.y, all: data.all , noEnabled: true }); core.clearMap('data'); core.setTextAlign('data', 'left'); core.setFont('data', '16px Arial'); diff --git a/project/events.js b/project/events.js index 7e29c50..4028ee8 100644 --- a/project/events.js +++ b/project/events.js @@ -7878,7 +7878,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "0", "time": 30, @@ -7896,7 +7896,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "1", "time": 30, @@ -7914,7 +7914,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "2", "time": 30, @@ -7932,7 +7932,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "3", "time": 30, @@ -7950,7 +7950,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "4", "time": 30, @@ -7968,7 +7968,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "5", "time": 30, @@ -7986,7 +7986,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "6", "time": 30, @@ -8004,7 +8004,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "7", "time": 30, @@ -8022,7 +8022,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "8", "time": 30, @@ -8040,7 +8040,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "9", "time": 30, @@ -8058,7 +8058,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "10", "time": 30, @@ -8076,7 +8076,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "11", "time": 30, @@ -8094,7 +8094,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "12", "time": 30, @@ -8112,7 +8112,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "13", "time": 30, @@ -8130,7 +8130,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "14", "time": 30, @@ -8148,7 +8148,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "15", "time": 30, @@ -8166,7 +8166,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "16", "time": 30, @@ -8184,7 +8184,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "17", "time": 30, @@ -8202,7 +8202,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "18", "time": 30, @@ -8220,7 +8220,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "19", "time": 30, @@ -8238,7 +8238,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "20", "time": 30, @@ -8256,7 +8256,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "21", "time": 30, @@ -8274,7 +8274,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "22", "time": 30, @@ -8292,7 +8292,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "23", "time": 30, @@ -8310,7 +8310,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "24", "time": 30, @@ -8328,7 +8328,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "25", "time": 30, @@ -8346,7 +8346,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "26", "time": 30, @@ -8364,7 +8364,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "27", "time": 30, @@ -8382,7 +8382,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "28", "time": 30, @@ -8400,7 +8400,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "29", "time": 30, @@ -8418,7 +8418,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "30", "time": 30, @@ -8436,7 +8436,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "31", "time": 30, @@ -8454,7 +8454,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "32", "time": 30, @@ -8472,7 +8472,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "33", "time": 30, @@ -8490,7 +8490,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "34", "time": 30, @@ -8508,7 +8508,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "35", "time": 30, @@ -8526,7 +8526,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "36", "time": 30, @@ -8544,7 +8544,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "37", "time": 30, @@ -8562,7 +8562,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "38", "time": 30, @@ -8580,7 +8580,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "39", "time": 30, @@ -8598,7 +8598,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "40", "time": 30, @@ -8616,7 +8616,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "41", "time": 30, @@ -8634,7 +8634,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "42", "time": 30, @@ -8652,7 +8652,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "43", "time": 30, @@ -8670,7 +8670,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "44", "time": 30, @@ -8688,7 +8688,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "45", "time": 30, @@ -8706,7 +8706,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "46", "time": 30, @@ -8724,7 +8724,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "47", "time": 30, @@ -8742,7 +8742,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "48", "time": 30, @@ -8760,7 +8760,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "49", "time": 30, @@ -8778,7 +8778,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "50", "time": 30, @@ -8796,7 +8796,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "51", "time": 30, @@ -8814,7 +8814,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "52", "time": 30, @@ -8832,7 +8832,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "53", "time": 30, @@ -8850,7 +8850,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "54", "time": 30, @@ -8868,7 +8868,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "55", "time": 30, @@ -8886,7 +8886,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "56", "time": 30, @@ -8904,7 +8904,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "57", "time": 30, @@ -8922,7 +8922,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "58", "time": 30, @@ -8940,7 +8940,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "59", "time": 30, @@ -8958,7 +8958,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "60", "time": 30, @@ -8976,7 +8976,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "61", "time": 30, @@ -8994,7 +8994,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "62", "time": 30, @@ -9012,7 +9012,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "63", "time": 30, @@ -9030,7 +9030,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "64", "time": 30, @@ -9048,7 +9048,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "65", "time": 30, @@ -9066,7 +9066,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "66", "time": 30, @@ -9084,7 +9084,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "67", "time": 30, @@ -9102,7 +9102,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "68", "time": 30, @@ -9120,7 +9120,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "69", "time": 30, @@ -9138,7 +9138,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "70", "time": 30, @@ -9156,7 +9156,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "71", "time": 30, @@ -9174,7 +9174,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "72", "time": 30, @@ -9192,7 +9192,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "73", "time": 30, @@ -9210,7 +9210,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "74", "time": 30, @@ -9228,7 +9228,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "75", "time": 30, @@ -9246,7 +9246,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "76", "time": 30, @@ -9264,7 +9264,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "77", "time": 30, @@ -9325,7 +9325,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "79", "time": 30, @@ -9349,7 +9349,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "80", "time": 30, @@ -9367,7 +9367,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "81", "time": 30, @@ -9385,7 +9385,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "82", "time": 30, @@ -9403,7 +9403,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "83", "time": 30, @@ -9421,7 +9421,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "84", "time": 30, @@ -9439,7 +9439,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "85", "time": 30, @@ -9457,7 +9457,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "86", "time": 30, @@ -9475,7 +9475,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "87", "time": 30, @@ -9493,7 +9493,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "88", "time": 30, @@ -9550,7 +9550,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "89", "time": 30, @@ -9568,7 +9568,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "90", "time": 30, @@ -9590,7 +9590,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020106.webp", - "px": -300 + "px": -100 }, "index": "0", "time": 30, @@ -9608,7 +9608,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020141.webp", - "px": -300 + "px": -100 }, "index": "1", "time": 30, @@ -9626,7 +9626,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020157.webp", - "px": -300 + "px": -100 }, "index": "2", "time": 30, @@ -9644,7 +9644,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020157.webp", - "px": -300 + "px": -100 }, "index": "3", "time": 30, @@ -9662,7 +9662,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020107.webp", - "px": -300 + "px": -100 }, "index": "4", "time": 30, @@ -9680,7 +9680,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "5", "time": 30, @@ -9698,7 +9698,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "6", "time": 30, @@ -9716,7 +9716,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "7", "time": 30, @@ -9734,7 +9734,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "8", "time": 30, @@ -9752,7 +9752,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020157.webp", - "px": -300 + "px": -100 }, "index": "9", "time": 30, @@ -9770,7 +9770,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020157.webp", - "px": -300 + "px": -100 }, "index": "10", "time": 30, @@ -9788,7 +9788,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "11", "time": 30, @@ -9806,7 +9806,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020111.webp", - "px": -300 + "px": -100 }, "index": "12", "time": 30, @@ -9824,7 +9824,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "13", "time": 30, @@ -9842,7 +9842,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020101.webp", - "px": -300 + "px": -100 }, "index": "14", "time": 30, @@ -9860,7 +9860,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "15", "time": 30, @@ -9878,7 +9878,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020107.webp", - "px": -300 + "px": -100 }, "index": "16", "time": 30, @@ -9896,7 +9896,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "17", "time": 30, @@ -9914,7 +9914,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020157.webp", - "px": -300 + "px": -100 }, "index": "18", "time": 30, @@ -9932,7 +9932,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "19", "time": 30, @@ -9950,7 +9950,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "20", "time": 30, @@ -9968,7 +9968,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020125.webp", - "px": -300 + "px": -100 }, "index": "21", "time": 30, @@ -9986,7 +9986,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020125.webp", - "px": -300 + "px": -100 }, "index": "22", "time": 30, @@ -10004,7 +10004,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020121.webp", - "px": -300 + "px": -100 }, "index": "23", "time": 30, @@ -10022,7 +10022,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "24", "time": 30, @@ -10040,7 +10040,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020121.webp", - "px": -300 + "px": -100 }, "index": "25", "time": 30, @@ -10058,7 +10058,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "26", "time": 30, @@ -10076,7 +10076,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020103.webp", - "px": -300 + "px": -100 }, "index": "27", "time": 30, @@ -10094,7 +10094,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020141.webp", - "px": -300 + "px": -100 }, "index": "28", "time": 30, @@ -10112,7 +10112,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "29", "time": 30, @@ -10130,7 +10130,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020105.webp", - "px": -300 + "px": -100 }, "index": "30", "time": 30, @@ -10148,7 +10148,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "31", "time": 30, @@ -10166,7 +10166,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020105.webp", - "px": -300 + "px": -100 }, "index": "32", "time": 30, @@ -10184,7 +10184,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020107.webp", - "px": -300 + "px": -100 }, "index": "33", "time": 30, @@ -10202,7 +10202,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "34", "time": 30, @@ -10220,7 +10220,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_020145.webp", - "px": -300 + "px": -100 }, "index": "35", "time": 30, @@ -10238,7 +10238,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "36", "time": 30, @@ -10256,7 +10256,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "37", "time": 30, @@ -10292,7 +10292,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "0", "time": 30, @@ -10335,7 +10335,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "1", "time": 30, @@ -10353,7 +10353,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "2", "time": 30, @@ -10371,7 +10371,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "3", "time": 30, @@ -10389,7 +10389,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "4", "time": 30, @@ -10407,7 +10407,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "5", "time": 30, @@ -10425,7 +10425,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "6", "time": 30, @@ -10443,7 +10443,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "7", "time": 30, @@ -10461,7 +10461,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "8", "time": 30, @@ -10504,7 +10504,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "9", "time": 30, @@ -10522,7 +10522,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "10", "time": 30, @@ -10540,7 +10540,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "11", "time": 30, @@ -10558,7 +10558,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "12", "time": 30, @@ -10576,7 +10576,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "13", "time": 30, @@ -10594,7 +10594,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "14", "time": 30, @@ -10612,7 +10612,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "15", "time": 30, @@ -10630,7 +10630,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "16", "time": 30, @@ -10671,7 +10671,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "17", "time": 30, @@ -10689,7 +10689,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "18", "time": 30, @@ -10716,7 +10716,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "19", "time": 30, @@ -10734,7 +10734,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "20", "time": 30, @@ -10752,7 +10752,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "21", "time": 30, @@ -10770,7 +10770,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "22", "time": 30, @@ -10788,7 +10788,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "23", "time": 30, @@ -10806,7 +10806,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "24", "time": 30, @@ -10828,7 +10828,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_440101.webp", - "px": -300 + "px": -100 }, "index": "25", "time": 30, @@ -10846,7 +10846,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "face_440105.webp", - "px": -300 + "px": -100 }, "index": "26", "time": 30, @@ -10864,7 +10864,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "27", "time": 30, @@ -10900,7 +10900,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "29", "time": 30, @@ -10918,7 +10918,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "30", "time": 30, @@ -10936,7 +10936,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "31", "time": 30, @@ -10954,7 +10954,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "32", "time": 30, @@ -10972,7 +10972,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "33", "time": 30, @@ -10990,7 +10990,7 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 = "WindowSkin": false, "head": { "name": "", - "px": -300 + "px": -100 }, "index": "34", "time": 30, diff --git a/project/functions.js b/project/functions.js index c50b22c..85f4ccb 100644 --- a/project/functions.js +++ b/project/functions.js @@ -788,18 +788,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = if (a) equipInfo.push(a) } - //处理回合条长度 - let oneTurn = [hero_speed, mon_speed]; - if (equipInfo.length > 0) { - for (let i = 0; i < equipInfo.length; i++) { - equipInfo[i].now = 0; - equipInfo[i].isAttack = false; - oneTurn.push(equipInfo[i].speed); - } - } - //需要变更 - const onegcd = gcd(...oneTurn) //最大公约数 - oneTurn = lcm(...oneTurn) //单次回合长度 + + let oneTurn = 100 //在这里处理equip的初始位置now equipInfo.forEach(v => { switch (v.id) { @@ -814,24 +804,14 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = const enemyinfo = { hp: mon_hp, atk: mon_atk, def: mon_def, mhp: 0, mdef: mon_mdef, spell: mon_spell, speed: mon_speed, special: mon_special, now: 0, isAttack: false } //怪物属性 //先攻,先攻为怪物50%行动条 if (core.hasSpecial(mon_special, 1)) { - enemyinfo.now = oneTurn / 2 + enemyinfo.now = 50 heroinfo.now = 0 } else { enemyinfo.now = 0 - heroinfo.now = oneTurn / 2 + heroinfo.now = 50 } - let max = heroinfo.speed - if (enemyinfo.speed > max) max = enemyinfo.speed - equipInfo.forEach(v => { if (v.speed > max) max = v.speed }) - let i = 1 - while (oneTurn * i / max < 30) { - i++ - } - heroinfo.now *= i - enemyinfo.now *= i - equipInfo.forEach(v => { v.now *= i }) - oneTurn *= i - const start = [core.clone(heroinfo), core.clone(enemyinfo), core.clone(equipInfo), oneTurn] //记录开始战斗时的属性并转发 + let Exspeed = hero_speed + const start = [core.clone(heroinfo), core.clone(enemyinfo), core.clone(equipInfo), Exspeed] //记录开始战斗时的属性并转发 //---第三部分:递归开始--- let poison = 0 const heroDiffList = [], @@ -840,6 +820,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = enemyanimateList = []; let beforehp = enemyinfo.hp + + while ( enemyinfo.hp > 0 ) { @@ -849,10 +831,10 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = hero_animate = [], enemy_animate = []; - heroinfo.now += heroinfo.speed - enemyinfo.now += enemyinfo.speed + heroinfo.now += heroinfo.speed / Exspeed + enemyinfo.now += enemyinfo.speed / Exspeed equipInfo.forEach(v => { - v.now += v.speed + v.now += v.speed / Exspeed }) if ( diff --git a/project/plugins.js b/project/plugins.js index feba2d6..0cee401 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -4000,10 +4000,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = number, x, y, - floorId + floorId, + config={} ) { var mon_hp = info.mon_hp, - hero_atk = core.status.hero.atk, + hero_atk = config.atk??core.status.hero.atk, mon_def = info.mon_def, pre = info.damage; var list = []; @@ -4012,26 +4013,29 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = start_atk += info.__overAtk__; list.push([info.__overAtk__, -info.damage]); } + var start=core.clone(config) + var mid=core.clone(config) + var end=core.clone(config) var calNext = function (currAtk, maxAtk) { - var start = Math.floor(currAtk), - end = Math.floor(maxAtk); - if (start > end) return null; + start.atk = Math.floor(currAtk) + end.atk = Math.floor(maxAtk); + if (start.atk > end.atk) return null; - while (start < end) { - var mid = Math.floor((start + end) / 2); - if (mid - start > end - mid) mid--; + while (start.atk < end.atk) { + mid.atk = Math.floor((start.atk + end.atk) / 2); + if (mid.atk - start.atk > end.atk - mid.atk) mid.atk--; var nextInfo = core.enemys.getDamageInfo( - enemy, { atk: mid }, + enemy, mid , x, y, floorId ); if (nextInfo == null || typeof nextInfo == "number") return null; - if (pre > nextInfo.damage) end = mid; - else start = mid + 1; + if (pre > nextInfo.damage) end.atk = mid.atk; + else start.atk = mid.atk + 1; } var nextInfo = core.enemys.getDamageInfo( - enemy, { atk: start }, + enemy, start, x, y, floorId @@ -4039,7 +4043,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = return nextInfo == null || typeof nextInfo == "number" || nextInfo.damage >= pre ? - null : [start, nextInfo.damage]; + null : [start.atk, nextInfo.damage]; }; var currAtk = start_atk; while (true) { @@ -4082,110 +4086,6 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = ); } }; - events.prototype.openBook = function (fromUserAction) { - if (core.isReplaying()) return; - // 如果能恢复事件(从callBook事件触发) - if ( - core.status.event.id == "book" && - core.events.recoverEvents(core.status.event.interval) - ) - return; - // 当前是book,且从“浏览地图”打开 - if (core.status.event.id == "book" && core.status.event.ui) { - core.status.boxAnimateObjs = []; - core.ui._drawViewMaps(core.status.event.ui); - return; - } - // 从“浏览地图”页面打开 - if (core.status.event.id == "viewMaps" || core.status.event.id == "fly") { - fromUserAction = false; - core.status.event.ui = core.status.event.data; - } - if (!this._checkStatus("book", fromUserAction, true)) return; - core.playSound("打开界面"); - core.useItem("book", true); - }; - ////// 怪物手册界面时,放开某个键的操作 ////// - core.actions._keyUpBook = function (keycode) { - if (keycode == 27 || keycode == 88) { - core.playSound("取消"); - if (core.events.recoverEvents(core.status.event.interval)) { - return; - } else if (core.status.event.ui != null) { - core.status.boxAnimateObjs = []; - if (typeof core.status.event.ui === "number") { - core.status.event.id = "fly"; - core.ui.drawFly(core.status.event.ui); - } else { - core.ui._drawViewMaps(core.status.event.ui); - } - } else core.ui.closePanel(); - return; - } - if (keycode == 13 || keycode == 32 || keycode == 67) { - var data = core.status.event.data; - if (data != null) { - core.ui._drawBookDetail(data); - } - return; - } - }; - ////// 怪物手册界面的点击操作 ////// - actions.prototype._clickBook = function (x, y) { - var pageinfo = core.ui._drawBook_pageinfo(); - // 上一页 - if ( - (x == this._HX_ - 2 || x == this._HX_ - 3) && - y === core._HEIGHT_ - 1 - ) { - core.playSound("光标移动"); - core.ui.drawBook(core.status.event.data - pageinfo.per_page); - return; - } - // 下一页 - if ( - (x == this._HX_ + 2 || x == this._HX_ + 3) && - y === core._HEIGHT_ - 1 - ) { - core.playSound("光标移动"); - core.ui.drawBook(core.status.event.data + pageinfo.per_page); - return; - } - // 返回 - if (x >= this.LAST - 2 && y === core._HEIGHT_ - 1) { - core.playSound("取消"); - if (core.events.recoverEvents(core.status.event.interval)) { - return; - } else if (core.status.event.ui != null) { - core.status.boxAnimateObjs = []; - if (typeof core.status.event.ui === "number") { - core.status.event.id = "fly"; - core.ui.drawFly(core.status.event.ui); - } else { - core.ui._drawViewMaps(core.status.event.ui); - } - } else core.ui.closePanel(); - return; - } - // 怪物信息 - var data = core.status.event.data; - if (data != null && y < core._HEIGHT_ - 1) { - var per_page = pageinfo.per_page, - page = parseInt(data / per_page); - var u = (core._HEIGHT_ - 1) / per_page; - for (var i = 0; i < per_page; ++i) { - if (y >= u * i && y < u * (i + 1)) { - var index = per_page * page + i; - core.ui.drawBook(index); - core.ui._drawBookDetail(index); - break; - } - } - return; - } - return; - }; - ////// 执行当前自定义事件列表中的下一个事件 ////// events.prototype.doAction = function () { // 清空boxAnimate和UI层 @@ -20019,7 +19919,6 @@ let time=0 const changeY = -30 let easy = false; const { imagelighter } = core.plugin.utils; - const { lcm, gcd } = core.plugin.utils; let a = [] @@ -20052,7 +19951,6 @@ let time=0 core.animateFrame.animate2Time = 0 function animationFrame(callback1) { - let time = 0 const ctx = core.getContextByName("animateAttack") ?? core.createCanvas("animateAttack", 0, 0, 416, 416, 80) const anctx = core.getContextByName("animate2") ?? core.createCanvas("animate2", 0, 0, 416, 416, 91) core.registerAnimationFrame("animate2", true, function (timestamp) { @@ -20117,13 +20015,14 @@ let time=0 drawAnimate(name, 130, 180 + changeY); } } - + let sp = [1, 2, 4, 8, 16] + let A = 1 this.attackAnimate = function ( enemyId, heroInfo, enemyInfo, equipInfo, - oneTurn, + Exspeed, heroDiffList, enemyDiffList, heroanimateList, @@ -20140,21 +20039,11 @@ let time=0 enemyInfo.id = enemyId; enemyInfo.cls = core.getClsFromId(enemyId); enemyInfo.name = core.material.enemys[enemyId].name; - let max = heroInfo.speed - if (enemyInfo.speed > max) max = enemyInfo.speed - equipInfo.forEach(v => { if (v.speed > max) max = v.speed }) - let i = 1 - while (oneTurn * i / max < 30) { - i++ - } heroInfo.turn = 0 enemyInfo.turn = 0 - heroInfo.now *= i - enemyInfo.now *= i - equipInfo.forEach(v => { v.now *= i }) - oneTurn *= i - let time = 0, - farme = 0; + const oneTurn = 100 + let farme = 0; + return new Promise((res) => { core.plugin.battle_onclick = function (x, y, px, py) { const makeBox = ([x, y], [w, h]) => { @@ -20184,7 +20073,9 @@ let time=0 (inRect(pos, easyspeedbox) && easy) || (inRect(pos, uneasyspeedbox) && !easy) ) { - flags.qukly = !flags.qukly + A++ + if (A >= sp.length) A = 0 + flags.qukly = sp[A] } else if ((inRect(pos, easyClosebox) && easy) || (inRect(pos, uneasyClosebox) && !easy) @@ -20198,7 +20089,6 @@ let time=0 }; async function drawAttackAnimate( heroInfo, - oneTurn, enemyInfo, equipInfo, farme, @@ -20227,26 +20117,25 @@ let time=0 core.clearMap(ctx); let animate = Math.floor(farme / 15); - if (flags.qukly) { - while (true) { - let goattack = false - equipInfo.forEach(v => { - if (v.now >= oneTurn) goattack = true - }); - if (enemyInfo.now >= oneTurn) goattack = true - if (heroInfo.now >= oneTurn) goattack = true + for (let i = 0; i < (flags.qukly ?? 2) / 2; i++) { + let goattack = false + equipInfo.forEach(v => { + if (v.now >= oneTurn) goattack = true - if (goattack) break; - enemyInfo.now += enemyInfo.speed - heroInfo.now += heroInfo.speed - equipInfo.forEach(function (v) { - v.now += v.speed + }); + if (enemyInfo.now >= oneTurn) goattack = true + if (heroInfo.now >= oneTurn) goattack = true + if (goattack || attack || onAttack) break; + enemyInfo.now += enemyInfo.speed / Exspeed + heroInfo.now += heroInfo.speed / Exspeed + equipInfo.forEach(function (v) { + v.now += v.speed / Exspeed - }); + }); - } } + if (easy) { core.fillRect(ctx, 64, 52, 288, 212, "rgba(0,0,0,0.5)"); core.strokeRect(ctx, 64, 52, 288, 212, "rgba(255,255,255,0.5)", 4); @@ -20377,7 +20266,7 @@ let time=0 ); core.fillBoldText( ctx, - flags.qukly ? "正常" : "极速", + "x" + (flags.qukly ?? 2) / 2, 330, 250 + changeY, "#FFFF60", @@ -20412,7 +20301,6 @@ let time=0 "bold 36px pala" ); - if (!attack && !onAttack && !flags.qukly) enemyInfo.now += enemyInfo.speed; let enemynow = Math.min(100 + (enemyInfo.now / oneTurn) * 215, 315); ctx.fillStyle = "#FFFFFF"; ctx.beginPath(); @@ -20425,7 +20313,6 @@ let time=0 core.drawLine(ctx, 100, 125 + changeY, 315, 125 + changeY, "#FFFFFF", 5); equipInfo.forEach(function (v) { - if (!attack && !onAttack) v.now += v.speed; let vnow = Math.min(100 + (v.now / oneTurn) * 215, 315); ctx.beginPath(); ctx.moveTo(vnow, 120 + changeY); @@ -20437,7 +20324,6 @@ let time=0 core.drawIcon(ctx, v.id, vnow - 16, 84 + changeY, 32, 32); }); - if (!attack && !onAttack && !flags.qukly) heroInfo.now += hero.speed; let heronow = Math.min(100 + (heroInfo.now / oneTurn) * 215, 315); ctx.beginPath(); ctx.moveTo(heronow, 120); @@ -20697,7 +20583,7 @@ let time=0 ); core.fillBoldText( ctx, - flags.qukly ? "正常" : "极速", + "x" + (flags.qukly ?? 2) / 2, 330, 365 + changeY, "#FFFF60", @@ -20732,7 +20618,6 @@ let time=0 "bold 36px pala" ); - if (!attack && !onAttack & !flags.qukly) enemyInfo.now += enemyInfo.speed; let enemynow = Math.min(100 + (enemyInfo.now / oneTurn) * 215, 315); ctx.fillStyle = "#FFFFFF"; ctx.beginPath(); @@ -20745,7 +20630,6 @@ let time=0 core.drawLine(ctx, 100, 125 + changeY, 315, 125 + changeY, "#FFFFFF", 5); equipInfo.forEach(function (v) { - if (!attack && !onAttack) v.now += v.speed; let vnow = Math.min(100 + (v.now / oneTurn) * 215, 315); ctx.beginPath(); ctx.moveTo(vnow, 120 + changeY); @@ -20757,7 +20641,6 @@ let time=0 core.drawIcon(ctx, v.id, vnow - 16, 84 + changeY, 32, 32); }); - if (!attack && !onAttack && !flags.qukly) heroInfo.now += hero.speed; let heronow = Math.min(100 + (heroInfo.now / oneTurn) * 215, 315); ctx.beginPath(); ctx.moveTo(heronow, 120 + changeY); @@ -20852,19 +20735,36 @@ let time=0 if (heroDiffList[turn] < 0) heroInfo.inAttack = true; if (heroInfo.hp < 0) heroInfo.hp = 0; if (enemyInfo.hp < 0) enemyInfo.hp = 0; - await Promise.all([ + await new Promise((resolve) => animationFrame(resolve)).then(() => { + if (heroInfo.isAttack) { + heroInfo.now -= oneTurn; + heroInfo.isAttack = false; + } + if (enemyInfo.isAttack) { + enemyInfo.now -= oneTurn; + enemyInfo.isAttack = false; + } + if (equipanimate.length > 0) { + equipanimate.forEach((v) => { + v.now -= oneTurn; + v.isAttack = false; + }); + } + turn++ + }) + /*await Promise.all([ await new Promise((resolve) => animationFrame(resolve)), new Promise((resolve) => { if (heroInfo.isAttack) { - heroInfo.now = 0; + heroInfo.now -= 100; heroInfo.isAttack = false; } resolve(); }), new Promise((resolve) => { if (enemyInfo.isAttack) { - enemyInfo.now = 0; + enemyInfo.now -= 100; enemyInfo.isAttack = false; } resolve(); @@ -20872,7 +20772,7 @@ let time=0 new Promise((resolve) => { if (equipanimate.length > 0) { equipanimate.forEach((v) => { - v.now = 0; + v.now -= 100; v.isAttack = false; }); } @@ -20882,7 +20782,7 @@ let time=0 turn++; resolve(); }), - ]); + ]);*/ if (heroInfo.hp <= 0 || enemyInfo.hp <= 0) { core.status.event.id = ""; @@ -20894,12 +20794,10 @@ let time=0 } } - core.registerAnimationFrame("attackAnimate", true, (temptime) => { + core.registerAnimationFrame("attackAnimate", true, () => { - time = temptime; drawAttackAnimate( heroInfo, - oneTurn, enemyInfo, equipInfo, farme, @@ -21895,29 +21793,36 @@ let time=0 //临界表 core.ui._drawBookDetail_turnAndCriticals = function (enemy, floorId, texts) { // 临界表 - var criticals = core.enemys.nextCriticals(enemy.id, 8, enemy.x, enemy.y, floorId).map(function (v) { + var criticals = core.enemys.nextCriticals(enemy.id, 5, enemy.x, enemy.y, floorId).map(function (v) { return core.formatBigNumber(v[0]) + ":" + core.formatBigNumber(v[1]); }); while (criticals[0] == '0:0') criticals.shift(); - texts.push("\r[#FF6A6A]\\d攻击临界表:\\d\r[]" + JSON.stringify(criticals)); - var criticals_spell = core.nextCriticals_spell(enemy.id, 8, enemy.x, enemy.y, floorId).map(function (v) { + if (criticals.length > 0) { + texts.push("\r[#FF6A6A]\\d攻击临界表:\\d\r[]" + JSON.stringify(criticals)); + } + var criticals_spell = core.nextCriticals_spell(enemy.id, 5, enemy.x, enemy.y, floorId).map(function (v) { return core.formatBigNumber(v[0]) + ":" + core.formatBigNumber(v[1]); }); while (criticals_spell[0] == '0:0') criticals_spell.shift(); - texts.push("\r[#FF6A6A]\\d法强临界表:\\d\r[]" + JSON.stringify(criticals_spell)); - var criticals_speed = core.nextCriticals_speed(enemy.id, 8, enemy.x, enemy.y, floorId).map(function (v) { + if (criticals_spell.length > 0) { + texts.push("\r[#FF6A6A]\\d法强临界表:\\d\r[]" + JSON.stringify(criticals_spell)); + } + var criticals_speed = core.nextCriticals_speed(enemy.id, 5, enemy.x, enemy.y, floorId).map(function (v) { return core.formatBigNumber(v[0]) + ":" + core.formatBigNumber(v[1]); }); + while (criticals_speed[0] == '0:0') criticals_speed.shift(); - texts.push("\r[#FF6A6A]\\d速度临界表:\\d\r[]" + JSON.stringify(criticals_speed)); + if (criticals_speed.length > 0) { + texts.push("\r[#FF6A6A]\\d速度临界表:\\d\r[]" + JSON.stringify(criticals_speed)); + } } //攻速临界计算 - core.nextCriticals_speed = function (enemy, number, x, y, floorId) { + core.nextCriticals_speed = function (enemy, number, x, y, floorId, config = {}) { if (typeof enemy == 'string') enemy = core.material.enemys[enemy]; number = number || 1; - var info = core.getDamageInfo(enemy, null, x, y, floorId); + var info = core.getDamageInfo(enemy, config, x, y, floorId); if (info == null) { // 如果未破防... return [ ['?', '?'] @@ -21929,31 +21834,33 @@ let time=0 [0, 0] ]; } - return core.enemys._nextSpeedCriticals_useBinarySearch(enemy, info, number, x, y, floorId); + return core.enemys._nextSpeedCriticals_useBinarySearch(enemy, info, number, x, y, floorId, config); } - enemys.prototype._nextSpeedCriticals_useBinarySearch = function (enemy, info, number, x, y, floorId) { + enemys.prototype._nextSpeedCriticals_useBinarySearch = function (enemy, info, number, x, y, floorId, config = {}) { var mon_hp = info.mon_hp, - hero_speed = core.status.hero.speed, + hero_speed = config.speed ?? core.status.hero.speed, mon_def = info.mon_def, pre = info.damage; var list = []; var start_speed = hero_speed; - + var start = core.clone(config) + var mid = core.clone(config) + var end = core.clone(config) var calNext = function (currSpeed, maxSpeed) { - var start = Math.floor(currSpeed), - end = Math.floor(maxSpeed); - if (start > end) return null; + start.speed = Math.floor(currSpeed) + end.speed = Math.floor(maxSpeed); + if (start.speed > end.speed) return null; - while (start < end) { - var mid = Math.floor((start + end) / 2); - if (mid - start > end - mid) mid--; - var nextInfo = core.enemys.getDamageInfo(enemy, { "speed": mid }, x, y, floorId); + while (start.speed < end.speed) { + mid.speed = Math.floor((start.speed + end.speed) / 2); + if (mid.speed - start.speed > end.speed - mid.speed) mid.speed--; + var nextInfo = core.enemys.getDamageInfo(enemy, mid, x, y, floorId); if (nextInfo == null || (typeof nextInfo == 'number')) return null; - if (pre > nextInfo.damage) end = mid; - else start = mid + 1; + if (pre > nextInfo.damage) end.speed = mid.speed; + else start.speed = mid.speed + 1; } - var nextInfo = core.enemys.getDamageInfo(enemy, { "speed": start }, x, y, floorId); - return nextInfo == null || (typeof nextInfo == 'number') || nextInfo.damage >= pre ? null : [start, nextInfo.damage]; + var nextInfo = core.enemys.getDamageInfo(enemy, start, x, y, floorId); + return nextInfo == null || (typeof nextInfo == 'number') || nextInfo.damage >= pre ? null : [start.speed, nextInfo.damage]; } var currSpeed = start_speed; while (true) { @@ -21969,7 +21876,7 @@ let time=0 return list; } //法强临界计算 - core.nextCriticals_spell = function (enemy, number, x, y, floorId) { + core.nextCriticals_spell = function (enemy, number, x, y, floorId, config = {}) { if (typeof enemy == 'string') enemy = core.material.enemys[enemy]; number = number || 1; @@ -21985,32 +21892,34 @@ let time=0 [0, 0] ]; } - return core.enemys._nextSpellCriticals_useBinarySearch(enemy, info, number, x, y, floorId); + return core.enemys._nextSpellCriticals_useBinarySearch(enemy, info, number, x, y, floorId, config); } - enemys.prototype._nextSpellCriticals_useBinarySearch = function (enemy, info, number, x, y, floorId) { + enemys.prototype._nextSpellCriticals_useBinarySearch = function (enemy, info, number, x, y, floorId, config = {}) { var mon_hp = info.mon_hp, - hero_spell = core.status.hero.spell, + hero_spell = config.spell ?? core.status.hero.spell, mon_def = info.mon_def, turn = info.mon_turn, pre = info.damage; var list = []; var start_spell = hero_spell; - + var start = core.clone(config) + var mid = core.clone(config) + var end = core.clone(config) var calNext = function (currSpell, maxSpell) { - var start = Math.floor(currSpell), - end = Math.floor(maxSpell); - if (start > end) return null; + start.spell = Math.floor(currSpell) + end.spell = Math.floor(maxSpell); + if (start.spell > end.spell) return null; - while (start < end) { - var mid = Math.floor((start + end) / 2); - if (mid - start > end - mid) mid--; - var nextInfo = core.enemys.getDamageInfo(enemy, { "spell": mid }, x, y, floorId); + while (start.spell < end.spell) { + mid.spell = Math.floor((start.spell + end.spell) / 2); + if (mid.spell - start.spell > end.spell - mid.spell) mid.spell--; + var nextInfo = core.enemys.getDamageInfo(enemy, mid, x, y, floorId); if (nextInfo == null || (typeof nextInfo == 'number')) return null; - if (turn > nextInfo.mon_turn) end = mid; - else start = mid + 1; + if (turn > nextInfo.mon_turn) end.spell = mid.spell; + else start.spell = mid.spell + 1; } - var nextInfo = core.enemys.getDamageInfo(enemy, { "spell": start }, x, y, floorId); - return nextInfo == null || (typeof nextInfo == 'number') || nextInfo.mon_turn >= turn ? null : [start, nextInfo.damage]; + var nextInfo = core.enemys.getDamageInfo(enemy, start, x, y, floorId); + return nextInfo == null || (typeof nextInfo == 'number') || nextInfo.mon_turn >= turn ? null : [start.spell, nextInfo.damage]; } var currSpell = start_spell; while (true) { @@ -22135,6 +22044,14 @@ let time=0 this.tempLeft = this.tempLeft.getContext("2d") this.tempRight = this.tempRight.getContext("2d") this.animateObjs = {} + this.atk = 0 + this.speed = 0 + this.spell = 0 + this.def = 0 + this.atkStep = 1 + this.speedStep = 1 + this.spellStep = 1 + this.defStep = 1 } getCurrentEnemys(floorId) { @@ -22218,9 +22135,6 @@ let time=0 } - } - pageinfo() { - } drawTempLeft(dir) { core.clearMap(this.tempLeft) @@ -22260,8 +22174,8 @@ let time=0 } drawTempRight(dir) { core.clearMap(this.tempRight) - const enemy = this.enemys[this.page + dir] - core.maps.drawThumbnail(this.floorId, null, { ctx: this.tempRight, size: 0.4, x: 10, y: 220 }) + const enemy = this.enemys[this.page] + core.maps.drawThumbnail(this.floorId, null, { ctx: this.tempRight, size: 0.4, x: 10, y: 220, noEnabled: true }) enemy.locs.forEach(v => { this.tempRight.beginPath() this.tempRight.moveTo(10 + (32 * v[0] + 16) * 0.4, 220 + 32 * v[1] * 0.4) @@ -22272,11 +22186,108 @@ let time=0 this.tempRight.fill() }) core.setTextAlign(this.tempRight, 'left') - core.fillText(this.tempRight, "出手 " + (core.getDamageInfo(enemy, null) ? core.getDamageInfo(enemy, null).hero_turn : '???'), 30, 50, "#000000", core.ui._buildFont(12, true)) - core.fillText(this.tempRight, "受击 " + (core.getDamageInfo(enemy, null) ? core.getDamageInfo(enemy, null).mon_turn : '???'), 130, 50, "#000000", core.ui._buildFont(12, true)) - core.fillText(this.tempRight, enemy.damage === "???" ? "你会死的哦~杂鱼❤~" : enemy.damage, 230, 50, "#FF0000", core.ui._buildFont(12, true)) + let getDamageInfo = core.getDamageInfo(enemy, null) + core.fillText(this.tempRight, "出手次数 " + (getDamageInfo ? getDamageInfo.hero_turn : '???'), 30, 50, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, "受击次数 " + (getDamageInfo ? getDamageInfo.mon_turn : '???'), 130, 50, "#000000", core.ui._buildFont(12, true)) + let color = "#FFFF00", + damage = enemy.damage + if (damage == '???') { + damage = '你会死的哦~杂鱼❤~'; + color = '#FF2222'; + } else { + if (damage >= core.status.hero.hp) color = '#FF2222'; + else if (damage >= core.status.hero.hp * 2 / 3) color = '#FF9933'; + else if (damage <= 0) color = '#11FF11'; + damage = core.formatBigNumber(damage); + } + if (enemy.notBomb) damage += "[b]"; + core.fillText(this.tempRight, damage, 230, 50, color, core.ui._buildFont(12, true)) + core.fillText(this.tempRight, "攻击临界 " + enemy.criticalAtk[0], 30, 70, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, "速度临界 " + enemy.criticalSpeed[0], 120, 70, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, '法强临界 ' + enemy.criticalSpell[0], 210, 70, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, "减伤 " + enemy.criticalAtk[1], 30, 90, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, "减伤 " + enemy.criticalSpeed[1], 120, 90, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, '减伤 ' + enemy.criticalSpell[1], 210, 90, "#000000", core.ui._buildFont(12, true)) + + + if (this.atk > 0 || this.def > 0 || this.speed > 0 || this.spell > 0) { + core.setTextAlign(this.tempRight, 'center'); + core.fillText(this.tempRight, "增幅战斗情况", 150, 110, "#000000", core.ui._buildFont(16, true)) + core.setTextAlign(this.tempRight, 'left'); + const config = { atk: core.getRealStatus("atk") + this.atk, def: core.getRealStatus("def") + this.def, spell: core.getRealStatus("spell") + this.spell, speed: core.getRealStatus("speed") + this.speed } + getDamageInfo = core.getDamageInfo(enemy, config) + core.fillText(this.tempRight, "出手次数 " + (getDamageInfo ? getDamageInfo.hero_turn : '???'), 30, 130, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, "受击次数 " + (getDamageInfo ? getDamageInfo.mon_turn : '???'), 130, 130, "#000000", core.ui._buildFont(12, true)) + color = "#FFFF00" + damage = getDamageInfo.damage + if (damage == '???') { + damage = '你会死的哦~杂鱼❤~'; + color = '#FF2222'; + } else { + if (damage >= core.status.hero.hp) color = '#FF2222'; + else if (damage >= core.status.hero.hp * 2 / 3) color = '#FF9933'; + else if (damage <= 0) color = '#11FF11'; + damage = core.formatBigNumber(damage); + } + if (enemy.notBomb) damage += "[b]"; + core.fillText(this.tempRight, damage, 230, 130, color, core.ui._buildFont(12, true)) + let atk = core.nextCriticals(enemy, null, null, null, null, config) + let speed = core.nextCriticals_speed(enemy, null, null, null, null, config) + let spell = core.nextCriticals_spell(enemy, null, null, null, null, config) + core.fillText(this.tempRight, "攻击临界 " + atk[0][0], 30, 150, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, "速度临界 " + speed[0][0], 120, 150, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, '法强临界 ' + spell[0][0], 210, 150, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, "减伤 " + atk[0][1], 30, 170, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, "减伤 " + speed[0][1], 120, 170, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, '减伤 ' + spell[0][1], 210, 170, "#000000", core.ui._buildFont(12, true)) + } else { + core.setTextAlign(this.tempRight, 'center'); + core.fillText(this.tempRight, "临界表", 150, 110, "#000000", core.ui._buildFont(16, true)) + let texts = [] + core.ui._drawBookDetail_turnAndCriticals(enemy, this.floorId, texts) + core.drawTextContent(this.tempRight, texts.join('\n'), { + left: 30, + top: 115, + maxWidth: 240, + fontSize: 10, + lineHeight: 12, + color: "#000000" + }); + } + core.setTextAlign(this.tempRight, 'left') + core.fillText(this.tempRight, "攻 " + core.formatBigNumber(this.atk), 30, 210, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, "防 " + core.formatBigNumber(this.def), 90, 210, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, "法 " + core.formatBigNumber(this.spell), 150, 210, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, "速 " + core.formatBigNumber(this.speed), 210, 210, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, "攻", 180, 260, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, "防", 180, 290, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, "法", 180, 320, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, "速", 180, 350, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, "-", 200, 262, "#000000", core.ui._buildFont(24, true)) + core.fillText(this.tempRight, "-", 200, 292, "#000000", core.ui._buildFont(24, true)) + core.fillText(this.tempRight, "-", 200, 322, "#000000", core.ui._buildFont(24, true)) + core.fillText(this.tempRight, "-", 200, 352, "#000000", core.ui._buildFont(24, true)) core.setTextAlign(this.tempRight, 'center'); - core.fillText(this.tempRight, "当前战斗情况", 150, 25, "#000000", core.ui._buildFont(16, true)) + core.fillText(this.tempRight, core.formatBigNumber(this.atkStep), 230, 260, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, core.formatBigNumber(this.defStep), 230, 290, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, core.formatBigNumber(this.spellStep), 230, 320, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.tempRight, core.formatBigNumber(this.speedStep), 230, 350, "#000000", core.ui._buildFont(12, true)) + core.setTextAlign(this.tempRight, 'left'); + + core.fillText(this.tempRight, "+", 250, 263, "#000000", core.ui._buildFont(24, true)) + core.fillText(this.tempRight, "+", 250, 293, "#000000", core.ui._buildFont(24, true)) + core.fillText(this.tempRight, "+", 250, 323, "#000000", core.ui._buildFont(24, true)) + core.fillText(this.tempRight, "+", 250, 353, "#000000", core.ui._buildFont(24, true)) + + core.fillText(this.tempRight, "↑", 265, 265, "#000000", core.ui._buildFont(24, true)) + core.fillText(this.tempRight, "↑", 265, 295, "#000000", core.ui._buildFont(24, true)) + core.fillText(this.tempRight, "↑", 265, 325, "#000000", core.ui._buildFont(24, true)) + core.fillText(this.tempRight, "↑", 265, 355, "#000000", core.ui._buildFont(24, true)) + core.fillText(this.tempRight, "清零", 180, 380, '#000000', core.ui._buildFont(16, true)); + core.setTextAlign(this.tempRight, 'center'); + core.fillText(this.tempRight, "当前战斗情况", 150, 30, "#000000", core.ui._buildFont(16, true)) + core.fillText(this.tempRight, "模拟属性提升", 150, 190, "#000000", core.ui._buildFont(16, true)) + core.fillText(this.tempRight, "模拟属性调整", 230, 233, "#000000", core.ui._buildFont(16, true)) core.fillText(this.tempRight, "合上书本", 254, 380, '#000000', core.ui._buildFont(16, true)); } drawLeft() { @@ -22308,9 +22319,9 @@ let time=0 core.drawTextContent(this.left, hints.join('\n'), { left: 30, top: 240, - maxWidth: 220, - fontSize: 14, - lineHeight: 20, + maxWidth: 240, + fontSize: 12, + lineHeight: 16, color: "#000000" }); @@ -22318,7 +22329,7 @@ let time=0 drawRight() { core.clearMap(this.right) const enemy = this.enemys[this.page] - core.maps.drawThumbnail(this.floorId, null, { ctx: this.right, size: 0.4, x: 10, y: 220 }) + core.maps.drawThumbnail(this.floorId, null, { ctx: this.right, size: 0.4, x: 10, y: 220, noEnabled: true }) enemy.locs.forEach(v => { this.right.beginPath() this.right.moveTo(10 + (32 * v[0] + 16) * 0.4, 220 + 32 * v[1] * 0.4) @@ -22329,12 +22340,110 @@ let time=0 this.right.fill() }) core.setTextAlign(this.right, 'left') - core.fillText(this.right, "出手 " + (core.getDamageInfo(enemy, null) ? core.getDamageInfo(enemy, null).hero_turn : '???'), 30, 50, "#000000", core.ui._buildFont(12, true)) - core.fillText(this.right, "受击 " + (core.getDamageInfo(enemy, null) ? core.getDamageInfo(enemy, null).mon_turn : '???'), 130, 50, "#000000", core.ui._buildFont(12, true)) - core.fillText(this.right, enemy.damage === "???" ? "你会死的哦~杂鱼❤~" : enemy.damage, 230, 50, "#FF0000", core.ui._buildFont(12, true)) + let getDamageInfo = core.getDamageInfo(enemy, null) + core.fillText(this.right, "出手次数 " + (getDamageInfo ? getDamageInfo.hero_turn : '???'), 30, 50, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, "受击次数 " + (getDamageInfo ? getDamageInfo.mon_turn : '???'), 130, 50, "#000000", core.ui._buildFont(12, true)) + let color = "#FFFF00", + damage = enemy.damage + if (damage == '???') { + damage = '你会死的哦~杂鱼❤~'; + color = '#FF2222'; + } else { + if (damage >= core.status.hero.hp) color = '#FF2222'; + else if (damage >= core.status.hero.hp * 2 / 3) color = '#FF9933'; + else if (damage <= 0) color = '#11FF11'; + damage = core.formatBigNumber(damage); + } + if (enemy.notBomb) damage += "[b]"; + core.fillText(this.right, damage, 230, 50, color, core.ui._buildFont(12, true)) + core.fillText(this.right, "攻击临界 " + enemy.criticalAtk[0], 30, 70, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, "速度临界 " + enemy.criticalSpeed[0], 120, 70, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, '法强临界 ' + enemy.criticalSpell[0], 210, 70, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, "减伤 " + enemy.criticalAtk[1], 30, 90, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, "减伤 " + enemy.criticalSpeed[1], 120, 90, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, '减伤 ' + enemy.criticalSpell[1], 210, 90, "#000000", core.ui._buildFont(12, true)) + + + if (this.atk > 0 || this.def > 0 || this.speed > 0 || this.spell > 0) { + core.setTextAlign(this.right, 'center'); + core.fillText(this.right, "增幅战斗情况", 150, 110, "#000000", core.ui._buildFont(16, true)) + core.setTextAlign(this.right, 'left'); + const config = { atk: core.getRealStatus("atk") + this.atk, def: core.getRealStatus("def") + this.def, spell: core.getRealStatus("spell") + this.spell, speed: core.getRealStatus("speed") + this.speed } + getDamageInfo = core.getDamageInfo(enemy, config) + core.fillText(this.right, "出手次数 " + (getDamageInfo ? getDamageInfo.hero_turn : '???'), 30, 130, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, "受击次数 " + (getDamageInfo ? getDamageInfo.mon_turn : '???'), 130, 130, "#000000", core.ui._buildFont(12, true)) + color = "#FFFF00" + damage = getDamageInfo.damage + if (damage == '???') { + damage = '你会死的哦~杂鱼❤~'; + color = '#FF2222'; + } else { + if (damage >= core.status.hero.hp) color = '#FF2222'; + else if (damage >= core.status.hero.hp * 2 / 3) color = '#FF9933'; + else if (damage <= 0) color = '#11FF11'; + damage = core.formatBigNumber(damage); + } + if (enemy.notBomb) damage += "[b]"; + core.fillText(this.right, damage, 230, 130, color, core.ui._buildFont(12, true)) + let atk = core.nextCriticals(enemy, null, null, null, null, config) + let speed = core.nextCriticals_speed(enemy, null, null, null, null, config) + let spell = core.nextCriticals_spell(enemy, null, null, null, null, config) + core.fillText(this.right, "攻击临界 " + atk[0][0], 30, 150, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, "速度临界 " + speed[0][0], 120, 150, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, '法强临界 ' + spell[0][0], 210, 150, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, "减伤 " + atk[0][1], 30, 170, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, "减伤 " + speed[0][1], 120, 170, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, '减伤 ' + spell[0][1], 210, 170, "#000000", core.ui._buildFont(12, true)) + } else { + core.setTextAlign(this.right, 'center'); + core.fillText(this.right, "临界表", 150, 110, "#000000", core.ui._buildFont(16, true)) + let texts = [] + core.ui._drawBookDetail_turnAndCriticals(enemy, this.floorId, texts) + core.drawTextContent(this.right, texts.join('\n'), { + left: 30, + top: 115, + maxWidth: 240, + fontSize: 10, + lineHeight: 12, + color: "#000000" + }); + } + core.setTextAlign(this.right, 'left') + core.fillText(this.right, "攻 " + core.formatBigNumber(this.atk), 30, 210, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, "防 " + core.formatBigNumber(this.def), 90, 210, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, "法 " + core.formatBigNumber(this.spell), 150, 210, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, "速 " + core.formatBigNumber(this.speed), 210, 210, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, "攻", 180, 260, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, "防", 180, 290, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, "法", 180, 320, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, "速", 180, 350, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, "-", 200, 262, "#000000", core.ui._buildFont(24, true)) + core.fillText(this.right, "-", 200, 292, "#000000", core.ui._buildFont(24, true)) + core.fillText(this.right, "-", 200, 322, "#000000", core.ui._buildFont(24, true)) + core.fillText(this.right, "-", 200, 352, "#000000", core.ui._buildFont(24, true)) core.setTextAlign(this.right, 'center'); - core.fillText(this.right, "当前战斗情况", 150, 25, "#000000", core.ui._buildFont(16, true)) + core.fillText(this.right, core.formatBigNumber(this.atkStep), 230, 260, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, core.formatBigNumber(this.defStep), 230, 290, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, core.formatBigNumber(this.spellStep), 230, 320, "#000000", core.ui._buildFont(12, true)) + core.fillText(this.right, core.formatBigNumber(this.speedStep), 230, 350, "#000000", core.ui._buildFont(12, true)) + core.setTextAlign(this.right, 'left'); + + core.fillText(this.right, "+", 250, 263, "#000000", core.ui._buildFont(24, true)) + core.fillText(this.right, "+", 250, 293, "#000000", core.ui._buildFont(24, true)) + core.fillText(this.right, "+", 250, 323, "#000000", core.ui._buildFont(24, true)) + core.fillText(this.right, "+", 250, 353, "#000000", core.ui._buildFont(24, true)) + + core.fillText(this.right, "↑", 265, 265, "#000000", core.ui._buildFont(24, true)) + core.fillText(this.right, "↑", 265, 295, "#000000", core.ui._buildFont(24, true)) + core.fillText(this.right, "↑", 265, 325, "#000000", core.ui._buildFont(24, true)) + core.fillText(this.right, "↑", 265, 355, "#000000", core.ui._buildFont(24, true)) + core.fillText(this.right, "清零", 180, 380, '#000000', core.ui._buildFont(16, true)); + core.setTextAlign(this.right, 'center'); + core.fillText(this.right, "当前战斗情况", 150, 30, "#000000", core.ui._buildFont(16, true)) + core.fillText(this.right, "模拟属性提升", 150, 190, "#000000", core.ui._buildFont(16, true)) + core.fillText(this.right, "模拟属性调整", 230, 233, "#000000", core.ui._buildFont(16, true)) core.fillText(this.right, "合上书本", 254, 380, '#000000', core.ui._buildFont(16, true)); + } clear() { @@ -22344,7 +22453,12 @@ let time=0 core.clearMap(this.tempLeft) core.clearMap(this.tempRight) } - + clearEx() { + this.atk = 0 + this.speed = 0 + this.spell = 0 + this.def = 0 + } init(floorId) { this.page = 0 this.getCurrentEnemys(floorId) @@ -22386,16 +22500,118 @@ let time=0 const leftbox = makeBox([(676 - this.width * 2) / 2, (416 - this.height) / 2], [this.width, this.height]) const rightbox = makeBox([338, (416 - this.height) / 2], [this.width, this.height]) const exitbox = makeBox([555, 365], [70, 35]) + const atkupbox = makeBox([581, 251], [25, 25]) + const atkdownbox = makeBox([531, 251], [25, 25]) + const atkchangebox = makeBox([606, 251], [25, 25]) + const defupbox = makeBox([581, 281], [25, 25]) + const defdownbox = makeBox([531, 281], [25, 25]) + const defchangebox = makeBox([606, 281], [25, 25]) + const spellupbox = makeBox([581, 311], [25, 25]) + const spelldownbox = makeBox([531, 311], [25, 25]) + const spellchangebox = makeBox([606, 311], [25, 25]) + const speedupbox = makeBox([581, 341], [25, 25]) + const speeddownbox = makeBox([531, 341], [25, 25]) + const speedchangebox = makeBox([606, 341], [25, 25]) + const zerochangebox = makeBox([515, 365], [35, 35]) if (this.isAnimate) return - if (inRect(pos, exitbox)) { + if (inRect(pos, atkupbox)) { + bookInfo.atk += bookInfo.atkStep + bookInfo.drawRight() + this.update() + } else if (inRect(pos, atkdownbox)) { + bookInfo.atk -= bookInfo.atkStep + if (bookInfo.atk < 0) bookInfo.atk = 0 + bookInfo.drawRight() + this.update() + } else if (inRect(pos, atkchangebox)) { + core.myprompt("请输入攻击调整步距(只可输入数字)", null, (value) => { + if (value && !Number.isNaN(Number(value)) && Number(value) >= 1) { + bookInfo.atkStep = Number(value) + bookInfo.drawRight() + this.update() + } else if (value) { + alert("无效的输入!"); + } else if (value === "") { + + } + }); + } else if (inRect(pos, defupbox)) { + bookInfo.def += bookInfo.defStep + bookInfo.drawRight() + this.update() + } else if (inRect(pos, defdownbox)) { + bookInfo.def -= bookInfo.defStep + if (bookInfo.def < 0) bookInfo.def = 0 + bookInfo.drawRight() + this.update() + } else if (inRect(pos, defchangebox)) { + core.myprompt("请输入防御调整步距(只可输入数字)", null, (value) => { + if (value && !Number.isNaN(Number(value)) && Number(value) >= 1) { + bookInfo.defStep = Number(value) + bookInfo.drawRight() + this.update() + } else if (value) { + alert("无效的输入!"); + } else if (value === "") { + + } + }); + } else if (inRect(pos, spellupbox)) { + bookInfo.spell += bookInfo.spellStep + bookInfo.drawRight() + this.update() + } else if (inRect(pos, spelldownbox)) { + bookInfo.spell -= bookInfo.spellStep + if (bookInfo.spell < 0) bookInfo.spell = 0 + bookInfo.drawRight() + this.update() + } else if (inRect(pos, spellchangebox)) { + core.myprompt("请输入法强调整步距(只可输入数字)", null, (value) => { + if (value && !Number.isNaN(Number(value)) && Number(value) >= 1) { + bookInfo.spellStep = Number(value) + bookInfo.drawRight() + this.update() + } else if (value) { + alert("无效的输入!"); + } else if (value === "") { + + } + }); + } else if (inRect(pos, speedupbox)) { + bookInfo.speed += bookInfo.speedStep + bookInfo.drawRight() + this.update() + } else if (inRect(pos, speeddownbox)) { + bookInfo.speed -= bookInfo.speedStep + if (bookInfo.speed < 0) bookInfo.speed = 0 + bookInfo.drawRight() + this.update() + } else if (inRect(pos, speedchangebox)) { + core.myprompt("请输入速度调整步距(只可输入数字)", null, (value) => { + if (value && !Number.isNaN(Number(value)) && Number(value) >= 1) { + bookInfo.speedStep = Number(value) + bookInfo.drawRight() + this.update() + } else if (value) { + alert("无效的输入!"); + } else if (value === "") { + + } + }); + } else if (inRect(pos, zerochangebox)) { + bookInfo.clearEx() + bookInfo.drawRight() + this.update() + } else if (inRect(pos, exitbox)) { core.playSound('取消'); + core.book.close() if (core.events.recoverEvents(core.status.event.interval)) { return; } else if (core.status.event.ui != null) { core.status.boxAnimateObjs = []; core.ui._drawViewMaps(core.status.event.ui); } else core.ui.closePanel(); - core.book.close() + return; } else if (inRect(pos, leftbox)) {