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

;; name: factory-boss-part.gc
;; name in dgo: factory-boss-part
;; dgos: FACD

(define-extern *range-factory-boss-shot-explo-color* curve-color-fast)
(define-extern *range-factory-boss-shot-explo-alpha* curve2d-fast)
(define-extern *range-factory-boss-shot-explo-scale-x* curve2d-fast)
(define-extern *range-factory-boss-shot-explo-scale-y* curve2d-fast)
(define-extern *curve-factory-boss-shot-explo-alpha* curve2d-fast)
(define-extern *curve-factory-boss-shot-explo-scale-x* curve2d-fast)
(define-extern *curve-factory-boss-shot-explo-scale-y* curve2d-fast)

;; DECOMP BEGINS

(defpartgroup group-factory-boss-shot-trail
  :id 1359
  :bounds (static-bspherem 0 0 0 8)
  :parts ((sp-item 4530 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 4531 :flags (sp6)))
  )

(defpart 4531
  :init-specs ((:texture (glow-soft level-default-sprite))
    (:num 1.0)
    (:scale-x (meters 2.5) (meters 0.2))
    (:rot-x (degrees 11.25))
    (:scale-y :copy scale-x)
    (:r 255.0)
    (:g 192.0 64.0)
    (:b 0.0)
    (:a 16.0)
    (:omega (degrees 6761.25))
    (:fade-a -0.8)
    (:timer (seconds 0.05))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
    (:userdata 3072.0)
    )
  )

(defpart 4530
  :init-specs ((:texture (redpuff level-default-sprite))
    (:num 1.0)
    (:scale-x (meters 0.8) (meters 0.8))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y :copy scale-x)
    (:r 255.0)
    (:g 128.0)
    (:b 0.0)
    (:a 32.0 32.0)
    (:vel-y (meters -0.006666667) (meters -0.006666667))
    (:scalevel-x (meters -0.006666667))
    (:scalevel-y :copy scalevel-x)
    (:fade-r -3.2)
    (:fade-g -1.6)
    (:fade-b -3.2)
    (:accel-y (meters 0.0001) (meters 0.000033333334))
    (:friction 0.97)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-2))
    (:next-time (seconds 0.135))
    (:next-launcher 4532)
    )
  )

(defpart 4532
  :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.42666668 -0.42666668))
  )

(defpart 4533
  :init-specs ((:texture (redpuff level-default-sprite))
    (:num 1.0)
    (:scale-x (meters 1.2) (meters 0.8))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y :copy scale-x)
    (:r 0.0)
    (:g 255.0)
    (:b 128.0)
    (:a 32.0 32.0)
    (:vel-y (meters -0.006666667) (meters -0.006666667))
    (:scalevel-x (meters -0.006666667))
    (:scalevel-y :copy scalevel-x)
    (:fade-r -3.2)
    (:fade-g -1.6)
    (:fade-b -3.2)
    (:accel-y (meters 0.0001) (meters 0.000033333334))
    (:friction 0.97)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-2))
    (:next-time (seconds 0.135))
    (:next-launcher 4534)
    )
  )

(defpart 4534
  :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.42666668 -0.42666668))
  )

(defpartgroup group-factory-boss-shot-explosion
  :id 1360
  :duration (seconds 4)
  :flags (sp0 sp5)
  :bounds (static-bspherem 0 0 0 15)
  :parts ((sp-item 4535 :flags (sp3) :period (seconds 30) :length (seconds 0.017))
    (sp-item 4536 :fade-after (meters 400) :flags (sp3) :period (seconds 30) :length (seconds 0.017))
    (sp-item 4537 :flags (sp3) :period (seconds 30) :length (seconds 0.017))
    (sp-item 4538 :period (seconds 30) :length (seconds 0.167))
    (sp-item 4539 :period (seconds 30) :length (seconds 0.5))
    )
  )

(defpart 4537
  :init-specs ((:texture (starflash level-default-sprite))
    (:num 1.0)
    (:scale-x (meters 20))
    (:rot-x (degrees 2.25))
    (:rot-z (degrees 0) (degrees 360))
    (:scale-y :copy scale-x)
    (:r 128.0)
    (:g 80.0)
    (:b 40.0)
    (:a 128.0)
    (:omega (degrees 6767.9995))
    (:scalevel-x (meters -0.33333334))
    (:scalevel-y :copy scalevel-x)
    (:timer (seconds 0.135))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
    (:userdata 4096.0)
    )
  )

(defpart 4535
  :init-specs ((:texture (glow-soft level-default-sprite))
    (:num 1.0)
    (:scale-x (meters 20))
    (:rot-x (degrees 22.5))
    (:scale-y :copy scale-x)
    (:r 255.0)
    (:g 128.0)
    (:b 40.0)
    (:a 64.0)
    (:fade-a -0.21333334)
    (:timer (seconds 1))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow))
    )
  )

