mirror of
https://github.com/open-goal/jak-project
synced 2026-07-04 05:20:56 -04:00
e2e5289788
- `pecker-ingame` - `des-bbush-tasks` - `des-burning-bush` - `des-bush-part` - `des-bush` - `mh-centipede` - `mh-centipede-part` - `mh-wasp` - `mh-wasp-part` - `needle-fish` - `des-bush-time-chase` - `timer-path` - `mission-squad-control-h` - `mh-bat` - `hover-nav-factoryd` - `hover-nav-factoryc` - `conveyor` - `fac-part` - `factory-part` - `factoryc-mood` - `factoryc-obs` - `factoryc-obs2` - `lfaccar-init` - `factory-boss-part` - `factory-boss-scenes` - `factory-boss-setup` - `factory-boss-states` - `factory-mood` - `factoryc-manager` - `lfacrm1-mood` - `lfacrm2-mood` - `missile-bot` - `sew-laser-turret` - `ai-task-h` - `ash-h` - `ash-shot` - `ash-states` - `ash-task` - `ash` - `bot-h` - `bot-states` - `bot` - `ash-oasis-course` - `oasis-defense` - `comb-field` - `comb-mood` - `comb-obs` - `comb-part` - `comb-scenes` - `comb-sentry` - `comb-travel` - `comba-init` - `combx-scenes` - `h-sled` - `destroy-dark-eco` - `fac-gunturret` - `fac-robotank-turret` - `fac-robotank` - `fac-tower` - `factory-h` - `factory-hud` - `factory-manager` - `factorya-init` - `ffight-projectile` - `ftank-projectile` - `fturret-projectile` - `h-warf` - `warf-projectile`
847 lines
31 KiB
Common Lisp
Vendored
Generated
847 lines
31 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition of type comb-sentry-shot
|
|
(deftype comb-sentry-shot (guard-shot)
|
|
()
|
|
)
|
|
|
|
;; definition for method 3 of type comb-sentry-shot
|
|
(defmethod inspect ((this comb-sentry-shot))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type guard-shot inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition for method 24 of type comb-sentry-shot
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod projectile-method-24 ((this comb-sentry-shot))
|
|
(draw-beam (-> *part-id-table* 4240) (-> 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* 4241))
|
|
(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 comb-sentry-shot
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod projectile-method-25 ((this comb-sentry-shot))
|
|
(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 vf6 vf0 vf0 :mask #b1000)
|
|
(.mul.x.vf acc vf5 vf7 :mask #b111)
|
|
(.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111)
|
|
(.svf (&-> s4-0 quad) vf6)
|
|
(let ((f28-0 (-> *part-id-table* 4236 init-specs 4 initial-valuef)))
|
|
(set! (-> *part-id-table* 4236 init-specs 4 initial-valuef) (vector-length s5-1))
|
|
(draw-beam (-> *part-id-table* 4236) a1-0 s5-1 #f)
|
|
(set! (-> *part-id-table* 4236 init-specs 4 initial-valuef) f28-0)
|
|
)
|
|
(vector-normalize! s5-1 1.0)
|
|
(launch-particles (-> *part-id-table* 4237) s4-0)
|
|
(launch-particles (-> *part-id-table* 4238) s4-0)
|
|
)
|
|
(let ((s4-1 (new 'stack-no-clear 'matrix))
|
|
(f26-0 (* 0.000027126736 f30-0))
|
|
(f30-1 (-> *part-id-table* 4239 init-specs 3 initial-valuef))
|
|
(f28-1 (-> *part-id-table* 4239 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* 4239 init-specs 3 initial-valuef) (* f26-0 f30-1))
|
|
(set! (-> *part-id-table* 4239 init-specs 4 initial-valuef) (* f26-0 f28-1))
|
|
(launch-particles (-> *part-id-table* 4239) s4-1 :origin-is-matrix #t)
|
|
(set! (-> *part-id-table* 4239 init-specs 3 initial-valuef) f30-1)
|
|
(set! (-> *part-id-table* 4239 init-specs 4 initial-valuef) f28-1)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
)
|
|
|
|
;; definition for method 26 of type comb-sentry-shot
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod projectile-method-26 ((this comb-sentry-shot))
|
|
(let* ((s4-0 (-> this root))
|
|
(v1-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s4-0 trans)) 2048.0))
|
|
(gp-0 (new 'stack-no-clear 'vector))
|
|
)
|
|
(set! (-> gp-0 quad) (-> s4-0 trans quad))
|
|
(vector+! gp-0 gp-0 v1-1)
|
|
(cond
|
|
((-> this hit-actor?)
|
|
(sound-play "sentry-hit")
|
|
(cond
|
|
((logtest? (-> *part-group-id-table* 211 flags) (sp-group-flag sp13))
|
|
(set! (-> *launch-matrix* trans quad) (-> gp-0 quad))
|
|
(part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 211))
|
|
)
|
|
(else
|
|
(set! (-> *launch-matrix* trans quad) (-> gp-0 quad))
|
|
(part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 211))
|
|
)
|
|
)
|
|
)
|
|
((logtest? (-> *part-group-id-table* 212 flags) (sp-group-flag sp13))
|
|
(set! (-> *launch-matrix* trans quad) (-> gp-0 quad))
|
|
(part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 212))
|
|
)
|
|
(else
|
|
(set! (-> *launch-matrix* trans quad) (-> gp-0 quad))
|
|
(part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 212))
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 31 of type comb-sentry-shot
|
|
;; WARN: Return type mismatch sound-id vs none.
|
|
(defmethod init-proj-settings! ((this comb-sentry-shot))
|
|
(let ((t9-0 (method-of-type guard-shot init-proj-settings!)))
|
|
(t9-0 this)
|
|
)
|
|
(logior! (-> this options) (projectile-options po13))
|
|
(set! (-> this max-speed) 2048000.0)
|
|
(set! (-> this damage) 3.0)
|
|
(set! (-> this timeout) (seconds 0.4))
|
|
(set! (-> this sound-id) (new-sound-id))
|
|
(none)
|
|
)
|
|
|
|
;; definition of type comb-sentry
|
|
(deftype comb-sentry (process-focusable)
|
|
((target-pos vector :inline)
|
|
(up-dir vector :inline)
|
|
(attack-vel vector :inline)
|
|
(exploder-params joint-exploder-static-params)
|
|
(exploder-skel skeleton-group)
|
|
(exploder-anim uint32)
|
|
(target-dist float)
|
|
(path-t float)
|
|
(path-dt float)
|
|
(hit-points float)
|
|
(incoming-attack-id int32)
|
|
(angle float)
|
|
(spin float)
|
|
(shooting symbol)
|
|
(should-attack symbol)
|
|
(i-barrel int8)
|
|
(hum-id sound-id)
|
|
(shot-time time-frame)
|
|
(attack-time time-frame)
|
|
(in-range-time time-frame)
|
|
(player-vehicle handle)
|
|
)
|
|
(:state-methods
|
|
idle
|
|
path-follow
|
|
explode
|
|
)
|
|
(:methods
|
|
(stop-hum (_type_) none)
|
|
(sentry-post (_type_) none)
|
|
(set-cspec! (_type_) none)
|
|
(go-explode (_type_) none)
|
|
(set-attack-vel! (_type_ vector) none)
|
|
(on-attack (_type_ process attack-info object) symbol)
|
|
(on-impact (_type_ rigid-body-impact) symbol)
|
|
(fire-shot (_type_) (pointer comb-sentry-shot))
|
|
(draw-glow-sprites (_type_) none)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type comb-sentry
|
|
(defmethod inspect ((this comb-sentry))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type process-focusable inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~2Ttarget-pos: #<vector @ #x~X>~%" (-> this target-pos))
|
|
(format #t "~2Tup-dir: #<vector @ #x~X>~%" (-> this up-dir))
|
|
(format #t "~2Tattack-vel: #<vector @ #x~X>~%" (-> this attack-vel))
|
|
(format #t "~2Texploder-params: ~A~%" (-> this exploder-params))
|
|
(format #t "~2Texploder-skel: ~A~%" (-> this exploder-skel))
|
|
(format #t "~2Texploder-anim: ~D~%" (-> this exploder-anim))
|
|
(format #t "~2Ttarget-dist: ~f~%" (-> this target-dist))
|
|
(format #t "~2Tpath-t: ~f~%" (-> this path-t))
|
|
(format #t "~2Tpath-dt: ~f~%" (-> this path-dt))
|
|
(format #t "~2Thit-points: ~f~%" (-> this hit-points))
|
|
(format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id))
|
|
(format #t "~2Tangle: ~f~%" (-> this angle))
|
|
(format #t "~2Tspin: ~f~%" (-> this spin))
|
|
(format #t "~2Tshooting: ~A~%" (-> this shooting))
|
|
(format #t "~2Tshould-attack: ~A~%" (-> this should-attack))
|
|
(format #t "~2Ti-barrel: ~D~%" (-> this i-barrel))
|
|
(format #t "~2Thum-id: ~D~%" (-> this hum-id))
|
|
(format #t "~2Tshot-time: ~D~%" (-> this shot-time))
|
|
(format #t "~2Tattack-time: ~D~%" (-> this attack-time))
|
|
(format #t "~2Tin-range-time: ~D~%" (-> this in-range-time))
|
|
(format #t "~2Tplayer-vehicle: ~D~%" (-> this player-vehicle))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup skel-comb-sentry comb-sentinel comb-sentinel-lod0-jg comb-sentinel-idle-ja
|
|
((comb-sentinel-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 11)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup skel-comb-sentry-explode comb-sentinel comb-sentinel-explode-lod0-jg comb-sentinel-explode-idle-ja
|
|
((comb-sentinel-explode-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 6.5 0 7)
|
|
)
|
|
|
|
;; definition for symbol *comb-sentry-explode-params*, type joint-exploder-static-params
|
|
(define *comb-sentry-explode-params*
|
|
(new 'static 'joint-exploder-static-params
|
|
:joints (new 'static 'boxed-array :type joint-exploder-static-joint-params
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1)
|
|
(new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1)
|
|
)
|
|
:collide-spec (collide-spec backgnd)
|
|
:art-level #f
|
|
)
|
|
)
|
|
|
|
;; definition for method 11 of type comb-sentry
|
|
;; INFO: Used lq/sq
|
|
(defmethod init-from-entity! ((this comb-sentry) (arg0 entity-actor))
|
|
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
|
(set! (-> s4-0 penetrated-by) (penetrate))
|
|
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0)))
|
|
(set! (-> s4-0 total-prims) (the-as uint 2))
|
|
(set! (-> s3-0 prim-core action) (collide-action solid))
|
|
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 61440.0)
|
|
(set! (-> s4-0 root-prim) s3-0)
|
|
)
|
|
(let ((a0-5 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0))))
|
|
(set! (-> a0-5 prim-core action) (collide-action solid))
|
|
(set! (-> a0-5 transform-index) 0)
|
|
)
|
|
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
|
|
(let ((v1-9 (-> s4-0 root-prim)))
|
|
(set! (-> s4-0 backup-collide-as) (-> v1-9 prim-core collide-as))
|
|
(set! (-> s4-0 backup-collide-with) (-> v1-9 prim-core collide-with))
|
|
)
|
|
(set! (-> this root) s4-0)
|
|
)
|
|
(process-drawable-from-entity! this arg0)
|
|
(initialize-skeleton
|
|
this
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-comb-sentry" (the-as (pointer level) #f)))
|
|
(the-as pair 0)
|
|
)
|
|
(logclear! (-> this mask) (process-mask actor-pause))
|
|
(set! (-> this up-dir quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad))
|
|
(set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0))
|
|
(if (nonzero? (-> this path))
|
|
(logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text))
|
|
)
|
|
(set! (-> this path-t) 0.0)
|
|
(set! (-> this path-dt) 0.0)
|
|
(set! (-> this hit-points) 6.0)
|
|
(set! (-> this shooting) #f)
|
|
(set! (-> this hum-id) (new 'static 'sound-id))
|
|
(set! (-> this should-attack) #f)
|
|
(set! (-> this exploder-params) *comb-sentry-explode-params*)
|
|
(set! (-> this exploder-skel)
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-comb-sentry-explode" (the-as (pointer level) #f)))
|
|
)
|
|
(set! (-> this exploder-anim) (the-as uint 5))
|
|
(set! (-> this draw lod-set lod 0 dist) 1228800.0)
|
|
(set! (-> this draw lod-set lod 1 dist) 1232896.0)
|
|
(set! (-> this player-vehicle) (the-as handle #f))
|
|
(set! (-> this target-dist) 4096000.0)
|
|
(set-cspec! this)
|
|
(go (method-of-object this idle))
|
|
)
|
|
|
|
;; definition for method 33 of type comb-sentry
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod set-cspec! ((this comb-sentry))
|
|
(iterate-prims
|
|
(-> this root)
|
|
(lambda ((arg0 collide-shape-prim))
|
|
(set! (-> arg0 prim-core collide-with) (collide-spec
|
|
backgnd
|
|
jak
|
|
bot
|
|
crate
|
|
civilian
|
|
enemy
|
|
obstacle
|
|
vehicle-sphere
|
|
hit-by-player-list
|
|
hit-by-others-list
|
|
player-list
|
|
collectable
|
|
pusher
|
|
shield
|
|
vehicle-sphere-no-probe
|
|
)
|
|
)
|
|
(set! (-> arg0 prim-core collide-as) (collide-spec obstacle vehicle-sphere vehicle-mesh))
|
|
(none)
|
|
)
|
|
)
|
|
(let ((v1-3 (-> this root root-prim)))
|
|
(mem-copy!
|
|
(the-as pointer (-> (the-as collide-shape-prim-group v1-3) child 0 local-sphere))
|
|
(the-as pointer (new 'static 'vector :y 6144.0 :w 40960.0))
|
|
16
|
|
)
|
|
)
|
|
(update-transforms (-> this root))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for symbol *comb-sentry-glow-template*, type sprite-glow-data
|
|
(define *comb-sentry-glow-template* (new 'static 'sprite-glow-data
|
|
:position (new 'static 'vector :w 20480.0)
|
|
:size-probe 655.36
|
|
:z-offset 819.2
|
|
:size-y 20480.0
|
|
:color (new 'static 'rgbaf :x 255.0 :y 64.0 :z 64.0 :w 16.0)
|
|
:fade-a -0.0000122044
|
|
:fade-b 8.997864
|
|
:tex-id (new 'static 'texture-id :index #xd :page #x4)
|
|
)
|
|
)
|
|
|
|
;; definition for symbol *comb-sentry-glow-ring-template*, type sprite-glow-data
|
|
(define *comb-sentry-glow-ring-template* (new 'static 'sprite-glow-data
|
|
:position (new 'static 'vector :w 20480.0)
|
|
:size-probe 655.36
|
|
:z-offset 819.2
|
|
:size-y 20480.0
|
|
:color (new 'static 'rgbaf :x 255.0 :w 16.0)
|
|
:fade-a -0.0000122044
|
|
:fade-b 8.997864
|
|
:tex-id (new 'static 'texture-id :index #x9c :page #x4)
|
|
)
|
|
)
|
|
|
|
;; definition for method 39 of type comb-sentry
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod draw-glow-sprites ((this comb-sentry))
|
|
(let ((gp-0 (new 'stack-no-clear 'comb-sentry-stack-var1)))
|
|
(matrix<-transformq! (-> gp-0 mat) (the-as transformq (-> this root trans)))
|
|
(let ((s5-0 (new 'static 'inline-array vector 3
|
|
(new 'static 'vector :z 30720.0 :w 1.0)
|
|
(new 'static 'vector :x 9420.8 :y 9420.8 :z 24985.6 :w 1.0)
|
|
(new 'static 'vector :x -10240.0 :z 24576.0 :w 1.0)
|
|
)
|
|
)
|
|
(s4-0 *comb-sentry-glow-template*)
|
|
(s3-0 *comb-sentry-glow-ring-template*)
|
|
)
|
|
(dotimes (s2-0 3)
|
|
(quad-copy! (the-as pointer (-> gp-0 glow)) (the-as pointer s4-0) 4)
|
|
(vector-matrix*! (-> gp-0 vec) (-> s5-0 s2-0) (-> gp-0 mat))
|
|
(let* ((v1-2 (-> gp-0 glow))
|
|
(a1-3 (-> gp-0 vec))
|
|
(f0-0 (-> v1-2 position w))
|
|
)
|
|
(set! (-> v1-2 position quad) (-> a1-3 quad))
|
|
(set! (-> v1-2 position w) f0-0)
|
|
)
|
|
0
|
|
(set! (-> gp-0 glow rot-angle) (* 182.04445 (rand-vu-float-range -17.0 -13.0)))
|
|
(set! (-> gp-0 glow color w) (* 4.0 (rand-vu-float-range 16.0 18.0)))
|
|
(add! *simple-sprite-system* (-> gp-0 glow))
|
|
(quad-copy! (the-as pointer (-> gp-0 glow)) (the-as pointer s3-0) 4)
|
|
(vector-matrix*! (-> gp-0 vec) (-> s5-0 s2-0) (-> gp-0 mat))
|
|
(let* ((v1-10 (-> gp-0 glow))
|
|
(a1-10 (-> gp-0 vec))
|
|
(f0-5 (-> v1-10 position w))
|
|
)
|
|
(set! (-> v1-10 position quad) (-> a1-10 quad))
|
|
(set! (-> v1-10 position w) f0-5)
|
|
)
|
|
0
|
|
(set! (-> gp-0 glow rot-angle) (* 182.04445 (rand-vu-float-range -17.0 -13.0)))
|
|
(set! (-> gp-0 glow color w) (* 0.5 (rand-vu-float-range 16.0 18.0)))
|
|
(add! *simple-sprite-system* (-> gp-0 glow))
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 38 of type comb-sentry
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch (pointer process) vs (pointer comb-sentry-shot).
|
|
(defmethod fire-shot ((this comb-sentry))
|
|
(sound-play "sentry-fire")
|
|
(let ((s5-1 (new 'stack-no-clear 'comb-sentry-stack-var0)))
|
|
(set! (-> s5-1 byte0) 0)
|
|
(let* ((v1-1 (-> s5-1 mat))
|
|
(a3-1 (-> this node-list data 0 bone transform))
|
|
(a0-5 (-> a3-1 rvec quad))
|
|
(a1-1 (-> a3-1 uvec quad))
|
|
(a2-1 (-> a3-1 fvec quad))
|
|
(a3-2 (-> a3-1 trans quad))
|
|
)
|
|
(set! (-> v1-1 rvec quad) a0-5)
|
|
(set! (-> v1-1 uvec quad) a1-1)
|
|
(set! (-> v1-1 fvec quad) a2-1)
|
|
(set! (-> v1-1 trans quad) a3-2)
|
|
)
|
|
(let ((v1-2 (new 'static 'inline-array vector 1 (new 'static 'vector :z 14336.0 :w 1.0))))
|
|
(vector-matrix*! (-> s5-1 vec2) (-> v1-2 (-> s5-1 byte0)) (-> s5-1 mat))
|
|
)
|
|
0
|
|
(set! (-> s5-1 vec3 quad) (-> s5-1 mat fvec quad))
|
|
(vector-float*! (-> s5-1 vec4) (-> s5-1 vec3) 2048000.0)
|
|
(set! (-> s5-1 params ent) (-> this entity))
|
|
(set! (-> s5-1 params charge) 1.0)
|
|
(set! (-> s5-1 params options) (projectile-options))
|
|
(logclear! (-> s5-1 params options) (projectile-options po14 po15 po16))
|
|
(set! (-> s5-1 params pos quad) (-> s5-1 vec2 quad))
|
|
(set! (-> s5-1 params vel quad) (-> s5-1 vec4 quad))
|
|
(set! (-> s5-1 params notify-handle) (the-as handle #f))
|
|
(set! (-> s5-1 params owner-handle) (the-as handle #f))
|
|
(set! (-> s5-1 params target-handle) (the-as handle #f))
|
|
(set! (-> s5-1 params target-pos quad) (the-as uint128 0))
|
|
(set! (-> s5-1 params ignore-handle) (process->handle this))
|
|
(let* ((v1-17 *game-info*)
|
|
(a0-20 (+ (-> v1-17 attack-id) 1))
|
|
)
|
|
(set! (-> v1-17 attack-id) a0-20)
|
|
(set! (-> s5-1 params attack-id) a0-20)
|
|
)
|
|
(set! (-> s5-1 params timeout) (seconds 4))
|
|
(the-as
|
|
(pointer comb-sentry-shot)
|
|
(spawn-projectile comb-sentry-shot (-> s5-1 params) this *default-dead-pool*)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 31 of type comb-sentry
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod stop-hum ((this comb-sentry))
|
|
(sound-stop (-> this hum-id))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 10 of type comb-sentry
|
|
(defmethod deactivate ((this comb-sentry))
|
|
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
|
|
(stop-hum this)
|
|
(call-parent-method this)
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 32 of type comb-sentry
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod sentry-post ((this comb-sentry))
|
|
(local-vars (v1-25 float))
|
|
(rlet ((acc :class vf)
|
|
(vf0 :class vf)
|
|
(vf1 :class vf)
|
|
(vf2 :class vf)
|
|
)
|
|
(init-vf0-vector)
|
|
(if (and (= (-> this player-vehicle) #f) *target* (focus-test? *target* pilot-riding))
|
|
(set! (-> this player-vehicle) (-> *target* pilot vehicle))
|
|
)
|
|
(set! (-> this should-attack) #f)
|
|
(let ((s5-0 (the-as process-focusable (handle->process (-> this player-vehicle)))))
|
|
(when s5-0
|
|
(if (and (not (focus-test? s5-0 dead))
|
|
(not (focus-test? s5-0 ignore))
|
|
(let ((f0-0 (vector-vector-distance-squared (-> s5-0 root trans) (-> this root trans)))
|
|
(f1-0 409600.0)
|
|
)
|
|
(< f0-0 (* f1-0 f1-0))
|
|
)
|
|
)
|
|
(set! (-> this should-attack) #t)
|
|
)
|
|
(let ((v1-23 (new 'stack-no-clear 'matrix)))
|
|
(set! (-> v1-23 rvec quad) (-> s5-0 root trans quad))
|
|
(set! (-> v1-23 uvec quad) (-> s5-0 root transv quad))
|
|
(vector+float*! (-> this target-pos) (-> v1-23 rvec) (-> v1-23 uvec) 0.1)
|
|
(set! (-> v1-23 fvec quad) (-> s5-0 node-list data 0 bone transform fvec quad))
|
|
(vector-! (-> v1-23 trans) (-> this root trans) (-> v1-23 rvec))
|
|
(set! (-> this target-dist) (vector-dot (-> v1-23 fvec) (-> v1-23 trans)))
|
|
(let* ((v1-24 (-> v1-23 trans))
|
|
(f0-4 409600.0)
|
|
(f0-6 (* f0-4 f0-4))
|
|
)
|
|
(.lvf vf1 (&-> v1-24 quad))
|
|
(.add.w.vf vf2 vf0 vf0 :mask #b1)
|
|
(.mul.vf vf1 vf1 vf1)
|
|
(.mul.x.vf acc vf2 vf1 :mask #b1)
|
|
(.add.mul.y.vf acc vf2 vf1 acc :mask #b1)
|
|
(.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1)
|
|
(.mov v1-25 vf1)
|
|
(if (< f0-6 v1-25)
|
|
(set! (-> this target-dist) 4096000.0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(if (not (-> this should-attack))
|
|
(set-time! (-> this in-range-time))
|
|
)
|
|
(set! (-> this path-dt) (* 0.00024414062 (- 163840.0 (-> this target-dist))))
|
|
(set! (-> this path-dt) (fmax -8.0 (fmin 8.0 (-> this path-dt))))
|
|
(+! (-> this path-t) (* (-> this path-dt) (seconds-per-frame)))
|
|
(set! (-> this path-t) (fmax 0.0 (fmin (-> this path-t) (get-num-segments (-> this path)))))
|
|
(if (= (-> this path-t) (get-num-segments (-> this path)))
|
|
(go-explode this)
|
|
)
|
|
(get-point-in-path! (-> this path) (-> this root trans) (-> this path-t) 'interp)
|
|
(let ((s5-1 (new 'stack-no-clear 'inline-array 'vector 5)))
|
|
(vector-! (-> s5-1 0) (-> this target-pos) (-> this root trans))
|
|
(vector-normalize! (-> s5-1 0) 1.0)
|
|
(set! (-> s5-1 1 quad) (-> this up-dir quad))
|
|
(set! (-> s5-1 4 x) (vector-dot (-> s5-1 0) (-> s5-1 1)))
|
|
(vector+float*! (-> s5-1 1) (-> s5-1 1) (-> s5-1 0) (- (-> s5-1 4 x)))
|
|
(vector-normalize! (-> s5-1 1) 1.0)
|
|
(set! (-> this up-dir quad) (-> s5-1 1 quad))
|
|
(forward-up-nopitch->quaternion (the-as quaternion (-> s5-1 2)) (-> s5-1 0) (-> s5-1 1))
|
|
(+! (-> this angle) (* (-> this spin) (seconds-per-frame)))
|
|
(set! (-> this angle) (the float (sar (shl (the int (-> this angle)) 48) 48)))
|
|
(quaternion-axis-angle! (the-as quaternion (-> s5-1 3)) 0.0 0.0 1.0 (-> this angle))
|
|
(quaternion*! (the-as quaternion (-> s5-1 2)) (the-as quaternion (-> s5-1 2)) (the-as quaternion (-> s5-1 3)))
|
|
(quaternion-copy! (-> this root quat) (the-as quaternion (-> s5-1 2)))
|
|
)
|
|
(cond
|
|
((-> this shooting)
|
|
(seek! (-> this spin) 131072.0 (* 262144.0 (seconds-per-frame)))
|
|
(when (time-elapsed? (-> this shot-time) (seconds 0.2))
|
|
(set-time! (-> this shot-time))
|
|
(fire-shot this)
|
|
)
|
|
(when (or (time-elapsed? (-> this attack-time) (seconds 1)) (not (-> this should-attack)))
|
|
(set-time! (-> this attack-time))
|
|
(set! (-> this shooting) #f)
|
|
)
|
|
)
|
|
(else
|
|
(seek! (-> this spin) 32768.0 (* 65536.0 (seconds-per-frame)))
|
|
(when (and (time-elapsed? (-> this attack-time) (seconds 3))
|
|
(time-elapsed? (-> this in-range-time) (seconds 4))
|
|
(-> this should-attack)
|
|
)
|
|
(set-time! (-> this attack-time))
|
|
(set! (-> this shooting) #t)
|
|
)
|
|
)
|
|
)
|
|
(cond
|
|
((-> this should-attack)
|
|
(if (zero? (-> this hum-id))
|
|
(set! (-> this hum-id) (new-sound-id))
|
|
)
|
|
(sound-play "sentry-engine" :id (-> this hum-id))
|
|
)
|
|
(else
|
|
(when (nonzero? (-> this hum-id))
|
|
(sound-stop (-> this hum-id))
|
|
(set! (-> this hum-id) (new 'static 'sound-id))
|
|
0
|
|
)
|
|
)
|
|
)
|
|
(transform-post)
|
|
(draw-glow-sprites this)
|
|
0
|
|
(none)
|
|
)
|
|
)
|
|
|
|
;; definition for method 34 of type comb-sentry
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod go-explode ((this comb-sentry))
|
|
(logclear! (-> this mask) (process-mask actor-pause))
|
|
(let ((v1-3 (-> this root root-prim)))
|
|
(set! (-> v1-3 prim-core collide-as) (collide-spec))
|
|
(set! (-> v1-3 prim-core collide-with) (collide-spec))
|
|
)
|
|
0
|
|
(logior! (-> this root penetrated-by) (penetrate vehicle))
|
|
(go (method-of-object this explode))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 27 of type comb-sentry
|
|
(defmethod get-inv-mass ((this comb-sentry))
|
|
0.125
|
|
)
|
|
|
|
;; definition for method 35 of type comb-sentry
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod set-attack-vel! ((this comb-sentry) (arg0 vector))
|
|
(set! (-> this attack-vel quad) (-> arg0 quad))
|
|
(if (< 81920.0 (vector-length (-> this attack-vel)))
|
|
(vector-normalize! (-> this attack-vel) 81920.0)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 36 of type comb-sentry
|
|
(defmethod on-attack ((this comb-sentry) (arg0 process) (arg1 attack-info) (arg2 object))
|
|
(vector-reset! (-> this attack-vel))
|
|
(let ((a1-1 (new 'stack-no-clear 'vector))
|
|
(f30-0 1.0)
|
|
)
|
|
(vector-reset! a1-1)
|
|
(when (logtest? (attack-mask attacker-velocity) (-> arg1 mask))
|
|
(vector-float*! a1-1 (-> arg1 attacker-velocity) 1.0)
|
|
(set-attack-vel! this a1-1)
|
|
)
|
|
(if (logtest? (attack-mask damage) (-> arg1 mask))
|
|
(set! f30-0 (-> arg1 damage))
|
|
)
|
|
(sound-play "impact-med")
|
|
(set! (-> this hit-points) (- (-> this hit-points) f30-0))
|
|
)
|
|
(if (< (-> this hit-points) 0.0)
|
|
(go-explode this)
|
|
)
|
|
#t
|
|
)
|
|
|
|
;; definition for method 37 of type comb-sentry
|
|
(defmethod on-impact ((this comb-sentry) (arg0 rigid-body-impact))
|
|
(let ((a1-1 (new 'stack-no-clear 'vector)))
|
|
(vector-float*! a1-1 (-> arg0 normal) (-> arg0 impulse))
|
|
(set-attack-vel! this a1-1)
|
|
)
|
|
(when (< 286720.0 (-> arg0 impulse))
|
|
(go-explode this)
|
|
#t
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (comb-sentry)
|
|
:virtual #t
|
|
:trans (behavior ()
|
|
(set! (-> self path-dt) 0.0)
|
|
(go-virtual path-follow)
|
|
)
|
|
:code (behavior ()
|
|
(until #f
|
|
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
:post (behavior ()
|
|
(sentry-post self)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate path-follow (comb-sentry)
|
|
:virtual #t
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('impact-impulse)
|
|
(let ((a1-1 (-> block param 0)))
|
|
(on-impact self (the-as rigid-body-impact a1-1))
|
|
)
|
|
)
|
|
(('attack)
|
|
(let ((s4-0 (the-as attack-info (-> block param 1))))
|
|
(get-penetrate-using-from-attack-event (the-as process-drawable proc) block)
|
|
(when (!= (-> s4-0 id) (-> self incoming-attack-id))
|
|
(set! (-> self incoming-attack-id) (the-as int (-> s4-0 id)))
|
|
(on-attack self proc s4-0 (-> block param 0))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:code (behavior ()
|
|
(until #f
|
|
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
:post (behavior ()
|
|
(sentry-post self)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate explode (comb-sentry)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(logior! (-> self draw status) (draw-control-status no-draw))
|
|
)
|
|
:code (behavior ()
|
|
(stop-hum self)
|
|
(sound-play "sentry-expl")
|
|
(cond
|
|
((logtest? (-> *part-group-id-table* 217 flags) (sp-group-flag sp13))
|
|
(set! (-> *launch-matrix* trans quad) (-> self root trans quad))
|
|
(part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 217))
|
|
)
|
|
(else
|
|
(set! (-> *launch-matrix* trans quad) (-> self root trans quad))
|
|
(part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 217))
|
|
)
|
|
)
|
|
(let ((gp-3 (new 'stack 'joint-exploder-tuning (the-as uint 0))))
|
|
(set! (-> gp-3 duration) (seconds 4))
|
|
(set! (-> gp-3 gravity) -163840.0)
|
|
(set! (-> gp-3 rot-speed) 10.0)
|
|
(vector+!
|
|
(-> gp-3 fountain-rand-transv-lo)
|
|
(new 'static 'vector :x -245760.0 :y 245760.0 :z -245760.0 :w 1.0)
|
|
(-> self attack-vel)
|
|
)
|
|
(vector+!
|
|
(-> gp-3 fountain-rand-transv-hi)
|
|
(new 'static 'vector :x 245760.0 :y 245760.0 :z 245760.0 :w 1.0)
|
|
(-> self attack-vel)
|
|
)
|
|
(process-spawn
|
|
joint-exploder
|
|
(-> self exploder-skel)
|
|
(-> self exploder-anim)
|
|
gp-3
|
|
(-> self exploder-params)
|
|
:name "joint-exploder"
|
|
:to self
|
|
:unk 0
|
|
)
|
|
)
|
|
(let ((gp-4 (current-time)))
|
|
(until (time-elapsed? gp-4 (seconds 2))
|
|
(suspend)
|
|
)
|
|
)
|
|
(cleanup-for-death self)
|
|
)
|
|
:post #f
|
|
)
|
|
|
|
;; definition of type comb-sentinel
|
|
(deftype comb-sentinel (comb-sentry)
|
|
()
|
|
)
|
|
|
|
;; definition for method 3 of type comb-sentinel
|
|
(defmethod inspect ((this comb-sentinel))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type comb-sentry inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type rail-sentinel
|
|
(deftype rail-sentinel (comb-sentry)
|
|
()
|
|
)
|
|
|
|
;; definition for method 3 of type rail-sentinel
|
|
(defmethod inspect ((this rail-sentinel))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type comb-sentry inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
0
|
|
|
|
|
|
|
|
|