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

(import "goal_src/jak1/import/pontoonfive-ag.gc")
(import "goal_src/jak1/import/allpontoons-ag.gc")
(import "goal_src/jak1/import/medres-village2-ag.gc")
(import "goal_src/jak1/import/exit-chamber-dummy-ag.gc")
(import "goal_src/jak1/import/village2cam-ag.gc")
(import "goal_src/jak1/import/fireboulder-ag.gc")
(import "goal_src/jak1/import/ogreboss-village2-ag.gc")
(import "goal_src/jak1/import/ceilingflag-ag.gc")
(import "goal_src/jak1/import/medres-rolling1-ag.gc")
(import "goal_src/jak1/import/medres-rolling-ag.gc")
(import "goal_src/jak1/import/pontoonten-ag.gc")

;; definition of type village2cam
(deftype village2cam (pov-camera)
  ((seq uint64  :offset-assert 224)
   )
  :heap-base #x80
  :method-count-assert 30
  :size-assert         #xe8
  :flag-assert         #x1e008000e8
  )

;; definition for method 3 of type village2cam
(defmethod inspect village2cam ((obj village2cam))
  (let ((t9-0 (method-of-type pov-camera inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tseq: ~D~%" (-> obj seq))
  obj
  )

;; failed to figure out what this is:
(defskelgroup *village2cam-sg* village2cam village2cam-lod0-jg -1
              ((village2cam-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 0 0 10)
              )

;; definition for method 29 of type village2cam
(defmethod set-stack-size! village2cam ((obj village2cam))
  (stack-size-set! (-> obj main-thread) 512)
  (none)
  )

;; failed to figure out what this is:
(defstate pov-camera-playing (village2cam)
  :virtual #t
  :code (behavior ()
    (let ((v1-0 (-> self seq)))
      (cond
        ((zero? v1-0)
         (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0)
         (until (ja-done? 0)
           (suspend)
           (ja :num! (seek!))
           )
         )
        ((= v1-0 1)
         (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0)
         (until (ja-done? 0)
           (suspend)
           (ja :num! (seek!))
           )
         )
        ((= v1-0 2)
         (pov-camera-play-and-reposition
           (the-as art-joint-anim (-> self draw art-group data 4))
           (new 'static 'vector :x 2199552.0 :y 40960.0 :z -6676480.0)
           1.0
           )
         )
        (else
          (suspend)
          0
          )
        )
      )
    (go-virtual pov-camera-done-playing)
    (none)
    )
  )

;; failed to figure out what this is:
(defskelgroup *med-res-rolling-sg* medres-rolling medres-rolling-lod0-jg medres-rolling-idle-ja
              ((medres-rolling-lod0-mg (meters 999999)))
              :bounds (static-spherem -520 110 70 100)
              :longest-edge (meters 0.01)
              )

;; failed to figure out what this is:
(defskelgroup *med-res-rolling1-sg* medres-rolling1 medres-rolling1-lod0-jg medres-rolling1-idle-ja
              ((medres-rolling1-lod0-mg (meters 999999)))
              :bounds (static-spherem -300 30 -20 120)
              :longest-edge (meters 0.01)
              )

;; failed to figure out what this is:
(defskelgroup *med-res-village2-sg* medres-village2 medres-village2-lod0-jg medres-village2-idle-ja
              ((medres-village2-lod0-mg (meters 999999)))
              :bounds (static-spherem -60 65 0 90)
              :longest-edge (meters 0.01)
              )

;; definition of type pontoon
(deftype pontoon (rigid-body-platform)
  ((anchor-point vector :inline :offset-assert 736)
   (task         uint8          :offset-assert 752)
   (alt-task     uint8          :offset-assert 753)
   )
  :heap-base #x290
  :method-count-assert 35
  :size-assert         #x2f2
  :flag-assert         #x23029002f2
  (:states
    pontoon-die
    pontoon-hidden
    )
  )

;; definition for method 3 of type pontoon
(defmethod inspect pontoon ((obj pontoon))
  (let ((t9-0 (method-of-type rigid-body-platform inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tanchor-point: #<vector @ #x~X>~%" (-> obj anchor-point))
  (format #t "~T~Ttask: ~D~%" (-> obj task))
  (format #t "~T~Talt-task: ~D~%" (-> obj alt-task))
  obj
  )

;; failed to figure out what this is:
(defstate pontoon-hidden (pontoon)
  :enter (behavior ()
    (logior! (-> self draw status) (draw-status hidden))
    (clear-collide-with-as (-> self root-overlay))
    (none)
    )
  :exit (behavior ()
    (logclear! (-> self draw status) (draw-status hidden))
    (restore-collide-with-as (-> self root-overlay))
    (none)
    )
  :trans (behavior ()
    (if (task-closed? (the-as game-task (-> self task)) (task-status need-resolution))
        (go-virtual rigid-body-platform-idle)
        )
    (none)
    )
  :code (behavior ()
    (loop
      (suspend)
      )
    (none)
    )
  )

;; failed to figure out what this is:
(defstate pontoon-die (pontoon)
  :code (behavior ()
    (cleanup-for-death self)
    (deactivate self)
    (none)
    )
  )

;; failed to figure out what this is:
(defstate rigid-body-platform-float (pontoon)
  :virtual #t
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (let ((v1-0 arg2))
      (the-as object (cond
                       ((= v1-0 'die)
                        (cleanup-for-death self)
                        (deactivate self)
                        )
                       (else
                         (rigid-body-platform-event-handler arg0 arg1 arg2 arg3)
                         )
                       )
              )
      )
    )
  )

;; failed to figure out what this is:
(defstate rigid-body-platform-idle (pontoon)
  :virtual #t
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (let ((v1-0 arg2))
      (the-as object (when (= v1-0 'die)
                       (cleanup-for-death self)
                       (deactivate self)
                       )
              )
      )
    )
  )

;; definition for method 11 of type pontoon
;; INFO: Return type mismatch int vs none.
(defmethod init-from-entity! pontoon ((obj pontoon) (arg0 entity-actor))
  (set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
  (TODO-RENAME-30 obj)
  (process-drawable-from-entity! obj arg0)
  (TODO-RENAME-31 obj)
  (set! (-> obj water-anim) #f)
  (set! (-> obj root-overlay pause-adjust-distance) -122880.0)
  (set! (-> obj task) (the-as uint (-> arg0 extra perm task)))
  (set! (-> obj alt-task) (res-lump-value arg0 'alt-task uint))
  (cond
    ((and (nonzero? (-> obj alt-task))
          (task-closed? (the-as game-task (-> obj alt-task)) (task-status need-resolution))
          )
     (go pontoon-die)
     )
    ((zero? (-> obj task))
     (go (method-of-object obj rigid-body-platform-idle))
     )
    ((task-closed? (the-as game-task (-> obj task)) (task-status need-resolution))
     (go (method-of-object obj rigid-body-platform-idle))
     )
    (else
      (go pontoon-hidden)
      )
    )
  0
  (none)
  )

;; definition for method 23 of type pontoon
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-23 pontoon ((obj pontoon) (arg0 float))
  ((the-as (function rigid-body-platform basic none) (find-parent-method pontoon 23)) obj (the-as basic arg0))
  (TODO-RENAME-27 obj (-> obj anchor-point))
  0
  (none)
  )

;; definition for symbol *pontoonfive-constants*, type rigid-body-platform-constants
(define *pontoonfive-constants* (new 'static 'rigid-body-platform-constants
                                  :drag-factor 4.0
                                  :buoyancy-factor 3.0
                                  :max-buoyancy-depth (meters 3)
                                  :gravity-factor 1.0
                                  :gravity (meters 80)
                                  :player-weight (meters 35)
                                  :player-bonk-factor 1.0
                                  :player-dive-factor 1.0
                                  :player-force-distance (meters 1000)
                                  :player-force-clamp (meters 1000000)
                                  :player-force-timeout (seconds 0.1)
                                  :explosion-force (meters 1000)
                                  :linear-damping 0.98
                                  :angular-damping 0.98
                                  :control-point-count 4
                                  :mass 2.0
                                  :inertial-tensor-x (meters 2.5)
                                  :inertial-tensor-y (meters 2)
                                  :inertial-tensor-z (meters 3.2)
                                  :idle-distance (meters 90)
                                  :platform #t
                                  :sound-name "pontoonten"
                                  )
        )

;; definition for symbol *pontoonten-constants*, type rigid-body-platform-constants
(define *pontoonten-constants* (new 'static 'rigid-body-platform-constants
                                 :drag-factor 4.0
                                 :buoyancy-factor 3.0
                                 :max-buoyancy-depth (meters 3)
                                 :gravity-factor 1.0
                                 :gravity (meters 80)
                                 :player-weight (meters 35)
                                 :player-bonk-factor 1.0
                                 :player-dive-factor 1.0
                                 :player-force-distance (meters 1000)
                                 :player-force-clamp (meters 1000000)
                                 :player-force-timeout (seconds 0.1)
                                 :explosion-force (meters 1000)
                                 :linear-damping 0.98
                                 :angular-damping 0.95
                                 :control-point-count 4
                                 :mass 4.0
                                 :inertial-tensor-x (meters 5)
                                 :inertial-tensor-y (meters 2)
                                 :inertial-tensor-z (meters 3.2)
                                 :idle-distance (meters 90)
                                 :platform #t
                                 :sound-name "pontoonten"
                                 )
        )

;; definition of type pontoonfive
(deftype pontoonfive (pontoon)
  ()
  :heap-base #x290
  :method-count-assert 35
  :size-assert         #x2f2
  :flag-assert         #x23029002f2
  )

;; definition for method 3 of type pontoonfive
(defmethod inspect pontoonfive ((obj pontoonfive))
  (let ((t9-0 (method-of-type pontoon inspect)))
    (t9-0 obj)
    )
  obj
  )

;; definition of type pontoonten
(deftype pontoonten (pontoon)
  ()
  :heap-base #x290
  :method-count-assert 35
  :size-assert         #x2f2
  :flag-assert         #x23029002f2
  )

;; definition for method 3 of type pontoonten
(defmethod inspect pontoonten ((obj pontoonten))
  (let ((t9-0 (method-of-type pontoon inspect)))
    (t9-0 obj)
    )
  obj
  )

;; failed to figure out what this is:
(defskelgroup *pontoonfive-sg* pontoonfive pontoonfive-lod0-jg pontoonfive-idle-ja
              ((pontoonfive-lod0-mg (meters 20)) (pontoonfive-lod1-mg (meters 40)) (pontoonfive-lod2-mg (meters 999999)))
              :bounds (static-spherem 0 0 0 5)
              :longest-edge (meters 3.5)
              )

;; failed to figure out what this is:
(defskelgroup *pontoonten-sg* pontoonten pontoonten-lod0-jg pontoonten-idle-ja
              ((pontoonten-lod0-mg (meters 20)) (pontoonten-lod1-mg (meters 40)) (pontoonten-lod2-mg (meters 999999)))
              :bounds (static-spherem 0 0 0 7)
              :longest-edge (meters 4)
              )

;; definition for method 30 of type pontoonfive
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-30 pontoonfive ((obj pontoonfive))
  (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)
          )
    (alloc-riders s5-0 1)
    (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 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 ca-1))
      (set! (-> s4-0 prim-core offense) (collide-offense indestructible))
      (set! (-> s4-0 transform-index) 0)
      (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 18432.0)
      (set-root-prim! s5-0 s4-0)
      )
    (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
    (backup-collide-with-as s5-0)
    (set! (-> obj root-overlay) s5-0)
    )
  0
  (none)
  )

;; definition for method 31 of type pontoonfive
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defmethod TODO-RENAME-31 pontoonfive ((obj pontoonfive))
  (initialize-skeleton obj *pontoonfive-sg* '())
  (TODO-RENAME-29 obj *pontoonfive-constants*)
  (set! (-> obj float-height-offset) 6144.0)
  (set! (-> obj root-overlay nav-radius) 12288.0)
  (let ((v1-6 (-> obj control-point-array data)))
    (set! (-> v1-6 0 local-pos x) 9216.0)
    (set! (-> v1-6 0 local-pos y) 0.0)
    (set! (-> v1-6 0 local-pos z) 12083.2)
    (set! (-> v1-6 0 local-pos w) 1.0)
    )
  (let ((v1-8 (-> obj control-point-array data 1)))
    (set! (-> v1-8 local-pos x) 9216.0)
    (set! (-> v1-8 local-pos y) 0.0)
    (set! (-> v1-8 local-pos z) -12083.2)
    (set! (-> v1-8 local-pos w) 1.0)
    )
  (let ((v1-10 (-> obj control-point-array data 2)))
    (set! (-> v1-10 local-pos x) -9216.0)
    (set! (-> v1-10 local-pos y) 0.0)
    (set! (-> v1-10 local-pos z) -12083.2)
    (set! (-> v1-10 local-pos w) 1.0)
    )
  (let ((v1-12 (-> obj control-point-array data 3)))
    (set! (-> v1-12 local-pos x) -9216.0)
    (set! (-> v1-12 local-pos y) 0.0)
    (set! (-> v1-12 local-pos z) 12083.2)
    (set! (-> v1-12 local-pos w) 1.0)
    )
  (set! (-> obj anchor-point quad) (-> obj root-overlay trans quad))
  (nav-mesh-connect obj (-> obj root-overlay) (the-as nav-control #f))
  0
  (none)
  )

;; definition for method 30 of type pontoonten
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-30 pontoonten ((obj pontoonten))
  (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)
          )
    (alloc-riders s5-0 1)
    (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 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 ca-1))
      (set! (-> s4-0 prim-core offense) (collide-offense indestructible))
      (set! (-> s4-0 transform-index) 0)
      (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 25395.2)
      (set-root-prim! s5-0 s4-0)
      )
    (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
    (backup-collide-with-as s5-0)
    (set! (-> obj root-overlay) s5-0)
    )
  0
  (none)
  )

;; definition for method 31 of type pontoonten
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defmethod TODO-RENAME-31 pontoonten ((obj pontoonten))
  (initialize-skeleton obj *pontoonten-sg* '())
  (TODO-RENAME-29 obj *pontoonten-constants*)
  (set! (-> obj float-height-offset) 6144.0)
  (set! (-> obj root-overlay nav-radius) 20480.0)
  (let ((v1-6 (-> obj control-point-array data)))
    (set! (-> v1-6 0 local-pos x) 17408.0)
    (set! (-> v1-6 0 local-pos y) 0.0)
    (set! (-> v1-6 0 local-pos z) 10035.2)
    (set! (-> v1-6 0 local-pos w) 1.0)
    )
  (let ((v1-8 (-> obj control-point-array data 1)))
    (set! (-> v1-8 local-pos x) 17408.0)
    (set! (-> v1-8 local-pos y) 0.0)
    (set! (-> v1-8 local-pos z) -10035.2)
    (set! (-> v1-8 local-pos w) 1.0)
    )
  (let ((v1-10 (-> obj control-point-array data 2)))
    (set! (-> v1-10 local-pos x) -17408.0)
    (set! (-> v1-10 local-pos y) 0.0)
    (set! (-> v1-10 local-pos z) -10035.2)
    (set! (-> v1-10 local-pos w) 1.0)
    )
  (let ((v1-12 (-> obj control-point-array data 3)))
    (set! (-> v1-12 local-pos x) -17408.0)
    (set! (-> v1-12 local-pos y) 0.0)
    (set! (-> v1-12 local-pos z) 10035.2)
    (set! (-> v1-12 local-pos w) 1.0)
    )
  (set! (-> obj anchor-point quad) (-> obj root-overlay trans quad))
  (nav-mesh-connect obj (-> obj root-overlay) (the-as nav-control #f))
  0
  (none)
  )

;; failed to figure out what this is:
(defpartgroup group-allpontoons-trail
  :id 563
  :flags (use-local-clock)
  :bounds (static-bspherem 0 0 0 8)
  :parts ((sp-item 2841 :flags (is-3d) :period 900 :length 5) (sp-item 2842 :flags (is-3d) :period 900 :length 5))
  )

;; failed to figure out what this is:
(defpart 2841
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2))
    (sp-flt spt-num 8.0)
    (sp-rnd-flt spt-x (meters 0) (meters 9) 1.0)
    (sp-flt spt-y (meters 0.1))
    (sp-rnd-flt spt-scale-x (meters 0.2) (meters 2) 1.0)
    (sp-rnd-flt spt-rot-y (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 64.0 1.0)
    (sp-rnd-flt spt-b 128.0 64.0 1.0)
    (sp-flt spt-a 0.0)
    (sp-rnd-flt spt-scalevel-x (meters 0.01) (meters 0.001) 1.0)
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-flt spt-fade-a 3.2)
    (sp-int spt-timer 1500)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    (sp-int-plain-rnd spt-next-time 10 29 1)
    (sp-launcher-by-id spt-next-launcher 2843)
    (sp-rnd-flt spt-conerot-x (degrees 70.0) (degrees 20.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0)
    )
  )

;; failed to figure out what this is:
(defpart 2843
  :init-specs ((sp-flt spt-fade-a -0.094814815))
  )

;; failed to figure out what this is:
(defpart 2842
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2))
    (sp-flt spt-num 8.0)
    (sp-rnd-flt spt-x (meters 8) (meters 8) 1.0)
    (sp-flt spt-y (meters 0.1))
    (sp-rnd-flt spt-scale-x (meters 0.2) (meters 2) 1.0)
    (sp-rnd-flt spt-rot-y (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 64.0 1.0)
    (sp-rnd-flt spt-b 128.0 64.0 1.0)
    (sp-flt spt-a 0.0)
    (sp-rnd-flt spt-scalevel-x (meters 0.006666667) (meters 0.001) 1.0)
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-flt spt-fade-a 3.2)
    (sp-int spt-timer 1500)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    (sp-int-plain-rnd spt-next-time 10 29 1)
    (sp-launcher-by-id spt-next-launcher 2843)
    (sp-rnd-flt spt-conerot-x (degrees 70.0) (degrees 20.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0)
    )
  )

;; definition of type allpontoons
(deftype allpontoons (process-drawable)
  ((task uint8  :offset-assert 176)
   )
  :heap-base #x50
  :method-count-assert 20
  :size-assert         #xb1
  :flag-assert         #x14005000b1
  (:states
    (allpontoons-be-clone handle)
    allpontoons-idle
    )
  )

;; definition for method 3 of type allpontoons
(defmethod inspect allpontoons ((obj allpontoons))
  (let ((t9-0 (method-of-type process-drawable inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Ttask: ~D~%" (-> obj task))
  obj
  )

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

;; failed to figure out what this is:
(defstate allpontoons-be-clone (allpontoons)
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (let ((v1-0 arg2))
      (the-as object (when (= v1-0 'end-mode)
                       (cleanup-for-death self)
                       (deactivate self)
                       )
              )
      )
    )
  :enter (behavior ((arg0 handle))
    (logclear! (-> self draw status) (draw-status hidden))
    (logclear! (-> self mask) (process-mask actor-pause))
    (none)
    )
  :exit (behavior ()
    (logior! (-> self mask) (process-mask actor-pause))
    (none)
    )
  :trans (behavior ()
    (when (>= (ja-aframe-num 0) 500.0)
      (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 3)))
      (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4)))
      (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 5)))
      (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 6)))
      (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 7)))
      (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 9)))
      )
    (none)
    )
  :code (behavior ((arg0 handle))
    (clone-anim arg0 3 #t "")
    (cleanup-for-death self)
    (deactivate self)
    (none)
    )
  )

;; failed to figure out what this is:
(defstate allpontoons-idle (allpontoons)
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (case arg2
      (('clone)
       (go allpontoons-be-clone (the-as handle (-> arg3 param 0)))
       )
      )
    )
  :enter (behavior ()
    (logior! (-> self draw status) (draw-status hidden))
    (none)
    )
  :code (behavior ()
    (loop
      (when (and (nonzero? (-> self task)) (task-closed? (the-as game-task (-> self task)) (task-status need-resolution)))
        (cleanup-for-death self)
        (deactivate self)
        )
      (logior! (-> self mask) (process-mask sleep))
      (suspend)
      )
    (none)
    )
  )

;; definition for method 11 of type allpontoons
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! allpontoons ((obj allpontoons) (arg0 entity-actor))
  (set! (-> obj root) (new 'process 'trsqv))
  (process-drawable-from-entity! obj arg0)
  (initialize-skeleton obj *allpontoons-sg* '())
  (set! (-> obj task) (the-as uint (-> arg0 extra perm task)))
  (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 563) obj))
  (go allpontoons-idle)
  (none)
  )

;; definition of type fireboulder
(deftype fireboulder (process-drawable)
  ((root-override collide-shape  :offset        112)
   (tracker       handle         :offset-assert 176)
   (task          uint8          :offset-assert 184)
   )
  :heap-base #x50
  :method-count-assert 20
  :size-assert         #xb9
  :flag-assert         #x14005000b9
  (:states
    (fireboulder-be-clone handle)
    fireboulder-hover
    fireboulder-idle
    )
  )