(defpart 4536
  :init-specs ((:texture (bigpuff level-default-sprite))
    (:num 10.0)
    (:scale-x (meters 2) (meters 1))
    (:rot-z (degrees 0) (degrees 360))
    (:scale-y :copy scale-x)
    (:r 255.0)
    (:g 160.0)
    (:b 40.0)
    (:a 128.0)
    (:vel-y (meters 0) (meters 0.033333335))
    (:scalevel-x (meters 0.01))
    (:scalevel-y :copy scalevel-x)
    (:fade-g -0.13333334)
    (:fade-b -0.05)
    (:fade-a -0.21333334 -0.21333334)
    (:friction 0.93)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14))
    (:conerot-x (degrees 0) (degrees 360))
    (:rotate-y (degrees 0) (degrees 3600))
    )
  )

(defpart 4538
  :init-specs ((:texture (explosion-edge level-default-sprite))
    (:num 2.0)
    (:scale-x (meters 2) (meters 1))
    (:rot-y (degrees 0) (degrees 360))
    (:scale-y :copy scale-x)
    (:r 128.0)
    (:g 80.0 20.0)
    (:b 30.0)
    (:a 128.0)
    (:vel-y (meters 0.16666667) (meters 0.06666667))
    (:scalevel-x (meters 0.016666668))
    (:scalevel-y :copy scalevel-x)
    (:fade-g -0.17777778)
    (:fade-b -0.06666667)
    (:fade-a -0.28444445 -0.28444445)
    (:friction 0.7)
    (:timer (seconds 1.5))
    (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14))
    (:func 'sparticle-2d-spline-align-instant)
    (:conerot-x (degrees 0) (degrees 360))
    (:rotate-y (degrees 0) (degrees 3600))
    )
  )

(defpart 4539
  :init-specs ((:texture (explo-texture level-default-sprite))
    (:birth-func 'birth-func-curve)
    (:num 1.0)
    (:x (meters -1) (meters 2))
    (:y (meters 0) (meters 2))
    (:scale-x (meters 1))
    (:rot-z (degrees 0) (degrees 360))
    (:scale-y :copy scale-x)
    (:r 128.0)
    (:g 128.0)
    (:b 128.0)
    (:a 128.0)
    (:vel-y (meters 0.033333335) (meters 0.016666668))
    (:friction 0.9)
    (:timer (seconds 1))
    (:flags (sp-cpuinfo-flag-14))
    (:userdata 0.0)
    (:func 'live-func-curve)
    (:conerot-x (degrees 20) (degrees 90))
    (:rotate-y (degrees 0) (degrees 3600))
    )
  )

(if #t
    (set! *range-factory-boss-shot-explo-color* (new 'static 'curve-color-fast
                                                  :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0)
                                                  :ys (new 'static 'inline-array vector 4
                                                    (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0)
                                                    (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0)
                                                    (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0)
                                                    (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0)
                                                    )
                                                  :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
                                                  )
          )
    )

(if #t
    (set! *range-factory-boss-shot-explo-alpha* (new 'static 'curve2d-fast
                                                  :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0)
                                                  :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0)
                                                  :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0)
                                                  )
          )
    )

(if #t
    (set! *range-factory-boss-shot-explo-scale-x* (new 'static 'curve2d-fast
                                                    :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0)
                                                    :ys (new 'static 'vector :x 2.0 :y 3.0 :z 4.0 :w 5.0)
                                                    :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
                                                    )
          )
    )

(if #t
    (set! *range-factory-boss-shot-explo-scale-y* (new 'static 'curve2d-fast
                                                    :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0)
                                                    :ys (new 'static 'vector :x 2.0 :y 3.0 :z 4.0 :w 5.0)
                                                    :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
                                                    )
          )
    )

(if #t
    (set! *curve-factory-boss-shot-explo-alpha*
          (new 'static 'curve2d-fast
            :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0)
            :ys (new 'static 'vector :y 1.0 :z 0.8)
            :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0)
            )
          )
    )

(if #t
    (set! *curve-factory-boss-shot-explo-scale-x* (new 'static 'curve2d-fast
                                                    :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0)
                                                    :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5)
                                                    :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0)
                                                    )
          )
    )

(if #t
    (set! *curve-factory-boss-shot-explo-scale-y* (new 'static 'curve2d-fast
                                                    :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0)
                                                    :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5)
                                                    :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0)
                                                    )
          )
    )

(define *part-factory-boss-shot-explosion-texture-curve-settings* (new 'static 'particle-curve-settings
                                                                    :lifetime-base (seconds 0.1)
                                                                    :lifetime-offset (seconds 0.6)
                                                                    :flags (particle-curve-flags pcf0)
                                                                    )
        )

(set! (-> *part-id-table* 4539 init-specs 16 initial-valuef)
      (the-as float *part-factory-boss-shot-explosion-texture-curve-settings*)
      )

