diff --git a/_server/comment.js b/_server/comment.js index f393526f..85f7b315 100644 --- a/_server/comment.js +++ b/_server/comment.js @@ -225,6 +225,17 @@ comment_c456ea59_6018_45ef_8bcc_211a24c627dc = ] }, "_data": "该图块是否不可通行;true代表不可通行,false代表可通行,null代表使用系统缺省值" + }, + "canBreak": { + "_leaf": true, + "_type": "select", + "_select": { + "values": [ + true, + false + ] + }, + "_data": "该图块是否可被破炸;true代表可以,false代表不可以" } } }, diff --git a/libs/enemys.js b/libs/enemys.js index efae6beb..c6350103 100644 --- a/libs/enemys.js +++ b/libs/enemys.js @@ -169,7 +169,7 @@ enemys.prototype.nextCriticals = function (enemy, number, x, y, floorId) { if (nextAtk!=pre) { var nextInfo = this.getDamageInfo(enemy, core.status.hero.hp, nextAtk, core.status.hero.def, core.status.hero.mdef, x, y, floorId); if (nextInfo==null) break; - list.push([nextAtk-hero_atk,info.damage-nextInfo.damage]); + list.push([nextAtk-hero_atk,Math.floor(info.damage-nextInfo.damage)]); if (nextInfo.damage<=0 && !core.flags.enableNegativeDamage) break; pre = nextAtk; } @@ -184,7 +184,7 @@ enemys.prototype.nextCriticals = function (enemy, number, x, y, floorId) { if (nextInfo==null) break; if (pre>nextInfo.damage) { pre = nextInfo.damage; - list.push([atk-hero_atk, info.damage-nextInfo.damage]); + list.push([atk-hero_atk, Math.floor(info.damage-nextInfo.damage)]); if (nextInfo.damage<=0 && !core.flags.enableNegativeDamage) break; if (list.length>=number) break; } diff --git a/libs/ui.js b/libs/ui.js index fce7961b..0acdb8dd 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -1443,6 +1443,43 @@ ui.prototype.drawBookDetail = function (index) { if (hints.length==0) hints.push("该怪物无特殊属性。"); + // 模仿临界计算器 + if (core.enemys.hasSpecial(core.material.enemys[enemyId].special, 10)) { + var hp = core.material.enemys[enemyId].hp; + var delta = core.status.hero.atk - core.status.hero.def; + if (delta0) { + hints.push(""); + hints.push("模仿临界计算器:(当前攻防差"+core.formatBigNumber(delta)+")"); + var arr = []; + (function () { + var last=0, start=0; + for (var i=1;i=0", - "pickaxe": "var able=false;\nvar ids = [], id2s = [];\nfor (var i in core.status.thisMap.blocks) {\n\tvar block = core.status.thisMap.blocks[i];\n\tif (core.isset(block.event) && !block.disable && Math.abs(block.x-core.status.hero.loc.x)+Math.abs(block.y-core.status.hero.loc.y)<=1\n\t\t&& (block.event.id == 'yellowWall' || block.event.id=='whiteWall' || block.event.id=='blueWall')) // 能破哪些墙\n\t{\n\t\t// 四个方向\n\t\tif (core.flags.pickaxeFourDirections || (block.x == core.nextX() && block.y == core.nextY()))\n\t\t\tids.push(i);\n\t\telse id2s.push(i);\n\t}\n}\nif (ids.length>0) {\n\tcore.status.event.data = ids;\n\table=true;\n}\nelse if (id2s.length==1) {\n\tcore.status.event.data = id2s;\n\table=true;\n}\nable", + "pickaxe": "var able=false;\nvar ids = [], id2s = [];\nfor (var i in core.status.thisMap.blocks) {\n\tvar block = core.status.thisMap.blocks[i];\n\tif (core.isset(block.event) && !block.disable && Math.abs(block.x-core.status.hero.loc.x)+Math.abs(block.y-core.status.hero.loc.y)<=1 && \n\t\t(block.event.canBreak || block.event.id == 'yellowWall' || block.event.id=='whiteWall' || block.event.id=='blueWall')) { // 能破哪些墙\n\t\t// 四个方向\n\t\tif (core.flags.pickaxeFourDirections || (block.x == core.nextX() && block.y == core.nextY()))\n\t\t\tids.push(i);\n\t\telse id2s.push(i);\n\t}\n}\nif (ids.length>0) {\n\tcore.status.event.data = ids;\n\table=true;\n}\nelse if (id2s.length==1) {\n\tcore.status.event.data = id2s;\n\table=true;\n}\nable", "icePickaxe": "var able=false;\nfor (var i in core.status.thisMap.blocks) {\n\tvar block = core.status.thisMap.blocks[i];\n\tif (core.isset(block.event) && !block.disable && block.x==core.nextX() && block.y==core.nextY() && block.event.id=='ice') {\n\t\tcore.status.event.data = [i];\n\t\table=true;\n\t}\n}\nable", - "bomb": "var able=false;\nvar ids = [], id2s = [];\nfor (var i in core.status.thisMap.blocks) {\n\tvar block = core.status.thisMap.blocks[i];\n\tif (core.isset(block.event) && !block.disable && block.event.cls.indexOf('enemy')==0 && Math.abs(block.x-core.status.hero.loc.x)+Math.abs(block.y-core.status.hero.loc.y)<=1) {\n\t\tvar enemy = core.material.enemys[block.event.id];\n\t\tif (core.isset(enemy) && enemy.notBomb) continue;\n\t\tif (core.flags.bombFourDirections || (block.x==core.nextX() && block.y==core.nextY()))\n\t\t\tids.push(i);\n\t\telse\n\t\t\tid2s.push(i);\n\t}\n}\nif (ids.length>0) {\n\tcore.status.event.data = ids;\n\table=true;\n}\nelse if (id2s.length==1) {\n\tcore.status.event.data = id2s;\n\table=true;\n}\nable", - "hammer": "var able=false;\nvar ids = [], id2s = [];\nfor (var i in core.status.thisMap.blocks) {\n\tvar block = core.status.thisMap.blocks[i];\n\tif (core.isset(block.event) && !block.disable && block.event.cls.indexOf('enemy')==0 && \n\t\tMath.abs(block.x-core.status.hero.loc.x)+Math.abs(block.y-core.status.hero.loc.y)<=1) {\n\t\tvar enemy = core.material.enemys[block.event.id];\n\t\tif (core.isset(enemy) && enemy.notBomb) continue;\n\t\tif (block.x==core.nextX() && block.y==core.nextY())\n\t\t\tids.push(i);\n\t\telse\n\t\t\tid2s.push(i);\n\t}\n}\nif (ids.length>0) {\n\tcore.status.event.data = ids;\n\table=true;\n}\nelse if (id2s.length==1) {\n\tcore.status.event.data = id2s;\n\table=true;\n}\nable", - "earthquake": "var able=false;\nvar ids = [];\nfor (var i in core.status.thisMap.blocks) {\n var block = core.status.thisMap.blocks[i];\n if (core.isset(block.event) && !block.disable && (block.event.id == 'yellowWall' || block.event.id == 'blueWall' || block.event.id == 'whiteWall')) // 能炸的墙壁\n ids.push(i);\n}\nif (ids.length>0) {\n core.status.event.data = ids;\n able=true;\n}\nable", + "bomb": "var able=false;\nvar ids = [], id2s = [];\nfor (var i in core.status.thisMap.blocks) {\n\tvar block = core.status.thisMap.blocks[i];\n\tif (core.isset(block.event) && !block.disable && block.event.cls.indexOf('enemy')==0 && Math.abs(block.x-core.getHeroLoc('x'))+Math.abs(block.y-core.getHeroLoc('y'))<=1) {\n\t\tvar enemy = core.material.enemys[block.event.id];\n\t\tif (core.isset(enemy) && enemy.notBomb) continue;\n\t\tif (core.flags.bombFourDirections || (block.x==core.nextX() && block.y==core.nextY()))\n\t\t\tids.push(i);\n\t\telse\n\t\t\tid2s.push(i);\n\t}\n}\nif (ids.length>0) {\n\tcore.status.event.data = ids;\n\table=true;\n}\nelse if (id2s.length==1) {\n\tcore.status.event.data = id2s;\n\table=true;\n}\nable", + "hammer": "var able=false;\nvar ids = [], id2s = [];\nfor (var i in core.status.thisMap.blocks) {\n\tvar block = core.status.thisMap.blocks[i];\n\tif (core.isset(block.event) && !block.disable && block.event.cls.indexOf('enemy')==0 && Math.abs(block.x-core.getHeroLoc('x'))+Math.abs(block.y-core.getHeroLoc('y'))<=1) {\n\t\tvar enemy = core.material.enemys[block.event.id];\n\t\tif (core.isset(enemy) && enemy.notBomb) continue;\n\t\tif (block.x==core.nextX() && block.y==core.nextY())\n\t\t\tids.push(i);\n\t\telse\n\t\t\tid2s.push(i);\n\t}\n}\nif (ids.length>0) {\n\tcore.status.event.data = ids;\n\table=true;\n}\nelse if (id2s.length==1) {\n\tcore.status.event.data = id2s;\n\table=true;\n}\nable", + "earthquake": "var able=false;\nvar ids = [];\nfor (var i in core.status.thisMap.blocks) {\n\tvar block = core.status.thisMap.blocks[i];\n\tif (core.isset(block.event) && !block.disable &&\n\t\t(block.event.canBreak || block.event.id == 'yellowWall' || block.event.id == 'blueWall' || block.event.id == 'whiteWall')) { // 能炸的墙壁\n\t\tids.push(i);\n\t}\n}\nif (ids.length>0) {\n\tcore.status.event.data = ids;\n\table=true;\n}\nable", "centerFly": "var toX = (core.bigmap.width||13)-1-core.getHeroLoc('x'), toY = (core.bigmap.height||13)-1-core.getHeroLoc('y');\ncore.getBlockId(toX, toY) == null", "upFly": "var able=false;\nvar floorId = core.status.floorId, index = core.floorIds.indexOf(floorId);\nif (index=0 && toX=0 && toY0) {\n\tvar toId = core.floorIds[index-1], toX = core.getHeroLoc('x'), toY = core.getHeroLoc('y');\n\tvar mw = core.floors[toId].width||13, mh = core.floors[toId].height||13;\n\tif (toX>=0 && toX=0 && toY0) {\n\tcore.status.event.data = ids;\n\table=true;\n}\nelse if (id2s.length==1) {\n\tcore.status.event.data = id2s;\n\table=true;\n}\nable", - "bigKey": "var able=false;\nvar ids = [];\nfor (var i in core.status.thisMap.blocks) {\n var block = core.status.thisMap.blocks[i];\n if (core.isset(block.event) && !block.disable && block.event.id == 'yellowDoor') {\n ids.push(i);\n }\n}\nif (ids.length>0) {\n core.status.event.data = ids;\n able=true;\n}\nable", + "snow": "var able=false;\nvar ids = [], id2s = [];\nfor (var i in core.status.thisMap.blocks) {\n\tvar block = core.status.thisMap.blocks[i];\n\tif (core.isset(block.event) && !block.disable && block.event.id == 'lava' && Math.abs(block.x-core.getHeroLoc('x'))+Math.abs(block.y-core.getHeroLoc('y'))<=1) {\n\t\tif (core.flags.snowFourDirections || (block.x == core.nextX() && block.y == core.nextY()))\n\t\t\tids.push(i);\n\t\telse id2s.push(i);\n\t}\n}\nif (ids.length>0) {\n\tcore.status.event.data = ids;\n\table=true;\n}\nelse if (id2s.length==1) {\n\tcore.status.event.data = id2s;\n\table=true;\n}\nable", + "bigKey": "var able=false;\nvar ids = [];\nfor (var i in core.status.thisMap.blocks) {\n\tvar block = core.status.thisMap.blocks[i];\n\tif (core.isset(block.event) && !block.disable && block.event.id == 'yellowDoor') {\n\t\tids.push(i);\n\t}\n}\nif (ids.length>0) {\n\tcore.status.event.data = ids;\n\table=true;\n}\nable", "poisonWine": "core.hasFlag('poison')", "weakWine": "core.hasFlag('weak')", "curseWine": "core.hasFlag('curse')", diff --git a/project/maps.js b/project/maps.js index 7f6ca1f4..5823d190 100644 --- a/project/maps.js +++ b/project/maps.js @@ -3,9 +3,9 @@ maps_90f36752_8815_4be8_b32b_d7fad1d0542e = ////////////////////////// 地形部分 ////////////////////////// // 0-20 地形 - '1':{'cls': 'terrains', 'id': 'yellowWall'}, // 黄墙 - '2':{'cls': 'terrains', 'id': 'whiteWall'}, // 白墙 - '3':{'cls': 'terrains', 'id': 'blueWall'}, // 蓝墙 + '1':{'cls': 'terrains', 'id': 'yellowWall', 'canBreak': true}, // 黄墙 + '2':{'cls': 'terrains', 'id': 'whiteWall', 'canBreak': true}, // 白墙 + '3':{'cls': 'terrains', 'id': 'blueWall', 'canBreak': true}, // 蓝墙 '4':{'cls': 'animates', 'id': 'star', 'noPass': true}, // 星空 '5':{'cls': 'animates', 'id': 'lava', 'noPass': true}, // 岩浆 '6':{'cls': 'terrains', 'id': 'ice'}, // 冰面