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

;; definition of type maincave-part
(deftype maincave-part (part-spawner)
  ()
  :heap-base #x60
  :method-count-assert 21
  :size-assert         #xd0
  :flag-assert         #x15006000d0
  )

;; definition for method 3 of type maincave-part
(defmethod inspect maincave-part ((obj maincave-part))
  (let ((t9-0 (method-of-type part-spawner inspect)))
    (t9-0 obj)
    )
  obj
  )

;; definition of type darkcave-part
(deftype darkcave-part (part-spawner)
  ()
  :heap-base #x60
  :method-count-assert 21
  :size-assert         #xd0
  :flag-assert         #x15006000d0
  )

;; definition for method 3 of type darkcave-part
(defmethod inspect darkcave-part ((obj darkcave-part))
  (let ((t9-0 (method-of-type part-spawner inspect)))
    (t9-0 obj)
    )
  obj
  )

;; failed to figure out what this is:
(defpartgroup group-part-maincave-torch
  :id 318
  :bounds (static-bspherem 0 3 0 4)
  :parts ((sp-item 706 :fade-after (meters 200) :falloff-to (meters 220))
    (sp-item 707 :fade-after (meters 140) :falloff-to (meters 140))
    (sp-item 708 :fade-after (meters 50) :falloff-to (meters 50) :period 600 :length 90)
    (sp-item 709 :fade-after (meters 50) :falloff-to (meters 50) :period 369 :length 69)
    (sp-item 710 :fade-after (meters 50) :falloff-to (meters 50) :period 710 :length 51)
    (sp-item 711 :fade-after (meters 60) :falloff-to (meters 60))
    )
  )

;; failed to figure out what this is:
(defpart 711
  :init-specs ((sp-flt spt-num 0.3)
    (sp-flt spt-x (meters 0.2))
    (sp-rnd-flt spt-y (meters 1) (meters 1) 1.0)
    (sp-int spt-rot-x 5)
    (sp-flt spt-r 4096.0)
    (sp-flt spt-g 2867.2)
    (sp-flt spt-b 3276.8)
    (sp-rnd-flt spt-vel-x (meters 0) (meters 0.006666667) 1.0)
    (sp-flt spt-vel-y (meters 0.026666667))
    (sp-int spt-timer 180)
    (sp-cpuinfo-flags aux-list)
    (sp-int spt-next-time 120)
    (sp-launcher-by-id spt-next-launcher 712)
    (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0)
    )
  )

;; failed to figure out what this is:
(defpart 712
  :init-specs ((sp-flt spt-fade-b -6.826667))
  )

;; failed to figure out what this is:
(defpart 706
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
    (sp-rnd-int spt-num 1069547520 1 1.0)
    (sp-rnd-flt spt-x (meters -0.35) (meters 0.7) 1.0)
    (sp-rnd-flt spt-z (meters -0.35) (meters 0.7) 1.0)
    (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.3) 1.0)
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 128.0 128.0 1.0)
    (sp-rnd-flt spt-g 0.0 60.0 1.0)
    (sp-flt spt-a 0.0)
    (sp-rnd-flt spt-vel-y (meters 0.016666668) (meters 0.013333334) 1.0)
    (sp-rnd-flt spt-rotvel-z (degrees -0.1) (degrees 0.2) 1.0)
    (sp-flt spt-fade-a 13.066667)
    (sp-flt spt-accel-y -0.8192)
    (sp-int spt-timer 75)
    (sp-cpuinfo-flags bit2 bit3)
    (sp-int spt-next-time 15)
    (sp-launcher-by-id spt-next-launcher 713)
    )
  )

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

;; failed to figure out what this is:
(defpart 708
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
    (sp-flt spt-num 1.5)
    (sp-rnd-flt spt-x (meters -0.4) (meters 0.8) 1.0)
    (sp-flt spt-y (meters 1))
    (sp-rnd-flt spt-z (meters -0.4) (meters 0.8) 1.0)
    (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.3) 1.0)
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 128.0 128.0 1.0)
    (sp-rnd-flt spt-g 0.0 60.0 1.0)
    (sp-flt spt-a 0.0)
    (sp-rnd-flt spt-vel-y (meters 0.02) (meters 0.006666667) 1.0)
    (sp-rnd-flt spt-rotvel-z (degrees -0.1) (degrees 0.2) 1.0)
    (sp-flt spt-fade-a 13.066667)
    (sp-flt spt-accel-y -0.8192)
    (sp-int spt-timer 105)
    (sp-cpuinfo-flags bit2 bit3)
    (sp-int spt-next-time 15)
    (sp-launcher-by-id spt-next-launcher 713)
    )
  )

