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

;; name: tomb-baby-spider.gc
;; name in dgo: tomb-baby-spider
;; dgos: TEMA

;; DECOMP BEGINS

(deftype tomb-baby-spider (nav-enemy)
  ()
  (:state-methods
    attack
    attack-stop
    )
  )


(defskelgroup skel-tomb-baby-spider tomb-baby-spider tomb-baby-spider-lod0-jg tomb-baby-spider-idle-ja
              ((tomb-baby-spider-lod0-mg (meters 20)) (tomb-baby-spider-lod1-mg (meters 999999)))
              :bounds (static-spherem 0 0 0 5.5)
              :shadow tomb-baby-spider-shadow-mg
              )

(define *tomb-baby-fact-info-enemy*
  (new 'static 'fact-info-enemy-defaults :idle-distance (meters 200) :pickup-type 7)
  )

(define *tomb-baby-spider-nav-enemy-info*
  (new 'static 'nav-enemy-info
    :use-die-falling #f
    :use-victory #f
    :use-jump-blocked #f
    :debug-draw-neck #f
    :jump-debug-draw #f
    :move-to-ground #t
    :hover-if-no-ground #f
    :idle-anim-script (new 'static 'inline-array idle-control-frame 3
      (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30)
      (new 'static 'idle-control-frame
        :command (idle-control-cmd play)
        :anim #x4
        :param0 100
        :param1 100
        :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0))
        )
      (new 'static 'idle-control-frame)
      )
    :idle-anim 4
    :notice-anim 5
    :hostile-anim 8
    :hit-anim 4
    :knocked-anim 14
    :knocked-land-anim 15
    :die-anim 13
    :die-falling-anim 13
    :victory-anim 4
    :jump-wind-up-anim 4
    :jump-in-air-anim 4
    :jump-land-anim 4
    :neck-joint -1
    :look-at-joint 3
    :bullseye-joint 3
    :sound-die (static-sound-name "bspider-die")
    :notice-distance (meters 100)
    :notice-distance-delta (meters 10)
    :proximity-notice-distance (meters 2)
    :default-hit-points 1.0
    :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list)
    :overlaps-others-collide-with-filter (collide-spec jak bot player-list)
    :penetrate-knocked (penetrate
      generic-attack
      flop
      punch
      spin
      roll
      uppercut
      bonk
      tube
      flut-attack
      board
      mech-punch
      mech-bonk
      dark-skin
      dark-punch
      dark-bomb
      dark-smack
      flut
      shield
      explode
      jak-yellow-shot
      jak-red-shot
      jak-blue-shot
      jak-dark-shot
      enemy-yellow-shot
      enemy-dark-shot
      eco-yellow
      knocked
      )
    :movement-gravity (meters -100)
    :friction 0.8
    :attack-shove-back (meters 6)
    :attack-shove-up (meters 3)
    :attack-mode 'generic
    :attack-damage 2
    :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher)
    :knocked-can-land-timeout (seconds 0.1)
    :knocked-recover-timeout (seconds 2)
    :ragdoll-blend-out-time (seconds 0.25)
    :ragdoll-rotate-velocity-mult 1.0
    :jump-height-min (meters 3)
    :jump-height-factor 0.5
    :knocked-seek-ry-clamp 2730.6667
    :knocked-soft-vxz-lo (meters 19.6)
    :knocked-soft-vxz-hi (meters 21.4)
    :knocked-soft-vy-lo (meters 16.6)
    :knocked-soft-vy-hi (meters 27.4)
    :knocked-medium-vxz-lo (meters 36)
    :knocked-medium-vxz-hi (meters 48)
    :knocked-medium-vy-lo (meters 33)
    :knocked-medium-vy-hi (meters 37)
    :knocked-hard-vxz-lo (meters 13.6)
    :knocked-hard-vxz-hi (meters 17.4)
    :knocked-hard-vy-lo (meters 21.6)
    :knocked-hard-vy-hi (meters 32.4)
    :knocked-huge-vxz-lo (meters 40.2)
    :knocked-huge-vxz-hi (meters 60.8)
    :knocked-huge-vy-lo (meters 44.8)
    :knocked-huge-vy-hi (meters 53.2)
    :knocked-yellow-vxz-lo (meters 10)
    :knocked-yellow-vxz-hi (meters 12)
    :knocked-yellow-vy-lo (meters 14)
    :knocked-yellow-vy-hi (meters 20)
    :knocked-red-vxz-lo (meters 13.6)
    :knocked-red-vxz-hi (meters 17.4)
    :knocked-red-vy-lo (meters 21.6)
    :knocked-red-vy-hi (meters 32.4)
    :knocked-blue-vxz-lo (meters 10)
    :knocked-blue-vxz-hi (meters 12)
    :knocked-blue-vy-lo (meters 6)
    :knocked-blue-vy-hi (meters 20)
    :ragdoll-info #f
    :shadow-size (meters 2)
    :shadow-max-y (meters 1)
    :shadow-min-y (meters -1)
    :shadow-locus-dist (meters 150)
    :gem-joint -1
    :gem-offset (new 'static 'sphere :r 163840.0)
    :knocked-off #t
    :callback-info #f
    :use-momentum #f
    :use-frustration #f
    :use-stop-chase #f
    :use-circling #f
    :use-pacing #f
    :walk-anim 5
    :turn-anim 5
    :run-anim 8
    :taunt-anim -1
    :run-travel-speed (meters 6)
    :run-acceleration (meters 4)
    :run-turning-acceleration (meters 18)
    :walk-travel-speed (meters 4)
    :walk-acceleration (meters 1)
    :walk-turning-acceleration (meters 8)
    :maximum-rotation-rate (degrees 180)
    :notice-nav-radius (meters 100)
    :frustration-distance (meters 6)
    :frustration-time (seconds 4)
    :blocked-time (seconds 0.3)
    :circle-dist-lo 20480.0
    :circle-dist-hi 61440.0
    :nav-mesh #f
    )
  )

