채팅0

    몹 스피드 어느부분임?

    조회수 339

    return function (self,mob)

    local ai = mob.MobAIComponent

    local kb = mob.MobKnockbackComponent

    local rb = mob.MobRigidbodyComponent


    if (not isvalid(rb)) then

    if (isvalid(ai)) then

    ai:EnableNextControlTimer(0.1)

    end

    return

    end

    if (not mob.Visible) then

    ai:EnableNextControlTimer(0.1)

    return

    end

    local fh = rb.LastFoothold

    if (fh == 0) then

    --log("last foothold is 0")

    --ai:EnableNextControlTimer(0.1)

    end


    local now = _UtilLogic.ServerElapsedSeconds

    if (now < ai.NextActionTime) then

    ai:EnableNextControlTimer(math.max(ai.NextActionTime - now, 0) + 0.1)

    return

    end


    local target = _UserService.LocalPlayer

    local nextAction = 0

    local newInputX = nil

    local mobX = mob.TransformComponent.WorldPosition.x

    if (isvalid(target) and ai.LocalUnchaseTick < 7) then

    if (ai.AttackWasLast) then

    nextAction = _GlobalRand32:RandomIntegerRange(200, 900) / 1000

    else
    	nextAction = _GlobalRand32:RandomIntegerRange(100, 160) / 1000
    
    end
    local targetX = target.TransformComponent.WorldPosition.x + 0.5
    newInputX = targetX > mobX and 1 or -1

    else

    nextAction = (_GlobalRand32:RandomIntegerRange(100, 300) / 1000)

    newInputX = _GlobalRand32:RandomIntegerRange(-1, 1)


    end


    local platforms = mob.CurrentMap.PlatformInfoComponent

    local timelines = {}

    local timelineIndex = 0

    --log("platform left x (fh=%d)", platform.left.x, platform.left.foothold.Id)

    --log("platform right x (fh=%d)", platform.right.x, platform.right.foothold.Id)

    local lastTimeline = 0

    local playerFh = _UserService.LocalPlayer.WsUserController.LastFoothold

    if (playerFh == 0 or platforms.ZMass[playerFh] ~= ai.LocalStartChaseZMass) then

    --ai.LocalUnchaseTick += 1

    --ai:IncUnTick()

    local rb = mob.MobRigidbodyComponent


    end


    local function makeCommand(cmd, value, timeline, nextActionTime)

    timelines[timelineIndex + 1] = {cmd, value, timeline - lastTimeline, nextActionTime}

    timelineIndex += 1

    lastTimeline = timeline

    end


    makeCommand(_MobActionPartType.Move, newInputX, 0, nextAction)

    ai.NextRandomJump = math.max(ai.NextRandomJump, now + 1)


    kb:SetShoeAttr(0)


    if (timelineIndex > 0) then

    mob.CurrentMap.LifeControllerComponent:RequestControl(mob, timelines, timelineIndex, false)

    end

    ai:EnableNextControlTimer(nextAction)

    end

    댓글1

    회원프로필

    몹 스피드라는건 없는걸로 암 그래서 듀프를 할 때 플라이로 변경했던거라고 알고 있음

    2024.01.27 21:13

      게시글 리스트
      제목작성자작성일조회
      1983701-27302
      1983601-27285
      1983501-27340
      1983401-27985
      1983301-27295
      1983201-27765
      1983101-27340
      1983001-27388
      1982901-27356
      1982801-27337
      1982701-27212
      1982601-27650
      1982501-27196
      1982401-27503
      1982301-27323
      1982201-27362
      1982101-27464
      1982001-27753
      1981901-27136
      1981801-27544
      안내 배너 이미지