;; definition for method 3 of type fireboulder
(defmethod inspect fireboulder ((obj fireboulder))
  (let ((t9-0 (method-of-type process-drawable inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Ttracker: ~D~%" (-> obj tracker))
  (format #t "~T~Ttask: ~D~%" (-> obj task))
  obj
  )

;; failed to figure out what this is:
(defskelgroup *fireboulder-sg* fireboulder fireboulder-lod0-jg fireboulder-idle-ja
              ((fireboulder-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 3.5 0 6)
              :longest-edge (meters 3.5)
              )

;; definition for function fireboulder-disable-blocking-collision
;; INFO: Return type mismatch int vs none.
(defbehavior fireboulder-disable-blocking-collision fireboulder ()
  (let ((v1-1 (-> self root-override root-prim)))
    (dotimes (a0-0 (-> (the-as collide-shape-prim-group v1-1) num-prims))
      (let ((a1-2 (-> (the-as collide-shape-prim-group v1-1) prims a0-0)))
        (when (= (-> a1-2 prim-id) 256)
          (set! (-> a1-2 prim-core collide-as) (collide-kind))
          (set! (-> a1-2 collide-with) (collide-kind))
          0
          )
        )
      )
    (set! (-> v1-1 local-sphere x) 0.0)
    (set! (-> v1-1 local-sphere w) 24576.0)
    )
  0
  (none)
  )

;; definition for function fireboulder-hover-stuff
;; Used lq/sq
(defbehavior fireboulder-hover-stuff fireboulder ()
  (local-vars (v0-1 object))
  (let ((gp-0 (new 'stack-no-clear 'vector)))
    (vector<-cspace! gp-0 (-> self node-list data 4))
    (cond
      ((handle->process (-> self tracker))
       (let ((v1-6 (-> (the-as (pointer part-tracker) (-> self tracker process)) 0)))
         (set! (-> v1-6 start-time) (-> *display* base-frame-counter))
         (set! v0-1 (-> v1-6 root trans))
         )
       (set! (-> (the-as vector v0-1) quad) (-> gp-0 quad))
       )
      (else
        (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000)))
          (set! v0-1 (ppointer->handle
                       (when gp-1
                         (let ((t9-2 (method-of-type part-tracker activate)))
                           (t9-2 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000))
                           )
                         (run-now-in-process
                           gp-1
                           part-tracker-init
                           (-> *part-group-id-table* 678)
                           -1
                           #f
                           #f
                           #f
                           (-> self root-override trans)
                           )
                         (-> gp-1 ppointer)
                         )
                       )
                )
          )
        (set! (-> self tracker) (the-as handle v0-1))
        )
      )
    )
  v0-1
  )

;; failed to figure out what this is:
(defstate fireboulder-hover (fireboulder)
  :enter (behavior ()
    (fireboulder-disable-blocking-collision)
    (ja-channel-set! 1)
    (ja :group! (-> self draw art-group data 3))
    (logclear! (-> self draw status) (draw-status hidden))
    (set! (-> self root-override trans quad) (-> self entity extra trans quad))
    (vector-reset! (-> self draw origin))
    (logior! (-> self skel status) (janim-status inited))
    (ja-post)
    (logclear! (-> self skel status) (janim-status inited))
    (let ((gp-0 (new 'stack-no-clear 'vector)))
      (vector<-cspace! gp-0 (-> self node-list data 4))
      (vector-! (-> self draw bounds) gp-0 (-> self root-override trans))
      )
    (set! (-> self draw bounds w) 24576.0)
    (none)
    )
  :exit (behavior ()
    (stop! (-> self sound))
    (none)
    )
  :trans (behavior ()
    (fireboulder-hover-stuff)
    (update! (-> self sound))
    (none)
    )
  :code (behavior ()
    (loop
      (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
      (until (ja-done? 0)
        (quaternion-rotate-y!
          (-> self root-override quat)
          (-> self root-override quat)
          (* 455.1111 (-> *display* time-adjust-ratio))
          )
        (suspend)
        (ja :num! (seek!))
        )
      )
    (none)
    )
  :post (the-as (function none :behavior fireboulder) transform-post)
  )

;; failed to figure out what this is:
(defstate fireboulder-be-clone (fireboulder)
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (case arg2
      (('stop-cloning)
       (go fireboulder-hover)
       )
      )
    )
  :enter (behavior ((arg0 handle))
    (logclear! (-> self mask) (process-mask actor-pause))
    (none)
    )
  :exit (behavior ()
    (logior! (-> self mask) (process-mask actor-pause))
    (logclear! (-> self skel status) (janim-status spool))
    (none)
    )
  :trans (the-as (function none :behavior fireboulder) fireboulder-hover-stuff)
  :code (behavior ((arg0 handle))
    (clone-anim arg0 3 #t "")
    (format 0 "ERROR<GMJ>: fireboulder-be-clone ended~%")
    (cleanup-for-death self)
    (deactivate self)
    (none)
    )
  )

;; failed to figure out what this is:
(defstate fireboulder-idle (fireboulder)
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (case arg2
      (('clone)
       (go fireboulder-be-clone (the-as handle (-> arg3 param 0)))
       )
      )
    )
  :exit (behavior ()
    (let ((a0-1 (handle->process (-> self tracker))))
      (if a0-1
          (deactivate a0-1)
          )
      )
    (none)
    )
  :code (behavior ()
    (transform-post)
    (loop
      (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
      (until (ja-done? 0)
        (cond
          ((zero? (-> self task))
           )
          ((handle->process (-> self tracker))
           (set! (-> (the-as (pointer part-tracker) (-> self tracker process)) 0 start-time)
                 (-> *display* base-frame-counter)
                 )
           )
          (else
            (set! (-> self tracker) (ppointer->handle (process-spawn
                                                        part-tracker
                                                        :init part-tracker-init
                                                        (-> *part-group-id-table* 271)
                                                        -1
                                                        #f
                                                        #f
                                                        #f
                                                        (-> self root-override trans)
                                                        :to *entity-pool*
                                                        )
                                                      )
                  )
            )
          )
        (suspend)
        (ja :num! (seek!))
        )
      )
    (none)
    )
  :post (the-as (function none :behavior fireboulder) ja-post)
  )

;; definition for method 11 of type fireboulder
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! fireboulder ((obj fireboulder) (arg0 entity-actor))
  (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others))))
    (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0)))
      (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object))
      (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) -24576.0 18432.0 0.0 49152.0)
      (set-root-prim! s4-0 s3-0)
      (let ((s2-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
        (set! (-> s2-0 prim-core collide-as) (collide-kind wall-object))
        (set! (-> s2-0 collide-with) (collide-kind target))
        (set! (-> s2-0 prim-core action) (collide-action solid))
        (set! (-> s2-0 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-0 transform-index) 4)
        (set-vector! (-> s2-0 local-sphere) 0.0 0.0 0.0 24576.0)
        (append-prim s3-0 s2-0)
        )
      (let ((s2-1 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 256))))
        (set! (-> s2-1 prim-core collide-as) (collide-kind wall-object))
        (set! (-> s2-1 collide-with) (collide-kind target))
        (set! (-> s2-1 prim-core action) (collide-action solid))
        (set! (-> s2-1 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-1 transform-index) 4)
        (set-vector! (-> s2-1 local-sphere) 0.0 0.0 -24576.0 49152.0)
        (append-prim s3-0 s2-1)
        )
      )
    (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
    (backup-collide-with-as s4-0)
    (set! (-> obj root-override) s4-0)
    )
  (process-drawable-from-entity! obj arg0)
  (cond
    ((name= (-> obj name) "fireboulder-6")
     (quaternion-axis-angle! (-> obj root-override quat) 0.0 1.0 0.0 16384.0)
     (set! (-> obj sound)
           (new 'process 'ambient-sound (static-sound-spec "rock-hover" :fo-max 30) (-> obj root-override trans))
           )
     )
    (else
      (fireboulder-disable-blocking-collision)
      )
    )
  (initialize-skeleton obj *fireboulder-sg* '())
  (set! (-> obj tracker) (the-as handle #f))
  (set-vector! (-> obj draw color-emissive) 0.125 0.0625 0.0 0.0)
  (set! (-> obj task) (the-as uint (-> arg0 extra perm task)))
  (cond
    ((zero? (-> obj task))
     (go fireboulder-idle)
     )
    ((= (get-task-status (-> arg0 extra perm task)) (task-status invalid))
     (go fireboulder-hover)
     )
    (else
      (go fireboulder-idle)
      )
    )
  (none)
  )

;; definition of type ceilingflag
(deftype ceilingflag (process-drawable)
  ()
  :heap-base #x40
  :method-count-assert 20
  :size-assert         #xb0
  :flag-assert         #x14004000b0
  (:states
    ceilingflag-idle
    )
  )

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

;; failed to figure out what this is:
(defskelgroup *ceilingflag-sg* ceilingflag ceilingflag-geo-jg ceilingflag-idle-ja
              ((ceilingflag-geo-mg (meters 999999)))
              :bounds (static-spherem 0 -4 0 7)
              )

;; failed to figure out what this is:
(defstate ceilingflag-idle (ceilingflag)
  :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 ceilingflag) ja-post)
  )

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

