Files
jak-project/test/decompiler/reference/jak3/engine/common-obs/guard-projectile_REF.gc
T

643 lines
20 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; failed to figure out what this is:
(defpart 849
:init-specs ((:texture (common-white common))
(:num 10.0 1.0)
(:x (meters 0))
(:y (meters 0))
(:z (meters 0))
(:scale-x (meters 1))
(:rot-x (degrees 90))
(:rot-y (degrees 0))
(:rot-z (degrees 0))
(:scale-y (meters 0.1))
(:r 255.0)
(:g 255.0)
(:b 255.0)
(:a 64.0 32.0)
(:accel-y (meters -0.00033333333) (meters -0.001))
(:timer (seconds 0.017))
(:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-14))
)
)
;; failed to figure out what this is:
(defpart 850
:init-specs ((:texture (gun-yellow-beam level-default-sprite))
(:birth-func 'birth-func-set-quat)
(:num 1.0)
(:scale-x (meters 0.25))
(:scale-y (meters 9))
(:r 128.0)
(:g 0.0 64.0)
(:b 0.0)
(:a 128.0)
(:scalevel-x (meters 0.0016666667))
(:fade-a -2.1333334)
(:timer (seconds 0.135))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat))
)
)
;; failed to figure out what this is:
(defpart 851
:init-specs ((:texture (glow-soft level-default-sprite))
(:num 1.0)
(:scale-x (meters 1))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 128.0)
(:g 0.0 32.0)
(:b 0.0)
(:a 64.0)
(:scalevel-x (meters -0.016666668))
(:scalevel-y :copy scalevel-x)
(:fade-a -1.6)
(:timer (seconds 0.085))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14))
)
)
;; failed to figure out what this is:
(defpart 852
:init-specs ((:texture (glow level-default-sprite))
(:num 0.0)
(:scale-x (meters 0.3) (meters 0.3))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 128.0)
(:g 128.0)
(:b 128.0)
(:a 64.0 32.0)
(:timer (seconds 0.017))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14))
)
)
;; failed to figure out what this is:
(defpart 853
:init-specs ((:texture (radial-gradient level-default-sprite))
(:num 8.0 8.0)
(:z (meters 0) (meters -3))
(:scale-x (meters 0.4) (meters 0.4))
(:scale-y (meters 0.4) (meters 0.4))
(:r 192.0)
(:g 64.0 128.0)
(:b 0.0)
(:a 64.0)
(:scalevel-x (meters -0.00234375))
(:scalevel-y :copy scalevel-x)
(:fade-g -1.2 -2.4)
(:fade-a -0.53333336 -2.1333334)
(:accel-y (meters -0.00016666666) (meters -0.00016666666))
(:timer (seconds 0.8))
(:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
(:rotate-y (degrees 0))
)
)
;; failed to figure out what this is:
(defpart 854
:init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite))
(:birth-func 'birth-func-set-quat)
(:num 1.0)
(:scale-x (meters 2))
(:scale-y (meters 4.5))
(:r 128.0)
(:g 0.0 128.0)
(:b 0.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 855
:init-specs ((:texture (glow level-default-sprite))
(:num 1.0)
(:scale-x (meters 1) (meters 1))
(:rot-x (degrees 4.5))
(:rot-z (degrees 0) (degrees 3600))
(:scale-y :copy scale-x)
(:r 128.0)
(:g 128.0)
(:b 0.0)
(:a 255.0)
(:omega (degrees 4515.75))
(:scalevel-x (meters 0.053333335))
(:scalevel-y :copy scalevel-x)
(:fade-g -3.6571429)
(: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-guard-shot-hit-object
:id 211
:duration (seconds 1)
:flags (sp0)
:bounds (static-bspherem 0 0 0 8)
:parts ((sp-item 856 :flags (sp6) :period (seconds 2) :length (seconds 0.017))
(sp-item 857 :flags (sp6) :period (seconds 2) :length (seconds 0.017))
(sp-item 858 :flags (sp6) :period (seconds 2) :length (seconds 0.017))
)
)
;; failed to figure out what this is:
(defpartgroup group-guard-shot-hit
:id 212
:duration (seconds 1)
:flags (sp0)
:bounds (static-bspherem 0 0 0 8)
:parts ((sp-item 856 :flags (sp6) :period (seconds 2) :length (seconds 0.017))
(sp-item 857 :flags (sp6) :period (seconds 2) :length (seconds 0.017))
(sp-item 858 :flags (sp6) :period (seconds 2) :length (seconds 0.017))
(sp-item 859 :period (seconds 2) :length (seconds 0.017))
)
)
;; failed to figure out what this is:
(defpart 858
:init-specs ((:texture (explosion-nebula level-default-sprite))
(:num 1.0)
(:scale-x (meters 2))
(:rot-x (degrees 1.125))
(:rot-z (degrees 0) (degrees 3600))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 0.0 128.0)
(:b 0.0)
(:a 64.0)
(:scalevel-x (meters 0.075))
(:scalevel-y :copy scalevel-x)
(:fade-a -1.8285714)
(:timer (seconds 0.135))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
(:userdata 8192.0)
)
)
;; failed to figure out what this is:
(defpart 859
:init-specs ((:texture (bigpuff level-default-sprite))
(:num 8.0 8.0)
(:scale-x (meters 0.75) (meters 0.5))
(:rot-z (degrees 0) (degrees 3600))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 0.0 128.0)
(:b 0.0)
(:a 16.0 48.0)
(:vel-y (meters 0.026666667) (meters 0.026666667))
(:scalevel-x (meters 0.0016666667) (meters 0.006666667))
(:rotvel-z (degrees -0.2) (degrees 0.4))
(:scalevel-y :copy scalevel-x)
(:fade-r -0.30476192)
(:fade-g 0.15238096)
(:fade-b 0.30476192)
(:fade-a -0.15238096)
(:accel-y (meters -0.00016666666) (meters -0.00016666666))
(:friction 0.9)
(:timer (seconds 1.4))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3))
(:conerot-x (degrees 0) (degrees 3600))
(:conerot-y (degrees 0) (degrees 3600))
)
)
;; failed to figure out what this is:
(defpart 857
:init-specs ((:texture (glow level-default-sprite))
(:num 2.0)
(:scale-x (meters 2))
(:rot-x (degrees 4.5))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 128.0 64.0)
(:b 0.0 32.0)
(:a 48.0)
(:scalevel-x (meters 0.125))
(: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 0.0)
(:next-time (seconds 0.067))
(:next-launcher 860)
)
)
;; failed to figure out what this is:
(defpart 860
:init-specs ((:scale-x (meters 4.5))
(:scale-y :copy scale-x)
(:scalevel-x (meters -0.05))
(:scalevel-y :copy scalevel-x)
(:fade-g -0.53333336)
(:fade-a -0.8)
)
)
;; failed to figure out what this is:
(defpart 856
:init-specs ((:texture (glow level-default-sprite))
(: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.1))
(: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 861)
)
)
;; failed to figure out what this is:
(defpart 861
:init-specs ((:scale-x (meters 3.5))
(:scale-y :copy scale-x)
(:scalevel-x (meters -0.0625))
(:scalevel-y :copy scalevel-x)
(:fade-b -6.4)
)
)
;; failed to figure out what this is:
(defpartgroup group-guard-grenade
:id 213
:duration (seconds 0.5)
:flags (sp0)
:bounds (static-bspherem 0 0 0 2)
:parts ((sp-item 862 :fade-after (meters 200) :falloff-to (meters 200)))
)
;; failed to figure out what this is:
(defpart 862
:init-specs ((:texture (bigpuff level-default-sprite))
(:num 1.0)
(:scale-x (meters 0.5) (meters 0.25))
(:rot-z (degrees 0) (degrees 3600))
(:scale-y :copy scale-x)
(:r 64.0 128.0)
(:g :copy r)
(:b :copy g)
(:a 16.0 32.0)
(:vel-y (meters 0) (meters 0.016666668))
(:scalevel-x (meters 0.006666667) (meters 0.013333334))
(:rotvel-z (degrees -0.2) (degrees 0.4))
(:scalevel-y :copy scalevel-x)
(:fade-a -0.16 -0.16)
(:friction 0.96)
(:timer (seconds 1))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
(:conerot-x (degrees 0) (degrees 3600))
(:conerot-y (degrees 0) (degrees 3600))
(:conerot-radius (meters 0))
)
)
;; definition of type guard-shot
(deftype guard-shot (projectile)
((hit-actor? symbol)
(tail-pos vector :inline)
)
)
;; definition for method 3 of type guard-shot
(defmethod inspect ((this guard-shot))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type projectile inspect)))
(t9-0 this)
)
(format #t "~2Thit-actor?: ~A~%" (-> this hit-actor?))
(format #t "~2Ttail-pos: #<vector @ #x~X>~%" (-> this tail-pos))
(label cfg-4)
this
)
;; definition for method 37 of type guard-shot
(defmethod deal-damage! ((this guard-shot) (arg0 process) (arg1 event-message-block))
(let ((t9-0 (method-of-type projectile deal-damage!)))
(when (t9-0 this arg0 arg1)
(set! (-> this hit-actor?) #t)
#t
)
)
)
;; definition for method 24 of type guard-shot
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod projectile-method-24 ((this guard-shot))
(draw-beam (-> *part-id-table* 854) (-> this tail-pos) (-> this starting-dir) #f)
(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* 855))
(a2-2 *launch-matrix*)
)
(vector-copy! (-> a2-2 trans) v1-2)
(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 guard-shot
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod projectile-method-25 ((this guard-shot))
(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-1 (vector+*! (new 'stack-no-clear 'vector) a1-0 s5-1 0.8)))
(let ((f28-0 (-> *part-id-table* 850 init-specs 4 initial-valuef)))
(set! (-> *part-id-table* 850 init-specs 4 initial-valuef) (vector-length s5-1))
(draw-beam (-> *part-id-table* 850) a1-0 s5-1 #f)
(set! (-> *part-id-table* 850 init-specs 4 initial-valuef) f28-0)
)
(vector-normalize! s5-1 1.0)
(launch-particles (-> *part-id-table* 851) s4-1)
(launch-particles (-> *part-id-table* 852) s4-1)
)
(let ((s4-2 (new 'stack-no-clear 'matrix))
(f26-0 (/ f30-0 (meters 9)))
(f30-1 (-> *part-id-table* 853 init-specs 3 initial-valuef))
(f28-1 (-> *part-id-table* 853 init-specs 4 initial-valuef))
)
(forward-up->inv-matrix s4-2 s5-1 *up-vector*)
(vector-copy! (-> s4-2 trans) gp-0)
(set! (-> *part-id-table* 853 init-specs 3 initial-valuef) (* f26-0 f30-1))
(set! (-> *part-id-table* 853 init-specs 4 initial-valuef) (* f26-0 f28-1))
(launch-particles (-> *part-id-table* 853) s4-2 :origin-is-matrix #t)
(set! (-> *part-id-table* 853 init-specs 3 initial-valuef) f30-1)
(set! (-> *part-id-table* 853 init-specs 4 initial-valuef) f28-1)
)
)
0
(none)
)
;; definition for method 26 of type guard-shot
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod projectile-method-26 ((this guard-shot))
(let* ((s5-0 (-> this root))
(a0-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s5-0 trans)) 2048.0))
(v1-1 (new 'stack-no-clear 'vector))
)
(vector-copy! v1-1 (-> s5-0 trans))
(vector+! v1-1 v1-1 a0-3)
(cond
((-> this hit-actor?)
(cond
((logtest? (-> group-guard-shot-hit-object flags) (sp-group-flag sp13))
(vector-copy! (-> *launch-matrix* trans) v1-1)
(part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group group-guard-shot-hit-object)
)
(else
(vector-copy! (-> *launch-matrix* trans) v1-1)
(part-tracker-spawn part-tracker :to *entity-pool* :group group-guard-shot-hit-object)
)
)
)
((logtest? (-> group-guard-shot-hit flags) (sp-group-flag sp13))
(vector-copy! (-> *launch-matrix* trans) v1-1)
(part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group group-guard-shot-hit)
)
(else
(vector-copy! (-> *launch-matrix* trans) v1-1)
(part-tracker-spawn part-tracker :to *entity-pool* :group group-guard-shot-hit)
)
)
)
0
(none)
)
;; definition for method 28 of type guard-shot
;; WARN: Return type mismatch int vs none.
(defmethod play-impact-sound ((this guard-shot) (arg0 projectile-options))
(let ((v1-0 arg0))
(cond
((zero? v1-0)
(sound-play "guard-shot-fire")
)
((= v1-0 (projectile-options po0))
(sound-play "guard-shot-hit")
)
)
)
0
(none)
)
;; definition for function guard-shot-move
;; WARN: Return type mismatch int vs none.
(defun guard-shot-move ((arg0 guard-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 (< 36864.0 f0-0)
(vector-normalize! s4-0 36864.0)
(vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0)
)
)
)
(when (logtest? (-> s5-0 status) (collide-status touch-surface))
(if (logtest? (-> arg0 root status) (collide-status touch-actor))
(set! (-> arg0 hit-actor?) #t)
)
(go (method-of-object arg0 impact))
)
)
0
(none)
)
;; definition for method 38 of type guard-shot
(defmethod made-impact? ((this guard-shot))
(let ((v1-0 (-> this root))
(t1-0 (new 'stack-no-clear 'collide-query))
)
(let ((a0-1 t1-0))
(set! (-> a0-1 radius) (-> v1-0 root-prim prim-core world-sphere w))
(set! (-> a0-1 collide-with) (-> v1-0 root-prim prim-core collide-with))
(set! (-> a0-1 ignore-process0) this)
(set! (-> a0-1 ignore-process1) (ppointer->process (-> this parent)))
(set! (-> a0-1 ignore-pat) (-> v1-0 pat-ignore-mask))
(set! (-> a0-1 action-mask) (collide-action solid))
)
(when (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -6144.0 0.0 -2048.0 t1-0)
(if (logtest? (-> this root status) (collide-status touch-actor))
(set! (-> this hit-actor?) #t)
)
#t
)
)
)
;; definition for method 30 of type guard-shot
;; WARN: Return type mismatch int vs none.
(defmethod setup-collision! ((this guard-shot))
(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
pusher
shield
)
)
(set! (-> s4-0 prim-core action) (collide-action solid))
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 2457.6)
(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
pusher
shield
)
)
(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
obstacle
vehicle-sphere
hit-by-others-list
player-list
pusher
shield
)
)
(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 :board #x1)
)
0
(none)
)
;; definition for method 31 of type guard-shot
;; INFO: Used lq/sq
(defmethod init-proj-settings! ((this guard-shot))
(set! (-> this hit-actor?) #f)
(vector-copy! (-> this tail-pos) (-> this root trans))
(set! (-> this attack-mode) 'guard-shot)
(set! (-> this max-speed) 819200.0)
(set! (-> this move) guard-shot-move)
(set! (-> this update-velocity) projectile-update-velocity-space-wars)
(set! (-> this timeout) (seconds 0.5))
(logior! (-> this options) (projectile-options po13))
(set-gravity-length (-> this root dynam) 573440.0)
(none)
)
;; definition for function spawn-guard-projectile
;; INFO: Used lq/sq
;; WARN: Return type mismatch (pointer process) vs (pointer guard-shot).
(defun spawn-guard-projectile ((arg0 process-focusable) (arg1 vector) (arg2 vector) (arg3 float) (arg4 vector))
(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))
(logclear! (-> gp-0 options) (projectile-options po14 po15 po16))
(set! (-> gp-0 notify-handle) (process->handle arg0))
(set! (-> gp-0 owner-handle) (the-as handle #f))
(set! (-> gp-0 target-handle) (the-as handle #f))
(set! (-> gp-0 target-pos quad) (the-as uint128 0))
(set! (-> gp-0 ignore-handle) (process->handle arg0))
(let* ((a0-13 *game-info*)
(a2-12 (+ (-> a0-13 attack-id) 1))
)
(set! (-> a0-13 attack-id) a2-12)
(set! (-> gp-0 attack-id) a2-12)
)
(set! (-> gp-0 timeout) (seconds 4))
(if arg4
(vector-copy! (-> gp-0 pos) arg4)
(vector-copy! (-> gp-0 pos) arg1)
)
(vector-normalize-copy! (-> gp-0 vel) v1-1 arg3)
)
(the-as (pointer guard-shot) (spawn-projectile guard-shot gp-0 arg0 *default-dead-pool*))
)
)