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

(import "goal_src/jak1/import/minershort-ag.gc")
(import "goal_src/jak1/import/cavegem-ag.gc")
(import "goal_src/jak1/import/minertall-ag.gc")

;; definition for function miners-anim-loop
(defbehavior miners-anim-loop minershort ()
  (when (!= (ja-group) (get-art-elem self))
    (ja-channel-push! 1 (seconds 0.2))
    (ja :group! (get-art-elem self))
    )
  (loop
    (suspend)
    (ja :num! (loop! 2.0))
    (if (= (-> self next-state name) 'idle)
        (TODO-RENAME-43 self)
        )
    )
  (the-as none 0)
  (none)
  )

;; definition of type minertall
(deftype minertall (process-taskable)
  ()
  :heap-base #x110
  :method-count-assert 53
  :size-assert         #x17c
  :flag-assert         #x350110017c
  )

;; definition for method 3 of type minertall
(defmethod inspect minertall ((obj minertall))
  (let ((t9-0 (method-of-type process-taskable inspect)))
    (t9-0 obj)
    )
  obj
  )

;; failed to figure out what this is:
(defskelgroup *minertall-sg* minertall minertall-lod0-jg minertall-idle-ja
              ((minertall-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 0 0 2.5)
              :shadow minertall-shadow-mg
              )

;; definition for method 52 of type minertall
;; INFO: Return type mismatch shadow-flags vs none.
(defmethod dummy-52 minertall ((obj minertall))
  (let ((v1-1 (-> obj draw shadow-ctrl)))
    (when v1-1
      (let ((f0-0 (-> obj root-override trans y)))
        (let ((a0-2 v1-1))
          (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0)))
          )
        0
        (let ((a0-4 v1-1))
          (set! (-> a0-4 settings top-plane w) (- (+ 4096.0 f0-0)))
          )
        )
      0
      (logclear! (-> v1-1 settings flags) (shadow-flags shdf03))
      )
    )
  (none)
  )

;; definition for method 48 of type minertall
(defmethod draw-npc-shadow minertall ((obj minertall))
  (-> obj draw shadow-ctrl)
  (cond
    ((and (-> obj draw shadow)
          (zero? (-> obj draw cur-lod))
          (logtest? (-> obj draw status) (draw-status was-drawn))
          )
     (let ((v1-9 (-> obj draw shadow-ctrl)))
       (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw))
       )
     0
     (update-direction-from-time-of-day (-> obj draw shadow-ctrl))
     )
    (else
      (let ((v1-14 (-> obj draw shadow-ctrl)))
        (logior! (-> v1-14 settings flags) (shadow-flags disable-draw))
        )
      0
      )
    )
  (none)
  )

;; definition for method 32 of type minertall
;; INFO: Return type mismatch art-element vs basic.
(defmethod play-anim! minertall ((obj minertall) (arg0 symbol))
  (set! (-> obj talk-message) (game-text-id press-to-talk))
  (current-status (-> obj tasks))
  (if arg0
      (format
        0
        "ERROR: <GMJ>: ~S playing anim for task status ~S~%"
        (-> obj name)
        (task-status->string (current-status (-> obj tasks)))
        )
      )
  (the-as basic (-> obj draw art-group data 3))
  )

;; definition for method 31 of type minertall
(defmethod get-art-elem minertall ((obj minertall))
  (-> obj draw art-group data 3)
  )

