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

(import "goal_src/jak1/import/crate-darkeco-cluster-ag.gc")
(import "goal_src/jak1/import/spike-ag.gc")

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

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

;; failed to figure out what this is:
(defpartgroup group-balloon
  :id 227
  :duration 5
  :bounds (static-bspherem 0 0 0 15)
  :parts ((sp-item 1006) (sp-item 1007) (sp-item 1008))
  )

;; failed to figure out what this is:
(defpart 1007
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
    (sp-flt spt-num 8.0)
    (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0)
    (sp-rnd-flt spt-y (meters 1) (meters 2) 1.0)
    (sp-rnd-flt spt-z (meters -1) (meters 2) 1.0)
    (sp-rnd-flt spt-scale-x (meters 3) (meters 3) 1.0)
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-flt spt-r 96.0)
    (sp-flt spt-g 96.0)
    (sp-flt spt-b 255.0)
    (sp-rnd-flt spt-a 32.0 32.0 1.0)
    (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0)
    (sp-flt spt-fade-a -0.42666668)
    (sp-int spt-timer 150)
    (sp-cpuinfo-flags bit2 bit3)
    )
  )

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

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

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

;; failed to figure out what this is:
(defstate balloon-idle (balloon)
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (case arg2
      (('attack)
       (send-event arg0 'heat -10.0)
       (go balloon-popping)
       )
      )
    )
  :code (behavior ()
    (transform-post)
    (loop
      (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
      (until (ja-done? 0)
        (suspend)
        (ja :num! (seek!))
        )
      )
    (none)
    )
  :post (the-as (function none :behavior balloon) ja-post)
  )

;; definition for method 11 of type balloon
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! balloon ((obj balloon) (arg0 entity-actor))
  (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player))))
    (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0))))
      (set! (-> s3-0 prim-core collide-as) (collide-kind enemy))
      (set! (-> s3-0 collide-with) (collide-kind target))
      (set! (-> s3-0 prim-core offense) (collide-offense indestructible))
      (set-vector! (-> s3-0 local-sphere) 0.0 8192.0 0.0 8192.0)
      (set-root-prim! s4-0 s3-0)
      )
    (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
    (backup-collide-with-as s4-0)
    (set! (-> obj root-override) s4-0)
    )
  (process-drawable-from-entity! obj arg0)
  (initialize-skeleton obj *balloon-sg* '())
  (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 227) obj))
  (go balloon-idle)
  (none)
  )

;; definition of type spike
(deftype spike (process-drawable)
  ((root-override collide-shape  :offset        112)
   (num-alts      int32          :offset-assert 176)
   )
  :heap-base #x50
  :method-count-assert 20
  :size-assert         #xb4
  :flag-assert         #x14005000b4
  (:states
    spike-down
    spike-idle
    spike-up
    )
  )

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

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

