Files
jak-project/test/decompiler/reference/jak3/levels/mine/prebot-states_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

2551 lines
92 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition for function prebot-neck-callback
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defbehavior prebot-neck-callback prebot ((arg0 cspace) (arg1 transformq))
(cspace<-parented-transformq-joint! arg0 arg1)
(let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) arg0))
(s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 bone transform fvec) 1.0))
(s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 bone transform uvec) 1.0))
(s3-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) s4-0))
(f28-0 (vector-normalize-ret-len! s3-1 1.0))
)
(vector-flatten! s3-1 s3-1 s5-0)
(vector-normalize! s3-1 1.0)
(let ((s4-1 self))
(let ((f30-0 (vector-dot s3-1 s2-0)))
(cond
((or (< 163840.0 f28-0)
(and (< 143360.0 f28-0) (= (fabs (-> s4-1 neck-angle target)) 0.0))
(< f30-0 (cos 15473.777))
(and (< f30-0 (cos 8192.0)) (= (fabs (-> s4-1 neck-angle target)) 0.0))
(not (-> arg0 param1))
)
(set! (-> s4-1 neck-angle target) 0.0)
)
(else
(set! (-> s4-1 neck-angle target) (fmin 1.0 (* 0.00012207031 (acos f30-0))))
(if (< (vector-dot s3-1 (-> arg0 bone transform rvec)) 0.0)
(set! (-> s4-1 neck-angle target) (- (-> s4-1 neck-angle target)))
)
)
)
)
(update! (-> s4-1 neck-angle) 0.0)
(let ((a1-9 (matrix-axis-angle! (new 'stack-no-clear 'matrix) s5-0 (* 8192.0 (-> s4-1 neck-angle value))))
(s5-1 (new 'stack-no-clear 'vector))
)
(vector-copy! s5-1 (-> arg0 bone transform trans))
(vector-reset! (-> arg0 bone transform trans))
(matrix*! (-> arg0 bone transform) a1-9 (-> arg0 bone transform))
(vector-copy! (-> arg0 bone transform trans) s5-1)
)
)
)
0
(none)
)
;; definition for function prebot-light-pulse-off
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defbehavior prebot-light-pulse-off prebot ()
(set! (-> self light-pulse target quad) (the-as uint128 0))
(set! (-> self light-pulse value quad) (the-as uint128 0))
(set! (-> self light-pulse vel quad) (the-as uint128 0))
0
(none)
)
;; definition for function prebot-light-pulse-on
(defbehavior prebot-light-pulse-on prebot ((arg0 float) (arg1 float) (arg2 float))
(let ((v0-0 (-> self light-pulse target)))
(set! (-> v0-0 x) arg0)
(set! (-> v0-0 y) arg1)
(set! (-> v0-0 z) arg2)
(set! (-> v0-0 w) 1.0)
v0-0
)
)
;; definition for function prebot-light-flash
;; INFO: Used lq/sq
(defbehavior prebot-light-flash prebot ((arg0 float) (arg1 float) (arg2 float))
(let ((v1-0 (new 'stack-no-clear 'vector)))
(set! (-> v1-0 x) arg0)
(set! (-> v1-0 y) arg1)
(set! (-> v1-0 z) arg2)
(set! (-> v1-0 w) 1.0)
(when (< (vector-length-squared (-> self light-flash value)) (vector-length-squared v1-0))
(set-vector! (-> self light-flash value) arg0 arg1 arg2 1.0)
(let ((v0-0 (-> self light-flash vel)))
(set! (-> v0-0 quad) (the-as uint128 0))
v0-0
)
)
)
)
;; definition for function prebot-prespool
(defbehavior prebot-prespool prebot ()
(case (-> self stage)
((1)
(script-eval '(want-anim "prebot-hit-a"))
)
((2)
(script-eval '(want-anim "prebot-hit-b"))
)
(else
(script-eval '(want-anim "mine-boss-res"))
)
)
)
;; definition for function prebot-common
;; INFO: Used lq/sq
(defbehavior prebot-common prebot ()
(dotimes (gp-0 20)
(cond
((handle->process (-> self ammo gp-0 handle))
(if (and (nonzero? (-> self ammo gp-0 timer)) (time-elapsed? (-> self ammo gp-0 timer) (seconds 20)))
(send-event (handle->process (-> self ammo gp-0 handle)) 'die)
)
)
((-> self ammo gp-0 birth-next-time)
(set! (-> self ammo gp-0 birth-next-time) #f)
(set-time! (-> self ammo gp-0 timer))
(let ((a0-16 (new 'static 'fact-info)))
(set-vector! (new 'stack-no-clear 'vector) 0.0 57001.605 0.0 1.0)
(set! (-> a0-16 options) (actor-option fade-out fall no-distance-check-fadeout))
(set! (-> a0-16 fade-time) (seconds 10))
(set! (-> a0-16 pickup-spawn-amount) 1.0)
(set! (-> a0-16 pickup-type) (pickup-type ammo-random))
(set! (-> a0-16 pickup-amount) 10.0)
(let ((s5-0 (new 'stack-no-clear 'vector)))
(vector-copy! s5-0 (-> self root trans))
(set! (-> self root trans quad)
(-> (the-as (pointer uint128) (+ (the-as uint (-> self ammo 0 where)) (* 48 gp-0))))
)
(set! (-> a0-16 process) self)
(set! (-> self ammo gp-0 handle)
(ppointer->handle (drop-pickup a0-16 #t *entity-pool* (the-as fact-info #f) 0 #t))
)
(vector-copy! (-> self root trans) s5-0)
)
)
)
)
)
(update! (-> self light-flash) (the-as vector #f))
(when (!= (-> self light-pulse target w) 0.0)
(update-with-delay! (-> self light-pulse-flicker))
(update! (-> self light-pulse) (-> self light-pulse-flicker value))
)
(let ((a0-27 (new 'stack-no-clear 'vector)))
(vector+! a0-27 (-> self light-flash value) (-> self light-pulse value))
(set! (-> a0-27 x) (fmax 0.0 (-> a0-27 x)))
(set! (-> a0-27 y) (fmax 0.0 (-> a0-27 y)))
(set! (-> a0-27 z) (fmax 0.0 (-> a0-27 z)))
(set! (-> a0-27 w) 1.0)
(set-mined-filter! a0-27 0)
)
(set! (-> *game-info* counter) (the float (-> self stage)))
(prebot-prespool)
(update! (-> self position) (the-as vector #f))
(vector-copy! (-> self root trans) (-> self position value))
(let* ((f0-17 (* 54.613335 (the float (current-time))))
(f0-18 (- f0-17 (* (the float (the int (/ f0-17 65536.0))) 65536.0)))
)
(+! (-> self root trans y) (* 2048.0 (cos f0-18)))
)
(cond
((and (-> self next-state) (= (-> self next-state name) 'watch-critters))
(remove-setting! 'point-of-interest)
)
(else
(let ((t0-1 (new 'static 'vector)))
(vector-copy! t0-1 (-> self root trans))
(+! (-> t0-1 y) 16384.0)
(set-setting! 'point-of-interest 'abs t0-1 0)
)
)
)
)
;; definition for method 10 of type prebot
(defmethod deactivate ((this prebot))
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
(set-mined-filter! *zero-vector* 0)
((method-of-type process-focusable deactivate) this)
(none)
)
;; definition for method 7 of type prebot
;; WARN: Return type mismatch process-focusable vs prebot.
(defmethod relocate ((this prebot) (offset int))
(if (nonzero? (-> this shoulder-aim-jm))
(&+! (-> this shoulder-aim-jm) offset)
)
(the-as prebot ((method-of-type process-focusable relocate) this offset))
)
;; definition for function prebot-go-next-stage
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs object.
(defbehavior prebot-go-next-stage prebot ()
(local-vars (v1-4 (pointer actor-group)))
(cond
((not (task-node-closed? (game-task-node mine-boss-introduction)))
(set! (-> self stage) 0)
0
)
((task-node-closed? (game-task-node mine-boss-resolution))
(set! (-> self stage) 4)
)
((begin
(set! (-> self stage) 1)
(let ((sv-16 (new 'static 'res-tag)))
(set! v1-4 (res-lump-data (-> self entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))
(and v1-4 (nonzero? (-> sv-16 elt-count)))
)
)
(let ((v1-5 (-> v1-4 0)))
(dotimes (a0-5 (-> v1-5 length))
(let ((a1-7 (-> v1-5 data a0-5 actor)))
(when a1-7
(if (logtest? (-> a1-7 extra perm status) (entity-perm-status subtask-complete))
(+! (-> self stage) 1)
)
)
)
)
)
)
(else
(format #t "ERROR<gmj>: could not find actor-group for ~S~%" (-> self name))
)
)
(set! (-> self stage-hit-points) 1.0)
(remove-setting! 'entity-name)
(when (and (< (-> self stage) 4) (not (handle->process (-> self blocker))))
(let ((gp-0 (new 'static 'inline-array vector 2 (new 'static 'vector) (new 'static 'vector))))
(vector-copy! (-> gp-0 0) (-> self entity extra trans))
(+! (-> gp-0 0 x) 163840.0)
(+! (-> gp-0 0 y) -81920.0)
(+! (-> gp-0 0 z) 4096.0)
(vector-copy! (-> gp-0 1) (-> self entity extra trans))
(+! (-> gp-0 1 x) -163840.0)
(+! (-> gp-0 1 y) -81920.0)
(+! (-> gp-0 1 z) 4096.0)
(set! (-> self blocker)
(ppointer->handle (process-spawn blocking-plane gp-0 #x48c80000 :name "blocking-plane" :to self))
)
)
(send-event (handle->process (-> self blocker)) 'collide-as #x4000000)
)
(let ((v1-39 (-> self stage)))
(cond
((zero? v1-39)
(go-virtual hidden)
)
((= v1-39 1)
(set-setting! 'entity-name "camera-308" 0.0 0)
(set! (-> self laugh-played) #f)
(go-virtual jump-to-hover)
)
((or (= v1-39 2) (= v1-39 3))
(set-setting! 'entity-name "camera-308" 0.0 0)
(set! (-> self laugh-played) #f)
(go-virtual pre-slam)
)
(else
(go-virtual beaten)
)
)
)
0
)
;; definition for method 20 of type prebot
;; WARN: Return type mismatch int vs search-info-flag.
(defmethod get-search-info-flag ((this prebot))
"Get search-info-flag for this process."
(the-as search-info-flag 0)
)
;; definition for method 45 of type prebot
;; WARN: Return type mismatch symbol vs none.
(defmethod prebot-method-45 ((this prebot))
(set! (-> this node-list data 9 param1) (the-as basic #t))
(none)
)
;; definition for method 46 of type prebot
;; WARN: Return type mismatch symbol vs none.
(defmethod prebot-method-46 ((this prebot))
(set! (-> this node-list data 9 param1) #f)
(none)
)
;; definition for function prebot-handler
;; INFO: Used lq/sq
(defbehavior prebot-handler prebot ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(local-vars (v0-0 object))
(case arg2
(('touched-hot-pillar)
(when (not (logtest? (-> self flags) (prebot-flag pf0)))
(logior! (-> self flags) (prebot-flag pf0))
(let ((v1-7 (-> self entity extra perm)))
(logior! (-> v1-7 status) (entity-perm-status bit-5))
(set! (-> v1-7 user-object 0) (-> self flags))
)
(talker-spawn-func (-> *talker-speech* 331) *entity-pool* (target-pos 0) (the-as region #f))
)
)
(('shot-hit)
(if (line-in-view-frustum? (the-as vector (-> arg3 param 0)) (the-as vector (-> arg3 param 0)))
(prebot-light-flash 0.0 0.4 1.0)
)
)
(('skip 'blocker-died)
(if (= arg2 'blocker-died)
(prebot-light-flash 1.0 0.4 0.0)
)
(set! (-> self which-movie) (the-as int (-> arg3 param 0)))
(go-virtual play-hit-movie)
)
(('railblocker-hittable?)
(when (-> arg3 param 0)
(set! (-> self minecar-hint-timer) 0)
0
)
(and (and (-> self next-state) (let ((v1-21 (-> self next-state name)))
(or (= v1-21 'watch-pillars) (= v1-21 'destroy-pillars))
)
)
(< (+ 32358.4 (-> self entity extra trans y)) (-> (target-pos 0) y))
)
)
(('attack)
(when (>= (+ (current-time) (seconds -5.1)) (-> self laugh-timer))
(set-time! (-> self laugh-timer))
(sound-play "prebot-laugh" :position (-> self root trans))
)
#t
)
(('start-critter)
(dotimes (v1-34 28)
(when (not (handle->process (-> self critters v1-34)))
(set! (-> self critters v1-34) (process->handle arg0))
(set! v0-0 #f)
(goto cfg-50)
)
)
(set! v0-0 #f)
(label cfg-50)
v0-0
)
(('eco-creature-died)
(dotimes (v1-38 20)
(when (and (not (-> self ammo v1-38 birth-next-time)) (not (handle->process (-> self ammo v1-38 handle))))
(set! (-> (the-as (pointer uint128) (+ (the-as uint (-> self ammo 0 where)) (* 48 v1-38))))
(-> (the-as vector (-> arg3 param 0)) quad)
)
(set! (-> self ammo v1-38 birth-next-time) #t)
(return 0)
)
)
#f
)
)
)
;; failed to figure out what this is:
(defstate beaten (prebot)
:virtual #t
:enter (behavior ()
(ja-channel-set! 0)
(ja-post)
(let ((a0-2 (handle->process (-> self blocker))))
(if a0-2
(deactivate a0-2)
)
)
(remove-setting! 'point-of-interest)
)
:exit (behavior ()
(ja-channel-push! 1 (seconds 0.1))
(ja :group! prebot-idle-ja :num! min)
)
:code sleep-code
)
;; failed to figure out what this is:
(defstate play-fma (prebot)
:virtual #t
:enter (behavior ()
(set-blackout-frames (seconds 0.007))
(set-time! (-> self state-time))
(case (-> self stage)
((1)
(process-spawn scene-player :init scene-player-init "prebot-hit-a" #t #f :name "scene-player")
)
((2)
(process-spawn scene-player :init scene-player-init "prebot-hit-b" #t #f :name "scene-player")
)
(else
(let* ((v1-13 (-> *game-info* sub-task-list (game-task-node mine-boss-resolution)))
(v1-15 (if (-> v1-13 manager)
(-> v1-13 manager manager)
(the-as handle #f)
)
)
)
(send-event (handle->process v1-15) 'complete)
)
)
)
(deactivate self)
)
:trans (behavior ()
(remove-setting! 'point-of-interest)
(if (time-elapsed? (-> self state-time) (seconds 0.5))
(deactivate self)
)
)
:code sleep-code
:post (behavior ()
(transform-post)
(do-push-aways (-> self root))
)
)
;; failed to figure out what this is:
(defstate play-hit-movie (prebot)
:virtual #t
:enter (behavior ()
(kill-by-type eco-pill *active-pool*)
(kill-by-type ammo-collectable *active-pool*)
(prebot-light-pulse-off)
)
:exit (behavior ()
(process-release? *target*)
)
:trans (behavior ()
(remove-setting! 'point-of-interest)
(prebot-prespool)
(set-letterbox-frames (seconds 0.007))
(let ((v1-4 (ja-group)))
(cond
((and v1-4 (or (= v1-4 prebot-mine-boss-train-1-ja)
(= v1-4 prebot-mine-boss-train-2-ja)
(= v1-4 prebot-mine-boss-train-3-ja)
)
)
(process-grab? *target* #f)
(ja :num! (seek!))
(when (ja-done? 0)
(vector-copy! (-> self root trans) (-> self entity extra trans))
(process-release? *target*)
(go-virtual play-fma)
)
)
(else
(let ((gp-0 (quaternion-identity! (new 'stack-no-clear 'quaternion))))
(let ((v1-19 (the-as entity-actor (entity-by-name "scene-stage-133"))))
(when v1-19
(vector-copy! (-> self root trans) (-> v1-19 extra trans))
(quaternion-copy! gp-0 (-> v1-19 quat))
)
)
(ja-channel-push! 1 0)
(let ((v1-20 (-> self which-movie)))
(cond
((zero? v1-20)
(ja :group! prebot-mine-boss-train-1-ja :num! min)
)
((= v1-20 1)
(ja :group! prebot-mine-boss-train-2-ja :num! min)
)
(else
(ja :group! prebot-mine-boss-train-3-ja :num! min)
)
)
)
(process-grab? *target* #f)
(let ((s5-3 (process-spawn
manipy
:init manipy-init
(-> self root trans)
(-> self entity)
(art-group-get-by-name *level* "skel-cav-minecar" (the-as (pointer level) #f))
#f
0
:name "cav-minecar"
:to self
:stack-size #x20000
)
)
)
(when s5-3
(send-event (ppointer->process s5-3) 'anim-mode 'clone-anim)
(send-event (ppointer->process s5-3) 'clone-copy-trans #f)
(send-event (ppointer->process s5-3) 'rot-quat gp-0)
)
)
(let ((s5-5 (process-spawn
manipy
:init manipy-init
(-> self root trans)
(-> self entity)
(art-group-get-by-name *level* "skel-prebot-camera" (the-as (pointer level) #f))
#f
0
:name "prebot-camera"
:to self
:stack-size #x20000
)
)
)
(when s5-5
(send-event (ppointer->process s5-5) 'anim-mode 'clone-anim)
(send-event (ppointer->process s5-5) 'clone-copy-trans #f)
(send-event (ppointer->process s5-5) 'rot-quat gp-0)
(let ((v1-83
(process-spawn othercam (ppointer->process s5-5) 4 #f #f :name "othercam" :to (ppointer->process s5-5))
)
)
(if v1-83
(send-event (ppointer->process v1-83) 'mask 0)
)
)
)
)
)
)
)
)
)
:code sleep-code
:post (behavior ()
(transform-post)
(do-push-aways (-> self root))
)
)
;; definition for function prebot-set-cam-slave-fov
(defbehavior prebot-set-cam-slave-fov prebot ((arg0 float))
(let ((v1-1 (-> *camera* slave)))
(if v1-1
(set! (-> v1-1 0 fov) arg0)
)
)
)
;; failed to figure out what this is:
(defstate destroy-pillars (prebot)
:virtual #t
:event prebot-handler
:enter (behavior ()
(set! (-> self state-time) 0)
(set! (-> self num-attacks) (the-as uint 0))
(set-setting! 'entity-name "camera-312" 0.0 0)
(dotimes (gp-0 5)
(send-event (handle->process (-> self pillars gp-0)) 'vulnerable)
)
)
:exit (behavior ()
(prebot-set-cam-slave-fov 11650.845)
(set-setting! 'entity-name "camera-308" 0.0 0)
(blend-to-off! (-> self shoulder-aim-jm) (seconds 0.1) #f)
)
:trans (behavior ()
(if (= (get-aspect-ratio) 'aspect16x9)
(prebot-set-cam-slave-fov 13653.333)
(prebot-set-cam-slave-fov 11650.845)
)
(let ((v1-4 (ja-group)))
(cond
((and v1-4 (= v1-4 prebot-gun-stow-again-ja))
(ja :num! (seek!))
(when (and (= (-> self stage) 1) (not (-> self laugh-played)) (>= (ja-aframe-num 0) 280.0))
(set-time! (-> self laugh-timer))
(set! (-> self laugh-played) #t)
(sound-play "prebot-laugh" :position (-> self root trans))
)
(when (ja-done? 0)
(let ((a0-14 (handle->process (-> self gun))))
(if a0-14
(deactivate a0-14)
)
)
(go-virtual slam)
)
)
((let ((v1-39 (ja-group)))
(and v1-39 (= v1-39 prebot-gun-fire-ja))
)
(ja :num! (seek!))
(when (ja-done? 0)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-gun-target-ja :num! min)
(set-time! (-> self state-time))
)
)
((let ((v1-60 (ja-group)))
(and v1-60 (= v1-60 prebot-gun-target-ja))
)
(ja :num! (loop!))
(while (and (< (-> self num-attacks) (the-as uint 4))
(not (handle->process (-> self pillars (-> self num-attacks))))
)
(+! (-> self num-attacks) 1)
)
(let ((gp-3 (handle->process (-> self pillars (-> self num-attacks)))))
(when gp-3
(blend-on! (-> self shoulder-aim-jm) (seconds 0.25) 1.0 #f)
(let ((a1-10 (new 'stack-no-clear 'vector)))
(vector-copy! a1-10 (-> (the-as process-drawable gp-3) root trans))
(+! (-> a1-10 y) -14336.0)
(set-target! (-> self shoulder-aim-jm) a1-10)
)
)
)
(when (time-elapsed? (-> self state-time) (seconds 1))
(set-time! (-> self state-time))
(blend-to-off! (-> self shoulder-aim-jm) (seconds 0.1) #f)
(ja-channel-push! 1 (seconds 0.1))
(cond
((and (>= (-> self num-attacks) (the-as uint 4))
(not (handle->process (-> self pillars (-> self num-attacks))))
)
(ja :group! prebot-gun-stow-again-ja :num! min)
(set! (-> self laugh-played) #f)
)
(else
(ja :group! prebot-gun-fire-ja :num! min)
(send-event (handle->process (-> self gun)) 'fire)
(prebot-light-flash 1.0 0.4 0.0)
)
)
)
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-gun-target-ja :num! min)
)
)
)
(prebot-common)
)
:code sleep-code
:post (behavior ()
(transform-post)
(do-push-aways (-> self root))
)
)
;; definition for function prebot-setup-shot-offsets
;; WARN: Return type mismatch float vs object.
(defbehavior prebot-setup-shot-offsets prebot ()
(let* ((f30-0 -2048.0)
(f28-0 12288.0)
(v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-4 (the-as number (logior #x3f800000 v1-3)))
)
(set! (-> self shot-extra-y) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-4)))))
)
(let* ((f30-1 12288.0)
(f28-1 8192.0)
(v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-10 (the-as number (logior #x3f800000 v1-9)))
)
(set! (-> self shot-extra-xz) (+ f30-1 (* f28-1 (+ -1.0 (the-as float v1-10)))))
)
(let* ((v1-13 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-14 (the-as number (logior #x3f800000 v1-13)))
)
(if (< (+ -1.0 (the-as float v1-14)) 0.5)
(set! (-> self shot-extra-xz) (- (-> self shot-extra-xz)))
)
)
)
;; failed to figure out what this is:
(defstate watch-pillars (prebot)
:virtual #t
:event prebot-handler
:enter (behavior ()
(set-time! (-> self state-time))
(cond
((and (logtest? (-> self flags) (prebot-flag pf1)) (logtest? (-> self flags) (prebot-flag pf2)))
(set! (-> self pillar-hint-timer) 0)
0
)
(else
(set-time! (-> self pillar-hint-timer))
)
)
(set-time! (-> self minecar-hint-timer))
(case (-> self stage)
((1)
(set! (-> self num-attacks) (the-as uint 20))
)
((2)
(set! (-> self num-attacks) (the-as uint 15))
)
(else
(set! (-> self num-attacks) (the-as uint 10))
)
)
(prebot-setup-shot-offsets)
(set-setting! 'entity-name "camera-312" 0.0 0)
)
:exit (behavior ()
(blend-to-off! (-> self shoulder-aim-jm) (seconds 0.1) #f)
(prebot-set-cam-slave-fov 11650.845)
(set-setting! 'entity-name "camera-308" 0.0 0)
)
:trans (behavior ()
(when (send-event self 'railblocker-hittable? #f)
(set! (-> self pillar-hint-timer) 0)
0
)
(when (nonzero? (-> self pillar-hint-timer))
(set! (-> self minecar-hint-timer) (+ (current-time) (seconds -4)))
(when (time-elapsed? (-> self pillar-hint-timer) (seconds 10))
(set! (-> self pillar-hint-timer) 0)
(cond
((not (logtest? (-> self flags) (prebot-flag pf1)))
(talker-spawn-func (-> *talker-speech* 328) *entity-pool* (target-pos 0) (the-as region #f))
(logior! (-> self flags) (prebot-flag pf1))
)
((not (logtest? (-> self flags) (prebot-flag pf2)))
(talker-spawn-func (-> *talker-speech* 330) *entity-pool* (target-pos 0) (the-as region #f))
(logior! (-> self flags) (prebot-flag pf2))
)
)
(let ((v1-28 (-> self entity extra perm)))
(logior! (-> v1-28 status) (entity-perm-status bit-5))
(set! (-> v1-28 user-object 0) (-> self flags))
)
)
)
(when (and (nonzero? (-> self minecar-hint-timer)) (time-elapsed? (-> self minecar-hint-timer) (seconds 10)))
(set! (-> self minecar-hint-timer) 0)
(cond
((< 1 (-> self stage))
(when (not (logtest? (-> self flags) (prebot-flag pf6)))
(talker-spawn-func (-> *talker-speech* 333) *entity-pool* (target-pos 0) (the-as region #f))
(logior! (-> self flags) (prebot-flag pf6))
)
)
((not (logtest? (-> self flags) (prebot-flag pf3)))
(talker-spawn-func (-> *talker-speech* 327) *entity-pool* (target-pos 0) (the-as region #f))
(logior! (-> self flags) (prebot-flag pf3))
)
((not (logtest? (-> self flags) (prebot-flag pf4)))
(talker-spawn-func (-> *talker-speech* 329) *entity-pool* (target-pos 0) (the-as region #f))
(logior! (-> self flags) (prebot-flag pf4))
)
((not (logtest? (-> self flags) (prebot-flag pf5)))
(talker-spawn-func (-> *talker-speech* 332) *entity-pool* (target-pos 0) (the-as region #f))
(logior! (-> self flags) (prebot-flag pf5))
)
)
(let ((v1-63 (-> self entity extra perm)))
(logior! (-> v1-63 status) (entity-perm-status bit-5))
(set! (-> v1-63 user-object 0) (-> self flags))
)
)
(if (= (get-aspect-ratio) 'aspect16x9)
(prebot-set-cam-slave-fov 13653.333)
(prebot-set-cam-slave-fov 11650.845)
)
(let ((v1-68 (ja-group)))
(cond
((and v1-68 (= v1-68 prebot-gun-from-tentacle-ja))
(ja :num! (seek!))
(when (ja-done? 0)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-gun-target-ja :num! min)
(set-time! (-> self state-time))
(prebot-setup-shot-offsets)
)
)
((let ((v1-90 (ja-group)))
(and v1-90 (= v1-90 prebot-gun-fire-ja))
)
(ja :num! (seek!))
(when (ja-done? 0)
(if (>= (the-as uint 1) (-> self num-attacks))
(go-virtual destroy-pillars)
)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-gun-target-ja :num! min)
(set-time! (-> self state-time))
(prebot-setup-shot-offsets)
)
)
((let ((v1-117 (ja-group)))
(and v1-117 (= v1-117 prebot-gun-target-ja))
)
(ja :num! (loop!))
(cond
((time-elapsed? (-> self state-time) (seconds 1))
(send-event (handle->process (-> self gun)) 'fire)
(prebot-light-flash 1.0 0.4 0.0)
(+! (-> self num-attacks) -1)
(set-time! (-> self state-time))
(blend-to-off! (-> self shoulder-aim-jm) (seconds 0.1) #f)
(ja-channel-push! 1 (seconds 0.1))
(ja :group! prebot-gun-fire-ja :num! min)
)
(else
(blend-on! (-> self shoulder-aim-jm) (seconds 0.25) 1.0 #f)
(let ((gp-10 (new 'stack-no-clear 'vector)))
(vector-copy! gp-10 (target-pos 0))
(let ((s5-6 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node prebot-lod0-jg shoulderL))))
(+! (-> gp-10 y) (-> self shot-extra-y))
(set! (-> s5-6 y) (-> s5-6 x))
(set! (-> s5-6 x) (-> s5-6 z))
(set! (-> s5-6 z) (- (-> s5-6 y)))
(set! (-> s5-6 y) 0.0)
(vector-normalize! s5-6 (-> self shot-extra-xz))
(vector+! gp-10 gp-10 s5-6)
)
(set-target! (-> self shoulder-aim-jm) gp-10)
)
)
)
)
((let ((v1-154 (ja-group)))
(and v1-154 (= v1-154 prebot-tentacle-stow-ja))
)
(ja :num! (seek!))
(when (ja-done? 0)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-gun-from-tentacle-ja :num! min)
(set! (-> self gun)
(ppointer->handle (process-spawn prebot-gun "gun-" (-> self root trans) :name "prebot-gun" :to self))
)
(setup-masks (-> self draw) 0 0)
(dotimes (gp-13 5)
(let ((a0-81 (handle->process (-> self tentacles gp-13))))
(if a0-81
(deactivate a0-81)
)
)
)
)
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-tentacle-stow-ja :num! min)
)
)
)
(prebot-common)
)
:code sleep-code
:post (behavior ()
(transform-post)
(do-push-aways (-> self root))
)
)
;; definition for function prebot-fire-tentacle
;; INFO: Used lq/sq
;; WARN: Return type mismatch none vs object.
(defbehavior prebot-fire-tentacle prebot ((arg0 handle) (arg1 vector))
(let ((s5-0 (new 'stack-no-clear 'vector)))
(vector-copy! s5-0 (-> self root trans))
(let ((v1-2 (handle->process arg0)))
(if v1-2
(vector<-cspace! s5-0 (-> (the-as prebot-tentacle v1-2) node-list data 14))
)
)
(let ((a2-0 (new 'stack-no-clear 'vector)))
(vector-! a2-0 arg1 s5-0)
(set! (-> *part-id-table* 4469 init-specs 4 initial-valuef) (vector-length a2-0))
(draw-beam (-> *part-id-table* 4469) s5-0 a2-0 #f)
)
(launch-particles (-> *part-id-table* 4470) s5-0)
)
(launch-particles (-> *part-id-table* 4471) arg1)
)
;; failed to figure out what this is:
(defstate create-pillars (prebot)
:virtual #t
:event prebot-handler
:enter (behavior ()
(set-time! (-> self state-time))
(set! (-> self num-attacks) (the-as uint 0))
(set-setting! 'entity-name "camera-309" 0.0 0)
(set-mined-pillar-texture! 0.0)
)
:exit (behavior ()
(set-setting! 'entity-name "camera-312" 0.0 0)
(set-mined-pillar-texture! 1.0)
(let ((a0-3 (handle->process (-> self beam-projectile))))
(when a0-3
(deactivate a0-3)
(set! (-> self beam-projectile) (the-as handle #f))
)
)
)
:trans (behavior ()
(let* ((s5-0 (new 'stack-no-clear 'vector))
(s4-0 (new 'stack-no-clear 'vector))
(v1-0 (-> self stage))
(gp-0 (cond
((= v1-0 1)
(new 'static 'boxed-array :type prebot-eco-pillar-launch-spec
(new 'static 'prebot-eco-pillar-launch-spec
:offset (new 'static 'vector :x 40960.0 :z 163840.0 :w 1.0)
:height 12288.0
)
(new 'static 'prebot-eco-pillar-launch-spec
:offset (new 'static 'vector :x 20480.0 :z 204800.0 :w 1.0)
:height 22528.0
:style 1
)
(new 'static 'prebot-eco-pillar-launch-spec
:offset (new 'static 'vector :x -20480.0 :z 204800.0 :w 1.0)
:height 32768.0
:style 2
)
(new 'static 'prebot-eco-pillar-launch-spec
:offset (new 'static 'vector :z 184320.0 :w 1.0)
:height 43008.0
:style 3
)
(new 'static 'prebot-eco-pillar-launch-spec
:offset (new 'static 'vector :x -40960.0 :z 163840.0 :w 1.0)
:height 53248.0
)
)
)
((= v1-0 2)
(new 'static 'boxed-array :type prebot-eco-pillar-launch-spec
(new 'static 'prebot-eco-pillar-launch-spec
:offset (new 'static 'vector :x 12288.0 :z 184320.0 :w 1.0)
:height 12288.0
)
(new 'static 'prebot-eco-pillar-launch-spec
:offset (new 'static 'vector :x -40960.0 :z 204800.0 :w 1.0)
:height 22528.0
:style 1
)
(new 'static 'prebot-eco-pillar-launch-spec
:offset (new 'static 'vector :x -32768.0 :z 163840.0 :w 1.0)
:height 32768.0
:style 2
)
(new 'static 'prebot-eco-pillar-launch-spec
:offset (new 'static 'vector :z 131072.0 :w 1.0)
:height 43008.0
:style 3
)
(new 'static 'prebot-eco-pillar-launch-spec
:offset (new 'static 'vector :x 49152.0 :z 143360.0 :w 1.0)
:height 53248.0
)
)
)
(else
(new 'static 'boxed-array :type prebot-eco-pillar-launch-spec
(new 'static 'prebot-eco-pillar-launch-spec
:offset (new 'static 'vector :x -73728.0 :z 163840.0 :w 1.0)
:height 12288.0
)
(new 'static 'prebot-eco-pillar-launch-spec
:offset (new 'static 'vector :x -40960.0 :z 204800.0 :w 1.0)
:height 22528.0
:style 1
)
(new 'static 'prebot-eco-pillar-launch-spec
:offset (new 'static 'vector :x -20480.0 :z 163840.0 :w 1.0)
:height 32768.0
:style 2
)
(new 'static 'prebot-eco-pillar-launch-spec
:offset (new 'static 'vector :x 24576.0 :z 163840.0 :w 1.0)
:height 43008.0
:style 3
)
(new 'static 'prebot-eco-pillar-launch-spec
:offset (new 'static 'vector :x 8192.0 :z 204800.0 :w 1.0)
:height 53248.0
)
)
)
)
)
)
(let ((f30-0 0.0))
(set! (-> self num-attacks) (the-as uint 0))
(dotimes (s3-0 (min 5 (-> gp-0 length)))
(vector+! s5-0 (-> gp-0 s3-0 offset) (-> self original-position))
(vector-copy! s4-0 s5-0)
(+! (-> s4-0 x)
(* 4096.0 (cos (* 1747.6267 (the float (+ (* 30 s3-0) (- (current-time) (-> self state-time)))))))
)
(cond
((not (time-elapsed? (-> self state-time) (+ (* 240 s3-0) 75)))
(send-event (handle->process (-> self tentacles s3-0)) 'look-at s5-0 #f)
)
((not (handle->process (-> self pillars s3-0)))
(let ((v1-27 (process-spawn prebot-eco-pillar s5-0 (-> gp-0 s3-0) :name "prebot-eco-pillar" :to self)))
(if v1-27
(set! (-> self pillars s3-0) (ppointer->handle v1-27))
)
)
(send-event (handle->process (-> self tentacles s3-0)) 'look-at s5-0 #t)
)
(else
(set! f30-0 (cond
((not (time-elapsed? (-> self state-time) (+ (* 240 s3-0) 1575)))
(prebot-fire-tentacle (-> self tentacles s3-0) s4-0)
(+ 1.0 f30-0)
)
(else
(send-event (handle->process (-> self tentacles s3-0)) 'look-at #f #f)
f30-0
)
)
)
)
)
(let ((v1-63 (handle->process (-> self pillars s3-0))))
(when v1-63
(if (and (-> v1-63 next-state) (= (-> v1-63 next-state name) 'wait-to-cool))
(+! (-> self num-attacks) 1)
)
)
)
)
(if (= f30-0 0.0)
(prebot-light-pulse-off)
(prebot-light-pulse-on (+ 0.2 (/ f30-0 10)) (+ 0.1 (/ f30-0 25)) 0.0)
)
)
(when (>= (-> self num-attacks) (the-as uint (min 5 (-> gp-0 length))))
(dotimes (s5-1 (min 5 (-> gp-0 length)))
(send-event (handle->process (-> self pillars s5-1)) 'cool-down)
)
(sound-play "pillar-cool")
(go-virtual watch-pillars)
)
)
(ja :num! (loop!))
(prebot-common)
)
:code sleep-code
:post (behavior ()
(transform-post)
(do-push-aways (-> self root))
)
)
;; failed to figure out what this is:
(defstate activate-tentacles (prebot)
:virtual #t
:event prebot-handler
:trans (behavior ()
(let ((v1-2 (ja-group)))
(cond
((and v1-2 (= v1-2 prebot-tentacle-launch-ja))
(ja :num! (seek!))
(when (and (not (-> self grunt-played)) (or (and (= (-> self stage) 1) (>= (ja-aframe-num 0) 165.0))
(and (= (-> self stage) 2) (>= (ja-aframe-num 0) 167.0))
(and (= (-> self stage) 3) (>= (ja-aframe-num 0) 178.0))
)
)
(set! (-> self grunt-played) #t)
(case (-> self stage)
((1)
(sound-play "prebot-grunts" :position (-> self root trans))
)
((2)
(sound-play "prebot-trythis" :position (-> self root trans))
)
((3)
(sound-play "prebot-greeting" :position (-> self root trans))
)
)
)
(when (ja-done? 0)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-hatch-hover-ja :num! min)
(go-virtual create-pillars)
)
)
(else
(let ((v1-53 (ja-group)))
(cond
((and v1-53 (= v1-53 prebot-tentacle-launch-pre-ja))
(ja :num! (seek!))
(when (ja-done? 0)
(set! (-> self tentacles 0)
(ppointer->handle
(process-spawn prebot-tentacle "a-" (-> self root trans) 47 :name "prebot-tentacle" :to self)
)
)
(set! (-> self tentacles 1)
(ppointer->handle
(process-spawn prebot-tentacle "b-" (-> self root trans) 48 :name "prebot-tentacle" :to self)
)
)
(set! (-> self tentacles 2)
(ppointer->handle
(process-spawn prebot-tentacle "c-" (-> self root trans) 49 :name "prebot-tentacle" :to self)
)
)
(set! (-> self tentacles 3)
(ppointer->handle
(process-spawn prebot-tentacle "d-" (-> self root trans) 45 :name "prebot-tentacle" :to self)
)
)
(set! (-> self tentacles 4)
(ppointer->handle
(process-spawn prebot-tentacle "e-" (-> self root trans) 46 :name "prebot-tentacle" :to self)
)
)
(ja-channel-push! 1 0)
(ja :group! prebot-tentacle-launch-ja :num! min)
(set! (-> self grunt-played) #f)
)
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-tentacle-launch-pre-ja :num! min)
(setup-masks (-> self draw) 0 0)
)
)
)
)
)
)
(prebot-common)
)
:code sleep-code
:post (behavior ()
(transform-post)
(do-push-aways (-> self root))
)
)
;; failed to figure out what this is:
(defstate watch-critters (prebot)
:virtual #t
:event prebot-handler
:enter (behavior ()
(set-time! (-> self state-time))
)
:trans (behavior ()
(let ((v1-2 (ja-group)))
(cond
((and v1-2 (= v1-2 prebot-idle-ja))
(ja :num! (loop!))
(dotimes (gp-0 28)
(let ((a0-6 (handle->process (-> self critters gp-0))))
(when a0-6
(if (or (time-elapsed? (-> self state-time) (seconds 45))
(< (-> (the-as process-drawable a0-6) root trans y) (+ -40960.0 (-> self entity extra trans y)))
)
(send-event a0-6 'instant-death)
(goto cfg-26)
)
)
)
)
(go-virtual activate-tentacles)
(label cfg-26)
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-idle-ja :num! min)
)
)
)
(prebot-common)
)
:code sleep-code
:post (behavior ()
(transform-post)
(do-push-aways (-> self root))
)
)
;; definition for function prebot-launch-critter
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs object.
(defbehavior prebot-launch-critter prebot ()
(cond
((zero? (-> self nav))
(format #t "ERROR<GMJ>: ~s nav mesh not found~%" (-> self name))
(set! (-> self critters-to-launch) 0)
0
)
(else
(let ((s4-0 (new 'stack-no-clear 'enemy-init-by-other-params))
(gp-0 (new 'stack-no-clear 'vector))
(s5-0 (new 'stack-no-clear 'vector))
)
(let ((s3-0 (handle->process (-> self gun))))
(cond
(s3-0
(vector<-cspace! gp-0 (-> (the-as process-drawable s3-0) node-list data 7))
(if (logtest? (-> group-prebot-launch-critter flags) (sp-group-flag sp13))
(part-tracker-spawn
part-tracker-subsampler
:to *entity-pool*
:group group-prebot-launch-critter
:duration (seconds 1)
:mat-joint (-> (the-as process-drawable s3-0) node-list data 7 bone transform)
)
(part-tracker-spawn
part-tracker
:to *entity-pool*
:group group-prebot-launch-critter
:duration (seconds 1)
:mat-joint (-> (the-as process-drawable s3-0) node-list data 7 bone transform)
)
)
)
(else
(vector<-cspace! gp-0 (joint-node prebot-lod0-jg head))
)
)
)
(vector-copy! s5-0 (-> self nav state mesh bounds))
(case (-> self stage)
((1)
(+! (-> s5-0 x) 61440.0)
(set! (-> s5-0 x) (- (-> s5-0 x) (* 32768.0 (the float (-> self critters-to-launch)))))
)
(else
(+! (-> s5-0 x) 61440.0)
(set! (-> s5-0 x) (- (-> s5-0 x) (* 28672.0 (the float (-> self critters-to-launch)))))
)
)
(vector-copy! (-> s4-0 trans) gp-0)
(quaternion-copy! (-> s4-0 quat) (-> self root quat))
(set! (-> s4-0 entity) (-> self entity))
(set! (-> s4-0 directed?) #f)
(set! (-> s4-0 no-initial-move-to-ground?) #f)
(set! (-> s4-0 art-level) #f)
(let ((v1-53 (process-spawn
prebot-large-eco-creature
:init enemy-init-by-other
self
s4-0
:name "prebot-large-eco-creature"
:to self
)
)
)
(when v1-53
(send-event (ppointer->process v1-53) 'set-dest gp-0 s5-0 #x46c00000 #x44160000)
(+! (-> self critters-to-launch) -1)
(prebot-light-flash 1.0 0.4 0.0)
(sound-play "launch-cav-eco" :position gp-0)
(the-as int (sound-play "launch-whoosh" :position gp-0))
)
)
)
)
)
)
;; failed to figure out what this is:
(defstate launch-critters (prebot)
:virtual #t
:event prebot-handler
:enter (behavior ()
(case (-> self stage)
((1)
(set! (-> self critters-to-launch) 2)
)
(else
(set! (-> self critters-to-launch) 3)
)
)
)
:exit (behavior ()
(sound-play "boss-win-vox" :position (-> self root trans))
)
:trans (behavior ()
(let ((v1-2 (ja-group)))
(cond
((and v1-2 (= v1-2 prebot-gun-stow-ja))
(ja :num! (seek!))
(when (ja-done? 0)
(let ((a0-7 (handle->process (-> self gun))))
(if a0-7
(deactivate a0-7)
)
)
(go-virtual watch-critters)
)
)
(else
(let ((v1-25 (ja-group)))
(cond
((and v1-25 (= v1-25 prebot-gun-launch-ja))
(ja :num! (seek!))
(when (ja-done? 0)
(cond
((= (-> self critters-to-launch) 1)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-gun-stow-ja :num! min)
)
(else
(ja :num-func num-func-identity :frame-num 0.0)
)
)
(prebot-launch-critter)
)
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-gun-launch-ja :num! min)
(prebot-launch-critter)
)
)
)
)
)
)
(prebot-common)
)
:code sleep-code
:post (behavior ()
(transform-post)
(do-push-aways (-> self root))
)
)
;; failed to figure out what this is:
(defstate sweep-done (prebot)
:virtual #t
:event prebot-handler
:enter (behavior ()
(set! (-> self position target quad) (-> self original-position quad))
(set! (-> self position target y) (-> self original-position y))
)
:exit (behavior ()
(dotimes (gp-0 2)
(let ((a0-1 (handle->process (-> self swords gp-0))))
(if a0-1
(deactivate a0-1)
)
)
)
(prebot-light-pulse-off)
)
:trans (behavior ()
(let ((v1-2 (ja-group)))
(cond
((and v1-2 (= v1-2 prebot-swords-horizontal-R2L-hold-ja))
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-swords-horizontal-R2L-complete-ja :num! min)
)
((let ((v1-12 (ja-group)))
(and v1-12 (= v1-12 prebot-sword-R-horizontal-R2L-hold-ja))
)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-R-horizontal-R2L-complete-ja :num! min)
)
((let ((v1-22 (ja-group)))
(and v1-22 (= v1-22 prebot-sword-R-horizontal-L2R-hold-ja))
)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-R-horizontal-L2R-complete-ja :num! min)
)
((let ((v1-32 (ja-group)))
(and v1-32 (= v1-32 prebot-swords-horizontal-R2L-hold-ja))
)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-swords-horizontal-R2L-complete-ja :num! min)
)
((let ((v1-42 (ja-group)))
(and v1-42 (= v1-42 prebot-sword-L-horizontal-R2L-hold-ja))
)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-L-horizontal-R2L-complete-ja :num! min)
)
((let ((v1-52 (ja-group)))
(and v1-52 (= v1-52 prebot-sword-L-horizontal-L2R-hold-ja))
)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-L-horizontal-L2R-complete-ja :num! min)
)
((let ((v1-62 (ja-group)))
(and v1-62 (or (= v1-62 prebot-sword-R-horizontal-L2R-complete-ja)
(= v1-62 prebot-sword-R-horizontal-R2L-complete-ja)
(= v1-62 prebot-sword-L-horizontal-L2R-complete-ja)
(= v1-62 prebot-sword-L-horizontal-R2L-complete-ja)
(= v1-62 prebot-swords-horizontal-L2R-complete-ja)
(= v1-62 prebot-swords-horizontal-R2L-complete-ja)
)
)
)
(ja :num! (seek!))
(when (ja-done? 0)
(dotimes (gp-6 2)
(let ((a0-58 (handle->process (-> self swords gp-6))))
(if a0-58
(deactivate a0-58)
)
)
)
(setup-masks (-> self draw) 28 0)
(prebot-light-pulse-off)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-gun-from-sword-R-ja :num! min)
(set! (-> self gun)
(ppointer->handle (process-spawn prebot-gun "gun-" (-> self root trans) :name "prebot-gun" :to self))
)
)
)
(else
(let ((v1-99 (ja-group)))
(cond
((and v1-99 (= v1-99 prebot-gun-from-sword-R-ja))
(ja :num! (seek!))
(when (ja-done? 0)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-gun-aim-ja :num! min)
)
)
(else
(if (< (vector-vector-distance-squared (-> self position target) (-> self position value)) (square 1024.0))
(go-virtual launch-critters)
)
(ja :num! (loop!))
)
)
)
)
)
)
(prebot-common)
)
:code sleep-code
:post (behavior ()
(transform-post)
(do-push-aways (-> self root))
)
)
;; failed to figure out what this is:
(defstate sweep (prebot)
:virtual #t
:event prebot-handler
:enter (behavior ()
(prebot-method-46 self)
(case (-> self stage)
((1)
(set! (-> self num-attacks) (the-as uint 2))
(set! (-> self position max-vel) 1638.4)
)
((2)
(set! (-> self num-attacks) (the-as uint 3))
(set! (-> self position max-vel) 2048.0)
)
(else
(set! (-> self num-attacks) (the-as uint 3))
(set! (-> self position max-vel) 2457.6)
)
)
(set! (-> self position accel) 409.6)
(set! (-> self position max-partial) 0.99)
(dotimes (gp-0 2)
(send-event (handle->process (-> self swords gp-0)) 'whoosh-lead (* 15.0 (-> self position max-vel)))
(send-event (handle->process (-> self swords gp-0)) 'use-pos-pitch #t)
)
)
:exit (behavior ()
(prebot-method-45 self)
(set! (-> self position accel) 0.004096)
(set! (-> self position max-vel) 2048.0)
(set! (-> self position max-partial) 0.125)
(dotimes (gp-0 2)
(send-event (handle->process (-> self swords gp-0)) 'scale #x3f800000)
(send-event (handle->process (-> self swords gp-0)) 'use-pos-pitch #f)
)
)
:trans (behavior ()
(let ((v1-2 (ja-group)))
(cond
((and v1-2 (= v1-2 prebot-swords-horizontal-R2L-strike-ja))
(ja :num! (seek!))
(cond
((>= (ja-aframe-num 0) 195.0)
(set! (-> self position target x) (+ -94208.0 (-> self original-position x)))
)
((>= (ja-aframe-num 0) 190.0)
(dotimes (gp-0 2)
(send-event (handle->process (-> self swords gp-0)) 'scale #x3ff33333)
)
)
)
(when (ja-done? 0)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-swords-horizontal-R2L-hold-ja :num! min)
)
)
((let ((v1-39 (ja-group)))
(and v1-39 (= v1-39 prebot-swords-horizontal-L2R-strike-ja))
)
(ja :num! (seek!))
(when (>= (ja-aframe-num 0) 231.0)
(set! (-> self position target x) (+ 94208.0 (-> self original-position x)))
(dotimes (gp-2 2)
(send-event (handle->process (-> self swords gp-2)) 'scale #x3ff33333)
)
)
(when (ja-done? 0)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-swords-horizontal-L2R-hold-ja :num! min)
)
)
((let ((v1-73 (ja-group)))
(and v1-73 (= v1-73 prebot-sword-R-horizontal-R2L-strike-ja))
)
(ja :num! (seek!))
(cond
((>= (ja-aframe-num 0) 252.0)
(set! (-> self position target x) (+ -94208.0 (-> self original-position x)))
)
((>= (ja-aframe-num 0) 248.0)
(dotimes (gp-4 2)
(send-event (handle->process (-> self swords gp-4)) 'scale #x3ff33333)
)
)
)
(when (ja-done? 0)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-R-horizontal-R2L-hold-ja :num! min)
)
)
((let ((v1-110 (ja-group)))
(and v1-110 (= v1-110 prebot-sword-R-horizontal-L2R-strike-ja))
)
(ja :num! (seek!))
(when (>= (ja-aframe-num 0) 207.0)
(set! (-> self position target x) (+ 94208.0 (-> self original-position x)))
(dotimes (gp-6 2)
(send-event (handle->process (-> self swords gp-6)) 'scale #x3ff33333)
)
)
(when (ja-done? 0)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-R-horizontal-L2R-hold-ja :num! min)
)
)
((let ((v1-144 (ja-group)))
(and v1-144 (= v1-144 prebot-sword-L-horizontal-R2L-strike-ja))
)
(ja :num! (seek!))
(when (>= (ja-aframe-num 0) 207.0)
(set! (-> self position target x) (+ -94208.0 (-> self original-position x)))
(dotimes (gp-8 2)
(send-event (handle->process (-> self swords gp-8)) 'scale #x3ff33333)
)
)
(when (ja-done? 0)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-L-horizontal-R2L-hold-ja :num! min)
)
)
((let ((v1-178 (ja-group)))
(and v1-178 (= v1-178 prebot-sword-L-horizontal-L2R-strike-ja))
)
(ja :num! (seek!))
(cond
((>= (ja-aframe-num 0) 252.0)
(set! (-> self position target x) (+ 94208.0 (-> self original-position x)))
)
((>= (ja-aframe-num 0) 248.0)
(dotimes (gp-10 2)
(send-event (handle->process (-> self swords gp-10)) 'scale #x3ff33333)
)
)
)
(when (ja-done? 0)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-L-horizontal-L2R-hold-ja :num! min)
)
)
((let ((v1-215 (ja-group)))
(and v1-215 (or (= v1-215 prebot-sword-R-horizontal-R2L-hold-ja)
(= v1-215 prebot-sword-R-horizontal-L2R-hold-ja)
(= v1-215 prebot-sword-L-horizontal-R2L-hold-ja)
(= v1-215 prebot-sword-L-horizontal-L2R-hold-ja)
(= v1-215 prebot-swords-horizontal-R2L-hold-ja)
(= v1-215 prebot-swords-horizontal-L2R-hold-ja)
)
)
)
(ja :num! (loop!))
(dotimes (gp-12 2)
(send-event (handle->process (-> self swords gp-12)) 'scale #x3ff33333)
)
(when (< (vector-vector-distance-squared (-> self position target) (-> self position value)) (square 1024.0))
(dotimes (gp-13 2)
(send-event (handle->process (-> self swords gp-13)) 'scale #x3f800000)
)
(+! (-> self num-attacks) -1)
(if (<= (-> self num-attacks) 0)
(go-virtual sweep-done)
)
(let ((v1-258 (ja-group)))
(cond
((and v1-258 (= v1-258 prebot-swords-horizontal-R2L-hold-ja))
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-swords-horizontal-R2L-return-ja :num! min)
(set! (-> self position target y) (+ -34816.0 (-> self original-position y)))
)
((let ((v1-270 (ja-group)))
(and v1-270 (= v1-270 prebot-swords-horizontal-L2R-hold-ja))
)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-swords-horizontal-L2R-return-ja :num! min)
(set! (-> self position target y) (+ -34816.0 (-> self original-position y)))
)
((let ((v1-282 (ja-group)))
(and v1-282 (= v1-282 prebot-sword-R-horizontal-R2L-hold-ja))
)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-R-horizontal-R2L-return-ja :num! min)
(set! (-> self position target y) (+ -36864.0 (-> self original-position y)))
)
((let ((v1-294 (ja-group)))
(and v1-294 (= v1-294 prebot-sword-R-horizontal-L2R-hold-ja))
)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-R-horizontal-L2R-return-ja :num! min)
(set! (-> self position target y) (+ -36864.0 (-> self original-position y)))
)
(else
(let ((v1-306 (ja-group)))
(cond
((and v1-306 (= v1-306 prebot-sword-L-horizontal-R2L-hold-ja))
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-L-horizontal-R2L-return-ja :num! min)
(set! (-> self position target y) (+ -36864.0 (-> self original-position y)))
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-L-horizontal-L2R-return-ja :num! min)
(set! (-> self position target y) (+ -36864.0 (-> self original-position y)))
)
)
)
)
)
)
)
)
((let ((v1-325 (ja-group)))
(and v1-325 (or (= v1-325 prebot-sword-R-horizontal-R2L-return-ja)
(= v1-325 prebot-sword-L-horizontal-R2L-return-ja)
(= v1-325 prebot-swords-horizontal-R2L-return-ja)
)
)
)
(ja :num! (seek!))
(when (ja-done? 0)
(dotimes (gp-20 2)
(send-event (handle->process (-> self swords gp-20)) 'whoosh-lead (* 15.0 (-> self position max-vel)))
)
(let ((v1-352 (ja-group)))
(cond
((and v1-352 (= v1-352 prebot-swords-horizontal-R2L-return-ja))
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-swords-horizontal-L2R-strike-ja :num! min)
)
(else
(let ((v1-362 (ja-group)))
(cond
((and v1-362 (= v1-362 prebot-sword-R-horizontal-R2L-return-ja))
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-R-horizontal-L2R-strike-ja :num! min)
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-L-horizontal-L2R-strike-ja :num! min)
)
)
)
)
)
)
)
)
((let ((v1-377 (ja-group)))
(and v1-377 (or (= v1-377 prebot-sword-R-horizontal-L2R-return-ja)
(= v1-377 prebot-sword-L-horizontal-L2R-return-ja)
(= v1-377 prebot-swords-horizontal-L2R-return-ja)
)
)
)
(ja :num! (seek!))
(when (ja-done? 0)
(dotimes (gp-24 2)
(send-event (handle->process (-> self swords gp-24)) 'whoosh-lead (* 15.0 (-> self position max-vel)))
)
(let ((v1-404 (ja-group)))
(cond
((and v1-404 (= v1-404 prebot-swords-horizontal-L2R-return-ja))
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-swords-horizontal-R2L-strike-ja :num! min)
)
(else
(let ((v1-414 (ja-group)))
(cond
((and v1-414 (= v1-414 prebot-sword-R-horizontal-L2R-return-ja))
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-R-horizontal-R2L-strike-ja :num! min)
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-L-horizontal-R2L-strike-ja :num! min)
)
)
)
)
)
)
)
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-R-horizontal-L2R-strike-ja :num! min)
)
)
)
(prebot-common)
)
:code sleep-code
:post (behavior ()
(transform-post)
(do-push-aways (-> self root))
)
)
;; failed to figure out what this is:
(defstate slam-done (prebot)
:virtual #t
:event prebot-handler
:enter (behavior ()
(case (-> self stage)
((1)
(set! (-> self position target x) (+ -94208.0 (-> self original-position x)))
(set! (-> self position target y) (+ -36864.0 (-> self original-position y)))
)
((2)
(set! (-> self position target x) (+ 94208.0 (-> self original-position x)))
(set! (-> self position target y) (+ -36864.0 (-> self original-position y)))
)
(else
(set! (-> self position target x) (+ 94208.0 (-> self original-position x)))
(set! (-> self position target y) (+ -34816.0 (-> self original-position y)))
)
)
)
:trans (behavior ()
(let ((v1-2 (ja-group)))
(cond
((and v1-2 (or (= v1-2 prebot-sword-R-strike2pose-ja)
(= v1-2 prebot-sword-L-strike2pose-ja)
(= v1-2 prebot-swords-strike2pose-ja)
)
)
(ja :num! (seek!))
(when (ja-done? 0)
(set! (-> self trythis-played) #f)
(let ((v1-16 (ja-group)))
(cond
((and v1-16 (= v1-16 prebot-swords-strike2pose-ja))
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-swords-pose-ja :num! min)
)
(else
(let ((v1-26 (ja-group)))
(cond
((and v1-26 (= v1-26 prebot-sword-R-strike2pose-ja))
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-R-pose-ja :num! min)
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-L-pose-ja :num! min)
)
)
)
)
)
)
)
)
((let ((v1-41 (ja-group)))
(and v1-41
(or (= v1-41 prebot-sword-R-pose-ja) (= v1-41 prebot-sword-L-pose-ja) (= v1-41 prebot-swords-pose-ja))
)
)
(ja :num! (seek!))
(when (and (not (-> self trythis-played)) (or (and (= (-> self stage) 1)
(let ((v1-59 (ja-group)))
(and v1-59 (= v1-59 prebot-sword-R-pose-ja))
)
(>= (ja-aframe-num 0) 162.0)
)
(and (= (-> self stage) 2)
(let ((v1-68 (ja-group)))
(and v1-68 (= v1-68 prebot-sword-L-pose-ja))
)
(>= (ja-aframe-num 0) 156.0)
)
(and (= (-> self stage) 3)
(let ((v1-76 (ja-group)))
(and v1-76 (= v1-76 prebot-swords-pose-ja))
)
(>= (ja-aframe-num 0) 166.0)
)
)
)
(set! (-> self trythis-played) #t)
(case (-> self stage)
((1)
(sound-play "prebot-trythis" :position (-> self root trans))
)
((2)
(sound-play "prebot-grunts" :position (-> self root trans))
)
((2)
(sound-play "prebot-harumph" :position (-> self root trans))
)
)
)
(when (ja-done? 0)
(let ((v1-99 (ja-group)))
(cond
((and v1-99 (= v1-99 prebot-swords-pose-ja))
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-swords-horizontal-R2L-pre-ja :num! min)
)
(else
(let ((v1-109 (ja-group)))
(cond
((and v1-109 (= v1-109 prebot-sword-R-pose-ja))
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-R-horizontal-L2R-pre-ja :num! min)
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-L-horizontal-R2L-pre-ja :num! min)
)
)
)
)
)
)
)
)
(else
(let ((v1-124 (ja-group)))
(cond
((and v1-124 (or (= v1-124 prebot-sword-R-horizontal-L2R-pre-ja)
(= v1-124 prebot-sword-L-horizontal-R2L-pre-ja)
(= v1-124 prebot-swords-horizontal-R2L-pre-ja)
)
)
(ja :num! (seek!))
(when (ja-done? 0)
(let ((v1-138 (ja-group)))
(cond
((and v1-138 (= v1-138 prebot-swords-horizontal-R2L-pre-ja))
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-swords-horizontal-R2L-strike-ja :num! min)
)
(else
(let ((v1-148 (ja-group)))
(cond
((and v1-148 (= v1-148 prebot-sword-R-horizontal-L2R-pre-ja))
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-R-horizontal-L2R-strike-ja :num! min)
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-L-horizontal-R2L-strike-ja :num! min)
)
)
)
)
)
)
(go-virtual sweep)
)
)
((let ((v1-166 (ja-group)))
(and v1-166 (= v1-166 prebot-swords-L-vertical-strike-ja))
)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-swords-strike2pose-ja :num! min)
)
(else
(let ((v1-176 (ja-group)))
(cond
((and v1-176 (= v1-176 prebot-sword-R-vertical-strike-ja))
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-R-strike2pose-ja :num! min)
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-L-strike2pose-ja :num! min)
)
)
)
)
)
)
)
)
)
(prebot-common)
)
:code sleep-code
:post (behavior ()
(transform-post)
(do-push-aways (-> self root))
)
)
;; definition for function prebot-spawn-shockwave
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs object.
(defbehavior prebot-spawn-shockwave prebot ()
(let ((gp-0 (new 'stack-no-clear 'vector)))
(vector-copy! gp-0 (-> self root trans))
(let ((s5-0 (quaternion-identity! (new 'stack-no-clear 'quaternion))))
L162
(let* ((v1-6 (ja-group))
(v1-13 (handle->process (-> self swords (if (and v1-6 (= v1-6 prebot-swords-R-vertical-strike-ja))
1
0
)
)
)
)
)
(when v1-13
(vector<-cspace! gp-0 (-> (the-as process-drawable v1-13) node-list data 5))
(+! (-> gp-0 z) -90112.0)
(set! (-> gp-0 y) (+ 4096.0 (-> self original-position y)))
)
)
(quaternion-set! s5-0 0.0 1.0 0.0 0.0)
(process-spawn prebot-shockwave gp-0 s5-0 :name "prebot-shockwave" :to self)
)
(set-zero! *camera-smush-control*)
(activate! *camera-smush-control* 819.2 37 300 1.0 1.1 (-> *display* camera-clock))
(prebot-light-flash 1.0 0.0 0.0)
(sound-play "shockwave" :position gp-0)
(sound-play "sword-hit" :position gp-0)
)
0
)
;; failed to figure out what this is:
(defstate slam (prebot)
:virtual #t
:event prebot-handler
:enter (behavior ()
(set! (-> self position target x) (-> self original-position x))
(set! (-> self position target y) (+ 6144.0 (-> self original-position y)))
(set! (-> self position target z) (+ 61440.0 (-> self original-position z)))
(case (-> self stage)
((1)
(set! (-> self num-attacks) (the-as uint 2))
)
((2)
(set! (-> self num-attacks) (the-as uint 3))
)
(else
(set! (-> self num-attacks) (the-as uint 4))
)
)
)
:trans (behavior ()
(let ((v1-2 (ja-group)))
(cond
((and v1-2 (= v1-2 prebot-sword-grab-both-ja))
(ja :num! (seek!))
(when (ja-done? 0)
(ja-channel-push! 1 (seconds 0.02))
(ja :group! prebot-swords-vertical-pre-ja :num! min)
(setup-masks (-> self draw) 0 24)
(prebot-light-pulse-on 0.7 0.2 0.0)
(set! (-> self swords 0)
(ppointer->handle
(process-spawn prebot-sword "sword-l-" (-> self root trans) 43 #f :name "prebot-sword" :to self)
)
)
(set! (-> self swords 1)
(ppointer->handle
(process-spawn prebot-sword "sword-r-" (-> self root trans) 27 #t :name "prebot-sword" :to self)
)
)
)
)
(else
(let ((v1-35 (ja-group)))
(cond
((and v1-35 (= v1-35 prebot-sword-grab-AR-ja))
(ja :num! (seek!))
(when (ja-done? 0)
(ja-channel-push! 1 (seconds 0.02))
(ja :group! prebot-sword-R-vertical-pre-ja :num! min)
(setup-masks (-> self draw) 0 4)
(prebot-light-pulse-on 0.7 0.2 0.0)
(set! (-> self swords 0)
(ppointer->handle
(process-spawn prebot-sword "sword-" (-> self root trans) 27 #f :name "prebot-sword" :to self)
)
)
)
)
((let ((v1-62 (ja-group)))
(and v1-62 (= v1-62 prebot-sword-grab-AL-ja))
)
(ja :num! (seek!))
(when (ja-done? 0)
(ja-channel-push! 1 (seconds 0.02))
(ja :group! prebot-sword-L-vertical-pre-ja :num! min)
(setup-masks (-> self draw) 0 2)
(prebot-light-pulse-on 0.7 0.2 0.0)
(set! (-> self swords 0)
(ppointer->handle
(process-spawn prebot-sword "sword-" (-> self root trans) 43 #f :name "prebot-sword" :to self)
)
)
)
)
((not (handle->process (-> self swords 0)))
(case (-> self stage)
((1)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-grab-AR-ja :num! min)
)
((2)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-grab-AL-ja :num! min)
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-grab-both-ja :num! min)
)
)
)
((let ((v1-108 (ja-group)))
(and v1-108 (or (= v1-108 prebot-sword-R-vertical-pre-ja)
(= v1-108 prebot-sword-L-vertical-pre-ja)
(= v1-108 prebot-swords-vertical-pre-ja)
)
)
)
(ja :num! (seek!))
(when (ja-done? 0)
(cond
((< (vector-vector-distance-squared (-> self position target) (-> self position value)) (square 1024.0))
(let ((v1-124 (ja-group)))
(cond
((and v1-124 (= v1-124 prebot-swords-vertical-pre-ja))
(ja-channel-push! 1 (seconds 0.02))
(ja :group! prebot-swords-R-vertical-strike-ja :num! min)
)
(else
(let ((v1-134 (ja-group)))
(cond
((and v1-134 (= v1-134 prebot-sword-R-vertical-pre-ja))
(ja-channel-push! 1 (seconds 0.02))
(ja :group! prebot-sword-R-vertical-strike-ja :num! min)
)
(else
(ja-channel-push! 1 (seconds 0.02))
(ja :group! prebot-sword-L-vertical-strike-ja :num! min)
)
)
)
)
)
)
)
((let ((v1-149 (ja-group)))
(and v1-149 (= v1-149 prebot-swords-vertical-pre-ja))
)
(ja-channel-push! 1 (seconds 0.02))
(ja :group! prebot-swords-vertical-hold-ja :num! min)
)
(else
(let ((v1-159 (ja-group)))
(cond
((and v1-159 (= v1-159 prebot-sword-R-vertical-pre-ja))
(ja-channel-push! 1 (seconds 0.02))
(ja :group! prebot-sword-R-vertical-hold-ja :num! min)
)
(else
(ja-channel-push! 1 (seconds 0.02))
(ja :group! prebot-sword-R-vertical-hold-ja :num! min)
)
)
)
)
)
)
)
((let ((v1-174 (ja-group)))
(and (and v1-174 (or (= v1-174 prebot-sword-R-vertical-hold-ja)
(= v1-174 prebot-sword-L-vertical-hold-ja)
(= v1-174 prebot-swords-vertical-hold-ja)
)
)
(< (vector-vector-distance-squared (-> self position target) (-> self position value)) (square 1024.0))
)
)
(let ((v1-182 (ja-group)))
(cond
((and v1-182 (= v1-182 prebot-swords-vertical-hold-ja))
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-swords-R-vertical-strike-ja :num! min)
)
(else
(let ((v1-192 (ja-group)))
(cond
((and v1-192 (= v1-192 prebot-sword-R-vertical-hold-ja))
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-R-vertical-strike-ja :num! min)
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-L-vertical-strike-ja :num! min)
)
)
)
)
)
)
)
((let ((v1-207 (ja-group)))
(and v1-207 (or (= v1-207 prebot-sword-R-vertical-strike-ja)
(= v1-207 prebot-sword-L-vertical-strike-ja)
(= v1-207 prebot-swords-L-vertical-strike-ja)
(= v1-207 prebot-swords-R-vertical-strike-ja)
)
)
)
(ja :num! (seek!))
(when (ja-done? 0)
(prebot-spawn-shockwave)
(+! (-> self num-attacks) -1)
(cond
((zero? (-> self num-attacks))
(go-virtual slam-done)
)
((let ((v1-227 (ja-group)))
(and v1-227 (= v1-227 prebot-swords-R-vertical-strike-ja))
)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-swords-R-vertical-between-ja :num! min)
)
((let ((v1-237 (ja-group)))
(and v1-237 (= v1-237 prebot-swords-L-vertical-strike-ja))
)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-swords-L-vertical-between-ja :num! min)
)
(else
(let ((v1-247 (ja-group)))
(cond
((and v1-247 (= v1-247 prebot-sword-R-vertical-strike-ja))
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-R-vertical-between-ja :num! min)
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-L-vertical-between-ja :num! min)
)
)
)
)
)
)
)
((let ((v1-262 (ja-group)))
(and v1-262 (or (= v1-262 prebot-sword-R-vertical-between-ja)
(= v1-262 prebot-sword-L-vertical-between-ja)
(= v1-262 prebot-swords-R-vertical-between-ja)
(= v1-262 prebot-swords-L-vertical-between-ja)
)
)
)
(ja :num! (seek!))
(when (ja-done? 0)
(let ((v1-276 (ja-group)))
(cond
((and v1-276 (= v1-276 prebot-swords-R-vertical-between-ja))
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-swords-L-vertical-strike-ja :num! min)
)
((let ((v1-286 (ja-group)))
(and v1-286 (= v1-286 prebot-swords-L-vertical-between-ja))
)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-swords-R-vertical-strike-ja :num! min)
)
(else
(let ((v1-296 (ja-group)))
(cond
((and v1-296 (= v1-296 prebot-sword-R-vertical-between-ja))
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-R-vertical-strike-ja :num! min)
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-sword-L-vertical-strike-ja :num! min)
)
)
)
)
)
)
)
)
(else
(ja :num! (loop!))
)
)
)
)
)
)
(prebot-common)
)
:code sleep-code
:post (behavior ()
(transform-post)
(do-push-aways (-> self root))
)
)
;; failed to figure out what this is:
(defstate pre-slam (prebot)
:virtual #t
:event prebot-handler
:enter (behavior ()
(set-time! (-> self state-time))
(set! (-> self laugh-played) #f)
)
:trans (behavior ()
(let ((v1-2 (ja-group)))
(cond
((and v1-2 (= v1-2 prebot-idle-ja))
(ja :num! (loop!))
(when (and (not (-> self laugh-played)) (or (and (= (-> self stage) 1) (>= (ja-aframe-num 0) 3.0))
(and (= (-> self stage) 2) (>= (ja-aframe-num 0) 4.0))
(and (= (-> self stage) 3) (>= (ja-aframe-num 0) 5.0))
)
)
(set-time! (-> self laugh-timer))
(set! (-> self laugh-played) #t)
(sound-play "prebot-laugh" :position (-> self root trans))
)
(if (or (-> self laugh-played) (time-elapsed? (-> self state-time) (seconds 0.25)))
(go-virtual slam)
)
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-idle-ja :num! min)
)
)
)
(prebot-common)
)
:code sleep-code
:post (behavior ()
(transform-post)
(do-push-aways (-> self root))
)
)
;; failed to figure out what this is:
(defstate jump-to-hover (prebot)
:virtual #t
:event prebot-handler
:enter (behavior ()
(when (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status bit-13))))
(talker-spawn-func (-> *talker-speech* 326) *entity-pool* (target-pos 0) (the-as region #f))
(process-entity-status! self (entity-perm-status bit-13) #t)
)
)
:trans (behavior ()
(let ((v1-2 (ja-group)))
(cond
((and v1-2 (= v1-2 prebot-jump-to-hover-ja))
(ja :num! (seek!))
(if (or (ja-done? 0) (< -40.0 (ja-aframe-num 0)))
(go-virtual pre-slam)
)
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja :group! prebot-jump-to-hover-ja :num! min)
)
)
)
(prebot-common)
)
:code sleep-code
:post (behavior ()
(transform-post)
(do-push-aways (-> self root))
)
)
;; failed to figure out what this is:
(defstate hidden (prebot)
:virtual #t
:enter (behavior ()
(set-time! (-> self state-time))
(remove-setting! 'point-of-interest)
)
:trans (behavior ()
(when (time-elapsed? (-> self state-time) (seconds 0.1))
(if (task-node-closed? (game-task-node mine-boss-introduction))
(prebot-go-next-stage)
)
(set-time! (-> self state-time))
)
)
:code sleep-code
)
;; failed to figure out what this is:
(defstate test (prebot)
:virtual #t
:event prebot-handler
:enter (behavior ()
(set-time! (-> self state-time))
(cond
((zero? (-> self nav))
(format #t "ERROR<GMJ>: ~s nav mesh not found~%" (-> self name))
)
(else
(let ((gp-0 (new 'stack-no-clear 'enemy-init-by-other-params)))
(let ((v1-4 (new 'stack-no-clear 'vector)))
(vector-copy! v1-4 (-> self nav state mesh bounds))
(vector-copy! (-> gp-0 trans) v1-4)
)
(quaternion-copy! (-> gp-0 quat) (-> self root quat))
(set! (-> gp-0 entity) (-> self entity))
(set! (-> gp-0 directed?) #f)
(set! (-> gp-0 no-initial-move-to-ground?) #f)
(set! (-> gp-0 art-level) #f)
(process-spawn
prebot-large-eco-creature
:init enemy-init-by-other
self
gp-0
:name "prebot-large-eco-creature"
:to self
)
)
)
)
(ja-channel-push! 1 0)
(ja :group! prebot-idle-ja :num! min)
(set! (-> self position target z) (+ -61440.0 (-> self original-position z)))
)
:trans (behavior ()
(if (and (time-elapsed? (-> self state-time) (seconds 0.017)) (cpad-pressed? 1 x))
(go-virtual test)
)
(ja :num! (loop!))
(show-maya-skeleton self -1 #x45800000)
(let ((gp-0 (handle->process (-> self gun))))
(cond
((>= (ja-aframe-num 0) 60.0)
(if (not gp-0)
(set! (-> self gun)
(ppointer->handle (process-spawn prebot-gun "gun-" (-> self root trans) :name "prebot-gun" :to self))
)
)
)
(gp-0
(deactivate gp-0)
)
)
)
(prebot-common)
)
:code sleep-code
:post (behavior ()
(transform-post)
(do-push-aways (-> self root))
)
)
;; definition for method 15 of type hud-prebot
;; WARN: Return type mismatch int vs none.
(defmethod draw ((this hud-prebot))
(set-hud-piece-position! (-> this sprites 0) (the int (+ 472.0 (* 130.0 (-> this offset)))) 150)
(set-as-offset-from! (-> this sprites 4) (-> this sprites 0 pos) -9 70)
(case (-> this values 0 current)
((1)
(set! (-> this sprites 4 scale-x) 6.0)
(set! (-> this sprites 4 color x) 0)
(set! (-> this sprites 4 color y) 255)
(set! (-> this sprites 4 color z) 0)
0
)
((2)
(set! (-> this sprites 4 scale-x) 4.0)
(set! (-> this sprites 4 color x) 128)
(set! (-> this sprites 4 color y) 128)
(set! (-> this sprites 4 color z) 0)
0
)
(else
(set! (-> this sprites 4 scale-x) 2.0)
(set! (-> this sprites 4 color x) 255)
(set! (-> this sprites 4 color y) 0)
(set! (-> this sprites 4 color z) 0)
0
)
)
(set-as-offset-from! (-> this sprites 3) (-> this sprites 0 pos) -8 68)
(set-as-offset-from! (-> this sprites 2) (-> this sprites 0 pos) -51 68)
(set-as-offset-from! (-> this sprites 1) (-> this sprites 0 pos) -12 68)
((method-of-type hud draw) this)
0
(none)
)
;; definition for method 16 of type hud-prebot
;; WARN: Return type mismatch int vs none.
(defmethod update-values! ((this hud-prebot))
(set! (-> this values 0 target) (the int (-> *game-info* counter)))
((method-of-type hud update-values!) this)
0
(none)
)
;; definition for method 17 of type hud-prebot
;; WARN: Return type mismatch int vs none.
(defmethod init-callback ((this hud-prebot))
(set! (-> this level) (level-get *level* 'mined))
(set! (-> this gui-id)
(add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0)
)
(logior! (-> this flags) (hud-flags show))
(set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-caveboss-01 mined-minimap)))
(set! (-> this sprites 0 scale-x) 1.0)
(set! (-> this sprites 0 scale-y) 1.0)
(set! (-> this sprites 0 flags) (hud-sprite-flags hsf2))
(set! (-> this sprites 4 tid) (the-as texture-id (get-texture hud-caveboss-health-01 mined-minimap)))
(set! (-> this sprites 4 scale-x) 1.0)
(set! (-> this sprites 4 scale-y) 0.5)
(set! (-> this sprites 4 flags) (hud-sprite-flags hsf2))
(set! (-> this sprites 3 tid) (the-as texture-id (get-texture hud-small-frame-01 mined-minimap)))
(set! (-> this sprites 3 scale-x) 1.0)
(set! (-> this sprites 3 scale-y) 1.0)
(set! (-> this sprites 3 flags) (hud-sprite-flags hsf0 hsf2))
(set! (-> this sprites 2 tid) (the-as texture-id (get-texture hud-small-frame-01 mined-minimap)))
(set! (-> this sprites 2 scale-x) 1.0)
(set! (-> this sprites 2 scale-y) 1.0)
(set! (-> this sprites 2 flags) (hud-sprite-flags hsf2))
(set! (-> this sprites 1 tid) (the-as texture-id (get-texture hud-small-frame-02 mined-minimap)))
(set! (-> this sprites 1 scale-x) 10.0)
(set! (-> this sprites 1 scale-y) 1.0)
(set! (-> this sprites 1 flags) (hud-sprite-flags hsf2))
0
(none)
)
;; definition of type task-manager-prebot
(deftype task-manager-prebot (task-manager)
((manager-entity entity)
(check-timer time-frame)
)
)
;; definition for method 3 of type task-manager-prebot
(defmethod inspect ((this task-manager-prebot))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type task-manager inspect)))
(t9-0 this)
)
(format #t "~2Tmanager-entity: ~A~%" (-> this manager-entity))
(format #t "~2Tcheck-timer: ~D~%" (-> this check-timer))
(label cfg-4)
this
)
;; failed to figure out what this is:
(defstate active (task-manager-prebot)
:virtual #t
:enter (behavior ()
(let ((t9-0 (-> (method-of-type task-manager active) enter)))
(if t9-0
(t9-0)
)
)
(set! (-> self check-timer) 0)
0
)
)
;; definition for method 26 of type task-manager-prebot
;; WARN: Return type mismatch time-frame vs none.
(defmethod task-manager-method-26 ((this task-manager-prebot))
(let ((t9-0 (method-of-type task-manager task-manager-method-26)))
(t9-0 this)
)
(when (and (not (-> this manager-entity)) (time-elapsed? (-> this check-timer) (seconds 0.1)))
(let* ((a0-3 "prebot-2")
(v1-6 (entity-by-name a0-3))
)
(when v1-6
(set! (-> this manager-entity) v1-6)
(set! (-> this hud-counter)
(ppointer->handle (process-spawn hud-prebot :init hud-init-by-other :name "hud-prebot" :to this))
)
)
)
(set-time! (-> this check-timer))
)
(none)
)
;; definition for method 21 of type task-manager-prebot
;; WARN: Return type mismatch connection vs none.
(defmethod set-time-limit ((this task-manager-prebot))
(let ((t9-0 (method-of-type task-manager set-time-limit)))
(t9-0 this)
)
(set! (-> this manager-entity) #f)
(set-setting! 'music 'mineboss 0.0 0)
(none)
)