From b45afe0ae4c3263a9d006c9ee5210a6557c15e05 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Tue, 19 May 2020 13:09:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=BC=80=E9=97=A8=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _server/table/comment.js | 2 +- libs/events.js | 8 ++++---- project/maps.js | 18 +++++++++--------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/_server/table/comment.js b/_server/table/comment.js index c6c622ea..702e54a8 100644 --- a/_server/table/comment.js +++ b/_server/table/comment.js @@ -338,7 +338,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "_leaf": true, "_type": "textarea", "_docs": "门信息", - "_data": "该图块的门信息,是一个三元数组。\n第一项为所需要的钥匙信息,第二项为开此门时的音效,第三项为关此门时的音效。仅对animates生效。" + "_data": "该图块的门信息,是一个四元数组。\n第一项为所需要的钥匙信息,第二项为开关门的毫秒数,第三项为开此门时的音效,第四项为关此门时的音效。仅对animates生效。" }, "faceIds": { "_leaf": true, diff --git a/libs/events.js b/libs/events.js index 7c5fc405..ce13f142 100644 --- a/libs/events.js +++ b/libs/events.js @@ -487,7 +487,7 @@ events.prototype._openDoor_check = function (id, x, y, needKey) { core.removeItem(keyName, keyInfo[keyName]); } } - core.playSound(doorInfo[1] || 'door.mp3'); + core.playSound(doorInfo[2] || 'door.mp3'); return true; } @@ -495,7 +495,7 @@ events.prototype._openDoor_animate = function (id, x, y, callback) { var blockInfo = core.getBlockInfo(id); var image = blockInfo.image, posY = blockInfo.posY, height = blockInfo.height; - var speed = 40; + var speed = (core.getBlockById(id).event.doorInfo[1] || 160) / 4; var locked = core.status.lockControl; core.lockControl(); @@ -2611,11 +2611,11 @@ events.prototype.closeDoor = function (x, y, id, callback) { } // 关门动画 - core.playSound(doorInfo[2] || 'door.mp3'); + core.playSound(doorInfo[3] || 'door.mp3'); var blockInfo = core.getBlockInfo(id); var image = blockInfo.image, posY = blockInfo.posY, height = blockInfo.height; - var speed = 40, state = 0; + var speed = (doorInfo[1] || 160) / 4, state = 0; var animate = window.setInterval(function () { state++; if (state == 4) { diff --git a/project/maps.js b/project/maps.js index 7d297646..09a10db7 100644 --- a/project/maps.js +++ b/project/maps.js @@ -1,8 +1,8 @@ var maps_90f36752_8815_4be8_b32b_d7fad1d0542e = { - "1": {"cls":"animates","id":"yellowWall","canBreak":true,"animate":1,"doorInfo":[null,"door.mp3","door.mp3"]}, - "2": {"cls":"animates","id":"whiteWall","canBreak":true,"animate":1,"doorInfo":[null,"door.mp3","door.mp3"]}, - "3": {"cls":"animates","id":"blueWall","canBreak":true,"animate":1,"doorInfo":[null,"door.mp3","door.mp3"]}, + "1": {"cls":"animates","id":"yellowWall","canBreak":true,"animate":1,"doorInfo":[null,160,"door.mp3","door.mp3"]}, + "2": {"cls":"animates","id":"whiteWall","canBreak":true,"animate":1,"doorInfo":[null,160,"door.mp3","door.mp3"]}, + "3": {"cls":"animates","id":"blueWall","canBreak":true,"animate":1,"doorInfo":[null,160,"door.mp3","door.mp3"]}, "4": {"cls":"animates","id":"star","name":"星空"}, "5": {"cls":"animates","id":"lava","name":"岩浆"}, "6": {"cls":"terrains","id":"ice"}, @@ -68,12 +68,12 @@ var maps_90f36752_8815_4be8_b32b_d7fad1d0542e = "71": {"cls":"items","id":"shield0"}, "72": {"cls":"items","id":"skill1"}, "73": {"cls":"items","id":"wand"}, - "81": {"cls":"animates","id":"yellowDoor","trigger":"openDoor","animate":1,"doorInfo":[{"yellowKey":1},"door.mp3","door.mp3"],"name":"黄门"}, - "82": {"cls":"animates","id":"blueDoor","trigger":"openDoor","animate":1,"doorInfo":[{"blueKey":1},"door.mp3","door.mp3"],"name":"蓝门"}, - "83": {"cls":"animates","id":"redDoor","trigger":"openDoor","animate":1,"doorInfo":[{"redKey":1},"door.mp3","door.mp3"],"name":"红门"}, - "84": {"cls":"animates","id":"greenDoor","trigger":"openDoor","animate":1,"doorInfo":[{"greenKey":1},"door.mp3","door.mp3"],"name":"绿门"}, - "85": {"cls":"animates","id":"specialDoor","trigger":"openDoor","animate":1,"doorInfo":[null,"door.mp3","door.mp3"],"name":"机关门"}, - "86": {"cls":"animates","id":"steelDoor","trigger":"openDoor","animate":1,"doorInfo":[{"steelKey":1},"door.mp3","door.mp3"],"name":"铁门"}, + "81": {"cls":"animates","id":"yellowDoor","trigger":"openDoor","animate":1,"doorInfo":[{"yellowKey":1},160,"door.mp3","door.mp3"],"name":"黄门"}, + "82": {"cls":"animates","id":"blueDoor","trigger":"openDoor","animate":1,"doorInfo":[{"blueKey":1},160,"door.mp3","door.mp3"],"name":"蓝门"}, + "83": {"cls":"animates","id":"redDoor","trigger":"openDoor","animate":1,"doorInfo":[{"redKey":1},160,"door.mp3","door.mp3"],"name":"红门"}, + "84": {"cls":"animates","id":"greenDoor","trigger":"openDoor","animate":1,"doorInfo":[{"greenKey":1},160,"door.mp3","door.mp3"],"name":"绿门"}, + "85": {"cls":"animates","id":"specialDoor","trigger":"openDoor","animate":1,"doorInfo":[null,160,"door.mp3","door.mp3"],"name":"机关门"}, + "86": {"cls":"animates","id":"steelDoor","trigger":"openDoor","animate":1,"doorInfo":[{"steelKey":1},160,"door.mp3","door.mp3"],"name":"铁门"}, "87": {"cls":"terrains","id":"upFloor","canPass":true}, "88": {"cls":"terrains","id":"downFloor","canPass":true}, "89": {"cls":"animates","id":"portal","canPass":true},