;; failed to figure out what this is:
(defstate idle (minertall)
  :virtual #t
  :trans (behavior ()
    (set! (-> self will-talk) #f)
    ((-> (method-of-type process-taskable idle) trans))
    (none)
    )
  :code (the-as (function none :behavior minertall) miners-anim-loop)
  )

;; definition for method 11 of type minertall
(defmethod init-from-entity! minertall ((obj minertall) (arg0 entity-actor))
  (dummy-40 obj arg0 *minertall-sg* 32 47 (new 'static 'vector :w 4096.0) 5)
  (set! (-> obj tasks) (get-task-control (game-task village3-miner-money1)))
  (set! (-> obj draw light-index) (the-as uint 1))
  (dummy-42 obj)
  (none)
  )

;; definition of type minershort
(deftype minershort (process-taskable)
  ((other-miner minertall  :offset-assert 380)
   )
  :heap-base #x110
  :method-count-assert 53
  :size-assert         #x180
  :flag-assert         #x3501100180
  )

;; definition for method 3 of type minershort
(defmethod inspect minershort ((obj minershort))
  (let ((t9-0 (method-of-type process-taskable inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tother-miner: ~A~%" (-> obj other-miner))
  obj
  )

;; failed to figure out what this is:
(defskelgroup *minershort-sg* minershort minershort-lod0-jg minershort-idle-ja
              ((minershort-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 0 0 2.5)
              :shadow minershort-shadow-mg
              )

;; failed to figure out what this is:
(defpartgroup group-minershort-candle
  :id 566
  :bounds (static-bspherem 0 0 0 15)
  :parts ((sp-item 2364 :fade-after (meters 60) :falloff-to (meters 60))
    (sp-item 2365 :fade-after (meters 60) :falloff-to (meters 60))
    (sp-item 2366 :fade-after (meters 60) :falloff-to (meters 60))
    )
  )

;; failed to figure out what this is:
(defpart 2366
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
    (sp-rnd-flt spt-num 1.0 2.0 1.0)
    (sp-flt spt-y (meters 0))
    (sp-rnd-flt spt-scale-x (meters 0.075) (meters 0.075) 1.0)
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 128.0 64.0 1.0)
    (sp-rnd-flt spt-g 128.0 32.0 1.0)
    (sp-rnd-flt spt-b 128.0 16.0 1.0)
    (sp-rnd-flt spt-a 32.0 32.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0) (meters 0.00033333333) 1.0)
    (sp-rnd-flt spt-scalevel-x (meters 0.0005) (meters 0.001) 1.0)
    (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0)
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-flt spt-fade-r -0.32820514)
    (sp-flt spt-fade-g -0.32820514)
    (sp-flt spt-fade-b -0.32820514)
    (sp-flt spt-fade-a -0.16410257)
    (sp-rnd-flt spt-accel-y 0.13653333 0.27306667 1.0)
    (sp-int spt-timer 390)
    (sp-cpuinfo-flags bit2 bit12 bit14)
    (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.05) 1.0)
    )
  )

;; failed to figure out what this is:
(defpart 2364
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
    (sp-flt spt-num 3.0)
    (sp-rnd-flt spt-y (meters -0.08) (meters 0.02) 1.0)
    (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.2) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 128.0 64.0 1.0)
    (sp-rnd-flt spt-g 64.0 64.0 1.0)
    (sp-rnd-flt spt-b 0.0 32.0 1.0)
    (sp-rnd-flt spt-a 32.0 32.0 1.0)
    (sp-rnd-flt spt-vel-x (meters 0) (meters 0.00016666666) 1.0)
    (sp-rnd-flt spt-vel-z (meters 0) (meters 0.00016666666) 1.0)
    (sp-flt spt-scalevel-x (meters -0.0016666667))
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-flt spt-fade-g -0.7111111)
    (sp-rnd-flt spt-accel-y 1.0922667 0.27306667 1.0)
    (sp-int-plain-rnd spt-timer 60 29 1)
    (sp-cpuinfo-flags bit3)
    )
  )