(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* color-start)
      *range-factory-boss-shot-explo-color*
      )

(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* alpha-start)
      *range-factory-boss-shot-explo-alpha*
      )

(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* scale-x-start)
      *range-factory-boss-shot-explo-scale-x*
      )

(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* scale-y-start)
      *range-factory-boss-shot-explo-scale-y*
      )

(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* r-scalar) #f)

(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* g-scalar) #f)

(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* b-scalar) #f)

(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* a-scalar)
      *curve-factory-boss-shot-explo-alpha*
      )

(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* scale-x-scalar)
      *curve-factory-boss-shot-explo-scale-x*
      )

(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* scale-y-scalar)
      *curve-factory-boss-shot-explo-scale-y*
      )

(defpartgroup group-factory-boss-machine-damaged-high-smoke
  :id 1361
  :flags (sp0)
  :bounds (static-bspherem 0 0 0 12)
  :parts ((sp-item 4540 :flags (sp7)))
  )

(defpart 4540
  :init-specs ((:texture (big-cloud level-default-sprite))
    (:num 0.3)
    (:x (meters 0) (meters 1.5))
    (:scale-x (meters 2) (meters 2))
    (:scale-y :copy scale-x)
    (:r 0.0 32.0)
    (:g :copy r)
    (:b :copy r)
    (:a 0.0)
    (:vel-y (meters 0) (meters 0.0033333334))
    (:scalevel-x (meters 0.006666667) (meters 0.01))
    (:rotvel-z (degrees -0.3) (degrees 0.6))
    (:scalevel-y :copy scalevel-x)
    (:fade-a 0.64 0.64)
    (:accel-y (meters 0.00033333333) (meters 0.00066666666))
    (:friction 0.95 0.03)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:next-time (seconds 0.335))
    (:next-launcher 4541)
    (:conerot-x (degrees 80) (degrees 20))
    (:rotate-y (degrees 0) (degrees 3600))
    )
  )

(defpart 4541
  :init-specs ((:fade-a -0.256 -0.256))
  )

(defpartgroup group-factory-boss-machine-damaged-low-smoke
  :id 1362
  :flags (sp0 sp4)
  :bounds (static-bspherem 0 0 0 12)
  :parts ((sp-item 4542 :flags (sp7)))
  )

(defpart 4542
  :init-specs ((:texture (big-cloud level-default-sprite))
    (:num 0.3)
    (:x (meters -1) (meters 2))
    (:y (meters 2))
    (:z (meters -2) (meters 4))
    (:scale-x (meters 1) (meters 1))
    (:scale-y :copy scale-x)
    (:r 16.0 32.0)
    (:g :copy r)
    (:b :copy r)
    (:a 0.0)
    (:vel-y (meters 0.033333335))
    (:scalevel-x (meters 0.006666667) (meters 0.006666667))
    (:rotvel-z (degrees -0.3) (degrees 0.6))
    (:scalevel-y :copy scalevel-x)
    (:fade-a 1.28)
    (:accel-y (meters 0.00016666666) (meters 0.00033333333))
    (:friction 0.97 0.01)
    (:timer (seconds 4))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:next-time (seconds 0.335))
    (:next-launcher 4543)
    (:conerot-x (degrees 60))
    (:rotate-y (degrees 0))
    )
  )

(defpart 4543
  :init-specs ((:fade-a -0.11636364 -0.11636364))
  )

(defpartgroup group-factory-boss-machine-ring1
  :id 1363
  :duration (seconds 0.017)
  :flags (sp0)
  :bounds (static-bspherem 0 0 0 12)
  :parts ((sp-item 4544 :flags (is-3d sp6 sp7)))
  )

(defpart 4544
  :init-specs ((:texture (ring level-default-sprite))
    (:num 1.0)
    (:y (meters -0.1))
    (:z (meters 0.38))
    (:scale-x (meters 8))
    (:rot-x (degrees 90))
    (:scale-y :copy scale-x)
    (:r 1.0)
    (:g 1.0)
    (:b 128.0)
    (:a 64.0 8.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-3))
    (:rotate-y (degrees 0))
    )
  )

(defpartgroup group-factory-boss-machine-ring2
  :id 1364
  :duration (seconds 0.017)
  :flags (sp0)
  :bounds (static-bspherem 0 0 0 12)
  :parts ((sp-item 4545 :flags (is-3d sp6 sp7)))
  )

(defpart 4545
  :init-specs ((:texture (ring level-default-sprite))
    (:num 1.0)
    (:y (meters -0.1))
    (:z (meters 0.38))
    (:scale-x (meters 8))
    (:rot-x (degrees 90))
    (:scale-y :copy scale-x)
    (:r 128.0)
    (:g 1.0)
    (:b 1.0)
    (:a 64.0 8.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-3))
    (:rotate-y (degrees 0))
    )
  )

