Files
jak-project/test/decompiler/reference/jak2/levels/common/metalhead-projectile_REF.gc
T

931 lines
31 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; failed to figure out what this is:
(defpart 621
:init-specs ((:texture (gun-enemy-beam effects))
(:birth-func 'birth-func-set-quat)
(:num 1.0)
(:scale-x (meters 0.25))
(:scale-y (meters 12))
(:r 128.0)
(:g 128.0)
(:b 128.0)
(:a 32.0 64.0)
(:timer (seconds 0.017))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat))
)
)
;; failed to figure out what this is:
(defpart 622
:init-specs ((:texture (glow-soft effects))
(:num 1.0)
(:scale-x (meters 3))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 128.0)
(:g 0.0)
(:b 128.0)
(:a 64.0)
(:scalevel-x (meters -0.075))
(:scalevel-y :copy scalevel-x)
(:fade-a -1.6)
(:timer (seconds 0.135))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14))
)
)
;; failed to figure out what this is:
(defpart 623
:init-specs ((:texture (metalhead-gun-part effects))
(:num 16.0)
(:z (meters 0) (meters -2))
(:scale-x (meters 0.5) (meters 0.5))
(:rot-z (degrees 0) (degrees 3600))
(:scale-y (meters 0.5) (meters 0.5))
(:r 128.0)
(:g 128.0)
(:b 128.0)
(:a 64.0)
(:fade-g -3.2 -6.4)
(:fade-a -1.6 -6.4)
(:accel-y (meters -0.00016666666) (meters -0.00016666666))
(:timer (seconds 0.267))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
(:rotate-y (degrees 0))
)
)
;; failed to figure out what this is:
(defpart 624
:init-specs ((:texture (gun-enemy-muzzleflash effects))
(:birth-func 'birth-func-set-quat)
(:num 1.0)
(:scale-x (meters 2))
(:scale-y (meters 4.5))
(:r 128.0)
(:g 128.0)
(:b 128.0)
(:a 128.0)
(:fade-a -3.6571429)
(:timer (seconds 0.117))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat))
)
)
;; failed to figure out what this is:
(defpart 625
:init-specs ((:texture (glow effects))
(:num 1.0)
(:scale-x (meters 2))
(:rot-x (degrees 4.5))
(:rot-z (degrees 0) (degrees 3600))
(:scale-y :copy scale-x)
(:r 128.0)
(:g 0.0 64.0)
(:b 128.0)
(:a 255.0)
(:omega (degrees 4515.75))
(:scalevel-x (meters 0.10666667))
(:scalevel-y :copy scalevel-x)
(:fade-a -7.285714)
(:timer (seconds 0.117))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow))
(:userdata 1024.0)
)
)
;; failed to figure out what this is:
(defpartgroup group-metalhead-shot-hit
:id 141
:duration (seconds 1)
:flags (use-local-clock)
:bounds (static-bspherem 0 0 0 8)
:parts ((sp-item 626 :period (seconds 2) :length (seconds 0.017))
(sp-item 627 :fade-after (meters 100) :flags (bit6) :period (seconds 2) :length (seconds 0.017))
(sp-item 628 :flags (bit6) :period (seconds 2) :length (seconds 0.017))
(sp-item 629 :flags (bit6) :period (seconds 2) :length (seconds 0.017))
(sp-item 630 :period (seconds 2) :length (seconds 0.017))
(sp-item 631 :fade-after (meters 50) :falloff-to (meters 50) :period (seconds 2) :length (seconds 0.017))
)
)
;; failed to figure out what this is:
(defpart 629
:init-specs ((:texture (explosion-nebula effects))
(:num 1.0)
(:scale-x (meters 1))
(:rot-x (degrees 1.125))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 0.0 128.0)
(:b 255.0)
(:a 12.0)
(:scalevel-x (meters 0.26666668))
(:scalevel-y :copy scalevel-x)
(:fade-a -0.34285715)
(:timer (seconds 0.135))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
(:userdata 4096.0)
)
)
;; failed to figure out what this is:
(defpart 630
:init-specs ((:texture (bigpuff effects))
(:num 8.0 8.0)
(:scale-x (meters 1) (meters 0.5))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 128.0 128.0)
(:g 0.0 64.0)
(:b 128.0 128.0)
(:a 16.0 48.0)
(:vel-y (meters 0.013333334) (meters 0.04))
(:scalevel-x (meters 0.0016666667) (meters 0.013333334))
(:rotvel-z (degrees -0.2) (degrees 0.4))
(:scalevel-y :copy scalevel-x)
(:fade-r -0.30476192)
(:fade-g -0.35555556)
(:fade-b -0.17777778)
(:fade-a -0.15238096)
(:accel-y (meters -0.00016666666) (meters -0.00016666666))
(:friction 0.9)
(:timer (seconds 1.4))
(:flags (sp-cpuinfo-flag-2))
(:conerot-x (degrees 0) (degrees 3600))
(:conerot-y (degrees 0) (degrees 3600))
)
)
;; failed to figure out what this is:
(defpart 631
:init-specs ((:texture (metalhead-gun-part effects))
(:num 20.0 10.0)
(:y (meters 0.25))
(:scale-x (meters 0.075) (meters 0.05))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 128.0)
(:g 0.0 128.0)
(:b 128.0)
(:a 64.0 32.0)
(:omega (degrees 0.0225) (degrees 0.0225))
(:vel-y (meters 0.033333335) (meters 0.1))
(:rotvel-z (degrees -2.4) 1 (degrees 4.8))
(:fade-g -0.85333335)
(:fade-a 0.0)
(:accel-y (meters -0.00033333333) (meters -0.0013333333))
(:friction 0.9 0.02)
(:timer (seconds 0.5))
(:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14))
(:func 'sparticle-motion-blur)
(:next-time (seconds 0.335))
(:next-launcher 632)
(:conerot-x (degrees 0) (degrees 360))
(:conerot-y (degrees 0) (degrees 360))
)
)
;; failed to figure out what this is:
(defpart 632
:init-specs ((:fade-a -0.48 -0.48))
)
;; failed to figure out what this is:
(defpart 627
:init-specs ((:texture (glow effects))
(:num 1.0)
(:scale-x (meters 4))
(:rot-x (degrees 4.5))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 128.0)
(:b 128.0 128.0)
(:a 128.0)
(:rotvel-z (degrees -0.1))
(:fade-a -1.6)
(:timer (seconds 0.267))
(:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow))
(:userdata -4096.0)
(:next-launcher 633)
)
)
;; failed to figure out what this is:
(defpart 633
:init-specs ((:scale-x (meters 2) (meters 0.5))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 0.0 64.0)
(:b 128.0 128.0)
(:next-time (seconds 0.017))
(:next-launcher 633)
)
)
;; failed to figure out what this is:
(defpart 628
:init-specs ((:texture (glow effects))
(:num 2.0)
(:scale-x (meters 1))
(:rot-x (degrees 4.5))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 0.0 64.0)
(:b 128.0 128.0)
(:a 48.0)
(:scalevel-x (meters 0.12857144))
(:rotvel-z (degrees -0.3) (degrees 0.6))
(:scalevel-y :copy scalevel-x)
(:fade-g -2.1333334)
(:fade-b -2.1333334)
(:timer (seconds 0.267))
(:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 glow))
(:userdata -4096.0)
(:next-time (seconds 0.067))
(:next-launcher 634)
)
)
;; failed to figure out what this is:
(defpart 634
:init-specs ((:scale-x (meters 4.5))
(:scale-y :copy scale-x)
(:scalevel-x (meters -0.06666667))
(:scalevel-y :copy scalevel-x)
(:fade-g -0.53333336)
(:fade-a -0.8)
)
)
;; failed to figure out what this is:
(defpart 626
:init-specs ((:texture (glow effects))
(:num 1.0)
(:scale-x (meters 1))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 255.0)
(:b 255.0)
(:a 96.0)
(:scalevel-x (meters 0.16666667))
(:rotvel-z (degrees 0.3))
(:scalevel-y :copy scalevel-x)
(:timer (seconds 0.185))
(:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
(:next-time (seconds 0.05))
(:next-launcher 635)
)
)
;; failed to figure out what this is:
(defpart 635
:init-specs ((:scale-x (meters 3.5))
(:scale-y :copy scale-x)
(:scalevel-x (meters -0.0875))
(:scalevel-y :copy scalevel-x)
(:fade-b -6.4)
)
)
;; failed to figure out what this is:
(defpartgroup group-metalhead-shot-die
:id 142
:duration (seconds 0.017)
:flags (use-local-clock)
:bounds (static-bspherem 0 0 0 8)
:parts ((sp-item 209))
)
;; failed to figure out what this is:
(defpart 636
:init-specs ((:texture (glow-soft effects))
(:num 1.0)
(:scale-x (meters 2.5))
(:rot-x (degrees 2.25))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 192.0)
(:b 64.0)
(:a 16.0)
(:timer (seconds 0.017))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
(:userdata 819.2)
)
)
;; definition of type metalhead-shot
(deftype metalhead-shot (projectile)
((tail-pos vector :inline)
)
)
;; definition for method 3 of type metalhead-shot
(defmethod inspect ((this metalhead-shot))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type projectile inspect)))
(t9-0 this)
)
(format #t "~2Ttail-pos: #<vector @ #x~X>~%" (-> this tail-pos))
(label cfg-4)
this
)
;; definition for method 24 of type metalhead-shot
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod draw-laser-sight ((this metalhead-shot))
"TODO - confirm If applicable, draw the laser sight particles"
(draw-beam (-> *part-id-table* 624) (-> this tail-pos) (-> this starting-dir) #f #t)
(let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0))
(v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3))
(t9-2 sp-launch-particles-var)
(a0-4 *sp-particle-system-2d*)
(a1-4 (-> *part-id-table* 625))
(a2-2 *launch-matrix*)
)
(set! (-> a2-2 trans quad) (-> v1-2 quad))
(t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
0
(none)
)
;; definition for method 25 of type metalhead-shot
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod spawn-impact-particles ((this metalhead-shot))
"Spawns associated particles with the projectile if applicable"
(rlet ((acc :class vf)
(vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
(vf7 :class vf)
)
(init-vf0-vector)
(let* ((gp-0 (-> this root trans))
(a1-0 (-> this tail-pos))
(s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0))
(f30-0 (vector-length s5-1))
)
(let ((s4-0 (new 'stack-no-clear 'vector)))
(let ((v1-4 a1-0))
(let ((a0-2 s5-1))
(let ((a2-1 0.8))
(.mov vf7 a2-1)
)
(.lvf vf5 (&-> a0-2 quad))
)
(.lvf vf4 (&-> v1-4 quad))
)
(.add.x.vf.w vf6 vf0 vf0)
(.mul.x.vf.xyz acc vf5 vf7)
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
(.svf (&-> s4-0 quad) vf6)
(let ((f28-0 (-> *part-id-table* 621 init-specs 4 initial-valuef)))
(set! (-> *part-id-table* 621 init-specs 4 initial-valuef) (fmin f28-0 (vector-length s5-1)))
(draw-beam (-> *part-id-table* 621) a1-0 s5-1 #f #t)
(set! (-> *part-id-table* 621 init-specs 4 initial-valuef) f28-0)
)
(vector-normalize! s5-1 1.0)
(launch-particles (-> *part-id-table* 622) s4-0)
)
(let ((s4-1 (new 'stack-no-clear 'matrix))
(f26-0 (/ f30-0 (meters 12)))
(f30-1 (-> *part-id-table* 623 init-specs 3 initial-valuef))
(f28-1 (-> *part-id-table* 623 init-specs 5 initial-valuef))
)
(forward-up->inv-matrix s4-1 s5-1 *up-vector*)
(set! (-> s4-1 trans quad) (-> gp-0 quad))
(set! (-> *part-id-table* 623 init-specs 3 initial-valuef) (* f26-0 f30-1))
(set! (-> *part-id-table* 623 init-specs 5 initial-valuef) (* f26-0 f28-1))
(launch-particles (-> *part-id-table* 623) s4-1 :origin-is-matrix #t)
(set! (-> *part-id-table* 623 init-specs 3 initial-valuef) f30-1)
(set! (-> *part-id-table* 623 init-specs 5 initial-valuef) f28-1)
)
)
0
(none)
)
)
;; definition for method 26 of type metalhead-shot
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod spawn-shell-particles ((this metalhead-shot))
"TODO - confirm"
(let* ((s5-0 (-> this root))
(v1-2 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s5-0 trans)) 2048.0))
(gp-0 (new 'stack-no-clear 'vector))
)
(set! (-> gp-0 quad) (-> s5-0 trans quad))
(vector+! gp-0 gp-0 v1-2)
(part-tracker-spawn :to *entity-pool* :group group-metalhead-shot-hit :mat-joint gp-0)
)
0
(none)
)
;; definition for method 28 of type metalhead-shot
;; WARN: Return type mismatch sound-id vs none.
(defmethod play-impact-sound ((this metalhead-shot) (arg0 projectile-options))
(with-pp
(case arg0
(((projectile-options lose-altitude proj-options-2))
(when (nonzero? (-> this sound-id))
(when *sound-player-enable*
(let ((gp-0 (the-as sound-rpc-set-param (get-sound-buffer-entry))))
(set! (-> gp-0 command) (sound-command set-param))
(set! (-> gp-0 id) (-> this sound-id))
(let ((a1-1 (-> this root trans)))
(let ((s5-1 pp))
(when (= a1-1 #t)
(if (and s5-1 (type? s5-1 process-drawable) (nonzero? (-> (the-as process-drawable s5-1) root)))
(set! a1-1 (-> (the-as process-drawable s5-1) root trans))
(set! a1-1 (the-as vector #f))
)
)
)
(sound-trans-convert (the-as vector3w (-> gp-0 params trans)) a1-1)
)
(set! (-> gp-0 params mask) (the-as uint 32))
(-> gp-0 id)
)
)
)
)
)
(none)
)
)
;; definition for function metalhead-shot-move
;; WARN: Return type mismatch int vs none.
(defun metalhead-shot-move ((arg0 metalhead-shot))
(projectile-move-fill-line-sphere arg0)
(let ((s5-0 (-> arg0 root)))
(let ((s4-0 (new 'stack-no-clear 'vector)))
(vector-! s4-0 (-> arg0 tail-pos) (-> s5-0 trans))
(let ((f0-0 (vector-length s4-0)))
(when (< 49152.0 f0-0)
(vector-normalize! s4-0 49152.0)
(vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0)
)
)
)
(if (logtest? (-> s5-0 status) (collide-status touch-surface))
(go (method-of-object arg0 impact))
)
)
0
(none)
)
;; definition for method 30 of type metalhead-shot
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-collision! ((this metalhead-shot))
"Init the [[projectile]]'s [[collide-shape]]"
(let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player))))
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s5-0 reaction)
(the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move)
)
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
)
(set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot))
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0)))
(set! (-> s5-0 total-prims) (the-as uint 3))
(set! (-> s4-0 prim-core collide-as) (collide-spec projectile))
(set! (-> s4-0 prim-core collide-with)
(collide-spec backgnd jak bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list)
)
(set! (-> s4-0 prim-core action) (collide-action solid))
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 819.2)
(set! (-> s5-0 root-prim) s4-0)
)
(let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-13 prim-core collide-as) (collide-spec projectile))
(set! (-> v1-13 prim-core collide-with)
(collide-spec backgnd jak bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list)
)
(set! (-> v1-13 prim-core action) (collide-action solid deadly))
(set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2)
)
(let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-15 prim-core collide-as) (collide-spec projectile))
(set! (-> v1-15 prim-core collide-with)
(collide-spec jak bot crate civilian enemy vehicle-sphere hit-by-others-list player-list)
)
(set! (-> v1-15 prim-core action) (collide-action deadly))
(set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6)
)
(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! (-> s5-0 max-iteration-count) (the-as uint 1))
(set! (-> s5-0 event-self) 'touched)
(set! (-> this root) s5-0)
)
(set! (-> this root pat-ignore-mask)
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1)
)
(none)
)
;; definition for method 31 of type metalhead-shot
;; INFO: Used lq/sq
(defmethod init-proj-settings! ((this metalhead-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(set! (-> this tail-pos quad) (-> this root trans quad))
(set! (-> this attack-mode) 'metalhead-shot)
(set! (-> this max-speed) 532480.0)
(set! (-> this move) metalhead-shot-move)
(set! (-> this timeout) (seconds 0.767))
(set-gravity-length (-> this root dynam) 573440.0)
(none)
)
;; definition for function spawn-metalhead-projectile
;; INFO: Used lq/sq
;; WARN: Return type mismatch (pointer process) vs (pointer metalhead-shot).
(defun spawn-metalhead-projectile ((arg0 metalhead-shot) (arg1 vector) (arg2 vector) (arg3 float))
(let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params)))
(let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1)))
(set! (-> gp-0 ent) (-> arg0 entity))
(set! (-> gp-0 charge) 1.0)
(set! (-> gp-0 options) (projectile-options))
(set! (-> gp-0 notify-handle) (process->handle arg0))
(set! (-> gp-0 owner-handle) (the-as handle #f))
(set! (-> gp-0 ignore-handle) (process->handle arg0))
(let* ((a0-10 *game-info*)
(a2-11 (+ (-> a0-10 attack-id) 1))
)
(set! (-> a0-10 attack-id) a2-11)
(set! (-> gp-0 attack-id) a2-11)
)
(set! (-> gp-0 timeout) (seconds 4))
(set! (-> gp-0 pos quad) (-> arg1 quad))
(vector-normalize-copy! (-> gp-0 vel) v1-1 arg3)
)
(the-as (pointer metalhead-shot) (spawn-projectile metalhead-shot gp-0 arg0 *default-dead-pool*))
)
)
;; failed to figure out what this is:
(defpartgroup group-metalhead-grenade-shot
:id 143
:duration (seconds 0.5)
:flags (use-local-clock)
:bounds (static-bspherem 0 0 0 4)
:parts ((sp-item 637) (sp-item 638) (sp-item 639))
)
;; failed to figure out what this is:
(defpart 637
:init-specs ((:texture (glow effects))
(:num 1.0)
(:scale-x (meters 3) (meters 1))
(:rot-x (degrees 2.25))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 255.0)
(:b 255.0)
(:a 64.0)
(:fade-r -5.5)
(:fade-g -51.0)
(:fade-b -5.5)
(:fade-a -8.533334)
(:timer (seconds 0.017))
(:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow))
(:userdata 409.6)
)
)
;; failed to figure out what this is:
(defpart 638
:init-specs ((:texture (grenadier-grenade-part dig3a-sprite))
(:num 4.0)
(:scale-x (meters 1) (meters 0.2))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 255.0)
(:b 255.0)
(:a 128.0)
(:scalevel-x (meters -0.01))
(:rotvel-z (degrees -1.2) (degrees 1.2))
(:scalevel-y :copy scalevel-x)
(:fade-r -1.375)
(:fade-g -6.375)
(:fade-b -1.375)
(:fade-a -3.2 -3.2)
(:timer (seconds 0.135))
(:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14))
(:conerot-x (degrees 0) (degrees 360))
(:conerot-y (degrees 0) (degrees 360))
(:conerot-radius (meters 0) (meters 0.2))
)
)
;; failed to figure out what this is:
(defpart 639
:init-specs ((:texture (grenadier-grenade-part dig3a-sprite))
(:num 2.0 1.0)
(:scale-x (meters 0.8) (meters 0.4))
(:scale-y (meters 0.6) (meters 0.2))
(:r 255.0)
(:g 255.0)
(:b 255.0)
(:a 64.0 32.0)
(:scalevel-x (meters -0.0026666666) (meters -0.0026666666))
(:scalevel-y :copy scalevel-x)
(:fade-r -0.73333335)
(:fade-g -3.4)
(:fade-b -0.73333335)
(:accel-y (meters -0.00033333333) (meters -0.001))
(:timer (seconds 1))
(:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-14))
(:next-time (seconds 0.25))
(:next-launcher 640)
(:conerot-x (degrees 0) (degrees 360))
(:conerot-y (degrees 0) (degrees 360))
(:conerot-radius (meters 0) (meters 0.35))
)
)
;; failed to figure out what this is:
(defpart 640
:init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.48 -0.48))
)
;; definition of type metalhead-grenade-shot
(deftype metalhead-grenade-shot (projectile)
((tumble-quat quaternion :inline)
(blast-radius float)
)
)
;; definition for method 3 of type metalhead-grenade-shot
(defmethod inspect ((this metalhead-grenade-shot))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type projectile inspect)))
(t9-0 this)
)
(format #t "~2Ttumble-quat: #<quaternion @ #x~X>~%" (-> this tumble-quat))
(format #t "~2Tblast-radius: ~f~%" (-> this blast-radius))
(label cfg-4)
this
)
;; definition for method 26 of type metalhead-grenade-shot
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod spawn-shell-particles ((this metalhead-grenade-shot))
"TODO - confirm"
(part-tracker-spawn :to this :group group-gun-dark-shot-hit :mat-joint (-> this root trans))
0
(none)
)
;; definition for method 28 of type metalhead-grenade-shot
;; WARN: Return type mismatch int vs none.
(defmethod play-impact-sound ((this metalhead-grenade-shot) (arg0 projectile-options))
(case arg0
(((projectile-options lose-altitude))
(sound-play "gren-shot-hit")
)
(((projectile-options lose-altitude proj-options-2))
(sound-play "gren-missile" :id (-> this sound-id) :position (-> this root trans))
)
)
0
(none)
)
;; failed to figure out what this is:
(defstate impact (metalhead-grenade-shot)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('touched)
(let ((v1-1 (as-type proc process-drawable)))
(when v1-1
(let ((s4-1 (-> v1-1 root))
(a1-3 (new 'stack 'collide-query))
)
0.0
(set! (-> a1-3 start-pos quad) (-> self root root-prim prim-core world-sphere quad))
(vector-!
(-> a1-3 move-dist)
(-> (the-as collide-shape s4-1) root-prim prim-core world-sphere)
(-> a1-3 start-pos)
)
(let ((v1-6 a1-3))
(set! (-> v1-6 radius) 40.96)
(set! (-> v1-6 collide-with) (collide-spec backgnd))
(set! (-> v1-6 ignore-process0) self)
(set! (-> v1-6 ignore-process1) (ppointer->process (-> self parent)))
(set! (-> v1-6 ignore-pat) (-> self root pat-ignore-mask))
(set! (-> v1-6 action-mask) (collide-action solid))
)
(when (< (fill-and-probe-using-line-sphere *collide-cache* a1-3) 0.0)
(send-event proc 'attack (-> block param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode))))
(let ((v1-15 (-> self notify-handle)))
(if (handle->process v1-15)
(send-event (-> v1-15 process 0) 'notify 'attack proc)
)
)
)
)
)
)
)
)
)
:code (behavior ()
(let ((v1-1 (-> self root root-prim)))
(set! (-> v1-1 local-sphere w) (-> self blast-radius))
(set! (-> v1-1 prim-core world-sphere w) (-> self blast-radius))
(set! (-> v1-1 prim-core collide-with)
(collide-spec jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list)
)
(set! (-> v1-1 prim-core collide-as) (collide-spec enemy))
)
(update-transforms (-> self root))
(let ((a1-0 (new 'stack-no-clear 'overlaps-others-params)))
(set! (-> a1-0 options) (overlaps-others-options))
(set! (-> a1-0 collide-with-filter) (the-as collide-spec -1))
(set! (-> a1-0 tlist) *touching-list*)
(find-overlapping-shapes (-> self root) a1-0)
)
(suspend)
(let ((v1-9 (-> self root root-prim)))
(set! (-> v1-9 prim-core collide-as) (collide-spec))
(set! (-> v1-9 prim-core collide-with) (collide-spec))
)
0
(while (-> self child)
(suspend)
)
(deactivate self)
)
)
;; failed to figure out what this is:
(defstate dissipate (metalhead-grenade-shot)
:virtual #t
:enter (behavior ()
(go-virtual impact)
)
)
;; definition for method 25 of type metalhead-grenade-shot
;; WARN: Return type mismatch int vs none.
(defmethod spawn-impact-particles ((this metalhead-grenade-shot))
"Spawns associated particles with the projectile if applicable"
(spawn (-> this part) (-> this root trans))
0
(none)
)
;; definition for function gren-canister-move
;; WARN: Return type mismatch int vs none.
(defun gren-canister-move ((arg0 metalhead-grenade-shot))
(quaternion*! (-> arg0 root quat) (-> arg0 root quat) (-> arg0 tumble-quat))
(projectile-move-fill-all-dirs arg0)
(let ((s5-0 (new 'stack-no-clear 'water-info)))
(water-info-init! (-> arg0 root) s5-0 (collide-action solid semi-solid))
(if (and (logtest? (-> s5-0 flags) (water-flags active)) (< (-> arg0 root trans y) (-> s5-0 trans y)))
(go (method-of-object arg0 impact))
)
)
(if (logtest? (-> arg0 root status) (collide-status touch-surface))
(go (method-of-object arg0 impact))
)
0
(none)
)
;; definition for function gren-cshape-reaction-canister
;; WARN: Return type mismatch int vs none.
(defun gren-cshape-reaction-canister ((arg0 collide-shape-moving) (arg1 metalhead-grenade-shot))
(let ((s5-0 0))
(let ((a1-1 (new 'stack-no-clear 'vector)))
(vector-float*! a1-1 (the-as vector (&-> arg1 starting-dir y)) (the-as float (-> arg1 connection-list prev0)))
(move-by-vector! arg0 a1-1)
)
(let ((f30-0 (vector-dot (-> arg0 transv) (the-as vector (&-> arg1 next-state))))
(s3-0 (new 'stack-no-clear 'vector))
)
(vector-float*! s3-0 (the-as vector (&-> arg1 next-state)) (* f30-0 (rand-vu-float-range 1.6 2.2)))
(vector-! (-> arg0 transv) (-> arg0 transv) s3-0)
)
(let ((v0-2 (logior s5-0 7)))
(logior! (-> arg0 status) v0-2)
)
)
(vector-float*! (-> arg0 transv) (-> arg0 transv) 0.88)
(none)
)
;; definition for method 30 of type metalhead-grenade-shot
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-collision! ((this metalhead-grenade-shot))
"Init the [[projectile]]'s [[collide-shape]]"
(let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player))))
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s5-0 reaction)
(the-as (function control-info collide-query vector vector collide-status) gren-cshape-reaction-canister)
)
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
)
(set! (-> s5-0 penetrate-using) (penetrate enemy-dark-shot))
(let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-7 prim-core collide-as) (collide-spec projectile))
(set! (-> v1-7 prim-core collide-with)
(collide-spec backgnd jak crate obstacle hit-by-others-list player-list pusher)
)
(set! (-> v1-7 prim-core action) (collide-action solid))
(set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 1228.8)
(set! (-> s5-0 total-prims) (the-as uint 1))
(set! (-> s5-0 root-prim) v1-7)
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(let ((v1-10 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with))
)
(set! (-> s5-0 max-iteration-count) (the-as uint 2))
(set! (-> s5-0 event-self) 'touched)
(set! (-> this root) s5-0)
)
(set! (-> this root pat-ignore-mask)
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1)
)
(none)
)
;; definition for method 31 of type metalhead-grenade-shot
;; WARN: Return type mismatch sound-id vs none.
(defmethod init-proj-settings! ((this metalhead-grenade-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(set! (-> this attack-mode) 'eco-yellow)
(set! (-> this blast-radius) 4096.0)
(set! (-> this max-speed) 135168.0)
(set! (-> this timeout) (seconds 4))
(set! (-> this update-velocity) projectile-update-velocity-add-gravity)
(set! (-> this move) gren-canister-move)
(set! (-> this root dynam gravity y) 102400.0)
(set! (-> this root dynam gravity-length) 102400.0)
(set! (-> this root dynam gravity-max) 102400.0)
(let ((f0-5 1092.2667))
(quaternion-axis-angle! (-> this tumble-quat) 1.0 0.0 0.0 f0-5)
)
(set! (-> this part) (create-launch-control group-metalhead-grenade-shot this))
(set! (-> this sound-id) (new-sound-id))
(none)
)
;; definition for function spawn-metalhead-grenade
;; INFO: Used lq/sq
;; WARN: Return type mismatch (pointer process) vs (pointer metalhead-grenade-shot).
(defun spawn-metalhead-grenade ((arg0 metalhead-grenade-shot) (arg1 vector) (arg2 vector) (arg3 float))
(let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params)))
(let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1)))
(set! (-> gp-0 ent) (-> arg0 entity))
(set! (-> gp-0 charge) 1.0)
(set! (-> gp-0 options) (projectile-options))
(set! (-> gp-0 notify-handle) (process->handle arg0))
(set! (-> gp-0 owner-handle) (the-as handle #f))
(set! (-> gp-0 ignore-handle) (process->handle arg0))
(let* ((a0-10 *game-info*)
(a2-11 (+ (-> a0-10 attack-id) 1))
)
(set! (-> a0-10 attack-id) a2-11)
(set! (-> gp-0 attack-id) a2-11)
)
(set! (-> gp-0 timeout) (seconds 4))
(set! (-> gp-0 pos quad) (-> arg1 quad))
(vector-normalize-copy! (-> gp-0 vel) v1-1 arg3)
)
(the-as (pointer metalhead-grenade-shot) (spawn-projectile metalhead-shot gp-0 arg0 *default-dead-pool*))
)
)