mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-21 07:37:45 -04:00
36f1592b90
Also adds: - BLERC - Minimap (with missing texture for the map, sprites work) - Eco Mine files - Precursor robot boss files - Sewer files - Vehicle files
226 lines
9.2 KiB
Common Lisp
226 lines
9.2 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: wcar-mirage.gc
|
|
;; name in dgo: wcar-mirage
|
|
;; dgos: LPATK, LFACCAR, WASALL
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
(deftype v-mirage (wcar-snake-base)
|
|
()
|
|
)
|
|
|
|
|
|
;; WARN: Return type mismatch (pointer process) vs none.
|
|
(defmethod wvehicle-method-169 ((this v-mirage))
|
|
(sound-play "toad-shot-fire")
|
|
(set! (-> this i-barrel) (logand (+ (-> this i-barrel) 1) 1))
|
|
(let ((gp-1 (new 'stack-no-clear 'wcar-toad-stack-var0)))
|
|
(set! (-> gp-1 barrel-idx) (-> this i-barrel))
|
|
(set! (-> gp-1 vec10 x) 61440.0)
|
|
(set! (-> gp-1 vec10 y) 204800.0)
|
|
(set! (-> gp-1 vec10 z) 409600.0)
|
|
(set! (-> gp-1 vec10 w) 163840.0)
|
|
(let* ((v1-9 (-> gp-1 mat0))
|
|
(a3-1 (-> this rbody matrix))
|
|
(a0-4 (-> a3-1 rvec quad))
|
|
(a1-1 (-> a3-1 uvec quad))
|
|
(a2-1 (-> a3-1 fvec quad))
|
|
(a3-2 (-> a3-1 trans quad))
|
|
)
|
|
(set! (-> v1-9 rvec quad) a0-4)
|
|
(set! (-> v1-9 uvec quad) a1-1)
|
|
(set! (-> v1-9 fvec quad) a2-1)
|
|
(set! (-> v1-9 trans quad) a3-2)
|
|
)
|
|
(let ((v1-10 (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0)))
|
|
(vector-matrix*!
|
|
(-> gp-1 vec0)
|
|
(the-as vector (+ (the-as uint v1-10) (* (-> gp-1 barrel-idx) 16)))
|
|
(-> gp-1 mat0)
|
|
)
|
|
)
|
|
0
|
|
(vector-reset! (-> gp-1 vec4))
|
|
(set! (-> gp-1 vec4 z) (-> gp-1 vec10 y))
|
|
(set! (-> gp-1 vec4 y) (* 0.2678 (-> gp-1 vec10 y)))
|
|
(set! (-> gp-1 vec8 quad) (-> gp-1 mat0 fvec quad))
|
|
(vector-float*! (-> gp-1 vec9) (-> gp-1 vec8) (- (-> gp-1 vec10 z) (-> gp-1 vec10 x)))
|
|
(vector+float*! (-> gp-1 vec3) (-> gp-1 vec0) (-> gp-1 vec8) (+ 32768.0 (-> gp-1 vec10 x)))
|
|
(let ((s4-1 (new 'stack 'boxed-array collide-shape 128)))
|
|
(set! (-> s4-1 length) (fill-actor-list-for-sphere
|
|
*actor-hash*
|
|
(-> gp-1 vec3)
|
|
(-> gp-1 vec9)
|
|
(-> gp-1 vec10 x)
|
|
(the-as (pointer collide-shape) (-> s4-1 data))
|
|
(-> s4-1 allocated-length)
|
|
-1
|
|
)
|
|
)
|
|
(let ((s4-2 (find-nearest-focusable
|
|
(the-as (array collide-shape) s4-1)
|
|
(-> gp-1 vec3)
|
|
(-> gp-1 vec10 z)
|
|
(search-info-flag attackable enemy attackable-priority high-priority)
|
|
(search-info-flag)
|
|
(-> gp-1 vec1)
|
|
(the-as vector #f)
|
|
8192.0
|
|
)
|
|
)
|
|
)
|
|
(when s4-2
|
|
(set! (-> gp-1 vec6 quad) (-> (get-trans s4-2 3) quad))
|
|
(set! (-> gp-1 vec7 quad) (-> (get-transv s4-2) quad))
|
|
(vector+float*! (-> gp-1 vec2) (-> this rbody lin-velocity) (-> gp-1 vec8) (-> gp-1 vec10 y))
|
|
(vector-! (-> gp-1 vec5) (-> gp-1 vec6) (-> gp-1 vec0))
|
|
(set! (-> gp-1 vec11 x) (vector-dot (-> gp-1 vec8) (-> gp-1 vec5)))
|
|
(vector-! (-> gp-1 vec5) (-> gp-1 vec7) (-> gp-1 vec2))
|
|
(set! (-> gp-1 vec11 y) (vector-dot (-> gp-1 vec8) (-> gp-1 vec5)))
|
|
(set! (-> gp-1 vec11 w) (fmax 0.1 (/ (-> gp-1 vec11 x) (fmax 4096.0 (- (-> gp-1 vec11 y))))))
|
|
(set! (-> gp-1 vec11 z) (+ (-> gp-1 vec6 y) (* (-> gp-1 vec11 w) (-> gp-1 vec7 y))))
|
|
(set! (-> gp-1 vec4 y) (+ (* (/ 1.0 (-> gp-1 vec11 w)) (- (-> gp-1 vec11 z) (-> gp-1 vec0 y)))
|
|
(* 0.5 (-> gp-1 vec11 w) (-> gp-1 vec10 w))
|
|
)
|
|
)
|
|
(set! (-> gp-1 vec4 y) (* (-> gp-1 vec4 y) (/ 1.0 (fmax 0.1 (-> gp-1 mat0 uvec y)))))
|
|
(set! (-> gp-1 vec4 y) (fmax (fmin (-> gp-1 vec4 y) (* 0.3638 (-> gp-1 vec10 y))) (* 0.0 (-> gp-1 vec10 y))))
|
|
0
|
|
)
|
|
)
|
|
)
|
|
(vector-rotate*! (-> gp-1 vec2) (-> gp-1 vec4) (-> gp-1 mat0))
|
|
(vector+! (-> gp-1 vec2) (-> gp-1 vec2) (-> this rbody lin-velocity))
|
|
(set! (-> gp-1 params ent) (-> this entity))
|
|
(set! (-> gp-1 params charge) 1.0)
|
|
(set! (-> gp-1 params options) (projectile-options))
|
|
(logclear! (-> gp-1 params options) (projectile-options po14 po15 po16))
|
|
(set! (-> gp-1 params pos quad) (-> gp-1 vec0 quad))
|
|
(set! (-> gp-1 params vel quad) (-> gp-1 vec2 quad))
|
|
(set! (-> gp-1 params notify-handle) (the-as handle #f))
|
|
(set! (-> gp-1 params owner-handle) (process->handle this))
|
|
(set! (-> gp-1 params target-handle) (the-as handle #f))
|
|
(set! (-> gp-1 params target-pos quad) (the-as uint128 0))
|
|
(set! (-> gp-1 params ignore-handle) (process->handle this))
|
|
(let* ((v1-60 *game-info*)
|
|
(a0-37 (+ (-> v1-60 attack-id) 1))
|
|
)
|
|
(set! (-> v1-60 attack-id) a0-37)
|
|
(set! (-> gp-1 params attack-id) a0-37)
|
|
)
|
|
(set! (-> gp-1 params timeout) (seconds 4))
|
|
(spawn-projectile v-toad-shot (-> gp-1 params) *rigid-body-queue-manager* *default-dead-pool*)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
(defmethod vehicle-method-62 ((this v-mirage))
|
|
(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-mirage))
|
|
(initialize-skeleton
|
|
this
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-v-mirage" (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) 2 0)
|
|
(alloc-rbody-control! this *v-mirage-constants*)
|
|
(set! (-> this shoot-delay) (the-as uint 240))
|
|
(set! (-> this local-gun-pos 0 quad) (-> (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0) quad))
|
|
(set! (-> this local-gun-pos 1 quad) (-> (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0) quad))
|
|
(set! (-> this rider-hand-joint-array 0) 17)
|
|
((method-of-type joint-mod-rotate-local init)
|
|
(the-as joint-mod-rotate-local (-> this jmod-axles))
|
|
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)
|
|
(the-as joint-mod-rotate-local (-> this jmod-shock-tops))
|
|
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)
|
|
(the-as joint-mod-set-local (-> this jmod-shock-mids))
|
|
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-fox-wheel" (the-as (pointer level) #f)))
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-v-fox-wheel-blur" (the-as (pointer level) #f)))
|
|
(the-as skeleton-group #f)
|
|
(the-as skeleton-group #f)
|
|
)
|
|
0
|
|
(none)
|
|
)
|