From a9835de64a4a6f925b1ccb59f813dd64750ec7fa Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Mon, 1 Jan 2018 19:31:32 +0800 Subject: [PATCH 1/5] editor_file & comment.js --- _server/editor_file.demo.js | 20 +++++------ _server/editor_file.js | 66 ++++++++++++++++++++++--------------- libs/project/comment.js | 27 +++++++++++++++ 3 files changed, 77 insertions(+), 36 deletions(-) create mode 100644 libs/project/comment.js diff --git a/_server/editor_file.demo.js b/_server/editor_file.demo.js index 943dc71d..7f70e19e 100644 --- a/_server/editor_file.demo.js +++ b/_server/editor_file.demo.js @@ -3,13 +3,13 @@ editor_file = {}; editor_file.getFloorFileList = function(editor,callback){ - if (isset(callback)) callback(['simple0.js','simple1.js','simple2.js'],null); + if (isset(callback)) callback([['simple0.js','simple1.js','simple2.js'],null]); } - //callback(Array,err:String) + //callback([Array,err:String]) editor_file.loadFloorFile = function(editor,filename,callback){ - if (isset(callback)) callback('',null); + if (isset(callback)) callback(null); } - //callback(String,err:String) + //callback(err:String) editor_file.saveFloorFile = function(editor,callback){ if (isset(callback)) callback(null); } @@ -25,16 +25,16 @@ if (isset(callback)) callback(null); } //callback(err:String) - editor_file.editItem = function(editor,id,obj,callback){ + editor_file.editItem = function(editor,id,actionList,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 if (isset(callback)) callback( {'items':{'cls': 'items', 'name': '红宝石'},'itemEffect':'core.status.hero.atk += core.values.redJewel','itemEffectTip':"',攻击+'+core.values.redJewel"}, - {'items':'','itemEffect':'','itemEffectTip':''}, + {'items':{'cls': "只能取keys items constants tools\n$range(thiseval in ['keys','items','constants','tools'])$end", 'name': '', 'text': ''},'itemEffect':'','itemEffectTip':''}, null); //只有items.cls是items的才有itemEffect和itemEffectTip,keys和constants和tools只有items } //callback(obj,commentObj,err:String) - editor_file.editEnemy = function(editor,id,obj,callback){ + editor_file.editEnemy = function(editor,id,actionList,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 if (isset(callback)) callback( {'name': '初级巫师', 'hp': 100, 'atk': 120, 'def': 0, 'money': 16, 'experience': 0, 'special': 15, 'value': 100, "bomb": false}, @@ -45,7 +45,7 @@ //////////////////////////////////////////////////////////////////// - editor_file.editLoc = function(editor,x,y,obj,callback){ + editor_file.editLoc = function(editor,x,y,actionList,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 if (isset(callback)) callback( {"events":['\t[老人,man]这些是本样板支持的所有的道具。\n\n道具分为三类:items, constants, tools。\nitems 为即捡即用类道具,例如宝石、血瓶、剑盾等。\nconstants 为永久道具,例如怪物手册、楼层传送器、幸运金币等。\ntools 为消耗类道具,例如破墙镐、炸弹、中心对称飞行器等。\n\n后两类道具在工具栏中可以看到并使用。', '\t[老人,man]有关道具效果,定义在items.js中。\n目前大多数道具已有默认行为,如有自定义的需求则需在items.js中修改代码。', '\t[老人,man]constants 和 tools 各最多只允许12种,多了会导致图标溢出。', '\t[老人,man]拾取道具结束后可触发 afterGetItem 事件。\n\n有关事件的各种信息在下一层会有更为详细的说明。', {'type': 'hide', 'time': 500}],"changeFloor":"","afterBattle":"","afterGetItem":"","afterOpenDoor":""}, @@ -56,7 +56,7 @@ //////////////////////////////////////////////////////////////////// - editor_file.editFloor = function(editor,obj,callback){ + editor_file.editFloor = function(editor,actionList,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 if (isset(callback)) callback( {'floorId': 'sample0', 'title': '样板 0 层', 'name': '0', 'canFlyTo': True, 'canUseQuickShop': True, 'defaultGround': 'ground', 'firstArrive': ['\t[样板提示]首次到达某层可以触发 firstArrive 事件,该事件可类似于RMXP中的“自动执行脚本”。\n\n本事件支持一切的事件类型,常常用来触发对话,例如:', '\t[hero]我是谁?我从哪来?我又要到哪去?', '\t[仙子,fairy]你问我...?我也不知道啊...', '本层主要对道具、门、怪物等进行介绍,有关事件的各种信息在下一层会有更为详细的说明。']}, @@ -69,7 +69,7 @@ - editor_file.editTower = function(editor,obj,callback){ + editor_file.editTower = function(editor,actionList,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 if (isset(callback)) callback( {'main': {'useCompress': False, 'floorIds': ['sample0', 'sample1', 'sample2', 'test']}, 'firstData': {'title': '魔塔样板', 'name': 'template', 'version': 'Ver 1.0.0 (Beta)', 'floorId': 'sample0', 'hero': {'name': '阳光', 'lv': 1, 'hp': 2000, 'atk': 100, 'def': 100, 'mdef': 100, 'money': 100, 'experience': 0, 'items': {'keys': {'yellowKey': 0, 'blueKey': 0, 'redKey': 0}, 'constants': {}, 'tools': {}}, 'flyRange': [], 'loc': {'direction': 'up', 'x': 6, 'y': 10}, 'flags': {'poison': False, 'weak': False, 'curse': False}}, 'startText': ['Hi,欢迎来到 HTML5 魔塔样板!\n\n本样板由艾之葵制作,可以让你在不会写任何代码\n的情况下也能做出属于自己的H5魔塔!', '这里游戏开始时的剧情。\n定义在data.js的startText处。\n\n你可以在这里写上自己的内容。', '赶快来试一试吧!'], 'shops': {'moneyShop1': {'name': '贪婪之神', 'icon': 'blueShop', 'textInList': '1F金币商店', 'use': 'money', 'need': '20+10*times*(times+1)', 'text': '勇敢的武士啊,给我${need}金币就可以:', 'choices': [{'text': '生命+800', 'effect': 'status:hp+=800'}, {'text': '攻击+4', 'effect': 'status:atk+=4'}, {'text': '防御+4', 'effect': 'status:def+=4'}, {'text': '魔防+10', 'effect': 'status:mdef+=10'}]}, 'expShop1': {'name': '经验之神', 'icon': 'pinkShop', 'textInList': '1F经验商店', 'use': 'experience', 'need': '-1', 'text': '勇敢的武士啊,给我若干经验就可以:', 'choices': [{'text': '等级+1', 'need': '100', 'effect': 'status:lv+=1;status:hp+=1000;status:atk+=7;status:def+=7'}, {'text': '攻击+5', 'need': '30', 'effect': 'status:atk+=5'}, {'text': '防御+5', 'need': '30', 'effect': 'status:def+=5'}]}}, 'levelUp': [{}, {'need': 20, 'name': '第二级', 'effect': 'status:hp+=2*(status:atk+status:def);status:atk+=10;status:def+=10'}, {'need': 40, 'effect': 'function () {\n core.drawText("恭喜升级!");\n core.status.hero.hp *= 2;\n core.status.hero.atk += 100;\n core.status.hero.def += 100;\n }'}]}, 'values': {'HPMAX': 999999, 'lavaDamage': 100, 'poisonDamage': 10, 'weakValue': 20, 'redJewel': 3, 'blueJewel': 3, 'greenJewel': 5, 'redPotion': 100, 'bluePotion': 250, 'yellowPotion': 500, 'greenPotion': 800, 'sword1': 10, 'shield1': 10, 'sword2': 20, 'shield2': 20, 'sword3': 40, 'shield3': 40, 'sword4': 80, 'shield4': 80, 'sword5': 160, 'shield5': 160, 'moneyPocket': 500, 'breakArmor': 0.9, 'counterAttack': 0.1, 'purify': 3, 'hatred': 2, 'animateSpeed': 500}, 'flags': {'enableNegativeDamage': True, 'enableFloor': False, 'enableLv': True, 'enableMDef': True, 'enableMoney': True, 'enableExperience': True, 'enableLevelUp': False, 'enableDebuff': True, 'flyNearStair': True, 'pickaxeFourDirections': True, 'bombFourDirections': True, 'bigKeyIsBox': False, 'startDirectly': False, 'canOpenBattleAnimate': True, 'showBattleAnimateConfirm': True, 'battleAnimate': True, 'displayEnemyDamage': True, 'displayExtraDamage': False, 'enableGentleClick': True, 'portalWithoutTrigger': True, 'potionWhileRouting': False}}, diff --git a/_server/editor_file.js b/_server/editor_file.js index 8ce40c89..d458b341 100644 --- a/_server/editor_file.js +++ b/_server/editor_file.js @@ -85,6 +85,7 @@ return; } } + throw('需要改实现') if (change!=-1 && change!=idnum){//修改idnum core.maps.blocksInfo[idnum] = core.maps.blocksInfo[change]; delete(core.maps.blocksInfo[change]); @@ -106,37 +107,24 @@ callback(null); } //callback(err:String) - editor_file.editItem = function(editor,id,obj,callback){ - //obj形式同callback的obj,为null或undefined时只查询不修改 + editor_file.editItem = function(editor,id,actionList,callback){ + /*actionList:[ + ["change","['items']['name']","红宝石的新名字"], + ["add","['items']['新的和name同级的属性']",123], + ["change","['itemEffectTip']","',攻击力+'+core.values.redJewel"], + ] + 为[]时只查询不修改 + */ if (!isset(callback)) throw('未设置callback'); callback( {'items':{'cls': 'items', 'name': '红宝石'},'itemEffect':'core.status.hero.atk += core.values.redJewel','itemEffectTip':"',攻击+'+core.values.redJewel"}, - {'items':'','itemEffect':'','itemEffectTip':''}, + {'items':{'cls': "/*只能取keys items constants tools\\n$range(thiseval in ['keys','items','constants','tools'])\\n*/", 'name': '', 'text': ''},'itemEffect':'','itemEffectTip':''}, null); //只有items.cls是items的才有itemEffect和itemEffectTip,keys和constants和tools只有items } - /* - << - {'items':{'cls': 'items', 'name': '红宝石'},'itemEffect':'core.status.hero.atk += core.values.redJewel','itemEffectTip':"',攻击+'+core.values.redJewel"} - == - [ - ["change","['items']['name']","红宝石的新名字"], - ["add","['items']['新的和name同级的属性']",123], - ["change","['itemEffectTip']","',攻击力+'+core.values.redJewel"], - ] - >> - 'yellowKey': {'cls': 'keys' \*只能取keys items constants tools\n$range(thiseval in ['keys','items','constants','tools'])\n*\ , 'name': '黄钥匙'} - - $range((function(){typeof(thiseval)==typeof(0)||})()) - if( 注释.indexof('$range(')!= -1){ - thiseval = 新值; - evalstr = 注释.split('$range')[1].split('\n')[0]; - if(eval(evalstr) !== true)alert('不在取值范围内') - } - */ //callback(obj,commentObj,err:String) - editor_file.editEnemy = function(editor,id,obj,callback){ + editor_file.editEnemy = function(editor,id,actionList,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 if (!isset(callback)) throw('未设置callback'); callback( @@ -148,7 +136,7 @@ //////////////////////////////////////////////////////////////////// - editor_file.editLoc = function(editor,x,y,obj,callback){ + editor_file.editLoc = function(editor,x,y,actionList,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 if (!isset(callback)) throw('未设置callback'); callback( @@ -160,7 +148,7 @@ //////////////////////////////////////////////////////////////////// - editor_file.editFloor = function(editor,obj,callback){ + editor_file.editFloor = function(editor,actionList,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 if (!isset(callback)) throw('未设置callback'); callback( @@ -174,7 +162,7 @@ - editor_file.editTower = function(editor,obj,callback){ + editor_file.editTower = function(editor,actionList,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 if (!isset(callback)) throw('未设置callback'); callback( @@ -210,4 +198,30 @@ } return formatArrStr; } + + var saveSetting = function(file,actionList,callback) { + if (file=='icons') {} + if (file=='maps') {} + if (file=='items') {} + if (file=='enemys') {} + if (file=='data') {} + callback('出错了,要设置的文件名不识别'); + } + /* + [ + ["change","['items']['redJewel']['name']","红宝石的新名字"], + ["add","['items']['redJewel']['新的和name同级的属性']",123], + ["change","['itemEffectTip']['redJewel']","',攻击力+'+core.values.redJewel"], + ] + >> + 'yellowKey': {'cls': 'keys' \*只能取keys items constants tools\n$range(thiseval in ['keys','items','constants','tools'])\n*\ , 'name': '黄钥匙'} + + $range((function(){typeof(thiseval)==typeof(0)||})()) + if( 注释.indexof('$range(')!= -1){ + thiseval = 新值; + evalstr = 注释.split('$range')[1].split('$end')[0]; + if(eval(evalstr) !== true)alert('不在取值范围内') + } + */ + })(); \ No newline at end of file diff --git a/libs/project/comment.js b/libs/project/comment.js new file mode 100644 index 00000000..df355d73 --- /dev/null +++ b/libs/project/comment.js @@ -0,0 +1,27 @@ +comment = +{ + "items" : { + 'items':{ + 'cls': "只能取keys items constants tools\n$range(thiseval in ['keys','items','constants','tools'])$end", + 'name': '名称', + 'text': '道具在道具栏中显示的描述' + }, + 'itemEffect':'cls为items的即捡即用类物品的效果,执行时会对这里的字符串执行eval()', + 'itemEffectTip':'cls为items的即捡即用类物品,在获得时左上角额外显示的文字,执行时会对这里的字符串执行eval()得到字符串' + }, + "enemys" : { + 'name': '名称', + 'hp': '生命值', + 'atk': '攻击力', + 'def': '防御力', + 'money': '金币', + 'experience': '经验', + 'special': '特殊属性\n1:先攻,2:魔攻,3:坚固,4:2连击,5:3连击,6:n连击,7:破甲,8:反击,9:净化,10:模仿,11:吸血,12:中毒,13:衰弱,14:诅咒,15:领域,16:夹击,17:仇恨,18:阻击,19:自爆,20:无敌\n多个属性例如用[1,4,11]表示先攻2连击吸血\n模仿怪的攻防设为0就好\n', + 'value': '特殊属性的数值\n领域怪需要加value表示领域伤害的数值\n吸血怪需要在后面添加value代表吸血比例', + 'zoneSquare': '领域怪zoneSquare代表是否九宫格伤害', + 'range': 'range可选,代表领域伤害的范围;不加默认为1\n$range(thiseval==~~thiseval &&thiseval>0)$end', + 'bomb':' 加入 "bomb": false 代表该怪物不可被炸弹或圣锤炸掉$range(thiseval in [true,false])$end', + 'point': 'point可以在打败怪物后进行加点,详见文档说明\n$range(thiseval==~~thiseval && thiseval>0)$end', + 'n': '多连击需要在后面指定n代表是几连击\n$range(thiseval==~~thiseval &&thiseval>0)$end', + } +} \ No newline at end of file From 5671d5501e7a0b2bee1fe9ab8b12c7378a5a3e0c Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Tue, 2 Jan 2018 12:37:40 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=8F=96=E6=B6=88=E4=BA=86editor=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E7=9A=84=E9=83=A8=E5=88=86=E5=8A=A8=E7=94=BB=20&=20fi?= =?UTF-8?q?x=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _server/vm.js | 1 + libs/core.js | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/_server/vm.js b/_server/vm.js index 4c1644bf..ba4e640e 100644 --- a/_server/vm.js +++ b/_server/vm.js @@ -168,6 +168,7 @@ var clear = new Vue({ methods: { clearMap: function(){ editor.mapInit(); + editor.updateMap(); clearTimeout(editArea.formatTimer); clearTimeout(tip.timer); pout.value = ''; diff --git a/libs/core.js b/libs/core.js index c659d2d6..12ac4980 100644 --- a/libs/core.js +++ b/libs/core.js @@ -3615,7 +3615,7 @@ core.prototype.isset = function (val) { ////// 播放背景音乐 ////// core.prototype.playBgm = function (bgm) { - + if (main.mode!='play')return; // 如果不允许播放 if (!core.musicStatus.bgmStatus) return; // 音频不存在 @@ -3666,7 +3666,7 @@ core.prototype.pauseBgm = function () { ////// 恢复背景音乐的播放 ////// core.prototype.resumeBgm = function () { - + if (main.mode!='play')return; // 如果不允许播放 if (!core.musicStatus.bgmStatus) return; @@ -3691,7 +3691,7 @@ core.prototype.resumeBgm = function () { ////// 播放音频 ////// core.prototype.playSound = function (sound) { - + if (main.mode!='play')return; // 如果不允许播放 if (!core.musicStatus.soundStatus) return; // 音频不存在 @@ -3730,6 +3730,11 @@ core.prototype.show = function (obj, speed, callback) { return; } obj.style.display = 'block'; + if (main.mode!='play'){ + obj.style.opacity = 1; + if (core.isset(callback)) {callback();} + return; + } obj.style.opacity = 0; var opacityVal = 0; var showAnimate = window.setInterval(function () { @@ -3750,6 +3755,11 @@ core.prototype.hide = function (obj, speed, callback) { obj.style.display = 'none'; return; } + if (main.mode!='play'){ + obj.style.display = 'none'; + if (core.isset(callback)) {callback();} + return; + } var opacityVal = 1; var hideAnimate = window.setInterval(function () { opacityVal -= 0.03; From 4659f4ddcdb69330dcdea8bd376e8bfe9b31c752 Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Tue, 2 Jan 2018 13:35:27 +0800 Subject: [PATCH 3/5] editor.changeFloor --- _server/css/editor.css | 3 +++ drawMapGUI.html | 28 ++++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/_server/css/editor.css b/_server/css/editor.css index 02b25b10..1ffb46b9 100644 --- a/_server/css/editor.css +++ b/_server/css/editor.css @@ -184,6 +184,9 @@ body{ top: 5px; overflow: auto; } +.egameCanvas { + position: absolute; +} .gameCanvas { position: absolute; } diff --git a/drawMapGUI.html b/drawMapGUI.html index e6051f11..5c983602 100644 --- a/drawMapGUI.html +++ b/drawMapGUI.html @@ -32,7 +32,7 @@
- +
@@ -70,7 +70,7 @@
- +
@@ -110,39 +110,39 @@
- +