(defpartgroup group-factory-boss-machine-ring3
  :id 1365
  :duration (seconds 0.017)
  :flags (sp0)
  :bounds (static-bspherem 0 0 0 12)
  :parts ((sp-item 4546 :flags (is-3d sp6 sp7)))
  )

(defpart 4546
  :init-specs ((:texture (ring level-default-sprite))
    (:num 1.0)
    (:y (meters -0.1))
    (:z (meters 0.45))
    (:scale-x (meters 8))
    (:rot-x (degrees 90))
    (:scale-y :copy scale-x)
    (:r 1.0)
    (:g 128.0)
    (:b 1.0)
    (:a 64.0 8.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-3))
    (:rotate-y (degrees 0))
    )
  )

(defpartgroup group-factory-boss-machine-ring4
  :id 1366
  :duration (seconds 0.017)
  :flags (sp0)
  :bounds (static-bspherem 0 0 0 12)
  :parts ((sp-item 4547 :flags (is-3d sp6 sp7)))
  )

(defpart 4547
  :init-specs ((:texture (ring level-default-sprite))
    (:num 1.0)
    (:y (meters -0.1))
    (:z (meters 0.38))
    (:scale-x (meters 8))
    (:rot-x (degrees 90))
    (:scale-y :copy scale-x)
    (:r 64.0)
    (:g 1.0)
    (:b 128.0)
    (:a 64.0 8.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-3))
    (:rotate-y (degrees 0))
    )
  )

(defpartgroup group-factory-boss-machine-explosion
  :id 1367
  :duration (seconds 4)
  :flags (sp0 sp5)
  :bounds (static-bspherem 0 0 0 15)
  :parts ((sp-item 4548 :flags (sp3) :period (seconds 30) :length (seconds 0.017))
    (sp-item 4549 :fade-after (meters 400) :flags (sp3) :period (seconds 30) :length (seconds 0.017))
    (sp-item 4550 :flags (sp3) :period (seconds 30) :length (seconds 0.017))
    (sp-item 4551 :period (seconds 30) :length (seconds 0.167))
    (sp-item 4552 :period (seconds 30) :length (seconds 0.5))
    )
  )

(defpart 4550
  :init-specs ((:texture (starflash level-default-sprite))
    (:num 1.0)
    (:scale-x (meters 20))
    (:rot-x (degrees 2.25))
    (:rot-z (degrees 0) (degrees 360))
    (:scale-y :copy scale-x)
    (:r 128.0)
    (:g 80.0)
    (:b 40.0)
    (:a 128.0)
    (:omega (degrees 6767.9995))
    (:scalevel-x (meters -0.33333334))
    (:scalevel-y :copy scalevel-x)
    (:timer (seconds 0.135))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
    (:userdata 4096.0)
    )
  )

(defpart 4548
  :init-specs ((:texture (glow-soft level-default-sprite))
    (:num 1.0)
    (:scale-x (meters 20))
    (:rot-x (degrees 22.5))
    (:scale-y :copy scale-x)
    (:r 255.0)
    (:g 128.0)
    (:b 40.0)
    (:a 64.0)
    (:fade-a -0.21333334)
    (:timer (seconds 1))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow))
    )
  )

(defpart 4549
  :init-specs ((:texture (bigpuff level-default-sprite))
    (:num 10.0)
    (:scale-x (meters 2) (meters 1))
    (:rot-z (degrees 0) (degrees 360))
    (:scale-y :copy scale-x)
    (:r 255.0)
    (:g 160.0)
    (:b 40.0)
    (:a 128.0)
    (:vel-y (meters 0) (meters 0.033333335))
    (:scalevel-x (meters 0.01))
    (:scalevel-y :copy scalevel-x)
    (:fade-g -0.13333334)
    (:fade-b -0.05)
    (:fade-a -0.21333334 -0.21333334)
    (:friction 0.93)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14))
    (:conerot-x (degrees 0) (degrees 360))
    (:rotate-y (degrees 0) (degrees 3600))
    )
  )

(defpart 4551
  :init-specs ((:texture (explosion-edge level-default-sprite))
    (:num 2.0)
    (:scale-x (meters 2) (meters 1))
    (:rot-y (degrees 0) (degrees 360))
    (:scale-y :copy scale-x)
    (:r 128.0)
    (:g 80.0 20.0)
    (:b 30.0)
    (:a 128.0)
    (:vel-y (meters 0.16666667) (meters 0.06666667))
    (:scalevel-x (meters 0.016666668))
    (:scalevel-y :copy scalevel-x)
    (:fade-g -0.17777778)
    (:fade-b -0.06666667)
    (:fade-a -0.28444445 -0.28444445)
    (:friction 0.7)
    (:timer (seconds 1.5))
    (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14))
    (:func 'sparticle-2d-spline-align-instant)
    (:conerot-x (degrees 0) (degrees 360))
    (:rotate-y (degrees 0) (degrees 3600))
    )
  )

