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

;; name: ctymark-obs.gc
;; name in dgo: ctymark-obs
;; dgos: WWD

;; DECOMP BEGINS

(defpartgroup group-mcrate-explode
  :id 248
  :duration (seconds 3.335)
  :flags (sp0 sp6)
  :bounds (static-bspherem 0 0 0 12)
  :rotate ((degrees 0) (degrees 90) (degrees 0))
  :parts ((sp-item 1117 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.035))
    (sp-item 1118 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05))
    (sp-item 1119 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135))
    (sp-item 1120 :fade-after (meters 60) :falloff-to (meters 90) :flags (sp7) :period (seconds 4) :length (seconds 0.05))
    (sp-item 1121 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017))
    )
  )

(defpart 1119
  :init-specs ((:texture (bigpuff level-default-sprite))
    (:num 16.0 3.0)
    (:y (meters 0) (meters 1))
    (:z (meters -1) (meters 2))
    (:scale-x (meters 2) (meters 2))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 2) (meters 2))
    (:r 128.0)
    (:g 64.0 32.0)
    (:b 0.0 32.0)
    (:a 16.0 8.0)
    (:vel-y (meters 0.06666667) (meters 0.033333335))
    (:scalevel-x (meters 0) (meters 0.0033333334))
    (:rotvel-z (degrees -0.2) (degrees 0.4))
    (:scalevel-y (meters 0) (meters 0.0033333334))
    (:fade-a -0.02 -0.02)
    (:accel-y (meters -0.00033333333) (meters -0.00083333335))
    (:friction 0.82 0.07)
    (:timer (seconds 4))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:conerot-x (degrees 30) (degrees 50.000004))
    (:conerot-y (degrees 0) (degrees 180))
    (:rotate-y (degrees 0))
    )
  )

(defpart 1120
  :init-specs ((:texture (bigpuff level-default-sprite))
    (:num 8.0 3.0)
    (:y (meters 0) (meters 1))
    (:z (meters -1) (meters 2))
    (:scale-x (meters 2) (meters 2))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 2) (meters 2))
    (:r 0.0 128.0)
    (:g :copy r)
    (:b :copy g)
    (:a 16.0 8.0)
    (:vel-y (meters 0.05) (meters 0.033333335))
    (:scalevel-x (meters 0) (meters 0.0033333334))
    (:rotvel-z (degrees -0.2) (degrees 0.4))
    (:scalevel-y (meters 0) (meters 0.0033333334))
    (:fade-a -0.02 -0.02)
    (:accel-y (meters -0.00033333333) (meters -0.00083333335))
    (:friction 0.82 0.07)
    (:timer (seconds 4))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:conerot-x (degrees 30) (degrees 50.000004))
    (:conerot-y (degrees 0) (degrees 180))
    (:rotate-y (degrees 0))
    )
  )

(defpart 1121
  :init-specs ((:texture (glow-soft level-default-sprite))
    (:num 1.0)
    (:y (meters 1))
    (:scale-x (meters 4))
    (:rot-x (degrees 0.675))
    (:scale-y (meters 6))
    (:r 255.0)
    (:g 196.0)
    (:b 128.0)
    (:a 64.0)
    (:omega (degrees 1136.25))
    (:scalevel-x (meters 0.2))
    (:scalevel-y :copy scalevel-x)
    (:fade-a -2.56)
    (:timer (seconds 0.085))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
    (:userdata 1024.0)
    )
  )

(defpart 1118
  :init-specs ((:texture (new 'static 'texture-id :index #x15 :page #xc1))
    (:num 12.0 6.0)
    (:y (meters 0) (meters 2))
    (:z (meters -1) (meters 2))
    (:scale-x (meters 0.1) (meters 0.5))
    (:rot-x (degrees 0) (degrees 3600))
    (:rot-y (degrees 0) (degrees 3600))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 0.1) (meters 0.5))
    (:r 64.0 128.0)
    (:g :copy r)
    (:b :copy g)
    (:a 128.0)
    (:vel-y (meters 0.083333336) (meters 0.05))
    (:scalevel-x (meters -0.00022222222))
    (:rotvel-x (degrees -4.8) (degrees 9.6))
    (:rotvel-y (degrees -4.8) (degrees 9.6))
    (:rotvel-z (degrees -4.8) (degrees 9.6))
    (:scalevel-y (meters -0.00022222222))
    (:fade-a -0.21333334 -0.21333334)
    (:accel-y (meters -0.0033333334) (meters -0.0016666667))
    (:friction 0.92 0.07)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:func 'check-market-piece-ground)
    (:next-time (seconds 4))
    (:next-launcher 1122)
    (:conerot-x (degrees 0) (degrees 110))
    (:conerot-y (degrees 0) (degrees 180))
    (:rotate-y (degrees 0))
    )
  )

(defpart 1117
  :init-specs ((:texture (new 'static 'texture-id :index #x15 :page #xc1))
    (:num 6.0 3.0)
    (:y (meters 0) (meters 2))
    (:z (meters -1) (meters 2))
    (:scale-x (meters 0.3) (meters 2))
    (:rot-x (degrees 0) (degrees 3600))
    (:rot-y (degrees 0) (degrees 3600))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 0.3) (meters 0.6))
    (:r 64.0 128.0)
    (:g :copy r)
    (:b :copy g)
    (:a 128.0)
    (:vel-y (meters 0.1) (meters 0.06666667))
    (:rotvel-x (degrees -4.8) (degrees 9.6))
    (:rotvel-y (degrees -4.8) (degrees 9.6))
    (:rotvel-z (degrees -4.8) (degrees 9.6))
    (:accel-y (meters -0.0033333334) (meters -0.0016666667))
    (:friction 0.92 0.07)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:func 'check-market-piece-ground)
    (:next-time (seconds 0.4))
    (:next-launcher 1122)
    (:conerot-x (degrees 0) (degrees 110))
    (:conerot-y (degrees 15) (degrees 150))
    (:rotate-y (degrees 0))
    )
  )

(defpartgroup group-mbasket-a-explode
  :id 249
  :duration (seconds 3.335)
  :flags (sp0 sp6)
  :bounds (static-bspherem 0 0 0 12)
  :rotate ((degrees 0) (degrees 90) (degrees 0))
  :parts ((sp-item 1123 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.035))
    (sp-item 1124 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05))
    (sp-item 1125 :fade-after (meters 40) :falloff-to (meters 60) :flags (sp7) :period (seconds 4) :length (seconds 0.05))
    (sp-item 1126 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1))
    (sp-item 1127 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135))
    (sp-item 1128 :fade-after (meters 60) :falloff-to (meters 90) :flags (sp7) :period (seconds 4) :length (seconds 0.05))
    (sp-item 1129 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017))
    )
  )

(defpart 1126
  :init-specs ((:texture (specs level-default-sprite))
    (:num 32.0)
    (:y (meters 0) (meters 3))
    (:z (meters -1.5) (meters 3))
    (:scale-x (meters 2) (meters 0.5))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y :copy scale-x)
    (:r 64.0 64.0)
    (:g :copy r)
    (:b 128.0 64.0)
    (:a 92.0 32.0)
    (:vel-y (meters 0.033333335) (meters 0.06666667))
    (:rotvel-z (degrees -0.2) (degrees 0.4))
    (:fade-a -0.16 -0.16)
    (:accel-y (meters -0.0016666667) (meters -0.00083333335))
    (:friction 0.95 0.03)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13))
    (:conerot-x (degrees 0) (degrees 50.000004))
    (:conerot-y (degrees 0) (degrees 180))
    (:rotate-y (degrees 0))
    )
  )

