diff --git a/project/data.js b/project/data.js index 2c698669..0b3caed1 100644 --- a/project/data.js +++ b/project/data.js @@ -140,7 +140,8 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "items": { "constants": { "book": 1, - "setting": 1 + "setting": 1, + "postman": 1, }, "tools": {}, "equips": {} diff --git a/project/functions.js b/project/functions.js index 47781495..62aff75d 100644 --- a/project/functions.js +++ b/project/functions.js @@ -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); // 统计信息 diff --git a/project/icons.js b/project/icons.js index c541ff1c..87c08971 100644 --- a/project/icons.js +++ b/project/icons.js @@ -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, diff --git a/project/items.js b/project/items.js index dbfc02d2..06ec64c1 100644 --- a/project/items.js +++ b/project/items.js @@ -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 } } \ No newline at end of file diff --git a/project/maps.js b/project/maps.js index c2459096..1c43806e 100644 --- a/project/maps.js +++ b/project/maps.js @@ -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"} } \ No newline at end of file diff --git a/project/materials/items.png b/project/materials/items.png index faf208f1..0a27be54 100644 Binary files a/project/materials/items.png and b/project/materials/items.png differ