From 725bae87eb42ed4b52c321b02bf979dfde4f7ab7 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Tue, 24 Apr 2018 13:06:41 +0800 Subject: [PATCH] resetMap --- libs/core.js | 5 +++++ libs/maps.js | 9 +++++++++ libs/utils.js | 2 +- project/comment.js | 5 +++-- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/libs/core.js b/libs/core.js index ae680280..b78e1087 100644 --- a/libs/core.js +++ b/libs/core.js @@ -878,6 +878,11 @@ core.prototype.debug = function() { core.control.debug(); } +////// 重置当前地图 ////// +core.prototype.resetMap = function() { + core.maps.resetMap(); +} + ////// 开始播放 ////// core.prototype.startReplay = function (list) { core.control.startReplay(list); diff --git a/libs/maps.js b/libs/maps.js index d2575c2c..4b99a178 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -887,4 +887,13 @@ maps.prototype.drawAnimate = function (name, x, y, callback) { } draw(index++); }, 50); +} + +maps.prototype.resetMap = function() { + var floorId = core.status.floorId; + core.status.maps[floorId] = this.loadFloor(floorId); + this.drawMap(floorId, function() { + core.drawHero(core.getHeroLoc('direction'), core.getHeroLoc('x'), core.getHeroLoc('y'), 'stop'); + core.updateStatusBar(); + }) } \ No newline at end of file diff --git a/libs/utils.js b/libs/utils.js index 9b67ca91..bfa4cae6 100644 --- a/libs/utils.js +++ b/libs/utils.js @@ -177,7 +177,7 @@ utils.prototype.formatBigNumber = function (x) { for (var i=0;i=10*one.val) { + if (x>=100*one.val) { var v = x/one.val; return v.toFixed(Math.max(0, Math.floor(4-Math.log10(v+1)))) + one.c; } diff --git a/project/comment.js b/project/comment.js index 110fa113..835335bc 100644 --- a/project/comment.js +++ b/project/comment.js @@ -120,7 +120,8 @@ comment_c456ea59_6018_45ef_8bcc_211a24c627dc = }, "zoneSquare": { "_leaf": true, - "_type": "textarea", + "_type": "checkbox", + "_bool": "bool", "_data": "领域怪zoneSquare代表是否九宫格伤害" }, "range": { @@ -286,7 +287,7 @@ comment_c456ea59_6018_45ef_8bcc_211a24c627dc = "item_ratio": { "_leaf": true, "_type": "textarea", - "_range": "(thiseval==~~thiseval && thiseval>0)||thiseval==null", + "_range": "(thiseval==~~thiseval && thiseval>=0)||thiseval==null", "_data": "每一层的宝石/血瓶效果,即获得宝石和血瓶时框内\"ratio\"的值。" }, "firstArrive": {