;;-*-Lisp-*-
(in-package goal)

;; name: target-anim.gc
;; name in dgo: target-anim
;; dgos: ENGINE, GAME

;; DECOMP BEGINS

(defbehavior target-land-anim target ()
  (cond
    ((using-gun? self)
     (case (-> self gun gun-type)
       (((pickup-type eco-red) (pickup-type eco-dark))
        jakb-gun-jump-land-ja
        )
       (else
         jakb-gun-jump-land-side-ja
         )
       )
     )
    (else
      (let ((v1-9 (ja-group)))
        (if (or (and v1-9 (= v1-9 jakb-darkjak-jump-ja)) (and (focus-test? self dark) (nonzero? (-> self darkjak))))
            jakb-darkjak-jump-land-ja
            jakb-jump-land-ja
            )
        )
      )
    )
  )

;; WARN: Return type mismatch symbol vs none.
;; WARN: new jak 2 until loop case, check carefully
(defbehavior target-stance-anim target ()
  (let ((gp-0 22))
    (new 'stack 'ground-tween-info)
    (let ((v1-4 (ja-group)))
      (cond
        ((and v1-4 (or (= v1-4 jakb-wade-shallow-walk-ja) (= v1-4 jakb-wade-deep-walk-ja)))
         (set! gp-0 45)
         )
        ((let ((v1-11 (ja-group)))
           (and v1-11 (= v1-11 jakb-roll-flip-ja))
           )
         ((lambda :behavior target
            ()
            (cond
              ((using-gun? self)
               (set! (-> self gun top-anim-low-high) 0.0)
               (case (-> self gun gun-type)
                 (((pickup-type eco-blue))
                  (push-anim-to-targ
                    (-> self skel top-anim)
                    (the-as art-joint-anim jakb-gun-roll-flip-land-ja)
                    0.0
                    0
                    30
                    1.0
                    10.0
                    #f
                    )
                  )
                 (else
                   (push-anim-to-targ
                     (-> self skel top-anim)
                     (the-as art-joint-anim jakb-gun-roll-flip-land-ja)
                     0.0
                     0
                     30
                     1.0
                     6.0
                     #f
                     )
                   )
                 )
               (ja-no-eval :group! jakb-roll-flip-land-ja :num! (seek! (ja-aframe 48.0 0)) :frame-num 0.0)
               (until (ja-done? 0)
                 (suspend)
                 (ja :num! (seek! (ja-aframe 48.0 0)))
                 )
               (ja-channel-push! 1 (seconds 0.05))
               (let ((gp-2 (target-land-anim)))
                 (ja-no-eval :group! gp-2 :num! (seek!) :frame-num (ja-aframe 64.0 0))
                 )
               (until (ja-done? 0)
                 (ja-blend-eval)
                 (suspend)
                 (ja :num! (seek!))
                 )
               )
              (else
                (ja-no-eval :group! jakb-roll-flip-land-ja :num! (seek!) :frame-num 0.0)
                (until (ja-done? 0)
                  (suspend)
                  (ja :num! (seek!))
                  )
                (ja-no-eval :group! jakb-jump-land-ja :num! (seek!) :frame-num (ja-aframe 55.0 0))
                (until (ja-done? 0)
                  (suspend)
                  (ja :num! (seek!))
                  )
                )
              )
            (none)
            )
          )
         )
        ((let ((v1-18 (ja-group)))
           (and v1-18 (or (= v1-18 jakb-attack-from-stance-ja)
                          (= v1-18 jakb-gun-attack-from-stance-ja)
                          (= v1-18 jakb-gun-attack-from-stance-blue-ja)
                          )
                )
           )
         ((lambda :behavior target
            ()
            (set! (-> self control mod-surface) *attack-end-mods*)
            (let* ((v1-3 (ja-group))
                   (a1-0 (cond
                           ((and v1-3 (= v1-3 jakb-gun-attack-from-stance-ja))
                            jakb-gun-attack-from-stance-end-ja
                            )
                           (else
                             (let ((v1-10 (ja-group)))
                               (cond
                                 ((and v1-10 (= v1-10 jakb-gun-attack-from-stance-blue-ja))
                                  jakb-gun-attack-from-stance-blue-end-ja
                                  )
                                 ((rand-vu-percent? 0.3)
                                  jakb-attack-from-stance-alt-end-ja
                                  )
                                 (else
                                   jakb-attack-from-stance-end-ja
                                   )
                                 )
                               )
                             )
                           )
                         )
                   )
              (ja-no-eval :group! a1-0 :num! (seek!) :frame-num 0.0)
              )
            (until (ja-done? 0)
              (when (nonzero? (-> self gun track-target-hold-time))
                (forward-up-nopitch->quaternion
                  (-> self control dir-targ)
                  (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans))
                  (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ))
                  )
                (set-quaternion! (-> self control) (-> self control dir-targ))
                (goto cfg-23)
                )
              (compute-alignment! (-> self align))
              (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0)
              (suspend)
              (ja :num! (seek!))
              )
            (quaternion-copy! (-> self control dir-targ) (-> self control unknown-quaternion04))
            (label cfg-23)
            (set! (-> self control mod-surface) *walk-mods*)
            (let ((v1-57 (ja-group)))
              (when (and (and v1-57 (= v1-57 jakb-gun-attack-from-stance-end-ja))
                         (and (using-gun? self) (= (-> self gun gun-type) (pickup-type eco-yellow)))
                         )
                (ja-channel-push! 1 (seconds 0.1))
                (ja-no-eval :group! jakb-gun-front-to-side-hop-ja :num! (seek!) :frame-num (ja-aframe 5.0 0))
                (until (ja-done? 0)
                  (suspend)
                  (ja :num! (seek!))
                  )
                )
              )
            (none)
            )
          )
         )
        ((let ((v1-25 (ja-group)))
           (and v1-25 (= v1-25 jakb-darkjak-attack-spin-ja))
           )
         (ja-no-eval :group! jakb-darkjak-attack-spin-end-ja :num! (seek!) :frame-num 0.0)
         (until (ja-done? 0)
           (suspend)
           (ja :num! (seek!))
           )
         )
        ((let ((v1-55 (ja-group)))
           (and v1-55 (= v1-55 jakb-smack-surface-ja))
           )
         (ja-no-eval :group! jakb-smack-surface-end-ja :num! (seek!) :frame-num 0.0)
         (until (ja-done? 0)
           (suspend)
           (ja :num! (seek!))
           )
         )
        ((let ((v1-85 (ja-group)))
           (and v1-85 (= v1-85 jakb-darkjak-get-on-fast-ja))
           )
         (ja-no-eval :num! (seek!))
         (while (not (ja-done? 0))
           (suspend)
           (ja-eval)
           )
         (ja-channel-push! 1 (seconds 0.07))
         (ja-no-eval :group! jakb-darkjak-stance-ja :num! (seek!) :frame-num (ja-aframe 15.0 0))
         (until (ja-done? 0)
           (suspend)
           (ja :num! (seek!))
           )
         (set! gp-0 0)
         )
        ((let ((v1-125 (ja-group)))
           (and v1-125 (or (= v1-125 jakb-attack-punch-ja)
                           (= v1-125 jakb-darkjak-attack-combo1-ja)
                           (= v1-125 jakb-darkjak-attack-combo1b-ja)
                           (= v1-125 jakb-darkjak-attack-combo2-ja)
                           (= v1-125 jakb-darkjak-attack-combo3-ja)
                           (= v1-125 jakb-darkjak-attack-combo3c-ja)
                           )
                )
           )
         ((lambda :behavior target
            ()
            (set! (-> self control bend-target) (-> self control bend-amount))
            (set! (-> self control mod-surface) *walk-no-turn-mods*)
            (let* ((v1-5 (ja-group))
                   (a1-0 (cond
                           ((and v1-5 (= v1-5 jakb-darkjak-attack-combo1-ja))
                            (logior! (-> self state-flags) (state-flags lleg-still))
                            jakb-darkjak-attack-combo1-end-ja
                            )
                           ((let ((v1-14 (ja-group)))
                              (and v1-14 (= v1-14 jakb-darkjak-attack-combo1b-ja))
                              )
                            (logior! (-> self state-flags) (state-flags lleg-still))
                            jakb-darkjak-attack-combo1b-end-ja
                            )
                           ((let ((v1-23 (ja-group)))
                              (and v1-23 (= v1-23 jakb-darkjak-attack-combo2-ja))
                              )
                            (logior! (-> self state-flags) (state-flags lleg-still))
                            jakb-darkjak-attack-combo2-end-ja
                            )
                           ((let ((v1-32 (ja-group)))
                              (and v1-32 (= v1-32 jakb-darkjak-attack-combo3-ja))
                              )
                            (logior! (-> self state-flags) (state-flags lleg-still))
                            jakb-darkjak-attack-combo3-end-ja
                            )
                           (else
                             (let ((v1-41 (ja-group)))
                               (cond
                                 ((and v1-41 (= v1-41 jakb-darkjak-attack-combo3c-ja))
                                  (logior! (-> self state-flags) (state-flags lleg-still))
                                  jakb-darkjak-attack-combo3c-end-ja
                                  )
                                 ((rand-vu-percent? 0.3)
                                  jakb-attack-punch-alt-end-ja
                                  )
                                 (else
                                   jakb-attack-punch-end-ja
                                   )
                                 )
                               )
                             )
                           )
                         )
                   )
              (ja-no-eval :group! a1-0 :num! (seek!) :frame-num 0.0)
              )
            (until (ja-done? 0)
              (seek! (-> self control bend-target) 0.0 (seconds-per-frame))
              (suspend)
              (ja :num! (seek!))
              )
            (set! (-> self control mod-surface) *walk-mods*)
            (set! (-> self control bend-target) 0.0)
            (rot->dir-targ! (-> self control))
            (logclear! (-> self state-flags) (state-flags lleg-still rleg-still lleg-no-ik rleg-no-ik))
            (none)
            )
          )
         )
        ((let ((v1-132 (ja-group)))
           (and v1-132 (= v1-132 jakb-gun-attack-butt-ja))
           )
         (set! (-> self control bend-target) (-> self control bend-amount))
         (set! (-> self control mod-surface) *walk-no-turn-mods*)
         (let ((a1-18 jakb-gun-attack-butt-end-ja))
           (ja-no-eval :group! a1-18 :num! (seek!) :frame-num 0.0)
           )
         (until (ja-done? 0)
           (seek! (-> self control bend-target) 0.0 (seconds-per-frame))
           (suspend)
           (ja :num! (seek!))
           )
         (set! (-> self control mod-surface) *walk-mods*)
         (set! (-> self control bend-target) 0.0)
         (rot->dir-targ! (-> self control))
         )
        ((let ((v1-166 (ja-group)))
           (and v1-166 (= v1-166 jakb-gun-attack-butt-blue-ja))
           )
         (set! (-> self control bend-target) (-> self control bend-amount))
         (set! (-> self control mod-surface) *walk-no-turn-mods*)
         (let ((a1-21 jakb-gun-attack-butt-blue-end-ja))
           (ja-no-eval :group! a1-21 :num! (seek!) :frame-num 0.0)
           )
         (until (ja-done? 0)
           (seek! (-> self control bend-target) 0.0 (seconds-per-frame))
           (suspend)
           (ja :num! (seek!))
           )
         (set! (-> self control mod-surface) *walk-mods*)
         (set! (-> self control bend-target) 0.0)
         (rot->dir-targ! (-> self control))
         )
        ((let ((v1-200 (ja-group)))
           (and (and v1-200 (or (= v1-200 jakb-gun-jump-land-ja) (= v1-200 jakb-gun-jump-land-side-ja)))
                (not (using-gun? self))
                )
           )
         (set! gp-0 60)
         )
        ((let ((v1-208 (ja-group)))
           (and v1-208 (or (= v1-208 jakb-duck-stance-ja)
                           (= v1-208 jakb-duck-walk-ja)
                           (= v1-208 jakb-gun-duck-walk-ja)
                           (= v1-208 jakb-duck-roll-ja)
                           (= v1-208 jakb-gun-duck-roll-ja)
                           )
                )
           )
         (cond
           ((and (focus-test? self dark) (nonzero? (-> self darkjak)))
            (set! gp-0 30)
            )
           (else
             (ja-channel-push! 1 (seconds 0.04))
             (ja-no-eval :group! jakb-stance-to-duck-ja :num! (seek! 0.0 1.2) :frame-num max)
             (until (ja-done? 0)
               (suspend)
               (ja :num! (seek! 0.0 1.2))
               )
             (set! gp-0 12)
             )
           )
         )
        ((let ((v1-240 (ja-group)))
           (or (and (and v1-240 (or (= v1-240 jakb-walk-ja) (= v1-240 jakb-darkjak-walk-ja)))
                    (begin (set! gp-0 45) (< 0.5 (-> self skel root-channel 6 frame-interp (-> self skel active-frame-interp))))
                    (not (using-gun? self))
                    )
               (let ((v1-253 (ja-group)))
                 (and v1-253 (or (= v1-253 jakb-run-squash-ja)
                                 (= v1-253 jakb-run-squash-weak-ja)
                                 (= v1-253 jakb-attack-from-stance-run-end-ja)
                                 (= v1-253 jakb-attack-from-stance-run-alt-end-ja)
                                 )
                      )
                 )
               )
           )
         (cond
           ((and (rand-vu-percent? 0.3) (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))))
            (ja-channel-push! 1 (seconds 0.1))
            (ja-no-eval :group! jakb-run-to-stance-fast-ja :num! (seek!) :frame-num 0.0)
            (until (ja-done? 0)
              (suspend)
              (ja :num! (seek!))
              )
            )
           (else
             (let* ((v1-288 (ja-group))
                    (f30-1 (cond
                             ((and v1-288 (or (= v1-288 jakb-walk-ja) (= v1-288 jakb-darkjak-walk-ja)))
                              (let ((f0-65 (+ 50.0 (* 0.8333333 (+ -25.0 (ja-aframe-num 0))))))
                                (- f0-65 (* (the float (the int (/ f0-65 50.0))) 50.0))
                                )
                              )
                             (else
                               0.0
                               )
                             )
                           )
                    )
               (set! gp-0 45)
               (ja-channel-push! 1 (the-as time-frame gp-0))
               (ja :group! jakb-run-to-stance-loop-ja :num! (identity (ja-aframe f30-1 0)))
               )
             (dotimes (s5-1 3)
               (until (ja-done? 0)
                 (suspend)
                 (ja :num! (seek!))
                 )
               (ja :num-func num-func-identity :frame-num 0.0)
               )
             (ja-no-eval :group! jakb-run-to-stance-ja :num! (seek! (ja-aframe 82.0 0)) :frame-num 0.0)
             (until (ja-done? 0)
               (suspend)
               (ja :num! (seek! (ja-aframe 82.0 0)))
               )
             (when (not (and (focus-test? self dark) (nonzero? (-> self darkjak))))
               (ja-no-eval :group! jakb-run-to-stance-ja :num! (seek! (ja-aframe 142.0 0)) :frame-num (ja-aframe 82.0 0))
               (until (ja-done? 0)
                 (suspend)
                 (ja :num! (seek! (ja-aframe 142.0 0)))
                 )
               (logior! (-> self state-flags) (state-flags lleg-still rleg-still))
               (ja-no-eval :group! jakb-run-to-stance-ja :num! (seek!) :frame-num (ja-aframe 142.0 0))
               (until (ja-done? 0)
                 (suspend)
                 (ja :num! (seek!))
                 )
               )
             )
           )
         )
        ((let ((v1-378 (ja-group)))
           (and (and v1-378 (= v1-378 jakb-walk-ja)) (>= (-> self control ctrl-xz-vel) 5734.4))
           )
         (set! gp-0 45)
         )
        )
      )
    (if (and (using-gun? self) (-> self next-state) (= (-> self next-state name) 'target-stance))
        (go target-gun-stance)
        )
    (let ((v1-395 (ja-group)))
      (if (not (and (and v1-395 (= v1-395 jakb-stance-loop-ja)) (= (ja-group-size) 1)))
          (ja-channel-push! 1 (the-as time-frame gp-0))
          )
      )
    )
  (logior! (-> self state-flags) (state-flags lleg-still rleg-still))
  (if (and (focus-test? self dark) (nonzero? (-> self darkjak)))
      (ja :group! jakb-darkjak-stance-ja)
      (ja :group! jakb-stance-loop-ja)
      )
  (until #f
    (suspend)
    (ja :num! (loop!))
    (if (can-play-stance-amibent?)
        (go target-stance-ambient)
        )
    )
  #f
  (none)
  )

