Merge remote-tracking branch 'refs/remotes/ckcz123/master' into dev-2.0-201802102001

This commit is contained in:
YouWei Zhao 2018-02-12 15:30:42 +08:00
commit c5dc50803b
5 changed files with 14 additions and 6 deletions

View File

@ -954,6 +954,8 @@ core.insertAction(list) //往当前事件列表中插入一系列事件。使用
由于NPC是自定义事件因此我们需要写events。注意到events中不覆盖trigger则还是怪物时存在系统trigger因此会战斗变成NPC后没有系统trigger因此会触发自定义事件。
请注意打死怪物时默认会禁用该点因此替换后需要手动进行show来启用。
``` js
"events": {
"x,y": [
@ -962,7 +964,8 @@ core.insertAction(list) //往当前事件列表中插入一系列事件。使用
},
"afterBattle": {
"x,y": [
{"type": "setBlock", "number": 121} // 变成老人
{"type": "setBlock", "number": 121}, // 变成老人
{"type": "show", "loc": [x,y]} // 启用该点
]
}
```

View File

@ -1943,9 +1943,11 @@ core.prototype.canMoveHero = function(x,y,direction,floorId) {
if (!core.isset(floorId)) floorId=core.status.floorId;
// 检查当前块的cannotMove
var cannotMove = core.floors[floorId].cannotMove[x+","+y];
if (core.isset(cannotMove) && cannotMove instanceof Array && cannotMove.indexOf(direction)>=0)
return false;
if (core.isset(core.floors[floorId].cannotMove)) {
var cannotMove = core.floors[floorId].cannotMove[x+","+y];
if (core.isset(cannotMove) && cannotMove instanceof Array && cannotMove.indexOf(direction)>=0)
return false;
}
var nowBlock = core.getBlock(x,y,floorId);
if (nowBlock!=null){
@ -2344,7 +2346,7 @@ core.prototype.trigger = function (x, y) {
var trigger = mapBlocks[b].event.trigger;
// 转换楼层能否穿透
if (trigger=='changeFloor') {
if (trigger=='changeFloor' && !noPass) {
var canCross = core.flags.portalWithoutTrigger;
if (core.isset(mapBlocks[b].event.data) && core.isset(mapBlocks[b].event.data.portalWithoutTrigger))
canCross=mapBlocks[b].event.data.portalWithoutTrigger;

View File

@ -1229,6 +1229,7 @@ events.prototype.clickShop = function(x,y) {
core.status.route.push("shop:"+core.status.event.data.id+":"+core.status.event.data.actions.join(""));
}
core.status.event.data.actions = [];
core.status.boxAnimateObjs = [];
if (core.status.event.data.fromList)
core.ui.drawQuickShop();
@ -1258,6 +1259,8 @@ events.prototype.keyUpShop = function (keycode) {
core.status.route.push("shop:"+core.status.event.data.id+":"+core.status.event.data.actions.join(""));
}
core.status.event.data.actions = [];
core.status.boxAnimateObjs = [];
if (core.status.event.data.fromList)

View File

@ -35,7 +35,6 @@ main.floors.sample0 =
"本层主要对道具、门、怪物等进行介绍,有关事件的各种信息在下一层会有更为详细的说明。",
],
"events": { // 该楼的所有可能事件列表
"10,9": [ // 守着道具的老人
"\t[老人,man]这些是本样板支持的所有的道具。\n\n道具分为三类items, constants, tools。\nitems 为即捡即用类道具,例如宝石、血瓶、剑盾等。\nconstants 为永久道具,例如怪物手册、楼层传送器、幸运金币等。\ntools 为消耗类道具,例如破墙镐、炸弹、中心对称飞行器等。\n\n后两类道具在工具栏中可以看到并使用。",
"\t[老人,man]\b[up]有关道具效果定义在items.js中。\n目前大多数道具已有默认行为如有自定义的需求则需在items.js中修改代码。",
@ -78,6 +77,7 @@ main.floors.sample0 =
},
},
"changeFloor": { // 楼层转换事件该事件不能和上面的events有冲突同位置点否则会被覆盖
"7,9": {"floorId": "sample1", "stair": "downFloor"},
"6,0": {"floorId": "sample1", "stair": "downFloor"}, // 目标点sample1层的下楼梯位置
"0,11": {"floorId": "sample0", "loc": [0,12]}, // 目标点sample0层的x=0,y=12位置
"0,12": {"floorId": "sample0", "stair": "upFloor"}, // 注意目标层有多个楼梯的话写stair可能会导致到达位置不确定。这时候推荐写loc指明目标点位置。

Binary file not shown.