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

(import "goal_src/jak1/import/lavafallsewerb-ag.gc")
(import "goal_src/jak1/import/lavashortcut-ag.gc")
(import "goal_src/jak1/import/lavabase-ag.gc")
(import "goal_src/jak1/import/lavafallsewera-ag.gc")
(import "goal_src/jak1/import/chainmine-ag.gc")
(import "goal_src/jak1/import/lavafall-ag.gc")
(import "goal_src/jak1/import/lavaballoon-ag.gc")
(import "goal_src/jak1/import/darkecobarrel-ag.gc")
(import "goal_src/jak1/import/lavayellowtarp-ag.gc")

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

;; failed to figure out what this is:
(defpartgroup group-darkecobarrel-hit
  :id 540
  :flags (use-local-clock)
  :bounds (static-bspherem 0 0 0 8)
  :parts ((sp-item 1932 :period 15 :length 5))
  )

;; failed to figure out what this is:
(defpart 1932
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
    (sp-flt spt-num 1.0)
    (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0)
    (sp-rnd-flt spt-y (meters 4) (meters 2) 1.0)
    (sp-rnd-flt spt-z (meters -2) (meters 4) 1.0)
    (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0)
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 0.0 96.0 1.0)
    (sp-rnd-flt spt-g 0.0 32.0 1.0)
    (sp-rnd-flt spt-b 64.0 32.0 1.0)
    (sp-rnd-flt spt-a 32.0 32.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0.08) (meters 0.04) 1.0)
    (sp-flt spt-scalevel-x (meters 0.02))
    (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.14222223)
    (sp-rnd-flt spt-accel-y -0.34133333 -0.34133333 1.0)
    (sp-flt spt-friction 0.9)
    (sp-int spt-timer 510)
    (sp-cpuinfo-flags bit2 bit14)
    )
  )

;; failed to figure out what this is:
(defpartgroup group-darkecobarrel-explode
  :id 541
  :flags (use-local-clock)
  :bounds (static-bspherem 0 0 0 8)
  :parts ((sp-item 2125 :period 600 :length 5)
    (sp-item 2126 :period 600 :length 40)
    (sp-item 2127 :period 600 :length 20)
    (sp-item 2128 :period 600 :length 20)
    (sp-item 2166 :fade-after (meters 100) :period 600 :length 20 :binding 296)
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    )
  )

;; failed to figure out what this is:
(defpart 2166
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2))
    (sp-flt spt-num 8.0)
    (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0)
    (sp-rnd-flt spt-y (meters -2) (meters 4) 1.0)
    (sp-rnd-flt spt-z (meters -2) (meters 4) 1.0)
    (sp-flt spt-scale-x (meters 0.1))
    (sp-copy-from-other spt-scale-y -4)
    (sp-flt spt-a 0.0)
    (sp-rnd-flt spt-vel-y (meters 0.10666667) (meters 0.053333335) 1.0)
    (sp-flt spt-accel-y -1.3653333)
    (sp-flt spt-friction 0.94)
    (sp-int spt-timer 240)
    (sp-cpuinfo-flags bit3)
    (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
    )
  )

;; failed to figure out what this is:
(defpart 2126
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
    (sp-flt spt-num 8.0)
    (sp-flt spt-y (meters 0))
    (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 64.0 128.0 1.0)
    (sp-rnd-flt spt-g 0.0 32.0 1.0)
    (sp-rnd-flt spt-b 96.0 64.0 1.0)
    (sp-rnd-flt spt-a 32.0 96.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0.053333335) (meters 0.21333334) 1.0)
    (sp-flt spt-scalevel-x (meters -0.0026666666))
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-rnd-flt spt-accel-y -0.68266666 -0.68266666 1.0)
    (sp-flt spt-friction 0.9)
    (sp-int spt-timer 300)
    (sp-cpuinfo-flags bit2 bit14)
    (sp-int-plain-rnd spt-next-time 30 89 1)
    (sp-launcher-by-id spt-next-launcher 2129)
    (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-conerot-radius (meters 2) (meters 4) 1.0)
    )
  )

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

;; failed to figure out what this is:
(defpart 2128
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
    (sp-flt spt-num 6.0)
    (sp-flt spt-y (meters 0))
    (sp-flt spt-scale-x (meters 0.4))
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 180.0) 1.0)
    (sp-flt spt-scale-y (meters 16))
    (sp-rnd-flt spt-r 64.0 192.0 1.0)
    (sp-rnd-flt spt-g 0.0 32.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.04))
    (sp-flt spt-fade-a -1.6)
    (sp-int spt-timer 60)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    )
  )

;; failed to figure out what this is:
(defpart 2125
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2))
    (sp-flt spt-num 1.0)
    (sp-flt spt-y (meters 0))
    (sp-flt spt-scale-x (meters 32))
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 64.0 192.0 1.0)
    (sp-rnd-flt spt-g 0.0 32.0 1.0)
    (sp-rnd-flt spt-b 128.0 64.0 1.0)
    (sp-flt spt-a 128.0)
    (sp-flt spt-fade-a -2.3272727)
    (sp-int spt-timer 54)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    )
  )

