Files
jak-project/test/decompiler/reference/jak2/engine/target/target-turret-shot_REF.gc
T

436 lines
14 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; failed to figure out what this is:
(defpart 915
:init-specs ((:texture (gun-yellow-beam effects))
(:birth-func 'birth-func-set-quat)
(:num 1.0)
(:scale-x (meters 0.4))
(: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:
(defpartgroup group-turret-shot-hit
:id 200
:duration (seconds 1)
:flags (use-local-clock)
:bounds (static-bspherem 0 0 0 8)
:parts ((sp-item 916 :flags (bit6) :period (seconds 2) :length (seconds 0.017))
(sp-item 917 :flags (bit6) :period (seconds 2) :length (seconds 0.017))
(sp-item 918 :flags (bit6) :period (seconds 2) :length (seconds 0.017))
(sp-item 919 :period (seconds 2) :length (seconds 0.017))
)
)
;; failed to figure out what this is:
(defpart 917
:init-specs ((:texture (glow effects))
(:num 2.0)
(:scale-x (meters 1))
(:rot-x (degrees 2.25))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 32.0)
(:b 32.0 8.0)
(:a 24.0)
(:scalevel-x (meters 0.12857144))
(:rotvel-z (degrees -0.3) (degrees 0.6))
(:scalevel-y :copy scalevel-x)
(:fade-g -3.6571429)
(:fade-b -0.9142857)
(:timer (seconds 0.267))
(:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 glow))
(:userdata 4096.0)
(:next-time (seconds 0.117))
(:next-launcher 920)
)
)
;; failed to figure out what this is:
(defpart 920
:init-specs ((:scale-x (meters 4.5))
(:scale-y :copy scale-x)
(:scalevel-x (meters -0.08888889))
(:scalevel-y :copy scalevel-x)
(:fade-g -3.1111112)
(:fade-b 0.0)
(:fade-a -1.0666667)
)
)
;; failed to figure out what this is:
(defpart 916
:init-specs ((:texture (glow-soft effects))
(:num 1.0)
(:scale-x (meters 0.5))
(:rot-x (degrees 0.5625))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 32.0)
(:b 255.0)
(:a 64.0)
(:scalevel-x (meters 0.16666667))
(:rotvel-z (degrees 0.3))
(:scalevel-y :copy scalevel-x)
(:timer (seconds 0.335))
(:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
(:userdata 4096.0)
(:next-time (seconds 0.05))
(:next-launcher 921)
)
)
;; failed to figure out what this is:
(defpart 921
:init-specs ((:scale-x (meters 3.5))
(:scale-y :copy scale-x)
(:scalevel-x (meters -0.025))
(:scalevel-y :copy scalevel-x)
(:fade-b -6.375)
(:next-time (seconds 0.135))
(:next-launcher 922)
)
)
;; failed to figure out what this is:
(defpart 922
:init-specs ((:scale-x (meters 2))
(:scale-y :copy scale-x)
(:scalevel-x (meters -0.025))
(:scalevel-y :copy scalevel-x)
(:fade-r 0.0)
(:fade-g -1.6)
(:fade-b 0.0)
(:fade-a -1.6)
)
)
;; failed to figure out what this is:
(defpart 918
:init-specs ((:texture (explosion-nebula effects))
(:num 1.0)
(:scale-x (meters 3) (meters 0.4))
(:rot-x (degrees 1.125))
(:rot-z (degrees 0) (degrees 3600))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 0.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 4096.0)
)
)
;; failed to figure out what this is:
(defpart 919
:init-specs ((:texture (bigpuff effects))
(:num 6.0 6.0)
(:scale-x (meters 1.25) (meters 1))
(:rot-z (degrees 0) (degrees 3600))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 0.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 923
:init-specs ((:texture (metalhead-gun-part effects))
(:num 4.0 4.0)
(:z (meters 0) (meters -3))
(:scale-x (meters 0.8) (meters 0.4))
(:scale-y (meters 0.8) (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 -1.6 -6.4)
(: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))
)
)
;; definition of type turret-shot
(deftype turret-shot (guard-shot)
((hit-pos vector :inline)
)
)
;; definition for method 3 of type turret-shot
(defmethod inspect ((this turret-shot))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type guard-shot inspect)))
(t9-0 this)
)
(format #t "~2Thit-pos: #<vector @ #x~X>~%" (-> this hit-pos))
(label cfg-4)
this
)
;; failed to figure out what this is:
(defstate impact (turret-shot)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('touched)
(let ((toucher (as-type proc process-drawable)))
(when toucher
(-> toucher root)
(send-event
proc
'attack
(-> block param 0)
(static-attack-info ((id (-> self attack-id)) (mode 'explode) (damage (-> self damage))))
)
)
)
)
(else
(projectile-event-handler proc argc message block)
)
)
)
:code (behavior ()
(let ((root-prim (-> self root root-prim)))
(set! (-> (the-as collide-shape-prim-group root-prim) child 0 prim-core world-sphere w) 4915.2)
)
(let ((overlap-params (new 'stack-no-clear 'overlaps-others-params)))
(set! (-> overlap-params options) (overlaps-others-options))
(set! (-> overlap-params collide-with-filter) (the-as collide-spec -1))
(set! (-> overlap-params tlist) *touching-list*)
(find-overlapping-shapes (-> self root) overlap-params)
)
(suspend)
(go-virtual die)
)
)
;; definition for method 25 of type turret-shot
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod spawn-impact-particles ((this turret-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* 915 init-specs 4 initial-valuef)))
(set! (-> *part-id-table* 915 init-specs 4 initial-valuef) (vector-length s5-1))
(draw-beam (-> *part-id-table* 915) a1-0 s5-1 #f #t)
(set! (-> *part-id-table* 915 init-specs 4 initial-valuef) f28-0)
)
(vector-normalize! s5-1 1.0)
(launch-particles (-> *part-id-table* 607) s4-0)
(launch-particles (-> *part-id-table* 608) s4-0)
)
(let ((s4-1 (new 'stack-no-clear 'matrix))
(f26-0 (/ f30-0 (meters 9)))
(f30-1 (-> *part-id-table* 923 init-specs 3 initial-valuef))
(f28-1 (-> *part-id-table* 923 init-specs 4 initial-valuef))
)
(forward-up->inv-matrix s4-1 s5-1 *up-vector*)
(set! (-> s4-1 trans quad) (-> gp-0 quad))
(set! (-> *part-id-table* 923 init-specs 3 initial-valuef) (* f26-0 f30-1))
(set! (-> *part-id-table* 923 init-specs 4 initial-valuef) (* f26-0 f28-1))
(launch-particles (-> *part-id-table* 923) s4-1 :origin-is-matrix #t)
(set! (-> *part-id-table* 923 init-specs 3 initial-valuef) f30-1)
(set! (-> *part-id-table* 923 init-specs 4 initial-valuef) f28-1)
)
)
0
(none)
)
)
;; definition for method 26 of type turret-shot
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod spawn-shell-particles ((this turret-shot))
"TODO - confirm"
(let* ((root (-> this root))
(v1-2 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> root trans)) 2048.0))
(gp-0 (new 'stack-no-clear 'vector))
)
(set! (-> gp-0 quad) (-> root trans quad))
(vector+! gp-0 gp-0 v1-2)
(part-tracker-spawn :to *entity-pool* :group group-turret-shot-hit :mat-joint gp-0)
)
0
(none)
)
;; definition for method 28 of type turret-shot
;; WARN: Return type mismatch int vs none.
(defmethod play-impact-sound ((this turret-shot) (proj-options projectile-options))
(let ((options proj-options))
(cond
((zero? options)
(sound-play "drl-turret-fire")
)
((= options (projectile-options lose-altitude))
(sound-play "drl-turret-hit")
)
)
)
0
(none)
)
;; definition for method 31 of type turret-shot
;; INFO: Used lq/sq
;; WARN: Return type mismatch projectile-options vs none.
(defmethod init-proj-settings! ((this turret-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(set! (-> this tail-pos quad) (-> this root trans quad))
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1))
(set! (-> this attack-mode) 'turret)
(set! (-> this max-speed) 1228800.0)
(set! (-> this move) guard-shot-move)
(set! (-> this damage) 1.0)
(logior! (-> this options) (projectile-options deal-damage))
(none)
)
;; definition for method 30 of type turret-shot
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-collision! ((this turret-shot))
"Init the [[projectile]]'s [[collide-shape]]"
(let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player))))
(set! (-> cshape dynam) (copy *standard-dynamics* 'process))
(set! (-> cshape reaction)
(the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move)
)
(set! (-> cshape no-reaction)
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
)
(set! (-> cshape penetrate-using) (penetrate enemy-dark-shot))
(let ((prim-group (new 'process 'collide-shape-prim-group cshape (the-as uint 2) 0)))
(set! (-> cshape total-prims) (the-as uint 3))
(set! (-> prim-group prim-core collide-as) (collide-spec projectile))
(set! (-> prim-group prim-core collide-with)
(collide-spec
backgnd
jak
bot
crate
civilian
enemy
obstacle
vehicle-sphere
hit-by-others-list
player-list
obstacle-for-jak
)
)
(set! (-> prim-group prim-core action) (collide-action solid))
(set-vector! (-> prim-group local-sphere) 0.0 0.0 0.0 4915.2)
(set! (-> cshape root-prim) prim-group)
)
(let ((prim-sphere-1 (new 'process 'collide-shape-prim-sphere cshape (the-as uint 0))))
(set! (-> prim-sphere-1 prim-core collide-as) (collide-spec projectile))
(set! (-> prim-sphere-1 prim-core collide-with)
(collide-spec
backgnd
jak
bot
crate
civilian
enemy
obstacle
vehicle-sphere
hit-by-others-list
player-list
obstacle-for-jak
)
)
(set! (-> prim-sphere-1 prim-core action) (collide-action solid deadly))
(set-vector! (-> prim-sphere-1 local-sphere) 0.0 0.0 0.0 2048.0)
)
(let ((prim-sphere-2 (new 'process 'collide-shape-prim-sphere cshape (the-as uint 0))))
(set! (-> prim-sphere-2 prim-core collide-as) (collide-spec projectile))
(set! (-> prim-sphere-2 prim-core collide-with)
(collide-spec jak bot crate civilian enemy vehicle-sphere hit-by-others-list player-list obstacle-for-jak)
)
(set! (-> prim-sphere-2 prim-core action) (collide-action deadly))
(set-vector! (-> prim-sphere-2 local-sphere) 0.0 0.0 0.0 4915.2)
)
(set! (-> cshape nav-radius) (* 0.75 (-> cshape root-prim local-sphere w)))
(let ((root-prim (-> cshape root-prim)))
(set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as))
(set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with))
)
(set! (-> cshape max-iteration-count) (the-as uint 1))
(set! (-> cshape event-self) 'touched)
(set! (-> this root) cshape)
)
(set! (-> this root pat-ignore-mask)
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1)
)
0
(none)
)