(defbehavior target-stance-push target ((arg0 int))
  (let ((v1-2 (ja-group)))
    (cond
      ((or (and (and v1-2 (= v1-2 jakb-walk-ja))
                (< 0.5 (-> self skel root-channel 6 frame-interp (-> self skel active-frame-interp)))
                )
           (let ((v1-14 (ja-group)))
             (and v1-14 (or (= v1-14 jakb-run-squash-ja)
                            (= v1-14 jakb-run-squash-weak-ja)
                            (= v1-14 jakb-attack-from-stance-run-end-ja)
                            (= v1-14 jakb-attack-from-stance-run-alt-end-ja)
                            )
                  )
             )
           )
       (ja-channel-push! 1 (seconds 0.15))
       (ja-no-eval :group! jakb-run-to-stance-loop-ja :num! (seek!) :frame-num 0.0)
       (until (ja-done? 0)
         (suspend)
         (ja :num! (seek!))
         )
       (ja-no-eval :group! jakb-run-to-stance-ja :num! (seek!) :frame-num 0.0)
       (until (ja-done? 0)
         (suspend)
         (ja :num! (seek!))
         )
       (ja-channel-push! arg0 (seconds 0.15))
       )
      ((let ((v1-68 (ja-group)))
         (and (and v1-68 (or (= v1-68 jakb-jump-short-land-ja)
                             (= v1-68 jakb-jump-land-ja)
                             (= v1-68 jakb-gun-jump-land-ja)
                             (= v1-68 jakb-gun-jump-land-side-ja)
                             (= v1-68 jakb-darkjak-jump-land-ja)
                             )
                   )
              (not (ja-max? 0))
              )
         )
       (ja-no-eval :num! (seek!))
       (while (not (ja-done? 0))
         (suspend)
         (ja-eval)
         )
       (ja-channel-push! arg0 (seconds 0.075))
       )
      ((let ((v1-84 (ja-group)))
         (not (and (and v1-84 (= v1-84 jakb-stance-loop-ja)) (= (ja-group-size) 1)))
         )
       (ja-channel-push! arg0 (seconds 0.075))
       )
      )
    )
  (none)
  )

