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

;; name: volcanox-scenes.gc
;; name in dgo: volcanox-scenes
;; dgos: VOCX

;; DECOMP BEGINS

(defskelgroup skel-h-gliderx tpl-glider tpl-glider-lod0-jg tpl-glider-idle-ja
              ((tpl-glider-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 0 0 15)
              :origin-joint-index 3
              )

(defskelgroup skel-h-gliderx-break tpl-glider-break tpl-glider-break-lod0-jg tpl-glider-break-idle-ja
              ((tpl-glider-break-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 0 0 15)
              )

(load-scene (new 'static 'scene
              :name "desert-glide-res"
              :extra #f
              :info #f
              :scene-flags (scene-flags scf1 scf2 scf3 scf4 scf8)
              :mask-to-clear (process-mask movie projectile)
              :entity "scene-stage-170"
              :art-group "scenecamera"
              :anim "desert-glide-res"
              :parts 4
              :command-list '((0 (kill "tpl-glider-broken-1"))
                (2 (want-load 'volcanox 'volcanoa))
                (67 (part-tracker
                      "group-volcano-glider-dust-ground"
                      entity
                      "h-gliderx-break"
                      joint
                      "f"
                      track
                      #t
                      duration
                      (frame-range 67 68)
                      )
                    )
                (67 (part-tracker
                      "group-volcano-glider-dust"
                      entity
                      "h-gliderx-break"
                      joint
                      "l"
                      track
                      #t
                      duration
                      (frame-range 67 90)
                      )
                    )
                (83 (part-tracker
                      "group-volcano-glider-dust"
                      entity
                      "h-gliderx-break"
                      joint
                      "a"
                      track
                      #t
                      duration
                      (frame-range 83 111)
                      )
                    )
                (90 (part-tracker
                      "group-volcano-glider-dust-ground"
                      entity
                      "h-gliderx-break"
                      joint
                      "l"
                      track
                      #t
                      duration
                      (frame-range 90 91)
                      )
                    )
                (111 (part-tracker
                       "group-volcano-glider-dust-ground"
                       entity
                       "h-gliderx-break"
                       joint
                       "a"
                       track
                       #t
                       duration
                       (frame-range 111 112)
                       )
                     )
                (199 (part-tracker
                       "group-land-jak-volcano"
                       entity
                       "jakc-highres"
                       joint
                       "Rball"
                       track
                       #t
                       duration
                       (frame-range 199 201)
                       )
                     )
                (10000 (task-close! "desert-glide-resolution") (task-close! "volcano-darkeco-introduction"))
                )
              :cut-list '(58 94 219 336)
              :wait-ground-time (seconds 1)
              :actor (new 'static 'boxed-array :type scene-actor
                (new 'static 'scene-actor
                  :name "scenecamera"
                  :level #f
                  :art-group "skel-scenecamera"
                  :prefix ""
                  :draw-frames '((min max))
                  :scissor-frames '()
                  :shadow-frames '((min max))
                  :cloth-reset-frames '()
                  :cloth-commands '()
                  :camera 4
                  :shadow-flags -1
                  :shadow-volume-joint #f
                  )
                (new 'static 'scene-actor
                  :name "jakc-highres"
                  :level 'volcanox
                  :art-group "skel-jakc-highres"
                  :prefix ""
                  :draw-frames '((min 583) (608 max))
                  :scissor-frames '()
                  :shadow-frames '((min max))
                  :cloth-reset-frames '()
                  :cloth-commands '()
                  :flags #x1
                  :shadow-flags -1
                  :shadow-volume-joint #f
                  :no-draw-seg #x3a0
                  )
                (new 'static 'scene-actor
                  :name "sidekick-highres"
                  :level 'volcanox
                  :art-group "skel-sidekick-highres"
                  :prefix ""
                  :draw-frames '((min max))
                  :scissor-frames '()
                  :shadow-frames '((min max))
                  :cloth-reset-frames '()
                  :cloth-commands '()
                  :flags #x1
                  :shadow-flags -1
                  :shadow-volume-joint #f
                  )
                (new 'static 'scene-actor
                  :name "h-gliderx"
                  :level 'volcanox
                  :art-group "skel-h-gliderx"
                  :prefix ""
                  :draw-frames '((0 58))
                  :scissor-frames '()
                  :shadow-frames '((min max))
                  :cloth-reset-frames '()
                  :cloth-commands '()
                  :flags #x1
                  :shadow-flags -1
                  :shadow-volume-joint #f
                  )
                (new 'static 'scene-actor
                  :name "h-gliderx-break"
                  :level 'volcanox
                  :art-group "skel-h-gliderx-break"
                  :prefix ""
                  :draw-frames '((min max))
                  :scissor-frames '()
                  :shadow-frames '((min max))
                  :cloth-reset-frames '()
                  :cloth-commands '()
                  :flags #x1
                  :shadow-flags -1
                  :shadow-volume-joint #f
                  )
                (new 'static 'scene-actor
                  :name "particleman"
                  :level 'volcanox
                  :art-group "skel-particleman"
                  :prefix ""
                  :draw-frames '((min max))
                  :scissor-frames '()
                  :shadow-frames '((min max))
                  :cloth-reset-frames '()
                  :cloth-commands '()
                  :shadow-flags -1
                  :shadow-volume-joint #f
                  )
                )
              :load-point "volcanox-start"
              :end-point "volcanox-vola-start"
              :borrow '()
              :sfx-volume -1.0
              :music-delay 1500.0
              :scene-task #x4d
              :on-running '(begin (sound-play-loop "volcano-mov-amb") (sound-play-loop "lava-mov-amb"))
              :on-complete #f
              )
            )

;; WARN: Return type mismatch float vs none.
(defun spt-birth-func-brightness-volcano-glider-dust ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo))
  (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 61) 80))
        (s3-0 (logand 0 (rand-uint31-gen *random-generator*)))
        (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 25))
        (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 50))
        )
    (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0))))
    (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0)))
    (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6)))
    )
  (none)
  )