;; definition of type exit-chamber-dummy
(deftype exit-chamber-dummy (process-drawable)
  ((orig-trans   vector :inline :offset-assert 176)
   (fcell-handle handle         :offset-assert 192)
   )
  :heap-base #x60
  :method-count-assert 21
  :size-assert         #xc8
  :flag-assert         #x15006000c8
  (:methods
    (skip-reminder? (_type_) symbol 20)
    )
  (:states
    exit-chamber-dummy-idle
    exit-chamber-dummy-wait-to-appear
    )
  )

;; definition for method 3 of type exit-chamber-dummy
(defmethod inspect exit-chamber-dummy ((obj exit-chamber-dummy))
  (let ((t9-0 (method-of-type process-drawable inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Torig-trans: #<vector @ #x~X>~%" (-> obj orig-trans))
  (format #t "~T~Tfcell-handle: ~D~%" (-> obj fcell-handle))
  obj
  )

;; failed to figure out what this is:
(defskelgroup *exit-chamber-dummy-sg* exit-chamber-dummy exit-chamber-dummy-lod0-jg -1
              ((exit-chamber-dummy-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 5 0 15)
              )

;; definition for method 20 of type exit-chamber-dummy
(defmethod skip-reminder? exit-chamber-dummy ((obj exit-chamber-dummy))
  (case (get-reminder (get-task-control (game-task sunken-room)) 0)
    ((2)
     (let ((v1-4 (level-get *level* 'sunken)))
       (if (or (not v1-4) (!= (-> v1-4 status) 'active))
           (return #t)
           )
       )
     )
    )
  #f
  )

;; failed to figure out what this is:
(defstate exit-chamber-dummy-wait-to-appear (exit-chamber-dummy)
  :code (behavior ()
    (logior! (-> self draw status) (draw-status hidden))
    (while (not (skip-reminder? self))
      (suspend)
      )
    (when (and (not (task-complete? *game-info* (game-task sunken-room))) (not (-> self child)))
      (let ((a0-3 (new 'stack-no-clear 'vector)))
        (set! (-> a0-3 quad) (-> self root trans quad))
        (set! (-> a0-3 y) (+ 67584.0 (-> a0-3 y)))
        (let ((v1-12 (birth-pickup-at-point a0-3 (pickup-type fuel-cell) 47.0 #f self (the-as fact-info #f))))
          (set! (-> self fcell-handle) (ppointer->handle v1-12))
          (send-event (ppointer->process v1-12) 'collide-shape #f)
          )
        )
      )
    (go exit-chamber-dummy-idle)
    (none)
    )
  )

;; failed to figure out what this is:
(defstate exit-chamber-dummy-idle (exit-chamber-dummy)
  :code (behavior ()
    (logclear! (-> self draw status) (draw-status hidden))
    (let ((gp-0 0))
      (while (< gp-0 2)
        (if (skip-reminder? self)
            (set! gp-0 0)
            (+! gp-0 1)
            )
        (set! (-> self root trans y)
              (+ (-> self orig-trans y)
                 (* 2252.8 (cos (* 36.40889 (the float (mod (-> *display* base-frame-counter) 1800)))))
                 )
              )
        (let ((a0-7 (handle->process (-> self fcell-handle))))
          (when a0-7
            (let ((v1-14 (new 'stack-no-clear 'vector)))
              (set! (-> v1-14 quad) (-> self root trans quad))
              (set! (-> v1-14 y) (+ 67584.0 (-> v1-14 y)))
              (send-event a0-7 'trans v1-14)
              )
            )
          )
        (suspend)
        )
      )
    (let ((a0-11 (handle->process (-> self fcell-handle))))
      (if a0-11
          (deactivate a0-11)
          )
      )
    (go exit-chamber-dummy-wait-to-appear)
    (none)
    )
  :post (the-as (function none :behavior exit-chamber-dummy) ja-post)
  )

;; definition for method 11 of type exit-chamber-dummy
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defmethod init-from-entity! exit-chamber-dummy ((obj exit-chamber-dummy) (arg0 entity-actor))
  (set! (-> obj fcell-handle) (the-as handle #f))
  (set! (-> obj root) (new 'process 'trsqv))
  (process-drawable-from-entity! obj arg0)
  (logclear! (-> obj mask) (process-mask actor-pause))
  (set! (-> obj root trans y) (+ 24576.0 (-> obj root trans y)))
  (set! (-> obj orig-trans quad) (-> obj root trans quad))
  (initialize-skeleton obj *exit-chamber-dummy-sg* '())
  (ja-channel-set! 1)
  (let ((s5-1 (-> obj skel root-channel 0)))
    (joint-control-channel-group-eval!
      s5-1
      (the-as art-joint-anim (-> obj draw art-group data 2))
      num-func-identity
      )
    (set! (-> s5-1 frame-num) 0.0)
    )
  (logior! (-> obj draw status) (draw-status hidden))
  (go exit-chamber-dummy-wait-to-appear)
  (none)
  )

;; definition of type ogreboss-village2
(deftype ogreboss-village2 (process-drawable)
  ((boulder handle  :offset-assert 176)
   )
  :heap-base #x50
  :method-count-assert 20
  :size-assert         #xb8
  :flag-assert         #x14005000b8
  (:states
    ogreboss-village2-idle
    ogreboss-village2-throw
    )
  )

;; definition for method 3 of type ogreboss-village2
(defmethod inspect ogreboss-village2 ((obj ogreboss-village2))
  (let ((t9-0 (method-of-type process-drawable inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tboulder: ~D~%" (-> obj boulder))
  obj
  )

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

;; failed to figure out what this is:
(defpartgroup group-ogreboulder-trail
  :id 564
  :flags (use-local-clock)
  :bounds (static-bspherem 0 0 0 8)
  :parts ((sp-item 2319 :fade-after (meters 200) :falloff-to (meters 200))
    (sp-item 2320 :fade-after (meters 200) :falloff-to (meters 200))
    )
  )

;; failed to figure out what this is:
(defpart 2320
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
    (sp-flt spt-num 0.5)
    (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0)
    (sp-rnd-flt spt-y (meters -1) (meters 2) 1.0)
    (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0)
    (sp-rnd-flt spt-scale-x (meters 8) (meters 4) 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-flt spt-r 128.0)
    (sp-flt spt-g 96.0)
    (sp-flt spt-b 32.0)
    (sp-rnd-flt spt-a 48.0 48.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0.0016666667) (meters 0.00083333335) 1.0)
    (sp-flt spt-scalevel-x (meters 0.04))
    (sp-rnd-flt spt-rotvel-z (degrees -1.9999999) (degrees 3.9999998) 1.0)
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-flt spt-fade-r -0.21333334)
    (sp-flt spt-fade-g -0.10666667)
    (sp-flt spt-fade-b 0.10666667)
    (sp-flt spt-fade-a -0.32)
    (sp-flt spt-accel-y -0.027306668)
    (sp-int spt-timer 300)
    (sp-cpuinfo-flags bit2 bit14)
    )
  )

;; failed to figure out what this is:
(defpart 2319
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
    (sp-flt spt-num 0.5)
    (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0)
    (sp-rnd-flt spt-y (meters -1) (meters 2) 1.0)
    (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0)
    (sp-rnd-flt spt-scale-x (meters 8) (meters 4) 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-flt spt-r 128.0)
    (sp-flt spt-g 96.0)
    (sp-flt spt-b 32.0)
    (sp-rnd-flt spt-a 80.0 80.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0.0016666667) (meters 0.00083333335) 1.0)
    (sp-flt spt-scalevel-x (meters 0.04))
    (sp-rnd-flt spt-rotvel-z (degrees -1.9999999) (degrees 3.9999998) 1.0)
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-flt spt-fade-g -0.53333336)
    (sp-flt spt-fade-b -0.17777778)
    (sp-flt spt-fade-a -1.0666667)
    (sp-flt spt-accel-y -0.027306668)
    (sp-int spt-timer 180)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    )
  )

;; failed to figure out what this is:
(defpartgroup group-ogreboulder-hit-wall
  :id 551
  :duration 900
  :flags (use-local-clock)
  :bounds (static-bspherem 0 0 0 64)
  :parts ((sp-item 2287 :period 900 :length 40))
  )

;; failed to figure out what this is:
(defpart 2287
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
    (sp-flt spt-num 12.0)
    (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0)
    (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.1) 1.0)
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 180.0) 1.0)
    (sp-rnd-flt spt-scale-y (meters 10) (meters 6) 1.0)
    (sp-rnd-flt spt-r 196.0 64.0 1.0)
    (sp-rnd-flt spt-g 128.0 64.0 1.0)
    (sp-rnd-flt spt-b 128.0 64.0 1.0)
    (sp-rnd-flt spt-a 32.0 64.0 1.0)
    (sp-flt spt-scalevel-y (meters 1.4))
    (sp-flt spt-fade-a -3.2)
    (sp-int spt-timer 30)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    )
  )

;; failed to figure out what this is:
(defpartgroup group-ogreboulder-splash
  :id 552
  :duration 900
  :flags (use-local-clock)
  :bounds (static-bspherem 0 0 0 64)
  :parts ((sp-item 2288 :period 900 :length 20)
    (sp-item 2321 :flags (is-3d) :period 900 :length 10)
    (sp-item 2322 :flags (is-3d) :period 900 :length 10)
    )
  )

;; failed to figure out what this is:
(defpart 2321
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2))
    (sp-flt spt-num 8.0)
    (sp-rnd-flt spt-x (meters 0) (meters 9) 1.0)
    (sp-rnd-flt spt-scale-x (meters 16) (meters 8) 1.0)
    (sp-rnd-flt spt-rot-y (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 64.0 1.0)
    (sp-rnd-flt spt-b 128.0 64.0 1.0)
    (sp-flt spt-a 0.0)
    (sp-rnd-flt spt-scalevel-x (meters 0.026666667) (meters 0.026666667) 1.0)
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-flt spt-fade-a 3.2)
    (sp-int spt-timer 1500)
    (sp-cpuinfo-flags bit2 bit14)
    (sp-int-plain-rnd spt-next-time 10 29 1)
    (sp-launcher-by-id spt-next-launcher 2323)
    (sp-rnd-flt spt-conerot-x (degrees 70.0) (degrees 20.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0)
    )
  )

;; failed to figure out what this is:
(defpart 2323
  :init-specs ((sp-flt spt-fade-a -0.094814815))
  )

;; failed to figure out what this is:
(defpart 2322
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2))
    (sp-flt spt-num 8.0)
    (sp-rnd-flt spt-x (meters 8) (meters 8) 1.0)
    (sp-rnd-flt spt-scale-x (meters 4.5) (meters 3.5) 1.0)
    (sp-rnd-flt spt-rot-y (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 64.0 1.0)
    (sp-rnd-flt spt-b 128.0 64.0 1.0)
    (sp-flt spt-a 0.0)
    (sp-rnd-flt spt-scalevel-x (meters 0.02) (meters 0.013333334) 1.0)
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-flt spt-fade-a 3.2)
    (sp-int spt-timer 1500)
    (sp-cpuinfo-flags bit2 bit14)
    (sp-int-plain-rnd spt-next-time 10 29 1)
    (sp-launcher-by-id spt-next-launcher 2323)
    (sp-rnd-flt spt-conerot-x (degrees 70.0) (degrees 20.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0)
    )
  )

;; failed to figure out what this is:
(defpart 2288
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
    (sp-flt spt-num 16.0)
    (sp-rnd-flt spt-y (meters 0) (meters 1) 1.0)
    (sp-rnd-flt spt-scale-x (meters 12) (meters 6) 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-flt spt-r 50.0)
    (sp-rnd-flt spt-g 80.0 64.0 1.0)
    (sp-flt spt-b 200.0)
    (sp-rnd-flt spt-a 48.0 48.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0.10666667) (meters 0.10666667) 1.0)
    (sp-flt spt-scalevel-x (meters 0.026666667))
    (sp-rnd-flt spt-rotvel-z (degrees -0.6) (degrees 1.2) 1.0)
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-flt spt-fade-a -0.16)
    (sp-rnd-flt spt-accel-y 2.048 2.048 1.0)
    (sp-flt spt-friction 0.85)
    (sp-int spt-timer 660)
    (sp-cpuinfo-flags bit2 bit14)
    (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 90.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 8) 1.0)
    )
  )

;; definition for function ogreboss-village2-trans
(defbehavior ogreboss-village2-trans ogreboss-village2 ()
  (when (= (get-task-status (game-task village2-levitator)) (task-status invalid))
    (cleanup-for-death self)
    (deactivate self)
    )
  (none)
  )

;; definition for function boulder1-trans
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defbehavior boulder1-trans fireboulder ()
  (spawn (-> self part) (-> self draw origin))
  (when (>= (ja-aframe-num 0) 82.0)
    (let ((gp-0 (new 'stack-no-clear 'vector)))
      (set! (-> gp-0 quad) (-> self draw origin quad))
      (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y)))
      (sound-play "boulder-splash")
      (process-spawn
        part-tracker
        :init part-tracker-init
        (-> *part-group-id-table* 552)
        -1
        #f
        #f
        #f
        gp-0
        :to *entity-pool*
        )
      )
    (send-event self 'trans-hook nothing)
    )
  0
  (none)
  )

;; definition for function boulder2-trans-2
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defbehavior boulder2-trans-2 fireboulder ()
  (spawn (-> self part) (-> self draw origin))
  (when (>= (ja-aframe-num 0) 120.0)
    (let ((gp-0 (new 'stack-no-clear 'vector)))
      (set! (-> gp-0 quad) (-> self draw origin quad))
      (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y)))
      (sound-play "boulder-splash")
      (process-spawn
        part-tracker
        :init part-tracker-init
        (-> *part-group-id-table* 552)
        -1
        #f
        #f
        #f
        gp-0
        :to *entity-pool*
        )
      )
    (send-event self 'trans-hook nothing)
    )
  0
  (none)
  )

;; definition for function boulder2-trans
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defbehavior boulder2-trans fireboulder ()
  (spawn (-> self part) (-> self draw origin))
  (when (>= (ja-aframe-num 0) 82.0)
    (let ((gp-0 (new 'stack-no-clear 'vector)))
      (set! (-> gp-0 quad) (-> self draw origin quad))
      (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y)))
      (sound-play "v2ogre-boulder")
      (process-spawn
        part-tracker
        :init part-tracker-init
        (-> *part-group-id-table* 551)
        -1
        #f
        #f
        #f
        gp-0
        :to *entity-pool*
        )
      )
    (send-event self 'trans-hook boulder2-trans-2)
    )
  0
  (none)
  )

