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

(import "goal_src/jak1/import/ram-boss-ag.gc")

;; definition of type ram-boss-proj
(deftype ram-boss-proj (projectile)
  ((parent-override (pointer ram-boss)               :offset         12)
   (part2           sparticle-launch-control         :offset-assert 412)
   (launched?       symbol                           :offset-assert 416)
   (growth          float                            :offset-assert 420)
   (charge-sound-id sound-id                         :offset-assert 424)
   (launch-time     time-frame                       :offset-assert 432)
   (facing-dir      vector                   :inline :offset-assert 448)
   )
  :heap-base #x160
  :method-count-assert 29
  :size-assert         #x1d0
  :flag-assert         #x1d016001d0
  (:states
    ram-boss-proj-growing
    ram-boss-proj-launch
    )
  )

;; definition for method 3 of type ram-boss-proj
(defmethod inspect ram-boss-proj ((obj ram-boss-proj))
  (let ((t9-0 (method-of-type projectile inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tpart2: ~A~%" (-> obj part2))
  (format #t "~T~Tlaunched?: ~A~%" (-> obj launched?))
  (format #t "~T~Tgrowth: ~f~%" (-> obj growth))
  (format #t "~T~Tcharge-sound-id: ~D~%" (-> obj charge-sound-id))
  (format #t "~T~Tlaunch-time: ~D~%" (-> obj launch-time))
  (format #t "~T~Tfacing-dir: #<vector @ #x~X>~%" (-> obj facing-dir))
  obj
  )

;; definition of type ram-boss
(deftype ram-boss (nav-enemy)
  ((parent-override          (pointer ram)                    :offset         12)
   (facing-y                 float                            :offset-assert 400)
   (player-dir-y             float                            :offset-assert 404)
   (last-turn-speed          float                            :offset-assert 408)
   (frustration              int32                            :offset-assert 412)
   (dead?                    symbol                           :offset-assert 416)
   (has-shield?              symbol                           :offset-assert 420)
   (proj-stoked              basic                            :offset-assert 424)
   (proj-status              uint64                           :offset-assert 432)
   (part2                    sparticle-launch-control         :offset-assert 440)
   (proj-last-thrown-time    time-frame                       :offset-assert 448)
   (nav-enemy-patrol-timeout time-frame                       :offset-assert 456)
   (proj-launch-vec          vector                   :inline :offset-assert 464)
   (local-throw-point        vector                   :inline :offset-assert 480)
   (shield-jmod              joint-mod-set-local              :offset-assert 496)
   )
  :heap-base #x190
  :method-count-assert 76
  :size-assert         #x1f4
  :flag-assert         #x4c019001f4
  (:methods
    (dummy-51 (_type_ vector) symbol :replace 51)
    (dummy-52 (_type_) symbol :replace 52)
    (dummy-57 (_type_ float) float :replace 57)
    )
  (:states
    (ram-boss-already-down basic)
    ram-boss-forward-defend-block
    ram-boss-idle
    (ram-boss-jump-down basic)
    ram-boss-jump-down-hit-ground
    ram-boss-lose-shield
    ram-boss-nav-resume
    ram-boss-nav-start
    ram-boss-show-anims
    ram-boss-throw
    ram-boss-tracking
    ram-boss-up-defend-block
    )
  )

;; definition for method 3 of type ram-boss
(defmethod inspect ram-boss ((obj ram-boss))
  (let ((t9-0 (method-of-type nav-enemy inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tfacing-y: ~f~%" (-> obj facing-y))
  (format #t "~T~Tplayer-dir-y: ~f~%" (-> obj player-dir-y))
  (format #t "~T~Tlast-turn-speed: ~f~%" (-> obj last-turn-speed))
  (format #t "~T~Tfrustration: ~D~%" (-> obj frustration))
  (format #t "~T~Tdead?: ~A~%" (-> obj dead?))
  (format #t "~T~Thas-shield?: ~A~%" (-> obj has-shield?))
  (format #t "~T~Tproj-stoked: ~A~%" (-> obj proj-stoked))
  (format #t "~T~Tproj-status: ~D~%" (-> obj proj-status))
  (format #t "~T~Tpart2: ~A~%" (-> obj part2))
  (format #t "~T~Tproj-last-thrown-time: ~D~%" (-> obj proj-last-thrown-time))
  (format #t "~T~Tnav-enemy-patrol-timeout: ~D~%" (-> obj nav-enemy-patrol-timeout))
  (format #t "~T~Tproj-launch-vec: #<vector @ #x~X>~%" (-> obj proj-launch-vec))
  (format #t "~T~Tlocal-throw-point: #<vector @ #x~X>~%" (-> obj local-throw-point))
  (format #t "~T~Tshield-jmod: ~A~%" (-> obj shield-jmod))
  obj
  )

;; failed to figure out what this is:
(defskelgroup *ram-boss-sg* ram-boss ram-boss-lod0-jg ram-boss-far-idle-ja
              ((ram-boss-lod0-mg (meters 20)) (ram-boss-lod1-mg (meters 40)) (ram-boss-lod2-mg (meters 999999)))
              :bounds (static-spherem 0 1 0 4.4)
              :longest-edge (meters 1.2)
              )

;; definition for symbol *ram-boss-nav-enemy-info*, type nav-enemy-info
(define *ram-boss-nav-enemy-info* (new 'static 'nav-enemy-info
                                    :idle-anim 13
                                    :walk-anim 11
                                    :turn-anim -1
                                    :notice-anim 19
                                    :run-anim 11
                                    :jump-anim 13
                                    :jump-land-anim 13
                                    :victory-anim 14
                                    :taunt-anim 14
                                    :die-anim 15
                                    :neck-joint 6
                                    :player-look-at-joint 5
                                    :run-travel-speed (meters 6)
                                    :run-rotate-speed (degrees 2880.0)
                                    :run-acceleration (meters 1)
                                    :run-turn-time (seconds 0.1)
                                    :walk-travel-speed (meters 4)
                                    :walk-rotate-speed (degrees 720.0)
                                    :walk-acceleration (meters 1)
                                    :walk-turn-time (seconds 0.5)
                                    :attack-shove-back (meters 2)
                                    :attack-shove-up (meters 0.5)
                                    :shadow-size (meters 2)
                                    :notice-nav-radius (meters 18)
                                    :nav-nearest-y-threshold (meters 10)
                                    :notice-distance (meters 58)
                                    :stop-chase-distance (meters 58)
                                    :frustration-time (seconds 30)
                                    :die-anim-hold-frame 24.0
                                    :jump-anim-start-frame 10.0
                                    :jump-land-anim-end-frame 10000000000.0
                                    :jump-height-min (meters 3)
                                    :jump-height-factor 0.5
                                    :jump-start-anim-speed 1.0
                                    :shadow-max-y (meters 1)
                                    :shadow-min-y (meters -1)
                                    :shadow-locus-dist (meters 150)
                                    :use-align #f
                                    :draw-shadow #t
                                    :move-to-ground #t
                                    :hover-if-no-ground #f
                                    :use-momentum #f
                                    :use-flee #f
                                    :use-proximity-notice #f
                                    :use-jump-blocked #f
                                    :use-jump-patrol #f
                                    :gnd-collide-with (collide-kind background)
                                    :debug-draw-neck #f
                                    :debug-draw-jump #f
                                    )
        )

;; definition for symbol *ram-boss-nav-enemy-info-no-shield*, type nav-enemy-info
(define *ram-boss-nav-enemy-info-no-shield* (new 'static 'nav-enemy-info
                                              :idle-anim 13
                                              :walk-anim 12
                                              :turn-anim -1
                                              :notice-anim 19
                                              :run-anim 12
                                              :jump-anim 13
                                              :jump-land-anim 13
                                              :victory-anim 14
                                              :taunt-anim 14
                                              :die-anim 15
                                              :neck-joint 6
                                              :player-look-at-joint 5
                                              :run-travel-speed (meters 6)
                                              :run-rotate-speed (degrees 2880.0)
                                              :run-acceleration (meters 1)
                                              :run-turn-time (seconds 0.1)
                                              :walk-travel-speed (meters 4)
                                              :walk-rotate-speed (degrees 720.0)
                                              :walk-acceleration (meters 1)
                                              :walk-turn-time (seconds 0.5)
                                              :attack-shove-back (meters 2)
                                              :attack-shove-up (meters 0.5)
                                              :shadow-size (meters 2)
                                              :notice-nav-radius (meters 18)
                                              :nav-nearest-y-threshold (meters 10)
                                              :notice-distance (meters 58)
                                              :stop-chase-distance (meters 58)
                                              :frustration-time (seconds 30)
                                              :die-anim-hold-frame 24.0
                                              :jump-anim-start-frame 10.0
                                              :jump-land-anim-end-frame 10000000000.0
                                              :jump-height-min (meters 3)
                                              :jump-height-factor 0.5
                                              :jump-start-anim-speed 1.0
                                              :shadow-max-y (meters 1)
                                              :shadow-min-y (meters -1)
                                              :shadow-locus-dist (meters 150)
                                              :use-align #f
                                              :draw-shadow #t
                                              :move-to-ground #t
                                              :hover-if-no-ground #f
                                              :use-momentum #f
                                              :use-flee #f
                                              :use-proximity-notice #f
                                              :use-jump-blocked #f
                                              :use-jump-patrol #f
                                              :gnd-collide-with (collide-kind background)
                                              :debug-draw-neck #f
                                              :debug-draw-jump #f
                                              )
        )

;; failed to figure out what this is:
(defpartgroup group-ram-boss-proj-grow
  :id 521
  :flags (use-local-clock)
  :bounds (static-bspherem 0 0 0 8)
  :parts ((sp-item 1904) (sp-item 1905) (sp-item 2487))
  )

;; failed to figure out what this is:
(defpart 2487
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2))
    (sp-flt spt-num 1.0)
    (sp-rnd-flt spt-scale-x (meters 1.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-rnd-flt spt-r 96.0 96.0 1.0)
    (sp-rnd-flt spt-g 48.0 48.0 1.0)
    (sp-rnd-flt spt-b 0.0 32.0 1.0)
    (sp-rnd-flt spt-a 64.0 64.0 1.0)
    (sp-flt spt-fade-a -6.4)
    (sp-int spt-timer 10)
    (sp-cpuinfo-flags bit2 bit3)
    (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
    (sp-flt spt-conerot-radius (meters 0.4))
    )
  )

;; failed to figure out what this is:
(defpart 1904
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
    (sp-rnd-flt spt-num 1.0 2.0 1.0)
    (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 160.0 32.0 1.0)
    (sp-rnd-flt spt-g 0.0 32.0 1.0)
    (sp-flt spt-b 0.0)
    (sp-flt spt-a 64.0)
    (sp-flt spt-vel-y (meters -0.033333335))
    (sp-flt spt-fade-r -0.53333336)
    (sp-flt spt-fade-g 1.0666667)
    (sp-flt spt-fade-b 0.53333336)
    (sp-flt spt-fade-a 1.0666667)
    (sp-int spt-timer 60)
    (sp-cpuinfo-flags bit2)
    (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
    (sp-flt spt-conerot-radius (meters 2))
    )
  )

;; failed to figure out what this is:
(defpart 1905
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2))
    (sp-flt spt-num 4.0)
    (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 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 150.0 32.0 1.0)
    (sp-rnd-flt spt-g 24.0 74.0 1.0)
    (sp-rnd-flt spt-b 0.0 32.0 1.0)
    (sp-rnd-flt spt-a 64.0 64.0 1.0)
    (sp-flt spt-fade-a -6.4)
    (sp-int spt-timer 10)
    (sp-cpuinfo-flags bit2)
    (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
    (sp-flt spt-conerot-radius (meters 0.15))
    )
  )

;; failed to figure out what this is:
(defpartgroup group-ram-boss-proj-fly
  :id 522
  :duration 300
  :bounds (static-bspherem 0 0 0 3)
  :parts ((sp-item 1910 :flags (launch-asap) :binding 1908)
    (sp-item 1908 :flags (start-dead) :binding 1909)
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    (sp-item 1909 :flags (start-dead launch-asap))
    )
  )

;; failed to figure out what this is:
(defpart 1910
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2))
    (sp-flt spt-num 1.0)
    (sp-flt spt-scale-x (meters 0.01))
    (sp-copy-from-other spt-scale-y -4)
    (sp-flt spt-a 0.0)
    (sp-int spt-timer 1200)
    (sp-cpuinfo-flags bit3)
    (sp-func spt-func 'sparticle-track-root-prim)
    )
  )

;; failed to figure out what this is:
(defpart 1908
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
    (sp-flt spt-num 1.0)
    (sp-flt spt-scale-x (meters 1))
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 128.0 32.0 1.0)
    (sp-rnd-flt spt-g 64.0 32.0 1.0)
    (sp-flt spt-b 32.0)
    (sp-flt spt-a 128.0)
    (sp-flt spt-scalevel-x (meters -0.006666667))
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-flt spt-fade-r 0.53333336)
    (sp-flt spt-fade-g -1.0666667)
    (sp-flt spt-fade-b -0.53333336)
    (sp-int spt-timer 150)
    (sp-cpuinfo-flags bit2)
    (sp-int spt-next-time 81)
    (sp-launcher-by-id spt-next-launcher 1912)
    (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
    (sp-flt spt-conerot-radius (meters 0.1))
    )
  )

;; failed to figure out what this is:
(defpart 1912
  :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:
(defpart 1909
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
    (sp-rnd-flt spt-num 1.0 5.0 1.0)
    (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.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-rnd-flt spt-r 128.0 32.0 1.0)
    (sp-rnd-flt spt-g 64.0 32.0 1.0)
    (sp-flt spt-b 32.0)
    (sp-flt spt-a 128.0)
    (sp-rnd-flt spt-vel-y (meters 0.006666667) (meters 0.0033333334) 1.0)
    (sp-flt spt-scalevel-x (meters -0.0026666666))
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-flt spt-fade-r 0.53333336)
    (sp-flt spt-fade-g -1.0666667)
    (sp-flt spt-fade-b -0.53333336)
    (sp-flt spt-accel-y -2.7306666)
    (sp-flt spt-friction 0.97)
    (sp-int-plain-rnd spt-timer 30 119 1)
    (sp-cpuinfo-flags bit2)
    (sp-int spt-next-time 60)
    (sp-launcher-by-id spt-next-launcher 1912)
    (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.4) 1.0)
    )
  )

;; failed to figure out what this is:
(defpartgroup group-ram-boss-proj-hit
  :id 523
  :duration 5
  :flags (use-local-clock)
  :bounds (static-bspherem 0 0 0 8)
  :parts ((sp-item 1914) (sp-item 1915) (sp-item 1916))
  )

;; failed to figure out what this is:
(defpart 1914
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
    (sp-flt spt-num 64.0)
    (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.2) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 192.0 32.0 1.0)
    (sp-rnd-flt spt-g 96.0 64.0 1.0)
    (sp-rnd-flt spt-b 32.0 32.0 1.0)
    (sp-rnd-flt spt-a 32.0 32.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0.026666667) (meters 0.053333335) 1.0)
    (sp-flt spt-scalevel-x (meters -0.0033333334))
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-flt spt-fade-r 0.0)
    (sp-flt spt-fade-g -0.42666668)
    (sp-flt spt-fade-b -0.21333334)
    (sp-flt spt-accel-y -0.68266666)
    (sp-flt spt-friction 0.97)
    (sp-int-plain-rnd spt-timer 30 119 1)
    (sp-cpuinfo-flags bit2)
    (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.4) 1.0)
    )
  )

;; failed to figure out what this is:
(defpart 1916
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
    (sp-flt spt-num 6.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-rnd-flt spt-r 128.0 32.0 1.0)
    (sp-rnd-flt spt-g 64.0 32.0 1.0)
    (sp-flt spt-b 32.0)
    (sp-rnd-flt spt-a 32.0 32.0 1.0)
    (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0)
    (sp-flt spt-fade-r 0.21333334)
    (sp-flt spt-fade-g -0.42666668)
    (sp-flt spt-fade-b -0.21333334)
    (sp-flt spt-fade-a -0.30476192)
    (sp-rnd-flt spt-accel-y -0.68266666 0.68266666 1.0)
    (sp-int spt-timer 210)
    (sp-cpuinfo-flags bit2 bit3)
    (sp-int spt-next-time 150)
    (sp-launcher-by-id spt-next-launcher 1912)
    (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 180.0) 1.0)
    )
  )

;; failed to figure out what this is:
(defpart 1915
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2))
    (sp-flt spt-num 1.0)
    (sp-rnd-flt spt-scale-x (meters 6) (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-rnd-flt spt-r 128.0 32.0 1.0)
    (sp-rnd-flt spt-g 64.0 32.0 1.0)
    (sp-flt spt-b 32.0)
    (sp-flt spt-a 96.0)
    (sp-flt spt-fade-a -4.8)
    (sp-int spt-timer 15)
    (sp-cpuinfo-flags bit2 bit3)
    )
  )

;; failed to figure out what this is:
(defpartgroup group-ram-boss-proj-die
  :id 524
  :duration 5
  :flags (use-local-clock)
  :bounds (static-bspherem 0 0 0 8)
  :parts ((sp-item 1914))
  )

;; definition for method 24 of type ram-boss-proj
;; INFO: Return type mismatch sound-id vs none.
(defmethod dummy-24 ram-boss-proj ((obj ram-boss-proj))
  (with-pp
    (quaternion-rotate-local-x!
      (-> obj root-override quat)
      (-> obj root-override quat)
      (* 65718.05 (-> *display* seconds-per-frame))
      )
    (quaternion-rotate-local-y!
      (-> obj root-override quat)
      (-> obj root-override quat)
      (* 32221.867 (-> *display* seconds-per-frame))
      )
    (let ((f0-9 (* 5120.0 (+ 0.9 (* 0.1 (cos (* 873.81335 (the float (mod (-> *display* base-frame-counter) 75)))))))))
      (find-ground-and-draw-shadow
        (-> obj root-override trans)
        (the-as vector #f)
        f0-9
        (collide-kind background)
        (the-as process-drawable #f)
        0.0
        81920.0
        )
      )
    (if (-> obj launched?)
        (spawn (-> obj part2) (the-as vector (-> obj root-override root-prim prim-core)))
        )
    (let ((s5-0 (the-as sound-rpc-set-param (get-sound-buffer-entry))))
      (set! (-> s5-0 command) (sound-command set-param))
      (set! (-> s5-0 id) (-> obj sound-id))
      (let ((a1-4 (-> obj root-override trans)))
        (let ((gp-1 pp))
          (when (= a1-4 #t)
            (if (and gp-1 (type-type? (-> gp-1 type) process-drawable) (nonzero? (-> (the-as process-drawable gp-1) root)))
                (set! a1-4 (-> (the-as process-drawable gp-1) root trans))
                (set! a1-4 (the-as vector #f))
                )
            )
          )
        (sound-trans-convert (-> s5-0 parms trans) a1-4)
        )
      (set! (-> s5-0 parms mask) (sound-mask trans))
      (-> s5-0 id)
      )
    (none)
    )
  )

;; definition for function snow-ram-proj-update-velocity
;; INFO: Return type mismatch int vs none.
(defun snow-ram-proj-update-velocity ((arg0 ram-boss-proj))
  (when (>= (vector-vector-distance (-> arg0 parent-override 0 collide-info trans) (-> arg0 target))
            (vector-vector-distance (-> arg0 parent-override 0 collide-info trans) (-> arg0 root-override trans))
            )
    (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 target) (-> arg0 root-override trans)))
          (s4-0 (new 'stack-no-clear 'vector))
          (s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root-override transv) 1.0))
          )
      (if (logtest? (-> arg0 root-override status) (cshape-moving-flags tsurf))
          (vector-flatten! s3-1 s3-1 (-> arg0 root-override local-normal))
          )
      (vector-normalize-copy! s4-0 s3-1 1.0)
      (let ((s3-2 (new 'stack-no-clear 'matrix)))
        (matrix-from-two-vectors-max-angle-partial!
          s3-2
          s5-0
          s4-0
          (* (-> arg0 max-turn) (-> *display* seconds-per-frame))
          (-> arg0 tween)
          )
        (vector-matrix*! s5-0 s5-0 s3-2)
        )
      (vector-normalize! s5-0 1.0)
      (vector-float*! (-> arg0 root-override transv) s5-0 (-> arg0 max-speed))
      )
    )
  0
  (none)
  )

;; definition for method 25 of type ram-boss-proj
;; INFO: Return type mismatch int vs none.
(defmethod dummy-25 ram-boss-proj ((obj ram-boss-proj))
  (go ram-boss-proj-growing)
  0
  (none)
  )

;; definition for method 26 of type ram-boss-proj
;; INFO: Return type mismatch int vs none.
(defmethod dummy-26 ram-boss-proj ((obj ram-boss-proj))
  (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))))
    (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
    (set! (-> s5-0 reaction) projectile-collision-reaction)
    (set! (-> s5-0 no-reaction)
          (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
          )
    (let ((s4-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
      (set! (-> s4-0 prim-core collide-as) (collide-kind projectile))
      (set! (-> s4-0 collide-with)
            (collide-kind background cak-2 cak-3 target crate enemy wall-object ground-object)
            )
      (set! (-> s4-0 prim-core offense) (collide-offense strong-attack))
      (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 1228.8)
      (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! (-> s5-0 max-iteration-count) (the-as uint 2))
    (set! (-> s5-0 event-self) 'touched)
    (set! (-> obj root-override) s5-0)
    )
  0
  (none)
  )

;; definition for method 27 of type ram-boss-proj
;; INFO: Return type mismatch int vs none.
(defmethod dummy-27 ram-boss-proj ((obj ram-boss-proj))
  (set! (-> obj charge-sound-id) (new 'static 'sound-id))
  (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 521) obj))
  (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 522) obj))
  (set! (-> obj launched?) #f)
  (set! (-> obj growth) 0.0)
  (set! (-> obj max-speed) 40960.0)
  (set! (-> obj update-velocity) snow-ram-proj-update-velocity)
  (set! (-> obj max-turn) 11832.889)
  (set! (-> obj tween) 0.02)
  (set! (-> obj attack-mode) 'snow-ram-proj)
  (set! (-> obj launch-time) (-> *display* base-frame-counter))
  (set! (-> obj timeout) (seconds 4))
  (set! (-> obj sound-id) (sound-play "ramboss-track"))
  (let ((v1-12 (-> obj parent-override)))
    (set! (-> v1-12 0 proj-stoked) #t)
    (set! (-> v1-12 0 proj-status) (the-as uint 1))
    )
  (none)
  )

;; definition for method 10 of type ram-boss-proj
(defmethod deactivate ram-boss-proj ((obj ram-boss-proj))
  (if (nonzero? (-> obj part2))
      (kill-and-free-particles (-> obj part2))
      )
  ((method-of-type projectile deactivate) obj)
  (none)
  )

;; definition for method 7 of type ram-boss-proj
;; INFO: Return type mismatch projectile vs ram-boss-proj.
(defmethod relocate ram-boss-proj ((obj ram-boss-proj) (arg0 int))
  (if (nonzero? (-> obj part2))
      (&+! (-> obj part2) arg0)
      )
  (the-as ram-boss-proj ((method-of-type projectile relocate) obj arg0))
  )

;; definition for method 28 of type ram-boss-proj
;; INFO: Used lq/sq
;; INFO: Return type mismatch vector vs none.
(defmethod dummy-28 ram-boss-proj ((obj ram-boss-proj))
  (when (and *target*
             (zero? (logand (-> *target* state-flags)
                            (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying)
                            )
                    )
             )
    (let ((gp-0 (-> obj target)))
      (set! (-> gp-0 quad) (-> (target-pos 0) quad))
      (set! (-> gp-0 y) (+ 4915.2 (-> gp-0 y)))
      (let ((f0-2 (vector-vector-distance gp-0 (-> obj root-override trans)))
            (a2-0 (new 'stack-no-clear 'vector))
            )
        (if (>= 0.0 f0-2)
            (set! f0-2 409.6)
            )
        (set! (-> a2-0 quad) (-> *target* control transv quad))
        (set! (-> a2-0 y) 0.0)
        (let ((f0-3 (/ f0-2 (* 40960.0 (-> *display* seconds-per-frame)))))
          (vector+float*! gp-0 gp-0 a2-0 (* f0-3 (-> *display* seconds-per-frame)))
          )
        )
      )
    )
  (none)
  )

;; failed to figure out what this is:
(defstate ram-boss-proj-growing (ram-boss-proj)
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (case arg2
      (('launch)
       (let ((v1-1 (-> self parent-override)))
         (set! (-> v1-1 0 proj-stoked) #f)
         (set! (-> v1-1 0 proj-status) (the-as uint 0))
         )
       0
       (go ram-boss-proj-launch)
       )
      )
    )
  :code (behavior ()
    (set! (-> self charge-sound-id) (sound-play "ramboss-charge"))
    (loop
      (let ((gp-1 (-> self parent-override)))
        (when (-> gp-1 0 dead?)
          (set! (-> gp-1 0 proj-stoked) #f)
          (set! (-> gp-1 0 proj-status) (the-as uint 0))
          (sound-stop (-> self charge-sound-id))
          (go-virtual projectile-dissipate)
          )
        (dummy-54 (-> gp-1 0) (-> self root-override trans))
        (update-transforms! (-> self root-override))
        (cond
          ((-> gp-1 0 proj-stoked)
           (set! (-> gp-1 0 proj-stoked) #f)
           (set! (-> self growth)
                 (seek-with-smooth (-> self growth) 1.0 (* 1.25 (-> *display* seconds-per-frame)) 0.8 0.01)
                 )
           (if (>= (-> self growth) 1.0)
               (set! (-> gp-1 0 proj-status) (the-as uint 2))
               (set! (-> gp-1 0 proj-status) (the-as uint 1))
               )
           )
          (else
            (set! (-> self growth) 0.0)
            (set! (-> gp-1 0 proj-stoked) #f)
            (set! (-> gp-1 0 proj-status) (the-as uint 0))
            (sound-stop (-> self charge-sound-id))
            (go-virtual projectile-dissipate)
            )
          )
        )
      (let ((f0-6 (-> self growth)))
        (set-vector! (-> self root-override scale) f0-6 f0-6 f0-6 1.0)
        )
      (spawn (-> self part) (-> self root-override trans))
      (suspend)
      )
    (none)
    )
  )

;; failed to figure out what this is:
(defstate ram-boss-proj-launch (ram-boss-proj)
  :code (behavior ()
    (sound-play "ramboss-fire")
    (set! (-> self launched?) #t)
    (set! (-> self growth) 1.0)
    (logior! (-> self root-override root-prim prim-core action) (collide-action solid))
    (set! (-> self launch-time) (-> *display* base-frame-counter))
    (vector-float*! (-> self root-override transv) (-> self parent-override 0 proj-launch-vec) 40960.0)
    (set! (-> self target quad) (-> (target-pos 0) quad))
    (set! (-> self target y) (+ 4915.2 (-> self target y)))
    (set! (-> self target-base quad) (-> self target quad))
    (go-virtual projectile-moving)
    (none)
    )
  )

;; failed to figure out what this is:
(defstate projectile-impact (ram-boss-proj)
  :virtual #t
  :code (behavior ()
    (process-spawn
      part-tracker
      :init part-tracker-init
      (-> *part-group-id-table* 523)
      -1
      #f
      #f
      #f
      (-> self root-override trans)
      :to *entity-pool*
      )
    (if (nonzero? (-> self sound-id))
        (sound-stop (-> self sound-id))
        )
    (sound-play "ramboss-hit")
    (suspend)
    (go-virtual projectile-die)
    (none)
    )
  )

;; failed to figure out what this is:
(defstate projectile-dissipate (ram-boss-proj)
  :virtual #t
  :code (behavior ()
    (process-spawn
      part-tracker
      :init part-tracker-init
      (-> *part-group-id-table* 524)
      -1
      #f
      #f
      #f
      (-> self root-override trans)
      :to *entity-pool*
      )
    (if (nonzero? (-> self sound-id))
        (sound-stop (-> self sound-id))
        )
    (suspend)
    (go-virtual projectile-die)
    (none)
    )
  )

;; failed to figure out what this is:
(defpartgroup group-ram-boss-shield-on-fire
  :id 525
  :flags (use-local-clock)
  :bounds (static-bspherem 0 0 0 8)
  :parts ((sp-item 1919))
  )

;; failed to figure out what this is:
(defpart 1919
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
    (sp-flt spt-num 2.0)
    (sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0)
    (sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0)
    (sp-rnd-flt spt-scale-x (meters 1) (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 128.0)
    (sp-rnd-flt spt-g 0.0 128.0 1.0)
    (sp-flt spt-b 0.0)
    (sp-rnd-flt spt-a 32.0 64.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0.006666667) (meters 0.006666667) 1.0)
    (sp-flt spt-scalevel-x (meters 0.023529412))
    (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 -1.5058824)
    (sp-flt spt-friction 0.98)
    (sp-int spt-timer 81)
    (sp-cpuinfo-flags bit2 bit3 bit14)
    (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0)
    )
  )

;; failed to figure out what this is:
(defpartgroup group-ram-boss-foot-puff
  :id 574
  :duration 5
  :linger-duration 450
  :bounds (static-bspherem 0 0 0 2)
  :parts ((sp-item 2367) (sp-item 2368) (sp-item 2369))
  )

;; failed to figure out what this is:
(defpart 2367
  :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 1) (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-rnd-flt spt-r 196.0 64.0 1.0)
    (sp-rnd-flt spt-g 196.0 64.0 1.0)
    (sp-rnd-flt spt-b 196.0 64.0 1.0)
    (sp-rnd-flt spt-a 16.0 32.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0.02) (meters 0.01) 1.0)
    (sp-flt spt-scalevel-x (meters 0.0033333334))
    (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0)
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-flt spt-fade-a -0.16)
    (sp-flt spt-accel-y -1.3653333)
    (sp-flt spt-friction 0.95)
    (sp-int spt-timer 300)
    (sp-cpuinfo-flags bit2 bit12)
    (sp-rnd-flt spt-conerot-x (degrees 60.0) (degrees 30.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 2368
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
    (sp-flt spt-num 12.0)
    (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 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 196.0 64.0 1.0)
    (sp-rnd-flt spt-g 196.0 64.0 1.0)
    (sp-rnd-flt spt-b 196.0 64.0 1.0)
    (sp-rnd-flt spt-a 16.0 16.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0.053333335) (meters 0.02) 1.0)
    (sp-flt spt-scalevel-x (meters 0.0016666667))
    (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0)
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-flt spt-fade-a -0.21333334)
    (sp-flt spt-accel-y -1.3653333)
    (sp-flt spt-friction 0.95)
    (sp-int spt-timer 150)
    (sp-cpuinfo-flags bit2 bit12)
    (sp-rnd-flt spt-conerot-x (degrees 60.0) (degrees 30.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 2369
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #x2))
    (sp-flt spt-num 32.0)
    (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0)
    (sp-rnd-flt spt-y (meters -0.1) (meters 0.4) 1.0)
    (sp-rnd-flt spt-z (meters -0.4) (meters 0.8) 1.0)
    (sp-rnd-flt spt-scale-x (meters 0.07) (meters 0.02) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 196.0 2.0 64.0)
    (sp-rnd-int spt-g 1128529920 1 64.0)
    (sp-rnd-int spt-b 1128529920 1 64.0)
    (sp-rnd-flt spt-a 64.0 64.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0.015) (meters 0.006666667) 1.0)
    (sp-flt spt-fade-a -0.42666668)
    (sp-rnd-flt spt-accel-y -5.4613333 2.7306666 1.0)
    (sp-int spt-timer 300)
    (sp-cpuinfo-flags bit2 bit12)
    (sp-rnd-flt spt-conerot-x (degrees 30.0) (degrees 50.000004) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
    (sp-flt spt-conerot-radius (meters 0.5))
    )
  )

;; definition for function ram-boss-on-ground-event-handler
;; WARN: disable def twice: 194. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare.
(defbehavior ram-boss-on-ground-event-handler ram-boss ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
  (local-vars (v0-4 object))
  (case arg2
    (('attack 'bonk 'roll)
     (cond
       ((-> self has-shield?)
        (cond
          ((send-event *target* 'query 'powerup (pickup-type eco-red))
           (nav-enemy-set-hit-from-direction arg0)
           (send-event arg0 'shove #f (static-attack-info ((shove-back (meters 2)))))
           (go ram-boss-lose-shield)
           (return #t)
           v0-4
           )
          ((begin
             (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)))
                 (do-push-aways! (-> self collide-info))
                 )
             (level-hint-spawn
               (game-text-id snow-ram-boss-red-eco-hint)
               "sksp0346"
               (the-as entity #f)
               *entity-pool*
               (game-task none)
               )
             (>= (- (-> (target-pos 0) y) (-> self collide-info trans y)) 9420.8)
             )
           (send-event arg0 'shove #f (static-attack-info ((shove-back (meters 4)) (shove-up (meters 2)))))
           (go ram-boss-up-defend-block)
           (return #t)
           v0-4
           )
          (else
            (when (= arg2 'attack)
              (send-event arg0 'shove #f (static-attack-info ((shove-back (meters 4)))))
              (go ram-boss-forward-defend-block)
              (return #t)
              v0-4
              )
            )
          )
        )
       (else
         (go-virtual nav-enemy-die)
         (return #t)
         v0-4
         )
       )
     )
    (('touch)
     (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)))
         (do-push-aways! (-> self collide-info))
         )
     (cond
       ((-> self has-shield?)
        (cond
          ((>= (- (-> (target-pos 0) y) (-> self collide-info trans y)) 9420.8)
           (send-event
             arg0
             'shove
             (-> arg3 param 0)
             (static-attack-info ((shove-back (meters 4)) (shove-up (meters 2))))
             )
           (go ram-boss-up-defend-block)
           (return #t)
           v0-4
           )
          (else
            (when (= arg2 'attack)
              (send-event arg0 'shove (-> arg3 param 0) (static-attack-info ((shove-back (meters 4)))))
              (go ram-boss-forward-defend-block)
              (return #t)
              v0-4
              )
            )
          )
        )
       (else
         (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg3 param 0)) 'generic)
             (go-virtual nav-enemy-victory)
             )
         )
       )
     )
    (('notify)
     (when (= (-> arg0 type) ram-boss-proj)
       (let ((v1-66 arg0))
         (cond
           ((= (-> arg3 param 0) 'attack)
            (when (= (-> arg3 param 1) *target*)
              (set! (-> self frustration) 0)
              (go-virtual nav-enemy-victory)
              (return #t)
              v0-4
              )
            )
           ((= (-> arg3 param 0) 'die)
            (let* ((v1-73 (- (-> *display* base-frame-counter) (-> (the-as ram-boss-proj v1-66) launch-time)))
                   (v1-74 (the-as int (- (seconds 4) v1-73)))
                   )
              (cond
                ((< (seconds 4) (the-as time-frame v1-74))
                 (set! v1-74 1200)
                 )
                ((< (the-as time-frame v1-74) 0)
                 (set! v1-74 0)
                 )
                )
              (+! (-> self frustration) (the int (* 0.00083333335 (the float (* v1-74 128)))))
              )
            (when (< 256 (-> self frustration))
              (set! v0-4 256)
              (set! (-> self frustration) (the-as int v0-4))
              v0-4
              )
            )
           )
         )
       )
     )
    )
  )

;; definition for method 10 of type ram-boss
(defmethod deactivate ram-boss ((obj ram-boss))
  (if (nonzero? (-> obj part2))
      (kill-and-free-particles (-> obj part2))
      )
  ((method-of-type nav-enemy deactivate) obj)
  (none)
  )

;; definition for method 7 of type ram-boss
;; INFO: Return type mismatch nav-enemy vs ram-boss.
(defmethod relocate ram-boss ((obj ram-boss) (arg0 int))
  (if (nonzero? (-> obj shield-jmod))
      (&+! (-> obj shield-jmod) arg0)
      )
  (if (nonzero? (-> obj part2))
      (&+! (-> obj part2) arg0)
      )
  (the-as ram-boss ((method-of-type nav-enemy relocate) obj arg0))
  )

;; definition for method 47 of type ram-boss
;; INFO: Return type mismatch int vs none.
(defmethod initialize-collision ram-boss ((obj ram-boss))
  (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))))
    (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
    (set! (-> s5-0 reaction) default-collision-reaction)
    (set! (-> s5-0 no-reaction)
          (the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
          )
    (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0)))
      (set! (-> s4-0 prim-core collide-as) (collide-kind enemy wall-object))
      (set! (-> s4-0 collide-with) (collide-kind target))
      (set! (-> s4-0 prim-core action) (collide-action solid))
      (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 -4096.0 11468.8)
      (set-root-prim! s5-0 s4-0)
      (let ((s3-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3))))
        (set! (-> s3-0 prim-core collide-as) (collide-kind enemy))
        (set! (-> s3-0 collide-with) (collide-kind target))
        (set! (-> s3-0 prim-core action) (collide-action solid))
        (set! (-> s3-0 prim-core offense) (collide-offense indestructible))
        (set-vector! (-> s3-0 local-sphere) 0.0 4096.0 -2048.0 6144.0)
        (append-prim s4-0 s3-0)
        )
      (let ((s3-1 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3))))
        (set! (-> s3-1 prim-core collide-as) (collide-kind enemy))
        (set! (-> s3-1 collide-with) (collide-kind target))
        (set! (-> s3-1 prim-core action) (collide-action solid))
        (set! (-> s3-1 prim-core offense) (collide-offense indestructible))
        (set-vector! (-> s3-1 local-sphere) 0.0 8601.6 -2048.0 7782.4)
        (append-prim s4-0 s3-1)
        )
      (let ((s3-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1))))
        (set! (-> s3-2 prim-core collide-as) (collide-kind enemy))
        (set! (-> s3-2 collide-with) (collide-kind target))
        (set! (-> s3-2 prim-core offense) (collide-offense no-offense))
        (set! (-> s3-2 transform-index) 6)
        (set-vector! (-> s3-2 local-sphere) 0.0 0.0 0.0 4096.0)
        (append-prim s4-0 s3-2)
        )
      (let ((s3-3 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3))))
        (set! (-> s3-3 prim-core offense) (collide-offense indestructible))
        (set! (-> s3-3 transform-index) 3)
        (set-vector! (-> s3-3 local-sphere) 0.0 0.0 0.0 409.6)
        (append-prim s4-0 s3-3)
        )
      )
    (set! (-> s5-0 nav-radius) 10240.0)
    (backup-collide-with-as s5-0)
    (set! (-> s5-0 max-iteration-count) (the-as uint 2))
    (set! (-> obj collide-info) s5-0)
    )
  0
  (none)
  )

;; definition for method 52 of type ram-boss
;; INFO: Return type mismatch vector vs symbol.
(defmethod dummy-52 ram-boss ((obj ram-boss))
  (let ((v1-1 (the-as basic (-> obj collide-info root-prim))))
    (set-vector! (-> (the-as collide-shape-prim v1-1) local-sphere) 0.0 8192.0 0.0 13516.8)
    (set-vector! (-> (the-as (array collide-shape-prim) v1-1) 16 local-sphere) 0.0 4096.0 0.0 4505.6)
    (set-vector! (-> (the-as (array collide-shape-prim) v1-1) 17 local-sphere) 0.0 9830.4 0.0 4505.6)
    (set-vector! (-> (the-as (array collide-shape-prim) v1-1) 18 local-sphere) 0.0 0.0 0.0 2048.0)
    (let ((v1-2 (-> (the-as (array collide-shape-prim) v1-1) 19)))
      (logior! (-> v1-2 prim-core action) (collide-action solid))
      (set! (-> v1-2 collide-with) (collide-kind target))
      (set! (-> v1-2 prim-core collide-as) (collide-kind enemy))
      (let ((v0-0 (-> v1-2 local-sphere)))
        (set! (-> v0-0 x) 0.0)
        (set! (-> v0-0 y) 819.2)
        (set! (-> v0-0 z) 4505.6)
        (set! (-> v0-0 w) 8192.0)
        (the-as symbol v0-0)
        )
      )
    )
  )

;; definition for method 53 of type ram-boss
;; INFO: Return type mismatch int vs symbol.
(defmethod dummy-53 ram-boss ((obj ram-boss))
  (let ((v1-1 (the-as (array collide-shape-prim) (-> obj collide-info root-prim))))
    (let ((a0-1 (-> v1-1 16)))
      (set! (-> a0-1 prim-core offense) (collide-offense touch))
      )
    (let ((a0-2 (-> v1-1 17)))
      (set! (-> a0-2 prim-core offense) (collide-offense touch))
      )
    (let ((a0-3 (-> v1-1 18)))
      (set! (-> a0-3 prim-core offense) (collide-offense touch))
      )
    (let ((v1-2 (-> v1-1 19)))
      (logclear! (-> v1-2 prim-core action) (collide-action solid))
      (set! (-> v1-2 collide-with) (collide-kind))
      (set! (-> v1-2 prim-core collide-as) (collide-kind))
      (set! (-> v1-2 prim-core offense) (collide-offense no-offense))
      )
    )
  (the-as symbol 0)
  )

;; definition for method 48 of type ram-boss
;; INFO: Used lq/sq
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-48 ram-boss ((obj ram-boss))
  (initialize-skeleton obj *ram-boss-sg* '())
  (set! (-> obj draw origin-joint-index) (the-as uint 3))
  (TODO-RENAME-45 obj *ram-boss-nav-enemy-info*)
  (logclear! (-> obj enemy-info options) (fact-options has-power-cell))
  (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 525) obj))
  (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 574) obj))
  (set! (-> obj shield-jmod) (new 'process 'joint-mod-set-local obj 32 #f #f #t))
  (set! (-> obj shield-jmod enable) #f)
  (set! (-> obj has-shield?) #t)
  (when (nonzero? (-> obj entity extra perm user-int8 1))
    (set! (-> obj has-shield?) #f)
    (TODO-RENAME-49 obj *ram-boss-nav-enemy-info-no-shield*)
    (let ((v1-23 (-> obj shield-jmod)))
      (set! (-> v1-23 enable) #t)
      (set! (-> v1-23 transform scale quad) (the-as uint128 0))
      )
    )
  (set! (-> obj neck up) (the-as uint 1))
  (set! (-> obj neck nose) (the-as uint 2))
  (set! (-> obj neck ear) (the-as uint 0))
  0
  (none)
  )

;; definition for function ram-boss-init-by-other
;; INFO: Used lq/sq
;; INFO: Return type mismatch object vs none.
(defbehavior ram-boss-init-by-other ram-boss ((arg0 basic) (arg1 nav-enemy) (arg2 symbol))
  (set! (-> self dead?) #f)
  (set! (-> self proj-status) (the-as uint 0))
  (set! (-> self proj-stoked) #f)
  (set! (-> self proj-last-thrown-time) (-> *display* base-frame-counter))
  (set-vector! (-> self local-throw-point) 10456.269 9961.882 1510.6049 1.0)
  (set! (-> self frustration) 0)
  (set! (-> self nav-enemy-patrol-timeout) (seconds 1))
  (initialize-collision self)
  (set! (-> self entity) (-> arg1 entity))
  (TODO-RENAME-48 self)
  (set! (-> self collide-info trans quad) (-> arg1 collide-info trans quad))
  (set-vector! (-> self collide-info scale) 1.0 1.0 1.0 1.0)
  (let ((t9-2 quaternion-copy!)
        (a0-6 (-> self collide-info quat))
        )
    (t9-2 a0-6 (-> arg1 collide-info quat))
    (cond
      (arg2
        (go ram-boss-already-down (the-as basic a0-6))
        )
      (else
        (ja-post)
        (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1))
        (go ram-boss-idle)
        )
      )
    )
  (none)
  )

;; definition for method 54 of type ram-boss
;; INFO: Return type mismatch vector vs symbol.
(defmethod dummy-54 ram-boss ((obj ram-boss) (arg0 vector))
  (let ((a2-0 (-> obj node-list data 18 bone transform)))
    (set-vector! arg0 0.0 0.0 -2457.6 1.0)
    (vector-matrix*! arg0 arg0 a2-0)
    )
  (the-as symbol (vector-float*! arg0 arg0 (/ 1.0 (-> arg0 w))))
  )

;; definition for method 55 of type ram-boss
;; INFO: Used lq/sq
(defmethod dummy-55 ram-boss ((obj ram-boss))
  (if (not *target*)
      (return #f)
      )
  (let ((s5-0 (new 'stack-no-clear 'vector))
        (s4-0 (new 'stack-no-clear 'vector))
        )
    (set! (-> s5-0 quad) (-> obj collide-info trans quad))
    (set! (-> s5-0 y) (+ 8192.0 (-> s5-0 y)))
    (set! (-> s4-0 quad) (-> (target-pos 0) quad))
    (set! (-> s4-0 y) (+ 4915.2 (-> s4-0 y)))
    (vector-! s4-0 s4-0 s5-0)
    (let* ((t2-0 (new 'stack-no-clear 'collide-tri-result))
           (v0-0 (< (fill-and-probe-using-line-sphere
                      *collide-cache*
                      s5-0
                      s4-0
                      1228.8
                      (collide-kind background cak-2 ground-object)
                      obj
                      t2-0
                      (new 'static 'pat-surface :noentity #x1)
                      )
                    0.0
                    )
                 )
           )
      (b! #t cfg-7 :delay (nop!))
      (the-as none 0)
      (set! v0-0 (the-as symbol #f))
      (label cfg-7)
      v0-0
      )
    )
  )

;; definition for method 51 of type ram-boss
(defmethod dummy-51 ram-boss ((obj ram-boss) (arg0 vector))
  (let* ((f30-0 (quaternion-y-angle (-> obj collide-info quat)))
         (f0-2 (atan (-> arg0 x) (-> arg0 z)))
         (f0-3 (deg- f30-0 f0-2))
         )
    (when (< (fabs f0-3) 10922.667)
      (if (< 1820.4445 f0-3)
          (vector-rotate-around-y! arg0 arg0 (+ -1820.4445 f0-3))
          )
      (return #f)
      )
    )
  #t
  )

;; definition for method 56 of type ram-boss
;; INFO: Used lq/sq
;; INFO: Return type mismatch object vs none.
(defmethod set-jump-height-factor! ram-boss ((obj ram-boss) (arg0 int))
  (cond
    ((zero? (-> obj proj-status))
     (when (and *target* (>= (- (-> *display* base-frame-counter) (-> obj proj-last-thrown-time)) (seconds 2)))
       (when arg0
         (set! (-> obj proj-stoked) #t)
         (let ((s5-0 (new 'stack-no-clear 'vector)))
           (set! (-> s5-0 quad) (the-as uint128 0))
           (let ((v1-9 (process-spawn
                         ram-boss-proj
                         :init projectile-init-by-other
                         (-> obj entity)
                         (-> obj collide-info trans)
                         s5-0
                         0
                         (process->handle *target*)
                         :to obj
                         )
                       )
                 )
             (set! (-> (the-as (pointer ram-boss-proj) v1-9) 0 notify-handle) (process->handle obj))
             )
           )
         )
       )
     )
    (else
      (set! (-> obj proj-stoked) #t)
      )
    )
  (none)
  )

;; failed to figure out what this is:
(defstate ram-boss-show-anims (ram-boss)
  :trans (behavior ()
    0
    (none)
    )
  :code (behavior ()
    0
    (none)
    )
  :post (the-as (function none :behavior ram-boss) transform-post)
  )

;; failed to figure out what this is:
(defstate ram-boss-idle (ram-boss)
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (case arg2
      (('jump)
       (go ram-boss-jump-down arg0)
       )
      (('touch 'attack)
       (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg3 param 0)) 'generic)
       )
      )
    )
  :enter (behavior ()
    ((-> (method-of-type nav-enemy nav-enemy-idle) enter))
    (set! (-> self frustration) 0)
    0
    (none)
    )
  :code (behavior ()
    (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2))
    (loop
      (clone-anim-once
        (ppointer->handle (-> self parent-override))
        (the-as int (-> self draw origin-joint-index))
        #t
        ""
        )
      (let ((a0-4 (-> self parent-override 0 node-list data 9 bone transform)))
        (set! (-> self collide-info trans quad) (-> a0-4 vector 3 quad))
        )
      (transform-post)
      (when *target*
        (if *target*
            (look-at-enemy!
              (-> *target* neck)
              (the-as vector (-> (the-as collide-shape-prim-group (-> self collide-info root-prim)) prims 0 prim-core))
              'attacking
              self
              )
            )
        )
      (suspend)
      )
    (none)
    )
  )

;; failed to figure out what this is:
(defstate ram-boss-jump-down (ram-boss)
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (case arg2
      (('touch 'attack)
       (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg3 param 0)) 'generic)
       )
      )
    )
  :enter (behavior ((arg0 basic))
    (dummy-52 self)
    (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2))
    (let ((s5-0 (new 'stack-no-clear 'vector))
          (gp-0 (-> self node-list data 0 bone transform))
          )
      (let ((s1-0 (new 'stack-no-clear 'matrix))
            (s4-0 (new 'stack-no-clear 'vector))
            )
        (matrix-4x4-inverse! s1-0 gp-0)
        (vector-matrix*! s4-0 (target-pos 0) s1-0)
        (set-vector! s5-0 -49152.0 -32768.0 16384.0 1.0)
        (if (< (-> s4-0 x) 0.0)
            (set! (-> s5-0 x) (- (-> s5-0 x)))
            )
        )
      (let ((s4-1 (new 'stack-no-clear 'vector)))
        (vector-matrix*! s4-1 s5-0 gp-0)
        (vector-! s4-1 s4-1 (-> gp-0 vector 3))
        (set! (-> s4-1 y) 0.0)
        (vector-normalize! s4-1 1.0)
        (set! (-> self collide-info transv x) (* 65536.0 (-> s4-1 x)))
        (set! (-> self collide-info transv z) (* 65536.0 (-> s4-1 z)))
        )
      )
    (set! (-> self collide-info transv y) 102400.0)
    (none)
    )
  :trans (behavior ()
    (+! (-> self collide-info transv y) (* -544768.0 (-> *display* seconds-per-frame)))
    (integrate-for-enemy-with-move-to-ground!
      (-> self collide-info)
      (-> self collide-info transv)
      (collide-kind background)
      16384.0
      #f
      #f
      #f
      )
    (if (logtest? (-> self collide-info status) (cshape-moving-flags onsurf))
        (go ram-boss-jump-down-hit-ground)
        )
    (none)
    )
  :code (behavior ((arg0 basic))
    (ja-channel-push! 1 (seconds 0.8))
    (ja-no-eval :group! (-> self draw art-group data 16) :num! (seek!) :frame-num 0.0)
    (until (ja-done? 0)
      (let ((gp-0 (new 'stack-no-clear 'vector)))
        (vector-! gp-0 (target-pos 0) (-> self collide-info trans))
        (set! (-> gp-0 y) 0.0)
        (seek-toward-heading-vec! (-> self collide-info) gp-0 182044.44 (seconds 0.01))
        )
      (suspend)
      (ja :num! (seek!))
      )
    (loop
      (suspend)
      )
    (none)
    )
  :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post)
  )

;; failed to figure out what this is:
(defstate ram-boss-jump-down-hit-ground (ram-boss)
  :event (-> ram-boss-jump-down event)
  :code (behavior ()
    (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2))
    (activate! *camera-smush-control* 409.6 37 150 1.0 0.99)
    (ja-no-eval :group! (-> self draw art-group data 17) :num! (seek!) :frame-num 0.0)
    (until (ja-done? 0)
      (suspend)
      (ja :num! (seek!))
      )
    (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1))
    (go ram-boss-nav-start)
    (none)
    )
  :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post)
  )

;; failed to figure out what this is:
(defstate ram-boss-already-down (ram-boss)
  :code (behavior ((arg0 basic))
    (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2))
    (dummy-52 self)
    (let ((a1-0 (new 'stack-no-clear 'vector))
          (a2-0 (-> self parent-override 0 node-list data 0 bone transform))
          )
      (set-vector! a1-0 0.0 -16384.0 -32768.0 1.0)
      (vector-matrix*! (-> self collide-info trans) a1-0 a2-0)
      )
    (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (collide-kind background))
    (let ((gp-0 (new 'stack-no-clear 'vector)))
      (vector-! gp-0 (target-pos 0) (-> self collide-info trans))
      (set! (-> gp-0 y) 0.0)
      (set-heading-vec! (-> self collide-info) gp-0)
      )
    (go ram-boss-nav-start)
    (none)
    )
  )

;; failed to figure out what this is:
(defstate ram-boss-nav-start (ram-boss)
  :code (behavior ()
    (let ((a1-1 (dummy-16 (-> self nav) (-> self collide-info trans))))
      (when (not a1-1)
        (go process-drawable-art-error "not on nav mesh")
        (return #f)
        )
      (set-current-poly! (-> self nav) a1-1)
      )
    (go ram-boss-nav-resume)
    (none)
    )
  )

;; failed to figure out what this is:
(defstate ram-boss-nav-resume (ram-boss)
  :code (behavior ()
    (set! (-> self frustration) 0)
    (when *target*
      (let ((f30-0 (vector-vector-distance (target-pos 0) (-> self collide-info trans))))
        (cond
          ((>= 18432.0 f30-0)
           (go ram-boss-tracking)
           )
          ((not (TODO-RENAME-46 self 237568.0))
           (go-virtual nav-enemy-patrol)
           )
          ((and (< f30-0 106496.0) (dummy-55 self))
           (go-virtual nav-enemy-attack)
           )
          ((< f30-0 237568.0)
           (go-virtual nav-enemy-chase)
           )
          (else
            (go-virtual nav-enemy-patrol)
            )
          )
        )
      )
    (go-virtual nav-enemy-idle)
    (none)
    )
  )

;; failed to figure out what this is:
(defstate nav-enemy-patrol (ram-boss)
  :virtual #t
  :event ram-boss-on-ground-event-handler
  :enter (behavior ()
    ((-> (method-of-type nav-enemy nav-enemy-patrol) enter))
    (set! (-> self state-timeout) (-> self nav-enemy-patrol-timeout))
    (set! (-> self nav-enemy-patrol-timeout) (seconds 1))
    (ja-channel-push! 1 (seconds 0.3))
    (none)
    )
  :trans (behavior ()
    (when *target*
      (let ((f0-0 (vector-vector-distance (target-pos 0) (-> self collide-info trans))))
        (if (>= 18432.0 f0-0)
            (go ram-boss-tracking)
            )
        )
      )
    ((-> (method-of-type nav-enemy nav-enemy-patrol) trans))
    (none)
    )
  )

;; failed to figure out what this is:
(defstate nav-enemy-chase (ram-boss)
  :virtual #t
  :event ram-boss-on-ground-event-handler
  :enter (behavior ()
    (let ((t9-0 (-> (method-of-type nav-enemy nav-enemy-chase) enter)))
      (if t9-0
          (t9-0)
          )
      )
    (none)
    )
  :trans (behavior ()
    (let ((f30-0 (vector-vector-distance (target-pos 0) (-> self collide-info trans))))
      (if (>= 18432.0 f30-0)
          (go ram-boss-tracking)
          )
      (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-time))
        (if (not (TODO-RENAME-46 self (-> self nav-info stop-chase-distance)))
            (go-virtual nav-enemy-patrol)
            )
        (if (and (>= 73728.0 f30-0) (dummy-55 self))
            (go-virtual nav-enemy-attack)
            )
        )
      )
    (cond
      ((logtest? (nav-control-flags navcf17) (-> self nav flags))
       (if (>= (- (-> *display* base-frame-counter) (-> self free-time)) (seconds 1))
           (go-virtual nav-enemy-patrol)
           )
       )
      (else
        (set! (-> self free-time) (-> *display* base-frame-counter))
        )
      )
    0
    (none)
    )
  )

;; failed to figure out what this is:
(defstate nav-enemy-attack (ram-boss)
  :virtual #t
  :event ram-boss-on-ground-event-handler
  :trans (the-as (function none :behavior ram-boss) #f)
  :code (behavior ()
    (go ram-boss-tracking)
    (none)
    )
  )

;; definition for method 57 of type ram-boss
(defmethod dummy-57 ram-boss ((obj ram-boss) (arg0 float))
  (let ((f0-0 0.0))
    (when *target*
      (let ((s3-0 (new 'stack-no-clear 'vector)))
        (vector-! s3-0 (target-pos 0) (-> obj collide-info trans))
        (let ((f0-1 (vector-x-angle s3-0)))
          (set! f0-0 (* 0.000091552734 f0-1))
          )
        )
      (cond
        ((< f0-0 0.0)
         (set! f0-0 0.0)
         )
        ((< 1.0 f0-0)
         (set! f0-0 1.0)
         )
        )
      (if (>= arg0 0.0)
          (set! f0-0 (* 0.5 (+ f0-0 arg0)))
          )
      )
    f0-0
    )
  )

;; failed to figure out what this is:
(defstate ram-boss-tracking (ram-boss)
  :event ram-boss-on-ground-event-handler
  :enter (behavior ()
    (set! (-> self state-time) (-> *display* base-frame-counter))
    (set! (-> self facing-y) (quaternion-y-angle (-> self collide-info quat)))
    (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2))
    (none)
    )
  :trans (behavior ()
    (set-jump-height-factor!
      self
      (the-as int (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.75)))
      )
    (if (not *target*)
        (go-virtual nav-enemy-patrol)
        )
    (let ((gp-0 (new 'stack-no-clear 'vector)))
      (vector-! gp-0 (target-pos 0) (-> self collide-info trans))
      (set! (-> self player-dir-y) (atan (-> gp-0 x) (-> gp-0 z)))
      )
    (let* ((v1-13 (if (-> self has-shield?)
                      145635.56
                      41870.223
                      )
                  )
           (f30-0 (-> self facing-y))
           (f0-6 (deg-seek-smooth f30-0 (-> self player-dir-y) (* v1-13 (-> *display* seconds-per-frame)) 0.25))
           (f0-7 (deg- f0-6 f30-0))
           )
      (cond
        ((< 18.204445 (fabs f0-7))
         (set! (-> self last-turn-speed) (* (fabs f0-7) (-> *display* frames-per-second)))
         (quaternion-rotate-y! (-> self collide-info quat) (-> self collide-info quat) f0-7)
         (set! (-> self facing-y) (quaternion-y-angle (-> self collide-info quat)))
         )
        (else
          (set! (-> self last-turn-speed) 0.0)
          )
        )
      )
    (let ((f0-10 (vector-vector-distance (target-pos 0) (-> self collide-info trans))))
      (cond
        ((>= f0-10 106496.0)
         (if (>= f0-10 237568.0)
             (go-virtual nav-enemy-patrol)
             )
         (go-virtual nav-enemy-chase)
         )
        ((< 18432.0 f0-10)
         (if (not (dummy-55 self))
             (go-virtual nav-enemy-chase)
             )
         (when (>= (-> self frustration) 256)
           (set! (-> self frustration) 0)
           (set! (-> self nav-enemy-patrol-timeout) (rand-vu-int-range (seconds 2) (seconds 5)))
           (go-virtual nav-enemy-patrol)
           )
         )
        )
      )
    (when (and (= (-> self proj-status) 2)
               (zero? (logand (-> *target* state-flags)
                              (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying)
                              )
                      )
               (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2))
               )
      (let ((gp-2 (new 'stack-no-clear 'vector))
            (s5-2 (new 'stack-no-clear 'vector))
            )
        (dummy-54 self s5-2)
        (set! (-> gp-2 quad) (-> (target-pos 0) quad))
        (set! (-> gp-2 y) (+ 4915.2 (-> gp-2 y)))
        (vector-! (-> self proj-launch-vec) gp-2 s5-2)
        )
      (vector-normalize! (-> self proj-launch-vec) 1.0)
      (if (not (dummy-51 self (-> self proj-launch-vec)))
          (go ram-boss-throw)
          )
      )
    0
    (none)
    )
  :code (behavior ()
    (let ((f30-0 -1.0))
      (loop
        (set! f30-0 (dummy-57 self f30-0))
        (cond
          ((< 5461.3335 (-> self last-turn-speed))
           (cond
             ((-> self has-shield?)
              (when (not (ja-group? (-> self draw art-group data 7)))
                (ja-channel-push! 2 (seconds 0.2))
                (ja :group! (-> self draw art-group data 7) :num! min)
                (ja :chan 1 :group! (-> self draw art-group data 22) :num! (chan 0) :frame-interp f30-0)
                )
              )
             (else
               (when (not (ja-group? (-> self draw art-group data 20)))
                 (ja-channel-push! 1 (seconds 0.2))
                 (ja :group! (-> self draw art-group data 20) :num! min)
                 )
               )
             )
           )
          ((-> self has-shield?)
           (when (not (ja-group? (-> self draw art-group data 6)))
             (ja-channel-push! 2 (seconds 0.2))
             (ja :group! (-> self draw art-group data 6) :num! min)
             (ja :chan 1 :group! (-> self draw art-group data 21) :num! (chan 0) :frame-interp f30-0)
             )
           )
          (else
            (when (not (ja-group? (-> self draw art-group data 24)))
              (ja-channel-push! 1 (seconds 0.2))
              (ja :group! (-> self draw art-group data 24) :num! min)
              )
            )
          )
        (suspend)
        (ja :num! (loop!))
        (if (= (ja-group-size) 2)
            (ja :chan 1 :num! (chan 0) :frame-interp f30-0)
            )
        )
      )
    (none)
    )
  :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post)
  )

;; failed to figure out what this is:
(defstate ram-boss-forward-defend-block (ram-boss)
  :enter (behavior ()
    (set! (-> self frustration) 0)
    (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2))
    (none)
    )
  :trans (behavior ()
    (set-jump-height-factor! self (the-as int #t))
    0
    (none)
    )
  :code (behavior ()
    (ja-channel-push! 1 (seconds 0.1))
    (ja-no-eval :group! (-> self draw art-group data 8) :num! (seek!) :frame-num 0.0)
    (until (ja-done? 0)
      (suspend)
      (ja :num! (seek!))
      )
    (go ram-boss-tracking)
    (none)
    )
  :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post)
  )

;; failed to figure out what this is:
(defstate ram-boss-up-defend-block (ram-boss)
  :enter (behavior ()
    (set! (-> self frustration) 0)
    (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2))
    (none)
    )
  :trans (behavior ()
    (set-jump-height-factor! self (the-as int #t))
    0
    (none)
    )
  :code (behavior ()
    (ja-channel-push! 1 (seconds 0.1))
    (ja-no-eval :group! (-> self draw art-group data 9) :num! (seek!) :frame-num 0.0)
    (until (ja-done? 0)
      (suspend)
      (ja :num! (seek!))
      )
    (go ram-boss-tracking)
    (none)
    )
  :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post)
  )

;; failed to figure out what this is:
(defstate nav-enemy-victory (ram-boss)
  :virtual #t
  :event ram-boss-on-ground-event-handler
  :enter (the-as (function none :behavior ram-boss) #f)
  :exit (the-as (function none :behavior ram-boss) #f)
  :trans (behavior ()
    (when *target*
      (let ((f0-0 (vector-vector-distance (target-pos 0) (-> self collide-info trans))))
        (if (and (>= 18432.0 f0-0) (-> self has-shield?))
            (go ram-boss-tracking)
            )
        )
      )
    (none)
    )
  :code (behavior ()
    (set! (-> self frustration) 0)
    (ja-channel-push! 1 (seconds 0.075))
    (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2)))
      (ja-no-eval :group! (-> self draw art-group data (-> self nav-info victory-anim))
                  :num! (seek! max f30-0)
                  :frame-num 0.0
                  )
      (until (ja-done? 0)
        (suspend)
        (ja :num! (seek! max f30-0))
        )
      )
    (go-virtual nav-enemy-attack)
    (none)
    )
  :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post)
  )

;; failed to figure out what this is:
(defstate nav-enemy-stare (ram-boss)
  :virtual #t
  :event ram-boss-on-ground-event-handler
  :enter (behavior ()
    (go ram-boss-nav-resume)
    (none)
    )
  )

;; failed to figure out what this is:
(defstate ram-boss-throw (ram-boss)
  :event ram-boss-on-ground-event-handler
  :enter (behavior ()
    (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2))
    (let ((gp-0 (-> self child)))
      (while gp-0
        (send-event (ppointer->process gp-0) 'launch)
        (set! gp-0 (-> gp-0 0 brother))
        )
      )
    (set! (-> self proj-last-thrown-time) (-> *display* base-frame-counter))
    (none)
    )
  :trans (behavior ()
    (set-jump-height-factor! self (the-as int #t))
    0
    (none)
    )
  :code (behavior ()
    (ja-channel-push! 1 (seconds 0.075))
    (cond
      ((-> self has-shield?)
       (ja-no-eval :group! (-> self draw art-group data 10) :num! (seek!) :frame-num 0.0)
       (until (ja-done? 0)
         (suspend)
         (ja :num! (seek!))
         )
       )
      (else
        (ja-no-eval :group! (-> self draw art-group data 23) :num! (seek!) :frame-num 0.0)
        (until (ja-done? 0)
          (suspend)
          (ja :num! (seek!))
          )
        )
      )
    (go ram-boss-tracking)
    (none)
    )
  :post (the-as (function none :behavior ram-boss) nav-enemy-simple-post)
  )

;; failed to figure out what this is:
(defstate ram-boss-lose-shield (ram-boss)
  :enter (behavior ()
    (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2))
    (nav-enemy-neck-control-inactive)
    (dummy-53 self)
    (TODO-RENAME-49 self *ram-boss-nav-enemy-info-no-shield*)
    (none)
    )
  :exit (behavior ()
    (nav-enemy-neck-control-look-at)
    (set! (-> self has-shield?) #f)
    (let ((v1-2 (-> self entity extra perm)))
      (logior! (-> v1-2 status) (entity-perm-status user-set-from-cstage))
      (set! (-> v1-2 user-int8 1) 1)
      )
    (let ((v1-3 (-> self shield-jmod)))
      (set! (-> v1-3 enable) #t)
      (set! (-> v1-3 transform scale quad) (the-as uint128 0))
      )
    (none)
    )
  :code (behavior ()
    (let ((gp-0 (new 'stack-no-clear 'vector)))
      (vector-normalize-copy! gp-0 (-> self hit-from-dir) 16384.0)
      (vector+! gp-0 (-> self collide-info trans) gp-0)
      (set! (-> self nav target-pos quad) (-> gp-0 quad))
      )
    (ja-channel-push! 1 (seconds 0.1))
    (ja-no-eval :group! (-> self draw art-group data 18) :num! (seek!) :frame-num 0.0)
    (until (ja-done? 0)
      (let ((gp-1 (new 'stack-no-clear 'vector)))
        (vector<-cspace! gp-1 (-> self node-list data 32))
        (spawn (-> self part) gp-1)
        )
      (suspend)
      (ja :num! (seek!))
      )
    (go ram-boss-tracking)
    (none)
    )
  :post (behavior ()
    (compute-alignment! (-> self align))
    (dummy-11 (-> self nav) (-> self nav target-pos))
    (align-vel-and-quat-only!
      (-> self align)
      (align-opts adjust-xz-vel)
      (-> self nav travel)
      (the-as int 1.0)
      1.0
      (* (-> self enemy-info speed) (-> self speed-scale))
      )
    (vector-v++!
      (-> self collide-info transv)
      (compute-acc-due-to-gravity (-> self collide-info) (new-stack-vector0) 0.0)
      )
    (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0)
    (integrate-for-enemy-with-move-to-ground!
      (-> self collide-info)
      (-> self collide-info transv)
      (collide-kind background)
      8192.0
      #t
      #f
      #f
      )
    (nav-enemy-common-post)
    (none)
    )
  )

;; failed to figure out what this is:
(defstate nav-enemy-die (ram-boss)
  :virtual #t
  :code (behavior ()
    (ja-channel-push! 1 (seconds 0.075))
    (clear-collide-with-as (-> self collide-info))
    (nav-enemy-fall-and-play-death-anim
      (the-as art-joint-anim (-> self draw art-group data (-> self nav-info die-anim)))
      1.0
      1.0
      1000000000000000.0
      600
      )
    (send-event self 'death-end)
    (send-event (ppointer->process (-> self parent-override)) 'notify)
    (suspend)
    0
    (none)
    )
  )