(defpart 1125
  :init-specs ((:texture (lakedrop level-default-sprite))
    (:num 32.0)
    (:y (meters 0.5) (meters 1))
    (:scale-x (meters 0.1) (meters 0.05))
    (:rot-x 4)
    (:scale-y :copy scale-x)
    (:r 32.0 32.0)
    (:g :copy r)
    (:b 64.0 32.0)
    (:a 128.0)
    (:omega (degrees 0.01575) (degrees 0.009))
    (:vel-y (meters 0.033333335) (meters 0.083333336))
    (:accel-y (meters -0.003) (meters -0.00066666666))
    (:friction 0.96 0.02)
    (:timer (seconds 1))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot))
    (:userdata 30720.0)
    (:func 'check-water-level-drop-motion)
    (:next-time (seconds 0) (seconds 0.58))
    (:next-launcher 41)
    (:conerot-x (degrees 0) (degrees 85))
    (:conerot-y (degrees 0) (degrees 3600))
    (:rotate-y (degrees 0))
    (:conerot-radius (meters 0) (meters 1))
    )
  )

(defpart 1127
  :init-specs ((:texture (bigpuff level-default-sprite))
    (:num 6.0 2.0)
    (:y (meters 0) (meters 2))
    (:z (meters -1.5) (meters 3))
    (:scale-x (meters 2) (meters 2))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 2) (meters 2))
    (:r 64.0 64.0)
    (:g 128.0 128.0)
    (:b 255.0)
    (:a 16.0 8.0)
    (:vel-y (meters 0.06666667) (meters 0.033333335))
    (:scalevel-x (meters 0) (meters 0.0033333334))
    (:rotvel-z (degrees -0.2) (degrees 0.4))
    (:scalevel-y (meters 0) (meters 0.0033333334))
    (:fade-a -0.02 -0.02)
    (:accel-y (meters -0.00083333335) (meters -0.00083333335))
    (:friction 0.82 0.07)
    (:timer (seconds 4))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13))
    (:conerot-x (degrees 30) (degrees 50.000004))
    (:conerot-y (degrees 0) (degrees 180))
    (:rotate-y (degrees 0))
    )
  )

(defpart 1128
  :init-specs ((:texture (bigpuff level-default-sprite))
    (:num 4.0 3.0)
    (:y (meters 0) (meters 4))
    (:z (meters -1.5) (meters 3))
    (:scale-x (meters 2) (meters 2))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 2) (meters 2))
    (:r 0.0 128.0)
    (:g :copy r)
    (:b :copy g)
    (:a 16.0 8.0)
    (:vel-y (meters 0.05) (meters 0.033333335))
    (:scalevel-x (meters 0) (meters 0.0033333334))
    (:rotvel-z (degrees -0.2) (degrees 0.4))
    (:scalevel-y (meters 0) (meters 0.0033333334))
    (:fade-a -0.02 -0.02)
    (:accel-y (meters -0.00033333333) (meters -0.00083333335))
    (:friction 0.82 0.07)
    (:timer (seconds 4))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:conerot-x (degrees 30) (degrees 50.000004))
    (:conerot-y (degrees 0) (degrees 180))
    (:rotate-y (degrees 0))
    )
  )

(defpart 1129
  :init-specs ((:texture (glow-soft level-default-sprite))
    (:num 1.0)
    (:y (meters 2))
    (:scale-x (meters 7))
    (:rot-x (degrees 0.675))
    (:scale-y (meters 5))
    (:r 64.0)
    (:g 196.0)
    (:b 255.0)
    (:a 64.0)
    (:omega (degrees 1136.25))
    (:scalevel-x (meters 0.2))
    (:scalevel-y :copy scalevel-x)
    (:fade-a -2.56)
    (:timer (seconds 0.085))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
    (:userdata 1024.0)
    )
  )

(defpart 1124
  :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #xc1))
    (:birth-func 'birth-func-texture-group)
    (:num 12.0 6.0)
    (:y (meters 0.5) (meters 4))
    (:z (meters -1.5) 1 (meters 3))
    (:scale-x (meters 0.2) (meters 0.3))
    (:rot-x (degrees 0) (degrees 3600))
    (:rot-y (degrees 0) (degrees 3600))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 0.2) (meters 0.3))
    (:r 64.0 128.0)
    (:g :copy r)
    (:b :copy g)
    (:a 128.0)
    (:vel-y (meters 0.083333336) (meters 0.05))
    (:scalevel-x (meters -0.00022222222))
    (:rotvel-x (degrees -4.8) (degrees 9.6))
    (:rotvel-y (degrees -4.8) (degrees 9.6))
    (:rotvel-z (degrees -4.8) (degrees 9.6))
    (:scalevel-y (meters -0.00022222222))
    (:fade-a -0.21333334 -0.21333334)
    (:accel-y (meters -0.0033333334) (meters -0.0016666667))
    (:friction 0.92 0.07)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #xc100200 #xc100c00))
    (:func 'check-market-piece-ground)
    (:next-time (seconds 4))
    (:next-launcher 1122)
    (:conerot-x (degrees 0) (degrees 110))
    (:conerot-y (degrees 0) (degrees 180))
    (:rotate-y (degrees 0))
    )
  )

(defpart 1123
  :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #xc1))
    (:birth-func 'birth-func-texture-group)
    (:num 6.0 3.0)
    (:y (meters 0.5) (meters 4))
    (:z (meters -1.5) 1 (meters 3))
    (:scale-x (meters 0.5) (meters 0.5))
    (:rot-x (degrees 0) (degrees 3600))
    (:rot-y (degrees 0) (degrees 3600))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 0.5) (meters 0.5))
    (:r 64.0 128.0)
    (:g :copy r)
    (:b :copy g)
    (:a 128.0)
    (:vel-y (meters 0.1) (meters 0.06666667))
    (:rotvel-x (degrees -4.8) (degrees 9.6))
    (:rotvel-y (degrees -4.8) (degrees 9.6))
    (:rotvel-z (degrees -4.8) (degrees 9.6))
    (:accel-y (meters -0.0033333334) (meters -0.0016666667))
    (:friction 0.92 0.07)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #xc100200 #xc100c00))
    (:func 'check-market-piece-ground)
    (:next-time (seconds 0.4))
    (:next-launcher 1122)
    (:conerot-x (degrees 0) (degrees 110))
    (:conerot-y (degrees 15) (degrees 150))
    (:rotate-y (degrees 0))
    )
  )

