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

(import "goal_src/jak1/import/maindoor-ag.gc")
(import "goal_src/jak1/import/junglecam-ag.gc")
(import "goal_src/jak1/import/precurbridge-ag.gc")
(import "goal_src/jak1/import/sidedoor-ag.gc")
(import "goal_src/jak1/import/towertop-ag.gc")
(import "goal_src/jak1/import/logtrap-ag.gc")
(import "goal_src/jak1/import/lurkerm-tall-sail-ag.gc")
(import "goal_src/jak1/import/medres-firecanyon-ag.gc")
(import "goal_src/jak1/import/lurkerm-piston-ag.gc")
(import "goal_src/jak1/import/accordian-ag.gc")

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

;; failed to figure out what this is:
(defskelgroup *jungle-camera-sg* jungle-camera 0 2
              ((1 (meters 999999)))
              :bounds (static-spherem 0 0 0 4)
              :texture-level 2
              )

;; definition of type logtrap
(deftype logtrap (process-drawable)
  ((root-override collide-shape-moving  :offset 112)
   )
  :heap-base #x40
  :method-count-assert 21
  :size-assert         #xb0
  :flag-assert         #x15004000b0
  (:methods
    (idle () _type_ :state 20)
    )
  )

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

;; failed to figure out what this is:
(defskelgroup *logtrap-sg* logtrap logtrap-lod0-jg logtrap-idle-ja
              ((logtrap-lod0-mg (meters 20)) (logtrap-lod1-mg (meters 999999)))
              :bounds (static-spherem 0 8 0 13)
              :longest-edge (meters 6)
              :shadow logtrap-shadow-mg
              )

;; failed to figure out what this is:
(defstate idle (logtrap)
  :virtual #t
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (if (or (= arg2 'touch) (= arg2 'attack))
        (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info))
        )
    )
  :code (behavior ()
    (transform-post)
    (loop
      (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0)
      (until (ja-done? 0)
        (when (logtest? (-> self draw status) (draw-status was-drawn))
          (cond
            ((> (-> self draw cur-lod) 0)
             (ja-post)
             )
            (else
              (transform-post)
              (if *target*
                  (look-at-enemy! (-> *target* neck) (the-as vector (-> self root-override root-prim prim-core)) #f self)
                  )
              )
            )
          )
        (suspend)
        (ja :num! (seek!))
        )
      )
    (none)
    )
  )

;; definition for method 11 of type logtrap
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! logtrap ((obj logtrap) (arg0 entity-actor))
  (set! (-> obj mask) (logior (process-mask enemy) (-> obj mask)))
  (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))))
    (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
    (set! (-> s4-0 reaction) default-collision-reaction)
    (set! (-> s4-0 no-reaction)
          (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
          )
    (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
      (set! (-> s3-0 prim-core collide-as) (collide-kind enemy))
      (set! (-> s3-0 collide-with) (collide-kind target))
      (set! (-> s3-0 transform-index) 6)
      (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 19251.2)
      (set-root-prim! s4-0 s3-0)
      )
    (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)
  (initialize-skeleton obj *logtrap-sg* '())
  (set! (-> obj draw shadow-ctrl) (new 'process 'shadow-control -5734.4 0.0 614400.0 (the-as float 1) 163840.0))
  (logclear! (-> obj mask) (process-mask actor-pause))
  (update-transforms! (-> obj root-override))
  (go (method-of-object obj idle))
  (none)
  )

;; definition of type towertop
(deftype towertop (process-drawable)
  ((root-override trsq  :offset 112)
   )
  :heap-base #x40
  :method-count-assert 20
  :size-assert         #xb0
  :flag-assert         #x14004000b0
  (:states
    towertop-idle
    )
  )

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

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

;; failed to figure out what this is:
(defstate towertop-idle (towertop)
  :code (behavior ()
    (loop
      (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max 0.4) :frame-num 0.0)
      (until (ja-done? 0)
        (suspend)
        (ja :num! (seek! max 0.4))
        )
      )
    (none)
    )
  :post (the-as (function none :behavior towertop) ja-post)
  )

;; definition for method 11 of type towertop
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! towertop ((obj towertop) (arg0 entity-actor))
  (set! (-> obj mask) (logior (process-mask ambient) (-> obj mask)))
  (set! (-> obj root-override) (new 'process 'trsq))
  (process-drawable-from-entity! obj arg0)
  (logclear! (-> obj mask) (process-mask actor-pause))
  (initialize-skeleton obj *towertop-sg* '())
  (go towertop-idle)
  (none)
  )

;; definition of type lurkerm-tall-sail
(deftype lurkerm-tall-sail (process-drawable)
  ((root-override collide-shape-moving  :offset        112)
   (speed         float                 :offset-assert 176)
   (alt-actor     entity-actor          :offset-assert 180)
   )
  :heap-base #x50
  :method-count-assert 20
  :size-assert         #xb8
  :flag-assert         #x14005000b8
  (:states
    lurkerm-tall-sail-idle
    )
  )

;; definition for method 3 of type lurkerm-tall-sail
(defmethod inspect lurkerm-tall-sail ((obj lurkerm-tall-sail))
  (let ((t9-0 (method-of-type process-drawable inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tspeed: ~f~%" (-> obj speed))
  (format #t "~T~Talt-actor: ~A~%" (-> obj alt-actor))
  obj
  )

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

;; failed to figure out what this is:
(defstate lurkerm-tall-sail-idle (lurkerm-tall-sail)
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (let ((v1-0 arg2))
      (the-as object (when (= v1-0 'stop)
                       (process-entity-status! self (entity-perm-status complete) #t)
                       (let ((f0-0 0.0))
                         (set! (-> self speed) f0-0)
                         f0-0
                         )
                       )
              )
      )
    )
  :trans (the-as (function none :behavior lurkerm-tall-sail) rider-trans)
  :code (behavior ()
    (loop
      (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max (* 0.5 (-> self speed))) :frame-num 0.0)
      (until (ja-done? 0)
        (quaternion-rotate-local-y!
          (-> self root-override quat)
          (-> self root-override quat)
          (* 12743.111 (-> *display* seconds-per-frame) (-> self speed))
          )
        (suspend)
        (ja :num! (seek! max (* 0.5 (-> self speed))))
        )
      )
    (none)
    )
  :post (the-as (function none :behavior lurkerm-tall-sail) rider-post)
  )

;; definition for method 11 of type lurkerm-tall-sail
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! lurkerm-tall-sail ((obj lurkerm-tall-sail) (arg0 entity-actor))
  (set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
  (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))))
    (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
    (set! (-> s4-0 reaction) default-collision-reaction)
    (set! (-> s4-0 no-reaction)
          (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
          )
    (alloc-riders s4-0 1)
    (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 ground-object))
      (set! (-> s3-0 collide-with) (collide-kind target))
      (set! (-> s3-0 prim-core action) (collide-action solid ca-1))
      (set! (-> s3-0 transform-index) 0)
      (set-vector! (-> s3-0 local-sphere) 0.0 36044.8 0.0 47104.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 ground-object))
        (set! (-> s2-0 collide-with) (collide-kind target))
        (set! (-> s2-0 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-0 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-0 transform-index) 3)
        (set-vector! (-> s2-0 local-sphere) 39321.6 0.0 0.0 43417.6)
        (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-override) s4-0)
    )
  (process-drawable-from-entity! obj arg0)
  (initialize-skeleton obj *lurkerm-tall-sail-sg* '())
  (logior! (-> obj skel status) (janim-status inited))
  (update-transforms! (-> obj root-override))
  (set! (-> obj alt-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0))
  (set! (-> obj speed) 1.0)
  (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))
      (set! (-> obj speed) 0.0)
      )
  (go lurkerm-tall-sail-idle)
  (none)
  )

