234.7 KB, 下载次数: 50
function findLine(root) { let line = []; line.push(root); findNear(root); function findNear(event) { let name = event.characterName(); let index = event.characterIndex(); let direction = event.direction(); check(event.x + 1, event.y); check(event.x - 1, event.y); check(event.x, event.y + 1); check(event.x, event.y - 1); check(event.x + 1, event.y + 1); check(event.x - 1, event.y - 1); check(event.x + 1, event.y - 1); check(event.x - 1, event.y + 1); function check(x, y) { let event2 = $gameMap.eventsXy(x, y)[0]; if (event2) { let name2 = event2.characterName(); let index2 = event2.characterIndex(); let direction2 = event2.direction(); if (name2 === name && index2 === index && direction2 === direction) { if (line.indexOf(event2) === -1) { line.push(event2); findNear(event2); } } } } } return line; }
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |