;;-*-Lisp-*- (in-package goal) ;; failed to figure out what this is: (defpartgroup group-talkbox-speak :id 122 :flags (sp4 sp6) :bounds (static-bspherem 0 0 0 2) :rotate ((degrees 90) (degrees 0) (degrees 0)) :parts ((sp-item 407 :flags (is-3d sp6 sp7) :period (seconds 0.435) :length (seconds 0.1)) (sp-item 407 :flags (is-3d sp6 sp7) :period (seconds 0.5) :length (seconds 0.117) :offset 5) (sp-item 407 :flags (is-3d sp6 sp7) :period (seconds 1.1) :length (seconds 0.085) :offset 35) (sp-item 407 :flags (is-3d sp6 sp7) :period (seconds 0.835) :length (seconds 0.2) :offset 15) (sp-item 407 :flags (is-3d sp6 sp7) :period (seconds 1.55) :length (seconds 0.25) :offset 60) ) ) ;; failed to figure out what this is: (defpart 407 :init-specs ((:texture (shockwave level-default-sprite)) (:birth-func 'birth-func-set-vel) (:num 0.0 0.3) (:y (meters 0.15)) (:z (meters 0.4)) (:scale-x (meters 0.1)) (:scale-y :copy scale-x) (:r 255.0) (:g 255.0) (:b 255.0) (:a 16.0) (:vel-y (meters 0.006666667) (meters 0.0033333334)) (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) (:scalevel-y :copy scalevel-x) (:fade-a 0.32) (:timer (seconds 0.335)) (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) (:next-time (seconds 0.167)) (:next-launcher 408) (:rotate-y (degrees 0)) ) ) ;; failed to figure out what this is: (defpart 408 :init-specs ((:fade-a -0.64)) ) ;; definition of type camera-remote (deftype camera-remote (camera-slave) () ) ;; definition for method 3 of type camera-remote (defmethod inspect ((this camera-remote)) (when (not this) (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type camera-slave inspect))) (t9-0 this) ) (label cfg-4) this ) ;; definition of type remote (deftype remote (process-drawable) ((parent (pointer camera-slave) :override) (base-trans vector :inline) (focus focus :inline) (seeker cam-float-seeker :inline) (start-time time-frame) (blend float) (twist float) (speak-effect? symbol) ) (:state-methods enter idle exit ) (:methods (init (_type_) none) (get-track-pt-and-scale (_type_ vector) float) (post-common (_type_) none) ) ) ;; definition for method 3 of type remote (defmethod inspect ((this remote)) (when (not this) (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) (format #t "~2Tbase-trans: ~`vector`P~%" (-> this base-trans)) (format #t "~2Tfocus: #~%" (-> this focus)) (format #t "~2Tseeker: #~%" (-> this seeker)) (format #t "~2Tstart-time: ~D~%" (-> this start-time)) (format #t "~2Tblend: ~f~%" (-> this blend)) (format #t "~2Ttwist: ~f~%" (-> this twist)) (format #t "~2Tspeak-effect?: ~A~%" (-> this speak-effect?)) (label cfg-4) this ) ;; failed to figure out what this is: (defskelgroup skel-voicebox talk-box talk-box-lod0-jg talk-box-idle-ja ((talk-box-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 4) :texture-level 10 :sort 1 ) ;; definition for method 24 of type remote ;; INFO: Used lq/sq (defmethod get-track-pt-and-scale ((this remote) (arg0 vector)) (let ((s4-0 (handle->process (-> this focus handle)))) (when s4-0 (vector-copy! arg0 (get-trans (the-as process-focusable s4-0) 3)) (let ((a0-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat (the-as process-focusable s4-0) 0)))) (vector+float*! arg0 arg0 a0-7 (* -16384.0 (- 1.0 (-> this blend)))) ) ) ) (lerp-scale 1.0 0.0 (-> this blend) 0.8 1.0) ) ;; definition for method 25 of type remote ;; WARN: Return type mismatch int vs none. (defmethod post-common ((this remote)) (with-pp (ja-post) (if (type? (-> this root) collide-shape) (update-transforms (the-as collide-shape (-> this root))) ) (when (and (nonzero? (-> this part)) (and (or (and (-> this next-state) (= (-> this next-state name) 'idle)) (and (-> this next-state) (= (-> this next-state name) 'enter)) ) (-> this speak-effect?) ) ) (let ((v1-15 (vector-float*! (new 'stack-no-clear 'vector) (-> this parent 0 velocity) (-> pp clock frames-per-second)) ) ) (vector+*! *particle-vel* v1-15 (-> this node-list data 3 bone transform fvec) 20480.0) ) (let ((v1-16 *particle-vel*) (a0-10 *particle-vel*) (f0-2 300.0) ) (vector-float*! v1-16 a0-10 (/ 1.0 f0-2)) ) (spawn-from-cspace (-> this part) (-> this node-list data 3)) ) 0 (none) ) ) ;; definition for function remote-track ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defbehavior remote-track remote () (let ((gp-0 (handle->process (-> self focus handle))) (s5-0 (new 'stack-no-clear 'vector)) ) (vector-copy! s5-0 (-> self parent 0 trans)) (let ((f30-0 (get-track-pt-and-scale self s5-0))) (let ((a1-2 (new 'stack-no-clear 'vector))) (vector-copy! a1-2 (-> self parent 0 trans)) (vector-lerp! (-> self root trans) a1-2 s5-0 (-> self blend)) ) (+! (-> self root trans y) (* 1638.4 (sin (* 54.613335 (the float (mod (current-time) 1200)))))) (let ((s5-1 (new 'stack-no-clear 'quaternion))) (forward-up->quaternion s5-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (target-pos 8) (-> self root trans)) 1.0) (new 'static 'vector :y 1.0 :w 1.0) ) (rotate-toward-orientation! (-> self root) s5-1 65536.0 5461.3335 150 150 0.0) ) (when gp-0 (let* ((gp-1 (-> (the-as process-focusable gp-0) root)) (s4-1 (-> self root trans)) (f0-6 (deg-diff (y-angle gp-1) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s4-1 (-> gp-1 trans)))) ) ) (if (< 0.0 f0-6) (seek! (-> self twist) -0.4 (* 0.3 (seconds-per-frame))) (seek! (-> self twist) 0.4 (* 0.3 (seconds-per-frame))) ) ) (let ((a1-9 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-9 from) (process->ppointer self)) (set! (-> a1-9 num-params) 0) (set! (-> a1-9 message) 'blocked-side?) (case (send-event-function (ppointer->process (-> self parent)) a1-9) ((1) (set! (-> self twist) 0.5) ) ((2) (set! (-> self twist) -0.5) ) ((3) (set! (-> self twist) 0.0) ) ) ) (send-event (ppointer->process (-> self parent)) 'joystick (-> self twist) -1.0) ) (set! (-> self root scale x) f30-0) (set! (-> self root scale y) f30-0) (set! (-> self root scale z) f30-0) ) ) 0 (none) ) ;; failed to figure out what this is: (defstate enter (remote) :virtual #t :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('die) (go-virtual exit) ) (('speak-effect) (let ((v0-0 (the-as object (-> block param 0)))) (set! (-> self speak-effect?) (the-as symbol v0-0)) v0-0 ) ) ) ) :enter (behavior () (set! (-> self start-time) (-> *display* game-clock frame-counter)) (let ((a1-1 (as-type (ppointer->process (-> self parent 0 parent)) process-focusable))) (if a1-1 (focus-on! (-> self focus) (the-as process-focusable a1-1)) ) ) ) :trans (behavior () (remote-track) (let ((a0-1 (handle->process (-> self focus handle)))) (if (and a0-1 (< 0.1 (-> self blend))) (point-toward-point-clear-roll-pitch! (-> self root) (get-trans (the-as process-focusable a0-1) 0)) ) ) ) :code (behavior () (let ((a0-1 (as-type (ppointer->process (-> self parent 0 parent)) process-focusable))) (if (and a0-1 (focus-test? (the-as process-focusable a0-1) pilot)) (send-event (ppointer->process (-> self parent)) 'set-dist (new 'static 'vector :z 8192.0 :w 1.0) (new 'static 'vector :y 20480.0 :z 12288.0 :w 1.0) ) (send-event (ppointer->process (-> self parent)) 'set-dist (new 'static 'vector :z 16384.0 :w 1.0) (new 'static 'vector :y 20480.0 :z 40960.0 :w 1.0) ) ) ) (init (-> self seeker) 1.0 0.01 0.022222223 0.1) (set! (-> self seeker target) 0.0) (while (< 0.0001 (-> self blend)) (update! (-> self seeker) 0.0) (set! (-> self blend) (-> self seeker value)) (suspend) ) (set! (-> self blend) 0.0) (go-virtual idle) ) :post (behavior () (post-common self) ) ) ;; failed to figure out what this is: (defstate idle (remote) :virtual #t :event (-> (method-of-type remote enter) event) :trans remote-track :code (behavior () (while (handle->process (-> self focus handle)) (suspend) (ja :num! (loop!)) ) (go-virtual exit) ) :post (-> (method-of-type remote enter) post) ) ;; failed to figure out what this is: (defstate exit (remote) :virtual #t :trans remote-track :code (behavior () (set! (-> self blend) 1.0) (send-event (ppointer->process (-> self parent)) 'change-state empty-state) (suspend) 0 ) :post (-> (method-of-type remote enter) post) ) ;; definition for method 23 of type remote ;; WARN: Return type mismatch remote vs none. (defmethod init ((this remote)) (reset-to-collide-spec (-> this focus) (collide-spec jak player-list)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-voicebox" (the-as (pointer level) #f))) (the-as pair 0) ) (set! (-> this blend) 1.0) (set! (-> this draw light-index) (the-as uint 30)) (set! (-> this speak-effect?) #f) (set! (-> this part) (create-launch-control group-talkbox-speak this)) (none) ) ;; failed to figure out what this is: (defstate cam-remote (camera-slave) :event (-> cam-string event) :enter (-> cam-string enter) :trans (behavior () (if (or (not *camera*) (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) (not (-> self child)) ) (deactivate self) ) ) :code (-> cam-string code) ) ;; definition of type voicebox (deftype voicebox (remote) ((hint handle) ) ) ;; definition for method 3 of type voicebox (defmethod inspect ((this voicebox)) (when (not this) (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type remote inspect))) (t9-0 this) ) (format #t "~2Thint: ~D~%" (-> this hint)) (label cfg-4) this ) ;; failed to figure out what this is: (defstate exit (voicebox) :virtual #t :code (behavior () (remove-setting! 'sound-flava) (set-time! (-> self state-time)) (set! (-> self seeker target) 1.0) (while (and (< (-> self blend) 0.9999) (not (and (not (handle->process (-> self hint))) (time-elapsed? (-> self state-time) (seconds 0.05)) (-> *setting-control* user-current hint) ) ) ) (update! (-> self seeker) 0.0) (set! (-> self blend) (-> self seeker value)) (suspend) ) (set! (-> self blend) 1.0) (send-event (ppointer->process (-> self parent)) 'change-state empty-state) (suspend) (cleanup-for-death self) ) ) ;; definition for function voicebox-init-by-other ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. (defbehavior voicebox-init-by-other voicebox ((arg0 vector) (arg1 handle)) (set! (-> self hint) arg1) (set! (-> self root) (new 'process 'trsqv)) (vector-copy! (-> self root trans) arg0) (vector-copy! (-> self base-trans) arg0) (init self) (set! (-> self event-hook) (-> (method-of-object self enter) event)) (go-virtual enter) (none) ) ;; definition for function voicebox-spawn (defun voicebox-spawn ((arg0 process-drawable) (arg1 vector)) (with-pp (when *camera* (let ((s4-0 (process-spawn camera-remote :init cam-slave-init cam-remote #f :name "camera-remote" :from *camera-dead-pool* :to arg0 ) ) ) (if s4-0 (process-spawn voicebox arg1 (process->handle pp) :name "voicebox" :to (ppointer->process s4-0)) ) ) ) ) ) ;; definition of type judge (deftype judge (remote) ((root collide-shape :override) (total-time time-frame) (beep-time time-frame) (hud-timer handle) (score uint8) (timer? symbol) ) (:state-methods wait ) (:methods (setup-collision! (_type_) none) ) ) ;; definition for method 3 of type judge (defmethod inspect ((this judge)) (when (not this) (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type remote inspect))) (t9-0 this) ) (format #t "~2Ttotal-time: ~D~%" (-> this total-time)) (format #t "~2Tbeep-time: ~D~%" (-> this beep-time)) (format #t "~2Thud-timer: ~D~%" (-> this hud-timer)) (format #t "~2Tscore: ~D~%" (-> this score)) (format #t "~2Ttimer?: ~A~%" (-> this timer?)) (label cfg-4) this ) ;; definition for method 24 of type judge ;; INFO: Used lq/sq (defmethod get-track-pt-and-scale ((this judge) (arg0 vector)) (vector-copy! arg0 (-> this base-trans)) 1.0 ) ;; definition for method 25 of type judge ;; WARN: Return type mismatch int vs none. (defmethod post-common ((this judge)) (ja-post) (if (type? (-> this root) collide-shape) (update-transforms (-> this root)) ) (when (and (-> this next-state) (let ((v1-6 (-> this next-state name))) (or (= v1-6 'idle) (= v1-6 'enter)) ) ) (if *target* (set! (-> *game-info* score) (-> *target* fact trick-point)) ) (when (-> this timer?) (let ((v1-17 (the-as int (- (-> this total-time) (- (-> *display* game-clock frame-counter) (-> this start-time))))) ) (if (< (the-as time-frame v1-17) 0) (set! v1-17 0) ) (set! (-> *game-info* timer) (the-as time-frame v1-17)) ) ) ) 0 (none) ) ;; failed to figure out what this is: (defstate wait (judge) :virtual #t :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('die) (sound-play "judge-stop") (go-virtual exit) ) (('touch 'attack) (when *camera* (let ((s4-0 (process-spawn camera-remote :init cam-slave-init cam-remote #f :name "camera-remote" :from *camera-dead-pool* :to proc ) ) (s5-2 (as-type proc process-focusable)) ) (when s4-0 (change-parent self (ppointer->process s4-0)) (focus-on! (-> self focus) (the-as process-focusable s5-2)) (go-virtual enter) ) ) ) ) (('waiting) #t ) ) ) :code (behavior () (transform-post) (logior! (-> self mask) (process-mask sleep)) (suspend) 0 ) ) ;; failed to figure out what this is: (defstate enter (judge) :virtual #t :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('die) (go-virtual exit) ) (('speak-effect) (let ((v0-0 (the-as object (-> block param 0)))) (set! (-> self speak-effect?) (the-as symbol v0-0)) v0-0 ) ) (('judging) #t ) ) ) :enter (behavior () (set! (-> self start-time) (-> *display* game-clock frame-counter)) (send-event *target* 'get-pickup (pickup-type trick-judge) (if (-> self timer?) (the float (-> self total-time)) #x4d2d08e0 ) ) (sound-play "judge-start") (if (-> self timer?) (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :name "hud-timer" :to self)) ) ) ) ) ;; failed to figure out what this is: (defstate idle (judge) :virtual #t :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('die) (sound-play "judge-stop") (go-virtual exit) ) (('judging) #t ) ) ) :code (behavior () (while (let ((a0-2 (handle->process (-> self focus handle)))) (and a0-2 (!= (send-event a0-2 'test-pickup (pickup-type trick-judge)) 0.0)) ) (suspend) (ja :num! (loop!)) ) (if (-> self timer?) (send-event (handle->process (-> self hud-timer)) 'hide-and-die) ) (go-virtual exit) ) ) ;; definition for method 27 of type judge ;; WARN: Return type mismatch int vs none. (defmethod setup-collision! ((this judge)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec collectable)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list tobot)) (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 16384.0) (set! (-> s5-0 total-prims) (the-as uint 1)) (set! (-> s5-0 root-prim) v1-2) ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (let ((v1-5 (-> s5-0 root-prim))) (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 11 of type judge ;; INFO: Used lq/sq (defmethod init-from-entity! ((this judge) (arg0 entity-actor)) "Set up a newly created process from the entity that created it." (setup-collision! this) (init this) (process-drawable-from-entity! this arg0) (+! (-> this root trans y) 4096.0) (vector-copy! (-> this base-trans) (-> this root trans)) (set! (-> this total-time) (seconds 90)) (go (method-of-object this wait)) ) ;; definition for function judge-init-by-other ;; INFO: Used lq/sq (defbehavior judge-init-by-other judge ((arg0 vector) (arg1 uint) (arg2 symbol)) (process-entity-set! self (the-as entity #f)) (set! (-> self score) arg1) (setup-collision! self) (init self) (vector-identity! (-> self root scale)) (quaternion-identity! (-> self root quat)) (vector-copy! (-> self root trans) arg0) (vector-copy! (-> self base-trans) (-> self root trans)) (set! (-> self total-time) (seconds 90)) (set! (-> self timer?) arg2) (go-virtual wait) ) ;; definition for function judge-spawn ;; WARN: Return type mismatch (pointer process) vs (pointer judge). (defun judge-spawn ((arg0 process-tree) (arg1 vector) (arg2 uint) (arg3 object)) (process-spawn judge arg1 arg2 arg3 :name "judge" :to arg0) )