;; failed to figure out what this is:
(defpart 2127
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
    (sp-flt spt-num 16.0)
    (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 4) (meters 2) 1.0)
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 0.0 96.0 1.0)
    (sp-rnd-flt spt-g 0.0 32.0 1.0)
    (sp-rnd-flt spt-b 64.0 32.0 1.0)
    (sp-rnd-flt spt-a 64.0 64.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0.08) (meters 0.04) 1.0)
    (sp-flt spt-scalevel-x (meters 0.02))
    (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.28444445)
    (sp-rnd-flt spt-accel-y 0.68266666 0.68266666 1.0)
    (sp-flt spt-friction 0.8)
    (sp-int spt-timer 510)
    (sp-cpuinfo-flags bit2 bit14)
    (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.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 6) 1.0)
    )
  )

;; definition of type darkecobarrel-leak
(deftype darkecobarrel-leak (structure)
  ((offset      vector :inline :offset-assert   0)
   (first-frame basic          :offset-assert  16)
   )
  :method-count-assert 9
  :size-assert         #x14
  :flag-assert         #x900000014
  )

;; definition for method 3 of type darkecobarrel-leak
(defmethod inspect darkecobarrel-leak ((obj darkecobarrel-leak))
  (format #t "[~8x] ~A~%" obj 'darkecobarrel-leak)
  (format #t "~Toffset: #<vector @ #x~X>~%" (-> obj offset))
  (format #t "~Tfirst-frame: ~A~%" (-> obj first-frame))
  obj
  )

;; definition of type darkecobarrel-base
(deftype darkecobarrel-base (process-drawable)
  ((root-override collide-shape-moving  :offset        112)
   (speed         float                 :offset-assert 176)
   (sync          time-frame            :offset-assert 184)
   )
  :heap-base #x50
  :method-count-assert 20
  :size-assert         #xc0
  :flag-assert         #x14005000c0
  )

;; definition for method 3 of type darkecobarrel-base
(defmethod inspect darkecobarrel-base ((obj darkecobarrel-base))
  (let ((t9-0 (method-of-type process-drawable inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tspeed: ~f~%" (-> obj speed))
  (format #t "~T~Tsync: ~D~%" (-> obj sync))
  obj
  )

;; definition of type darkecobarrel-mover
(deftype darkecobarrel-mover (darkecobarrel-base)
  ((start-time   time-frame                    :offset-assert 192)
   (hits         int32                         :offset-assert 200)
   (leak         darkecobarrel-leak  1 :inline :offset-assert 208)
   (y-offset     bouncing-float      :inline   :offset-assert 240)
   (y-offset-tgt delayed-rand-float  :inline   :offset-assert 280)
   (down         oscillating-vector  :inline   :offset-assert 320)
   (down-tgt     delayed-rand-vector :inline   :offset-assert 384)
   )
  :heap-base #x140
  :method-count-assert 20
  :size-assert         #x1b0
  :flag-assert         #x14014001b0
  (:states
    darkecobarrel-mover-die
    darkecobarrel-mover-move
    )
  )

;; definition for method 3 of type darkecobarrel-mover
(defmethod inspect darkecobarrel-mover ((obj darkecobarrel-mover))
  (let ((t9-0 (method-of-type darkecobarrel-base inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tstart-time: ~D~%" (-> obj start-time))
  (format #t "~T~Thits: ~D~%" (-> obj hits))
  (format #t "~T~Tleak[1] @ #x~X~%" (-> obj leak))
  (format #t "~T~Ty-offset: #<bouncing-float @ #x~X>~%" (-> obj y-offset))
  (format #t "~T~Ty-offset-tgt: #<delayed-rand-float @ #x~X>~%" (-> obj y-offset-tgt))
  (format #t "~T~Tdown: #<oscillating-vector @ #x~X>~%" (-> obj down))
  (format #t "~T~Tdown-tgt: #<delayed-rand-vector @ #x~X>~%" (-> obj down-tgt))
  obj
  )

;; definition of type darkecobarrel
(deftype darkecobarrel (darkecobarrel-base)
  ((self-override darkecobarrel  :offset         28)
   (spawn-array   (array int64)  :offset-assert 192)
   (cur-spawn     int32          :offset-assert 196)
   )
  :heap-base #x60
  :method-count-assert 20
  :size-assert         #xc8
  :flag-assert         #x14006000c8
  (:states
    darkecobarrel-spawner
    )
  )

;; definition for method 3 of type darkecobarrel
(defmethod inspect darkecobarrel ((obj darkecobarrel))
  (let ((t9-0 (method-of-type darkecobarrel-base inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tspawn-array: ~A~%" (-> obj spawn-array))
  (format #t "~T~Tcur-spawn: ~D~%" (-> obj cur-spawn))
  obj
  )

;; definition for method 7 of type darkecobarrel
;; INFO: Return type mismatch darkecobarrel-base vs darkecobarrel.
(defmethod relocate darkecobarrel ((obj darkecobarrel) (arg0 int))
  (if (nonzero? (-> obj spawn-array))
      (&+! (-> obj spawn-array) arg0)
      )
  (the-as
    darkecobarrel
    ((the-as (function darkecobarrel-base int darkecobarrel-base) (find-parent-method darkecobarrel 7)) obj arg0)
    )
  )

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

;; definition for function darkecobarrel-base-time
(defbehavior darkecobarrel-base-time darkecobarrel-base ()
  (+ (-> *display* base-frame-counter) (-> self sync))
  )

;; definition for function darkecobarrel-base-pos
(defbehavior darkecobarrel-base-pos darkecobarrel-base ((arg0 time-frame))
  (if (< 0.0 (-> self speed))
      (* (-> self speed) (the float (- (darkecobarrel-base-time) arg0)))
      (+ 1.0 (* (-> self speed) (the float (- (darkecobarrel-base-time) arg0))))
      )
  )

;; definition for function darkecobarrel-base-done?
(defbehavior darkecobarrel-base-done? darkecobarrel-base ((arg0 float))
  (or (and (< 0.0 (-> self speed)) (< 1.0 arg0)) (and (< (-> self speed) 0.0) (< arg0 0.0)))
  )

;; definition for function darkecobarrel-base-init
(defbehavior darkecobarrel-base-init darkecobarrel-base ((arg0 res-lump))
  (process-drawable-from-entity! self (the-as entity-actor arg0))
  (initialize-skeleton self *darkecobarrel-sg* '())
  (set! (-> self path) (new 'process 'path-control self 'path 0.0))
  (let ((v0-3 (logior (-> self path flags) (path-control-flag display draw-line draw-point draw-text))))
    (set! (-> self path flags) v0-3)
    v0-3
    )
  )

;; definition for function darkecobarrel-mover-pos
;; INFO: Return type mismatch uint vs none.
;; Used lq/sq
(defbehavior darkecobarrel-mover-pos darkecobarrel-mover ()
  (let ((f30-0 (darkecobarrel-base-pos (-> self start-time))))
    (if (darkecobarrel-base-done? f30-0)
        (deactivate self)
        )
    (eval-path-curve! (-> self path) (-> self root-override trans) f30-0 'interp)
    (+! (-> self root-override trans y) (* 4096.0 (-> self y-offset osc value)))
    (set! (-> self root-override trans y) (+ -4096.0 (-> self root-override trans y)))
    (let ((s5-0 (new 'stack-no-clear 'vector))
          (gp-0 (new 'stack-no-clear 'matrix))
          )
      (let ((s4-0 (new 'stack-no-clear 'vector)))
        (TODO-RENAME-14 (-> self path) s5-0 f30-0)
        (set! (-> s4-0 quad) (-> self down value quad))
        (set! (-> s4-0 y) -1.0)
        (vector-normalize! s4-0 1.0)
        (forward-down-nopitch->inv-matrix gp-0 s5-0 s4-0)
        )
      (matrix->quaternion (-> self root-override quat) gp-0)
      (dotimes (s5-1 (-> self hits))
        (when (-> self leak s5-1 first-frame)
          (set! (-> self leak s5-1 first-frame) #f)
          (let ((s4-1 (new 'stack-no-clear 'matrix)))
            (matrix-transpose! s4-1 gp-0)
            (vector-matrix*! (the-as vector (-> self leak s5-1)) (the-as vector (-> self leak s5-1)) s4-1)
            )
          )
        (let ((s4-2 (new 'stack-no-clear 'vector)))
          (vector-matrix*! s4-2 (the-as vector (-> self leak s5-1)) gp-0)
          (vector+! s4-2 s4-2 (-> self root-override trans))
          (spawn (-> self part) s4-2)
          )
        )
      )
    )
  (if (< (vector-vector-xz-distance-squared (-> self root-override trans) (camera-pos)) 1073741800.0)
      (logior! (-> self draw status) (draw-status skip-bones))
      (set! (-> self draw status) (the-as draw-status (logclear (-> self draw status) (draw-status skip-bones))))
      )
  (none)
  )

;; failed to figure out what this is:
(defstate darkecobarrel-mover-die (darkecobarrel-mover)
  :code (behavior ()
    (ja-channel-set! 0)
    (clear-collide-with-as (-> self root-override))
    (ja-post)
    (sound-play "dcrate-break")
    (let ((gp-1 (new 'stack-no-clear 'vector)))
      (set! (-> gp-1 quad) (-> self root-override trans quad))
      (set! (-> gp-1 y) (+ -49152.0 (-> gp-1 y)))
      (process-spawn
        part-tracker
        :init part-tracker-init
        (-> *part-group-id-table* 541)
        600
        #f
        #f
        #f
        gp-1
        :to *entity-pool*
        )
      )
    (suspend)
    (set! (-> self state-time) (-> *display* base-frame-counter))
    (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1))
      (suspend)
      )
    (cleanup-for-death self)
    (deactivate self)
    (none)
    )
  )

;; failed to figure out what this is:
(defstate darkecobarrel-mover-move (darkecobarrel-mover)
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (case arg2
      (('touch 'attack)
       (cond
         ((= arg0 *target*)
          (let ((s5-0 (-> arg3 param 0)))
            (if (and s5-0
                     ((method-of-type touching-shapes-entry prims-touching?)
                      (the-as touching-shapes-entry s5-0)
                      (-> self root-override)
                      (the-as uint 1)
                      )
                     (send-event arg0 'attack-invinc s5-0 (static-attack-info ((mode 'death))))
                     )
                (go darkecobarrel-mover-die)
                )
            )
          )
         ((>= arg1 2)
          (case (-> arg3 param 1)
            (('eco-yellow)
             (+! (-> self hits) 1)
             (cond
               ((>= (-> self hits) 2)
                (go darkecobarrel-mover-die)
                )
               (else
                 (let ((v1-17 (if (and (nonzero? arg0) (type-type? (-> arg0 type) process-drawable))
                                  arg0
                                  )
                              )
                       (gp-1 (new 'stack-no-clear 'vector))
                       )
                   (set! (-> self leak (+ (-> self hits) -1) first-frame) #t)
                   (cond
                     (v1-17
                       (vector-! gp-1 (-> (the-as process-drawable v1-17) root trans) (-> self root-override trans))
                       (set! (-> self leak (+ (-> self hits) -1) offset quad) (-> gp-1 quad))
                       (vector-normalize! gp-1 -0.04)
                       (let ((v0-0 (the-as object (-> self down vel))))
                         (set! (-> (the-as vector v0-0) quad) (-> gp-1 quad))
                         v0-0
                         )
                       )
                     (else
                       (set! (-> self leak (+ (-> self hits) -1) offset quad) (-> self root-override trans quad))
                       (let ((f0-1 (+ -49152.0 (-> self leak (+ (-> self hits) -1) offset y))))
                         (set! (-> self leak (+ (-> self hits) -1) offset y) f0-1)
                         f0-1
                         )
                       )
                     )
                   )
                 )
               )
             )
            )
          )
         )
       )
      )
    )
  :trans (behavior ()
    (update! (-> self y-offset) 0.0)
    (if (and (at-min? (-> self y-offset)) (< (-> self y-offset osc vel) 0.03))
        (set! (-> self y-offset osc vel) (fabs (update! (-> self y-offset-tgt))))
        )
    (update! (-> self down) (update-with-delay! (-> self down-tgt)))
    (darkecobarrel-mover-pos)
    (none)
    )
  :code (behavior ()
    (let ((f30-0 0.9)
          (f28-0 0.25)
          )
      (+ f30-0 (* f28-0 (rand-float-gen)))
      )
    (let ((gp-0 (-> self skel root-channel 0)))
      (set! (-> gp-0 num-func) num-func-identity)
      (set! (-> gp-0 frame-num) (* (rand-float-gen) (the float (ja-num-frames 0))))
      )
    (loop
      (ja :num-func num-func-identity :frame-num 0.0)
      (suspend)
      )
    (none)
    )
  :post (the-as (function none :behavior darkecobarrel-mover) pusher-post)
  )

;; definition for function darkecobarrel-mover-init-by-other
;; INFO: Return type mismatch object vs none.
(defbehavior darkecobarrel-mover-init-by-other darkecobarrel-mover ((arg0 res-lump) (arg1 float) (arg2 time-frame) (arg3 time-frame))
  (let ((s2-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player))))
    (set! (-> s2-0 dynam) (copy *standard-dynamics* 'process))
    (set! (-> s2-0 reaction) default-collision-reaction)
    (set! (-> s2-0 no-reaction)
          (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
          )
    (let ((s1-0 (new 'process 'collide-shape-prim-group s2-0 (the-as uint 2) 0)))
      (set! (-> s1-0 prim-core collide-as) (collide-kind ground-object))
      (set! (-> s1-0 collide-with) (collide-kind target))
      (set! (-> s1-0 prim-core action) (collide-action solid))
      (set! (-> s1-0 transform-index) 3)
      (set-vector! (-> s1-0 local-sphere) 0.0 -32768.0 0.0 32768.0)
      (set-root-prim! s2-0 s1-0)
      (let ((s0-0 (new 'process 'collide-shape-prim-mesh s2-0 (the-as uint 0) (the-as uint 1))))
        (set! (-> s0-0 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s0-0 collide-with) (collide-kind target))
        (set! (-> s0-0 prim-core action) (collide-action solid))
        (set! (-> s0-0 prim-core offense) (collide-offense indestructible))
        (set! (-> s0-0 transform-index) 3)
        (set-vector! (-> s0-0 local-sphere) 0.0 -32768.0 0.0 32768.0)
        (append-prim s1-0 s0-0)
        )
      (let ((s0-1 (new 'process 'collide-shape-prim-mesh s2-0 (the-as uint 1) (the-as uint 0))))
        (set! (-> s0-1 prim-core collide-as) (collide-kind ground-object))
        (set! (-> s0-1 collide-with) (collide-kind target))
        (set! (-> s0-1 prim-core action) (collide-action solid))
        (set! (-> s0-1 prim-core offense) (collide-offense indestructible))
        (set! (-> s0-1 transform-index) 3)
        (set-vector! (-> s0-1 local-sphere) 0.0 -32768.0 0.0 32768.0)
        (append-prim s1-0 s0-1)
        )
      )
    (set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w)))
    (backup-collide-with-as s2-0)
    (set! (-> self root-override) s2-0)
    )
  (darkecobarrel-base-init arg0)
  (set! (-> self part) (create-launch-control (-> *part-group-id-table* 540) self))
  (set! (-> self speed) arg1)
  (set! (-> self start-time) arg2)
  (set! (-> self sync) arg3)
  (set! (-> self hits) 0)
  (set-params! (-> self y-offset-tgt) 300 900 0.5)
  (set-params! (-> self y-offset) 0.0 1.0 0.0 0.7 0.08 0.1 0.97)
  (set-params! (-> self down) (the-as vector #f) 0.005 0.05 0.999)
  (set-params! (-> self down-tgt) 300 600 0.05 0.9)
  (darkecobarrel-mover-pos)
  (logclear! (-> self mask) (process-mask actor-pause))
  (set! (-> self mask) (logior (process-mask attackable) (-> self mask)))
  (go darkecobarrel-mover-move)
  (none)
  )

;; definition for function darkecobarrel-advance-curspawn
;; INFO: Return type mismatch int vs none.
(defbehavior darkecobarrel-advance-curspawn darkecobarrel ()
  (+! (-> self cur-spawn) 1)
  (when (>= (-> self cur-spawn) (-> self spawn-array length))
    (set! (-> self self-override cur-spawn) 0)
    0
    )
  (none)
  )

;; definition for function darkecobarrel-cycle-time
(defbehavior darkecobarrel-cycle-time darkecobarrel ()
  (-> self spawn-array (+ (-> self spawn-array length) -1))
  )

;; failed to figure out what this is:
(defstate darkecobarrel-spawner (darkecobarrel)
  :trans (behavior ()
    (let ((gp-1 (mod (darkecobarrel-base-time) (darkecobarrel-cycle-time))))
      (if (and (> (-> self cur-spawn) 0) (< gp-1 (-> self spawn-array (+ (-> self cur-spawn) -1))))
          (+! gp-1 (darkecobarrel-cycle-time))
          )
      (let ((gp-2 (- gp-1 (-> self spawn-array (-> self cur-spawn)))))
        (when (>= gp-2 0)
          (process-spawn
            darkecobarrel-mover
            (-> self entity)
            (-> self speed)
            (- (darkecobarrel-base-time) (the-as time-frame gp-2))
            (-> self sync)
            :to self
            )
          (darkecobarrel-advance-curspawn)
          )
        )
      )
    (if (nonzero? (-> self sound))
        (update! (-> self sound))
        )
    (none)
    )
  :code (behavior ()
    (loop
      (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
      (until (ja-done? 0)
        (suspend)
        (ja :num! (seek!))
        )
      )
    (none)
    )
  )

;; definition for method 11 of type darkecobarrel
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defmethod init-from-entity! darkecobarrel ((obj darkecobarrel) (arg0 entity-actor))
  (local-vars (sv-16 res-tag))
  (set! (-> obj root-override) (the-as collide-shape-moving (new 'process 'trsqv)))
  (darkecobarrel-base-init arg0)
  (set! (-> obj sound)
        (new 'process 'ambient-sound (static-sound-spec "lav-dark-eco" :fo-max 30) (-> obj root-override trans))
        )
  (logior! (-> obj draw status) (draw-status hidden))
  (set! (-> obj speed) (/ 300.0 (res-lump-float (-> obj entity) 'speed :default 61440.0)))
  (set! sv-16 (new 'static 'res-tag))
  (let ((s5-1 (res-lump-data arg0 'delay pointer :tag-ptr (& sv-16))))
    (cond
      (s5-1
        (set! (-> obj spawn-array)
              (the-as (array int64) (new 'process 'boxed-array time-frame (the-as int (-> sv-16 elt-count))))
              )
        (dotimes (v1-12 (the-as int (-> sv-16 elt-count)))
          (set! (-> obj spawn-array v1-12)
                (the int (* (fabs (-> obj speed)) (-> (the-as (pointer float) (&+ s5-1 (* v1-12 4))))))
                )
          )
        )
      (else
        (set! (-> obj spawn-array) (the-as (array int64) (new 'process 'boxed-array time-frame 4)))
        (set! (-> obj spawn-array 0) (the int (* 45056.0 (fabs (-> obj speed)))))
        (set! (-> obj spawn-array 1) (the int (* 90112.0 (fabs (-> obj speed)))))
        (set! (-> obj spawn-array 2) (the int (* 45056.0 (fabs (-> obj speed)))))
        (set! (-> obj spawn-array 3) (the int (* 135168.0 (fabs (-> obj speed)))))
        )
      )
    )
  (dotimes (v1-19 (+ (-> obj spawn-array length) -1))
    (+! (-> obj spawn-array (+ v1-19 1)) (-> obj spawn-array v1-19))
    )
  (set! (-> obj sync)
        (the-as time-frame (the int (* (fabs (-> obj speed)) (res-lump-float (-> obj entity) 'sync))))
        )
  (set! (-> obj speed) (/ 1.0 (* (-> obj speed) (path-distance (-> obj path)))))
  (let ((s5-3 (mod (darkecobarrel-base-time) (darkecobarrel-cycle-time))))
    (set! (-> obj cur-spawn) 0)
    (while (>= s5-3 (-> obj spawn-array (-> obj cur-spawn)))
      (darkecobarrel-advance-curspawn)
      )
    (+! (-> obj cur-spawn) -1)
    (when (< (-> obj cur-spawn) 0)
      (set! (-> obj cur-spawn) (+ (-> obj spawn-array length) -1))
      (+! s5-3 (-> obj spawn-array (-> obj cur-spawn)))
      )
    (let ((s4-0 (-> obj cur-spawn))
          (s5-4 (- (darkecobarrel-base-time) (the-as time-frame (- s5-3 (-> obj spawn-array (-> obj cur-spawn))))))
          )
      (until (darkecobarrel-base-done? (darkecobarrel-base-pos s5-4))
        (process-spawn darkecobarrel-mover (-> obj entity) (-> obj speed) s5-4 (-> obj sync) :to obj)
        (set! s5-4 (- s5-4 (the-as time-frame (-> obj spawn-array s4-0))))
        (+! s4-0 -1)
        (if (< s4-0 0)
            (set! s4-0 (+ (-> obj spawn-array length) -1))
            (+! s5-4 (-> obj spawn-array s4-0))
            )
        )
      )
    )
  (darkecobarrel-advance-curspawn)
  (go darkecobarrel-spawner)
  (none)
  )

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

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

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

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

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

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

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

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

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

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

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

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

;; failed to figure out what this is:
(defpartgroup group-chainmine-explode
  :id 542
  :flags (use-local-clock)
  :bounds (static-bspherem 0 0 0 8)
  :parts ((sp-item 2132 :period 600 :length 5)
    (sp-item 2133 :period 600 :length 40)
    (sp-item 2134 :period 600 :length 20)
    (sp-item 2135 :period 600 :length 20)
    )
  )

;; failed to figure out what this is:
(defpart 2133
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
    (sp-flt spt-num 8.0)
    (sp-flt spt-y (meters 0))
    (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 192.0 64.0 1.0)
    (sp-rnd-flt spt-g 192.0 64.0 1.0)
    (sp-flt spt-b 128.0)
    (sp-rnd-flt spt-a 32.0 96.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0.053333335) (meters 0.21333334) 1.0)
    (sp-flt spt-scalevel-x (meters -0.0026666666))
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-flt spt-fade-g -2.1333334)
    (sp-flt spt-fade-b -1.4222223)
    (sp-rnd-flt spt-accel-y -0.68266666 -0.68266666 1.0)
    (sp-flt spt-friction 0.9)
    (sp-int spt-timer 300)
    (sp-cpuinfo-flags bit2 bit14)
    (sp-int-plain-rnd spt-next-time 30 89 1)
    (sp-launcher-by-id spt-next-launcher 2136)
    (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-conerot-radius (meters 2) (meters 4) 1.0)
    )
  )

;; failed to figure out what this is:
(defpart 2136
  :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0) (sp-flt spt-fade-a -1.0666667))
  )

;; failed to figure out what this is:
(defpart 2135
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
    (sp-flt spt-num 6.0)
    (sp-flt spt-y (meters 0))
    (sp-flt spt-scale-x (meters 0.4))
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 180.0) 1.0)
    (sp-flt spt-scale-y (meters 16))
    (sp-flt spt-r 255.0)
    (sp-flt spt-g 196.0)
    (sp-flt spt-b 64.0)
    (sp-rnd-flt spt-a 32.0 64.0 1.0)
    (sp-flt spt-scalevel-y (meters 1.04))
    (sp-flt spt-fade-g -3.2666667)
    (sp-flt spt-fade-b -1.0666667)
    (sp-flt spt-fade-a -1.6)
    (sp-int spt-timer 60)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    )
  )

;; failed to figure out what this is:
(defpart 2132
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2))
    (sp-flt spt-num 1.0)
    (sp-flt spt-y (meters 0))
    (sp-flt spt-scale-x (meters 32))
    (sp-copy-from-other spt-scale-y -4)
    (sp-flt spt-r 255.0)
    (sp-rnd-flt spt-g 192.0 32.0 1.0)
    (sp-flt spt-b 128.0)
    (sp-flt spt-a 128.0)
    (sp-flt spt-fade-a -2.3272727)
    (sp-int spt-timer 54)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    )
  )

;; failed to figure out what this is:
(defpart 2134
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
    (sp-flt spt-num 16.0)
    (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 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 255.0)
    (sp-rnd-flt spt-g 128.0 64.0 1.0)
    (sp-flt spt-b 128.0)
    (sp-rnd-flt spt-a 64.0 64.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0.08) (meters 0.04) 1.0)
    (sp-flt spt-scalevel-x (meters 0.02))
    (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.28444445)
    (sp-rnd-flt spt-accel-y 0.68266666 0.68266666 1.0)
    (sp-flt spt-friction 0.8)
    (sp-int spt-timer 510)
    (sp-cpuinfo-flags bit2 bit14)
    (sp-int spt-next-time 42)
    (sp-launcher-by-id spt-next-launcher 2137)
    (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.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 2) 1.0)
    )
  )

;; failed to figure out what this is:
(defpart 2137
  :init-specs ((sp-flt spt-fade-r -1.0666667)
    (sp-flt spt-fade-g -1.0666667)
    (sp-flt spt-fade-b -2.1166666)
    (sp-int spt-next-time 60)
    (sp-launcher-by-id spt-next-launcher 2138)
    )
  )

;; failed to figure out what this is:
(defpart 2138
  :init-specs ((sp-flt spt-fade-r -0.5688889)
    (sp-flt spt-fade-g -0.28444445)
    (sp-flt spt-fade-b 0.0)
    (sp-flt spt-fade-a -0.21333334)
    (sp-int spt-next-time 225)
    (sp-launcher-by-id spt-next-launcher 2139)
    )
  )

;; failed to figure out what this is:
(defpart 2139
  :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-g 0.0) (sp-flt spt-fade-b 0.0))
  )

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

;; failed to figure out what this is:
(defstate die (chainmine)
  :virtual #t
  :code (behavior ()
    (ja-channel-set! 0)
    (clear-collide-with-as (-> self root-override))
    (ja-post)
    (sound-play "dcrate-break")
    (let ((gp-1 (new 'stack-no-clear 'vector)))
      (set! (-> gp-1 quad) (-> self root-override trans quad))
      (set! (-> gp-1 y) (+ -73728.0 (-> gp-1 y)))
      (process-spawn
        part-tracker
        :init part-tracker-init
        (-> *part-group-id-table* 542)
        600
        #f
        #f
        #f
        gp-1
        :to *entity-pool*
        )
      )
    (suspend)
    (set! (-> self state-time) (-> *display* base-frame-counter))
    (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1))
      (suspend)
      )
    (cleanup-for-death self)
    (deactivate self)
    (none)
    )
  )

;; failed to figure out what this is:
(defstate idle (chainmine)
  :virtual #t
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (case arg2
      (('attack 'touch)
       (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'deadly))))
       (go-virtual die)
       )
      )
    )
  :code (behavior ()
    (loop
      (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
      (until (ja-done? 0)
        (if (nonzero? (-> self sound))
            (update! (-> self sound))
            )
        (suspend)
        (ja :num! (seek!))
        )
      )
    (none)
    )
  :post (the-as (function none :behavior chainmine) ja-post)
  )

;; definition for method 11 of type chainmine
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! chainmine ((obj chainmine) (arg0 entity-actor))
  (set! (-> obj mask) (logior (process-mask attackable) (-> obj mask)))
  (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-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-sphere s4-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))
      (set! (-> s3-0 prim-core offense) (collide-offense indestructible))
      (set! (-> s3-0 transform-index) 0)
      (set-vector! (-> s3-0 local-sphere) 0.0 -73728.0 0.0 18432.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 *chainmine-sg* '())
  (set! (-> obj sound)
        (new 'process 'ambient-sound (static-sound-spec "lava-mine-chain" :fo-max 30) (-> obj root-override trans))
        )
  (go (method-of-object obj idle))
  (none)
  )

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

;; definition of type lavaballoon
(deftype lavaballoon (process-drawable)
  ((root-override collide-shape  :offset        112)
   (move-per-tick float          :offset-assert 176)
   )
  :heap-base #x50
  :method-count-assert 22
  :size-assert         #xb4
  :flag-assert         #x16005000b4
  (:methods
    (idle () _type_ :state 20)
    (die () _type_ :state 21)
    )
  )

;; definition for method 3 of type lavaballoon
(defmethod inspect lavaballoon ((obj lavaballoon))
  (let ((t9-0 (method-of-type process-drawable inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tmove-per-tick: ~f~%" (-> obj move-per-tick))
  obj
  )

;; failed to figure out what this is:
(defpartgroup group-lavaballoon
  :id 543
  :duration 5
  :bounds (static-bspherem 0 0 0 15)
  :parts ((sp-item 1987) (sp-item 1988) (sp-item 1989))
  )

;; failed to figure out what this is:
(defpart 1988
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
    (sp-flt spt-num 8.0)
    (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 3) (meters 3) 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 96.0)
    (sp-flt spt-g 96.0)
    (sp-flt spt-b 255.0)
    (sp-rnd-flt spt-a 32.0 32.0 1.0)
    (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0)
    (sp-flt spt-fade-a -0.42666668)
    (sp-int spt-timer 150)
    (sp-cpuinfo-flags bit2 bit3)
    )
  )

;; failed to figure out what this is:
(defpart 1989
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
    (sp-flt spt-num 16.0)
    (sp-flt spt-y (meters 2))
    (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1) 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 96.0)
    (sp-flt spt-g 96.0)
    (sp-flt spt-b 255.0)
    (sp-rnd-flt spt-a 32.0 32.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0.04) (meters 0.08) 1.0)
    (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0)
    (sp-flt spt-fade-a -0.85333335)
    (sp-flt spt-friction 0.98)
    (sp-int spt-timer 75)
    (sp-cpuinfo-flags bit2 bit3)
    (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
    (sp-flt spt-conerot-radius (meters 1.5))
    )
  )

;; failed to figure out what this is:
(defpart 1987
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2))
    (sp-flt spt-num 1.0)
    (sp-flt spt-y (meters 2))
    (sp-flt spt-scale-x (meters 12))
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 100.0 28.0 1.0)
    (sp-flt spt-g 100.0)
    (sp-flt spt-b 80.0)
    (sp-flt spt-a 96.0)
    (sp-flt spt-fade-a -0.08)
    (sp-int spt-timer 15)
    (sp-cpuinfo-flags bit2 bit3)
    )
  )

;; failed to figure out what this is:
(defstate die (lavaballoon)
  :virtual #t
  :code (behavior ()
    (ja-channel-set! 0)
    (clear-collide-with-as (-> self root-override))
    (ja-post)
    (sound-play "cool-balloon")
    (process-spawn
      part-tracker
      :init part-tracker-init
      (-> *part-group-id-table* 543)
      -1
      #f
      #f
      #f
      (-> self root-override trans)
      :to *entity-pool*
      )
    (suspend)
    (cleanup-for-death self)
    (deactivate self)
    (none)
    )
  )

;; failed to figure out what this is:
(defstate idle (lavaballoon)
  :virtual #t
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (case arg2
      (('attack)
       (send-event arg0 'heat -10.0)
       (go-virtual die)
       )
      )
    )
  :trans (behavior ()
    (when (zero? (logand (-> self path flags) (path-control-flag not-found)))
      (let ((f0-4 (* 0.5 (+ 1.0 (sin (* (-> self move-per-tick) (the float (-> *display* base-frame-counter))))))))
        (eval-path-curve! (-> self path) (-> self root-override trans) f0-4 'interp)
        )
      )
    (none)
    )
  :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 lavaballoon) transform-post)
  )

;; definition for method 11 of type lavaballoon
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! lavaballoon ((obj lavaballoon) (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-sphere s4-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 prim-core offense) (collide-offense indestructible))
      (set-vector! (-> s3-0 local-sphere) 0.0 8192.0 0.0 8192.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 *lavaballoon-sg* '())
  (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 543) obj))
  (set! (-> obj root-override pause-adjust-distance) 122880.0)
  (set! (-> obj path) (new 'process 'path-control obj 'path 0.0))
  (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text))
  (when (zero? (logand (-> obj path flags) (path-control-flag not-found)))
    (let ((f30-0 (res-lump-float (-> obj entity) 'speed :default 12288.0)))
      (set! (-> obj move-per-tick) (* 32768.0 (/ 1.0 (* 300.0 (path-distance (-> obj path)))) f30-0))
      )
    )
  (go (method-of-object obj idle))
  (none)
  )

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

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

;; definition for symbol ripple-for-lavatube-lava, type ripple-wave-set
(define ripple-for-lavatube-lava (new 'static 'ripple-wave-set
                                   :count 2
                                   :converted #f
                                   :wave (new 'static 'inline-array ripple-wave 4
                                     (new 'static 'ripple-wave :scale 40.0 :xdiv 2 :speed 3.0)
                                     (new 'static 'ripple-wave :scale 40.0 :xdiv -2 :zdiv 2 :speed 1.8)
                                     (new 'static 'ripple-wave)
                                     (new 'static 'ripple-wave)
                                     )
                                   )
        )

;; failed to figure out what this is:
(defstate water-vol-idle (lavatube-lava)
  :virtual #t
  :post (behavior ()
    (let ((t9-0 (-> (method-of-type water-anim water-vol-idle) post)))
      (if t9-0
          ((the-as (function none :behavior lavatube-lava) t9-0))
          )
      )
    (ja-post)
    (none)
    )
  )

;; definition for method 22 of type lavatube-lava
;; INFO: Return type mismatch symbol vs none.
(defmethod TODO-RENAME-22 lavatube-lava ((obj lavatube-lava))
  (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! (-> v1-2 global-scale) 2048.0)
    (set! (-> v1-2 waveform) ripple-for-lavatube-lava)
    )
  (logclear! (-> obj flags) (water-flags wt23))
  (set! (-> obj flags) (logior (water-flags wt25) (-> obj flags)))
  (set! (-> obj attack-event) 'heat)
  (none)
  )

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

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

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

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

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