(set! (-> *tomb-baby-spider-nav-enemy-info* fact-defaults) *tomb-baby-fact-info-enemy*)

(defstate active (tomb-baby-spider)
  :virtual #t
  :code (behavior ()
    (ja-channel-push! 1 (seconds 0.2))
    (let ((f30-0 (rnd-float-range self 0.9 1.1)))
      (until #f
        (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info walk-anim))
                    :num! (seek! max f30-0)
                    :frame-num 0.0
                    )
        (until (ja-done? 0)
          (suspend)
          (ja :num! (seek! max f30-0))
          )
        (when (rnd-chance-for-idle? self 0.2)
          (ja-no-eval :num! (loop!))
          (ja-channel-push! 1 (seconds 0.2))
          (let ((v1-37 self))
            (set! (-> v1-37 enemy-flags) (the-as enemy-flag (logclear (-> v1-37 enemy-flags) (enemy-flag ef37))))
            (set! (-> v1-37 nav callback-info) *null-nav-callback-info*)
            )
          0
          (nav-enemy-method-178 self)
          (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim))
                      :num! (seek! max f30-0)
                      :frame-num 0.0
                      )
          (until (ja-done? 0)
            (ja-blend-eval)
            (suspend)
            (ja :num! (seek! max f30-0))
            )
          (until (not (rnd-chance-for-idle? self 0.2))
            (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim))
                        :num! (seek! max f30-0)
                        :frame-num 0.0
                        )
            (until (ja-done? 0)
              (suspend)
              (ja :num! (seek! max f30-0))
              )
            )
          (let ((v1-101 self))
            (if (not (logtest? (enemy-flag ef37) (-> v1-101 enemy-flags)))
                (set! (-> v1-101 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-101 enemy-flags))))
                )
            (set! (-> v1-101 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-101 enemy-flags))))
            (set! (-> v1-101 nav callback-info) (-> v1-101 enemy-info callback-info))
            )
          0
          (nav-enemy-method-176 self)
          (ja-no-eval :num! (loop!))
          (ja-channel-push! 1 (seconds 0.05))
          (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info walk-anim))
                      :num! (seek! max f30-0)
                      :frame-num 0.0
                      )
          (until (ja-done? 0)
            (ja-blend-eval)
            (suspend)
            (ja :num! (seek! max f30-0))
            )
          )
        )
      )
    #f
    )
  )

