Merge pull request #109 from ckcz123/v2.0

V2.0
This commit is contained in:
Zhang Chen 2018-04-24 13:07:20 +08:00 committed by GitHub
commit 1bb62e612e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 12 deletions

View File

@ -1049,9 +1049,9 @@ control.prototype.snipe = function (snipes) {
}
else {
if (damage <= 0) color = '#00FF00';
else if (damage < hero_hp / 3) color = '#FFFFFF';
else if (damage < hero_hp * 2 / 3) color = '#FFFF00';
else if (damage < hero_hp) color = '#FF7F00';
else if (damage < core.status.hero.hp / 3) color = '#FFFFFF';
else if (damage < core.status.hero.hp * 2 / 3) color = '#FFFF00';
else if (damage < core.status.hero.hp) color = '#FF7F00';
else color = '#FF0000';
damage = core.formatBigNumber(damage);

View File

@ -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);

View File

@ -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();
})
}

View File

@ -168,18 +168,18 @@ utils.prototype.formatBigNumber = function (x) {
if (!core.isset(x)) return '???';
var all = [
{"val": 10e20, "c": "g"},
{"val": 10e16, "c": "j"},
{"val": 10e12, "c": "z"},
{"val": 10e8, "c": "e"},
{"val": 10e4, "c": "w"},
{"val": 1e20, "c": "g"},
{"val": 1e16, "c": "j"},
{"val": 1e12, "c": "z"},
{"val": 1e8, "c": "e"},
{"val": 1e4, "c": "w"},
]
for (var i=0;i<all.length;i++) {
var one = all[i];
if (x>=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)))) + one.c;
return v.toFixed(Math.max(0, Math.floor(4-Math.log10(v+1)))) + one.c;
}
}

View File

@ -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": {