;; failed to figure out what this is:
(defstate spike-up (spike)
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (let ((v1-0 arg2))
      (the-as object (if (= v1-0 'go-spike-up)
                         #t
                         )
              )
      )
    )
  :trans (behavior ()
    (when (nonzero? (-> self num-alts))
      (let ((s5-0 (/ (-> self num-alts) 2))
            (gp-0 #t)
            )
        (while (< s5-0 (+ (-> self num-alts) -1))
          (let ((v1-2 (entity-actor-lookup (-> self entity) 'alt-actor s5-0)))
            (if (and v1-2 (-> v1-2 extra process) (not (send-event
                                                         (if v1-2
                                                             (-> v1-2 extra process)
                                                             )
                                                         'go-spike-up
                                                         )
                                                       )
                     )
                (set! gp-0 #f)
                )
            )
          (+! s5-0 1)
          )
        (when gp-0
          (set! (-> self num-alts) 0)
          0
          )
        )
      )
    (none)
    )
  :code (behavior ()
    (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
    (until (ja-done? 0)
      (transform-post)
      (suspend)
      (ja :num! (seek!))
      )
    (loop
      (suspend)
      )
    (none)
    )
  )

;; failed to figure out what this is:
(defstate spike-down (spike)
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (let ((v1-0 arg2))
      (the-as object (when (= v1-0 'go-spike-up)
                       (go spike-up)
                       #t
                       )
              )
      )
    )
  :trans (behavior ()
    (when (nonzero? (-> self num-alts))
      (let ((s5-0 0)
            (gp-0 #t)
            )
        (while (< s5-0 (/ (-> self num-alts) 2))
          (let ((v1-1 (entity-actor-lookup (-> self entity) 'alt-actor s5-0)))
            (if (and v1-1 (-> v1-1 extra process) (not (send-event
                                                         (if v1-1
                                                             (-> v1-1 extra process)
                                                             )
                                                         'go-spike-up
                                                         )
                                                       )
                     )
                (set! gp-0 #f)
                )
            )
          (+! s5-0 1)
          )
        (when gp-0
          (set! (-> self num-alts) 0)
          0
          )
        )
      )
    (none)
    )
  :code (behavior ()
    (transform-post)
    (loop
      (suspend)
      )
    (none)
    )
  )

;; failed to figure out what this is:
(defstate spike-idle (spike)
  :trans (behavior ()
    (when (and *target*
               (= (send-event *target* 'query 'mode) 'racer)
               (< (vector-vector-distance (-> self root-override trans) (target-pos 0)) 225280.0)
               )
      (sound-play "magma-rock")
      (let ((v1-8 (entity-actor-count (-> self entity) 'alt-actor)))
        0
        (cond
          ((>= 1 v1-8)
           (go spike-up)
           )
          ((< (rand-float-gen) 0.5)
           (go spike-down)
           )
          (else
            (go spike-up)
            )
          )
        )
      )
    (none)
    )
  :code (behavior ()
    (transform-post)
    (loop
      (suspend)
      )
    (none)
    )
  )

;; definition for method 11 of type spike
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! spike ((obj spike) (arg0 entity-actor))
  (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player))))
    (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 4) 0)))
      (set! (-> s3-0 prim-core collide-as) (collide-kind enemy))
      (set! (-> s3-0 collide-with) (collide-kind target))
      (set! (-> s3-0 prim-core action) (collide-action solid))
      (set! (-> s3-0 prim-core offense) (collide-offense indestructible))
      (set! (-> s3-0 transform-index) 3)
      (set-vector! (-> s3-0 local-sphere) 0.0 24576.0 0.0 40960.0)
      (set-root-prim! s4-0 s3-0)
      (let ((s2-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0))))
        (set! (-> s2-0 prim-core collide-as) (collide-kind enemy))
        (set! (-> s2-0 collide-with) (collide-kind target))
        (set! (-> s2-0 prim-core action) (collide-action solid))
        (set! (-> s2-0 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-0 transform-index) 3)
        (set-vector! (-> s2-0 local-sphere) 0.0 8192.0 0.0 16384.0)
        (append-prim s3-0 s2-0)
        )
      (let ((s2-1 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0))))
        (set! (-> s2-1 prim-core collide-as) (collide-kind enemy))
        (set! (-> s2-1 collide-with) (collide-kind target))
        (set! (-> s2-1 prim-core action) (collide-action solid))
        (set! (-> s2-1 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-1 transform-index) 3)
        (set-vector! (-> s2-1 local-sphere) 0.0 20480.0 0.0 16384.0)
        (append-prim s3-0 s2-1)
        )
      (let ((s2-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0))))
        (set! (-> s2-2 prim-core collide-as) (collide-kind enemy))
        (set! (-> s2-2 collide-with) (collide-kind target))
        (set! (-> s2-2 prim-core action) (collide-action solid))
        (set! (-> s2-2 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-2 transform-index) 3)
        (set-vector! (-> s2-2 local-sphere) 0.0 32768.0 0.0 16384.0)
        (append-prim s3-0 s2-2)
        )
      (let ((s2-3 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0))))
        (set! (-> s2-3 prim-core collide-as) (collide-kind enemy))
        (set! (-> s2-3 collide-with) (collide-kind target))
        (set! (-> s2-3 prim-core action) (collide-action solid))
        (set! (-> s2-3 prim-core offense) (collide-offense indestructible))
        (set! (-> s2-3 transform-index) 3)
        (set-vector! (-> s2-3 local-sphere) 0.0 45056.0 0.0 16384.0)
        (append-prim s3-0 s2-3)
        )
      )
    (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
    (backup-collide-with-as s4-0)
    (set! (-> obj root-override) s4-0)
    )
  (process-drawable-from-entity! obj arg0)
  (initialize-skeleton obj *spike-sg* '())
  (set! (-> obj draw origin-joint-index) (the-as uint 3))
  (set! (-> obj num-alts) (entity-actor-count (-> obj entity) 'alt-actor))
  (if (zero? (-> obj num-alts))
      (go spike-down)
      (go spike-idle)
      )
  (none)
  )

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

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

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

;; failed to figure out what this is:
(defpartgroup group-dark-cluster-explosion
  :id 228
  :duration 600
  :flags (use-local-clock)
  :bounds (static-bspherem 0 0 0 12)
  :parts ((sp-item 2100 :period 600 :length 5)
    (sp-item 2101 :period 600 :length 40)
    (sp-item 2102 :period 600 :length 20)
    (sp-item 2103 :period 600 :length 20)
    (sp-item 2104 :fade-after (meters 100) :period 600 :length 5 :binding 296)
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    (sp-item 296 :flags (start-dead launch-asap) :binding 297)
    (sp-item 297 :fade-after (meters 80) :falloff-to (meters 100) :flags (start-dead))
    )
  )

;; failed to figure out what this is:
(defpart 2104
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x12 :page #x2))
    (sp-flt spt-num 32.0)
    (sp-rnd-flt spt-x (meters -2) (meters 4) 1.0)
    (sp-rnd-flt spt-y (meters 1) (meters 2) 1.0)
    (sp-rnd-flt spt-z (meters -2) (meters 4) 1.0)
    (sp-flt spt-scale-x (meters 0.1))
    (sp-copy-from-other spt-scale-y -4)
    (sp-flt spt-a 0.0)
    (sp-rnd-flt spt-vel-y (meters 0.053333335) (meters 0.026666667) 1.0)
    (sp-flt spt-accel-y -1.3653333)
    (sp-flt spt-friction 0.94)
    (sp-int spt-timer 240)
    (sp-cpuinfo-flags bit3)
    (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 140.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 2101
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
    (sp-flt spt-num 12.0)
    (sp-rnd-flt spt-y (meters 1) (meters 3) 1.0)
    (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.8) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 128.0 128.0 1.0)
    (sp-rnd-flt spt-g 0.0 32.0 1.0)
    (sp-rnd-flt spt-b 128.0 128.0 1.0)
    (sp-rnd-flt spt-a 32.0 96.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0.04) (meters 0.16) 1.0)
    (sp-flt spt-scalevel-x (meters -0.0026666666))
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-rnd-flt spt-accel-y -0.68266666 -0.68266666 1.0)
    (sp-flt spt-friction 0.9)
    (sp-int spt-timer 300)
    (sp-cpuinfo-flags bit2 bit14)
    (sp-int-plain-rnd spt-next-time 30 89 1)
    (sp-launcher-by-id spt-next-launcher 2105)
    (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 120.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
    (sp-rnd-flt spt-conerot-radius (meters 2) (meters 4) 1.0)
    )
  )

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

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

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

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

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

;; failed to figure out what this is:
(defstate idle (crate-darkeco-cluster)
  :virtual #t
  :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
    (case arg2
      (('attack 'touch)
       (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'darkeco))))
       (go-virtual die)
       )
      )
    )
  :code (behavior ()
    (transform-post)
    (logior! (-> self mask) (process-mask sleep))
    (suspend)
    0
    (none)
    )
  )

;; definition for method 11 of type crate-darkeco-cluster
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! crate-darkeco-cluster ((obj crate-darkeco-cluster) (arg0 entity-actor))
  (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player))))
    (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
      (set! (-> s3-0 prim-core collide-as) (collide-kind crate))
      (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 touch))
      (set! (-> s3-0 transform-index) 3)
      (set-vector! (-> s3-0 local-sphere) 0.0 6553.6 0.0 13516.8)
      (set-root-prim! s4-0 s3-0)
      )
    (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
    (backup-collide-with-as s4-0)
    (set! (-> obj root-override) s4-0)
    )
  (process-drawable-from-entity! obj arg0)
  (initialize-skeleton obj *crate-darkeco-cluster-sg* '())
  (go (method-of-object obj idle))
  (none)
  )