(defstate notice (tomb-baby-spider)
  :virtual #t
  :code (behavior ()
    (go-state-for-focused self)
    (ja-channel-push! 1 (seconds 0.2))
    (let ((f30-0 (rnd-float-range self 0.8 1.2)))
      (let ((gp-0 (new 'stack-no-clear 'vector)))
        (let ((a0-4 (handle->process (-> self focus handle))))
          (cond
            (a0-4
              (vector-copy! gp-0 (get-trans (the-as process-focusable a0-4) 0))
              )
            (else
              (let ((a1-4 (-> self nav state)))
                (vector-copy! gp-0 (-> a1-4 target-pos))
                )
              )
            )
          )
        (ja-no-eval :group! tomb-baby-spider-notice-spin-ja :num! (seek! max f30-0) :frame-num 0.0)
        (until (ja-done? 0)
          (seek-to-point-toward-point! (-> self root) gp-0 (* 1.8 (-> self nav max-rotation-rate)) (seconds 0.02))
          (suspend)
          (ja :num! (seek! max f30-0))
          )
        )
      (ja-no-eval :group! tomb-baby-spider-notice-land-ja :num! (seek! max f30-0) :frame-num 0.0)
      (until (ja-done? 0)
        (suspend)
        (ja :num! (seek! max f30-0))
        )
      )
    (go-state-for-focused self)
    )
  )

(defstate attack (tomb-baby-spider)
  :virtual #t
  :event enemy-event-handler
  :enter (behavior ()
    (nav-enemy-method-177 self)
    (logior! (-> self enemy-flags) (enemy-flag lock-focus))
    (logior! (-> self focus-status) (focus-status dangerous))
    (let ((v1-9 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1)))
      (set! (-> v1-9 local-sphere w) 4915.2)
      )
    (set! (-> self root penetrate-using) (penetrate generic-attack lunge))
    (reset-penetrate-later! self)
    (let* ((v1-14 *game-info*)
           (v0-2 (+ (-> v1-14 attack-id) 1))
           )
      (set! (-> v1-14 attack-id) v0-2)
      (set! (-> self attack-id) v0-2)
      )
    )
  :exit (behavior ()
    (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1)))
      (set! (-> v1-3 local-sphere w) 819.2)
      )
    (logclear! (-> self enemy-flags) (enemy-flag lock-focus))
    (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
        (logior! (-> self focus-status) (focus-status dangerous))
        (logclear! (-> self focus-status) (focus-status dangerous))
        )
    (nav-enemy-method-176 self)
    )
  :trans (behavior ()
    (reset-penetrate-later! self)
    (if (logtest? (-> self enemy-flags) (enemy-flag victory))
        (logclear! (-> self enemy-flags) (enemy-flag victory))
        )
    )
  :code (behavior ()
    (let ((v1-0 (-> self nav)))
      (set! (-> v1-0 target-speed) (* 2.8 (-> self enemy-info run-travel-speed)))
      )
    0
    (let ((v1-2 (-> self nav)))
      (set! (-> v1-2 acceleration) (* 2.4 (-> self enemy-info run-acceleration)))
      )
    0
    (ja-channel-push! 1 (seconds 0.1))
    (ja-no-eval :group! tomb-baby-spider-attack0-start-ja :num! (seek! max 0.8) :frame-num 0.0)
    (until (ja-done? 0)
      (suspend)
      (ja :num! (seek! max 0.8))
      )
    (go-virtual attack-stop)
    )
  :post nav-enemy-chase-post
  )