;; failed to figure out what this is:
(defpart 709
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
    (sp-flt spt-num 1.5)
    (sp-rnd-flt spt-x (meters -0.2) (meters 0.6) 1.0)
    (sp-flt spt-y (meters 0.5))
    (sp-rnd-flt spt-z (meters 0) (meters 0.4) 1.0)
    (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.3) 1.0)
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 128.0 128.0 1.0)
    (sp-rnd-flt spt-g 0.0 60.0 1.0)
    (sp-flt spt-a 0.0)
    (sp-rnd-flt spt-vel-y (meters 0.018333333) (meters 0.0033333334) 1.0)
    (sp-rnd-flt spt-rotvel-z (degrees -0.1) (degrees 0.2) 1.0)
    (sp-flt spt-fade-a 13.066667)
    (sp-flt spt-accel-y -0.8192)
    (sp-int spt-timer 105)
    (sp-cpuinfo-flags bit2 bit3)
    (sp-int spt-next-time 15)
    (sp-launcher-by-id spt-next-launcher 713)
    )
  )

;; failed to figure out what this is:
(defpart 710
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
    (sp-flt spt-num 2.0)
    (sp-rnd-flt spt-x (meters 0) (meters 0.2) 1.0)
    (sp-flt spt-y (meters 0.6))
    (sp-rnd-flt spt-z (meters -0.6) (meters 0.6) 1.0)
    (sp-rnd-flt spt-scale-x (meters 0.7) (meters 0.4) 1.0)
    (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 128.0 128.0 1.0)
    (sp-rnd-flt spt-g 0.0 60.0 1.0)
    (sp-flt spt-a 0.0)
    (sp-rnd-flt spt-vel-y (meters 0.018333333) (meters 0.005) 1.0)
    (sp-rnd-flt spt-rotvel-z (degrees -0.1) (degrees 0.2) 1.0)
    (sp-flt spt-fade-a 13.066667)
    (sp-flt spt-accel-y -0.8192)
    (sp-int spt-timer 105)
    (sp-cpuinfo-flags bit2 bit3)
    (sp-int spt-next-time 15)
    (sp-launcher-by-id spt-next-launcher 713)
    )
  )

;; failed to figure out what this is:
(defpart 707
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
    (sp-flt spt-num 0.4)
    (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0)
    (sp-flt spt-y (meters 0.3))
    (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0)
    (sp-rnd-flt spt-scale-x (meters 1) (meters 0.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-flt spt-r 128.0)
    (sp-flt spt-g 96.0)
    (sp-flt spt-b 96.0)
    (sp-rnd-flt spt-a 16.0 32.0 1.0)
    (sp-flt spt-vel-y (meters 0.01))
    (sp-flt spt-scalevel-x (meters 0.0005))
    (sp-rnd-int-flt spt-rotvel-z (degrees -0.26666668) 1 97.09037)
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-flt spt-fade-r -0.10666667)
    (sp-flt spt-fade-g -0.053333335)
    (sp-flt spt-fade-b -0.053333335)
    (sp-flt spt-fade-a -0.08)
    (sp-flt spt-accel-x 0.27306667)
    (sp-flt spt-accel-y 0.13653333)
    (sp-flt spt-friction 0.9975)
    (sp-int spt-timer 600)
    (sp-cpuinfo-flags bit2)
    (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 5.0) 1.0)
    (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
    )
  )

;; failed to figure out what this is:
(defpartgroup group-cave-cavedrip-1
  :id 319
  :bounds (static-bspherem 0 8 0 8.25)
  :parts ((sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 369 :length 5)
    (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 768 :length 5)
    (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 1167 :length 5)
    (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 1701 :length 5)
    (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 2736 :length 5)
    (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 3831 :length 5)
    )
  )

;; failed to figure out what this is:
(defpartgroup group-cave-cavedrip-2
  :id 320
  :bounds (static-bspherem 0 8 0 8.25)
  :parts ((sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 467 :length 5)
    (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 834 :length 5)
    (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 984 :length 5)
    (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 2237 :length 5)
    (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 2597 :length 5)
    (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 3587 :length 5)
    )
  )

