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

;; name: wcar-snake.gc
;; name in dgo: wcar-snake
;; dgos: LPATK, LFACCAR, WASALL

;; DECOMP BEGINS

(deftype v-snake (wcar-snake-base)
  ()
  )


(defmethod vehicle-method-62 ((this v-snake))
  (let ((s5-0 (-> this root root-prim)))
    (mem-copy!
      (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere))
      (the-as pointer (new 'static 'vector :x 8192.0 :y 1638.4 :z 7864.32 :w 3276.8))
      16
      )
    (mem-copy!
      (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere))
      (the-as pointer (new 'static 'vector :x -8192.0 :y 1638.4 :z 7864.32 :w 3276.8))
      16
      )
    (mem-copy!
      (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere))
      (the-as pointer (new 'static 'vector :x 9011.2 :y 2048.0 :z -11878.4 :w 4915.2))
      16
      )
    (mem-copy!
      (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere))
      (the-as pointer (new 'static 'vector :x -9011.2 :y 2048.0 :z -11878.4 :w 4915.2))
      16
      )
    (mem-copy!
      (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere))
      (the-as pointer (new 'static 'vector :y 3276.8 :z 9011.2 :w 4505.6))
      16
      )
    (mem-copy!
      (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere))
      (the-as pointer (new 'static 'vector :y 3686.4 :z -1638.4 :w 6144.0))
      16
      )
    (mem-copy!
      (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere))
      (the-as pointer (new 'static 'vector :y 3276.8 :z -11878.4 :w 5734.4))
      16
      )
    (set! (-> (the-as collide-shape-prim-group s5-0) child 7 local-sphere w) 20889.6)
    )
  ((method-of-type wcar-base vehicle-method-62) this)
  0
  (none)
  )

(defmethod init-rbody-control! ((this v-snake))
  (initialize-skeleton
    this
    (the-as skeleton-group (art-group-get-by-name *level* "skel-v-snake" (the-as (pointer level) #f)))
    (the-as pair 0)
    )
  (setup-masks (-> this draw) 0 -1)
  (setup-masks (-> this draw) 1 0)
  (setup-masks (-> this draw) 4 0)
  (alloc-rbody-control! this *v-snake-constants*)
  (set! (-> this shoot-delay) (the-as uint 18))
  (set! (-> this local-gun-pos 0 quad) (-> (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0) quad))
  (vector-copy! (-> this local-gun-pos 1) (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0))
  (set! (-> this rider-hand-joint-array 0) 17)
  ((method-of-type joint-mod-rotate-local init)
   (-> this jmod-axles 0)
   this
   (the-as uint 5)
   (joint-mod-base-flags attached)
   )
  (init (-> this jmod-axles 1) this (the-as uint 6) (joint-mod-base-flags attached))
  (init (-> this jmod-axles 2) this (the-as uint 4) (joint-mod-base-flags attached))
  (init (-> this jmod-axles 3) this (the-as uint 7) (joint-mod-base-flags attached))
  ((method-of-type joint-mod-rotate-local init)
   (-> this jmod-shock-tops 0)
   this
   (the-as uint 11)
   (joint-mod-base-flags attached)
   )
  (init (-> this jmod-shock-tops 1) this (the-as uint 15) (joint-mod-base-flags attached))
  (init (-> this jmod-shock-tops 2) this (the-as uint 9) (joint-mod-base-flags attached))
  (init (-> this jmod-shock-tops 3) this (the-as uint 13) (joint-mod-base-flags attached))
  ((method-of-type joint-mod-set-local init)
   (-> this jmod-shock-mids 0)
   this
   (the-as uint 12)
   (joint-mod-base-flags attached trans)
   )
  (init (-> this jmod-shock-mids 1) this (the-as uint 16) (joint-mod-base-flags attached trans))
  (init (-> this jmod-shock-mids 2) this (the-as uint 10) (joint-mod-base-flags attached trans))
  (init (-> this jmod-shock-mids 3) this (the-as uint 14) (joint-mod-base-flags attached trans))
  ((method-of-type joint-mod-add-local init)
   (the-as joint-mod-add-local (-> this jmod-guns))
   this
   (the-as uint 18)
   (joint-mod-base-flags attached trans)
   )
  ((method-of-type joint-mod-add-local init)
   (the-as joint-mod-add-local (-> this jmod-guns 1))
   this
   (the-as uint 19)
   (joint-mod-base-flags attached trans)
   )
  (spawn-wheels!
    this
    (the-as skeleton-group (art-group-get-by-name *level* "skel-v-snake-wheel" (the-as (pointer level) #f)))
    (the-as skeleton-group (art-group-get-by-name *level* "skel-v-snake-wheel-blur" (the-as (pointer level) #f)))
    (the-as skeleton-group #f)
    (the-as skeleton-group #f)
    )
  0
  (none)
  )
