feat:弹幕系统(待测试)

This commit is contained in:
ShakeFlower 2025-02-14 14:19:58 +08:00
parent 425f3d74c9
commit ca50811e78
6 changed files with 62 additions and 17 deletions

View File

@ -140,7 +140,8 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"items": {
"constants": {
"book": 1,
"setting": 1
"setting": 1,
"postman": 1,
},
"tools": {},
"equips": {}

View File

@ -165,7 +165,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
// ...可以新增一些其他内容,比如创建个画布在右上角显示什么内容等等
},
"afterChangeFloor": function (floorId) {
"afterChangeFloor": function (floorId) {
// 转换楼层结束的事件;此函数会在整个楼层切换完全结束后再执行
// floorId是切换到的楼层
@ -183,6 +183,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
core.visitFloor(floorId);
}
}
if (!core.isReplaying()) core.plugin.drawCommentSign();
},
"flyTo": function (toId, callback) {
// 楼层传送器的使用从当前楼层飞往toId
@ -1619,6 +1620,9 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
if (!hasTrigger)
core.trigger(nowx, nowy, callback);
// 绘制目标点的弹幕
if (!core.isReplaying()) core.plugin.showComment(nowx, nowy);
// 检查该点是否是滑冰
if (core.onSki()) {
// 延迟到事件最后执行,因为这之前可能有阻激夹域动画
@ -1655,6 +1659,9 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
core.status.hero.loc.x = x;
core.status.hero.loc.y = y;
core.drawHero();
// 绘制目标点的弹幕
if (!core.isReplaying()) core.plugin.showComment(x, y);
// 记录录像
core.status.route.push("move:" + x + ":" + y);
// 统计信息

View File

@ -272,7 +272,8 @@ var icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1 =
"shield5": 59,
"sword0": 60,
"shield0": 61,
"setting": 62
"setting": 62,
"postman": 63
},
"autotile": {
"autotile": 0,

View File

@ -509,7 +509,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"canBatchUse": "true",
"text": "使用后回复100体力。",
"canUseItemEffect": "true",
"useItemEffect": "core.addStatus('hp', 100);"
"useItemEffect": "core.addStatus('hp', 100);",
"hideInReplay": true
},
"pack": {
"cls": "items",
@ -523,19 +524,12 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"canUseItemEffect": "true"
},
"silverCoin": {
"cls": "tools",
"cls": "items",
"name": "新物品",
"canUseItemEffect": "true",
"useItemEffect": "core.status.hero.hp += 1;",
"useItemEvent": [
{
"type": "setValue",
"name": "status:hp",
"operator": "+=",
"value": "1"
}
],
"canBatchUse": "true"
"canUseItemEffect": null,
"useItemEffect": null,
"useItemEvent": null,
"canBatchUse": null
},
"orb": {
"cls": "items",
@ -601,5 +595,46 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items",
"name": "新物品",
"canUseItemEffect": "true"
},
"postman": {
"cls": "constants",
"name": "言灵",
"canUseItemEffect": "true",
"useItemEvent": [
{
"type": "choices",
"text": "本功能需要您在h5mota.com在线游玩并处于登录状态时使用可以发送和接受留言。\n发言后需要选择刷新留言才能看到自己新发的留言。",
"choices": [
{
"text": "刷新留言",
"action": [
{
"type": "function",
"function": "function(){\nif (!core.isReplaying()) {\n\tcore.plugin.getComment();\n\tsetTimeout(core.plugin.drawCommentSign, 1000);\n}\n}"
}
]
},
{
"text": "写留言",
"action": [
{
"type": "input2",
"text": "请输入要发送的评论,文明友善发言,拒绝放假、剧透。"
},
{
"type": "function",
"function": "function(){\nconst input = core.getFlag('input', '');\nconst tags = [core.status.floorId,\n\tcore.getHeroLoc().x.toString(), core.getHeroLoc().y.toString()\n]\nif (!core.isReplaying()) {\n\tcore.plugin.postComment(input, tags);\n}\n}"
}
]
},
{
"text": "退出",
"action": []
}
]
}
],
"text": "可以发送和接收在线留言。",
"hideInReplay": true
}
}

View File

@ -235,5 +235,6 @@ var maps_90f36752_8815_4be8_b32b_d7fad1d0542e =
"339": {"cls":"items","id":"silverCoin"},
"340": {"cls":"items","id":"orb"},
"341": {"cls":"items","id":"bentWand"},
"342": {"cls":"items","id":"crossChest"}
"342": {"cls":"items","id":"crossChest"},
"343": {"cls":"items","id":"postman"}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 17 KiB