;; definition of type lurkerm-short-sail
(deftype lurkerm-short-sail (process-drawable)
  ((root-override collide-shape-moving  :offset        112)
   (speed         float                 :offset-assert 176)
   (alt-actor     entity-actor          :offset-assert 180)
   )
  :heap-base #x50
  :method-count-assert 20
  :size-assert         #xb8
  :flag-assert         #x14005000b8
  (:states
    lurkerm-short-sail-idle
    )
  )

;; definition for method 3 of type lurkerm-short-sail
(defmethod inspect lurkerm-short-sail ((obj lurkerm-short-sail))
  (let ((t9-0 (method-of-type process-drawable inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tspeed: ~f~%" (-> obj speed))
  (format #t "~T~Talt-actor: ~A~%" (-> obj alt-actor))
  obj
  )

;; failed to figure out what this is:
(defskelgroup *lurkerm-short-sail-sg* lurkerm-short-sail 0 4
              ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999)))
              :bounds (static-spherem 0 5 0 9)
              )

;; failed to figure out what this is:
(defstate lurkerm-short-sail-idle (lurkerm-short-sail)
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (let ((v1-0 arg2))
      (the-as object (when (= v1-0 'stop)
                       (process-entity-status! self (entity-perm-status complete) #t)
                       (let ((f0-0 0.0))
                         (set! (-> self speed) f0-0)
                         f0-0
                         )
                       )
              )
      )
    )
  :trans (the-as (function none :behavior lurkerm-short-sail) rider-trans)
  :code (behavior ()
    (loop
      (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max (* 0.5 (-> self speed))) :frame-num 0.0)
      (until (ja-done? 0)
        (quaternion-rotate-local-y!
          (-> self root-override quat)
          (-> self root-override quat)
          (* -12743.111 (-> *display* seconds-per-frame) (-> self speed))
          )
        (suspend)
        (ja :num! (seek! max (* 0.5 (-> self speed))))
        )
      )
    (none)
    )
  :post (the-as (function none :behavior lurkerm-short-sail) rider-post)
  )

;; definition for method 11 of type lurkerm-short-sail
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! lurkerm-short-sail ((obj lurkerm-short-sail) (arg0 entity-actor))
  (set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
  (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))))
    (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
    (set! (-> s4-0 reaction) default-collision-reaction)
    (set! (-> s4-0 no-reaction)
          (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
          )
    (alloc-riders s4-0 1)
    (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0)))
      (set! (-> s3-0 prim-core collide-as) (collide-kind ground-object))
      (set! (-> s3-0 collide-with) (collide-kind target))
      (set! (-> s3-0 prim-core action) (collide-action solid ca-1))
      (set-vector! (-> s3-0 local-sphere) 0.0 40960.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 ground-object))
        (set! (-> s2-0 collide-with) (collide-kind target))
        (set! (-> s2-0 prim-core action) (collide-action solid ca-1))
        (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 36864.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 0))))
        (set! (-> s2-1 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s2-1 collide-with) (collide-kind target))
        (set! (-> s2-1 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-1 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-1 transform-index) 3)
        (set-vector! (-> s2-1 local-sphere) 40960.0 0.0 0.0 24576.0)
        (append-prim s3-0 s2-1)
        )
      (let ((s2-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0))))
        (set! (-> s2-2 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s2-2 collide-with) (collide-kind target))
        (set! (-> s2-2 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-2 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-2 transform-index) 3)
        (set-vector! (-> s2-2 local-sphere) 40960.0 0.0 0.0 24576.0)
        (append-prim s3-0 s2-2)
        )
      )
    (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)
  (initialize-skeleton obj *lurkerm-short-sail-sg* '())
  (logior! (-> obj skel status) (janim-status inited))
  (update-transforms! (-> obj root-override))
  (set! (-> obj alt-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0))
  (set! (-> obj speed) 1.0)
  (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))
      (set! (-> obj speed) 0.0)
      )
  (go lurkerm-short-sail-idle)
  (none)
  )