(defpart 4552
  :init-specs ((:texture (explo-texture level-default-sprite))
    (:birth-func 'birth-func-curve)
    (:num 1.0)
    (:x (meters -1) (meters 2))
    (:y (meters 0) (meters 2))
    (:scale-x (meters 1))
    (:rot-z (degrees 0) (degrees 360))
    (:scale-y :copy scale-x)
    (:r 128.0)
    (:g 128.0)
    (:b 128.0)
    (:a 128.0)
    (:vel-y (meters 0.033333335) (meters 0.016666668))
    (:friction 0.9)
    (:timer (seconds 1))
    (:flags (sp-cpuinfo-flag-14))
    (:userdata 0.0)
    (:func 'live-func-curve)
    (:conerot-x (degrees 20) (degrees 90))
    (:rotate-y (degrees 0) (degrees 3600))
    )
  )

(if #t
    (set! *range-factory-boss-shot-explo-color* (new 'static 'curve-color-fast
                                                  :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0)
                                                  :ys (new 'static 'inline-array vector 4
                                                    (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0)
                                                    (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0)
                                                    (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0)
                                                    (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0)
                                                    )
                                                  :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
                                                  )
          )
    )

(if #t
    (set! *range-factory-boss-shot-explo-alpha* (new 'static 'curve2d-fast
                                                  :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0)
                                                  :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0)
                                                  :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0)
                                                  )
          )
    )

(if #t
    (set! *range-factory-boss-shot-explo-scale-x* (new 'static 'curve2d-fast
                                                    :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0)
                                                    :ys (new 'static 'vector :x 2.0 :y 3.0 :z 4.0 :w 5.0)
                                                    :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
                                                    )
          )
    )

(if #t
    (set! *range-factory-boss-shot-explo-scale-y* (new 'static 'curve2d-fast
                                                    :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0)
                                                    :ys (new 'static 'vector :x 2.0 :y 3.0 :z 4.0 :w 5.0)
                                                    :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
                                                    )
          )
    )

(if #t
    (set! *curve-factory-boss-shot-explo-alpha*
          (new 'static 'curve2d-fast
            :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0)
            :ys (new 'static 'vector :y 1.0 :z 0.8)
            :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0)
            )
          )
    )

(if #t
    (set! *curve-factory-boss-shot-explo-scale-x* (new 'static 'curve2d-fast
                                                    :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0)
                                                    :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5)
                                                    :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0)
                                                    )
          )
    )

(if #t
    (set! *curve-factory-boss-shot-explo-scale-y* (new 'static 'curve2d-fast
                                                    :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0)
                                                    :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5)
                                                    :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0)
                                                    )
          )
    )

(define *part-factory-boss-machine-explosion-texture-curve-settings* (new 'static 'particle-curve-settings
                                                                       :lifetime-base (seconds 0.1)
                                                                       :lifetime-offset (seconds 0.6)
                                                                       :flags (particle-curve-flags pcf0)
                                                                       )
        )

(set! (-> *part-id-table* 4552 init-specs 16 initial-valuef)
      (the-as float *part-factory-boss-machine-explosion-texture-curve-settings*)
      )

(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* color-start)
      *range-factory-boss-shot-explo-color*
      )

(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* alpha-start)
      *range-factory-boss-shot-explo-alpha*
      )

(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* scale-x-start)
      *range-factory-boss-shot-explo-scale-x*
      )

(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* scale-y-start)
      *range-factory-boss-shot-explo-scale-y*
      )

(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* r-scalar) #f)

(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* g-scalar) #f)

(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* b-scalar) #f)

(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* a-scalar)
      *curve-factory-boss-shot-explo-alpha*
      )

(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* scale-x-scalar)
      *curve-factory-boss-shot-explo-scale-x*
      )

(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* scale-y-scalar)
      *curve-factory-boss-shot-explo-scale-y*
      )

(defpartgroup group-missile-bot-fizzle
  :id 1368
  :duration (seconds 1)
  :flags (sp0)
  :bounds (static-bspherem 0 0 0 12)
  :parts ((sp-item 4553 :flags (sp7)) (sp-item 4553 :flags (sp7)))
  )

(defpart 4554
  :init-specs ((:texture (bigpuff level-default-sprite))
    (:num 1.0)
    (:x (meters -0.5) (meters 1.5))
    (:scale-x (meters 4) (meters 3))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 4) (meters 3))
    (:r 64.0)
    (:g 128.0 64.0)
    (:b 196.0 64.0)
    (:a 16.0 32.0)
    (:vel-y (meters 0.02) (meters 0.02))
    (:scalevel-x (meters 0.006666667) (meters 0.01))
    (:rotvel-z (degrees -0.3) (degrees 0.6))
    (:scalevel-y :copy scalevel-x)
    (:fade-a -0.08 -0.16)
    (:friction 0.95 0.03)
    (:timer (seconds 2.167))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:rotate-y (degrees 0) (degrees 3600))
    )
  )