(defpartgroup group-volcano-glider-dust
  :id 1408
  :flags (sp0)
  :bounds (static-bspherem 0 0 0 12)
  :parts ((sp-item 4641))
  )

(defpart 4641
  :init-specs ((:texture (dirtpuff01 level-default-sprite))
    (:birth-func 'spt-birth-func-brightness-volcano-glider-dust)
    (:num 1.0)
    (:scale-x (meters 2) (meters 5))
    (:rot-z (degrees 0) (degrees 360))
    (:scale-y :copy scale-x)
    (:r 128.0)
    (:g 128.0)
    (:b 128.0)
    (:a 16.0 16.0)
    (:vel-y (meters 0.0033333334) (meters 0.016666668))
    (:scalevel-x (meters 0.006666667))
    (:rotvel-z (degrees -0.1) (degrees 0.2))
    (:scalevel-y :copy scalevel-x)
    (:fade-a -0.053333335 -0.053333335)
    (:accel-y (meters 0) (meters 0.00033333333))
    (:friction 0.98)
    (:timer (seconds 2))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z))
    (:conerot-x (degrees 0) (degrees 360))
    (:rotate-y (degrees 0) (degrees 3600))
    )
  )

(defpartgroup group-volcano-glider-dust-ground
  :id 1409
  :flags (sp0)
  :bounds (static-bspherem 0 0 0 12)
  :parts ((sp-item 4642))
  )

(defpart 4642
  :init-specs ((:texture (dirtpuff01 level-default-sprite))
    (:birth-func 'spt-birth-func-brightness-volcano-glider-dust)
    (:num 10.0)
    (:y (meters -1))
    (:scale-x (meters 1) (meters 1))
    (:rot-z (degrees 0) (degrees 360))
    (:scale-y :copy scale-x)
    (:r 128.0)
    (:g 128.0)
    (:b 128.0)
    (:a 32.0 32.0)
    (:vel-y (meters 0.013333334) (meters 0.02))
    (:scalevel-x (meters 0.006666667))
    (:rotvel-z (degrees -0.1) (degrees 0.2))
    (:scalevel-y :copy scalevel-x)
    (:fade-a -0.042666666 -0.042666666)
    (:accel-y (meters 0) (meters 0.00033333333))
    (:friction 0.98)
    (:timer (seconds 5))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z))
    (:conerot-x (degrees 89) (degrees 2))
    (:rotate-y (degrees 0) (degrees 3600))
    )
  )

