event:wait
This commit is contained in:
parent
49679ff24d
commit
fd57f77c95
@ -168,6 +168,7 @@ action
|
|||||||
| setHeroIcon_s
|
| setHeroIcon_s
|
||||||
| update_s
|
| update_s
|
||||||
| sleep_s
|
| sleep_s
|
||||||
|
| wait_s
|
||||||
| battle_s
|
| battle_s
|
||||||
| openDoor_s
|
| openDoor_s
|
||||||
| changeFloor_s
|
| changeFloor_s
|
||||||
@ -455,6 +456,18 @@ var code = '{"type": "sleep", "time": '+Int_0+'},\n';
|
|||||||
return code;
|
return code;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
wait_s
|
||||||
|
: '等待用户操作'
|
||||||
|
;
|
||||||
|
|
||||||
|
/* wait_s
|
||||||
|
tooltip : wait: 等待用户操作
|
||||||
|
helpUrl : https://ckcz123.github.io/mota-js/#/event?id=wait-%e7%ad%89%e5%be%85%e7%94%a8%e6%88%b7%e6%93%8d%e4%bd%9c
|
||||||
|
colour : this.soundColor
|
||||||
|
var code = '{"type": "wait"},\n';
|
||||||
|
return code;
|
||||||
|
*/
|
||||||
|
|
||||||
battle_s
|
battle_s
|
||||||
: '强制战斗' IdString Newline
|
: '强制战斗' IdString Newline
|
||||||
;
|
;
|
||||||
@ -1433,6 +1446,10 @@ ActionParser.prototype.parseAction = function() {
|
|||||||
this.next = MotaActionBlocks['sleep_s'].xmlText([
|
this.next = MotaActionBlocks['sleep_s'].xmlText([
|
||||||
data.time,this.next]);
|
data.time,this.next]);
|
||||||
break;
|
break;
|
||||||
|
case "wait": // 等待用户操作
|
||||||
|
this.next = MotaActionBlocks['wait_s'].xmlText([
|
||||||
|
this.next]);
|
||||||
|
break;
|
||||||
case "revisit": // 立刻重新执行该事件
|
case "revisit": // 立刻重新执行该事件
|
||||||
this.next = MotaActionBlocks['revisit_s'].xmlText([
|
this.next = MotaActionBlocks['revisit_s'].xmlText([
|
||||||
this.next]);
|
this.next]);
|
||||||
|
|||||||
@ -102,6 +102,7 @@ editor_blockly = function () {
|
|||||||
MotaActionBlocks['disableShop_s'].xmlText(),
|
MotaActionBlocks['disableShop_s'].xmlText(),
|
||||||
'<label text="特效/声音"></label>',
|
'<label text="特效/声音"></label>',
|
||||||
MotaActionBlocks['sleep_s'].xmlText(),
|
MotaActionBlocks['sleep_s'].xmlText(),
|
||||||
|
MotaActionBlocks['wait_s'].xmlText(),
|
||||||
MotaActionBlocks['animate_s'].xmlText(),
|
MotaActionBlocks['animate_s'].xmlText(),
|
||||||
MotaActionBlocks['setFg_0_s'].xmlText(),
|
MotaActionBlocks['setFg_0_s'].xmlText(),
|
||||||
MotaActionBlocks['setFg_1_s'].xmlText(),
|
MotaActionBlocks['setFg_1_s'].xmlText(),
|
||||||
|
|||||||
@ -519,6 +519,10 @@ name是可选的,代表目标行走图的文件名。
|
|||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### wait:等待用户操作
|
||||||
|
|
||||||
|
使用 `{"type": "wait"}` 可以等待用户进行操作(如点击、回车等)。
|
||||||
|
|
||||||
### battle: 强制战斗
|
### battle: 强制战斗
|
||||||
|
|
||||||
调用battle可强制与某怪物进行战斗(而无需去触碰到它)。
|
调用battle可强制与某怪物进行战斗(而无需去触碰到它)。
|
||||||
|
|||||||
@ -712,7 +712,7 @@ actions.prototype.longClick = function () {
|
|||||||
core.drawText();
|
core.drawText();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (core.status.event.id=='action' && core.status.event.data.type=='text') {
|
if (core.status.event.id=='action' && (core.status.event.data.type=='text' || core.status.event.data.type=='wait')) {
|
||||||
core.doAction();
|
core.doAction();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -725,7 +725,7 @@ actions.prototype.keyDownCtrl = function () {
|
|||||||
core.drawText();
|
core.drawText();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (core.status.event.id=='action' && core.status.event.data.type=='text') {
|
if (core.status.event.id=='action' && (core.status.event.data.type=='text' || core.status.event.data.type=='wait')) {
|
||||||
core.doAction();
|
core.doAction();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -766,7 +766,7 @@ actions.prototype.keyUpConfirmBox = function (keycode) {
|
|||||||
////// 自定义事件时的点击操作 //////
|
////// 自定义事件时的点击操作 //////
|
||||||
actions.prototype.clickAction = function (x,y) {
|
actions.prototype.clickAction = function (x,y) {
|
||||||
|
|
||||||
if (core.status.event.data.type=='text') {
|
if (core.status.event.data.type=='text' || core.status.event.data.type=='wait') {
|
||||||
// 文字
|
// 文字
|
||||||
core.doAction();
|
core.doAction();
|
||||||
return;
|
return;
|
||||||
@ -808,7 +808,7 @@ actions.prototype.keyDownAction = function (keycode) {
|
|||||||
|
|
||||||
////// 自定义事件时,放开某个键的操作 //////
|
////// 自定义事件时,放开某个键的操作 //////
|
||||||
actions.prototype.keyUpAction = function (keycode) {
|
actions.prototype.keyUpAction = function (keycode) {
|
||||||
if (core.status.event.data.type=='text' && (keycode==13 || keycode==32 || keycode==67)) {
|
if ((core.status.event.data.type=='text' || core.status.event.data.type=='wait') && (keycode==13 || keycode==32 || keycode==67)) {
|
||||||
core.doAction();
|
core.doAction();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,8 +33,8 @@ enemys.prototype.hasSpecial = function (special, test) {
|
|||||||
|
|
||||||
////// 获得所有特殊属性的名称 //////
|
////// 获得所有特殊属性的名称 //////
|
||||||
enemys.prototype.getSpecialText = function (enemyId) {
|
enemys.prototype.getSpecialText = function (enemyId) {
|
||||||
if (enemyId == undefined) return "";
|
var enemy = core.material.enemys[enemyId];
|
||||||
var enemy = this.enemys[enemyId];
|
if (!core.isset(enemy)) return [];
|
||||||
var special = enemy.special;
|
var special = enemy.special;
|
||||||
var text = [];
|
var text = [];
|
||||||
if (this.hasSpecial(special, 1)) text.push("先攻");
|
if (this.hasSpecial(special, 1)) text.push("先攻");
|
||||||
|
|||||||
@ -57,8 +57,7 @@ events.prototype.init = function () {
|
|||||||
callback();
|
callback();
|
||||||
},
|
},
|
||||||
'action': function (data, core, callback) {
|
'action': function (data, core, callback) {
|
||||||
core.events.doEvents(data.event.data, data.x, data.y);
|
core.events.insertAction(data.event.data, data.x, data.y, callback);
|
||||||
if (core.isset(callback)) callback();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -670,6 +669,10 @@ events.prototype.doAction = function() {
|
|||||||
}, data.time);
|
}, data.time);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "wait":
|
||||||
|
if (core.status.replay.replaying)
|
||||||
|
core.events.doAction();
|
||||||
|
break;
|
||||||
case "revisit": // 立刻重新执行该事件
|
case "revisit": // 立刻重新执行该事件
|
||||||
{
|
{
|
||||||
var block=core.getBlock(x,y); // 重新获得事件
|
var block=core.getBlock(x,y); // 重新获得事件
|
||||||
|
|||||||
@ -167,6 +167,8 @@ utils.prototype.formatBigNumber = function (x) {
|
|||||||
x = parseFloat(x);
|
x = parseFloat(x);
|
||||||
if (!core.isset(x)) return '???';
|
if (!core.isset(x)) return '???';
|
||||||
|
|
||||||
|
if (x<=999999) return x;
|
||||||
|
|
||||||
var all = [
|
var all = [
|
||||||
{"val": 1e20, "c": "g"},
|
{"val": 1e20, "c": "g"},
|
||||||
{"val": 1e16, "c": "j"},
|
{"val": 1e16, "c": "j"},
|
||||||
@ -177,7 +179,7 @@ utils.prototype.formatBigNumber = function (x) {
|
|||||||
|
|
||||||
for (var i=0;i<all.length;i++) {
|
for (var i=0;i<all.length;i++) {
|
||||||
var one = all[i];
|
var one = all[i];
|
||||||
if (x>=100*one.val) {
|
if (x>=10*one.val) {
|
||||||
var v = x/one.val;
|
var v = x/one.val;
|
||||||
return v.toFixed(Math.max(0, Math.floor(4-Math.log10(v+1)))) + one.c;
|
return v.toFixed(Math.max(0, Math.floor(4-Math.log10(v+1)))) + one.c;
|
||||||
}
|
}
|
||||||
|
|||||||
16
更新说明.txt
16
更新说明.txt
@ -1,4 +1,18 @@
|
|||||||
HTML5魔塔样板V2.1.1
|
HTML5魔塔样板V2.1.2
|
||||||
|
|
||||||
|
事件坐标可用变量指定
|
||||||
|
全局商店也可以使用图块编辑
|
||||||
|
图片移动事件
|
||||||
|
提供core.random函数提供随机数
|
||||||
|
作弊处理(成绩范围控制,通关不上传则按照最低分)
|
||||||
|
格子有事件则高亮显示
|
||||||
|
状态栏绘制
|
||||||
|
等待用户点击事件
|
||||||
|
事件:设置BGM音量
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------
|
||||||
|
|
||||||
|
HTML5魔塔样板V2.1.1
|
||||||
|
|
||||||
新增事件:改变勇士行走图
|
新增事件:改变勇士行走图
|
||||||
楼传器落点设置
|
楼传器落点设置
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user