diff --git a/_server/config.json b/_server/config.json index a2a81f0c..bedad7f5 100644 --- a/_server/config.json +++ b/_server/config.json @@ -1 +1 @@ -{"lastUsed":[],"foldPerCol":50,"folded":false,"editorLastFloorId":"sample0","disableBlocklyReplace":false,"disableBlocklyExpandCompare":false,"shortcut":{"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0},"viewportLoc":[0,0]} \ No newline at end of file +{"lastUsed":[{"idnum":261,"id":"angel","images":"enemy48","y":0,"recent":1643777643176,"frequent":1}],"foldPerCol":50,"folded":false,"editorLastFloorId":"sample0","disableBlocklyReplace":false,"disableBlocklyExpandCompare":false,"shortcut":{"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0},"viewportLoc":[0,0]} \ No newline at end of file diff --git a/_server/table/comment.js b/_server/table/comment.js index 17fb1ccb..d8d8b154 100644 --- a/_server/table/comment.js +++ b/_server/table/comment.js @@ -211,20 +211,87 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "_leaf": true, "_type": "textarea", "_docs": "特殊属性数值", - "_data": "特殊属性的数值\n如:领域/阻激/激光怪的伤害值;吸血怪的吸血比例;光环怪增加生命的比例" + "_data": "特殊属性的数值\n如:领域/阻激/激光怪的伤害值;光环怪增加生命的比例" + }, + "zone": { + "_leaf": true, + "_type": "textarea", + "_docs": "领域伤害", + "_data": "领域怪的伤害值" + }, + "repulse": { + "_leaf": true, + "_type": "textarea", + "_docs": "阻击伤害", + "_data": "阻击怪的伤害值" + }, + "laser": { + "_leaf": true, + "_type": "textarea", + "_docs": "激光伤害", + "_data": "激光怪的伤害值" + }, + "breakArmor": { + "_leaf": true, + "_type": "textarea", + "_docs": "破甲比例", + "_data": "破甲百分比" + }, + "counterAttack": { + "_leaf": true, + "_type": "textarea", + "_docs": "反击比例", + "_data": "反击百分比" + }, + "vampire": { + "_leaf": true, + "_type": "textarea", + "_docs": "吸血比例", + "_data": "吸血怪的吸血百分比" + }, + "hpBuff": { + "_leaf": true, + "_type": "textarea", + "_docs": "光环加血", + "_data": "光环怪增加生命的比例" + }, + "atkBuff": { + "_leaf": true, + "_type": "textarea", + "_docs": "光环加攻", + "_data": "光环怪增加攻击的比例" + }, + "defBuff": { + "_leaf": true, + "_type": "textarea", + "_docs": "光环加防", + "_data": "光环怪增加防御的比例" }, "zoneSquare": { "_leaf": true, "_type": "checkbox", "_docs": "九宫格", - "_data": "领域、阻击、光环或捕捉怪是否九宫格" + "_data": "领域、阻击或捕捉怪是否九宫格" + }, + "haloSquare": { + "_leaf": true, + "_type": "checkbox", + "_docs": "九宫格", + "_data": "光环怪是否九宫格" }, "range": { "_leaf": true, "_type": "textarea", "_range": "(thiseval==~~thiseval && thiseval>0)||thiseval==null", "_docs": "领域范围", - "_data": "领域或光环的范围;领域不加默认为1,光环不加则为全图效果" + "_data": "领域的范围;不加默认为1" + }, + "haloRange": { + "_leaf": true, + "_type": "textarea", + "_range": "(thiseval==~~thiseval && thiseval>0)||thiseval==null", + "_docs": "光环范围", + "_data": "光环的范围;不加为全图效果" }, "notBomb": { "_leaf": true, @@ -239,25 +306,38 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "_docs": "连击数", "_data": "多连击的连击数,净化怪的净化倍率" }, + "purify": { + "_leaf": true, + "_type": "textarea", + "_range": "(thiseval==~~thiseval && thiseval>0)||thiseval==null", + "_docs": "净化倍率", + "_data": "净化百分比" + }, "add": { "_leaf": true, "_type": "checkbox", "_docs": "吸血加到自身", - "_data": "吸血后是否加到自身;光环是否叠加" + "_data": "吸血后是否加到自身" + }, + "haloAdd": { + "_leaf": true, + "_type": "checkbox", + "_docs": "吸血加到自身", + "_data": "光环是否叠加" }, "atkValue": { "_leaf": true, "_type": "textarea", "_range": "thiseval==~~thiseval||thiseval==null", "_docs": "退化扣攻", - "_data": "退化时勇士下降的攻击力点数;光环怪增加攻击的比例;反击的比例" + "_data": "退化时勇士下降的攻击力点数" }, "defValue": { "_leaf": true, "_type": "textarea", "_range": "thiseval==~~thiseval||thiseval==null", "_docs": "退化扣防", - "_data": "退化时勇士下降的防御力点数;光环怪增加防御的比例;破甲的比例" + "_data": "退化时勇士下降的防御力点数" }, "damage": { "_leaf": true, diff --git a/libs/actions.js b/libs/actions.js index be0eb731..25e73bea 100644 --- a/libs/actions.js +++ b/libs/actions.js @@ -1911,8 +1911,10 @@ actions.prototype._keyUpEquipbox = function (keycode, altKey) { core.playSound('取消'); core.ui.closePanel(); var last = core.status.route[core.status.route.length - 1]; - if (last.startsWith('equip:') || last.startsWith('unEquip:')) { - core.status.route.push('no'); + if (typeof last === 'string') { + if (last.startsWith('equip:') || last.startsWith('unEquip:')) { + core.status.route.push('no'); + } } core.checkAutoEvents(); return; diff --git a/libs/control.js b/libs/control.js index b50a8c45..558c7433 100644 --- a/libs/control.js +++ b/libs/control.js @@ -1837,7 +1837,7 @@ control.prototype._replayAction_fly = function (action) { if (action.indexOf("fly:") != 0) return false; var floorId = action.substring(4); var toIndex = core.floorIds.indexOf(floorId); - if (!core.canUseItem('fly')) return false; + if (!core.canUseItem('fly') || (core.flags.flyNearStair && !core.nearStair())) return false; core.ui.drawFly(toIndex); if (core.status.replay.speed == 24) { if (!core.flyTo(floorId, core.replay)) diff --git a/libs/maps.js b/libs/maps.js index c1c7b5f9..76b08a7f 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -1707,6 +1707,7 @@ maps.prototype._makeAutotileEdges = function () { // heroLoc: 勇士位置;heroIcon:勇士图标(默认当前勇士);damage:是否绘制显伤;flags:当前的flags(存读档时使用) // ctx:要绘制到的画布(名);x,y:起点横纵坐标(默认0);size:大小(默认416/480); // all:是否绘制全图(默认false);centerX,centerY:截取中心(默认为地图正中心) +// noHD:不使用高清绘制,避免存读档界面出问题 maps.prototype.drawThumbnail = function (floorId, blocks, options) { floorId = floorId || core.status.floorId; if (!floorId) return; @@ -1730,13 +1731,17 @@ maps.prototype._drawThumbnail_drawTempCanvas = function (floorId, blocks, option if (options.all) { // 计算比例 var scale = Math.max(core.__SIZE__ / width, core.__SIZE__ / height); - tempCanvas.canvas.width = width * 32 * scale; - tempCanvas.canvas.height = height * 32 * scale; + if (options.noHD) { + tempCanvas.canvas.width = width * 32 * scale; + tempCanvas.canvas.height = height * 32 * scale; + } else core.resizeCanvas(tempCanvas, width * 32 * scale, height * 32 * scale); tempCanvas.scale(scale, scale); } else if (width * height > core.bigmap.threshold) { options.v2 = true; - tempCanvas.canvas.width = core.__PIXELS__; - tempCanvas.canvas.height = core.__PIXELS__; + if (options.noHD) { + tempCanvas.canvas.width = core.__PIXELS__; + tempCanvas.canvas.height = core.__PIXELS__; + } else core.resizeCanvas(tempCanvas, core.__PIXELS__, core.__PIXELS__); var centerX = options.centerX, centerY = options.centerY; if (centerX == null) centerX = Math.floor(width / 2); if (centerY == null) centerY = Math.floor(height / 2); @@ -1745,8 +1750,10 @@ maps.prototype._drawThumbnail_drawTempCanvas = function (floorId, blocks, option tempCanvas.translate(-32 * offsetX, -32 * offsetY); } else { options.v2 = false; - tempCanvas.canvas.width = width * 32; - tempCanvas.canvas.height = height * 32; + if (options.noHD) { + tempCanvas.canvas.width = width * 32; + tempCanvas.canvas.height = height * 32; + } else core.resizeCanvas(tempCanvas, width * 32, height * 32); } options.ctx = tempCanvas; @@ -1829,7 +1836,9 @@ maps.prototype._drawThumbnail_drawToTarget = function (floorId, options) { } else { var offsetX = core.clamp(centerX - core.__HALF_SIZE__, 0, width - core.__SIZE__), offsetY = core.clamp(centerY - core.__HALF_SIZE__, 0, height - core.__SIZE__); - core.drawImage(ctx, tempCanvas.canvas, offsetX * 32, offsetY * 32, core.__PIXELS__, core.__PIXELS__, x, y, size, size); + var scale = core.domStyle.scale; + if (options.noHD) scale = 1; + core.drawImage(ctx, tempCanvas.canvas, offsetX * 32 * scale, offsetY * 32 * scale, core.__PIXELS__ * scale, core.__PIXELS__ * scale, x, y, size, size); } } diff --git a/libs/ui.js b/libs/ui.js index 80bec762..4f6f52da 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -1357,8 +1357,9 @@ ui.prototype._drawTextContent_drawIcon = function (tempCtx, content, config) { // 绘制一个 \i 效果 var index = config.index, index2; if (content.charAt(config.index + 1) == '[' && ((index2 = content.indexOf(']', index + 1)) >= 0)) { - var str = content.substring(index + 2, index2); + var str = core.replaceText(content.substring(index + 2, index2)); // --- 获得图标 + var cls = core.getClsFromId(str); var iconInfo = core.ui._getDrawableIconInfo(str), image = iconInfo[0], icon = iconInfo[1]; if (image == null) return this._drawTextContent_next(tempCtx, content, config); // 检查自动换行 @@ -1369,7 +1370,9 @@ ui.prototype._drawTextContent_drawIcon = function (tempCtx, content, config) { return this._drawTextContent_next(tempCtx, content, config); } // 绘制到画布上 - core.drawImage(tempCtx, image, 0, 32 * icon, 32, 32, left, top, width, width); + var height = 32; + if (cls.endsWith('48')) height = 48; + core.drawImage(tempCtx, image, 0, height * icon, 32, height, left, top, width, width); config.blocks.push({ left: left, top: config.offsetY, @@ -3044,7 +3047,7 @@ ui.prototype._drawSLPanel_drawRecord = function (title, data, x, y, size, cho, h core.extractBlocksForUI(map, data.hero.flags); core.drawThumbnail(data.floorId, map.blocks, { heroLoc: data.hero.loc, heroIcon: data.hero.image, flags: data.hero.flags, - ctx: 'ui', x: x - size / 2, y: y + 15, size: size, centerX: data.hero.loc.x, centerY: data.hero.loc.y + ctx: 'ui', x: x - size / 2, y: y + 15, size: size, centerX: data.hero.loc.x, centerY: data.hero.loc.y, noHD: true }); if (core.isPlaying() && core.getFlag("hard") != data.hero.flags.hard) { core.fillRect('ui', x - size / 2, y + 15, size, size, [0, 0, 0, 0.4]); diff --git a/main.js b/main.js index f64060c3..a5742c87 100644 --- a/main.js +++ b/main.js @@ -190,7 +190,7 @@ function main () { this.canvas = {}; this.__VERSION__ = "2.9"; - this.__VERSION_CODE__ = 507; + this.__VERSION_CODE__ = 508; } main.prototype.init = function (mode, callback) { diff --git a/project/floors/sample0.js b/project/floors/sample0.js index 7ffc7566..00caef6a 100644 --- a/project/floors/sample0.js +++ b/project/floors/sample0.js @@ -99,6 +99,9 @@ main.floors.sample0= "type": "hide", "time": 500 } + ], + "7,9": [ + "\\i[angel]" ] }, "changeFloor": { diff --git a/project/functions.js b/project/functions.js index 4fddc419..6330a49c 100644 --- a/project/functions.js +++ b/project/functions.js @@ -496,25 +496,25 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = [4, "2连击", "怪物每回合攻击2次", "#ffee77"], [5, "3连击", "怪物每回合攻击3次", "#ffee77"], [6, function (enemy) { return (enemy.n || '') + "连击"; }, function (enemy) { return "怪物每回合攻击" + (enemy.n || 4) + "次"; }, "#ffee77"], - [7, "破甲", function (enemy) { return "战斗前,怪物附加角色防御的" + Math.floor(100 * (enemy.defValue || core.values.breakArmor || 0)) + "%作为伤害"; }, "#88c0ff"], - [8, "反击", function (enemy) { return "战斗时,怪物每回合附加角色攻击的" + Math.floor(100 * (enemy.atkValue || core.values.counterAttack || 0)) + "%作为伤害,无视角色防御"; }, "#ffaa44"], - [9, "净化", function (enemy) { return "战斗前,怪物附加角色护盾的" + (enemy.n || core.values.purify) + "倍作为伤害"; }, "#80eed6"], + [7, "破甲", function (enemy) { return "战斗前,怪物附加角色防御的" + Math.floor(100 * (enemy.breakArmor || core.values.breakArmor || 0)) + "%作为伤害"; }, "#88c0ff"], + [8, "反击", function (enemy) { return "战斗时,怪物每回合附加角色攻击的" + Math.floor(100 * (enemy.counterAttack || core.values.counterAttack || 0)) + "%作为伤害,无视角色防御"; }, "#ffaa44"], + [9, "净化", function (enemy) { return "战斗前,怪物附加角色护盾的" + (enemy.purify || core.values.purify) + "倍作为伤害"; }, "#80eed6"], [10, "模仿", "怪物的攻防和角色攻防相等", "#b0c0dd"], - [11, "吸血", function (enemy) { return "战斗前,怪物首先吸取角色的" + Math.floor(100 * enemy.value || 0) + "%生命(约" + Math.floor((enemy.value || 0) * core.getStatus('hp')) + "点)作为伤害" + (enemy.add ? ",并把伤害数值加到自身生命上" : ""); }, "#dd4448"], + [11, "吸血", function (enemy) { return "战斗前,怪物首先吸取角色的" + Math.floor(100 * enemy.vampire || 0) + "%生命(约" + Math.floor((enemy.vampire || 0) * core.getStatus('hp')) + "点)作为伤害" + (enemy.add ? ",并把伤害数值加到自身生命上" : ""); }, "#dd4448"], [12, "中毒", "战斗后,角色陷入中毒状态,每一步损失生命" + core.values.poisonDamage + "点", "#99ee88"], [13, "衰弱", "战斗后,角色陷入衰弱状态,攻防暂时下降" + (core.values.weakValue >= 1 ? core.values.weakValue + "点" : parseInt(core.values.weakValue * 100) + "%"), "#f0bbcc"], [14, "诅咒", "战斗后,角色陷入诅咒状态,战斗无法获得金币和经验", "#bbeef0"], - [15, "领域", function (enemy) { return "经过怪物周围" + (enemy.zoneSquare ? "九宫格" : "十字") + "范围内" + (enemy.range || 1) + "格时自动减生命" + (enemy.value || 0) + "点"; }, "#c677dd"], + [15, "领域", function (enemy) { return "经过怪物周围" + (enemy.zoneSquare ? "九宫格" : "十字") + "范围内" + (enemy.range || 1) + "格时自动减生命" + (enemy.zone || 0) + "点"; }, "#c677dd"], [16, "夹击", "经过两只相同的怪物中间,角色生命值变成一半", "#bb99ee"], [17, "仇恨", "战斗前,怪物附加之前积累的仇恨值作为伤害;战斗后,释放一半的仇恨值。(每杀死一个怪物获得" + (core.values.hatred || 0) + "点仇恨值)", "#b0b666"], - [18, "阻击", function (enemy) { return "经过怪物周围" + (enemy.zoneSquare ? "九宫格" : "十字") + "时自动减生命" + (enemy.value || 0) + "点,同时怪物后退一格"; }, "#8888e6"], + [18, "阻击", function (enemy) { return "经过怪物周围" + (enemy.zoneSquare ? "九宫格" : "十字") + "时自动减生命" + (enemy.repulse || 0) + "点,同时怪物后退一格"; }, "#8888e6"], [19, "自爆", "战斗后角色的生命值变成1", "#ff6666"], [20, "无敌", "角色无法打败怪物,除非拥有十字架", "#aaaaaa"], [21, "退化", function (enemy) { return "战斗后角色永久下降" + (enemy.atkValue || 0) + "点攻击和" + (enemy.defValue || 0) + "点防御"; }], [22, "固伤", function (enemy) { return "战斗前,怪物对角色造成" + (enemy.damage || 0) + "点固定伤害,未开启负伤时无视角色护盾。"; }, "#ff9977"], [23, "重生", "怪物被击败后,角色转换楼层则怪物将再次出现", "#a0e0ff"], - [24, "激光", function (enemy) { return "经过怪物同行或同列时自动减生命" + (enemy.value || 0) + "点"; }, "#dda0dd"], - [25, "光环", function (enemy) { return (enemy.range != null ? ((enemy.zoneSquare ? "该怪物九宫格" : "该怪物十字") + enemy.range + "格范围内") : "同楼层所有") + "怪物生命提升" + (enemy.value || 0) + "%,攻击提升" + (enemy.atkValue || 0) + "%,防御提升" + (enemy.defValue || 0) + "%," + (enemy.add ? "可叠加" : "不可叠加"); }, "#e6e099", 1], + [24, "激光", function (enemy) { return "经过怪物同行或同列时自动减生命" + (enemy.laser || 0) + "点"; }, "#dda0dd"], + [25, "光环", function (enemy) { return (enemy.range != null ? ((enemy.haloSquare ? "该怪物九宫格" : "该怪物十字") + enemy.haloRange + "格范围内") : "同楼层所有") + "怪物生命提升" + (enemy.hpBuff || 0) + "%,攻击提升" + (enemy.atkBuff || 0) + "%,防御提升" + (enemy.defBuff || 0) + "%," + (enemy.haloAdd ? "可叠加" : "不可叠加"); }, "#e6e099", 1], [26, "支援", "当周围一圈的怪物受到攻击时将上前支援,并组成小队战斗。", "#77c0b6", 1], [27, "捕捉", function (enemy) { return "当走到怪物周围" + (enemy.zoneSquare ? "九宫格" : "十字") + "时会强制进行战斗。"; }, "#c0ddbb"] ]; @@ -1316,7 +1316,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = ny = y + scan[dir].y, currloc = nx + "," + ny; if (nx < 0 || nx >= width || ny < 0 || ny >= height) continue; - damage[currloc] = (damage[currloc] || 0) + (enemy.repluse || 0); + damage[currloc] = (damage[currloc] || 0) + (enemy.repulse || 0); type[currloc] = type[currloc] || {}; type[currloc]["阻击伤害"] = true; diff --git a/runtime.d.ts b/runtime.d.ts index 1341a355..c9d2a474 100644 --- a/runtime.d.ts +++ b/runtime.d.ts @@ -1701,6 +1701,8 @@ declare class maps { centerX?: number /** 绘制的视野中心 */ centerY?: number + /** 存读档时使用,可以无视 */ + noHD: boolean }): void /** @@ -2781,7 +2783,7 @@ declare class icons { getIcons(): void /** 根据ID获得其类型 */ - getClsFromId(id?: string): void + getClsFromId(id?: string): string /** 获得所有图标的ID */ getAllIconIds(): void