(defpartgroup group-mbasket-b-explode
  :id 250
  :duration (seconds 3.335)
  :flags (sp0 sp6)
  :bounds (static-bspherem 0 0 0 12)
  :rotate ((degrees 0) (degrees 90) (degrees 0))
  :parts ((sp-item 1130 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.035))
    (sp-item 1131 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05))
    (sp-item 1132 :fade-after (meters 60) :falloff-to (meters 90) :flags (sp7) :period (seconds 4) :length (seconds 0.05))
    (sp-item 1133 :fade-after (meters 60) :falloff-to (meters 90) :flags (sp7) :period (seconds 4) :length (seconds 0.05))
    (sp-item 1134 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1))
    (sp-item 1135 :fade-after (meters 30) :falloff-to (meters 40) :flags (is-3d) :period (seconds 4) :length (seconds 0.335))
    (sp-item 1136 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017))
    )
  )

(defpart 1134
  :init-specs ((:texture (specs level-default-sprite))
    (:num 32.0)
    (:y (meters 0) (meters 1))
    (:z (meters -1.5) (meters 3))
    (:scale-x (meters 1) (meters 1))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 1) (meters 1))
    (:r 255.0)
    (:g :copy r)
    (:b :copy g)
    (:a 92.0 32.0)
    (:vel-y (meters 0.033333335) (meters 0.06666667))
    (:rotvel-z (degrees -0.2) (degrees 0.4))
    (:fade-a -0.16 -0.16)
    (:accel-y (meters -0.0016666667) (meters -0.00083333335))
    (:friction 0.95 0.03)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13))
    (:conerot-x (degrees 0) (degrees 50.000004))
    (:conerot-y (degrees 0) (degrees 180))
    (:rotate-y (degrees 0))
    )
  )

(defpart 1135
  :init-specs ((:texture (specs level-default-sprite))
    (:num 2.0)
    (:x (meters -3) (meters 6))
    (:y (meters 0.05))
    (:z (meters -3) (meters 6))
    (:scale-x (meters 1.5) (meters 1))
    (:rot-y (degrees 0) (degrees 3600))
    (:scale-y (meters 1.5) (meters 1))
    (:r 255.0)
    (:g :copy r)
    (:b :copy g)
    (:a 0.0)
    (:fade-a 3.2)
    (:timer (seconds 4))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 left-multiply-quat))
    (:next-time (seconds 0.135))
    (:next-launcher 1137)
    )
  )

(defpart 1137
  :init-specs ((:fade-a 0.0) (:next-time (seconds 1) (seconds 0.997)) (:next-launcher 1138))
  )

(defpart 1138
  :init-specs ((:fade-a -0.21333334 -0.21333334))
  )

(defpart 1132
  :init-specs ((:texture (bigpuff level-default-sprite))
    (:num 6.0 3.0)
    (:y (meters 0) (meters 1))
    (:z (meters -1.5) (meters 3))
    (:scale-x (meters 2) (meters 2))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 2) (meters 2))
    (:r 192.0 64.0)
    (:g :copy r)
    (:b :copy g)
    (:a 16.0 8.0)
    (:vel-y (meters 0.06666667) (meters 0.033333335))
    (:scalevel-x (meters 0) (meters 0.0033333334))
    (:rotvel-z (degrees -0.2) (degrees 0.4))
    (:scalevel-y (meters 0) (meters 0.0033333334))
    (:fade-a -0.02 -0.02)
    (:accel-y (meters -0.00033333333) (meters -0.00083333335))
    (:friction 0.82 0.07)
    (:timer (seconds 4))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13))
    (:conerot-x (degrees 30) (degrees 50.000004))
    (:conerot-y (degrees 0) (degrees 180))
    (:rotate-y (degrees 0))
    )
  )

(defpart 1133
  :init-specs ((:texture (bigpuff level-default-sprite))
    (:num 12.0 3.0)
    (:y (meters 0) (meters 1))
    (:z (meters -1.5) (meters 3))
    (:scale-x (meters 2) (meters 2))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 2) (meters 2))
    (:r 0.0 128.0)
    (:g :copy r)
    (:b :copy g)
    (:a 16.0 8.0)
    (:vel-y (meters 0.05) (meters 0.033333335))
    (:scalevel-x (meters 0) (meters 0.0033333334))
    (:rotvel-z (degrees -0.2) (degrees 0.4))
    (:scalevel-y (meters 0) (meters 0.0033333334))
    (:fade-a -0.02 -0.02)
    (:accel-y (meters -0.00033333333) (meters -0.00083333335))
    (:friction 0.82 0.07)
    (:timer (seconds 4))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:conerot-x (degrees 30) (degrees 50.000004))
    (:conerot-y (degrees 0) (degrees 180))
    (:rotate-y (degrees 0))
    )
  )

(defpart 1136
  :init-specs ((:texture (glow-soft level-default-sprite))
    (:num 1.0)
    (:y (meters 0.5))
    (:scale-x (meters 3))
    (:rot-x (degrees 0.675))
    (:scale-y (meters 7))
    (:r 255.0)
    (:g 255.0)
    (:b 255.0)
    (:a 64.0)
    (:omega (degrees 1136.25))
    (:scalevel-x (meters 0.2))
    (:scalevel-y :copy scalevel-x)
    (:fade-a -2.56)
    (:timer (seconds 0.085))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
    (:userdata 1024.0)
    )
  )

(defpart 1131
  :init-specs ((:texture (new 'static 'texture-id :page #xc1))
    (:num 6.0 3.0)
    (:y (meters 0.5) (meters 0.5))
    (:z (meters -1.5) 1 (meters 3))
    (:scale-x (meters 0.2) (meters 0.3))
    (:rot-x (degrees 0) (degrees 3600))
    (:rot-y (degrees 0) (degrees 3600))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 0.2) (meters 0.3))
    (:r 64.0 128.0)
    (:g :copy r)
    (:b :copy g)
    (:a 128.0)
    (:vel-y (meters 0.083333336) (meters 0.05))
    (:scalevel-x (meters -0.00022222222))
    (:rotvel-x (degrees -4.8) (degrees 9.6))
    (:rotvel-y (degrees -4.8) (degrees 9.6))
    (:rotvel-z (degrees -4.8) (degrees 9.6))
    (:scalevel-y (meters -0.00022222222))
    (:fade-a -0.21333334 -0.21333334)
    (:accel-y (meters -0.0033333334) (meters -0.0016666667))
    (:friction 0.92 0.07)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:func 'check-market-piece-ground)
    (:next-time (seconds 4))
    (:next-launcher 1122)
    (:conerot-x (degrees 0) (degrees 110))
    (:conerot-y (degrees 0) (degrees 180))
    (:rotate-y (degrees 0))
    )
  )

(defpart 1130
  :init-specs ((:texture (new 'static 'texture-id :page #xc1))
    (:num 4.0 2.0)
    (:y (meters 0.5) (meters 0.5))
    (:z (meters -1.5) 1 (meters 3))
    (:scale-x (meters 0.5) (meters 0.5))
    (:rot-x (degrees 0) (degrees 3600))
    (:rot-y (degrees 0) (degrees 3600))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 0.5) (meters 0.5))
    (:r 64.0 128.0)
    (:g :copy r)
    (:b :copy g)
    (:a 128.0)
    (:vel-y (meters 0.1) (meters 0.06666667))
    (:rotvel-x (degrees -4.8) (degrees 9.6))
    (:rotvel-y (degrees -4.8) (degrees 9.6))
    (:rotvel-z (degrees -4.8) (degrees 9.6))
    (:accel-y (meters -0.0033333334) (meters -0.0016666667))
    (:friction 0.92 0.07)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:func 'check-market-piece-ground)
    (:next-time (seconds 0.4))
    (:next-launcher 1122)
    (:conerot-x (degrees 0) (degrees 110))
    (:conerot-y (degrees 15) (degrees 150))
    (:rotate-y (degrees 0))
    )
  )

