Files
jak-project/test/decompiler/reference/jak3/levels/temple/temple-obs_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

2699 lines
92 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition for function templea-login
;; WARN: Return type mismatch int vs none.
(defun templea-login ((arg0 level))
(set! *nav-network* (new 'loading-level 'nav-network))
(alloc-nav-network-for-level! *nav-network* 64 10)
0
(none)
)
;; definition for function templea-logout
;; WARN: Return type mismatch int vs none.
(defun templea-logout ((arg0 level))
(set! *nav-network* (the-as nav-network 0))
0
(none)
)
;; definition for function templea-activate
;; WARN: Return type mismatch int vs none.
(defun templea-activate ((arg0 level))
(if (and (nonzero? *nav-network*) *nav-network*)
(init-by-other! *nav-network* arg0 *templea-adjacency*)
)
0
(none)
)
;; failed to figure out what this is:
(defskelgroup skel-tpl-bouncer tpl-bouncer tpl-bouncer-lod0-jg tpl-bouncer-idle-ja
((tpl-bouncer-lod0-mg (meters 20)) (tpl-bouncer-lod1-mg (meters 999999)))
:bounds (static-spherem 0 0 0 5)
)
;; definition of type tpl-bouncer
(deftype tpl-bouncer (bouncer)
()
(:state-methods
broken
)
)
;; definition for method 3 of type tpl-bouncer
(defmethod inspect ((this tpl-bouncer))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type bouncer inspect)))
(t9-0 this)
)
(label cfg-4)
this
)
;; failed to figure out what this is:
(defstate idle (tpl-bouncer)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('bonk)
(when ((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> block param 0))
(-> self root)
(the-as uint 1)
)
(when (send-event proc 'jump (-> self spring-height) (-> self spring-height) (-> self mods))
(sound-play "bouncer")
(go-virtual fire)
)
)
)
(('touch)
(let ((gp-2 (-> block param 0)))
(cond
(((method-of-type touching-shapes-entry prims-touching-action?)
(the-as touching-shapes-entry gp-2)
(-> self root)
(collide-action solid)
(collide-action)
)
(when ((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry gp-2)
(-> self root)
(the-as uint 1)
)
(if (not (and (-> self next-state) (let ((v1-22 (-> self next-state name)))
(or (= v1-22 'smush) (= v1-22 'fire))
)
)
)
(go-virtual smush)
)
)
)
(((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry gp-2)
(-> self root)
(the-as uint 4)
)
(persist-with-delay
*setting-control*
(the-as symbol (process->ppointer self))
(seconds 0.05)
'double-jump
#f
0.0
0
)
)
)
)
)
(('attack)
(let ((v1-29 (the-as object (-> block param 1)))
(a0-16 (-> block param 0))
(a2-7 0)
)
(cond
((= (-> (the-as attack-info v1-29) mode) 'flop)
(set! a2-7 1)
)
((= (-> (the-as attack-info v1-29) mode) 'board)
(set! a2-7 9)
)
)
(when (and (nonzero? a2-7)
(and ((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry a0-16)
(-> self root)
(the-as uint a2-7)
)
(send-event proc 'jump (-> self spring-height) (-> self spring-height) (-> self mods))
)
)
(sound-play "bouncer")
(go-virtual fire)
#f
)
)
)
)
)
:enter (behavior ()
(set! (-> self draw force-lod) 0)
(if (task-node-closed? (game-task-node volcano-darkeco-resolution))
(go-virtual broken)
)
)
:code (behavior ()
(ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) :num! min)
(transform-post)
(until #f
(logior! (-> self mask) (process-mask sleep))
(suspend)
)
#f
)
)
;; failed to figure out what this is:
(defstate fire (tpl-bouncer)
:virtual #t
:code (behavior ()
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 178 (seconds 0.1))
(sound-play "bouncer-whoosh")
(ja-no-eval :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim)
:num! (seek!)
:frame-num (ja-aframe 6.0 0)
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(go-virtual idle)
)
:post transform-post
)
;; failed to figure out what this is:
(defstate broken (tpl-bouncer)
:virtual #t
:enter (behavior ()
(let ((v1-1 (-> self root root-prim)))
(set! (-> v1-1 prim-core collide-as) (collide-spec))
(set! (-> v1-1 prim-core collide-with) (collide-spec))
)
0
(set! (-> self draw force-lod) 1)
)
:code sleep-code
:post ja-post
)
;; definition for method 23 of type tpl-bouncer
;; WARN: Return type mismatch int vs none.
(defmethod init-skel! ((this tpl-bouncer))
(initialize-skeleton
this
(the-as skeleton-group (art-group-get-by-name *level* "skel-tpl-bouncer" (the-as (pointer level) #f)))
(the-as pair 0)
)
0
(none)
)
;; definition for method 24 of type tpl-bouncer
;; WARN: Return type mismatch int vs none.
(defmethod init-collision! ((this tpl-bouncer))
(let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player))))
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0)))
(set! (-> s5-0 total-prims) (the-as uint 3))
(set! (-> s4-0 prim-core collide-as) (collide-spec obstacle))
(set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> s4-0 prim-core action) (collide-action solid))
(set! (-> s4-0 transform-index) 4)
(set-vector! (-> s4-0 local-sphere) -2128.2815 5212.979 223.6416 25526.682)
(set! (-> s5-0 root-prim) s4-0)
)
(let ((v1-9 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 1))))
(set! (-> v1-9 prim-core collide-as) (collide-spec crate))
(set! (-> v1-9 prim-core collide-with) (collide-spec jak player-list))
(set! (-> v1-9 prim-core action) (collide-action solid))
(set! (-> v1-9 transform-index) 4)
(set-vector! (-> v1-9 local-sphere) -2128.2815 5212.979 223.6416 25526.682)
)
(let ((v1-11 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 1))))
(set! (-> v1-11 prim-core collide-as) (collide-spec crate))
(set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list))
(set! (-> v1-11 prim-core action) (collide-action solid))
(set! (-> v1-11 transform-index) 3)
(set-vector! (-> v1-11 local-sphere) -2128.2815 5212.979 223.6416 25526.682)
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(let ((v1-14 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with))
)
(set! (-> this root) s5-0)
)
0
(none)
)
;; failed to figure out what this is:
(defskelgroup skel-tpl-outer-airlock-door tpl-outer-airlock-door tpl-outer-airlock-door-lod0-jg tpl-outer-airlock-door-idle-ja
((tpl-outer-airlock-door-lod0-mg (meters 999999)))
:bounds (static-spherem 0 6 0 18)
)
;; definition of type tpl-outer-airlock-door
(deftype tpl-outer-airlock-door (com-airlock)
()
)
;; definition for method 3 of type tpl-outer-airlock-door
(defmethod inspect ((this tpl-outer-airlock-door))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type com-airlock inspect)))
(t9-0 this)
)
(label cfg-4)
this
)
;; definition for method 11 of type tpl-outer-airlock-door
(defmethod init-from-entity! ((this tpl-outer-airlock-door) (arg0 entity-actor))
"Set up a newly created process from the entity that created it."
(let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
(set! (-> s5-0 penetrated-by) (penetrate))
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0)))
(set! (-> s5-0 total-prims) (the-as uint 3))
(set! (-> s4-0 prim-core collide-as) (collide-spec obstacle))
(set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> s4-0 prim-core action) (collide-action solid))
(set-vector! (-> s4-0 local-sphere) 0.0 24576.0 0.0 61440.0)
(set! (-> s5-0 root-prim) s4-0)
)
(let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0))))
(set! (-> v1-8 prim-core collide-as) (collide-spec obstacle))
(set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-8 prim-core action) (collide-action solid))
(set! (-> v1-8 transform-index) 5)
(set-vector! (-> v1-8 local-sphere) 0.0 24576.0 0.0 61440.0)
)
(let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
(set! (-> v1-10 prim-core collide-as) (collide-spec obstacle))
(set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-10 prim-core action) (collide-action solid))
(set! (-> v1-10 transform-index) 4)
(set-vector! (-> v1-10 local-sphere) 0.0 24576.0 0.0 61440.0)
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(let ((v1-13 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with))
)
(set! (-> this root) s5-0)
)
(initialize-skeleton
this
(the-as
skeleton-group
(art-group-get-by-name *level* "skel-tpl-outer-airlock-door" (the-as (pointer level) #f))
)
(the-as pair 0)
)
(init-airlock! this)
(set! (-> this lock-frame) 45.0)
(set! (-> this open-frame) 90.0)
(set! (-> this sound-pre-open) (static-sound-spec "door-eye-open" :group 0))
(set! (-> this sound-open-loop) (static-sound-spec "door-open" :group 0))
(set! (-> this sound-open-stop) (static-sound-spec "door-open-hit" :group 0))
(set! (-> this sound-close-loop) (static-sound-spec "door-close" :group 0))
(set! (-> this sound-close-stop) (static-sound-spec "door-close-hit" :group 0))
(set! (-> this sound-post-close) (static-sound-spec "door-eye-close" :group 0))
(set! (-> this sound-behind?) #t)
(go (method-of-object this close) #t)
)
;; failed to figure out what this is:
(defskelgroup skel-tpl-mardoor tpl-mardoor tpl-mardoor-lod0-jg tpl-mardoor-idle-ja
((tpl-mardoor-lod0-mg (meters 999999)))
:bounds (static-spherem 0 6 0 9)
)
;; definition of type tpl-mardoor
(deftype tpl-mardoor (com-airlock)
()
)
;; definition for method 3 of type tpl-mardoor
(defmethod inspect ((this tpl-mardoor))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type com-airlock inspect)))
(t9-0 this)
)
(label cfg-4)
this
)
;; definition for method 11 of type tpl-mardoor
(defmethod init-from-entity! ((this tpl-mardoor) (arg0 entity-actor))
"Set up a newly created process from the entity that created it."
(let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
(set! (-> s5-0 penetrated-by) (penetrate))
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0)))
(set! (-> s5-0 total-prims) (the-as uint 3))
(set! (-> s4-0 prim-core collide-as) (collide-spec obstacle))
(set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> s4-0 prim-core action) (collide-action solid))
(set-vector! (-> s4-0 local-sphere) 0.0 24576.0 0.0 36864.0)
(set! (-> s5-0 root-prim) s4-0)
)
(let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0))))
(set! (-> v1-8 prim-core collide-as) (collide-spec obstacle))
(set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-8 prim-core action) (collide-action solid))
(set! (-> v1-8 transform-index) 5)
(set-vector! (-> v1-8 local-sphere) 0.0 32768.0 0.0 65536.0)
)
(let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
(set! (-> v1-10 prim-core collide-as) (collide-spec obstacle))
(set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-10 prim-core action) (collide-action solid))
(set! (-> v1-10 transform-index) 4)
(set-vector! (-> v1-10 local-sphere) 0.0 32768.0 0.0 65536.0)
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(let ((v1-13 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with))
)
(set! (-> this root) s5-0)
)
(initialize-skeleton
this
(the-as skeleton-group (art-group-get-by-name *level* "skel-tpl-mardoor" (the-as (pointer level) #f)))
(the-as pair 0)
)
(init-airlock! this)
(set! (-> this lock-frame) 30.0)
(set! (-> this open-frame) 30.0)
(set! (-> this sound-pre-open) (static-sound-spec "mardoor-open" :group 0))
(set! (-> this sound-close) (static-sound-spec "mardoor-close" :group 0))
(set! (-> this sound-close-stop) (static-sound-spec "mardoor-cls-hit" :group 0))
(set! (-> this sound-post-close) (static-sound-spec "mardoor-turn-cl" :group 0))
(set! (-> this sound-behind?) #t)
(go (method-of-object this close) #t)
)
;; definition of type task-manager-temple-defend
(deftype task-manager-temple-defend (task-manager)
()
)
;; definition for method 3 of type task-manager-temple-defend
(defmethod inspect ((this task-manager-temple-defend))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type task-manager inspect)))
(t9-0 this)
)
(label cfg-4)
this
)
;; definition for method 21 of type task-manager-temple-defend
(defmethod set-time-limit ((this task-manager-temple-defend))
(set-setting! 'extra-bank '((temple4 temple6)) 0.0 0)
(set-setting! 'music 'templedf 0.0 0)
((method-of-type task-manager set-time-limit) this)
(none)
)
;; definition of type task-manager-temple-oracle
(deftype task-manager-temple-oracle (task-manager)
()
)
;; definition for method 3 of type task-manager-temple-oracle
(defmethod inspect ((this task-manager-temple-oracle))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type task-manager inspect)))
(t9-0 this)
)
(label cfg-4)
this
)
;; failed to figure out what this is:
(defstate active (task-manager-temple-oracle)
:virtual #t
:trans (behavior ()
(format *stdcon* "Temple Oracle: Press down to fail, up to complete~%")
(if (cpad-pressed? 0 up)
(send-event self 'complete)
)
(if (cpad-pressed? 0 down)
(send-event self 'fail)
)
)
)
;; definition of type task-manager-temple-oracle-powerup
(deftype task-manager-temple-oracle-powerup (task-manager)
((arrow-h handle)
)
)
;; definition for method 3 of type task-manager-temple-oracle-powerup
(defmethod inspect ((this task-manager-temple-oracle-powerup))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type task-manager inspect)))
(t9-0 this)
)
(format #t "~2Tarrow-h: ~D~%" (-> this arrow-h))
(label cfg-4)
this
)
;; failed to figure out what this is:
(defstate active (task-manager-temple-oracle-powerup)
:virtual #t
:enter (behavior ()
(let ((gp-0 (new 'stack-no-clear 'task-arrow-params)))
(let ((a0-0 (-> self info sphere-array 0)))
(vector-copy! (-> gp-0 pos) a0-0)
)
(quaternion-identity! (-> gp-0 quat))
(set! (-> gp-0 flags) (task-arrow-flags taf5))
(set! (-> gp-0 map-icon) (the-as uint 13))
(set! (-> self arrow-h) (process->handle (task-arrow-spawn gp-0 self)))
)
(call-parent-state-handler enter)
)
:trans (behavior ()
(call-parent-state-handler trans)
(when (-> self arrow-h)
(let ((gp-0 (-> self arrow-h process 0)))
(when (and (< (vector-vector-distance (-> (the-as process-drawable gp-0) root trans) (target-pos 0)) 20480.0)
(movie?)
)
(send-event gp-0 'leave)
(set! (-> self arrow-h) (the-as handle #f))
)
)
)
)
)
;; definition of type task-manager-lightjak-training
(deftype task-manager-lightjak-training (task-manager)
((gui-id sound-id)
)
(:methods
(task-manager-lightjak-training-method-32 (_type_ text-id) none)
)
)
;; definition for method 3 of type task-manager-lightjak-training
(defmethod inspect ((this task-manager-lightjak-training))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type task-manager inspect)))
(t9-0 this)
)
(format #t "~2Tgui-id: ~D~%" (-> this gui-id))
(label cfg-4)
this
)
;; definition for method 32 of type task-manager-lightjak-training
;; WARN: Return type mismatch float vs none.
(defmethod task-manager-lightjak-training-method-32 ((this task-manager-lightjak-training) (arg0 text-id))
(when (= (get-status *gui-control* (-> this gui-id)) (gui-status active))
(let ((s5-1
(new 'stack 'font-context *font-default-matrix* 32 290 0.0 (font-color default) (font-flags shadow kerning))
)
)
(set! (-> s5-1 flags) (font-flags shadow kerning middle middle-vert large))
(set-width! s5-1 440)
(set-height! s5-1 80)
(set-scale! s5-1 0.7)
(let ((s4-0 print-game-text))
(format (clear *temp-string*) (lookup-text! *common-text* arg0 #f))
(s4-0 *temp-string* s5-1 #f 44 (bucket-id hud-draw-hud-alpha))
)
)
)
(none)
)
;; failed to figure out what this is:
(defstate active (task-manager-lightjak-training)
:virtual #t
:enter (behavior ()
(when *target*
(send-event *target* 'get-pickup (pickup-type eco-pill-light) 100.0)
(send-event *target* 'get-pickup (pickup-type health) -1.0)
)
(set! (-> self gui-id)
(add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0)
)
)
:exit (behavior ()
(send-event *target* 'get-pickup (pickup-type health) 100.0)
)
:trans (behavior ()
(task-manager-lightjak-training-method-32 self (text-id text-05f6))
(if (and *target* (focus-test? *target* light))
(send-event self 'complete)
)
(call-parent-state-handler trans)
)
)
;; definition of type task-manager-lightjak-training-freeze
(deftype task-manager-lightjak-training-freeze (task-manager-lightjak-training)
()
)
;; definition for method 3 of type task-manager-lightjak-training-freeze
(defmethod inspect ((this task-manager-lightjak-training-freeze))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type task-manager-lightjak-training inspect)))
(t9-0 this)
)
(label cfg-4)
this
)
;; failed to figure out what this is:
(defstate active (task-manager-lightjak-training-freeze)
:virtual #t
:enter (behavior ()
(if *target*
(send-event *target* 'get-pickup (pickup-type eco-pill-light) 100.0)
)
(set! (-> self gui-id)
(add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0)
)
)
:exit #f
:trans (behavior ()
(task-manager-lightjak-training-method-32 self (text-id text-05f7))
(if (!= (-> *display* entity-clock clock-ratio) 1.0)
(send-event self 'complete)
)
(let ((t9-2 (-> (method-of-type task-manager active) trans)))
(if t9-2
(t9-2)
)
)
)
)
;; definition of type task-manager-lightjak-training-swoop
(deftype task-manager-lightjak-training-swoop (task-manager-lightjak-training)
((learned-to-flap? symbol)
(flap-count int32)
)
)
;; definition for method 3 of type task-manager-lightjak-training-swoop
(defmethod inspect ((this task-manager-lightjak-training-swoop))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type task-manager-lightjak-training inspect)))
(t9-0 this)
)
(format #t "~2Tlearned-to-flap?: ~A~%" (-> this learned-to-flap?))
(format #t "~2Tflap-count: ~D~%" (-> this flap-count))
(label cfg-4)
this
)
;; failed to figure out what this is:
(defstate active (task-manager-lightjak-training-swoop)
:virtual #t
:enter (behavior ()
(if *target*
(send-event *target* 'get-pickup (pickup-type eco-pill-light) 100.0)
)
(set! (-> self gui-id)
(add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0)
)
(set! (-> self learned-to-flap?) #f)
)
:exit #f
:trans (behavior ()
(let ((t9-0 (-> (method-of-type task-manager active) trans)))
(if t9-0
(t9-0)
)
)
)
:code (behavior ()
(until #f
(cond
((not *target*)
(suspend)
0
)
((and (focus-test? *target* light)
(nonzero? (-> *target* lightjak))
(logtest? (-> *target* lightjak stage) (lightjak-stage swoop))
)
(cond
((-> self learned-to-flap?)
(cond
((nonzero? (-> self flap-count))
)
((and (-> *target* next-state) (= (-> *target* next-state name) 'target-lightjak-swoop-again))
(+! (-> self flap-count) 1)
)
(else
(task-manager-lightjak-training-method-32 self (text-id text-061f))
)
)
)
((and (-> *target* next-state) (= (-> *target* next-state name) 'target-lightjak-swoop))
(set! (-> self learned-to-flap?) #t)
)
(else
(task-manager-lightjak-training-method-32 self (text-id text-061e))
)
)
)
(else
(task-manager-lightjak-training-method-32 self (text-id text-05f9))
)
)
(suspend)
)
#f
)
)
;; failed to figure out what this is:
(defpartgroup group-holo-halo
:id 677
:flags (sp0 sp4)
:bounds (static-bspherem 0 0 0 20)
:parts ((sp-item 2618 :flags (sp6 sp7)) (sp-item 2619 :flags (sp6 sp7)))
)
;; definition for function sparticle-holo-halo0
;; WARN: Return type mismatch float vs none.
(defun sparticle-holo-halo0 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo))
(let* ((v1-2 (-> *display* part-clock frame-counter))
(f0-1 (* 0.00020833334 (the float (mod v1-2 4800))))
)
(set! (-> arg2 conerot z) (* 65536.0 f0-1))
)
(none)
)
;; definition for function sparticle-holo-halo1
;; WARN: Return type mismatch float vs none.
(defun sparticle-holo-halo1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo))
(let* ((v1-2 (-> *display* part-clock frame-counter))
(f0-1 (* 0.00020833334 (the float (mod v1-2 4800))))
)
(set! (-> arg2 conerot z) (* -65536.0 f0-1))
)
(none)
)
;; failed to figure out what this is:
(defpart 2618
:init-specs ((:texture (colorflash level-default-sprite))
(:num 1.0)
(:scale-x (meters 14))
(:rot-z (degrees 0))
(:scale-y (meters 14))
(:r 100.0)
(:g 100.0)
(:b 150.0)
(:a 48.0)
(:timer (seconds 0.017))
(:flags (sp-cpuinfo-flag-3))
(:func 'sparticle-holo-halo0)
)
)
;; failed to figure out what this is:
(defpart 2619
:init-specs ((:texture (colorflash level-default-sprite))
(:num 1.0)
(:scale-x (meters 14))
(:rot-z (degrees 0))
(:scale-y (meters 14))
(:r 100.0)
(:g 100.0)
(:b 150.0)
(:a 48.0)
(:timer (seconds 0.017))
(:flags (sp-cpuinfo-flag-3))
(:func 'sparticle-holo-halo1)
)
)
;; definition of type tpl-holo-eye
(deftype tpl-holo-eye (process-drawable)
((eyeball-jmod joint-mod-set-world-no-trans :inline)
(other-eyeball-jmod joint-mod-set-world :inline)
(next-blink-time time-frame)
(trigger-radius float)
(idle-clock time-frame)
(actor-group (pointer actor-group))
(actor-group-count int32)
(triggered? symbol)
(untriggered? symbol)
(kill-quat quaternion :inline)
(kill-angle float)
(kill-speed float)
(init-trans vector :inline)
(perm-part handle)
)
(:state-methods
idle
alert
die
die-fast
)
(:methods
(tpl-holo-eye-method-24 (_type_) none)
)
)
;; definition for method 3 of type tpl-holo-eye
(defmethod inspect ((this tpl-holo-eye))
(when (not this)
(set! this this)
(goto cfg-7)
)
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 this)
)
(format #t "~2Teyeball-jmod: #<joint-mod-set-world-no-trans @ #x~X>~%" (-> this eyeball-jmod))
(format #t "~2Tother-eyeball-jmod: #<joint-mod-set-world @ #x~X>~%" (-> this other-eyeball-jmod))
(format #t "~2Tnext-blink-time: ~D~%" (-> this next-blink-time))
(format #t "~2Ttrigger-radius: ~f~%" (-> this trigger-radius))
(format #t "~2Tidle-clock: ~D~%" (-> this idle-clock))
(format #t "~2Tactor-group: #x~X~%" (-> this actor-group))
(dotimes (s5-0 (-> this actor-group-count))
(format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0))
)
(format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count))
(format #t "~2Ttriggered?: ~A~%" (-> this triggered?))
(format #t "~2Tuntriggered?: ~A~%" (-> this untriggered?))
(format #t "~2Tkill-quat: #<quaternion @ #x~X>~%" (-> this kill-quat))
(format #t "~2Tkill-angle: ~f~%" (-> this kill-angle))
(format #t "~2Tkill-speed: ~f~%" (-> this kill-speed))
(format #t "~2Tinit-trans: #<vector @ #x~X>~%" (-> this init-trans))
(format #t "~2Tperm-part: ~D~%" (-> this perm-part))
(label cfg-7)
this
)
;; failed to figure out what this is:
(defskelgroup skel-tpl-holo-eye tpl-holo-eye tpl-holo-eye-lod0-jg tpl-holo-eye-idle-ja
((tpl-holo-eye-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 4)
)
;; definition for method 24 of type tpl-holo-eye
;; INFO: Used lq/sq
;; WARN: Return type mismatch transformq vs none.
(defmethod tpl-holo-eye-method-24 ((this tpl-holo-eye))
(let ((s5-1 (quaternion-look-at!
(new 'stack-no-clear 'quaternion)
(vector-normalize-copy!
(new 'stack-no-clear 'vector)
(vector-!
(new 'stack-no-clear 'vector)
(get-trans *target* 3)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 4))
)
1.0
)
*up-vector*
)
)
)
(if (>= (-> (quaternion*!
(new 'stack-no-clear 'quaternion)
s5-1
(quaternion-conjugate! (new 'stack-no-clear 'quaternion) (-> this root quat))
)
w
)
0.81915206
)
(quaternion-copy! (-> this eyeball-jmod transform quat) s5-1)
)
)
(quaternion-copy! (-> this other-eyeball-jmod transform quat) (-> this eyeball-jmod transform quat))
(set! (-> this other-eyeball-jmod transform trans quad) (-> this node-list data 4 bone transform trans quad))
(none)
)
;; failed to figure out what this is:
(defstate idle (tpl-holo-eye)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('trigger)
(let ((v0-0 (the-as object #t)))
(set! (-> self triggered?) (the-as symbol v0-0))
v0-0
)
)
(('kill)
(go-virtual die)
)
)
)
:enter (behavior ()
(set! (-> self triggered?) #f)
)
:trans (behavior ()
(when *target*
(b!
(not (or (logtest? (target-flags invisible) (-> *target* target-flags))
(< 40960.0 (- (-> (target-pos 0) y) (-> self root trans y)))
)
)
cfg-7
:delay (nop!)
)
(quaternion-copy! (-> self eyeball-jmod transform quat) (-> self root quat))
(quaternion-copy! (-> self other-eyeball-jmod transform quat) (-> self root quat))
(set! (-> self other-eyeball-jmod transform trans quad) (-> self node-list data 4 bone transform trans quad))
(b! #t cfg-16 :delay (nop!))
(label cfg-7)
(tpl-holo-eye-method-24 self)
(if (or (-> self triggered?) (< (if *target*
(vector-vector-xz-distance (-> self root trans) (-> *target* control trans))
4096000.0
)
(-> self trigger-radius)
)
)
(go-virtual alert)
)
)
(label cfg-16)
(+! (-> self idle-clock) (- (current-time) (-> self clock old-frame-counter)))
(let ((f30-1 (* 0.0003030303 (the float (mod (-> self idle-clock) 3300))))
(f0-5 (* 0.00025641025 (the float (mod (-> self idle-clock) 3900))))
(s4-0 (-> self root trans))
(gp-0 (-> self init-trans))
(s5-0 (new 'stack-no-clear 'vector))
)
(set! (-> s5-0 x) 0.0)
(set! (-> s5-0 y) (* 8192.0 (cos (* 65536.0 f0-5)) (sin (* 65536.0 f30-1))))
(set! (-> s5-0 z) 0.0)
(set! (-> s5-0 w) 1.0)
(vector+! s4-0 gp-0 s5-0)
)
)
:code (behavior ()
(ja-no-eval :group! tpl-holo-eye-shuteye-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) :num! min)
(set! (-> self next-blink-time)
(the-as time-frame (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 2101) 900 (current-time)))
)
(until #f
(ja-no-eval :group! tpl-holo-eye-idle-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(when (< (-> self next-blink-time) (current-time))
(set! (-> self next-blink-time)
(the-as time-frame (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 2101) 900 (current-time)))
)
(ja-no-eval :group! tpl-holo-eye-blink-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
)
#f
)
:post ja-post
)
;; failed to figure out what this is:
(defstate alert (tpl-holo-eye)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('untrigger)
(let ((v0-0 (the-as object #t)))
(set! (-> self untriggered?) (the-as symbol v0-0))
v0-0
)
)
(('kill)
(go-virtual die)
)
)
)
:enter (behavior ()
(set! (-> self untriggered?) #f)
)
:exit (behavior ()
(when (and (nonzero? (-> self actor-group)) (-> self actor-group 0))
(let ((gp-0 (-> self actor-group 0)))
(dotimes (s5-0 (-> gp-0 length))
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-0 from) (process->ppointer self))
(set! (-> a1-0 num-params) 0)
(set! (-> a1-0 message) 'down)
(let ((t9-0 send-event-function)
(v1-8 (-> gp-0 data s5-0 actor))
)
(t9-0
(if v1-8
(-> v1-8 extra process)
)
a1-0
)
)
)
)
)
)
)
:trans (behavior ()
(cond
((and *target*
(not (logtest? (target-flags invisible) (-> *target* target-flags)))
(< (- (-> (target-pos 0) y) (-> self root trans y)) 40960.0)
)
(tpl-holo-eye-method-24 self)
(if (or (and (-> self triggered?) (-> self untriggered?))
(and (not (-> self triggered?))
(< (-> self trigger-radius) (if *target*
(vector-vector-xz-distance (-> self root trans) (-> *target* control trans))
4096000.0
)
)
)
)
(go-virtual idle)
)
)
(else
(go-virtual idle)
)
)
)
:code (behavior ()
(sound-play "temple-holo-eye")
(ja-no-eval :group! tpl-holo-eye-openeye-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(when (and (nonzero? (-> self actor-group)) (-> self actor-group 0))
(let ((gp-1 (-> self actor-group 0)))
(dotimes (s5-1 (-> gp-1 length))
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) (process->ppointer self))
(set! (-> a1-3 num-params) 0)
(set! (-> a1-3 message) 'up)
(let ((t9-5 send-event-function)
(v1-35 (-> gp-1 data s5-1 actor))
)
(t9-5
(if v1-35
(-> v1-35 extra process)
)
a1-3
)
)
)
)
)
)
(sleep-code)
)
:post ja-post
)
;; failed to figure out what this is:
(defstate die (tpl-holo-eye)
:virtual #t
:enter (behavior ()
(sound-play "holo-eye-close")
(quaternion-copy! (-> self kill-quat) (-> self root quat))
(set! (-> self kill-angle) 0.0)
(set! (-> self kill-speed) 0.0)
(set-time! (-> self state-time))
(let ((v1-6 (res-lump-struct (-> self entity) 'continue-name structure)))
(when v1-6
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) (process->ppointer self))
(set! (-> a1-3 num-params) 2)
(set! (-> a1-3 message) 'checkpoint)
(set! (-> a1-3 param 0) (the-as uint v1-6))
(set! (-> a1-3 param 1) (the-as uint (-> self entity)))
(let ((t9-4 send-event-function)
(v1-10 (-> *game-info* sub-task-list (game-task-node arena-training-1-collect)))
)
(t9-4
(handle->process (if (-> v1-10 manager)
(-> v1-10 manager manager)
(the-as handle #f)
)
)
a1-3
)
)
)
)
)
)
:trans (behavior ()
'()
)
:code (behavior ()
(let ((t0-1 (res-lump-struct (-> self entity) 'camera-name structure)))
(when t0-1
(persist-with-delay *setting-control* 'entity-name (seconds 2) 'entity-name (the-as symbol t0-1) 0.0 0)
(until (process-grab? *target* #f)
(suspend)
)
(suspend-for (seconds 1)
)
)
)
(set-time! (-> self state-time))
(until #f
(seek! (-> self kill-speed) 182044.44 (* 182044.44 (seconds-per-frame)))
(+! (-> self kill-angle) (* (-> self kill-speed) (seconds-per-frame)))
(let ((a2-4 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *y-vector* (-> self kill-angle))))
(quaternion*! (-> self root quat) (-> self kill-quat) a2-4)
)
(vector-copy! (-> self other-eyeball-jmod transform scale) (-> self root scale))
(vector-copy! (-> self eyeball-jmod transform scale) (-> self root scale))
(set! (-> self root scale x)
(square (square (lerp-scale 1.0 0.0 (the float (- (current-time) (-> self state-time))) 0.0 60.0)))
)
(set! (-> self root scale y) (+ 1.0 (/ (-> self root scale x) 2)))
(set! (-> self root scale z) (-> self root scale x))
(when (= (-> self root scale x) 0.0)
(send-event (handle->process (-> self perm-part)) 'die)
(suspend-for (seconds 1)
)
(until (process-release? *target*)
(suspend)
)
(let ((gp-2 (res-lump-struct (-> self entity) 'on-deactivate structure)))
(if gp-2
(script-eval (the-as pair gp-2))
)
)
(go-virtual die-fast)
)
(suspend)
)
#f
)
:post ja-post
)
;; failed to figure out what this is:
(defstate die-fast (tpl-holo-eye)
:virtual #t
:code (behavior ()
(send-event (handle->process (-> self perm-part)) 'die)
(when (and (nonzero? (-> self actor-group)) (>= (-> self actor-group-count) 2) (-> self actor-group 1))
(let ((gp-0 (-> self actor-group 1)))
(dotimes (s5-0 (-> gp-0 length))
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) (process->ppointer self))
(set! (-> a1-1 num-params) 0)
(set! (-> a1-1 message) 'open)
(let ((t9-1 send-event-function)
(v1-16 (-> gp-0 data s5-0 actor))
)
(t9-1
(if v1-16
(-> v1-16 extra process)
)
a1-1
)
)
)
)
)
)
(while (-> self child)
(suspend)
)
(process-entity-status! self (entity-perm-status dead) #t)
)
)
;; definition for method 11 of type tpl-holo-eye
;; INFO: Used lq/sq
;; INFO: Process stack size was changed from 320 to 384
(defmethod init-from-entity! ((this tpl-holo-eye) (arg0 entity-actor))
"Set up a newly created process from the entity that created it."
(stack-size-set! (-> this main-thread) 384)
(set! (-> this root) (new 'process 'trsqv))
(process-drawable-from-entity! this arg0)
(initialize-skeleton
this
(the-as skeleton-group (art-group-get-by-name *level* "skel-tpl-holo-eye" (the-as (pointer level) #f)))
(the-as pair 0)
)
(set! (-> this trigger-radius) (res-lump-float (-> this entity) 'holo-eye-activate-radius :default 77824.0))
(let* ((sv-16 (new 'static 'res-tag))
(v1-8 (res-lump-data arg0 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))
)
(cond
((and v1-8 (nonzero? (-> sv-16 elt-count)))
(set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count)))
(set! (-> this actor-group) v1-8)
)
(else
(format 0 "ERROR: ~s: entity missing actor-group!~%" (-> this name))
)
)
)
(vector-copy! (-> this init-trans) (-> this root trans))
(init (-> this eyeball-jmod) this (the-as uint 4) (joint-mod-base-flags attached scale))
(init (-> this other-eyeball-jmod) this (the-as uint 9) (joint-mod-base-flags attached trans quat scale))
(set! (-> this perm-part) (ppointer->handle (if (logtest? (-> group-holo-halo flags) (sp-group-flag sp13))
(part-tracker-spawn
part-tracker-subsampler
:to this
:group group-holo-halo
:duration -1
:target this
:mat-joint (the-as object 0)
)
(part-tracker-spawn
part-tracker
:to this
:group group-holo-halo
:duration -1
:target this
:mat-joint (the-as object 0)
)
)
)
)
(set! (-> this idle-clock) 0)
(set! (-> this triggered?) #f)
(set! (-> this untriggered?) #f)
(set! (-> this root pause-adjust-distance) 327680.0)
(let ((s5-3 (res-lump-struct (-> this entity) 'on-activate structure)))
(if (and s5-3 (not (script-eval (the-as pair s5-3))))
(go (method-of-object this die-fast))
)
)
(go (method-of-object this idle))
)
;; definition for method 10 of type tpl-holo-eye
;; WARN: Return type mismatch object vs none.
(defmethod deactivate ((this tpl-holo-eye))
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
(let ((t9-0 (method-of-type process-focusable deactivate)))
(t9-0 (the-as process-focusable this))
)
(send-event (handle->process (-> this perm-part)) 'die)
(none)
)
;; definition of type tpl-spike-trap
(deftype tpl-spike-trap (process-drawable)
((was-up symbol)
(no-collision-timer time-frame)
(attack-id int32)
)
(:state-methods
idle-down
idle-up
)
)
;; definition for method 3 of type tpl-spike-trap
(defmethod inspect ((this tpl-spike-trap))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 this)
)
(format #t "~2Twas-up: ~A~%" (-> this was-up))
(format #t "~2Tno-collision-timer: ~D~%" (-> this no-collision-timer))
(format #t "~2Tattack-id: ~D~%" (-> this attack-id))
(label cfg-4)
this
)
;; failed to figure out what this is:
(defskelgroup skel-tpl-spike-trap tpl-spike-trap tpl-spike-trap-lod0-jg tpl-spike-trap-idle-ja
((tpl-spike-trap-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 12)
)
;; failed to figure out what this is:
(defstate idle-down (tpl-spike-trap)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('up)
(go-virtual idle-up)
)
)
)
:code (behavior ()
(when (-> self was-up)
(sound-play "temple-spikes")
(ja-no-eval :group! tpl-spike-trap-down-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
(set! (-> self was-up) #f)
(sleep-code)
)
:post ja-post
)
;; failed to figure out what this is:
(defstate idle-up (tpl-spike-trap)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('down)
(go-virtual idle-down)
)
(('touch)
(let ((gp-0 (as-type proc process-focusable)))
(when (and gp-0 (= (-> gp-0 type) target))
(when (time-elapsed? (-> self no-collision-timer) (seconds 0.2))
(let* ((v1-9
((method-of-type res-lump get-property-struct)
(-> self entity)
'spike-toss-dest
'interp
-1000000000.0
(new 'static 'structure)
(the-as (pointer res-tag) #f)
*res-static-buf*
)
)
(s4-2
(vector-! (new 'stack-no-clear 'vector) (the-as vector v1-9) (-> (the-as process-drawable gp-0) root trans))
)
)
(set! (-> s4-2 y) 0.0)
(vector-xz-normalize! s4-2 1.0)
(when (send-event
gp-0
'attack-invinc
(-> block param 0)
(static-attack-info
:mask (vehicle-impulse-factor)
((id (the-as uint (-> self attack-id)))
(damage 2.0)
(vehicle-damage-factor 1.0)
(vehicle-impulse-factor 1.0)
(vector s4-2)
(shove-back (meters 10))
(shove-up (meters 5))
(control (if (focus-test? (the-as process-focusable gp-0) board)
1.0
0.0
)
)
)
)
)
(let ((v0-0 (the-as object (current-time))))
(set! (-> self no-collision-timer) (the-as time-frame v0-0))
v0-0
)
)
)
)
)
)
)
)
)
:code (behavior ()
(when (not (-> self was-up))
(sound-play "temple-spikes")
(ja-no-eval :group! tpl-spike-trap-up-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
(set! (-> self was-up) #t)
(sleep-code)
)
:post ja-post
)
;; definition for method 11 of type tpl-spike-trap
(defmethod init-from-entity! ((this tpl-spike-trap) (arg0 entity-actor))
"Set up a newly created process from the entity that created it."
(let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player))))
(set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-0 reaction) projectile-bounce-reaction)
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
)
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0)))
(set! (-> s4-0 total-prims) (the-as uint 2))
(set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher))
(set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> s3-0 prim-core action) (collide-action solid))
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 32768.0)
(set! (-> s4-0 root-prim) s3-0)
)
(pusher-init s4-0)
(let ((v1-14 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
(set! (-> v1-14 prim-core collide-as) (collide-spec obstacle camera-blocker pusher))
(set! (-> v1-14 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-14 prim-core action) (collide-action solid))
(set! (-> v1-14 transform-index) 3)
(set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 32768.0)
)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(let ((v1-17 (-> s4-0 root-prim)))
(set! (-> s4-0 backup-collide-as) (-> v1-17 prim-core collide-as))
(set! (-> s4-0 backup-collide-with) (-> v1-17 prim-core collide-with))
)
(set! (-> this root) s4-0)
)
(process-drawable-from-entity! this arg0)
(initialize-skeleton
this
(the-as skeleton-group (art-group-get-by-name *level* "skel-tpl-spike-trap" (the-as (pointer level) #f)))
(the-as pair 0)
)
(set! (-> this was-up) #f)
(set-time! (-> this no-collision-timer))
(let* ((v1-24 *game-info*)
(a0-17 (+ (-> v1-24 attack-id) 1))
)
(set! (-> v1-24 attack-id) a0-17)
(set! (-> this attack-id) (the-as int a0-17))
)
(go (method-of-object this idle-down))
)
;; failed to figure out what this is:
(defpart 2620
:init-specs ((:texture (pal-lightning level-default-sprite))
(:birth-func 'birth-func-set-quat)
(:num 1.0)
(:scale-x (meters 2))
(:scale-y (meters 40))
(:r 128.0 64.0)
(:g 128.0 64.0)
(:b 128.0 64.0)
(:a 128.0)
(:timer (seconds 0.017))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat))
)
)
;; failed to figure out what this is:
(defskelgroup skel-tpl-elec-swing-pole tpl-elec-swing-pole tpl-elec-swing-pole-lod0-jg tpl-elec-swing-pole-idle-ja
((tpl-elec-swing-pole-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 8 9)
)
;; definition of type tpl-elec-swing-pole
(deftype tpl-elec-swing-pole (swingpole)
((root collide-shape :override)
(y-start float)
(y-end float)
(electrify symbol)
(lightning lightning-control 4)
(y-disable float)
(sound-id sound-id)
)
(:state-methods
goup
)
)
;; definition for method 3 of type tpl-elec-swing-pole
(defmethod inspect ((this tpl-elec-swing-pole))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type swingpole inspect)))
(t9-0 this)
)
(format #t "~2Ty-start: ~f~%" (-> this y-start))
(format #t "~2Ty-end: ~f~%" (-> this y-end))
(format #t "~2Telectrify: ~A~%" (-> this electrify))
(format #t "~2Tlightning[4] @ #x~X~%" (-> this lightning))
(format #t "~2Ty-disable: ~f~%" (-> this y-disable))
(format #t "~2Tsound-id: ~D~%" (-> this sound-id))
(label cfg-4)
this
)
;; definition for method 10 of type tpl-elec-swing-pole
(defmethod deactivate ((this tpl-elec-swing-pole))
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
(if (-> this sound-id)
(sound-stop (-> this sound-id))
)
((method-of-type swingpole deactivate) this)
(none)
)
;; definition for method 22 of type tpl-elec-swing-pole
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod swingpole-method-22 ((this tpl-elec-swing-pole))
(let ((t9-0 (method-of-type swingpole swingpole-method-22)))
(t9-0 this)
)
(cond
((-> this electrify)
(let ((f30-0 (-> *part-id-table* 2620 init-specs 4 initial-valuef)))
(set! (-> *part-id-table* 2620 init-specs 4 initial-valuef) (-> this edge-length))
(draw-beam (-> *part-id-table* 2620) (-> this root trans) (-> this dir) #f)
(set! (-> *part-id-table* 2620 init-specs 4 initial-valuef) f30-0)
)
(dotimes (s5-0 4)
(let ((f30-1 (rand-vu-float-range 0.0 (-> this edge-length)))
(f0-3 (rand-vu-float-range 0.0 (-> this edge-length)))
)
(let ((a0-5 (-> this lightning s5-0))
(v1-17 (vector+*! (new 'stack-no-clear 'vector) (-> this root trans) (-> this dir) f30-1))
)
(set! (-> a0-5 state meet data 0 quad) (-> v1-17 quad))
)
(let ((a0-8 (-> this lightning s5-0))
(v1-22 (vector+*! (new 'stack-no-clear 'vector) (-> this root trans) (-> this dir) f0-3))
)
(vector-copy! (-> a0-8 state meet data (+ (-> a0-8 state points-to-draw) -1)) v1-22)
)
)
(let ((v1-26 (-> this lightning s5-0))
(a0-11 2)
)
(let ((a1-12 (!= a0-11 (-> v1-26 state mode))))
(case a0-11
((3)
(if a1-12
(set! (-> v1-26 state counter) 0.0)
)
)
((1)
(set! (-> v1-26 state start-color) (-> v1-26 spec start-color))
(set! (-> v1-26 state end-color) (-> v1-26 spec end-color))
)
)
)
(set! (-> v1-26 state mode) (the-as uint a0-11))
)
)
(sound-play "pole-hum-loop" :id (-> this sound-id))
)
(else
(sound-stop (-> this sound-id))
(dotimes (v1-32 4)
(let ((a0-18 (-> this lightning v1-32))
(a1-22 0)
)
(let ((a2-6 (!= a1-22 (-> a0-18 state mode))))
(case a1-22
((3)
(if a2-6
(set! (-> a0-18 state counter) 0.0)
)
)
((1)
(set! (-> a0-18 state start-color) (-> a0-18 spec start-color))
(set! (-> a0-18 state end-color) (-> a0-18 spec end-color))
)
)
)
(set! (-> a0-18 state mode) (the-as uint a1-22))
)
)
)
)
0
(none)
)
;; definition for method 7 of type tpl-elec-swing-pole
;; WARN: Return type mismatch swingpole vs tpl-elec-swing-pole.
(defmethod relocate ((this tpl-elec-swing-pole) (offset int))
(dotimes (v1-0 4)
(if (nonzero? (-> this lightning v1-0))
(&+! (-> this lightning v1-0) offset)
)
)
(the-as tpl-elec-swing-pole ((method-of-type swingpole relocate) this offset))
)
;; failed to figure out what this is:
(defstate idle (tpl-elec-swing-pole)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('down)
(set! (-> self electrify) #f)
#f
)
(('up)
(let ((v0-0 #t))
(set! (-> self electrify) v0-0)
v0-0
)
)
(('touch 'attack)
(if (send-event proc 'pole-grab (-> block param 0))
(go-virtual active (process->handle proc))
)
#f
)
)
)
:trans (behavior ()
(if (task-node-closed? (game-task-node temple-oracle-pole-half))
(go-virtual goup)
)
)
)
;; failed to figure out what this is:
(defstate goup (tpl-elec-swing-pole)
:virtual #t
:trans (behavior ()
(seek! (-> self root trans y) (-> self y-disable) (* 16384.0 (seconds-per-frame)))
)
:code sleep-code
:post transform-post
)
;; failed to figure out what this is:
(defstate active (tpl-elec-swing-pole)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('down)
(set! (-> self electrify) #f)
#f
)
(('up)
(let ((v0-0 #t))
(set! (-> self electrify) v0-0)
v0-0
)
)
)
)
:trans (behavior ()
(if (and *target* (-> self electrify))
(send-event
*target*
'attack
#f
(static-attack-info
:mask (vehicle-impulse-factor)
((id (new-attack-id)) (damage 100.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'shock))
)
)
)
)
)
;; definition for method 23 of type tpl-elec-swing-pole
;; WARN: Return type mismatch int vs none.
(defmethod init-collision! ((this tpl-elec-swing-pole))
(let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player))))
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 7) 0)))
(set! (-> s5-0 total-prims) (the-as uint 8))
(set! (-> s4-0 prim-core collide-as) (collide-spec collectable))
(set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list tobot))
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 32768.0 32768.0)
(set! (-> s5-0 root-prim) s4-0)
)
(let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-7 prim-core collide-as) (collide-spec collectable))
(set! (-> v1-7 prim-core collide-with) (collide-spec jak player-list tobot))
(set-vector! (-> v1-7 local-sphere) 0.0 0.0 8192.0 8192.0)
)
(let ((v1-9 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-9 prim-core collide-as) (collide-spec collectable))
(set! (-> v1-9 prim-core collide-with) (collide-spec jak player-list tobot))
(set-vector! (-> v1-9 local-sphere) 0.0 0.0 16384.0 8192.0)
)
(let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-11 prim-core collide-as) (collide-spec collectable))
(set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list tobot))
(set-vector! (-> v1-11 local-sphere) 0.0 0.0 24576.0 8192.0)
)
(let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-13 prim-core collide-as) (collide-spec collectable))
(set! (-> v1-13 prim-core collide-with) (collide-spec jak player-list tobot))
(set-vector! (-> v1-13 local-sphere) 0.0 0.0 32768.0 8192.0)
)
(let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-15 prim-core collide-as) (collide-spec collectable))
(set! (-> v1-15 prim-core collide-with) (collide-spec jak player-list tobot))
(set-vector! (-> v1-15 local-sphere) 0.0 0.0 40960.0 8192.0)
)
(let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-17 prim-core collide-as) (collide-spec collectable))
(set! (-> v1-17 prim-core collide-with) (collide-spec jak player-list tobot))
(set-vector! (-> v1-17 local-sphere) 0.0 0.0 49152.0 8192.0)
)
(let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-19 prim-core collide-as) (collide-spec collectable))
(set! (-> v1-19 prim-core collide-with) (collide-spec jak player-list tobot))
(set-vector! (-> v1-19 local-sphere) 0.0 0.0 57344.0 8192.0)
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(let ((v1-22 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-22 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-22 prim-core collide-with))
)
(set! (-> this root) s5-0)
)
0
(none)
)
;; definition for method 24 of type tpl-elec-swing-pole
;; WARN: Return type mismatch collide-prim-core vs vector.
(defmethod get-trans ((this tpl-elec-swing-pole))
(the-as vector (-> this root root-prim prim-core))
)
;; definition for method 11 of type tpl-elec-swing-pole
;; INFO: Used lq/sq
(defmethod init-from-entity! ((this tpl-elec-swing-pole) (arg0 entity-actor))
"Set up a newly created process from the entity that created it."
(stack-size-set! (-> this main-thread) 128)
(set! (-> this y-start) (res-lump-float (-> this entity) 'y-start))
(set! (-> this y-end) (res-lump-float (-> this entity) 'y-end))
(set! (-> this electrify) #f)
(set! (-> this sound-id) (new-sound-id))
(init-collision! this)
(vector-copy! (-> this root trans) (-> arg0 extra trans))
(quaternion-copy! (-> this root quat) (-> arg0 quat))
(vector-identity! (-> this root scale))
(vector-z-quaternion! (-> this dir) (-> this root quat))
(set! (-> this joint-track) -1)
(set! (-> this y-disable) (+ 37888.0 (-> this root trans y)))
(initialize-skeleton
this
(the-as skeleton-group (art-group-get-by-name *level* "skel-tpl-elec-swing-pole" (the-as (pointer level) #f)))
(the-as pair 0)
)
(set! (-> this dir y) 0.0)
(vector-normalize! (-> this dir) 1.0)
(set! (-> this edge-length) 8192.0)
(let ((s4-1 (new 'stack-no-clear 'sync-info-params)))
(let ((a0-15 (res-lump-value arg0 'options uint128 :time -1000000000.0))
(v1-19 0)
)
(if (not (logtest? (the-as int a0-15) 8))
(set! v1-19 (logior v1-19 1))
)
(set! (-> s4-1 sync-type) 'sync-eased)
(set! (-> s4-1 sync-flags) (the-as sync-flags v1-19))
)
(set! (-> s4-1 period) (the-as uint 0))
(set! (-> s4-1 entity) arg0)
(set! (-> s4-1 percent) 0.0)
(set! (-> s4-1 ease-in) 0.2)
(set! (-> s4-1 ease-out) 0.2)
(set! (-> s4-1 pause-in) 0.0)
(set! (-> s4-1 pause-out) 0.0)
(initialize! (-> this sync) s4-1)
)
(when (nonzero? (-> this sync period))
(set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f))
(when (and (zero? (-> this path curve num-cverts)) (-> this entity))
(set! (-> this path curve num-cverts) 2)
(set! (-> this path curve cverts) (-> (new 'process 'vector-array 2) data))
(logclear! (-> this path flags) (path-control-flag not-found))
(vector+*! (-> this path curve cverts 0) (-> this entity trans) *y-vector* (* 4096.0 (-> this y-start)))
(vector+*! (-> this path curve cverts 1) (-> this entity trans) *y-vector* (* 4096.0 (-> this y-end)))
)
(if (and (nonzero? (-> this path)) (nonzero? (-> this path curve num-cverts)))
(logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text))
)
)
(set! (-> this sound) (new 'process 'ambient-sound (-> this entity) (-> this root trans) 0.0))
(set! (-> this edge-length) 65536.0)
(dotimes (s5-1 4)
(set! (-> this lightning s5-1) (new
'process
'lightning-control
(new 'static 'lightning-spec
:name #f
:flags (lightning-spec-flags lsf0)
:start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
:end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
:fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5)
:fade-start-factor 0.2
:fade-time 120.0
:texture (new 'static 'texture-id :index #x3f :page #x4)
:reduction 0.42
:num-points 10
:box-size 8192.0
:merge-factor 0.5
:merge-count 2
:radius 512.0
:duration -1.0
:sound #f
)
this
0.0
)
)
(let ((v1-59 (-> this lightning s5-1))
(a0-39 0)
)
(let ((a1-18 (!= a0-39 (-> v1-59 state mode))))
(case a0-39
((3)
(if a1-18
(set! (-> v1-59 state counter) 0.0)
)
)
((1)
(set! (-> v1-59 state start-color) (-> v1-59 spec start-color))
(set! (-> v1-59 state end-color) (-> v1-59 spec end-color))
)
)
)
(set! (-> v1-59 state mode) (the-as uint a0-39))
)
)
(go (method-of-object this idle))
)
;; definition of type tpl-spindle
(deftype tpl-spindle (process-drawable)
((root collide-shape :override)
(init-quat quaternion :inline)
(init-quat2 quaternion :inline)
(rot-angle float)
(shudder-angle float)
(cycle-time float)
(cycle-offset float)
)
(:state-methods
idle
idle-slow
)
)
;; definition for method 3 of type tpl-spindle
(defmethod inspect ((this tpl-spindle))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 this)
)
(format #t "~2Tinit-quat: #<quaternion @ #x~X>~%" (-> this init-quat))
(format #t "~2Tinit-quat2: #<quaternion @ #x~X>~%" (-> this init-quat2))
(format #t "~2Trot-angle: ~f~%" (-> this rot-angle))
(format #t "~2Tshudder-angle: ~f~%" (-> this shudder-angle))
(format #t "~2Tcycle-time: ~f~%" (-> this cycle-time))
(format #t "~2Tcycle-offset: ~f~%" (-> this cycle-offset))
(label cfg-4)
this
)
;; failed to figure out what this is:
(defskelgroup skel-tpl-spindle tpl-spindle tpl-spindle-lod0-jg tpl-spindle-idle-ja
((tpl-spindle-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 45)
)
;; failed to figure out what this is:
(defstate idle (tpl-spindle)
:virtual #t
:enter (behavior ()
(set-time! (-> self state-time))
)
:trans (behavior ()
(rider-trans)
(let ((gp-1 (quaternion-vector-angle!
(new 'stack-no-clear 'quaternion)
*z-vector*
(* 436.90668
(the float (- (current-time) (-> self state-time)))
(lerp-scale 1.0 2.0 (-> self clock clock-ratio) 1.0 0.05)
)
)
)
)
(quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *z-vector* 0.0)
(quaternion*! (-> self root quat) (-> self init-quat2) gp-1)
)
(quaternion-normalize! (-> self root quat))
(when (= (-> self clock clock-ratio) 0.05)
)
)
:code sleep-code
:post (behavior ()
(rider-post)
)
)
;; failed to figure out what this is:
(defstate idle-slow (tpl-spindle)
:virtual #t
:trans (behavior ()
(rider-trans)
(let ((a2-1 (quaternion-vector-angle!
(new 'stack-no-clear 'quaternion)
*z-vector*
(+ (-> self rot-angle) (-> self shudder-angle))
)
)
)
(quaternion*! (-> self root quat) (-> self init-quat) a2-1)
)
(when (!= (-> self clock clock-ratio) 0.05)
(quaternion-copy! (-> self init-quat2) (-> self root quat))
(go-virtual idle)
)
)
:code (behavior ()
(suspend-for (the int (-> self cycle-offset))
)
(until #f
(suspend-for (the int (-> self cycle-time))
)
(sound-play "fan-shake" :position (-> self root trans))
(suspend-for (seconds 0.01)
(let ((f0-5 (* 36408.89 (the float (- (current-time) time))))
(f1-3 (* 0.33333334 (- 3.0 (the float (- (current-time) time)))))
)
(set! (-> self shudder-angle) (* 0.0018204444 f1-3 (sin f0-5)))
)
)
(set! (-> self shudder-angle) 0.0)
(suspend-for (seconds 0.04)
)
(sound-play "fan-turn" :position (-> self root trans))
(let* ((f0-9 100.0)
(f30-1 (* 16384.0 f0-9))
)
(suspend-for (seconds 0.01)
(set! (-> self rot-angle)
(the float (sar (shl (the int (+ (-> self rot-angle) (* f30-1 (seconds-per-frame)))) 48) 48))
)
)
)
(let ((v1-47 #x4000))
(if (< (-> self rot-angle) 0.0)
(set! (-> self rot-angle)
(the float (sar (shl (* v1-47 (/ (- (the int (-> self rot-angle)) (/ v1-47 2)) v1-47)) 48) 48))
)
(set! (-> self rot-angle)
(the float (sar (shl (* v1-47 (/ (+ (the int (-> self rot-angle)) (/ v1-47 2)) v1-47)) 48) 48))
)
)
)
)
#f
)
:post (behavior ()
(rider-post)
)
)
;; definition for method 11 of type tpl-spindle
;; INFO: Used lq/sq
(defmethod init-from-entity! ((this tpl-spindle) (arg0 entity-actor))
"Set up a newly created process from the entity that created it."
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
(let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
(set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher))
(set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> s3-0 prim-core action) (collide-action solid rideable))
(set! (-> s3-0 transform-index) 3)
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 184320.0)
(set! (-> s4-0 total-prims) (the-as uint 1))
(set! (-> s4-0 root-prim) s3-0)
)
(pusher-init s4-0)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(let ((v1-12 (-> s4-0 root-prim)))
(set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as))
(set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with))
)
(set! (-> this root) s4-0)
)
(process-drawable-from-entity! this arg0)
(initialize-skeleton
this
(the-as skeleton-group (art-group-get-by-name *level* "skel-tpl-spindle" (the-as (pointer level) #f)))
(the-as pair 0)
)
(logclear! (-> this mask) (process-mask actor-pause))
(set! (-> this root rider-max-momentum) 819.2)
(set! (-> this rot-angle) 0.0)
(set! (-> this shudder-angle) 0.0)
(quaternion-copy! (-> this init-quat) (-> this root quat))
(quaternion-copy! (-> this init-quat2) (-> this root quat))
(ja-channel-push! 1 0)
(let ((s4-2 (-> this skel root-channel 0)))
(joint-control-channel-group-eval!
s4-2
(the-as art-joint-anim (-> this draw art-group data 2))
num-func-identity
)
(set! (-> s4-2 frame-num) 0.0)
)
(transform-post)
(let ((f28-0 0.4)
(f30-0 0.0)
)
(let* ((sv-16 (new 'static 'res-tag))
(v1-30 (res-lump-data arg0 'cycle-speed (pointer float) :tag-ptr (& sv-16)))
)
(when v1-30
(set! f28-0 (-> v1-30 0))
(set! f30-0 (-> v1-30 1))
)
)
(set! (-> this cycle-time) (the float (max 0 (+ (the int (* 300.0 f28-0)) -6))))
(set! (-> this cycle-offset) (the float (the int (* 300.0 f30-0))))
)
(set! (-> this draw light-index) (the-as uint 5))
(go (method-of-object this idle-slow))
)
;; definition of type tpl-fan-two
(deftype tpl-fan-two (process-drawable)
((quat quaternion :inline)
(cycle-time float)
(cycle-offset float)
(start-timef float)
(next-sound float)
(last-sound float)
)
(:state-methods
idle
)
)
;; definition for method 3 of type tpl-fan-two
(defmethod inspect ((this tpl-fan-two))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 this)
)
(format #t "~2Tquat: #<quaternion @ #x~X>~%" (-> this quat))
(format #t "~2Tcycle-time: ~f~%" (-> this cycle-time))
(format #t "~2Tcycle-offset: ~f~%" (-> this cycle-offset))
(format #t "~2Tstart-timef: ~f~%" (-> this start-timef))
(format #t "~2Tnext-sound: ~f~%" (-> this next-sound))
(format #t "~2Tlast-sound: ~f~%" (-> this last-sound))
(label cfg-4)
this
)
;; failed to figure out what this is:
(defskelgroup skel-tpl-fan-two tpl-fan-two tpl-fan-two-lod0-jg tpl-fan-two-idle-ja
((tpl-fan-two-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 15)
)
;; failed to figure out what this is:
(defstate idle (tpl-fan-two)
:virtual #t
:enter (behavior ()
(set! (-> self start-timef) (the float (current-time)))
(set! (-> self next-sound) (the float (current-time)))
)
:trans (behavior ()
(let ((f0-2 (lerp-scale 91022.22 (-> self cycle-time) (-> self clock clock-ratio) 1.0 0.05)))
0.0
(+! (-> self start-timef) (* f0-2 (seconds-per-frame)))
)
(let ((f30-0 (- (-> self start-timef) (-> self cycle-offset))))
(let ((a2-2 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *z-vector* (+ -3640.889 f30-0))))
(quaternion*! (-> self root quat) (-> self quat) a2-2)
)
(vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))
(let ((f0-11
(lerp-scale
1.0
0.0
(fabs (vector-dot (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root trans)) *z-vector*))
20480.0
81920.0
)
)
)
(when (< (-> self next-sound) f30-0)
(+! (-> self next-sound) 32768.0)
(if (and (!= f0-11 0.0) (< -40960.0 (- (-> (target-pos 0) y) (-> self root trans y))))
(sound-play-by-name
(static-sound-name "fan-whsh-fast")
(new-sound-id)
1024
(the int (* 1524.0 (lerp-scale 0.0 -0.3 (-> self clock clock-ratio) 1.0 0.05)))
0
(sound-group)
(-> self root trans)
)
)
)
)
)
(rider-trans)
)
:code (behavior ()
(until #f
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
#f
)
:post (behavior ()
(rider-post)
)
)
;; definition for method 11 of type tpl-fan-two
;; INFO: Used lq/sq
(defmethod init-from-entity! ((this tpl-fan-two) (arg0 entity-actor))
"Set up a newly created process from the entity that created it."
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
(let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
(set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher))
(set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> s3-0 prim-core action) (collide-action solid rideable))
(set! (-> s3-0 transform-index) 3)
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 61440.0)
(set! (-> s4-0 total-prims) (the-as uint 1))
(set! (-> s4-0 root-prim) s3-0)
)
(pusher-init s4-0)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(let ((v1-12 (-> s4-0 root-prim)))
(set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as))
(set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with))
)
(set! (-> this root) s4-0)
)
(process-drawable-from-entity! this arg0)
(initialize-skeleton
this
(the-as skeleton-group (art-group-get-by-name *level* "skel-tpl-fan-two" (the-as (pointer level) #f)))
(the-as pair 0)
)
(logclear! (-> this mask) (process-mask actor-pause))
(quaternion-copy! (-> this quat) (-> this root quat))
(let ((f28-0 720.0)
(f30-0 0.0)
)
(let* ((sv-16 (new 'static 'res-tag))
(v1-22 (res-lump-data arg0 'cycle-speed (pointer float) :tag-ptr (& sv-16)))
)
(when v1-22
(set! f28-0 (-> v1-22 0))
(set! f30-0 (-> v1-22 1))
)
)
(set! (-> this cycle-time) (* 182.04445 f28-0))
(set! (-> this cycle-offset) (* 182.04445 f30-0))
)
(set! (-> this draw light-index) (the-as uint 5))
(go (method-of-object this idle))
)
;; definition of type tpl-fan-three
(deftype tpl-fan-three (process-drawable)
((quat quaternion :inline)
(cycle-time float)
(cycle-offset float)
(start-timef float)
(next-sound float)
(last-sound float)
)
(:state-methods
idle
)
)
;; definition for method 3 of type tpl-fan-three
(defmethod inspect ((this tpl-fan-three))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 this)
)
(format #t "~2Tquat: #<quaternion @ #x~X>~%" (-> this quat))
(format #t "~2Tcycle-time: ~f~%" (-> this cycle-time))
(format #t "~2Tcycle-offset: ~f~%" (-> this cycle-offset))
(format #t "~2Tstart-timef: ~f~%" (-> this start-timef))
(format #t "~2Tnext-sound: ~f~%" (-> this next-sound))
(format #t "~2Tlast-sound: ~f~%" (-> this last-sound))
(label cfg-4)
this
)
;; failed to figure out what this is:
(defskelgroup skel-tpl-fan-three tpl-fan-three tpl-fan-three-lod0-jg tpl-fan-three-idle-ja
((tpl-fan-three-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 15)
)
;; failed to figure out what this is:
(defstate idle (tpl-fan-three)
:virtual #t
:enter (behavior ()
(set! (-> self start-timef) (the float (current-time)))
(set! (-> self next-sound) (the float (current-time)))
)
:trans (behavior ()
(let ((f0-2 (lerp-scale 91022.22 (-> self cycle-time) (-> self clock clock-ratio) 1.0 0.05)))
0.0
(+! (-> self start-timef) (* f0-2 (seconds-per-frame)))
)
(let ((f30-0 (- (-> self start-timef) (-> self cycle-offset))))
(let ((a2-2 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *z-vector* (+ 10922.667 f30-0))))
(quaternion*! (-> self root quat) (-> self quat) a2-2)
)
(vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))
(let ((f0-11
(lerp-scale
1.0
0.0
(fabs (vector-dot (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root trans)) *z-vector*))
20480.0
81920.0
)
)
)
(when (< (-> self next-sound) f30-0)
(+! (-> self next-sound) 21845.334)
(if (and (!= f0-11 0.0) (< -40960.0 (- (-> (target-pos 0) y) (-> self root trans y))))
(sound-play-by-name
(static-sound-name "fan-whsh-fast")
(new-sound-id)
1024
(the int (* 1524.0 (lerp-scale 0.0 -0.7 (-> self clock clock-ratio) 1.0 0.05)))
0
(sound-group)
(-> self root trans)
)
)
)
)
)
(rider-trans)
)
:code (behavior ()
(until #f
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
#f
)
:post (behavior ()
(rider-post)
)
)
;; definition for method 11 of type tpl-fan-three
;; INFO: Used lq/sq
(defmethod init-from-entity! ((this tpl-fan-three) (arg0 entity-actor))
"Set up a newly created process from the entity that created it."
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
(let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
(set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher))
(set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> s3-0 prim-core action) (collide-action solid rideable))
(set! (-> s3-0 transform-index) 3)
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 61440.0)
(set! (-> s4-0 total-prims) (the-as uint 1))
(set! (-> s4-0 root-prim) s3-0)
)
(pusher-init s4-0)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(let ((v1-12 (-> s4-0 root-prim)))
(set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as))
(set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with))
)
(set! (-> this root) s4-0)
)
(process-drawable-from-entity! this arg0)
(initialize-skeleton
this
(the-as skeleton-group (art-group-get-by-name *level* "skel-tpl-fan-three" (the-as (pointer level) #f)))
(the-as pair 0)
)
(logclear! (-> this mask) (process-mask actor-pause))
(quaternion-copy! (-> this quat) (-> this root quat))
(let ((f28-0 720.0)
(f30-0 0.0)
)
(let* ((sv-16 (new 'static 'res-tag))
(v1-22 (res-lump-data arg0 'cycle-speed (pointer float) :tag-ptr (& sv-16)))
)
(when v1-22
(set! f28-0 (-> v1-22 0))
(set! f30-0 (-> v1-22 1))
)
)
(set! (-> this cycle-time) (* 182.04445 f28-0))
(set! (-> this cycle-offset) (* 182.04445 f30-0))
)
(set! (-> this draw light-index) (the-as uint 5))
(go (method-of-object this idle))
)
;; definition of type tpl-break-alcove
(deftype tpl-break-alcove (process-drawable)
((root collide-shape :override)
(alt-actor entity-actor)
(extra-id uint32)
(perm uint32)
(part-explode sparticle-launch-control)
(spawn-part sparticle-launch-control)
)
(:state-methods
idle
closed
die-fast
)
)
;; definition for method 3 of type tpl-break-alcove
(defmethod inspect ((this tpl-break-alcove))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 this)
)
(format #t "~2Talt-actor: ~A~%" (-> this alt-actor))
(format #t "~2Textra-id: ~D~%" (-> this extra-id))
(format #t "~2Tperm: ~D~%" (-> this perm))
(format #t "~2Tpart-explode: ~A~%" (-> this part-explode))
(format #t "~2Tspawn-part: ~A~%" (-> this spawn-part))
(label cfg-4)
this
)
;; failed to figure out what this is:
(defskelgroup skel-tpl-break-alcove tpl-break-alcove tpl-break-alcove-lod0-jg tpl-break-alcove-idle-ja
((tpl-break-alcove-lod0-mg (meters 999999)))
:bounds (static-spherem 0 8 0 30)
)
;; failed to figure out what this is:
(defstate idle (tpl-break-alcove)
:virtual #t
:enter (behavior ()
(let ((v1-1 (-> self root root-prim)))
(set! (-> v1-1 prim-core collide-as) (collide-spec))
(set! (-> v1-1 prim-core collide-with) (collide-spec))
)
0
(sound-play "door-break")
(set! (-> self spawn-part) (the-as sparticle-launch-control #t))
)
:code (behavior ()
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(let ((gp-0 (res-lump-struct (-> self entity) 'on-exit structure)))
(if gp-0
(script-eval (the-as pair gp-0))
)
)
(suspend-for (seconds 1)
)
(cleanup-for-death self)
(deactivate self)
)
:post (behavior ()
(when (-> self spawn-part)
(set! (-> self spawn-part) #f)
(let ((gp-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))))
(matrix<-trans gp-0 (-> self root trans))
(spawn-from-mat (-> self part-explode) gp-0)
)
)
(transform-post)
)
)
;; failed to figure out what this is:
(defstate closed (tpl-break-alcove)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('attack)
(let ((v1-1 (the-as attack-info (-> block param 1))))
(if (or (= (-> v1-1 mode) 'dark-smack) (and (logtest? (attack-mask penetrate-using) (-> v1-1 mask))
(logtest? (penetrate dark-smack) (-> v1-1 penetrate-using))
)
)
(go-virtual idle)
)
)
)
)
)
:code (behavior ()
(ja-channel-push! 1 0)
(ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) :num! min)
(transform-post)
(until #f
(suspend)
)
#f
)
:post (behavior ()
(let ((gp-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))))
(matrix<-trans gp-0 (-> self root trans))
(spawn-from-mat (-> self part) gp-0)
)
(transform-post)
)
)
;; failed to figure out what this is:
(defstate die-fast (tpl-break-alcove)
:virtual #t
:code (behavior ()
(suspend)
(process-entity-status! self (entity-perm-status dead) #t)
)
)
;; definition for method 10 of type tpl-break-alcove
(defmethod deactivate ((this tpl-break-alcove))
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
(if (nonzero? (-> this part))
(kill-particles (-> this part))
)
(if (nonzero? (-> this part-explode))
(kill-particles (-> this part-explode))
)
((method-of-type process-drawable deactivate) this)
(none)
)
;; definition for method 7 of type tpl-break-alcove
;; WARN: Return type mismatch process-drawable vs tpl-break-alcove.
(defmethod relocate ((this tpl-break-alcove) (offset int))
(if (nonzero? (-> this part-explode))
(&+! (-> this part-explode) offset)
)
(the-as tpl-break-alcove ((method-of-type process-drawable relocate) this offset))
)
;; definition for method 11 of type tpl-break-alcove
(defmethod init-from-entity! ((this tpl-break-alcove) (arg0 entity-actor))
"Set up a newly created process from the entity that created it."
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
(let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
(set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher))
(set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> s3-0 prim-core action) (collide-action solid rideable))
(set! (-> s3-0 transform-index) 2)
(set-vector! (-> s3-0 local-sphere) 0.0 32768.0 0.0 32768.0)
(set! (-> s4-0 total-prims) (the-as uint 1))
(set! (-> s4-0 root-prim) s3-0)
)
(pusher-init s4-0)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(let ((v1-12 (-> s4-0 root-prim)))
(set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as))
(set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with))
)
(set! (-> this root) s4-0)
)
(set! (-> this entity) arg0)
(process-drawable-from-entity! this arg0)
(initialize-skeleton
this
(the-as skeleton-group (art-group-get-by-name *level* "skel-tpl-break-alcove" (the-as (pointer level) #f)))
(the-as pair 0)
)
(logclear! (-> this mask) (process-mask actor-pause))
(set! (-> this draw light-index) (the-as uint 10))
(set! (-> this alt-actor) (entity-actor-lookup arg0 'alt-actor 0))
(set! (-> this extra-id) (res-lump-value (-> this entity) 'extra-id uint :time -1000000000.0))
(set! (-> this part) (create-launch-control group-tpl-break-alcove this))
(set! (-> this part-explode) (create-launch-control group-tpl-break-alcove-explode this))
(let ((s5-1 (res-lump-struct (-> this entity) 'on-activate structure)))
(if (and s5-1 (not (script-eval (the-as pair s5-1))))
(go (method-of-object this die-fast))
)
)
(go (method-of-object this closed))
)
;; failed to figure out what this is:
(defskelgroup skel-tpl-break-door-a tpl-break-door-a tpl-break-door-a-lod0-jg tpl-break-door-a-idle-ja
((tpl-break-door-a-lod0-mg (meters 999999)))
:bounds (static-spherem 0 8 0 30)
)
;; definition of type tpl-break-door-a
(deftype tpl-break-door-a (process-drawable)
((root collide-shape :override)
(alt-actor entity-actor)
(extra-id uint32)
(perm uint32)
(part-explode sparticle-launch-control)
(spawn-part sparticle-launch-control)
)
(:state-methods
idle
closed
die-fast
)
)
;; definition for method 3 of type tpl-break-door-a
(defmethod inspect ((this tpl-break-door-a))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 this)
)
(format #t "~2Talt-actor: ~A~%" (-> this alt-actor))
(format #t "~2Textra-id: ~D~%" (-> this extra-id))
(format #t "~2Tperm: ~D~%" (-> this perm))
(format #t "~2Tpart-explode: ~A~%" (-> this part-explode))
(format #t "~2Tspawn-part: ~A~%" (-> this spawn-part))
(label cfg-4)
this
)
;; failed to figure out what this is:
(defstate idle (tpl-break-door-a)
:virtual #t
:enter (behavior ()
(let ((v1-1 (-> self root root-prim)))
(set! (-> v1-1 prim-core collide-as) (collide-spec))
(set! (-> v1-1 prim-core collide-with) (collide-spec))
)
0
(sound-play "door-break")
(set! (-> self spawn-part) (the-as sparticle-launch-control #t))
)
:code (behavior ()
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(let ((gp-0 (res-lump-struct (-> self entity) 'on-exit structure)))
(if gp-0
(script-eval (the-as pair gp-0))
)
)
(suspend-for (seconds 1)
)
(cleanup-for-death self)
(deactivate self)
)
:post (behavior ()
(when (-> self spawn-part)
(set! (-> self spawn-part) #f)
(let ((gp-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))))
(matrix<-trans gp-0 (-> self root trans))
(spawn-from-mat (-> self part-explode) gp-0)
)
)
(transform-post)
)
)
;; failed to figure out what this is:
(defstate closed (tpl-break-door-a)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('attack 'attack-invinc)
(let ((v1-2 (the-as attack-info (-> block param 1))))
(if (or (= (-> v1-2 mode) 'dark-smack) (and (logtest? (attack-mask penetrate-using) (-> v1-2 mask))
(logtest? (penetrate dark-smack) (-> v1-2 penetrate-using))
)
)
(go-virtual idle)
)
)
)
)
)
:code (behavior ()
(sound-play "door-break")
(ja-channel-push! 1 0)
(ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) :num! min)
(transform-post)
(until #f
(suspend)
)
#f
)
:post (behavior ()
(let ((gp-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))))
(matrix<-trans gp-0 (-> self root trans))
(spawn-from-mat (-> self part) gp-0)
)
(transform-post)
)
)
;; failed to figure out what this is:
(defstate die-fast (tpl-break-door-a)
:virtual #t
:code (behavior ()
(suspend)
(process-entity-status! self (entity-perm-status dead) #t)
)
)
;; definition for method 10 of type tpl-break-door-a
(defmethod deactivate ((this tpl-break-door-a))
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
(if (nonzero? (-> this part))
(kill-particles (-> this part))
)
(if (nonzero? (-> this part-explode))
(kill-particles (-> this part-explode))
)
((method-of-type process-drawable deactivate) this)
(none)
)
;; definition for method 7 of type tpl-break-door-a
;; WARN: Return type mismatch process-drawable vs tpl-break-door-a.
(defmethod relocate ((this tpl-break-door-a) (offset int))
(if (nonzero? (-> this part-explode))
(&+! (-> this part-explode) offset)
)
(the-as tpl-break-door-a ((method-of-type process-drawable relocate) this offset))
)
;; definition for method 11 of type tpl-break-door-a
(defmethod init-from-entity! ((this tpl-break-door-a) (arg0 entity-actor))
"Set up a newly created process from the entity that created it."
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
(let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
(set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher))
(set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> s3-0 prim-core action) (collide-action solid rideable))
(set! (-> s3-0 transform-index) 2)
(set-vector! (-> s3-0 local-sphere) 0.0 40960.0 0.0 40960.0)
(set! (-> s4-0 total-prims) (the-as uint 1))
(set! (-> s4-0 root-prim) s3-0)
)
(pusher-init s4-0)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(let ((v1-12 (-> s4-0 root-prim)))
(set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as))
(set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with))
)
(set! (-> this root) s4-0)
)
(set! (-> this entity) arg0)
(process-drawable-from-entity! this arg0)
(initialize-skeleton
this
(the-as skeleton-group (art-group-get-by-name *level* "skel-tpl-break-door-a" (the-as (pointer level) #f)))
(the-as pair 0)
)
(logclear! (-> this mask) (process-mask actor-pause))
(set! (-> this alt-actor) (entity-actor-lookup arg0 'alt-actor 0))
(set! (-> this extra-id) (res-lump-value (-> this entity) 'extra-id uint :time -1000000000.0))
(set! (-> this part) (create-launch-control group-tpl-break-door-a this))
(set! (-> this part-explode) (create-launch-control group-tpl-break-door-explode this))
(let ((s5-1 (res-lump-struct (-> this entity) 'on-activate structure)))
(if (and s5-1 (not (script-eval (the-as pair s5-1))))
(go (method-of-object this die-fast))
)
)
(set! (-> this spawn-part) #f)
(go (method-of-object this closed))
)