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")| 제목 | 작성자 | 작성일 | 조회 | |
|---|---|---|---|---|
| 18938 | 01-27 | 320 | ||
| 18937 | 01-27 | 307 | ||
| 18936 | 01-27 | 473 | ||
| 18935 | 01-27 | 844 | ||
| 18934 | 01-27 | 533 | ||
| 18933 | 01-27 | 533 | ||
| 18932 | 01-27 | 1203 | ||
| 18931 | 01-27 | 349 | ||
| 18930 | 01-27 | 500 | ||
| 18929 | 01-27 | 318 | ||
| 18928 | 01-27 | 481 | ||
| 18927 | 01-27 | 490 | ||
| 18926 | 01-27 | 295 | ||
| 18925 | 01-27 | 215 | ||
| 18924 | 01-27 | 1515 | ||
| 18923 | 01-27 | 587 | ||
| 18922 | 01-27 | 765 | ||
| 18921 | 01-27 | 457 | ||
| 18920 | 01-27 | 482 | ||
| 18919 | 01-27 | 558 |
댓글1
이동제한 푸는거임 ? 아니면 듀프 스크립트 ?