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

;; name: generic-obs-h.gc
;; name in dgo: generic-obs-h
;; dgos: ENGINE, GAME

(defenum manipy-options
  :bitfield #t
  :type uint32
  (mo-0 0)
  )
(declare-type part-tracker process)
(declare-type manipy process-drawable)
(declare-type sparticle-launch-group basic)
(define-extern part-tracker-init (function sparticle-launch-group time-frame (function part-tracker none) (pointer process-drawable) process matrix none :behavior part-tracker))
(define-extern manipy-init (function vector entity-actor skeleton-group vector object none :behavior manipy))
(define-extern lightning-tracker-init (function lightning-spec time-frame symbol process-drawable vector vector none :behavior lightning-tracker))
(define-extern birth-pickup-at-point (function vector pickup-type float symbol process-tree fact-info (pointer process) :behavior process))
(define-extern process-grab? (function process symbol symbol :behavior process))
(define-extern process-release? (function process symbol :behavior process))

;; DECOMP BEGINS

(deftype manipy (process-drawable)
  ((root                  collide-shape :override)
   (new-trans-hook        (function none))
   (cur-trans-hook        (function none))
   (cur-event-hook        (function none))
   (new-joint-anim        art-joint-anim)
   (new-joint-anim-blend  uint64)
   (anim-mode             symbol)
   (cur-grab-handle       handle)
   (cur-target-handle     handle)
   (old-grab-pos          vector         :inline)
   (joint                 joint-mod      4)
   (new-post-hook         (function none))
   (cur-post-hook         (function none))
   (clone-copy-trans      symbol)
   (shadow-backup         basic)
   (draw?                 symbol)
   (userdata              uint64)
   (prefix                basic)
   (shadow-volume-joint   int32)
   (speed                 float)
   (user-uint64           uint64         4)
   (options               manipy-options)
   )
  (:state-methods
    idle
    )
  )


(deftype part-spawner (process)
  ((root          trsqv)
   (part          sparticle-launch-control)
   (sound         ambient-sound)
   (mode          (pointer sparticle-launch-group))
   (enable        symbol)
   (radius        meters)
   (world-sphere  sphere  :inline)
   )
  (:state-methods
    active
    )
  (:methods
    (is-in-view? (_type_) symbol)
    )
  )


(deftype part-tracker (process)
  ((root             trsqv)
   (mat              matrix      :inline)
   (part             sparticle-launch-control)
   (callback         (function part-tracker vector))
   (linger-callback  (function part-tracker vector))
   (duration         uint64)
   (linger-duration  uint64)
   (start-time       time-frame)
   (target           handle)
   (target-joint     int32)
   (offset           vector      :inline)
   (userdata         uint64)
   (user-time        time-frame  2)
   (user-vector      vector      :inline)
   (user-handle      uint32      2 :offset 352)
   )
  (:state-methods
    active
    )
  (:methods
    (notify-parent-of-death (_type_) none)
    )
  )


(deftype lightning-tracker (process)
  ((ppointer       (pointer lightning-tracker) :override)
   (root           trsqv)
   (lightning      lightning-control)
   (callback       (function lightning-tracker none))
   (duration       uint64)
   (start-time     time-frame)
   (offset0        vector                       :inline)
   (offset1        vector                       :inline)
   (target0        handle)
   (target1        handle)
   (target-joint0  int32)
   (target-joint1  int32)
   (sound          sound-id)
   (userdata       uint64)
   (user-time      time-frame                   2)
   (user-vector    vector                       :inline)
   (user-handle    handle                       2 :offset 288)
   )
  (:state-methods
    active
    )
  (:methods
    (notify-parent-of-death (_type_) none)
    (update (_type_) none)
    )
  )


(deftype touch-tracker (process-drawable)
  ((root          collide-shape :override)
   (duration      time-frame)
   (target        handle)
   (event         symbol)
   (run-function  (function object))
   (callback      (function touch-tracker none))
   (event-mode    basic)
   )
  (:state-methods
    active
    )
  )


(deftype swingpole (process-drawable)
  ((root         collide-shape :override)
   (edge-length  meters)
   (path-pos     float)
   (joint-track  int32)
   (speed        meters)
   (dir          vector         :inline)
   (sync         sync-eased     :inline)
   )
  (:state-methods
    idle
    (active handle)
    )
  (:methods
    (move-along-path (_type_) none)
    )
  )


(deftype gui-query (structure)
  ((x-position         int32)
   (y-position         int32)
   (message            string)
   (decision           symbol)
   (only-allow-cancel  symbol)
   (no-msg             string)
   (message-space      int32)
   )
  (:methods
    (gui-query-method-9 () none)
    (gui-query-method-10 () none)
    )
  )


(deftype othercam (process)
  ((hand               handle)
   (old-global-mask    process-mask)
   (mask-to-clear      process-mask)
   (cam-joint-index    int32)
   (old-pos            vector  :inline)
   (old-mat-z          vector  :inline)
   (had-valid-frame    basic)
   (border-value       basic)
   (die?               symbol)
   (survive-anim-end?  symbol)
   (spooling?          symbol)
   (fov                float)
   )
  (:states
    othercam-running
    )
  )


(deftype explosion (process-drawable)
  ((root             collide-shape :override)
   (start-time       time-frame)
   (duration         uint32)
   (linger-duration  uint32)
   (attack-id        uint32)
   )
  (:state-methods
    explode
    )
  (:methods
    (setup-explosion-collision (_type_) none)
    (explosion-method-22 (_type_) none)
    )
  )


(deftype explosion-init-params (structure)
  ((spawn-point      vector      :inline)
   (spawn-quat       quaternion  :inline)
   (radius           float)
   (group            sparticle-launch-group)
   (collide-with     collide-spec)
   (penetrate-using  penetrate)
   )
  )


(deftype process-hidden (process)
  ()
  (:state-methods
    die
    )
  )