(defpartgroup group-missile-bot-spark
  :id 1369
  :duration (seconds 1)
  :flags (sp0)
  :bounds (static-bspherem 0 0 0 12)
  :parts ((sp-item 4555 :flags (sp7)))
  )

(defpart 4556
  :init-specs ((:texture (glow level-default-sprite))
    (:num 1.0)
    (:scale-x (meters 1) (meters 0.05))
    (:rot-x (degrees 0.675))
    (:scale-y :copy scale-x)
    (:r 64.0 32.0)
    (:g 255.0)
    (:b 0.0)
    (:a 16.0 8.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
    (:userdata 1228.8)
    (:rotate-y (degrees 0))
    )
  )

(defpart 4557
  :init-specs ((:texture (glow level-default-sprite))
    (:num 1.0)
    (:y (meters 0.2))
    (:scale-x (meters 1) (meters 0.05))
    (:rot-x (degrees 2.25))
    (:scale-y :copy scale-x)
    (:r 255.0)
    (:g 64.0 64.0)
    (:b 0.0)
    (:a 16.0 8.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
    (:userdata 409.6)
    (:rotate-y (degrees 0))
    )
  )

(defpartgroup group-missile-bot-thruster
  :id 1370
  :duration (seconds 0.017)
  :flags (sp0)
  :bounds (static-bspherem 0 0 0 8)
  :parts ((sp-item 4558 :fade-after (meters 120) :falloff-to (meters 120) :flags (is-3d sp7))
    (sp-item 4559 :fade-after (meters 120) :falloff-to (meters 120) :flags (sp7))
    (sp-item 4560 :fade-after (meters 120) :falloff-to (meters 120) :flags (sp7))
    (sp-item 4561 :fade-after (meters 80) :falloff-to (meters 80) :flags (sp7))
    (sp-item 4562 :fade-after (meters 80) :falloff-to (meters 80) :flags (sp7))
    )
  )

(defpart 4558
  :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite))
    (:num 1.0)
    (:z (meters 0.5))
    (:scale-x (meters 0.5) (meters 0.1))
    (:scale-y (meters 1) (meters 0.1))
    (:r 96.0 32.0)
    (:g 0.0 128.0)
    (:b 128.0)
    (:a 32.0 32.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
    (:rotate-x (degrees -90))
    (:rotate-y (degrees 0))
    )
  )

(defpart 4559
  :init-specs ((:texture (glow level-default-sprite))
    (:num 1.0)
    (:y (meters 0.2))
    (:scale-x (meters 1) (meters 0.05))
    (:scale-y :copy scale-x)
    (:r 128.0)
    (:g 32.0 32.0)
    (:b 0.0)
    (:a 8.0 8.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
    (:userdata 409.6)
    (:rotate-y (degrees 0))
    )
  )

(defpart 4560
  :init-specs ((:texture (bigpuff level-default-sprite))
    (:num 0.0 1.0)
    (:y (meters 0) (meters 0.25))
    (:scale-x (meters 0.2) (meters 0.2))
    (:rot-z (degrees 0) 1 (degrees 180))
    (:scale-y (meters 1) (meters 0.6))
    (:r 255.0)
    (:g 64.0)
    (:b 0.0)
    (:a 16.0 16.0)
    (:vel-y (meters 0.06666667) (meters 0.016666668))
    (:scalevel-x (meters 0.033333335) (meters 0.016666668))
    (:scalevel-y (meters 0.016666668) (meters 0.033333335))
    (:fade-r -1.28 -1.28)
    (:fade-g 1.0)
    (:fade-b 2.0)
    (:accel-x (meters 0) (meters 0.0016666667))
    (:accel-y (meters 0.00016666666) (meters 0.0005))
    (:friction 0.94)
    (:timer (seconds 1))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:next-time (seconds 0.167))
    (:next-launcher 4563)
    (:rotate-y (degrees 0) (degrees 360))
    )
  )

(defpart 4563
  :init-specs ((:r 64.0 128.0) (:g :copy r) (:b :copy g) (:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.128 -0.256))
  )

(defpart 4561
  :init-specs ((:texture (hotdot level-default-sprite))
    (:num 0.1 0.1)
    (:y (meters 0.25) (meters 0.5))
    (:scale-x (meters 0.05))
    (:scale-y (meters 0.5))
    (:r 192.0 64.0)
    (:g 0.0 128.0)
    (:b 0.0)
    (:a 128.0)
    (:vel-y (meters 0.033333335) (meters 0.026666667))
    (:scalevel-x (meters 0.001))
    (:scalevel-y (meters -0.017))
    (:fade-g 0.0)
    (:accel-x (meters 0) (meters 0.0016666667))
    (:accel-y (meters -0.00016666666) (meters -0.0005))
    (:friction 0.96)
    (:timer (seconds 0.167) (seconds 0.247))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14))
    (:next-time (seconds 0.1))
    (:next-launcher 4564)
    (:rotate-y (degrees 0) (degrees 360))
    )
  )

