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

(import "goal_src/jak1/import/bird-lady-beach-ag.gc")

;; definition of type bird-lady-beach
(deftype bird-lady-beach (process-taskable)
  ((flutflut handle  :offset-assert 384)
   (egg      handle  :offset-assert 392)
   )
  :heap-base #x120
  :method-count-assert 53
  :size-assert         #x190
  :flag-assert         #x3501200190
  )

;; definition for method 3 of type bird-lady-beach
(defmethod inspect bird-lady-beach ((obj bird-lady-beach))
  (let ((t9-0 (method-of-type process-taskable inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tflutflut: ~D~%" (-> obj flutflut))
  (format #t "~T~Tegg: ~D~%" (-> obj egg))
  obj
  )

;; failed to figure out what this is:
(defskelgroup *bird-lady-beach-sg* bird-lady-beach bird-lady-beach-lod0-jg bird-lady-beach-idle-ja
              ((bird-lady-beach-lod0-mg (meters 999999)))
              :bounds (static-spherem 0 0 0 4)
              :shadow bird-lady-beach-shadow-mg
              )

;; failed to figure out what this is:
(defstate idle (bird-lady-beach)
  :virtual #t
  :enter (behavior ()
    (when (not (should-display? self))
      (let ((a0-2 (handle->process (-> self flutflut))))
        (if a0-2
            (deactivate a0-2)
            )
        )
      (let ((a0-6 (handle->process (-> self egg))))
        (if a0-6
            (deactivate a0-6)
            )
        )
      (go-virtual hidden)
      )
    ((-> (method-of-type process-taskable idle) enter))
    (none)
    )
  )

;; definition for method 32 of type bird-lady-beach
(defmethod play-anim! bird-lady-beach ((obj bird-lady-beach) (arg0 symbol))
  (case (current-status (-> obj tasks))
    (((task-status need-reward-speech))
     (when arg0
       (set! (-> obj cell-for-task) (current-task (-> obj tasks)))
       (close-current! (-> obj tasks))
       (set! (-> obj flutflut)
             (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *flutflut-naked-sg* #f :to obj))
             )
       (send-event (handle->process (-> obj flutflut)) 'anim-mode 'clone-anim)
       (send-event (handle->process (-> obj flutflut)) 'blend-shape #t)
       (set! (-> obj egg)
             (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *flutflutegg-sg* #f :to obj))
             )
       (send-event (handle->process (-> obj egg)) 'anim-mode 'clone-anim)
       )
     (new 'static 'spool-anim
       :name "bird-lady-beach-resolution"
       :index 4
       :parts 10
       :command-list '((141 joint "cameraB") (535 joint "camera") (696 joint "cameraB") (758 joint "camera") (813 joint "cameraB"))
       )
     )
    (else
      (if arg0
          (format
            0
            "ERROR: <GMJ>: ~S playing anim for task status ~S~%"
            (-> obj name)
            (task-status->string (current-status (-> obj tasks)))
            )
          )
      (-> obj draw art-group data 3)
      )
    )
  )

;; definition for method 31 of type bird-lady-beach
(defmethod get-art-elem bird-lady-beach ((obj bird-lady-beach))
  (-> obj draw art-group data 3)
  )

;; definition for method 39 of type bird-lady-beach
(defmethod should-display? bird-lady-beach ((obj bird-lady-beach))
  (= (current-status (-> obj tasks)) (task-status need-reward-speech))
  )

;; definition for method 11 of type bird-lady-beach
(defmethod init-from-entity! bird-lady-beach ((obj bird-lady-beach) (arg0 entity-actor))
  (dummy-40 obj arg0 *bird-lady-beach-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5)
  (set! (-> obj tasks) (get-task-control (game-task beach-flutflut)))
  (set! (-> obj sound-flava) (music-flava birdlady))
  (dummy-42 obj)
  (none)
  )