(defstate attack-stop (tomb-baby-spider)
  :virtual #t
  :event enemy-event-handler
  :enter (behavior ()
    (let ((v1-0 (-> self nav)))
      (set! (-> v1-0 target-speed) 0.0)
      )
    0
    (let ((v1-2 self))
      (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef38))))
      )
    0
    )
  :exit (behavior ()
    (let ((v1-0 self))
      (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-0 enemy-flags))))
      )
    0
    )
  :code (behavior ()
    (ja-no-eval :group! tomb-baby-spider-attack0-stop-ja :num! (seek!) :frame-num 0.0)
    (until (ja-done? 0)
      (suspend)
      (ja :num! (seek!))
      )
    (when (not (pointing-toward-focus? self 6371.5557 #t))
      (let ((v1-27 self))
        (set! (-> v1-27 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-27 enemy-flags))))
        )
      0
      (let ((t9-4 vector-normalize!)
            (a0-7 (new 'stack-no-clear 'vector))
            (a2-3 (-> self nav state))
            (v1-30 (new 'stack-no-clear 'vector))
            )
        (vector-copy! v1-30 (-> a2-3 target-pos))
        (let* ((s5-0 (t9-4 (vector-! a0-7 v1-30 (-> self root trans)) 1.0))
               (f30-0 (deg-diff (quaternion-y-angle (-> self root quat)) (vector-y-angle s5-0)))
               )
          (ja-no-eval :num! (loop!))
          (cond
            ((< 0.0 f30-0)
             (ja-channel-push! 1 (seconds 0.1))
             (ja :group! tomb-baby-spider-turn-left-ja :num! min)
             )
            (else
              (ja-channel-push! 1 (seconds 0.1))
              (ja :group! tomb-baby-spider-turn-right-ja :num! min)
              )
            )
          )
        )
      (until (pointing-toward-focus? self 910.2222 #t)
        (ja-blend-eval)
        (suspend)
        (ja :num! (loop!))
        )
      (let ((v1-53 self))
        (set! (-> v1-53 enemy-flags) (the-as enemy-flag (logclear (-> v1-53 enemy-flags) (enemy-flag ef38))))
        )
      0
      )
    (ja-channel-push! 1 (seconds 0.2))
    (let ((gp-3 (current-time))
          (s5-1 (the int (* 300.0 (rand-vu-float-range 0.6 1.2))))
          (f30-2 1.0)
          )
      (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim))
                  :num! (loop! f30-2)
                  :frame-num 0.0
                  )
      (until (time-elapsed? gp-3 s5-1)
        (suspend)
        (ja :num! (loop! f30-2))
        )
      )
    (let ((gp-4 (-> self focus aware)))
      (if (or (not (get-focus! self)) (!= gp-4 3))
          (go-stare self)
          )
      )
    (go-virtual hostile)
    )
  :post nav-enemy-face-focus-post
  )

(defstate hostile (tomb-baby-spider)
  :virtual #t
  :trans (behavior ()
    (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans)))
      (if t9-0
          (t9-0)
          )
      )
    (let ((a0-1 (get-focus! self)))
      (when a0-1
        (let ((a0-2 (get-trans a0-1 0)))
          (if (and (< (vector-vector-distance a0-2 (-> self root trans)) 20480.0)
                   (pointing-toward-focus? self 1274.3112 #t)
                   )
              (go-virtual attack)
              )
          )
        )
      )
    )
  )

(defmethod knocked-anim ((this tomb-baby-spider) (arg0 enemy-knocked-info))
  "start the knocked animation."
  (let* ((a2-0 (the-as collide-shape-prim-group (-> this root root-prim)))
         (v1-2 (-> a2-0 child 3))
         )
    (dotimes (a3-0 3)
      (set! (-> a2-0 child a3-0 local-sphere w) 819.2)
      )
    (set! (-> v1-2 prim-core action) (collide-action solid))
    (set! (-> v1-2 prim-core collide-as) (collide-spec enemy))
    (set! (-> v1-2 prim-core collide-with)
          (collide-spec backgnd jak bot crate obstacle player-list blocking-plane pusher)
          )
    )
  (case (-> this incoming knocked-type)
    (((knocked-type blue-shot))
     (let ((v1-6 (-> this skel root-channel 0)))
       (set! (-> v1-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 20)))
       (set! (-> v1-6 param 0)
             (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1))
             )
       (set! (-> v1-6 param 1) (-> arg0 anim-speed))
       (set! (-> v1-6 frame-num) 0.0)
       (joint-control-channel-group! v1-6 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!)
       )
     #t
     )
    (((knocked-type explode-or-darkjak) (knocked-type red-shot))
     (let ((v1-11 (-> this skel root-channel 0)))
       (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> this draw art-group data 17)))
       (set! (-> v1-11 param 0)
             (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 17)) frames num-frames) -1))
             )
       (set! (-> v1-11 param 1) (-> arg0 anim-speed))
       (set! (-> v1-11 frame-num) 0.0)
       (joint-control-channel-group! v1-11 (the-as art-joint-anim (-> this draw art-group data 17)) num-func-seek!)
       )
     #t
     )
    (else
      ((method-of-type nav-enemy knocked-anim) this arg0)
      )
    )
  )