(defbehavior target-falling-anim target ((arg0 int) (arg1 time-frame))
  (let ((v1-2 (ja-group)))
    (cond
      ((and v1-2
            (or (= v1-2 jakb-jump-loop-ja) (= v1-2 jakb-attack-uppercut-ja) (= v1-2 jakb-gun-attack-upperbutt-ja))
            )
       )
      ((let ((v1-8 (ja-group)))
         (and v1-8 (or (= v1-8 jakb-edge-grab-stance0-ja) (= v1-8 jakb-edge-grab-stance1-ja)))
         )
       (ja-channel-push! 1 (seconds 0.15))
       (ja-no-eval :group! jakb-edge-grab-off-ja :num! (seek!) :frame-num 0.0)
       (until (ja-done? 0)
         (suspend)
         (ja :num! (seek!))
         )
       )
      ((let ((v1-37 (ja-group)))
         (and v1-37 (= v1-37 jakb-edge-grab-off-ja))
         )
       (until (ja-done? 0)
         (suspend)
         (ja :num! (seek!))
         )
       (ja-channel-push! 1 (seconds 0.15))
       )
      (else
        (let ((v1-52 (ja-group)))
          (cond
            ((and v1-52 (= v1-52 jakb-roll-flip-ja))
             (let ((s5-0 (current-time)))
               (while (or (= arg0 -1) (not (time-elapsed? s5-0 arg0)))
                 (when (time-elapsed? s5-0 (seconds 0.01))
                   (let ((v1-62 (ja-group)))
                     (when (not (and v1-62 (= v1-62 jakb-jump-loop-ja)))
                       (ja-channel-push! 1 (seconds 0.1))
                       (ja :group! jakb-jump-loop-ja :num! min)
                       )
                     )
                   )
                 (let ((v1-71 (new-stack-vector0))
                       (f0-12 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))
                       )
                   0.0
                   (vector-! v1-71 (-> self control transv) (vector-float*! v1-71 (-> self control dynam gravity-normal) f0-12))
                   (let* ((f2-0 (vector-length v1-71))
                          (f1-2 f2-0)
                          (f2-1 (* 0.9 f2-0))
                          )
                     (vector+!
                       (-> self control transv)
                       (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-12)
                       (vector-float*! v1-71 v1-71 (/ f2-1 f1-2))
                       )
                     )
                   )
                 (suspend)
                 (let ((v1-74 (ja-group)))
                   (if (and v1-74 (= v1-74 jakb-jump-loop-ja))
                       (ja :num! (loop!))
                       (ja :num! (seek!))
                       )
                   )
                 )
               )
             (return #f)
             )
            (else
              (ja-channel-push! 1 arg1)
              (ja :group! jakb-jump-loop-ja)
              (while (!= (-> self skel root-channel 0) (-> self skel channel))
                (suspend)
                )
              )
            )
          )
        )
      )
    )
  (ja-no-eval :group! jakb-jump-loop-ja :num! (loop!) :frame-num 0.0)
  (let ((s5-1 (current-time)))
    (while (or (= arg0 -1)
               (and (not (time-elapsed? s5-1 arg0)) (not (logtest? (-> self control status) (collide-status on-surface))))
               )
      (suspend)
      (ja :group! jakb-jump-loop-ja :num! (loop!))
      )
    )
  #f
  )

(defbehavior target-falling-anim-trans target ()
  (let ((v1-2 (ja-group)))
    (cond
      ((not (and v1-2 (or (= v1-2 jakb-jump-loop-ja)
                          (= v1-2 jakb-jump-land-ja)
                          (= v1-2 jakb-gun-jump-land-ja)
                          (= v1-2 jakb-gun-jump-land-side-ja)
                          )
                 )
            )
       (ja-channel-push! 1 (seconds 0.33))
       (ja :group! jakb-jump-loop-ja)
       )
      ((and (logtest? (-> self control status) (collide-status on-surface))
            (let ((v1-15 (ja-group)))
              (and (not (and v1-15 (= v1-15 jakb-jump-land-ja)))
                   (not (logtest? (-> self control status) (collide-status on-water)))
                   )
              )
            )
       (ja-channel-push! 1 (seconds 0.02))
       (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim (target-land-anim)))
       )
      ((let ((v1-23 (ja-group)))
         (and v1-23 (= v1-23 jakb-jump-loop-ja))
         )
       (ja :num! (loop!))
       )
      ((let ((v1-33 (ja-group)))
         (and v1-33
              (or (= v1-33 jakb-jump-land-ja) (= v1-33 jakb-gun-jump-land-ja) (= v1-33 jakb-gun-jump-land-side-ja))
              )
         )
       (ja :num! (seek!))
       )
      )
    )
  0
  (none)
  )

