diff --git a/README.md b/README.md index 7e331545..b95dbf49 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,20 @@ HTML5 canvas制作的魔塔样板,支持全平台游戏! ## 更新说明 +### 2019.6.7 V2.6.2 + +* [x] 可以拖动地图上的图块和事件,复制剪切和跨楼层粘贴 +* [x] 新增事件的地图选点功能,可以在地图上选择落点 +* [x] 现在素材区可以进行折叠与自动换列了 +* [x] 新增UI绘制系列事件,并且可以进行预览 +* [x] 显示文本事件的标题解析 +* [x] 新增常用工具:额外素材合并工具 +* [x] 进一步提升24倍速的播放速度 +* [x] 楼层转换增加对称点 +* [x] 增加编辑器快捷键说明,H键查看 +* [x] 文档-事件增加事件编辑器截图 +* [x] 大量细节优化,所有已知的Bug修复 + ### 2019.5.2 V2.6.1 * [x] 区域优化的录像播放功能,R键使用 diff --git a/_docs/V2.0.md b/_docs/V2.0.md index 0b8bd92a..076c827c 100644 --- a/_docs/V2.0.md +++ b/_docs/V2.0.md @@ -1,6 +1,6 @@ # V2.0版本介绍 -?> 目前版本**v2.6.1**,上次更新时间:* {docsify-updated} * +?> 目前版本**v2.6.2**,上次更新时间:* {docsify-updated} * 目前样板已经更新到V2.0版本以上,本章将对V2.0的一些内容进行介绍。 diff --git a/_docs/api.md b/_docs/api.md index 640f74fc..c74a7267 100644 --- a/_docs/api.md +++ b/_docs/api.md @@ -1,6 +1,6 @@ # 附录:API列表 -?> 目前版本**v2.6.1**,上次更新时间:* {docsify-updated} * +?> 目前版本**v2.6.2**,上次更新时间:* {docsify-updated} * 这里将列出所有被转发到core的API,没有被转发的函数此处不会列出,请自行在代码中查看。 diff --git a/_docs/element.md b/_docs/element.md index a6fbcc9f..bd2966de 100644 --- a/_docs/element.md +++ b/_docs/element.md @@ -1,6 +1,6 @@ # 元件说明 -?> 目前版本**v2.6.1**,上次更新时间:* {docsify-updated} * +?> 目前版本**v2.6.2**,上次更新时间:* {docsify-updated} * 在本章中,将对样板里的各个元件进行说明。各个元件主要包括道具、门、怪物、楼梯等等。 diff --git a/_docs/event.md b/_docs/event.md index 64a598d1..9c40d646 100644 --- a/_docs/event.md +++ b/_docs/event.md @@ -1,6 +1,6 @@ # 事件 -?> 目前版本**v2.6.1**,上次更新时间:* {docsify-updated} * +?> 目前版本**v2.6.2**,上次更新时间:* {docsify-updated} * 本章内将对样板所支持的事件进行介绍。 @@ -24,7 +24,7 @@ 它能通过拖动、复制粘贴等方式帮助你快速生成事件列表,而不用手动打大量字符。 -下述所说的都是在事件编辑器右边所展示的,该事件的代码化写法。 +下述所说的都是在事件编辑器右边所展示的,该事件的代码化写法;部分增加了可视化事件编辑器的截图示意(感谢秋橙的制作)。 强烈建议要对每个事件的写法进行了解,因为在脚本编辑,`insertAction`等地方需要插入自定义事件时,还是很有必要的。 @@ -154,6 +154,8 @@ ] ``` +![](img/events/1.jpg) + 该项可以简写成直接的字符串的形式,即下面这种方式也是可以的: ``` js @@ -188,7 +190,9 @@ 从V2.5.2以后,新增了绘制大头像的功能。绘制大头像图的基本写法是`\t[1.png]`或者`\t[标题,1.png]`。 -从V2.6开始,所有图块都允许只写ID,对于非怪物则没有标题。 +从V2.6开始,所有图块都允许只写ID,对于非怪物则仅当图块属性中设置了name才有标题(否则不显示标题)。 + +另外注意的是,名字可以用null从而只显示动画而不显示标题。 ``` js [ @@ -202,10 +206,13 @@ "\t[1.png]绘制1.png这个头像图", "\t[标题,1.png]同时绘制标题和1.png这个头像图", "\t[sword1]获得铁剑,没有标题", - "\t[man]没有标题的npc动画" + "\t[man]没有标题的npc动画", + "\t[null,greenSlime]只绘制怪物动画而不显示标题" ] ``` +![](img/events/2.jpg) + !> 大头像的头像图需要在全塔属性中注册,且必须是png格式,不可以用jpg或者其他格式,请自行转换。 除此以外,我们还能实现“对话框效果”,只要有`\b[...]`就可以。 @@ -231,9 +238,7 @@ ] ``` -从V2.6开始,`\b`提供了更多功能,包括: - -- `\b[hero]` +![](img/events/3.jpg) !> `\t[...]`必须在`\b[...]`前面!不然两者都无法正常显示。 @@ -247,6 +252,8 @@ ] ``` +![](img/events/4.jpg) + 从V2.5.3以后,也可以使用`\f[...]`来同时绘制一张图片。 其基本写法是`\f[img,x,y]`,或者`\f[img,x,y,w,h]`,或者`\f[img,sx,sy,sw,sh,x,y,w,h]`。 @@ -262,6 +269,8 @@ ] ``` +![](img/events/5.jpg) + 从V2.5.5以后,也可以使用`\\i[...]`来在对话框中绘制一个图标。 这里可以使用一个合法ID(32x48图块除外),或使用一个系统图标(`core.statusBar.icons`中的内容)。 @@ -273,6 +282,8 @@ ] ``` +![](img/events/6.jpg) + **可以在控制台中输入`core.statusBar.icons`以查看所有的系统图标定义。** !> 注意,在事件块中,允许只写一个反斜杠`\i`,系统会自动转义成`\\i`;但是在脚本中必须两个反斜杠都写上! @@ -299,6 +310,8 @@ ] ``` +![](img/events/7.jpg) + - `status:xxx` 获取勇士属性时只能使用如下几个:hp(生命值),atk(攻击力),def(防御力),mdef(魔防值),money(金币),experience(经验),x(勇士的横坐标),y(勇士的纵坐标),direction(勇士的方向)。 - `item:xxx` 中的xxx为道具ID。所有道具的ID定义在items.js中,请自行查看。例如,`item:centerFly` 代表中心对称飞行器的个数。 - `flag:xxx` 中的xxx为一个自定义的变量/Flag(支持中文);如果没有对其进行赋值则默认值为0。 @@ -314,6 +327,8 @@ ] ``` +![](img/events/8.jpg) + text为文本正文内容,和上面的写法完全一致。 time为可选项,代表该自动文本的时间。可以不指定,不指定默认为3000毫秒。 @@ -334,6 +349,8 @@ time为可选项,代表该自动文本的时间。可以不指定,不指定 ] ``` +![](img/events/9.jpg) + text为正文文本内容。可以使用`${ }`来计算表达式的值,且使用`\n`手动换行。系统不会对滚动剧情文本进行自动换行。 time为可选项,代表总的滚动时间。默认为5000毫秒。 @@ -359,6 +376,8 @@ async可选,如果为true则会异步执行(即不等待当前事件执行 ] ``` +![](img/events/10.jpg) + title为可选项,如果设置则为一个RGB三元组或RGBA四元组,表示标题(名字)颜色。 默认值:`[255,215,0,1]` text为可选项,如果设置则为一个RGB三元组或RGBA四元组,表示正文颜色。 默认值:`[255,255,255,1]` @@ -389,6 +408,8 @@ time为可选项,表示文字添加的速度。若此项设置为0将直接全 ] ``` +![](img/events/11.jpg) + text必填,为显示的内容,支持`${}`的表达式计算。 icon是可选的,如果设置则会绘制图标,其可以是一个有效的ID,或者`core.statusBar.icons`中的系统图标。 @@ -403,6 +424,8 @@ icon是可选的,如果设置则会绘制图标,其可以是一个有效的I ] ``` +![](img/events/12.jpg) + 这个事件将在运行时被游戏跳过。 ### setValue:设置勇士的某个属性、道具个数,或某个变量/Flag的值 @@ -436,6 +459,8 @@ value是一个表达式,将通过这个表达式计算出的结果赋值给nam ] ``` +![](img/events/13.jpg) + 另外注意一点的是,如果hp被设置成了0或以下,将触发lose事件,直接死亡。 ### addValue:增减勇士的某个属性、道具个数,或某个变量/Flag的值 @@ -455,6 +480,8 @@ value是一个表达式,将通过这个表达式计算出的结果赋值给nam ] ``` +![](img/events/14.jpg) + ### setFloor:设置楼层属性 使用`{"type":"setFloor"}`可以设置某层楼的楼层属性。 @@ -471,6 +498,8 @@ value是一个表达式,将通过这个表达式计算出的结果赋值给nam ] ``` +![](img/events/15.jpg) + name为必填项,代表要修改的楼层属性,和楼层属性中的一一对应。 floorId为可选项,代表要修改的楼层ID;可以省略代表当前楼层。 @@ -489,6 +518,8 @@ value为必填项,代表要修改到的数值。其应该和楼层属性中的 ] ``` +![](img/events/16.jpg) + name必填项,代表要修改的全局属性。 value为必填项,代表要修改到的结果。此项无需再手动加单引号。 @@ -503,6 +534,8 @@ value为必填项,代表要修改到的结果。此项无需再手动加单引 ] ``` +![](img/events/17.jpg) + name必填项,代表要修改的全局数值,其和全塔属性中的values一一对应。 value为必填项,代表要修改到的结果。该项必须是个数值。 @@ -517,6 +550,8 @@ value为必填项,代表要修改到的结果。该项必须是个数值。 ] ``` +![](img/events/18.jpg) + name必填项,代表要修改的系统开关,其是全塔属性中的flags中的一部分。 value为必填项,只能为true或false,代表要修改到的结果。 @@ -537,6 +572,8 @@ value为必填项,只能为true或false,代表要修改到的结果。 ] ``` +![](img/events/19.jpg) + show事件需要用loc指定目标点的坐标,可以简单的写[x,y]代表一个点,也可以写个二维数组[[x1,y1],[x2,y2],...]来同时显示多个点。 从V2.2开始,loc也可以用变量来代替,例如 `"loc": ["flag:x", "flag:y"]`。下同。 @@ -575,6 +612,8 @@ NPC对话事件结束后如果需要NPC消失也需要调用 `{"type": "hide"}` ] ``` +![](img/events/20.jpg) + ### trigger:立即触发另一个地点的事件 `{"type":"trigger"}` 会立刻触发当层另一个地点的自定义事件。 @@ -588,6 +627,8 @@ NPC对话事件结束后如果需要NPC消失也需要调用 `{"type": "hide"}` ] ``` +![](img/events/21.jpg) + 其后面带有loc选项,代表另一个地点的坐标。 keep可选,如果此项为true则不会结束当前的事件列表,否则会中断当前的事件流。 @@ -613,6 +654,8 @@ keep可选,如果此项为true则不会结束当前的事件列表,否则会 ] ``` +![](img/events/22.jpg) + `insert`的写法有两种,可以写`name`,或者`loc`。 - 如果写了`"name": "xxx"`,则会去公共事件列表中找寻对应的事件,并执行。 @@ -650,6 +693,8 @@ revisit和trigger完全相同,只不过是立刻触发的还是本地点的事 ] ``` +![](img/events/23.jpg) + revisit其实是trigger的简写,只不过是loc固定为当前点。 revisit常常使用在一些商人之类的地方,当用户购买物品后不是离开,而是立刻重新访问重新进入购买页面。 @@ -669,6 +714,8 @@ revisit常常使用在一些商人之类的地方,当用户购买物品后不 ] ``` +![](img/events/24.jpg) + ### setBlock:设置某个图块 我们可以采用 `{"type": "setBlock"}` 来改变某个地图块。 @@ -682,6 +729,8 @@ revisit常常使用在一些商人之类的地方,当用户购买物品后不 ] ``` +![](img/events/25.jpg) + floorId为可选的,表示要更改的目标楼层。如果忽略此项,则默认为当前楼层。 loc为可选的,表示要更改地图块的坐标。如果忽略此项,则默认为当前事件点。 @@ -712,6 +761,8 @@ number为**要更改到的数字**,有关“数字”的定义详见参见[素 ] ``` +![](img/events/26.jpg) + loc为要隐藏的贴图的左上角坐标,可以简单的写[x,y]代表一个点,也可以写个二维数组[[x1,y1],[x2,y2],...]来同时显示多个点。 如果同时存在若干个贴图都是是该坐标为左上角,则这些贴图全部会被隐藏。 @@ -744,6 +795,8 @@ floorId为目标点的楼层,如果是当前楼层可以忽略不写。 ] ``` +![](img/events/27.jpg) + name为必选的,且只能是`bg`和`fg`之一,分别代表背景图层和前景图层。 loc为要隐藏的贴图的左上角坐标,可以简单的写[x,y]代表一个点,也可以写个二维数组[[x1,y1],[x2,y2],...]来同时显示多个点。 @@ -774,6 +827,8 @@ floorId为目标点的楼层,如果是当前楼层可以忽略不写。 ] ``` +![](img/events/28.jpg) + name为必选的,且只能是`bg`和`fg`之一,分别代表背景层和前景层。 floorId为可选的,表示要更改的目标楼层。如果忽略此项,则默认为当前楼层。 @@ -794,6 +849,8 @@ loc为可选的,表示要更改地图块的坐标。如果忽略此项,则 ] ``` +![](img/events/29.jpg) + name是可选的,代表目标行走图的文件名。 !> **目标行走图必须在全塔属性的this.images中被定义过,且宽度必须是128像素(高度不限)。** @@ -836,6 +893,8 @@ name是可选的,代表目标行走图的文件名。 ] ``` +![](img/events/30.jpg) + 默认的等待事件可以被Ctrl跳过,下面两种情况下不可呗跳过: - 加上`"noSkip": true`后 - 当前存在尚未执行完毕的异步事件。 @@ -851,6 +910,8 @@ name是可选的,代表目标行走图的文件名。 ], ``` +![](img/events/31.jpg) + 从V2.6开始,有两种写法: - 写id,则视为和空降怪物进行强制战斗,不会执行一些战后事件,也不会隐藏任何点。 - 写loc(可选,不填默认当前点),则视为和某点怪物进行强制战斗,会隐藏该点并且插入该点战后事件执行。 @@ -871,6 +932,8 @@ name是可选的,代表目标行走图的文件名。 ] ``` +![](img/events/32.jpg) + loc指定门的坐标,floorId指定门所在的楼层ID。如果是当前层则可以忽略floorId选项。 如果loc所在的点是一个墙壁,则作为暗墙来开启。 @@ -896,6 +959,8 @@ async可选,如果为true则会异步执行(即不等待当前事件执行 ] ``` +![](img/events/33.jpg) + id为你要关门的ID,需要是一个合法的门,系统默认只支持如下几种: ``` @@ -924,6 +989,8 @@ changeFloor的事件写法大致如下。 ] ``` +![](img/events/34.jpg) + 可以看到,与上面的楼梯、传送门的写法十分类似。 但是相比那个而言,不支持stair楼梯位置(只能写坐标),没有穿透选项。 @@ -948,6 +1015,8 @@ time为可选的,指定的话将作为楼层切换动画的时间。 ] ``` +![](img/events/35.jpg) + ### useItem:使用道具 调用`{"type": "useItem"}`可以使用一个道具。 @@ -960,6 +1029,8 @@ time为可选的,指定的话将作为楼层切换动画的时间。 ] ``` +![](img/events/36.jpg) + 使用道具事件会消耗对应的道具。 如果当前不可使用该道具(如没有,或者达不到使用条件),则会进行提示并跳过本事件。 @@ -996,7 +1067,7 @@ name所指定的图片必须存在,在全塔属性中的images中被定义过 ``` js [ {"type": "unfollow", "name": "npc.png"}, // 将 npc.png 这个行走图取消跟随 - {"type": "follow"}, // 取消所有跟随 + {"type": "unfollow"}, // 取消所有跟随 ] ``` @@ -1029,6 +1100,8 @@ async可选,如果为true则会异步执行(即不等待当前事件执行 ] ``` +![](img/events/37.jpg) + name为动画名,**请确保动画在全塔属性中的animates中被定义过。** loc为动画的位置,可以是`[x,y]`表示在(x,y)点显示,也可以是字符串`"hero"`表示在勇士点显示。 @@ -1052,6 +1125,8 @@ loc可忽略,如果忽略则显示为事件当前点。 ] ``` +![](img/events/38.jpg) + code为图片编号,如果两张图片重叠,编号较大会覆盖编号较小的。该值需要在1~50之间。 image为图片名。**请确保图片在全塔属性中的images中被定义过。** @@ -1138,6 +1213,8 @@ loc为动图左上角坐标,以像素为单位进行计算。 ] ``` +![](img/events/39.jpg) + code为图片编号。该值需要在1~50之间。 to为终点图片左上角坐标,以像素为单位进行计算,不填写则视为当前图片位置。 @@ -1160,6 +1237,8 @@ async可选,如果为true则会异步执行(即不等待当前事件执行 ] ``` +![](img/events/40.jpg) + color为需要更改画面色调的颜色。它是一个数组,分别指定目标颜色的R,G,B,A值。 - 常见RGB颜色: 纯黑[0,0,0],纯白[255,255,255],纯红[255,0,0],等等。 - 第四元为Alpha值,即不透明度,为一个0到1之间的数。可以不指定,则默认为Alpha=1 @@ -1227,6 +1306,8 @@ level为天气的强度等级,在1-10之间。1级为最弱,10级为最强 ] ``` +![](img/events/41.jpg) + time选项必须指定,为每移动一步所需要用到的时间。 loc为需要移动的事件位置。可以省略,如果省略则移动本事件。 @@ -1257,6 +1338,8 @@ keep为一个可选项,代表该事件移动完毕后是否消失。如果该 } ``` +![](img/events/42.jpg) + 即,在移动的到达点指定一个事件,然后move事件中指定"keep":true,然后就可以触发目标点的事件了。 async可选,如果为true则会异步执行(即不等待当前事件执行完毕,立刻执行下一个事件)。 @@ -1381,6 +1464,8 @@ async可选,如果为true则会异步执行(即不等待当前事件执行 使用方法: `{"type": "setVolume", "value": 90, "time": 500, "async": true}` +![](img/events/43.jpg) + value为音量大小,在0到100之间,默认为100。设置后,BGM将使用该音量进行播放。SE的音量大小不会发生改变。 可以设置time为音量渐变时间。 @@ -1440,6 +1525,8 @@ async可选,如果为true则会异步执行(即不等待当前事件执行 ] ``` +![](img/events/44.jpg) + text为提示文字,可以在这里给输入提示文字。这里同样可以使用${ }来计算表达式的值。 当执行input事件时,将显示一个弹窗,并提示用户输入一个内容。 @@ -1459,6 +1546,8 @@ text为提示文字,可以在这里给输入提示文字。这里同样可以 ] ``` +![](img/events/45.jpg) + text为提示文字,可以在这里给输入提示文字。这里同样可以使用${ }来计算表达式的值。 当执行input2事件时,将显示一个弹窗,并提示用户输入一个内容。 @@ -1510,6 +1599,8 @@ text为提示文字,可以在这里给输入提示文字。这里同样可以 ] ``` +![](img/events/46.jpg) + 需要额外注意的几点: - 给定的表达式(condition)一般需要返回true或false。 @@ -1575,6 +1666,8 @@ nobreak是可选的,如果设置,则在当前条件满足并插入事件后 ] ``` +![](img/events/47.jpg) + 需要额外注意的几点: - 各个条件分支的判断是顺序执行的,因此若多个分支的条件都满足,将只执行最靠前的分支。 @@ -1603,6 +1696,7 @@ nobreak是可选的,如果设置,则在当前条件满足并插入事件后 ] ``` +![](img/events/48.jpg) ### choices:给用户提供选项 @@ -1708,12 +1802,16 @@ yes和no均为必填项,即用户点击确认或取消后执行的事件。 ] ``` +![](img/events/49.jpg) + ### dowhile:后置条件循环 `type:dowhile`可以制作一个后置条件循环。 其写法与参数和`type:while`完全一致,不过与其不同的是,会先执行一次事件列表,再对条件进行判定,就和C/C++中的 `do {...} while (...);` 语法一样。 +![](img/events/50.jpg) + ### break:跳出循环 使用 `{"type": "break"}` 可以跳出当前循环。 @@ -1743,6 +1841,8 @@ yes和no均为必填项,即用户点击确认或取消后执行的事件。 ] ``` +![](img/events/51.jpg) + !> 如果continue事件不在任何循环中被执行,则和exit等价,即会立刻结束当前事件! ### wait:等待用户操作 @@ -1782,6 +1882,8 @@ yes和no均为必填项,即用户点击确认或取消后执行的事件。 ] ``` +![](img/events/52.jpg) + ### waitAsync:等待所有异步事件执行完毕 上面有很多很多的异步事件(也就是执行时不等待执行完毕)。 @@ -2099,7 +2201,7 @@ core.insertAction([ 从V2.5.3开始,针对每个事件都提供了独立开关。 -独立开关的写法是`switch:A`, `switch:A`直到`switch:Z`,共计26个;不过样板中的值块默认只提供前6个。 +独立开关的写法是`switch:A`, `switch:A`直到`switch:Z`,共计26个。 独立开关算是特殊的flag,它在事件中使用时会和事件的楼层及坐标进行绑定;换句话说每个事件对应的`switch:A`都是不同的。 @@ -2110,6 +2212,8 @@ core.insertAction([ 通过独立开关的方式,我们无需对某些NPC的对话都设立单独的互不重复flag,只需要关注该事件自身的逻辑即可。 +![](img/events/53.jpg) + ## 同一个点的多事件处理 我们可以发现,就目前而且,每个点的事件是和该点进行绑定,并以该点坐标作为唯一索引来查询。 @@ -2154,6 +2258,8 @@ core.insertAction([ } ``` +![](img/events/54.jpg) + ### 获得圣水后变成墙 这个例子要求获得圣水时不前进(也就是不能走到圣水地方),然后把圣水位置变成墙。 @@ -2181,6 +2287,8 @@ core.insertAction([ } ``` +![](img/events/55.jpg) + 总之,记住如下两点: - 可以使用setBlock来更改一个图块。 @@ -2362,11 +2470,13 @@ if (core.flags.enableAddPoint && point > 0) { ] ``` +![](img/events/56.jpg) + `id`, `textInList`, `mustEnable`和上述完全相同。 `commonEvent`为公共事件名,即选择此项时要执行的公共事件。 -`args`为向该公共事件传递的参数,参见[type:insert](#insert:插入公共事件或另一个地点的事件并执行)的说明。 +`args`可选,为向该公共事件传递的参数,参见[type:insert](#insert:插入公共事件或另一个地点的事件并执行)的说明。 ## 系统引发的自定义事件 @@ -2404,6 +2514,8 @@ if (core.flags.enableAddPoint && point > 0) { }, ``` +![](img/events/60.jpg) + !> 多个机关门请分别设置开门变量如door1, door2等等。请勿存在两个机关门用相同的变量! 除此以外,每层楼还提供了`firstArrive`和`eachArrive`事件,分别为首次到达该楼层和每次到达该楼层时执行的事件。 @@ -2523,6 +2635,8 @@ if (core.flags.enableAddPoint && point > 0) { } ``` +![](img/events/57.jpg) + 另外,从V2.6开始,脚本编辑中提供了战前事件`beforeBattle`,这里不再详细展开,如有需求可自行前往研究。 ## 经验升级(进阶/境界塔) @@ -2552,6 +2666,8 @@ if (core.flags.enableAddPoint && point > 0) { ] ``` +![](img/events/58.jpg) + `levelUp`是一个数组,里面分别定义了每个等级的信息。里面每一项有三个参数`need`, `title`, `effect` - `need` 该等级所需要的经验值,可以是个表达式。请确保数组中的need依次递增。 - `title` 该等级的名称,比如“佣兵下级”等。该项可以忽略,以使用系统默认的等级。该项将显示在状态栏中。 @@ -2605,6 +2721,8 @@ if (core.flags.enableAddPoint && point > 0) { ] ``` +![](img/events/59.jpg) + ========================================================================================== [继续阅读下一章:个性化](personalization) diff --git a/_docs/img/events/1.jpg b/_docs/img/events/1.jpg new file mode 100644 index 00000000..6cc44ab5 Binary files /dev/null and b/_docs/img/events/1.jpg differ diff --git a/_docs/img/events/10.jpg b/_docs/img/events/10.jpg new file mode 100644 index 00000000..9e7166a6 Binary files /dev/null and b/_docs/img/events/10.jpg differ diff --git a/_docs/img/events/11.jpg b/_docs/img/events/11.jpg new file mode 100644 index 00000000..c6f3aa1b Binary files /dev/null and b/_docs/img/events/11.jpg differ diff --git a/_docs/img/events/12.jpg b/_docs/img/events/12.jpg new file mode 100644 index 00000000..12551990 Binary files /dev/null and b/_docs/img/events/12.jpg differ diff --git a/_docs/img/events/13.jpg b/_docs/img/events/13.jpg new file mode 100644 index 00000000..af81a7f0 Binary files /dev/null and b/_docs/img/events/13.jpg differ diff --git a/_docs/img/events/14.jpg b/_docs/img/events/14.jpg new file mode 100644 index 00000000..53221968 Binary files /dev/null and b/_docs/img/events/14.jpg differ diff --git a/_docs/img/events/15.jpg b/_docs/img/events/15.jpg new file mode 100644 index 00000000..14aa4cd2 Binary files /dev/null and b/_docs/img/events/15.jpg differ diff --git a/_docs/img/events/16.jpg b/_docs/img/events/16.jpg new file mode 100644 index 00000000..4e77816f Binary files /dev/null and b/_docs/img/events/16.jpg differ diff --git a/_docs/img/events/17.jpg b/_docs/img/events/17.jpg new file mode 100644 index 00000000..a8e94528 Binary files /dev/null and b/_docs/img/events/17.jpg differ diff --git a/_docs/img/events/18.jpg b/_docs/img/events/18.jpg new file mode 100644 index 00000000..8cbe6f94 Binary files /dev/null and b/_docs/img/events/18.jpg differ diff --git a/_docs/img/events/19.jpg b/_docs/img/events/19.jpg new file mode 100644 index 00000000..e250b7bd Binary files /dev/null and b/_docs/img/events/19.jpg differ diff --git a/_docs/img/events/2.jpg b/_docs/img/events/2.jpg new file mode 100644 index 00000000..e2461d34 Binary files /dev/null and b/_docs/img/events/2.jpg differ diff --git a/_docs/img/events/20.jpg b/_docs/img/events/20.jpg new file mode 100644 index 00000000..3c616d9e Binary files /dev/null and b/_docs/img/events/20.jpg differ diff --git a/_docs/img/events/21.jpg b/_docs/img/events/21.jpg new file mode 100644 index 00000000..6cccb422 Binary files /dev/null and b/_docs/img/events/21.jpg differ diff --git a/_docs/img/events/22.jpg b/_docs/img/events/22.jpg new file mode 100644 index 00000000..e814be0c Binary files /dev/null and b/_docs/img/events/22.jpg differ diff --git a/_docs/img/events/23.jpg b/_docs/img/events/23.jpg new file mode 100644 index 00000000..5cad5714 Binary files /dev/null and b/_docs/img/events/23.jpg differ diff --git a/_docs/img/events/24.jpg b/_docs/img/events/24.jpg new file mode 100644 index 00000000..2852e509 Binary files /dev/null and b/_docs/img/events/24.jpg differ diff --git a/_docs/img/events/25.jpg b/_docs/img/events/25.jpg new file mode 100644 index 00000000..d5492386 Binary files /dev/null and b/_docs/img/events/25.jpg differ diff --git a/_docs/img/events/26.jpg b/_docs/img/events/26.jpg new file mode 100644 index 00000000..6eaca21b Binary files /dev/null and b/_docs/img/events/26.jpg differ diff --git a/_docs/img/events/27.jpg b/_docs/img/events/27.jpg new file mode 100644 index 00000000..6c5b3a25 Binary files /dev/null and b/_docs/img/events/27.jpg differ diff --git a/_docs/img/events/28.jpg b/_docs/img/events/28.jpg new file mode 100644 index 00000000..5f6c6a19 Binary files /dev/null and b/_docs/img/events/28.jpg differ diff --git a/_docs/img/events/29.jpg b/_docs/img/events/29.jpg new file mode 100644 index 00000000..a04439c1 Binary files /dev/null and b/_docs/img/events/29.jpg differ diff --git a/_docs/img/events/3.jpg b/_docs/img/events/3.jpg new file mode 100644 index 00000000..b5aff14b Binary files /dev/null and b/_docs/img/events/3.jpg differ diff --git a/_docs/img/events/30.jpg b/_docs/img/events/30.jpg new file mode 100644 index 00000000..c1e9aca2 Binary files /dev/null and b/_docs/img/events/30.jpg differ diff --git a/_docs/img/events/31.jpg b/_docs/img/events/31.jpg new file mode 100644 index 00000000..663f3a30 Binary files /dev/null and b/_docs/img/events/31.jpg differ diff --git a/_docs/img/events/32.jpg b/_docs/img/events/32.jpg new file mode 100644 index 00000000..9a0fddfa Binary files /dev/null and b/_docs/img/events/32.jpg differ diff --git a/_docs/img/events/33.jpg b/_docs/img/events/33.jpg new file mode 100644 index 00000000..10246b96 Binary files /dev/null and b/_docs/img/events/33.jpg differ diff --git a/_docs/img/events/34.jpg b/_docs/img/events/34.jpg new file mode 100644 index 00000000..222ad18b Binary files /dev/null and b/_docs/img/events/34.jpg differ diff --git a/_docs/img/events/35.jpg b/_docs/img/events/35.jpg new file mode 100644 index 00000000..ff8ef556 Binary files /dev/null and b/_docs/img/events/35.jpg differ diff --git a/_docs/img/events/36.jpg b/_docs/img/events/36.jpg new file mode 100644 index 00000000..40a951fa Binary files /dev/null and b/_docs/img/events/36.jpg differ diff --git a/_docs/img/events/37.jpg b/_docs/img/events/37.jpg new file mode 100644 index 00000000..5267ed13 Binary files /dev/null and b/_docs/img/events/37.jpg differ diff --git a/_docs/img/events/38.jpg b/_docs/img/events/38.jpg new file mode 100644 index 00000000..b6ccf550 Binary files /dev/null and b/_docs/img/events/38.jpg differ diff --git a/_docs/img/events/39.jpg b/_docs/img/events/39.jpg new file mode 100644 index 00000000..d30c8d79 Binary files /dev/null and b/_docs/img/events/39.jpg differ diff --git a/_docs/img/events/4.jpg b/_docs/img/events/4.jpg new file mode 100644 index 00000000..d447565f Binary files /dev/null and b/_docs/img/events/4.jpg differ diff --git a/_docs/img/events/40.jpg b/_docs/img/events/40.jpg new file mode 100644 index 00000000..e10f56b7 Binary files /dev/null and b/_docs/img/events/40.jpg differ diff --git a/_docs/img/events/41.jpg b/_docs/img/events/41.jpg new file mode 100644 index 00000000..ec9b7e49 Binary files /dev/null and b/_docs/img/events/41.jpg differ diff --git a/_docs/img/events/42.jpg b/_docs/img/events/42.jpg new file mode 100644 index 00000000..24d0c2f4 Binary files /dev/null and b/_docs/img/events/42.jpg differ diff --git a/_docs/img/events/43.jpg b/_docs/img/events/43.jpg new file mode 100644 index 00000000..cb8f1c31 Binary files /dev/null and b/_docs/img/events/43.jpg differ diff --git a/_docs/img/events/44.jpg b/_docs/img/events/44.jpg new file mode 100644 index 00000000..59b3ecb7 Binary files /dev/null and b/_docs/img/events/44.jpg differ diff --git a/_docs/img/events/45.jpg b/_docs/img/events/45.jpg new file mode 100644 index 00000000..44dec550 Binary files /dev/null and b/_docs/img/events/45.jpg differ diff --git a/_docs/img/events/46.jpg b/_docs/img/events/46.jpg new file mode 100644 index 00000000..1eea4e37 Binary files /dev/null and b/_docs/img/events/46.jpg differ diff --git a/_docs/img/events/47.jpg b/_docs/img/events/47.jpg new file mode 100644 index 00000000..dd7bb88e Binary files /dev/null and b/_docs/img/events/47.jpg differ diff --git a/_docs/img/events/48.jpg b/_docs/img/events/48.jpg new file mode 100644 index 00000000..2086b1c3 Binary files /dev/null and b/_docs/img/events/48.jpg differ diff --git a/_docs/img/events/49.jpg b/_docs/img/events/49.jpg new file mode 100644 index 00000000..f81e0451 Binary files /dev/null and b/_docs/img/events/49.jpg differ diff --git a/_docs/img/events/5.jpg b/_docs/img/events/5.jpg new file mode 100644 index 00000000..333c972c Binary files /dev/null and b/_docs/img/events/5.jpg differ diff --git a/_docs/img/events/50.jpg b/_docs/img/events/50.jpg new file mode 100644 index 00000000..568eabf0 Binary files /dev/null and b/_docs/img/events/50.jpg differ diff --git a/_docs/img/events/51.jpg b/_docs/img/events/51.jpg new file mode 100644 index 00000000..1a3f70c3 Binary files /dev/null and b/_docs/img/events/51.jpg differ diff --git a/_docs/img/events/52.jpg b/_docs/img/events/52.jpg new file mode 100644 index 00000000..b66d2a22 Binary files /dev/null and b/_docs/img/events/52.jpg differ diff --git a/_docs/img/events/53.jpg b/_docs/img/events/53.jpg new file mode 100644 index 00000000..c3e488bb Binary files /dev/null and b/_docs/img/events/53.jpg differ diff --git a/_docs/img/events/54.jpg b/_docs/img/events/54.jpg new file mode 100644 index 00000000..6dbfc95e Binary files /dev/null and b/_docs/img/events/54.jpg differ diff --git a/_docs/img/events/55.jpg b/_docs/img/events/55.jpg new file mode 100644 index 00000000..fff606c2 Binary files /dev/null and b/_docs/img/events/55.jpg differ diff --git a/_docs/img/events/56.jpg b/_docs/img/events/56.jpg new file mode 100644 index 00000000..15fac681 Binary files /dev/null and b/_docs/img/events/56.jpg differ diff --git a/_docs/img/events/57.jpg b/_docs/img/events/57.jpg new file mode 100644 index 00000000..60196800 Binary files /dev/null and b/_docs/img/events/57.jpg differ diff --git a/_docs/img/events/58.jpg b/_docs/img/events/58.jpg new file mode 100644 index 00000000..e9ff8af9 Binary files /dev/null and b/_docs/img/events/58.jpg differ diff --git a/_docs/img/events/59.jpg b/_docs/img/events/59.jpg new file mode 100644 index 00000000..48c58e01 Binary files /dev/null and b/_docs/img/events/59.jpg differ diff --git a/_docs/img/events/6.jpg b/_docs/img/events/6.jpg new file mode 100644 index 00000000..7be2810b Binary files /dev/null and b/_docs/img/events/6.jpg differ diff --git a/_docs/img/events/60.jpg b/_docs/img/events/60.jpg new file mode 100644 index 00000000..408cebb3 Binary files /dev/null and b/_docs/img/events/60.jpg differ diff --git a/_docs/img/events/7.jpg b/_docs/img/events/7.jpg new file mode 100644 index 00000000..546a8bab Binary files /dev/null and b/_docs/img/events/7.jpg differ diff --git a/_docs/img/events/8.jpg b/_docs/img/events/8.jpg new file mode 100644 index 00000000..1c78a313 Binary files /dev/null and b/_docs/img/events/8.jpg differ diff --git a/_docs/img/events/9.jpg b/_docs/img/events/9.jpg new file mode 100644 index 00000000..bb6d752d Binary files /dev/null and b/_docs/img/events/9.jpg differ diff --git a/_docs/index.md b/_docs/index.md index 510bd14c..131b9acd 100644 --- a/_docs/index.md +++ b/_docs/index.md @@ -1,6 +1,6 @@ # HTML5 魔塔样板说明文档 -?> 目前版本**v2.6.1**,上次更新时间:* {docsify-updated} * +?> 目前版本**v2.6.2**,上次更新时间:* {docsify-updated} * 众所周知,魔塔的趋势是向移动端发展,贴吧中也常常能见到“求手机魔塔”的帖子。然而现有的工具中,NekoRPG有着比较大的局限性,游戏感较差,更是完全没法在iOS上运行。而一些APP的魔塔虽然可用,但是必须要下载安装,对于Android和iOS还必须开发不同的版本,非常麻烦。 diff --git a/_docs/personalization.md b/_docs/personalization.md index 5b71c8c3..f4bfb1ac 100644 --- a/_docs/personalization.md +++ b/_docs/personalization.md @@ -1,6 +1,6 @@ # 个性化 -?> 目前版本**v2.6.1**,上次更新时间:* {docsify-updated} * +?> 目前版本**v2.6.2**,上次更新时间:* {docsify-updated} * 有时候只靠样板本身可能是不够的。我们需要一些个性化、自定义的素材,道具效果,怪物属性,等等。 diff --git a/_docs/script.md b/_docs/script.md index c6d0aeff..cf277eed 100644 --- a/_docs/script.md +++ b/_docs/script.md @@ -1,6 +1,6 @@ # 脚本 -?> 目前版本**v2.6.1**,上次更新时间:* {docsify-updated} * +?> 目前版本**v2.6.2**,上次更新时间:* {docsify-updated} * 在V2.6版本中,基本对整个项目代码进行了重写,更加方便造塔者的使用和复写函数。 diff --git a/_docs/start.md b/_docs/start.md index 87319f4c..61cf9ed8 100644 --- a/_docs/start.md +++ b/_docs/start.md @@ -1,6 +1,6 @@ # 快速上手 -?> 目前版本**v2.6.1**,上次更新时间:* {docsify-updated} * +?> 目前版本**v2.6.2**,上次更新时间:* {docsify-updated} * 在这一节中,将详细介绍做一部塔的流程。现在,让我们来做一部单层塔! diff --git a/_server/MotaAction.g4 b/_server/MotaAction.g4 index 3627e6c1..b6c5c19c 100644 --- a/_server/MotaAction.g4 +++ b/_server/MotaAction.g4 @@ -393,7 +393,7 @@ if (EvalString_0==''){ if (IdString_0=='')title='\\t['+EvalString_0+']'; else title='\\t['+EvalString_0+','+IdString_0+']'; } -if(EvalString_1 && !(/^(up|down)(,hero)?(,([+-]?\d+),([+-]?\d+))?$/.test(EvalString_1))) { +if(EvalString_1 && !(/^(up|center|down|hero|null)(,(hero|null|\d+,\d+|\d+))?$/.test(EvalString_1))) { throw new Error('对话框效果的用法请右键点击帮助'); } EvalString_1 = EvalString_1 && ('\\b['+EvalString_1+']'); @@ -3406,7 +3406,7 @@ ActionParser.prototype.getTitleAndPosition = function (string) { string = string.replace(/\\t\[(([^\],]+),)?([^\],]+)\]/g, function (s0, s1, s2, s3) { if (s3) title = s3; if (s2) { icon = s3; title = s2; } - if (icon.endsWith('.png')) { title += "," + icon; icon = ''; } + if (icon && !/^[0-9a-zA-Z_][0-9a-zA-Z_:]*$/.test(icon)) { title += "," + icon; icon = ''; } return ""; }).replace(/\\b\[(.*?)\]/g, function (s0, s1) { position = s1; return ""; diff --git a/_server/editor.js b/_server/editor.js index 683200a2..3641c236 100644 --- a/_server/editor.js +++ b/_server/editor.js @@ -531,6 +531,25 @@ editor.prototype.movePos = function (startPos, endPos, callback) { }); } +editor.prototype.exchangePos = function (startPos, endPos, callback) { + if (!startPos || !endPos) return; + if (startPos.x == endPos.x && startPos.y == endPos.y) return; + var startInfo = editor.copyFromPos(startPos); + var endInfo = editor.copyFromPos(endPos); + editor.pasteToPos(startInfo, endPos); + editor.pasteToPos(endInfo, startPos); + editor.updateMap(); + editor.file.saveFloorFile(function (err) { + if (err) { + printe(err); + throw(err) + } + ;printf('交换事件成功'); + editor.drawPosSelection(); + if (callback) callback(); + }); +} + editor.prototype.clearPos = function (clearPos, pos, callback) { var fields = Object.keys(editor.file.comment._data.floors._data.loc._data); pos = pos || editor.pos; diff --git a/_server/editor_unsorted_1.js b/_server/editor_unsorted_1.js index ef27a102..91f754c7 100644 --- a/_server/editor_unsorted_1.js +++ b/_server/editor_unsorted_1.js @@ -123,7 +123,7 @@ editor.constructor.prototype.listen=function () { var loc = eToLoc(e); var pos = locToPos(loc,true); editor.showMidMenu(e.clientX,e.clientY); - return; + return false; } if (!selectBox.isSelected()) { var loc = eToLoc(e); @@ -137,20 +137,19 @@ editor.constructor.prototype.listen=function () { uc.strokeStyle = '#FF0000'; uc.lineWidth = 3; if(editor.isMobile)editor.showMidMenu(e.clientX,e.clientY); - return; + return false; } - holdingPath = 1; mouseOutCheck = 2; setTimeout(clear1); - e.stopPropagation(); uc.clearRect(0, 0, core.__PIXELS__, core.__PIXELS__); var loc = eToLoc(e); var pos = locToPos(loc,true); stepPostfix = []; stepPostfix.push(pos); fillPos(pos); + return false; } eui.onmousemove = function (e) { @@ -178,14 +177,13 @@ editor.constructor.prototype.listen=function () { //editor_mode.loc(); //tip.whichShow(1); // tip.showHelp(6); - return; + return false; } if (holdingPath == 0) { - return; + return false; } mouseOutCheck = 2; - e.stopPropagation(); var loc = eToLoc(e); var pos = locToPos(loc,true); var pos0 = stepPostfix[stepPostfix.length - 1] @@ -204,18 +202,19 @@ editor.constructor.prototype.listen=function () { stepPostfix.push(pos); fillPos(pos); } + return false; } eui.onmouseup = function (e) { if (!selectBox.isSelected()) { //tip.whichShow(1); - editor.movePos(startPos, endPos); + // editor.movePos(startPos, endPos); + editor.exchangePos(startPos, endPos); startPos = endPos = null; uc.clearRect(0, 0, core.__PIXELS__, core.__PIXELS__); - return; + return false; } holdingPath = 0; - e.stopPropagation(); if (stepPostfix && stepPostfix.length) { editor.preMapData = JSON.parse(JSON.stringify({map:editor.map,fgmap:editor.fgmap,bgmap:editor.bgmap})); if(editor.brushMod!=='line'){ @@ -258,6 +257,7 @@ editor.constructor.prototype.listen=function () { stepPostfix = []; uc.clearRect(0, 0, core.__PIXELS__, core.__PIXELS__); } + return false; } /* @@ -279,7 +279,6 @@ editor.constructor.prototype.listen=function () { */ document.getElementById('mid').onmousewheel = function (e) { - e.preventDefault(); var wheel = function (direct) { var index=editor.core.floorIds.indexOf(editor.currentFloorId); var toId = editor.currentFloorId; @@ -305,6 +304,7 @@ editor.constructor.prototype.listen=function () { catch (ee) { console.log(ee); } + return false; } editor.preMapData = null; @@ -747,19 +747,7 @@ editor.constructor.prototype.listen=function () { editor.preMapData = null; reDo = null; editor_mode.onmode(''); - var now = editor.pos, last = editor.lastRightButtonPos[1]; - if (now.x == last.x && now.y == last.y) return; - editor.pasteToPos(editor.lastCopyedInfo[1], now); - editor.pasteToPos(editor.lastCopyedInfo[0], last); - editor.updateMap(); - editor.file.saveFloorFile(function (err) { - if (err) { - printe(err); - throw(err) - } - ;printf('两位置的事件已互换'); - editor.drawPosSelection(); - }); + editor.exchangePos(editor.pos, editor.lastRightButtonPos[1]); } var clearEvent = document.getElementById('clearEvent'); diff --git a/_server/editor_unsorted_3.js b/_server/editor_unsorted_3.js index fd6ec89e..b0adaa5c 100644 --- a/_server/editor_unsorted_3.js +++ b/_server/editor_unsorted_3.js @@ -481,6 +481,8 @@ uievent.selectPoint = function (floorId, x, y, hideFloor, callback) { uievent.updateSelectPoint = function (redraw) { uievent.elements.title.innerText = '地图选点 ('+uievent.values.x+","+uievent.values.y+')'; if (redraw) { + core.setAlpha('uievent', 1); + core.clearMap('uievent'); core.drawThumbnail(uievent.values.floorId, null, null, {ctx: 'uievent', centerX: uievent.values.left + core.__HALF_SIZE__, centerY: uievent.values.top + core.__HALF_SIZE__}); diff --git a/_server/table/comment.js b/_server/table/comment.js index ef03953d..abbf3b7d 100644 --- a/_server/table/comment.js +++ b/_server/table/comment.js @@ -225,6 +225,12 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "_range": "false", "_data": "图块类别" }, + "name": { + "_leaf": true, + "_type": "textarea", + "_string": true, + "_data": "图块名称" + }, "trigger": { "_leaf": true, "_type": "select", diff --git a/libs/actions.js b/libs/actions.js index 67340276..f6f80541 100644 --- a/libs/actions.js +++ b/libs/actions.js @@ -1858,6 +1858,11 @@ actions.prototype._keyUpSL = function (keycode) { this._clickSL(this.LAST, this.LAST); return; } + if (keycode >= 48 && keycode <= 57) { + if (keycode == 48) keycode = 58; + core.ui.drawSLPanel((keycode - 49) * 1000 + 1); + return; + } if (keycode == 13 || keycode == 32 || keycode == 67) { if (offset == 0) core.doSL("autoSave", core.status.event.id); diff --git a/libs/control.js b/libs/control.js index cf122581..54201a90 100644 --- a/libs/control.js +++ b/libs/control.js @@ -570,6 +570,12 @@ control.prototype.setAutoHeroMove = function (steps) { ////// 设置行走的效果动画 ////// control.prototype.setHeroMoveInterval = function (callback) { if (core.status.heroMoving > 0) return; + if (core.status.replay.speed == 24) { + core.moveOneStep(core.nextX(), core.nextY()); + if (callback) callback(); + return; + } + core.status.heroMoving=1; var toAdd = 1; @@ -1346,6 +1352,7 @@ control.prototype._replay_error = function (action) { } control.prototype.__replay_getTimeout = function () { + if (core.status.replay.speed == 24) return 0; return 750 / Math.max(1, core.status.replay.speed); } diff --git a/libs/events.js b/libs/events.js index 3b44a8cf..0461d567 100644 --- a/libs/events.js +++ b/libs/events.js @@ -434,7 +434,7 @@ events.prototype._openDoor_animate = function (id, x, y, callback) { return; } core.drawImage('event', core.material.images.animates, 32 * state, 32 * door, 32, 32, 32 * x, 32 * y, 32, 32); - }, speed / Math.max(core.status.replay.speed, 1)); + }, core.status.replay.speed == 24 ? 1 : speed / Math.max(core.status.replay.speed, 1)); core.animateFrame.asyncId[animate] = true; } @@ -1395,7 +1395,7 @@ events.prototype._action_choices = function (data, x, y, prefix) { core.status.route.push("choices:" + index); core.insertAction(data.choices[index].action); core.doAction(); - }, 750 / Math.max(1, core.status.replay.speed)) + }, core.status.replay.speed == 24 ? 1 : 750 / Math.max(1, core.status.replay.speed)) } else { core.control._replay_error(action); @@ -1418,7 +1418,7 @@ events.prototype._action_confirm = function (data, x, y, prefix) { if (index == 0) core.insertAction(data.yes); else core.insertAction(data.no); core.doAction(); - }, 750 / Math.max(1, core.status.replay.speed)) + }, core.status.replay.speed == 24 ? 1 : 750 / Math.max(1, core.status.replay.speed)) } else { core.control._replay_error(action); @@ -1986,7 +1986,7 @@ events.prototype.closeDoor = function (x, y, id, callback) { } core.clearMap('event', 32 * x, 32 * y, 32, 32); core.drawImage('event', core.material.images.animates, 32 * (4-state), 32 * door, 32, 32, 32 * x, 32 * y, 32, 32); - }, speed / Math.max(core.status.replay.speed, 1)); + }, core.status.replay.speed == 24 ? 1 : speed / Math.max(core.status.replay.speed, 1)); core.animateFrame.asyncId[animate] = true; } @@ -2194,7 +2194,7 @@ events.prototype.eventMoveHero = function(steps, time, callback) { if (core.events._eventMoveHero_moving(++step, moveSteps)) step = 0; } - }, time / 8 / core.status.replay.speed); + }, core.status.replay.speed == 24 ? 1 : time / 8 / core.status.replay.speed); core.animateFrame.asyncId[animate] = true; } diff --git a/libs/maps.js b/libs/maps.js index ffa3f590..81a70157 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -363,7 +363,8 @@ maps.prototype._getBgFgMapArray = function (name, floorId, noCache) { return core.status[name + "maps"][floorId]; var arr = core.clone(core.floors[floorId][name + "map"] || []); - if (main.mode == 'editor') arr = core.clone(editor[name + "map"]) || arr; + if (main.mode == 'editor' && !(uievent && uievent.isOpen)) + arr = core.clone(editor[name + "map"]) || arr; for (var x = 0; x < width; x++) { for (var y = 0; y < height; y++) { arr[y] = arr[y] || []; @@ -1223,7 +1224,7 @@ maps.prototype.getBlockInfo = function (block) { if (block == 0) return null; block = this.initBlock(0, 0, block, true); } - var number = block.id, id = block.event.id, cls = block.event.cls, + var number = block.id, id = block.event.id, cls = block.event.cls, name = block.event.name, image = null, posX = 0, posY = 0, animate = block.event.animate, height = block.event.height || 32, faceIds = {}; @@ -1231,6 +1232,7 @@ maps.prototype.getBlockInfo = function (block) { else if (id == 'airwall') { if (!core.material.images.airwall) return null; image = core.material.images.airwall; + name = "空气墙"; } else if (cls == 'tileset') { var offset = core.icons.getTilesetOffset(id); @@ -1246,9 +1248,12 @@ maps.prototype.getBlockInfo = function (block) { image = core.material.images[cls]; posY = core.material.icons[cls][id]; faceIds = block.event.faceIds || {}; + if (core.material.enemys[id]) { + name = core.material.enemys[id].name; + } } - return {number: number, id: id, cls: cls, image: image, posX: posX, posY: posY, height: height, faceIds: faceIds, animate: animate}; + return {number: number, id: id, cls: cls, name: name, image: image, posX: posX, posY: posY, height: height, faceIds: faceIds, animate: animate}; } ////// 搜索某个图块出现的所有位置 ////// diff --git a/libs/ui.js b/libs/ui.js index ec48eb26..25391dbe 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -535,7 +535,7 @@ ui.prototype._getTitleAndIcon = function (content) { else { var blockInfo = core.getBlockInfo(s4); if (blockInfo != null) { - if (core.material.enemys[s4]) title = core.material.enemys[s4].name; + if (blockInfo.name) title = blockInfo.name; image = blockInfo.image; icon = blockInfo.posY; height = blockInfo.height; @@ -544,7 +544,10 @@ ui.prototype._getTitleAndIcon = function (content) { else title = s4; } } - if (s3) title = s3; + if (s3 != null) { + title = s3; + if (title == 'null') title = null; + } return ""; }); return { diff --git a/main.js b/main.js index 5ecac76f..15673ecd 100644 --- a/main.js +++ b/main.js @@ -2,7 +2,7 @@ function main() { //------------------------ 用户修改内容 ------------------------// - this.version = "2.6.1"; // 游戏版本号;如果更改了游戏内容建议修改此version以免造成缓存问题。 + this.version = "2.6.2"; // 游戏版本号;如果更改了游戏内容建议修改此version以免造成缓存问题。 this.useCompress = false; // 是否使用压缩文件 // 当你即将发布你的塔时,请使用“JS代码压缩工具”将所有js代码进行压缩,然后将这里的useCompress改为true。 @@ -188,8 +188,8 @@ function main() { this.floors = {} this.canvas = {}; - this.__VERSION__ = "2.6.1"; - this.__VERSION_CODE__ = 36; + this.__VERSION__ = "2.6.2"; + this.__VERSION_CODE__ = 54; } main.prototype.init = function (mode, callback) { diff --git a/project/data.js b/project/data.js index aa989629..654b14c6 100644 --- a/project/data.js +++ b/project/data.js @@ -77,7 +77,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "firstData": { "title": "魔塔样板", "name": "template", - "version": "Ver 2.6.1", + "version": "Ver 2.6.2", "floorId": "sample0", "hero": { "name": "阳光", diff --git a/project/functions.js b/project/functions.js index 8ff352dc..7723d333 100644 --- a/project/functions.js +++ b/project/functions.js @@ -1229,8 +1229,10 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = if (enemyDamage != null && enemyDamage < value) value = enemyDamage; } - damage[loc] = (damage[loc] || 0) + value; - type[loc] = "夹击伤害"; + if (value > 0) { + damage[loc] = (damage[loc] || 0) + value; + type[loc] = "夹击伤害"; + } } } } diff --git a/启动服务.exe b/启动服务.exe index 0735ba06..2f6786f0 100644 Binary files a/启动服务.exe and b/启动服务.exe differ diff --git a/常用工具/额外素材合并工具.exe b/常用工具/额外素材合并工具.exe new file mode 100644 index 00000000..169828b1 Binary files /dev/null and b/常用工具/额外素材合并工具.exe differ diff --git a/更新说明.txt b/更新说明.txt index c66b427b..f973f575 100644 --- a/更新说明.txt +++ b/更新说明.txt @@ -1,4 +1,20 @@ -HTML5魔塔样板V2.6.1 +HTML5魔塔样板V2.6.2 + +可以拖动地图上的图块和事件,复制剪切和跨楼层粘贴 +新增事件的地图选点功能,可以在地图上选择落点 +现在素材区可以进行折叠与自动换列了 +新增UI绘制系列事件,并且可以进行预览 +显示文本事件的标题解析 +新增常用工具:额外素材合并工具 +进一步提升24倍速的播放速度 +楼层转换增加对称点 +增加编辑器快捷键说明,H键查看 +文档-事件增加事件编辑器截图 +大量细节优化,所有已知的Bug修复 + +----------------------------------------------------------------------- + +HTML5魔塔样板V2.6.1 区域优化的录像播放功能,R键使用 强制战斗可以指定怪物坐标,将自动隐藏并执行该点战后事件