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

(import "goal_src/jak1/import/double-lurker-ag.gc")
(import "goal_src/jak1/import/double-lurker-top-ag.gc")

;; definition of type double-lurker-top
(deftype double-lurker-top (nav-enemy)
  ((parent-process (pointer double-lurker)         :offset         12)
   (fall-dest      vector                  :inline :offset-assert 400)
   )
  :heap-base #x130
  :method-count-assert 76
  :size-assert         #x1a0
  :flag-assert         #x4c013001a0
  (:states
    (double-lurker-top-knocked-down object vector vector)
    double-lurker-top-on-shoulders
    double-lurker-top-on-shoulders-die
    double-lurker-top-resume
    )
  )

;; definition for method 3 of type double-lurker-top
(defmethod inspect double-lurker-top ((obj double-lurker-top))
  (let ((t9-0 (method-of-type nav-enemy inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tfall-dest: #<vector @ #x~X>~%" (-> obj fall-dest))
  obj
  )

;; definition of type double-lurker
(deftype double-lurker (nav-enemy)
  ((knocked-back-speed  float   :offset-assert 400)
   (buddy-on-shoulders? symbol  :offset-assert 404)
   (dead?               symbol  :offset-assert 408)
   (buddy-dead?         symbol  :offset-assert 412)
   (buddy-handle        handle  :offset-assert 416)
   )
  :heap-base #x140
  :method-count-assert 76
  :size-assert         #x1a8
  :flag-assert         #x4c014001a8
  (:methods
    (initialize-collision (_type_) collide-shape-moving :replace 47)
    (dummy-53 (_type_ vector) symbol :replace 53)
    )
  (:states
    double-lurker-both-knocked-back
    double-lurker-break-apart
    double-lurker-buddy-was-hit
    double-lurker-knocked-back
    double-lurker-resume
    double-lurker-show-anims
    double-lurker-waiting-to-die
    )
  )

;; definition for method 3 of type double-lurker
(defmethod inspect double-lurker ((obj double-lurker))
  (let ((t9-0 (method-of-type nav-enemy inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tknocked-back-speed: ~f~%" (-> obj knocked-back-speed))
  (format #t "~T~Tbuddy-on-shoulders?: ~A~%" (-> obj buddy-on-shoulders?))
  (format #t "~T~Tdead?: ~A~%" (-> obj dead?))
  (format #t "~T~Tbuddy-dead?: ~A~%" (-> obj buddy-dead?))
  (format #t "~T~Tbuddy-handle: ~D~%" (-> obj buddy-handle))
  obj
  )

;; failed to figure out what this is:
(defskelgroup *double-lurker-sg* double-lurker double-lurker-lod0-jg double-lurker-both-idle-ja
              ((double-lurker-lod0-mg (meters 20))
               (double-lurker-lod1-mg (meters 40))
               (double-lurker-lod2-mg (meters 999999))
               )
              :bounds (static-spherem 0 1 0 4.5)
              :longest-edge (meters 1)
              :shadow double-lurker-shadow-mg
              )

;; failed to figure out what this is:
(defskelgroup *double-lurker-top-sg* double-lurker-top double-lurker-top-lod0-jg -1
              ((double-lurker-top-lod0-mg (meters 20))
               (double-lurker-top-lod1-mg (meters 40))
               (double-lurker-top-lod2-mg (meters 999999))
               )
              :bounds (static-spherem 0 0.5 0 4.5)
              :longest-edge (meters 1)
              :shadow double-lurker-top-shadow-mg
              )

;; definition for symbol *double-lurker-top-nav-enemy-info*, type nav-enemy-info
(define *double-lurker-top-nav-enemy-info* (new 'static 'nav-enemy-info
                                             :idle-anim 12
                                             :walk-anim 13
                                             :turn-anim -1
                                             :notice-anim 14
                                             :run-anim 15
                                             :jump-anim -1
                                             :jump-land-anim -1
                                             :victory-anim 16
                                             :taunt-anim 16
                                             :die-anim 17
                                             :neck-joint -1
                                             :player-look-at-joint 5
                                             :run-travel-speed (meters 6)
                                             :run-rotate-speed (degrees 2880.0)
                                             :run-acceleration (meters 1)
                                             :run-turn-time (seconds 0.1)
                                             :walk-travel-speed (meters 3)
                                             :walk-rotate-speed (degrees 720.0)
                                             :walk-acceleration (meters 1)
                                             :walk-turn-time (seconds 0.5)
                                             :attack-shove-back (meters 3)
                                             :attack-shove-up (meters 2)
                                             :shadow-size (meters 3)
                                             :notice-nav-radius (meters 2)
                                             :nav-nearest-y-threshold (meters 10)
                                             :notice-distance (meters 30)
                                             :stop-chase-distance (meters 40)
                                             :frustration-distance (meters 8)
                                             :frustration-time (seconds 4)
                                             :die-anim-hold-frame 24.0
                                             :jump-anim-start-frame 10.0
                                             :jump-land-anim-end-frame 10000000000.0
                                             :jump-height-min (meters 3)
                                             :jump-height-factor 0.5
                                             :jump-start-anim-speed 1.0
                                             :shadow-max-y (meters 0.25)
                                             :shadow-min-y (meters -1)
                                             :shadow-locus-dist (meters 150)
                                             :use-align #f
                                             :draw-shadow #t
                                             :move-to-ground #t
                                             :hover-if-no-ground #f
                                             :use-momentum #f
                                             :use-flee #f
                                             :use-proximity-notice #f
                                             :use-jump-blocked #f
                                             :use-jump-patrol #f
                                             :gnd-collide-with (collide-kind background)
                                             :debug-draw-neck #f
                                             :debug-draw-jump #f
                                             )
        )

;; definition for symbol *double-lurker-when-both-nav-enemy-info*, type nav-enemy-info
(define *double-lurker-when-both-nav-enemy-info* (new 'static 'nav-enemy-info
                                                   :idle-anim 5
                                                   :walk-anim 6
                                                   :turn-anim -1
                                                   :notice-anim 7
                                                   :run-anim 8
                                                   :jump-anim -1
                                                   :jump-land-anim -1
                                                   :victory-anim 9
                                                   :taunt-anim 9
                                                   :die-anim 17
                                                   :neck-joint 5
                                                   :player-look-at-joint 5
                                                   :run-travel-speed (meters 6)
                                                   :run-rotate-speed (degrees 720.0)
                                                   :run-acceleration (meters 1)
                                                   :run-turn-time (seconds 0.1)
                                                   :walk-travel-speed (meters 3.8)
                                                   :walk-rotate-speed (degrees 720.0)
                                                   :walk-acceleration (meters 1)
                                                   :walk-turn-time (seconds 0.5)
                                                   :attack-shove-back (meters 3)
                                                   :attack-shove-up (meters 2)
                                                   :shadow-size (meters 4)
                                                   :notice-nav-radius (meters 2)
                                                   :nav-nearest-y-threshold (meters 10)
                                                   :notice-distance (meters 30)
                                                   :stop-chase-distance (meters 40)
                                                   :frustration-distance (meters 8)
                                                   :frustration-time (seconds 4)
                                                   :die-anim-hold-frame 24.0
                                                   :jump-anim-start-frame 10.0
                                                   :jump-land-anim-end-frame 10000000000.0
                                                   :jump-height-min (meters 3)
                                                   :jump-height-factor 0.5
                                                   :jump-start-anim-speed 1.0
                                                   :shadow-max-y (meters 0.25)
                                                   :shadow-min-y (meters -1)
                                                   :shadow-locus-dist (meters 150)
                                                   :use-align #f
                                                   :draw-shadow #t
                                                   :move-to-ground #t
                                                   :hover-if-no-ground #f
                                                   :use-momentum #f
                                                   :use-flee #f
                                                   :use-proximity-notice #f
                                                   :use-jump-blocked #f
                                                   :use-jump-patrol #f
                                                   :gnd-collide-with (collide-kind background)
                                                   :debug-draw-neck #f
                                                   :debug-draw-jump #f
                                                   )
        )

;; definition for symbol *double-lurker-nav-enemy-info*, type nav-enemy-info
(define *double-lurker-nav-enemy-info* (new 'static 'nav-enemy-info
                                         :idle-anim 12
                                         :walk-anim 13
                                         :turn-anim -1
                                         :notice-anim 14
                                         :run-anim 15
                                         :jump-anim -1
                                         :jump-land-anim -1
                                         :victory-anim 16
                                         :taunt-anim 16
                                         :die-anim 17
                                         :neck-joint 5
                                         :player-look-at-joint 5
                                         :run-travel-speed (meters 6)
                                         :run-rotate-speed (degrees 720.0)
                                         :run-acceleration (meters 1)
                                         :run-turn-time (seconds 0.1)
                                         :walk-travel-speed (meters 3.8)
                                         :walk-rotate-speed (degrees 720.0)
                                         :walk-acceleration (meters 1)
                                         :walk-turn-time (seconds 0.5)
                                         :attack-shove-back (meters 3)
                                         :attack-shove-up (meters 2)
                                         :shadow-size (meters 4)
                                         :notice-nav-radius (meters 2)
                                         :nav-nearest-y-threshold (meters 10)
                                         :notice-distance (meters 30)
                                         :stop-chase-distance (meters 40)
                                         :frustration-distance (meters 8)
                                         :frustration-time (seconds 4)
                                         :die-anim-hold-frame 24.0
                                         :jump-anim-start-frame 10.0
                                         :jump-land-anim-end-frame 10000000000.0
                                         :jump-height-min (meters 3)
                                         :jump-height-factor 0.5
                                         :jump-start-anim-speed 1.0
                                         :shadow-max-y (meters 0.25)
                                         :shadow-min-y (meters -1)
                                         :shadow-locus-dist (meters 150)
                                         :use-align #f
                                         :draw-shadow #t
                                         :move-to-ground #t
                                         :hover-if-no-ground #f
                                         :use-momentum #f
                                         :use-flee #f
                                         :use-proximity-notice #f
                                         :use-jump-blocked #f
                                         :use-jump-patrol #f
                                         :gnd-collide-with (collide-kind background)
                                         :debug-draw-neck #f
                                         :debug-draw-jump #f
                                         )
        )

;; failed to figure out what this is:
(defstate double-lurker-top-on-shoulders (double-lurker-top)
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (case arg2
      (('trigger)
       (let ((v1-1 (-> self fall-dest))
             (a0-4 (-> (the-as vector (-> arg3 param 0)) quad))
             )
         (set! (-> v1-1 quad) a0-4)
         (go double-lurker-top-knocked-down a0-4 (the-as vector arg1) (the-as vector arg2))
         )
       )
      (('instant-death)
       (let ((v1-3 (the-as object (-> arg3 param 0))))
         (quaternion-axis-angle!
           (-> self collide-info quat)
           0.0
           1.0
           0.0
           (atan (-> (the-as vector v1-3) x) (-> (the-as vector v1-3) z))
           )
         )
       (go double-lurker-top-on-shoulders-die)
       )
      )
    )
  :code (behavior ()
    (loop
      (clone-anim-once
        (ppointer->handle (-> self parent-process))
        (the-as int (-> self draw origin-joint-index))
        #t
        ""
        )
      (update-transforms! (-> self collide-info))
      (suspend)
      )
    (none)
    )
  )

;; failed to figure out what this is:
(defstate double-lurker-top-on-shoulders-die (double-lurker-top)
  :code (behavior ()
    (logclear! (-> self mask) (process-mask actor-pause))
    (ja-channel-push! 1 (seconds 0.1))
    (ja-no-eval :group! double-lurker-bottom-take-hit-ja :num! (seek!) :frame-num 0.0)
    (until (ja-done? 0)
      (suspend)
      (ja :num! (seek!))
      )
    (none)
    )
  :post (the-as (function none :behavior double-lurker-top) ja-post)
  )

;; failed to figure out what this is:
(defstate double-lurker-top-knocked-down (double-lurker-top)
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (case arg2
      (('touch)
       (send-event
         arg0
         'shove
         (-> arg3 param 0)
         (static-attack-info ((shove-up (meters 3)) (shove-back (meters 2))))
         )
       )
      )
    )
  :code (behavior ((arg0 object) (arg1 vector) (arg2 vector))
    (dummy-51 self)
    (let ((v1-3 (-> self draw shadow-ctrl)))
      (logclear! (-> v1-3 settings flags) (shadow-flags disable-draw))
      )
    0
    (logclear! (-> self collide-info nav-flags) (nav-flags navf0))
    (logior! (-> self collide-info nav-flags) (nav-flags navf1))
    (set! (-> self nav extra-nav-sphere quad) (-> self fall-dest quad))
    (set! (-> self nav extra-nav-sphere w) 9011.2)
    (let ((gp-0 (new 'stack-no-clear 'vector)))
      (set! (-> gp-0 quad) (-> self collide-info trans quad))
      (ja-channel-push! 1 (seconds 0.1))
      (ja-no-eval :group! double-lurker-both-break-apart-ja :num! (seek!) :frame-num 0.0)
      (until (ja-done? 0)
        (vector-lerp!
          (-> self collide-info trans)
          gp-0
          (-> self fall-dest)
          (fmin 1.0 (/ (ja-frame-num 0) (ja-aframe 44.0 0)))
          )
        (suspend)
        (ja :num! (seek!))
        )
      )
    (logior! (-> self collide-info nav-flags) (nav-flags navf0))
    (logclear! (-> self collide-info nav-flags) (nav-flags navf1))
    (TODO-RENAME-27 (-> self nav))
    (go double-lurker-top-resume)
    (none)
    )
  :post (the-as (function none :behavior double-lurker-top) transform-post)
  )

;; failed to figure out what this is:
(defstate double-lurker-top-resume (double-lurker-top)
  :code (behavior ()
    (cond
      ((not *target*)
       (go-virtual nav-enemy-idle)
       )
      ((TODO-RENAME-46 self (-> self nav-info notice-distance))
       (go-virtual nav-enemy-chase)
       )
      ((and (and *target* (>= (-> self enemy-info idle-distance)
                              (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))
                              )
                 )
            (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout))
            (nonzero? (-> self draw))
            (logtest? (-> self draw status) (draw-status was-drawn))
            )
       (go-virtual nav-enemy-patrol)
       )
      )
    (go-virtual nav-enemy-idle)
    (none)
    )
  )

;; failed to figure out what this is:
(defstate nav-enemy-patrol (double-lurker-top)
  :virtual #t
  :code (behavior ()
    (ja-channel-push! 1 (seconds 0.2))
    (ja :group! (-> self draw art-group data (-> self nav-info walk-anim)))
    (ja :num-func num-func-identity :frame-num 0.0)
    (let ((t9-1 (-> (method-of-type nav-enemy nav-enemy-patrol) code)))
      (if t9-1
          ((the-as (function none) t9-1))
          )
      )
    (none)
    )
  )

;; failed to figure out what this is:
(defstate nav-enemy-die (double-lurker-top)
  :virtual #t
  :enter (behavior ()
    (let ((v1-2 (-> self entity extra perm)))
      (logior! (-> v1-2 status) (entity-perm-status user-set-from-cstage))
      (set! (-> v1-2 user-int8 1) 1)
      )
    (set! (-> self parent-process 0 dead?) #t)
    (let ((t9-0 (-> (method-of-type nav-enemy nav-enemy-die) enter)))
      (if t9-0
          (t9-0)
          )
      )
    (none)
    )
  )

;; definition for method 51 of type double-lurker-top
(defmethod dummy-51 double-lurker-top ((obj double-lurker-top))
  (restore-collide-with-as (-> obj collide-info))
  (logior! (-> obj collide-info nav-flags) (nav-flags navf0))
  (TODO-RENAME-27 (-> obj nav))
  (none)
  )

;; definition for method 47 of type double-lurker-top
(defmethod initialize-collision double-lurker-top ((obj double-lurker-top))
  (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))))
    (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
    (set! (-> s5-0 reaction) default-collision-reaction)
    (set! (-> s5-0 no-reaction)
          (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
          )
    (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 6) 0)))
      (set! (-> s4-0 prim-core collide-as) (collide-kind enemy))
      (set! (-> s4-0 collide-with) (collide-kind target))
      (set! (-> s4-0 prim-core action) (collide-action solid))
      (set-vector! (-> s4-0 local-sphere) 0.0 10240.0 0.0 14336.0)
      (set-root-prim! s5-0 s4-0)
      (let ((s3-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2))))
        (set! (-> s3-0 prim-core collide-as) (collide-kind enemy))
        (set! (-> s3-0 collide-with) (collide-kind target))
        (set! (-> s3-0 prim-core action) (collide-action solid))
        (set! (-> s3-0 prim-core offense) (collide-offense touch))
        (set-vector! (-> s3-0 local-sphere) 0.0 2662.4 0.0 4096.0)
        (append-prim s4-0 s3-0)
        )
      (let ((s3-1 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2))))
        (set! (-> s3-1 prim-core collide-as) (collide-kind enemy))
        (set! (-> s3-1 collide-with) (collide-kind target))
        (set! (-> s3-1 prim-core action) (collide-action solid))
        (set! (-> s3-1 prim-core offense) (collide-offense touch))
        (set-vector! (-> s3-1 local-sphere) 0.0 6758.4 0.0 4096.0)
        (append-prim s4-0 s3-1)
        )
      (let ((s3-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2))))
        (set! (-> s3-2 prim-core collide-as) (collide-kind enemy))
        (set! (-> s3-2 collide-with) (collide-kind target))
        (set! (-> s3-2 prim-core action) (collide-action solid))
        (set! (-> s3-2 prim-core offense) (collide-offense touch))
        (set-vector! (-> s3-2 local-sphere) 0.0 10854.4 0.0 4096.0)
        (append-prim s4-0 s3-2)
        )
      (let ((s3-3 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1))))
        (set! (-> s3-3 prim-core collide-as) (collide-kind enemy))
        (set! (-> s3-3 collide-with) (collide-kind target))
        (set! (-> s3-3 prim-core offense) (collide-offense normal-attack))
        (set! (-> s3-3 transform-index) 10)
        (set-vector! (-> s3-3 local-sphere) 0.0 0.0 0.0 1228.8)
        (append-prim s4-0 s3-3)
        )
      (let ((s3-4 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1))))
        (set! (-> s3-4 prim-core collide-as) (collide-kind enemy))
        (set! (-> s3-4 collide-with) (collide-kind target))
        (set! (-> s3-4 prim-core offense) (collide-offense normal-attack))
        (set! (-> s3-4 transform-index) 16)
        (set-vector! (-> s3-4 local-sphere) 0.0 0.0 0.0 1228.8)
        (append-prim s4-0 s3-4)
        )
      (let ((s3-5 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1))))
        (set! (-> s3-5 prim-core collide-as) (collide-kind enemy))
        (set! (-> s3-5 collide-with) (collide-kind target))
        (set! (-> s3-5 prim-core offense) (collide-offense normal-attack))
        (set! (-> s3-5 transform-index) 5)
        (set-vector! (-> s3-5 local-sphere) 0.0 -2048.0 0.0 3276.8)
        (append-prim s4-0 s3-5)
        )
      )
    (set! (-> s5-0 nav-radius) 9011.2)
    (backup-collide-with-as s5-0)
    (set! (-> obj collide-info) s5-0)
    )
  (clear-collide-with-as (-> obj collide-info))
  (none)
  )