(defpartgroup group-land-jak-volcano
  :id 1410
  :flags (sp0)
  :bounds (static-bspherem 0 0 0 12)
  :parts ((sp-item 4643))
  )

(defpart 4643
  :init-specs ((:texture (dirtpuff01 level-default-sprite))
    (:birth-func 'spt-birth-func-brightness-volcano-glider-dust)
    (:num 8.0)
    (:scale-x (meters 1) (meters 1))
    (:rot-z (degrees 0) (degrees 360))
    (:scale-y :copy scale-x)
    (:r 128.0)
    (:g 128.0)
    (:b 128.0)
    (:a 32.0 32.0)
    (:vel-y (meters 0.02) (meters 0.01))
    (:scalevel-x (meters 0.0033333334))
    (:rotvel-z (degrees -0.2) (degrees 0.4))
    (:scalevel-y :copy scalevel-x)
    (:fade-a -0.042666666 -0.042666666)
    (:accel-y (meters -0.00033333333))
    (:friction 0.95)
    (:timer (seconds 5))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
    (:conerot-x (degrees 60) (degrees 30))
    (:conerot-y (degrees 0) (degrees 3600))
    )
  )

(defpartgroup group-volcanox-lantern-glow
  :id 1411
  :bounds (static-bspherem 0 0 0 8)
  :parts ((sp-item 4644 :fade-after (meters 120) :flags (sp6))
    (sp-item 4645 :fade-after (meters 120) :flags (sp6))
    (sp-item 4646 :fade-after (meters 120) :flags (sp6))
    )
  )

(defpart 4644
  :init-specs ((:texture (glow-hotdot level-default-sprite))
    (:num 1.0)
    (:scale-x (meters 2) (meters 0.1))
    (:rot-x (degrees 4.5))
    (:rot-z (degrees -17))
    (:scale-y :copy scale-x)
    (:r 128.0)
    (:g 128.0)
    (:b 80.0)
    (:a 70.0)
    (:omega (degrees 2715.75))
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
    (:userdata 1638.4)
    )
  )

(defpart 4645
  :init-specs ((:texture (glow-soft level-default-sprite))
    (:num 1.0)
    (:scale-x (meters 10) (meters 0.1))
    (:rot-x (degrees 9))
    (:rot-z (degrees -17))
    (:scale-y :copy scale-x)
    (:r 128.0)
    (:g 80.0)
    (:b 0.0)
    (:a 30.0 10.0)
    (:omega (degrees 2715.75))
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
    (:userdata 819.2)
    )
  )

(defpart 4646
  :init-specs ((:texture (ring level-default-sprite))
    (:num 1.0)
    (:scale-x (meters 3) (meters 0.1))
    (:rot-x (degrees 9))
    (:rot-z (degrees -17))
    (:scale-y :copy scale-x)
    (:r 255.0)
    (:g 128.0)
    (:b 0.0)
    (:a 2.0 1.0)
    (:omega (degrees 1815.7499))
    (:timer (seconds 0.017))
    (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
    (:userdata 819.2)
    )
  )

(defskelgroup skel-monk-mummy-x monk-mummy monk-mummy-lod0-jg monk-mummy-idle-ja
              ((monk-mummy-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 0 0 10)
              :shadow monk-mummy-shadow-mg
              :origin-joint-index 3
              :shadow-joint-index 3
              )

(deftype monk-mummy (process-taskable)
  ()
  )


(defmethod get-art-element ((this monk-mummy))
  (if (task-node-closed? (game-task-node volcano-darkeco-resolution))
      (setup-masks (-> this draw) 0 2)
      )
  (-> this draw art-group data 3)
  )

(defmethod init-skeleton! ((this monk-mummy))
  (initialize-skeleton
    this
    (the-as skeleton-group (art-group-get-by-name *level* "skel-monk-mummy-x" (the-as (pointer level) #f)))
    (the-as pair 0)
    )
  0
  (none)
  )
