Remove type:revisit

This commit is contained in:
ckcz123 2020-05-13 19:52:54 +08:00
parent 1faad822fb
commit 8c5fc76d8c
8 changed files with 1782 additions and 1791 deletions

View File

@ -336,7 +336,6 @@ action
| trigger_s
| insert_1_s
| insert_2_s
| revisit_s
| exit_s
| setBlock_s
| showFloorImg_s
@ -780,18 +779,6 @@ var code = '{"type": "insert", "loc": ['+PosString_0+','+PosString_1+']'+Event_L
return code;
*/;
revisit_s
: '重启当前事件' Newline
/* revisit_s
tooltip : revisit: 立即重启当前事件
helpUrl : https://h5mota.com/games/template/_docs/#/event?id=revisit%EF%BC%9A%E7%AB%8B%E5%8D%B3%E9%87%8D%E5%90%AF%E5%BD%93%E5%89%8D%E4%BA%8B%E4%BB%B6
colour : this.eventColor
var code = '{"type": "revisit"},\n';
return code;
*/;
exit_s
: '立刻结束当前事件' Newline
@ -3509,10 +3496,6 @@ ActionParser.prototype.parseAction = function() {
this.next = MotaActionBlocks['waitAsync_s'].xmlText([
this.next]);
break;
case "revisit": // 立刻重新执行该事件
this.next = MotaActionBlocks['revisit_s'].xmlText([
this.next]);
break;
case "callBook": // 呼出怪物手册
this.next = MotaActionBlocks['callBook_s'].xmlText([
this.next]);

View File

@ -149,7 +149,6 @@ editor_blockly = function () {
MotaActionBlocks['dowhile_s'].xmlText(),
MotaActionBlocks['break_s'].xmlText(),
MotaActionBlocks['continue_s'].xmlText(),
MotaActionBlocks['revisit_s'].xmlText(),
MotaActionBlocks['exit_s'].xmlText(),
MotaActionBlocks['trigger_s'].xmlText(),
MotaActionBlocks['insert_1_s'].xmlText(),
@ -242,6 +241,7 @@ editor_blockly = function () {
}),
'<label text="商店购买属性/钥匙"></label>',
MotaActionFunctions.actionParser.parse([
{"type": "while", "condition": "true", "data": [
{"type": "choices", "text": "\\t[老人,man]少年,你需要钥匙吗?\\n我这里有大把的",
"choices": [
{"text": "黄钥匙(\\\${9+flag:shop_times}金币)", "color": [255,255,0,1], "action": [
@ -252,20 +252,19 @@ editor_blockly = function () {
],
"false": [
"\\t[老人,man]你的金钱不足!",
{"type": "revisit"}
{"type": "continue"}
]
}
]},
{"text": "蓝钥匙(\\\${18+2*flag:shop_times}金币)", "color": [0,0,255,1], "action": [
]},
{"text": "离开", "action": [
{"type": "exit"}
{"type": "break"}
]}
]
},
{"type": "setValue", "name": "flag:shop_times", "operator": "+=", "value": "1"},
{"type": "revisit"}
], 'event'),
{"type": "setValue", "name": "flag:shop_times", "operator": "+=", "value": "1"}
]}], 'event'),
'<label text="战前剧情"></label>',
MotaActionFunctions.actionParser.parse({
"trigger": "action",
@ -750,12 +749,12 @@ function omitedcheckUpdateFunction(event) {
'hide_s',
'setValue_s',
'if_s',
'while_s',
'battle_s',
'openDoor_s',
'choices_s',
'setText_s',
'exit_s',
'revisit_s',
'sleep_s',
'setBlock_s',
'insert_1_s'

View File

@ -2063,13 +2063,6 @@ events.prototype._action_waitAsync = function (data, x, y, prefix) {
}, 50);
}
events.prototype._action_revisit = function (data, x, y, prefix) {
var block = core.getBlock(x, y);
if (block != null && block.block.event.trigger == 'action')
this.setEvents(block.block.event.data);
core.doAction();
}
events.prototype._action_callBook = function (data, x, y, prefix) {
if (core.isReplaying() || !core.hasItem('book')) {
core.doAction();

View File

@ -38,4 +38,7 @@ main.floors.MT0=
"fgmap": [
],
"width": 13,
"height": 13,
"autoEvent": {}
}

View File

@ -219,4 +219,7 @@ main.floors.sample0=
"fgmap": [
],
"width": 13,
"height": 13,
"autoEvent": {}
}

View File

@ -41,7 +41,7 @@ main.floors.sample1=
"左边是一个仿50层的陷阱做法上方是商店、快捷商店的使用方法右上是一个典型的杀怪开门的例子右下是各类可能的NPC事件。",
"本样板目前支持的事件列表大致有:\ntext: 显示一段文字(比如你现在正在看到的)\ntip: 左上角显示提示\nshow: 使一个事件有效(可见、可被交互)\nhide: 使一个事件失效(不可见、不可被交互)\ntrigger: 触发另一个地点的事件\nanimate: 显示动画\nbattle: 强制和某怪物战斗\nopenDoor: 无需钥匙开门(例如机关门、暗墙)",
"openShop: 打开一个全局商店\ndisableShop: 禁用一个全局商店\nchangeFloor: 传送勇士到某层某位置\nchangePos: 传送勇士到当层某位置;转向\nshowImage: 显示图片\nsetFg: 更改画面色调\nsetWeather: 更改天气\nmove: 移动事件效果\nmoveHero: 移动勇士效果\nplayBgm: 播放某个背景音乐\npauseBgm: 暂停背景音乐\nresumeBgm: 恢复背景音乐的播放\nplaySound: 播放某个音频",
"if: 条件判断\nchoices: 提供选项\nsetValue: 设置勇士属性道具,或某个变量/flag\nupdate: 更新状态栏和地图显伤\nwin: 获得胜利(游戏通关)\nlose: 游戏失败\nsleep: 等待多少毫秒\nexit: 立刻结束当前事件\nrevisit: 立刻结束事件并重新触发\nfunction: 自定义JS脚本\n\n更多支持的事件还在编写中欢迎您宝贵的意见。",
"if: 条件判断\nchoices: 提供选项\nsetValue: 设置勇士属性道具,或某个变量/flag\nupdate: 更新状态栏和地图显伤\nwin: 获得胜利(游戏通关)\nlose: 游戏失败\nsleep: 等待多少毫秒\nexit: 立刻结束当前事件\nfunction: 自定义JS脚本\n\n更多支持的事件还在编写中欢迎您宝贵的意见。",
"有关各事件的样例可参见本层一些NPC的写法。\n所有事件样例本层都有介绍。\n\n一个自定义事件处理完后需要调用{\"type\": \"hide\"}该事件才不会再次出现。",
{
"type": "hide"
@ -409,18 +409,24 @@ main.floors.sample1=
],
"10,11": [
{
"type": "if",
"condition": "flag:woman_times==0",
"true": [
"type": "while",
"condition": "true",
"data": [
{
"type": "switch",
"condition": "flag:woman_times",
"caseList": [
{
"case": "0",
"action": [
"\t[老人,woman]这是个很复杂的例子它将教会你如何使用if 语句进行条件判断,以及 choices 提供选项来供用户进行选择。",
"\t[老人,woman]第一次访问我将显示这段文字;从第二次开始将会向你出售钥匙。\n钥匙价格将随着访问次数递增。\n当合计出售了七把钥匙后将送你一把大黄门钥匙并消失不再出现。",
"\t[老人,woman]这部分的逻辑比较长,请细心看样板的写法,是很容易看懂并理解的。"
],
"false": [
]
},
{
"type": "if",
"condition": "flag:woman_times==8",
"true": [
"case": "8",
"action": [
"\t[老人,woman]你购买的钥匙已经够多了,再继续卖给你的话我会有危险的。",
"\t[老人,woman]看在你贡献给我这么多钱的份上,送你一把大黄门钥匙吧,希望你能好好用它。",
{
@ -437,8 +443,11 @@ main.floors.sample1=
{
"type": "exit"
}
],
"false": [
]
},
{
"case": "default",
"action": [
{
"type": "choices",
"text": "\t[老人,woman]少年,你需要钥匙吗?\n我这里有大把的",
@ -464,10 +473,7 @@ main.floors.sample1=
}
],
"false": [
"\t[老人,woman]你的金钱不足!",
{
"type": "revisit"
}
"\t[老人,woman]你的金钱不足!"
]
}
]
@ -490,13 +496,13 @@ main.floors.sample1=
"name": "item:blueKey",
"operator": "+=",
"value": "1"
},
{
"type": "continue"
}
],
"false": [
"\t[老人,woman]你的金钱不足!",
{
"type": "revisit"
}
"\t[老人,woman]你的金钱不足!"
]
}
]
@ -524,7 +530,7 @@ main.floors.sample1=
"false": [
"\t[老人,woman]你的金钱不足!",
{
"type": "revisit"
"type": "continue"
}
]
}
@ -549,9 +555,8 @@ main.floors.sample1=
"name": "flag:woman_times",
"operator": "+=",
"value": "1"
},
{
"type": "revisit"
}
]
}
],
"12,11": [
@ -580,7 +585,7 @@ main.floors.sample1=
"false": []
},
"\t[老人,womanMagician]具体可参见样板中本事件的写法。"
],
]
},
"changeFloor": {
"4,12": {
@ -636,9 +641,10 @@ main.floors.sample1=
{
"type": "openDoor"
}
]
}
}
}
},
"width": 13,
"height": 13
}

View File

@ -69,4 +69,5 @@ main.floors.sample2=
"fgmap": [
],
"autoEvent": {}
}

View File

@ -1002,4 +1002,7 @@ main.floors.sample3=
"fgmap": [
],
"width": 13,
"height": 13,
"autoEvent": {}
}