diff --git a/_server/blockly/MotaAction.g4 b/_server/blockly/MotaAction.g4
index 7cca7805..917ed6e8 100644
--- a/_server/blockly/MotaAction.g4
+++ b/_server/blockly/MotaAction.g4
@@ -342,7 +342,7 @@ return code;
*/;
setValue_s
- : '变量设置' ':' '名称' idString_e '值' expression Newline
+ : '数值操作' ':' '名称' idString_e '值' expression Newline
/* setValue_s
diff --git a/_server/comment.js b/_server/comment.js
index 982424a4..42422d46 100644
--- a/_server/comment.js
+++ b/_server/comment.js
@@ -245,6 +245,18 @@ comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
"_type": "textarea",
"_data": "显示在状态栏中的层数"
},
+ "width": {
+ "_leaf": true,
+ "_type": "textarea",
+ "_range": "false",
+ "_data": "地图x方向大小,这里不能更改,仅能在新建地图时设置,null视为13"
+ },
+ "height": {
+ "_leaf": true,
+ "_type": "textarea",
+ "_range": "false",
+ "_data": "地图y方向大小,这里不能更改,仅能在新建地图时设置,null视为13"
+ },
"canFlyTo": {
"_leaf": true,
"_type": "checkbox",
diff --git a/_server/css/editor.css b/_server/css/editor.css
index f5681118..928a0964 100644
--- a/_server/css/editor.css
+++ b/_server/css/editor.css
@@ -89,6 +89,10 @@ body {
height: 630px;
}
+#mapEdit {
+ overflow: hidden;
+}
+
.map {
position: absolute;
left: 20px;
diff --git a/_server/css/editor_mobile.css b/_server/css/editor_mobile.css
index d5eed943..36ca92ae 100644
--- a/_server/css/editor_mobile.css
+++ b/_server/css/editor_mobile.css
@@ -82,6 +82,10 @@ body {
position: absolute;
}
+#mapEdit {
+ overflow: hidden;
+}
+
.map {
position: absolute;
left: 4vw;
diff --git a/_server/data.comment.js b/_server/data.comment.js
index 760450e8..acfae9fc 100644
--- a/_server/data.comment.js
+++ b/_server/data.comment.js
@@ -426,6 +426,12 @@ data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
"_bool": "bool",
"_data": "是否在状态栏显示三色钥匙数量"
},
+ "enablePZF": {
+ "_leaf": true,
+ "_type": "checkbox",
+ "_bool": "bool",
+ "_data": "是否在状态栏显示破炸飞数量"
+ },
"enableDebuff": {
"_leaf": true,
"_type": "checkbox",
diff --git a/_server/editor.js b/_server/editor.js
index b76134b0..cbb4f6d1 100644
--- a/_server/editor.js
+++ b/_server/editor.js
@@ -18,9 +18,10 @@ editor.prototype.init = function (callback) {
return editor.ids[[editor.indexs[parseInt(v)][0]]]
})
});
- editor.updateMap();
editor.currentFloorId = core.status.floorId;
editor.currentFloorData = core.floors[core.status.floorId];
+ editor.updateMap();
+ editor.buildMark();
editor.drawEventBlock();
if (Boolean(callback)) callback();
});
@@ -159,12 +160,13 @@ editor.prototype.drawInitData = function (icons) {
}
editor.prototype.mapInit = function () {
var ec = document.getElementById('event').getContext('2d');
- ec.clearRect(0, 0, 416, 416);
- document.getElementById('event2').getContext('2d').clearRect(0, 0, 416, 416);
+ ec.clearRect(0, 0, core.bigmap.width*32, core.bigmap.height*32);
+ document.getElementById('event2').getContext('2d').clearRect(0, 0, core.bigmap.width*32, core.bigmap.height*32);
editor.map = [];
- for (var y = 0; y < 13; y++) {
+ var sy=editor.currentFloorData.map.length,sy=editor.currentFloorData.map[0].length;
+ for (var y = 0; y < sy; y++) {
editor.map[y] = [];
- for (var x = 0; x < 13; x++) {
+ for (var x = 0; x < sx; x++) {
editor.map[y][x] = 0;
}
}
@@ -200,23 +202,23 @@ editor.prototype.drawEventBlock = function () {
fg.clearRect(0, 0, 416, 416);
for (var i=0;i<13;i++) {
for (var j=0;j<13;j++) {
- var color=null;
- var loc=i+","+j;
+ var color=[];
+ var loc=(i+core.bigmap.offsetX/32)+","+(j+core.bigmap.offsetY/32);
if (core.isset(editor.currentFloorData.events[loc]))
- color = '#FF0000';
- else if (core.isset(editor.currentFloorData.changeFloor[loc]))
- color = '#00FF00';
- else if (core.isset(editor.currentFloorData.afterBattle[loc]))
- color = '#FFFF00';
- else if (core.isset(editor.currentFloorData.afterGetItem[loc]))
- color = '#00FFFF';
- else if (core.isset(editor.currentFloorData.afterOpenDoor[loc]))
- color = '#FF00FF';
- else if (core.isset(editor.currentFloorData.cannotMove[loc]))
- color = '#0000FF';
- if (color!=null) {
- fg.fillStyle = color;
- fg.fillRect(32*i, 32*j+32-8, 8, 8);
+ color.push('#FF0000');
+ if (core.isset(editor.currentFloorData.changeFloor[loc]))
+ color.push('#00FF00');
+ if (core.isset(editor.currentFloorData.afterBattle[loc]))
+ color.push('#FFFF00');
+ if (core.isset(editor.currentFloorData.afterGetItem[loc]))
+ color.push('#00FFFF');
+ if (core.isset(editor.currentFloorData.afterOpenDoor[loc]))
+ color.push('#FF00FF');
+ if (core.isset(editor.currentFloorData.cannotMove[loc]))
+ color.push('#0000FF');
+ for(var kk=0,cc;cc=color[kk];kk++){
+ fg.fillStyle = cc;
+ fg.fillRect(32*i+8*kk, 32*j+32-8, 8, 8);
}
}
}
@@ -227,7 +229,7 @@ editor.prototype.updateMap = function () {
return v.map(function (v) {
return v.idnum || v || 0
})
- }), {'events': {}, 'changeFloor': {}});
+ }), {'events': {}, 'changeFloor': {}}, editor.currentFloorId);
core.status.thisMap.blocks = blocks;
main.editor.updateMap();
@@ -252,96 +254,10 @@ editor.prototype.updateMap = function () {
}
//ctx.drawImage(editor.material.images[tileInfo.images], 0, tileInfo.y*32, 32, 32, x*32, y*32, 32, 32);
}
- /*
- // autotile的相关处理
- var indexArrs = [ //16种组合的图块索引数组; // 将autotile分割成48块16*16的小块; 数组索引即对应各个小块
- // +----+----+----+----+----+----+
- [10, 9, 4, 3 ], //0 bin:0000 | 1 | 2 | 3 | 4 | 5 | 6 |
- [10, 9, 4, 13], //1 bin:0001 +----+----+----+----+----+----+
- [10, 9, 18, 3 ], //2 bin:0010 | 7 | 8 | 9 | 10 | 11 | 12 |
- [10, 9, 16, 15], //3 bin:0011 +----+----+----+----+----+----+
- [10, 43, 4, 3 ], //4 bin:0100 | 13 | 14 | 15 | 16 | 17 | 18 |
- [10, 31, 4, 25], //5 bin:0101 +----+----+----+----+----+----+
- [10, 7, 2, 3 ], //6 bin:0110 | 19 | 20 | 21 | 22 | 23 | 24 |
- [10, 31, 16, 5 ], //7 bin:0111 +----+----+----+----+----+----+
- [48, 9, 4, 3 ], //8 bin:1000 | 25 | 26 | 27 | 28 | 29 | 30 |
- [ 8, 9, 4, 1 ], //9 bin:1001 +----+----+----+----+----+----+
- [36, 9, 30, 3 ], //10 bin:1010 | 31 | 32 | 33 | 34 | 35 | 36 |
- [36, 9, 6, 15], //11 bin:1011 +----+----+----+----+----+----+
- [46, 45, 4, 3 ], //12 bin:1100 | 37 | 38 | 39 | 40 | 41 | 42 |
- [46, 11, 4, 25], //13 bin:1101 +----+----+----+----+----+----+
- [12, 45, 30, 3 ], //14 bin:1110 | 43 | 44 | 45 | 46 | 47 | 48 |
- [34, 33, 28, 27] //15 bin:1111 +----+----+----+----+----+----+
- ];
- var drawBlockByIndex = function(ctx, dx, dy, autotileImg, index){ //index为autotile的图块索引1-48
- var sx = 16*((index-1)%6), sy = 16*(~~((index-1)/6));
- ctx.drawImage(autotileImg, sx, sy, 16, 16, dx, dy, 16, 16);
- }
- var isAutotile = function(info){
- if(typeof(info)=='object' && hasOwnProp(info, 'images') && info.images=='autotile') return true;
- return false;
- }
- var getAutotileAroundId = function(currId, x, y){ //与autotile当前idnum一致返回1,否则返回0
- if(x>=0 && y >=0 && x<13 && y<13 && isAutotile(editor.map[y][x]) && editor.map[y][x].idnum == currId)
- return 1;
- else if(x<0 || y<0 || x>12 || y>12) return 1; //边界外视为通用autotile,这样好看些
- else
- return 0;
- }
- var checkAround = function(x, y){ // 得到周围四个32*32块(周围每块都包含当前块的1/4,不清楚的话画下图你就明白)的数组索引
- var currId = editor.map[y][x].idnum;
- var pointBlock = [];
- for(var i=0; i<4; i++){
- var bsum = 0;
- var offsetx = i%2, offsety = ~~(i/2);
- for(var j=0; j<4; j++){
- var mx = j%2, my = ~~(j/2);
- var b = getAutotileAroundId(currId, x+offsetx+mx-1, y+offsety+my-1);
- bsum += b*(Math.pow(2, 3-j));
- }
- pointBlock.push(bsum);
- }
- return pointBlock;
- }
- var addIndexToAutotileInfo = function(x, y){
- var indexArr = [];
- var pointBlocks = checkAround(x, y);
- for(var i=0; i<4; i++){
- var arr = indexArrs[pointBlocks[i]]
- indexArr.push(arr[3-i]);
- }
- editor.map[y][x].blockIndex = indexArr;
- }
- var drawAutotile = function(ctx, x, y, info){ // 绘制一个autotile
- ctx.clearRect(x*32, y*32, 32, 32);
- //修正四个边角的固定搭配
- if(info.blockIndex[0] == 13){
- if(info.blockIndex[1] == 16) info.blockIndex[1] = 14;
- if(info.blockIndex[2] == 31) info.blockIndex[2] = 19;
- }
- if(info.blockIndex[1] == 18){
- if(info.blockIndex[0] == 15) info.blockIndex[0] = 17;
- if(info.blockIndex[3] == 36) info.blockIndex[3] = 24;
- }
- if(info.blockIndex[2] == 43){
- if(info.blockIndex[0] == 25) info.blockIndex[0] = 37;
- if(info.blockIndex[3] == 46) info.blockIndex[3] = 44;
- }
- if(info.blockIndex[3] == 48){
- if(info.blockIndex[1] == 30) info.blockIndex[1] = 42;
- if(info.blockIndex[2] == 45) info.blockIndex[2] = 47;
- }
- for(var i=0; i<4; i++){
- var index = info.blockIndex[i];
- var dx = x*32 + 16*(i%2), dy = y*32 + 16*(~~(i/2));
- drawBlockByIndex(ctx, dx, dy, editor.material.images[info.images][info.id], index);
- }
- }
- */
// 绘制地图 start
var eventCtx = document.getElementById('event').getContext("2d");
- for (var y = 0; y < 13; y++)
- for (var x = 0; x < 13; x++) {
+ for (var y = 0; y < editor.map.length; y++)
+ for (var x = 0; x < editor.map[0].length; x++) {
var tileInfo = editor.map[y][x];
if (false && isAutotile(tileInfo)) {
addIndexToAutotileInfo(x, y);
@@ -352,6 +268,64 @@ editor.prototype.updateMap = function () {
}
+editor.prototype.buildMark = function(){
+ // 生成定位编号
+ var arrColMark=document.getElementById('arrColMark');
+ var arrRowMark=document.getElementById('arrRowMark');
+ var mapColMark=document.getElementById('mapColMark');
+ var mapRowMark=document.getElementById('mapRowMark');
+ var buildMark = function (offsetX,offsetY) {
+ var colNum = ' ';
+ for (var i = 0; i < 13; i++) {
+ var tpl = '
' + (i+offsetX) + ' | ';
+ colNum += tpl;
+ }
+ arrColMark.innerHTML = '' + colNum + '
';
+ mapColMark.innerHTML = '' + colNum + '
';
+ var rowNum = ' ';
+ for (var i = 0; i < 13; i++) {
+ var tpl = '| ' + (i+offsetY) + ' |
';
+ rowNum += tpl;
+ }
+ arrRowMark.innerHTML = rowNum;
+ mapRowMark.innerHTML = rowNum;
+ }
+ var buildMark_mobile = function (offsetX,offsetY) {
+ var colNum = ' ';
+ for (var i = 0; i < 13; i++) {
+ var tpl = '' + (' '+i).slice(-2).replace(' ',' ') + ' | ';
+ colNum += tpl;
+ }
+ arrColMark.innerHTML = '' + colNum + '
';
+ //mapColMark.innerHTML = '' + colNum + '
';
+ var rowNum = ' ';
+ for (var i = 0; i < 13; i++) {
+ var tpl = '| ' + (' '+i).slice(-2).replace(' ',' ') + ' |
';
+ rowNum += tpl;
+ }
+ arrRowMark.innerHTML = rowNum;
+ //mapRowMark.innerHTML = rowNum;
+ //=====
+ var colNum = ' ';
+ for (var i = 0; i < 13; i++) {
+ var tpl = '' + (' '+(i+offsetX)).slice(-2).replace(' ',' ') + '
';
+ colNum += tpl;
+ }
+ mapColMark.innerHTML = '' + colNum + '
';
+ var rowNum = ' ';
+ for (var i = 0; i < 13; i++) {
+ var tpl = '' + (' '+(i+offsetY)).slice(-2).replace(' ',' ') + '
';
+ rowNum += tpl;
+ }
+ mapRowMark.innerHTML = rowNum;
+ }
+ if(editor.isMobile){
+ buildMark_mobile(core.bigmap.offsetX/32,core.bigmap.offsetY/32);
+ } else {
+ buildMark(core.bigmap.offsetX/32,core.bigmap.offsetY/32);
+ }
+}
+
editor.prototype.changeFloor = function (floorId, callback) {
editor.currentFloorData.map = editor.map.map(function (v) {
return v.map(function (v) {
@@ -366,9 +340,9 @@ editor.prototype.changeFloor = function (floorId, callback) {
return editor.ids[[editor.indexs[parseInt(v)][0]]]
})
});
- editor.updateMap();
editor.currentFloorId = core.status.floorId;
editor.currentFloorData = core.floors[core.status.floorId];
+ editor.updateMap();
editor_mode.floor();
editor.drawEventBlock();
if (core.isset(callback)) callback();
@@ -394,7 +368,7 @@ editor.prototype.listen = function () {
function fillPos(pos) {
uc.fillStyle = '#' + ~~(Math.random() * 8) + ~~(Math.random() * 8) + ~~(Math.random() * 8);
- uc.fillRect(pos.x * 32 + 12, pos.y * 32 + 12, 8, 8);
+ uc.fillRect(pos.x * 32 + 12 - core.bigmap.offsetX, pos.y * 32 + 12 - core.bigmap.offsetY, 8, 8);
}//在格子内画一个随机色块
function eToLoc(e) {
@@ -410,8 +384,13 @@ editor.prototype.listen = function () {
return editor.loc;
}//返回可用的组件内坐标
- function locToPos(loc) {
- editor.pos = {'x': ~~(loc.x / loc.size), 'y': ~~(loc.y / loc.size)}
+ function locToPos(loc, addViewportOffset) {
+ var offsetX=0, offsetY=0;
+ if (addViewportOffset){
+ offsetX=core.bigmap.offsetX/32;
+ offsetY=core.bigmap.offsetY/32;
+ }
+ editor.pos = {'x': ~~(loc.x / loc.size)+offsetX, 'y': ~~(loc.y / loc.size)+offsetY}
return editor.pos;
}
@@ -436,13 +415,13 @@ editor.prototype.listen = function () {
eui.onmousedown = function (e) {
if (e.button==2){
var loc = eToLoc(e);
- var pos = locToPos(loc);
+ var pos = locToPos(loc,true);
editor.showMidMenu(e.clientX,e.clientY);
return;
}
if (!selectBox.isSelected) {
var loc = eToLoc(e);
- var pos = locToPos(loc);
+ var pos = locToPos(loc,true);
editor_mode.onmode('nextChange');
editor_mode.onmode('loc');
//editor_mode.loc();
@@ -458,7 +437,7 @@ editor.prototype.listen = function () {
e.stopPropagation();
uc.clearRect(0, 0, 416, 416);
var loc = eToLoc(e);
- var pos = locToPos(loc);
+ var pos = locToPos(loc,true);
stepPostfix = [];
stepPostfix.push(pos);
fillPos(pos);
@@ -476,7 +455,7 @@ editor.prototype.listen = function () {
mouseOutCheck = 2;
e.stopPropagation();
var loc = eToLoc(e);
- var pos = locToPos(loc);
+ var pos = locToPos(loc,true);
var pos0 = stepPostfix[stepPostfix.length - 1]
var directionDistance = [pos.y - pos0.y, pos0.x - pos.x, pos0.y - pos.y, pos.x - pos0.x]
var max = 0, index = 4;
@@ -532,6 +511,24 @@ editor.prototype.listen = function () {
}
}
+ /*
+ document.getElementById('mid').onkeydown = function (e) {
+ console.log(e);
+ if (e.keyCode==37) {
+ editor.moveViewport(-1, 0);
+ }
+ if (e.keyCode==38) {
+ editor.moveViewport(0, -1);
+ }
+ if (e.keyCode==39) {
+ editor.moveViewport(1, 0);
+ }
+ if (e.keyCode==40) {
+ editor.moveViewport(0, 1);
+ }
+ }
+ */
+
document.getElementById('mid').onmousewheel = function (e) {
e.preventDefault();
var wheel = function (direct) {
@@ -864,6 +861,24 @@ editor.prototype.listen = function () {
editor.brushMod=brushMod2.value;
}
+
+ editor.moveViewport=function(x,y){
+ core.bigmap.offsetX = core.clamp(core.bigmap.offsetX+32*x, 0, 32*core.bigmap.width-416);
+ core.bigmap.offsetY = core.clamp(core.bigmap.offsetY+32*y, 0, 32*core.bigmap.height-416);
+ core.control.updateViewport();
+ editor.buildMark();
+ editor.drawEventBlock();
+ }
+
+ var viewportButtons=document.getElementById('viewportButtons');
+ for(var ii=0,node;node=viewportButtons.children[ii];ii++){
+ (function(x,y){
+ node.onclick=function(){
+ editor.moveViewport(x,y);
+ }
+ })([-1,0,0,1][ii],[0,-1,1,0][ii]);
+ }
+
}//绑定事件
/*
diff --git a/_server/editor_file.js b/_server/editor_file.js
index 82247ee0..4f534d2a 100644
--- a/_server/editor_file.js
+++ b/_server/editor_file.js
@@ -83,12 +83,21 @@ editor_file = function (editor, callback) {
} */
var filename = 'project/floors/' + editor.currentFloorId + '.js';
var datastr = ['main.floors.', editor.currentFloorId, '=\n{'];
- if (editor.currentFloorData.map == 'new')
+ if (editor.currentFloorData.map == 'new') {
+ /*
editor.currentFloorData.map = editor.map.map(function (v) {
return v.map(function () {
return 0
})
});
+ */
+ var width = parseInt(document.getElementById('newMapWidth').value);
+ var height = parseInt(document.getElementById('newMapHeight').value);
+ var row = [];
+ for (var i=0;i1000) {
+ printe("新建地图的宽高都不得小于13,且宽高之积不能超过1000");
+ return;
+ }
editor_mode.onmode('');
editor.file.saveNewFile(newFileName.value, function (err) {
diff --git a/_server/vm.js b/_server/vm.js
index 1dd5136b..addb20eb 100644
--- a/_server/vm.js
+++ b/_server/vm.js
@@ -24,7 +24,14 @@ document.body.onmousedown = function (e) {
}
});
- if (clickpath.indexOf('edit') === -1 && clickpath.indexOf('tip') === -1 && clickpath.indexOf('brushMod') === -1 && clickpath.indexOf('brushMod2') === -1) {
+ var unselect=true;
+ for(var ii=0,thisId;thisId=['edit','tip','brushMod','brushMod2','viewportButtons'][ii];ii++){
+ if (clickpath.indexOf(thisId) !== -1){
+ unselect=false;
+ break;
+ }
+ }
+ if (unselect) {
if (clickpath.indexOf('eui') === -1) {
if (selectBox.isSelected) {
editor_mode.onmode('');
@@ -60,11 +67,12 @@ var exportMap = new Vue({
methods: {
exportMap: function () {
editor.updateMap();
+ var sx=editor.map.length-1,sy=editor.map[0].length-1;
var filestr = '';
- for (var yy = 0; yy < 13; yy++) {
+ for (var yy = 0; yy <= sy; yy++) {
filestr += '['
- for (var xx = 0; xx < 13; xx++) {
+ for (var xx = 0; xx <= sx; xx++) {
var mapxy = editor.map[yy][xx];
if (typeof(mapxy) == typeof({})) {
if ('idnum' in mapxy) mapxy = mapxy.idnum;
@@ -79,10 +87,10 @@ var exportMap = new Vue({
}
mapxy = String(mapxy);
mapxy = Array(Math.max(4 - mapxy.length, 0)).join(' ') + mapxy;
- filestr += mapxy + (xx == 12 ? '' : ',')
+ filestr += mapxy + (xx == sx ? '' : ',')
}
- filestr += ']' + (yy == 12 ? '' : ',\n');
+ filestr += ']' + (yy == sy ? '' : ',\n');
}
pout.value = filestr;
editArea.mapArr = filestr;
@@ -97,7 +105,7 @@ var editArea = new Vue({
data: {
mapArr: '',
errors: [ // 编号1,2,3,4
- "格式错误!请使用正确格式(13*13数组,如不清楚,可先点击生成地图查看正确格式)",
+ "格式错误!请使用正确格式(width*height数组,如不清楚,可先点击生成地图查看正确格式)",
"当前有未定义ID(在地图区域显示红块),请修改ID或者到icons.js和maps.js中进行定义!",
"ID越界(在地图区域显示红块),当前编辑器暂时支持编号小于400,请修改编号!",
// "发生错误!",
@@ -138,8 +146,9 @@ var editArea = new Vue({
// var mapArray = that.mapArr.split(/\D+/).join(' ').trim().split(' ');
var mapArray = JSON.parse('[' + that.mapArr + ']');
- for (var y = 0; y < 13; y++)
- for (var x = 0; x < 13; x++) {
+ var sy=editor.map.length,sx=editor.map[0].length;
+ for (var y = 0; y < sy; y++)
+ for (var x = 0; x < sx; x++) {
var num = mapArray[y][x];
if (num == 0)
editor.map[y][x] = 0;
@@ -159,25 +168,26 @@ var editArea = new Vue({
var formatArrStr = '';
var that = this;
clearTimeout(that.formatTimer);
- if (this.mapArr.split(/\D+/).join(' ').trim().split(' ').length != 169) return false;
+ var si=this.mapArr.length,sk=this.mapArr[0].length;
+ if (this.mapArr.split(/\D+/).join(' ').trim().split(' ').length != si*sk) return false;
var arr = this.mapArr.replace(/\s+/g, '').split('],[');
- if (arr.length != 13) return;
- for (var i = 0; i < 13; i++) {
+ if (arr.length != si) return;
+ for (var i = 0; i < si; i++) {
var a = [];
formatArrStr += '[';
- if (i == 0 || i == 12) a = arr[i].split(/\D+/).join(' ').trim().split(' ');
+ if (i == 0 || i == si-1) a = arr[i].split(/\D+/).join(' ').trim().split(' ');
else a = arr[i].split(/\D+/);
- if (a.length != 13) {
+ if (a.length != sk) {
formatArrStr = '';
return;
}
- for (var k = 0; k < 13; k++) {
+ for (var k = 0; k < sk; k++) {
var num = parseInt(a[k]);
- formatArrStr += Array(Math.max(4 - String(num).length, 0)).join(' ') + num + (k == 12 ? '' : ',');
+ formatArrStr += Array(Math.max(4 - String(num).length, 0)).join(' ') + num + (k == sk-1 ? '' : ',');
}
- formatArrStr += ']' + (i == 12 ? '' : ',\n');
+ formatArrStr += ']' + (i == si-1 ? '' : ',\n');
}
return formatArrStr;
}
diff --git a/docs/api.md b/docs/api.md
index 50319569..f28da96b 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -184,22 +184,29 @@ core.enemyExists(x, y, id, floorId)
x和y为坐标;id为怪物ID,可为null表示任意怪物;floorId为楼层ID,可忽略表示当前楼层。
-core.getBlock(x, y, floorId, needEnable)
+core.getBlock(x, y, floorId, showDisable)
获得某个点的当前图块信息。
x和y为坐标;floorId为楼层ID,可忽略或null表示当前楼层。
-needEnable表示该点是否启用时才返回,其值不设置则默认为true。
+showDisable如果为true,则对于禁用的点和事件也会进行返回。
如果该点不存在图块,则返回null。
否则,返回值如下: {"index": xxx, "block": xxx}
其中index为该点在该楼层blocks数组中的索引,block为该图块实际内容。
-core.getBlockId(x, y, floorId, needEnable)
+core.getBlockId(x, y, floorId, showDisable)
获得某个点的图块ID。
x和y为坐标;floorId为楼层ID,可忽略或null表示当前楼层。
-needEnable表示是否需要该点处于启用状态才返回,其值不设置则默认为true。
+showDisable如果为true,则对于禁用的点和事件也会进行返回。
如果该点不存在图块,则返回null,否则返回该点的图块ID。
+core.getBlockCls(x, y, floorId, showDisable)
+获得某个点的图块cls。
+x和y为坐标;floorId为楼层ID,可忽略或null表示当前楼层。
+showDisable如果为true,则对于禁用的点和事件也会进行返回。
+如果该点不存在图块,则返回null,否则返回该点的图块cls。
+
+
core.showBlock(x, y, floorId)
将某个点从禁用变成启用状态。
diff --git a/docs/personalization.md b/docs/personalization.md
index caa80a16..0c2a6075 100644
--- a/docs/personalization.md
+++ b/docs/personalization.md
@@ -18,6 +18,7 @@ HTML5魔塔是使用画布(canvas)来绘制,存在若干个图层,它们
- animate:动画层;主要用来绘制动画,图块的淡入/淡出效果,图块的移动。showImage事件绘制的图片也是在这一层。
- weather:天气层;主要用来绘制天气(雨/雪)
- curtain:色调层;用来控制当前楼层的画面色调
+- route:路线层;主要用来绘制勇士的行走路线图
- ui:UI层;用来绘制一切UI窗口,如剧情文本、怪物手册、楼传器、系统菜单等等
- data:数据层;用来绘制一些顶层的或更新比较快的数据,如左上角的提示,战斗界面中数据的变化等等。
@@ -299,7 +300,7 @@ enemys.prototype.calDamage = function (monster, hero_hp, hero_atk, hero_def, her
// 检查领域、夹击、阻击事件
control.prototype.checkBlock = function () {
var x=core.getHeroLoc('x'), y=core.getHeroLoc('y');
- var damage = core.status.checkBlock.damage[13*x+y];
+ var damage = core.status.checkBlock.damage[x+core.bigmap.width*y];
if (damage>0) {
if (core.hasFlag("shield5")) damage = 0; // 如果存在神圣盾,则将伤害变成0
core.status.hero.hp -= damage;
diff --git a/editor-mobile.html b/editor-mobile.html
index eae04732..70d5f8b0 100644
--- a/editor-mobile.html
+++ b/editor-mobile.html
@@ -24,9 +24,13 @@
-
+
+ 宽
+
+ 高
+
- 保留楼层属性
+ 保留属性
-
+
+
+
+
+
+
@@ -387,50 +401,20 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
diff --git a/editor.html b/editor.html
index 22b17d73..30ce7708 100644
--- a/editor.html
+++ b/editor.html
@@ -23,7 +23,11 @@
-
+
+ 宽
+
+ 高
+
保留楼层属性
@@ -241,7 +245,14 @@
画线
画矩形
-
+
+
+
+
+
+
+
+
@@ -346,11 +357,16 @@
-
+
+
+
+
+
+
@@ -370,36 +386,20 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
diff --git a/index.html b/index.html
index 0f69d24f..7b07028a 100644
--- a/index.html
+++ b/index.html
@@ -87,6 +87,11 @@
+
+
+
+
+
@@ -106,18 +111,22 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+