Files
jak-project/test/decompiler/reference/jak1/levels/finalboss/robotboss-weapon_REF.gc
T
water111 637990314b wip: better stack var support (#4222)
Closes #736

---------

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2026-04-19 00:14:44 +02:00

927 lines
31 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition of type torus
(deftype torus (structure)
((origin vector :inline)
(axis vector :inline)
(radius-primary float)
(radius-secondary float)
)
(:methods
(torus-method-9 (_type_ vector) none)
(torus-method-10 (_type_ collide-prim-core vector) symbol)
(torus-method-11 (_type_ vector) symbol)
(torus-method-12 (_type_ vector) vector)
)
)
;; definition for method 3 of type torus
(defmethod inspect ((this torus))
(format #t "[~8x] ~A~%" this 'torus)
(format #t "~Torigin: #<vector @ #x~X>~%" (-> this origin))
(format #t "~Taxis: #<vector @ #x~X>~%" (-> this axis))
(format #t "~Tradius-primary: ~f~%" (-> this radius-primary))
(format #t "~Tradius-secondary: ~f~%" (-> this radius-secondary))
this
)
;; definition for method 10 of type torus
(defmethod torus-method-10 ((this torus) (arg0 collide-prim-core) (arg1 vector))
(let ((gp-0 (new 'stack-no-clear 'vector))
(s5-0 (new 'stack-no-clear 'vector))
(f30-0 (+ (-> this radius-secondary) (-> arg0 world-sphere w)))
)
(vector-! gp-0 (-> arg0 world-sphere) (-> this origin))
(vector-flatten! s5-0 gp-0 (-> this axis))
(vector-normalize! s5-0 (-> this radius-primary))
(vector-! arg1 gp-0 s5-0)
(< (vector-length-squared arg1) (square f30-0))
)
)
;; definition for method 11 of type torus
(defmethod torus-method-11 ((this torus) (arg0 vector))
(let ((s4-0 (the-as collide-shape-prim-group (-> *target* control root-prim))))
(when (and (logtest? (-> s4-0 prim-core collide-as) (collide-kind target))
(torus-method-10 this (-> s4-0 prim-core) arg0)
)
(countdown (s3-0 (-> s4-0 num-prims))
(let ((v1-9 (-> s4-0 prims s3-0)))
(if (and (logtest? (-> v1-9 prim-core action) (collide-action solid))
(logtest? (-> v1-9 prim-core collide-as) (collide-kind target))
(torus-method-10 this (-> v1-9 prim-core) arg0)
)
(return #t)
)
)
)
)
)
#f
)
;; definition of type torus-verts
(deftype torus-verts (structure)
((vert vector 8 :inline)
)
)
;; definition for method 3 of type torus-verts
(defmethod inspect ((this torus-verts))
(format #t "[~8x] ~A~%" this 'torus-verts)
(format #t "~Tvert[8] @ #x~X~%" (-> this vert))
this
)
;; definition for method 9 of type torus
;; INFO: Used lq/sq
;; INFO: Return type mismatch int vs none.
(defmethod torus-method-9 ((this torus) (arg0 vector))
(let ((s0-0 (new 'stack-no-clear 'vector))
(s4-0 (new 'stack-no-clear 'vector))
(s3-0 (new 'stack-no-clear 'vector))
(s2-0 (new 'stack-no-clear 'matrix))
(s1-0 (new 'stack-no-clear 'inline-array 'vector 8))
)
(set-vector! s0-0 0.0 0.0 1.0 1.0)
(vector-flatten! s0-0 s0-0 (-> this axis))
(if (= (vector-normalize-ret-len! s0-0 1.0) 0.0)
(set-vector! s0-0 0.0 1.0 0.0 1.0)
)
(vector-cross! s4-0 s0-0 (-> this axis))
(matrix-axis-angle! s2-0 s4-0 8192.0)
(vector-float*! (-> s1-0 0) s0-0 (-> this radius-secondary))
(let ((sv-256 0))
(while (< sv-256 7)
(vector-matrix*! (-> s1-0 (+ sv-256 1)) (-> s1-0 sv-256) s2-0)
(+! sv-256 1)
)
)
(vector-float*! s0-0 s0-0 (-> this radius-primary))
(dotimes (v1-21 8)
(vector+! (-> s1-0 v1-21) (-> s1-0 v1-21) s0-0)
)
(matrix-axis-angle! s2-0 (-> this axis) 4096.0)
(dotimes (s0-1 16)
(let ((sv-272 0))
(while (< sv-272 7)
(vector+! s4-0 (-> s1-0 sv-272) (-> this origin))
(vector+! s3-0 (-> s1-0 (+ sv-272 1)) (-> this origin))
(camera-line s4-0 s3-0 (the-as vector4w arg0))
(+! sv-272 1)
)
)
(vector+! s4-0 (-> s1-0 0) (-> this origin))
(camera-line s4-0 s3-0 (the-as vector4w arg0))
(let ((sv-288 0))
(while (< sv-288 8)
(vector+! s4-0 (-> s1-0 sv-288) (-> this origin))
(vector-matrix*! (-> s1-0 sv-288) (-> s1-0 sv-288) s2-0)
(vector+! s3-0 (-> s1-0 sv-288) (-> this origin))
(camera-line s4-0 s3-0 (the-as vector4w arg0))
(+! sv-288 1)
)
)
)
)
0
(none)
)
;; definition for method 12 of type torus
(defmethod torus-method-12 ((this torus) (arg0 vector))
(let* ((f30-0 65536.0)
(v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-2 (the-as number (logior #x3f800000 v1-1)))
(f30-1 (* f30-0 (+ -1.0 (the-as float v1-2))))
)
(set! (-> arg0 x) 0.0)
(set! (-> arg0 y) (* (-> this radius-secondary) (sin f30-1)))
(set! (-> arg0 z) (* (-> this radius-secondary) (cos f30-1)))
)
(+! (-> arg0 z) (-> this radius-primary))
(set! (-> arg0 w) 0.0)
(let ((s2-0 (new 'stack-no-clear 'matrix)))
(let* ((s4-0 matrix-rotate-y!)
(s3-0 s2-0)
(f30-2 65536.0)
(v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-7 (the-as number (logior #x3f800000 v1-6)))
)
(s4-0 s3-0 (* f30-2 (+ -1.0 (the-as float v1-7))))
)
(vector-matrix*! arg0 arg0 s2-0)
(matrix-from-two-vectors! s2-0 (new 'static 'vector :y 1.0 :w 1.0) (-> this axis))
(vector-matrix*! arg0 arg0 s2-0)
)
(vector+! arg0 arg0 (-> this origin))
arg0
)
;; definition of type arcing-shot
(deftype arcing-shot (process-drawable)
((root collide-shape-moving :override)
(y-vel float)
(grav float)
(from vector :inline)
(to vector :inline)
)
(:states
arcing-shot-debug-trajectory
)
)
;; definition for method 3 of type arcing-shot
(defmethod inspect ((this arcing-shot))
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 this)
)
(format #t "~T~Ty-vel: ~f~%" (-> this y-vel))
(format #t "~T~Tgrav: ~f~%" (-> this grav))
(format #t "~T~Tfrom: #<vector @ #x~X>~%" (-> this from))
(format #t "~T~Tto: #<vector @ #x~X>~%" (-> this to))
this
)
;; definition for function arcing-shot-setup
;; INFO: Used lq/sq
(defbehavior arcing-shot-setup arcing-shot ((arg0 vector) (arg1 vector) (arg2 float))
(set! (-> self from quad) (-> arg0 quad))
(set! (-> self to quad) (-> arg1 quad))
(let ((v1-2 (fmax 1.0 arg2)))
(if (< (-> arg0 y) (-> arg1 y))
(set! v1-2 (+ v1-2 (- (-> arg1 y) (-> arg0 y))))
)
(let ((f0-6 (* -4.0 v1-2))
(f3-1 (* 4.0 v1-2 (- (-> arg1 y) (-> arg0 y))))
)
(set! (-> self y-vel) (* 0.5 (- (sqrtf (- (square f0-6) (* 4.0 f3-1))) f0-6)))
)
(set! (-> self grav) (/ (- (* (-> self y-vel) (-> self y-vel))) (* 2.0 v1-2)))
)
)
;; definition for function arcing-shot-calculate
(defbehavior arcing-shot-calculate arcing-shot ((arg0 vector) (arg1 float))
(let ((s5-0 (fmin 1.0 (fmax 0.0 arg1))))
(vector-lerp! arg0 (-> self from) (-> self to) s5-0)
(set! (-> arg0 y) (-> self from y))
(+! (-> arg0 y) (* (-> self y-vel) s5-0))
(set! (-> arg0 y) (+ (-> arg0 y) (* (/ s5-0 2) s5-0 (-> self grav))))
)
)
;; definition for function arcing-shot-draw
;; INFO: Used lq/sq
(defbehavior arcing-shot-draw arcing-shot ()
(let ((gp-0 (new 'stack-no-clear 'vector))
(s5-0 (new 'stack-no-clear 'vector))
)
(set! (-> s5-0 quad) (-> self from quad))
(dotimes (s4-0 30)
(arcing-shot-calculate gp-0 (* 0.033333335 (the float (+ s4-0 1))))
(camera-line gp-0 s5-0 (new 'static 'vector4w :x #xff :y #xff :w #x80))
(set! (-> s5-0 quad) (-> gp-0 quad))
)
)
#f
)
;; failed to figure out what this is:
(defstate arcing-shot-debug-trajectory (arcing-shot)
:trans (behavior ()
(arcing-shot-setup (camera-pos) (-> self entity extra trans) 40960.0)
(arcing-shot-draw)
)
:code (behavior ()
(loop
(format *stdcon* "debug trajectory~%")
(suspend)
)
)
)
;; definition of type darkecobomb
(deftype darkecobomb (arcing-shot)
((flight-time time-frame)
(countdown-time float)
(anim-speed float)
(next-tick float)
)
(:states
darkecobomb-countdown
(darkecobomb-explode symbol)
darkecobomb-idle
darkecobomb-land
)
)
;; definition for method 3 of type darkecobomb
(defmethod inspect ((this darkecobomb))
(let ((t9-0 (method-of-type arcing-shot inspect)))
(t9-0 this)
)
(format #t "~T~Tflight-time: ~D~%" (-> this flight-time))
(format #t "~T~Tcountdown-time: ~f~%" (-> this countdown-time))
(format #t "~T~Tanim-speed: ~f~%" (-> this anim-speed))
(format #t "~T~Tnext-tick: ~f~%" (-> this next-tick))
this
)
;; failed to figure out what this is:
(defskelgroup *darkecobomb-sg* darkecobomb darkecobomb-lod0-jg darkecobomb-idle-ja
((darkecobomb-lod0-mg (meters 999999)))
:bounds (static-spherem 0 3.5 0 6)
)
;; failed to figure out what this is:
(defstate darkecobomb-explode (darkecobomb)
:code (behavior ((arg0 symbol))
(send-event *target* 'reset-pickup 'eco)
(sound-play "explod-bomb" :position #f)
(activate! *camera-smush-control* 819.2 37 600 1.0 0.995)
(send-event (ppointer->process (-> self parent)) 'flash 255.0)
(process-spawn
part-tracker
:init part-tracker-init
group-final-boss-mine-explosion
900
#f
#f
#f
(-> self root trans)
:to *entity-pool*
)
(logior! (-> self draw status) (draw-status hidden))
(cond
((or arg0 (and *target* (< (-> (target-pos 0) y) (+ 40960.0 (-> self entity extra trans y)))))
(if *target*
(logior! (-> *target* mask) (process-mask sleep))
)
(send-event (ppointer->process (-> self parent)) 'bomb-going)
(send-event *camera* 'change-to-entity-by-name "camera-402")
(set-time! (-> self state-time))
(until (time-elapsed? (-> self state-time) (seconds 2))
(suspend)
)
(send-event *camera* 'force-blend 0)
(send-event *camera* 'change-state *camera-base-mode*)
(send-event *camera* 'clear-entity)
(if *target*
(logclear! (-> *target* mask) (process-mask sleep))
)
(send-event *target* 'attack-invinc #f (static-attack-info ((mode 'instant-death))))
)
(else
(send-event (ppointer->process (-> self parent)) 'bomb-done)
)
)
(deactivate self)
)
:post ja-post
)
;; definition for function darkecobomb-handler
(defbehavior darkecobomb-handler darkecobomb ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('touch 'attack)
(go darkecobomb-explode #t)
)
)
)
;; definition for function darkecobomb-explode-if-player-high-enough
;; INFO: Return type mismatch object vs none.
(defbehavior darkecobomb-explode-if-player-high-enough darkecobomb ()
(if (and (not (movie?)) *target* (< (+ 409600.0 (-> self entity extra trans y)) (-> (target-pos 0) y)))
(go darkecobomb-explode #f)
)
(none)
)
;; failed to figure out what this is:
(defstate darkecobomb-countdown (darkecobomb)
:event darkecobomb-handler
:enter (behavior ()
(set! (-> self state-time) (-> *display* game-frame-counter))
(set! (-> self next-tick) 0.9)
)
:exit (behavior ()
(stop! (-> self sound))
)
:trans (behavior ()
(darkecobomb-explode-if-player-high-enough)
(let ((f0-1
(fmax
0.0
(/ (- (-> self countdown-time) (the float (- (-> *display* game-frame-counter) (-> self state-time))))
(-> self countdown-time)
)
)
)
)
(let ((f1-5 (* (- 1.0 f0-1) (- 1.0 f0-1))))
(set! (-> self anim-speed) (+ 1.0 f1-5))
)
(when (< (cos (* 16384.0 (- 1.0 f0-1))) (-> self next-tick))
(process-spawn
part-tracker
:init part-tracker-init
group-robotboss-darkecobomb-tick
150
#f
#f
#f
(-> self root trans)
:to *entity-pool*
)
(+! (-> self next-tick) -0.06)
(sound-play "robo-warning")
)
)
(if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (the int (-> self countdown-time)))
(go darkecobomb-explode #f)
)
(when (ja-group? darkecobomb-spin-cycle-ja)
(let ((gp-2 (new 'stack-no-clear 'vector)))
(vector<-cspace! gp-2 (joint-node darkecobomb-lod0-jg particles))
(spawn (-> self part) gp-2)
)
)
)
:code (behavior ()
(sound-play "bomb-open")
(ja-no-eval :group! darkecobomb-open-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(loop
(ja-no-eval :group! darkecobomb-spin-cycle-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0)
(until (ja-done? 0)
(update! (-> self sound))
(suspend)
(ja :num! (seek! max (-> self anim-speed)))
)
)
)
:post transform-post
)
;; failed to figure out what this is:
(defstate darkecobomb-land (darkecobomb)
:event darkecobomb-handler
:enter (behavior ()
(set! (-> self state-time) (-> *display* game-frame-counter))
0
)
:trans (behavior ()
(darkecobomb-explode-if-player-high-enough)
(if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 0.5))
(go darkecobomb-countdown)
)
)
:code (behavior ()
(ja-no-eval :num! (seek!))
(while (not (ja-done? 0))
(suspend)
(ja-eval)
)
(loop
(ja-no-eval :group! darkecobomb-idle-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
)
:post transform-post
)
;; failed to figure out what this is:
(defstate darkecobomb-idle (darkecobomb)
:enter (behavior ()
(set! (-> self state-time) (-> *display* game-frame-counter))
)
:trans (behavior ()
(arcing-shot-calculate
(-> self root trans)
(/ (the float (- (-> *display* game-frame-counter) (-> self state-time))) (the float (-> self flight-time)))
)
(if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self flight-time))
(go darkecobomb-land)
)
)
:code (behavior ()
(ja-no-eval :group! darkecobomb-blast-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(loop
(ja-no-eval :group! darkecobomb-idle-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
)
:post transform-post
)
;; definition for function darkecobomb-init-by-other
;; INFO: Used lq/sq
;; INFO: Return type mismatch object vs none.
(defbehavior darkecobomb-init-by-other darkecobomb ((arg0 vector) (arg1 vector) (arg2 float) (arg3 time-frame) (arg4 float))
(let ((s1-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player))))
(set! (-> s1-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s1-0 reaction) default-collision-reaction)
(set! (-> s1-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(let ((s0-0 (new 'process 'collide-shape-prim-sphere s1-0 (the-as uint 0))))
(set! (-> s0-0 prim-core collide-as) (collide-kind wall-object))
(set! (-> s0-0 collide-with) (collide-kind target))
(set! (-> s0-0 prim-core action) (collide-action solid))
(set! (-> s0-0 prim-core offense) (collide-offense indestructible))
(set! (-> s0-0 transform-index) 3)
(set-vector! (-> s0-0 local-sphere) 0.0 0.0 0.0 16384.0)
(set-root-prim! s1-0 s0-0)
)
(set! (-> s1-0 nav-radius) (* 0.75 (-> s1-0 root-prim local-sphere w)))
(backup-collide-with-as s1-0)
(set! (-> self root) s1-0)
)
(set! (-> self root trans quad) (-> arg0 quad))
(initialize-skeleton self *darkecobomb-sg* '())
(logclear! (-> self mask) (process-mask actor-pause))
(set! (-> self part) (create-launch-control group-robotboss-darkecobomb-glow self))
(arcing-shot-setup arg0 arg1 arg2)
(set! (-> self countdown-time) arg4)
(set! (-> self flight-time) arg3)
(set! (-> self sound) (new 'process 'ambient-sound (static-sound-spec "bomb-spin" :fo-max 80) (-> self to)))
(go darkecobomb-idle)
(none)
)
;; definition of type greenshot
(deftype greenshot (arcing-shot)
((flight-time time-frame)
)
(:states
greenshot-idle
)
)
;; definition for method 3 of type greenshot
(defmethod inspect ((this greenshot))
(let ((t9-0 (method-of-type arcing-shot inspect)))
(t9-0 this)
)
(format #t "~T~Tflight-time: ~D~%" (-> this flight-time))
this
)
;; failed to figure out what this is:
(defskelgroup *greenshot-sg* greenshot greenshot-lod0-jg greenshot-idle-ja
((greenshot-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 4)
)
;; failed to figure out what this is:
(defstate greenshot-idle (greenshot)
:enter (behavior ()
(set! (-> self state-time) (-> *display* game-frame-counter))
)
:trans (behavior ()
(arcing-shot-calculate
(-> self root trans)
(/ (the float (- (-> *display* game-frame-counter) (-> self state-time))) (the float (-> self flight-time)))
)
(if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self flight-time))
(deactivate self)
)
(spawn (-> self part) (-> self root trans))
)
:code (behavior ()
(loop
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
)
:post transform-post
)
;; definition for function greenshot-init-by-other
;; INFO: Used lq/sq
;; INFO: Return type mismatch object vs none.
(defbehavior greenshot-init-by-other greenshot ((arg0 vector) (arg1 vector) (arg2 float) (arg3 time-frame))
(let ((s2-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player))))
(set! (-> s2-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s2-0 reaction) default-collision-reaction)
(set! (-> s2-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(let ((s1-0 (new 'process 'collide-shape-prim-sphere s2-0 (the-as uint 0))))
(set! (-> s1-0 prim-core collide-as) (collide-kind enemy))
(set! (-> s1-0 collide-with) (collide-kind target))
(set! (-> s1-0 prim-core offense) (collide-offense indestructible))
(set-vector! (-> s1-0 local-sphere) 0.0 8192.0 0.0 8192.0)
(set-root-prim! s2-0 s1-0)
)
(set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w)))
(backup-collide-with-as s2-0)
(set! (-> self root) s2-0)
)
(set! (-> self root trans quad) (-> arg0 quad))
(initialize-skeleton self *greenshot-sg* '())
(logclear! (-> self mask) (process-mask actor-pause))
(arcing-shot-setup arg0 arg1 arg2)
(set! (-> self flight-time) arg3)
(set! (-> self part) (create-launch-control group-robotboss-greenshot self))
(logior! (-> self draw status) (draw-status hidden))
(go greenshot-idle)
(none)
)
;; definition of type redshot
(deftype redshot (arcing-shot)
((flight-time time-frame)
(stall-time time-frame)
(ring torus :inline)
(rotation-offset int64)
(part-track handle)
(shot-particle sparticle-launch-control)
(test-particle sparticle-launch-control)
)
(:states
redshot-explode
redshot-idle
redshot-wait
)
)
;; definition for method 3 of type redshot
(defmethod inspect ((this redshot))
(let ((t9-0 (method-of-type arcing-shot inspect)))
(t9-0 this)
)
(format #t "~T~Tflight-time: ~D~%" (-> this flight-time))
(format #t "~T~Tstall-time: ~D~%" (-> this stall-time))
(format #t "~T~Tring: #<torus @ #x~X>~%" (-> this ring))
(format #t "~T~Trotation-offset: ~D~%" (-> this rotation-offset))
(format #t "~T~Tpart-track: ~D~%" (-> this part-track))
(format #t "~T~Tshot-particle: ~A~%" (-> this shot-particle))
(format #t "~T~Ttest-particle: ~A~%" (-> this test-particle))
this
)
;; definition for method 7 of type redshot
;; INFO: Return type mismatch arcing-shot vs redshot.
(defmethod relocate ((this redshot) (offset int))
(if (nonzero? (-> this shot-particle))
(&+! (-> this shot-particle) offset)
)
(if (nonzero? (-> this test-particle))
(&+! (-> this test-particle) offset)
)
(the-as redshot ((method-of-type arcing-shot relocate) this offset))
)
;; definition for method 10 of type redshot
(defmethod deactivate ((this redshot))
(if (nonzero? (-> this shot-particle))
(kill-and-free-particles (-> this shot-particle))
)
(if (nonzero? (-> this test-particle))
(kill-and-free-particles (-> this test-particle))
)
((method-of-type arcing-shot deactivate) this)
(none)
)
;; definition for function redshot-particle-callback
;; INFO: Return type mismatch int vs none.
(defun redshot-particle-callback ((arg0 part-tracker))
(let ((v1-0 (the-as object (-> arg0 userdata))))
(set! (-> *part-id-table* 2626 init-specs 2 initial-valuef)
(* 2.25 (-> (the-as (pointer redshot) v1-0) 0 ring radius-primary))
)
)
0
(none)
)
;; failed to figure out what this is:
(defskelgroup *redring-sg* redring redring-lod0-jg redring-idle-ja
((redring-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 40)
)
;; definition for function redshot-trans
;; INFO: Return type mismatch object vs none.
(defbehavior redshot-trans redshot ((arg0 time-frame))
(let ((s5-0 (new 'stack-no-clear 'matrix)))
0.0
(matrix-rotate-yx!
s5-0
(* 436.90668 (the float (+ (-> self rotation-offset) (-> *display* game-frame-counter))))
(* 291.27112 (the float (+ (-> self rotation-offset) (-> *display* game-frame-counter))))
)
(matrix->quaternion (-> self root quat) s5-0)
)
(if (< (* 0.006666667 (the float (min 150 arg0))) 1.0)
(spawn (-> self part) (-> self root trans))
)
(none)
)
;; failed to figure out what this is:
(defstate redshot-explode (redshot)
:enter (behavior ()
(set! (-> self state-time) (-> *display* game-frame-counter))
(sound-play "red-explode")
(logclear! (-> self draw status) (draw-status hidden))
(quaternion-identity! (-> self root quat))
(set! (-> self ring radius-secondary) 3072.0)
(set! (-> self ring origin quad) (-> self root trans quad))
(+! (-> self ring origin y) (-> self ring radius-secondary))
(set-vector! (-> self ring axis) 0.0 1.0 0.0 1.0)
(set! (-> self part-track) (ppointer->handle (process-spawn
part-tracker
:init part-tracker-init
group-robotboss-redshot
-1
redshot-particle-callback
(-> self ppointer)
#f
(-> self root trans)
:to self
)
)
)
)
:trans (behavior ()
(set! (-> self ring radius-primary)
(* 204.8 (the float (- (-> *display* game-frame-counter) (-> self state-time))))
)
(let ((gp-0 (new 'stack-no-clear 'vector)))
(when (torus-method-11 (-> self ring) gp-0)
(vector-normalize! gp-0 16384.0)
(send-event *target* 'attack #f (static-attack-info ((vector gp-0))))
(send-event (ppointer->process (-> self parent)) 'hit-jak)
)
)
(dotimes (gp-1 5)
(let ((s5-0 (new 'stack-no-clear 'vector)))
(torus-method-12 (-> self ring) s5-0)
(spawn (-> self test-particle) s5-0)
)
)
(let ((f0-3
(fmin
1.0
(* 0.006666667 (the float (- (seconds 2) (- (-> *display* game-frame-counter) (-> self state-time)))))
)
)
)
(set-vector! (-> self draw color-mult) f0-3 f0-3 f0-3 0.75)
)
(when (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 2))
(send-event (ppointer->process (-> self parent)) 'missed-jak)
(deactivate self)
)
)
:code (behavior ()
(loop
(ja :num-func num-func-identity :frame-num (/ (-> self ring radius-primary) (meters 15)))
(suspend)
)
)
:post transform-post
)
;; definition for function redshot-handler
(defbehavior redshot-handler redshot ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('attack 'touch)
(go redshot-explode)
)
)
)
;; failed to figure out what this is:
(defstate redshot-wait (redshot)
:event redshot-handler
:enter (behavior ()
(set! (-> self state-time) (-> *display* game-frame-counter))
)
:trans (behavior ()
(redshot-trans (- (-> self stall-time) (- (-> *display* game-frame-counter) (-> self state-time))))
(if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self stall-time))
(go redshot-explode)
)
(spawn (-> self shot-particle) (-> self root trans))
)
:code (behavior ()
(loop
(suspend)
)
)
:post transform-post
)
;; failed to figure out what this is:
(defstate redshot-idle (redshot)
:event redshot-handler
:enter (behavior ()
(set! (-> self state-time) (-> *display* game-frame-counter))
)
:trans (behavior ()
(redshot-trans (seconds 5))
(arcing-shot-calculate
(-> self root trans)
(/ (the float (- (-> *display* game-frame-counter) (-> self state-time))) (the float (-> self flight-time)))
)
(if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self flight-time))
(go redshot-wait)
)
(spawn (-> self shot-particle) (-> self root trans))
)
:code (behavior ()
(loop
(suspend)
)
)
:post transform-post
)
;; definition for function redshot-init-by-other
;; INFO: Used lq/sq
;; INFO: Return type mismatch object vs none.
(defbehavior redshot-init-by-other redshot ((arg0 vector) (arg1 vector) (arg2 float) (arg3 time-frame) (arg4 time-frame) (arg5 int))
(let ((s0-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player))))
(set! (-> s0-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s0-0 reaction) default-collision-reaction)
(set! (-> s0-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(let ((sv-16 (new 'process 'collide-shape-prim-sphere s0-0 (the-as uint 0))))
(set! (-> sv-16 prim-core collide-as) (collide-kind wall-object))
(set! (-> sv-16 collide-with) (collide-kind target))
(set! (-> sv-16 prim-core action) (collide-action solid))
(set! (-> sv-16 prim-core offense) (collide-offense indestructible))
(set! (-> sv-16 transform-index) 4)
(set-vector! (-> sv-16 local-sphere) 0.0 0.0 0.0 12288.0)
(set-root-prim! s0-0 sv-16)
)
(set! (-> s0-0 nav-radius) (* 0.75 (-> s0-0 root-prim local-sphere w)))
(backup-collide-with-as s0-0)
(set! (-> self root) s0-0)
)
(set! (-> self root trans quad) (-> arg0 quad))
(initialize-skeleton self *redring-sg* '())
(logclear! (-> self mask) (process-mask actor-pause))
(arcing-shot-setup arg0 arg1 arg2)
(set! (-> self flight-time) arg3)
(set! (-> self stall-time) arg4)
(set! (-> self rotation-offset) arg5)
(set! (-> self part) (create-launch-control group-robotboss-redshot-warning self))
(set! (-> self shot-particle) (create-launch-control group-robotboss-redshot-body self))
(set! (-> self test-particle) (create-launch-control group-robotboss-redshot-test self))
(logior! (-> self draw status) (draw-status hidden))
(set! (-> self sound)
(new 'process 'ambient-sound (static-sound-spec "red-fireball" :fo-max 80) (-> self root trans))
)
(go redshot-idle)
(none)
)
;; definition of type yellowshot
(deftype yellowshot (arcing-shot)
((flight-time time-frame)
)
(:states
yellowshot-idle
)
)
;; definition for method 3 of type yellowshot
(defmethod inspect ((this yellowshot))
(let ((t9-0 (method-of-type arcing-shot inspect)))
(t9-0 this)
)
(format #t "~T~Tflight-time: ~D~%" (-> this flight-time))
this
)
;; failed to figure out what this is:
(defstate yellowshot-idle (yellowshot)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('touch 'attack)
(when (= (-> proc type) target)
(send-event *target* 'attack (-> block param 0) (static-attack-info ((mode 'generic))))
(send-event (ppointer->process (-> self parent)) 'hit-jak)
)
)
)
)
:enter (behavior ()
(set! (-> self state-time) (-> *display* game-frame-counter))
)
:trans (behavior ()
(arcing-shot-calculate
(-> self root trans)
(/ (the float (- (-> *display* game-frame-counter) (-> self state-time))) (the float (-> self flight-time)))
)
(spawn (-> self part) (-> self root trans))
(when (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self flight-time))
(send-event (ppointer->process (-> self parent)) 'missed-jak)
(deactivate self)
)
)
:code (behavior ()
(loop
(suspend)
)
)
:post transform-post
)
;; definition for function yellowshot-init-by-other
;; INFO: Used lq/sq
;; INFO: Return type mismatch object vs none.
(defbehavior yellowshot-init-by-other yellowshot ((arg0 vector) (arg1 vector) (arg2 float) (arg3 time-frame))
(let ((s2-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player))))
(set! (-> s2-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s2-0 reaction) default-collision-reaction)
(set! (-> s2-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(let ((s1-0 (new 'process 'collide-shape-prim-sphere s2-0 (the-as uint 0))))
(set! (-> s1-0 prim-core collide-as) (collide-kind wall-object))
(set! (-> s1-0 collide-with) (collide-kind target))
(set! (-> s1-0 prim-core action) (collide-action solid))
(set! (-> s1-0 prim-core offense) (collide-offense indestructible))
(set-vector! (-> s1-0 local-sphere) 0.0 0.0 0.0 12288.0)
(set-root-prim! s2-0 s1-0)
)
(set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w)))
(backup-collide-with-as s2-0)
(set! (-> self root) s2-0)
)
(set! (-> self root trans quad) (-> arg0 quad))
(initialize-skeleton self *redring-sg* '())
(logior! (-> self draw status) (draw-status hidden))
(arcing-shot-setup arg0 arg1 arg2)
(set! (-> self flight-time) arg3)
(set! (-> self part) (create-launch-control group-robotboss-yellowshot self))
(go yellowshot-idle)
(none)
)