- +

- +

- +

- +

- +

- +

- +

- +

@@ -157,13 +157,13 @@
- - - - - - - + + + + + + +

diff --git a/index.html b/index.html index d59b0e43..a8d12214 100644 --- a/index.html +++ b/index.html @@ -25,7 +25,7 @@

资源即将开始加载

- +
@@ -48,39 +48,39 @@
- +

- +

- +

- +

- +

- +

- +

- +

- +

@@ -95,13 +95,13 @@
- - - - - - - + + + + + + +

diff --git a/libs/core.js b/libs/core.js index 12ac4980..11a9bc9b 100644 --- a/libs/core.js +++ b/libs/core.js @@ -181,7 +181,7 @@ core.prototype.init = function (dom, statusBar, canvas, images, pngs, bgms, soun core.flags.displayExtraDamage = core.getLocalStorage('extraDamage', core.flags.displayExtraDamage); core.material.ground = new Image(); - core.material.ground.src = "images/ground.png"; + core.material.ground.src = "project/images/ground.png"; core.loader(function () { console.log(core.material); @@ -298,7 +298,7 @@ core.prototype.loadImage = function (imgName, callback) { if (name.indexOf(".png")<0) // 不包含"png" name=name+".png"; var image = new Image(); - image.src = 'images/' + name + "?v=" + main.version; + image.src = 'project/images/' + name + "?v=" + main.version; if (image.complete) { callback(imgName, image); return; @@ -323,7 +323,7 @@ core.prototype.loadMusic = function (callback) { if (core.musicStatus.audioContext!=null) { core.material.bgms[t] = 'loading'; var xhr = new XMLHttpRequest(); - xhr.open('GET', 'sounds/'+t, true); + xhr.open('GET', 'project/sounds/'+t, true); xhr.overrideMimeType("text/plain; charset=x-user-defined"); xhr.onload = function(e) { //下载完成 try { @@ -360,7 +360,7 @@ core.prototype.loadMusic = function (callback) { else { var music = new Audio(); music.preload = core.musicStatus.startDirectly?'auto':'none'; - music.src = 'sounds/'+t; + music.src = 'project/sounds/'+t; music.loop = 'loop'; core.material.bgms[t] = music; } @@ -370,7 +370,7 @@ core.prototype.loadMusic = function (callback) { if (core.musicStatus.audioContext != null) { var xhr = new XMLHttpRequest(); - xhr.open('GET', 'sounds/'+t, true); + xhr.open('GET', 'project/sounds/'+t, true); xhr.responseType = 'arraybuffer'; xhr.onload = function(e) { //下载完成 try { @@ -399,7 +399,7 @@ core.prototype.loadMusic = function (callback) { } else { var music = new Audio(); - music.src = 'sounds/'+t; + music.src = 'project/sounds/'+t; core.material.sounds[t] = music; } @@ -990,8 +990,8 @@ core.prototype.onmousewheel = function (direct) { // 怪物手册 if (core.status.lockControl && core.status.event.id == 'book') { - if (direct==1) core.ui.drawBook(core.status.event.data - 1); - if (direct==-1) core.ui.drawBook(core.status.event.data + 1); + if (direct==1) core.ui.drawBook(core.status.event.data - 6); + if (direct==-1) core.ui.drawBook(core.status.event.data + 6); return; } diff --git a/main.js b/main.js index 8efdf81d..1e3ff0d6 100644 --- a/main.js +++ b/main.js @@ -154,7 +154,7 @@ main.prototype.loaderFloors = function (callback) { main.setMainTipsText('正在加载楼层文件...') if (this.useCompress) { // 读取压缩文件 var script = document.createElement('script'); - script.src = 'libs/project/floors.min.js?v=' + this.version; + script.src = 'project/floors.min.js?v=' + this.version; main.dom.body.appendChild(script); script.onload = function () { main.dom.mainTips.style.display = 'none'; @@ -189,7 +189,7 @@ main.prototype.loadMod = function (modName, callback) { ////// 加载某一个楼层 ////// main.prototype.loadFloor = function(floorId, callback) { var script = document.createElement('script'); - script.src = 'libs/project/floors/' + floorId +'.js?v=' + this.version; + script.src = 'project/floors/' + floorId +'.js?v=' + this.version; main.dom.body.appendChild(script); script.onload = function () { callback(floorId); @@ -200,7 +200,7 @@ main.prototype.loadPureData = function(callback) { var loadedNum = 0; main.pureData.forEach(function(name){ var script = document.createElement('script'); - script.src = 'libs/project/' + name +'.js?v=' + this.version; + script.src = 'project/' + name +'.js?v=' + main.version; main.dom.body.appendChild(script); script.onload = function () { loadedNum++; diff --git a/libs/project/comment.js b/project/comment.js similarity index 100% rename from libs/project/comment.js rename to project/comment.js diff --git a/libs/project/data.js b/project/data.js similarity index 100% rename from libs/project/data.js rename to project/data.js diff --git a/libs/project/enemys.js b/project/enemys.js similarity index 100% rename from libs/project/enemys.js rename to project/enemys.js diff --git a/libs/project/floors/MT0.js b/project/floors/MT0.js similarity index 100% rename from libs/project/floors/MT0.js rename to project/floors/MT0.js diff --git a/libs/project/floors/sample0.js b/project/floors/sample0.js similarity index 99% rename from libs/project/floors/sample0.js rename to project/floors/sample0.js index aee78417..857473d0 100644 --- a/libs/project/floors/sample0.js +++ b/project/floors/sample0.js @@ -65,7 +65,7 @@ main.floors.sample0 = { ], "2,3": [ // 守着第三批怪物的老人 "\t[老人,magician]领域、夹击。\n请注意领域怪需要设置value为伤害数值,可参见样板中初级巫师的写法。", - "\t[老人,magician]夹击和领域同时发生时先计算领域,再夹击。\n自动寻路同样会尽量绕过你设置的这些点。\n\n另:本塔不支持阻击怪。", + "\t[老人,magician]夹击和领域同时发生时先计算领域,再夹击。\n自动寻路同样会尽量绕过你设置的这些点。", {"type": "hide", "time": 500} ], "12,10": { // 隐藏的仙子 diff --git a/libs/project/floors/sample1.js b/project/floors/sample1.js similarity index 100% rename from libs/project/floors/sample1.js rename to project/floors/sample1.js diff --git a/libs/project/floors/sample2.js b/project/floors/sample2.js similarity index 100% rename from libs/project/floors/sample2.js rename to project/floors/sample2.js diff --git a/libs/project/floors/test.js b/project/floors/test.js similarity index 100% rename from libs/project/floors/test.js rename to project/floors/test.js diff --git a/libs/project/icons.js b/project/icons.js similarity index 100% rename from libs/project/icons.js rename to project/icons.js diff --git a/images/animates.png b/project/images/animates.png similarity index 100% rename from images/animates.png rename to project/images/animates.png diff --git a/images/atk.png b/project/images/atk.png similarity index 100% rename from images/atk.png rename to project/images/atk.png diff --git a/images/autotile.png b/project/images/autotile.png similarity index 100% rename from images/autotile.png rename to project/images/autotile.png diff --git a/images/autotile1.png b/project/images/autotile1.png similarity index 100% rename from images/autotile1.png rename to project/images/autotile1.png diff --git a/images/autotile2.png b/project/images/autotile2.png similarity index 100% rename from images/autotile2.png rename to project/images/autotile2.png diff --git a/images/autotile3.png b/project/images/autotile3.png similarity index 100% rename from images/autotile3.png rename to project/images/autotile3.png diff --git a/images/bg.png b/project/images/bg.png similarity index 100% rename from images/bg.png rename to project/images/bg.png diff --git a/images/book.png b/project/images/book.png similarity index 100% rename from images/book.png rename to project/images/book.png diff --git a/images/def.png b/project/images/def.png similarity index 100% rename from images/def.png rename to project/images/def.png diff --git a/images/enemys.png b/project/images/enemys.png similarity index 100% rename from images/enemys.png rename to project/images/enemys.png diff --git a/images/experience.png b/project/images/experience.png similarity index 100% rename from images/experience.png rename to project/images/experience.png diff --git a/images/floor.png b/project/images/floor.png similarity index 100% rename from images/floor.png rename to project/images/floor.png diff --git a/images/fly.png b/project/images/fly.png similarity index 100% rename from images/fly.png rename to project/images/fly.png diff --git a/images/ground.png b/project/images/ground.png similarity index 100% rename from images/ground.png rename to project/images/ground.png diff --git a/images/hero.png b/project/images/hero.png similarity index 100% rename from images/hero.png rename to project/images/hero.png diff --git a/images/hp.png b/project/images/hp.png similarity index 100% rename from images/hp.png rename to project/images/hp.png diff --git a/images/items.png b/project/images/items.png similarity index 100% rename from images/items.png rename to project/images/items.png diff --git a/images/load.png b/project/images/load.png similarity index 100% rename from images/load.png rename to project/images/load.png diff --git a/images/lv.png b/project/images/lv.png similarity index 100% rename from images/lv.png rename to project/images/lv.png diff --git a/images/mdef.png b/project/images/mdef.png similarity index 100% rename from images/mdef.png rename to project/images/mdef.png diff --git a/images/money.png b/project/images/money.png similarity index 100% rename from images/money.png rename to project/images/money.png diff --git a/images/npcs.png b/project/images/npcs.png similarity index 100% rename from images/npcs.png rename to project/images/npcs.png diff --git a/images/save.png b/project/images/save.png similarity index 100% rename from images/save.png rename to project/images/save.png diff --git a/images/settings.png b/project/images/settings.png similarity index 100% rename from images/settings.png rename to project/images/settings.png diff --git a/images/shop.png b/project/images/shop.png similarity index 100% rename from images/shop.png rename to project/images/shop.png diff --git a/images/terrains.png b/project/images/terrains.png similarity index 100% rename from images/terrains.png rename to project/images/terrains.png diff --git a/images/toolbox.png b/project/images/toolbox.png similarity index 100% rename from images/toolbox.png rename to project/images/toolbox.png diff --git a/images/up.png b/project/images/up.png similarity index 100% rename from images/up.png rename to project/images/up.png diff --git a/images/yewai.png b/project/images/yewai.png similarity index 100% rename from images/yewai.png rename to project/images/yewai.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/autotile0.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile0.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/autotile0.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile0.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/autotile1.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile1.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/autotile1.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile1.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/autotile10.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile10.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/autotile10.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile10.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/autotile11.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile11.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/autotile11.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile11.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/autotile12.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile12.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/autotile12.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile12.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/autotile13.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile13.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/autotile13.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile13.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/autotile14.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile14.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/autotile14.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile14.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/autotile2.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile2.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/autotile2.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile2.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/autotile3.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile3.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/autotile3.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile3.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/autotile4.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile4.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/autotile4.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile4.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/autotile5.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile5.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/autotile5.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile5.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/autotile6.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile6.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/autotile6.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile6.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/autotile7.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile7.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/autotile7.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile7.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/autotile8.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile8.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/autotile8.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile8.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/autotile9.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile9.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/autotile9.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/autotile9.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/hero0.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/hero0.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/hero0.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/hero0.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/hero1.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/hero1.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/hero1.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/hero1.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/hero10.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/hero10.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/hero10.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/hero10.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/hero2.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/hero2.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/hero2.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/hero2.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/hero3.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/hero3.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/hero3.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/hero3.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/hero4.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/hero4.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/hero4.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/hero4.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/hero5.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/hero5.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/hero5.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/hero5.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/hero6.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/hero6.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/hero6.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/hero6.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/hero7.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/hero7.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/hero7.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/hero7.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/hero8.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/hero8.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/hero8.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/hero8.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/hero9.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/hero9.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/hero9.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/hero9.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/items0:经典.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/items0:经典.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/items0:经典.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/items0:经典.png diff --git a/images/常用素材:如需使用请直接替换目录中的对应文件/items1:圆形宝石.png b/project/images/常用素材:如需使用请直接替换目录中的对应文件/items1:圆形宝石.png similarity index 100% rename from images/常用素材:如需使用请直接替换目录中的对应文件/items1:圆形宝石.png rename to project/images/常用素材:如需使用请直接替换目录中的对应文件/items1:圆形宝石.png diff --git a/libs/project/items.js b/project/items.js similarity index 100% rename from libs/project/items.js rename to project/items.js diff --git a/libs/project/maps.js b/project/maps.js similarity index 100% rename from libs/project/maps.js rename to project/maps.js diff --git a/sounds/058-Slow01.mid b/project/sounds/058-Slow01.mid similarity index 100% rename from sounds/058-Slow01.mid rename to project/sounds/058-Slow01.mid diff --git a/sounds/attack.ogg b/project/sounds/attack.ogg similarity index 100% rename from sounds/attack.ogg rename to project/sounds/attack.ogg diff --git a/sounds/bgm.mp3 b/project/sounds/bgm.mp3 similarity index 100% rename from sounds/bgm.mp3 rename to project/sounds/bgm.mp3 diff --git a/sounds/door.ogg b/project/sounds/door.ogg similarity index 100% rename from sounds/door.ogg rename to project/sounds/door.ogg diff --git a/sounds/floor.mp3 b/project/sounds/floor.mp3 similarity index 100% rename from sounds/floor.mp3 rename to project/sounds/floor.mp3 diff --git a/sounds/item.ogg b/project/sounds/item.ogg similarity index 100% rename from sounds/item.ogg rename to project/sounds/item.ogg diff --git a/sounds/qianjin.mid b/project/sounds/qianjin.mid similarity index 100% rename from sounds/qianjin.mid rename to project/sounds/qianjin.mid diff --git a/sounds/star.mid b/project/sounds/star.mid similarity index 100% rename from sounds/star.mid rename to project/sounds/star.mid diff --git a/styles.css b/styles.css index 6523b3b8..b7031156 100644 --- a/styles.css +++ b/styles.css @@ -169,7 +169,7 @@ box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; - background: url(images/ground.png) round; + background: url(project/images/ground.png) round; z-index: 7; display: none; } @@ -198,7 +198,7 @@ } #toolBar { position: absolute; - background: url(images/ground.png) round; + background: url(project/images/ground.png) round; z-index: 6; box-sizing: border-box; -moz-box-sizing: border-box; From 62fbd21836b3ed7491d964c975fb98d48fbef7de Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Fri, 5 Jan 2018 20:43:11 +0800 Subject: [PATCH 5/5] Update editor_file.js --- {project => _server}/comment.js | 2 +- _server/editor_file.demo.js | 20 +++++------ _server/editor_file.js | 61 +++++++++++++++++++++++---------- 3 files changed, 53 insertions(+), 30 deletions(-) rename {project => _server}/comment.js (97%) diff --git a/project/comment.js b/_server/comment.js similarity index 97% rename from project/comment.js rename to _server/comment.js index df355d73..60762edb 100644 --- a/project/comment.js +++ b/_server/comment.js @@ -1,4 +1,4 @@ -comment = +comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "items" : { 'items':{ diff --git a/_server/editor_file.demo.js b/_server/editor_file.demo.js index 7f70e19e..6b5dc288 100644 --- a/_server/editor_file.demo.js +++ b/_server/editor_file.demo.js @@ -27,19 +27,19 @@ //callback(err:String) editor_file.editItem = function(editor,id,actionList,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 - if (isset(callback)) callback( + if (isset(callback)) callback([ {'items':{'cls': 'items', 'name': '红宝石'},'itemEffect':'core.status.hero.atk += core.values.redJewel','itemEffectTip':"',攻击+'+core.values.redJewel"}, {'items':{'cls': "只能取keys items constants tools\n$range(thiseval in ['keys','items','constants','tools'])$end", 'name': '', 'text': ''},'itemEffect':'','itemEffectTip':''}, - null); + null]); //只有items.cls是items的才有itemEffect和itemEffectTip,keys和constants和tools只有items } //callback(obj,commentObj,err:String) editor_file.editEnemy = function(editor,id,actionList,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 - if (isset(callback)) callback( + if (isset(callback)) callback([ {'name': '初级巫师', 'hp': 100, 'atk': 120, 'def': 0, 'money': 16, 'experience': 0, 'special': 15, 'value': 100, "bomb": false}, {'name': '名称', 'hp': '生命值', 'atk': '攻击力', 'def': '防御力', 'money': '金币', 'experience': '经验', 'special': '特殊属性\n1:先攻,2:魔攻,3:坚固,4:2连击,5:3连击,6:4连击,7:破甲,8:反击,9:净化,10:模仿,11:吸血,12:中毒,13:衰弱,14:诅咒,15:领域,16:夹击,17:仇恨\n多个属性例如用010411表示先攻2连击吸血\n模仿怪的攻防设为0就好\n', 'value': '特殊属性的数值\n领域怪需要加value表示领域伤害的数值\n吸血怪需要在后面添加value代表吸血比例', 'bomb':' 加入 "bomb": false 代表该怪物不可被炸弹或圣锤炸掉'}, - null); + null]); } //callback(obj,commentObj,err:String) @@ -47,10 +47,10 @@ editor_file.editLoc = function(editor,x,y,actionList,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 - if (isset(callback)) callback( + if (isset(callback)) callback([ {"events":['\t[老人,man]这些是本样板支持的所有的道具。\n\n道具分为三类:items, constants, tools。\nitems 为即捡即用类道具,例如宝石、血瓶、剑盾等。\nconstants 为永久道具,例如怪物手册、楼层传送器、幸运金币等。\ntools 为消耗类道具,例如破墙镐、炸弹、中心对称飞行器等。\n\n后两类道具在工具栏中可以看到并使用。', '\t[老人,man]有关道具效果,定义在items.js中。\n目前大多数道具已有默认行为,如有自定义的需求则需在items.js中修改代码。', '\t[老人,man]constants 和 tools 各最多只允许12种,多了会导致图标溢出。', '\t[老人,man]拾取道具结束后可触发 afterGetItem 事件。\n\n有关事件的各种信息在下一层会有更为详细的说明。', {'type': 'hide', 'time': 500}],"changeFloor":"","afterBattle":"","afterGetItem":"","afterOpenDoor":""}, {"events":['', '', '', '', {'type': '', 'time': ' // 消失 \n // 守着门的老人 '}],"changeFloor":"","afterBattle":"","afterGetItem":"","afterOpenDoor":""}, - null); + null]); } //callback(obj,commentObj,err:String) @@ -58,10 +58,10 @@ editor_file.editFloor = function(editor,actionList,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 - if (isset(callback)) callback( + if (isset(callback)) callback([ {'floorId': 'sample0', 'title': '样板 0 层', 'name': '0', 'canFlyTo': True, 'canUseQuickShop': True, 'defaultGround': 'ground', 'firstArrive': ['\t[样板提示]首次到达某层可以触发 firstArrive 事件,该事件可类似于RMXP中的“自动执行脚本”。\n\n本事件支持一切的事件类型,常常用来触发对话,例如:', '\t[hero]我是谁?我从哪来?我又要到哪去?', '\t[仙子,fairy]你问我...?我也不知道啊...', '本层主要对道具、门、怪物等进行介绍,有关事件的各种信息在下一层会有更为详细的说明。']}, {'floorId': '// 这里需要改楼层名,请和文件名及下面的floorId保持完全一致 // 楼层唯一标识符仅能由字母、数字、下划线组成,且不能由数字开头 // 推荐用法:第20层就用MT20,第38层就用MT38,地下6层就用MT_6(用下划线代替负号),隐藏3层用MT3h(h表示隐藏),等等 \n // 楼层唯一标识符,需要和名字完全一致 ', 'title': ' // 楼层中文名 ', 'name': ' // 显示在状态栏中的层数 ', 'canFlyTo': ' // 该楼能否被楼传器飞到(不能的话在该楼也不允许使用楼传器) ', 'canUseQuickShop': ' // 该层是否允许使用快捷商店 ', 'defaultGround': ' // 默认地面的图块ID(terrains中) \n // 地图数据,需要是13x13,建议使用地图生成器来生成 ', 'firstArrive': ['', '', '', ' // 该楼的所有可能事件列表 \n // 守着道具的老人 ']}, - null); + null]); } //callback(obj,commentObj,err:String) @@ -71,10 +71,10 @@ editor_file.editTower = function(editor,actionList,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 - if (isset(callback)) callback( + if (isset(callback)) callback([ {'main': {'useCompress': False, 'floorIds': ['sample0', 'sample1', 'sample2', 'test']}, 'firstData': {'title': '魔塔样板', 'name': 'template', 'version': 'Ver 1.0.0 (Beta)', 'floorId': 'sample0', 'hero': {'name': '阳光', 'lv': 1, 'hp': 2000, 'atk': 100, 'def': 100, 'mdef': 100, 'money': 100, 'experience': 0, 'items': {'keys': {'yellowKey': 0, 'blueKey': 0, 'redKey': 0}, 'constants': {}, 'tools': {}}, 'flyRange': [], 'loc': {'direction': 'up', 'x': 6, 'y': 10}, 'flags': {'poison': False, 'weak': False, 'curse': False}}, 'startText': ['Hi,欢迎来到 HTML5 魔塔样板!\n\n本样板由艾之葵制作,可以让你在不会写任何代码\n的情况下也能做出属于自己的H5魔塔!', '这里游戏开始时的剧情。\n定义在data.js的startText处。\n\n你可以在这里写上自己的内容。', '赶快来试一试吧!'], 'shops': {'moneyShop1': {'name': '贪婪之神', 'icon': 'blueShop', 'textInList': '1F金币商店', 'use': 'money', 'need': '20+10*times*(times+1)', 'text': '勇敢的武士啊,给我${need}金币就可以:', 'choices': [{'text': '生命+800', 'effect': 'status:hp+=800'}, {'text': '攻击+4', 'effect': 'status:atk+=4'}, {'text': '防御+4', 'effect': 'status:def+=4'}, {'text': '魔防+10', 'effect': 'status:mdef+=10'}]}, 'expShop1': {'name': '经验之神', 'icon': 'pinkShop', 'textInList': '1F经验商店', 'use': 'experience', 'need': '-1', 'text': '勇敢的武士啊,给我若干经验就可以:', 'choices': [{'text': '等级+1', 'need': '100', 'effect': 'status:lv+=1;status:hp+=1000;status:atk+=7;status:def+=7'}, {'text': '攻击+5', 'need': '30', 'effect': 'status:atk+=5'}, {'text': '防御+5', 'need': '30', 'effect': 'status:def+=5'}]}}, 'levelUp': [{}, {'need': 20, 'name': '第二级', 'effect': 'status:hp+=2*(status:atk+status:def);status:atk+=10;status:def+=10'}, {'need': 40, 'effect': 'function () {\n core.drawText("恭喜升级!");\n core.status.hero.hp *= 2;\n core.status.hero.atk += 100;\n core.status.hero.def += 100;\n }'}]}, 'values': {'HPMAX': 999999, 'lavaDamage': 100, 'poisonDamage': 10, 'weakValue': 20, 'redJewel': 3, 'blueJewel': 3, 'greenJewel': 5, 'redPotion': 100, 'bluePotion': 250, 'yellowPotion': 500, 'greenPotion': 800, 'sword1': 10, 'shield1': 10, 'sword2': 20, 'shield2': 20, 'sword3': 40, 'shield3': 40, 'sword4': 80, 'shield4': 80, 'sword5': 160, 'shield5': 160, 'moneyPocket': 500, 'breakArmor': 0.9, 'counterAttack': 0.1, 'purify': 3, 'hatred': 2, 'animateSpeed': 500}, 'flags': {'enableNegativeDamage': True, 'enableFloor': False, 'enableLv': True, 'enableMDef': True, 'enableMoney': True, 'enableExperience': True, 'enableLevelUp': False, 'enableDebuff': True, 'flyNearStair': True, 'pickaxeFourDirections': True, 'bombFourDirections': True, 'bigKeyIsBox': False, 'startDirectly': False, 'canOpenBattleAnimate': True, 'showBattleAnimateConfirm': True, 'battleAnimate': True, 'displayEnemyDamage': True, 'displayExtraDamage': False, 'enableGentleClick': True, 'portalWithoutTrigger': True, 'potionWhileRouting': False}}, {'main': {'useCompress': ' // 是否使用压缩文件 // 当你即将发布你的塔时,请使用“JS代码压缩工具”将所有js代码进行压缩,然后将这里的useCompress改为true。 // 请注意,只有useCompress是false时才会读取floors目录下的文件,为true时会直接读取libs目录下的floors.min.js文件。 // 如果要进行剧本的修改请务必将其改成false。 \n // 在这里按顺序放所有的楼层;其顺序直接影响到楼层传送器的顺序和上楼器/下楼器的顺序 ', 'floorIds': ['', '', '', '']}, 'firstData': {'title': ' // 游戏名,将显示在标题页面以及切换楼层的界面中 ', 'name': ' // 游戏的唯一英文标识符。由英文、数字、下划线组成,不能超过20个字符。 ', 'version': ' // 当前游戏版本;版本不一致的存档不能通用。 ', 'floorId': ' // 初始楼层ID \n // 勇士初始数据 ', 'hero': {'name': ' // 勇士名;可以改成喜欢的 ', 'lv': ' // 初始等级,该项必须为正整数 ', 'hp': ' // 初始生命值 ', 'atk': ' // 初始攻击 ', 'def': ' // 初始防御 ', 'mdef': ' // 初始魔防 ', 'money': ' // 初始金币 ', 'experience': ' // 初始经验 \n // 初始道具个数 ', 'items': {'keys': {'yellowKey': '', 'blueKey': '', 'redKey': ''}, 'constants': '', 'tools': ''}, 'flyRange': ' // 初始可飞的楼层;一般留空数组即可 ', 'loc': {'direction': '', 'x': '', 'y': ' // 勇士初始位置 \n // 游戏过程中的变量或flags '}, 'flags': {'poison': ' // 毒 ', 'weak': ' // 衰 ', 'curse': ' // 咒 \n // 游戏开始前剧情。如果无剧情直接留一个空数组即可。 '}}, 'startText': ['', '', ' // 定义全局商店(即快捷商店) \n // 商店唯一ID '], 'shops': {'moneyShop1': {'name': ' // 商店名称(标题) ', 'icon': ' // 商店图标,blueShop为蓝色商店,pinkShop为粉色商店 ', 'textInList': ' // 在快捷商店栏中显示的名称 ', 'use': ' // 商店所要使用的。只能是"money"或"experience"。 ', 'need': ' // 商店需要的金币/经验数值;可以是一个表达式,以times作为参数计算。 // 这里用到的times为该商店的已经的访问次数。首次访问该商店时times的值为0。 // 上面的例子是50层商店的计算公式。你也可以写任意其他的计算公式,只要以times作为参数即可。 // 例如: "need": "25" 就是恒定需要25金币的商店; "need": "20+2*times" 就是第一次访问要20金币,以后每次递增2金币的商店。 // 如果是对于每个选项有不同的计算公式,写 "need": "-1" 即可。可参见下面的经验商店。 ', 'text': ' // 显示的文字,需手动加换行符。可以使用${need}表示上面的need值。 \n // 商店的选项 ', 'choices': [{'text': '', 'effect': ' // 如果有多个effect以分号分开,参见下面的经验商店 '}, {'text': '', 'effect': ''}, {'text': '', 'effect': ''}, {'text': '', 'effect': ' // effect只能对status和item进行操作,不能修改flag值。 // 必须是X+=Y的形式,其中Y可以是一个表达式,以status:xxx或item:xxx为参数 // 其他effect样例: // "item:yellowKey+=1" 黄钥匙+1 // "item:pickaxe+=3" 破墙镐+3 // "status:hp+=2*(status:atk+status:def)" 将生命提升攻防和的数值的两倍 \n // 商店唯一ID '}]}, 'expShop1': {'name': '', 'icon': '', 'textInList': '', 'use': ' // 该商店使用的是经验进行计算 ', 'need': ' // 如果是对于每个选项所需要的数值不同,这里直接写-1,然后下面选项里给定具体数值 ', 'text': ' // 在choices中写need,可以针对每个选项都有不同的需求。 // 这里的need同样可以以times作为参数,比如 "need": "100+20*times" ', 'choices': [{'text': '', 'need': '', 'effect': ' // 多个effect直接以分号分开即可。如上面的意思是生命+1000,攻击+7,防御+7。 '}, {'text': '', 'need': '', 'effect': ''}, {'text': '', 'need': '', 'effect': ' // 经验升级所需要的数值,是一个数组 '}]}}, 'levelUp': [' // 第一项为初始等级,可以简单留空,也可以写name // 每一个里面可以含有三个参数 name, need, effect // need为所需要的经验数值,是一个正整数。请确保need所需的依次递增 // name为该等级的名称,也可以省略代表使用系统默认值;本项将显示在状态栏中 // effect为本次升级所执行的操作,可由若干项组成,由分号分开 // 其中每一项写法和上面的商店完全相同,同样必须是X+=Y的形式,Y是一个表达式,同样可以使用status:xxx或item:xxx代表勇士的某项数值/道具个数 ', {'need': '', 'name': '', 'effect': ' // 先将生命提升攻防和的2倍;再将攻击+10,防御+10 // effect也允许写一个function,代表本次升级将会执行的操作 '}, {'need': '', 'effect': ' // 依次往下写需要的数值即可 \n // 各种数值;一些数值可以在这里设置 \n /****** 角色相关 ******/ '}]}, 'values': {'HPMAX': ' // HP上限;-1则无上限 ', 'lavaDamage': ' // 经过血网受到的伤害 ', 'poisonDamage': ' // 中毒后每步受到的伤害 ', 'weakValue': ' // 衰弱状态下攻防减少的数值 /****** 道具相关 ******/ ', 'redJewel': ' // 红宝石加攻击的数值 ', 'blueJewel': ' // 蓝宝石加防御的数值 ', 'greenJewel': ' // 绿宝石加魔防的数值 ', 'redPotion': ' // 红血瓶加血数值 ', 'bluePotion': ' // 蓝血瓶加血数值 ', 'yellowPotion': ' // 黄血瓶加血数值 ', 'greenPotion': ' // 绿血瓶加血数值 ', 'sword1': ' // 铁剑加攻数值 ', 'shield1': ' // 铁盾加防数值 ', 'sword2': ' // 银剑加攻数值 ', 'shield2': ' // 银盾加防数值 ', 'sword3': ' // 骑士剑加攻数值 ', 'shield3': ' // 骑士盾加防数值 ', 'sword4': ' // 圣剑加攻数值 ', 'shield4': ' // 圣盾加防数值 ', 'sword5': ' // 神圣剑加攻数值 ', 'shield5': ' // 神圣盾加防数值 ', 'moneyPocket': ' // 金钱袋加金币的数值 /****** 怪物相关 ******/ ', 'breakArmor': ' // 破甲的比例(战斗前,怪物附加角色防御的x%作为伤害) ', 'counterAttack': ' // 反击的比例(战斗时,怪物每回合附加角色攻击的x%作为伤害,无视角色防御) ', 'purify': ' // 净化的比例(战斗前,怪物附加勇士魔防的x倍作为伤害) ', 'hatred': ' // 仇恨属性中,每杀死一个怪物获得的仇恨值 /****** 系统相关 ******/ ', 'animateSpeed': ' // 动画时间 \n // 系统FLAG,在游戏运行中中请不要修改它。 \n /****** 角色状态相关 ******/ '}, 'flags': {'enableNegativeDamage': ' // 是否支持负伤害(回血) ', 'enableFloor': ' // 是否在状态栏显示当前楼层 ', 'enableLv': ' // 是否在状态栏显示当前等级 ', 'enableMDef': ' // 是否在状态栏及战斗界面显示魔防(护盾) ', 'enableMoney': ' // 是否在状态栏、怪物手册及战斗界面显示金币 ', 'enableExperience': ' // 是否在状态栏、怪物手册及战斗界面显示经验 ', 'enableLevelUp': ' // 是否允许等级提升(进阶);如果上面enableExperience为false,则此项恒视为false ', 'enableDebuff': ' // 是否涉及毒衰咒;如果此项为false则不会在状态栏中显示毒衰咒的debuff ////// 上述的几个开关将直接影响状态栏的显示效果 ////// /****** 道具相关 ******/ ', 'flyNearStair': ' // 是否需要在楼梯边使用传送器 ', 'pickaxeFourDirections': ' // 使用破墙镐是否四个方向都破坏;如果false则只破坏面前的墙壁 ', 'bombFourDirections': ' // 使用炸弹是否四个方向都会炸;如果false则只炸面前的怪物(即和圣锤等价) ', 'bigKeyIsBox': ' // 如果此项为true,则视为钥匙盒,红黄蓝钥匙+1;若为false,则视为大黄门钥匙 /****** 系统相关 ******/ ', 'startDirectly': ' // 点击“开始游戏”后是否立刻开始游戏而不显示难度选择界面 ', 'canOpenBattleAnimate': ' // 是否允许用户开启战斗过程;如果此项为false,则下面两项均强制视为false ', 'showBattleAnimateConfirm': ' // 是否在游戏开始时提供“是否开启战斗动画”的选项 ', 'battleAnimate': ' // 是否默认显示战斗动画;用户可以手动在菜单栏中开关 ', 'displayEnemyDamage': ' // 是否地图怪物显伤;用户可以手动在菜单栏中开关 ', 'displayExtraDamage': ' // 是否地图高级显伤(领域、夹击等);用户可以手动在菜单栏中开关 ', 'enableGentleClick': ' // 是否允许轻触(获得面前物品) ', 'portalWithoutTrigger': ' // 经过楼梯、传送门时是否能“穿透”。穿透的意思是,自动寻路得到的的路径中间经过了楼梯,行走时是否触发楼层转换事件 ', 'potionWhileRouting': ' // 寻路算法是否经过血瓶;如果该项为false,则寻路算法会自动尽量绕过血瓶 '}}, - null); + null]); } //callback(obj,commentObj,err:String) diff --git a/_server/editor_file.js b/_server/editor_file.js index d458b341..d547915a 100644 --- a/_server/editor_file.js +++ b/_server/editor_file.js @@ -1,11 +1,20 @@ (function(){ editor_file = {}; + (function(){ + var script = document.createElement('script'); + script.src = 'comment.js'; + document.body.appendChild(script); + script.onload = function () { + editor_file.comment=comment_c456ea59_6018_45ef_8bcc_211a24c627dc; + delete(comment_c456ea59_6018_45ef_8bcc_211a24c627dc); + } + })(); editor_file.getFloorFileList = function(editor,callback){ if (!isset(callback)) throw('未设置callback'); var fs = editor.fs; - fs.readdir('libs/project/floors',function(err, data){ + fs.readdir('project/floors',function(err, data){ callback([data,err]); }); } @@ -14,7 +23,7 @@ //filename不含'/'不含'.js' if (!isset(callback)) throw('未设置callback'); var fs = editor.fs; - fs.readFile('libs/project/floors/'+filename+'.js','utf-8',function(err, data){ + fs.readFile('project/floors/'+filename+'.js','utf-8',function(err, data){ if (err!=null){callback(err);return;} data=data.split('='); data=[data[0],data.slice(1).join('=')]; @@ -39,7 +48,7 @@ if (!isset(editor.currentFloorId) || !isset(editor.currentfloorData)) { callback('未选中文件或无数据'); } - var filename = 'libs/project/floors/' + editor.currentFloorId + '.js'; + var filename = 'project/floors/' + editor.currentFloorId + '.js'; var datastr = ['main.floors.' , editor.currentFloorId , '=\n{']; for(var ii in editor.currentfloorData) if (editor.currentfloorData.hasOwnProperty(ii)) { @@ -75,17 +84,18 @@ var change = -1; for(var ii in core.maps.blocksInfo){ if (ii==idnum) { - if (info.idnum==idnum){change=ii;break;}//修改id + //暂时只允许创建新的不允许修改已有的 + //if (info.idnum==idnum){change=ii;break;}//修改id callback('idnum重复了'); return; } if (core.maps.blocksInfo[ii].id==id) { - if (info.id==id){change=ii;break;}//修改idnum + //if (info.id==id){change=ii;break;}//修改idnum callback('id重复了'); return; } } - throw('需要改实现') + /* if (change!=-1 && change!=idnum){//修改idnum core.maps.blocksInfo[idnum] = core.maps.blocksInfo[change]; delete(core.maps.blocksInfo[change]); @@ -102,8 +112,20 @@ core.maps.blocksInfo[idnum]={'cls': info.images, 'id':id}; core.icons.icons[info.images][id]=info.y; } + */ + var templist=[]; + var tempcallback = function (err) { + templist.push(err); + if (templist.length ==2 ) { + if (templist[0]!=null || templist[1]!=null) + callback((templist[0]||'')+'\n'+(templist[1]||'')); + else + callback(null); + } + } + saveSetting('maps',[["add","['"+idnum+"']",{'cls': info.images, 'id':id}]],tempcallback); + saveSetting('icons',[["add","['"+info.images+"']['"+id+"']",info.y]],tempcallback); - throw('尚未实现:save(core.maps.blocksInfo,map.js);save(core.icons.icons,icons.js);') callback(null); } //callback(err:String) @@ -116,10 +138,10 @@ 为[]时只查询不修改 */ if (!isset(callback)) throw('未设置callback'); - callback( + callback([ {'items':{'cls': 'items', 'name': '红宝石'},'itemEffect':'core.status.hero.atk += core.values.redJewel','itemEffectTip':"',攻击+'+core.values.redJewel"}, - {'items':{'cls': "/*只能取keys items constants tools\\n$range(thiseval in ['keys','items','constants','tools'])\\n*/", 'name': '', 'text': ''},'itemEffect':'','itemEffectTip':''}, - null); + editor_file.comment.items, + null]); //只有items.cls是items的才有itemEffect和itemEffectTip,keys和constants和tools只有items } @@ -127,10 +149,10 @@ editor_file.editEnemy = function(editor,id,actionList,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 if (!isset(callback)) throw('未设置callback'); - callback( + callback([ {'name': '初级巫师', 'hp': 100, 'atk': 120, 'def': 0, 'money': 16, 'experience': 0, 'special': 15, 'value': 100, "bomb": false}, - {'name': '名称', 'hp': '生命值', 'atk': '攻击力', 'def': '防御力', 'money': '金币', 'experience': '经验', 'special': '特殊属性\n1:先攻,2:魔攻,3:坚固,4:2连击,5:3连击,6:4连击,7:破甲,8:反击,9:净化,10:模仿,11:吸血,12:中毒,13:衰弱,14:诅咒,15:领域,16:夹击,17:仇恨\n多个属性例如用010411表示先攻2连击吸血\n模仿怪的攻防设为0就好\n', 'value': '特殊属性的数值\n领域怪需要加value表示领域伤害的数值\n吸血怪需要在后面添加value代表吸血比例', 'bomb':' 加入 "bomb": false 代表该怪物不可被炸弹或圣锤炸掉'}, - null); + editor_file.comment.enemys, + null]); } //callback(obj,commentObj,err:String) @@ -139,10 +161,10 @@ editor_file.editLoc = function(editor,x,y,actionList,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 if (!isset(callback)) throw('未设置callback'); - callback( + callback([ {"events":['\t[老人,man]这些是本样板支持的所有的道具。\n\n道具分为三类:items, constants, tools。\nitems 为即捡即用类道具,例如宝石、血瓶、剑盾等。\nconstants 为永久道具,例如怪物手册、楼层传送器、幸运金币等。\ntools 为消耗类道具,例如破墙镐、炸弹、中心对称飞行器等。\n\n后两类道具在工具栏中可以看到并使用。', '\t[老人,man]有关道具效果,定义在items.js中。\n目前大多数道具已有默认行为,如有自定义的需求则需在items.js中修改代码。', '\t[老人,man]constants 和 tools 各最多只允许12种,多了会导致图标溢出。', '\t[老人,man]拾取道具结束后可触发 afterGetItem 事件。\n\n有关事件的各种信息在下一层会有更为详细的说明。', {'type': 'hide', 'time': 500}],"changeFloor":"","afterBattle":"","afterGetItem":"","afterOpenDoor":""}, {"events":['', '', '', '', {'type': '', 'time': ' // 消失 \n // 守着门的老人 '}],"changeFloor":"","afterBattle":"","afterGetItem":"","afterOpenDoor":""}, - null); + null]); } //callback(obj,commentObj,err:String) @@ -151,10 +173,10 @@ editor_file.editFloor = function(editor,actionList,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 if (!isset(callback)) throw('未设置callback'); - callback( + callback([ {'floorId': 'sample0', 'title': '样板 0 层', 'name': '0', 'canFlyTo': True, 'canUseQuickShop': True, 'defaultGround': 'ground', 'firstArrive': ['\t[样板提示]首次到达某层可以触发 firstArrive 事件,该事件可类似于RMXP中的“自动执行脚本”。\n\n本事件支持一切的事件类型,常常用来触发对话,例如:', '\t[hero]我是谁?我从哪来?我又要到哪去?', '\t[仙子,fairy]你问我...?我也不知道啊...', '本层主要对道具、门、怪物等进行介绍,有关事件的各种信息在下一层会有更为详细的说明。']}, {'floorId': '// 这里需要改楼层名,请和文件名及下面的floorId保持完全一致 // 楼层唯一标识符仅能由字母、数字、下划线组成,且不能由数字开头 // 推荐用法:第20层就用MT20,第38层就用MT38,地下6层就用MT_6(用下划线代替负号),隐藏3层用MT3h(h表示隐藏),等等 \n // 楼层唯一标识符,需要和名字完全一致 ', 'title': ' // 楼层中文名 ', 'name': ' // 显示在状态栏中的层数 ', 'canFlyTo': ' // 该楼能否被楼传器飞到(不能的话在该楼也不允许使用楼传器) ', 'canUseQuickShop': ' // 该层是否允许使用快捷商店 ', 'defaultGround': ' // 默认地面的图块ID(terrains中) \n // 地图数据,需要是13x13,建议使用地图生成器来生成 ', 'firstArrive': ['', '', '', ' // 该楼的所有可能事件列表 \n // 守着道具的老人 ']}, - null); + null]); } //callback(obj,commentObj,err:String) @@ -165,10 +187,10 @@ editor_file.editTower = function(editor,actionList,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 if (!isset(callback)) throw('未设置callback'); - callback( + callback([ {'main': {'useCompress': False, 'floorIds': ['sample0', 'sample1', 'sample2', 'test']}, 'firstData': {'title': '魔塔样板', 'name': 'template', 'version': 'Ver 1.0.0 (Beta)', 'floorId': 'sample0', 'hero': {'name': '阳光', 'lv': 1, 'hp': 2000, 'atk': 100, 'def': 100, 'mdef': 100, 'money': 100, 'experience': 0, 'items': {'keys': {'yellowKey': 0, 'blueKey': 0, 'redKey': 0}, 'constants': {}, 'tools': {}}, 'flyRange': [], 'loc': {'direction': 'up', 'x': 6, 'y': 10}, 'flags': {'poison': False, 'weak': False, 'curse': False}}, 'startText': ['Hi,欢迎来到 HTML5 魔塔样板!\n\n本样板由艾之葵制作,可以让你在不会写任何代码\n的情况下也能做出属于自己的H5魔塔!', '这里游戏开始时的剧情。\n定义在data.js的startText处。\n\n你可以在这里写上自己的内容。', '赶快来试一试吧!'], 'shops': {'moneyShop1': {'name': '贪婪之神', 'icon': 'blueShop', 'textInList': '1F金币商店', 'use': 'money', 'need': '20+10*times*(times+1)', 'text': '勇敢的武士啊,给我${need}金币就可以:', 'choices': [{'text': '生命+800', 'effect': 'status:hp+=800'}, {'text': '攻击+4', 'effect': 'status:atk+=4'}, {'text': '防御+4', 'effect': 'status:def+=4'}, {'text': '魔防+10', 'effect': 'status:mdef+=10'}]}, 'expShop1': {'name': '经验之神', 'icon': 'pinkShop', 'textInList': '1F经验商店', 'use': 'experience', 'need': '-1', 'text': '勇敢的武士啊,给我若干经验就可以:', 'choices': [{'text': '等级+1', 'need': '100', 'effect': 'status:lv+=1;status:hp+=1000;status:atk+=7;status:def+=7'}, {'text': '攻击+5', 'need': '30', 'effect': 'status:atk+=5'}, {'text': '防御+5', 'need': '30', 'effect': 'status:def+=5'}]}}, 'levelUp': [{}, {'need': 20, 'name': '第二级', 'effect': 'status:hp+=2*(status:atk+status:def);status:atk+=10;status:def+=10'}, {'need': 40, 'effect': 'function () {\n core.drawText("恭喜升级!");\n core.status.hero.hp *= 2;\n core.status.hero.atk += 100;\n core.status.hero.def += 100;\n }'}]}, 'values': {'HPMAX': 999999, 'lavaDamage': 100, 'poisonDamage': 10, 'weakValue': 20, 'redJewel': 3, 'blueJewel': 3, 'greenJewel': 5, 'redPotion': 100, 'bluePotion': 250, 'yellowPotion': 500, 'greenPotion': 800, 'sword1': 10, 'shield1': 10, 'sword2': 20, 'shield2': 20, 'sword3': 40, 'shield3': 40, 'sword4': 80, 'shield4': 80, 'sword5': 160, 'shield5': 160, 'moneyPocket': 500, 'breakArmor': 0.9, 'counterAttack': 0.1, 'purify': 3, 'hatred': 2, 'animateSpeed': 500}, 'flags': {'enableNegativeDamage': True, 'enableFloor': False, 'enableLv': True, 'enableMDef': True, 'enableMoney': True, 'enableExperience': True, 'enableLevelUp': False, 'enableDebuff': True, 'flyNearStair': True, 'pickaxeFourDirections': True, 'bombFourDirections': True, 'bigKeyIsBox': False, 'startDirectly': False, 'canOpenBattleAnimate': True, 'showBattleAnimateConfirm': True, 'battleAnimate': True, 'displayEnemyDamage': True, 'displayExtraDamage': False, 'enableGentleClick': True, 'portalWithoutTrigger': True, 'potionWhileRouting': False}}, {'main': {'useCompress': ' // 是否使用压缩文件 // 当你即将发布你的塔时,请使用“JS代码压缩工具”将所有js代码进行压缩,然后将这里的useCompress改为true。 // 请注意,只有useCompress是false时才会读取floors目录下的文件,为true时会直接读取libs目录下的floors.min.js文件。 // 如果要进行剧本的修改请务必将其改成false。 \n // 在这里按顺序放所有的楼层;其顺序直接影响到楼层传送器的顺序和上楼器/下楼器的顺序 ', 'floorIds': ['', '', '', '']}, 'firstData': {'title': ' // 游戏名,将显示在标题页面以及切换楼层的界面中 ', 'name': ' // 游戏的唯一英文标识符。由英文、数字、下划线组成,不能超过20个字符。 ', 'version': ' // 当前游戏版本;版本不一致的存档不能通用。 ', 'floorId': ' // 初始楼层ID \n // 勇士初始数据 ', 'hero': {'name': ' // 勇士名;可以改成喜欢的 ', 'lv': ' // 初始等级,该项必须为正整数 ', 'hp': ' // 初始生命值 ', 'atk': ' // 初始攻击 ', 'def': ' // 初始防御 ', 'mdef': ' // 初始魔防 ', 'money': ' // 初始金币 ', 'experience': ' // 初始经验 \n // 初始道具个数 ', 'items': {'keys': {'yellowKey': '', 'blueKey': '', 'redKey': ''}, 'constants': '', 'tools': ''}, 'flyRange': ' // 初始可飞的楼层;一般留空数组即可 ', 'loc': {'direction': '', 'x': '', 'y': ' // 勇士初始位置 \n // 游戏过程中的变量或flags '}, 'flags': {'poison': ' // 毒 ', 'weak': ' // 衰 ', 'curse': ' // 咒 \n // 游戏开始前剧情。如果无剧情直接留一个空数组即可。 '}}, 'startText': ['', '', ' // 定义全局商店(即快捷商店) \n // 商店唯一ID '], 'shops': {'moneyShop1': {'name': ' // 商店名称(标题) ', 'icon': ' // 商店图标,blueShop为蓝色商店,pinkShop为粉色商店 ', 'textInList': ' // 在快捷商店栏中显示的名称 ', 'use': ' // 商店所要使用的。只能是"money"或"experience"。 ', 'need': ' // 商店需要的金币/经验数值;可以是一个表达式,以times作为参数计算。 // 这里用到的times为该商店的已经的访问次数。首次访问该商店时times的值为0。 // 上面的例子是50层商店的计算公式。你也可以写任意其他的计算公式,只要以times作为参数即可。 // 例如: "need": "25" 就是恒定需要25金币的商店; "need": "20+2*times" 就是第一次访问要20金币,以后每次递增2金币的商店。 // 如果是对于每个选项有不同的计算公式,写 "need": "-1" 即可。可参见下面的经验商店。 ', 'text': ' // 显示的文字,需手动加换行符。可以使用${need}表示上面的need值。 \n // 商店的选项 ', 'choices': [{'text': '', 'effect': ' // 如果有多个effect以分号分开,参见下面的经验商店 '}, {'text': '', 'effect': ''}, {'text': '', 'effect': ''}, {'text': '', 'effect': ' // effect只能对status和item进行操作,不能修改flag值。 // 必须是X+=Y的形式,其中Y可以是一个表达式,以status:xxx或item:xxx为参数 // 其他effect样例: // "item:yellowKey+=1" 黄钥匙+1 // "item:pickaxe+=3" 破墙镐+3 // "status:hp+=2*(status:atk+status:def)" 将生命提升攻防和的数值的两倍 \n // 商店唯一ID '}]}, 'expShop1': {'name': '', 'icon': '', 'textInList': '', 'use': ' // 该商店使用的是经验进行计算 ', 'need': ' // 如果是对于每个选项所需要的数值不同,这里直接写-1,然后下面选项里给定具体数值 ', 'text': ' // 在choices中写need,可以针对每个选项都有不同的需求。 // 这里的need同样可以以times作为参数,比如 "need": "100+20*times" ', 'choices': [{'text': '', 'need': '', 'effect': ' // 多个effect直接以分号分开即可。如上面的意思是生命+1000,攻击+7,防御+7。 '}, {'text': '', 'need': '', 'effect': ''}, {'text': '', 'need': '', 'effect': ' // 经验升级所需要的数值,是一个数组 '}]}}, 'levelUp': [' // 第一项为初始等级,可以简单留空,也可以写name // 每一个里面可以含有三个参数 name, need, effect // need为所需要的经验数值,是一个正整数。请确保need所需的依次递增 // name为该等级的名称,也可以省略代表使用系统默认值;本项将显示在状态栏中 // effect为本次升级所执行的操作,可由若干项组成,由分号分开 // 其中每一项写法和上面的商店完全相同,同样必须是X+=Y的形式,Y是一个表达式,同样可以使用status:xxx或item:xxx代表勇士的某项数值/道具个数 ', {'need': '', 'name': '', 'effect': ' // 先将生命提升攻防和的2倍;再将攻击+10,防御+10 // effect也允许写一个function,代表本次升级将会执行的操作 '}, {'need': '', 'effect': ' // 依次往下写需要的数值即可 \n // 各种数值;一些数值可以在这里设置 \n /****** 角色相关 ******/ '}]}, 'values': {'HPMAX': ' // HP上限;-1则无上限 ', 'lavaDamage': ' // 经过血网受到的伤害 ', 'poisonDamage': ' // 中毒后每步受到的伤害 ', 'weakValue': ' // 衰弱状态下攻防减少的数值 /****** 道具相关 ******/ ', 'redJewel': ' // 红宝石加攻击的数值 ', 'blueJewel': ' // 蓝宝石加防御的数值 ', 'greenJewel': ' // 绿宝石加魔防的数值 ', 'redPotion': ' // 红血瓶加血数值 ', 'bluePotion': ' // 蓝血瓶加血数值 ', 'yellowPotion': ' // 黄血瓶加血数值 ', 'greenPotion': ' // 绿血瓶加血数值 ', 'sword1': ' // 铁剑加攻数值 ', 'shield1': ' // 铁盾加防数值 ', 'sword2': ' // 银剑加攻数值 ', 'shield2': ' // 银盾加防数值 ', 'sword3': ' // 骑士剑加攻数值 ', 'shield3': ' // 骑士盾加防数值 ', 'sword4': ' // 圣剑加攻数值 ', 'shield4': ' // 圣盾加防数值 ', 'sword5': ' // 神圣剑加攻数值 ', 'shield5': ' // 神圣盾加防数值 ', 'moneyPocket': ' // 金钱袋加金币的数值 /****** 怪物相关 ******/ ', 'breakArmor': ' // 破甲的比例(战斗前,怪物附加角色防御的x%作为伤害) ', 'counterAttack': ' // 反击的比例(战斗时,怪物每回合附加角色攻击的x%作为伤害,无视角色防御) ', 'purify': ' // 净化的比例(战斗前,怪物附加勇士魔防的x倍作为伤害) ', 'hatred': ' // 仇恨属性中,每杀死一个怪物获得的仇恨值 /****** 系统相关 ******/ ', 'animateSpeed': ' // 动画时间 \n // 系统FLAG,在游戏运行中中请不要修改它。 \n /****** 角色状态相关 ******/ '}, 'flags': {'enableNegativeDamage': ' // 是否支持负伤害(回血) ', 'enableFloor': ' // 是否在状态栏显示当前楼层 ', 'enableLv': ' // 是否在状态栏显示当前等级 ', 'enableMDef': ' // 是否在状态栏及战斗界面显示魔防(护盾) ', 'enableMoney': ' // 是否在状态栏、怪物手册及战斗界面显示金币 ', 'enableExperience': ' // 是否在状态栏、怪物手册及战斗界面显示经验 ', 'enableLevelUp': ' // 是否允许等级提升(进阶);如果上面enableExperience为false,则此项恒视为false ', 'enableDebuff': ' // 是否涉及毒衰咒;如果此项为false则不会在状态栏中显示毒衰咒的debuff ////// 上述的几个开关将直接影响状态栏的显示效果 ////// /****** 道具相关 ******/ ', 'flyNearStair': ' // 是否需要在楼梯边使用传送器 ', 'pickaxeFourDirections': ' // 使用破墙镐是否四个方向都破坏;如果false则只破坏面前的墙壁 ', 'bombFourDirections': ' // 使用炸弹是否四个方向都会炸;如果false则只炸面前的怪物(即和圣锤等价) ', 'bigKeyIsBox': ' // 如果此项为true,则视为钥匙盒,红黄蓝钥匙+1;若为false,则视为大黄门钥匙 /****** 系统相关 ******/ ', 'startDirectly': ' // 点击“开始游戏”后是否立刻开始游戏而不显示难度选择界面 ', 'canOpenBattleAnimate': ' // 是否允许用户开启战斗过程;如果此项为false,则下面两项均强制视为false ', 'showBattleAnimateConfirm': ' // 是否在游戏开始时提供“是否开启战斗动画”的选项 ', 'battleAnimate': ' // 是否默认显示战斗动画;用户可以手动在菜单栏中开关 ', 'displayEnemyDamage': ' // 是否地图怪物显伤;用户可以手动在菜单栏中开关 ', 'displayExtraDamage': ' // 是否地图高级显伤(领域、夹击等);用户可以手动在菜单栏中开关 ', 'enableGentleClick': ' // 是否允许轻触(获得面前物品) ', 'portalWithoutTrigger': ' // 经过楼梯、传送门时是否能“穿透”。穿透的意思是,自动寻路得到的的路径中间经过了楼梯,行走时是否触发楼层转换事件 ', 'potionWhileRouting': ' // 寻路算法是否经过血瓶;如果该项为false,则寻路算法会自动尽量绕过血瓶 '}}, - null); + null]); } //callback(obj,commentObj,err:String) @@ -200,6 +222,7 @@ } var saveSetting = function(file,actionList,callback) { + throw('尚未实现'); if (file=='icons') {} if (file=='maps') {} if (file=='items') {}