(defpart 4564
  :init-specs ((:scalevel-x (meters 0)) (:scalevel-y (meters 0)))
  )

(defpart 4562
  :init-specs ((:num 0.6)
    (:rot-x 8)
    (:r 1638.4)
    (:g 1331.2)
    (:b 1433.6)
    (:vel-y (meters 0.06666667) (meters 0.016666668))
    (:fade-r 32.768)
    (:fade-g 26.623999)
    (:fade-b 28.671999)
    (:accel-x (meters 0) (meters 0.0016666667))
    (:friction 0.94)
    (:timer (seconds 0.335))
    (:flags (distort))
    (:next-time (seconds 0.167))
    (:next-launcher 4565)
    (:rotate-y (degrees 0) (degrees 360))
    )
  )

(defpart 4565
  :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b -4.096))
  )

(defpartgroup group-factory-boss-bomb-reticle
  :id 1371
  :flags (sp0 sp1)
  :bounds (static-bspherem 0 0 0 3)
  :parts ((sp-item 4566 :flags (is-3d sp7)))
  )

(defpart 4566
  :init-specs ((:texture (errolbomb-target-reg-01 factoryd-sprite))
    (:num 1.0)
    (:y (meters 0.5))
    (:scale-x (meters 3))
    (:scale-y :copy scale-x)
    (:r 0.0)
    (:g 128.0)
    (:b 0.0)
    (:a 64.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-3))
    (:rotate-y (degrees 0))
    )
  )

(defpartgroup group-factory-boss-bomb-corner
  :id 1372
  :flags (sp0 sp1)
  :bounds (static-bspherem 0 0 0 3)
  :parts ((sp-item 4567 :flags (is-3d sp7)))
  )

(defpart 4567
  :init-specs ((:texture (errolbomb-target-reg-corner-01 factoryd-sprite))
    (:num 1.0)
    (:y (meters 0.5))
    (:scale-x (meters 1.5))
    (:scale-y :copy scale-x)
    (:r 0.0)
    (:g 128.0)
    (:b 0.0)
    (:a 64.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-3))
    (:rotate-y (degrees 0))
    )
  )

(defpartgroup group-factory-boss-bomb-dot
  :id 1373
  :flags (sp0 sp1)
  :bounds (static-bspherem 0 0 0 3)
  :parts ((sp-item 4568 :flags (is-3d sp7)))
  )

(defpart 4568
  :init-specs ((:texture (errolbomb-target-dot-01 factoryd-sprite))
    (:num 1.0)
    (:y (meters 0.5))
    (:scale-x (meters 0.3))
    (:scale-y :copy scale-x)
    (:r 0.0)
    (:g 128.0)
    (:b 0.0)
    (:a 64.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-3))
    (:rotate-y (degrees 0))
    )
  )

(defpartgroup group-factory-boss-bomb-arrow
  :id 1374
  :flags (sp0 sp1)
  :bounds (static-bspherem 0 0 0 3)
  :parts ((sp-item 4569 :flags (is-3d sp7)))
  )

(defpart 4569
  :init-specs ((:texture (errolbomb-target-indicator-arrow-01 factoryd-sprite))
    (:num 1.0)
    (:y (meters 0.5))
    (:scale-x (meters 1.2))
    (:scale-y :copy scale-x)
    (:r 0.0)
    (:g 128.0)
    (:b 0.0)
    (:a 64.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-3))
    (:rotate-y (degrees 0))
    )
  )

(defpartgroup group-factory-boss-superbomb-reticle
  :id 1375
  :flags (sp0 sp1)
  :bounds (static-bspherem 0 0 0 3)
  :parts ((sp-item 4570 :flags (is-3d sp7)))
  )

(defpart 4570
  :init-specs ((:texture (errolbomb-target-supr-01 factoryd-sprite))
    (:num 1.0)
    (:y (meters 0.5))
    (:scale-x (meters 3))
    (:scale-y :copy scale-x)
    (:r 128.0)
    (:g 128.0)
    (:b 0.0)
    (:a 64.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-3))
    (:rotate-y (degrees 0))
    )
  )

(defpartgroup group-factory-boss-superbomb-ring
  :id 1376
  :flags (sp0 sp1)
  :bounds (static-bspherem 0 0 0 3)
  :parts ((sp-item 4571 :flags (is-3d sp7)))
  )

(defpart 4571
  :init-specs ((:texture (errolbomb-target-supr-ring-01 factoryd-sprite))
    (:num 1.0)
    (:y (meters 0.5))
    (:scale-x (meters 3))
    (:scale-y :copy scale-x)
    (:r 128.0)
    (:g 128.0)
    (:b 0.0)
    (:a 64.0)
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-3))
    (:rotate-y (degrees 0))
    )
  )