;; definition for function boulder3-trans-2
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defbehavior boulder3-trans-2 fireboulder ()
  (spawn (-> self part) (-> self draw origin))
  (when (>= (ja-aframe-num 0) 131.0)
    (let ((gp-0 (new 'stack-no-clear 'vector)))
      (set! (-> gp-0 quad) (-> self draw origin quad))
      (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y)))
      (sound-play "boulder-splash")
      (process-spawn
        part-tracker
        :init part-tracker-init
        (-> *part-group-id-table* 552)
        -1
        #f
        #f
        #f
        gp-0
        :to *entity-pool*
        )
      )
    (send-event self 'trans-hook nothing)
    )
  0
  (none)
  )

;; definition for function boulder3-trans
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defbehavior boulder3-trans fireboulder ()
  (spawn (-> self part) (-> self draw origin))
  (when (>= (ja-aframe-num 0) 80.0)
    (let ((gp-0 (new 'stack-no-clear 'vector)))
      (set! (-> gp-0 quad) (-> self draw origin quad))
      (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y)))
      (sound-play "v2ogre-boulder")
      (process-spawn
        part-tracker
        :init part-tracker-init
        (-> *part-group-id-table* 551)
        -1
        #f
        #f
        #f
        gp-0
        :to *entity-pool*
        )
      )
    (send-event self 'trans-hook boulder3-trans-2)
    )
  0
  (none)
  )