;; WARN: Return type mismatch number vs none.
(defun check-market-piece-ground ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo))
  (if (and (>= 35225.6 (-> arg2 launchrot y)) (>= 0.0 (-> arg1 vel-sxvel y)))
      (set! (-> arg2 launchrot y) 35225.6)
      (set! (-> arg1 next-time)
            (the-as uint (* (max 1 (the-as int (-> *display* clock (-> arg1 clock-index) sparticle-data x))) 2))
            )
      )
  (none)
  )

(defpart 1122
  :init-specs ((:rot-x (degrees 0))
    (:rot-y (degrees 0) (degrees 3600))
    (:rot-z (degrees 0))
    (:vel-y (meters 0))
    (:rotvel-x (degrees 0))
    (:rotvel-y (degrees 0))
    (:rotvel-z (degrees 0))
    (:accel-y (meters 0))
    (:friction 0.8 0.1)
    (:timer (seconds 4))
    (:next-time (seconds 0.5) (seconds 0.997))
    (:next-launcher 1139)
    )
  )

(defpart 1139
  :init-specs ((:fade-a -0.21333334 -0.21333334) (:flags (sp-cpuinfo-flag-2 left-multiply-quat)))
  )

(defpartgroup group-msack-a-explode
  :id 251
  :duration (seconds 3.335)
  :flags (sp0 sp6)
  :bounds (static-bspherem 0 0 0 12)
  :rotate ((degrees 0) (degrees 90) (degrees 0))
  :parts ((sp-item 1140 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.035))
    (sp-item 1141 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05))
    (sp-item 1142 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1))
    (sp-item 1143 :fade-after (meters 30) :falloff-to (meters 40) :flags (is-3d) :period (seconds 4) :length (seconds 0.335))
    (sp-item 1144 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135))
    (sp-item 1145 :fade-after (meters 60) :falloff-to (meters 90) :flags (sp7) :period (seconds 4) :length (seconds 0.05))
    (sp-item 1146 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017))
    )
  )

(defpart 1142
  :init-specs ((:texture (new 'static 'texture-id :index #x10 :page #xc1))
    (:num 32.0)
    (:y (meters 0) (meters 1))
    (:z (meters -1.5) (meters 3))
    (:scale-x (meters 0.1) (meters 0.05))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 0.3) (meters 0.6))
    (:r 128.0 128.0)
    (:g :copy r)
    (:b :copy g)
    (:a 96.0 32.0)
    (:vel-y (meters 0.033333335) (meters 0.06666667))
    (:rotvel-z (degrees -1.2) (degrees 2.4))
    (:scalevel-y (meters 0.00033333333))
    (:fade-a -0.16 -0.16)
    (:accel-y (meters -0.0016666667) (meters -0.00083333335))
    (:friction 0.95 0.03)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:conerot-x (degrees 0) (degrees 50.000004))
    (:conerot-y (degrees 0) (degrees 180))
    (:rotate-y (degrees 0))
    )
  )

(defpart 1143
  :init-specs ((:texture (new 'static 'texture-id :index #x11 :page #xc1))
    (:num 1.0 1.0)
    (:x (meters -3) (meters 6))
    (:y (meters 0.05))
    (:z (meters -3) (meters 6))
    (:scale-x (meters 1.5) (meters 1.5))
    (:rot-y (degrees 0) (degrees 3600))
    (:scale-y (meters 1.5) (meters 1.5))
    (:r 64.0 128.0)
    (:g :copy r)
    (:b :copy g)
    (:a 0.0)
    (:fade-a 1.6)
    (:timer (seconds 4))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat))
    (:next-time (seconds 0.2) (seconds 0.065))
    (:next-launcher 1137)
    )
  )

(defpart 1144
  :init-specs ((:texture (bigpuff level-default-sprite))
    (:num 8.0 3.0)
    (:y (meters 0) (meters 3))
    (:z (meters -1) (meters 2))
    (:scale-x (meters 2) (meters 2))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 2) (meters 2))
    (:r 150.0 60.0)
    (:g 96.0 64.0)
    (:b 0.0 32.0)
    (:a 16.0 8.0)
    (:vel-y (meters 0.06666667) (meters 0.033333335))
    (:scalevel-x (meters 0) (meters 0.0033333334))
    (:rotvel-z (degrees -0.2) (degrees 0.4))
    (:scalevel-y (meters 0) (meters 0.0033333334))
    (:fade-a -0.02 -0.02)
    (:accel-y (meters -0.00033333333) (meters -0.00083333335))
    (:friction 0.82 0.07)
    (:timer (seconds 4))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:conerot-x (degrees 30) (degrees 50.000004))
    (:conerot-y (degrees 0) (degrees 180))
    (:rotate-y (degrees 0))
    )
  )

(defpart 1145
  :init-specs ((:texture (bigpuff level-default-sprite))
    (:num 6.0 3.0)
    (:y (meters 0) (meters 3))
    (:z (meters -1) (meters 2))
    (:scale-x (meters 2) (meters 2))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 2) (meters 2))
    (:r 0.0 128.0)
    (:g :copy r)
    (:b :copy g)
    (:a 16.0 8.0)
    (:vel-y (meters 0.05) (meters 0.033333335))
    (:scalevel-x (meters 0) (meters 0.0033333334))
    (:rotvel-z (degrees -0.2) (degrees 0.4))
    (:scalevel-y (meters 0) (meters 0.0033333334))
    (:fade-a -0.02 -0.02)
    (:accel-y (meters -0.00033333333) (meters -0.00083333335))
    (:friction 0.82 0.07)
    (:timer (seconds 4))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:conerot-x (degrees 30) (degrees 50.000004))
    (:conerot-y (degrees 0) (degrees 180))
    (:rotate-y (degrees 0))
    )
  )

(defpart 1146
  :init-specs ((:texture (glow-soft level-default-sprite))
    (:num 1.0)
    (:y (meters 1))
    (:scale-x (meters 5))
    (:rot-x (degrees 0.675))
    (:scale-y (meters 4.5))
    (:r 255.0)
    (:g 255.0)
    (:b 32.0)
    (:a 64.0)
    (:omega (degrees 1136.25))
    (:scalevel-x (meters 0.2))
    (:scalevel-y :copy scalevel-x)
    (:fade-a -2.56)
    (:timer (seconds 0.085))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
    (:userdata 1024.0)
    )
  )