;; definition for method 48 of type double-lurker-top
;; INFO: Return type mismatch nav-flags vs none.
;; Used lq/sq
(defmethod TODO-RENAME-48 double-lurker-top ((obj double-lurker-top))
  (initialize-skeleton obj *double-lurker-top-sg* '())
  (set! (-> obj draw origin-joint-index) (the-as uint 3))
  (TODO-RENAME-45 obj *double-lurker-top-nav-enemy-info*)
  (let ((v1-5 (-> obj parent-process)))
    (set! (-> obj collide-info trans quad) (-> v1-5 0 collide-info trans quad))
    (set-vector! (-> obj collide-info scale) 1.0 1.0 1.0 1.0)
    (quaternion-copy! (-> obj collide-info quat) (-> v1-5 0 collide-info quat))
    )
  (logclear! (-> obj collide-info nav-flags) (nav-flags navf0))
  (none)
  )

;; definition for function double-lurker-top-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior double-lurker-top-init-by-other double-lurker-top ((arg0 entity) (arg1 double-lurker) (arg2 symbol) (arg3 vector))
  (initialize-collision self)
  (set! (-> self entity) (-> arg1 entity))
  (TODO-RENAME-48 self)
  (set! (-> self collide-info trans quad) (-> arg3 quad))
  (cond
    (arg2
      (ja-channel-set! 1)
      (ja :group! double-lurker-both-idle-ja :num! min)
      (transform-post)
      (let ((v1-13 (-> self draw shadow-ctrl)))
        (logior! (-> v1-13 settings flags) (shadow-flags disable-draw))
        )
      0
      (go double-lurker-top-on-shoulders)
      )
    (else
      (ja-channel-set! 1)
      (ja :group! double-lurker-idle-ja :num! min)
      (transform-post)
      (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (collide-kind background))
      (dummy-51 self)
      (go double-lurker-top-resume)
      )
    )
  (none)
  )