;; definition for function boulder4-trans-3
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defbehavior boulder4-trans-3 fireboulder ()
  (spawn (-> self part) (-> self draw origin))
  (when (>= (ja-aframe-num 0) 152.4)
    (let ((gp-0 (new 'stack-no-clear 'vector)))
      (set! (-> gp-0 quad) (-> self draw origin quad))
      (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y)))
      (sound-play "boulder-splash")
      (process-spawn
        part-tracker
        :init part-tracker-init
        (-> *part-group-id-table* 552)
        -1
        #f
        #f
        #f
        gp-0
        :to *entity-pool*
        )
      )
    (send-event self 'trans-hook nothing)
    )
  0
  (none)
  )

;; definition for function boulder4-trans-2
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defbehavior boulder4-trans-2 fireboulder ()
  (spawn (-> self part) (-> self draw origin))
  (when (>= (ja-aframe-num 0) 116.0)
    (let ((gp-0 (new 'stack-no-clear 'vector)))
      (set! (-> gp-0 quad) (-> self draw origin quad))
      (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y)))
      (sound-play "v2ogre-boulder")
      (process-spawn
        part-tracker
        :init part-tracker-init
        (-> *part-group-id-table* 551)
        -1
        #f
        #f
        #f
        gp-0
        :to *entity-pool*
        )
      )
    (send-event self 'trans-hook boulder4-trans-3)
    )
  0
  (none)
  )

