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

;; name: ctyslumc-obs.gc
;; name in dgo: ctyslumc-obs
;; dgos: CTC

;; DECOMP BEGINS

(deftype cty-elevator (elevator)
  ()
  )


(defskelgroup skel-cty-elevator cty-elevator cty-elevator-lod0-jg cty-elevator-idle-ja
              ((cty-elevator-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 0 0 10)
              )

(defmethod get-art-group ((this cty-elevator))
  (art-group-get-by-name *level* "skel-cty-elevator" (the-as (pointer level) #f))
  )

;; WARN: Return type mismatch collide-shape-moving vs none.
(defmethod init-collision! ((this cty-elevator))
  (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 ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0)))
      (set! (-> s5-0 total-prims) (the-as uint 2))
      (set! (-> s4-0 prim-core collide-as) (collide-spec camera-blocker pusher))
      (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list))
      (set! (-> s4-0 prim-core action) (collide-action solid rideable))
      (set! (-> s4-0 transform-index) 3)
      (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 40960.0)
      (set! (-> s5-0 root-prim) s4-0)
      )
    (pusher-init s5-0)
    (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
      (set! (-> v1-15 prim-core collide-as) (collide-spec pusher))
      (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list))
      (set! (-> v1-15 prim-core action) (collide-action solid rideable))
      (set! (-> v1-15 transform-index) 3)
      (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 40960.0)
      )
    (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
    (let ((v1-18 (-> s5-0 root-prim)))
      (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as))
      (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with))
      )
    (set! (-> this root) s5-0)
    )
  (none)
  )

(defmethod init-sound! ((this cty-elevator))
  (set! (-> this sound-running-loop) (static-sound-spec "hqlift-loop" :group 0))
  (set! (-> this sound-arrived) (static-sound-spec "hqlift-stop" :group 0))
  (set! (-> this sound-start) (static-sound-spec "hqlift-start" :group 0))
  (call-parent-method this)
  (none)
  )

(define *ctyslumc-water-texture-anim-array*
  (new 'static 'texture-anim-array :type texture-anim
    (new 'static 'texture-anim
      :num-layers #x3
      :func #f
      :init-func-id 'texture-anim-overide-size-init
      :tex #f
      :tex-name "ctyslumc-water-dest"
      :extra (new 'static 'vector :x 128.0 :y 128.0 :z 4.0)
      :color (new 'static 'rgba :a #x80)
      :frame-delta 300.0
      :frame-mod 2100.0
      :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))
      :alpha (new 'static 'gs-alpha :b #x1 :d #x1)
      :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp))
      :data (new 'static 'array texture-anim-layer 6
        (new 'static 'texture-anim-layer
          :func-id 'default-texture-anim-layer-func
          :init-func #f
          :tex #f
          :end-time 2100.0
          :tex-name "ctyslumc-water"
          :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))
          :alpha (new 'static 'gs-alpha :b #x2 :d #x1)
          :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
          :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.33 0.33))
          :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          :start-st-rot (degrees 180)
          :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
          :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 1.33 1.33))
          :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          :end-st-rot (degrees 180)
          )
        (new 'static 'texture-anim-layer
          :func-id 'default-texture-anim-layer-func
          :init-func #f
          :tex #f
          :end-time 2100.0
          :tex-name "ctyslumc-water"
          :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))
          :alpha (new 'static 'gs-alpha :b #x2 :d #x1)
          :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
          :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.67 0.67))
          :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          :start-st-rot (degrees 90)
          :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
          :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 1.67 1.67))
          :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          :end-st-rot (degrees 90)
          )
        (new 'static 'texture-anim-layer
          :func-id 'default-texture-anim-layer-func
          :init-func #f
          :tex #f
          :end-time 2100.0
          :tex-name "ctyslumc-water"
          :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))
          :alpha (new 'static 'gs-alpha :b #x2 :d #x1)
          :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
          :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.0))
          :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
          :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 1.0))
          :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          )
        )
      )
    (new 'static 'texture-anim
      :num-layers #x3
      :func #f
      :init-func-id 'texture-anim-overide-size-init
      :tex #f
      :tex-name "ctyslumc-fountain-fall-dest"
      :extra (new 'static 'vector :x 128.0 :y 128.0 :z 1.0)
      :color (new 'static 'rgba :a #x80)
      :frame-delta 300.0
      :frame-mod 600.0
      :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))
      :alpha (new 'static 'gs-alpha :b #x1 :d #x1)
      :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp))
      :data (new 'static 'array texture-anim-layer 6
        (new 'static 'texture-anim-layer
          :func-id 'default-texture-anim-layer-func
          :init-func #f
          :tex #f
          :end-time 600.0
          :tex-name "ctyslumc-fountain-fall"
          :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))
          :alpha (new 'static 'gs-alpha :b #x2 :d #x1)
          :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
          :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 -0.3 0.0))
          :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
          :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 -1.3 -1.0))
          :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          )
        (new 'static 'texture-anim-layer
          :func-id 'default-texture-anim-layer-func
          :init-func #f
          :tex #f
          :end-time 600.0
          :tex-name "ctyslumc-fountain-fall"
          :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))
          :alpha (new 'static 'gs-alpha :b #x2 :d #x1)
          :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
          :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.3 -0.5))
          :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
          :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 1.3 -2.5))
          :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          )
        (new 'static 'texture-anim-layer
          :func-id 'default-texture-anim-layer-func
          :init-func #f
          :tex #f
          :end-time 600.0
          :tex-name "ctyslumc-fountain-fall"
          :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))
          :alpha (new 'static 'gs-alpha :b #x2 :d #x1)
          :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
          :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 -0.25))
          :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
          :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
          :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 -3.25))
          :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
          )
        )
      )
    )
  )

(deftype ctyslumc-flag (process-drawable)
  ()
  (:state-methods
    idle
    )
  )


(defskelgroup skel-ctyslumc-flag ctyslumc-flag ctyslumc-flag-lod0-jg ctyslumc-flag-idle-ja
              ((ctyslumc-flag-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 -7 0 12)
              )

(defstate idle (ctyslumc-flag)
  :virtual #t
  :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 ja-post
  )

(defmethod init-from-entity! ((this ctyslumc-flag) (arg0 entity-actor))
  "Set up a newly created process from the entity that created it."
  (set! (-> this root) (new 'process 'trsqv))
  (process-drawable-from-entity! this arg0)
  (initialize-skeleton
    this
    (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyslumc-flag" (the-as (pointer level) #f)))
    (the-as pair 0)
    )
  (go (method-of-object this idle))
  )

(defbehavior ctyslumc-flag-init-by-other ctyslumc-flag ((arg0 vector) (arg1 entity-actor))
  (process-entity-set! self arg1)
  (set! (-> self root) (new 'process 'trsqv))
  (vector-copy! (-> self root trans) arg0)
  (initialize-skeleton
    self
    (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyslumc-flag" (the-as (pointer level) #f)))
    (the-as pair 0)
    )
  (go-virtual idle)
  )