;; definition for function double-lurker-default-event-handler
;; WARN: disable def twice: 80. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare.
;; WARN: disable def twice: 120. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare.
(defbehavior double-lurker-default-event-handler double-lurker ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
  (local-vars (v0-0 object))
  (case arg2
    (('touch)
     (set! (-> self touch-time) (-> *display* base-frame-counter))
     (dummy-44 self arg0 arg3)
     )
    (('attack)
     (when (= (-> arg0 type) target)
       (nav-enemy-set-hit-from-direction arg0)
       (cond
         ((-> self buddy-on-shoulders?)
          (let ((s4-0 (new 'stack-no-clear 'vector)))
            (vector-! s4-0 (target-pos 0) (-> self collide-info trans))
            (cond
              ((and (>= (-> s4-0 y) 8192.0)
                    (>= 14563.556 (fabs (deg- (quaternion-y-angle (-> self collide-info quat)) (atan (-> s4-0 x) (-> s4-0 z)))))
                    )
               (when (send-event
                       arg0
                       'shove
                       (-> arg3 param 0)
                       (static-attack-info ((shove-up (meters 3)) (shove-back (meters 2))))
                       )
                 (increment-success-for-hint (game-text-id sunken-double-lurker-hint))
                 (go double-lurker-buddy-was-hit)
                 (return #f)
                 v0-0
                 )
               )
              (else
                (when (and ((method-of-type touching-shapes-entry prims-touching-action?)
                            (the-as touching-shapes-entry (-> arg3 param 0))
                            (-> (the-as target arg0) control)
                            (collide-action solid)
                            (collide-action)
                            )
                           (send-event
                             arg0
                             'shove
                             (-> arg3 param 0)
                             (static-attack-info ((shove-up (meters 3)) (shove-back (meters 2))))
                             )
                           )
                  (level-hint-spawn
                    (game-text-id sunken-double-lurker-hint)
                    "sksp0127"
                    (the-as entity #f)
                    *entity-pool*
                    (game-task none)
                    )
                  (go double-lurker-both-knocked-back)
                  (return #f)
                  v0-0
                  )
                )
              )
            )
          )
         (else
           (nav-enemy-set-hit-from-direction arg0)
           (dummy-43 self arg0 arg3)
           )
         )
       )
     )
    )
  )

;; failed to figure out what this is:
(defstate double-lurker-show-anims (double-lurker)
  :trans (behavior ()
    0
    (none)
    )
  :code (behavior ()
    0
    (none)
    )
  :post (the-as (function none :behavior double-lurker) transform-post)
  )

;; failed to figure out what this is:
(defstate double-lurker-resume (double-lurker)
  :code (behavior ()
    (cond
      ((not *target*)
       (go-virtual nav-enemy-idle)
       )
      ((TODO-RENAME-46 self (-> self nav-info notice-distance))
       (go-virtual nav-enemy-chase)
       )
      ((and (and *target* (>= (-> self enemy-info idle-distance)
                              (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))
                              )
                 )
            (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout))
            (nonzero? (-> self draw))
            (logtest? (-> self draw status) (draw-status was-drawn))
            )
       (go-virtual nav-enemy-patrol)
       )
      )
    (go-virtual nav-enemy-idle)
    (none)
    )
  )

;; failed to figure out what this is:
(defstate nav-enemy-idle (double-lurker)
  :virtual #t
  :event double-lurker-default-event-handler
  )

;; failed to figure out what this is:
(defstate nav-enemy-patrol (double-lurker)
  :virtual #t
  :event double-lurker-default-event-handler
  :code (behavior ()
    (ja-channel-push! 1 (seconds 0.2))
    (ja :group! (-> self draw art-group data (-> self nav-info walk-anim)))
    (ja :num-func num-func-identity :frame-num 0.0)
    (let ((t9-1 (-> (method-of-type nav-enemy nav-enemy-patrol) code)))
      (if t9-1
          ((the-as (function none) t9-1))
          )
      )
    (none)
    )
  )

;; failed to figure out what this is:
(defstate nav-enemy-notice (double-lurker)
  :virtual #t
  :event double-lurker-default-event-handler
  :enter (behavior ()
    (start-hint-timer (game-text-id sunken-double-lurker-hint))
    (let ((t9-1 (-> (method-of-type nav-enemy nav-enemy-notice) enter)))
      (if t9-1
          (t9-1)
          )
      )
    (none)
    )
  )

;; failed to figure out what this is:
(defstate nav-enemy-chase (double-lurker)
  :virtual #t
  :event double-lurker-default-event-handler
  )

;; failed to figure out what this is:
(defstate nav-enemy-stop-chase (double-lurker)
  :virtual #t
  :event double-lurker-default-event-handler
  )

;; failed to figure out what this is:
(defstate nav-enemy-stare (double-lurker)
  :virtual #t
  :event double-lurker-default-event-handler
  )

;; failed to figure out what this is:
(defstate nav-enemy-victory (double-lurker)
  :virtual #t
  :event double-lurker-default-event-handler
  )

;; failed to figure out what this is:
(defstate nav-enemy-die (double-lurker)
  :virtual #t
  :enter (behavior ()
    (let ((v1-2 (-> self entity extra perm)))
      (logior! (-> v1-2 status) (entity-perm-status user-set-from-cstage))
      (set! (-> v1-2 user-int8 0) 1)
      )
    (set! (-> self dead?) #t)
    (let ((t9-0 (-> (method-of-type nav-enemy nav-enemy-die) enter)))
      (if t9-0
          (t9-0)
          )
      )
    (none)
    )
  )

;; failed to figure out what this is:
(defstate double-lurker-both-knocked-back (double-lurker)
  :enter (behavior ()
    (set! (-> self knocked-back-speed) 40960.0)
    (none)
    )
  :trans (behavior ()
    (local-vars (at-0 int))
    (rlet ((vf0 :class vf)
           (vf1 :class vf)
           (vf2 :class vf)
           )
      (init-vf0-vector)
      (let* ((f0-3
               (seek-with-smooth (-> self knocked-back-speed) 0.0 (* 49152.0 (-> *display* seconds-per-frame)) 0.5 0.01)
               )
             (f30-0 (* f0-3 (-> *display* seconds-per-frame)))
             )
        (set! (-> self knocked-back-speed) f0-3)
        (vector-float*! (-> self collide-info transv) (-> self hit-from-dir) f0-3)
        (when (< 0.0 f0-3)
          (let ((v1-7 (-> self nav travel)))
            (.lvf vf1 (&-> (-> self collide-info transv) quad))
            (let ((f0-4 (-> *display* seconds-per-frame)))
              (.mov at-0 f0-4)
              )
            (.mov vf2 at-0)
            (.mov.vf vf1 vf0 :mask #b1000)
            (.mul.x.vf vf1 vf1 vf2 :mask #b111)
            (.svf (&-> v1-7 quad) vf1)
            )
          (let ((gp-0 #f))
            (TODO-RENAME-28
              (-> self nav)
              (collide-kind
                background
                cak-1
                cak-2
                cak-3
                target
                water
                powerup
                crate
                enemy
                wall-object
                projectile
                ground-object
                target-attack
                mother-spider
                cak-14
                blue-eco-suck
                unknown-16
                unknown-17
                unknown-18
                unknown-19
                unknown-20
                unknown-21
                unknown-22
                unknown-23
                unknown-24
                unknown-25
                unknown-26
                unknown-27
                unknown-28
                unknown-29
                unknown-30
                unknown-31
                unknown-32
                unknown-33
                unknown-34
                unknown-35
                unknown-36
                unknown-37
                unknown-38
                unknown-39
                unknown-40
                unknown-41
                unknown-42
                unknown-43
                unknown-44
                unknown-45
                unknown-46
                unknown-47
                unknown-48
                unknown-49
                unknown-50
                unknown-51
                unknown-52
                unknown-53
                unknown-54
                unknown-55
                unknown-56
                unknown-57
                unknown-58
                unknown-59
                unknown-60
                unknown-61
                unknown-62
                unknown-63
                )
              )
            (let ((a2-1 (new 'stack-no-clear 'check-vector-collision-with-nav-spheres-info)))
              (if (>= (dummy-23 (-> self nav) (-> self nav travel) a2-1) 0.0)
                  (set! gp-0 #t)
                  )
              )
            (when (not gp-0)
              (let ((s5-0 (new 'stack 'clip-travel-vector-to-mesh-return-info)))
                (dummy-24 (-> self nav) (* 1.2 f30-0) s5-0)
                (if (-> s5-0 found-boundary)
                    (set! gp-0 #t)
                    )
                )
              )
            (when gp-0
              (set! (-> self knocked-back-speed) 0.0)
              (vector-reset! (-> self collide-info transv))
              )
            )
          )
        )
      (set! (-> self collide-info transv y) (+ -36864.0 (-> self collide-info transv y)))
      (integrate-for-enemy-with-move-to-ground!
        (-> self collide-info)
        (-> self collide-info transv)
        (collide-kind background)
        8192.0
        #t
        (-> self nav-info hover-if-no-ground)
        #f
        )
      (TODO-RENAME-27 (-> self nav))
      (none)
      )
    )
  :code (behavior ()
    (ja-channel-push! 1 (seconds 0.2))
    (ja-no-eval :group! double-lurker-both-take-hit-ja :num! (seek!) :frame-num 0.0)
    (until (ja-done? 0)
      (suspend)
      (ja :num! (seek!))
      )
    (go double-lurker-resume)
    (none)
    )
  :post (the-as (function none :behavior double-lurker) nav-enemy-simple-post)
  )

;; definition for method 52 of type double-lurker
;; Used lq/sq
(defmethod dummy-52 double-lurker ((obj double-lurker) (arg0 vector))
  (TODO-RENAME-28 (-> obj nav) (collide-kind
                                 background
                                 cak-1
                                 cak-2
                                 cak-3
                                 target
                                 water
                                 powerup
                                 crate
                                 enemy
                                 wall-object
                                 projectile
                                 ground-object
                                 target-attack
                                 mother-spider
                                 cak-14
                                 blue-eco-suck
                                 unknown-16
                                 unknown-17
                                 unknown-18
                                 unknown-19
                                 unknown-20
                                 unknown-21
                                 unknown-22
                                 unknown-23
                                 unknown-24
                                 unknown-25
                                 unknown-26
                                 unknown-27
                                 unknown-28
                                 unknown-29
                                 unknown-30
                                 unknown-31
                                 unknown-32
                                 unknown-33
                                 unknown-34
                                 unknown-35
                                 unknown-36
                                 unknown-37
                                 unknown-38
                                 unknown-39
                                 unknown-40
                                 unknown-41
                                 unknown-42
                                 unknown-43
                                 unknown-44
                                 unknown-45
                                 unknown-46
                                 unknown-47
                                 unknown-48
                                 unknown-49
                                 unknown-50
                                 unknown-51
                                 unknown-52
                                 unknown-53
                                 unknown-54
                                 unknown-55
                                 unknown-56
                                 unknown-57
                                 unknown-58
                                 unknown-59
                                 unknown-60
                                 unknown-61
                                 unknown-62
                                 unknown-63
                                 )
                  )
  (let ((a1-2 (new 'stack-no-clear 'vector)))
    (vector-float*! a1-2 (-> obj hit-from-dir) 22937.602)
    (vector+! a1-2 a1-2 (-> obj collide-info trans))
    (dummy-13 (-> obj nav) a1-2 (-> obj hit-from-dir))
    )
  (when (>= (vector-xz-length (-> obj nav travel)) 18841.602)
    (vector+! arg0 (-> obj collide-info trans) (-> obj nav travel))
    (let ((a1-5 (new 'stack-no-clear 'vector))
          (s4-0 (new 'stack-no-clear 'collide-tri-result))
          )
      (set! (-> a1-5 quad) (-> arg0 quad))
      (set! (-> a1-5 y) (+ 8192.0 (-> a1-5 y)))
      (when (>= (fill-and-probe-using-line-sphere
                  *collide-cache*
                  a1-5
                  (new 'static 'vector :y -40960.0 :w 1.0)
                  40.96
                  (collide-kind background)
                  obj
                  s4-0
                  (new 'static 'pat-surface :noentity #x1)
                  )
                0.0
                )
        (set! (-> arg0 y) (-> s4-0 intersect y))
        (return #t)
        )
      )
    )
  #f
  )

;; failed to figure out what this is:
(defstate double-lurker-buddy-was-hit (double-lurker)
  :code (behavior ()
    (set! (-> self buddy-on-shoulders?) #f)
    (let ((v1-2 (-> self entity extra perm)))
      (logior! (-> v1-2 status) (entity-perm-status user-set-from-cstage))
      (set! (-> v1-2 user-int8 2) 1)
      )
    (let ((gp-0 (new 'stack-no-clear 'vector)))
      (if (dummy-52 self gp-0)
          (send-event (handle->process (-> self buddy-handle)) 'trigger gp-0)
          (send-event (handle->process (-> self buddy-handle)) 'instant-death (-> self hit-from-dir))
          )
      )
    (dummy-51 self)
    (TODO-RENAME-49 self *double-lurker-nav-enemy-info*)
    (go double-lurker-break-apart)
    (none)
    )
  )

;; failed to figure out what this is:
(defstate double-lurker-break-apart (double-lurker)
  :event double-lurker-default-event-handler
  :code (behavior ()
    (ja-no-eval :group! double-lurker-both-break-apart-ja :num! (seek!) :frame-num 0.0)
    (until (ja-done? 0)
      (suspend)
      (ja :num! (seek!))
      )
    (go double-lurker-resume)
    (none)
    )
  :post (the-as (function none :behavior double-lurker) nav-enemy-simple-post)
  )

;; failed to figure out what this is:
(defstate double-lurker-knocked-back (double-lurker)
  :enter (behavior ()
    (set! (-> self knocked-back-speed) 40960.0)
    (none)
    )
  :trans (behavior ()
    (local-vars (at-0 int))
    (rlet ((vf0 :class vf)
           (vf1 :class vf)
           (vf2 :class vf)
           )
      (init-vf0-vector)
      (let* ((f0-3
               (seek-with-smooth (-> self knocked-back-speed) 0.0 (* 49152.0 (-> *display* seconds-per-frame)) 0.5 0.01)
               )
             (f30-0 (* f0-3 (-> *display* seconds-per-frame)))
             )
        (set! (-> self knocked-back-speed) f0-3)
        (vector-float*! (-> self collide-info transv) (-> self hit-from-dir) f0-3)
        (when (< 0.0 f0-3)
          (let ((v1-7 (-> self nav travel)))
            (.lvf vf1 (&-> (-> self collide-info transv) quad))
            (let ((f0-4 (-> *display* seconds-per-frame)))
              (.mov at-0 f0-4)
              )
            (.mov vf2 at-0)
            (.mov.vf vf1 vf0 :mask #b1000)
            (.mul.x.vf vf1 vf1 vf2 :mask #b111)
            (.svf (&-> v1-7 quad) vf1)
            )
          (let ((gp-0 #f))
            (TODO-RENAME-28
              (-> self nav)
              (collide-kind
                background
                cak-1
                cak-2
                cak-3
                target
                water
                powerup
                crate
                enemy
                wall-object
                projectile
                ground-object
                target-attack
                mother-spider
                cak-14
                blue-eco-suck
                unknown-16
                unknown-17
                unknown-18
                unknown-19
                unknown-20
                unknown-21
                unknown-22
                unknown-23
                unknown-24
                unknown-25
                unknown-26
                unknown-27
                unknown-28
                unknown-29
                unknown-30
                unknown-31
                unknown-32
                unknown-33
                unknown-34
                unknown-35
                unknown-36
                unknown-37
                unknown-38
                unknown-39
                unknown-40
                unknown-41
                unknown-42
                unknown-43
                unknown-44
                unknown-45
                unknown-46
                unknown-47
                unknown-48
                unknown-49
                unknown-50
                unknown-51
                unknown-52
                unknown-53
                unknown-54
                unknown-55
                unknown-56
                unknown-57
                unknown-58
                unknown-59
                unknown-60
                unknown-61
                unknown-62
                unknown-63
                )
              )
            (let ((a2-1 (new 'stack-no-clear 'check-vector-collision-with-nav-spheres-info)))
              (if (>= (dummy-23 (-> self nav) (-> self nav travel) a2-1) 0.0)
                  (set! gp-0 #t)
                  )
              )
            (when (not gp-0)
              (let ((s5-0 (new 'stack 'clip-travel-vector-to-mesh-return-info)))
                (dummy-24 (-> self nav) (* 1.2 f30-0) s5-0)
                (if (-> s5-0 found-boundary)
                    (set! gp-0 #t)
                    )
                )
              )
            (when gp-0
              (set! (-> self knocked-back-speed) 0.0)
              (vector-reset! (-> self collide-info transv))
              )
            )
          )
        )
      (set! (-> self collide-info transv y) (+ -36864.0 (-> self collide-info transv y)))
      (integrate-for-enemy-with-move-to-ground!
        (-> self collide-info)
        (-> self collide-info transv)
        (collide-kind background)
        8192.0
        #t
        (-> self nav-info hover-if-no-ground)
        #f
        )
      (TODO-RENAME-27 (-> self nav))
      (none)
      )
    )
  :code (behavior ()
    (ja-channel-push! 1 (seconds 0.2))
    (ja-no-eval :group! double-lurker-bottom-take-hit-ja :num! (seek!) :frame-num 0.0)
    (until (ja-done? 0)
      (suspend)
      (ja :num! (seek!))
      )
    (go double-lurker-resume)
    (none)
    )
  :post (the-as (function none :behavior double-lurker) nav-enemy-simple-post)
  )

;; failed to figure out what this is:
(defstate double-lurker-waiting-to-die (double-lurker)
  :code (behavior ()
    (clear-collide-with-as (-> self collide-info))
    (logior! (-> self draw status) (draw-status hidden))
    (until (not (-> self child))
      (suspend)
      )
    (none)
    )
  )

;; definition for method 53 of type double-lurker
(defmethod dummy-53 double-lurker ((obj double-lurker) (arg0 vector))
  (let* ((s3-0 (-> obj path curve num-cverts))
         (s4-0 (rand-vu-int-count s3-0))
         )
    (while (nonzero? s3-0)
      (+! s3-0 -1)
      (eval-path-curve-div! (-> obj path) arg0 (the float s4-0) 'interp)
      (if (not (TODO-RENAME-50 obj arg0))
          (return #t)
          )
      )
    )
  #f
  )

;; definition for method 47 of type double-lurker
(defmethod initialize-collision double-lurker ((obj double-lurker))
  (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))))
    (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
    (set! (-> s5-0 reaction) default-collision-reaction)
    (set! (-> s5-0 no-reaction)
          (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
          )
    (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 9) 0)))
      (set! (-> s4-0 prim-core collide-as) (collide-kind enemy))
      (set! (-> s4-0 collide-with) (collide-kind target))
      (set! (-> s4-0 prim-core action) (collide-action solid))
      (set-vector! (-> s4-0 local-sphere) 0.0 12288.0 0.0 18432.0)
      (set-root-prim! s5-0 s4-0)
      (let ((s3-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2))))
        (set! (-> s3-0 prim-core collide-as) (collide-kind enemy))
        (set! (-> s3-0 collide-with) (collide-kind target))
        (set! (-> s3-0 prim-core action) (collide-action solid))
        (set! (-> s3-0 prim-core offense) (collide-offense indestructible))
        (set-vector! (-> s3-0 local-sphere) 0.0 15564.8 0.0 3686.4)
        (append-prim s4-0 s3-0)
        )
      (let ((s3-1 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2))))
        (set! (-> s3-1 prim-core collide-as) (collide-kind enemy))
        (set! (-> s3-1 collide-with) (collide-kind target))
        (set! (-> s3-1 prim-core action) (collide-action solid))
        (set! (-> s3-1 prim-core offense) (collide-offense indestructible))
        (set-vector! (-> s3-1 local-sphere) 0.0 19660.8 0.0 3686.4)
        (append-prim s4-0 s3-1)
        )
      (let ((s3-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2))))
        (set! (-> s3-2 prim-core collide-as) (collide-kind enemy))
        (set! (-> s3-2 collide-with) (collide-kind target))
        (set! (-> s3-2 prim-core offense) (collide-offense no-offense))
        (set! (-> s3-2 transform-index) 5)
        (set-vector! (-> s3-2 local-sphere) 0.0 8192.0 -1024.0 3276.8)
        (append-prim s4-0 s3-2)
        )
      (let ((s3-3 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2))))
        (set! (-> s3-3 prim-core collide-as) (collide-kind enemy))
        (set! (-> s3-3 collide-with) (collide-kind target))
        (set! (-> s3-3 prim-core action) (collide-action solid))
        (set! (-> s3-3 prim-core offense) (collide-offense indestructible))
        (set-vector! (-> s3-3 local-sphere) 0.0 3276.8 0.0 3686.4)
        (append-prim s4-0 s3-3)
        )
      (let ((s3-4 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2))))
        (set! (-> s3-4 prim-core collide-as) (collide-kind enemy))
        (set! (-> s3-4 collide-with) (collide-kind target))
        (set! (-> s3-4 prim-core action) (collide-action solid))
        (set! (-> s3-4 prim-core offense) (collide-offense indestructible))
        (set-vector! (-> s3-4 local-sphere) 0.0 7372.8 0.0 3686.4)
        (append-prim s4-0 s3-4)
        )
      (let ((s3-5 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2))))
        (set! (-> s3-5 prim-core collide-as) (collide-kind enemy))
        (set! (-> s3-5 collide-with) (collide-kind target))
        (set! (-> s3-5 prim-core action) (collide-action solid))
        (set! (-> s3-5 prim-core offense) (collide-offense indestructible))
        (set-vector! (-> s3-5 local-sphere) 0.0 11468.8 0.0 3686.4)
        (append-prim s4-0 s3-5)
        )
      (let ((s3-6 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1))))
        (set! (-> s3-6 prim-core collide-as) (collide-kind enemy))
        (set! (-> s3-6 collide-with) (collide-kind target))
        (set! (-> s3-6 prim-core offense) (collide-offense normal-attack))
        (set! (-> s3-6 transform-index) 5)
        (set-vector! (-> s3-6 local-sphere) 0.0 -2048.0 -2048.0 3686.4)
        (append-prim s4-0 s3-6)
        )
      (let ((s3-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1))))
        (set! (-> s3-7 prim-core collide-as) (collide-kind enemy))
        (set! (-> s3-7 collide-with) (collide-kind target))
        (set! (-> s3-7 prim-core offense) (collide-offense normal-attack))
        (set! (-> s3-7 transform-index) 10)
        (set-vector! (-> s3-7 local-sphere) 0.0 1024.0 0.0 1638.4)
        (append-prim s4-0 s3-7)
        )
      (let ((s3-8 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1))))
        (set! (-> s3-8 prim-core collide-as) (collide-kind enemy))
        (set! (-> s3-8 collide-with) (collide-kind target))
        (set! (-> s3-8 prim-core offense) (collide-offense normal-attack))
        (set! (-> s3-8 transform-index) 16)
        (set-vector! (-> s3-8 local-sphere) 0.0 -1024.0 0.0 1638.4)
        (append-prim s4-0 s3-8)
        )
      )
    (set! (-> s5-0 nav-radius) 9830.4)
    (backup-collide-with-as s5-0)
    (set! (-> obj collide-info) s5-0)
    s5-0
    )
  )