;; definition for function boulder4-trans
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defbehavior boulder4-trans fireboulder ()
  (spawn (-> self part) (-> self draw origin))
  (when (>= (ja-aframe-num 0) 74.0)
    (let ((gp-0 (new 'stack-no-clear 'vector)))
      (set! (-> gp-0 quad) (-> self draw origin quad))
      (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y)))
      (sound-play "v2ogre-boulder")
      (process-spawn
        part-tracker
        :init part-tracker-init
        (-> *part-group-id-table* 551)
        -1
        #f
        #f
        #f
        gp-0
        :to *entity-pool*
        )
      )
    (send-event self 'trans-hook boulder4-trans-2)
    )
  0
  (none)
  )

;; failed to figure out what this is:
(defstate ogreboss-village2-throw (ogreboss-village2)
  :trans ogreboss-village2-trans
  :code (behavior ()
    (set! (-> self boulder)
          (ppointer->handle (manipy-spawn (-> self entity extra trans) (-> self entity) *fireboulder-sg* #f :to self))
          )
    (send-event (handle->process (-> self boulder)) 'anim-mode 'play1)
    (send-event (handle->process (-> self boulder)) 'art-joint-anim "fireboulder-pre-throw" 0)
    (send-event (handle->process (-> self boulder)) 'draw #t)
    (send-event (handle->process (-> self boulder)) 'origin-joint-index 4)
    (send-event (handle->process (-> self boulder)) 'max-vis-dist 2048000.0)
    (send-event
      (handle->process (-> self boulder))
      'eval
      (lambda :behavior ogreboss-village2
        ()
        (let ((v0-0 (create-launch-control (-> *part-group-id-table* 564) self)))
          (set! (-> self part) v0-0)
          v0-0
          )
        )
      )
    (ja-channel-push! 1 (seconds 0.2))
    (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0)
    (until (ja-done? 0)
      (suspend)
      (ja :num! (seek!))
      )
    (let ((f0-9 (rand-float-gen)))
      (cond
        ((< 0.75 f0-9)
         (send-event (handle->process (-> self boulder)) 'art-joint-anim "fireboulder-boulder1" 0)
         (send-event (handle->process (-> self boulder)) 'trans-hook boulder1-trans)
         )
        ((< 0.5 f0-9)
         (send-event (handle->process (-> self boulder)) 'art-joint-anim "fireboulder-boulder2" 0)
         (send-event (handle->process (-> self boulder)) 'trans-hook boulder2-trans)
         )
        ((< 0.25 f0-9)
         (send-event (handle->process (-> self boulder)) 'art-joint-anim "fireboulder-boulder3" 0)
         (send-event (handle->process (-> self boulder)) 'trans-hook boulder3-trans)
         )
        (else
          (send-event (handle->process (-> self boulder)) 'art-joint-anim "fireboulder-boulder4" 0)
          (send-event (handle->process (-> self boulder)) 'trans-hook boulder4-trans)
          )
        )
      )
    (ja-channel-push! 1 (seconds 0.2))
    (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek!) :frame-num 0.0)
    (until (ja-done? 0)
      (suspend)
      (ja :num! (seek!))
      )
    (go ogreboss-village2-idle)
    (none)
    )
  :post (the-as (function none :behavior ogreboss-village2) ja-post)
  )

;; failed to figure out what this is:
(defstate ogreboss-village2-idle (ogreboss-village2)
  :trans ogreboss-village2-trans
  :code (behavior ()
    (loop
      (ja-channel-push! 1 (seconds 0.1))
      (let ((v1-0 (rand-vu-int-range 0 2)))
        (cond
          ((zero? v1-0)
           (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek! (ja-aframe 140.0 0)) :frame-num 0.0)
           (until (ja-done? 0)
             (suspend)
             (ja :num! (seek! (ja-aframe 140.0 0)))
             )
           (let ((gp-2 (-> *display* base-frame-counter)))
             (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.167))
               (suspend)
               )
             )
           (ja-no-eval :group! (-> self draw art-group data 2)
                       :num! (seek! (ja-aframe 168.0 0))
                       :frame-num (ja-aframe 140.0 0)
                       )
           (until (ja-done? 0)
             (suspend)
             (ja :num! (seek! (ja-aframe 168.0 0)))
             )
           (let ((gp-5 (-> *display* base-frame-counter)))
             (until (>= (- (-> *display* base-frame-counter) gp-5) (seconds 0.167))
               (suspend)
               )
             )
           (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num (ja-aframe 168.0 0))
           (until (ja-done? 0)
             (suspend)
             (ja :num! (seek!))
             )
           )
          ((= v1-0 1)
           (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0)
           (until (ja-done? 0)
             (suspend)
             (ja :num! (seek!))
             )
           )
          (else
            (dotimes (gp-7 4)
              (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0)
              (until (ja-done? 0)
                (suspend)
                (ja :num! (seek!))
                )
              )
            )
          )
        )
      (let ((f0-33 (rand-float-gen)))
        (cond
          ((< 0.6666667 f0-33)
           (ja-channel-push! 1 (seconds 0.2))
           (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0)
           (until (ja-done? 0)
             (suspend)
             (ja :num! (seek!))
             )
           )
          ((not (handle->process (-> self boulder)))
           (go ogreboss-village2-throw)
           )
          )
        )
      )
    (none)
    )
  :post (the-as (function none :behavior ogreboss-village2) ja-post)
  )

;; definition for method 11 of type ogreboss-village2
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! ogreboss-village2 ((obj ogreboss-village2) (arg0 entity-actor))
  (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player))))
    (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0)))
      (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-vector! (-> s3-0 local-sphere) 0.0 40960.0 0.0 40960.0)
      (set-root-prim! s4-0 s3-0)
      (let ((s2-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 3))))
        (set! (-> s2-0 prim-core collide-as) (collide-kind enemy))
        (set! (-> s2-0 collide-with) (collide-kind target))
        (set! (-> s2-0 prim-core action) (collide-action solid))
        (set! (-> s2-0 prim-core offense) (collide-offense touch))
        (set-vector! (-> s2-0 local-sphere) 0.0 34816.0 0.0 14336.0)
        (append-prim s3-0 s2-0)
        )
      )
    (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
    (backup-collide-with-as s4-0)
    (set! (-> obj root) s4-0)
    )
  (process-drawable-from-entity! obj arg0)
  (initialize-skeleton obj *ogreboss-village2-sg* '())
  (set-vector! (-> obj root scale) 0.65 0.65 0.65 1.0)
  (transform-post)
  (set! (-> obj root pause-adjust-distance) 122880.0)
  (logclear! (-> obj mask) (process-mask actor-pause))
  (set! (-> obj boulder) (the-as handle #f))
  (go ogreboss-village2-idle)
  (none)
  )

;; definition of type villageb-ogreboss
(deftype villageb-ogreboss (ogreboss-village2)
  ()
  :heap-base #x50
  :method-count-assert 20
  :size-assert         #xb8
  :flag-assert         #x14005000b8
  )

;; definition for method 3 of type villageb-ogreboss
(defmethod inspect villageb-ogreboss ((obj villageb-ogreboss))
  (let ((t9-0 (method-of-type ogreboss-village2 inspect)))
    (t9-0 obj)
    )
  obj
  )

;; definition of type villageb-water
(deftype villageb-water (water-anim)
  ()
  :heap-base #x70
  :method-count-assert 30
  :size-assert         #xdc
  :flag-assert         #x1e007000dc
  )

;; definition for method 3 of type villageb-water
(defmethod inspect villageb-water ((obj villageb-water))
  (let ((t9-0 (method-of-type water-anim inspect)))
    (t9-0 obj)
    )
  obj
  )

;; definition for symbol ripple-for-villageb-water, type ripple-wave-set
(define ripple-for-villageb-water (new 'static 'ripple-wave-set
                                    :count 3
                                    :converted #f
                                    :normal-scale 6.0
                                    :wave (new 'static 'inline-array ripple-wave 4
                                      (new 'static 'ripple-wave :scale 7.0 :xdiv 1 :speed 6.0)
                                      (new 'static 'ripple-wave :scale 7.0 :xdiv -1 :zdiv 1 :speed 6.0)
                                      (new 'static 'ripple-wave :scale 3.0 :xdiv 5 :zdiv 3 :speed 3.0)
                                      (new 'static 'ripple-wave)
                                      )
                                    )
        )

;; definition for method 22 of type villageb-water
;; INFO: Return type mismatch ripple-wave-set vs none.
(defmethod TODO-RENAME-22 villageb-water ((obj villageb-water))
  (let ((t9-0 (method-of-type water-anim TODO-RENAME-22)))
    (t9-0 obj)
    )
  (let ((v1-2 (new 'process 'ripple-control)))
    (set! (-> obj draw ripple) v1-2)
    (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75)
    (set! (-> v1-2 global-scale) 3072.0)
    (set! (-> v1-2 close-fade-dist) 163840.0)
    (set! (-> v1-2 far-fade-dist) 245760.0)
    (set! (-> v1-2 waveform) ripple-for-villageb-water)
    )
  (none)
  )