(defpart 1141
  :init-specs ((:texture (new 'static 'texture-id :index #x3 :page #xc1))
    (:num 8.0 3.0)
    (:y (meters 0) (meters 3))
    (:z (meters -1) (meters 2))
    (:scale-x (meters 0.2) (meters 0.3))
    (:rot-x (degrees 0) (degrees 3600))
    (:rot-y (degrees 0) (degrees 3600))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 0.2) (meters 0.3))
    (:r 64.0 128.0)
    (:g :copy r)
    (:b :copy g)
    (:a 128.0)
    (:vel-y (meters 0.083333336) (meters 0.05))
    (:scalevel-x (meters -0.00022222222))
    (:rotvel-x (degrees -4.8) (degrees 9.6))
    (:rotvel-y (degrees -4.8) (degrees 9.6))
    (:rotvel-z (degrees -4.8) (degrees 9.6))
    (:scalevel-y (meters -0.00022222222))
    (:fade-a -0.21333334 -0.21333334)
    (:accel-y (meters -0.0033333334) (meters -0.0016666667))
    (:friction 0.92 0.07)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:func 'check-market-piece-ground)
    (:next-time (seconds 4))
    (:next-launcher 1122)
    (:conerot-x (degrees 0) (degrees 110))
    (:conerot-y (degrees 0) (degrees 180))
    (:rotate-y (degrees 0))
    )
  )

(defpart 1140
  :init-specs ((:texture (new 'static 'texture-id :index #x3 :page #xc1))
    (:num 4.0 2.0)
    (:y (meters 0) (meters 3))
    (:z (meters -1) (meters 2))
    (:scale-x (meters 0.5) (meters 0.5))
    (:rot-x (degrees 0) (degrees 3600))
    (:rot-y (degrees 0) (degrees 3600))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 0.5) (meters 0.5))
    (:r 64.0 128.0)
    (:g :copy r)
    (:b :copy g)
    (:a 128.0)
    (:vel-y (meters 0.1) (meters 0.06666667))
    (:rotvel-x (degrees -4.8) (degrees 9.6))
    (:rotvel-y (degrees -4.8) (degrees 9.6))
    (:rotvel-z (degrees -4.8) (degrees 9.6))
    (:accel-y (meters -0.0033333334) (meters -0.0016666667))
    (:friction 0.92 0.07)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:func 'check-market-piece-ground)
    (:next-time (seconds 0.4))
    (:next-launcher 1122)
    (:conerot-x (degrees 0) (degrees 110))
    (:conerot-y (degrees 15) (degrees 150))
    (:rotate-y (degrees 0))
    )
  )

(defpartgroup group-msack-b-explode
  :id 252
  :duration (seconds 3.335)
  :flags (sp0 sp6)
  :bounds (static-bspherem 0 0 0 12)
  :rotate ((degrees 0) (degrees 90) (degrees 0))
  :parts ((sp-item 1147 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05))
    (sp-item 1148 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1))
    (sp-item 1149 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135))
    (sp-item 1150 :fade-after (meters 60) :falloff-to (meters 90) :flags (sp7) :period (seconds 4) :length (seconds 0.05))
    (sp-item 1151 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017))
    )
  )

(defpart 1148
  :init-specs ((:texture (new 'static 'texture-id :index #x1 :page #xc1))
    (:num 32.0)
    (:y (meters 0) (meters 1))
    (:z (meters -0.5) (meters 1))
    (:scale-x (meters 0.2) (meters 0.1))
    (:scale-y :copy scale-x)
    (:r 128.0 128.0)
    (:g :copy r)
    (:b :copy g)
    (:a 128.0)
    (:vel-y (meters 0.06666667) (meters 0.06666667))
    (:fade-a -0.16 -0.16)
    (:accel-y (meters -0.0033333334) (meters -0.00083333335))
    (:friction 0.95 0.03)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:func 'check-market-piece-ground)
    (:next-time (seconds 3.335))
    (:next-launcher 1152)
    (:conerot-x (degrees 0) (degrees 50.000004))
    (:conerot-y (degrees 0) (degrees 180))
    (:rotate-y (degrees 0))
    )
  )

(defpart 1152
  :init-specs ((:vel-y (meters 0))
    (:rotvel-z (degrees 0))
    (:accel-y (meters 0))
    (:friction 0.8 0.1)
    (:timer (seconds 5.667))
    (:next-time (seconds 1.5) (seconds 0.997))
    (:next-launcher 1139)
    )
  )

(defpart 1149
  :init-specs ((:texture (bigpuff level-default-sprite))
    (:num 6.0 2.0)
    (:y (meters 0) (meters 1))
    (:z (meters -0.5) (meters 1))
    (:scale-x (meters 1) (meters 1))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 1) (meters 1))
    (:r 150.0 60.0)
    (:g 0.0 64.0)
    (:b 0.0)
    (:a 16.0 8.0)
    (:vel-y (meters 0.033333335) (meters 0.033333335))
    (:scalevel-x (meters 0) (meters 0.0033333334))
    (:rotvel-z (degrees -0.2) (degrees 0.4))
    (:scalevel-y (meters 0) (meters 0.0033333334))
    (:fade-a -0.02 -0.02)
    (:accel-y (meters -0.00033333333) (meters -0.00083333335))
    (:friction 0.82 0.07)
    (:timer (seconds 4))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:conerot-x (degrees 30) (degrees 50.000004))
    (:conerot-y (degrees 0) (degrees 180))
    (:rotate-y (degrees 0))
    )
  )

(defpart 1150
  :init-specs ((:texture (bigpuff level-default-sprite))
    (:num 5.0 2.0)
    (:y (meters 0) (meters 1))
    (:z (meters -0.5) (meters 1))
    (:scale-x (meters 1) (meters 1))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 1) (meters 1))
    (:r 0.0 128.0)
    (:g :copy r)
    (:b :copy g)
    (:a 16.0 8.0)
    (:vel-y (meters 0.033333335) (meters 0.033333335))
    (:scalevel-x (meters 0) (meters 0.0033333334))
    (:rotvel-z (degrees -0.2) (degrees 0.4))
    (:scalevel-y (meters 0) (meters 0.0033333334))
    (:fade-a -0.02 -0.02)
    (:accel-y (meters -0.00033333333) (meters -0.00083333335))
    (:friction 0.82 0.07)
    (:timer (seconds 4))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:conerot-x (degrees 30) (degrees 50.000004))
    (:conerot-y (degrees 0) (degrees 180))
    (:rotate-y (degrees 0))
    )
  )

(defpart 1151
  :init-specs ((:texture (glow-soft level-default-sprite))
    (:num 1.0)
    (:y (meters 1))
    (:scale-x (meters 3))
    (:rot-x (degrees 0.675))
    (:scale-y :copy scale-x)
    (:r 255.0)
    (:g 64.0)
    (:b 64.0)
    (:a 64.0)
    (:omega (degrees 1136.25))
    (:scalevel-x (meters 0.2))
    (:scalevel-y :copy scalevel-x)
    (:fade-a -2.56)
    (:timer (seconds 0.085))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
    (:userdata 1024.0)
    )
  )

