Files
jak-project/test/decompiler/reference/jak3/levels/stadium/rubble-attack_REF.gc
T
water111 3ee2b4423c [decompiler] Cleanup for Jak 3 (#3845)
This PR does a few cleanups:
- improve method names/comments/flags for `enemy.gc` and a few other
files
- fix `new-stack-matrix0` not working for jak 3
- add `matrix-copy!` detection for jak 3
- add `vector-copy!` detection

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
2025-01-20 10:31:29 -05:00

848 lines
32 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition of type rub-missile
(deftype rub-missile (metalhead-grenade-shot)
()
)
;; definition for method 3 of type rub-missile
(defmethod inspect ((this rub-missile))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type metalhead-grenade-shot inspect)))
(t9-0 this)
)
(label cfg-4)
this
)
;; failed to figure out what this is:
(defstate impact (rub-missile)
:virtual #t
:enter (behavior ()
(let ((t9-0 (-> (method-of-type metalhead-grenade-shot impact) enter)))
(if t9-0
(t9-0)
)
)
(send-event (handle->process (-> self desired-target)) 'die)
)
)
;; definition for method 39 of type rub-missile
;; WARN: Return type mismatch object vs none.
(defmethod projectile-method-39 ((this rub-missile))
(let ((t9-0 (method-of-type metalhead-grenade-shot projectile-method-39)))
(t9-0 this)
)
(send-event (handle->process (-> this desired-target)) 'update (-> this root trans))
(none)
)
;; definition for method 26 of type rub-missile
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod projectile-method-26 ((this rub-missile))
(cond
((logtest? (-> *part-group-id-table* 1021 flags) (sp-group-flag sp13))
(vector-copy! (-> *launch-matrix* trans) (-> this root trans))
(part-tracker-spawn
part-tracker-subsampler
:to this
:group (-> *part-group-id-table* 1021)
:duration (seconds 0.167)
)
)
(else
(vector-copy! (-> *launch-matrix* trans) (-> this root trans))
(part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 1021) :duration (seconds 0.167))
)
)
0
(none)
)
;; definition for method 28 of type rub-missile
;; WARN: Return type mismatch int vs none.
(defmethod play-impact-sound ((this rub-missile) (arg0 projectile-options))
(case arg0
(((projectile-options po0))
(sound-play "firebomb")
)
(((projectile-options po0 po1))
(let ((f0-0 (vector-vector-distance-squared (-> this root trans) (-> this desired-target-pos)))
(f1-0 614400.0)
)
(when (< f0-0 (* f1-0 f1-0))
(let ((a0-6 (static-sound-spec "incoming" :group 0 :volume 0.0)))
(set! (-> a0-6 volume) 1024)
(sound-play-by-spec a0-6 (-> this sound-id) (-> this root trans))
)
)
)
)
)
0
(none)
)
;; definition for method 31 of type rub-missile
;; WARN: Return type mismatch sound-id vs none.
(defmethod init-proj-settings! ((this rub-missile))
(set! (-> this attack-mode) 'eco-yellow)
(set! (-> this blast-radius) 40960.0)
(set! (-> this max-speed) 245760.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) 409600.0)
(set! (-> this root dynam gravity-length) 409600.0)
(set! (-> this root dynam gravity-max) 409600.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 (-> *part-group-id-table* 1020) this))
(set! (-> this sound-id) (new-sound-id))
(none)
)
;; definition of type dm-missile-target
(deftype dm-missile-target (process-drawable)
((ring-jmod joint-mod 2)
(ring-timer time-frame)
(blink-timer time-frame)
(target-sound-id sound-id)
(warn-sound-id sound-id)
)
(:state-methods
idle
lock
)
)
;; definition for method 3 of type dm-missile-target
(defmethod inspect ((this dm-missile-target))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 this)
)
(format #t "~2Tring-jmod[2] @ #x~X~%" (-> this ring-jmod))
(format #t "~2Tring-timer: ~D~%" (-> this ring-timer))
(format #t "~2Tblink-timer: ~D~%" (-> this blink-timer))
(format #t "~2Ttarget-sound-id: ~D~%" (-> this target-sound-id))
(format #t "~2Twarn-sound-id: ~D~%" (-> this warn-sound-id))
(label cfg-4)
this
)
;; failed to figure out what this is:
(defskelgroup skel-dm-missile-target dm-missile-target dm-missile-target-lod0-jg dm-missile-target-idle-ja
((dm-missile-target-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0.5 84)
:longest-edge (meters 80)
:shadow dm-missile-target-shadow-mg
:origin-joint-index 4
:shadow-joint-index 5
)
;; definition for function dm-missile-target-post
(defbehavior dm-missile-target-post dm-missile-target ()
(ja-post)
(none)
)
;; definition for function dm-missile-target-handler
;; INFO: Used lq/sq
(defbehavior dm-missile-target-handler dm-missile-target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(local-vars (v0-0 object))
(case arg2
(('update-trans-only)
(set! v0-0 (-> self root trans))
(set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> arg3 param 0)) quad))
v0-0
)
(('update)
(let ((gp-0 (the-as object (-> arg3 param 0))))
(let* ((f0-1 (- (-> (the-as vector gp-0) y) (-> self root trans y)))
(f0-2 (lerp-scale 1.5 2.0 f0-1 0.0 614400.0))
)
(set-vector! (-> self root scale) f0-2 1.0 f0-2 1.0)
)
(let ((f0-4 (vector-vector-distance-squared (-> self root trans) (the-as vector gp-0)))
(f1-2 409600.0)
)
(when (< f0-4 (* f1-2 f1-2))
(if (not (and (-> self next-state) (= (-> self next-state name) 'lock)))
(go-virtual lock)
)
(when (time-elapsed? (-> self blink-timer) (seconds 0.05))
(if (logtest? (-> self draw status) (draw-control-status no-draw))
(send-event self 'on)
(send-event self 'off)
)
(set-time! (-> self blink-timer))
)
)
)
)
0
)
(('on)
(let ((v1-35 (-> self draw shadow-ctrl)))
(logclear! (-> v1-35 settings flags) (shadow-flags disable-draw))
)
0
(set! v0-0 (logclear (-> self draw status) (draw-control-status no-draw)))
(set! (-> self draw status) (the-as draw-control-status v0-0))
v0-0
)
(('off)
(let ((v1-40 (-> self draw shadow-ctrl)))
(logior! (-> v1-40 settings flags) (shadow-flags disable-draw))
)
0
(set! v0-0 (logior (-> self draw status) (draw-control-status no-draw)))
(set! (-> self draw status) (the-as draw-control-status v0-0))
v0-0
)
(('spotlight-on)
(let ((v1-46 (-> self draw shadow-ctrl)))
(logclear! (-> v1-46 settings flags) (shadow-flags disable-draw))
)
0
)
(('spotlight-off)
(let ((v1-48 (-> self draw shadow-ctrl)))
(logior! (-> v1-48 settings flags) (shadow-flags disable-draw))
)
0
)
(('lock)
(go-virtual lock)
)
(('unlock)
(go-virtual idle)
)
(('die)
(if (not (-> *setting-control* cam-current entity-name))
(activate! *camera-smush-control* 2048.0 30 150 1.0 0.8 (-> *display* camera-clock))
)
(go empty-state)
)
)
)
;; failed to figure out what this is:
(defstate idle (dm-missile-target)
:virtual #t
:event dm-missile-target-handler
:enter (behavior ()
(set! (-> self ring-timer) 0)
(dotimes (v1-0 2)
(set! (-> self ring-jmod v1-0 twist z) (the-as float #t))
)
)
:exit (behavior ()
(if (nonzero? (-> self target-sound-id))
(sound-stop (-> self target-sound-id))
)
)
:trans (behavior ()
(if (nonzero? (-> self target-sound-id))
(sound-play "ruins-target" :id (-> self target-sound-id))
)
)
:code (behavior ()
(ja-no-eval :group! dm-missile-target-idle-ja :num! zero)
(sleep-code)
)
:post (behavior ()
(when (< (-> self ring-timer) (current-time))
(let ((v1-2 (rand-vu-int-range 0 7)))
(dotimes (a0-3 2)
(if (logand (ash 1 a0-3) v1-2)
(set! (-> self ring-jmod a0-3 twist y) (* -1.0 (-> self ring-jmod a0-3 twist y)))
)
)
)
(set! (-> self ring-timer) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.6 1.8)))))
)
(dm-missile-target-post)
)
)
;; failed to figure out what this is:
(defstate lock (dm-missile-target)
:virtual #t
:event dm-missile-target-handler
:enter (behavior ()
(dotimes (v1-0 2)
(set! (-> self ring-jmod v1-0 twist z) (the-as float #f))
)
)
:exit (behavior ()
(if (nonzero? (-> self warn-sound-id))
(sound-stop (-> self warn-sound-id))
)
)
:trans (behavior ()
(if (nonzero? (-> self warn-sound-id))
(sound-play "target-warn" :id (-> self warn-sound-id))
)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.04))
(ja-no-eval :group! dm-missile-target-idle-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(sleep-code)
)
:post dm-missile-target-post
)
;; definition for method 7 of type dm-missile-target
;; WARN: Return type mismatch process-drawable vs dm-missile-target.
(defmethod relocate ((this dm-missile-target) (offset int))
(dotimes (v1-0 2)
(if (nonzero? (-> this ring-jmod v1-0))
(&+! (-> this ring-jmod v1-0) offset)
)
)
(the-as dm-missile-target ((method-of-type process-drawable relocate) this offset))
)
;; definition for method 10 of type dm-missile-target
(defmethod deactivate ((this dm-missile-target))
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
(if (nonzero? (-> this target-sound-id))
(sound-stop (-> this target-sound-id))
)
(if (nonzero? (-> this warn-sound-id))
(sound-stop (-> this warn-sound-id))
)
((method-of-type process-drawable deactivate) this)
(none)
)
;; definition for symbol *dm-missile-target-shadow-control*, type shadow-control
(define *dm-missile-target-shadow-control*
(new 'static 'shadow-control :settings (new 'static 'shadow-settings
:center (new 'static 'vector :w (the-as float #x9a))
:shadow-dir (new 'static 'vector :y -1.0 :w 614400.0)
:bot-plane (new 'static 'plane :y 1.0 :w 163840.0)
:top-plane (new 'static 'plane :y 1.0 :w -163840.0)
:shadow-type 2
)
)
)
;; definition for function dm-missile-target-init-by-other
;; INFO: Used lq/sq
(defbehavior dm-missile-target-init-by-other dm-missile-target ((arg0 vector))
(set! (-> self root) (new 'process 'trsqv))
(vector-copy! (-> self root trans) arg0)
(initialize-skeleton
self
(the-as skeleton-group (art-group-get-by-name *level* "skel-dm-missile-target" (the-as (pointer level) #f)))
(the-as pair 0)
)
(setup-masks (-> self draw) 0 2)
(vector+! (-> self root trans) (-> self root trans) (new 'static 'vector :y 81920.0 :w 1.0))
(set-vector! (-> self root scale) 2.0 1.0 2.0 1.0)
(set! (-> self ring-jmod 0) (the-as joint-mod (new 'process 'joint-mod-spinner self 5 *y-vector* 49152.0)))
(set! (-> self ring-jmod 1) (the-as joint-mod (new 'process 'joint-mod-spinner self 6 *y-vector* -32768.0)))
(set! (-> self draw shadow-ctrl) *dm-missile-target-shadow-control*)
(set! (-> self target-sound-id) (new-sound-id))
(set! (-> self warn-sound-id) (new-sound-id))
(ja-no-eval :group! dm-missile-target-idle-ja :num! zero)
(ja-post)
(set-setting! 'highlight-color #f 0.0 #x200000ff)
(go-virtual idle)
)
;; definition for symbol *missile-spawners-all*, type (array (array vector))
(define *missile-spawners-all*
(the-as (array (array vector)) (new 'static 'boxed-array :type array
(new 'static 'boxed-array :type vector
(new 'static 'vector :x -1264012.9 :y 171088.28 :z -1945632.4 :w 1.0)
(new 'static 'vector :x -1372659.8 :y 93930.7 :z -183979.22 :w 1.0)
(new 'static 'vector :x -2812845.8 :y 221565.34 :z -914960.0 :w 1.0)
)
(new 'static 'boxed-array :type vector
(new 'static 'vector :x -2812845.8 :y 221565.34 :z -914960.0 :w 1.0)
(new 'static 'vector :x -1968271.0 :y 239602.48 :z 1218449.0 :w 1.0)
)
(new 'static 'boxed-array :type vector
(new 'static 'vector :x -2812845.8 :y 221565.34 :z -914960.0 :w 1.0)
(new 'static 'vector :x -1716713.5 :y 160845.83 :z -1615964.1 :w 1.0)
(new 'static 'vector :x -1968271.0 :y 239602.48 :z 1218449.0 :w 1.0)
)
(new 'static 'boxed-array :type vector
(new 'static 'vector :x -963790.0 :y 92553.22 :z -1338117.4 :w 1.0)
(new 'static 'vector :x -1716713.5 :y 160845.83 :z -1615964.1 :w 1.0)
(new 'static 'vector :x -1968271.0 :y 239602.48 :z 1218449.0 :w 1.0)
)
(new 'static 'boxed-array :type vector
(new 'static 'vector :x 583820.9 :y 128227.734 :z -692007.3 :w 1.0)
(new 'static 'vector :x -85653.914 :y 159268.86 :z -1789697.6 :w 1.0)
(new 'static 'vector :x 924756.8 :y 184549.38 :z -1444707.5 :w 1.0)
)
(new 'static 'boxed-array :type vector
(new 'static 'vector :x 924756.8 :y 184549.38 :z -1444707.5 :w 1.0)
(new 'static 'vector :x 322749.66 :y 187547.64 :z 211919.67 :w 1.0)
)
(new 'static 'boxed-array :type vector
(new 'static 'vector :x 671323.3 :y 146283.31 :z -943431.25 :w 1.0)
(new 'static 'vector :x -118573.47 :y 198613.4 :z 214160.6 :w 1.0)
(new 'static 'vector :x -1405265.1 :y 91194.984 :z -253249.53 :w 1.0)
(new 'static 'vector :x -1092076.8 :y 207061.4 :z 597792.75 :w 1.0)
)
(new 'static 'boxed-array :type vector
(new 'static 'vector :x -1277521.9 :y 185948.16 :z -200834.25 :w 1.0)
(new 'static 'vector :x 358128.44 :y 221917.6 :z 232636.83 :w 1.0)
)
(new 'static 'boxed-array :type vector
(new 'static 'vector :x -1675861.2 :y 372983.4 :z 504688.22 :w 1.0)
(new 'static 'vector :x -1653110.8 :y 412161.62 :z 1300128.1 :w 1.0)
(new 'static 'vector :x -1106516.4 :y 187868.36 :z -293120.0 :w 1.0)
)
(new 'static 'boxed-array :type vector
(new 'static 'vector :x -1675861.2 :y 372983.4 :z 504688.22 :w 1.0)
(new 'static 'vector :x -1653110.8 :y 412161.62 :z 1300128.1 :w 1.0)
(new 'static 'vector :x -1106516.4 :y 187868.36 :z -293120.0 :w 1.0)
)
(new 'static 'boxed-array :type vector
(new 'static 'vector :x -1751204.2 :y 355590.97 :z 1353843.5 :w 1.0)
(new 'static 'vector :x 660947.75 :y 210554.88 :z 1027779.8 :w 1.0)
(new 'static 'vector :x 305282.66 :y 246803.66 :z 55287.81 :w 1.0)
)
(new 'static 'boxed-array :type vector
(new 'static 'vector :x 305282.66 :y 246803.66 :z 55287.81 :w 1.0)
(new 'static 'vector :x 2127342.0 :y 443428.47 :z 586409.2 :w 1.0)
)
(new 'static 'boxed-array :type vector
(new 'static 'vector :x 2127342.0 :y 443428.47 :z 586409.2 :w 1.0)
(new 'static 'vector :x 389331.34 :y 210130.12 :z -56164.35 :w 1.0)
(new 'static 'vector :x 1093069.6 :y 132921.75 :z 1745401.9 :w 1.0)
(new 'static 'vector :x 479159.1 :y 66208.56 :z 2266018.5 :w 1.0)
(new 'static 'vector :x 13882.163 :y 203250.89 :z 1256858.4 :w 1.0)
)
)
)
)
;; definition of type rubble-attack-manager
(deftype rubble-attack-manager (task-manager)
((missile-spawners (array vector))
(missile handle)
(missile-target handle)
(missile-timer time-frame)
(vehicle-handle handle)
(king-rider handle)
(talk-timer time-frame)
(played-speeches uint32)
(first-dp-noticed? symbol)
)
(:methods
(spawn-missile (_type_) none)
(rubble-attack-manager-method-33 (_type_) none)
(play-speech (_type_ int) symbol)
)
)
;; definition for method 3 of type rubble-attack-manager
(defmethod inspect ((this rubble-attack-manager))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type task-manager inspect)))
(t9-0 this)
)
(format #t "~2Tmissile-spawners: ~A~%" (-> this missile-spawners))
(format #t "~2Tmissile: ~D~%" (-> this missile))
(format #t "~2Tmissile-target: ~D~%" (-> this missile-target))
(format #t "~2Tmissile-timer: ~D~%" (-> this missile-timer))
(format #t "~2Tvehicle-handle: ~D~%" (-> this vehicle-handle))
(format #t "~2Tking-rider: ~D~%" (-> this king-rider))
(format #t "~2Ttalk-timer: ~D~%" (-> this talk-timer))
(format #t "~2Tplayed-speeches: ~D~%" (-> this played-speeches))
(format #t "~2Tfirst-dp-noticed?: ~A~%" (-> this first-dp-noticed?))
(label cfg-4)
this
)
;; definition for method 34 of type rubble-attack-manager
(defmethod play-speech ((this rubble-attack-manager) (arg0 int))
(let ((s5-1 (logtest? (-> this played-speeches) (ash 1 arg0))))
(when (not s5-1)
(let ((v1-3 arg0))
(cond
((zero? v1-3)
(talker-spawn-func (-> *talker-speech* 340) *entity-pool* (target-pos 0) (the-as region #f))
)
((= v1-3 4)
(talker-spawn-func (-> *talker-speech* 343) *entity-pool* (target-pos 0) (the-as region #f))
)
((= v1-3 5)
(talker-spawn-func (-> *talker-speech* 345) *entity-pool* (target-pos 0) (the-as region #f))
)
((= v1-3 1)
(talker-spawn-func (-> *talker-speech* 346) *entity-pool* (target-pos 0) (the-as region #f))
)
((= v1-3 3)
(talker-spawn-func (-> *talker-speech* 347) *entity-pool* (target-pos 0) (the-as region #f))
)
((= v1-3 2)
(talker-spawn-func (-> *talker-speech* 344) *entity-pool* (target-pos 0) (the-as region #f))
)
((= v1-3 6)
(talker-spawn-func (-> *talker-speech* 341) *entity-pool* (target-pos 0) (the-as region #f))
)
((= v1-3 7)
(talker-spawn-func (-> *talker-speech* 342) *entity-pool* (target-pos 0) (the-as region #f))
)
)
)
(logior! (-> this played-speeches) (ash 1 arg0))
)
(not s5-1)
)
)
;; definition for method 32 of type rubble-attack-manager
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
;; WARN: Function (method 32 rubble-attack-manager) has a return type of none, but the expression builder found a return statement.
(defmethod spawn-missile ((this rubble-attack-manager))
(local-vars (sv-816 vector) (sv-832 (function vector quaternion vector)) (sv-848 vector))
(when *target*
(let ((s5-0 (new 'stack-no-clear 'vector))
(s3-0 (target-pos 0))
(s2-0 (the-as vector #f))
)
(when (-> this missile-spawners)
(let ((f30-0 0.0))
(dotimes (s4-0 (length (-> this missile-spawners)))
(let ((s1-0 (-> this missile-spawners s4-0))
(s0-0 vector-vector-xz-distance)
)
(set! sv-816 s1-0)
(let* ((a1-0 (target-pos 0))
(f28-0 (s0-0 sv-816 a1-0))
)
(when (and (sphere-in-view-frustum? (sphere<-vector+r! (new 'stack-no-clear 'sphere) s1-0 81920.0)) (< f30-0 f28-0))
(set! f30-0 f28-0)
(set! s2-0 s1-0)
)
)
)
)
)
)
(vector+float*! s5-0 s3-0 (-> *target* control transv) 2.0)
(let ((a0-10 (find-nearest-nav-mesh s5-0 (the-as float #x7f800000))))
(if a0-10
(nav-mesh-method-10 a0-10 s5-0 s5-0 (the-as nav-poly #f))
(return #f)
)
)
(set! (-> s5-0 y) (+ 204800.0 (-> s3-0 y) (-> s5-0 y)))
(let ((s4-1 (new 'stack-no-clear 'collide-query)))
(vector-copy! (-> s4-1 start-pos) s5-0)
(set-vector! (-> s4-1 move-dist) 0.0 -409600.0 0.0 1.0)
(let ((v1-21 s4-1))
(set! (-> v1-21 radius) 40.96)
(set! (-> v1-21 collide-with) (collide-spec backgnd obstacle pusher))
(set! (-> v1-21 ignore-process0) #f)
(set! (-> v1-21 ignore-process1) #f)
(set! (-> v1-21 ignore-pat)
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
)
(set! (-> v1-21 action-mask) (collide-action solid))
)
(let ((f0-9 (fill-and-probe-using-line-sphere *collide-cache* s4-1)))
(when (>= f0-9 0.0)
(+! (-> s5-0 y) (* f0-9 (-> s4-1 move-dist y)))
(when (< (- (-> s5-0 y) (-> (target-pos 0) y)) 81920.0)
(let ((s4-2 (new 'stack-no-clear 'traj3d-params))
(s1-1 (new 'stack-no-clear 'vector))
)
(cond
(s2-0
(vector-copy! s1-1 s2-0)
)
(else
(let ((s0-2 s1-1)
(s2-1 vector-normalize!)
)
(set! sv-832 vector-z-quaternion!)
(set! sv-848 s1-1)
(let ((a1-8 (target-rot)))
(vector+! s0-2 s3-0 (s2-1 (sv-832 sv-848 a1-8) 409600.0))
)
)
(+! (-> s1-1 y) 1228800.0)
)
)
(set! (-> s4-2 initial-tilt) 8192.0)
(set! (-> s4-2 gravity) 409600.0)
(vector-copy! (-> s4-2 src) s1-1)
(vector-copy! (-> s4-2 dest) s5-0)
(when (traj3d-calc-initial-velocity-using-tilt s4-2)
(let ((s3-1 (new 'stack-no-clear 'projectile-init-by-other-params)))
(set! (-> this missile-target)
(ppointer->handle (process-spawn dm-missile-target s5-0 :name "dm-missile-target" :to this))
)
(set! (-> s3-1 ent) (-> this entity))
(set! (-> s3-1 charge) 1.0)
(set! (-> s3-1 options) (projectile-options))
(logclear! (-> s3-1 options) (projectile-options po14 po15 po16))
(vector-copy! (-> s3-1 pos) s1-1)
(set! (-> s3-1 notify-handle) (the-as handle #f))
(set! (-> s3-1 owner-handle) (process->handle this))
(set! (-> s3-1 target-handle) (ppointer->handle (-> this missile-target process)))
(vector-copy! (-> s3-1 target-pos) s5-0)
(set! (-> s3-1 ignore-handle) (process->handle this))
(let* ((v1-56 *game-info*)
(a0-50 (+ (-> v1-56 attack-id) 1))
)
(set! (-> v1-56 attack-id) a0-50)
(set! (-> s3-1 attack-id) a0-50)
)
(set! (-> s3-1 timeout) (seconds 4))
(set! (-> s3-1 damage) 4.0)
(logior! (-> s3-1 options) (projectile-options po14))
(set! (-> s3-1 vehicle-damage-factor) 1.0)
(logior! (-> s3-1 options) (projectile-options po15))
(set! (-> s3-1 vehicle-impulse-factor) 7.5)
(logior! (-> s3-1 options) (projectile-options po16))
(vector-copy! (-> s3-1 vel) (-> s4-2 initial-velocity))
(set! (-> this missile) (process->handle (-> (spawn-projectile rub-missile s3-1 this *default-dead-pool*) 0)))
)
)
)
)
)
)
)
)
)
0
(none)
)
;; failed to figure out what this is:
(method-set! rubble-attack-manager 33 (if *debug-segment*
(lambda () 0)
nothing
)
)
;; definition for method 30 of type rubble-attack-manager
;; WARN: disable def twice: 131. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare.
(defmethod taskman-event-handler ((this rubble-attack-manager) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(local-vars (v0-2 object))
(case arg2
(('camera-cut)
(let ((a0-3 (handle->process (-> this missile))))
(if a0-3
(deactivate a0-3)
)
)
(let ((a0-7 (handle->process (-> this missile-target))))
(if a0-7
(deactivate a0-7)
)
)
(set! v0-2 (+ (-> this missile-timer) (seconds 5)))
(set! (-> this missile-timer) (the-as time-frame v0-2))
v0-2
)
(('missile-spawners)
(let ((s5-0 (command-get-int (-> arg3 param 0) 0)))
(cond
((zero? s5-0)
(set! (-> this missile-spawners) #f)
#f
)
((>= (length *missile-spawners-all*) s5-0)
(set! v0-2 (-> *missile-spawners-all* (+ s5-0 -1)))
(set! (-> this missile-spawners) (the-as (array vector) v0-2))
v0-2
)
(else
(set! (-> this missile-spawners) #f)
#f
)
)
)
)
(('notify)
(when (>= arg1 1)
(case (-> arg3 param 0)
(('dp-bipedal-ambush)
(when (time-elapsed? (-> this talk-timer) (seconds 30))
(cond
((not (-> this first-dp-noticed?))
(play-speech this 4)
(set! (-> this first-dp-noticed?) #t)
(set! v0-2 (current-time))
(set! (-> this talk-timer) (the-as time-frame v0-2))
v0-2
)
(else
(let ((a1-5 (logior (-> this played-speeches) 15)))
(when (play-speech this (rand-vu-int-count-excluding 8 (the-as int a1-5)))
(set! v0-2 (current-time))
(set! (-> this talk-timer) (the-as time-frame v0-2))
v0-2
)
)
)
)
)
)
(('dp-bipedal-die)
(when (and (time-elapsed? (-> this talk-timer) (seconds 30))
(play-speech this (rand-vu-int-count-excluding 4 (the-as int (-> this played-speeches))))
)
(set! v0-2 (current-time))
(set! (-> this talk-timer) (the-as time-frame v0-2))
v0-2
)
)
)
)
)
(else
((method-of-type task-manager taskman-event-handler) this arg0 arg1 arg2 arg3)
)
)
)
;; failed to figure out what this is:
(defstate active (rubble-attack-manager)
:virtual #t
:enter (behavior ()
(let ((t9-0 (-> (method-of-type task-manager active) enter)))
(if t9-0
(t9-0)
)
)
(set-time! (-> self missile-timer))
)
:code (behavior ()
(local-vars (v1-23 object))
(while (!= (level-status? *level* 'lpattack #f) 'active)
(set-time! (-> self missile-timer))
(suspend)
)
(while (begin
(set! (-> self vehicle-handle) (-> *vehicle-info* handle-by-vehicle-type 17))
(not (handle->process (-> self vehicle-handle)))
)
(format *stdebug* "rubble-attack task manager waiting for rhino~%")
(set-time! (-> self missile-timer))
(suspend)
)
(set! (-> self king-rider)
(process->handle (king-rider-spawn (the-as vehicle (handle->process (-> self vehicle-handle)))))
)
(until v1-23
(set-time! (-> self missile-timer))
(suspend)
(set! v1-23 (and *target* (= (send-event *target* 'query 'mode) 'pilot)))
)
(play-speech self 0)
(set-setting! 'music 'ruinsatk 0.0 0)
(sleep-code)
)
)
;; definition for method 26 of type rubble-attack-manager
;; WARN: Return type mismatch time-frame vs none.
(defmethod task-manager-method-26 ((this rubble-attack-manager))
(let ((t9-0 (method-of-type task-manager task-manager-method-26)))
(t9-0 this)
)
(rubble-attack-manager-method-33 this)
(when (time-elapsed? (-> this missile-timer) (seconds 7))
(spawn-missile this)
(set! (-> this missile-timer) (+ (current-time) (the int (* 2100.0 (rand-vu-float-range 0.0 0.25)))))
)
(when (and (or (not (logtest? (-> this played-speeches) 64)) (not (logtest? (-> this played-speeches) 128)))
(and (-> this first-dp-noticed?) (time-elapsed? (-> this talk-timer) (seconds 25)))
)
(let ((v1-23 (the-as dm-missile-target (handle->process (-> this missile-target)))))
(when v1-23
(let ((f0-4 (vector-dot
(vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> v1-23 root trans) (target-pos 0)) 1.0)
(vector-x-quaternion! (new 'stack-no-clear 'vector) (target-rot))
)
)
)
(cond
((< f0-4 -0.6)
(if (play-speech this 6)
(set-time! (-> this talk-timer))
)
)
((< 0.6 f0-4)
(if (play-speech this 7)
(set-time! (-> this talk-timer))
)
)
)
)
)
)
)
(none)
)
;; definition for method 25 of type rubble-attack-manager
(defmethod task-manager-method-25 ((this rubble-attack-manager))
(let ((t9-0 (method-of-type task-manager task-manager-method-25)))
(t9-0 this)
)
(let ((a0-3 (handle->process (-> this king-rider))))
(if a0-3
(deactivate a0-3)
)
)
(none)
)
;; definition for method 20 of type rubble-attack-manager
;; WARN: Return type mismatch symbol vs none.
(defmethod init! ((this rubble-attack-manager))
(let ((t9-0 (method-of-type task-manager init!)))
(t9-0 this)
)
(set! (-> this king-rider) (the-as handle #f))
(none)
)
;; definition for method 21 of type rubble-attack-manager
;; WARN: Return type mismatch symbol vs none.
(defmethod set-time-limit ((this rubble-attack-manager))
(let ((t9-0 (method-of-type task-manager set-time-limit)))
(t9-0 this)
)
(set-setting! 'pilot-exit #f 0.0 0)
(set! (-> this missile) (the-as handle #f))
(set! (-> this missile-target) (the-as handle #f))
(set! (-> this missile-spawners) #f)
(set! (-> this first-dp-noticed?) #f)
(none)
)