;; WARN: Return type mismatch symbol vs none.
(defbehavior target-walk-anim target ((arg0 int))
  (local-vars (sv-16 float))
  (let ((f24-0 0.0)
        (f26-0 (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -16384.0 (-> self control ctrl-xz-vel))))))
        (f30-0 0.0)
        (f28-0 0.0)
        (s5-0 #f)
        )
    (let ((v1-6 (ja-group)))
      (cond
        ((and v1-6 (= v1-6 jakb-turn-around-ja))
         (set! f26-0 1.0)
         (ja-channel-push! 7 (seconds 0.05))
         )
        ((let ((v1-12 (ja-group)))
           (and v1-12 (or (= v1-12 jakb-duck-roll-ja) (= v1-12 jakb-gun-duck-roll-ja)))
           )
         (ja-channel-push! 7 (seconds 0.075))
         (set! f26-0 1.0)
         )
        ((let ((v1-19 (ja-group)))
           (and v1-19 (= v1-19 jakb-attack-from-stance-ja))
           )
         ((lambda :behavior target
            ()
            (let ((f30-0 (fmax 0.8 (fmin 1.0 (/ (-> self control ctrl-xz-vel) (meters 5))))))
              (cond
                ((and (rand-vu-percent? 0.3) (< 20480.0 (-> self control ctrl-xz-vel)))
                 (ja-no-eval :group! jakb-attack-from-stance-alt-end-ja :num! (seek! (ja-aframe 29.0 0) f30-0) :frame-num 0.0)
                 (until (ja-done? 0)
                   (suspend)
                   (ja :num! (seek! (ja-aframe 29.0 0) f30-0))
                   )
                 (ja-no-eval :group! jakb-attack-from-stance-run-alt-end-ja :num! (seek! max f30-0) :frame-num 0.0)
                 (until (ja-done? 0)
                   (suspend)
                   (ja :num! (seek! max f30-0))
                   )
                 )
                (else
                  (ja-no-eval :group! jakb-attack-from-stance-end-ja :num! (seek! (ja-aframe 29.0 0) f30-0) :frame-num 0.0)
                  (until (ja-done? 0)
                    (suspend)
                    (ja :num! (seek! (ja-aframe 29.0 0) f30-0))
                    )
                  (ja-no-eval :group! jakb-attack-from-stance-run-end-ja :num! (seek! max f30-0) :frame-num 0.0)
                  (until (ja-done? 0)
                    (suspend)
                    (ja :num! (seek! max f30-0))
                    )
                  )
                )
              )
            (ja-channel-push! 7 (seconds 0.05))
            (none)
            )
          )
         (set! f26-0 1.0)
         (set! f24-0 30.0)
         )
        ((let ((v1-27 (ja-group)))
           (and v1-27 (or (= v1-27 jakb-darkjak-get-off-ja) (= v1-27 jakb-darkjak-bomb-end-ja)))
           )
         (set! f26-0 1.0)
         (ja-channel-push! 7 (seconds 0.3))
         )
        ((let ((v1-33 (ja-group)))
           (and v1-33 (or (= v1-33 jakb-attack-punch-ja)
                          (= v1-33 jakb-attack-punch-end-ja)
                          (= v1-33 jakb-gun-attack-butt-ja)
                          (= v1-33 jakb-gun-attack-butt-blue-ja)
                          (= v1-33 jakb-darkjak-attack-combo1-end-ja)
                          (= v1-33 jakb-darkjak-attack-combo1b-end-ja)
                          (= v1-33 jakb-darkjak-attack-combo2-end-ja)
                          (= v1-33 jakb-darkjak-attack-combo3-end-ja)
                          (= v1-33 jakb-darkjak-attack-combo3c-end-ja)
                          )
                )
           )
         (set! f26-0 1.0)
         (set! f24-0 30.0)
         (ja-channel-push! 7 (seconds 0.15))
         )
        ((let ((v1-40 (ja-group)))
           (and (and v1-40 (or (= v1-40 jakb-walk-ja) (= v1-40 jakb-gun-walk-side-ja) (= v1-40 jakb-darkjak-walk-ja)))
                (= (ja-group-size) 7)
                )
           )
         (set! f24-0 (ja-aframe-num 0))
         (set! f26-0 (-> self control unknown-float002))
         (set! f30-0 (-> self control unknown-float-n12iuh3n1))
         (set! f28-0 (-> self control unknown-float-ki1jhbn23hj))
         )
        ((let ((v1-50 (ja-group)))
           (and v1-50 (= v1-50 (-> self draw art-group data 108)))
           )
         (set! f24-0 (ja-aframe-num 0))
         (ja-channel-push! 7 (seconds 0.1))
         )
        ((let ((v1-55 (ja-group)))
           (and v1-55 (= v1-55 jakb-wade-shallow-walk-ja))
           )
         (set! f24-0 (ja-aframe-num 0))
         (ja-channel-push! 7 (seconds 0.05))
         )
        ((let ((v1-60 (ja-group)))
           (and (or (and v1-60
                         (or (= v1-60 jakb-jump-loop-ja)
                             (= v1-60 jakb-roll-flip-ja)
                             (= v1-60 jakb-attack-from-jump-end-ja)
                             (= v1-60 jakb-attack-uppercut-ja)
                             (= v1-60 jakb-gun-attack-upperbutt-ja)
                             (= v1-60 jakb-flop-down-land-ja)
                             )
                         )
                    (let ((v1-66 (ja-group)))
                      (and (and v1-66 (or (= v1-66 jakb-jump-ja) (= v1-66 jakb-darkjak-jump-ja))) (< 30.0 (ja-aframe-num 0)))
                      )
                    )
                (< 12288.0 (-> self control ctrl-xz-vel))
                )
           )
         ((lambda :behavior target
            ()
            (let ((gp-0 (ja-group))
                  (f30-0 (-> self control ground-impact-vel))
                  )
              (let ((v1-7 (ja-group)))
                (if (and v1-7 (or (= v1-7 jakb-roll-flip-ja) (= v1-7 jakb-attack-from-jump-end-ja)))
                    (ja-channel-push! 1 (seconds 0.05))
                    (ja-channel-set! 1)
                    )
                )
              (cond
                ((< (if (= gp-0 jakb-jump-ja)
                        77824.0
                        102400.0
                        )
                    f30-0
                    )
                 (ja-no-eval :group! jakb-run-squash-ja :num! (seek! (ja-aframe 3.0 0) 1.00001) :frame-num 0.0)
                 (until (ja-done? 0)
                   (suspend)
                   (ja :num! (seek! (ja-aframe 3.0 0) 1.00001))
                   )
                 )
                ((< (if (= gp-0 jakb-jump-ja)
                        61440.0
                        102400.0
                        )
                    f30-0
                    )
                 (ja-no-eval :group! jakb-run-squash-ja :num! (seek! (ja-aframe 3.0 0) 1.00001) :frame-num (ja-aframe -1.0 0))
                 (until (ja-done? 0)
                   (suspend)
                   (ja :num! (seek! (ja-aframe 3.0 0) 1.00001))
                   )
                 )
                (else
                  (ja-no-eval :group! jakb-run-squash-weak-ja :num! (seek! (ja-aframe 4.0 0) 1.00001) :frame-num 0.0)
                  (until (ja-done? 0)
                    (suspend)
                    (ja :num! (seek! (ja-aframe 4.0 0) 1.00001))
                    )
                  )
                )
              )
            (when (using-gun? self)
              (set! (-> self gun top-anim-low-high) 0.0)
              (case (-> self gun gun-type)
                (((pickup-type eco-blue))
                 (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-run-blue-ja) 16.0 90 60 1.0 0.0 #f)
                 )
                (else
                  (push-anim-to-targ
                    (-> self skel top-anim)
                    (the-as art-joint-anim jakb-gun-front-run-ja)
                    16.0
                    90
                    60
                    1.0
                    0.0
                    #f
                    )
                  )
                )
              )
            (until (ja-done? 0)
              (suspend)
              ;; og:preserve-this patched for high fps
              (ja :num! (seek! max (/ (* (fmax 20480.0 (-> self control ctrl-xz-vel)) (seconds-per-frame-high-fps))
                                      (/ (-> *TARGET-bank* run-up-cycle-dist) (-> *TARGET-bank* run-cycle-length))
                                      )
                               )
                  )
              )
            (ja-channel-push! 7 (seconds 0.1))
            (none)
            )
          )
         (set! f24-0 30.0)
         (set! f26-0 1.0)
         )
        ((let ((v1-78 (ja-group)))
           (and v1-78 (or (= v1-78 jakb-jump-ja) (= v1-78 jakb-darkjak-jump-ja)))
           )
         (ja-channel-push! 7 (seconds 0.05))
         (set! s5-0 #t)
         )
        (else
          (let ((v1-84 (ja-group)))
            (cond
              ((and v1-84 (= v1-84 jakb-smack-surface-ja))
               (ja-channel-push! 7 (seconds 0.15))
               )
              ((and (focus-test? self dark) (nonzero? (-> self darkjak)))
               (set! f24-0 55.0)
               (ja-channel-push! 7 (seconds 0.1))
               )
              (else
                (ja-channel-push! 7 (seconds 0.05))
                )
              )
            )
          )
        )
      )
    (set! (-> self skel root-channel 3 command) (joint-control-command push))
    (set! (-> self skel root-channel 6 command) (joint-control-command stack))
    (ja :group! jakb-walk-ja)
    (let ((f24-1 (ja-aframe f24-0 0)))
      (cond
        ((and (focus-test? self dark) (nonzero? (-> self darkjak)))
         (let ((s4-0 (-> self skel root-channel 0)))
           (let ((f0-3 0.0))
             (set! (-> s4-0 frame-interp 1) f0-3)
             (set! (-> s4-0 frame-interp 0) f0-3)
             )
           (set! (-> s4-0 dist) 12288.0)
           (joint-control-channel-group-eval! s4-0 (the-as art-joint-anim jakb-darkjak-walk-ja) num-func-identity)
           (set! (-> s4-0 frame-num) f24-1)
           )
         )
        ((and (using-gun? self)
              (or (= (-> self gun gun-type) (pickup-type eco-yellow)) (= (-> self gun gun-type) (pickup-type eco-blue)))
              )
         (let ((s4-1 (-> self skel root-channel 0)))
           (let ((f0-5 0.0))
             (set! (-> s4-1 frame-interp 1) f0-5)
             (set! (-> s4-1 frame-interp 0) f0-5)
             )
           (set! (-> s4-1 dist) 12288.0)
           (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim jakb-gun-walk-side-ja) num-func-identity)
           (set! (-> s4-1 frame-num) f24-1)
           )
         )
        (else
          (let ((s4-2 (-> self skel root-channel 0)))
            (let ((f0-7 0.0))
              (set! (-> s4-2 frame-interp 1) f0-7)
              (set! (-> s4-2 frame-interp 0) f0-7)
              )
            (set! (-> s4-2 dist) (-> *TARGET-bank* walk-cycle-dist))
            (joint-control-channel-group-eval! s4-2 (the-as art-joint-anim jakb-walk-ja) num-func-identity)
            (set! (-> s4-2 frame-num) f24-1)
            )
          )
        )
      (let ((s4-3 (-> self skel root-channel 1)))
        (let ((f0-9 0.0))
          (set! (-> s4-3 frame-interp 1) f0-9)
          (set! (-> s4-3 frame-interp 0) f0-9)
          )
        (set! (-> s4-3 dist) (-> *TARGET-bank* walk-down-cycle-dist))
        (joint-control-channel-group-eval! s4-3 (the-as art-joint-anim jakb-walk-down-ja) num-func-identity)
        (set! (-> s4-3 frame-num) f24-1)
        )
      (let ((s4-4 (-> self skel root-channel 2)))
        (let ((f0-11 0.0))
          (set! (-> s4-4 frame-interp 1) f0-11)
          (set! (-> s4-4 frame-interp 0) f0-11)
          )
        (set! (-> s4-4 dist) (-> *TARGET-bank* walk-side-cycle-dist))
        (joint-control-channel-group-eval! s4-4 (the-as art-joint-anim jakb-walk-left-ja) num-func-identity)
        (set! (-> s4-4 frame-num) f24-1)
        )
      (let ((s4-5 (-> self skel root-channel 4)))
        (let ((f0-13 0.0))
          (set! (-> s4-5 frame-interp 1) f0-13)
          (set! (-> s4-5 frame-interp 0) f0-13)
          )
        (set! (-> s4-5 dist) (-> *TARGET-bank* run-down-cycle-dist))
        (joint-control-channel-group-eval! s4-5 (the-as art-joint-anim jakb-run-down-ja) num-func-identity)
        (set! (-> s4-5 frame-num) f24-1)
        )
      (let ((s4-6 (-> self skel root-channel 5)))
        (let ((f0-15 0.0))
          (set! (-> s4-6 frame-interp 1) f0-15)
          (set! (-> s4-6 frame-interp 0) f0-15)
          )
        (set! (-> s4-6 dist) (-> *TARGET-bank* run-side-cycle-dist))
        (joint-control-channel-group-eval! s4-6 (the-as art-joint-anim jakb-run-left-ja) num-func-identity)
        (set! (-> s4-6 frame-num) f24-1)
        )
      (cond
        ((and (focus-test? self dark) (nonzero? (-> self darkjak)))
         (let ((s4-7 (-> self skel root-channel 3)))
           (let ((f0-17 0.0))
             (set! (-> s4-7 frame-interp 1) f0-17)
             (set! (-> s4-7 frame-interp 0) f0-17)
             )
           (set! (-> s4-7 dist) 27033.6)
           (joint-control-channel-group-eval! s4-7 (the-as art-joint-anim jakb-darkjak-run-ja) num-func-identity)
           (set! (-> s4-7 frame-num) f24-1)
           )
         )
        ((using-gun? self)
         (let ((s4-8 (-> self skel root-channel 3)))
           (let ((f0-19 0.0))
             (set! (-> s4-8 frame-interp 1) f0-19)
             (set! (-> s4-8 frame-interp 0) f0-19)
             )
           (set! (-> s4-8 dist) (-> *TARGET-bank* run-cycle-dist))
           (joint-control-channel-group-eval! s4-8 (the-as art-joint-anim jakb-gun-front-run-ja) num-func-identity)
           (set! (-> s4-8 frame-num) f24-1)
           )
         )
        (else
          (let ((s4-9 (-> self skel root-channel 3)))
            (let ((f0-21 0.0))
              (set! (-> s4-9 frame-interp 1) f0-21)
              (set! (-> s4-9 frame-interp 0) f0-21)
              )
            (set! (-> s4-9 dist) (-> *TARGET-bank* run-cycle-dist))
            (joint-control-channel-group-eval! s4-9 (the-as art-joint-anim jakb-run-ja) num-func-identity)
            (set! (-> s4-9 frame-num) f24-1)
            )
          )
        )
      )
    (let ((s4-10 (current-time))
          (f24-2
            (if (and (using-gun? self)
                     (or (= (-> self gun gun-type) (pickup-type eco-yellow)) (= (-> self gun gun-type) (pickup-type eco-blue)))
                     )
                0.0
                1.0
                )
            )
          )
      (until (and (>= arg0 0) (time-elapsed? s4-10 arg0))
        (let ((f20-0 (fmax -1.0 (fmin 1.0 (* 2.0 (-> self control local-slope-z)))))
              (f22-1 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control local-slope-x)))))
              )
          (set! sv-16 (fabs (deg-diff (quaternion-y-angle (-> self control dir-targ)) (y-angle (-> self control)))))
          (set! f26-0 (seek
                        f26-0
                        (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -16384.0 (-> self control ctrl-xz-vel)))))
                        (* 2.0 (seconds-per-frame))
                        )
                )
          (if (and (focus-test? self dark) (nonzero? (-> self darkjak)))
              (set! f26-0
                    (seek f26-0 (lerp-scale f26-0 (* 0.7 f26-0) sv-16 1820.4445 3640.889) (* 2.0 (seconds-per-frame)))
                    )
              )
          (cond
            ((< 0.5 f26-0)
             (let ((v1-206 (-> self skel effect)))
               (set! (-> v1-206 channel-offset) 3)
               )
             0
             (logclear! (-> self state-flags) (state-flags lleg-no-ik rleg-no-ik))
             )
            (else
              (let ((v1-211 (-> self skel effect)))
                (set! (-> v1-211 channel-offset) 0)
                )
              0
              (logior! (-> self state-flags) (state-flags lleg-no-ik rleg-no-ik))
              )
            )
          (let ((f0-37 (fabs (- f20-0 f30-0))))
            (set! f30-0 (seek f30-0 f20-0 (fmax 0.05 (fmin 0.2 (/ f0-37 4)))))
            )
          (let ((f0-42 (fabs (- f22-1 f28-0))))
            (set! f28-0 (seek f28-0 f22-1 (fmax 0.05 (fmin 0.2 (/ f0-42 4)))))
            )
          )
        (set! (-> self control unknown-float-n12iuh3n1) f30-0)
        (set! (-> self control unknown-float-ki1jhbn23hj) f28-0)
        (set! (-> self control unknown-float002) f26-0)
        (cond
          ((>= f30-0 0.0)
           (let ((v1-228 (-> self skel root-channel 1)))
             (let ((f0-48 (* (fabs f30-0) f24-2)))
               (set! (-> v1-228 frame-interp 1) f0-48)
               (set! (-> v1-228 frame-interp 0) f0-48)
               )
             (set! (-> v1-228 dist) (-> *TARGET-bank* walk-up-cycle-dist))
             (set! (-> v1-228 frame-group) (the-as art-joint-anim jakb-walk-up-ja))
             )
           (let ((v1-231 (-> self skel root-channel 4)))
             (let ((f0-50 (fabs f30-0)))
               (set! (-> v1-231 frame-interp 1) f0-50)
               (set! (-> v1-231 frame-interp 0) f0-50)
               )
             (set! (-> v1-231 dist) (-> *TARGET-bank* run-up-cycle-dist))
             (set! (-> v1-231 frame-group) (the-as art-joint-anim jakb-run-up-ja))
             )
           )
          (else
            (let ((v1-234 (-> self skel root-channel 1)))
              (let ((f0-53 (* (fabs f30-0) f24-2)))
                (set! (-> v1-234 frame-interp 1) f0-53)
                (set! (-> v1-234 frame-interp 0) f0-53)
                )
              (set! (-> v1-234 dist) (-> *TARGET-bank* walk-down-cycle-dist))
              (set! (-> v1-234 frame-group) (the-as art-joint-anim jakb-walk-down-ja))
              )
            (let ((v1-237 (-> self skel root-channel 4)))
              (let ((f0-55 (fabs f30-0)))
                (set! (-> v1-237 frame-interp 1) f0-55)
                (set! (-> v1-237 frame-interp 0) f0-55)
                )
              (set! (-> v1-237 dist) (-> *TARGET-bank* run-down-cycle-dist))
              (set! (-> v1-237 frame-group) (the-as art-joint-anim jakb-run-down-ja))
              )
            )
          )
        (cond
          ((>= f28-0 0.0)
           (let ((v1-240 (-> self skel root-channel 2)))
             (let ((f0-59 (* (fabs f28-0) f24-2)))
               (set! (-> v1-240 frame-interp 1) f0-59)
               (set! (-> v1-240 frame-interp 0) f0-59)
               )
             (set! (-> v1-240 dist) (-> *TARGET-bank* walk-side-cycle-dist))
             (set! (-> v1-240 frame-group) (the-as art-joint-anim jakb-walk-right-ja))
             )
           (let ((v1-243 (-> self skel root-channel 5)))
             (let ((f0-61 (fabs f28-0)))
               (set! (-> v1-243 frame-interp 1) f0-61)
               (set! (-> v1-243 frame-interp 0) f0-61)
               )
             (set! (-> v1-243 dist) (-> *TARGET-bank* run-side-cycle-dist))
             (set! (-> v1-243 frame-group) (the-as art-joint-anim jakb-run-right-ja))
             )
           )
          (else
            (let ((v1-246 (-> self skel root-channel 2)))
              (let ((f0-64 (* (fabs f28-0) f24-2)))
                (set! (-> v1-246 frame-interp 1) f0-64)
                (set! (-> v1-246 frame-interp 0) f0-64)
                )
              (set! (-> v1-246 dist) (-> *TARGET-bank* walk-side-cycle-dist))
              (set! (-> v1-246 frame-group) (the-as art-joint-anim jakb-walk-left-ja))
              )
            (let ((v1-249 (-> self skel root-channel 5)))
              (let ((f0-66 (fabs f28-0)))
                (set! (-> v1-249 frame-interp 1) f0-66)
                (set! (-> v1-249 frame-interp 0) f0-66)
                )
              (set! (-> v1-249 dist) (-> *TARGET-bank* run-side-cycle-dist))
              (set! (-> v1-249 frame-group) (the-as art-joint-anim jakb-run-left-ja))
              )
            )
          )
        (ja :chan 6 :frame-interp0 f26-0 :frame-interp1 f26-0)
        (let* ((f1-14 (* (current-cycle-distance (-> self skel)) (-> self control scale x)))
               (f0-70 (/ (-> self control ctrl-xz-vel) (* 60.0 (/ f1-14 (-> *TARGET-bank* run-cycle-length)))))
               )
          (ja :num! (loop! f0-70))
          )
        (ja :chan 1 :num! (chan 0))
        (ja :chan 2 :num! (chan 0))
        (ja :chan 3 :num! (chan 0))
        (ja :chan 4 :num! (chan 0))
        (ja :chan 5 :num! (chan 0))
        (if (and s5-0 (!= (-> self skel root-channel 0) (-> self skel channel)))
            (ja-blend-eval)
            )
        (suspend)
        )
      )
    )
  (none)
  )