(defpart 1147
  :init-specs ((:texture (new 'static 'texture-id :index #x3 :page #xc1))
    (:num 6.0 2.0)
    (:y (meters 0) (meters 3))
    (:z (meters -1) (meters 2))
    (:scale-x (meters 0.1) (meters 0.2))
    (:rot-x (degrees 0) (degrees 3600))
    (:rot-y (degrees 0) (degrees 3600))
    (:rot-z (degrees 0) (degrees 3600))
    (:scale-y (meters 0.1) (meters 0.2))
    (:r 64.0 128.0)
    (:g :copy r)
    (:b :copy g)
    (:a 128.0)
    (:vel-y (meters 0.083333336) (meters 0.05))
    (:scalevel-x (meters -0.00022222222))
    (:rotvel-x (degrees -4.8) (degrees 9.6))
    (:rotvel-y (degrees -4.8) (degrees 9.6))
    (:rotvel-z (degrees -4.8) (degrees 9.6))
    (:scalevel-y (meters -0.00022222222))
    (:fade-a -0.21333334 -0.21333334)
    (:accel-y (meters -0.0033333334) (meters -0.0016666667))
    (:friction 0.92 0.07)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:func 'check-market-piece-ground)
    (:next-time (seconds 4))
    (:next-launcher 1122)
    (:conerot-x (degrees 0) (degrees 110))
    (:conerot-y (degrees 0) (degrees 180))
    (:rotate-y (degrees 0))
    )
  )

(defskelgroup skel-market-basket-a market-basket-a market-basket-a-lod0-jg market-basket-a-idle-ja
              ((market-basket-a-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 2 0 2.5)
              )

;; WARN: Return type mismatch market-basket-a vs none.
(defmethod init-skel! ((this market-basket-a))
  (initialize-skeleton
    this
    (the-as skeleton-group (art-group-get-by-name *level* "skel-market-basket-a" (the-as (pointer level) #f)))
    (the-as pair 0)
    )
  (set! (-> this part-explode) (-> *part-group-id-table* 249))
  (set! (-> this sound-explode) (static-sound-spec "break-vase" :group 0))
  (call-parent-method this)
  (none)
  )

(defskelgroup skel-market-basket-b market-basket-b market-basket-b-lod0-jg market-basket-b-idle-ja
              ((market-basket-b-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 0 0 2)
              )

;; WARN: Return type mismatch market-basket-b vs none.
(defmethod init-skel! ((this market-basket-b))
  (initialize-skeleton
    this
    (the-as skeleton-group (art-group-get-by-name *level* "skel-market-basket-b" (the-as (pointer level) #f)))
    (the-as pair 0)
    )
  (set! (-> this part-explode) (-> *part-group-id-table* 250))
  (set! (-> this sound-explode) (static-sound-spec "break-flour" :group 0))
  (call-parent-method this)
  (none)
  )

(defskelgroup skel-market-crate market-crate market-crate-lod0-jg market-crate-idle-ja
              ((market-crate-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 0 0 2)
              )

;; WARN: Return type mismatch market-crate vs none.
(defmethod init-skel! ((this market-crate))
  (initialize-skeleton
    this
    (the-as skeleton-group (art-group-get-by-name *level* "skel-market-crate" (the-as (pointer level) #f)))
    (the-as pair 0)
    )
  (set! (-> this part-explode) (-> *part-group-id-table* 248))
  (set! (-> this sound-explode) (static-sound-spec "break-crate" :group 0))
  (call-parent-method this)
  (none)
  )

(defskelgroup skel-market-sack-a market-sack-a market-sack-a-lod0-jg market-sack-a-idle-ja
              ((market-sack-a-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 1 0 2)
              )

;; WARN: Return type mismatch market-sack-a vs none.
(defmethod init-skel! ((this market-sack-a))
  (initialize-skeleton
    this
    (the-as skeleton-group (art-group-get-by-name *level* "skel-market-sack-a" (the-as (pointer level) #f)))
    (the-as pair 0)
    )
  (set! (-> this part-explode) (-> *part-group-id-table* 251))
  (set! (-> this sound-explode) (static-sound-spec "break-crate" :group 0))
  (call-parent-method this)
  (none)
  )

(defskelgroup skel-market-sack-b market-sack-b market-sack-b-lod0-jg market-sack-b-idle-ja
              ((market-sack-b-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 1 0 2)
              )

;; WARN: Return type mismatch market-sack-b vs none.
(defmethod init-skel! ((this market-sack-b))
  (initialize-skeleton
    this
    (the-as skeleton-group (art-group-get-by-name *level* "skel-market-sack-b" (the-as (pointer level) #f)))
    (the-as pair 0)
    )
  (set! (-> this part-explode) (-> *part-group-id-table* 252))
  (set! (-> this sound-explode) (static-sound-spec "break-veg-straw" :group 0))
  (call-parent-method this)
  (none)
  )

(defun market-activate ((arg0 level))
  (let* ((v1-0 (-> arg0 name))
         (gp-0 (cond
                 ((= v1-0 'ctymarka)
                  (new 'static 'boxed-array :type int32 5 0 0 #xc100200 #xc100c00)
                  )
                 ((= v1-0 'ctymarkb)
                  (new 'static 'boxed-array :type int32 5 0 0 #xcd00200 #xcd00c00)
                  )
                 ((= v1-0 'waswide)
                  (new 'static 'boxed-array :type int32 5 0 0 #x29a01400 #x29a01500)
                  )
                 (else
                   (format 0 "ERROR: market-activate called for unknown level ~A~%" (-> arg0 name))
                   )
                 )
               )
         )
    (set! (-> (get-field-spec-by-id (-> *part-id-table* 1124) (sp-field-id spt-userdata)) initial-valuef)
          (the-as float gp-0)
          )
    (set! (-> (get-field-spec-by-id (-> *part-id-table* 1123) (sp-field-id spt-userdata)) initial-valuef)
          (the-as float gp-0)
          )
    )
  (setup-special-textures (-> *part-id-table* 1118) "wood-plain-debris")
  (setup-special-textures (-> *part-id-table* 1117) "wood-plain-debris")
  (setup-special-textures (-> *part-id-table* 1124) "clay-pot-debris-01")
  (setup-special-textures (-> *part-id-table* 1123) "clay-pot-debris-01")
  (setup-special-textures (-> *part-id-table* 1131) "basket-debris-01")
  (setup-special-textures (-> *part-id-table* 1130) "basket-debris-01")
  (setup-special-textures (-> *part-id-table* 1141) "cotton-wrap-debris")
  (setup-special-textures (-> *part-id-table* 1140) "cotton-wrap-debris")
  (setup-special-textures (-> *part-id-table* 1147) "basket-debris-01")
  (setup-special-textures (-> *part-id-table* 1142) "straw-bit")
  (setup-special-textures (-> *part-id-table* 1143) "straw-ground")
  (setup-special-textures (-> *part-id-table* 1148) "cherry")
  0
  (none)
  )

(define *fruit-check-ground-counter* 0)

(defun fruit-check-ground-bounce ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 matrix))
  (let ((v1-1 (-> arg1 key proc))
        (f0-0 (-> arg1 user-float))
        )
    (set! (-> (the-as fruit-stand (+ (* (-> (the-as fruit-stand v1-1) num-sparts) 4) (the-as uint v1-1)))
              sparts-index
              0
              )
          (the-as uint arg3)
          )
    (when (and (>= (-> (the-as fruit-stand v1-1) count-sparts) (-> (the-as fruit-stand v1-1) first-sparts))
               (nonzero? (-> (the-as fruit-stand v1-1) hack-counter))
               )
      (set-vector!
        (-> (the-as fruit-stand v1-1) sparts-pos (-> (the-as fruit-stand v1-1) num-sparts))
        (-> arg2 launchrot x)
        (-> arg2 launchrot y)
        (-> arg2 launchrot z)
        1.0
        )
      (+! (-> (the-as fruit-stand v1-1) num-sparts) 1)
      (+! (-> (the-as fruit-stand v1-1) hack-counter) -1)
      )
    (+! (-> (the-as fruit-stand v1-1) count-sparts) 1)
    (when (and (< (-> arg2 launchrot y) f0-0) (< (-> arg1 vel-sxvel y) 0.0))
      (set! (-> arg2 launchrot y) f0-0)
      (if (and (< (-> arg1 vel-sxvel y) -122.88) (< (rand-vu-int-count 10) 3))
          (set-vector!
            (new 'stack-no-clear 'vector)
            (-> arg2 launchrot x)
            (-> arg2 launchrot y)
            (-> arg2 launchrot z)
            1.0
            )
          )
      (set! (-> arg1 vel-sxvel y) (* (-> arg1 vel-sxvel y) (- (rand-vu-float-range 0.6 0.8))))
      )
    )
  )

(defun fruit-sparticle-next-on-mode-1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo))
  (let ((s5-0 (-> arg1 key)))
    (cond
      ((zero? (-> s5-0 state-mode 0))
       (set! (-> arg1 next-time)
             (the-as uint (* (max 1 (the-as int (-> *display* clock (-> arg1 clock-index) sparticle-data x))) 2))
             )
       )
      (else
        (let ((s4-0 (new 'stack-no-clear 'vector)))
          0.0
          0.0
          0.0
          (let* ((f28-0 (/ 1.0 (/ (-> arg1 omega) METER_LENGTH)))
                 (f26-0 (* (rand-vu-float-range -136.53334 136.53334) f28-0))
                 (f30-0 (* (rand-vu-float-range 0.0 136.53334) f28-0))
                 (f0-8 (* (rand-vu-float-range -13.653334 54.613335) f28-0))
                 )
            (vector-float*! s4-0 (-> s5-0 origin rvec) f26-0)
            (vector+*! s4-0 s4-0 (-> s5-0 origin uvec) f30-0)
            (vector+*! s4-0 s4-0 (-> s5-0 origin fvec) f0-8)
            )
          (set! (-> arg1 vel-sxvel x) (-> s4-0 x))
          (set! (-> arg1 vel-sxvel y) (-> s4-0 y))
          (set! (-> arg1 vel-sxvel z) (-> s4-0 z))
          )
        (-> arg1 vel-sxvel)
        (set! (-> arg1 user-float) (+ (-> s5-0 origin trans y) (-> arg1 omega)))
        )
      )
    )
  0.0
  )

(defpartgroup group-ctywide-fruit
  :id 253
  :flags (sp0 sp6)
  :bounds (static-bspherem 0 0 0 6)
  :rotate ((degrees 30) (degrees 0) (degrees 0))
  :parts ((sp-item 1153 :flags (sp3 sp7))
    (sp-item 1154 :flags (sp3 sp7))
    (sp-item 1155 :flags (sp3 sp7))
    (sp-item 1156 :flags (sp3 sp7))
    (sp-item 1157 :flags (sp3 sp7))
    )
  )

(defpart 1153
  :init-specs ((:texture (fruit1 waswide-sprite))
    (:num 8.0 2.0)
    (:x (meters 2.2) 2 (meters 0.75))
    (:y (meters 1.1))
    (:z (meters -1.25) 2 (meters 0.75))
    (:scale-x (meters 0.6) (meters 0.15))
    (:scale-y :copy scale-x)
    (:r 128.0)
    (:g 128.0 40.0)
    (:b 128.0)
    (:a 128.0)
    (:omega (degrees 9))
    (:timer (seconds -0.005))
    (:flags (sp-cpuinfo-flag-2 aux-list sp-cpuinfo-flag-13 launch-along-z))
    (:userdata 1638.4)
    (:func 'fruit-sparticle-next-on-mode-1)
    (:next-launcher 1158)
    (:rotate-y (degrees 0))
    )
  )

(defpart 1158
  :init-specs ((:accel-y (meters -0.0033333334) (meters -0.0016666667))
    (:friction 0.96 0.02)
    (:func 'fruit-check-ground-bounce)
    (:next-time (seconds 2) (seconds 3.997))
    (:next-launcher 1159)
    )
  )

(defpart 1157
  :init-specs ((:texture (fruit1 waswide-sprite))
    (:num 40.0)
    (:x (meters -3.7) 7 (meters 0.25))
    (:y (meters 1.1))
    (:z (meters -1.1) 7 (meters 0.25))
    (:scale-x (meters 0.25) (meters 0.1))
    (:scale-y (meters 0.35) (meters 0.1))
    (:r 0.0 1 120.0)
    (:g 90.0 20.0)
    (:b 0.0 1 80.0)
    (:a 128.0)
    (:omega (degrees 4.5))
    (:timer (seconds -0.005))
    (:flags (sp-cpuinfo-flag-2 aux-list sp-cpuinfo-flag-13 launch-along-z))
    (:userdata 819.2)
    (:func 'fruit-sparticle-next-on-mode-1)
    (:next-launcher 1160)
    (:rotate-y (degrees 0))
    )
  )

(defpart 1156
  :init-specs ((:texture (fruit1 waswide-sprite))
    (:num 24.0)
    (:x (meters -3.6) 7 (meters 0.25))
    (:y (meters 1.25))
    (:z (meters -1.075) 6 (meters 0.25))
    (:scale-x (meters 0.25) (meters 0.1))
    (:scale-y (meters 0.35) (meters 0.1))
    (:r 0.0 1 120.0)
    (:g 90.0 20.0)
    (:b 0.0 1 80.0)
    (:a 128.0)
    (:omega (degrees 4.5))
    (:timer (seconds -0.005))
    (:flags (sp-cpuinfo-flag-2 aux-list sp-cpuinfo-flag-13 launch-along-z))
    (:userdata 819.2)
    (:func 'fruit-sparticle-next-on-mode-1)
    (:next-launcher 1160)
    (:rotate-y (degrees 0))
    )
  )

(defpart 1160
  :init-specs ((:rot-z (degrees 0) (degrees 360))
    (:rotvel-z (degrees -1.2) (degrees 2.4))
    (:accel-y (meters -0.0033333334) (meters -0.0016666667))
    (:friction 0.97 0.02)
    (:func 'fruit-check-ground-bounce)
    (:next-time (seconds 1.5) (seconds 2.997))
    (:next-launcher 1161)
    )
  )

(defpart 1161
  :init-specs ((:rotvel-z (degrees 0)) (:fade-a -0.42666668))
  )

(defpart 1155
  :init-specs ((:texture (fruit1 waswide-sprite))
    (:num 32.0)
    (:x (meters -0.8) 3 (meters 0.5))
    (:y (meters 1))
    (:z (meters -1) 3 (meters 0.5))
    (:scale-x (meters 0.4) (meters 0.15))
    (:scale-y :copy scale-x)
    (:r 128.0 64.0)
    (:g 100.0)
    (:b 100.0)
    (:a 128.0)
    (:omega (degrees 6.7500005))
    (:timer (seconds -0.005))
    (:flags (sp-cpuinfo-flag-2 aux-list sp-cpuinfo-flag-13 launch-along-z))
    (:userdata 1228.8)
    (:func 'fruit-sparticle-next-on-mode-1)
    (:next-launcher 1162)
    (:rotate-y (degrees 0))
    )
  )

(defpart 1154
  :init-specs ((:texture (fruit1 waswide-sprite))
    (:num 32.0)
    (:x (meters -0.55) 2 (meters 0.5))
    (:y (meters 1.25))
    (:z (meters -0.8) 2 (meters 0.5))
    (:scale-x (meters 0.4) (meters 0.15))
    (:scale-y :copy scale-x)
    (:r 140.0 64.0)
    (:g 128.0)
    (:b 128.0)
    (:a 128.0)
    (:omega (degrees 6.7500005))
    (:timer (seconds -0.005))
    (:flags (sp-cpuinfo-flag-2 aux-list sp-cpuinfo-flag-13 launch-along-z))
    (:userdata 1228.8)
    (:func 'fruit-sparticle-next-on-mode-1)
    (:next-launcher 1162)
    (:rotate-y (degrees 0))
    )
  )

(defpart 1162
  :init-specs ((:accel-y (meters -0.0033333334) (meters -0.0016666667))
    (:friction 0.97 0.02)
    (:func 'fruit-check-ground-bounce)
    (:next-time (seconds 2) (seconds 3.997))
    (:next-launcher 1159)
    )
  )

(defpart 1159
  :init-specs ((:fade-a -0.42666668))
  )

(defskelgroup skel-fruit-stand cty-fruit-stand cty-fruit-stand-lod0-jg cty-fruit-stand-idle-ja
              ((cty-fruit-stand-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 0 0 5)
              )

;; WARN: Return type mismatch none vs object.
(defbehavior fruit-stand-event-handler fruit-stand ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
  (case arg2
    (('attack)
     (let ((gp-0 (the-as attack-info (-> arg3 param 1))))
       (when (and (!= (-> gp-0 id) (-> self incoming-attack-id))
                  (nonzero? (-> self part))
                  (zero? (-> self part state-mode 0))
                  )
         (sound-play "break-veg-wood")
         (set! (-> self incoming-attack-id) (-> gp-0 id))
         (set! (-> self part state-mode 0) (the-as uint 1))
         (when (not (run-logic? self))
           (format 0 "Killing self!~%")
           (when (-> self parts-alive?)
             (set! (-> self parts-alive?) #f)
             (kill-particles (-> self part))
             )
           )
         )
       )
     )
    )
  )

(defmethod run-logic? ((this fruit-stand))
  "Should this process be run? Checked by execute-process-tree."
  (if (-> this parts-alive?)
      (call-parent-method this)
      #t
      )
  )

(defstate idle (fruit-stand)
  :virtual #t
  :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
    (fruit-stand-event-handler proc argc message block)
    )
  :code (behavior ()
    (until #f
      (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
      (until (ja-done? 0)
        (suspend)
        (ja :num! (seek!))
        )
      )
    #f
    )
  :post (behavior ()
    (when (-> self parts-alive?)
      (dotimes (gp-0 (the-as int (-> self num-sparts)))
        (let ((s5-0 (new 'stack-no-clear 'collide-query))
              (s4-0 (-> *sp-particle-system-2d* cpuinfo-table (-> self sparts-index gp-0)))
              )
          (when (and (nonzero? (-> s4-0 key)) (= (-> s4-0 key group) (lookup-part-group-by-name "group-ctywide-fruit")))
            (vector-copy! (-> s5-0 start-pos) (-> self sparts-pos gp-0))
            (+! (-> s5-0 start-pos y) 4096.0)
            (set-vector! (-> s5-0 move-dist) 0.0 -40960.0 0.0 1.0)
            (let ((v1-11 s5-0))
              (set! (-> v1-11 radius) (-> s4-0 omega))
              (set! (-> v1-11 collide-with) (collide-spec backgnd))
              (set! (-> v1-11 ignore-process0) #f)
              (set! (-> v1-11 ignore-process1) #f)
              (set! (-> v1-11 ignore-pat)
                    (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
                    )
              (set! (-> v1-11 action-mask) (collide-action solid))
              )
            (let ((f0-7 (fill-and-probe-using-line-sphere *collide-cache* s5-0)))
              (if (>= f0-7 0.0)
                  (set! (-> s4-0 user-float) (+ (-> s5-0 start-pos y) (* (-> s5-0 move-dist y) f0-7)))
                  )
              (when (< f0-7 0.0)
                )
              )
            )
          )
        )
      (+! (-> self first-sparts) (-> self num-sparts))
      (when (>= (-> self first-sparts) (-> self count-sparts))
        (set! (-> self first-sparts) (the-as uint 0))
        0
        )
      (set! (-> self num-sparts) (the-as uint 0))
      (set! (-> self hack-counter) (the-as uint 4))
      (set! (-> self count-sparts) (the-as uint 0))
      0
      )
    (let ((a0-16 (new 'stack 'sphere)))
      (set! (-> a0-16 quad) (-> self root trans quad))
      (set! (-> a0-16 r) (-> self root root-prim local-sphere w))
      (cond
        ((or (= (-> self part state-mode 0) 1)
             (and (sphere-in-view-frustum? a0-16)
                  (< (vector-vector-distance (-> self root trans) (math-camera-pos)) 491520.0)
                  )
             )
         (when (not (-> self parts-alive?))
           (initialize (-> self part) (-> *part-group-id-table* 253) self)
           (set! (-> self parts-alive?) #t)
           )
         (spawn-from-cspace (-> self part) (-> self node-list data 0))
         )
        (else
          (when (-> self parts-alive?)
            (set! (-> self parts-alive?) #f)
            (kill-particles (-> self part))
            )
          )
        )
      )
    (ja-post)
    )
  )

(defmethod fruit-stand-method-29 ((this fruit-stand))
  (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player))))
    (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
    (set! (-> s5-0 reaction) cshape-reaction-default)
    (set! (-> s5-0 no-reaction)
          (the-as (function collide-shape-moving collide-query vector vector object) nothing)
          )
    (let ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
      (set! (-> v1-6 prim-core collide-as) (collide-spec crate))
      (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot))
      (set! (-> v1-6 prim-core action) (collide-action solid rideable))
      (set! (-> v1-6 transform-index) 0)
      (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 20480.0)
      (set! (-> s5-0 total-prims) (the-as uint 1))
      (set! (-> s5-0 root-prim) v1-6)
      )
    (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
    (let ((v1-9 (-> s5-0 root-prim)))
      (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as))
      (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with))
      )
    (set! (-> this root) s5-0)
    )
  0
  (none)
  )

(defmethod fruit-stand-method-30 ((this fruit-stand))
  (logior! (-> this mask) (process-mask crate))
  (set! (-> this part) (create-launch-control (-> *part-group-id-table* 253) this))
  (set! (-> this parts-alive?) #t)
  0
  (none)
  )

(defmethod init-from-entity! ((this fruit-stand) (arg0 entity-actor))
  "Set up a newly created process from the entity that created it."
  (fruit-stand-method-29 this)
  (process-drawable-from-entity! this arg0)
  (initialize-skeleton
    this
    (the-as skeleton-group (art-group-get-by-name *level* "skel-fruit-stand" (the-as (pointer level) #f)))
    (the-as pair 0)
    )
  (fruit-stand-method-30 this)
  (go (method-of-object this idle))
  )