(defmethod knocked-land-anim ((this tomb-baby-spider) (arg0 enemy-knocked-info))
  "start the knocked-land animation."
  (case (-> this incoming knocked-type)
    (((knocked-type blue-shot))
     (let ((v1-3 (-> this skel root-channel 0)))
       (set! (-> v1-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 22)))
       (set! (-> v1-3 param 0)
             (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1))
             )
       (set! (-> v1-3 param 1) (-> arg0 anim-speed))
       (set! (-> v1-3 frame-num) 0.0)
       (joint-control-channel-group! v1-3 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!)
       )
     #t
     )
    (((knocked-type explode-or-darkjak) (knocked-type red-shot))
     (let ((v1-8 (-> this skel root-channel 0)))
       (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 18)))
       (set! (-> v1-8 param 0)
             (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1))
             )
       (set! (-> v1-8 param 1) (-> arg0 anim-speed))
       (set! (-> v1-8 frame-num) 0.0)
       (joint-control-channel-group! v1-8 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!)
       )
     #t
     )
    (else
      ((method-of-type nav-enemy knocked-land-anim) this arg0)
      )
    )
  )

(defmethod knocked-anim-handler ((this tomb-baby-spider) (arg0 int) (arg1 enemy-knocked-info))
  "start or play the approriate animation for an enemy being knocked."
  (case arg0
    ((3)
     (let ((s4-0 (ja-done? 0)))
       (let ((a0-3 (-> this skel root-channel 0)))
         (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group frames num-frames) -1)))
         (set! (-> a0-3 param 1) (-> arg1 anim-speed))
         (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!)
         )
       (when s4-0
         (case (-> this incoming knocked-type)
           (((knocked-type blue-shot))
            )
           (((knocked-type explode-or-darkjak) (knocked-type red-shot))
            (let ((a0-7 (-> this skel root-channel 0)))
              (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> this draw art-group data 19)))
              (set! (-> a0-7 param 0)
                    (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 19)) frames num-frames) -1))
                    )
              (set! (-> a0-7 param 1) (-> arg1 anim-speed))
              (set! (-> a0-7 frame-num) 0.0)
              (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> this draw art-group data 19)) num-func-seek!)
              )
            )
           (else
             (let ((a0-8 (-> this skel root-channel 0)))
               (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 16)))
               (set! (-> a0-8 param 0)
                     (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 16)) frames num-frames) -1))
                     )
               (set! (-> a0-8 param 1) (-> arg1 anim-speed))
               (set! (-> a0-8 frame-num) 0.0)
               (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 16)) num-func-seek!)
               )
             )
           )
         (vector-reset! (-> this root transv))
         #t
         )
       )
     )
    ((4)
     (let ((s4-1 (ja-done? 0)))
       (let ((a0-11 (-> this skel root-channel 0)))
         (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group frames num-frames) -1)))
         (set! (-> a0-11 param 1) (-> arg1 anim-speed))
         (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!)
         )
       (when s4-1
         (let ((v1-50 (-> this root root-prim)))
           (set! (-> (the-as collide-shape-prim-group v1-50) child 0 local-sphere w) 1638.4)
           (set! (-> (the-as collide-shape-prim-group v1-50) child 1 local-sphere w) 1638.4)
           (set! (-> (the-as collide-shape-prim-group v1-50) child 2 local-sphere w) 3276.8)
           (set! (-> (the-as collide-shape-prim-group v1-50) child 3 prim-core action) (collide-action))
           (set! (-> (the-as collide-shape-prim-group v1-50) child 3 prim-core collide-with) (collide-spec))
           )
         0
         )
       s4-1
       )
     )
    (else
      ((method-of-type nav-enemy knocked-anim-handler) this arg0 arg1)
      )
    )
  )