;; failed to figure out what this is:
(defpart 2365
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2))
    (sp-flt spt-num 1.0)
    (sp-flt spt-y (meters -0.02))
    (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.75) 1.0)
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 128.0 64.0 1.0)
    (sp-rnd-flt spt-g 64.0 64.0 1.0)
    (sp-rnd-flt spt-b 0.0 32.0 1.0)
    (sp-rnd-flt spt-a 16.0 32.0 1.0)
    (sp-rnd-flt spt-vel-x (meters 0) (meters 0.00016666666) 1.0)
    (sp-rnd-flt spt-vel-z (meters 0) (meters 0.00016666666) 1.0)
    (sp-flt spt-scalevel-x (meters -0.0016666667))
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-flt spt-fade-g -0.7111111)
    (sp-flt spt-fade-a -1.92)
    (sp-rnd-flt spt-accel-y 1.0922667 0.27306667 1.0)
    (sp-int spt-timer 20)
    (sp-cpuinfo-flags bit2 bit3)
    )
  )

;; definition for method 52 of type minershort
;; INFO: Return type mismatch shadow-flags vs none.
(defmethod dummy-52 minershort ((obj minershort))
  (let ((v1-1 (-> obj draw shadow-ctrl)))
    (when v1-1
      (let ((f0-0 (-> obj root-override trans y)))
        (let ((a0-2 v1-1))
          (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0)))
          )
        0
        (let ((a0-4 v1-1))
          (set! (-> a0-4 settings top-plane w) (- (+ 4096.0 f0-0)))
          )
        )
      0
      (logclear! (-> v1-1 settings flags) (shadow-flags shdf03))
      )
    )
  (none)
  )

;; definition for method 48 of type minershort
(defmethod draw-npc-shadow minershort ((obj minershort))
  (-> obj draw shadow-ctrl)
  (cond
    ((and (-> obj draw shadow)
          (zero? (-> obj draw cur-lod))
          (logtest? (-> obj draw status) (draw-status was-drawn))
          )
     (let ((v1-9 (-> obj draw shadow-ctrl)))
       (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw))
       )
     0
     (update-direction-from-time-of-day (-> obj draw shadow-ctrl))
     )
    (else
      (let ((v1-14 (-> obj draw shadow-ctrl)))
        (logior! (-> v1-14 settings flags) (shadow-flags disable-draw))
        )
      0
      )
    )
  (none)
  )

;; definition for function minershort-trans-hook
;; INFO: Return type mismatch object vs none.
(defbehavior minershort-trans-hook minershort ()
  (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 14)))
  (none)
  )

