commit
d56d648771
@ -524,7 +524,7 @@ if (EvalString_0 && EvalString_1) {
|
||||
floorstr = ', "loc": ['+EvalString_0.join(',')+']';
|
||||
}
|
||||
IdString_0 = IdString_0 && (', "floorId": "'+IdString_0+'"');
|
||||
Int_0 = Int_0 ?(', "time": '+Int_0):'';
|
||||
Int_0 = Int_0!=='' ?(', "time": '+Int_0):'';
|
||||
Bool_0 = Bool_0 ?', "async": true':'';
|
||||
var code = '{"type": "show"'+floorstr+IdString_0+''+Int_0+Bool_0+'},\n';
|
||||
return code;
|
||||
@ -557,7 +557,7 @@ if (EvalString_0 && EvalString_1) {
|
||||
floorstr = ', "loc": ['+EvalString_0.join(',')+']';
|
||||
}
|
||||
IdString_0 = IdString_0 && (', "floorId": "'+IdString_0+'"');
|
||||
Int_0 = Int_0 ?(', "time": '+Int_0):'';
|
||||
Int_0 = Int_0!=='' ?(', "time": '+Int_0):'';
|
||||
Bool_0 = Bool_0 ?', "async": true':'';
|
||||
var code = '{"type": "hide"'+floorstr+IdString_0+''+Int_0+Bool_0+'},\n';
|
||||
return code;
|
||||
@ -1134,7 +1134,7 @@ Number_0 = limit(Number_0,0,255);
|
||||
Number_1 = limit(Number_1,0,255);
|
||||
Number_2 = limit(Number_2,0,255);
|
||||
Number_3 = limit(Number_3,0,1);
|
||||
Int_0 = Int_0 ?(', "time": '+Int_0):'';
|
||||
Int_0 = Int_0!=='' ?(', "time": '+Int_0):'';
|
||||
var async = Bool_0?', "async": true':'';
|
||||
var code = '{"type": "setFg", "color": ['+Number_0+','+Number_1+','+Number_2+','+Number_3+']'+Int_0 +async+'},\n';
|
||||
return code;
|
||||
@ -1149,7 +1149,7 @@ tooltip : setFg: 恢复画面色调,动画时间可不填
|
||||
helpUrl : https://h5mota.com/games/template/docs/#/event?id=setfg%EF%BC%9A%E6%9B%B4%E6%94%B9%E7%94%BB%E9%9D%A2%E8%89%B2%E8%B0%83
|
||||
default : [500,false]
|
||||
colour : this.soundColor
|
||||
Int_0 = Int_0 ?(', "time": '+Int_0):'';
|
||||
Int_0 = Int_0!=='' ?(', "time": '+Int_0):'';
|
||||
var async = Bool_0?', "async": true':'';
|
||||
var code = '{"type": "setFg"'+Int_0 +async+'},\n';
|
||||
return code;
|
||||
@ -1183,7 +1183,7 @@ var floorstr = '';
|
||||
if (PosString_0 && PosString_1) {
|
||||
floorstr = ', "loc": ['+PosString_0+','+PosString_1+']';
|
||||
}
|
||||
Int_0 = Int_0 ?(', "time": '+Int_0):'';
|
||||
Int_0 = Int_0!=='' ?(', "time": '+Int_0):'';
|
||||
Bool_0 = Bool_0?', "keep": true':'';
|
||||
Bool_1 = Bool_1?', "async": true':'';
|
||||
var code = '{"type": "move"'+floorstr+Int_0+Bool_0+Bool_1+', "steps": '+JSON.stringify(StepString_0)+'},\n';
|
||||
@ -1199,7 +1199,7 @@ tooltip : moveHero:移动勇士,用这种方式移动勇士的过程中将无
|
||||
helpUrl : https://h5mota.com/games/template/docs/#/event?id=movehero%EF%BC%9A%E7%A7%BB%E5%8A%A8%E5%8B%87%E5%A3%AB
|
||||
default : [500,false,"上右3下2左上左2"]
|
||||
colour : this.dataColor
|
||||
Int_0 = Int_0 ?(', "time": '+Int_0):'';
|
||||
Int_0 = Int_0!=='' ?(', "time": '+Int_0):'';
|
||||
Bool_0 = Bool_0?', "async": true':'';
|
||||
var code = '{"type": "moveHero"'+Int_0+Bool_0+', "steps": '+JSON.stringify(StepString_0)+'},\n';
|
||||
return code;
|
||||
@ -1221,7 +1221,7 @@ if (PosString_0 && PosString_1) {
|
||||
if (PosString_2 && PosString_3) {
|
||||
floorstr += ', "to": ['+PosString_2+','+PosString_3+']';
|
||||
}
|
||||
Int_0 = Int_0 ?(', "time": '+Int_0):'';
|
||||
Int_0 = Int_0!=='' ?(', "time": '+Int_0):'';
|
||||
Bool_0 = Bool_0?', "keep": true':'';
|
||||
Bool_1 = Bool_1?', "async": true':'';
|
||||
var code = '{"type": "jump"'+floorstr+''+Int_0+Bool_0+Bool_1+'},\n';
|
||||
@ -1241,7 +1241,7 @@ var floorstr = '';
|
||||
if (PosString_0 && PosString_1) {
|
||||
floorstr = ', "loc": ['+PosString_0+','+PosString_1+']';
|
||||
}
|
||||
Int_0 = Int_0 ?(', "time": '+Int_0):'';
|
||||
Int_0 = Int_0!=='' ?(', "time": '+Int_0):'';
|
||||
Bool_0 = Bool_0?', "async": true':'';
|
||||
var code = '{"type": "jumpHero"'+floorstr+Int_0+Bool_0+'},\n';
|
||||
return code;
|
||||
@ -1306,7 +1306,7 @@ tooltip : setVolume: 设置音量
|
||||
helpUrl : https://h5mota.com/games/template/docs/#/event?id=setvolume%EF%BC%9A%E8%AE%BE%E7%BD%AE%E9%9F%B3%E9%87%8F
|
||||
default : [90, 500, false]
|
||||
colour : this.soundColor
|
||||
Int_1 = Int_1?(', "time": '+Int_1):""
|
||||
Int_1 = Int_1!==''?(', "time": '+Int_1):""
|
||||
var async = Bool_0?', "async": true':'';
|
||||
var code = '{"type": "setVolume", "value": '+Int_0+Int_1+async+'},\n';
|
||||
return code;
|
||||
@ -1917,9 +1917,8 @@ ActionParser.prototype.parseAction = function() {
|
||||
this.EvalString(data.text),this.next]);
|
||||
break;
|
||||
case "autoText": // 自动剧情文本
|
||||
data.time=this.isset(data.time)?data.time:MotaActionBlocks['autoText_s'].fieldDefault[3];
|
||||
this.next = MotaActionBlocks['autoText_s'].xmlText([
|
||||
'','','',data.time||0,this.EvalString(data.text),this.next]);
|
||||
'','','',data.time,this.EvalString(data.text),this.next]);
|
||||
break;
|
||||
case "scrollText":
|
||||
this.next = MotaActionBlocks['scrollText_s'].xmlText([
|
||||
|
||||
@ -334,7 +334,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
||||
"_leaf": true,
|
||||
"_type": "event",
|
||||
"_event": "eachArrive",
|
||||
"_data": "每次到该楼层触发的事件,可以双击进入事件编辑器;该事件会比firstArrive先执行。"
|
||||
"_data": "每次到该楼层触发的事件,可以双击进入事件编辑器;该事件会在firstArrive执行后再执行。"
|
||||
},
|
||||
"parallelDo": {
|
||||
"_leaf": true,
|
||||
|
||||
@ -135,11 +135,15 @@ core.changeFloor('MT5', null, {'x': 3, 'y': 6}, 0) 无动画切换到MT5层的(3
|
||||
|
||||
|
||||
core.resetMap()
|
||||
重置当前楼层地图。
|
||||
重置当前楼层地图和楼层属性。
|
||||
当我们修改某一层地图后,进游戏读档,会发现修改的内容并没有被更新上去。
|
||||
这是因为,H5的存档是会存下来每一个楼层的地图的,读档会从档里面获得地图信息。
|
||||
此时,如果我们在某一层地图执行 core.resetMap() ,则可以立刻从剧本中读取并重置当前楼层地图。
|
||||
已经被修改过的内容也会相应出现。
|
||||
此函数参数有三种形式:
|
||||
- 不加任何参数,表示重置当前层:core.resetMap()
|
||||
- 加上一个floorId,表示重置某一层:core.resetMap("MT1")
|
||||
- 使用一个数组,表示重置若干层:core.resetMap(["MT1", "MT2", "MT3"])
|
||||
|
||||
|
||||
R
|
||||
@ -500,7 +504,7 @@ core.utils.decodeBase64(str)
|
||||
Base64解密字符串
|
||||
|
||||
|
||||
core.utils.formatBigNumber(x)
|
||||
core.utils.formatBigNumber(x, onMap)
|
||||
大数据的格式化
|
||||
|
||||
|
||||
|
||||
@ -354,9 +354,6 @@ control.prototype.resetStatus = function(hero, hard, floorId, route, maps, value
|
||||
// 清除游戏数据
|
||||
core.clearStatus();
|
||||
|
||||
// 显示状态栏
|
||||
core.control.triggerStatusBar("show");
|
||||
|
||||
// 初始化status
|
||||
core.status = core.clone(core.initStatus);
|
||||
// 初始化maps
|
||||
@ -397,6 +394,8 @@ control.prototype.resetStatus = function(hero, hard, floorId, route, maps, value
|
||||
else core.values = core.clone(core.data.values);
|
||||
|
||||
core.events.initGame();
|
||||
this.updateGlobalAttribute(Object.keys(core.status.globalAttribute));
|
||||
this.triggerStatusBar(core.getFlag('hideStatusBar', false)?'hide':'show');
|
||||
core.status.played = true;
|
||||
}
|
||||
|
||||
@ -1373,7 +1372,7 @@ control.prototype.snipe = function (snipes) {
|
||||
else if (damage < core.status.hero.hp) color = '#FF7F00';
|
||||
else color = '#FF0000';
|
||||
|
||||
damage = core.formatBigNumber(damage);
|
||||
damage = core.formatBigNumber(damage, true);
|
||||
if (core.enemys.hasSpecial(core.material.enemys[block.event.id], 19))
|
||||
damage += "+";
|
||||
if (core.enemys.hasSpecial(core.material.enemys[block.event.id], 21))
|
||||
@ -1555,15 +1554,15 @@ control.prototype.setFg = function(color, time, callback) {
|
||||
return;
|
||||
}
|
||||
|
||||
var step=0;
|
||||
// core.status.replay.animate=true;
|
||||
var per_time = 10, step=0, steps = parseInt(time / per_time);
|
||||
|
||||
var changeAnimate = setInterval(function() {
|
||||
step++;
|
||||
|
||||
var nowA = fromColor[3]+(color[3]-fromColor[3])*step/25;
|
||||
var nowR = parseInt(fromColor[0]+(color[0]-fromColor[0])*step/25);
|
||||
var nowG = parseInt(fromColor[1]+(color[1]-fromColor[1])*step/25);
|
||||
var nowB = parseInt(fromColor[2]+(color[2]-fromColor[2])*step/25);
|
||||
var nowA = fromColor[3]+(color[3]-fromColor[3])*step/steps;
|
||||
var nowR = parseInt(fromColor[0]+(color[0]-fromColor[0])*step/steps);
|
||||
var nowG = parseInt(fromColor[1]+(color[1]-fromColor[1])*step/steps);
|
||||
var nowB = parseInt(fromColor[2]+(color[2]-fromColor[2])*step/steps);
|
||||
core.clearMap('curtain');
|
||||
core.fillRect('curtain', 0, 0, 416, 416, core.arrayToRGBA([nowR,nowG,nowB,nowA]));
|
||||
|
||||
@ -1574,7 +1573,7 @@ control.prototype.setFg = function(color, time, callback) {
|
||||
// core.status.replay.animate=false;
|
||||
if (core.isset(callback)) callback();
|
||||
}
|
||||
}, time/25/core.status.replay.speed);
|
||||
}, per_time);
|
||||
|
||||
core.animateFrame.asyncId[changeAnimate] = true;
|
||||
}
|
||||
@ -1622,7 +1621,7 @@ control.prototype.updateDamage = function (floorId, canvas) {
|
||||
else if (damage < hero_hp * 2 / 3) color = '#FFFF00';
|
||||
else if (damage < hero_hp) color = '#FF7F00';
|
||||
else color = '#FF0000';
|
||||
damage = core.formatBigNumber(damage);
|
||||
damage = core.formatBigNumber(damage, true);
|
||||
if (core.enemys.hasSpecial(core.material.enemys[id], 19))
|
||||
damage += "+";
|
||||
if (core.enemys.hasSpecial(core.material.enemys[id], 21))
|
||||
@ -1645,7 +1644,7 @@ control.prototype.updateDamage = function (floorId, canvas) {
|
||||
if (core.flags.displayCritical) {
|
||||
var critical = core.enemys.nextCriticals(id);
|
||||
if (critical.length>0) critical=critical[0];
|
||||
critical = core.formatBigNumber(critical[0]);
|
||||
critical = core.formatBigNumber(critical[0], true);
|
||||
if (critical == '???') critical = '?';
|
||||
canvas.fillStyle = '#000000';
|
||||
canvas.fillText(critical, 32 * x + 2, 32 * (y + 1) - 2 - 10);
|
||||
@ -1677,7 +1676,7 @@ control.prototype.updateDamage = function (floorId, canvas) {
|
||||
for (var y=0;y<core.bigmap.height;y++) {
|
||||
var damage = core.status.checkBlock.damage[x+core.bigmap.width*y];
|
||||
if (damage>0) {
|
||||
damage = core.formatBigNumber(damage);
|
||||
damage = core.formatBigNumber(damage, true);
|
||||
canvas.fillStyle = '#000000';
|
||||
canvas.fillText(damage, 32 * x + 17, 32 * (y + 1) - 13);
|
||||
canvas.fillText(damage, 32 * x + 15, 32 * (y + 1) - 15);
|
||||
@ -2831,6 +2830,7 @@ control.prototype.triggerStatusBar = function (name) {
|
||||
var statusItems = core.dom.status;
|
||||
var toolItems = core.dom.tools;
|
||||
core.domStyle.showStatusBar = name == 'show';
|
||||
core.setFlag('hideStatusBar', core.domStyle.showStatusBar?null:true);
|
||||
if (!core.domStyle.showStatusBar) {
|
||||
for (var i = 0; i < statusItems.length; ++i)
|
||||
statusItems[i].style.opacity = 0;
|
||||
@ -2896,11 +2896,11 @@ control.prototype.updateGlobalAttribute = function (name) {
|
||||
var border = '3px ' + attribute[name] + ' solid';
|
||||
core.dom.statusBar.style.borderTop = border;
|
||||
core.dom.statusBar.style.borderLeft = border;
|
||||
core.dom.statusBar.style.borderRight = core.domStyle.isVertical?'':border;
|
||||
core.dom.statusBar.style.borderRight = core.domStyle.isVertical?border:'';
|
||||
core.dom.gameDraw.style.border = border;
|
||||
core.dom.toolBar.style.borderBottom = border;
|
||||
core.dom.toolBar.style.borderLeft = border;
|
||||
core.dom.toolBar.style.borderRight = core.domStyle.isVertical?'':border;
|
||||
core.dom.toolBar.style.borderRight = core.domStyle.isVertical?border:'';
|
||||
break;
|
||||
}
|
||||
case 'statusBarColor':
|
||||
|
||||
@ -1037,8 +1037,8 @@ core.prototype.formatDate2 = function (date) {
|
||||
}
|
||||
|
||||
////// 格式化大数 //////
|
||||
core.prototype.formatBigNumber = function (x) {
|
||||
return core.utils.formatBigNumber(x);
|
||||
core.prototype.formatBigNumber = function (x, onMap) {
|
||||
return core.utils.formatBigNumber(x, onMap);
|
||||
}
|
||||
|
||||
////// 两位数显示 //////
|
||||
|
||||
@ -117,7 +117,7 @@ events.prototype.startGame = function (hard, seed, route, callback) {
|
||||
|
||||
core.changeFloor(core.firstData.floorId, null, nowLoc, null, function() {
|
||||
if (core.isset(callback)) callback();
|
||||
}, true);
|
||||
});
|
||||
|
||||
setTimeout(function () {
|
||||
// Upload
|
||||
@ -1575,10 +1575,11 @@ events.prototype.animateImage = function (type, image, loc, time, keep, callback
|
||||
core.canvas.data.drawImage(image, x, y);
|
||||
core.setAlpha('data', 1);
|
||||
|
||||
// core.status.replay.animate=true;
|
||||
var per_time = 10, steps = parseInt(time / per_time), delta = 1 / steps;
|
||||
|
||||
var animate = setInterval(function () {
|
||||
if (type=='show') alpha += 0.1;
|
||||
else alpha -= 0.1;
|
||||
if (type=='show') alpha += delta;
|
||||
else alpha -= delta;
|
||||
core.clearMap('data', x, y, image.width, image.height);
|
||||
if (alpha >=1 || alpha<=0) {
|
||||
delete core.animateFrame.asyncId[animate];
|
||||
@ -1593,7 +1594,7 @@ events.prototype.animateImage = function (type, image, loc, time, keep, callback
|
||||
core.canvas.data.drawImage(image, x, y);
|
||||
core.setAlpha('data', 1);
|
||||
}
|
||||
}, time / 10);
|
||||
}, per_time);
|
||||
|
||||
core.animateFrame.asyncId[animate] = true;
|
||||
}
|
||||
@ -1653,21 +1654,20 @@ events.prototype.setVolume = function (value, time, callback) {
|
||||
if (core.isset(callback)) callback();
|
||||
return;
|
||||
}
|
||||
// core.status.replay.animate=true;
|
||||
|
||||
var currVolume = core.musicStatus.volume;
|
||||
var step = 0;
|
||||
var per_time = 10, step = 0, steps = parseInt(time / per_time);
|
||||
var fade = setInterval(function () {
|
||||
step++;
|
||||
var nowVolume = currVolume+(value-currVolume)*step/32;
|
||||
var nowVolume = currVolume+(value-currVolume)*step/steps;
|
||||
set(nowVolume);
|
||||
if (step>=32) {
|
||||
if (step>=steps) {
|
||||
delete core.animateFrame.asyncId[fade];
|
||||
clearInterval(fade);
|
||||
// core.status.replay.animate=false;
|
||||
if (core.isset(callback))
|
||||
callback();
|
||||
}
|
||||
}, time / 32);
|
||||
}, per_time);
|
||||
|
||||
core.animateFrame.asyncId[fade] = true;
|
||||
}
|
||||
|
||||
@ -91,6 +91,7 @@ items.prototype.useItem = function (itemId, callback) {
|
||||
delete core.status.hero.items[itemCls][itemId];
|
||||
|
||||
core.updateStatusBar();
|
||||
core.status.event.data = null;
|
||||
|
||||
if (core.isset(callback)) callback();
|
||||
}
|
||||
@ -100,16 +101,18 @@ items.prototype.canUseItem = function (itemId) {
|
||||
// 没有道具
|
||||
if (!core.hasItem(itemId)) return false;
|
||||
|
||||
var able = false;
|
||||
if (itemId in this.canUseItemEffect) {
|
||||
try {
|
||||
return eval(this.canUseItemEffect[itemId]);
|
||||
able = eval(this.canUseItemEffect[itemId]);
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
if (!able) core.status.event.data = null;
|
||||
|
||||
return false;
|
||||
return able;
|
||||
}
|
||||
|
||||
////// 获得某个物品的个数 //////
|
||||
|
||||
28
libs/maps.js
28
libs/maps.js
@ -476,7 +476,7 @@ maps.prototype.drawBgFgMap = function (floorId, canvas, name, animate) {
|
||||
}
|
||||
}
|
||||
}
|
||||
core.status.autotileAnimateObjs[name+"map"] = core.clone(arr);
|
||||
if (animate) core.status.autotileAnimateObjs[name+"map"] = core.clone(arr);
|
||||
}
|
||||
|
||||
////// 绘制某张地图 //////
|
||||
@ -1091,9 +1091,10 @@ maps.prototype.animateBlock = function (loc,type,time,callback) {
|
||||
core.setAlpha('route', alpha);
|
||||
draw();
|
||||
|
||||
var animate = window.setInterval(function () {
|
||||
if (type=='show') alpha += 0.1;
|
||||
else alpha -= 0.1;
|
||||
var per_time = 10, steps = parseInt(time / per_time), delta = 1 / steps;
|
||||
var animate = setInterval(function () {
|
||||
if (type=='show') alpha += delta;
|
||||
else alpha -= delta;
|
||||
clear();
|
||||
if (alpha >=1 || alpha<=0) {
|
||||
delete core.animateFrame.asyncId[animate];
|
||||
@ -1115,7 +1116,7 @@ maps.prototype.animateBlock = function (loc,type,time,callback) {
|
||||
core.setAlpha('route', alpha);
|
||||
draw();
|
||||
}
|
||||
}, time / 10 / core.status.replay.speed);
|
||||
}, per_time);
|
||||
|
||||
core.animateFrame.asyncId[animate] = true;
|
||||
}
|
||||
@ -1449,13 +1450,12 @@ maps.prototype.setBgFgMap = function (type, name, loc, floorId, callback) {
|
||||
maps.prototype.resetMap = function(floorId) {
|
||||
floorId = floorId || core.status.floorId;
|
||||
if (!core.isset(floorId)) return;
|
||||
core.status.maps[floorId] = this.loadFloor(floorId);
|
||||
if (floorId==core.status.floorId) {
|
||||
this.drawMap(floorId, function () {
|
||||
core.drawTip("地图重置成功");
|
||||
})
|
||||
}
|
||||
else {
|
||||
core.drawTip(floorId+"地图重置成功");
|
||||
}
|
||||
if (typeof floorId == 'string') floorId = [floorId];
|
||||
var needRefresh = false;
|
||||
floorId.forEach(function (t) {
|
||||
core.status.maps[t] = core.maps.loadFloor(t);
|
||||
if (t == core.status.floorId) needRefresh = true;
|
||||
});
|
||||
if (needRefresh) this.drawMap(core.status.floorId);
|
||||
core.drawTip("地图重置成功");
|
||||
}
|
||||
@ -2225,8 +2225,8 @@ ui.prototype.drawSLPanel = function(index, refresh) {
|
||||
core.strokeRect('ui', (2*i+1)*u-size/2, 45, size, size, i==offset?strokeColor:'#FFFFFF', i==offset?6:2);
|
||||
if (core.isset(data) && core.isset(data.floorId)) {
|
||||
core.ui.drawThumbnail(data.floorId, 'ui', core.maps.load(data.maps, data.floorId).blocks, (2*i+1)*u-size/2, 45, size, data.hero.loc.x, data.hero.loc.y, data.hero.loc, data.hero.flags.heroIcon||"hero.png");
|
||||
var v = core.formatBigNumber(data.hero.hp)+"/"+core.formatBigNumber(data.hero.atk)+"/"+core.formatBigNumber(data.hero.def);
|
||||
var v2 = "/"+core.formatBigNumber(data.hero.mdef);
|
||||
var v = core.formatBigNumber(data.hero.hp,true)+"/"+core.formatBigNumber(data.hero.atk,true)+"/"+core.formatBigNumber(data.hero.def,true);
|
||||
var v2 = "/"+core.formatBigNumber(data.hero.mdef,true);
|
||||
if (v.length+v2.length<=21) v+=v2;
|
||||
core.fillText('ui', v, (2*i+1)*u, 60+size, '#FFD700', '10px '+globalFont);
|
||||
core.fillText('ui', core.formatDate(new Date(data.time)), (2*i+1)*u, 73+size, data.hero.flags.consoleOpened?'#FF6A6A':'#FFFFFF');
|
||||
@ -2241,8 +2241,8 @@ ui.prototype.drawSLPanel = function(index, refresh) {
|
||||
core.strokeRect('ui', (2*i-5)*u-size/2, 233, size, size, i==offset?strokeColor:'#FFFFFF', i==offset?6:2);
|
||||
if (core.isset(data) && core.isset(data.floorId)) {
|
||||
core.ui.drawThumbnail(data.floorId, 'ui', core.maps.load(data.maps, data.floorId).blocks, (2*i-5)*u-size/2, 233, size, data.hero.loc.x, data.hero.loc.y, data.hero.loc, data.hero.flags.heroIcon||"hero.png");
|
||||
var v = core.formatBigNumber(data.hero.hp)+"/"+core.formatBigNumber(data.hero.atk)+"/"+core.formatBigNumber(data.hero.def);
|
||||
var v2 = "/"+core.formatBigNumber(data.hero.mdef);
|
||||
var v = core.formatBigNumber(data.hero.hp,true)+"/"+core.formatBigNumber(data.hero.atk,true)+"/"+core.formatBigNumber(data.hero.def,true);
|
||||
var v2 = "/"+core.formatBigNumber(data.hero.mdef,true);
|
||||
if (v.length+v2.length<=21) v+=v2;
|
||||
core.fillText('ui', v, (2*i-5)*u, 248+size, '#FFD700', '10px '+globalFont);
|
||||
core.fillText('ui', core.formatDate(new Date(data.time)), (2*i-5)*u, 261+size, data.hero.flags.consoleOpened?'#FF6A6A':'#FFFFFF', '10px '+globalFont);
|
||||
|
||||
@ -297,14 +297,14 @@ utils.prototype.setTwoDigits = function (x) {
|
||||
return parseInt(x)<10?"0"+x:x;
|
||||
}
|
||||
|
||||
utils.prototype.formatBigNumber = function (x) {
|
||||
utils.prototype.formatBigNumber = function (x, onMap) {
|
||||
x = Math.floor(parseFloat(x));
|
||||
if (!core.isset(x)) return '???';
|
||||
|
||||
var c = x<0?"-":"";
|
||||
x = Math.abs(x);
|
||||
|
||||
if (x<=999999) return c + x;
|
||||
if (x<=99999 || (!onMap && x<=999999)) return c + x;
|
||||
|
||||
var all = [
|
||||
{"val": 1e20, "c": "g"},
|
||||
@ -316,9 +316,17 @@ utils.prototype.formatBigNumber = function (x) {
|
||||
|
||||
for (var i=0;i<all.length;i++) {
|
||||
var one = all[i];
|
||||
if (x>=10*one.val) {
|
||||
var v = x/one.val;
|
||||
return c + v.toFixed(Math.max(0, Math.floor(4-Math.log10(v+1)))) + one.c;
|
||||
if (onMap) {
|
||||
if (x>=one.val) {
|
||||
var v = x/one.val;
|
||||
return c + v.toFixed(Math.max(0, Math.floor(3-Math.log10(v+1)))) + one.c;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (x>=10*one.val) {
|
||||
var v = x/one.val;
|
||||
return c + v.toFixed(Math.max(0, Math.floor(4-Math.log10(v+1)))) + one.c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -87,16 +87,19 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
||||
"afterChangeFloor": function (floorId, fromLoad) {
|
||||
// 转换楼层结束的事件
|
||||
// floorId是切换到的楼层;fromLoad若为true则代表是从读档行为造成的楼层切换
|
||||
|
||||
// 每次抵达楼层时执行的事件
|
||||
if (!fromLoad) {
|
||||
core.insertAction(core.floors[floorId].eachArrive);
|
||||
}
|
||||
|
||||
// 首次抵达楼层时执行的事件(后插入,先执行)
|
||||
var visited = core.getFlag("__visited__", []);
|
||||
if (visited.indexOf(floorId)===-1) {
|
||||
core.insertAction(core.floors[floorId].firstArrive);
|
||||
visited.push(floorId);
|
||||
core.setFlag("__visited__", visited);
|
||||
}
|
||||
// 每次抵达楼层时执行的事件
|
||||
if (!fromLoad) {
|
||||
core.insertAction(core.floors[floorId].eachArrive);
|
||||
}
|
||||
},
|
||||
"addPoint": function (enemy) {
|
||||
// 加点事件
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Loading…
Reference in New Issue
Block a user