;; definition for method 51 of type double-lurker
;; INFO: Return type mismatch symbol vs none.
(defmethod dummy-51 double-lurker ((obj double-lurker))
  (let ((v1-1 (-> obj collide-info root-prim)))
    (let ((a0-1 0))
      (dotimes (a1-0 3)
        (let ((a2-2 (-> (the-as collide-shape-prim-group v1-1) prims a0-1)))
          (set! (-> a2-2 collide-with) (collide-kind))
          (set! (-> a2-2 prim-core collide-as) (collide-kind))
          (set! (-> a2-2 prim-core action) (collide-action))
          (set! (-> a2-2 prim-core offense) (collide-offense no-offense))
          )
        0
        (+! a0-1 1)
        )
      )
    (countdown (a0-4 (-> (the-as collide-shape-prim-group v1-1) num-prims))
      (let ((a1-3 (-> (the-as collide-shape-prim-group v1-1) prims a0-4)))
        (if (and (= (-> a1-3 prim-core offense) (collide-offense indestructible)) (logtest? (-> a1-3 prim-id) 2))
            (set! (-> a1-3 prim-core offense) (collide-offense touch))
            )
        )
      )
    )
  (none)
  )

;; definition for method 48 of type double-lurker
;; INFO: Return type mismatch float vs none.
;; Used lq/sq
(defmethod TODO-RENAME-48 double-lurker ((obj double-lurker))
  (set! (-> obj buddy-handle) (the-as handle #f))
  (process-drawable-from-entity! obj (-> obj entity))
  (set! (-> obj align) (new 'process 'align-control obj))
  (initialize-skeleton obj *double-lurker-sg* '())
  (set! (-> obj draw origin-joint-index) (the-as uint 3))
  (set! (-> obj buddy-on-shoulders?) #t)
  (set! (-> obj dead?) #f)
  (set! (-> obj buddy-dead?) #f)
  (let ((v1-7 (-> obj entity extra perm)))
    (if (nonzero? (-> v1-7 user-int8 2))
        (set! (-> obj buddy-on-shoulders?) #f)
        )
    (when (nonzero? (-> v1-7 user-int8 0))
      (set! (-> obj dead?) #t)
      (set! (-> obj buddy-on-shoulders?) #f)
      )
    (when (nonzero? (-> v1-7 user-int8 1))
      (set! (-> obj buddy-dead?) #t)
      (set! (-> obj buddy-on-shoulders?) #f)
      )
    )
  (TODO-RENAME-45 obj *double-lurker-when-both-nav-enemy-info*)
  (set! (-> obj neck up) (the-as uint 1))
  (set! (-> obj neck nose) (the-as uint 2))
  (set! (-> obj neck ear) (the-as uint 0))
  (set-vector! (-> obj neck twist-max) 12743.111 12743.111 0.0 1.0)
  (when (not (-> obj buddy-dead?))
    (let ((s5-0 (new 'stack-no-clear 'vector)))
      (when (not (-> obj buddy-on-shoulders?))
        (when (not (dummy-53 obj s5-0))
          (set! (-> obj buddy-on-shoulders?) #t)
          (let ((v1-29 (-> obj entity extra perm)))
            (logior! (-> v1-29 status) (entity-perm-status user-set-from-cstage))
            (set! (-> v1-29 user-int8 2) 0)
            )
          0
          )
        )
      (if (-> obj buddy-on-shoulders?)
          (set! (-> s5-0 quad) (-> obj collide-info trans quad))
          )
      (set! (-> obj buddy-handle)
            (ppointer->handle
              (process-spawn double-lurker-top (-> obj entity) obj (-> obj buddy-on-shoulders?) s5-0 :to obj)
              )
            )
      )
    )
  (when (and (not (-> obj dead?)) (not (-> obj buddy-on-shoulders?)))
    (dummy-51 obj)
    (TODO-RENAME-49 obj *double-lurker-nav-enemy-info*)
    )
  (none)
  )

;; definition for method 11 of type double-lurker
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! double-lurker ((obj double-lurker) (arg0 entity-actor))
  (initialize-collision obj)
  (TODO-RENAME-48 obj)
  (if (-> obj dead?)
      (go double-lurker-waiting-to-die)
      (go (method-of-object obj nav-enemy-idle))
      )
  (none)
  )
