diff --git a/_docs/personalization.md b/_docs/personalization.md index ac7ff766..356bb46a 100644 --- a/_docs/personalization.md +++ b/_docs/personalization.md @@ -236,7 +236,7 @@ ID必须由数字字母下划线组成,数字在1000以内,且均不能和 除此之外,额外素材在游戏中的使用和正式素材都是一致的,也能在前景或背景图层绘制。 -额外素材可以使用“tileset贴图”的方式进行绘制,一次绘制一个矩形区域。 +额外素材可以使用“tileset平铺”的方式进行绘制,一次绘制一个矩形区域。 “辅助工具”中提供了“额外素材合并”,如果使用此功能,请不要对额外素材进行基于ID、索引和数字的判定和读写等操作,如确有此需求,可以创建一些玩家不可达也不可预览的隐藏样板层,然后用等量代换的办法去从样板层取用。 ## 自定义道具效果 diff --git a/_server/MotaActionParse.js b/_server/MotaActionParse.js index 3a639310..5c9ab9c1 100644 --- a/_server/MotaActionParse.js +++ b/_server/MotaActionParse.js @@ -1022,9 +1022,9 @@ ActionParser.prototype.matchEvalCompare=function(args, isShadow){ // 按优先级依次寻找以下符号 var oplist=['<','<=','>','>=','==','!=','&&','||'].reverse() for (var index = 0,op; op=oplist[index]; index++) { - var match=new RegExp('(?<= )'+(op=='||'?'\\|\\|':op)+'(?= )').exec(str) + var match=new RegExp(' '+(op=='||'?'\\|\\|':op)+' ').exec(str) if (!match) continue; - args=[this.expandEvalBlock([raw.slice(0,match.index)],isShadow),op.replace(/&/g,'&').replace(//g,'>'),this.expandEvalBlock([raw.slice(match.index+op.length)],isShadow)] + args=[this.expandEvalBlock([raw.slice(0,match.index+1)],isShadow),op.replace(/&/g,'&').replace(//g,'>'),this.expandEvalBlock([raw.slice(match.index+1+op.length)],isShadow)] return {ret:true,xml:xml,args:args} } return {ret:false} diff --git a/_server/editor.js b/_server/editor.js index 31d1f954..c2843696 100644 --- a/_server/editor.js +++ b/_server/editor.js @@ -105,6 +105,7 @@ function editor() { // tile tileSize: [1,1], + startLoc: null, lockMode: false, // 最近使用的图块 @@ -282,6 +283,7 @@ editor.prototype.changeFloor = function (floorId, callback) { editor.viewportLoc = editor.viewportLoc || {}; var loc = editor.viewportLoc[floorId] || [], x = loc[0] || 0, y = loc[1] || 0; editor.setViewport(x, y); + editor.uifunctions.unhighlightSaveFloorButton(); editor.config.set('editorLastFloorId', floorId, function() { if (callback) callback(); @@ -682,6 +684,7 @@ editor.prototype.setSelectBoxFromInfo=function(thisevent, scrollTo){ editor.dom.dataSelection.style.left = pos.x * 32 + 'px'; editor.dom.dataSelection.style.top = pos.y * ysize + 'px'; editor.dom.dataSelection.style.height = ysize - 6 + 'px'; + editor.dom.dataSelection.style.width = 32 - 6 + 'px'; setTimeout(function(){ selectBox.isSelected(true); editor.updateLastUsedMap(); diff --git a/_server/editor_listen.js b/_server/editor_listen.js index f5994f4e..7a3b83b1 100644 --- a/_server/editor_listen.js +++ b/_server/editor_listen.js @@ -24,6 +24,8 @@ editor_listen_wrapper = function (editor) { editor.dom.iconExpandBtn.onclick = editor.uifunctions.fold_material_click editor.dom.iconLib.onmousedown = editor.uifunctions.material_ondown + editor.dom.iconLib.onmousemove = editor.uifunctions.material_onmove + editor.dom.iconLib.onmouseup = editor.uifunctions.material_onup editor.dom.iconLib.oncontextmenu = function (e) { e.preventDefault() } editor.dom.extraEvent.onmousedown = editor.uifunctions.extraEvent_click @@ -132,6 +134,14 @@ editor_listen_wrapper = function (editor) { editor.dom.moveLoc.onmousedown = null editor.dom.clearLoc.ontouchstart = editor.dom.clearLoc.onmousedown editor.dom.clearLoc.onmousedown = null + + // 不使用以下6语句, 会使得素材区手机无法拖动, 手机的框选素材只能放弃, 要通过弹框实现框选 + // editor.dom.iconLib.ontouchstart = editor.dom.iconLib.onmousedown + // editor.dom.iconLib.onmousedown = null + // editor.dom.iconLib.ontouchmove = editor.dom.iconLib.onmousemove + // editor.dom.iconLib.onmousemove = null + // editor.dom.iconLib.ontouchend = editor.dom.iconLib.onmouseup + // editor.dom.iconLib.onmouseup = null } editor.constructor.prototype.mode_listen = function (callback) { diff --git a/_server/editor_mappanel.js b/_server/editor_mappanel.js index f6c7687c..f2f850ac 100644 --- a/_server/editor_mappanel.js +++ b/_server/editor_mappanel.js @@ -202,6 +202,7 @@ editor_mappanel_wrapper = function (editor) { editor.exchangeBgFg(editor.uivalues.startPos, editor.uivalues.endPos, editor.layerMod); editor.uivalues.startPos = editor.uivalues.endPos = null; editor.dom.euiCtx.clearRect(0, 0, core.__PIXELS__, core.__PIXELS__); + editor.uifunctions.unhighlightSaveFloorButton(); return false; } editor.uivalues.holdingPath = 0; @@ -239,12 +240,11 @@ editor_mappanel_wrapper = function (editor) { var x0 = editor.uivalues.stepPostfix[0].x; var y0 = editor.uivalues.stepPostfix[0].y; var idnum = editor.info.idnum; + var pmod=function(a,b){return (a%b+b)%b;} for (var ii = 0; ii < editor.uivalues.stepPostfix.length; ii++) { - if (editor.uivalues.stepPostfix[ii].y != y0) { - y0++; - idnum += imgWidth; - } - editor[editor.layerMod][editor.uivalues.stepPostfix[ii].y][editor.uivalues.stepPostfix[ii].x] = editor.ids[editor.indexs[idnum + editor.uivalues.stepPostfix[ii].x - x0]]; + var dx=pmod(editor.uivalues.stepPostfix[ii].x-x0,editor.uivalues.tileSize[0]); + var dy=pmod(editor.uivalues.stepPostfix[ii].y-y0,editor.uivalues.tileSize[1]); + editor[editor.layerMod][editor.uivalues.stepPostfix[ii].y][editor.uivalues.stepPostfix[ii].x] = editor.ids[editor.indexs[idnum + dx+dy*imgWidth]]; } } else { // 检测是否是填充模式 @@ -274,6 +274,7 @@ editor_mappanel_wrapper = function (editor) { editor.uivalues.holdingPath = 0; editor.uivalues.stepPostfix = []; editor.dom.euiCtx.clearRect(0, 0, core.__PIXELS__, core.__PIXELS__); + editor.uifunctions.highlightSaveFloorButton(); } return false; } @@ -465,6 +466,7 @@ editor_mappanel_wrapper = function (editor) { editor.drawEventBlock(); editor_mode.showMode('loc'); printf('添加楼梯事件成功'); + editor.uifunctions.unhighlightSaveFloorButton(); }); return true; } @@ -525,6 +527,7 @@ editor_mappanel_wrapper = function (editor) { editor.drawPosSelection(); editor_mode.showMode('loc'); printf('绑定机关门事件成功'); + editor.uifunctions.unhighlightSaveFloorButton(); }); bindSpecialDoor.loc = null; bindSpecialDoor.enemys = []; @@ -577,6 +580,7 @@ editor_mappanel_wrapper = function (editor) { throw (err) } ; printf('复制事件成功'); + editor.uifunctions.unhighlightSaveFloorButton(); editor.drawPosSelection(); }); } @@ -591,6 +595,7 @@ editor_mappanel_wrapper = function (editor) { editor.savePreMap(); editor_mode.onmode(''); editor.exchangePos(editor.pos, editor.uivalues.lastRightButtonPos[1]); + editor.uifunctions.unhighlightSaveFloorButton(); } /** @@ -600,6 +605,7 @@ editor_mappanel_wrapper = function (editor) { editor.uifunctions.clearEvent_click = function (e) { e.stopPropagation(); editor.clearPos(false); + editor.uifunctions.unhighlightSaveFloorButton(); } /** @@ -609,6 +615,7 @@ editor_mappanel_wrapper = function (editor) { editor.uifunctions.clearLoc_click = function (e) { e.stopPropagation(); editor.clearPos(true); + editor.uifunctions.unhighlightSaveFloorButton(); } /** @@ -647,13 +654,13 @@ editor_mappanel_wrapper = function (editor) { * 切换画笔模式 */ editor.uifunctions.brushMod3_onchange = function () { - if (!editor.config.get('alertTileMode') && - !confirm("从V2.6.6开始,tileset贴图模式已被废弃。\n请右键额外素材,并输入所需要绘制的宽高,然后单击地图以绘制一个区域。\n\n点取消将不再显示此提示。")) { - editor.config.set('alertTileMode', true); + if (!editor.config.get('alertTileModeV2.7') && + !confirm("从V2.7开始,请直接素材区拖框进行绘制区域。\n\n点取消将不再显示此提示。")) { + editor.config.set('alertTileModeV2.7', true); } // tip.showHelp(5) tip.isSelectedBlock(false) - tip.msgs[11] = String('tileset贴图模式下可以按选中tileset素材,并在地图上拖动来一次绘制一个区域'); + tip.msgs[11] = String('tileset平铺模式下可以按选中tileset素材,并在地图上拖动来一次绘制一个区域'); tip.whichShow(12); editor.brushMod = editor.dom.brushMod3.value; } @@ -765,6 +772,15 @@ editor_mappanel_wrapper = function (editor) { }); } + editor.uifunctions.highlightSaveFloorButton=function(){ + var saveFloor = document.getElementById('saveFloor'); + saveFloor.style.background='#FFCCAA'; + } + + editor.uifunctions.unhighlightSaveFloorButton=function(){ + var saveFloor = document.getElementById('saveFloor'); + saveFloor.style.background=''; + } editor.uifunctions.saveFloor_func = function () { var saveFloor = document.getElementById('saveFloor'); @@ -776,6 +792,7 @@ editor_mappanel_wrapper = function (editor) { throw (err) } ; printf('保存成功'); + editor.uifunctions.unhighlightSaveFloorButton() }); } saveFloor.onclick = editor_mode.saveFloor; diff --git a/_server/editor_materialpanel.js b/_server/editor_materialpanel.js index 51752b9c..8a6704fa 100644 --- a/_server/editor_materialpanel.js +++ b/_server/editor_materialpanel.js @@ -62,13 +62,54 @@ editor_materialpanel_wrapper = function (editor) { } } + var lastmoveE=null; /** * editor.dom.iconLib.onmousedown - * 素材区的单击事件 + * 素材区的单击/拖拽事件 */ editor.uifunctions.material_ondown = function (e) { e.stopPropagation(); e.preventDefault(); + lastmoveE=e; + if (!editor.isMobile && e.clientY >= editor.dom.iconLib.offsetHeight - editor.uivalues.scrollBarHeight) return; + var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft; + var scrollTop = document.documentElement.scrollTop || document.body.scrollTop; + editor.uivalues.startLoc={ + 'x': scrollLeft + e.clientX + editor.dom.iconLib.scrollLeft - right.offsetLeft - editor.dom.iconLib.offsetLeft, + 'y': scrollTop + e.clientY + editor.dom.iconLib.scrollTop - right.offsetTop - editor.dom.iconLib.offsetTop, + 'px': e.clientX, + 'py': e.clientY, + 'size': 32 + }; + } + + /** + * editor.dom.iconLib.onmousemove + * 素材区的单击/拖拽事件 + */ + editor.uifunctions.material_onmove = function (e) { + e.stopPropagation(); + e.preventDefault(); + lastmoveE=e; + if (!editor.uivalues.startLoc) return; + var pos0 = editor.uifunctions.locToPos(editor.uivalues.startLoc); + + editor.dom.dataSelection.style.left = 32 * pos0.x + 'px'; + editor.dom.dataSelection.style.top = 32 * pos0.y + 'px'; + editor.dom.dataSelection.style.width = e.clientX - editor.uivalues.startLoc.px + 'px'; + editor.dom.dataSelection.style.height = e.clientY - editor.uivalues.startLoc.py + 'px'; + editor.dom.dataSelection.style.display = 'block'; + } + + /** + * editor.dom.iconLib.onmouseup + * 素材区的单击/拖拽事件 + */ + editor.uifunctions.material_onup = function (ee) { + var startLoc = editor.uivalues.startLoc; + editor.uivalues.startLoc = null; + + var e=lastmoveE; if (!editor.isMobile && e.clientY >= editor.dom.iconLib.offsetHeight - editor.uivalues.scrollBarHeight) return; var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft; var scrollTop = document.documentElement.scrollTop || document.body.scrollTop; @@ -79,6 +120,7 @@ editor_materialpanel_wrapper = function (editor) { }; editor.loc = loc; editor.uivalues.tileSize = [1,1]; + var pos0 = editor.uifunctions.locToPos(startLoc); var pos = editor.uifunctions.locToPos(loc); for (var spriter in editor.widthsX) { if (pos.x >= editor.widthsX[spriter][1] && pos.x < editor.widthsX[spriter][2]) { @@ -115,6 +157,7 @@ editor_materialpanel_wrapper = function (editor) { editor.dom.dataSelection.style.left = pos.x * 32 + 'px'; editor.dom.dataSelection.style.top = pos.y * ysize + 'px'; editor.dom.dataSelection.style.height = ysize - 6 + 'px'; + editor.dom.dataSelection.style.width = 32 - 6 + 'px'; if (pos.x == 0 && pos.y == 0) { // editor.info={idnum:0, id:'empty','images':'清除块', 'y':0}; @@ -133,21 +176,24 @@ editor_materialpanel_wrapper = function (editor) { editor.info = { 'images': pos.images, 'y': y } } - for (var ii = 0; ii < editor.ids.length; ii++) { - if ((core.tilesets.indexOf(pos.images) != -1 && editor.info.images == editor.ids[ii].images - && editor.info.y == editor.ids[ii].y && editor.info.x == editor.ids[ii].x) - || (Object.prototype.hasOwnProperty.call(autotiles, pos.images) && editor.info.images == editor.ids[ii].id - && editor.info.y == editor.ids[ii].y) - || (core.tilesets.indexOf(pos.images) == -1 && editor.info.images == editor.ids[ii].images - && editor.info.y == editor.ids[ii].y) + for (var idindex = 0; idindex < editor.ids.length; idindex++) { + if ((core.tilesets.indexOf(pos.images) != -1 && editor.info.images == editor.ids[idindex].images + && editor.info.y == editor.ids[idindex].y && editor.info.x == editor.ids[idindex].x) + || (Object.prototype.hasOwnProperty.call(autotiles, pos.images) && editor.info.images == editor.ids[idindex].id + && editor.info.y == editor.ids[idindex].y) + || (core.tilesets.indexOf(pos.images) == -1 && editor.info.images == editor.ids[idindex].images + && editor.info.y == editor.ids[idindex].y) ) { - editor.info = editor.ids[ii]; + editor.info = editor.ids[idindex]; break; } } - if (editor.info.isTile && e.button == 2) { + if (editor.info.isTile && e.button == 2) { //这段改一改之类的应该能给手机用,就不删了 + // 废弃好了 + alert('V2.7后右键已被废弃,请直接素材区拖框选中区域。'); + /* var v = prompt("请输入该额外素材区域绑定宽高,以逗号分隔", "1,1"); if (v != null && /^\d+,\d+$/.test(v)) { v = v.split(","); @@ -157,8 +203,31 @@ editor_materialpanel_wrapper = function (editor) { alert("不合法的输入范围,已经越界"); } else { editor.uivalues.tileSize = [x, y]; + editor.dom.dataSelection.style.left = pos.x * 32 + 'px'; + editor.dom.dataSelection.style.top = pos.y * ysize + 'px'; + editor.dom.dataSelection.style.height = ysize*y - 6 + 'px'; + editor.dom.dataSelection.style.width = 32*x - 6 + 'px'; } } + */ + } + if (editor.info.isTile && e.button != 2) { //左键拖拽框选 + + var x = pos.x-pos0.x+1, y = pos.y-pos0.y+1; + var widthX = editor.widthsX[editor.info.images]; + // 懒得仔细处理了, 只允许左上往右下拉 + if (x <= 0 || y <= 0 || pos0.x < widthX[1]){ + + } else { + editor.info = editor.ids[idindex-(x-1)-(y-1)*(widthX[2]-widthX[1])]; + editor.uifunctions.locToPos(startLoc); //重置editor.pos + editor.uivalues.tileSize = [x, y]; + editor.dom.dataSelection.style.left = pos0.x * 32 + 'px'; + editor.dom.dataSelection.style.top = pos0.y * ysize + 'px'; + editor.dom.dataSelection.style.height = ysize*y - 6 + 'px'; + editor.dom.dataSelection.style.width = 32*x - 6 + 'px'; + } + } } diff --git a/_server/editor_ui.js b/_server/editor_ui.js index cc9588ed..3d528f20 100644 --- a/_server/editor_ui.js +++ b/_server/editor_ui.js @@ -30,7 +30,7 @@ editor_ui_wrapper = function (editor) { '双击事件编辑器的图块可以进行长文本编辑/脚本编辑/地图选点/UI绘制预览等操作', 'ESC或点击空白处可以自动保存当前修改', 'H键可以打开操作帮助哦', - 'tileset贴图模式可以在地图上拖动来一次绘制一个区域;右键额外素材也可以绑定宽高', + 'tileset平铺模式可以在地图上拖动来平铺框选的图形', '可以拖动地图上的图块和事件,或按Ctrl+C, Ctrl+X和Ctrl+V进行复制,剪切和粘贴,Delete删除', 'Alt+数字键保存图块,数字键读取保存的图块', ]; @@ -236,6 +236,7 @@ editor_ui_wrapper = function (editor) { throw (err) } ; printf('地图保存成功'); + editor.uifunctions.unhighlightSaveFloorButton(); }); } selectBox.isSelected(false); @@ -318,6 +319,7 @@ editor_ui_wrapper = function (editor) { editor.bgmap = JSON.parse(JSON.stringify(data.bgmap)); editor.updateMap(); editor.uivalues.postMapData.push(data); + editor.uifunctions.highlightSaveFloorButton(); printf("已撤销此操作,你可能需要重新保存地图。"); } return; @@ -332,6 +334,7 @@ editor_ui_wrapper = function (editor) { editor.bgmap = JSON.parse(JSON.stringify(data.bgmap)); editor.updateMap(); editor.uivalues.preMapData.push(data); + editor.uifunctions.highlightSaveFloorButton(); printf("已重做此操作,你可能需要重新保存地图。"); } return; @@ -349,6 +352,7 @@ editor_ui_wrapper = function (editor) { editor.uivalues.copyedInfo = editor.copyFromPos(); editor.clearPos(true, null, function () { printf('该点事件已剪切'); + editor.uifunctions.unhighlightSaveFloorButton(); }) return; } @@ -366,6 +370,7 @@ editor_ui_wrapper = function (editor) { throw (err) } ; printf('粘贴事件成功'); + editor.uifunctions.unhighlightSaveFloorButton(); editor.drawPosSelection(); }); return; @@ -373,6 +378,7 @@ editor_ui_wrapper = function (editor) { // DELETE if (e.keyCode == 46 && !selectBox.isSelected()) { editor.clearPos(true); + editor.uifunctions.unhighlightSaveFloorButton(); return; } // ESC diff --git a/_server/table/plugins.comment.js b/_server/table/plugins.comment.js index f012cdc1..059b7e5d 100644 --- a/_server/table/plugins.comment.js +++ b/_server/table/plugins.comment.js @@ -26,6 +26,12 @@ var plugins_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "_range": "typeof(thiseval)=='string' || thiseval==null", "_data": "灯光效果" }, + "removeMap": { + "_leaf": true, + "_type": "textarea", + "_range": "typeof(thiseval)=='string' || thiseval==null", + "_data": "砍层插件" + }, "itemShop": { "_leaf": true, "_type": "textarea", diff --git a/editor-mobile.html b/editor-mobile.html index df00077d..8bc87798 100644 --- a/editor-mobile.html +++ b/editor-mobile.html @@ -386,7 +386,7 @@ 线 矩形 - tileset贴图 + tileset平铺 填充 diff --git a/libs/actions.js b/libs/actions.js index 0a9ed824..a05d286a 100644 --- a/libs/actions.js +++ b/libs/actions.js @@ -1919,7 +1919,7 @@ actions.prototype._clickSwitchs = function (x, y) { var topIndex = this.HSIZE - parseInt((choices.length - 1) / 2) + (core.status.event.ui.offset || 0); var selection = y - topIndex; if (x < this.CHOICES_LEFT || x > this.CHOICES_RIGHT) { - if (selection != 2 && selection != 3 && selection != 4) return; + if (selection != 1 && selection != 2 && selection != 3 && selection != 4) return; } var width = choices[selection].width; var leftPos = (core.__PIXELS__ - width) / 2, rightPos = (core.__PIXELS__ + width) / 2; @@ -1928,32 +1928,32 @@ actions.prototype._clickSwitchs = function (x, y) { core.status.event.selection = selection; switch (selection) { case 0: - return this._clickSwitchs_bgm(); + return this._clickSwitchs_bgmSound(); case 1: - return this._clickSwitchs_sound(); - case 2: if (x == leftGrid || x == leftGrid + 1) return this._clickSwitchs_userVolume(-1); if (x == rightGrid || x == rightGrid + 1) return this._clickSwitchs_userVolume(1); return; - case 3: + case 2: if (x == leftGrid || x == leftGrid + 1) return this._clickSwitchs_moveSpeed(-10); if (x == rightGrid || x == rightGrid + 1) return this._clickSwitchs_moveSpeed(10); return; - case 4: + case 3: if (x == leftGrid || x == leftGrid + 1) return this._clickSwitchs_floorChangeTime(-100); if (x == rightGrid || x == rightGrid + 1) return this._clickSwitchs_floorChangeTime(100); return; + case 4: + if (x == leftGrid || x == leftGrid + 1) return this._clickSwitchs_setSize(-1); + if (x == rightGrid || x == rightGrid + 1) return this._clickSwitchs_setSize(1); + return; case 5: return this._clickSwitchs_displayEnemyDamage(); case 6: - return this._clickSwitchs_displayCritical(); + return this._clickSwitchs_displayCriticalExtra(); case 7: - return this._clickSwitchs_displayExtraDamage(); - case 8: return this._clickSwitchs_potionNoRouting(); - case 9: + case 8: return this._clickSwitchs_clickMove(); - case 10: + case 9: core.status.event.selection = 0; core.ui.drawSettings(); break; @@ -1961,13 +1961,23 @@ actions.prototype._clickSwitchs = function (x, y) { } } -actions.prototype._clickSwitchs_bgm = function () { - core.triggerBgm(); - core.ui.drawSwitchs(); -} - -actions.prototype._clickSwitchs_sound = function () { - core.musicStatus.soundStatus = !core.musicStatus.soundStatus; +actions.prototype._clickSwitchs_bgmSound = function () { + var bgm = core.musicStatus.bgmStatus; + var sound = core.musicStatus.soundStatus; + if (bgm && sound) { + sound = false; + } else if (bgm && !sound) { + bgm = false; + sound = true; + } else if (!bgm && sound) { + sound = false; + } else { + bgm = true; + sound = true; + } + if (bgm != core.musicStatus.bgmStatus) + core.triggerBgm(); + core.musicStatus.soundStatus = sound; core.setLocalStorage('soundStatus', core.musicStatus.soundStatus); core.ui.drawSwitchs(); } @@ -1995,6 +2005,17 @@ actions.prototype._clickSwitchs_floorChangeTime = function (delta) { core.ui.drawSwitchs(); } +actions.prototype._clickSwitchs_setSize = function (delta) { + var index = core.domStyle.availableScale.indexOf(core.domStyle.scale); + if (index < 0) return; + index += delta; + if (index < 0 || index >= core.domStyle.availableScale.length); + core.domStyle.scale = core.domStyle.availableScale[index]; + core.setLocalStorage('scale', core.domStyle.scale); + core.resize(); + core.ui.drawSwitchs(); +} + actions.prototype._clickSwitchs_displayEnemyDamage = function () { core.flags.displayEnemyDamage = !core.flags.displayEnemyDamage; core.updateDamage(); @@ -2002,16 +2023,26 @@ actions.prototype._clickSwitchs_displayEnemyDamage = function () { core.ui.drawSwitchs(); } -actions.prototype._clickSwitchs_displayCritical = function () { - core.flags.displayCritical = !core.flags.displayCritical; +actions.prototype._clickSwitchs_displayCriticalExtra = function () { + var critical = core.flags.displayCritical; + var extra = core.flags.displayExtraDamage; + if (critical && extra) { + extra = false; + } else if (critical && !extra) { + critical = false; + extra = true; + } else if (!critical && extra) { + critical = false; + extra = false; + } else { + critical = true; + extra = true; + } + + core.flags.displayCritical = critical; + core.flags.displayExtraDamage = extra; core.updateDamage(); core.setLocalStorage('critical', core.flags.displayCritical); - core.ui.drawSwitchs(); -} - -actions.prototype._clickSwitchs_displayExtraDamage = function () { - core.flags.displayExtraDamage = !core.flags.displayExtraDamage; - core.updateDamage(); core.setLocalStorage('extraDamage', core.flags.displayExtraDamage); core.ui.drawSwitchs(); } diff --git a/libs/control.js b/libs/control.js index 2007912a..5b6602c1 100644 --- a/libs/control.js +++ b/libs/control.js @@ -2683,17 +2683,28 @@ control.prototype._doResize = function (obj) { control.prototype.resize = function() { if (main.mode=='editor')return; var clientWidth = main.dom.body.clientWidth, clientHeight = main.dom.body.clientHeight; - var CANVAS_WIDTH = core.__PIXELS__ + 6, BAR_WIDTH = Math.round(core.__PIXELS__ * 0.31) + 3; + var CANVAS_WIDTH = core.__PIXELS__, BAR_WIDTH = Math.round(core.__PIXELS__ * 0.31); + var BORDER = 3; - if (clientWidth >= CANVAS_WIDTH + BAR_WIDTH || (clientWidth > clientHeight && clientHeight < CANVAS_WIDTH)) { + if (clientWidth - 3 * BORDER >= CANVAS_WIDTH + BAR_WIDTH || (clientWidth > clientHeight && clientHeight - 2 * BORDER < CANVAS_WIDTH)) { // 横屏 core.domStyle.isVertical = false; - core.domStyle.scale = Math.min(1, clientHeight / CANVAS_WIDTH); + + core.domStyle.availableScale = []; + [1, 1.25, 1.5, 2].forEach(function (v) { + if (clientWidth - 3 * BORDER >= v*(CANVAS_WIDTH + BAR_WIDTH) && clientHeight - 2 * BORDER >= v * CANVAS_WIDTH) { + core.domStyle.availableScale.push(v); // 64x64 + } + }); + if (core.domStyle.availableScale.indexOf(core.domStyle.scale) < 0) { + core.domStyle.scale = Math.min(1, (clientHeight - 2 * BORDER) / CANVAS_WIDTH); + } } else { // 竖屏 core.domStyle.isVertical = true; - core.domStyle.scale = Math.min(1, clientWidth / CANVAS_WIDTH); + core.domStyle.scale = Math.min(1, (clientWidth - 2 * BORDER) / CANVAS_WIDTH); + core.domStyle.availableScale = []; } var statusDisplayArr = this._shouldDisplayStatus(), count = statusDisplayArr.length; @@ -2709,15 +2720,16 @@ control.prototype.resize = function() { clientWidth: clientWidth, clientHeight: clientHeight, CANVAS_WIDTH: CANVAS_WIDTH, + BORDER: BORDER, BAR_WIDTH: BAR_WIDTH, - outerSize: CANVAS_WIDTH * core.domStyle.scale, + outerSize: CANVAS_WIDTH * core.domStyle.scale + 2 * BORDER, globalAttribute: globalAttribute, border: '3px ' + globalAttribute.borderColor + ' solid', statusDisplayArr: statusDisplayArr, count: count, col: col, - statusBarHeightInVertical: core.domStyle.isVertical ? (32 * col + 6) * core.domStyle.scale + 6 : 0, - toolbarHeightInVertical: core.domStyle.isVertical ? 44 * core.domStyle.scale + 6 : 0, + statusBarHeightInVertical: core.domStyle.isVertical ? (32 * col + 6) * core.domStyle.scale + 2 * BORDER : 0, + toolbarHeightInVertical: core.domStyle.isVertical ? 44 * core.domStyle.scale + 2 * BORDER : 0, is15x15: core.__SIZE__ == 15 }; @@ -2734,7 +2746,7 @@ control.prototype._resize_gameGroup = function (obj) { totalHeight = obj.outerSize + obj.statusBarHeightInVertical + obj.toolbarHeightInVertical } else { - totalWidth = (obj.CANVAS_WIDTH + obj.BAR_WIDTH) * core.domStyle.scale; + totalWidth = obj.outerSize + obj.BAR_WIDTH * core.domStyle.scale + obj.BORDER; totalHeight = obj.outerSize; } gameGroup.style.width = totalWidth + "px"; @@ -2743,8 +2755,8 @@ control.prototype._resize_gameGroup = function (obj) { gameGroup.style.top = (obj.clientHeight - totalHeight) / 2 + "px"; // floorMsgGroup var floorMsgGroup = core.dom.floorMsgGroup; - floorMsgGroup.style.width = obj.outerSize - 6 + "px"; - floorMsgGroup.style.height = totalHeight - 6 + "px"; + floorMsgGroup.style.width = obj.outerSize - 2 * obj.BORDER + "px"; + floorMsgGroup.style.height = totalHeight - 2 * obj.BORDER + "px"; floorMsgGroup.style.background = obj.globalAttribute.floorChangingBackground; floorMsgGroup.style.color = obj.globalAttribute.floorChangingTextColor; // musicBtn @@ -2758,7 +2770,7 @@ control.prototype._resize_gameGroup = function (obj) { } control.prototype._resize_canvas = function (obj) { - var innerSize = (obj.outerSize - 6) + "px"; + var innerSize = (obj.CANVAS_WIDTH * core.domStyle.scale) + "px"; for (var i = 0; i < core.dom.gameCanvas.length; ++i) core.dom.gameCanvas[i].style.width = core.dom.gameCanvas[i].style.height = innerSize; core.dom.gif.style.width = core.dom.gif.style.height = innerSize; @@ -2783,8 +2795,6 @@ control.prototype._resize_canvas = function (obj) { // resize next main.dom.next.style.width = main.dom.next.style.height = 5 * core.domStyle.scale + "px"; main.dom.next.style.borderBottomWidth = main.dom.next.style.borderRightWidth = 4 * core.domStyle.scale + "px"; - - } control.prototype._resize_statusBar = function (obj) { @@ -2797,7 +2807,7 @@ control.prototype._resize_statusBar = function (obj) { statusBar.style.fontSize = 16 * core.domStyle.scale + "px"; } else { - statusBar.style.width = obj.BAR_WIDTH * core.domStyle.scale + "px"; + statusBar.style.width = (obj.BAR_WIDTH * core.domStyle.scale + obj.BORDER) + "px"; statusBar.style.height = obj.outerSize + "px"; statusBar.style.background = obj.globalAttribute.statusLeftBackground; // --- 计算文字大小 @@ -2809,22 +2819,22 @@ control.prototype._resize_statusBar = function (obj) { statusBar.style.borderBottom = core.domStyle.isVertical ? '' : obj.border; // 自绘状态栏 if (core.domStyle.isVertical) { - core.dom.statusCanvas.style.width = obj.outerSize - 6 + "px"; - core.dom.statusCanvas.width = core.__PIXELS__; + core.dom.statusCanvas.style.width = obj.CANVAS_WIDTH + "px"; + core.dom.statusCanvas.width = obj.CANVAS_WIDTH; core.dom.statusCanvas.style.height = obj.statusBarHeightInVertical - 3 + "px"; core.dom.statusCanvas.height = obj.col * 32 + 9; } else { - core.dom.statusCanvas.style.width = obj.BAR_WIDTH * core.domStyle.scale - 3 + "px"; - core.dom.statusCanvas.width = obj.BAR_WIDTH - 3; - core.dom.statusCanvas.style.height = obj.outerSize - 6 + "px"; - core.dom.statusCanvas.height = core.__PIXELS__; + core.dom.statusCanvas.style.width = obj.BAR_WIDTH * core.domStyle.scale + "px"; + core.dom.statusCanvas.width = obj.BAR_WIDTH; + core.dom.statusCanvas.style.height = obj.outerSize - 2 * obj.BORDER + "px"; + core.dom.statusCanvas.height = obj.CANVAS_WIDTH; } core.dom.statusCanvas.style.display = core.flags.statusCanvas ? "block" : "none"; } control.prototype._resize_status = function (obj) { - var statusHeight = (core.domStyle.isVertical ? 1 : (core.__HALF_SIZE__ + 3) / obj.count) * 32 * core.domStyle.scale * 0.8; + var statusHeight = (core.domStyle.isVertical ? 1 : (core.__HALF_SIZE__ + obj.BORDER) / obj.count) * 32 * core.domStyle.scale * 0.8; // status for (var i = 0; i < core.dom.status.length; ++i) { var id = core.dom.status[i].id, style = core.dom.status[i].style; @@ -2832,7 +2842,7 @@ control.prototype._resize_status = function (obj) { style.display = core.flags.statusCanvas || obj.statusDisplayArr.indexOf(id) < 0 ? 'none': 'block'; style.margin = 3 * core.domStyle.scale + "px"; style.height = statusHeight + "px"; - style.maxWidth = obj.BAR_WIDTH * core.domStyle.scale * (core.domStyle.isVertical ? 0.95 : 1) + "px"; + style.maxWidth = obj.BAR_WIDTH * core.domStyle.scale * (core.domStyle.isVertical ? 0.95 : 1) + obj.BORDER + "px"; if (obj.is15x15 && !core.domStyle.isVertical) style.marginLeft = 11 * core.domStyle.scale + "px"; } @@ -2864,7 +2874,7 @@ control.prototype._resize_toolBar = function (obj) { toolBar.style.background = obj.globalAttribute.toolsBackground; } else { - toolBar.style.width = obj.BAR_WIDTH * core.domStyle.scale + "px"; + toolBar.style.width = obj.BAR_WIDTH * core.domStyle.scale + obj.BORDER + "px"; toolBar.style.top = 0.718 * obj.outerSize + "px"; toolBar.style.height = 0.281 * obj.outerSize + "px"; toolBar.style.background = 'transparent'; diff --git a/libs/core.js b/libs/core.js index dc5ee70d..de495399 100644 --- a/libs/core.js +++ b/libs/core.js @@ -84,6 +84,7 @@ function core() { // 样式 this.domStyle = { scale: 1.0, + availableScale: [], isVertical: false, showStatusBar: true, toolbarBtn: false, @@ -291,6 +292,12 @@ core.prototype._init_sys_flags = function () { // 行走速度 core.values.moveSpeed = core.getLocalStorage('moveSpeed', 100); core.values.floorChangeTime = core.getLocalStorage('floorChangeTime', 500); + if (main.mode != 'editor') { + core.domStyle.scale = core.getLocalStorage('scale', 1); + if (core.domStyle.scale != 1) { + core.resize(); + } + } } core.prototype._init_platform = function () { diff --git a/libs/events.js b/libs/events.js index 3e2e46f6..6fa74489 100644 --- a/libs/events.js +++ b/libs/events.js @@ -2067,7 +2067,7 @@ events.prototype._action_wait = function (data, x, y, prefix) { } else if (data.timeout) { core.status.event.interval = setTimeout(function() { core.status.route.push("input:none"); - core.removeFlag("type"); + core.setFlag("type", -1); core.doAction(); }, data.timeout); } diff --git a/libs/maps.js b/libs/maps.js index a2477497..9254a1cc 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -42,6 +42,10 @@ maps.prototype.loadFloor = function (floorId, map) { if (notCopy.indexOf(name) == -1 && map[name] != null) content[name] = core.clone(map[name]); } + if (map.deleted) { + content['blocks'] = []; + return content; + } map = this.decompressMap(map.map, floorId); // 事件处理 content['blocks'] = this._mapIntoBlocks(map, floor, floorId); @@ -267,7 +271,7 @@ maps.prototype.saveMap = function (floorId) { } // 砍层状态:直接返回 if (main.mode == 'play' && (flags.__removed__ || []).indexOf(floorId) >= 0) { - return { canFlyTo: false, cannotViewMap: true }; + return { deleted: true, canFlyTo: false, cannotViewMap: true }; } var map = maps[floorId], floor = core.floors[floorId]; @@ -305,23 +309,6 @@ maps.prototype.loadMap = function (data, floorId) { return this.loadFloor(floorId, data[floorId]); } -////// 删除地图,不计入存档 ////// -maps.prototype.removeMaps = function (fromId, toId) { - if (!core.isPlaying()) return; - toId = toId || fromId; - var fromIndex = core.floorIds.indexOf(fromId), - toIndex = core.floorIds.indexOf(toId); - if (toIndex < 0) toIndex = core.floorIds.length - 1; - flags.__removed__ = flags.__removed__ || []; - for (var i = fromIndex; i <= toIndex; ++i) { - var floorId = core.floorIds[i]; - delete flags.__visited__[floorId]; - flags.__removed__.push(floorId); - core.status.maps[floorId].canFlyTo = false; - core.status.maps[floorId].cannotViewMap = true; - } -} - ////// 更改地图画布的尺寸 maps.prototype.resizeMap = function (floorId) { floorId = floorId || core.status.floorId; diff --git a/libs/ui.js b/libs/ui.js index 690f9984..79836eee 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -1655,16 +1655,15 @@ ui.prototype.drawWaiting = function(text) { ui.prototype.drawSwitchs = function() { core.status.event.id = 'switchs'; var choices = [ - "背景音乐: "+(core.musicStatus.bgmStatus ? "[ON]" : "[OFF]"), - "背景音效: "+(core.musicStatus.soundStatus ? "[ON]" : "[OFF]"), + "音乐/音效: "+(core.musicStatus.bgmStatus ? "[ON]" : "[OFF]") + " "+(core.musicStatus.soundStatus ? "[ON]" : "[OFF]"), //显示为 0~10 十挡 " < 音量:" + Math.round(Math.sqrt(100 * core.musicStatus.userVolume)) + " > ", //数值越大耗时越长 " < 步时:" + core.values.moveSpeed + " > ", " < 转场:" + core.values.floorChangeTime + " > ", + " < 放缩:" + Math.max(core.domStyle.scale, 1) + "x > ", "怪物显伤: "+(core.flags.displayEnemyDamage ? "[ON]" : "[OFF]"), - "临界显伤: "+(core.flags.displayCritical ? "[ON]" : "[OFF]"), - "领域显伤: "+(core.flags.displayExtraDamage ? "[ON]" : "[OFF]"), + "临界/领域: "+(core.flags.displayCritical ? "[ON]" : "[OFF]")+" "+(core.flags.displayExtraDamage ? "[ON]" : "[OFF]"), "血瓶绕路: "+(core.hasFlag('__potionNoRouting__') ? "[ON]":"[OFF]"), "单击瞬移: "+(!core.hasFlag("__noClickMove__") ? "[ON]":"[OFF]"), "返回主菜单" diff --git a/project/enemys.js b/project/enemys.js index c3de9b33..cf035ecf 100644 --- a/project/enemys.js +++ b/project/enemys.js @@ -1,84 +1,84 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 = { - "greenSlime": {"name":"绿头怪","hp":100,"atk":120,"def":0,"money":1,"experience":1,"point":0,"special":[1,5,7,8]}, - "redSlime": {"name":"红头怪","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":[16,18],"value":10}, - "blackSlime": {"name":"青头怪","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "slimelord": {"name":"怪王","hp":100,"atk":120,"def":0,"money":10,"experience":0,"point":0,"special":[1,9]}, - "bat": {"name":"小蝙蝠","hp":100,"atk":120,"def":0,"money":2,"experience":0,"point":0,"special":1}, - "bigBat": {"name":"大蝙蝠","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "redBat": {"name":"红蝙蝠","hp":100,"atk":120,"def":0,"money":5,"experience":0,"point":0,"special":4}, - "vampire": {"name":"冥灵魔王","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "skeleton": {"name":"骷髅人","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "skeletonCaptain": {"name":"骷髅队长","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "zombie": {"name":"兽人","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "zombieKnight": {"name":"兽人武士","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "rock": {"name":"石头人","hp":100,"atk":120,"def":0,"money":4,"experience":0,"point":0,"special":3}, - "bluePriest": {"name":"初级法师","hp":100,"atk":120,"def":0,"money":3,"experience":0,"point":1,"special":2}, - "redPriest": {"name":"高级法师","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "brownWizard": {"name":"初级巫师","hp":100,"atk":120,"def":0,"money":16,"experience":0,"point":0,"special":15,"value":100,"range":2}, - "redWizard": {"name":"高级巫师","hp":1000,"atk":1200,"def":0,"money":160,"experience":0,"point":0,"special":15,"value":200,"zoneSquare":true}, - "swordsman": {"name":"双手剑士","hp":100,"atk":120,"def":0,"money":6,"experience":0,"point":0,"special":[5,23]}, - "soldier": {"name":"冥战士","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "yellowKnight": {"name":"金骑士","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "redKnight": {"name":"红骑士","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "darkKnight": {"name":"黑骑士","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "blueKnight": {"name":"蓝骑士","hp":100,"atk":120,"def":0,"money":9,"experience":0,"point":0,"special":8}, - "goldSlime": {"name":"黄头怪","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "poisonSkeleton": {"name":"紫骷髅","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "poisonBat": {"name":"紫蝙蝠","hp":100,"atk":120,"def":0,"money":14,"experience":0,"point":0,"special":13}, - "skeletonPriest": {"name":"骷髅法师","hp":100,"atk":100,"def":0,"money":0,"experience":0,"point":0,"special":18,"value":20}, - "skeletonKing": {"name":"骷髅王","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "evilHero": {"name":"迷失勇者","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "demonPriest": {"name":"魔神法师","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "goldHornSlime": {"name":"金角怪","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "silverSlime": {"name":"银头怪","hp":100,"atk":120,"def":0,"money":15,"experience":0,"point":0,"special":14}, - "whiteHornSlime": {"name":"尖角怪","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "redSwordsman": {"name":"剑王","hp":100,"atk":120,"def":0,"money":7,"experience":0,"point":0,"special":6,"n":8}, - "poisonZombie": {"name":"绿兽人","hp":100,"atk":120,"def":0,"money":13,"experience":0,"point":0,"special":12}, - "octopus": {"name":"血影","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "princessEnemy": {"name":"假公主","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "angel": {"name":"天使","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "elemental": {"name":"元素生物","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "steelGuard": {"name":"铁守卫","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":18,"value":20}, - "evilBat": {"name":"邪恶蝙蝠","hp":1000,"atk":1,"def":0,"money":0,"experience":0,"point":0,"special":[2,3]}, - "frozenSkeleton": {"name":"冻死骨","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "silverSlimelord": {"name":"银怪王","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "goldSlimelord": {"name":"金怪王","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "skeletonWarrior": {"name":"骷髅士兵","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "ghostWarrior": {"name":"冥队长","hp":100,"atk":120,"def":0,"money":8,"experience":0,"point":0,"special":7}, - "whiteSlimeman": {"name":"水银战士","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "slimeman": {"name":"影子战士","hp":100,"atk":0,"def":0,"money":11,"experience":0,"point":0,"special":[10,21],"atkValue":2,"defValue":3}, - "yellowGT": {"name":"初级卫兵","hp":100,"atk":120,"def":0,"money":10,"experience":0,"point":0,"special":0}, - "blueGT": {"name":"中级卫兵","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "redGT": {"name":"高级卫兵","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "blackMS": {"name":"黑衣魔王","hp":1000,"atk":500,"def":0,"money":1000,"experience":1000,"point":0,"special":0,"notBomb":true}, - "yellowMS": {"name":"黄衣魔王","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "greenMS": {"name":"青衣武士","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "magicMaster": {"name":"黑暗大法师","hp":100,"atk":120,"def":0,"money":12,"experience":0,"point":0,"special":11,"value":0.3333333333333333,"add":true,"notBomb":true}, - "blueMS": {"name":"白衣武士","hp":100,"atk":120,"def":0,"money":17,"experience":0,"point":0,"special":16}, - "redMS": {"name":"红衣魔王","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "devilWarrior": {"name":"魔神武士","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "fairyEnemy": {"name":"仙子","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "dragon": {"name":"魔龙","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "skeletonKnight": {"name":"骷髅武士","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "skeletonPresbyter": {"name":"骷髅巫师","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "ironRock": {"name":"铁面人","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "grayRock": {"name":"灰色石头人","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "yellowPriest": {"name":"中级法师","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "evilPrincess": {"name":"痛苦魔女","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "blademaster": {"name":"剑圣","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "evilFairy": {"name":"黑暗仙子","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "blueRock": {"name":"鬼邪石","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "skeletonLite": {"name":"骷髅精英","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "greenKnight": {"name":"强盾骑士","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "bowman": {"name":"弓兵","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "liteBowman": {"name":"精锐弓兵","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "crismonZombie": {"name":"红兽人","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "watcherSlime": {"name":"邪眼怪","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "mutantSlimeman": {"name":"变异战士","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "devilKnight": {"name":"恶灵骑士","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "grayPriest": {"name":"混沌法师","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "greenGT": {"name":"卫兵队长","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "ghostSoldier": {"name":"冥队长","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0}, - "frostBat": {"name":"寒蝙蝠","hp":0,"atk":0,"def":0,"money":0,"experience":0,"point":0,"special":0} + "greenSlime": {"name":"绿头怪","hp":100,"atk":120,"def":0,"money":1,"exp":1,"point":0,"special":[1,5,7,8]}, + "redSlime": {"name":"红头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[16,18],"value":10}, + "blackSlime": {"name":"青头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "slimelord": {"name":"怪王","hp":100,"atk":120,"def":0,"money":10,"exp":0,"point":0,"special":[1,9]}, + "bat": {"name":"小蝙蝠","hp":100,"atk":120,"def":0,"money":2,"exp":0,"point":0,"special":1}, + "bigBat": {"name":"大蝙蝠","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "redBat": {"name":"红蝙蝠","hp":100,"atk":120,"def":0,"money":5,"exp":0,"point":0,"special":4}, + "vampire": {"name":"冥灵魔王","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "skeleton": {"name":"骷髅人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "skeletonCaptain": {"name":"骷髅队长","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "zombie": {"name":"兽人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "zombieKnight": {"name":"兽人武士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "rock": {"name":"石头人","hp":100,"atk":120,"def":0,"money":4,"exp":0,"point":0,"special":3}, + "bluePriest": {"name":"初级法师","hp":100,"atk":120,"def":0,"money":3,"exp":0,"point":1,"special":2}, + "redPriest": {"name":"高级法师","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "brownWizard": {"name":"初级巫师","hp":100,"atk":120,"def":0,"money":16,"exp":0,"point":0,"special":15,"value":100,"range":2}, + "redWizard": {"name":"高级巫师","hp":1000,"atk":1200,"def":0,"money":160,"exp":0,"point":0,"special":15,"value":200,"zoneSquare":true}, + "swordsman": {"name":"双手剑士","hp":100,"atk":120,"def":0,"money":6,"exp":0,"point":0,"special":[5,23]}, + "soldier": {"name":"冥战士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "yellowKnight": {"name":"金骑士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "redKnight": {"name":"红骑士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "darkKnight": {"name":"黑骑士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "blueKnight": {"name":"蓝骑士","hp":100,"atk":120,"def":0,"money":9,"exp":0,"point":0,"special":8}, + "goldSlime": {"name":"黄头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "poisonSkeleton": {"name":"紫骷髅","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "poisonBat": {"name":"紫蝙蝠","hp":100,"atk":120,"def":0,"money":14,"exp":0,"point":0,"special":13}, + "skeletonPriest": {"name":"骷髅法师","hp":100,"atk":100,"def":0,"money":0,"exp":0,"point":0,"special":18,"value":20}, + "skeletonKing": {"name":"骷髅王","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "evilHero": {"name":"迷失勇者","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "demonPriest": {"name":"魔神法师","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "goldHornSlime": {"name":"金角怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "silverSlime": {"name":"银头怪","hp":100,"atk":120,"def":0,"money":15,"exp":0,"point":0,"special":14}, + "whiteHornSlime": {"name":"尖角怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "redSwordsman": {"name":"剑王","hp":100,"atk":120,"def":0,"money":7,"exp":0,"point":0,"special":6,"n":8}, + "poisonZombie": {"name":"绿兽人","hp":100,"atk":120,"def":0,"money":13,"exp":0,"point":0,"special":12}, + "octopus": {"name":"血影","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "princessEnemy": {"name":"假公主","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "angel": {"name":"天使","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "elemental": {"name":"元素生物","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "steelGuard": {"name":"铁守卫","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":18,"value":20}, + "evilBat": {"name":"邪恶蝙蝠","hp":1000,"atk":1,"def":0,"money":0,"exp":0,"point":0,"special":[2,3]}, + "frozenSkeleton": {"name":"冻死骨","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "silverSlimelord": {"name":"银怪王","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "goldSlimelord": {"name":"金怪王","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "skeletonWarrior": {"name":"骷髅士兵","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "ghostWarrior": {"name":"冥队长","hp":100,"atk":120,"def":0,"money":8,"exp":0,"point":0,"special":7}, + "whiteSlimeman": {"name":"水银战士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "slimeman": {"name":"影子战士","hp":100,"atk":0,"def":0,"money":11,"exp":0,"point":0,"special":[10,21],"atkValue":2,"defValue":3}, + "yellowGT": {"name":"初级卫兵","hp":100,"atk":120,"def":0,"money":10,"exp":0,"point":0,"special":0}, + "blueGT": {"name":"中级卫兵","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "redGT": {"name":"高级卫兵","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "blackMS": {"name":"黑衣魔王","hp":1000,"atk":500,"def":0,"money":1000,"exp":1000,"point":0,"special":0,"notBomb":true}, + "yellowMS": {"name":"黄衣魔王","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "greenMS": {"name":"青衣武士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "magicMaster": {"name":"黑暗大法师","hp":100,"atk":120,"def":0,"money":12,"exp":0,"point":0,"special":11,"value":0.3333333333333333,"add":true,"notBomb":true}, + "blueMS": {"name":"白衣武士","hp":100,"atk":120,"def":0,"money":17,"exp":0,"point":0,"special":16}, + "redMS": {"name":"红衣魔王","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "devilWarrior": {"name":"魔神武士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "fairyEnemy": {"name":"仙子","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "dragon": {"name":"魔龙","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "skeletonKnight": {"name":"骷髅武士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "skeletonPresbyter": {"name":"骷髅巫师","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "ironRock": {"name":"铁面人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "grayRock": {"name":"灰色石头人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "yellowPriest": {"name":"中级法师","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "evilPrincess": {"name":"痛苦魔女","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "blademaster": {"name":"剑圣","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "evilFairy": {"name":"黑暗仙子","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "blueRock": {"name":"鬼邪石","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "skeletonLite": {"name":"骷髅精英","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "greenKnight": {"name":"强盾骑士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "bowman": {"name":"弓兵","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "liteBowman": {"name":"精锐弓兵","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "crismonZombie": {"name":"红兽人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "watcherSlime": {"name":"邪眼怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "mutantSlimeman": {"name":"变异战士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "devilKnight": {"name":"恶灵骑士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "grayPriest": {"name":"混沌法师","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "greenGT": {"name":"卫兵队长","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "ghostSoldier": {"name":"冥队长","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "frostBat": {"name":"寒蝙蝠","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0} } \ No newline at end of file diff --git a/project/materials/icons.png b/project/materials/icons.png index 2a602bf3..a24d21eb 100644 Binary files a/project/materials/icons.png and b/project/materials/icons.png differ diff --git a/project/materials/icons_old.png b/project/materials/icons_old.png new file mode 100644 index 00000000..311b6392 Binary files /dev/null and b/project/materials/icons_old.png differ diff --git a/project/plugins.js b/project/plugins.js index 58445b73..eed88ab3 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -220,6 +220,49 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = return null; } +}, + "removeMap": function () { + // 高层塔砍层插件,删除后不会存入存档,不可浏览地图也不可飞到。 + // 推荐用法: + // 对于超高层或分区域塔,当在1区时将2区以后的地图删除;1区结束时恢复2区,进二区时删除1区地图,以此类推 + // 这样可以大幅减少存档空间,以及加快存读档速度 + + // 删除楼层 + // core.removeMaps("MT1", "MT300") 删除MT1~MT300之间的全部层 + // core.removeMaps("MT10") 只删除MT10层 + this.removeMaps = function (fromId, toId) { + toId = toId || fromId; + var fromIndex = core.floorIds.indexOf(fromId), + toIndex = core.floorIds.indexOf(toId); + if (toIndex < 0) toIndex = core.floorIds.length - 1; + flags.__removed__ = flags.__removed__ || []; + for (var i = fromIndex; i <= toIndex; ++i) { + var floorId = core.floorIds[i]; + delete flags.__visited__[floorId]; + flags.__removed__.push(floorId); + core.status.maps[floorId].deleted = true; + core.status.maps[floorId].canFlyTo = false; + core.status.maps[floorId].cannotViewMap = true; + } + } + + // 恢复楼层 + // core.resumeMaps("MT1", "MT300") 恢复MT1~MT300之间的全部层 + // core.resumeMaps("MT10") 只恢复MT10层 + this.resumeMaps = function (fromId, toId) { + toId = toId || fromId; + var fromIndex = core.floorIds.indexOf(fromId), + toIndex = core.floorIds.indexOf(toId); + if (toIndex < 0) toIndex = core.floorIds.length - 1; + flags.__removed__ = flags.__removed__ || []; + for (var i = fromIndex; i <= toIndex; ++i) { + var floorId = core.floorIds[i]; + flags.__removed__ = flags.__removed__.filter(function (f) { return f != floorId; }); + if (core.status.maps[floorId].deleted) { + core.status.maps[floorId] = core.loadFloor(floorId); + } + } + } }, "itemShop": function () { // 道具商店相关的插件 diff --git a/styles.css b/styles.css index d981dfdf..999e30f4 100644 --- a/styles.css +++ b/styles.css @@ -74,7 +74,7 @@ color: #fff; font-size: 0.6rem; position: absolute; - top: 8%; + top: 10%; left: 5%; z-index: 15; } diff --git a/v2.x-final更新.txt b/v2.x-final更新.txt index a6d4e1d7..1d0849d9 100644 --- a/v2.x-final更新.txt +++ b/v2.x-final更新.txt @@ -44,14 +44,14 @@ (已完成!) 重构全局商店! (已完成!) 读档时色调数据丢失 (已完成!) 圆角边框 -像素高分辨率问题 +(不处理) 像素高分辨率问题 (已完成!) 道具效果优化,删除部分道具相关的开关 (已完成!) 素材列表选择 (已完成!) 油漆桶,动态更改地图大小 地图拉框选择复制剪切删除 -额外素材区拖动选择一个区域 +(已完成!) 额外素材区拖动选择一个区域 (已完成!) 素材替换 -大屏幕下放大游戏界面 +(已完成!) 大屏幕下放大游戏界面 (已完成!) 最近使用/最常使用的图块 (已完成!) loader并行加载 合并items.js @@ -60,6 +60,10 @@ (已完成!) 32x48的门 (已完成!) 难度分歧的图块(颜色,含SL界面) 装备同时加属性和比例 +(已完成!) removeMap和resumeMap +右键图块选择复制/粘贴事件 +showImage, drawImage等加上对称选项 + ------------- @@ -93,7 +97,7 @@ (已完成!) 27. 勇士后退时跟随者很鬼畜,建议优化(每步聚集算是一种简陋的办法) (不处理) 28. 勇士的移动帧只有2,建议改为允许作者指定 (不处理) 29. 建议加一对“勇士开始抖动”和“勇士停止抖动”事件指令,来让勇士像图块一样原地抖动(即全局动画)。目前这个效果还只能通过隐藏勇士(或切换透明行走图)并转变图块/图层块来实现且只能用于事件处理中QAQ -30. 建议加一个“视角锁定”事件指令,从而允许用事件改变勇士位置、朝向或行走图时不会使视角重置到以其为中心,用于一些演出效果 +(不处理) 30. 建议加一个“视角锁定”事件指令,从而允许用事件改变勇士位置、朝向或行走图时不会使视角重置到以其为中心,用于一些演出效果 (已完成!) 31. 楼层切换事件(绿点)一旦使用blockly编辑就会无视全塔属性的切换时间,只能手动在表格中删除时间(数据相关“楼层切换”事件指令也有这个问题,有群友还希望这个默认时间能像步时和音量一样由玩家设定来节约拆塔时间)。使用blockly编辑也无法做出“ignore:true”的效果(用来覆盖全塔属性的禁止穿透),建议优化 (已完成!) 32. (关于CC的来回回档优化版)据其称,清空存档后会出现bug,此外他使用了W键导致二倍斩失效了(js的switch语句遇到duplicate cases居然不报错吗...) (已完成!) 33. (疑似已被CC修复)楼传平面塔模式在记录离开位置时会错误地把读档也算作离开