(defbehavior target-hit-ground-flop-anim target ((arg0 symbol) (arg1 symbol))
  (let ((f30-0 (if (= arg0 'swim)
                   0.4
                   1.0
                   )
               )
        )
    (if (using-gun? self)
        (push-anim-to-targ
          (-> self skel top-anim)
          (the-as art-joint-anim jakb-gun-flop-down-land-ja)
          0.0
          0
          30
          1.0
          0.0
          #f
          )
        )
    (ja-channel-set! 1)
    (let ((s5-0 (-> self skel root-channel 0)))
      (set! (-> s5-0 frame-group) (the-as art-joint-anim jakb-flop-down-land-ja))
      (set! (-> s5-0 param 0)
            (the float (+ (-> (the-as art-joint-anim jakb-flop-down-land-ja) frames num-frames) -1))
            )
      (let ((f30-1 (seek f30-0 1.0 (* 0.5 (seconds-per-frame)))))
        (set! (-> s5-0 param 1) f30-1)
        (set! (-> s5-0 frame-num) 0.0)
        (joint-control-channel-group! s5-0 (the-as art-joint-anim jakb-flop-down-land-ja) num-func-seek!)
        (until (ja-done? 0)
          (compute-alignment! (-> self align))
          (align!
            (-> self align)
            (if arg1
                (align-opts adjust-y-vel)
                (align-opts adjust-y-vel adjust-xz-vel)
                )
            1.0
            1.0
            1.5
            )
          (when (and (>= 25.0 (ja-aframe-num 0))
                     (and (>= (ja-aframe-num 0) 21.0)
                          (and (-> self next-state) (= (-> self next-state name) 'target-flop-hit-ground))
                          (!= (-> self tobot?) 'tobot)
                          (!= (-> self control unknown-spool-anim00) 'stuck)
                          )
                     )
            (when (and (cpad-hold? (-> self control cpad number) x) (can-jump? #f) (!= (-> self control ground-pat event) 7))
              (let ((v1-55 (new-stack-vector0)))
                (let ((f0-8 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))))
                  0.0
                  (vector-! v1-55 (-> self control transv) (vector-float*! v1-55 (-> self control dynam gravity-normal) f0-8))
                  )
                (let* ((f0-9 (vector-length v1-55))
                       (f1-3 f0-9)
                       (f2-0 0.0)
                       )
                  (vector+!
                    (-> self control transv)
                    (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0)
                    (vector-float*! v1-55 v1-55 (/ f0-9 f1-3))
                    )
                  )
                )
              (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.4)))
              (if (using-gun? self)
                  (go
                    target-high-jump
                    (-> *TARGET-bank* flop-jump-height-min)
                    (-> *TARGET-bank* flop-jump-height-max)
                    (if arg1
                        'flop
                        'flop-forward
                        )
                    )
                  (go
                    target-duck-high-jump
                    (-> *TARGET-bank* flop-jump-height-min)
                    (-> *TARGET-bank* flop-jump-height-max)
                    (if arg1
                        'flop
                        'flop-forward
                        )
                    )
                  )
              )
            )
          (suspend)
          (let ((s5-1 (-> self skel root-channel 0)))
            (set! (-> s5-1 param 0) (the float (+ (-> s5-1 frame-group frames num-frames) -1)))
            (set! f30-1 (seek f30-1 1.0 (* 0.5 (seconds-per-frame))))
            (set! (-> s5-1 param 1) f30-1)
            (joint-control-channel-group-eval! s5-1 (the-as art-joint-anim #f) num-func-seek!)
            )
          )
        )
      )
    )
  0
  (none)
  )

(defbehavior target-hit-ground-anim target ((arg0 symbol) (arg1 symbol))
  (cond
    ((logtest? (water-flags swimming) (-> self water flags))
     )
    ((let ((v1-5 (ja-group)))
       (and v1-5 (or (= v1-5 jakb-flop-down-ja)
                     (= v1-5 jakb-flop-down-loop-ja)
                     (= v1-5 jakb-moving-flop-down-ja)
                     (= v1-5 jakb-moving-flop-down-loop-ja)
                     )
            )
       )
     (target-hit-ground-flop-anim arg0 arg1)
     )
    ((and (= (-> self control ground-pat material) (pat-material ice)) (< 16384.0 (-> self control ctrl-xz-vel)))
     )
    ((let ((v1-20 (ja-group)))
       (or (and v1-20 (or (= v1-20 jakb-jump-loop-ja) (= v1-20 jakb-darkjak-jump-ja) (= v1-20 jakb-flop-jump-ja)))
           (let ((v1-26 (ja-group)))
             (and (and v1-26 (= v1-26 jakb-jump-ja))
                  (or (>= (ja-aframe-num 0) 38.0) (and (focus-test? self dark) (nonzero? (-> self darkjak))))
                  )
             )
           )
       )
     (logior! (-> self state-flags) (state-flags lleg-still rleg-still))
     (ja-channel-push! 1 (seconds 0.02))
     (let ((a1-4 (target-land-anim)))
       (ja-no-eval :group! a1-4 :num! (seek!) :frame-num 0.0)
       )
     (until (ja-done? 0)
       (let ((v1-46 (ja-group)))
         (if (or (and (and v1-46 (or (= v1-46 jakb-gun-jump-land-ja) (= v1-46 jakb-gun-jump-land-side-ja)))
                      (not (using-gun? self))
                      )
                 (let ((v1-53 (ja-group)))
                   (and (and v1-53 (= v1-53 jakb-jump-land-ja)) (and (>= (ja-aframe-num 0) 60.0) (using-gun? self)))
                   )
                 )
             (goto cfg-78)
             )
         )
       (suspend)
       (ja :num! (seek!))
       )
     (label cfg-78)
     )
    ((let ((v1-70 (ja-group)))
       (and (and v1-70 (or (= v1-70 jakb-jump-ja) (= v1-70 jakb-darkjak-jump-ja)))
            (>= (ja-aframe-num 0) 35.0)
            (not (using-gun? self))
            )
       )
     (logior! (-> self state-flags) (state-flags lleg-still rleg-still))
     (ja-channel-set! 1)
     (ja-no-eval :group! jakb-jump-short-land-ja :num! (seek!) :frame-num 0.0)
     (until (ja-done? 0)
       (suspend)
       (ja :num! (seek!))
       )
     (ja-no-eval :group! jakb-jump-land-ja :num! (seek!) :frame-num (ja-aframe 50.0 0))
     (until (ja-done? 0)
       (suspend)
       (ja :num! (seek!))
       )
     )
    ((let ((v1-128 (ja-group)))
       (and v1-128 (or (= v1-128 jakb-jump-ja) (= v1-128 jakb-duck-high-jump-ja) (= v1-128 jakb-darkjak-jump-ja)))
       )
     ((lambda :behavior target
        ()
        (logior! (-> self state-flags) (state-flags lleg-still rleg-still))
        (ja-channel-set! 1)
        (cond
          ((using-gun? self)
           (ja-no-eval :group! jakb-jump-short-land-ja :num! (seek! (ja-aframe 41.0 0)) :frame-num (ja-aframe 38.0 0))
           (until (ja-done? 0)
             (suspend)
             (ja :num! (seek! (ja-aframe 41.0 0)))
             )
           (ja-no-eval :num! (seek! 0.0))
           (ja-channel-push! 1 (seconds 0.1))
           (case (-> self gun gun-type)
             (((pickup-type eco-red) (pickup-type eco-dark))
              (ja-no-eval :group! jakb-gun-jump-land-ja :num! (seek!) :frame-num (ja-aframe 64.0 0))
              (until (ja-done? 0)
                (ja-blend-eval)
                (if (not (using-gun? self))
                    (goto cfg-19)
                    )
                (suspend)
                (ja :num! (seek!))
                )
              )
             (else
               (ja-no-eval :group! jakb-gun-jump-land-side-ja :num! (seek!) :frame-num (ja-aframe 64.0 0))
               (until (ja-done? 0)
                 (ja-blend-eval)
                 (if (not (using-gun? self))
                     (goto cfg-19)
                     )
                 (suspend)
                 (ja :num! (seek!))
                 )
               )
             )
           (label cfg-19)
           )
          (else
            (ja-no-eval :group! jakb-jump-short-land-ja :num! (seek!) :frame-num (ja-aframe 38.0 0))
            (until (ja-done? 0)
              (suspend)
              (ja :num! (seek!))
              )
            (ja-no-eval :group! jakb-jump-land-ja :num! (seek!) :frame-num (ja-aframe 50.0 0))
            (until (ja-done? 0)
              (suspend)
              (ja :num! (seek!))
              )
            )
          )
        (none)
        )
      )
     )
    ((let ((v1-134 (ja-group)))
       (and v1-134
            (or (= v1-134 jakb-hit-from-front-ja) (= v1-134 jakb-hit-from-front-alt1-ja) (= v1-134 jakb-hit-from-back-ja))
            )
       )
     (logior! (-> self state-flags) (state-flags lleg-still rleg-still))
     (let* ((v1-142 (ja-group))
            (f30-0 (if (and v1-142 (= v1-142 jakb-hit-from-back-ja))
                       24576.0
                       -24576.0
                       )
                   )
            )
       (ja-channel-push! 1 (seconds 0.04))
       (ja-no-eval :group! jakb-jump-short-land-ja :num! (seek!) :frame-num (ja-aframe 38.0 0))
       (until (ja-done? 0)
         (set-forward-vel f30-0)
         (suspend)
         (ja :num! (seek!))
         )
       )
     (ja-no-eval :group! jakb-jump-land-ja :num! (seek!) :frame-num (ja-aframe 50.0 0))
     (until (ja-done? 0)
       (suspend)
       (ja :num! (seek!))
       )
     )
    ((let ((v1-195 (ja-group)))
       (and v1-195
            (or (= v1-195 jakb-jump-ja)
                (= v1-195 jakb-darkjak-jump-ja)
                (= v1-195 jakb-attack-from-jump-ja)
                (= v1-195 jakb-attack-from-jump-loop-ja)
                (= v1-195 jakb-attack-from-jump-end-ja)
                (= v1-195 jakb-flop-down-land-ja)
                (= v1-195 jakb-attack-uppercut-ja)
                (= v1-195 jakb-gun-attack-upperbutt-ja)
                (= v1-195 jakb-gun-attack-upperbutt-blue-ja)
                (= v1-195 jakb-board-get-off-ja)
                )
            )
       )
     ((lambda :behavior target
        ()
        (logior! (-> self state-flags) (state-flags lleg-still rleg-still))
        (ja-channel-push! 1 (seconds 0.04))
        (cond
          ((using-gun? self)
           (ja-no-eval :group! jakb-jump-short-land-ja :num! (seek! (ja-aframe 41.0 0)) :frame-num (ja-aframe 38.0 0))
           (until (ja-done? 0)
             (suspend)
             (ja :num! (seek! (ja-aframe 41.0 0)))
             )
           (ja-no-eval :num! (seek! 0.0))
           (ja-channel-push! 1 (seconds 0.1))
           (case (-> self gun gun-type)
             (((pickup-type eco-red) (pickup-type eco-dark))
              (ja-no-eval :group! jakb-gun-jump-land-ja :num! (seek!) :frame-num (ja-aframe 64.0 0))
              (until (ja-done? 0)
                (ja-blend-eval)
                (suspend)
                (ja :num! (seek!))
                )
              )
             (else
               (ja-no-eval :group! jakb-gun-jump-land-side-ja :num! (seek!) :frame-num (ja-aframe 64.0 0))
               (until (ja-done? 0)
                 (ja-blend-eval)
                 (suspend)
                 (ja :num! (seek!))
                 )
               )
             )
           )
          ((and (focus-test? self dark) (nonzero? (-> self darkjak)))
           (ja-no-eval :group! jakb-darkjak-jump-land-ja :num! (seek!) :frame-num (ja-aframe 42.0 0))
           (until (ja-done? 0)
             (suspend)
             (ja :num! (seek!))
             )
           )
          (else
            (ja-no-eval :group! jakb-jump-land-ja :num! (seek!) :frame-num (ja-aframe 42.0 0))
            (until (ja-done? 0)
              (suspend)
              (ja :num! (seek!))
              )
            )
          )
        (none)
        )
      )
     )
    ((let ((v1-201 (ja-group)))
       (and v1-201 (or (= v1-201 (-> self draw art-group data 321)) (= v1-201 (-> self draw art-group data 322))))
       )
     (logior! (-> self state-flags) (state-flags lleg-still rleg-still))
     (ja-channel-push! 1 (seconds 0.04))
     (ja-no-eval :group! (-> self draw art-group data 323) :num! (seek!) :frame-num 0.0)
     (until (ja-done? 0)
       (suspend)
       (ja :num! (seek!))
       )
     )
    ((let ((v1-232 (ja-group)))
       (and v1-232 (or (= v1-232 jakb-jump-land-ja)
                       (= v1-232 jakb-gun-jump-land-ja)
                       (= v1-232 jakb-gun-jump-land-side-ja)
                       (= v1-232 (-> self draw art-group data 323))
                       (= v1-232 jakb-mech-jump-land-ja)
                       (= v1-232 jakb-mech-carry-jump-land-ja)
                       )
            )
       )
     (logior! (-> self state-flags) (state-flags lleg-still rleg-still))
     (ja-no-eval :num! (seek!))
     (while (not (ja-done? 0))
       (suspend)
       (ja-eval)
       )
     )
    ((let ((v1-248 (ja-group)))
       (and v1-248
            (or (= v1-248 jakb-mech-jump-ja) (= v1-248 jakb-mech-jump-loop-ja) (= v1-248 jakb-mech-hit-front-ja))
            )
       )
     (logior! (-> self state-flags) (state-flags lleg-still rleg-still))
     (ja-channel-push! 1 (seconds 0.017))
     (ja-no-eval :group! jakb-mech-jump-land-ja :num! (seek!) :frame-num 0.0)
     (until (ja-done? 0)
       (suspend)
       (ja :num! (seek!))
       )
     )
    ((let ((v1-279 (ja-group)))
       (and v1-279 (or (= v1-279 jakb-mech-carry-jump-ja) (= v1-279 jakb-mech-carry-jump-loop-ja)))
       )
     (logior! (-> self state-flags) (state-flags lleg-still rleg-still))
     (let ((v1-286 (ja-group)))
       (if (and v1-286 (= v1-286 jakb-mech-carry-jump-loop-ja))
           (ja-channel-set! 1)
           (ja-channel-push! 1 (seconds 0.04))
           )
       )
     (ja-no-eval :group! jakb-mech-carry-jump-land-ja :num! (seek!) :frame-num 0.0)
     (until (ja-done? 0)
       (suspend)
       (ja :num! (seek!))
       )
     )
    )
  (none)
  )

;; WARN: Return type mismatch symbol vs none.
(defbehavior target-attack-air-anim target ()
  (when (using-gun? self)
    (set! (-> self gun top-anim-low-high) 0.0)
    (case (-> self gun gun-type)
      (((pickup-type eco-yellow))
       (push-anim-to-targ
         (-> self skel top-anim)
         (the-as art-joint-anim jakb-gun-attack-from-stance-ja)
         0.0
         30
         30
         0.6
         0.0
         #f
         )
       )
      (else
        (push-anim-to-targ
          (-> self skel top-anim)
          (the-as art-joint-anim jakb-gun-attack-from-stance-ja)
          3.0
          30
          30
          0.5
          0.0
          #f
          )
        )
      )
    )
  (set! (-> self control unknown-float41) 0.0)
  (set! (-> self control unknown-float42) 0.0)
  (ja-channel-push! 1 (seconds 0.075))
  (set! (-> self control unknown-sound-id01) (sound-play "spin-kick"))
  (ja-no-eval :group! jakb-attack-from-jump-ja :num! (seek!) :frame-num 0.0)
  (until (ja-done? 0)
    (compute-alignment! (-> self align))
    (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0)
    (suspend)
    (ja :num! (seek!))
    )
  (set! (-> self control unknown-sound-id01) (sound-play "spin-kick"))
  (ja :group! jakb-attack-from-jump-loop-ja :num! min)
  (let ((f30-0 -393216.0))
    (let ((f0-11 (target-height-above-ground))
          (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))
          )
      (while (not (or (and (< (fabs (/ f0-11 (/ f1-1 300))) 150.0) (< f1-1 0.0))
                      (time-elapsed? (-> self state-time) (seconds 1.7))
                      )
                  )
        (quaternion-rotate-y!
          (-> self control quat-for-control)
          (-> self control quat-for-control)
          (* f30-0 (seconds-per-frame))
          )
        (suspend)
        (ja :num! (loop!))
        (set! f0-11 (target-height-above-ground))
        (set! f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))
        )
      )
    (ja-no-eval :group! jakb-attack-from-jump-end-ja :num! (seek!) :frame-num 0.0)
    (until (ja-done? 0)
      (cond
        ((< (ja-aframe-num 0) 32.0)
         (quaternion-rotate-y!
           (-> self control quat-for-control)
           (-> self control quat-for-control)
           (* f30-0 (seconds-per-frame))
           )
         )
        (else
          (let ((f0-25
                  (deg-diff
                    (quaternion-y-angle (-> self control quat-for-control))
                    (quaternion-y-angle (-> self control dir-targ))
                    )
                  )
                )
            (quaternion-rotate-y!
              (-> self control quat-for-control)
              (-> self control quat-for-control)
              (* -0.2 (fabs f0-25))
              )
            )
          )
        )
      (suspend)
      (ja :num! (seek!))
      )
    )
  (none)
  )

;; WARN: Return type mismatch symbol vs none.
;; WARN: new jak 2 until loop case, check carefully
(defbehavior target-edge-grab-anim target ((arg0 float))
  (ja-channel-push! 1 (seconds 0.15))
  (ja :group! jakb-falling-to-edge-grab-ja :num! min)
  (until (ja-done? 0)
    (suspend)
    (ja :num! (seek!))
    )
  (ja-channel-set! 1)
  (until #f
    (ja-no-eval :group! jakb-edge-grab-stance0-ja :num! (seek!) :frame-num 0.0)
    (until (ja-done? 0)
      (can-play-stance-amibent?)
      (suspend)
      (ja :num! (seek!))
      )
    (+! (-> self anim-seed) 1)
    (ja-no-eval :group! jakb-edge-grab-stance1-ja :num! (seek!) :frame-num 0.0)
    (until (ja-done? 0)
      (can-play-stance-amibent?)
      (suspend)
      (ja :num! (seek!))
      )
    )
  #f
  (none)
  )