(defpartgroup group-factory-boss-launch-critter
  :id 1377
  :flags (sp0 sp4)
  :bounds (static-bspherem 0 0 0 8)
  :parts ((sp-item 4572 :flags (sp7) :period (seconds 2) :length (seconds 0.017))
    (sp-item 4573 :flags (sp7) :period (seconds 2) :length (seconds 0.017))
    (sp-item 4574 :flags (sp6) :period (seconds 2) :length (seconds 0.017))
    )
  )

(defpart 4572
  :init-specs ((:texture (bigpuff level-default-sprite))
    (:num 16.0)
    (:scale-x (meters 1.5) (meters 0.5))
    (:rot-z (degrees 0) (degrees 360))
    (:scale-y :copy scale-x)
    (:r 64.0 128.0)
    (:g :copy r)
    (:b :copy r)
    (:a 32.0 32.0)
    (:vel-y (meters 0.016666668) (meters 0.10666667))
    (:scalevel-x (meters 0.006666667) (meters 0.013333334))
    (:rotvel-z (degrees -0.4) (degrees 0.8))
    (:scalevel-y :copy scalevel-x)
    (:fade-a -0.10666667 -0.10666667)
    (:friction 0.95)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-2))
    (:rotate-y (degrees 0))
    )
  )

(defpart 4573
  :init-specs ((:texture (bigpuff level-default-sprite))
    (:num 48.0)
    (:scale-x (meters 1.5) (meters 0.5))
    (:rot-z (degrees 0) (degrees 360))
    (:scale-y :copy scale-x)
    (:r 64.0 128.0)
    (:g :copy r)
    (:b :copy r)
    (:a 32.0 32.0)
    (:vel-y (meters 0.033333335) (meters 0.016666668))
    (:scalevel-x (meters 0.006666667) (meters 0.013333334))
    (:rotvel-z (degrees -0.4) (degrees 0.8))
    (:scalevel-y :copy scalevel-x)
    (:fade-a -0.10666667 -0.10666667)
    (:friction 0.95)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-2))
    (:conerot-x (degrees 70) (degrees 40))
    (:conerot-y (degrees 0) (degrees 3600))
    (:rotate-y (degrees 0))
    )
  )

(defpart 4574
  :init-specs ((:texture (glow level-default-sprite))
    (:num 1.0)
    (:scale-x (meters 4))
    (:rot-x (degrees 45))
    (:scale-y :copy scale-x)
    (:r 100.0)
    (:g 100.0)
    (:b 255.0)
    (:a 128.0)
    (:omega (degrees 9011.25))
    (:scalevel-x (meters 0.53333336))
    (:scalevel-y :copy scalevel-x)
    (:fade-a -6.4)
    (:timer (seconds 0.15))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
    (:userdata 40960.0)
    )
  )

(defpartgroup group-facboss-sparks
  :id 1378
  :flags (sp0 sp4)
  :bounds (static-bspherem 0 0 0 40)
  :parts ((sp-item 4555 :flags (sp7)) (sp-item 4553 :flags (sp7)) (sp-item 4553 :flags (sp7)))
  )

(defpart 4555
  :init-specs ((:texture (middot level-default-sprite))
    (:num 0.0 1.0)
    (:scale-x (meters 0.1) (meters 0.2))
    (:scale-y :copy scale-x)
    (:r 64.0 64.0)
    (:g :copy r)
    (:b 255.0)
    (:a 255.0)
    (:omega (degrees 0.0675))
    (:vel-y (meters 0.033333335) (meters 0.06666667))
    (:fade-r -0.10666667)
    (:fade-g -0.10666667)
    (:fade-a -0.21333334)
    (:accel-y (meters -0.0016666667))
    (:friction 0.94 0.04)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z left-multiply-quat))
    (:func 'sparticle-motion-blur)
    (:conerot-x (degrees 0) (degrees 180))
    (:rotate-y (degrees 0) (degrees 3600))
    )
  )

(defpart 4553
  :init-specs ((:texture (starflash level-default-sprite))
    (:num 0.1)
    (:x (meters -2) (meters 4))
    (:y (meters -2) (meters 4))
    (:z (meters 1))
    (:scale-x (meters 1) (meters 3))
    (:rot-x (degrees 22.5))
    (:rot-z (degrees 0) (degrees 360))
    (:scale-y :copy scale-x)
    (:r 64.0 64.0)
    (:g :copy r)
    (:b 255.0)
    (:a -512.0 5 128.0)
    (:scalevel-x (meters -0.1))
    (:scalevel-y :copy scalevel-x)
    (:timer (seconds 0.05))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
    (:userdata 40960.0)
    (:rotate-y (degrees 0))
    (:rotate-z (degrees 0) (degrees 3600))
    )
  )