(defmethod send-attack-from-tshape ((this tomb-baby-spider) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint))
  "Send an attack from this enemy to something else."
  (let ((s2-0 (as-type arg0 process-focusable))
        (v1-0 (the-as target (as-type *target* process-focusable)))
        (f0-0 1.0)
        )
    (if (and (= s2-0 v1-0) (focus-test? v1-0 indax))
        (set! f0-0 0.6)
        )
    (when (send-event arg0 'attack arg1 (static-attack-info
                                          :mask (vehicle-impulse-factor)
                                          ((id arg2)
                                           (damage (the float (-> this enemy-info attack-damage)))
                                           (vehicle-damage-factor 1.0)
                                           (vehicle-impulse-factor 1.0)
                                           (shove-back (* f0-0 (-> this enemy-info attack-shove-back)))
                                           (shove-up (* f0-0 (-> this enemy-info attack-shove-up)))
                                           (mode (-> this enemy-info attack-mode))
                                           (knock (knocked-type knocked-off))
                                           )
                                          )
                      )
      (on-attack this (the-as process-focusable arg0))
      #t
      )
    )
  )

(defmethod init-enemy-collision! ((this tomb-baby-spider))
  "Typical place to construct collision shapes"
  (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player))))
    (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
    (set! (-> s5-0 reaction) cshape-reaction-default)
    (set! (-> s5-0 no-reaction)
          (the-as (function collide-shape-moving collide-query vector vector object) nothing)
          )
    (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0)))
      (set! (-> s5-0 total-prims) (the-as uint 6))
      (set! (-> s4-0 prim-core collide-as) (collide-spec enemy))
      (set! (-> s4-0 prim-core collide-with)
            (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list)
            )
      (set! (-> s4-0 prim-core action) (collide-action solid deadly no-standon))
      (set! (-> s4-0 transform-index) 3)
      (set-vector! (-> s4-0 local-sphere) 0.0 409.6 0.0 7782.4)
      (set! (-> s5-0 root-prim) s4-0)
      )
    (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
      (set! (-> v1-13 prim-core collide-as) (collide-spec enemy))
      (set! (-> v1-13 prim-core collide-with)
            (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list)
            )
      (set! (-> v1-13 prim-core action) (collide-action solid no-standon))
      (set! (-> v1-13 transform-index) 3)
      (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 1638.4)
      )
    (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
      (set! (-> v1-15 prim-core collide-as) (collide-spec enemy))
      (set! (-> v1-15 prim-core collide-with)
            (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list)
            )
      (set! (-> v1-15 prim-core action) (collide-action solid deadly no-standon))
      (set! (-> v1-15 transform-index) 24)
      (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 1638.4)
      )
    (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
      (set! (-> v1-17 prim-core collide-as) (collide-spec enemy))
      (set! (-> v1-17 prim-core collide-with)
            (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list)
            )
      (set! (-> v1-17 prim-core action) (collide-action solid no-standon))
      (set! (-> v1-17 transform-index) 4)
      (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 3276.8)
      )
    (set-vector!
      (-> (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)) local-sphere)
      0.0
      2867.2
      0.0
      3276.8
      )
    (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
      (set! (-> v1-21 prim-core collide-as) (collide-spec enemy))
      (set! (-> v1-21 prim-core collide-with)
            (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list)
            )
      (set! (-> v1-21 prim-core action) (collide-action solid no-standon))
      (set! (-> v1-21 transform-index) 5)
      (set-vector! (-> v1-21 local-sphere) 0.0 4096.0 -1228.8 1638.4)
      )
    (set! (-> s5-0 nav-radius) 3686.4)
    (let ((v1-23 (-> s5-0 root-prim)))
      (set! (-> s5-0 backup-collide-as) (-> v1-23 prim-core collide-as))
      (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with))
      )
    (set! (-> s5-0 max-iteration-count) (the-as uint 3))
    (set! (-> this root) s5-0)
    )
  0
  (none)
  )

;; WARN: Return type mismatch vector vs none.
(defmethod init-enemy! ((this tomb-baby-spider))
  "Typical place for shared init code. Runs from entity or process style init."
  (initialize-skeleton
    this
    (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-baby-spider" (the-as (pointer level) #f)))
    (the-as pair 0)
    )
  (setup-enemy! this *tomb-baby-spider-nav-enemy-info*)
  (let ((f0-0 (rnd-float-range this 0.75 1.0)))
    (set-vector! (-> this root scale) f0-0 f0-0 f0-0 1.0)
    )
  (none)
  )

(deftype dig-spider (tomb-baby-spider)
  ()
  )