;; definition for method 32 of type minershort
(defmethod play-anim! minershort ((obj minershort) (arg0 symbol))
  (set! (-> obj talk-message) (game-text-id press-to-talk))
  (case (current-status (-> obj tasks))
    (((task-status need-hint) (task-status need-introduction))
     (if (not arg0)
         (set! (-> obj will-talk) #t)
         )
     (case (current-task (-> obj tasks))
       (((game-task village3-miner-money1))
        (when arg0
          (let* ((s5-1 (-> obj tasks))
                 (s4-0 (method-of-object s5-1 save-reminder))
                 )
            (s4-0 s5-1 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1)
            )
          (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj))
          (close-specific-task! (game-task village3-miner-money1) (task-status need-introduction))
          (close-specific-task! (game-task village3-miner-money2) (task-status need-introduction))
          (close-specific-task! (game-task village3-miner-money3) (task-status need-introduction))
          (close-specific-task! (game-task village3-miner-money4) (task-status need-introduction))
          )
        (new 'static 'spool-anim
          :name "minershort-introduction-orbs"
          :index 4
          :parts 16
          :command-list '((171 joint "cameraB")
            (206 joint "camera")
            (423 joint "cameraB")
            (591 joint "camera")
            (692 joint "cameraB")
            (918 joint "camera")
            (1122 joint "cameraB")
            (1122 shadow self #f)
            (1241 joint "camera")
            (1241 shadow self #t)
            )
          )
        )
       (((game-task cave-gnawers))
        (when arg0
          (let* ((s5-2 (-> obj tasks))
                 (s4-1 (method-of-object s5-2 save-reminder))
                 )
            (s4-1 s5-2 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1)
            )
          (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj))
          (close-status! (-> obj tasks) (task-status need-introduction))
          )
        (new 'static 'spool-anim
          :name "minershort-introduction-gnawers"
          :index 9
          :parts 8
          :command-list '((0 want-levels village3 maincave)
            (149 joint "cameraB")
            (158 display-level maincave movie)
            (158 want-force-vis maincave #t)
            (435 display-level maincave #f)
            (435 joint "camera")
            (680 joint "cameraB")
            (719 joint "camera")
            )
          )
        )
       (else
         (when arg0
           (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj))
           (close-status! (-> obj tasks) (task-status need-introduction))
           )
         (new 'static 'spool-anim
           :name "minershort-introduction-switch"
           :index 11
           :parts 7
           :command-list '((2 shadow "minertall-1" #f) (835 shadow "minertall-1" #t))
           )
         )
       )
     )
    (((task-status need-reminder))
     (set! (-> obj skippable) #t)
     (let ((s4-2 (+ (get-reminder (-> obj tasks) 0) 1)))
       (if (< (the-as uint 3) (the-as uint s4-2))
           (set! s4-2 0)
           )
       (countdown (s3-0 4)
         (let ((v1-59 s4-2))
           (cond
             ((zero? v1-59)
              (if (not (or (= (get-task-status (game-task village3-miner-money1)) (task-status need-reminder))
                           (= (get-task-status (game-task village3-miner-money2)) (task-status need-reminder))
                           (= (get-task-status (game-task village3-miner-money3)) (task-status need-reminder))
                           (= (get-task-status (game-task village3-miner-money4)) (task-status need-reminder))
                           )
                       )
                  (set! s4-2 1)
                  )
              )
             ((= v1-59 1)
              (if (!= (get-task-status (game-task cave-gnawers)) (task-status need-reminder))
                  (set! s4-2 2)
                  )
              )
             ((= v1-59 2)
              (if (not (or (= (get-task-status (game-task village3-miner-money1)) (task-status need-reminder))
                           (= (get-task-status (game-task village3-miner-money2)) (task-status need-reminder))
                           (= (get-task-status (game-task village3-miner-money3)) (task-status need-reminder))
                           (= (get-task-status (game-task village3-miner-money4)) (task-status need-reminder))
                           )
                       )
                  (set! s4-2 3)
                  )
              )
             (else
               (if (!= (get-task-status (game-task snow-eggtop)) (task-status need-reminder))
                   (set! s4-2 0)
                   )
               )
             )
           )
         )
       (if arg0
           (save-reminder (-> obj tasks) s4-2 0)
           )
       (cond
         ((zero? s4-2)
          (new 'static 'spool-anim :name "minershort-reminder-1-orbs" :index 5 :parts 3 :command-list '())
          )
         ((= s4-2 1)
          (if arg0
              (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj))
              )
          (new 'static 'spool-anim :name "minershort-reminder-1-gnawers" :index 10 :parts 3 :command-list '())
          )
         ((= s4-2 2)
          (if arg0
              (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj))
              )
          (new 'static 'spool-anim :name "minershort-reminder-2-orbs" :index 6 :parts 2 :command-list '())
          )
         (else
           (if arg0
               (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj))
               )
           (new 'static 'spool-anim
             :name "minershort-reminder-1-switch"
             :index 12
             :parts 5
             :command-list '((2 shadow "minertall-1" #f) (500 shadow "minertall-1" #t))
             )
           )
         )
       )
     )
    (((task-status need-reward-speech))
     (let ((s4-3 (get-reminder (-> obj tasks) 2)))
       (cond
         (arg0
           (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj))
           (set! (-> obj cell-for-task) (current-task (-> obj tasks)))
           (close-current! (-> obj tasks))
           (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc)))
           (save-reminder (-> obj tasks) (+ s4-3 1) 2)
           )
         (else
           (set! (-> obj will-talk) #t)
           (set! (-> obj talk-message) (game-text-id press-to-trade-money))
           )
         )
       (if (< (the-as uint s4-3) (the-as uint 3))
           (new 'static 'spool-anim :name "minershort-resolution-1-orbs" :index 7 :parts 2 :command-list '())
           (new 'static 'spool-anim
             :name "minershort-resolution-2-orbs"
             :index 8
             :parts 6
             :command-list '((154 joint "cameraB") (461 joint "camera"))
             )
           )
       )
     )
    (else
      (if arg0
          (format
            0
            "ERROR: <GMJ>: ~S playing anim for task status ~S~%"
            (-> obj name)
            (task-status->string (current-status (-> obj tasks)))
            )
          )
      (-> obj draw art-group data 3)
      )
    )
  )

