34层门,21层录像

This commit is contained in:
爱的天使Erdnase 2023-06-14 23:02:22 +08:00
parent 0d9dc92adf
commit d6b59f8af2
5 changed files with 64 additions and 279 deletions

View File

@ -51,15 +51,9 @@ main.floors.MT21=
"condition": "core.isReplaying()",
"true": [
{
"type": "if",
"condition": "switch:A",
"true": [
{
"type": "moveHero",
"steps": [
"down:1"
]
}
"type": "moveHero",
"steps": [
"down:1"
]
}
]

View File

@ -99,238 +99,7 @@ main.floors.MT34=
}
]
},
"afterOpenDoor": {
"5,4": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"9,4": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"9,6": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"9,8": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"9,10": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"10,9": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"8,9": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"6,9": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"4,9": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"5,10": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"5,8": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"5,6": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"4,5": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"6,5": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"8,5": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"10,5": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"7,4": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"7,6": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"7,8": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"7,10": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"6,7": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"10,7": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
],
"4,7": [
{
"type": "insert",
"name": "34door"
},
{
"type": "hide",
"remove": true
}
]
},
"afterOpenDoor": {},
"cannotMove": {},
"ratio": 8,
"bgmap": [

View File

@ -437,26 +437,66 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
},
"afterOpenDoor": function (doorId, x, y) {
// 开一个门后触发的事件
// 开一个门后触发的事件
if (core.status.floorId == "MT34") {
let doorInfo = {
"5,4": 1,
"7,4": 2,
"9,4": 0,
"4,5": 2,
"6,5": 1,
"8,5": 0,
"10,5": 2,
"5,6": 0,
"7,6": 1,
"9,6": 2,
"4,7": 1,
"6,7": 2,
"8,7": 1,
"10,7": 1,
"5,8": 0,
"7,8": 0,
"9,8": 2,
"4,9": 1,
"6,9": 1,
"8,9": 1,
"10,9": 1,
"5,10": 2,
"7,10": 0,
"9,10": 1
},
doorIds = ['A538', 'A539', 'A540'];
var todo = [];
// 检查该点的开门后事件
if (core.status.floorId) {
core.push(todo, core.floors[core.status.floorId].afterOpenDoor[x + "," + y]);
}
// 检查批量开门事件
var door = core.getBlockById(doorId);
if (door && door.event.doorInfo) {
core.push(todo, door.event.doorInfo.afterOpenDoor);
}
core.addFlag("_MT34OpenDoors_", 1);
if (todo.length > 0) core.insertAction(todo, x, y);
for (let loc in doorInfo) {
let [dx, dy] = loc.split(',');
dx = parseInt(dx)
dy = parseInt(dy)
if (x == dx && y == dy) continue;
if (core.status.event.id == null)
core.continueAutomaticRoute();
else
core.clearContinueAutomaticRoute();
},
let calIndex = (core.getFlag("_MT34OpenDoors_", 0) + doorInfo[loc]) % doorIds.length;
core.setBlock(doorIds[calIndex], dx, dy);
}
}
var todo = [];
// 检查该点的开门后事件
if (core.status.floorId) {
core.push(todo, core.floors[core.status.floorId].afterOpenDoor[x + "," + y]);
}
// 检查批量开门事件
var door = core.getBlockById(doorId);
if (door && door.event.doorInfo) {
core.push(todo, door.event.doorInfo.afterOpenDoor);
}
if (todo.length > 0) core.insertAction(todo, x, y);
if (core.status.event.id == null)
core.continueAutomaticRoute();
else
core.clearContinueAutomaticRoute();
},
"afterGetItem": function (itemId, x, y, isGentleClick) {
// 获得一个道具后触发的事件
// itemId获得的道具IDx和y是该道具所在的坐标

View File

@ -423,9 +423,9 @@ var maps_90f36752_8815_4be8_b32b_d7fad1d0542e =
"535": {"cls":"items","id":"I535"},
"536": {"cls":"items","id":"I536"},
"537": {"cls":"items","id":"I537"},
"538": {"cls":"animates","id":"A538","doorInfo":{"time":160,"openSound":"door.ogg","closeSound":"door.ogg","keys":{"yellowKey":1}},"trigger":"openDoor","animate":1,"script":"if (core.itemCount('yellowKey') > 0) {\n\tcore.mydoor34();\n\tflags.door_34 = { x: core.nextX(), y: core.nextY(), door: core.getBlockId(core.nextX(), core.nextY()) }\n}"},
"539": {"cls":"animates","id":"A539","doorInfo":{"time":160,"openSound":"door.ogg","closeSound":"door.ogg","keys":{"blueKey":1}},"trigger":"openDoor","animate":1,"script":"if (core.itemCount('blueKey') > 0) {\n\tcore.mydoor34();\n\tflags.door_34 = { x: core.nextX(), y: core.nextY(), door: core.getBlockId(core.nextX(), core.nextY()) }\n}"},
"540": {"cls":"animates","id":"A540","doorInfo":{"time":160,"openSound":"door.mp3","closeSound":"door.mp3","keys":{"redKey":1}},"trigger":"openDoor","animate":1,"script":"if (core.itemCount('redKey') > 0) {\n\tcore.mydoor34();\n\tflags.door_34 = { x: core.nextX(), y: core.nextY(), door: core.getBlockId(core.nextX(), core.nextY()) }\n}"},
"538": {"cls":"animates","id":"A538","doorInfo":{"time":160,"openSound":"door.ogg","closeSound":"door.ogg","keys":{"yellowKey":1}},"trigger":"openDoor","animate":1,"script":""},
"539": {"cls":"animates","id":"A539","doorInfo":{"time":160,"openSound":"door.ogg","closeSound":"door.ogg","keys":{"blueKey":1}},"trigger":"openDoor","animate":1,"script":""},
"540": {"cls":"animates","id":"A540","doorInfo":{"time":160,"openSound":"door.mp3","closeSound":"door.mp3","keys":{"redKey":1}},"trigger":"openDoor","animate":1,"script":""},
"541": {"cls":"animates","id":"A541"},
"542": {"cls":"animates","id":"A542"},
"543": {"cls":"animates","id":"A543"},

View File

@ -1545,26 +1545,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
return ids.indexOf(blockId) >= 0;
}
core.mydoor34 = function () {
if (flags.door_34) {
var x = flags.door_34.x,
y = flags.door_34.y;
switch (flags.door_34.door) {
case 'A538':
core.setBlock('A539', x, y);
break;
case 'A539':
core.setBlock('A540', x, y);
break;
case 'A540':
core.setBlock('A538', x, y);
break;
}
}
}
},
"drawLight": function () {