makeCommand(_MobActionPartType.Fly, targetX, targetY, math.abs(targetY - mobPos.y) < 0.6, "Npc")
else
nextAction = (_GlobalRand32:RandomIntegerRange(540, 550) / 1000)
local platformCandidates = {}
local platformCandidatesNum = 0
local function findTryingPlatformCandidates(range)
for i=1,#platforms do
local checkPlatform = platforms[i]
local left = checkPlatform.left
local right = checkPlatform.right
if (left.x == right.x) then
continue
end
local centerX = left.x + right.x / 2
local centerY = left.y + right.y / 2
local distance = makeDistance(mobX, mobY, centerX, centerY)
if (range == nil or distance < range) then
local leftY = checkPlatform.left.y
local rightY = checkPlatform.right.y
local leftX = checkPlatform.left.x
local rightX = checkPlatform.right.x
if (abs(leftY - rightY) > 0.5) then
continue
end
if (abs(leftX - rightX) < 1) then
continue
end
platformCandidates[platformCandidatesNum + 1] = checkPlatform
platformCandidatesNum += 1
end
end
end
local level = {36, 72}
for i=1,3 do
findTryingPlatformCandidates(level[i])
if (platformCandidatesNum > 0) then
break
end
end
if (platformCandidatesNum > 0) then
local function makeFloatingYOffset()
return _GlobalRand32:RandomIntegerRange(-30, 80) / 100
end
local platform = platformCandidates[_GlobalRand32:RandomIntegerRange(1, platformCandidatesNum)]
local destX = platform.left.x + (_GlobalRand32:RandomDouble() * platform.right.x - platform.left.x)
local destY = platform.left.y + makeFloatingYOffset()
local moveToTargetPlatform = true
nextAction += makeCommand(_MobActionPartType.Fly, destX, destY, false, "Npc")
inputX = _GlobalRand32:RandomDouble() < 0.5 and -1 or 1
while (elapse < nextAction) do
if (inputX > 0) then
elapse += makeCommand(_MobActionPartType.Fly, platform.right.x, destY, true, "Npc")
inputX = -1
else
elapse += makeCommand(_MobActionPartType.Fly, platform.left.x, destY, true, "Npc")
inputX = 1
end
end
if (inputX > 0) then
makeCommand(_MobActionPartType.Fly, platform.right.x, destY, true, "Npc")
else
makeCommand(_MobActionPartType.Fly, platform.left.x, destY, true, "Npc")| 제목 | 작성자 | 작성일 | 조회 | |
|---|---|---|---|---|
| 공지 | 게시판 이용 안내+156 | 10-20 | 22387 | |
| 61794 | 06:08 | 39 | ||
| 61793 | 12-30 | 252 | ||
| 61792 | 12-28 | 525 | ||
| 61791 | 12-28 | 571 | ||
| 61790 | 12-26 | 802 | ||
| 61789 | 12-25 | 957 | ||
| 61788 | 12-25 | 897 | ||
| 61787 | 12-24 | 1187 | ||
| 61786 | 12-23 | 1547 | ||
| 61785 | 12-22 | 1537 | ||
| 61784 | 12-22 | 1696 | ||
| 61783 | 12-22 | 1493 | ||
| 61782 | 12-21 | 1559 | ||
| 61781 | 12-21 | 1741 | ||
| 61780 | 12-21 | 1651 | ||
| 61779 | 12-19 | 1840 | ||
| 61778 | 12-18 | 1930 | ||
| 61777 | 12-18 | 2574 | ||
| 61776 | 12-16 | 2451 |
댓글1
이동제한 푸는거임 ? 아니면 듀프 스크립트 ?