;; definition of type lurkerm-piston
(deftype lurkerm-piston (process-drawable)
  ((root-override collide-shape-moving         :offset        112)
   (sync          sync-info            :inline :offset-assert 176)
   (base          vector               :inline :offset-assert 192)
   (height        vector               :inline :offset-assert 208)
   (speed         float                        :offset-assert 224)
   (alt-actor     entity-actor                 :offset-assert 228)
   )
  :heap-base #x80
  :method-count-assert 20
  :size-assert         #xe8
  :flag-assert         #x14008000e8
  (:states
    lurkerm-piston-idle
    )
  )

;; definition for method 3 of type lurkerm-piston
(defmethod inspect lurkerm-piston ((obj lurkerm-piston))
  (let ((t9-0 (method-of-type process-drawable inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tsync: #<sync-info @ #x~X>~%" (-> obj sync))
  (format #t "~T~Tbase: ~`vector`P~%" (-> obj base))
  (format #t "~T~Theight: ~`vector`P~%" (-> obj height))
  (format #t "~T~Tspeed: ~f~%" (-> obj speed))
  (format #t "~T~Talt-actor: ~A~%" (-> obj alt-actor))
  obj
  )

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

;; failed to figure out what this is:
(defstate lurkerm-piston-idle (lurkerm-piston)
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (let ((v1-0 arg2))
      (the-as object (when (= v1-0 'stop)
                       (process-entity-status! self (entity-perm-status complete) #t)
                       (let ((f0-0 0.0))
                         (set! (-> self speed) f0-0)
                         f0-0
                         )
                       )
              )
      )
    )
  :trans (the-as (function none :behavior lurkerm-piston) rider-trans)
  :code (behavior ()
    (loop
      (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek! max (-> self speed)) :frame-num 0.0)
      (until (ja-done? 0)
        (let ((gp-0 (new-stack-vector0)))
          (set! (-> gp-0 quad) (-> self base quad))
          (+! (-> gp-0 y) (* (get-current-value-with-mirror (-> self sync) (-> self height y)) (-> self speed)))
          (move-to-point! (-> self root-override) gp-0)
          )
        (suspend)
        (ja :num! (seek! max (-> self speed)))
        )
      )
    (none)
    )
  :post (the-as (function none :behavior lurkerm-piston) rider-post)
  )

;; definition for method 11 of type lurkerm-piston
;; INFO: Used lq/sq
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! lurkerm-piston ((obj lurkerm-piston) (arg0 entity-actor))
  (local-vars (sv-16 res-tag) (sv-32 res-tag))
  (set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
  (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))))
    (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
    (set! (-> s4-0 reaction) default-collision-reaction)
    (set! (-> s4-0 no-reaction)
          (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
          )
    (alloc-riders s4-0 1)
    (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
      (set! (-> s3-0 prim-core collide-as) (collide-kind ground-object))
      (set! (-> s3-0 collide-with) (collide-kind target))
      (set! (-> s3-0 prim-core action) (collide-action solid ca-1))
      (set! (-> s3-0 prim-core offense) (collide-offense indestructible))
      (set! (-> s3-0 transform-index) 3)
      (set-vector! (-> s3-0 local-sphere) 24576.0 0.0 0.0 20480.0)
      (set-root-prim! s4-0 s3-0)
      )
    (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)
  (logclear! (-> obj mask) (process-mask actor-pause))
  (initialize-skeleton obj *lurkerm-piston-sg* '())
  (logior! (-> obj skel status) (janim-status inited))
  (update-transforms! (-> obj root-override))
  (set! (-> obj base quad) (-> obj root-override trans quad))
  (let ((f30-0 (-> obj base y)))
    (set! sv-16 (new 'static 'res-tag))
    (let ((v1-32 (res-lump-data arg0 'height-info pointer :tag-ptr (& sv-16))))
      (set! (-> obj base y) (+ f30-0 (if (and v1-32 (> (the-as int (-> sv-16 elt-count)) 0))
                                         (-> (the-as (pointer float) v1-32))
                                         0.0
                                         )
                               )
            )
      )
    )
  (let ((s4-1 (-> obj height)))
    (set! (-> s4-1 x) 0.0)
    (set! sv-32 (new 'static 'res-tag))
    (let ((v1-35 (res-lump-data arg0 'height-info (pointer float) :tag-ptr (& sv-32))))
      (set! (-> s4-1 y) (if (and v1-35 (< 1 (the-as int (-> sv-32 elt-count))))
                            (-> v1-35 1)
                            20480.0
                            )
            )
      )
    (set! (-> s4-1 z) 0.0)
    (set! (-> s4-1 w) 1.0)
    )
  (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.15 0.15)
  (set! (-> obj alt-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0))
  (set! (-> obj speed) 1.0)
  (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))
      (set! (-> obj speed) 0.0)
      )
  (go lurkerm-piston-idle)
  (none)
  )

;; definition of type accordian
(deftype accordian (process-drawable)
  ((speed     float         :offset-assert 176)
   (alt-actor entity-actor  :offset-assert 180)
   )
  :heap-base #x50
  :method-count-assert 20
  :size-assert         #xb8
  :flag-assert         #x14005000b8
  (:states
    accordian-idle
    )
  )

;; definition for method 3 of type accordian
(defmethod inspect accordian ((obj accordian))
  (let ((t9-0 (method-of-type process-drawable inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tspeed: ~f~%" (-> obj speed))
  (format #t "~T~Talt-actor: ~A~%" (-> obj alt-actor))
  obj
  )

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

;; failed to figure out what this is:
(defstate accordian-idle (accordian)
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (let ((v1-0 arg2))
      (the-as object (when (= v1-0 'stop)
                       (process-entity-status! self (entity-perm-status complete) #t)
                       (let ((f0-0 0.0))
                         (set! (-> self speed) f0-0)
                         f0-0
                         )
                       )
              )
      )
    )
  :code (behavior ()
    (ja-no-eval :num! (loop!) :frame-num 0.0)
    (ja-post)
    (loop
      (suspend)
      (when (logtest? (-> self draw status) (draw-status was-drawn))
        (ja :num! (loop! (-> self speed)))
        (ja-post)
        )
      )
    (none)
    )
  )

;; definition for method 11 of type accordian
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! accordian ((obj accordian) (arg0 entity-actor))
  (set! (-> obj root) (new 'process 'trsqv))
  (process-drawable-from-entity! obj arg0)
  (initialize-skeleton obj *accordian-sg* '())
  (set! (-> obj root pause-adjust-distance) 204800.0)
  (set! (-> obj alt-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0))
  (set! (-> obj speed) 1.0)
  (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))
      (set! (-> obj speed) 0.0)
      )
  (go accordian-idle)
  (none)
  )

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

;; definition of type junglecam
(deftype junglecam (process-hidden)
  ()
  :method-count-assert 15
  :size-assert         #x70
  :flag-assert         #xf00000070
  )

;; definition for method 3 of type junglecam
(defmethod inspect junglecam ((obj junglecam))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tname: ~A~%" (-> obj name))
  (format #t "~Tmask: ~D~%" (-> obj mask))
  (format #t "~Tparent: #x~X~%" (-> obj parent))
  (format #t "~Tbrother: #x~X~%" (-> obj brother))
  (format #t "~Tchild: #x~X~%" (-> obj child))
  (format #t "~Tppointer: #x~X~%" (-> obj ppointer))
  (format #t "~Tself: ~A~%" (-> obj self))
  (format #t "~Tpool: ~A~%" (-> obj pool))
  (format #t "~Tstatus: ~A~%" (-> obj status))
  (format #t "~Tpid: ~D~%" (-> obj pid))
  (format #t "~Tmain-thread: ~A~%" (-> obj main-thread))
  (format #t "~Ttop-thread: ~A~%" (-> obj top-thread))
  (format #t "~Tentity: ~A~%" (-> obj entity))
  (format #t "~Tstate: ~A~%" (-> obj state))
  (format #t "~Ttrans-hook: ~A~%" (-> obj trans-hook))
  (format #t "~Tpost-hook: ~A~%" (-> obj post-hook))
  (format #t "~Tevent-hook: ~A~%" (-> obj event-hook))
  (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length))
  (format #t "~Tnext-state: ~A~%" (-> obj next-state))
  (format #t "~Theap-base: #x~X~%" (-> obj heap-base))
  (format #t "~Theap-top: #x~X~%" (-> obj heap-top))
  (format #t "~Theap-cur: #x~X~%" (-> obj heap-cur))
  (format #t "~Tstack-frame-top: ~A~%" (-> obj stack-frame-top))
  (format #t "~Theap: #<kheap @ #x~X>~%" (&-> obj heap-base))
  (format #t "~Tconnection-list: ~`'connectable`P~%" (-> obj connection-list))
  (format #t "~Tstack[0] @ #x~X~%" (-> obj stack))
  obj
  )

;; definition of type precurbridgecam
(deftype precurbridgecam (pov-camera)
  ()
  :heap-base #x70
  :method-count-assert 30
  :size-assert         #xdc
  :flag-assert         #x1e007000dc
  )

;; definition for method 3 of type precurbridgecam
(defmethod inspect precurbridgecam ((obj precurbridgecam))
  (let ((t9-0 (method-of-type pov-camera inspect)))
    (t9-0 obj)
    )
  obj
  )

;; failed to figure out what this is:
(defstate pov-camera-playing (precurbridgecam)
  :virtual #t
  :code (behavior ()
    (ambient-hint-spawn "gamcam30" (the-as vector #f) *entity-pool* 'camera)
    (ja :group! (-> self draw art-group data 8))
    (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek! (ja-aframe 0.0 0)) :frame-num 0.0)
    (until (ja-done? 0)
      (suspend)
      (ja :num! (seek! (ja-aframe 0.0 0)))
      )
    (send-event (ppointer->process (-> self parent)) 'go)
    (ja-no-eval :num! (seek!))
    (while (not (ja-done? 0))
      (suspend)
      (ja-eval)
      )
    (go-virtual pov-camera-done-playing)
    (none)
    )
  )

;; definition of type precurbridge-span
(deftype precurbridge-span (structure)
  ()
  :method-count-assert 9
  :size-assert         #x0
  :flag-assert         #x900000000
  )

;; definition for method 3 of type precurbridge-span
(defmethod inspect precurbridge-span ((obj precurbridge-span))
  (format #t "[~8x] ~A~%" obj 'precurbridge-span)
  obj
  )

;; definition of type precurbridge
(deftype precurbridge (process-drawable)
  ((root-override    collide-shape-moving         :offset        112)
   (smush            smush-control        :inline :offset-assert 176)
   (base             vector               :inline :offset-assert 208)
   (activation-point vector               :inline :offset-assert 224)
   (span-array       precurbridge-span    8       :offset-assert 240)
   )
  :heap-base #xa0
  :method-count-assert 20
  :size-assert         #x110
  :flag-assert         #x1400a00110
  (:states
    precurbridge-activate
    (precurbridge-active symbol)
    precurbridge-idle
    )
  )

;; definition for method 3 of type precurbridge
(defmethod inspect precurbridge ((obj precurbridge))
  (let ((t9-0 (method-of-type process-drawable inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tsmush: #<smush-control @ #x~X>~%" (-> obj smush))
  (format #t "~T~Tbase: ~`vector`P~%" (-> obj base))
  (format #t "~T~Tactivation-point: #<vector @ #x~X>~%" (-> obj activation-point))
  (format #t "~T~Tspan-array[8] @ #x~X~%" (-> obj span-array))
  obj
  )

;; failed to figure out what this is:
(defskelgroup *precurbridge-sg* precurbridge precurbridge-geo-jg precurbridge-idle-ja
              ((precurbridge-geo-mg (meters 20)) (precurbridge-lod1-mg (meters 999999)))
              :bounds (static-spherem 0 0 0 40)
              :longest-edge (meters 3.6)
              )

;; failed to figure out what this is:
(defstate precurbridge-idle (precurbridge)
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (case arg2
      (('go)
       (go precurbridge-activate)
       )
      )
    )
  :code (behavior ()
    (ja :group! (-> self draw art-group data 3) :num! min)
    (transform-post)
    (loop
      (when (and *target*
                 (< (vector-vector-xz-distance (-> self activation-point) (-> *target* control trans)) 49152.0)
                 (< (-> self activation-point y) (-> *target* control trans y))
                 (< (-> *target* control trans y) (+ 20480.0 (-> self activation-point y)))
                 (not (-> self child))
                 )
        (cond
          ((send-event *target* 'query 'powerup (pickup-type eco-blue))
           (logclear! (-> self mask) (process-mask actor-pause))
           (logclear! (-> self mask) (process-mask platform))
           (let ((gp-1 (entity-by-name "junglecam-1")))
             (cond
               (gp-1
                 (process-spawn
                   precurbridgecam
                   :init pov-camera-init-by-other
                   (-> gp-1 extra trans)
                   *junglecam-sg*
                   "precurbridgecam"
                   0
                   #f
                   '()
                   :to self
                   )
                 )
               (else
                 (format #t "ERROR<GMJ>: position for precursor bridge camera not found~%")
                 (go precurbridge-activate)
                 )
               )
             )
           )
          (else
            (level-hint-spawn
              (game-text-id sidekick-hint-precurbridge)
              "sksp0039"
              (the-as entity #f)
              *entity-pool*
              (game-task none)
              )
            )
          )
        )
      (suspend)
      )
    (none)
    )
  :post (the-as (function none :behavior precurbridge) ja-post)
  )

;; failed to figure out what this is:
(defstate precurbridge-activate (precurbridge)
  :exit (behavior ()
    (logior! (-> self mask) (process-mask actor-pause))
    (none)
    )
  :trans (the-as (function none :behavior precurbridge) rider-trans)
  :code (behavior ()
    (process-entity-status! self (entity-perm-status complete) #t)
    (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans)))
    (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! max 0.25) :frame-num 0.0)
    (until (ja-done? 0)
      (if (rand-vu-percent? 0.1)
          (spawn-projectile-blue *target*)
          )
      (suspend)
      (ja :num! (seek! max 0.25))
      )
    (go precurbridge-active #f)
    (none)
    )
  :post (the-as (function none :behavior precurbridge) rider-post)
  )

;; failed to figure out what this is:
(defstate precurbridge-active (precurbridge)
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (let ((v1-0 arg2))
      (the-as
        object
        (when (= v1-0 'bonk)
          (let* ((gp-0 (the-as object (-> arg3 param 0)))
                 (a0-2 (-> (the-as touching-shapes-entry gp-0) head))
                 (s5-0 (-> self root-override))
                 )
            (get-touched-prim a0-2 s5-0 (the-as touching-shapes-entry gp-0))
            ((method-of-type touching-shapes-entry get-touched-shape) (the-as touching-shapes-entry gp-0) s5-0)
            )
          (activate! (-> self smush) -1.0 150 600 1.0 1.0)
          )
        )
      )
    )
  :trans (the-as (function none :behavior precurbridge) rider-trans)
  :code (behavior ((arg0 symbol))
    (set! (-> self draw bounds w) 81920.0)
    (when arg0
      (ja-channel-set! 1)
      (ja :group! (-> self draw art-group data 4) :num! min)
      )
    (ja-post)
    (update-transforms! (-> self root-override))
    (logior! (-> self mask) (process-mask actor-pause))
    (loop
      (if (not (movie?))
          (set! (-> self mask) (logior (process-mask platform) (-> self mask)))
          )
      (cond
        ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))))
         (when (not (ja-group? (-> self draw art-group data 5)))
           (ja-channel-push! 1 (seconds 0.2))
           (ja :group! (-> self draw art-group data 5) :num! min)
           )
         )
        (else
          (when (not (ja-group? (-> self draw art-group data 4)))
            (ja-channel-push! 1 (seconds 0.2))
            (ja :group! (-> self draw art-group data 4) :num! min)
            )
          )
        )
      (update! (-> self sound))
      (ja :num! (loop! 0.4))
      (suspend)
      )
    (none)
    )
  :post (the-as (function none :behavior precurbridge) rider-post)
  )

;; definition for method 11 of type precurbridge
;; INFO: Used lq/sq
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! precurbridge ((obj precurbridge) (arg0 entity-actor))
  (stack-size-set! (-> obj main-thread) 512)
  (set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
  (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))))
    (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
    (set! (-> s4-0 reaction) default-collision-reaction)
    (set! (-> s4-0 no-reaction)
          (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
          )
    (alloc-riders s4-0 1)
    (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 16) 0)))
      (set! (-> s3-0 prim-core collide-as) (collide-kind ground-object))
      (set! (-> s3-0 collide-with) (collide-kind target))
      (set! (-> s3-0 prim-core action) (collide-action solid ca-1))
      (set! (-> s3-0 transform-index) 0)
      (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 81920.0)
      (set-root-prim! s4-0 s3-0)
      (let ((s2-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (the-as uint 0))))
        (set! (-> s2-0 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s2-0 collide-with) (collide-kind target))
        (set! (-> s2-0 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-0 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-0 transform-index) 5)
        (set-vector! (-> s2-0 local-sphere) -6144.0 0.0 0.0 17203.2)
        (append-prim s3-0 s2-0)
        )
      (let ((s2-1 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 1))))
        (set! (-> s2-1 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s2-1 collide-with) (collide-kind target))
        (set! (-> s2-1 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-1 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-1 transform-index) 7)
        (set-vector! (-> s2-1 local-sphere) 6144.0 0.0 0.0 17203.2)
        (append-prim s3-0 s2-1)
        )
      (let ((s2-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (the-as uint 1))))
        (set! (-> s2-2 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s2-2 collide-with) (collide-kind target))
        (set! (-> s2-2 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-2 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-2 transform-index) 9)
        (set-vector! (-> s2-2 local-sphere) -6144.0 0.0 0.0 17203.2)
        (append-prim s3-0 s2-2)
        )
      (let ((s2-3 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 1))))
        (set! (-> s2-3 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s2-3 collide-with) (collide-kind target))
        (set! (-> s2-3 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-3 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-3 transform-index) 11)
        (set-vector! (-> s2-3 local-sphere) 6144.0 0.0 0.0 17203.2)
        (append-prim s3-0 s2-3)
        )
      (let ((s2-4 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (the-as uint 1))))
        (set! (-> s2-4 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s2-4 collide-with) (collide-kind target))
        (set! (-> s2-4 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-4 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-4 transform-index) 13)
        (set-vector! (-> s2-4 local-sphere) -6144.0 0.0 0.0 17203.2)
        (append-prim s3-0 s2-4)
        )
      (let ((s2-5 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 1))))
        (set! (-> s2-5 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s2-5 collide-with) (collide-kind target))
        (set! (-> s2-5 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-5 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-5 transform-index) 15)
        (set-vector! (-> s2-5 local-sphere) 6144.0 0.0 0.0 17203.2)
        (append-prim s3-0 s2-5)
        )
      (let ((s2-6 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (the-as uint 1))))
        (set! (-> s2-6 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s2-6 collide-with) (collide-kind target))
        (set! (-> s2-6 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-6 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-6 transform-index) 17)
        (set-vector! (-> s2-6 local-sphere) -6144.0 0.0 0.0 17203.2)
        (append-prim s3-0 s2-6)
        )
      (let ((s2-7 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 1))))
        (set! (-> s2-7 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s2-7 collide-with) (collide-kind target))
        (set! (-> s2-7 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-7 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-7 transform-index) 19)
        (set-vector! (-> s2-7 local-sphere) 6144.0 0.0 0.0 17203.2)
        (append-prim s3-0 s2-7)
        )
      (let ((s2-8 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0))))
        (set! (-> s2-8 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s2-8 collide-with) (collide-kind target))
        (set! (-> s2-8 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-8 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-8 transform-index) 4)
        (set-vector! (-> s2-8 local-sphere) -4096.0 0.0 0.0 9011.2)
        (append-prim s3-0 s2-8)
        )
      (let ((s2-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
        (set! (-> s2-9 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s2-9 collide-with) (collide-kind target))
        (set! (-> s2-9 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-9 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-9 transform-index) 6)
        (set-vector! (-> s2-9 local-sphere) 4096.0 0.0 0.0 9011.2)
        (append-prim s3-0 s2-9)
        )
      (let ((s2-10 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0))))
        (set! (-> s2-10 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s2-10 collide-with) (collide-kind target))
        (set! (-> s2-10 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-10 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-10 transform-index) 8)
        (set-vector! (-> s2-10 local-sphere) -4096.0 0.0 0.0 9011.2)
        (append-prim s3-0 s2-10)
        )
      (let ((s2-11 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
        (set! (-> s2-11 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s2-11 collide-with) (collide-kind target))
        (set! (-> s2-11 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-11 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-11 transform-index) 10)
        (set-vector! (-> s2-11 local-sphere) 4096.0 0.0 0.0 9011.2)
        (append-prim s3-0 s2-11)
        )
      (let ((s2-12 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0))))
        (set! (-> s2-12 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s2-12 collide-with) (collide-kind target))
        (set! (-> s2-12 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-12 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-12 transform-index) 12)
        (set-vector! (-> s2-12 local-sphere) -4096.0 0.0 0.0 9011.2)
        (append-prim s3-0 s2-12)
        )
      (let ((s2-13 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
        (set! (-> s2-13 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s2-13 collide-with) (collide-kind target))
        (set! (-> s2-13 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-13 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-13 transform-index) 14)
        (set-vector! (-> s2-13 local-sphere) 4096.0 0.0 0.0 9011.2)
        (append-prim s3-0 s2-13)
        )
      (let ((s2-14 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0))))
        (set! (-> s2-14 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s2-14 collide-with) (collide-kind target))
        (set! (-> s2-14 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-14 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-14 transform-index) 16)
        (set-vector! (-> s2-14 local-sphere) -4096.0 0.0 0.0 9011.2)
        (append-prim s3-0 s2-14)
        )
      (let ((s2-15 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
        (set! (-> s2-15 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s2-15 collide-with) (collide-kind target))
        (set! (-> s2-15 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-15 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-15 transform-index) 18)
        (set-vector! (-> s2-15 local-sphere) 4096.0 0.0 0.0 9011.2)
        (append-prim s3-0 s2-15)
        )
      )
    (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)
  (set-vector! (-> obj activation-point) 1765785.6 61440.0 -1279180.8 1.0)
  (initialize-skeleton obj *precurbridge-sg* '())
  (logior! (-> obj skel status) (janim-status inited))
  (ja-post)
  (update-transforms! (-> obj root-override))
  (set! (-> obj base quad) (-> obj root-override trans quad))
  (set! (-> obj sound) (new 'process 'ambient-sound arg0 (-> obj root-override trans)))
  (cond
    ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))
     (logclear! (-> obj mask) (process-mask actor-pause))
     (go precurbridge-active #t)
     )
    (else
      (go precurbridge-idle)
      )
    )
  (none)
  )

;; definition of type maindoor
(deftype maindoor (process-drawable)
  ((root-override collide-shape         :offset        112)
   (thresh        vector        :inline :offset-assert 176)
   )
  :heap-base #x50
  :method-count-assert 20
  :size-assert         #xc0
  :flag-assert         #x14005000c0
  (:states
    (maindoor-closed symbol)
    (maindoor-open symbol)
    )
  )

;; definition for method 3 of type maindoor
(defmethod inspect maindoor ((obj maindoor))
  (let ((t9-0 (method-of-type process-drawable inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tthresh: ~`vector`P~%" (-> obj thresh))
  obj
  )

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

;; failed to figure out what this is:
(defstate maindoor-closed (maindoor)
  :code (behavior ((arg0 symbol))
    (set! (-> self draw force-lod) 1)
    (logclear! (-> self draw status) (draw-status hidden))
    (if arg0
        (ja :num-func num-func-identity :frame-num 0.0)
        )
    (suspend)
    (update-transforms! (-> self root-override))
    (loop
      (when (or (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))
                (and (and *target*
                          (>= (-> self thresh w) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))
                          )
                     (send-event *target* 'query 'powerup (pickup-type eco-blue))
                     )
                )
        (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans)))
        (go maindoor-open #f)
        )
      (if (and *target*
               (>= (-> self thresh w) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))
               )
          (level-hint-spawn
            (game-text-id sidekick-hint-rounddoor)
            "sksp0038"
            (the-as entity #f)
            *entity-pool*
            (game-task none)
            )
          )
      (when (ja-min? 0)
        (set! (-> self root-override root-prim prim-core action) (collide-action solid))
        (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible))
        )
      (ja :num! (seek! 0.0))
      (ja-post)
      (suspend)
      )
    (none)
    )
  )

;; failed to figure out what this is:
(defstate maindoor-open (maindoor)
  :code (behavior ((arg0 symbol))
    (set! (-> self draw force-lod) 0)
    (logclear! (-> self draw status) (draw-status hidden))
    (process-entity-status! self (entity-perm-status complete) #t)
    (if arg0
        (ja :num-func num-func-identity :frame-num max)
        )
    (set! (-> self root-override root-prim prim-core action) (collide-action))
    (set! (-> self root-override root-prim prim-core offense) (collide-offense no-offense))
    (while (not (ja-max? 0))
      (ja :num! (seek! max 2.0))
      (if (and (not arg0) (rand-vu-percent? 0.2))
          (spawn-projectile-blue *target*)
          )
      (suspend)
      )
    (logior! (-> self draw status) (draw-status hidden))
    (loop
      (suspend)
      )
    (none)
    )
  :post (the-as (function none :behavior maindoor) ja-post)
  )

;; definition for method 11 of type maindoor
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! maindoor ((obj maindoor) (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-mesh s4-0 (the-as uint 0) (the-as uint 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! (-> s3-0 transform-index) 0)
      (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 24576.0)
      (set-root-prim! s4-0 s3-0)
      )
    (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)
  (initialize-skeleton obj *maindoor-sg* '())
  (update-transforms! (-> obj root-override))
  (set! (-> obj thresh w) 61440.0)
  (if (or (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))
          (and (and *target*
                    (>= (-> obj thresh w) (vector-vector-distance (-> obj root-override trans) (-> *target* control trans)))
                    )
               (send-event *target* 'query 'powerup (pickup-type eco-blue))
               )
          )
      (go maindoor-open #t)
      (go maindoor-closed #t)
      )
  (none)
  )

;; definition of type sidedoor
(deftype sidedoor (eco-door)
  ()
  :heap-base #xa0
  :method-count-assert 27
  :size-assert         #x104
  :flag-assert         #x1b00a00104
  )

;; definition for method 3 of type sidedoor
(defmethod inspect sidedoor ((obj sidedoor))
  (let ((t9-0 (method-of-type eco-door inspect)))
    (t9-0 obj)
    )
  obj
  )

;; failed to figure out what this is:
(defskelgroup *sidedoor-sg* sidedoor sidedoor-geo-jg sidedoor-idle-ja
              ((sidedoor-geo-mg (meters 20)) (sidedoor-lod1-mg (meters 999999)))
              :bounds (static-spherem 0 0 0 8)
              )

;; definition for method 24 of type sidedoor
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-24 sidedoor ((obj sidedoor))
  (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player))))
    (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 wall-object))
      (set! (-> s4-0 collide-with) (collide-kind target))
      (set! (-> s4-0 prim-core action) (collide-action solid))
      (set! (-> s4-0 prim-core offense) (collide-offense indestructible))
      (set! (-> s4-0 transform-index) 2)
      (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 14336.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-override) s5-0)
    )
  0
  (none)
  )

;; definition for method 25 of type sidedoor
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-25 sidedoor ((obj sidedoor))
  (initialize-skeleton obj *sidedoor-sg* '())
  (set! (-> obj open-distance) 22528.0)
  (set! (-> obj close-distance) 61440.0)
  (set! (-> obj speed) 6.0)
  (update-transforms! (-> obj root-override))
  0
  (none)
  )

;; definition of type jngpusher
(deftype jngpusher (process-drawable)
  ((root-override trsqv                      :offset        112)
   (sync          sync-info          :inline :offset-assert 176)
   (back-prim     collide-shape-prim         :offset-assert 184)
   )
  :heap-base #x50
  :method-count-assert 20
  :size-assert         #xbc
  :flag-assert         #x14005000bc
  (:states
    jngpusher-idle
    )
  )

;; definition for method 3 of type jngpusher
(defmethod inspect jngpusher ((obj jngpusher))
  (let ((t9-0 (method-of-type process-drawable inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tsync: #<sync-info @ #x~X>~%" (-> obj sync))
  (format #t "~T~Tback-prim: ~A~%" (-> obj back-prim))
  obj
  )

;; definition for method 7 of type jngpusher
;; INFO: Return type mismatch process-drawable vs jngpusher.
(defmethod relocate jngpusher ((obj jngpusher) (arg0 int))
  (if (nonzero? (-> obj back-prim))
      (&+! (-> obj back-prim) arg0)
      )
  (the-as
    jngpusher
    ((the-as (function process-drawable int process-drawable) (find-parent-method jngpusher 7)) obj arg0)
    )
  )

;; failed to figure out what this is:
(defskelgroup *jngpusher-sg* jngpusher 0 2 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 10))

;; failed to figure out what this is:
(defstate jngpusher-idle (jngpusher)
  :trans (the-as (function none :behavior jngpusher) rider-trans)
  :code (behavior ()
    (loop
      (ja :num-func num-func-identity
          :frame-num (get-current-value-with-mirror (-> self sync) (the float (ja-num-frames 0)))
          )
      (cond
        ((< (ja-frame-num 0) (the float (/ (ja-num-frames 0) 3)))
         (set! (-> self back-prim prim-core collide-as) (collide-kind))
         (set! (-> self back-prim collide-with) (collide-kind))
         0
         )
        (else
          (set! (-> self back-prim prim-core collide-as) (collide-kind ground-object))
          (set! (-> self back-prim collide-with) (collide-kind target))
          )
        )
      (suspend)
      )
    (none)
    )
  :post (the-as (function none :behavior jngpusher) rider-post)
  )

;; definition for method 11 of type jngpusher
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! jngpusher ((obj jngpusher) (arg0 entity-actor))
  (set! (-> obj mask) (logior (process-mask enemy platform) (-> obj mask)))
  (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))))
    (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
    (set! (-> s4-0 reaction) default-collision-reaction)
    (set! (-> s4-0 no-reaction)
          (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
          )
    (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 ground-object))
      (set! (-> s3-0 collide-with) (collide-kind target))
      (set! (-> s3-0 prim-core action) (collide-action solid ca-1))
      (set! (-> s3-0 transform-index) 0)
      (set-vector! (-> s3-0 local-sphere) -32768.0 -8192.0 0.0 32768.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 ground-object))
        (set! (-> s2-0 collide-with) (collide-kind target))
        (set! (-> s2-0 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-0 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-0 transform-index) 4)
        (set-vector! (-> s2-0 local-sphere) 8192.0 0.0 0.0 20480.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 0))))
        (set! (-> s2-1 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s2-1 collide-with) (collide-kind target))
        (set! (-> s2-1 prim-core action) (collide-action solid ca-1))
        (set! (-> s2-1 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-1 transform-index) 4)
        (set-vector! (-> s2-1 local-sphere) 36864.0 0.0 0.0 20480.0)
        (append-prim s3-0 s2-1)
        (set! (-> obj back-prim) 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) s4-0)
    )
  (process-drawable-from-entity! obj arg0)
  (initialize-skeleton obj *jngpusher-sg* '())
  (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.15 0.15)
  (go jngpusher-idle)
  (none)
  )

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

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

;; definition for symbol ripple-for-jungle-water, type ripple-wave-set
(define ripple-for-jungle-water (new 'static 'ripple-wave-set
                                  :count 3
                                  :converted #f
                                  :normal-scale 1.5
                                  :wave (new 'static 'inline-array ripple-wave 4
                                    (new 'static 'ripple-wave :scale 30.0 :xdiv -2 :speed 4.0)
                                    (new 'static 'ripple-wave :scale 30.0 :xdiv 1 :zdiv -1 :speed 4.0)
                                    (new 'static 'ripple-wave :scale 10.0 :xdiv -5 :zdiv -3 :speed 2.0)
                                    (new 'static 'ripple-wave)
                                    )
                                  )
        )

;; definition for method 22 of type jungle-water
;; INFO: Return type mismatch ripple-wave-set vs none.
(defmethod TODO-RENAME-22 jungle-water ((obj jungle-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-jungle-water)
    )
  (none)
  )
