Merge pull request #380 from ckcz123/v2.x

V2.x
This commit is contained in:
Zhang Chen 2019-06-09 10:16:47 +08:00 committed by GitHub
commit cb357b05d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
85 changed files with 245 additions and 60 deletions

View File

@ -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键使用

View File

@ -1,6 +1,6 @@
# V2.0版本介绍
?> 目前版本**v2.6.1**,上次更新时间:* {docsify-updated} *
?> 目前版本**v2.6.2**,上次更新时间:* {docsify-updated} *
目前样板已经更新到V2.0版本以上本章将对V2.0的一些内容进行介绍。

View File

@ -1,6 +1,6 @@
# 附录API列表
?> 目前版本**v2.6.1**,上次更新时间:* {docsify-updated} *
?> 目前版本**v2.6.2**,上次更新时间:* {docsify-updated} *
这里将列出所有被转发到core的API没有被转发的函数此处不会列出请自行在代码中查看。

View File

@ -1,6 +1,6 @@
# 元件说明
?> 目前版本**v2.6.1**,上次更新时间:* {docsify-updated} *
?> 目前版本**v2.6.2**,上次更新时间:* {docsify-updated} *
在本章中,将对样板里的各个元件进行说明。各个元件主要包括道具、门、怪物、楼梯等等。

View File

@ -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[...]`来在对话框中绘制一个图标。
这里可以使用一个合法ID32x48图块除外或使用一个系统图标`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)

BIN
_docs/img/events/1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
_docs/img/events/10.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
_docs/img/events/11.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
_docs/img/events/12.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
_docs/img/events/13.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
_docs/img/events/14.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
_docs/img/events/15.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
_docs/img/events/16.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
_docs/img/events/17.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
_docs/img/events/18.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
_docs/img/events/19.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
_docs/img/events/2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
_docs/img/events/20.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
_docs/img/events/21.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
_docs/img/events/22.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
_docs/img/events/23.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
_docs/img/events/24.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
_docs/img/events/25.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
_docs/img/events/26.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
_docs/img/events/27.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
_docs/img/events/28.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
_docs/img/events/29.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
_docs/img/events/3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

BIN
_docs/img/events/30.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
_docs/img/events/31.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
_docs/img/events/32.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
_docs/img/events/33.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
_docs/img/events/34.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
_docs/img/events/35.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
_docs/img/events/36.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
_docs/img/events/37.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
_docs/img/events/38.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
_docs/img/events/39.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

BIN
_docs/img/events/4.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
_docs/img/events/40.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
_docs/img/events/41.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
_docs/img/events/42.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
_docs/img/events/43.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
_docs/img/events/44.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
_docs/img/events/45.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
_docs/img/events/46.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
_docs/img/events/47.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
_docs/img/events/48.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
_docs/img/events/49.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
_docs/img/events/5.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
_docs/img/events/50.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
_docs/img/events/51.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

BIN
_docs/img/events/52.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
_docs/img/events/53.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
_docs/img/events/54.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
_docs/img/events/55.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
_docs/img/events/56.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
_docs/img/events/57.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
_docs/img/events/58.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
_docs/img/events/59.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
_docs/img/events/6.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
_docs/img/events/60.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
_docs/img/events/7.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
_docs/img/events/8.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
_docs/img/events/9.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -1,6 +1,6 @@
# HTML5 魔塔样板说明文档
?> 目前版本**v2.6.1**,上次更新时间:* {docsify-updated} *
?> 目前版本**v2.6.2**,上次更新时间:* {docsify-updated} *
众所周知魔塔的趋势是向移动端发展贴吧中也常常能见到“求手机魔塔”的帖子。然而现有的工具中NekoRPG有着比较大的局限性游戏感较差更是完全没法在iOS上运行。而一些APP的魔塔虽然可用但是必须要下载安装对于Android和iOS还必须开发不同的版本非常麻烦。

View File

@ -1,6 +1,6 @@
# 个性化
?> 目前版本**v2.6.1**,上次更新时间:* {docsify-updated} *
?> 目前版本**v2.6.2**,上次更新时间:* {docsify-updated} *
有时候只靠样板本身可能是不够的。我们需要一些个性化、自定义的素材,道具效果,怪物属性,等等。

View File

@ -1,6 +1,6 @@
# 脚本
?> 目前版本**v2.6.1**,上次更新时间:* {docsify-updated} *
?> 目前版本**v2.6.2**,上次更新时间:* {docsify-updated} *
在V2.6版本中,基本对整个项目代码进行了重写,更加方便造塔者的使用和复写函数。

View File

@ -1,6 +1,6 @@
# 快速上手
?> 目前版本**v2.6.1**,上次更新时间:* {docsify-updated} *
?> 目前版本**v2.6.2**,上次更新时间:* {docsify-updated} *
在这一节中,将详细介绍做一部塔的流程。现在,让我们来做一部单层塔!

View File

@ -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 "";

View File

@ -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;

View File

@ -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');

View File

@ -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__});

View File

@ -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",

View File

@ -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);

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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};
}
////// 搜索某个图块出现的所有位置 //////

View File

@ -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 {

View File

@ -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) {

View File

@ -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": "阳光",

View File

@ -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] = "夹击伤害";
}
}
}
}

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,20 @@
HTML5魔塔样板V2.6.1
HTML5魔塔样板V2.6.2
可以拖动地图上的图块和事件,复制剪切和跨楼层粘贴
新增事件的地图选点功能,可以在地图上选择落点
现在素材区可以进行折叠与自动换列了
新增UI绘制系列事件并且可以进行预览
显示文本事件的标题解析
新增常用工具:额外素材合并工具
进一步提升24倍速的播放速度
楼层转换增加对称点
增加编辑器快捷键说明H键查看
文档-事件增加事件编辑器截图
大量细节优化所有已知的Bug修复
-----------------------------------------------------------------------
HTML5魔塔样板V2.6.1
区域优化的录像播放功能R键使用
强制战斗可以指定怪物坐标,将自动隐藏并执行该点战后事件