;; failed to figure out what this is:
(defpartgroup group-cave-cavedrip-3
  :id 321
  :bounds (static-bspherem 0 8 0 8.25)
  :parts ((sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 801 :length 5)
    (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 867 :length 5)
    (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 1269 :length 5)
    (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 1983 :length 5)
    (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 2601 :length 5)
    (sp-item 2230 :fade-after (meters 60) :falloff-to (meters 60) :period 5061 :length 5)
    )
  )

;; failed to figure out what this is:
(defpart 2231
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2))
    (sp-rnd-flt spt-num 3.0 4.0 1.0)
    (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.075) 1.0)
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 96.0 32.0 1.0)
    (sp-rnd-flt spt-g 112.0 64.0 1.0)
    (sp-rnd-flt spt-b 128.0 128.0 1.0)
    (sp-rnd-flt spt-a 64.0 64.0 1.0)
    (sp-rnd-flt spt-vel-y (meters 0.006666667) (meters 0.013333334) 1.0)
    (sp-flt spt-fade-a -0.5688889)
    (sp-flt spt-accel-y -2.7306666)
    (sp-int spt-timer 225)
    (sp-cpuinfo-flags bit2 bit3 bit12 bit14)
    (sp-rnd-flt spt-conerot-x (degrees 20.0) (degrees 60.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 2232
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1e :page #x2))
    (sp-flt spt-num 1.0)
    (sp-flt spt-y (meters 0.02))
    (sp-flt spt-scale-x (meters 0.5))
    (sp-copy-from-other spt-scale-y -4)
    (sp-rnd-flt spt-r 96.0 64.0 1.0)
    (sp-rnd-flt spt-g 64.0 16.0 1.0)
    (sp-rnd-flt spt-b 192.0 32.0 1.0)
    (sp-rnd-flt spt-a 64.0 64.0 1.0)
    (sp-rnd-flt spt-scalevel-x (meters 0.016666668) (meters 0.01) 1.0)
    (sp-copy-from-other spt-scalevel-y -4)
    (sp-flt spt-fade-a -1.2222222)
    (sp-int spt-timer 90)
    (sp-cpuinfo-flags bit2 bit3 bit12 bit14)
    (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0)
    )
  )

;; failed to figure out what this is:
(defpart 2230
  :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9 :page #x2))
    (sp-func spt-birth-func 'birth-func-y->userdata)
    (sp-flt spt-num 1.0)
    (sp-flt spt-y (meters 24))
    (sp-flt spt-scale-x (meters 0.1))
    (sp-flt spt-scale-y (meters 0.4))
    (sp-rnd-flt spt-r 96.0 64.0 1.0)
    (sp-rnd-flt spt-g 64.0 16.0 1.0)
    (sp-rnd-flt spt-b 192.0 32.0 1.0)
    (sp-flt spt-a 128.0)
    (sp-flt spt-vel-y (meters -0.045714285))
    (sp-flt spt-fade-a 0.5688889)
    (sp-int spt-timer 900)
    (sp-cpuinfo-flags bit2 bit3 bit12 bit14)
    (sp-flt spt-userdata -98304.0)
    (sp-func spt-func 'check-drop-level-maincave-drip)
    (sp-int-plain-rnd spt-next-time 150 74 1)
    (sp-launcher-by-id spt-next-launcher 2233)
    )
  )

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

;; definition for function check-drop-level-maincave-drip
(defun check-drop-level-maincave-drip ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector))
  (when (< (-> arg2 y) (-> arg1 user-float))
    (let ((gp-0 (new 'stack-no-clear 'vector)))
      (sp-kill-particle arg0 arg1)
      (if (< (rand-float-gen) 0.25)
          (sound-play "water-drop")
          )
      (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0)
      (sp-launch-particles-var
        *sp-particle-system-2d*
        (-> *part-id-table* 2231)
        gp-0
        (the-as sparticle-launch-state #f)
        (the-as sparticle-launch-control #f)
        1.0
        )
      (sp-launch-particles-var
        *sp-particle-system-3d*
        (-> *part-id-table* 2232)
        gp-0
        (the-as sparticle-launch-state #f)
        (the-as sparticle-launch-control #f)
        1.0
        )
      )
    )
  (none)
  )