;; failed to figure out what this is:
(defstate play-anim (minershort)
  :virtual #t
  :exit (behavior ()
    (send-event (-> self other-miner ppointer 3) 'end-mode)
    ((-> (method-of-type process-taskable play-anim) exit))
    (none)
    )
  )

;; definition for method 31 of type minershort
(defmethod get-art-elem minershort ((obj minershort))
  (-> obj draw art-group data 3)
  )

;; definition for method 43 of type minershort
(defmethod TODO-RENAME-43 minershort ((obj minershort))
  (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj)
    (let ((f0-2 (rand-float-gen)))
      (cond
        ((< 0.9655172 f0-2)
         (play-ambient (-> obj ambient) "MIN-LO01" #f (-> obj root-override trans))
         )
        ((< 0.9310345 f0-2)
         (play-ambient (-> obj ambient) "MIN-LO03" #f (-> obj root-override trans))
         )
        ((< 0.8965517 f0-2)
         (play-ambient (-> obj ambient) "MIN-LO04" #f (-> obj root-override trans))
         )
        ((< 0.86206895 f0-2)
         (play-ambient (-> obj ambient) "MIN-LO05" #f (-> obj root-override trans))
         )
        ((< 0.82758623 f0-2)
         (play-ambient (-> obj ambient) "MIN-LO06" #f (-> obj root-override trans))
         )
        ((< 0.79310346 f0-2)
         (play-ambient (-> obj ambient) "MSH-AM01" #f (-> obj root-override trans))
         )
        ((< 0.7586207 f0-2)
         (play-ambient (-> obj ambient) "MSH-AM02" #f (-> obj root-override trans))
         )
        ((< 0.7241379 f0-2)
         (play-ambient (-> obj ambient) "MSH-AM03" #f (-> obj root-override trans))
         )
        ((< 0.6896552 f0-2)
         (play-ambient (-> obj ambient) "MSH-AM04" #f (-> obj root-override trans))
         )
        ((< 0.6551724 f0-2)
         (play-ambient (-> obj ambient) "MSH-AM05" #f (-> obj root-override trans))
         )
        ((< 0.62068963 f0-2)
         (play-ambient (-> obj ambient) "MSH-AM06" #f (-> obj root-override trans))
         )
        ((< 0.5862069 f0-2)
         (play-ambient (-> obj ambient) "MSH-AM07" #f (-> obj root-override trans))
         )
        ((< 0.55172414 f0-2)
         (play-ambient (-> obj ambient) "MSH-AM08" #f (-> obj root-override trans))
         )
        ((< 0.51724136 f0-2)
         (play-ambient (-> obj ambient) "MSH-AM09" #f (-> obj root-override trans))
         )
        ((< 0.4827586 f0-2)
         (play-ambient (-> obj ambient) "MSH-AM10" #f (-> obj root-override trans))
         )
        ((< 0.44827586 f0-2)
         (play-ambient (-> obj ambient) "MSH-AM11" #f (-> obj root-override trans))
         )
        ((< 0.41379312 f0-2)
         (play-ambient (-> obj ambient) "MSH-AM12" #f (-> obj root-override trans))
         )
        ((< 0.37931034 f0-2)
         (play-ambient (-> obj ambient) "MSH-AM1A" #f (-> obj root-override trans))
         )
        ((< 0.3448276 f0-2)
         (play-ambient (-> obj ambient) "MSH-AM2A" #f (-> obj root-override trans))
         )
        ((< 0.31034482 f0-2)
         (play-ambient (-> obj ambient) "MSH-AM3A" #f (-> obj root-override trans))
         )
        ((< 0.27586207 f0-2)
         (play-ambient (-> obj ambient) "MTA-AM01" #f (-> obj root-override trans))
         )
        ((< 0.2413793 f0-2)
         (play-ambient (-> obj ambient) "MTA-AM02" #f (-> obj root-override trans))
         )
        ((< 0.20689656 f0-2)
         (play-ambient (-> obj ambient) "MTA-AM03" #f (-> obj root-override trans))
         )
        ((< 0.1724138 f0-2)
         (play-ambient (-> obj ambient) "MTA-AM04" #f (-> obj root-override trans))
         )
        ((< 0.13793103 f0-2)
         (play-ambient (-> obj ambient) "MTA-AM05" #f (-> obj root-override trans))
         )
        ((< 0.10344828 f0-2)
         (play-ambient (-> obj ambient) "MTA-AM06" #f (-> obj root-override trans))
         )
        ((< 0.06896552 f0-2)
         (play-ambient (-> obj ambient) "MTA-AM07" #f (-> obj root-override trans))
         )
        ((< 0.03448276 f0-2)
         (play-ambient (-> obj ambient) "MTA-AM08" #f (-> obj root-override trans))
         )
        (else
          (play-ambient (-> obj ambient) "MTA-AM09" #f (-> obj root-override trans))
          )
        )
      )
    )
  )

;; failed to figure out what this is:
(defstate idle (minershort)
  :virtual #t
  :code miners-anim-loop
  )

;; definition for method 11 of type minershort
(defmethod init-from-entity! minershort ((obj minershort) (arg0 entity-actor))
  (dummy-40 obj arg0 *minershort-sg* 34 46 (new 'static 'vector :w 4096.0) 5)
  (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 566) obj))
  (set! (-> obj tasks) (get-task-control (game-task village3-miner-money1)))
  (set! (-> obj other-miner) (the-as minertall (entity-actor-lookup arg0 'alt-actor 0)))
  (set! (-> obj cur-trans-hook) minershort-trans-hook)
  (set! (-> obj sound-flava) (music-flava miners))
  (set! (-> obj draw light-index) (the-as uint 1))
  (dummy-42 obj)
  (none)
  )

;; definition of type cavegem
(deftype cavegem (process-drawable)
  ()
  :heap-base #x40
  :method-count-assert 21
  :size-assert         #xb0
  :flag-assert         #x15004000b0
  (:methods
    (idle () _type_ :state 20)
    )
  )

;; definition for method 3 of type cavegem
(defmethod inspect cavegem ((obj cavegem))
  (let ((t9-0 (method-of-type process-drawable inspect)))
    (t9-0 obj)
    )
  obj
  )

;; failed to figure out what this is:
(defskelgroup *cavegem-sg* cavegem cavegem-lod0-jg cavegem-idle-ja
              ((cavegem-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 0 0 9)
              )

;; failed to figure out what this is:
(defstate idle (cavegem)
  :virtual #t
  :code (behavior ()
    (loop
      (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
      (until (ja-done? 0)
        (suspend)
        (ja :num! (seek!))
        )
      )
    (none)
    )
  :post (the-as (function none :behavior cavegem) ja-post)
  )

;; definition for method 11 of type cavegem
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! cavegem ((obj cavegem) (arg0 entity-actor))
  (set! (-> obj root) (new 'process 'trsqv))
  (process-drawable-from-entity! obj arg0)
  (initialize-skeleton obj *cavegem-sg* '())
  (go (method-of-object obj idle))
  (none)
  )
