diff --git a/.vs/launch.vs.json b/.vs/launch.vs.json index a7a463646c..be17fb24ee 100644 --- a/.vs/launch.vs.json +++ b/.vs/launch.vs.json @@ -145,6 +145,7 @@ "name": "Game - Jak 1 - Runtime (boot)", "args": [ "-v", + "--portable", "--game", "jak1", "--", diff --git a/common/formatter/formatter.cpp b/common/formatter/formatter.cpp index 73d8ca17e4..30353ff597 100644 --- a/common/formatter/formatter.cpp +++ b/common/formatter/formatter.cpp @@ -380,7 +380,9 @@ std::vector apply_formatting(const FormatterTreeNode& curr_node, // Consolidate any lines if the configuration requires it // TODO there is a hack here so that multi-line forms that are consolidated still line up properly // i have to make consolidate a more first-class feature of the config - if (curr_node.formatting_config.inline_until_index(form_lines)) { + // TODO - hacky, but prevents a bad situation, clean up + if (curr_node.formatting_config.inline_until_index(form_lines) && + !str_util::contains(form_lines.at(0), ";")) { std::vector new_form_lines = {}; const auto original_form_head_width = str_util::split(form_lines.at(0), '\n').at(0).length(); bool consolidating_lines = true; @@ -436,15 +438,22 @@ std::vector apply_formatting(const FormatterTreeNode& curr_node, } form_lines = {fmt::format("{}", fmt::join(new_form_lines, " "))}; } else { + bool currently_in_block_comment = false; for (int i = 0; i < (int)form_lines.size(); i++) { - if (i > 0) { - auto& line = form_lines.at(i); + auto& line = form_lines.at(i); + if (str_util::contains(line, "|#")) { + currently_in_block_comment = false; + } + if (i > 0 && !currently_in_block_comment) { line = fmt::format("{}{}", str_util::repeat(curr_node.formatting_config.indentation_width_for_index( curr_node.formatting_config, i), " "), line); } + if (str_util::contains(line, "#|") && !str_util::contains(line, "|#")) { + currently_in_block_comment = true; + } } } return form_lines; diff --git a/common/formatter/rules/formatting_rules.cpp b/common/formatter/rules/formatting_rules.cpp index 4ce13352b3..ea8fc52b03 100644 --- a/common/formatter/rules/formatting_rules.cpp +++ b/common/formatter/rules/formatting_rules.cpp @@ -89,10 +89,14 @@ std::vector format_block_comment(const std::string& comment) { comment_contents = str_util::rtrim(comment_contents); std::vector lines = {new_comment}; const auto contents_as_lines = str_util::split_string(comment_contents, "\n"); - for (const auto& line : contents_as_lines) { - lines.push_back(line); + if (contents_as_lines.size() > 1) { + for (const auto& line : contents_as_lines) { + lines.push_back(line); + } + lines.push_back("|#"); + } else { + lines.at(0) = fmt::format("{} {} |#", new_comment, str_util::trim(contents_as_lines.at(0))); } - lines.push_back("|#"); return lines; } } // namespace comments diff --git a/common/formatter/rules/rule_config.cpp b/common/formatter/rules/rule_config.cpp index 9de1e2d697..bab83cf2bf 100644 --- a/common/formatter/rules/rule_config.cpp +++ b/common/formatter/rules/rule_config.cpp @@ -288,7 +288,7 @@ const std::unordered_map opengoal_form_config {"#when", new_flow_rule(2)}, {"countdown", new_flow_rule(2)}, {"until", new_flow_rule(2)}, - {"loop", new_flow_rule(2)}, + {"loop", new_flow_rule(0)}, {"while", new_flow_rule(2)}, {"begin", new_flow_rule(0)}, {"seval", new_flow_rule(0)}, diff --git a/goal_src/jak1/compiler-setup.gc b/goal_src/jak1/compiler-setup.gc index d7231aad37..4dbef56e1a 100644 --- a/goal_src/jak1/compiler-setup.gc +++ b/goal_src/jak1/compiler-setup.gc @@ -1,6 +1,4 @@ -#|@file -Compiler Setup for Jak 1 -|# +#|@file Compiler Setup for Jak 1 |# ;; load kernel type definitions. ;; these types/functions are provided by Jak 1's runtime. diff --git a/goal_src/jak1/engine/anim/joint.gc b/goal_src/jak1/engine/anim/joint.gc index c7587ddd5a..25ef0b8690 100644 --- a/goal_src/jak1/engine/anim/joint.gc +++ b/goal_src/jak1/engine/anim/joint.gc @@ -1325,22 +1325,22 @@ (defun make-joint-jump-tables () #| - #x3ee6b6f9, // = 9 ^ 1055307504 - #x3ee6b6ff, // = 15 ^ 1055307504 - #x3ee6b6e2, // = 18 ^ 1055307504 - #x3ee6b6e4, // = 20 ^ 1055307504 - #x3ee6b6e5, // = 21 ^ 1055307504 - #x3ee6b6eb, // = 27 ^ 1055307504 - #x3ee6b6ee, // = 30 ^ 1055307504 - #x3ee6b6f6, // = 6 ^ 1055307504 - #x3ee6b6fc, // = 12 ^ 1055307504 - #x3ee6b6ff, // = 15 ^ 1055307504 - #x3ee6b6e3, // = 19 ^ 1055307504 - #x3ee6b6e4, // = 20 ^ 1055307504 - #x3ee6b6e8, // = 24 ^ 1055307504 - #x3ee6b6eb, // = 27 ^ 1055307504 - #x3ee6b6ef, // = 31 ^ 1055307504 - #x3ee6b6f6, // = 6 ^ 1055307504 + #x3ee6b6f9, // = 9 ^ 1055307504 + #x3ee6b6ff, // = 15 ^ 1055307504 + #x3ee6b6e2, // = 18 ^ 1055307504 + #x3ee6b6e4, // = 20 ^ 1055307504 + #x3ee6b6e5, // = 21 ^ 1055307504 + #x3ee6b6eb, // = 27 ^ 1055307504 + #x3ee6b6ee, // = 30 ^ 1055307504 + #x3ee6b6f6, // = 6 ^ 1055307504 + #x3ee6b6fc, // = 12 ^ 1055307504 + #x3ee6b6ff, // = 15 ^ 1055307504 + #x3ee6b6e3, // = 19 ^ 1055307504 + #x3ee6b6e4, // = 20 ^ 1055307504 + #x3ee6b6e8, // = 24 ^ 1055307504 + #x3ee6b6eb, // = 27 ^ 1055307504 + #x3ee6b6ef, // = 31 ^ 1055307504 + #x3ee6b6f6, // = 6 ^ 1055307504 |# (set! (-> (scratchpad-object terrain-context) work foreground joint-work fix-jmp-table 0) (the-as (function none) (+ 0 #x3ee6b6f9))) diff --git a/goal_src/jak1/engine/camera/cam-combiner.gc b/goal_src/jak1/engine/camera/cam-combiner.gc index 80b530f1bb..8f0fd36287 100644 --- a/goal_src/jak1/engine/camera/cam-combiner.gc +++ b/goal_src/jak1/engine/camera/cam-combiner.gc @@ -101,9 +101,10 @@ :code (behavior () (local-vars (sv-160 cam-rotation-tracker)) - (loop (when (and (not (logtest? (-> *camera* master-options) 2)) (!= (-> self tracking-status) 0)) - (set! (-> self tracking-status) (the-as uint 0)) - 0) + (loop + (when (and (not (logtest? (-> *camera* master-options) 2)) (!= (-> self tracking-status) 0)) + (set! (-> self tracking-status) (the-as uint 0)) + 0) (when *camera* (let ((s5-0 (-> *camera* slave 0)) (s4-0 (-> *camera* slave 1)) diff --git a/goal_src/jak1/engine/camera/cam-layout.gc b/goal_src/jak1/engine/camera/cam-layout.gc index 8279112bbc..5a6868efa4 100644 --- a/goal_src/jak1/engine/camera/cam-layout.gc +++ b/goal_src/jak1/engine/camera/cam-layout.gc @@ -136,7 +136,8 @@ (sv-272 int) (sv-288 int)) (let ((s4-0 0)) - (loop (set! sv-16 (new 'static 'res-tag)) + (loop + (set! sv-16 (new 'static 'res-tag)) (let ((s3-0 (the-as (inline-array vector) ((method-of-type res-lump get-property-data) arg0 @@ -2679,7 +2680,8 @@ (defstate cam-layout-active (cam-layout) :code (behavior () - (loop (cam-layout-entity-info (the-as entity-actor (-> self cam-entity))) + (loop + (cam-layout-entity-info (the-as entity-actor (-> self cam-entity))) (cam-layout-entity-volume-info) (cam-layout-do-menu *clm*) (suspend)))) diff --git a/goal_src/jak1/engine/camera/cam-master.gc b/goal_src/jak1/engine/camera/cam-master.gc index 682ffd54bf..a82ca1f4c7 100644 --- a/goal_src/jak1/engine/camera/cam-master.gc +++ b/goal_src/jak1/engine/camera/cam-master.gc @@ -345,7 +345,8 @@ (defun in-cam-entity-volume? ((arg0 vector) (arg1 entity) (arg2 float) (arg3 symbol)) (local-vars (sv-16 res-tag)) (let ((s2-0 0)) - (loop (set! sv-16 (new 'static 'res-tag)) + (loop + (set! sv-16 (new 'static 'res-tag)) (let ((v1-1 (the-as object ((method-of-type res-lump get-property-data) arg1 @@ -930,10 +931,11 @@ (cam-master-effect))) :code (behavior () - (loop (if (and *dproc* *debug-segment*) - (add-frame (-> *display* frames (-> *display* on-screen) frame profile-bar 0) - 'camera - (new 'static 'rgba :r #x40 :b #x40 :a #x80))) + (loop + (if (and *dproc* *debug-segment*) + (add-frame (-> *display* frames (-> *display* on-screen) frame profile-bar 0) + 'camera + (new 'static 'rgba :r #x40 :b #x40 :a #x80))) (set! (-> self string-min target y) (-> self stringMinHeight)) (set! (-> self string-max target y) (-> self stringMaxHeight)) (set! (-> self string-min target z) (-> self stringMinLength)) @@ -962,7 +964,8 @@ (defstate list-keeper-active (camera-master) :code (behavior () - (loop (change-to-last-brother self) + (loop + (change-to-last-brother self) (suspend)))) (defbehavior list-keeper-init camera-master () diff --git a/goal_src/jak1/engine/camera/cam-states-dbg.gc b/goal_src/jak1/engine/camera/cam-states-dbg.gc index 679a1416e6..ccd0988cbc 100644 --- a/goal_src/jak1/engine/camera/cam-states-dbg.gc +++ b/goal_src/jak1/engine/camera/cam-states-dbg.gc @@ -30,35 +30,36 @@ (set! (-> self blend-to-type) (the-as uint 1)))) :code (behavior () - (loop (let ((s5-0 (new-stack-vector0)) - (gp-0 (new-stack-vector0))) - (when *camera-read-analog* - (let ((f28-0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0)) - (f30-0 (analog-input (the-as int (-> *cpad-list* cpads 0 lefty)) 128.0 48.0 110.0 -1.0)) - (f26-0 (analog-input (the-as int (-> *cpad-list* cpads 0 rightx)) 128.0 48.0 110.0 -1.0)) - (f0-0 (analog-input (the-as int (-> *cpad-list* cpads 0 righty)) 128.0 48.0 110.0 -1.0))) - (cond - ((cpad-hold? (-> *CAMERA-bank* joypad) r2) - (set! (-> s5-0 y) (- (-> s5-0 y) (* 0.2 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f26-0)))) - (set! (-> s5-0 x) (- (-> s5-0 x) (* 0.2 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f0-0)))) - (+! (-> gp-0 x) (* 0.2 (-> *CAM_POINT_WATCH-bank* speed) f28-0)) - (+! (-> gp-0 z) (* 0.2 (-> *CAM_POINT_WATCH-bank* speed) f30-0))) - (else - (set! (-> s5-0 y) (- (-> s5-0 y) (* 2.0 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f26-0)))) - (set! (-> s5-0 x) (- (-> s5-0 x) (* 2.0 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f0-0)))) - (+! (-> gp-0 x) (* 2.0 (-> *CAM_POINT_WATCH-bank* speed) f28-0)) - (+! (-> gp-0 z) (* 2.0 (-> *CAM_POINT_WATCH-bank* speed) f30-0))))) - (let ((s4-0 (new-stack-vector0))) - (let ((s3-0 (new-stack-matrix0))) - (matrix-axis-angle! s3-0 (the-as vector (-> self tracking)) (- (-> s5-0 x))) - (vector-matrix*! s4-0 (-> self tracking inv-mat vector 2) s3-0) - (matrix-axis-angle! s3-0 (-> *camera* local-down) (- (-> s5-0 y))) - (vector-matrix*! s4-0 s4-0 s3-0)) - (forward-down->inv-matrix (the-as matrix (-> self tracking)) s4-0 (-> *camera* local-down))) - (set! (-> self pivot-rad) (- (-> self pivot-rad) (-> gp-0 z))) - (if (< (-> self pivot-rad) 4096.0) (set! (-> self pivot-rad) 4096.0)) - (set-vector! gp-0 0.0 0.0 (- (-> self pivot-rad)) 1.0) - (vector-matrix*! (-> self trans) gp-0 (the-as matrix (-> self tracking))))) + (loop + (let ((s5-0 (new-stack-vector0)) + (gp-0 (new-stack-vector0))) + (when *camera-read-analog* + (let ((f28-0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0)) + (f30-0 (analog-input (the-as int (-> *cpad-list* cpads 0 lefty)) 128.0 48.0 110.0 -1.0)) + (f26-0 (analog-input (the-as int (-> *cpad-list* cpads 0 rightx)) 128.0 48.0 110.0 -1.0)) + (f0-0 (analog-input (the-as int (-> *cpad-list* cpads 0 righty)) 128.0 48.0 110.0 -1.0))) + (cond + ((cpad-hold? (-> *CAMERA-bank* joypad) r2) + (set! (-> s5-0 y) (- (-> s5-0 y) (* 0.2 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f26-0)))) + (set! (-> s5-0 x) (- (-> s5-0 x) (* 0.2 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f0-0)))) + (+! (-> gp-0 x) (* 0.2 (-> *CAM_POINT_WATCH-bank* speed) f28-0)) + (+! (-> gp-0 z) (* 0.2 (-> *CAM_POINT_WATCH-bank* speed) f30-0))) + (else + (set! (-> s5-0 y) (- (-> s5-0 y) (* 2.0 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f26-0)))) + (set! (-> s5-0 x) (- (-> s5-0 x) (* 2.0 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f0-0)))) + (+! (-> gp-0 x) (* 2.0 (-> *CAM_POINT_WATCH-bank* speed) f28-0)) + (+! (-> gp-0 z) (* 2.0 (-> *CAM_POINT_WATCH-bank* speed) f30-0))))) + (let ((s4-0 (new-stack-vector0))) + (let ((s3-0 (new-stack-matrix0))) + (matrix-axis-angle! s3-0 (the-as vector (-> self tracking)) (- (-> s5-0 x))) + (vector-matrix*! s4-0 (-> self tracking inv-mat vector 2) s3-0) + (matrix-axis-angle! s3-0 (-> *camera* local-down) (- (-> s5-0 y))) + (vector-matrix*! s4-0 s4-0 s3-0)) + (forward-down->inv-matrix (the-as matrix (-> self tracking)) s4-0 (-> *camera* local-down))) + (set! (-> self pivot-rad) (- (-> self pivot-rad) (-> gp-0 z))) + (if (< (-> self pivot-rad) 4096.0) (set! (-> self pivot-rad) 4096.0)) + (set-vector! gp-0 0.0 0.0 (- (-> self pivot-rad)) 1.0) + (vector-matrix*! (-> self trans) gp-0 (the-as matrix (-> self tracking))))) (suspend) 0))) @@ -232,9 +233,10 @@ (send-event *camera-combiner* 'stop-tracking))) :code (behavior () - (loop (let ((a2-0 (-> *camera* local-down))) - (if (logtest? (-> self options) 8) (set! a2-0 (the-as vector #f))) - (cam-free-floating-move (the-as matrix (-> self tracking)) (-> self trans) a2-0 (the-as int (-> *CAMERA-bank* joypad)))) + (loop + (let ((a2-0 (-> *camera* local-down))) + (if (logtest? (-> self options) 8) (set! a2-0 (the-as vector #f))) + (cam-free-floating-move (the-as matrix (-> self tracking)) (-> self trans) a2-0 (the-as int (-> *CAMERA-bank* joypad)))) (suspend)))) (deftype camera-orbit-info (structure) @@ -281,7 +283,8 @@ ()) :code (behavior () - (loop (if (not *camera-orbit-target*) (cam-slave-go cam-free-floating)) + (loop + (if (not *camera-orbit-target*) (cam-slave-go cam-free-floating)) (when *camera-read-analog* (let ((f0-0 (analog-input (the-as int (-> *cpad-list* cpads 0 righty)) 128.0 32.0 110.0 0.05))) (cond diff --git a/goal_src/jak1/engine/camera/cam-states.gc b/goal_src/jak1/engine/camera/cam-states.gc index 2f2ea53e62..e82fe3afef 100644 --- a/goal_src/jak1/engine/camera/cam-states.gc +++ b/goal_src/jak1/engine/camera/cam-states.gc @@ -31,13 +31,14 @@ 0)) :code (behavior () - (loop (when (not (paused?)) - (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> self trans quad) (-> self saved-pt quad)) - (cam-curve-pos (-> self trans) gp-0 (the-as curve #f) #f) - (when (!= (-> gp-0 w) 0.0) - (vector-normalize! gp-0 (the-as float 1.0)) - (forward-down->inv-matrix (the-as matrix (-> self tracking)) gp-0 (-> *camera* local-down))))) + (loop + (when (not (paused?)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> self trans quad) (-> self saved-pt quad)) + (cam-curve-pos (-> self trans) gp-0 (the-as curve #f) #f) + (when (!= (-> gp-0 w) 0.0) + (vector-normalize! gp-0 (the-as float 1.0)) + (forward-down->inv-matrix (the-as matrix (-> self tracking)) gp-0 (-> *camera* local-down))))) (suspend)))) (defstate cam-fixed-read-entity (camera-slave) @@ -63,7 +64,8 @@ (go cam-fixed)) :code (behavior () - (loop (format *stdcon* "ERROR : stayed in cam-fixed-read-entity~%") + (loop + (format *stdcon* "ERROR : stayed in cam-fixed-read-entity~%") (suspend)))) (defstate cam-pov (camera-slave) @@ -84,20 +86,21 @@ (cam-slave-go cam-fixed))) :code (behavior () - (loop (when (not (paused?)) - (vector<-cspace! (-> self trans) - (-> (the-as pov-camera (-> *camera* pov-handle process 0)) node-list data (-> *camera* pov-bone))) - (let* ((v1-5 (-> self tracking)) - (a3-0 (-> (the-as pov-camera (-> *camera* pov-handle process 0)) node-list data (-> *camera* pov-bone) bone transform)) - (a0-8 (-> a3-0 vector 0 quad)) - (a1-9 (-> a3-0 vector 1 quad)) - (a2-0 (-> a3-0 vector 2 quad)) - (a3-1 (-> a3-0 vector 3 quad))) - (set! (-> v1-5 inv-mat vector 0 quad) a0-8) - (set! (-> v1-5 inv-mat vector 1 quad) a1-9) - (set! (-> v1-5 inv-mat vector 2 quad) a2-0) - (set! (-> v1-5 inv-mat vector 3 quad) a3-1)) - (vector-reset! (-> self tracking inv-mat vector 3))) + (loop + (when (not (paused?)) + (vector<-cspace! (-> self trans) + (-> (the-as pov-camera (-> *camera* pov-handle process 0)) node-list data (-> *camera* pov-bone))) + (let* ((v1-5 (-> self tracking)) + (a3-0 (-> (the-as pov-camera (-> *camera* pov-handle process 0)) node-list data (-> *camera* pov-bone) bone transform)) + (a0-8 (-> a3-0 vector 0 quad)) + (a1-9 (-> a3-0 vector 1 quad)) + (a2-0 (-> a3-0 vector 2 quad)) + (a3-1 (-> a3-0 vector 3 quad))) + (set! (-> v1-5 inv-mat vector 0 quad) a0-8) + (set! (-> v1-5 inv-mat vector 1 quad) a1-9) + (set! (-> v1-5 inv-mat vector 2 quad) a2-0) + (set! (-> v1-5 inv-mat vector 3 quad) a3-1)) + (vector-reset! (-> self tracking inv-mat vector 3))) (suspend)))) (defstate cam-pov180 (camera-slave) @@ -124,28 +127,29 @@ (vector<-cspace! gp-0 (-> (the-as pov-camera (-> *camera* pov-handle process 0)) node-list data (-> *camera* pov-bone))) (let ((v1-11 (-> (the-as pov-camera (-> *camera* pov-handle process 0)) node-list data (-> *camera* pov-bone) bone transform))) (vector-normalize-copy! s5-0 (-> v1-11 vector 2) (the-as float 1.0))) - (loop (when (not (paused?)) - (let ((s0-0 (-> (the-as pov-camera (-> *camera* pov-handle process 0)) node-list data (-> *camera* pov-bone) bone transform)) - (s1-0 (-> (the-as pov-camera (-> *camera* pov-handle process 0)) node-list data (-> *camera* pov-bone) bone scale)) - (s3-0 (new 'stack-no-clear 'vector))) - (let ((s2-0 (new 'stack-no-clear 'vector))) - (vector<-cspace! s2-0 (-> (the-as pov-camera (-> *camera* pov-handle process 0)) node-list data (-> *camera* pov-bone))) - (vector-normalize-copy! s3-0 (-> s0-0 vector 2) (the-as float 1.0)) - (set! s4-0 - (cond - ((and (< (vector-vector-distance s2-0 gp-0) 40960.0) (< (cos (the-as float 3640.889)) (vector-dot s5-0 s3-0))) - (set! (-> self trans quad) (-> s2-0 quad)) - (vector-negate! (the-as vector (-> self tracking)) (the-as vector (-> s0-0 vector))) - (set! (-> self tracking inv-mat vector 1 quad) (-> s0-0 vector 1 quad)) - (vector-negate! (-> self tracking inv-mat vector 2) (-> s0-0 vector 2)) - (set! (-> self fov) (* 2.0 (atan (/ 12.700255 (* 20.3 (-> s1-0 x))) (the-as float 1.0)))) - (vector-float*! (the-as vector (-> self tracking)) (the-as vector (-> self tracking)) (/ 1.0 (-> s1-0 x))) - (vector-reset! (-> self tracking inv-mat vector 3)) - (if s4-0 (set! s4-0 #f)) - s4-0) - (else #t))) - (set! (-> gp-0 quad) (-> s2-0 quad))) - (set! (-> s5-0 quad) (-> s3-0 quad)))) + (loop + (when (not (paused?)) + (let ((s0-0 (-> (the-as pov-camera (-> *camera* pov-handle process 0)) node-list data (-> *camera* pov-bone) bone transform)) + (s1-0 (-> (the-as pov-camera (-> *camera* pov-handle process 0)) node-list data (-> *camera* pov-bone) bone scale)) + (s3-0 (new 'stack-no-clear 'vector))) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (vector<-cspace! s2-0 (-> (the-as pov-camera (-> *camera* pov-handle process 0)) node-list data (-> *camera* pov-bone))) + (vector-normalize-copy! s3-0 (-> s0-0 vector 2) (the-as float 1.0)) + (set! s4-0 + (cond + ((and (< (vector-vector-distance s2-0 gp-0) 40960.0) (< (cos (the-as float 3640.889)) (vector-dot s5-0 s3-0))) + (set! (-> self trans quad) (-> s2-0 quad)) + (vector-negate! (the-as vector (-> self tracking)) (the-as vector (-> s0-0 vector))) + (set! (-> self tracking inv-mat vector 1 quad) (-> s0-0 vector 1 quad)) + (vector-negate! (-> self tracking inv-mat vector 2) (-> s0-0 vector 2)) + (set! (-> self fov) (* 2.0 (atan (/ 12.700255 (* 20.3 (-> s1-0 x))) (the-as float 1.0)))) + (vector-float*! (the-as vector (-> self tracking)) (the-as vector (-> self tracking)) (/ 1.0 (-> s1-0 x))) + (vector-reset! (-> self tracking inv-mat vector 3)) + (if s4-0 (set! s4-0 #f)) + s4-0) + (else #t))) + (set! (-> gp-0 quad) (-> s2-0 quad))) + (set! (-> s5-0 quad) (-> s3-0 quad)))) (suspend))))) (defstate cam-pov-track (camera-slave) @@ -164,9 +168,10 @@ (cam-slave-go cam-free-floating))) :code (behavior () - (loop (if (not (paused?)) - (vector<-cspace! (-> self trans) - (-> (the-as pov-camera (-> *camera* pov-handle process 0)) node-list data (-> *camera* pov-bone)))) + (loop + (if (not (paused?)) + (vector<-cspace! (-> self trans) + (-> (the-as pov-camera (-> *camera* pov-handle process 0)) node-list data (-> *camera* pov-bone)))) (suspend)))) (defbehavior cam-standoff-calc-trans camera-slave () @@ -200,9 +205,10 @@ (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating))) :code (behavior () - (loop (when (not (paused?)) - (cam-calc-follow! (-> self tracking) (-> self trans) #t) - (cam-standoff-calc-trans)) + (loop + (when (not (paused?)) + (cam-calc-follow! (-> self tracking) (-> self trans) #t) + (cam-standoff-calc-trans)) (suspend)))) (defstate cam-standoff-read-entity (camera-slave) @@ -232,7 +238,8 @@ (go cam-standoff)) :code (behavior () - (loop (format *stdcon* "ERROR : stayed in cam-standoff-read-entity~%") + (loop + (format *stdcon* "ERROR : stayed in cam-standoff-read-entity~%") (suspend)))) (deftype cam-eye-bank (basic) @@ -273,73 +280,74 @@ :code (behavior () (let ((gp-0 (current-time))) - (loop (when (not (paused?)) - (let ((s4-0 (vector-reset! (new-stack-vector0))) - (s5-0 (new-stack-matrix0))) - (when *camera-read-analog* - (let ((f30-0 (analog-input-horizontal-first ;; og:preserve-this changed for pc port - (the-as int (+ (-> *cpad-list* cpads 0 rightx) -256 (-> *cpad-list* cpads 0 leftx))) - (the-as float 0.0) - (the-as float 48.0) - (the-as float 110.0) - (the-as float -1.0))) - (f0-0 (analog-input-vertical-first ;; og:preserve-this changed for pc port - (the-as int (+ (-> *cpad-list* cpads 0 righty) -256 (-> *cpad-list* cpads 0 lefty))) - (the-as float 0.0) - (the-as float 48.0) - (the-as float 110.0) - (the-as float -1.0)))) - (set! (-> s4-0 y) (- (-> s4-0 y) (* (- f30-0) (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed))))) ;; og:preserve-this changed for high fps - (set! (-> s4-0 x) (- (-> s4-0 x) (* (- f0-0) (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed))))) ;; og:preserve-this changed for high fps - )) - (cond - ((< (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed)) (-> s4-0 x)) ;; og:preserve-this changed for high fps - (set! (-> s4-0 x) (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed))) ;; og:preserve-this changed for high fps - ) - ((< (-> s4-0 x) (- (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed)))) ;; og:preserve-this changed for high fps - (set! (-> s4-0 x) (- (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed)))) ;; og:preserve-this changed for high fps - )) - (cond - ((< (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed)) (-> s4-0 y)) ;; og:preserve-this changed for high fps - (set! (-> s4-0 y) (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed))) ;; og:preserve-this changed for high fps - ) - ((< (-> s4-0 y) (- (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed)))) ;; og:preserve-this changed for high fps - (set! (-> s4-0 y) (- (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed)))) ;; og:preserve-this changed for high fps - )) - (cond - ((and (= (-> s4-0 x) 0.0) (= (-> s4-0 y) 0.0)) (set! gp-0 (current-time))) - (else (let ((v1-44 (min 10 (max 1 (- (current-time) gp-0))))) (vector-float*! s4-0 s4-0 (* 0.1 (the float v1-44)))))) - (matrix-axis-angle! s5-0 (-> *camera* local-down) (-> s4-0 y)) - (matrix*! (the-as matrix (-> self tracking)) (the-as matrix (-> self tracking)) s5-0) - (when (not (logtest? (-> self options) 8)) - (if (< (vector-dot (-> self tracking inv-mat vector 1) (-> *camera* local-down)) 0.0) - (forward-down->inv-matrix (the-as matrix (-> self tracking)) - (-> self tracking inv-mat vector 2) - (-> *camera* local-down)) - (forward-down->inv-matrix (the-as matrix (-> self tracking)) - (-> self tracking inv-mat vector 2) - (vector-negate! (new-stack-vector0) (-> *camera* local-down))))) - (matrix-axis-angle! s5-0 (the-as vector (-> self tracking)) (- (-> s4-0 x))) - (matrix*! (the-as matrix (-> self tracking)) (the-as matrix (-> self tracking)) s5-0)) - (when (not (logtest? (-> self options) 8)) - (let ((f30-1 (vector-dot (-> *camera* local-down) (-> self tracking inv-mat vector 2)))) - (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) - (when (< (sin (-> *CAM_EYE-bank* max-degrees)) (fabs f30-1)) - (vector--float*! (-> self tracking inv-mat vector 2) (-> self tracking inv-mat vector 2) (-> *camera* local-down) f30-1) - (vector-normalize! (-> self tracking inv-mat vector 2) (cos (-> *CAM_EYE-bank* max-degrees))) - (if (< f30-1 0.0) - (vector--float*! (-> self tracking inv-mat vector 2) - (-> self tracking inv-mat vector 2) - (-> *camera* local-down) - (sin (-> *CAM_EYE-bank* max-degrees))) - (vector+float*! (-> self tracking inv-mat vector 2) - (-> self tracking inv-mat vector 2) - (-> *camera* local-down) - (sin (-> *CAM_EYE-bank* max-degrees)))) - (vector-cross! (-> self tracking inv-mat vector 1) + (loop + (when (not (paused?)) + (let ((s4-0 (vector-reset! (new-stack-vector0))) + (s5-0 (new-stack-matrix0))) + (when *camera-read-analog* + (let ((f30-0 (analog-input-horizontal-first ;; og:preserve-this changed for pc port + (the-as int (+ (-> *cpad-list* cpads 0 rightx) -256 (-> *cpad-list* cpads 0 leftx))) + (the-as float 0.0) + (the-as float 48.0) + (the-as float 110.0) + (the-as float -1.0))) + (f0-0 (analog-input-vertical-first ;; og:preserve-this changed for pc port + (the-as int (+ (-> *cpad-list* cpads 0 righty) -256 (-> *cpad-list* cpads 0 lefty))) + (the-as float 0.0) + (the-as float 48.0) + (the-as float 110.0) + (the-as float -1.0)))) + (set! (-> s4-0 y) (- (-> s4-0 y) (* (- f30-0) (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed))))) ;; og:preserve-this changed for high fps + (set! (-> s4-0 x) (- (-> s4-0 x) (* (- f0-0) (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed))))) ;; og:preserve-this changed for high fps + )) + (cond + ((< (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed)) (-> s4-0 x)) ;; og:preserve-this changed for high fps + (set! (-> s4-0 x) (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed))) ;; og:preserve-this changed for high fps + ) + ((< (-> s4-0 x) (- (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed)))) ;; og:preserve-this changed for high fps + (set! (-> s4-0 x) (- (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed)))) ;; og:preserve-this changed for high fps + )) + (cond + ((< (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed)) (-> s4-0 y)) ;; og:preserve-this changed for high fps + (set! (-> s4-0 y) (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed))) ;; og:preserve-this changed for high fps + ) + ((< (-> s4-0 y) (- (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed)))) ;; og:preserve-this changed for high fps + (set! (-> s4-0 y) (- (* (-> *display* time-adjust-ratio) (-> *CAM_EYE-bank* rot-speed)))) ;; og:preserve-this changed for high fps + )) + (cond + ((and (= (-> s4-0 x) 0.0) (= (-> s4-0 y) 0.0)) (set! gp-0 (current-time))) + (else (let ((v1-44 (min 10 (max 1 (- (current-time) gp-0))))) (vector-float*! s4-0 s4-0 (* 0.1 (the float v1-44)))))) + (matrix-axis-angle! s5-0 (-> *camera* local-down) (-> s4-0 y)) + (matrix*! (the-as matrix (-> self tracking)) (the-as matrix (-> self tracking)) s5-0) + (when (not (logtest? (-> self options) 8)) + (if (< (vector-dot (-> self tracking inv-mat vector 1) (-> *camera* local-down)) 0.0) + (forward-down->inv-matrix (the-as matrix (-> self tracking)) + (-> self tracking inv-mat vector 2) + (-> *camera* local-down)) + (forward-down->inv-matrix (the-as matrix (-> self tracking)) + (-> self tracking inv-mat vector 2) + (vector-negate! (new-stack-vector0) (-> *camera* local-down))))) + (matrix-axis-angle! s5-0 (the-as vector (-> self tracking)) (- (-> s4-0 x))) + (matrix*! (the-as matrix (-> self tracking)) (the-as matrix (-> self tracking)) s5-0)) + (when (not (logtest? (-> self options) 8)) + (let ((f30-1 (vector-dot (-> *camera* local-down) (-> self tracking inv-mat vector 2)))) + (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) + (when (< (sin (-> *CAM_EYE-bank* max-degrees)) (fabs f30-1)) + (vector--float*! (-> self tracking inv-mat vector 2) (-> self tracking inv-mat vector 2) (-> *camera* local-down) f30-1) + (vector-normalize! (-> self tracking inv-mat vector 2) (cos (-> *CAM_EYE-bank* max-degrees))) + (if (< f30-1 0.0) + (vector--float*! (-> self tracking inv-mat vector 2) (-> self tracking inv-mat vector 2) - (the-as vector (-> self tracking))) - (set! (-> self tracking inv-mat vector 1 w) 0.0))))) + (-> *camera* local-down) + (sin (-> *CAM_EYE-bank* max-degrees))) + (vector+float*! (-> self tracking inv-mat vector 2) + (-> self tracking inv-mat vector 2) + (-> *camera* local-down) + (sin (-> *CAM_EYE-bank* max-degrees)))) + (vector-cross! (-> self tracking inv-mat vector 1) + (-> self tracking inv-mat vector 2) + (the-as vector (-> self tracking))) + (set! (-> self tracking inv-mat vector 1 w) 0.0))))) (let ((v1-76 (vector-float*! (new-stack-vector0) (-> *camera* local-down) (+ 1024.0 (-> *camera* target-height))))) (vector-! (-> self trans) (-> *camera* tpos-curr) v1-76)) (suspend))))) @@ -374,51 +382,52 @@ (if (not (logtest? (-> *camera* master-options) 2)) (go cam-free-floating))) :code (behavior () - (loop (when (not (paused?)) - (let ((s5-0 (vector-reset! (new-stack-vector0))) - (s4-0 (vector-reset! (new-stack-vector0))) - (s3-0 (vector-reset! (new-stack-vector0))) - (s2-0 (new-stack-vector0)) - (gp-0 (new-stack-matrix0))) - 0.0 - (when *camera-read-analog* - (let ((f1-0 (analog-input-horizontal-first ;; og:preserve-this changed for pc port - (the-as int (+ (-> *cpad-list* cpads 0 rightx) -256 (-> *cpad-list* cpads 0 leftx))) - (the-as float 0.0) - (the-as float 48.0) - (the-as float 110.0) - (the-as float -1.0)))) - (set! (-> s5-0 y) (- (-> s5-0 y) (* (- f1-0) (* (-> *display* time-adjust-ratio) (-> *CAM_BILLY-bank* rot-speed))))) ;; og:preserve-this changed for high fps - )) - (cond - ((< (* (-> *display* time-adjust-ratio) (-> *CAM_BILLY-bank* rot-speed)) (-> s5-0 y)) ;; og:preserve-this changed for high fps - (set! (-> s5-0 y) (* (-> *display* time-adjust-ratio) (-> *CAM_BILLY-bank* rot-speed))) ;; og:preserve-this changed for high fps - ) - ((< (-> s5-0 y) (- (* (-> *display* time-adjust-ratio) (-> *CAM_BILLY-bank* rot-speed)))) ;; og:preserve-this changed for high fps - (set! (-> s5-0 y) (- (* (-> *display* time-adjust-ratio) (-> *CAM_BILLY-bank* rot-speed)))) ;; og:preserve-this changed for high fps - )) - (set! (-> s3-0 x) (sin (the-as float 37319.11))) - (set! (-> s3-0 z) (cos (the-as float 37319.11))) - (set! (-> s4-0 x) (-> s3-0 z)) - (set! (-> s4-0 z) (- (-> s3-0 x))) - (vector-flatten! s2-0 (-> self tracking inv-mat vector 2) (-> *camera* local-down)) - (vector-normalize! s2-0 (the-as float 1.0)) - (let ((f0-14 (acos (vector-dot (-> self tracking inv-mat vector 2) s3-0)))) - (if (< (vector-dot (-> self tracking inv-mat vector 2) s4-0) 0.0) (set! f0-14 (- f0-14))) - (let ((f0-18 (cond - ((and (< 0.0 f0-14) (< 0.0 (-> s5-0 y))) (fmin (-> s5-0 y) (fmax 0.0 (* 0.5 (- 10922.667 f0-14))))) - ((and (< f0-14 0.0) (< (-> s5-0 y) 0.0)) (fmax (-> s5-0 y) (fmin 0.0 (* 0.5 (- -10922.667 f0-14))))) - (else (-> s5-0 y))))) - (matrix-axis-angle! gp-0 (-> *camera* local-down) f0-18))) - (vector-matrix*! (-> self tracking inv-mat vector 2) (-> self tracking inv-mat vector 2) gp-0)) - (set! (-> self tracking inv-mat vector 2 y) 0.0) - (vector-normalize! (-> self tracking inv-mat vector 2) (cos (-> *CAM_BILLY-bank* tilt-degrees))) - (set! (-> self tracking inv-mat vector 2 y) (sin (-> *CAM_BILLY-bank* tilt-degrees))) - (vector-cross! (the-as vector (-> self tracking)) (-> self tracking inv-mat vector 2) (-> *camera* local-down)) - (vector-normalize! (the-as vector (-> self tracking)) (the-as float 1.0)) - (vector-cross! (-> self tracking inv-mat vector 1) - (-> self tracking inv-mat vector 2) - (the-as vector (-> self tracking)))) + (loop + (when (not (paused?)) + (let ((s5-0 (vector-reset! (new-stack-vector0))) + (s4-0 (vector-reset! (new-stack-vector0))) + (s3-0 (vector-reset! (new-stack-vector0))) + (s2-0 (new-stack-vector0)) + (gp-0 (new-stack-matrix0))) + 0.0 + (when *camera-read-analog* + (let ((f1-0 (analog-input-horizontal-first ;; og:preserve-this changed for pc port + (the-as int (+ (-> *cpad-list* cpads 0 rightx) -256 (-> *cpad-list* cpads 0 leftx))) + (the-as float 0.0) + (the-as float 48.0) + (the-as float 110.0) + (the-as float -1.0)))) + (set! (-> s5-0 y) (- (-> s5-0 y) (* (- f1-0) (* (-> *display* time-adjust-ratio) (-> *CAM_BILLY-bank* rot-speed))))) ;; og:preserve-this changed for high fps + )) + (cond + ((< (* (-> *display* time-adjust-ratio) (-> *CAM_BILLY-bank* rot-speed)) (-> s5-0 y)) ;; og:preserve-this changed for high fps + (set! (-> s5-0 y) (* (-> *display* time-adjust-ratio) (-> *CAM_BILLY-bank* rot-speed))) ;; og:preserve-this changed for high fps + ) + ((< (-> s5-0 y) (- (* (-> *display* time-adjust-ratio) (-> *CAM_BILLY-bank* rot-speed)))) ;; og:preserve-this changed for high fps + (set! (-> s5-0 y) (- (* (-> *display* time-adjust-ratio) (-> *CAM_BILLY-bank* rot-speed)))) ;; og:preserve-this changed for high fps + )) + (set! (-> s3-0 x) (sin (the-as float 37319.11))) + (set! (-> s3-0 z) (cos (the-as float 37319.11))) + (set! (-> s4-0 x) (-> s3-0 z)) + (set! (-> s4-0 z) (- (-> s3-0 x))) + (vector-flatten! s2-0 (-> self tracking inv-mat vector 2) (-> *camera* local-down)) + (vector-normalize! s2-0 (the-as float 1.0)) + (let ((f0-14 (acos (vector-dot (-> self tracking inv-mat vector 2) s3-0)))) + (if (< (vector-dot (-> self tracking inv-mat vector 2) s4-0) 0.0) (set! f0-14 (- f0-14))) + (let ((f0-18 (cond + ((and (< 0.0 f0-14) (< 0.0 (-> s5-0 y))) (fmin (-> s5-0 y) (fmax 0.0 (* 0.5 (- 10922.667 f0-14))))) + ((and (< f0-14 0.0) (< (-> s5-0 y) 0.0)) (fmax (-> s5-0 y) (fmin 0.0 (* 0.5 (- -10922.667 f0-14))))) + (else (-> s5-0 y))))) + (matrix-axis-angle! gp-0 (-> *camera* local-down) f0-18))) + (vector-matrix*! (-> self tracking inv-mat vector 2) (-> self tracking inv-mat vector 2) gp-0)) + (set! (-> self tracking inv-mat vector 2 y) 0.0) + (vector-normalize! (-> self tracking inv-mat vector 2) (cos (-> *CAM_BILLY-bank* tilt-degrees))) + (set! (-> self tracking inv-mat vector 2 y) (sin (-> *CAM_BILLY-bank* tilt-degrees))) + (vector-cross! (the-as vector (-> self tracking)) (-> self tracking inv-mat vector 2) (-> *camera* local-down)) + (vector-normalize! (the-as vector (-> self tracking)) (the-as float 1.0)) + (vector-cross! (-> self tracking inv-mat vector 1) + (-> self tracking inv-mat vector 2) + (the-as vector (-> self tracking)))) (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) (-> *camera* target-height)) (suspend)))) @@ -477,11 +486,12 @@ (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating))) :code (behavior () - (loop (when (not (paused?)) - (cam-calc-follow! (-> self tracking) (-> self trans) #t) - (new 'stack 'curve) - (set! (-> self trans quad) (-> self saved-pt quad)) - (cam-curve-pos (-> self trans) (the-as vector #f) (the-as curve #f) #t)) + (loop + (when (not (paused?)) + (cam-calc-follow! (-> self tracking) (-> self trans) #t) + (new 'stack 'curve) + (set! (-> self trans quad) (-> self saved-pt quad)) + (cam-curve-pos (-> self trans) (the-as vector #f) (the-as curve #f) #t)) (suspend)))) (defstate cam-decel (camera-slave) @@ -495,24 +505,25 @@ (if (not (-> self enter-has-run)) (set! (-> self saved-pt quad) (-> self trans quad)))) :code (behavior () - (loop (when (not (paused?)) - (let ((s5-0 (new-stack-vector0)) - (gp-0 (new-stack-vector0))) - (when (!= (-> *camera* outro-t-step) 0.0) - (curve-get-pos! s5-0 (parameter-ease-sin-clamp (-> *camera* outro-t)) (-> *camera* outro-curve)) - (+! (-> *camera* outro-t) (* (-> *camera* outro-t-step) (-> *display* time-adjust-ratio))) - (curve-get-pos! gp-0 (parameter-ease-sin-clamp (-> *camera* outro-t)) (-> *camera* outro-curve)) - (vector-! gp-0 gp-0 s5-0) - (cond - ((or (and (< (-> *camera* outro-t-step) 0.0) (>= (-> *camera* outro-exit-value) (-> *camera* outro-t))) - (and (< 0.0 (-> *camera* outro-t-step)) (>= (-> *camera* outro-t) (-> *camera* outro-exit-value)))) - (set! (-> *camera* outro-t) (-> *camera* outro-exit-value)) - (set! (-> *camera* outro-t-step) 0.0) - (vector+! (-> self velocity) (-> self velocity) gp-0) - (send-event *camera* 'outro-done)) - (else (vector+! (-> self trans) (-> self trans) gp-0))))) - (vector-float*! (-> self velocity) (-> self velocity) 0.9) - (vector+! (-> self trans) (-> self trans) (-> self velocity))) + (loop + (when (not (paused?)) + (let ((s5-0 (new-stack-vector0)) + (gp-0 (new-stack-vector0))) + (when (!= (-> *camera* outro-t-step) 0.0) + (curve-get-pos! s5-0 (parameter-ease-sin-clamp (-> *camera* outro-t)) (-> *camera* outro-curve)) + (+! (-> *camera* outro-t) (* (-> *camera* outro-t-step) (-> *display* time-adjust-ratio))) + (curve-get-pos! gp-0 (parameter-ease-sin-clamp (-> *camera* outro-t)) (-> *camera* outro-curve)) + (vector-! gp-0 gp-0 s5-0) + (cond + ((or (and (< (-> *camera* outro-t-step) 0.0) (>= (-> *camera* outro-exit-value) (-> *camera* outro-t))) + (and (< 0.0 (-> *camera* outro-t-step)) (>= (-> *camera* outro-t) (-> *camera* outro-exit-value)))) + (set! (-> *camera* outro-t) (-> *camera* outro-exit-value)) + (set! (-> *camera* outro-t-step) 0.0) + (vector+! (-> self velocity) (-> self velocity) gp-0) + (send-event *camera* 'outro-done)) + (else (vector+! (-> self trans) (-> self trans) gp-0))))) + (vector-float*! (-> self velocity) (-> self velocity) 0.9) + (vector+! (-> self trans) (-> self trans) (-> self velocity))) (suspend)))) (defstate cam-endlessfall (camera-slave) @@ -538,17 +549,18 @@ (set! (-> s5-0 y) 0.0) (init! gp-0 s4-0 (the-as float 81.92) (fmax 819.2 (vector-length s5-0)) (the-as float 0.75)) (set! (-> gp-0 vel quad) (-> s5-0 quad))) - (loop (when (not (paused?)) - (set! (-> gp-0 target x) (-> (target-pos 0) x)) - (set! (-> gp-0 target z) (-> (target-pos 0) z)) - (update! gp-0 (the-as vector #f)) - (when (< 819.2 (-> gp-0 max-vel)) - (set! (-> gp-0 max-vel) (* 0.9 (-> gp-0 max-vel))) - (if (< (-> gp-0 max-vel) 819.2) (set! (-> gp-0 max-vel) 819.2))) - (set! f30-0 (* 0.9 f30-0)) - (+! (-> self trans y) f30-0) - (set! (-> self trans x) (-> gp-0 value x)) - (set! (-> self trans z) (-> gp-0 value z))) + (loop + (when (not (paused?)) + (set! (-> gp-0 target x) (-> (target-pos 0) x)) + (set! (-> gp-0 target z) (-> (target-pos 0) z)) + (update! gp-0 (the-as vector #f)) + (when (< 819.2 (-> gp-0 max-vel)) + (set! (-> gp-0 max-vel) (* 0.9 (-> gp-0 max-vel))) + (if (< (-> gp-0 max-vel) 819.2) (set! (-> gp-0 max-vel) 819.2))) + (set! f30-0 (* 0.9 f30-0)) + (+! (-> self trans y) f30-0) + (set! (-> self trans x) (-> gp-0 value x)) + (set! (-> self trans z) (-> gp-0 value z))) (suspend))))) (defbehavior cam-circular-position-into-max-angle camera-slave ((arg0 vector) (arg1 vector) (arg2 float)) @@ -716,7 +728,8 @@ (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating))) :code (behavior () - (loop (if (not (paused?)) (cam-circular-code)) + (loop + (if (not (paused?)) (cam-circular-code)) (suspend)))) (defstate cam-lookat (camera-slave) @@ -731,7 +744,8 @@ (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating))) :code (behavior () - (loop (suspend)))) + (loop + (suspend)))) (deftype cam-string-bank (basic) ((los-coll-rad meters) @@ -750,7 +764,8 @@ (set! (-> s5-0 z) (+ 1024.0 (-> *CAMERA-bank* default-string-min-z)))) (vector--float*! s5-0 s5-0 (-> *camera* local-down) (-> *CAMERA-bank* default-string-min-y)) (set! (-> arg0 quad) (-> s5-0 quad)) - (loop (vector--float*! s4-0 arg0 (-> *camera* local-down) (-> *camera* target-height)) + (loop + (vector--float*! s4-0 arg0 (-> *camera* local-down) (-> *camera* target-height)) (if (< (fill-and-probe-using-line-sphere *collide-cache* (-> *camera* tpos-curr-adj) arg0 @@ -1703,11 +1718,12 @@ (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating))) :code (behavior () - (loop (when (not (paused?)) - (set-string-parms) - (cam-string-code) - (tracking-spline-method-9 (-> self position-spline)) - (set! (-> self have-phony-joystick) #f)) + (loop + (when (not (paused?)) + (set-string-parms) + (cam-string-code) + (tracking-spline-method-9 (-> self position-spline)) + (set! (-> self have-phony-joystick) #f)) (suspend)))) (deftype cam-stick-bank (basic) @@ -1843,7 +1859,8 @@ (vector-matrix*! (-> self view-flat) (-> self view-flat) gp-0))))))) :code (behavior () - (loop (if (not (paused?)) (cam-stick-code)) + (loop + (if (not (paused?)) (cam-stick-code)) (suspend)))) (deftype cam-bike-bank (basic) @@ -1954,7 +1971,8 @@ (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating))) :code (behavior () - (loop (if (not (paused?)) (cam-bike-code)) + (loop + (if (not (paused?)) (cam-bike-code)) (suspend)))) (define *camera-base-mode* cam-string) diff --git a/goal_src/jak1/engine/camera/camera.gc b/goal_src/jak1/engine/camera/camera.gc index 4ac8f6cf5b..db4af2317f 100644 --- a/goal_src/jak1/engine/camera/camera.gc +++ b/goal_src/jak1/engine/camera/camera.gc @@ -375,27 +375,28 @@ (set! (-> arg2 cur-pt) (-> this used-point)) (set! (-> arg2 partial-pt) (-> this partial-point))) 0.0 - (loop (cond - ((= (-> arg2 cur-pt) (-> this end-point)) - (set! (-> arg2 partial-pt) 0.0) - (vector+! arg1 arg1 (the-as vector (-> this point (-> arg2 cur-pt)))) - (return arg1)) - ((begin - (set! f0-4 (+ (-> arg2 partial-pt) (/ arg0 (-> this point (-> arg2 cur-pt) tp-length)))) - (< f0-4 1.0)) - (set! (-> arg2 partial-pt) f0-4) - (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) - (let ((a2-5 (-> this point (-> arg2 cur-pt) next))) - (vector-lerp! (the-as vector s5-0) - (the-as vector (-> this point (-> arg2 cur-pt))) - (the-as vector (-> this point a2-5)) - f0-4)) - (vector+! arg1 arg1 (the-as vector s5-0))) - (return arg1)) - (else - (let ((f0-7 (* (- 1.0 (-> arg2 partial-pt)) (-> this point (-> arg2 cur-pt) tp-length)))) (set! arg0 (- arg0 f0-7))) - (set! (-> arg2 partial-pt) 0.0) - (set! (-> arg2 cur-pt) (-> this point (-> arg2 cur-pt) next))))) + (loop + (cond + ((= (-> arg2 cur-pt) (-> this end-point)) + (set! (-> arg2 partial-pt) 0.0) + (vector+! arg1 arg1 (the-as vector (-> this point (-> arg2 cur-pt)))) + (return arg1)) + ((begin + (set! f0-4 (+ (-> arg2 partial-pt) (/ arg0 (-> this point (-> arg2 cur-pt) tp-length)))) + (< f0-4 1.0)) + (set! (-> arg2 partial-pt) f0-4) + (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) + (let ((a2-5 (-> this point (-> arg2 cur-pt) next))) + (vector-lerp! (the-as vector s5-0) + (the-as vector (-> this point (-> arg2 cur-pt))) + (the-as vector (-> this point a2-5)) + f0-4)) + (vector+! arg1 arg1 (the-as vector s5-0))) + (return arg1)) + (else + (let ((f0-7 (* (- 1.0 (-> arg2 partial-pt)) (-> this point (-> arg2 cur-pt) tp-length)))) (set! arg0 (- arg0 f0-7))) + (set! (-> arg2 partial-pt) 0.0) + (set! (-> arg2 cur-pt) (-> this point (-> arg2 cur-pt) next))))) (the-as vector #f)) (defmethod tracking-spline-method-19 ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) diff --git a/goal_src/jak1/engine/common-obs/babak.gc b/goal_src/jak1/engine/common-obs/babak.gc index 2c217e325b..bb3ebbb007 100644 --- a/goal_src/jak1/engine/common-obs/babak.gc +++ b/goal_src/jak1/engine/common-obs/babak.gc @@ -54,7 +54,8 @@ (ja-channel-push! 1 (seconds 0.2)) (ja :group! (-> self draw art-group data (-> self nav-info run-anim))) (ja :num-func num-func-identity :frame-num 0.0))) - (loop (suspend) + (loop + (suspend) (ja :num! (loop! f30-0)))))) (defstate nav-enemy-stare (babak) @@ -70,17 +71,18 @@ (until (ja-done? 0) (suspend) (ja :num! (seek! (ja-aframe 68.0 0) f30-0)))) - (loop (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) - (ja-no-eval :num! (loop!)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! babak-turn-ja) - (ja :num-func num-func-identity :frame-num 0.0) - (until (nav-enemy-facing-player? 1820.4445) - (ja-blend-eval) - (suspend) - (ja :num! (loop! 0.75))) - (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel))) + (loop + (when (not (nav-enemy-facing-player? 2730.6667)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! babak-turn-ja) + (ja :num-func num-func-identity :frame-num 0.0) + (until (nav-enemy-facing-player? 1820.4445) + (ja-blend-eval) + (suspend) + (ja :num! (loop! 0.75))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel))) (if (not (ja-group? babak-idle-ja)) (ja-channel-push! 1 (seconds 0.2))) (ja-no-eval :group! babak-idle-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) diff --git a/goal_src/jak1/engine/common-obs/baseplat.gc b/goal_src/jak1/engine/common-obs/baseplat.gc index d1a2e76e76..27dd95b215 100644 --- a/goal_src/jak1/engine/common-obs/baseplat.gc +++ b/goal_src/jak1/engine/common-obs/baseplat.gc @@ -80,10 +80,11 @@ (suspend) (transform-post) (suspend) - (loop (when (not (-> self bouncing)) - (logior! (-> self mask) (process-mask sleep)) - (suspend) - 0) + (loop + (when (not (-> self bouncing)) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0) (while (-> self bouncing) (suspend))) (none)) @@ -159,14 +160,15 @@ eco-door-event-handler (suspend) (update-transforms! (-> self root)) (ja-post) - (loop (when (and *target* (>= (-> self open-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (eco-door-method-26 self) - (if (and (not (-> self locked)) - (or (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) - (send-event *target* 'query 'powerup (pickup-type eco-blue)) - (and (-> self one-way) (< (vector4-dot (-> self out-dir) (target-pos 0)) -8192.0)))) - (go-virtual door-opening)) - (level-hint-spawn (text-id zero) (the-as string #f) (-> self entity) *entity-pool* (game-task none))) + (loop + (when (and *target* (>= (-> self open-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (eco-door-method-26 self) + (if (and (not (-> self locked)) + (or (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) + (send-event *target* 'query 'powerup (pickup-type eco-blue)) + (and (-> self one-way) (< (vector4-dot (-> self out-dir) (target-pos 0)) -8192.0)))) + (go-virtual door-opening)) + (level-hint-spawn (text-id zero) (the-as string #f) (-> self entity) *entity-pool* (game-task none))) (suspend)))) (defstate door-opening (eco-door) @@ -199,12 +201,13 @@ eco-door-event-handler (suspend) (update-transforms! (-> self root)) (ja-post) - (loop (let ((f30-0 (vector4-dot (-> self out-dir) (target-pos 0))) - (f28-0 (vector4-dot (-> self out-dir) (camera-pos)))) - (when (and (-> self auto-close) - (or (not *target*) - (< (-> self close-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))))) - (if (and (>= (* f30-0 f28-0) 0.0) (< 16384.0 (fabs f28-0))) (go-virtual door-closing)))) + (loop + (let ((f30-0 (vector4-dot (-> self out-dir) (target-pos 0))) + (f28-0 (vector4-dot (-> self out-dir) (camera-pos)))) + (when (and (-> self auto-close) + (or (not *target*) + (< (-> self close-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))))) + (if (and (>= (* f30-0 f28-0) 0.0) (< 16384.0 (fabs f28-0))) (go-virtual door-closing)))) (suspend)))) (defstate door-closing (eco-door) diff --git a/goal_src/jak1/engine/common-obs/collectables.gc b/goal_src/jak1/engine/common-obs/collectables.gc index 7843cd3bb3..fc04119477 100644 --- a/goal_src/jak1/engine/common-obs/collectables.gc +++ b/goal_src/jak1/engine/common-obs/collectables.gc @@ -383,19 +383,20 @@ (update-transforms! (-> self root))) :code (behavior () - (loop (let ((gp-0 (-> self part)) - (s5-0 (-> self root root-prim prim-core))) - (when (and (logtest? (-> self flags) (collectable-flags fade)) (time-elapsed? (-> self birth-time) (-> self fadeout-timeout))) - (let ((v1-10 (- (seconds 1) (- (- (current-time) (-> self birth-time)) (-> self fadeout-timeout))))) - (cond - ((< v1-10 0) (process-entity-status! self (entity-perm-status dead) #t) (deactivate self)) - (else - (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self actor-pause) #f) - (logior! (-> self flags) (collectable-flags fading)) - (logior! (-> self state-flags) (state-flags fade-out-particles)) - (set! (-> gp-0 fade) (* 0.0033333334 (the float v1-10))))))) - (spawn gp-0 (the-as vector s5-0))) + (loop + (let ((gp-0 (-> self part)) + (s5-0 (-> self root root-prim prim-core))) + (when (and (logtest? (-> self flags) (collectable-flags fade)) (time-elapsed? (-> self birth-time) (-> self fadeout-timeout))) + (let ((v1-10 (- (seconds 1) (- (- (current-time) (-> self birth-time)) (-> self fadeout-timeout))))) + (cond + ((< v1-10 0) (process-entity-status! self (entity-perm-status dead) #t) (deactivate self)) + (else + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self actor-pause) #f) + (logior! (-> self flags) (collectable-flags fading)) + (logior! (-> self state-flags) (state-flags fade-out-particles)) + (set! (-> gp-0 fade) (* 0.0033333334 (the float v1-10))))))) + (spawn gp-0 (the-as vector s5-0))) (if (nonzero? (-> self sound)) (update! (-> self sound))) (suspend)))) @@ -432,7 +433,8 @@ (go-virtual wait)))) :code (behavior ((arg0 handle)) - (loop (set! (-> self root trans quad) (-> self base quad)) + (loop + (set! (-> self root trans quad) (-> self base quad)) (add-blue-motion #t #f #t #f) (update-transforms! (-> self root)) (if (nonzero? (-> self draw)) (ja-post)) @@ -685,7 +687,8 @@ :virtual #t :code (behavior () - (loop (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 40049.777 (seconds-per-frame))) + (loop + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 40049.777 (seconds-per-frame))) (let ((f30-0 (-> self bob-amount))) (when (< 0.0 f30-0) (set! (-> self root trans y) @@ -703,7 +706,8 @@ :virtual #t :code (behavior ((arg0 handle)) - (loop (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 91022.22 (seconds-per-frame))) + (loop + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 91022.22 (seconds-per-frame))) (set! (-> self root trans quad) (-> self base quad)) (add-blue-motion #t #t #t #f) (let ((f30-0 (-> self bob-amount))) @@ -912,17 +916,18 @@ 0.5 (let ((f28-0 0.0)) (ja :group! fuel-cell-idle-ja) - (loop (let ((f30-0 (vector-vector-distance (-> self base) (target-pos 0)))) - (set! f28-0 - (if (and (< f30-0 (-> *FACT-bank* suck-suck-dist)) (not (logtest? (-> self flags) (collectable-flags anim)))) - (seek f28-0 (the-as float 16384.0) (* 3072.0 (seconds-per-frame))) - (seek f28-0 (the-as float 0.0) (* 3072.0 (seconds-per-frame))))) - (set! (-> self root trans y) (+ (-> self base y) (* 2867.2 (sin f28-0)))) - (let ((f30-1 (lerp-scale (the-as float 0.6) (the-as float 0.5) f30-0 (the-as float 8192.0) (-> *FACT-bank* suck-suck-dist)))) - (transform-post) - (fuel-cell-animate) - (suspend) - (ja :num! (loop! f30-1)))))))) + (loop + (let ((f30-0 (vector-vector-distance (-> self base) (target-pos 0)))) + (set! f28-0 + (if (and (< f30-0 (-> *FACT-bank* suck-suck-dist)) (not (logtest? (-> self flags) (collectable-flags anim)))) + (seek f28-0 (the-as float 16384.0) (* 3072.0 (seconds-per-frame))) + (seek f28-0 (the-as float 0.0) (* 3072.0 (seconds-per-frame))))) + (set! (-> self root trans y) (+ (-> self base y) (* 2867.2 (sin f28-0)))) + (let ((f30-1 (lerp-scale (the-as float 0.6) (the-as float 0.5) f30-0 (the-as float 8192.0) (-> *FACT-bank* suck-suck-dist)))) + (transform-post) + (fuel-cell-animate) + (suspend) + (ja :num! (loop! f30-1)))))))) (defstate pickup (fuel-cell) :virtual #t @@ -1241,7 +1246,8 @@ (behavior () (case (get-reminder (get-task-control (the-as game-task (logand (the int (-> self fact pickup-amount)) #xffff))) 0) ((127) (go-virtual pickup #t (the-as handle #f)))) - (loop (transform-post) + (loop + (transform-post) (animate self) (suspend)))) @@ -1578,8 +1584,9 @@ (transform-post) (suspend) (transform-post) - (loop (if (not ((-> self block-func) (the-as vent (ppointer->process (-> self parent))))) - (set-vector! (-> self offset-target) 0.0 0.0 0.0 1.0)) + (loop + (if (not ((-> self block-func) (the-as vent (ppointer->process (-> self parent))))) + (set-vector! (-> self offset-target) 0.0 0.0 0.0 1.0)) (when (!= (-> self offset-target y) (-> self offset y)) (vector-seek! (-> self offset) (-> self offset-target) (* 4096.0 (seconds-per-frame))) (move-to-point! (-> self root) @@ -1718,11 +1725,12 @@ (vent-standard-event-handler proc argc message block)) :code (behavior () - (loop (let ((a0-0 (-> self part)) - (a1-0 (-> self root trans)) - (gp-0 (-> self sound))) - (if (and (nonzero? a0-0) (-> self show-particles)) (spawn a0-0 a1-0)) - (if (nonzero? gp-0) (update! gp-0))) + (loop + (let ((a0-0 (-> self part)) + (a1-0 (-> self root trans)) + (gp-0 (-> self sound))) + (if (and (nonzero? a0-0) (-> self show-particles)) (spawn a0-0 a1-0)) + (if (nonzero? gp-0) (update! gp-0))) (suspend)))) (defstate vent-blocked (vent) @@ -1732,7 +1740,8 @@ (('show) (go vent-wait-for-touch)))) :code (behavior () - (loop (if (not ((-> self block-func) self)) (go vent-wait-for-touch)) + (loop + (if (not ((-> self block-func) self)) (go vent-wait-for-touch)) (suspend)))) (defstate vent-pickup (vent) diff --git a/goal_src/jak1/engine/common-obs/crates.gc b/goal_src/jak1/engine/common-obs/crates.gc index 1eb1927124..126ec5b7f1 100644 --- a/goal_src/jak1/engine/common-obs/crates.gc +++ b/goal_src/jak1/engine/common-obs/crates.gc @@ -546,7 +546,8 @@ (suspend) (update-transforms! (-> self root)) (logior! (-> self mask) (process-mask sleep)) - (loop (suspend))) + (loop + (suspend))) :post ja-post) (defstate bounce-on (crate) @@ -572,34 +573,35 @@ :code (behavior ((arg0 handle)) (set! (-> self target) arg0) - (loop (let* ((gp-0 (handle->process (-> self target))) - (v1-4 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) gp-0))) - (when v1-4 - (let* ((gp-1 (-> (the-as process-drawable v1-4) root)) - (v1-6 (if (and (nonzero? gp-1) (type-type? (-> gp-1 type) collide-shape)) gp-1))) - (when v1-6 - (let* ((gp-2 (-> self root root-prim prim-core)) - (a1-3 (-> (the-as collide-shape v1-6) root-prim prim-core)) - (f30-0 (vector-vector-distance (the-as vector gp-2) (the-as vector a1-3)))) - (when (and (< f30-0 (-> *FACT-bank* suck-suck-dist)) (!= (-> self defense) 'steel)) - (logior! (-> self fact options) (fact-options can-collect)) - (go-virtual die #f 0)) - (when (rand-vu-percent? 0.5) - (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> gp-2 world-sphere quad)) - (dotimes (gp-3 3) - (+! (-> s5-0 data gp-3) (rand-vu-float-range -5324.8 5324.8))) - (eco-blue-glow s5-0))) - (activate! (-> self smush) - (lerp-scale (rand-vu-float-range 0.1 0.3) - (rand-vu-float-range 0.0 0.02) - f30-0 - (-> *FACT-bank* suck-suck-dist) - (-> *FACT-bank* suck-bounce-dist)) - 60 - 60 - 1.0 - 1.0)))))) + (loop + (let* ((gp-0 (handle->process (-> self target))) + (v1-4 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) gp-0))) + (when v1-4 + (let* ((gp-1 (-> (the-as process-drawable v1-4) root)) + (v1-6 (if (and (nonzero? gp-1) (type-type? (-> gp-1 type) collide-shape)) gp-1))) + (when v1-6 + (let* ((gp-2 (-> self root root-prim prim-core)) + (a1-3 (-> (the-as collide-shape v1-6) root-prim prim-core)) + (f30-0 (vector-vector-distance (the-as vector gp-2) (the-as vector a1-3)))) + (when (and (< f30-0 (-> *FACT-bank* suck-suck-dist)) (!= (-> self defense) 'steel)) + (logior! (-> self fact options) (fact-options can-collect)) + (go-virtual die #f 0)) + (when (rand-vu-percent? 0.5) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> gp-2 world-sphere quad)) + (dotimes (gp-3 3) + (+! (-> s5-0 data gp-3) (rand-vu-float-range -5324.8 5324.8))) + (eco-blue-glow s5-0))) + (activate! (-> self smush) + (lerp-scale (rand-vu-float-range 0.1 0.3) + (rand-vu-float-range 0.0 0.02) + f30-0 + (-> *FACT-bank* suck-suck-dist) + (-> *FACT-bank* suck-bounce-dist)) + 60 + 60 + 1.0 + 1.0)))))) (suspend))) :post crate-post) @@ -940,7 +942,8 @@ (set-time! (-> self state-time)) (suspend) (update-transforms! (-> self root)) - (loop (set-time! (-> self state-time)) + (loop + (set-time! (-> self state-time)) (ja-post) (logior! (-> self mask) (process-mask sleep-code)) (suspend) @@ -988,6 +991,7 @@ :virtual #t :code (behavior () - (loop (if (or (not (-> self blocker)) (logtest? (-> self blocker extra perm status) (entity-perm-status complete))) - (go-virtual die #t 0)) + (loop + (if (or (not (-> self blocker)) (logtest? (-> self blocker extra perm status) (entity-perm-status complete))) + (go-virtual die #t 0)) (suspend)))) diff --git a/goal_src/jak1/engine/common-obs/generic-obs.gc b/goal_src/jak1/engine/common-obs/generic-obs.gc index c3d2b64f57..8164221551 100644 --- a/goal_src/jak1/engine/common-obs/generic-obs.gc +++ b/goal_src/jak1/engine/common-obs/generic-obs.gc @@ -85,11 +85,12 @@ (defstate swingpole-stance (swingpole) :code (behavior () - (loop (when (and *target* - (< (vector-vector-distance (-> self root trans) (-> *target* control unknown-vector90)) (-> self range)) - (logtest? (-> *target* control root-prim prim-core action) (collide-action edgegrab-possible)) - (< (-> *target* control unknown-vector90 y) (+ (-> self root trans y) (* 0.5 (-> self range))))) - (if (send-event *target* 'pole-grab self) (go swingpole-active))) + (loop + (when (and *target* + (< (vector-vector-distance (-> self root trans) (-> *target* control unknown-vector90)) (-> self range)) + (logtest? (-> *target* control root-prim prim-core action) (collide-action edgegrab-possible)) + (< (-> *target* control unknown-vector90 y) (+ (-> self root trans y) (* 0.5 (-> self range))))) + (if (send-event *target* 'pole-grab self) (go swingpole-active))) (suspend)))) (defstate swingpole-active (swingpole) @@ -255,7 +256,8 @@ :code (behavior () (logclear! (-> self mask) (process-mask heap-shrunk)) - (loop ((-> self cur-post-hook)) + (loop + ((-> self cur-post-hook)) (if (!= (-> self anim-mode) 'clone-anim) (ja-post)) (suspend) (case (-> self anim-mode) @@ -697,19 +699,20 @@ (vf16 :class vf) (vf17 :class vf)) (init-vf0-vector) - (loop (let ((a0-1 (level-get *level* (-> self level))) - (v1-3 (-> *game-info* current-continue level))) - (cond - ((and a0-1 (or (= (-> a0-1 display?) 'special) (= (-> a0-1 display?) 'special-vis))) - (logclear! (-> self draw status) (draw-status hidden)) - (if (nonzero? (-> self skel)) (ja :num! (loop!)))) - ((or (and a0-1 (= (-> a0-1 status) 'active)) (= v1-3 'firecanyon)) (logior! (-> self draw status) (draw-status hidden))) - ((and (= (-> self level) 'firecanyon) (< (-> (camera-pos) y) 327680.0)) - (logior! (-> self draw status) (draw-status hidden))) - (else - (logclear! (-> self draw status) (draw-status hidden)) - (if (nonzero? (-> self part)) (spawn (-> self part) (-> self root trans))) - (if (nonzero? (-> self skel)) (ja :num! (loop!)))))) + (loop + (let ((a0-1 (level-get *level* (-> self level))) + (v1-3 (-> *game-info* current-continue level))) + (cond + ((and a0-1 (or (= (-> a0-1 display?) 'special) (= (-> a0-1 display?) 'special-vis))) + (logclear! (-> self draw status) (draw-status hidden)) + (if (nonzero? (-> self skel)) (ja :num! (loop!)))) + ((or (and a0-1 (= (-> a0-1 status) 'active)) (= v1-3 'firecanyon)) (logior! (-> self draw status) (draw-status hidden))) + ((and (= (-> self level) 'firecanyon) (< (-> (camera-pos) y) 327680.0)) + (logior! (-> self draw status) (draw-status hidden))) + (else + (logclear! (-> self draw status) (draw-status hidden)) + (if (nonzero? (-> self part)) (spawn (-> self part) (-> self root trans))) + (if (nonzero? (-> self skel)) (ja :num! (loop!)))))) (when (not (logtest? (-> self draw status) (draw-status hidden))) (let ((v1-36 (-> self draw)) (a0-18 (new 'stack-no-clear 'vector))) @@ -777,9 +780,10 @@ v0-1)))) :code (behavior () - (loop (when (-> self enable) - (spawn (-> self part) (-> self root trans)) - (if (nonzero? (-> self sound)) (update! (-> self sound)))) + (loop + (when (-> self enable) + (spawn (-> self part) (-> self root trans)) + (if (nonzero? (-> self sound)) (update! (-> self sound)))) (suspend)))) (defmethod init-from-entity! ((this part-spawner) (arg0 entity-actor)) @@ -1100,11 +1104,12 @@ :code (behavior () (let ((gp-0 (current-time))) - (loop (when (not (paused?)) - (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) - (send-event *camera* 'teleport) - (if (and (-> *camera* on-ground) (time-elapsed? gp-0 (seconds 1))) - (send-event *camera* 'change-state *camera-base-mode* (seconds 0.5)))) + (loop + (when (not (paused?)) + (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) + (send-event *camera* 'teleport) + (if (and (-> *camera* on-ground) (time-elapsed? gp-0 (seconds 1))) + (send-event *camera* 'change-state *camera-base-mode* (seconds 0.5)))) (suspend))))) ;; og:preserve-this @@ -1146,32 +1151,33 @@ :code (behavior () (let ((gp-0 (current-time))) - (loop (when (not (paused?)) - (let ((s4-0 (new 'stack-no-clear 'vector)) - (s5-0 (new 'stack-no-clear 'vector))) - 0.0 - 0.0 - 0.0 - (send-event *camera* 'teleport) - (let* ((f0-4 (vector-dot (-> self velocity) (-> *camera* local-down))) - (f30-0 (* 0.975 f0-4))) - (vector--float*! s4-0 (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) - (vector-! s4-0 s4-0 (-> self trans)) - (let ((f28-0 (vector-dot s4-0 (-> *camera* local-down)))) - (vector--float*! s5-0 s4-0 (-> *camera* local-down) f28-0) - (cond - ((< f28-0 f30-0) (set! f30-0 f28-0)) - ((< 20480.0 f28-0) - (let ((f28-1 (+ -20480.0 f28-0))) - (let ((f0-8 (lerp f30-0 f28-1 0.005))) (if (< f30-0 f0-8) (set! f30-0 f0-8))) - (if (< (* 0.09 f28-1) f30-0) (set! f30-0 (* 0.09 f28-1))))))) - (vector+float*! (-> self velocity) s5-0 (-> *camera* local-down) f30-0))) - (vector+! (-> self trans) (-> self trans) (-> self velocity)) - (set! (-> self trans x) (-> *camera* tpos-curr x)) - (set! (-> self trans z) (-> *camera* tpos-curr z)) - (vector+! (-> self trans) (-> self trans) (-> self view-flat)) - (if (and (-> *camera* on-ground) (time-elapsed? gp-0 (seconds 1))) - (send-event *camera* 'change-state *camera-base-mode* (seconds 0.5)))) + (loop + (when (not (paused?)) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector))) + 0.0 + 0.0 + 0.0 + (send-event *camera* 'teleport) + (let* ((f0-4 (vector-dot (-> self velocity) (-> *camera* local-down))) + (f30-0 (* 0.975 f0-4))) + (vector--float*! s4-0 (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) + (vector-! s4-0 s4-0 (-> self trans)) + (let ((f28-0 (vector-dot s4-0 (-> *camera* local-down)))) + (vector--float*! s5-0 s4-0 (-> *camera* local-down) f28-0) + (cond + ((< f28-0 f30-0) (set! f30-0 f28-0)) + ((< 20480.0 f28-0) + (let ((f28-1 (+ -20480.0 f28-0))) + (let ((f0-8 (lerp f30-0 f28-1 0.005))) (if (< f30-0 f0-8) (set! f30-0 f0-8))) + (if (< (* 0.09 f28-1) f30-0) (set! f30-0 (* 0.09 f28-1))))))) + (vector+float*! (-> self velocity) s5-0 (-> *camera* local-down) f30-0))) + (vector+! (-> self trans) (-> self trans) (-> self velocity)) + (set! (-> self trans x) (-> *camera* tpos-curr x)) + (set! (-> self trans z) (-> *camera* tpos-curr z)) + (vector+! (-> self trans) (-> self trans) (-> self view-flat)) + (if (and (-> *camera* on-ground) (time-elapsed? gp-0 (seconds 1))) + (send-event *camera* 'change-state *camera-base-mode* (seconds 0.5)))) (vector-reset! (-> self tracking follow-off)) (vector+! (-> self tracking follow-pt) (-> *camera* tpos-curr-adj) (-> self tracking follow-off)) (vector--float*! (-> self tracking follow-pt) diff --git a/goal_src/jak1/engine/common-obs/nav-enemy.gc b/goal_src/jak1/engine/common-obs/nav-enemy.gc index c56e44882e..5e14cad1d7 100644 --- a/goal_src/jak1/engine/common-obs/nav-enemy.gc +++ b/goal_src/jak1/engine/common-obs/nav-enemy.gc @@ -549,7 +549,8 @@ nav-enemy-default-event-handler :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) - (loop (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) :num! (seek! max f30-0) :frame-num 0.0) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max f30-0))) @@ -630,7 +631,8 @@ nav-enemy-default-event-handler (suspend) (ja :num! (seek! max f30-0))) (ja-channel-push! 1 (seconds 0.2)) - (loop (ja-no-eval :group! (-> self draw art-group data (-> self nav-info idle-anim)) :num! (seek! max f30-0) :frame-num 0.0) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info idle-anim)) :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max f30-0)))))) diff --git a/goal_src/jak1/engine/common-obs/orb-cache.gc b/goal_src/jak1/engine/common-obs/orb-cache.gc index e5d2d053ed..d6d74eb453 100644 --- a/goal_src/jak1/engine/common-obs/orb-cache.gc +++ b/goal_src/jak1/engine/common-obs/orb-cache.gc @@ -140,7 +140,8 @@ (set! (-> self money-pos-actual s5-1) (-> s4-1 y)) (set! (-> self money-list s5-1) (ppointer->handle (process-spawn money :init money-init-by-other-no-bob s4-1 *null-vector* 5 1.0 (-> self entity) :to self))))) - (loop (calculate-pos self #t) + (loop + (calculate-pos self #t) (while (not (or (not *target*) (< (-> self inactive-distance) (vector-vector-xz-distance (-> self root trans) (-> *target* control trans))))) (pos-logic self #t) diff --git a/goal_src/jak1/engine/common-obs/plat-button.gc b/goal_src/jak1/engine/common-obs/plat-button.gc index ed40861e13..32c17ca102 100644 --- a/goal_src/jak1/engine/common-obs/plat-button.gc +++ b/goal_src/jak1/engine/common-obs/plat-button.gc @@ -67,7 +67,8 @@ (behavior () (let ((gp-0 (can-activate? self))) (if gp-0 (ja-no-eval :num! (seek! 0.0)) (ja-no-eval :num! (seek!))) - (loop (if (should-teleport? self) (go-virtual plat-button-teleport-to-other-end)) + (loop + (if (should-teleport? self) (go-virtual plat-button-teleport-to-other-end)) (let ((s5-0 (can-activate? self))) (when (!= s5-0 gp-0) (set! gp-0 s5-0) @@ -226,8 +227,9 @@ (if (-> self allow-auto-kill) (process-entity-status! self (entity-perm-status bit-3) #f)) (sound-stop (-> self sound-id)) (sound-play "elev-land") - (loop (if (or (not *target*) (< 268435460.0 (vector-vector-xz-distance-squared (-> self root trans) (target-pos 0)))) - (go-virtual plat-button-idle)) + (loop + (if (or (not *target*) (< 268435460.0 (vector-vector-xz-distance-squared (-> self root trans) (target-pos 0)))) + (go-virtual plat-button-idle)) (suspend)))) (defmethod plat-button-method-28 ((this plat-button)) diff --git a/goal_src/jak1/engine/common-obs/plat-eco.gc b/goal_src/jak1/engine/common-obs/plat-eco.gc index e64fed79a3..6707723006 100644 --- a/goal_src/jak1/engine/common-obs/plat-eco.gc +++ b/goal_src/jak1/engine/common-obs/plat-eco.gc @@ -93,32 +93,33 @@ :code (behavior ((arg0 handle)) (set! (-> self target) arg0) - (loop (let* ((gp-0 (handle->process (-> self target))) - (v1-4 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) gp-0))) - (when v1-4 - (let* ((gp-1 (-> (the-as process-drawable v1-4) root)) - (v1-6 (if (and (nonzero? gp-1) (type-type? (-> gp-1 type) collide-shape)) gp-1))) - (when v1-6 - (let* ((s5-0 (-> self root root-prim prim-core)) - (a1-3 (-> (the-as collide-shape v1-6) root-prim prim-core)) - (f30-0 (vector-vector-distance (the-as vector s5-0) (the-as vector a1-3)))) - (when (rand-vu-percent? 0.5) - (let ((gp-2 (new 'stack-no-clear 'vector))) - (set! (-> gp-2 quad) (-> s5-0 world-sphere quad)) - (dotimes (s5-1 3) - (+! (-> gp-2 data s5-1) (rand-vu-float-range -5324.8 5324.8))) - (eco-blue-glow gp-2))) - (set! (-> self bouncing) #t) - (activate! (-> self smush) - (lerp-scale (rand-vu-float-range 1.1 1.3) - (rand-vu-float-range 1.0 1.02) - f30-0 - (-> *FACT-bank* suck-suck-dist) - (-> *FACT-bank* suck-bounce-dist)) - 60 - 60 - 1.0 - 1.0)))))) + (loop + (let* ((gp-0 (handle->process (-> self target))) + (v1-4 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) gp-0))) + (when v1-4 + (let* ((gp-1 (-> (the-as process-drawable v1-4) root)) + (v1-6 (if (and (nonzero? gp-1) (type-type? (-> gp-1 type) collide-shape)) gp-1))) + (when v1-6 + (let* ((s5-0 (-> self root root-prim prim-core)) + (a1-3 (-> (the-as collide-shape v1-6) root-prim prim-core)) + (f30-0 (vector-vector-distance (the-as vector s5-0) (the-as vector a1-3)))) + (when (rand-vu-percent? 0.5) + (let ((gp-2 (new 'stack-no-clear 'vector))) + (set! (-> gp-2 quad) (-> s5-0 world-sphere quad)) + (dotimes (s5-1 3) + (+! (-> gp-2 data s5-1) (rand-vu-float-range -5324.8 5324.8))) + (eco-blue-glow gp-2))) + (set! (-> self bouncing) #t) + (activate! (-> self smush) + (lerp-scale (rand-vu-float-range 1.1 1.3) + (rand-vu-float-range 1.0 1.02) + f30-0 + (-> *FACT-bank* suck-suck-dist) + (-> *FACT-bank* suck-bounce-dist)) + 60 + 60 + 1.0 + 1.0)))))) (suspend))) :post (behavior () diff --git a/goal_src/jak1/engine/common-obs/plat.gc b/goal_src/jak1/engine/common-obs/plat.gc index 1ec890b16d..ecdc9b7c90 100644 --- a/goal_src/jak1/engine/common-obs/plat.gc +++ b/goal_src/jak1/engine/common-obs/plat.gc @@ -145,12 +145,13 @@ (plat-trans) (rider-post) (suspend) - (loop (when (not (-> self bouncing)) - (plat-trans) - (rider-post) - (logior! (-> self mask) (process-mask sleep-code)) - (suspend) - 0) + (loop + (when (not (-> self bouncing)) + (plat-trans) + (rider-post) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0) (while (-> self bouncing) (plat-trans) (rider-post) diff --git a/goal_src/jak1/engine/common-obs/process-drawable.gc b/goal_src/jak1/engine/common-obs/process-drawable.gc index f2cfc465de..f522e41a5f 100644 --- a/goal_src/jak1/engine/common-obs/process-drawable.gc +++ b/goal_src/jak1/engine/common-obs/process-drawable.gc @@ -311,12 +311,13 @@ :code (behavior ((arg0 string)) (logior! (-> self entity extra perm status) (entity-perm-status bit-1)) - (loop (when *display-entity-errors* - (let ((s5-0 add-debug-text-3d) - (s4-0 #t) - (s3-0 68)) - (format (clear *temp-string*) "~2j~s art error for ~s" arg0 (-> self name)) - (s5-0 s4-0 (the-as bucket-id s3-0) *temp-string* (-> self root trans) (font-color red) (the-as vector2h #f)))) + (loop + (when *display-entity-errors* + (let ((s5-0 add-debug-text-3d) + (s4-0 #t) + (s3-0 68)) + (format (clear *temp-string*) "~2j~s art error for ~s" arg0 (-> self name)) + (s5-0 s4-0 (the-as bucket-id s3-0) *temp-string* (-> self root trans) (font-color red) (the-as vector2h #f)))) (suspend)) (none))) @@ -674,7 +675,8 @@ (defbehavior anim-loop process-drawable () (logior! (-> self mask) (process-mask sleep-code)) - (loop (nop!) + (loop + (nop!) (suspend)) (none)) diff --git a/goal_src/jak1/engine/common-obs/process-taskable.gc b/goal_src/jak1/engine/common-obs/process-taskable.gc index d232a87574..c034ad9d02 100644 --- a/goal_src/jak1/engine/common-obs/process-taskable.gc +++ b/goal_src/jak1/engine/common-obs/process-taskable.gc @@ -171,7 +171,8 @@ (when (!= (ja-group) (get-art-elem self)) (ja-channel-push! 1 (seconds 0.2)) (ja :group! (get-art-elem self))) - (loop (suspend) + (loop + (suspend) (ja :num! (loop!)) (if (= (-> self next-state name) 'idle) (process-taskable-method-43 self))) (the-as none 0) @@ -764,36 +765,37 @@ (apply-settings *setting-control*)) :code (behavior () - (loop (let ((s2-0 (-> self hand process 0))) - (when (not s2-0) - (format #t "ERROR: othercam parent invalid~%") - (deactivate self)) - (set! (-> *camera-other-root* quad) (-> (the-as process-taskable s2-0) root trans quad)) - (let ((s4-0 (-> (the-as process-taskable s2-0) node-list data (-> self cam-joint-index) bone transform)) - (s3-0 (-> (the-as process-taskable s2-0) node-list data (-> self cam-joint-index) bone scale)) - (gp-0 (new 'stack-no-clear 'vector)) - (s5-0 (new 'stack-no-clear 'vector)) - (s1-0 (or (!= (-> self spooling?) #t) (logtest? (-> (the-as process-taskable s2-0) skel status) (janim-status spool))))) - (vector<-cspace! s5-0 (-> (the-as process-taskable s2-0) node-list data (-> self cam-joint-index))) - (vector-normalize-copy! gp-0 (-> s4-0 vector 2) -1.0) - (when s1-0 - (when (not (-> self had-valid-frame)) - (set! (-> self had-valid-frame) #t) - (set! (-> self old-pos quad) (-> s5-0 quad)) - (set! (-> self old-mat-z quad) (-> gp-0 quad))) - (when #t - (set! (-> *camera-other-trans* quad) (-> s5-0 quad)) - (vector-normalize-copy! (the-as vector (-> *camera-other-matrix* vector)) (the-as vector (-> s4-0 vector)) -1.0) - (set! (-> *camera-other-matrix* vector 0 w) 0.0) - (vector-normalize-copy! (-> *camera-other-matrix* vector 1) (-> s4-0 vector 1) 1.0) - (set! (-> *camera-other-matrix* vector 1 w) 0.0) - (vector-normalize-copy! (-> *camera-other-matrix* vector 2) (-> s4-0 vector 2) -1.0) - (set! (-> *camera-other-matrix* vector 2 w) 0.0) - (vector-reset! (-> *camera-other-matrix* vector 3)) - (othercam-calc (-> s3-0 x))) - (set! *camera-look-through-other* 2) - (set! (-> self old-pos quad) (-> s5-0 quad)) - (set! (-> self old-mat-z quad) (-> gp-0 quad))))) + (loop + (let ((s2-0 (-> self hand process 0))) + (when (not s2-0) + (format #t "ERROR: othercam parent invalid~%") + (deactivate self)) + (set! (-> *camera-other-root* quad) (-> (the-as process-taskable s2-0) root trans quad)) + (let ((s4-0 (-> (the-as process-taskable s2-0) node-list data (-> self cam-joint-index) bone transform)) + (s3-0 (-> (the-as process-taskable s2-0) node-list data (-> self cam-joint-index) bone scale)) + (gp-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + (s1-0 (or (!= (-> self spooling?) #t) (logtest? (-> (the-as process-taskable s2-0) skel status) (janim-status spool))))) + (vector<-cspace! s5-0 (-> (the-as process-taskable s2-0) node-list data (-> self cam-joint-index))) + (vector-normalize-copy! gp-0 (-> s4-0 vector 2) -1.0) + (when s1-0 + (when (not (-> self had-valid-frame)) + (set! (-> self had-valid-frame) #t) + (set! (-> self old-pos quad) (-> s5-0 quad)) + (set! (-> self old-mat-z quad) (-> gp-0 quad))) + (when #t + (set! (-> *camera-other-trans* quad) (-> s5-0 quad)) + (vector-normalize-copy! (the-as vector (-> *camera-other-matrix* vector)) (the-as vector (-> s4-0 vector)) -1.0) + (set! (-> *camera-other-matrix* vector 0 w) 0.0) + (vector-normalize-copy! (-> *camera-other-matrix* vector 1) (-> s4-0 vector 1) 1.0) + (set! (-> *camera-other-matrix* vector 1 w) 0.0) + (vector-normalize-copy! (-> *camera-other-matrix* vector 2) (-> s4-0 vector 2) -1.0) + (set! (-> *camera-other-matrix* vector 2 w) 0.0) + (vector-reset! (-> *camera-other-matrix* vector 3)) + (othercam-calc (-> s3-0 x))) + (set! *camera-look-through-other* 2) + (set! (-> self old-pos quad) (-> s5-0 quad)) + (set! (-> self old-mat-z quad) (-> gp-0 quad))))) (suspend) (let ((a0-25 (-> self hand process 0))) (when (or (-> self die?) (and (not (-> self survive-anim-end?)) (ja-anim-done? a0-25))) diff --git a/goal_src/jak1/engine/common-obs/rigid-body.gc b/goal_src/jak1/engine/common-obs/rigid-body.gc index a30b4c8faa..ed341266d7 100644 --- a/goal_src/jak1/engine/common-obs/rigid-body.gc +++ b/goal_src/jak1/engine/common-obs/rigid-body.gc @@ -419,7 +419,8 @@ (go-virtual rigid-body-platform-float))) :code (behavior () - (loop (suspend))) + (loop + (suspend))) :post ja-post) (defstate rigid-body-platform-float (rigid-body-platform) @@ -432,7 +433,8 @@ (go-virtual rigid-body-platform-idle))) :code (behavior () - (loop (suspend))) + (loop + (suspend))) :post rigid-body-platform-post) (defmethod rigid-body-platform-method-29 ((this rigid-body-platform) (arg0 rigid-body-platform-constants)) diff --git a/goal_src/jak1/engine/common-obs/ropebridge.gc b/goal_src/jak1/engine/common-obs/ropebridge.gc index f7d350f1f2..686280325b 100644 --- a/goal_src/jak1/engine/common-obs/ropebridge.gc +++ b/goal_src/jak1/engine/common-obs/ropebridge.gc @@ -593,7 +593,8 @@ (set-vel-from-impact self (+ s5-1 1) gp-1 1 f30-0)))))) :code (behavior () - (loop (suspend) + (loop + (suspend) (detect-riders! (-> self root)) (when (-> self do-physics?) (clear-spring-forces self) @@ -621,12 +622,13 @@ ;; WARN: Function (method 20 ropebridge) has a return type of none, but the expression builder found a return statement. (defmethod set-vel-from-impact ((this ropebridge) (arg0 uint) (arg1 vector) (arg2 int) (arg3 float)) - (loop (let ((f0-2 (fabs (- (-> arg1 z) (-> this spring-point (the-as int arg0) local-pos z))))) - (if (< (-> this tuning max-bonk-influence-dist) f0-2) (return #f)) - (let* ((f0-4 (/ (* 8.0 f0-2) (-> this tuning max-bonk-influence-dist))) - (f0-5 (+ 1.0 f0-4)) - (f0-6 (/ 1.0 f0-5))) - (set! (-> this spring-point (the-as int arg0) vel y) (- (-> this spring-point (the-as int arg0) vel y) (* f0-6 arg3))))) + (loop + (let ((f0-2 (fabs (- (-> arg1 z) (-> this spring-point (the-as int arg0) local-pos z))))) + (if (< (-> this tuning max-bonk-influence-dist) f0-2) (return #f)) + (let* ((f0-4 (/ (* 8.0 f0-2) (-> this tuning max-bonk-influence-dist))) + (f0-5 (+ 1.0 f0-4)) + (f0-6 (/ 1.0 f0-5))) + (set! (-> this spring-point (the-as int arg0) vel y) (- (-> this spring-point (the-as int arg0) vel y) (* f0-6 arg3))))) (set! arg0 (+ arg0 arg2)) (if (or (< (the-as int arg0) 0) (>= (the-as int arg0) (-> this tuning num-spring-points))) (return #f))) (none)) @@ -659,12 +661,13 @@ ;; WARN: Function (method 22 ropebridge) has a return type of none, but the expression builder found a return statement. (defmethod set-vel-from-rider ((this ropebridge) (arg0 uint) (arg1 vector) (arg2 int)) - (loop (let ((f0-0 (vector-vector-distance arg1 (the-as vector (-> this spring-point (the-as int arg0)))))) - (if (< (-> this tuning max-influence-dist) f0-0) (return #f)) - (let* ((f0-2 (/ (* 8.0 f0-0) (-> this tuning max-influence-dist))) - (f0-3 (+ 1.0 f0-2)) - (f0-4 (/ 1.0 f0-3))) - (+! (-> this spring-point (the-as int arg0) extra-force y) (* f0-4 (-> this tuning rider-max-gravity))))) + (loop + (let ((f0-0 (vector-vector-distance arg1 (the-as vector (-> this spring-point (the-as int arg0)))))) + (if (< (-> this tuning max-influence-dist) f0-0) (return #f)) + (let* ((f0-2 (/ (* 8.0 f0-0) (-> this tuning max-influence-dist))) + (f0-3 (+ 1.0 f0-2)) + (f0-4 (/ 1.0 f0-3))) + (+! (-> this spring-point (the-as int arg0) extra-force y) (* f0-4 (-> this tuning rider-max-gravity))))) (+! arg0 arg2) (if (or (< (the-as int arg0) 0) (>= (the-as int arg0) (-> this tuning num-spring-points))) (return #f))) (none)) diff --git a/goal_src/jak1/engine/common-obs/sharkey.gc b/goal_src/jak1/engine/common-obs/sharkey.gc index f97a53b363..46a51c577a 100644 --- a/goal_src/jak1/engine/common-obs/sharkey.gc +++ b/goal_src/jak1/engine/common-obs/sharkey.gc @@ -216,11 +216,12 @@ nav-enemy-default-event-handler (behavior () (ja-channel-push! 1 (seconds 0.075)) (set! (-> self nav target-pos quad) (-> self spawn-point quad)) - (loop (ja-no-eval :group! - (-> self draw art-group data (-> self nav-info walk-anim)) - :num! - (seek! max (-> self anim-speed)) - :frame-num 0.0) + (loop + (ja-no-eval :group! + (-> self draw art-group data (-> self nav-info walk-anim)) + :num! + (seek! max (-> self anim-speed)) + :frame-num 0.0) (until (ja-done? 0) (seek! (-> self anim-speed) 1.0 0.05) (cond @@ -346,11 +347,12 @@ nav-enemy-default-event-handler (set-time! (-> self player-water-time)) (ja-channel-push! 1 (seconds 0.17)) (sound-play "bigshark-idle") - (loop (ja-no-eval :group! - (-> self draw art-group data (-> self nav-info run-anim)) - :num! - (seek! max (-> self anim-speed)) - :frame-num 0.0) + (loop + (ja-no-eval :group! + (-> self draw art-group data (-> self nav-info run-anim)) + :num! + (seek! max (-> self anim-speed)) + :frame-num 0.0) (until (ja-done? 0) (seek! (-> self anim-speed) 1.0 (* 3.0 (seconds-per-frame))) (suspend) @@ -370,11 +372,12 @@ nav-enemy-default-event-handler :code (behavior () (ja-channel-push! 1 (seconds 0.17)) - (loop (ja-no-eval :group! - (-> self draw art-group data (-> self nav-info walk-anim)) - :num! - (seek! max (-> self anim-speed)) - :frame-num 0.0) + (loop + (ja-no-eval :group! + (-> self draw art-group data (-> self nav-info walk-anim)) + :num! + (seek! max (-> self anim-speed)) + :frame-num 0.0) (until (ja-done? 0) (seek! (-> self anim-speed) 1.0 0.05) (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (seconds-per-frame))) @@ -393,7 +396,8 @@ nav-enemy-default-event-handler (ja-channel-push! 1 (seconds 0.17)) (ja :group! (-> self draw art-group data (-> self nav-info idle-anim))) (ja :num-func num-func-identity :frame-num 0.0) - (loop (ja :num! (loop! (-> self anim-speed))) + (loop + (ja :num! (loop! (-> self anim-speed))) (seek! (-> self anim-speed) 1.0 0.05) (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (seconds-per-frame))) (suspend)))) diff --git a/goal_src/jak1/engine/common-obs/voicebox.gc b/goal_src/jak1/engine/common-obs/voicebox.gc index 2d58dbed58..5e03c2c8ac 100644 --- a/goal_src/jak1/engine/common-obs/voicebox.gc +++ b/goal_src/jak1/engine/common-obs/voicebox.gc @@ -114,7 +114,8 @@ :trans voicebox-track :code (behavior () - (loop (suspend) + (loop + (suspend) (ja :num! (loop!)))) :post ja-post) diff --git a/goal_src/jak1/engine/common-obs/water-anim.gc b/goal_src/jak1/engine/common-obs/water-anim.gc index 73091baa1f..7dff318845 100644 --- a/goal_src/jak1/engine/common-obs/water-anim.gc +++ b/goal_src/jak1/engine/common-obs/water-anim.gc @@ -545,7 +545,8 @@ (if (and (-> self play-ambient-sound?) (nonzero? (-> self sound))) (update! (-> self sound)))) :code (behavior () - (loop (ja-post) + (loop + (ja-post) (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) diff --git a/goal_src/jak1/engine/debug/anim-tester.gc b/goal_src/jak1/engine/debug/anim-tester.gc index 6ad984e608..7dbf23ca63 100644 --- a/goal_src/jak1/engine/debug/anim-tester.gc +++ b/goal_src/jak1/engine/debug/anim-tester.gc @@ -168,11 +168,12 @@ (let ((v1-88 (-> arg0 the-node))) "is this node the start of the list. #t = start" (when (not (not (-> v1-88 prev))) - (loop (let ((v1-92 (-> arg0 the-node))) - "return the previous node in the list" - (let ((v1-93 (-> v1-92 prev))) - (let ((a0-41 v1-93)) "is this node the start of the list. #t = start" (if (not (-> a0-41 prev)) (goto cfg-61))) - (set! (-> arg0 the-node) v1-93))) + (loop + (let ((v1-92 (-> arg0 the-node))) + "return the previous node in the list" + (let ((v1-93 (-> v1-92 prev))) + (let ((a0-41 v1-93)) "is this node the start of the list. #t = start" (if (not (-> a0-41 prev)) (goto cfg-61))) + (set! (-> arg0 the-node) v1-93))) (+! (-> arg0 the-index) -1) (when ((-> arg0 listfunc) 1 arg0) (set! (-> arg0 top-index) (-> arg0 the-index)) @@ -186,11 +187,12 @@ (let ((v1-107 (-> arg0 the-node))) "is this node the end of the list. #t = end" (when (not (not (-> v1-107 next))) - (loop (let ((v1-111 (-> arg0 the-node))) - "return the next node in the list" - (let ((v1-112 (-> v1-111 next))) - (let ((a0-55 v1-112)) "is this node the end of the list. #t = end" (if (not (-> a0-55 next)) (goto cfg-77))) - (set! (-> arg0 the-node) v1-112))) + (loop + (let ((v1-111 (-> arg0 the-node))) + "return the next node in the list" + (let ((v1-112 (-> v1-111 next))) + (let ((a0-55 v1-112)) "is this node the end of the list. #t = end" (if (not (-> a0-55 next)) (goto cfg-77))) + (set! (-> arg0 the-node) v1-112))) (+! (-> arg0 the-index) 1) (when ((-> arg0 listfunc) 1 arg0) (set! (-> arg0 top-index) (-> arg0 the-index)) @@ -683,7 +685,8 @@ "is the list empty, #t = empty" (when (not (= (-> v1-15 tailpred) v1-15)) (let ((v1-17 (glst-get-node-by-index (-> arg1 list) (-> arg1 highlight-index)))) - (loop "return the previous node in the list" + (loop + "return the previous node in the list" (set! v1-17 (-> (the-as anim-test-obj v1-17) prev)) (let ((a0-23 (the-as anim-test-obj v1-17))) "is this node the start of the list. #t = start" @@ -697,7 +700,8 @@ "is the list empty, #t = empty" (when (not (= (-> v1-21 tailpred) v1-21)) (let ((v1-23 (glst-get-node-by-index (-> arg1 list) (-> arg1 highlight-index)))) - (loop "return the next node in the list" + (loop + "return the next node in the list" (set! v1-23 (-> (the-as anim-test-obj v1-23) next)) (let ((a0-40 (the-as anim-test-obj v1-23))) "is this node the end of the list. #t = end" @@ -787,7 +791,8 @@ "is the list empty, #t = empty" (when (not (= (-> v1-17 tailpred) v1-17)) (let ((v1-19 (glst-get-node-by-index (-> arg1 list) (-> arg1 highlight-index)))) - (loop "return the previous node in the list" + (loop + "return the previous node in the list" (set! v1-19 (-> (the-as anim-test-sequence v1-19) prev)) (let ((a0-24 (the-as anim-test-sequence v1-19))) "is this node the start of the list. #t = start" @@ -801,7 +806,8 @@ "is the list empty, #t = empty" (when (not (= (-> v1-23 tailpred) v1-23)) (let ((v1-25 (glst-get-node-by-index (-> arg1 list) (-> arg1 highlight-index)))) - (loop "return the next node in the list" + (loop + "return the next node in the list" (set! v1-25 (-> (the-as anim-test-sequence v1-25) next)) (let ((a0-42 (the-as anim-test-sequence v1-25))) "is this node the end of the list. #t = end" @@ -1354,7 +1360,8 @@ (let ((s5-0 v0-0) (s4-0 (-> arg0 playing-item))) (when (logtest? (-> v0-0 flags) 5) - (loop (+! s4-0 1) + (loop + (+! s4-0 1) (if (>= s4-0 (glst-num-elements (-> arg0 item-list))) (set! s4-0 0)) (set! v0-0 ((the-as (function glst-list int anim-test-seq-item) glst-get-node-by-index) (-> arg0 item-list) s4-0)) (when (or (= v0-0 s5-0) (not (logtest? (-> v0-0 flags) 5))) @@ -1377,7 +1384,8 @@ :code (behavior () (local-vars (s4-0 glst-node) (s5-1 anim-test-seq-item) (gp-2 anim-test-sequence)) - (loop (logclear! (-> self flags) (anim-tester-flags fanimt0)) + (loop + (logclear! (-> self flags) (anim-tester-flags fanimt0)) (let ((v1-2 (-> self obj-list))) "is the list empty, #t = empty" (cond diff --git a/goal_src/jak1/engine/debug/part-tester.gc b/goal_src/jak1/engine/debug/part-tester.gc index 12dc341d47..42af562a46 100644 --- a/goal_src/jak1/engine/debug/part-tester.gc +++ b/goal_src/jak1/engine/debug/part-tester.gc @@ -39,12 +39,13 @@ (defstate part-tester-idle (part-tester) :code (behavior () - (loop (let ((gp-0 (entity-by-name *part-tester-name*))) - (when gp-0 - (let ((s5-0 (-> gp-0 extra process))) - (if (and s5-0 (type-type? (-> s5-0 type) process-drawable) (nonzero? (-> (the-as process-drawable s5-0) root))) - (set! (-> self root trans quad) (-> (the-as process-drawable s5-0) root trans quad)) - (set! (-> self root trans quad) (-> gp-0 extra trans quad)))))) + (loop + (let ((gp-0 (entity-by-name *part-tester-name*))) + (when gp-0 + (let ((s5-0 (-> gp-0 extra process))) + (if (and s5-0 (type-type? (-> s5-0 type) process-drawable) (nonzero? (-> (the-as process-drawable s5-0) root))) + (set! (-> self root trans quad) (-> (the-as process-drawable s5-0) root trans quad)) + (set! (-> self root trans quad) (-> gp-0 extra trans quad)))))) (add-debug-x #t (bucket-id debug-no-zbuf) (-> self root trans) diff --git a/goal_src/jak1/engine/debug/stats-h.gc b/goal_src/jak1/engine/debug/stats-h.gc index 5dc2287e7b..871632ed43 100644 --- a/goal_src/jak1/engine/debug/stats-h.gc +++ b/goal_src/jak1/engine/debug/stats-h.gc @@ -56,21 +56,21 @@ (when (nonzero? (-> this ctrl)) (set! *pc-perf-stat-counter* (get-cpu-clock))) #| - (let ((v1-0 (-> this ctrl))) - (+! (-> this count) 1) - (b! (zero? v1-0) cfg-2 :delay (nop!)) - (.mtc0 Perf 0) - (.sync.l) - (.sync.p) - (.mtpc pcr0 0) - (.mtpc pcr1 0) - (.sync.l) - (.sync.p) - (.mtc0 Perf v1-0) - ) - (.sync.l) - (.sync.p) - (label cfg-2) + (let ((v1-0 (-> this ctrl))) + (+! (-> this count) 1) + (b! (zero? v1-0) cfg-2 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mtpc pcr0 0) + (.mtpc pcr1 0) + (.sync.l) + (.sync.p) + (.mtc0 Perf v1-0) + ) + (.sync.l) + (.sync.p) + (label cfg-2) |# 0 (none)) @@ -81,16 +81,16 @@ (+! (-> this accum0) (- (get-cpu-clock) *pc-perf-stat-counter*)) (set! (-> this accum1) 0)) #| - (local-vars (v1-1 int) (v1-3 int)) - (b! (zero? (-> this ctrl)) cfg-2 :delay (nop!)) - (.mtc0 Perf 0) - (.sync.l) - (.sync.p) - (.mfpc v1-1 pcr0) - (+! (-> this accum0) v1-1) - (.mfpc v1-3 pcr1) - (+! (-> this accum1) v1-3) - (label cfg-2) + (local-vars (v1-1 int) (v1-3 int)) + (b! (zero? (-> this ctrl)) cfg-2 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mfpc v1-1 pcr0) + (+! (-> this accum0) v1-1) + (.mfpc v1-3 pcr1) + (+! (-> this accum1) v1-3) + (label cfg-2) |# 0 (none)) diff --git a/goal_src/jak1/engine/debug/viewer.gc b/goal_src/jak1/engine/debug/viewer.gc index 3a6f2ec53c..339428bd9a 100644 --- a/goal_src/jak1/engine/debug/viewer.gc +++ b/goal_src/jak1/engine/debug/viewer.gc @@ -29,7 +29,8 @@ (defstate viewer-process (viewer) :code (behavior () - (loop (ja-no-eval :group! (-> self janim) :num! (seek! (the float (+ (-> self janim data 0 length) -1))) :frame-num 0.0) + (loop + (ja-no-eval :group! (-> self janim) :num! (seek! (the float (+ (-> self janim data 0 length) -1))) :frame-num 0.0) (until (ja-done? 0) (compute-alignment! (-> self align)) (align! (-> self align) diff --git a/goal_src/jak1/engine/entity/res.gc b/goal_src/jak1/engine/entity/res.gc index 419b2d2b76..1c2dde055a 100644 --- a/goal_src/jak1/engine/entity/res.gc +++ b/goal_src/jak1/engine/entity/res.gc @@ -10,28 +10,28 @@ ;; dgos: GAME, ENGINE #| -res is a generic storage system for not very large data, used mostly for the game entities. -These res files store collections of data, which can be as values (int8, int16, int32, int64, uint8, uint16, uint32, uint64, float, vector), or any structure (as references), which are tagged and identified with a res-tag. -The data is stored similar to an unboxed inline-array, the type of the data is stored in the res-tag. - -A res-lump stores and is used to access all of the data for a single "resource", a collection of varying data. -This is similar to a C++ map or C# dictionary. The key is a res-tag and the value is the corresponding binary data. - -A res-tag is a tag that contains information about a particular property of this resource, such as type, name, and amount of elements. -For example, information about an array of vectors that make up a path - for a moving platform - or an integer to store its entity ID. - -Keyframes are used to specify when/where the data is relevant. -For example (this is made-up), say you have a camera spline, and you want the FOV to change at three specific points: -when it starts, somewhere in the middle, and at the end. -You would store an array of three FOV values. The key-frame field could then be used to say at which point in the spline -the FOV should be at that value. If the camera is somewhere between those points, the result could then be interpolated. - -Properties are looked up from a res-lump using their name (a symbol). -You can look up the data of the property you want directly using the various get-property methods. -Curves can be quickly filled in using the get-curve-data! method. - - -This is updated from the entity system used in Crash 2, which had most of these features and worked very similarly! + res is a generic storage system for not very large data, used mostly for the game entities. + These res files store collections of data, which can be as values (int8, int16, int32, int64, uint8, uint16, uint32, uint64, float, vector), or any structure (as references), which are tagged and identified with a res-tag. + The data is stored similar to an unboxed inline-array, the type of the data is stored in the res-tag. + + A res-lump stores and is used to access all of the data for a single "resource", a collection of varying data. + This is similar to a C++ map or C# dictionary. The key is a res-tag and the value is the corresponding binary data. + + A res-tag is a tag that contains information about a particular property of this resource, such as type, name, and amount of elements. + For example, information about an array of vectors that make up a path - for a moving platform - or an integer to store its entity ID. + + Keyframes are used to specify when/where the data is relevant. + For example (this is made-up), say you have a camera spline, and you want the FOV to change at three specific points: + when it starts, somewhere in the middle, and at the end. + You would store an array of three FOV values. The key-frame field could then be used to say at which point in the spline + the FOV should be at that value. If the camera is somewhere between those points, the result could then be interpolated. + + Properties are looked up from a res-lump using their name (a symbol). + You can look up the data of the property you want directly using the various get-property methods. + Curves can be quickly filled in using the get-curve-data! method. + + + This is updated from the entity system used in Crash 2, which had most of these features and worked very similarly! |# (defmacro res-ref? (tag) diff --git a/goal_src/jak1/engine/game/game-save.gc b/goal_src/jak1/engine/game/game-save.gc index deef52475a..e7b0ecc538 100644 --- a/goal_src/jak1/engine/game/game-save.gc +++ b/goal_src/jak1/engine/game/game-save.gc @@ -1003,7 +1003,8 @@ (when (!= (-> self result) (mc-status-code ok)) (suspend) (goto cfg-1)) - (loop (set! (-> self result) (the-as mc-status-code (mc-check-result))) + (loop + (set! (-> self result) (the-as mc-status-code (mc-check-result))) (case (-> self result) (((mc-status-code busy))) (((mc-status-code ok)) (goto cfg-11)) @@ -1026,7 +1027,8 @@ (when (!= (-> self result) (mc-status-code ok)) (suspend) (goto cfg-6)) - (loop (set! (-> self result) (the-as mc-status-code (mc-check-result))) + (loop + (set! (-> self result) (the-as mc-status-code (mc-check-result))) (case (-> self result) (((mc-status-code busy))) (((mc-status-code ok)) (goto cfg-16)) @@ -1068,7 +1070,8 @@ (when (!= (-> self result) (mc-status-code ok)) (suspend) (goto cfg-7)) - (loop (set! (-> self result) (the-as mc-status-code (mc-check-result))) + (loop + (set! (-> self result) (the-as mc-status-code (mc-check-result))) (let ((v1-24 (-> self result))) (set! gp-0 (cond @@ -1098,7 +1101,8 @@ (when (!= (-> self result) (mc-status-code ok)) (suspend) (goto cfg-6)) - (loop (set! (-> self result) (the-as mc-status-code (mc-check-result))) + (loop + (set! (-> self result) (the-as mc-status-code (mc-check-result))) (let ((v1-22 (-> self result))) (set! gp-0 (cond diff --git a/goal_src/jak1/engine/gfx/foreground/bones.gc b/goal_src/jak1/engine/gfx/foreground/bones.gc index 6a08847bda..134599732a 100644 --- a/goal_src/jak1/engine/gfx/foreground/bones.gc +++ b/goal_src/jak1/engine/gfx/foreground/bones.gc @@ -201,9 +201,7 @@ (define bones-vu0-block (new 'static 'vu-function - #| - :length 63 :qlength 32 - |# + #| :length 63 :qlength 32 |# )) ;; these changes only matter if transferring in _interleave_ mode. diff --git a/goal_src/jak1/engine/gfx/mood/time-of-day.gc b/goal_src/jak1/engine/gfx/mood/time-of-day.gc index 764a51b242..3ba0c3f2db 100644 --- a/goal_src/jak1/engine/gfx/mood/time-of-day.gc +++ b/goal_src/jak1/engine/gfx/mood/time-of-day.gc @@ -68,7 +68,8 @@ (defstate time-of-day-tick (time-of-day-proc) :code (behavior () - (loop (+! (-> self frame) (the int (* (-> self time-ratio) (-> *display* time-adjust-ratio)))) + (loop + (+! (-> self frame) (the int (* (-> self time-ratio) (-> *display* time-adjust-ratio)))) ;; now update time... (when (>= (-> self frame) 300) ;; 300 ticks/second diff --git a/goal_src/jak1/engine/gfx/ocean/ocean-texture.gc b/goal_src/jak1/engine/gfx/ocean/ocean-texture.gc index 3f189a5e6e..a2986a946b 100644 --- a/goal_src/jak1/engine/gfx/ocean/ocean-texture.gc +++ b/goal_src/jak1/engine/gfx/ocean/ocean-texture.gc @@ -79,9 +79,7 @@ (define ocean-texture-vu1-block (new 'static 'vu-function - #| - :length #x92 :qlength 73 - |# + #| :length #x92 :qlength 73 |# )) (defun ocean-texture-setup-constants ((arg0 ocean-texture-constants)) diff --git a/goal_src/jak1/engine/gfx/shadow/shadow-cpu-h.gc b/goal_src/jak1/engine/gfx/shadow/shadow-cpu-h.gc index 90087bfc25..ca345279e8 100644 --- a/goal_src/jak1/engine/gfx/shadow/shadow-cpu-h.gc +++ b/goal_src/jak1/engine/gfx/shadow/shadow-cpu-h.gc @@ -123,17 +123,16 @@ ;; it seems like the first definition is not used. ;; The OpenGOAL compiler doesn't like this, so this is commented out. #| -;; shadow-cpu-h -; (deftype shadow-edge (structure) ; -; ((ind-0 uint16 :offset-assert 0) ; -; (ind-1 uint16 :offset-assert 2) ; -; (tri-0 uint16 :offset-assert 4) ; -; (tri-1 uint16 :offset-assert 6) ; -; ) ; -; :method-count-assert 9 ; -; :size-assert #x4 ; -; :flag-assert #x900000004 ; -; ) ; +(deftype shadow-edge (structure) + ((ind-0 uint16 :offset-assert 0) + (ind-1 uint16 :offset-assert 2) + (tri-0 uint16 :offset-assert 4) + (tri-1 uint16 :offset-assert 6) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) |# (deftype shadow-tri (structure) diff --git a/goal_src/jak1/engine/gfx/shadow/shadow-cpu.gc b/goal_src/jak1/engine/gfx/shadow/shadow-cpu.gc index b8463e1791..da0122a7e9 100644 --- a/goal_src/jak1/engine/gfx/shadow/shadow-cpu.gc +++ b/goal_src/jak1/engine/gfx/shadow/shadow-cpu.gc @@ -370,9 +370,7 @@ (define shadow-vu0-block (new 'static 'vu-function - #| - :length 88 :qlength 44 - |# + #| :length 88 :qlength 44 |# )) (def-mips2c shadow-xform-verts function) diff --git a/goal_src/jak1/engine/gfx/shrub/shrubbery.gc b/goal_src/jak1/engine/gfx/shrub/shrubbery.gc index ed91b637a1..6cb8916a3c 100644 --- a/goal_src/jak1/engine/gfx/shrub/shrubbery.gc +++ b/goal_src/jak1/engine/gfx/shrub/shrubbery.gc @@ -173,9 +173,7 @@ (define shrub-vu1-block (new 'static 'vu-function - #| - :length #x26a :qlength #x135 - |# + #| :length #x26a :qlength #x135 |# )) (defun shrub-num-tris ((arg0 shrubbery)) diff --git a/goal_src/jak1/engine/gfx/tie/tie.gc b/goal_src/jak1/engine/gfx/tie/tie.gc index 7a7e28a870..79b6fb49fe 100644 --- a/goal_src/jak1/engine/gfx/tie/tie.gc +++ b/goal_src/jak1/engine/gfx/tie/tie.gc @@ -53,10 +53,10 @@ (the-as int (+ (-> drawable-inline-array-instance-tie size) (* (+ (-> this length) -1) 64)))) #| -;; for some reason, this showed up twice. -(defmethod login ((this drawable-tree-instance-tie)) -this -) + ;; for some reason, this showed up twice. + (defmethod login ((this drawable-tree-instance-tie)) + this + ) |# (defmethod login ((this drawable-tree-instance-tie)) diff --git a/goal_src/jak1/engine/level/load-boundary.gc b/goal_src/jak1/engine/level/load-boundary.gc index 476af3b854..b4d8f93e6b 100644 --- a/goal_src/jak1/engine/level/load-boundary.gc +++ b/goal_src/jak1/engine/level/load-boundary.gc @@ -802,57 +802,58 @@ ((= v1-7 (+ s4-0 -1)) (set! (-> s5-0 v1-7 v1) (the-as uint 0)) 0) (else (set! (-> s5-0 v1-7 v1) (the-as uint (+ v1-7 1))))) (set! (-> s5-0 v1-7 v2) (the-as uint 1))) - (loop (let ((a1-11 -1)) - (let ((f0-0 268435460.0)) - (dotimes (v1-10 (the-as int s4-0)) - (when (nonzero? (-> s5-0 v1-10 v2)) - (when (or (< (-> s5-0 v1-10 z) f0-0) (and (= (-> s5-0 v1-10 z) f0-0) (< (-> s5-0 v1-10 x) (-> s5-0 a1-11 x)))) - (set! f0-0 (-> s5-0 v1-10 z)) - (set! a1-11 v1-10))))) - (let* ((v1-14 (-> s5-0 a1-11)) - (a2-0 (-> s5-0 (-> v1-14 v0))) - (a0-36 (-> s5-0 (-> v1-14 v1))) - (f0-2 (- (-> v1-14 x) (-> a2-0 x))) - (f1-5 (- (-> v1-14 z) (-> a2-0 z))) - (f2-3 (- (-> a0-36 x) (-> v1-14 x)))) - (when (< (- (* f0-2 (- (-> a0-36 z) (-> v1-14 z))) (* f2-3 f1-5)) 0.0) - (dotimes (v1-16 (the-as int s4-0)) - (let ((a0-39 (-> s5-0 v1-16 v0))) (set! (-> s5-0 v1-16 v0) (-> s5-0 v1-16 v1)) (set! (-> s5-0 v1-16 v1) a0-39))))) - (let ((s3-0 a1-11) - (a0-40 (-> s5-0 a1-11 v0)) - (v1-23 (-> s5-0 a1-11 v1))) - (let ((a2-6 0)) - (while (>= (-> s5-0 a0-40 z) (-> s5-0 s3-0 z)) - (set! s3-0 (the-as int a0-40)) - (set! a0-40 (-> s5-0 (the-as uint s3-0) v0)) - (+! a2-6 1) - (when (= a2-6 10) - (break!) - 0))) - (while (and (!= s3-0 a1-11) (>= (-> s5-0 s3-0 z) (-> s5-0 a0-40 z))) - (set! s3-0 (the-as int a0-40)) - (set! a0-40 (-> s5-0 (the-as uint s3-0) v0))) - (when (= s3-0 a1-11) - (split-monotone-polygon arg0 a1-11) - (fix-boundary-normals arg0) - (return (the-as object 0))) - (let ((s2-0 a1-11)) - (while (and (>= (-> s5-0 v1-23 z) (-> s5-0 s2-0 z)) (>= (-> s5-0 s3-0 z) (-> s5-0 v1-23 z))) - (set! s2-0 (the-as int v1-23)) - (set! v1-23 (-> s5-0 (the-as uint s2-0) v1))) - (let ((s1-0 (-> s5-0 s3-0 v0)) - (s0-0 (-> s5-0 s2-0 v1))) - (set! (-> s5-0 s3-0 v0) (the-as uint s2-0)) - (set! (-> s5-0 s2-0 v1) (the-as uint s3-0)) - (let ((v1-37 (-> s5-0 s3-0 v1))) - (while (!= v1-37 s2-0) - (set! (-> s5-0 v1-37 v2) (the-as uint 0)) - (set! v1-37 (-> s5-0 v1-37 v1)))) - (split-monotone-polygon arg0 a1-11) - (set! (-> s5-0 s3-0 v0) s1-0) - (set! (-> s5-0 s2-0 v1) s0-0)) - (set! (-> s5-0 s2-0 v0) (the-as uint s3-0)) - (set! (-> s5-0 s3-0 v1) (the-as uint s2-0)))))))) + (loop + (let ((a1-11 -1)) + (let ((f0-0 268435460.0)) + (dotimes (v1-10 (the-as int s4-0)) + (when (nonzero? (-> s5-0 v1-10 v2)) + (when (or (< (-> s5-0 v1-10 z) f0-0) (and (= (-> s5-0 v1-10 z) f0-0) (< (-> s5-0 v1-10 x) (-> s5-0 a1-11 x)))) + (set! f0-0 (-> s5-0 v1-10 z)) + (set! a1-11 v1-10))))) + (let* ((v1-14 (-> s5-0 a1-11)) + (a2-0 (-> s5-0 (-> v1-14 v0))) + (a0-36 (-> s5-0 (-> v1-14 v1))) + (f0-2 (- (-> v1-14 x) (-> a2-0 x))) + (f1-5 (- (-> v1-14 z) (-> a2-0 z))) + (f2-3 (- (-> a0-36 x) (-> v1-14 x)))) + (when (< (- (* f0-2 (- (-> a0-36 z) (-> v1-14 z))) (* f2-3 f1-5)) 0.0) + (dotimes (v1-16 (the-as int s4-0)) + (let ((a0-39 (-> s5-0 v1-16 v0))) (set! (-> s5-0 v1-16 v0) (-> s5-0 v1-16 v1)) (set! (-> s5-0 v1-16 v1) a0-39))))) + (let ((s3-0 a1-11) + (a0-40 (-> s5-0 a1-11 v0)) + (v1-23 (-> s5-0 a1-11 v1))) + (let ((a2-6 0)) + (while (>= (-> s5-0 a0-40 z) (-> s5-0 s3-0 z)) + (set! s3-0 (the-as int a0-40)) + (set! a0-40 (-> s5-0 (the-as uint s3-0) v0)) + (+! a2-6 1) + (when (= a2-6 10) + (break!) + 0))) + (while (and (!= s3-0 a1-11) (>= (-> s5-0 s3-0 z) (-> s5-0 a0-40 z))) + (set! s3-0 (the-as int a0-40)) + (set! a0-40 (-> s5-0 (the-as uint s3-0) v0))) + (when (= s3-0 a1-11) + (split-monotone-polygon arg0 a1-11) + (fix-boundary-normals arg0) + (return (the-as object 0))) + (let ((s2-0 a1-11)) + (while (and (>= (-> s5-0 v1-23 z) (-> s5-0 s2-0 z)) (>= (-> s5-0 s3-0 z) (-> s5-0 v1-23 z))) + (set! s2-0 (the-as int v1-23)) + (set! v1-23 (-> s5-0 (the-as uint s2-0) v1))) + (let ((s1-0 (-> s5-0 s3-0 v0)) + (s0-0 (-> s5-0 s2-0 v1))) + (set! (-> s5-0 s3-0 v0) (the-as uint s2-0)) + (set! (-> s5-0 s2-0 v1) (the-as uint s3-0)) + (let ((v1-37 (-> s5-0 s3-0 v1))) + (while (!= v1-37 s2-0) + (set! (-> s5-0 v1-37 v2) (the-as uint 0)) + (set! v1-37 (-> s5-0 v1-37 v1)))) + (split-monotone-polygon arg0 a1-11) + (set! (-> s5-0 s3-0 v0) s1-0) + (set! (-> s5-0 s2-0 v1) s0-0)) + (set! (-> s5-0 s2-0 v0) (the-as uint s3-0)) + (set! (-> s5-0 s3-0 v1) (the-as uint s2-0)))))))) 0) (defun try-corner ((arg0 object) (arg1 int)) @@ -871,13 +872,14 @@ (defun split-monotone-polygon ((arg0 load-boundary) (arg1 int)) (let ((s5-0 *triangulation-buffer*)) - (loop (when (= (-> s5-0 (-> s5-0 (-> s5-0 arg1 v0) v0) v0) arg1) - (let ((v1-10 (-> arg0 tri-cnt))) - (set! (-> arg0 data v1-10 v0) (the-as uint arg1)) - (set! (-> arg0 data v1-10 v1) (-> s5-0 arg1 v0)) - (set! (-> arg0 data v1-10 v2) (-> s5-0 (-> s5-0 arg1 v0) v0))) - (+! (-> arg0 tri-cnt) 1) - (return 0)) + (loop + (when (= (-> s5-0 (-> s5-0 (-> s5-0 arg1 v0) v0) v0) arg1) + (let ((v1-10 (-> arg0 tri-cnt))) + (set! (-> arg0 data v1-10 v0) (the-as uint arg1)) + (set! (-> arg0 data v1-10 v1) (-> s5-0 arg1 v0)) + (set! (-> arg0 data v1-10 v2) (-> s5-0 (-> s5-0 arg1 v0) v0))) + (+! (-> arg0 tri-cnt) 1) + (return 0)) (let ((s3-0 arg1)) (while (not (try-corner arg0 s3-0)) (set! s3-0 (the-as int (-> s5-0 s3-0 v1))) diff --git a/goal_src/jak1/engine/load/decomp.gc b/goal_src/jak1/engine/load/decomp.gc index 6d3fddf850..5412380166 100644 --- a/goal_src/jak1/engine/load/decomp.gc +++ b/goal_src/jak1/engine/load/decomp.gc @@ -22,21 +22,22 @@ "Unpack run-length-encoded data. Has sections of repeated values, then normally copied." (local-vars (current-input int) (copy-length int)) (nop!) - (loop (loop ;; read the input and see what kind it is, based on number. - (set! current-input (-> in 0)) - (set! in (&-> in 1)) - (b! (<= current-input 0) cfg-5 :delay (nop!)) - ;; it's a repated value, loop to copy it. - (let ((repeated-value (-> in 0))) - (set! in (&-> in 1)) - (label cfg-3) - (nop!) - (nop!) - (nop!) - (nop!) - (set! (-> out 0) repeated-value)) - (set! out (&-> out 1)) - (b! (> current-input 0) cfg-3 :delay (set! current-input (+ current-input -1)))) + (loop + (loop ;; read the input and see what kind it is, based on number. + (set! current-input (-> in 0)) + (set! in (&-> in 1)) + (b! (<= current-input 0) cfg-5 :delay (nop!)) + ;; it's a repated value, loop to copy it. + (let ((repeated-value (-> in 0))) + (set! in (&-> in 1)) + (label cfg-3) + (nop!) + (nop!) + (nop!) + (nop!) + (set! (-> out 0) repeated-value)) + (set! out (&-> out 1)) + (b! (> current-input 0) cfg-3 :delay (set! current-input (+ current-input -1)))) (label cfg-5) ;; check for end (b! (zero? current-input) cfg-8 :delay (set! copy-length (- current-input))) diff --git a/goal_src/jak1/engine/target/target.gc b/goal_src/jak1/engine/target/target.gc index 35719e1c93..b9086858b8 100644 --- a/goal_src/jak1/engine/target/target.gc +++ b/goal_src/jak1/engine/target/target.gc @@ -374,7 +374,8 @@ (the-as uint eichar-stance-loop-down-ja) (the-as uint eichar-stance-loop-left-ja) (the-as uint eichar-stance-loop-right-ja)) - (loop (ground-tween-update gp-0 (-> self control unknown-float61) (-> self control unknown-float62)) + (loop + (ground-tween-update gp-0 (-> self control unknown-float61) (-> self control unknown-float62)) (suspend) (ja :num! (loop!)) (ja :chan 1 :num! (chan 0)) @@ -570,16 +571,17 @@ (ja :chan 3 :group! eichar-run-ja :num! (identity f28-1) :frame-interp 0.0 :dist (-> *TARGET-bank* run-cycle-dist))) (let ((f28-2 0.0) (f26-1 0.0)) - (loop (let ((f22-0 (fmax -1.0 (fmin 1.0 (* 2.0 (-> self control unknown-float61))))) - (f24-0 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control unknown-float62)))))) - (set! f30-0 - (seek f30-0 - (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -16384.0 (-> self control unknown-float01))))) - (* 2.0 (seconds-per-frame)))) - (let ((v1-317 (-> self skel effect))) (set! (-> v1-317 channel-offset) (if (< 0.5 f30-0) 3 0))) - 0 - (let ((f0-64 (fabs (- f22-0 f28-2)))) (set! f28-2 (seek f28-2 f22-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-64)))))) - (let ((f0-69 (fabs (- f24-0 f26-1)))) (set! f26-1 (seek f26-1 f24-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-69))))))) + (loop + (let ((f22-0 (fmax -1.0 (fmin 1.0 (* 2.0 (-> self control unknown-float61))))) + (f24-0 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control unknown-float62)))))) + (set! f30-0 + (seek f30-0 + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -16384.0 (-> self control unknown-float01))))) + (* 2.0 (seconds-per-frame)))) + (let ((v1-317 (-> self skel effect))) (set! (-> v1-317 channel-offset) (if (< 0.5 f30-0) 3 0))) + 0 + (let ((f0-64 (fabs (- f22-0 f28-2)))) (set! f28-2 (seek f28-2 f22-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-64)))))) + (let ((f0-69 (fabs (- f24-0 f26-1)))) (set! f26-1 (seek f26-1 f24-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-69))))))) (cond ((>= f28-2 0.0) (ja :chan 1 :group! eichar-walk-up-ja :frame-interp (fabs f28-2) :dist (-> *TARGET-bank* walk-up-cycle-dist)) @@ -672,7 +674,8 @@ :code (behavior () (if (not (ja-group? eichar-duck-stance-ja)) (ja-channel-push! 1 (seconds 0.1))) - (loop (ja-no-eval :group! eichar-duck-stance-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! eichar-duck-stance-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -803,7 +806,8 @@ (until (ja-done? 0) (suspend) (ja :num! (seek!))))) - (loop (ja-no-eval :group! eichar-duck-stance-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! eichar-duck-stance-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -847,7 +851,8 @@ ((and (ja-group? eichar-duck-walk-ja) (= (-> self skel root-channel 0) (-> self skel channel)))) ((ja-group? eichar-duck-stance-ja) (ja-channel-push! 1 (seconds 0.45)) (ja :group! eichar-duck-walk-ja :num! min)) (else (ja-channel-push! 1 (seconds 0.1)) (ja :group! eichar-duck-walk-ja :num! min))) - (loop (if (= (-> self skel root-channel 0) (-> self skel channel)) (set! (-> self control unknown-surface00) *duck-mods*)) + (loop + (if (= (-> self skel root-channel 0) (-> self skel channel)) (set! (-> self control unknown-surface00) *duck-mods*)) (ja :num! (loop! (fmin 1.0 (/ (-> self control unknown-float01) @@ -956,7 +961,8 @@ (suspend) (ja :num! (seek!))) (ja-no-eval :group! eichar-jump-loop-ja :num! (loop!) :frame-num 0.0) - (loop (suspend) + (loop + (suspend) (ja :group! eichar-jump-loop-ja :num! (loop!)))) :post target-post) @@ -1148,11 +1154,13 @@ (cond ((= arg2 'launch) (ja-no-eval :group! eichar-launch-jump-loop-ja :num! (loop! f28-0) :frame-num 0.0) - (loop (suspend) + (loop + (suspend) (ja :group! eichar-launch-jump-loop-ja :num! (loop! f28-0)))) (else (ja-no-eval :group! eichar-jump-loop-ja :num! (loop!) :frame-num 0.0) - (loop (suspend) + (loop + (suspend) (ja :group! eichar-jump-loop-ja :num! (loop!)))))) (the-as none 0)) :post target-post) @@ -1734,7 +1742,8 @@ (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-2) (vector-float*! gp-4 gp-4 (/ f0-23 f1-3))))) (suspend) - (loop (+! (-> self control unknown-uint20) 1) + (loop + (+! (-> self control unknown-uint20) 1) (ja :num! (+!)) (ja :chan 1 :num! diff --git a/goal_src/jak1/engine/target/target2.gc b/goal_src/jak1/engine/target/target2.gc index 989dea3241..54c859137d 100644 --- a/goal_src/jak1/engine/target/target2.gc +++ b/goal_src/jak1/engine/target/target2.gc @@ -204,8 +204,9 @@ (disable-hud (the-as int (-> *hud-parts* power)))) :code (behavior () - (loop (dotimes (gp-0 (-> self nb-of-particles)) - (if (= (-> self particles gp-0 part matrix) -1) (set! (-> self particles gp-0 part matrix) (sprite-allocate-user-hvdf)))) + (loop + (dotimes (gp-0 (-> self nb-of-particles)) + (if (= (-> self particles gp-0 part matrix) -1) (set! (-> self particles gp-0 part matrix) (sprite-allocate-user-hvdf)))) (set-setting! 'common-page 'set 0.0 1) (suspend) (go hud-coming-in) @@ -217,7 +218,8 @@ event) :code (behavior () - (loop (seekl! (-> self in-out-position) 0 (the int (* 350.0 (-> *display* time-adjust-ratio)))) + (loop + (seekl! (-> self in-out-position) 0 (the int (* 350.0 (-> *display* time-adjust-ratio)))) (if (zero? (-> self in-out-position)) (go hud-normal)) (suspend))) :post @@ -230,17 +232,19 @@ event) :code (behavior () - (loop (if (or (not *progress-process*) - (= (-> *progress-process* 0 next-state name) 'progress-going-out) - (= (-> *progress-process* 0 next-state name) 'progress-gone)) - (seekl! (-> self in-out-position) 0 (the int (* 150.0 (-> *display* time-adjust-ratio)))) - (seekl! (-> self in-out-position) 4096 (the int (* 200.0 (-> *display* time-adjust-ratio))))) + (loop + (if (or (not *progress-process*) + (= (-> *progress-process* 0 next-state name) 'progress-going-out) + (= (-> *progress-process* 0 next-state name) 'progress-gone)) + (seekl! (-> self in-out-position) 0 (the int (* 150.0 (-> *display* time-adjust-ratio)))) + (seekl! (-> self in-out-position) 4096 (the int (* 200.0 (-> *display* time-adjust-ratio))))) (suspend)))) (defstate hud-going-out (first-person-hud) :code (behavior () - (loop (seekl! (-> self in-out-position) 4096 (the int (* 350.0 (-> *display* time-adjust-ratio)))) + (loop + (seekl! (-> self in-out-position) 4096 (the int (* 350.0 (-> *display* time-adjust-ratio)))) (if (= (-> self in-out-position) 4096) (deactivate self)) (suspend))) :post @@ -388,7 +392,8 @@ (suspend)) (ja-channel-set! 0) (set! (-> self control transv quad) (the-as uint128 0)) - (loop (if (!= (-> self cam-user-mode) 'look-around) (go target-stance-look-around)) + (loop + (if (!= (-> self cam-user-mode) 'look-around) (go target-stance-look-around)) (suspend))) :post target-no-move-post) @@ -509,56 +514,59 @@ (= v1-11 eichar-duck-high-jump-ja)))) (target-hit-ground-anim #f))) (-> self control unknown-spoolanim00) - (loop (let ((gp-1 (-> self control unknown-spoolanim00))) - (case gp-1 - (('stance) - (cond - ((or (and (ja-group? eichar-walk-ja) (< 0.5 (-> self skel root-channel 6 frame-interp))) - (let ((v1-32 (ja-group))) - (or (= v1-32 eichar-run-squash-ja) - (= v1-32 eichar-run-squash-weak-ja) - (= v1-32 eichar-attack-from-stance-run-end-ja) - (= v1-32 eichar-attack-from-stance-run-alt-end-ja)))) - (ja-channel-push! 1 (seconds 0.15)) - (ja-no-eval :group! eichar-run-to-stance-loop-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))) - (ja-no-eval :group! eichar-run-to-stance-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))) - (ja-channel-push! 1 (seconds 0.15))) - ((let ((v1-87 (ja-group))) - (and (or (= v1-87 eichar-jump-short-land-ja) (= v1-87 eichar-jump-land-ja)) (not (ja-max? 0)))) - (ja-no-eval :num! (seek!)) - (while (not (ja-done? 0)) - (suspend) - (ja-eval)) - (ja-channel-push! 1 (seconds 0.075))) - ((not (and (ja-group? eichar-stance-loop-ja) (= (ja-group-size) 1))) (ja-channel-push! 1 (seconds 0.075)))) - (loop (ja-no-eval :group! eichar-stance-loop-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (if (!= gp-1 (-> self control unknown-spoolanim00)) (goto cfg-94)) - (suspend) - (ja :num! (seek!))))) - (('shock-in) - (ja-channel-push! 1 (seconds 0.2)) - (ja-no-eval :group! eichar-shocked-ja :num! (seek! (ja-aframe (the-as float 18.0) 0)) :frame-num 0.0) - (until (ja-done? 0) - (if (!= gp-1 (-> self control unknown-spoolanim00)) (goto cfg-94)) - (suspend) - (ja :num! (seek! (ja-aframe (the-as float 18.0) 0)))) - (loop (if (!= gp-1 (-> self control unknown-spoolanim00)) (goto cfg-94)) - (suspend))) - (('shock-out) - (if (not (ja-group? eichar-shocked-ja)) (ja-channel-push! 1 (seconds 0.2))) - (ja-no-eval :group! eichar-shocked-ja :num! (seek!) :frame-num (ja-aframe (the-as float 18.0) 0)) - (until (ja-done? 0) - (if (!= gp-1 (-> self control unknown-spoolanim00)) (goto cfg-94)) - (suspend) - (ja :num! (seek!))) - (set! (-> self control unknown-uint20) (the-as uint 'stance))))) + (loop + (let ((gp-1 (-> self control unknown-spoolanim00))) + (case gp-1 + (('stance) + (cond + ((or (and (ja-group? eichar-walk-ja) (< 0.5 (-> self skel root-channel 6 frame-interp))) + (let ((v1-32 (ja-group))) + (or (= v1-32 eichar-run-squash-ja) + (= v1-32 eichar-run-squash-weak-ja) + (= v1-32 eichar-attack-from-stance-run-end-ja) + (= v1-32 eichar-attack-from-stance-run-alt-end-ja)))) + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! eichar-run-to-stance-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))) + (ja-no-eval :group! eichar-run-to-stance-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))) + (ja-channel-push! 1 (seconds 0.15))) + ((let ((v1-87 (ja-group))) + (and (or (= v1-87 eichar-jump-short-land-ja) (= v1-87 eichar-jump-land-ja)) (not (ja-max? 0)))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval)) + (ja-channel-push! 1 (seconds 0.075))) + ((not (and (ja-group? eichar-stance-loop-ja) (= (ja-group-size) 1))) (ja-channel-push! 1 (seconds 0.075)))) + (loop + (ja-no-eval :group! eichar-stance-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (!= gp-1 (-> self control unknown-spoolanim00)) (goto cfg-94)) + (suspend) + (ja :num! (seek!))))) + (('shock-in) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! eichar-shocked-ja :num! (seek! (ja-aframe (the-as float 18.0) 0)) :frame-num 0.0) + (until (ja-done? 0) + (if (!= gp-1 (-> self control unknown-spoolanim00)) (goto cfg-94)) + (suspend) + (ja :num! (seek! (ja-aframe (the-as float 18.0) 0)))) + (loop + (if (!= gp-1 (-> self control unknown-spoolanim00)) (goto cfg-94)) + (suspend))) + (('shock-out) + (if (not (ja-group? eichar-shocked-ja)) (ja-channel-push! 1 (seconds 0.2))) + (ja-no-eval :group! eichar-shocked-ja :num! (seek!) :frame-num (ja-aframe (the-as float 18.0) 0)) + (until (ja-done? 0) + (if (!= gp-1 (-> self control unknown-spoolanim00)) (goto cfg-94)) + (suspend) + (ja :num! (seek!))) + (set! (-> self control unknown-uint20) (the-as uint 'stance))))) (label cfg-94))) :post (behavior () @@ -634,7 +642,8 @@ (until (ja-done? 0) (suspend) (ja :num! (seek!))) - (loop (set! (-> self anim-seed) (the-as uint (if (rand-vu-percent? (the-as float 0.1)) 0 1))) + (loop + (set! (-> self anim-seed) (the-as uint (if (rand-vu-percent? (the-as float 0.1)) 0 1))) (ja-no-eval :group! eichar-pole-cycle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -680,7 +689,8 @@ (set! f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))))) (ja-channel-push! 1 (seconds 0.25)) (ja-no-eval :group! eichar-jump-loop-ja :num! (loop!) :frame-num 0.0) - (loop (suspend) + (loop + (suspend) (ja :group! eichar-jump-loop-ja :num! (loop!)))) :post target-post) @@ -786,7 +796,8 @@ (suspend) (ja :num! (seek!))) (ja-channel-set! 1) - (loop (ja-no-eval :group! eichar-edge-grab-stance0-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! eichar-edge-grab-stance0-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))) @@ -1159,10 +1170,11 @@ (the-as float 16384.0) (the-as float 32768.0))) (gp-6 0)) - (loop (let ((f0-10 (fmax -1.0 (fmin 1.0 (* 2.0 (-> self control unknown-float61))))) - (f24-0 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control unknown-float62)))))) - (let ((f1-4 (fabs (- f0-10 f30-1)))) (set! f30-1 (seek f30-1 f0-10 (fmax 0.05 (fmin 0.2 (* 0.25 f1-4)))))) - (let ((f0-14 (fabs (- f24-0 f28-0)))) (set! f28-0 (seek f28-0 f24-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-14))))))) + (loop + (let ((f0-10 (fmax -1.0 (fmin 1.0 (* 2.0 (-> self control unknown-float61))))) + (f24-0 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control unknown-float62)))))) + (let ((f1-4 (fabs (- f0-10 f30-1)))) (set! f30-1 (seek f30-1 f0-10 (fmax 0.05 (fmin 0.2 (* 0.25 f1-4)))))) + (let ((f0-14 (fabs (- f24-0 f28-0)))) (set! f28-0 (seek f28-0 f24-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-14))))))) (ja :chan 3 :group! eichar-walk-down-ja :dist (-> *TARGET-bank* walk-down-cycle-dist)) (if (>= f30-1 0.0) (ja :chan 3 :group! eichar-walk-up-ja :frame-interp (fabs f30-1) :dist (-> *TARGET-bank* walk-up-cycle-dist)) @@ -1299,7 +1311,8 @@ (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!)))) ((ja-group? eichar-swim-walk-ja) (ja-channel-push! 1 (seconds 0.83))) (else (ja-channel-push! 1 (seconds 0.15))))) - (loop (ja :group! eichar-swim-stance-ja :num! min) + (loop + (ja :group! eichar-swim-stance-ja :num! min) (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) (suspend) (if (= (-> self skel root-channel 0) (-> self skel channel)) (ja :num! (seek!)))))) @@ -1359,7 +1372,8 @@ (suspend) (ja :num! (seek!)))) (else (ja-channel-push! 1 (seconds 0.15))))) - (loop (ja-no-eval :group! eichar-swim-walk-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! eichar-swim-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (compute-alignment! (-> self align)) (if (not (logtest? (-> self align flags) (align-flags disabled))) @@ -1449,9 +1463,10 @@ (ja :group! eichar-swim-down-ja :num! (identity (ja-aframe (the-as float 124.0) 0))) -16384.0) (else (ja-channel-push! 1 (seconds 0.075)) (ja :group! eichar-swim-down-ja :num! min) f30-0)))))) - (loop (if (and (or (not (cpad-hold? (-> self control unknown-cpad-info00 number) square)) (-> self control unknown-spoolanim00)) - (time-elapsed? (-> self state-time) gp-0)) - (go target-swim-up)) + (loop + (if (and (or (not (cpad-hold? (-> self control unknown-cpad-info00 number) square)) (-> self control unknown-spoolanim00)) + (time-elapsed? (-> self state-time) gp-0)) + (go target-swim-up)) (if (or (time-elapsed? (-> self state-time) s5-0) (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) (and (< (-> self water swim-depth) 8192.0) (time-elapsed? (-> self state-time) gp-0)))) @@ -1523,10 +1538,11 @@ (suspend) (ja :num! (seek!)))) (ja :group! eichar-swim-up-ja :num! min) - (loop (target-swim-tilt (the-as float (if (< 8192.0 (-> self water swim-depth)) 0.3 0.0)) - (the-as float 1.0) - (the-as float 0.0) - (the-as float 0.1)) + (loop + (target-swim-tilt (the-as float (if (< 8192.0 (-> self water swim-depth)) 0.3 0.0)) + (the-as float 1.0) + (the-as float 0.0) + (the-as float 0.1)) (if (not (logtest? (-> self water flags) (water-flags wt12))) (goto cfg-37)) (if (cpad-pressed? (-> self control unknown-cpad-info00 number) x) (set! f30-0 2.0)) (compute-alignment! (-> self align)) diff --git a/goal_src/jak1/engine/ui/hud.gc b/goal_src/jak1/engine/ui/hud.gc index 1b245f4289..40d4c20c9b 100644 --- a/goal_src/jak1/engine/ui/hud.gc +++ b/goal_src/jak1/engine/ui/hud.gc @@ -177,7 +177,8 @@ :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) - (loop (suspend))) + (loop + (suspend))) :post (behavior () (if (-> self deactivate-when-hidden) (deactivate self)) @@ -212,7 +213,8 @@ (if (= (-> self particles gp-1 part matrix) -1) (set! (-> self particles gp-1 part matrix) (sprite-allocate-user-hvdf))))) :code (behavior () - (loop (if (not (paused?)) (seekl! (-> self offset) 0 (the int (* 15.0 (-> *display* time-adjust-ratio))))) + (loop + (if (not (paused?)) (seekl! (-> self offset) 0 (the int (* 15.0 (-> *display* time-adjust-ratio))))) (draw-icons self) (if (<= (-> self offset) 0) (go hud-in)) (when (movie?) @@ -260,7 +262,8 @@ event) :code (behavior ((arg0 int)) - (loop (if (not (paused?)) (seekl! (-> self offset) 128 (the int (* (the float arg0) (-> *display* time-adjust-ratio))))) + (loop + (if (not (paused?)) (seekl! (-> self offset) 128 (the int (* (the float arg0) (-> *display* time-adjust-ratio))))) (draw-icons self) (when (movie?) (set-time! (-> self last-hide-time)) @@ -320,13 +323,14 @@ (f28-0 (-> self root scale x)) (f24-0 (-> self root scale y)) (f22-0 (-> self root scale z))) - (loop (let ((f0-7 (* f30-0 (seconds-per-frame)))) - (+! f26-0 f0-7) - (when (< 1.0 f26-0) - (let ((f0-8 (- f26-0 f0-7))) (set! f0-7 (- 1.0 f0-8))) - (set! f26-0 1.0)) - (+! (-> self root trans x) (* f0-7 (-> s5-0 x))) - (+! (-> self root trans y) (* f0-7 (-> s5-0 y)))) + (loop + (let ((f0-7 (* f30-0 (seconds-per-frame)))) + (+! f26-0 f0-7) + (when (< 1.0 f26-0) + (let ((f0-8 (- f26-0 f0-7))) (set! f0-7 (- 1.0 f0-8))) + (set! f26-0 1.0)) + (+! (-> self root trans x) (* f0-7 (-> s5-0 x))) + (+! (-> self root trans y) (* f0-7 (-> s5-0 y)))) (set-vector! (-> self root scale) (* f28-0 (-> *video-parms* relative-x-scale)) (* f24-0 (-> *video-parms* relative-y-scale) (-> *video-parms* relative-y-scale)) diff --git a/goal_src/jak1/engine/ui/progress/progress.gc b/goal_src/jak1/engine/ui/progress/progress.gc index cdf86b3a16..b60ae54b23 100644 --- a/goal_src/jak1/engine/ui/progress/progress.gc +++ b/goal_src/jak1/engine/ui/progress/progress.gc @@ -645,12 +645,13 @@ (('go-away) (go progress-gone)))) :code (behavior () - (loop (when (hud-hidden?) - (dotimes (gp-0 (-> self nb-of-particles)) - (if (= (-> self particles gp-0 part matrix) -1) (set! (-> self particles gp-0 part matrix) (sprite-allocate-user-hvdf)))) - (set-setting! 'common-page 'set 0.0 1) - (suspend) - (go progress-coming-in)) + (loop + (when (hud-hidden?) + (dotimes (gp-0 (-> self nb-of-particles)) + (if (= (-> self particles gp-0 part matrix) -1) (set! (-> self particles gp-0 part matrix) (sprite-allocate-user-hvdf)))) + (set-setting! 'common-page 'set 0.0 1) + (suspend) + (go progress-coming-in)) (suspend)))) (defstate progress-gone (progress) @@ -1202,12 +1203,13 @@ v0-0))))))))) :code (behavior () - (loop (when (and (cpad-hold? 0 l1) (cpad-hold? 0 r1) *cheat-mode*) - (when (and (< (-> self task-index) (-> *level-task-data* (-> self display-level-index) nb-of-tasks)) - (>= (-> self task-index) 0)) - (let ((gp-0 (-> *level-task-data* (-> self display-level-index) task-info (-> self task-index) task-id))) - (close-specific-task! gp-0 (task-status need-resolution)) - (send-event *target* 'get-pickup 6 (the float gp-0))))) + (loop + (when (and (cpad-hold? 0 l1) (cpad-hold? 0 r1) *cheat-mode*) + (when (and (< (-> self task-index) (-> *level-task-data* (-> self display-level-index) nb-of-tasks)) + (>= (-> self task-index) 0)) + (let ((gp-0 (-> *level-task-data* (-> self display-level-index) task-info (-> self task-index) task-id))) + (close-specific-task! gp-0 (task-status need-resolution)) + (send-event *target* 'get-pickup 6 (the float gp-0))))) (if (and (= (-> self display-state) (-> self next-display-state)) (= (-> self display-level-index) (-> self next-level-index))) (seekl! (-> self transition-offset) @@ -1380,7 +1382,8 @@ (set! *pause-lock* #f)) :code (behavior () - (loop (seekl! (-> self in-out-position) 0 (the int (* 170.0 (-> *display* time-adjust-ratio)))) + (loop + (seekl! (-> self in-out-position) 0 (the int (* 170.0 (-> *display* time-adjust-ratio)))) (when (< (-> self in-out-position) 2867) (seekl! (-> self transition-offset) 0 (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio)))) (set-transition-progress! self (-> self transition-offset))) @@ -1402,7 +1405,8 @@ (set! (-> self transition-speed) 30.0)))) :code (behavior () - (loop (seekl! (-> self transition-offset) 512 (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio)))) + (loop + (seekl! (-> self transition-offset) 512 (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio)))) (set-transition-progress! self (-> self transition-offset)) (when (< 153 (-> self transition-offset)) (seekl! (-> self in-out-position) 4096 (the int (* 170.0 (-> *display* time-adjust-ratio)))) @@ -1419,28 +1423,29 @@ (('go-away) (go progress-going-out)))) :code (behavior () - (loop (cond - ((cpad-pressed? 0 left) (if (> (-> self current-debug-string) 0) (+! (-> self current-debug-string) -1))) - ((cpad-pressed? 0 right) - (if (< (-> self current-debug-string) (+ (-> *common-text* length) -1)) (+! (-> self current-debug-string) 1))) - ((cpad-pressed? 0 up) - (when (> (-> self current-debug-group) 0) - (+! (-> self current-debug-group) -1) - (set! (-> self current-debug-string) 0) - 0)) - ((cpad-pressed? 0 down) - (when (< (-> self current-debug-group) (+ (-> *text-group-names* length) -1)) - (+! (-> self current-debug-group) 1) - (set! (-> self current-debug-string) 0) - 0)) - ((cpad-pressed? 0 l1) - (if (> (the-as int (-> *setting-control* default language)) 0) (+! (-> *setting-control* default language) -1))) - ((cpad-pressed? 0 r1) - (if (< (the-as int (-> *setting-control* default language)) 6) (+! (-> *setting-control* default language) 1))) - ((cpad-pressed? 0 l2) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l2)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons l2)) - (go progress-normal))) + (loop + (cond + ((cpad-pressed? 0 left) (if (> (-> self current-debug-string) 0) (+! (-> self current-debug-string) -1))) + ((cpad-pressed? 0 right) + (if (< (-> self current-debug-string) (+ (-> *common-text* length) -1)) (+! (-> self current-debug-string) 1))) + ((cpad-pressed? 0 up) + (when (> (-> self current-debug-group) 0) + (+! (-> self current-debug-group) -1) + (set! (-> self current-debug-string) 0) + 0)) + ((cpad-pressed? 0 down) + (when (< (-> self current-debug-group) (+ (-> *text-group-names* length) -1)) + (+! (-> self current-debug-group) 1) + (set! (-> self current-debug-string) 0) + 0)) + ((cpad-pressed? 0 l1) + (if (> (the-as int (-> *setting-control* default language)) 0) (+! (-> *setting-control* default language) -1))) + ((cpad-pressed? 0 r1) + (if (< (the-as int (-> *setting-control* default language)) 6) (+! (-> *setting-control* default language) 1))) + ((cpad-pressed? 0 l2) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l2)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons l2)) + (go progress-normal))) (load-game-text-info (-> *text-group-names* (-> self current-debug-group)) '*common-text* *common-text-heap*) (suspend))) :post diff --git a/goal_src/jak1/kernel/gstate.gc b/goal_src/jak1/kernel/gstate.gc index 7e7e4f4f3c..5455186a27 100644 --- a/goal_src/jak1/kernel/gstate.gc +++ b/goal_src/jak1/kernel/gstate.gc @@ -8,47 +8,47 @@ ;; dgos: KERNEL #| -Summary of state system: - -A process can be put into a state, using enter-state, or the go macro. -This will set up the process to run the appropriate handler functions defined by the state. -The state handlers are: -- enter : gets run before trans on the first time the state is used. Can be #f. Must return. -- trans : gets run before code each time the code is run. Can be #f. Must return. -- code : main thread. Can suspend. If it returns, the process dies -- exit : gets run when leaving a state. must return. -- event : not sure of the details here yet. - -You can use "go" to change the state of a process. This causes the process main thread execution to be abandoned. -If the main thread has exits/protects on the stack frame, they will be run first to clean up. - -There are several ways to "go" -- go during init: when a process is being initialized with run-function-in-process, you can "go". - this causes the run-function-in-process to return immediately, and the next time the process is dispatched - it will go into the other state. This will automatically set the process to waiting-to-run, - and shrink the process heap, if appropriate - -- go from outside the process. You can temporarily set pp to another process, and have that - process go to another state. The actual go will occur the next time the process is scheduled. - Use the go-process macro to do this. - -- go from a non-main thread in the right process. You can do a go from a temporary thread, like trans or post. - If you do it from post, the go returns and the rest of the post runs. If you do it from any other thread, the temporary thread - is immediately abandonded. Like the previous two, it will defer the actual go until the next time the - process runs. - -- go from the main thread of the main process. This causes the (-> pp state) to change, the stack frames - to be cleaned up, and the old state's exit to be called. It will reset the stack, then run the code. - Unlike the others, this means you "go" immediately. - -The compiler has two special hooks related to states: go-hook and define-state-hook. -These take care of doing a go and a state definition and properly checking types. - -The define-state-hook takes a state object and handlers and defines a global symbol -with the appropriate state type. - -The go-hook calls enter state and sets (-> proc next-state) for the given process. -It type checks the arguments for the entry function. + Summary of state system: + + A process can be put into a state, using enter-state, or the go macro. + This will set up the process to run the appropriate handler functions defined by the state. + The state handlers are: + - enter : gets run before trans on the first time the state is used. Can be #f. Must return. + - trans : gets run before code each time the code is run. Can be #f. Must return. + - code : main thread. Can suspend. If it returns, the process dies + - exit : gets run when leaving a state. must return. + - event : not sure of the details here yet. + + You can use "go" to change the state of a process. This causes the process main thread execution to be abandoned. + If the main thread has exits/protects on the stack frame, they will be run first to clean up. + + There are several ways to "go" + - go during init: when a process is being initialized with run-function-in-process, you can "go". + this causes the run-function-in-process to return immediately, and the next time the process is dispatched + it will go into the other state. This will automatically set the process to waiting-to-run, + and shrink the process heap, if appropriate + + - go from outside the process. You can temporarily set pp to another process, and have that + process go to another state. The actual go will occur the next time the process is scheduled. + Use the go-process macro to do this. + + - go from a non-main thread in the right process. You can do a go from a temporary thread, like trans or post. + If you do it from post, the go returns and the rest of the post runs. If you do it from any other thread, the temporary thread + is immediately abandonded. Like the previous two, it will defer the actual go until the next time the + process runs. + + - go from the main thread of the main process. This causes the (-> pp state) to change, the stack frames + to be cleaned up, and the old state's exit to be called. It will reset the stack, then run the code. + Unlike the others, this means you "go" immediately. + + The compiler has two special hooks related to states: go-hook and define-state-hook. + These take care of doing a go and a state definition and properly checking types. + + The define-state-hook takes a state object and handlers and defines a global symbol + with the appropriate state type. + + The go-hook calls enter state and sets (-> proc next-state) for the given process. + It type checks the arguments for the entry function. |# (defmacro go (next-state &rest args) @@ -417,7 +417,8 @@ It type checks the arguments for the entry function. (defun looping-code () "Loop." - (loop (suspend)) + (loop + (suspend)) #f) (defmacro set-state-time () diff --git a/goal_src/jak1/kernel/pskernel.gc b/goal_src/jak1/kernel/pskernel.gc index 91c97413a7..0f799c68b4 100644 --- a/goal_src/jak1/kernel/pskernel.gc +++ b/goal_src/jak1/kernel/pskernel.gc @@ -8,20 +8,20 @@ ;; dgos: KERNEL #| -pskernel.gc contains a bunch of utilities for poking around the PS2's kernel. -These are unused in the retail game, and wouldn't be "safe" to use on a retail console, -as later console revisions may have different memory layout of the BIOS. I suspect this -was used for the purposes of debugging and handling crashes. -They took over syscall 102 to access memory inside the kernel. - -There's an error message: -"I CANNOT CONTINUE TO LOAD GOAL, BECAUSE THE KERNEL VERSION HAS CHANGED~%" -"~%Alternatively, try removing pskernel.gc and debug-handlers.gc from project.cl, do an (lg) and then (:r) again~%" - -My theory is that debug-handlers.gc held crash handlers, and on load would install them using functions defined in pskernel.gc. -In the retail game, they removed debug-handlers, but not pskernel. - -In the PC port, all of these functions are just stubs. + pskernel.gc contains a bunch of utilities for poking around the PS2's kernel. + These are unused in the retail game, and wouldn't be "safe" to use on a retail console, + as later console revisions may have different memory layout of the BIOS. I suspect this + was used for the purposes of debugging and handling crashes. + They took over syscall 102 to access memory inside the kernel. + + There's an error message: + "I CANNOT CONTINUE TO LOAD GOAL, BECAUSE THE KERNEL VERSION HAS CHANGED~%" + "~%Alternatively, try removing pskernel.gc and debug-handlers.gc from project.cl, do an (lg) and then (:r) again~%" + + My theory is that debug-handlers.gc held crash handlers, and on load would install them using functions defined in pskernel.gc. + In the retail game, they removed debug-handlers, but not pskernel. + + In the PC port, all of these functions are just stubs. |# ;; map of the kernel's memory. diff --git a/goal_src/jak1/levels/beach/beach-obs.gc b/goal_src/jak1/levels/beach/beach-obs.gc index 4900a2d1f1..d10261503f 100644 --- a/goal_src/jak1/levels/beach/beach-obs.gc +++ b/goal_src/jak1/levels/beach/beach-obs.gc @@ -46,7 +46,8 @@ (sound-play "gears-rumble" :id (-> self sound-id) :position (the-as symbol t2-0))))) :code (behavior () - (loop (ja-no-eval :group! windmill-one-idle-ja :num! (seek! max 0.5) :frame-num 0.0) + (loop + (ja-no-eval :group! windmill-one-idle-ja :num! (seek! max 0.5) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max 0.5))))) @@ -215,7 +216,8 @@ (ja :group! grottopole-idle-ja :num! min) (transform-post) (suspend) - (loop (logior! (-> self mask) (process-mask sleep)) + (loop + (logior! (-> self mask) (process-mask sleep)) (suspend)))) (defun move-grottopole ((arg0 grottopole) (arg1 float)) @@ -462,7 +464,8 @@ :code (behavior () (transform-post) - (loop (logior! (-> self mask) (process-mask sleep)) + (loop + (logior! (-> self mask) (process-mask sleep)) (suspend)))) (defstate ecoventrock-break (ecoventrock) @@ -688,7 +691,8 @@ (defstate bladeassm-idle (bladeassm) :code (behavior () - (loop (+! (-> self angle) (* 3640.889 (seconds-per-frame))) + (loop + (+! (-> self angle) (* 3640.889 (seconds-per-frame))) (set! (-> self angle) (the float (sar (shl (the int (-> self angle)) 48) 48))) (pusher-post) (suspend)))) @@ -822,7 +826,8 @@ :code (behavior () (ja-post) - (loop (suspend)))) + (loop + (suspend)))) (defstate flutflutegg-physics (flutflutegg) :event @@ -844,7 +849,8 @@ :code (behavior () (set-time! (-> self state-time)) - (loop (+! (-> self pos) (* (-> self vel) (seconds-per-frame))) + (loop + (+! (-> self pos) (* (-> self vel) (seconds-per-frame))) ;; og:preserve-this PAL patch here (set! (-> self vel) (* (-> self vel) (- 1.0 (* 0.05 (-> *display* time-adjust-ratio))))) (move! (-> self wobbler)) @@ -884,7 +890,8 @@ :to self) (close-specific-task! (game-task beach-flutflut) (task-status need-reminder)) - (loop (vector-float*! (-> self root transv) (-> self dir) (-> self vel)) + (loop + (vector-float*! (-> self root transv) (-> self dir) (-> self vel)) (set-time! (-> self state-time)) (until v1-25 (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) @@ -936,7 +943,8 @@ (set-vector! (-> self root trans) -231190.94 64559.105 -1164727.5 1.0) (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 0.0) (ja :group! flutflutegg-broke-ja :num! max) - (loop (logior! (-> self mask) (process-mask sleep)) + (loop + (logior! (-> self mask) (process-mask sleep)) (suspend))) :post ja-post) @@ -1011,7 +1019,8 @@ (go harvester-inflate #t)) (ja :group! harvester-inflate-ja :num! (identity (ja-aframe 1.0 0))) (ja-post) - (loop (logior! (-> self mask) (process-mask sleep)) + (loop + (logior! (-> self mask) (process-mask sleep)) (suspend)))) (defstate harvester-inflate (harvester) @@ -1022,7 +1031,8 @@ (until (ja-done? 0) (suspend) (ja :num! (seek!)))) - (loop (ja-no-eval :group! harvester-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! harvester-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) diff --git a/goal_src/jak1/levels/beach/beach-part.gc b/goal_src/jak1/levels/beach/beach-part.gc index 78c440be55..4a470e47ec 100644 --- a/goal_src/jak1/levels/beach/beach-part.gc +++ b/goal_src/jak1/levels/beach/beach-part.gc @@ -78,12 +78,13 @@ (defstate beach-part-grotto-1 (beach-part) :code (behavior () - (loop (when (is-visible? self) - (let* ((gp-0 (camera-pos)) - (f0-0 (vector-vector-distance (-> self root trans) gp-0))) - (if (or (< (-> gp-0 y) (-> self root trans y)) (< 122880.0 f0-0)) - (launch-particles (-> *part-id-table* 666) (-> self root trans)))) - (launch-particles (-> *part-id-table* 668) (-> self root trans))) + (loop + (when (is-visible? self) + (let* ((gp-0 (camera-pos)) + (f0-0 (vector-vector-distance (-> self root trans) gp-0))) + (if (or (< (-> gp-0 y) (-> self root trans y)) (< 122880.0 f0-0)) + (launch-particles (-> *part-id-table* 666) (-> self root trans)))) + (launch-particles (-> *part-id-table* 668) (-> self root trans))) (suspend)))) (defpart 671 diff --git a/goal_src/jak1/levels/beach/beach-rocks.gc b/goal_src/jak1/levels/beach/beach-rocks.gc index 9f3e7444ec..37a5fa2eca 100644 --- a/goal_src/jak1/levels/beach/beach-rocks.gc +++ b/goal_src/jak1/levels/beach/beach-rocks.gc @@ -260,7 +260,8 @@ (if (-> self trigger) (go-virtual falling)) (ja-channel-set! 0) (ja-post) - (loop (logior! (-> self mask) (process-mask sleep)) + (loop + (logior! (-> self mask) (process-mask sleep)) (suspend)))) (defstate loading (beach-rock) @@ -270,7 +271,8 @@ event) :code (behavior () - (loop (spool-push *art-control* "lrocklrg-falling" 0 self -1.0) + (loop + (spool-push *art-control* "lrocklrg-falling" 0 self -1.0) (suspend)))) (defstate falling (beach-rock) diff --git a/goal_src/jak1/levels/beach/lurkercrab.gc b/goal_src/jak1/levels/beach/lurkercrab.gc index 274ed6d0ea..7a13cb708c 100644 --- a/goal_src/jak1/levels/beach/lurkercrab.gc +++ b/goal_src/jak1/levels/beach/lurkercrab.gc @@ -148,7 +148,8 @@ nav-enemy-default-event-handler (set! (-> self target-speed) 0.0) (set! (-> self draw force-lod) 2) (ja-channel-push! 1 (seconds 0.075)) - (loop (ja :group! lurkercrab-idle-ja :num! (identity (ja-aframe 1.0 0))) + (loop + (ja :group! lurkercrab-idle-ja :num! (identity (ja-aframe 1.0 0))) (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (seconds 3)) (suspend))) (ja-no-eval :group! lurkercrab-idle-ja :num! (seek! (ja-aframe 19.0 0)) :frame-num (ja-aframe 1.0 0)) (until (ja-done? 0) @@ -189,11 +190,12 @@ nav-enemy-default-event-handler (suspend) (ja :num! (seek!)))) (ja-channel-push! 1 (seconds 0.075)) - (loop (dotimes (gp-0 6) - (ja-no-eval :group! lurkercrab-walk-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!)))) + (loop + (dotimes (gp-0 6) + (ja-no-eval :group! lurkercrab-walk-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)))) (when (nav-enemy-rnd-go-idle? 0.2) (ja-no-eval :num! (loop!)) (ja-channel-push! 1 (seconds 0.6)) @@ -249,7 +251,8 @@ nav-enemy-default-event-handler (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (ja-channel-push! 1 (seconds 0.075)) - (loop (ja-no-eval :group! lurkercrab-walk-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! lurkercrab-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))) diff --git a/goal_src/jak1/levels/beach/lurkerpuppy.gc b/goal_src/jak1/levels/beach/lurkerpuppy.gc index bf10074e43..892d3d7543 100644 --- a/goal_src/jak1/levels/beach/lurkerpuppy.gc +++ b/goal_src/jak1/levels/beach/lurkerpuppy.gc @@ -49,7 +49,8 @@ nav-enemy-default-event-handler (ja :num! (seek!)))) (else (ja-channel-push! 1 (seconds 0.17)))) (let ((f30-0 (rand-vu-float-range 0.9 1.1))) - (loop (if (rand-vu-percent? 0.25) (sound-play "puppy-bark")) + (loop + (if (rand-vu-percent? 0.25) (sound-play "puppy-bark")) (ja-no-eval :group! lurkerpuppy-run-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-attack)) @@ -65,7 +66,8 @@ nav-enemy-default-event-handler (set! (-> self turn-time) (seconds 0.1)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) - (loop (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (loop + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! lurkerpuppy-celebrate-ja :num! (seek! (ja-aframe 12.0 0) f30-0) :frame-num 0.0) (until (ja-done? 0) diff --git a/goal_src/jak1/levels/beach/lurkerworm.gc b/goal_src/jak1/levels/beach/lurkerworm.gc index 879ad8f98c..365cb1ffa0 100644 --- a/goal_src/jak1/levels/beach/lurkerworm.gc +++ b/goal_src/jak1/levels/beach/lurkerworm.gc @@ -246,10 +246,11 @@ lurkerworm-default-post-behavior (set-time! (-> self state-time))) :code (behavior () - (loop (if (and (time-elapsed? (-> self state-time) (seconds 1)) - *target* - (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (go lurkerworm-spot)) + (loop + (if (and (time-elapsed? (-> self state-time) (seconds 1)) + *target* + (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (go lurkerworm-spot)) (suspend))) :post lurkerworm-default-post-behavior) @@ -262,7 +263,8 @@ lurkerworm-default-post-behavior :code (behavior () (set! (-> self part local-clock) 0) - (loop (spawn (-> self part) (-> self root trans)) + (loop + (spawn (-> self part) (-> self root trans)) (particle-effect self) (when (time-elapsed? (-> self state-time) (seconds 1)) (if (and *target* (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) diff --git a/goal_src/jak1/levels/beach/pelican.gc b/goal_src/jak1/levels/beach/pelican.gc index 14aec5942a..5e13f86ef5 100644 --- a/goal_src/jak1/levels/beach/pelican.gc +++ b/goal_src/jak1/levels/beach/pelican.gc @@ -103,9 +103,10 @@ (seek-toward-heading-vec! (-> self root) s3-0 arg0 (the-as time-frame arg1))))) (defbehavior pelican-fly pelican ((arg0 (function pelican int)) (arg1 (function pelican int))) - (loop (cond - ((ja-group? pelican-fly-ja) (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval))) - (else (ja-channel-push! 1 (seconds 0.25)))) + (loop + (cond + ((ja-group? pelican-fly-ja) (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval))) + (else (ja-channel-push! 1 (seconds 0.25)))) (let ((s4-0 (arg0 self))) (dotimes (s3-0 s4-0) (ja-no-eval :group! pelican-fly-ja :num! (seek!) :frame-num 0.0) @@ -376,7 +377,8 @@ (ja :num! (seek!))) (ja-channel-push! 1 (seconds 0.5)))) (send-event (handle->process (-> self cam-tracker)) 'message 'release) - (loop (ja-no-eval :group! pelican-sleep-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! pelican-sleep-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) diff --git a/goal_src/jak1/levels/beach/sculptor.gc b/goal_src/jak1/levels/beach/sculptor.gc index c8e57b0046..3abfe90c44 100644 --- a/goal_src/jak1/levels/beach/sculptor.gc +++ b/goal_src/jak1/levels/beach/sculptor.gc @@ -155,87 +155,88 @@ (suspend) (ja :num! (seek!))) (muse-to-idle (the-as muse self)))) - (loop (let ((v1-43 (current-status (-> self tasks)))) - (cond - ((or (= v1-43 (task-status invalid)) (= v1-43 (task-status need-resolution))) - (ja-no-eval :group! sculptor-to-small-ja :num! (seek!) :frame-num 0.0) + (loop + (let ((v1-43 (current-status (-> self tasks)))) + (cond + ((or (= v1-43 (task-status invalid)) (= v1-43 (task-status need-resolution))) + (ja-no-eval :group! sculptor-to-small-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))) + (let* ((f30-0 4.0) + (v1-68 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-69 (the-as number (logior #x3f800000 v1-68)))) + (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-69)))) 4)) + (ja-no-eval :group! sculptor-small-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))))) + (let ((f30-1 (rand-float-gen))) + (ja-no-eval :group! sculptor-small-to-looking-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))) + (ja-no-eval :group! sculptor-looking-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))) + (ja-no-eval :group! sculptor-from-looking-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))) + (when (< f30-1 0.5) + (ja-no-eval :group! sculptor-to-huge-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))) - (let* ((f30-0 4.0) - (v1-68 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-69 (the-as number (logior #x3f800000 v1-68)))) - (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-69)))) 4)) - (ja-no-eval :group! sculptor-small-ja :num! (seek!) :frame-num 0.0) + (let* ((f30-2 2.0) + (v1-190 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-191 (the-as number (logior #x3f800000 v1-190)))) + (countdown (gp-2 (+ (the int (* f30-2 (+ -1.0 (the-as float v1-191)))) 2)) + (ja-no-eval :group! sculptor-huge-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) - (let ((f30-1 (rand-float-gen))) - (ja-no-eval :group! sculptor-small-to-looking-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))) - (ja-no-eval :group! sculptor-looking-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))) - (ja-no-eval :group! sculptor-from-looking-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))) - (when (< f30-1 0.5) - (ja-no-eval :group! sculptor-to-huge-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))) - (let* ((f30-2 2.0) - (v1-190 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-191 (the-as number (logior #x3f800000 v1-190)))) - (countdown (gp-2 (+ (the int (* f30-2 (+ -1.0 (the-as float v1-191)))) 2)) - (ja-no-eval :group! sculptor-huge-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))))) - (ja-no-eval :group! sculptor-huge-to-looking-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))) - (ja-no-eval :group! sculptor-looking-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))) - (ja-no-eval :group! sculptor-from-looking-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!)))))) - ((begin - (process-taskable-method-43 self) - (let* ((f30-3 4.0) - (v1-287 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-288 (the-as number (logior #x3f800000 v1-287)))) - (countdown (gp-3 (+ (the int (* f30-3 (+ -1.0 (the-as float v1-288)))) 4)) - (ja-no-eval :group! sculptor-idle-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))))) - (< (rand-float-gen) 0.5)) - (ja-no-eval :group! sculptor-sigh-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!)))) - (else - (ja-no-eval :group! sculptor-strikestart-ja :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! sculptor-huge-to-looking-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))) - (ja-no-eval :group! sculptor-strikemiddle-ja :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! sculptor-looking-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))) - (ja-no-eval :group! sculptor-strikeend-ja :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! sculptor-from-looking-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (ja :num! (seek!))))))))) + (ja :num! (seek!)))))) + ((begin + (process-taskable-method-43 self) + (let* ((f30-3 4.0) + (v1-287 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-288 (the-as number (logior #x3f800000 v1-287)))) + (countdown (gp-3 (+ (the int (* f30-3 (+ -1.0 (the-as float v1-288)))) 4)) + (ja-no-eval :group! sculptor-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))))) + (< (rand-float-gen) 0.5)) + (ja-no-eval :group! sculptor-sigh-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)))) + (else + (ja-no-eval :group! sculptor-strikestart-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))) + (ja-no-eval :group! sculptor-strikemiddle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))) + (ja-no-eval :group! sculptor-strikeend-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))))))))) (defmethod init-from-entity! ((this sculptor) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *sculptor-sg* 3 40 (new 'static 'vector :w 4096.0) 5) diff --git a/goal_src/jak1/levels/beach/seagull.gc b/goal_src/jak1/levels/beach/seagull.gc index af49925a64..b23dddc56e 100644 --- a/goal_src/jak1/levels/beach/seagull.gc +++ b/goal_src/jak1/levels/beach/seagull.gc @@ -305,57 +305,58 @@ (update-transforms! (-> self root)) (clear-collide-with-as (-> self root)) (ja :group! seagull-idle-ja :num! (identity (ja-aframe 0.0 0))) - (loop (let* ((f30-0 4.0) - (v1-14 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-15 (the-as number (logior #x3f800000 v1-14))) - (gp-1 (the int (* f30-0 (+ -1.0 (the-as float v1-15)))))) - (let* ((f30-1 60.0) - (v1-18 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-19 (the-as number (logior #x3f800000 v1-18))) - (s5-0 (the int (* f30-1 (+ -1.0 (the-as float v1-19)))))) - (dotimes (s4-0 s5-0) - (suspend))) - (cond - ((zero? gp-1) - (ja-no-eval :group! seagull-idle-ja :num! (seek! (ja-aframe 4.0 0)) :frame-num (ja-aframe 0.0 0)) - (until (ja-done? 0) - (suspend) - (ja :num! (seek! (ja-aframe 4.0 0)))) - (let* ((f30-2 60.0) - (v1-37 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-38 (the-as number (logior #x3f800000 v1-37))) - (gp-4 (the int (* f30-2 (+ -1.0 (the-as float v1-38)))))) - (dotimes (s5-1 gp-4) - (suspend))) - (ja-no-eval :group! seagull-idle-ja :num! (seek! (ja-aframe 10.0 0)) :frame-num (ja-aframe 4.0 0)) - (until (ja-done? 0) - (suspend) - (ja :num! (seek! (ja-aframe 10.0 0)))) - (let* ((f30-3 60.0) - (v1-55 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-56 (the-as number (logior #x3f800000 v1-55))) - (gp-7 (the int (* f30-3 (+ -1.0 (the-as float v1-56)))))) - (dotimes (s5-2 gp-7) - (suspend))) - (ja-no-eval :group! seagull-idle-ja :num! (seek! (ja-aframe 14.0 0)) :frame-num (ja-aframe 10.0 0)) - (until (ja-done? 0) - (suspend) - (ja :num! (seek! (ja-aframe 14.0 0))))) - ((= gp-1 2) - (ja-no-eval :group! seagull-peck-ja :num! (seek! (ja-aframe 4.0 0)) :frame-num (ja-aframe 0.0 0)) - (until (ja-done? 0) - (suspend) - (ja :num! (seek! (ja-aframe 4.0 0))))) - ((= gp-1 3) - (ja-no-eval :group! seagull-peck-ja :num! (seek! (ja-aframe 8.0 0)) :frame-num (ja-aframe 4.0 0)) - (until (ja-done? 0) - (suspend) - (ja :num! (seek! (ja-aframe 8.0 0))))) - ((= gp-1 4) - (ja-no-eval :group! seagull-peck-ja :num! (seek! (ja-aframe 12.0 0)) :frame-num (ja-aframe 8.0 0)) - (until (ja-done? 0) - (suspend) - (ja :num! (seek! (ja-aframe 12.0 0))))))))) + (loop + (let* ((f30-0 4.0) + (v1-14 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-15 (the-as number (logior #x3f800000 v1-14))) + (gp-1 (the int (* f30-0 (+ -1.0 (the-as float v1-15)))))) + (let* ((f30-1 60.0) + (v1-18 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-19 (the-as number (logior #x3f800000 v1-18))) + (s5-0 (the int (* f30-1 (+ -1.0 (the-as float v1-19)))))) + (dotimes (s4-0 s5-0) + (suspend))) + (cond + ((zero? gp-1) + (ja-no-eval :group! seagull-idle-ja :num! (seek! (ja-aframe 4.0 0)) :frame-num (ja-aframe 0.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 4.0 0)))) + (let* ((f30-2 60.0) + (v1-37 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-38 (the-as number (logior #x3f800000 v1-37))) + (gp-4 (the int (* f30-2 (+ -1.0 (the-as float v1-38)))))) + (dotimes (s5-1 gp-4) + (suspend))) + (ja-no-eval :group! seagull-idle-ja :num! (seek! (ja-aframe 10.0 0)) :frame-num (ja-aframe 4.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 10.0 0)))) + (let* ((f30-3 60.0) + (v1-55 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-56 (the-as number (logior #x3f800000 v1-55))) + (gp-7 (the int (* f30-3 (+ -1.0 (the-as float v1-56)))))) + (dotimes (s5-2 gp-7) + (suspend))) + (ja-no-eval :group! seagull-idle-ja :num! (seek! (ja-aframe 14.0 0)) :frame-num (ja-aframe 10.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 14.0 0))))) + ((= gp-1 2) + (ja-no-eval :group! seagull-peck-ja :num! (seek! (ja-aframe 4.0 0)) :frame-num (ja-aframe 0.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 4.0 0))))) + ((= gp-1 3) + (ja-no-eval :group! seagull-peck-ja :num! (seek! (ja-aframe 8.0 0)) :frame-num (ja-aframe 4.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 8.0 0))))) + ((= gp-1 4) + (ja-no-eval :group! seagull-peck-ja :num! (seek! (ja-aframe 12.0 0)) :frame-num (ja-aframe 8.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 12.0 0))))))))) :post seagull-post) (defmethod move-vertically! ((this seagull) (arg0 symbol)) @@ -480,7 +481,8 @@ (behavior () (set! (-> self max-tilt) 1820.4445) (let ((gp-0 0)) - (loop (ja-no-eval :group! seagull-fly-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! seagull-fly-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (when (-> self teleport) @@ -586,7 +588,8 @@ (behavior () (set-time! (-> self state-time)) (set! (-> self max-tilt) 4551.1113) - (loop (ja-no-eval :group! seagull-slowfly-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! seagull-slowfly-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) (when (-> self teleport) @@ -866,7 +869,8 @@ (defstate seagullflock-idle (seagullflock) :code (behavior () - (loop (if (> (-> self teleport-frames) 0) (go seagullflock-at-waterfall)) + (loop + (if (> (-> self teleport-frames) 0) (go seagullflock-at-waterfall)) (if (and *target* (>= 102400.0 (vector-vector-distance (-> self trans) (-> *target* control trans)))) (level-hint-spawn (text-id zero) (the-as string #f) (-> self entity) *entity-pool* (game-task none))) (suspend)))) diff --git a/goal_src/jak1/levels/citadel/assistant-citadel.gc b/goal_src/jak1/levels/citadel/assistant-citadel.gc index 75e868ab5e..eeeeec41c2 100644 --- a/goal_src/jak1/levels/citadel/assistant-citadel.gc +++ b/goal_src/jak1/levels/citadel/assistant-citadel.gc @@ -73,9 +73,10 @@ (((task-status need-reward-speech)) (send-event self 'play-anim)))) :code (behavior () - (loop (when (!= (ja-group) (get-art-elem self)) - (ja-channel-push! 1 (seconds 0.05)) - (ja :group! assistant-lavatube-end-idle-ja)) + (loop + (when (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! assistant-lavatube-end-idle-ja)) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) diff --git a/goal_src/jak1/levels/citadel/citadel-obs.gc b/goal_src/jak1/levels/citadel/citadel-obs.gc index b0eba90b42..c451e308fc 100644 --- a/goal_src/jak1/levels/citadel/citadel-obs.gc +++ b/goal_src/jak1/levels/citadel/citadel-obs.gc @@ -78,9 +78,10 @@ (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector))) - (loop (cond - ((< (- (-> (target-pos 0) y) (-> self root trans y)) -122880.0) (set! (-> self draw force-lod) 1)) - (else (set! (-> self draw force-lod) 0) 0)) + (loop + (cond + ((< (- (-> (target-pos 0) y) (-> self root trans y)) -122880.0) (set! (-> self draw force-lod) 1)) + (else (set! (-> self draw force-lod) 0) 0)) (set! (-> self y-angle) (* 65536.0 (get-current-phase (-> self sync)) (-> self rot-scale))) (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (-> self y-angle)) (vector-orient-by-quat! gp-0 (-> self cull-dir-local) (-> self root quat)) @@ -274,7 +275,8 @@ :trans rider-trans :code (behavior () - (loop (update! (-> self sound)) + (loop + (update! (-> self sound)) (quaternion-axis-angle! (-> self root quat) 0.0 1.0 @@ -600,10 +602,11 @@ (send-event (ppointer->process gp-7) 'art-joint-anim "citb-robotboss-belly-idle" 0) (send-event (ppointer->process gp-7) 'draw #t)) (update-transforms! (-> self root)) - (loop (when (-> self shield-on) - (update! (-> self sound)) - (spawn (-> self part) (-> self root trans)) - (set! (-> *palette-fade-controls* control 7 fade) 1.0)) + (loop + (when (-> self shield-on) + (update! (-> self sound)) + (spawn (-> self part) (-> self root trans)) + (set! (-> *palette-fade-controls* control 7 fade) 1.0)) (suspend))) :post ja-post) @@ -667,7 +670,8 @@ (('trigger) (go citb-coil-break)))) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -695,7 +699,8 @@ (until (ja-done? 0) (suspend) (ja :num! (seek!))) - (loop (spawn (-> self part-off) (-> self root trans)) + (loop + (spawn (-> self part-off) (-> self root trans)) (suspend))) :post ja-post) @@ -732,7 +737,8 @@ :event citb-hose-event-handler :code (behavior () - (loop (ja-no-eval :group! citb-hose-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! citb-hose-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -868,7 +874,8 @@ (behavior () (lods-assign! (-> self draw) (-> self normal-look)) (update-transforms! (-> self root)) - (loop (spawn (-> self part) (-> self root trans)) + (loop + (spawn (-> self part) (-> self root trans)) (update! (-> self sound)) (if (-> self mushroom) (spawn (-> self part-mushroom) (-> self mushroom-pos))) (if (not (-> self mushroom)) (+! (-> *palette-fade-controls* control 3 fade) 0.3333)) diff --git a/goal_src/jak1/levels/citadel/citadel-sages.gc b/goal_src/jak1/levels/citadel/citadel-sages.gc index 60d72f0a61..9f83963183 100644 --- a/goal_src/jak1/levels/citadel/citadel-sages.gc +++ b/goal_src/jak1/levels/citadel/citadel-sages.gc @@ -80,13 +80,14 @@ :trans rider-trans :code (behavior () - (loop (cond - ((-> self cloning) - (let ((gp-0 (ppointer->process (-> self parent-override)))) - (when gp-0 - (joint-control-copy! (-> self skel) (-> (the-as citb-sage gp-0) skel)) - (joint-control-remap! (-> self skel) (-> self draw art-group) (-> (the-as citb-sage gp-0) draw art-group) () 0 "")))) - (else (ja :num! (loop!)))) + (loop + (cond + ((-> self cloning) + (let ((gp-0 (ppointer->process (-> self parent-override)))) + (when gp-0 + (joint-control-copy! (-> self skel) (-> (the-as citb-sage gp-0) skel)) + (joint-control-remap! (-> self skel) (-> self draw art-group) (-> (the-as citb-sage gp-0) draw art-group) () 0 "")))) + (else (ja :num! (loop!)))) (suspend))) :post (behavior () diff --git a/goal_src/jak1/levels/citadel/citb-drop-plat.gc b/goal_src/jak1/levels/citadel/citb-drop-plat.gc index 196d941467..33f9dec804 100644 --- a/goal_src/jak1/levels/citadel/citb-drop-plat.gc +++ b/goal_src/jak1/levels/citadel/citb-drop-plat.gc @@ -78,7 +78,8 @@ (update-transforms! (-> self root)) (set-time! (-> self state-time)) (logior! (-> self mask) (process-mask actor-pause)) - (loop (if (time-elapsed? (-> self state-time) (-> self duration)) (go drop-plat-drop)) + (loop + (if (time-elapsed? (-> self state-time) (-> self duration)) (go drop-plat-drop)) (suspend))) :post ja-post) @@ -101,11 +102,12 @@ (logior! (-> self draw status) (draw-status hidden)) (ja-post) (set-time! (-> self state-time)) - (loop (when (time-elapsed? (-> self state-time) (-> self delay)) - (let ((v1-14 (logclear (-> self draw status) (draw-status hidden))) - (a0-5 (-> self draw))) - (set! (-> a0-5 status) v1-14) - (go drop-plat-rise a0-5))) + (loop + (when (time-elapsed? (-> self state-time) (-> self delay)) + (let ((v1-14 (logclear (-> self draw status) (draw-status hidden))) + (a0-5 (-> self draw))) + (set! (-> a0-5 status) v1-14) + (go drop-plat-rise a0-5))) (suspend)))) (defstate drop-plat-rise (drop-plat) @@ -123,8 +125,9 @@ (s5-0 #f)) (set! (-> gp-0 quad) (-> self root trans quad)) (set! (-> gp-0 y) (-> (the-as process-drawable (-> self parent 0)) root trans y)) - (loop (let ((f0-6 (fmax 0.0 (- 1.0 (* 0.0033333334 (the float (- (current-time) (-> self state-time)))))))) - (set! (-> self interp) (* f0-6 f0-6))) + (loop + (let ((f0-6 (fmax 0.0 (- 1.0 (* 0.0033333334 (the float (- (current-time) (-> self state-time)))))))) + (set! (-> self interp) (* f0-6 f0-6))) (set! (-> self root trans y) (- (-> (the-as process-drawable (-> self parent 0)) root trans y) (* 204800.0 (-> self interp)))) (when (and (not s5-0) (< (-> self interp) 0.05)) @@ -152,7 +155,8 @@ (set! (-> self interp) (/ (the float (- (current-time) (-> self state-time))) (the float gp-1))) (set! (-> self spin-angle) (* 910.2222 (sin (* 196608.0 (-> self interp))))) (suspend)))) - (loop (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) + (loop + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) (vector-v++! (-> self root trans) (-> self root transv)) (if (< 204800.0 (- (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root trans y))) (go drop-plat-die)) @@ -318,7 +322,8 @@ :code (behavior () (citb-drop-plat-drop-all-children) - (loop (suspend)))) + (loop + (suspend)))) (defstate citb-drop-plat-active (citb-drop-plat) :event @@ -333,11 +338,12 @@ (behavior () (set-time! (-> self state-time)) (citb-drop-plat-spawn-children) - (loop (if (or (time-elapsed? (-> self state-time) (+ (-> self duration) (seconds 2))) - (or (not *target*) - (< (-> self idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (not (-> self child))) - (go citb-drop-plat-idle)) + (loop + (if (or (time-elapsed? (-> self state-time) (+ (-> self duration) (seconds 2))) + (or (not *target*) + (< (-> self idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (not (-> self child))) + (go citb-drop-plat-idle)) (suspend)))) (defmethod init-from-entity! ((this citb-drop-plat) (arg0 entity-actor)) diff --git a/goal_src/jak1/levels/citadel/citb-plat.gc b/goal_src/jak1/levels/citadel/citb-plat.gc index a7e30382cd..19d37a2af1 100644 --- a/goal_src/jak1/levels/citadel/citb-plat.gc +++ b/goal_src/jak1/levels/citadel/citb-plat.gc @@ -229,11 +229,12 @@ (ja-post) (suspend)) (set-time! (-> self state-time)) - (loop (let ((f30-0 (- 1.0 (* 0.0011111111 (the float (- (current-time) (-> self state-time))))))) - (when (< f30-0 0.0) - (set! (-> self root trans y) (-> self rise-height)) - (go-virtual citb-base-plat-active)) - (set! (-> self root trans y) (lerp (-> self rise-height) (-> self idle-height) (* f30-0 f30-0)))) + (loop + (let ((f30-0 (- 1.0 (* 0.0011111111 (the float (- (current-time) (-> self state-time))))))) + (when (< f30-0 0.0) + (set! (-> self root trans y) (-> self rise-height)) + (go-virtual citb-base-plat-active)) + (set! (-> self root trans y) (lerp (-> self rise-height) (-> self idle-height) (* f30-0 f30-0)))) (let ((f0-12 (fmax 0.0 (fmin 1.0 (* 0.000012207031 (+ 409600.0 (-> self root trans y))))))) (set! (-> self draw color-mult x) f0-12) (set! (-> self draw color-mult y) f0-12) @@ -465,7 +466,8 @@ :trans rider-trans :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))) @@ -617,7 +619,8 @@ (go citb-firehose-active))) :code (behavior () - (loop (suspend))) + (loop + (suspend))) :post ja-post) (defstate citb-firehose-active (citb-firehose) @@ -632,7 +635,8 @@ (if (< f0-2 f1-1) (go citb-firehose-blast)))) :code (behavior () - (loop (suspend))) + (loop + (suspend))) :post ja-post) (defbehavior citb-firehose-blast-particles citb-firehose () @@ -745,7 +749,8 @@ (behavior () (logior! (-> self draw status) (draw-status hidden)) (clear-collide-with-as (-> self root)) - (loop (suspend)))) + (loop + (suspend)))) (defstate citb-exit-plat-rise (citb-exit-plat) :trans rider-trans @@ -754,11 +759,12 @@ (logclear! (-> self draw status) (draw-status hidden)) (restore-collide-with-as (-> self root)) (set-time! (-> self state-time)) - (loop (let ((f30-0 (- 1.0 (* 0.0016666667 (the float (- (current-time) (-> self state-time))))))) - (when (< f30-0 0.0) - (set! (-> self root trans y) (-> self rise-height)) - (go-virtual plat-button-idle)) - (set! (-> self root trans y) (lerp (-> self rise-height) (-> self idle-height) (* f30-0 f30-0)))) + (loop + (let ((f30-0 (- 1.0 (* 0.0016666667 (the float (- (current-time) (-> self state-time))))))) + (when (< f30-0 0.0) + (set! (-> self root trans y) (-> self rise-height)) + (go-virtual plat-button-idle)) + (set! (-> self root trans y) (lerp (-> self rise-height) (-> self idle-height) (* f30-0 f30-0)))) (suspend))) :post rider-post) diff --git a/goal_src/jak1/levels/common/battlecontroller.gc b/goal_src/jak1/levels/common/battlecontroller.gc index 0fa53378ce..591fd3d9cd 100644 --- a/goal_src/jak1/levels/common/battlecontroller.gc +++ b/goal_src/jak1/levels/common/battlecontroller.gc @@ -249,17 +249,18 @@ battlecontroller-default-event-handler (behavior () (set-time! (-> self state-time)) (if (-> self prespawn) (battlecontroller-fill-all-spawners)) - (loop (when (time-elapsed? (-> self state-time) (seconds 0.1)) - (set-time! (-> self state-time)) - (when (and *target* - (>= (-> self activate-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (set! (-> self noticed-player) #t) - (battlecontroller-battle-begin) - (when (not (-> self prespawn)) - (battlecontroller-fill-all-spawners) - (suspend) - 0) - (go-virtual battlecontroller-play-intro-camera))) + (loop + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (set-time! (-> self state-time)) + (when (and *target* + (>= (-> self activate-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (set! (-> self noticed-player) #t) + (battlecontroller-battle-begin) + (when (not (-> self prespawn)) + (battlecontroller-fill-all-spawners) + (suspend) + 0) + (go-virtual battlecontroller-play-intro-camera))) (suspend))) :post #f) @@ -297,14 +298,15 @@ battlecontroller-default-event-handler (behavior () (set-time! (-> self state-time)) (battlecontroller-camera-on) - (loop (when (time-elapsed? (-> self state-time) (seconds 0.1)) - (set-time! (-> self state-time)) - (let ((gp-0 0)) - (let ((v1-8 (-> self child))) (while v1-8 (+! gp-0 1) (set! v1-8 (-> v1-8 0 brother)) (nop!) (nop!))) - (if (and (zero? gp-0) (= (-> self spawn-count) (-> self max-spawn-count))) (go-virtual battlecontroller-die)) - (when (< gp-0 (-> self target-count)) - (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (-> self spawn-period)) (suspend))) - (battlecontroller-spawn-creature-random-spawner)))) + (loop + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (set-time! (-> self state-time)) + (let ((gp-0 0)) + (let ((v1-8 (-> self child))) (while v1-8 (+! gp-0 1) (set! v1-8 (-> v1-8 0 brother)) (nop!) (nop!))) + (if (and (zero? gp-0) (= (-> self spawn-count) (-> self max-spawn-count))) (go-virtual battlecontroller-die)) + (when (< gp-0 (-> self target-count)) + (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (-> self spawn-period)) (suspend))) + (battlecontroller-spawn-creature-random-spawner)))) (suspend))) :post #f) diff --git a/goal_src/jak1/levels/common/blocking-plane.gc b/goal_src/jak1/levels/common/blocking-plane.gc index 4cfccc219b..9692d3f6e0 100644 --- a/goal_src/jak1/levels/common/blocking-plane.gc +++ b/goal_src/jak1/levels/common/blocking-plane.gc @@ -25,7 +25,8 @@ :code (behavior () (transform-post) - (loop (logior! (-> self mask) (process-mask sleep)) + (loop + (logior! (-> self mask) (process-mask sleep)) (suspend)))) (defbehavior blocking-plane-init-by-other blocking-plane ((arg0 curve-control) (arg1 int)) diff --git a/goal_src/jak1/levels/common/launcherdoor.gc b/goal_src/jak1/levels/common/launcherdoor.gc index 9eeb79f770..83cfcba26d 100644 --- a/goal_src/jak1/levels/common/launcherdoor.gc +++ b/goal_src/jak1/levels/common/launcherdoor.gc @@ -46,10 +46,11 @@ (ja :num-func num-func-identity :frame-num 0.0) (set! (-> self draw force-lod) 1)) (suspend) - (loop (if (and *target* - (= (-> *target* control unknown-surface00 name) 'launch-jump) - (< (-> *target* control trans y) (-> self thresh-y))) - (go launcherdoor-open #f)) + (loop + (if (and *target* + (= (-> *target* control unknown-surface00 name) 'launch-jump) + (< (-> *target* control trans y) (-> self thresh-y))) + (go launcherdoor-open #f)) (ja :num! (seek! 0.0 (-> self close-speed))) (suspend) (when (ja-done? 0) @@ -73,15 +74,16 @@ (clear-collide-with-as (-> self root)) (ja-no-eval :num! (seek!)) (if arg0 (ja :num-func num-func-identity :frame-num max)) - (loop (when (or (not *target*) - (!= (-> *target* control unknown-surface00 name) 'launch-jump) - (< (+ 4096.0 (-> self root trans y)) (-> *target* control trans y))) - (when (and *target* (< (-> self thresh-y) (-> *target* control trans y))) - (let ((a1-3 (res-lump-struct (-> self entity) 'continue-name structure))) - (when a1-3 - (let ((v1-36 (set-continue! *game-info* (the-as basic a1-3)))) (load-commands-set! *level* (-> v1-36 load-commands))))) - (set! (-> self notify-player-passed-thru?) #t)) - (go launcherdoor-closed #f)) + (loop + (when (or (not *target*) + (!= (-> *target* control unknown-surface00 name) 'launch-jump) + (< (+ 4096.0 (-> self root trans y)) (-> *target* control trans y))) + (when (and *target* (< (-> self thresh-y) (-> *target* control trans y))) + (let ((a1-3 (res-lump-struct (-> self entity) 'continue-name structure))) + (when a1-3 + (let ((v1-36 (set-continue! *game-info* (the-as basic a1-3)))) (load-commands-set! *level* (-> v1-36 load-commands))))) + (set! (-> self notify-player-passed-thru?) #t)) + (go launcherdoor-closed #f)) (ja :num! (seek! max (-> self open-speed))) (suspend))) :post ja-post) diff --git a/goal_src/jak1/levels/demo/demo-obs.gc b/goal_src/jak1/levels/demo/demo-obs.gc index 7531c3d3b6..ff068616d6 100644 --- a/goal_src/jak1/levels/demo/demo-obs.gc +++ b/goal_src/jak1/levels/demo/demo-obs.gc @@ -198,5 +198,6 @@ (lambda () (set! (-> *setting-control* default bg-a) 0.0) (start 'play (get-continue-by-name *game-info* "village1-demo-convo")))) - (loop (suspend))) + (loop + (suspend))) :post target-no-move-post) diff --git a/goal_src/jak1/levels/finalboss/final-door.gc b/goal_src/jak1/levels/finalboss/final-door.gc index 4d7547261a..32112747d1 100644 --- a/goal_src/jak1/levels/finalboss/final-door.gc +++ b/goal_src/jak1/levels/finalboss/final-door.gc @@ -122,17 +122,18 @@ :code (behavior () (ja-post) - (loop (if (and (and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (and (not (logtest? (-> *target* state-flags) (state-flags grabbed))) - (and (>= (-> *game-info* fuel) 100.0) - (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) - (= (get-task-status (game-task finalboss-movies)) (task-status need-reward-speech)) - (send-event *target* - 'change-mode - 'final-door - (search-process-tree *active-pool* (lambda ((arg0 final-door)) (= (-> arg0 type) power-right))) - (search-process-tree *active-pool* (lambda ((arg0 final-door)) (= (-> arg0 type) power-left))))))) - (process-entity-status! self (entity-perm-status complete) #t)) + (loop + (if (and (and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (and (not (logtest? (-> *target* state-flags) (state-flags grabbed))) + (and (>= (-> *game-info* fuel) 100.0) + (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) + (= (get-task-status (game-task finalboss-movies)) (task-status need-reward-speech)) + (send-event *target* + 'change-mode + 'final-door + (search-process-tree *active-pool* (lambda ((arg0 final-door)) (= (-> arg0 type) power-right))) + (search-process-tree *active-pool* (lambda ((arg0 final-door)) (= (-> arg0 type) power-left))))))) + (process-entity-status! self (entity-perm-status complete) #t)) (suspend)))) (defmethod final-door-method-21 ((this power-left)) @@ -191,7 +192,8 @@ :virtual #t :code (behavior () - (loop (vector<-cspace! (-> self root trans) (-> (the-as process-drawable (-> self parent 0)) node-list data (-> self index))) + (loop + (vector<-cspace! (-> self root trans) (-> (the-as process-drawable (-> self parent 0)) node-list data (-> self index))) (transform-post) (suspend)))) diff --git a/goal_src/jak1/levels/finalboss/green-eco-lurker.gc b/goal_src/jak1/levels/finalboss/green-eco-lurker.gc index 42571ff1f0..259063e029 100644 --- a/goal_src/jak1/levels/finalboss/green-eco-lurker.gc +++ b/goal_src/jak1/levels/finalboss/green-eco-lurker.gc @@ -349,7 +349,8 @@ (if (nav-enemy-method-52 self (-> self appear-dest)) (go green-eco-lurker-appear))) :code (behavior () - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defmethod nav-enemy-method-53 ((this green-eco-lurker)) @@ -416,7 +417,8 @@ (until (ja-done? 0) (suspend) (ja :num! (seek!))))) - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend))) :post transform-post) @@ -469,7 +471,8 @@ (ja-channel-push! 1 (seconds 0.2)) (ja :group! (-> self draw art-group data (-> self nav-info run-anim))) (ja :num-func num-func-identity :frame-num 0.0))) - (loop (suspend) + (loop + (suspend) (ja :num! (loop! f30-0)))))) (defstate nav-enemy-jump-land (green-eco-lurker) diff --git a/goal_src/jak1/levels/finalboss/light-eco.gc b/goal_src/jak1/levels/finalboss/light-eco.gc index bdfe610c68..a8fbd7b5e8 100644 --- a/goal_src/jak1/levels/finalboss/light-eco.gc +++ b/goal_src/jak1/levels/finalboss/light-eco.gc @@ -349,7 +349,8 @@ (common-trans self)) :code (behavior () - (loop (suspend) + (loop + (suspend) (ja :num! (loop!)))) :post transform-post) @@ -380,7 +381,8 @@ (common-trans self)) :code (behavior () - (loop (suspend) + (loop + (suspend) (ja :num! (loop!)))) :post transform-post) @@ -395,7 +397,8 @@ (common-trans self)) :code (behavior () - (loop (suspend) + (loop + (suspend) (ja :num! (loop!)))) :post transform-post) @@ -542,7 +545,8 @@ 0) :code (behavior () - (loop (suspend) + (loop + (suspend) (ja :num! (loop!)))) :post ja-post) diff --git a/goal_src/jak1/levels/finalboss/robotboss-misc.gc b/goal_src/jak1/levels/finalboss/robotboss-misc.gc index c7f763cea7..3b23ac04a9 100644 --- a/goal_src/jak1/levels/finalboss/robotboss-misc.gc +++ b/goal_src/jak1/levels/finalboss/robotboss-misc.gc @@ -49,22 +49,23 @@ (cam-slave-go cam-free-floating))) :code (behavior () - (loop (when #t - (let ((a2-0 (new-stack-vector0))) - (vector-! a2-0 (-> *camera* tpos-curr-adj) (-> self pivot-pt)) - (vector-! (-> self circular-follow) (-> self circular-follow) (-> self pivot-pt)) - (v-slrp3! (-> self circular-follow) - (-> self circular-follow) - a2-0 - (-> *camera* local-down) - (* 182.04445 (-> *display* time-adjust-ratio)))) - (vector+! (-> self circular-follow) (-> self circular-follow) (-> self pivot-pt)) - (let ((gp-0 (new 'stack-no-clear 'vector))) - (vector-! gp-0 (-> self circular-follow) (-> self pivot-pt)) - (vector-flatten! gp-0 gp-0 (-> *camera* local-down)) - (let ((f0-3 (- (vector-length gp-0) (-> self pivot-rad)))) - (if (>= 0.0 f0-3) (vector-reset! gp-0) (vector-normalize! gp-0 f0-3))) - (vector+! (-> self trans) gp-0 (-> self pivot-pt)))) + (loop + (when #t + (let ((a2-0 (new-stack-vector0))) + (vector-! a2-0 (-> *camera* tpos-curr-adj) (-> self pivot-pt)) + (vector-! (-> self circular-follow) (-> self circular-follow) (-> self pivot-pt)) + (v-slrp3! (-> self circular-follow) + (-> self circular-follow) + a2-0 + (-> *camera* local-down) + (* 182.04445 (-> *display* time-adjust-ratio)))) + (vector+! (-> self circular-follow) (-> self circular-follow) (-> self pivot-pt)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (vector-! gp-0 (-> self circular-follow) (-> self pivot-pt)) + (vector-flatten! gp-0 gp-0 (-> *camera* local-down)) + (let ((f0-3 (- (vector-length gp-0) (-> self pivot-rad)))) + (if (>= 0.0 f0-3) (vector-reset! gp-0) (vector-normalize! gp-0 f0-3))) + (vector+! (-> self trans) gp-0 (-> self pivot-pt)))) (suspend)))) (deftype ecoclaw-part-info (structure) @@ -173,14 +174,16 @@ (until (ja-done? 0) (suspend) (ja :num! (seek!))) - (loop (suspend))) + (loop + (suspend))) :post ja-post) (defstate ecoclaw-idle (ecoclaw) :event ecoclaw-handler :code (behavior () - (loop (if (-> self particles 0 kind) (go ecoclaw-activate)) + (loop + (if (-> self particles 0 kind) (go ecoclaw-activate)) (suspend))) :post ja-post) @@ -218,12 +221,13 @@ :trans rider-trans :code (behavior () - (loop (when (not (movie?)) - (ja :num! (seek! (* (-> self part-opened) (the float (ja-num-frames 0))) 0.01)) - (cond - ((< 0.01 (fabs (- (* (-> self part-opened) (the float (ja-num-frames 0))) (ja-aframe-num 0)))) - (if (nonzero? (-> self sound)) (update! (-> self sound)))) - ((nonzero? (-> self sound)) (stop! (-> self sound))))) + (loop + (when (not (movie?)) + (ja :num! (seek! (* (-> self part-opened) (the float (ja-num-frames 0))) 0.01)) + (cond + ((< 0.01 (fabs (- (* (-> self part-opened) (the float (ja-num-frames 0))) (ja-aframe-num 0)))) + (if (nonzero? (-> self sound)) (update! (-> self sound)))) + ((nonzero? (-> self sound)) (stop! (-> self sound))))) (suspend))) :post (behavior () diff --git a/goal_src/jak1/levels/finalboss/robotboss-weapon.gc b/goal_src/jak1/levels/finalboss/robotboss-weapon.gc index e3de73d113..16dcaba8de 100644 --- a/goal_src/jak1/levels/finalboss/robotboss-weapon.gc +++ b/goal_src/jak1/levels/finalboss/robotboss-weapon.gc @@ -150,7 +150,8 @@ (arcing-shot-draw)) :code (behavior () - (loop (format *stdcon* "debug trajectory~%") + (loop + (format *stdcon* "debug trajectory~%") (suspend)))) (deftype darkecobomb (arcing-shot) @@ -259,7 +260,8 @@ (until (ja-done? 0) (suspend) (ja :num! (seek!))) - (loop (ja-no-eval :group! darkecobomb-spin-cycle-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) + (loop + (ja-no-eval :group! darkecobomb-spin-cycle-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) (until (ja-done? 0) (update! (-> self sound)) (suspend) @@ -282,7 +284,8 @@ (while (not (ja-done? 0)) (suspend) (ja-eval)) - (loop (ja-no-eval :group! darkecobomb-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! darkecobomb-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -303,7 +306,8 @@ (until (ja-done? 0) (suspend) (ja :num! (seek!))) - (loop (ja-no-eval :group! darkecobomb-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! darkecobomb-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -360,7 +364,8 @@ (spawn (-> self part) (-> self root trans))) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -478,7 +483,8 @@ (deactivate self))) :code (behavior () - (loop (ja :num-func num-func-identity :frame-num (* 0.000016276043 (-> self ring radius-primary))) + (loop + (ja :num-func num-func-identity :frame-num (* 0.000016276043 (-> self ring radius-primary))) (suspend))) :post transform-post) @@ -498,7 +504,8 @@ (spawn (-> self shot-particle) (-> self root trans))) :code (behavior () - (loop (suspend))) + (loop + (suspend))) :post transform-post) (defstate redshot-idle (redshot) @@ -515,7 +522,8 @@ (spawn (-> self shot-particle) (-> self root trans))) :code (behavior () - (loop (suspend))) + (loop + (suspend))) :post transform-post) (defbehavior redshot-init-by-other redshot ((arg0 vector) (arg1 vector) (arg2 float) (arg3 time-frame) (arg4 time-frame) (arg5 int)) @@ -576,7 +584,8 @@ (deactivate self))) :code (behavior () - (loop (suspend))) + (loop + (suspend))) :post transform-post) (defbehavior yellowshot-init-by-other yellowshot ((arg0 vector) (arg1 vector) (arg2 float) (arg3 time-frame)) diff --git a/goal_src/jak1/levels/finalboss/robotboss.gc b/goal_src/jak1/levels/finalboss/robotboss.gc index db6ccdfd36..98dc72e4fa 100644 --- a/goal_src/jak1/levels/finalboss/robotboss.gc +++ b/goal_src/jak1/levels/finalboss/robotboss.gc @@ -203,7 +203,8 @@ (defbehavior robotboss-anim-blend-loop robotboss ((arg0 art-joint-anim)) (let ((s5-0 (ja-group))) (ja-channel-push! 2 0) (ja :group! arg0 :num! min) (ja :chan 1 :group! s5-0 :num! min)) - (loop (ja :num! (loop!)) + (loop + (ja :num! (loop!)) (ja :chan 1 :num! (chan 0) :frame-interp (- 1.0 (ease-loc-t self))) (suspend)) (none)) @@ -389,9 +390,10 @@ (set! (-> self des-cam-entity) "camera-365")) (suspend) (ja :num! (seek!))) - (loop (when (not (ja-group? robotboss-idle-hover-no-yellow-ja)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! robotboss-idle-hover-no-yellow-ja)) + (loop + (when (not (ja-group? robotboss-idle-hover-no-yellow-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-yellow-ja)) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -550,7 +552,8 @@ (when (not (ja-group? robotboss-idle-hover-no-yellow-ja)) (ja-channel-push! 1 (seconds 0.2)) (ja :group! robotboss-idle-hover-no-yellow-ja)) - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -674,33 +677,34 @@ (ja-eval)) (robotboss-setup-for-hits 8 (-> self dda yellow-gun-hits)) (if (nonzero? (-> self yellow-gun)) (set-mode! (-> self yellow-gun) (joint-mod-handler-mode look-at))) - (loop (when (not (robotboss-time-to-shoot-yellow)) - (when (not (ja-group? robotboss-yellow-idle-ja)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! robotboss-yellow-idle-ja)) - (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) - (ja :num-func num-func-identity :frame-num 15.0)) - (while (not (or (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) - (ja-group? robotboss-yellow-last-hit-ja))) - (when (not (ja-group? robotboss-yellow-idle-ja)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! robotboss-yellow-idle-ja)) - (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (if (robotboss-is-yellow-hit) (goto cfg-36)) - (suspend) - (ja :num! (seek!)))) - (label cfg-36) - (when (not (robotboss-is-yellow-hit)) - (when (not (ja-group? robotboss-yellow-idle-ja)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! robotboss-yellow-idle-ja)) - (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (if (robotboss-is-yellow-hit) (goto cfg-55)) - (if (< 15.0 (ja-aframe-num 0)) (set! (-> self keep-charging) #t)) - (suspend) - (ja :num! (seek!))))) + (loop + (when (not (robotboss-time-to-shoot-yellow)) + (when (not (ja-group? robotboss-yellow-idle-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-yellow-idle-ja)) + (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) + (ja :num-func num-func-identity :frame-num 15.0)) + (while (not (or (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) + (ja-group? robotboss-yellow-last-hit-ja))) + (when (not (ja-group? robotboss-yellow-idle-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-yellow-idle-ja)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (robotboss-is-yellow-hit) (goto cfg-36)) + (suspend) + (ja :num! (seek!)))) + (label cfg-36) + (when (not (robotboss-is-yellow-hit)) + (when (not (ja-group? robotboss-yellow-idle-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-yellow-idle-ja)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (robotboss-is-yellow-hit) (goto cfg-55)) + (if (< 15.0 (ja-aframe-num 0)) (set! (-> self keep-charging) #t)) + (suspend) + (ja :num! (seek!))))) (label cfg-55) (when (and (not (ja-group? robotboss-yellow-last-hit-ja)) (or (robotboss-time-to-shoot-yellow) (not (ja-group? robotboss-yellow-hit-ja)))) @@ -764,14 +768,15 @@ (until (ja-done? 0) (suspend) (ja :num! (seek!))) - (loop (cond - ((and *target* (< (+ 81920.0 (-> self entity extra trans y)) (-> (target-pos 0) y))) - (when (not (ja-group? robotboss-idle-hover-lookup-no-red-ja)) - (ja-channel-push! 1 (seconds 0.8)) - (ja :group! robotboss-idle-hover-lookup-no-red-ja))) - ((not (ja-group? robotboss-idle-hover-no-red-ja)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! robotboss-idle-hover-no-red-ja))) + (loop + (cond + ((and *target* (< (+ 81920.0 (-> self entity extra trans y)) (-> (target-pos 0) y))) + (when (not (ja-group? robotboss-idle-hover-lookup-no-red-ja)) + (ja-channel-push! 1 (seconds 0.8)) + (ja :group! robotboss-idle-hover-lookup-no-red-ja))) + ((not (ja-group? robotboss-idle-hover-no-red-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-red-ja))) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -810,9 +815,10 @@ (set! (-> self des-cam-entity) "camera-365")) (suspend) (ja :num! (seek!))) - (loop (when (not (ja-group? robotboss-idle-hover-no-red-ja)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! robotboss-idle-hover-no-red-ja)) + (loop + (when (not (ja-group? robotboss-idle-hover-no-red-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-red-ja)) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -844,7 +850,8 @@ (when (not (ja-group? robotboss-idle-hover-no-red-ja)) (ja-channel-push! 1 (seconds 0.2)) (ja :group! robotboss-idle-hover-no-red-ja)) - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -1034,15 +1041,16 @@ (suspend) (ja-eval)) (robotboss-setup-for-hits 1 5) - (loop (until (or (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) - (ja-group? robotboss-red-last-hit-ja)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! robotboss-red-idle-ja) - (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (if (ja-group? robotboss-red-last-hit-ja) (goto cfg-24)) - (suspend) - (ja :num! (seek!)))) + (loop + (until (or (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) + (ja-group? robotboss-red-last-hit-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-red-idle-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (ja-group? robotboss-red-last-hit-ja) (goto cfg-24)) + (suspend) + (ja :num! (seek!)))) (label cfg-24) (set! (-> self state-time) (-> *display* game-frame-counter)) (let ((f30-0 (-> self dda red-shot-time-min)) @@ -1123,9 +1131,10 @@ (until (ja-done? 0) (suspend) (ja :num! (seek!))) - (loop (when (not (ja-group? robotboss-idle-hover-no-blue-ja)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! robotboss-idle-hover-no-blue-ja)) + (loop + (when (not (ja-group? robotboss-idle-hover-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-blue-ja)) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1164,9 +1173,10 @@ (play-ambient (-> self ambient) "GOL-AM11" #t (the-as vector #f))) (suspend) (ja :num! (seek!))) - (loop (when (not (ja-group? robotboss-idle-hover-no-blue-ja)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! robotboss-idle-hover-no-blue-ja)) + (loop + (when (not (ja-group? robotboss-idle-hover-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-blue-ja)) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1199,7 +1209,8 @@ (when (not (ja-group? robotboss-idle-hover-no-blue-ja)) (ja-channel-push! 1 (seconds 0.2)) (ja :group! robotboss-idle-hover-no-blue-ja)) - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -1332,11 +1343,12 @@ (while (not (ja-done? 0)) (suspend) (ja-eval)) - (loop (cond - ((ja-group? robotboss-green-roar-ja) (go robotboss-green-dark-bomb)) - ((not (ja-group? robotboss-idle-hover-no-blue-ja)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! robotboss-idle-hover-no-blue-ja))) + (loop + (cond + ((ja-group? robotboss-green-roar-ja) (go robotboss-green-dark-bomb)) + ((not (ja-group? robotboss-idle-hover-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-blue-ja))) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1372,9 +1384,10 @@ (until (ja-done? 0) (suspend) (ja :num! (seek!))) - (loop (when (not (ja-group? robotboss-idle-hover-no-blue-ja)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! robotboss-idle-hover-no-blue-ja)) + (loop + (when (not (ja-group? robotboss-idle-hover-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-blue-ja)) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1413,14 +1426,15 @@ (play-ambient (-> self ambient) "MAI-AM04" #t (the-as vector #f))) (suspend) (ja :num! (seek!))) - (loop (cond - ((and *target* (< (+ 81920.0 (-> self entity extra trans y)) (-> (target-pos 0) y))) - (when (not (ja-group? robotboss-idle-hover-lookup-no-blue-ja)) - (ja-channel-push! 1 (seconds 0.8)) - (ja :group! robotboss-idle-hover-lookup-no-blue-ja))) - ((not (ja-group? robotboss-idle-hover-no-blue-ja)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! robotboss-idle-hover-no-blue-ja))) + (loop + (cond + ((and *target* (< (+ 81920.0 (-> self entity extra trans y)) (-> (target-pos 0) y))) + (when (not (ja-group? robotboss-idle-hover-lookup-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.8)) + (ja :group! robotboss-idle-hover-lookup-no-blue-ja))) + ((not (ja-group? robotboss-idle-hover-no-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-hover-no-blue-ja))) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1452,7 +1466,8 @@ (when (not (ja-group? robotboss-idle-hover-no-blue-ja)) (ja-channel-push! 1 (seconds 0.2)) (ja :group! robotboss-idle-hover-no-blue-ja)) - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -1674,9 +1689,10 @@ (until (ja-done? 0) (suspend) (ja :num! (seek!))) - (loop (when (not (ja-group? robotboss-idle-blue-ja)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! robotboss-idle-blue-ja)) + (loop + (when (not (ja-group? robotboss-idle-blue-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robotboss-idle-blue-ja)) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) diff --git a/goal_src/jak1/levels/firecanyon/assistant-firecanyon.gc b/goal_src/jak1/levels/firecanyon/assistant-firecanyon.gc index b825a00a1d..ebc9e21ac6 100644 --- a/goal_src/jak1/levels/firecanyon/assistant-firecanyon.gc +++ b/goal_src/jak1/levels/firecanyon/assistant-firecanyon.gc @@ -87,84 +87,85 @@ :code (behavior () (if (!= (ja-group) (get-art-elem self)) (ja-channel-push! 1 (seconds 0.05))) - (loop (let ((gp-0 #t)) - (cond - ((= (current-status (-> self tasks)) (task-status invalid)) - (when (< (rand-float-gen) 0.5) - (ja :group! assistant-firecanyon-idle-a-ja) - (let* ((f30-0 2.0) - (v1-16 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-17 (the-as number (logior #x3f800000 v1-16)))) - (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-17)))) 3)) - (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))))) - (set! gp-0 #f)) - (when (or gp-0 (< (rand-float-gen) 0.5)) - (ja-no-eval :group! assistant-firecanyon-idle-to-b-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))) - (ja :group! assistant-firecanyon-idle-b-ja) - (let* ((f30-1 2.0) - (v1-83 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-84 (the-as number (logior #x3f800000 v1-83)))) - (countdown (gp-2 (+ (the int (* f30-1 (+ -1.0 (the-as float v1-84)))) 3)) - (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))))) - (ja-no-eval :group! assistant-firecanyon-idle-to-a-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!)))) - (when (< (rand-float-gen) 0.25) - (ja :group! assistant-firecanyon-idle-wipe-brow-ja) + (loop + (let ((gp-0 #t)) + (cond + ((= (current-status (-> self tasks)) (task-status invalid)) + (when (< (rand-float-gen) 0.5) + (ja :group! assistant-firecanyon-idle-a-ja) + (let* ((f30-0 2.0) + (v1-16 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-17 (the-as number (logior #x3f800000 v1-16)))) + (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-17)))) 3)) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) - (else - (when (< (rand-float-gen) 0.8) - (ja :group! assistant-firecanyon-idle-twist-ja) - (let* ((f30-2 4.0) - (v1-184 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-185 (the-as number (logior #x3f800000 v1-184)))) - (countdown (gp-3 (+ (the int (* f30-2 (+ -1.0 (the-as float v1-185)))) 8)) - (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))))) - (set! gp-0 #f)) - (when (or gp-0 (< (rand-float-gen) 0.5)) - (ja-no-eval :group! assistant-firecanyon-idle-down-ja :num! (seek!) :frame-num 0.0) + (set! gp-0 #f)) + (when (or gp-0 (< (rand-float-gen) 0.5)) + (ja-no-eval :group! assistant-firecanyon-idle-to-b-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))) + (ja :group! assistant-firecanyon-idle-b-ja) + (let* ((f30-1 2.0) + (v1-83 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-84 (the-as number (logior #x3f800000 v1-83)))) + (countdown (gp-2 (+ (the int (* f30-1 (+ -1.0 (the-as float v1-84)))) 3)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (ja :num! (seek!))) - (ja :group! assistant-firecanyon-idle-examine-ja) - (let* ((f30-3 2.0) - (v1-251 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-252 (the-as number (logior #x3f800000 v1-251)))) - (countdown (gp-4 (+ (the int (* f30-3 (+ -1.0 (the-as float v1-252)))) 3)) - (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))))) - (ja-no-eval :group! assistant-firecanyon-idle-up-ja :num! (seek!) :frame-num 0.0) + (ja :num! (seek!))))) + (ja-no-eval :group! assistant-firecanyon-idle-to-a-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)))) + (when (< (rand-float-gen) 0.25) + (ja :group! assistant-firecanyon-idle-wipe-brow-ja) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))))) + (else + (when (< (rand-float-gen) 0.8) + (ja :group! assistant-firecanyon-idle-twist-ja) + (let* ((f30-2 4.0) + (v1-184 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-185 (the-as number (logior #x3f800000 v1-184)))) + (countdown (gp-3 (+ (the int (* f30-2 (+ -1.0 (the-as float v1-185)))) 8)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (ja :num! (seek!)))) - (when (< (rand-float-gen) 0.5) - (ja :group! assistant-firecanyon-idle-fiddle-ja) - (let* ((f30-4 2.0) - (v1-316 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-317 (the-as number (logior #x3f800000 v1-316)))) - (countdown (gp-5 (+ (the int (* f30-4 (+ -1.0 (the-as float v1-317)))) 3)) - (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!)))))))))))) + (ja :num! (seek!))))) + (set! gp-0 #f)) + (when (or gp-0 (< (rand-float-gen) 0.5)) + (ja-no-eval :group! assistant-firecanyon-idle-down-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))) + (ja :group! assistant-firecanyon-idle-examine-ja) + (let* ((f30-3 2.0) + (v1-251 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-252 (the-as number (logior #x3f800000 v1-251)))) + (countdown (gp-4 (+ (the int (* f30-3 (+ -1.0 (the-as float v1-252)))) 3)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))))) + (ja-no-eval :group! assistant-firecanyon-idle-up-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)))) + (when (< (rand-float-gen) 0.5) + (ja :group! assistant-firecanyon-idle-fiddle-ja) + (let* ((f30-4 2.0) + (v1-316 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-317 (the-as number (logior #x3f800000 v1-316)))) + (countdown (gp-5 (+ (the int (* f30-4 (+ -1.0 (the-as float v1-317)))) 3)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)))))))))))) (defmethod should-display? ((this assistant-firecanyon)) (first-any (-> this tasks) #t) diff --git a/goal_src/jak1/levels/firecanyon/firecanyon-obs.gc b/goal_src/jak1/levels/firecanyon/firecanyon-obs.gc index a1517af499..05cbbec9dc 100644 --- a/goal_src/jak1/levels/firecanyon/firecanyon-obs.gc +++ b/goal_src/jak1/levels/firecanyon/firecanyon-obs.gc @@ -108,7 +108,8 @@ :code (behavior () (transform-post) - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -171,7 +172,8 @@ (transform-post) (suspend) (ja :num! (seek!))) - (loop (suspend)))) + (loop + (suspend)))) (defstate spike-down (spike) :event @@ -193,7 +195,8 @@ :code (behavior () (transform-post) - (loop (suspend)))) + (loop + (suspend)))) (defstate spike-idle (spike) :trans @@ -211,7 +214,8 @@ :code (behavior () (transform-post) - (loop (suspend)))) + (loop + (suspend)))) (defmethod init-from-entity! ((this spike) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) diff --git a/goal_src/jak1/levels/flut_common/flutflut.gc b/goal_src/jak1/levels/flut_common/flutflut.gc index d465594376..5842082b9c 100644 --- a/goal_src/jak1/levels/flut_common/flutflut.gc +++ b/goal_src/jak1/levels/flut_common/flutflut.gc @@ -80,38 +80,39 @@ 0) :code (behavior () - (loop (let ((v1-0 (-> self condition))) - (cond - ((or (zero? v1-0) (= v1-0 1)) - (if (or (and (task-complete? *game-info* (game-task beach-flutflut)) - (or (and (zero? (-> self condition)) (task-closed? (game-task village2-levitator) (task-status need-hint))) - (and (= (-> self condition) 1) (task-closed? (game-task village3-button) (task-status need-hint))))) - (and *cheat-mode* (cpad-hold? 0 l3)) - (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action flut)))) - (goto cfg-75))) - ((= v1-0 4) - (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action flut))) (goto cfg-75))) - ((= v1-0 3) - (cond - ((and (task-complete? *game-info* (-> self entity extra perm task)) (not (handle->process (-> self cell)))) - (when (and (-> self auto-get-off) (send-event *target* 'end-mode)) - (set! (-> self auto-get-off) #f) - (go-virtual pickup (method-of-object self idle))) - (set! (-> self auto-get-off) #f) - (if (= (-> self condition) 3) (goto cfg-75)) - (if (and *target* - (logtest? (-> *target* control root-prim prim-core action) (collide-action flut)) - (not (time-elapsed? (-> self touch-time) (seconds 0.05)))) - (go-virtual pickup (method-of-object self idle)))) - ((not (handle->process (-> self cell))) - (set! (-> self cell) - (ppointer->handle (birth-pickup-at-point (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (new 'static 'vector :y 8192.0 :w 1.0)) - (pickup-type fuel-cell) - (the float (-> self entity extra perm task)) - #f - self - (-> self fact))))))) - (else (goto cfg-75)))) + (loop + (let ((v1-0 (-> self condition))) + (cond + ((or (zero? v1-0) (= v1-0 1)) + (if (or (and (task-complete? *game-info* (game-task beach-flutflut)) + (or (and (zero? (-> self condition)) (task-closed? (game-task village2-levitator) (task-status need-hint))) + (and (= (-> self condition) 1) (task-closed? (game-task village3-button) (task-status need-hint))))) + (and *cheat-mode* (cpad-hold? 0 l3)) + (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action flut)))) + (goto cfg-75))) + ((= v1-0 4) + (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action flut))) (goto cfg-75))) + ((= v1-0 3) + (cond + ((and (task-complete? *game-info* (-> self entity extra perm task)) (not (handle->process (-> self cell)))) + (when (and (-> self auto-get-off) (send-event *target* 'end-mode)) + (set! (-> self auto-get-off) #f) + (go-virtual pickup (method-of-object self idle))) + (set! (-> self auto-get-off) #f) + (if (= (-> self condition) 3) (goto cfg-75)) + (if (and *target* + (logtest? (-> *target* control root-prim prim-core action) (collide-action flut)) + (not (time-elapsed? (-> self touch-time) (seconds 0.05)))) + (go-virtual pickup (method-of-object self idle)))) + ((not (handle->process (-> self cell))) + (set! (-> self cell) + (ppointer->handle (birth-pickup-at-point (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (new 'static 'vector :y 8192.0 :w 1.0)) + (pickup-type fuel-cell) + (the float (-> self entity extra perm task)) + #f + self + (-> self fact))))))) + (else (goto cfg-75)))) (flutflut-effect) (suspend)) (label cfg-75) @@ -137,8 +138,9 @@ (ja :group! flut-saddle-flut-idle-ja) (set! (-> self root root-prim prim-core action) (collide-action solid attackable-unused)) (set! (-> self root root-prim prim-core offense) (collide-offense indestructible)) - (loop (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action flut))) - (go-virtual wait-for-return)) + (loop + (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action flut))) + (go-virtual wait-for-return)) (when (logtest? (-> self draw status) (draw-status was-drawn)) (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (level-hint-spawn (text-id swamp-flutflut-hint) "sksp0160" (the-as entity #f) *entity-pool* (game-task none)))) @@ -207,8 +209,9 @@ (behavior () (ja-channel-set! 0) (ja-post) - (loop (if (not (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action flut)))) - (go-virtual idle)) + (loop + (if (not (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action flut)))) + (go-virtual idle)) (flutflut-effect) (suspend)))) diff --git a/goal_src/jak1/levels/flut_common/target-flut.gc b/goal_src/jak1/levels/flut_common/target-flut.gc index cc2350bd5e..1bdbf57749 100644 --- a/goal_src/jak1/levels/flut_common/target-flut.gc +++ b/goal_src/jak1/levels/flut_common/target-flut.gc @@ -421,7 +421,8 @@ (ja :num! (seek!)))))) (if (not (ja-group? eichar-flut-idle-ja)) (ja-channel-push! 1 (the-as time-frame gp-0)))) (ja :group! eichar-flut-idle-ja) - (loop (suspend) + (loop + (suspend) (ja :num! (loop!)))) :post target-flut-post) @@ -491,7 +492,8 @@ (else (ja-channel-push! 2 (the-as time-frame gp-0)) f30-0)))) (ja-no-eval :group! eichar-flut-walk-ja :num! (loop!) :dist 49152.0 :frame-num f28-0) (ja-no-eval :chan 1 :group! eichar-flut-run-ja :num! (identity (* 0.5 f28-0)) :frame-interp f30-0 :dist 40960.0) - (loop (suspend) + (loop + (suspend) (let ((f0-13 (lerp-scale (the-as float 0.0) (the-as float 1.0) (-> self control unknown-float01) @@ -601,7 +603,8 @@ (suspend)) (ja-no-eval :group! eichar-flut-jump-loop-ja :num! (loop!) :frame-num 0.0) (ja :chan 1 :group! eichar-flut-jump-forward-loop-ja :num! (chan 0) :frame-interp (-> self control unknown-float122)) - (loop (suspend) + (loop + (suspend) (ja :group! eichar-flut-jump-loop-ja :num! (loop!)) (ja :chan 1 :group! eichar-flut-jump-forward-loop-ja :num! (chan 0) :frame-interp (-> self control unknown-float122)))) :post target-flut-post) @@ -672,7 +675,8 @@ (ja-channel-push! 2 (seconds 0.1)) (ja-no-eval :group! eichar-flut-jump-loop-ja :num! (loop!) :frame-num 0.0) (ja :chan 1 :group! eichar-flut-jump-forward-loop-ja :num! min :frame-interp (-> self control unknown-float122)) - (loop (suspend) + (loop + (suspend) (seek! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max) (* 163840.0 (seconds-per-frame))) @@ -748,7 +752,8 @@ (else (ja-channel-push! 2 (seconds 0.5)))) (ja-no-eval :group! eichar-flut-jump-loop-ja :num! (loop!) :frame-num 0.0) (ja :chan 1 :group! eichar-flut-jump-forward-loop-ja :num! min :frame-interp (-> self control unknown-float122)) - (loop (suspend) + (loop + (suspend) (ja :num! (loop! max)) (ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122)))) :post target-flut-post) @@ -994,7 +999,8 @@ (suspend) (ja :num! (seek!))) (ja :group! eichar-flut-air-attack-loop-ja :num! min) - (loop (suspend))) + (loop + (suspend))) :post target-flut-post) (defstate target-flut-air-attack-hit-ground (target) diff --git a/goal_src/jak1/levels/intro/evilbro.gc b/goal_src/jak1/levels/intro/evilbro.gc index 4ab5fd582e..d6fcc30daf 100644 --- a/goal_src/jak1/levels/intro/evilbro.gc +++ b/goal_src/jak1/levels/intro/evilbro.gc @@ -43,7 +43,8 @@ :code (behavior () (if (!= (ja-group) (get-art-elem self)) (ja-channel-push! 1 (seconds 0.05))) - (loop (ja-no-eval :group! evilbro-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! evilbro-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))) diff --git a/goal_src/jak1/levels/jungle/bouncer.gc b/goal_src/jak1/levels/jungle/bouncer.gc index f7f1faa4ea..bd787a1be1 100644 --- a/goal_src/jak1/levels/jungle/bouncer.gc +++ b/goal_src/jak1/levels/jungle/bouncer.gc @@ -47,7 +47,8 @@ (behavior () (ja :group! bounceytarp-idle-ja :num! min) (transform-post) - (loop (logior! (-> self mask) (process-mask sleep)) + (loop + (logior! (-> self mask) (process-mask sleep)) (suspend)))) (defstate bouncer-smush (springbox) @@ -60,15 +61,16 @@ (behavior () (set-time! (-> self state-time)) (set! (-> self smush) 0.0) - (loop (if (time-elapsed? (-> self state-time) (seconds 0.2)) - (ja :num! (seek! 0.0 0.1)) - (ja :num! - (seek! (lerp-scale (ja-aframe 6.0 0) - (ja-aframe 2.0 0) - (vector-vector-xz-distance (target-pos 0) (-> self root trans)) - 0.0 - 4096.0) - 0.2))) + (loop + (if (time-elapsed? (-> self state-time) (seconds 0.2)) + (ja :num! (seek! 0.0 0.1)) + (ja :num! + (seek! (lerp-scale (ja-aframe 6.0 0) + (ja-aframe 2.0 0) + (vector-vector-xz-distance (target-pos 0) (-> self root trans)) + 0.0 + 4096.0) + 0.2))) (suspend) (if (ja-min? 0) (go bouncer-wait)))) :post transform-post) diff --git a/goal_src/jak1/levels/jungle/darkvine.gc b/goal_src/jak1/levels/jungle/darkvine.gc index 2b3c09e1d8..d8a7ee0371 100644 --- a/goal_src/jak1/levels/jungle/darkvine.gc +++ b/goal_src/jak1/levels/jungle/darkvine.gc @@ -136,7 +136,8 @@ (set! (-> self dangerous) #t) (set! (-> self vulnerable) #t) (let ((f30-0 0.0)) - (loop (if (logtest? (get-reminder (get-task-control (game-task jungle-plant)) 0) 1) (go darkvine-die #f)) + (loop + (if (logtest? (get-reminder (get-task-control (game-task jungle-plant)) 0) 1) (go darkvine-die #f)) (ja-no-eval :group! darkvine-idle-ja :num! (seek! max (-> self speed)) :frame-num 0.0) (until (ja-done? 0) (if (and (>= (ja-aframe-num 0) 120.0) (>= 180.0 (ja-aframe-num 0))) diff --git a/goal_src/jak1/levels/jungle/fisher.gc b/goal_src/jak1/levels/jungle/fisher.gc index 25f1a2ed4f..c0e7da3425 100644 --- a/goal_src/jak1/levels/jungle/fisher.gc +++ b/goal_src/jak1/levels/jungle/fisher.gc @@ -806,7 +806,8 @@ (behavior () (set-heading-vec! (-> self root) (path-control-method-12 (-> (the-as fisher (-> self parent 0)) path) (-> self dir) (-> self pos))) - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (fisher-fish-move) (if (< (vector-vector-xz-distance (-> self root trans) (-> (the-as fisher (-> self parent 0)) paddle-pos)) @@ -1216,7 +1217,8 @@ (process-spawn-function process (lambda :behavior fisher-fish () (logclear! (-> self mask) (process-mask pause)) - (loop (fisher-draw-display (the-as fisher (ppointer->process (-> self parent)))) + (loop + (fisher-draw-display (the-as fisher (ppointer->process (-> self parent)))) (suspend)) (none)) :to @@ -1269,7 +1271,8 @@ (set! (-> self ambient-steady) 0) (set! (-> self ambient-sagging) 0) (set! (-> self ambient-almost) 0) - (loop (hide-hud-quick) + (loop + (hide-hud-quick) (fisher-game-update) (if (or (zero? (-> self params timeout)) (>= (-> self missed) (-> *FISHER-bank* max-missed)) @@ -1458,7 +1461,8 @@ :code (behavior () (if (!= (ja-group) (get-art-elem self)) (ja-channel-push! 1 (seconds 0.2))) - (loop (ja :group! (get-art-elem self)) + (loop + (ja :group! (get-art-elem self)) (let* ((f30-0 5.0) (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-10 (the-as number (logior #x3f800000 v1-9)))) diff --git a/goal_src/jak1/levels/jungle/hopper.gc b/goal_src/jak1/levels/jungle/hopper.gc index 76947c6ad2..b8db7499e7 100644 --- a/goal_src/jak1/levels/jungle/hopper.gc +++ b/goal_src/jak1/levels/jungle/hopper.gc @@ -90,11 +90,12 @@ nav-enemy-default-event-handler :code (behavior () (ja-channel-push! 1 (seconds 0.075)) - (loop (dotimes (gp-0 3) - (ja-no-eval :group! hopper-idle-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!)))) + (loop + (dotimes (gp-0 3) + (ja-no-eval :group! hopper-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)))) (ja-no-eval :group! hopper-burp-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -112,22 +113,23 @@ nav-enemy-default-event-handler (vector-reset! (-> self collide-info transv)) (set! (-> self jump-length) 16384.0) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) - (loop (cond - ((ja-group? hopper-jump-long-ja) - (ja-channel-push! 1 (seconds 0.067)) - (ja-no-eval :group! hopper-jump-long-land-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))) - (ja-channel-push! 1 (seconds 0.1))) - ((ja-group? hopper-jump-short-ja) - (ja-channel-push! 1 (seconds 0.1)) - (ja-no-eval :group! hopper-jump-short-land-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))) - (ja-channel-push! 1 (seconds 0.1))) - (else (ja-channel-push! 1 (seconds 0.075)))) + (loop + (cond + ((ja-group? hopper-jump-long-ja) + (ja-channel-push! 1 (seconds 0.067)) + (ja-no-eval :group! hopper-jump-long-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))) + (ja-channel-push! 1 (seconds 0.1))) + ((ja-group? hopper-jump-short-ja) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! hopper-jump-short-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))) + (ja-channel-push! 1 (seconds 0.1))) + (else (ja-channel-push! 1 (seconds 0.075)))) (set-time! (-> self state-time)) (ja :group! hopper-idle-ja :num! min) (until (time-elapsed? (-> self state-time) (seconds 0.5)) @@ -160,22 +162,23 @@ nav-enemy-default-event-handler (vector-reset! (-> self collide-info transv)) (set! (-> self jump-length) 32768.0) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) - (loop (cond - ((ja-group? hopper-jump-long-ja) - (ja-channel-push! 1 (seconds 0.067)) - (ja-no-eval :group! hopper-jump-long-land-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))) - (ja-channel-push! 1 (seconds 0.1))) - ((ja-group? hopper-jump-short-ja) - (ja-channel-push! 1 (seconds 0.1)) - (ja-no-eval :group! hopper-jump-short-land-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))) - (ja-channel-push! 1 (seconds 0.1))) - (else (ja-channel-push! 1 (seconds 0.075)))) + (loop + (cond + ((ja-group? hopper-jump-long-ja) + (ja-channel-push! 1 (seconds 0.067)) + (ja-no-eval :group! hopper-jump-long-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))) + (ja-channel-push! 1 (seconds 0.1))) + ((ja-group? hopper-jump-short-ja) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! hopper-jump-short-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))) + (ja-channel-push! 1 (seconds 0.1))) + (else (ja-channel-push! 1 (seconds 0.075)))) (set-time! (-> self state-time)) (ja :group! hopper-idle-ja :num! min) (until (time-elapsed? (-> self state-time) (seconds 0.2)) diff --git a/goal_src/jak1/levels/jungle/jungle-mirrors.gc b/goal_src/jak1/levels/jungle/jungle-mirrors.gc index 3fd4b02241..ebe21899d2 100644 --- a/goal_src/jak1/levels/jungle/jungle-mirrors.gc +++ b/goal_src/jak1/levels/jungle/jungle-mirrors.gc @@ -583,50 +583,52 @@ (f28-0 (the-as float (-> (the-as periscope (-> gp-0 0)) tilt))) (f30-0 (the-as float (-> (the-as periscope (-> gp-0 0)) turn))) (s5-0 (new 'stack-no-clear 'vector))) - (loop (when (not (or (paused?) (-> (the-as periscope (-> self change-event-from 0)) aligned?))) - (vector-reset! s5-0) - (when *camera-read-analog* - ;; og:preserve-this Mirror controls changed to respect PC Port settings - (let ((f26-0 (analog-input-horizontal-first (the-as int (+ (-> *cpad-list* cpads 0 rightx) -256 (-> *cpad-list* cpads 0 leftx))) - 0.0 - 48.0 - 110.0 - -1.0)) - (f0-0 (analog-input-vertical-first (the-as int (+ (-> *cpad-list* cpads 0 righty) -256 (-> *cpad-list* cpads 0 lefty))) - 0.0 - 48.0 - 110.0 - -1.0))) - (set! (-> s5-0 y) (- (-> s5-0 y) (* 136.53334 (- f26-0)))) - (set! (-> s5-0 x) (- (-> s5-0 x) (* 136.53334 (- f0-0)))) - (cond - ((and (= f26-0 0.0) (= f0-0 0.0)) (sound-stop (-> (the-as periscope (-> gp-0 0)) sound-id))) - (else - (let ((s4-0 sound-play-by-name) - (s3-0 (make-u128 101 (the-as uint #x706f6373656c6574))) - (s2-0 (-> (the-as periscope (-> gp-0 0)) sound-id)) - (s1-0 1024) - (s0-0 0)) - (set! sv-32 0) - (set! sv-48 1) - (let ((t2-0 (target-pos 0))) - (the-as int (s4-0 (the-as sound-name s3-0) s2-0 s1-0 s0-0 sv-32 (the-as sound-group sv-48) (the-as symbol t2-0))))))))) + (loop + (when (not (or (paused?) (-> (the-as periscope (-> self change-event-from 0)) aligned?))) + (vector-reset! s5-0) + (when *camera-read-analog* + ;; og:preserve-this Mirror controls changed to respect PC Port settings + (let ((f26-0 (analog-input-horizontal-first (the-as int (+ (-> *cpad-list* cpads 0 rightx) -256 (-> *cpad-list* cpads 0 leftx))) + 0.0 + 48.0 + 110.0 + -1.0)) + (f0-0 (analog-input-vertical-first (the-as int (+ (-> *cpad-list* cpads 0 righty) -256 (-> *cpad-list* cpads 0 lefty))) + 0.0 + 48.0 + 110.0 + -1.0))) + (set! (-> s5-0 y) (- (-> s5-0 y) (* 136.53334 (- f26-0)))) + (set! (-> s5-0 x) (- (-> s5-0 x) (* 136.53334 (- f0-0)))) (cond - ((< 136.53334 (-> s5-0 x)) (set! (-> s5-0 x) 136.53334)) - ((< (-> s5-0 x) -136.53334) (set! (-> s5-0 x) -136.53334))) - (cond - ((< 136.53334 (-> s5-0 y)) (set! (-> s5-0 y) 136.53334)) - ((< (-> s5-0 y) -136.53334) (set! (-> s5-0 y) -136.53334))) - (+! f30-0 (* (-> s5-0 y) (-> *display* time-adjust-ratio))) - (set! f28-0 (fmax -12743.111 (fmin 12743.111 (+ f28-0 (* (-> s5-0 x) (-> *display* time-adjust-ratio)))))) - (matrix-rotate-yx! (the-as matrix (-> self tracking)) f30-0 f28-0)) + ((and (= f26-0 0.0) (= f0-0 0.0)) (sound-stop (-> (the-as periscope (-> gp-0 0)) sound-id))) + (else + (let ((s4-0 sound-play-by-name) + (s3-0 (make-u128 101 (the-as uint #x706f6373656c6574))) + (s2-0 (-> (the-as periscope (-> gp-0 0)) sound-id)) + (s1-0 1024) + (s0-0 0)) + (set! sv-32 0) + (set! sv-48 1) + (let ((t2-0 (target-pos 0))) + (the-as int (s4-0 (the-as sound-name s3-0) s2-0 s1-0 s0-0 sv-32 (the-as sound-group sv-48) (the-as symbol t2-0))))))))) + (cond + ((< 136.53334 (-> s5-0 x)) (set! (-> s5-0 x) 136.53334)) + ((< (-> s5-0 x) -136.53334) (set! (-> s5-0 x) -136.53334))) + (cond + ((< 136.53334 (-> s5-0 y)) (set! (-> s5-0 y) 136.53334)) + ((< (-> s5-0 y) -136.53334) (set! (-> s5-0 y) -136.53334))) + (+! f30-0 (* (-> s5-0 y) (-> *display* time-adjust-ratio))) + (set! f28-0 (fmax -12743.111 (fmin 12743.111 (+ f28-0 (* (-> s5-0 x) (-> *display* time-adjust-ratio)))))) + (matrix-rotate-yx! (the-as matrix (-> self tracking)) f30-0 f28-0)) (suspend))))) (defstate reflector-idle (reflector) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) - (loop (set! (-> gp-0 x) (-> self parent-override 0 tilt)) + (loop + (set! (-> gp-0 x) (-> self parent-override 0 tilt)) (set! (-> gp-0 y) (-> self parent-override 0 turn)) (set! (-> gp-0 z) 0.0) (set! (-> gp-0 w) 1.0) @@ -948,7 +950,8 @@ (suspend) (update-transforms! (-> self root)) (logior! (-> self draw status) (draw-status hidden)) - (loop (suspend)))) + (loop + (suspend)))) (defstate periscope-activate (periscope) :exit @@ -992,7 +995,8 @@ (suspend))) (update-transforms! (-> self root)) (set! (-> self y-offset) (-> self height)) - (loop (if (periscope-has-power-input?) (go periscope-wait-for-player)) + (loop + (if (periscope-has-power-input?) (go periscope-wait-for-player)) (suspend))) :post ja-post) @@ -1038,7 +1042,8 @@ (s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector))) - (loop (set! (-> s5-0 quad) (-> self node-list data 4 bone transform vector 3 quad)) + (loop + (set! (-> s5-0 quad) (-> self node-list data 4 bone transform vector 3 quad)) (let ((a0-10 s5-0) (f30-1 81920.0)) (when (and *target* (>= f30-1 (vector-vector-distance a0-10 (-> *target* control trans)))) @@ -1068,7 +1073,8 @@ (print-game-text (lookup-text! *common-text* (text-id press-to-use) #f) s2-2 #f 128 22)) (when (cpad-pressed? 0 circle) (set! (-> self grips-moving?) #f) - (loop (send-event *target* 'change-mode 'periscope self) + (loop + (send-event *target* 'change-mode 'periscope self) (hide-hud) (suspend) (hide-hud) @@ -1186,50 +1192,52 @@ (send-event *camera* 'change-state cam-periscope 0) (logior! (-> self reflector 0 draw status) (draw-status hidden)) (suspend) - (loop (if (not (-> self aligned?)) (set-time! (-> self lock-time))) + (loop + (if (not (-> self aligned?)) (set-time! (-> self lock-time))) (periscope-crosshair) (when (or (cpad-pressed? 0 triangle x) (and (-> self aligned?) (time-elapsed? (-> self lock-time) (seconds 3)))) (sound-stop (-> self sound-id)) (if (periscope-test-task-complete?) (close-specific-task! (game-task jungle-lurkerm) (task-status need-reminder))) - (loop (when (send-event *target* 'end-mode) - (cond - ((and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) - (let ((gp-1 (ppointer->handle (peri-beamcam-init-by-other (the-as string (-> self name)))))) - (suspend) - (while (and *target* (= (-> *target* next-state name) 'target-periscope)) - (periscope-crosshair) - (suspend)) - (logclear! (-> self reflector 0 draw status) (draw-status hidden)) - (periscope-find-reflection-angles) - (set! (-> self turn) (-> self target-turn)) - (set! (-> self tilt) (-> self target-tilt)) - (set! *camera-init-mat* (-> self old-camera-matrix)) - (send-event *camera* 'change-state *camera-base-mode* 0) - (set! *camera-init-mat* #f) - (while (handle->process (the-as handle gp-1)) - (suspend))) - (process-spawn-function process - (lambda ((arg0 string)) - (while (or (-> *setting-control* current ambient) (-> *setting-control* current movie) (-> *setting-control* current hint)) - (suspend)) - (cond - ((name= arg0 "periscope-11") - (level-hint-spawn (text-id sidekick-hint-periscope3) "sksp0053" (the-as entity #f) *entity-pool* (game-task none))) - ((name= arg0 "periscope-12") - (level-hint-spawn (text-id sidekick-hint-periscope2) "sksp0052" (the-as entity #f) *entity-pool* (game-task none))) - ((name= arg0 "periscope-15") - (level-hint-spawn (text-id jungle-lurkerm-resolution) "sksp0018" (the-as entity #f) *entity-pool* (game-task none)))) - (none)) - (-> self name) - :to - self)) - (else - (set! *camera-init-mat* (-> self old-camera-matrix)) - (send-event *camera* 'change-state *camera-base-mode* 0) - (set! *camera-init-mat* #f))) - (if (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) - (go periscope-power-on) - (go periscope-wait-for-player))) + (loop + (when (send-event *target* 'end-mode) + (cond + ((and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) + (let ((gp-1 (ppointer->handle (peri-beamcam-init-by-other (the-as string (-> self name)))))) + (suspend) + (while (and *target* (= (-> *target* next-state name) 'target-periscope)) + (periscope-crosshair) + (suspend)) + (logclear! (-> self reflector 0 draw status) (draw-status hidden)) + (periscope-find-reflection-angles) + (set! (-> self turn) (-> self target-turn)) + (set! (-> self tilt) (-> self target-tilt)) + (set! *camera-init-mat* (-> self old-camera-matrix)) + (send-event *camera* 'change-state *camera-base-mode* 0) + (set! *camera-init-mat* #f) + (while (handle->process (the-as handle gp-1)) + (suspend))) + (process-spawn-function process + (lambda ((arg0 string)) + (while (or (-> *setting-control* current ambient) (-> *setting-control* current movie) (-> *setting-control* current hint)) + (suspend)) + (cond + ((name= arg0 "periscope-11") + (level-hint-spawn (text-id sidekick-hint-periscope3) "sksp0053" (the-as entity #f) *entity-pool* (game-task none))) + ((name= arg0 "periscope-12") + (level-hint-spawn (text-id sidekick-hint-periscope2) "sksp0052" (the-as entity #f) *entity-pool* (game-task none))) + ((name= arg0 "periscope-15") + (level-hint-spawn (text-id jungle-lurkerm-resolution) "sksp0018" (the-as entity #f) *entity-pool* (game-task none)))) + (none)) + (-> self name) + :to + self)) + (else + (set! *camera-init-mat* (-> self old-camera-matrix)) + (send-event *camera* 'change-state *camera-base-mode* 0) + (set! *camera-init-mat* #f))) + (if (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) + (go periscope-power-on) + (go periscope-wait-for-player))) (suspend))) (suspend))) :post @@ -1256,7 +1264,8 @@ (suspend))) (sound-stop (-> self grips-sound-id)) (ja-post) - (loop (suspend))) + (loop + (suspend))) :post periscope-post) (defmethod init-from-entity! ((this periscope) (arg0 entity-actor)) @@ -1362,7 +1371,8 @@ (suspend))) (process-entity-status! self (entity-perm-status complete) #t) (reflector-origin-update (-> self link next)) - (loop (suspend))) + (loop + (suspend))) :post (behavior () (draw-power-beam (-> self reflector-trans) (-> self next-reflector-trans)))) @@ -1390,7 +1400,8 @@ (let ((gp-0 (new-stack-vector0))) (set! (-> gp-0 quad) (-> self root trans quad)) (+! (-> gp-0 y) 49152.0) - (loop (draw-power-beam gp-0 (-> self beam-end)) + (loop + (draw-power-beam gp-0 (-> self beam-end)) (update! (-> self sound)) (when (logtest? (-> self draw status) (draw-status was-drawn)) (launch-particles (-> *part-id-table* 825) (-> self beam-end)) @@ -1431,7 +1442,8 @@ (while (-> self child) (suspend))) (logior! (-> self mask) (process-mask actor-pause)) - (loop (suspend)))) + (loop + (suspend)))) (defmethod init-from-entity! ((this reflector-mirror) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) diff --git a/goal_src/jak1/levels/jungle/jungle-obs.gc b/goal_src/jak1/levels/jungle/jungle-obs.gc index 0d93d15b08..3b565d5b65 100644 --- a/goal_src/jak1/levels/jungle/jungle-obs.gc +++ b/goal_src/jak1/levels/jungle/jungle-obs.gc @@ -51,7 +51,8 @@ :code (behavior () (transform-post) - (loop (ja-no-eval :group! logtrap-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! logtrap-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (when (logtest? (-> self draw status) (draw-status was-drawn)) (cond @@ -100,7 +101,8 @@ (defstate towertop-idle (towertop) :code (behavior () - (loop (ja-no-eval :group! towertop-idle-ja :num! (seek! max 0.4) :frame-num 0.0) + (loop + (ja-no-eval :group! towertop-idle-ja :num! (seek! max 0.4) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max 0.4))))) @@ -140,7 +142,8 @@ :trans rider-trans :code (behavior () - (loop (ja-no-eval :group! lurkerm-tall-sail-idle-ja :num! (seek! max (* 0.5 (-> self speed))) :frame-num 0.0) + (loop + (ja-no-eval :group! lurkerm-tall-sail-idle-ja :num! (seek! max (* 0.5 (-> self speed))) :frame-num 0.0) (until (ja-done? 0) (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (* 12743.111 (seconds-per-frame) (-> self speed))) (suspend) @@ -205,7 +208,8 @@ :trans rider-trans :code (behavior () - (loop (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max (* 0.5 (-> self speed))) :frame-num 0.0) + (loop + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max (* 0.5 (-> self speed))) :frame-num 0.0) (until (ja-done? 0) (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (* -12743.111 (seconds-per-frame) (-> self speed))) (suspend) @@ -288,7 +292,8 @@ :trans rider-trans :code (behavior () - (loop (ja-no-eval :group! lurkerm-piston-idle-ja :num! (seek! max (-> self speed)) :frame-num 0.0) + (loop + (ja-no-eval :group! lurkerm-piston-idle-ja :num! (seek! max (-> self speed)) :frame-num 0.0) (until (ja-done? 0) (let ((gp-0 (new-stack-vector0))) (set! (-> gp-0 quad) (-> self base quad)) @@ -366,7 +371,8 @@ (behavior () (ja-no-eval :num! (loop!) :frame-num 0.0) (ja-post) - (loop (suspend) + (loop + (suspend) (when (logtest? (-> self draw status) (draw-status was-drawn)) (ja :num! (loop! (-> self speed))) (ja-post))))) @@ -441,32 +447,33 @@ (behavior () (ja :group! precurbridge-idle-ja :num! min) (transform-post) - (loop (when (and *target* - (< (vector-vector-xz-distance (-> self activation-point) (-> *target* control trans)) 49152.0) - (< (-> self activation-point y) (-> *target* control trans y)) - (< (-> *target* control trans y) (+ 20480.0 (-> self activation-point y))) - (not (-> self child))) - (cond - ((send-event *target* 'query 'powerup (pickup-type eco-blue)) - (logclear! (-> self mask) (process-mask actor-pause)) - (logclear! (-> self mask) (process-mask platform)) - (let ((gp-1 (entity-by-name "junglecam-1"))) - (cond - (gp-1 - (process-spawn precurbridgecam - :init - pov-camera-init-by-other - (-> gp-1 extra trans) - *junglecam-sg* - "precurbridgecam" - 0 - #f - () - :to - self)) - (else (format #t "ERROR: position for precursor bridge camera not found~%") (go precurbridge-activate))))) - (else - (level-hint-spawn (text-id sidekick-hint-precurbridge) "sksp0039" (the-as entity #f) *entity-pool* (game-task none))))) + (loop + (when (and *target* + (< (vector-vector-xz-distance (-> self activation-point) (-> *target* control trans)) 49152.0) + (< (-> self activation-point y) (-> *target* control trans y)) + (< (-> *target* control trans y) (+ 20480.0 (-> self activation-point y))) + (not (-> self child))) + (cond + ((send-event *target* 'query 'powerup (pickup-type eco-blue)) + (logclear! (-> self mask) (process-mask actor-pause)) + (logclear! (-> self mask) (process-mask platform)) + (let ((gp-1 (entity-by-name "junglecam-1"))) + (cond + (gp-1 + (process-spawn precurbridgecam + :init + pov-camera-init-by-other + (-> gp-1 extra trans) + *junglecam-sg* + "precurbridgecam" + 0 + #f + () + :to + self)) + (else (format #t "ERROR: position for precursor bridge camera not found~%") (go precurbridge-activate))))) + (else + (level-hint-spawn (text-id sidekick-hint-precurbridge) "sksp0039" (the-as entity #f) *entity-pool* (game-task none))))) (suspend))) :post ja-post) @@ -508,7 +515,8 @@ (ja-post) (update-transforms! (-> self root)) (logior! (-> self mask) (process-mask actor-pause)) - (loop (if (not (movie?)) (logior! (-> self mask) (process-mask platform))) + (loop + (if (not (movie?)) (logior! (-> self mask) (process-mask platform))) (cond ((and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (when (not (ja-group? precurbridge-static-ja)) @@ -705,11 +713,12 @@ (if arg0 (ja :num-func num-func-identity :frame-num 0.0)) (suspend) (update-transforms! (-> self root)) - (loop (when (or (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) - (and (and *target* (>= (-> self thresh w) (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (send-event *target* 'query 'powerup (pickup-type eco-blue)))) - (sound-play "blue-eco-on" :position (the-as symbol (-> self root trans))) - (go maindoor-open #f)) + (loop + (when (or (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) + (and (and *target* (>= (-> self thresh w) (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (send-event *target* 'query 'powerup (pickup-type eco-blue)))) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root trans))) + (go maindoor-open #f)) (if (and *target* (>= (-> self thresh w) (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (level-hint-spawn (text-id sidekick-hint-rounddoor) "sksp0038" (the-as entity #f) *entity-pool* (game-task none))) (when (ja-min? 0) @@ -733,7 +742,8 @@ (if (and (not arg0) (rand-vu-percent? 0.2)) (spawn-projectile-blue *target*)) (suspend)) (logior! (-> self draw status) (draw-status hidden)) - (loop (suspend))) + (loop + (suspend))) :post ja-post) (defmethod init-from-entity! ((this maindoor) (arg0 entity-actor)) @@ -816,7 +826,8 @@ :trans rider-trans :code (behavior () - (loop (ja :num-func num-func-identity :frame-num (get-current-value-with-mirror (-> self sync) (the float (ja-num-frames 0)))) + (loop + (ja :num-func num-func-identity :frame-num (get-current-value-with-mirror (-> self sync) (the float (ja-num-frames 0)))) (cond ((< (ja-frame-num 0) (the float (/ (ja-num-frames 0) 3))) (set! (-> self back-prim prim-core collide-as) (collide-kind)) diff --git a/goal_src/jak1/levels/jungle/junglefish.gc b/goal_src/jak1/levels/jungle/junglefish.gc index e9e3d5f176..27de1477ed 100644 --- a/goal_src/jak1/levels/jungle/junglefish.gc +++ b/goal_src/jak1/levels/jungle/junglefish.gc @@ -37,7 +37,8 @@ nav-enemy-default-event-handler (behavior () (ja-channel-push! 1 (seconds 0.2)) (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) - (loop (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) :num! (seek! max f30-0) :frame-num 0.0) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max f30-0))) diff --git a/goal_src/jak1/levels/jungle/junglesnake.gc b/goal_src/jak1/levels/jungle/junglesnake.gc index 4a254f7a95..ed61a88371 100644 --- a/goal_src/jak1/levels/jungle/junglesnake.gc +++ b/goal_src/jak1/levels/jungle/junglesnake.gc @@ -290,7 +290,8 @@ junglesnake-default-event-handler (cond ((ja-group? junglesnake-idle-ja) (while (not (ja-done? 0)) (suspend) (ja :num! (seek!)))) (else (ja-channel-push! 1 (seconds 0.15)))) - (loop (ja-no-eval :group! junglesnake-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! junglesnake-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) diff --git a/goal_src/jak1/levels/jungleb/aphid.gc b/goal_src/jak1/levels/jungleb/aphid.gc index 26e7b70c0f..2b075d02be 100644 --- a/goal_src/jak1/levels/jungleb/aphid.gc +++ b/goal_src/jak1/levels/jungleb/aphid.gc @@ -48,7 +48,8 @@ ((>= (-> self try) 10) 300) ((>= (-> self try) 5) 150) (else 0)))) - (loop (ja-channel-push! 1 (seconds 0.05)) + (loop + (ja-channel-push! 1 (seconds 0.05)) (sound-play "aphid-spike-out") (ja-no-eval :group! aphid-lurker-spike-out-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -94,17 +95,18 @@ (until (ja-done? 0) (suspend) (ja :num! (seek! max f30-0)))) - (loop (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) - (ja-no-eval :num! (loop!)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! aphid-lurker-walk-ja) - (ja :num-func num-func-identity :frame-num 0.0) - (until (nav-enemy-facing-player? 1820.4445) - (ja-blend-eval) - (suspend) - (ja :num! (loop! 0.75))) - (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel))) + (loop + (when (not (nav-enemy-facing-player? 2730.6667)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! aphid-lurker-walk-ja) + (ja :num-func num-func-identity :frame-num 0.0) + (until (nav-enemy-facing-player? 1820.4445) + (ja-blend-eval) + (suspend) + (ja :num! (loop! 0.75))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel))) (when (nav-enemy-rnd-percent? 0.3) (if (not (ja-group? aphid-lurker-win-ja)) (ja-channel-push! 1 (seconds 0.1))) (ja-no-eval :group! aphid-lurker-win-ja :num! (seek! max f30-0) :frame-num 0.0) diff --git a/goal_src/jak1/levels/jungleb/plant-boss.gc b/goal_src/jak1/levels/jungleb/plant-boss.gc index 78ede1f753..efe6c02f4a 100644 --- a/goal_src/jak1/levels/jungleb/plant-boss.gc +++ b/goal_src/jak1/levels/jungleb/plant-boss.gc @@ -191,7 +191,8 @@ (ja-channel-set! 2) (ja :group! plant-boss-arms-idle-ja :num! min) (ja :chan 1 :group! plant-boss-arms-still-ja :num! min) - (loop (ja :num! (loop!)) + (loop + (ja :num! (loop!)) (ja :chan 1 :frame-interp (- 1.0 (-> self parent-override 0 energy))) (suspend))) :post ja-post) @@ -254,7 +255,8 @@ (set! (-> (find-prim-by-id (-> self root) (the-as uint 2)) prim-core action) (collide-action)) 0 (update-transforms! (-> self root)) - (loop (logior! (-> self mask) (process-mask sleep)) + (loop + (logior! (-> self mask) (process-mask sleep)) (suspend))) :post ja-post) @@ -267,7 +269,8 @@ ((= message 'die) (go plant-boss-back-arms-die (the-as symbol (-> block param 0)))))) :code (behavior () - (loop (ja-no-eval :group! plant-boss-back-arms-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! plant-boss-back-arms-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -314,7 +317,8 @@ (ja :num! (seek!))))) (clear-collide-with-as (-> self root)) (ja :group! plant-boss-back-arms-die-ja :num! max) - (loop (suspend))) + (loop + (suspend))) :post ja-post) (defstate plant-boss-vine-idle (plant-boss-arm) @@ -326,7 +330,8 @@ :code (behavior () (let ((f30-0 (rand-vu-float-range (the-as float 0.9) (the-as float 1.1)))) - (loop (ja-no-eval :group! plant-boss-vine-idle-ja :num! (seek! max f30-0) :frame-num 0.0) + (loop + (ja-no-eval :group! plant-boss-vine-idle-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max f30-0)))))) @@ -377,7 +382,8 @@ :code (behavior () (let ((f30-0 (rand-vu-float-range (the-as float 0.9) (the-as float 1.1)))) - (loop (ja-no-eval :group! plant-boss-root-idle-ja :num! (seek! max f30-0) :frame-num 0.0) + (loop + (ja-no-eval :group! plant-boss-root-idle-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max f30-0)))))) @@ -501,19 +507,20 @@ (('die) (go plant-boss-leaf-die (the-as basic (-> block param 0)))))) :code (behavior ((arg0 symbol)) - (loop (case (-> self side) - ((1) - (dotimes (gp-0 4) - (ja-no-eval :group! plant-boss-leaf-stubby-right-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))))) - (else - (dotimes (gp-1 5) - (ja-no-eval :group! plant-boss-leaf-stubby-left-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!)))))))) + (loop + (case (-> self side) + ((1) + (dotimes (gp-0 4) + (ja-no-eval :group! plant-boss-leaf-stubby-right-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))))) + (else + (dotimes (gp-1 5) + (ja-no-eval :group! plant-boss-leaf-stubby-left-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)))))))) :post ja-post) (defstate plant-boss-leaf-open (plant-boss-leaf) @@ -638,7 +645,8 @@ (defstate plant-boss-leaf-die (plant-boss-leaf) :code (behavior ((arg0 basic)) - (loop (logior! (-> self mask) (process-mask sleep)) + (loop + (logior! (-> self mask) (process-mask sleep)) (suspend))) :post ja-post) @@ -684,7 +692,8 @@ (set-mode! (-> self body) (joint-mod-handler-mode flex-blend)) (set! (-> self body flex-blend) 0.0) (ja-channel-set! 1) - (loop (ja-no-eval :group! plant-boss-main-initial-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! plant-boss-main-initial-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (seek! (-> self energy) (the-as float 0.25) (seconds-per-frame)) (if (and (and *target* (>= 245760.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) @@ -810,9 +819,10 @@ (ja :num! (seek!)))) ((ja-group? plant-boss-main-intro-ja)) (else (ja-channel-push! 1 (seconds 0.25)))) - (loop (when (or (and *cheat-mode* (cpad-hold? 1 r3)) (zero? (-> self aphid-count))) - (ja-no-eval :group! plant-boss-main-idle-ja :num! (seek!) :frame-num 0.0) - (go plant-boss-vulnerable)) + (loop + (when (or (and *cheat-mode* (cpad-hold? 1 r3)) (zero? (-> self aphid-count))) + (ja-no-eval :group! plant-boss-main-idle-ja :num! (seek!) :frame-num 0.0) + (go plant-boss-vulnerable)) (ja-no-eval :group! plant-boss-main-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1203,7 +1213,8 @@ (transform-post) (do-push-aways! (-> self root)) (suspend))) - (loop (logior! (-> self mask) (process-mask sleep)) + (loop + (logior! (-> self mask) (process-mask sleep)) (suspend)))) (defstate plant-boss-dead-bounce (plant-boss) diff --git a/goal_src/jak1/levels/jungleb/plat-flip.gc b/goal_src/jak1/levels/jungleb/plat-flip.gc index d287987dec..cec4397dd7 100644 --- a/goal_src/jak1/levels/jungleb/plat-flip.gc +++ b/goal_src/jak1/levels/jungleb/plat-flip.gc @@ -42,34 +42,35 @@ (behavior () (local-vars (f30-0 float) (f30-1 float)) (let ((gp-0 #f)) - (loop (let ((f0-1 (get-current-value (-> self sync) (-> self total-time)))) - (cond - ((< f0-1 (-> self before-turn-down-time)) (ja :group! plat-flip-turn-down-ja :num! min) (set! gp-0 #f)) - ((begin - (set! f30-0 (- f0-1 (-> self before-turn-down-time))) - (< f30-0 (-> self turn-down-time))) - (when (not gp-0) - (set! gp-0 #t) - (sound-play "plat-flip")) - (ja :group! - plat-flip-turn-down-ja - :num! - (identity (/ (* f30-0 (the float (+ (-> (the-as art-joint-anim plat-flip-turn-down-ja) data 0 length) -1))) - (-> self turn-down-time))))) - ((begin - (set! f30-1 (- f30-0 (-> self turn-down-time))) - (< f30-1 (-> self before-turn-up-time))) - (set! gp-0 #f) - (ja :group! plat-flip-turn-down-ja :num! max)) - (else - (when (not gp-0) - (set! gp-0 #t) - (sound-play "plat-flip")) - (let ((f30-2 (- f30-1 (-> self before-turn-up-time)))) - (ja :group! - plat-flip-turn-up-ja - :num! - (identity (/ (* f30-2 (the float (+ (-> (the-as art-joint-anim plat-flip-turn-up-ja) data 0 length) -1))) (-> self turn-up-time)))))))) + (loop + (let ((f0-1 (get-current-value (-> self sync) (-> self total-time)))) + (cond + ((< f0-1 (-> self before-turn-down-time)) (ja :group! plat-flip-turn-down-ja :num! min) (set! gp-0 #f)) + ((begin + (set! f30-0 (- f0-1 (-> self before-turn-down-time))) + (< f30-0 (-> self turn-down-time))) + (when (not gp-0) + (set! gp-0 #t) + (sound-play "plat-flip")) + (ja :group! + plat-flip-turn-down-ja + :num! + (identity (/ (* f30-0 (the float (+ (-> (the-as art-joint-anim plat-flip-turn-down-ja) data 0 length) -1))) + (-> self turn-down-time))))) + ((begin + (set! f30-1 (- f30-0 (-> self turn-down-time))) + (< f30-1 (-> self before-turn-up-time))) + (set! gp-0 #f) + (ja :group! plat-flip-turn-down-ja :num! max)) + (else + (when (not gp-0) + (set! gp-0 #t) + (sound-play "plat-flip")) + (let ((f30-2 (- f30-1 (-> self before-turn-up-time)))) + (ja :group! + plat-flip-turn-up-ja + :num! + (identity (/ (* f30-2 (the float (+ (-> (the-as art-joint-anim plat-flip-turn-up-ja) data 0 length) -1))) (-> self turn-up-time)))))))) (let ((s5-5 (new 'stack-no-clear 'vector))) (set! (-> s5-5 quad) (-> self base-pos quad)) (+! (-> s5-5 y) (* 1638.4 (update! (-> self smush)))) diff --git a/goal_src/jak1/levels/lavatube/assistant-lavatube.gc b/goal_src/jak1/levels/lavatube/assistant-lavatube.gc index e66989b104..30f1525b76 100644 --- a/goal_src/jak1/levels/lavatube/assistant-lavatube.gc +++ b/goal_src/jak1/levels/lavatube/assistant-lavatube.gc @@ -72,9 +72,10 @@ :virtual #t :code (behavior () - (loop (when (!= (ja-group) (get-art-elem self)) - (ja-channel-push! 1 (seconds 0.05)) - (ja :group! assistant-lavatube-start-idle-ja)) + (loop + (when (!= (ja-group) (get-art-elem self)) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! assistant-lavatube-start-idle-ja)) (let* ((f30-0 2.0) (v1-7 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-8 (the-as number (logior #x3f800000 v1-7)))) diff --git a/goal_src/jak1/levels/lavatube/lavatube-energy.gc b/goal_src/jak1/levels/lavatube/lavatube-energy.gc index 041f0f3ccf..eaa013628f 100644 --- a/goal_src/jak1/levels/lavatube/lavatube-energy.gc +++ b/goal_src/jak1/levels/lavatube/lavatube-energy.gc @@ -404,7 +404,8 @@ (behavior () (ja :num-func num-func-identity :frame-num max) (transform-post) - (loop (suspend)))) + (loop + (suspend)))) (defstate energydoor-opening (energydoor) :event energydoor-open-handler @@ -435,7 +436,8 @@ (behavior () (ja :num-func num-func-identity :frame-num 0.0) (transform-post) - (loop (suspend)))) + (loop + (suspend)))) (defstate energydoor-closed-till-near (energydoor) :event energydoor-closed-handler @@ -446,7 +448,8 @@ (behavior () (ja :num-func num-func-identity :frame-num 0.0) (transform-post) - (loop (suspend)))) + (loop + (suspend)))) (defmethod init-from-entity! ((this energydoor) (arg0 entity-actor)) (with-pp @@ -502,13 +505,15 @@ :code (behavior () (ja-post) - (loop (suspend)))) + (loop + (suspend)))) (defstate energybase-stopping (energybase) :code (behavior () (let ((f30-0 1.0)) - (loop (ja-no-eval :group! (ja-group) :num! (seek! max f30-0) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (set! f30-0 (- f30-0 (* 0.002 (-> *display* time-adjust-ratio)))) (if (< f30-0 0.0) (go energybase-stopped)) @@ -523,8 +528,9 @@ (('stop) (go energybase-stopping)))) :code (behavior () - (loop (if (and *target* (>= 307200.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (level-hint-spawn (text-id lavatube-balls) "sksp0375" (the-as entity #f) *entity-pool* (game-task none))) + (loop + (if (and *target* (>= 307200.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (level-hint-spawn (text-id lavatube-balls) "sksp0375" (the-as entity #f) *entity-pool* (game-task none))) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -627,7 +633,8 @@ (matrix->quaternion (-> self root quat) s5-1)))) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -699,7 +706,8 @@ (energyarm-trans)) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -734,7 +742,8 @@ (energyarm-trans)) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -755,7 +764,8 @@ (energyarm-trans)) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -794,7 +804,8 @@ (let ((gp-0 (-> self skel root-channel 0))) (set! (-> gp-0 num-func) num-func-identity) (set! (-> gp-0 frame-num) (* (rand-float-gen) (the float (ja-num-frames 0))))) - (loop (suspend) + (loop + (suspend) (let* ((f30-1 0.25) (f28-0 0.25) (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -895,7 +906,8 @@ (energyhub-set-lava-height -122880.0)) :code (behavior () - (loop (suspend) + (loop + (suspend) (let* ((f30-0 1.0) (f28-0 0.25) (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -938,7 +950,8 @@ (if (< (-> self rotation-speed value) 0.3) (go energyhub-stopped))) :code (behavior () - (loop (suspend) + (loop + (suspend) (let* ((f30-0 1.0) (f28-0 0.25) (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -972,7 +985,8 @@ (energyhub-trans)) :code (behavior () - (loop (suspend) + (loop + (suspend) (let* ((f30-0 1.0) (f28-0 0.25) (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -1024,7 +1038,8 @@ (defstate energylava-idle (energylava) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) diff --git a/goal_src/jak1/levels/lavatube/lavatube-obs.gc b/goal_src/jak1/levels/lavatube/lavatube-obs.gc index 724496532f..734ae34be1 100644 --- a/goal_src/jak1/levels/lavatube/lavatube-obs.gc +++ b/goal_src/jak1/levels/lavatube/lavatube-obs.gc @@ -27,7 +27,8 @@ (defstate lavabase-idle (lavabase) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -55,7 +56,8 @@ (defstate lavafall-idle (lavafall) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -83,7 +85,8 @@ (defstate lavashortcut-idle (lavashortcut) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -461,7 +464,8 @@ (let ((gp-0 (-> self skel root-channel 0))) (set! (-> gp-0 num-func) num-func-identity) (set! (-> gp-0 frame-num) (* (rand-float-gen) (the float (ja-num-frames 0))))) - (loop (ja :num-func num-func-identity :frame-num 0.0) + (loop + (ja :num-func num-func-identity :frame-num 0.0) (suspend))) :post pusher-post) @@ -541,7 +545,8 @@ (if (nonzero? (-> self sound)) (update! (-> self sound)))) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)))))) @@ -604,7 +609,8 @@ (defstate lavafallsewera-idle (lavafallsewera) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -631,7 +637,8 @@ (defstate lavafallsewerb-idle (lavafallsewerb) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -799,7 +806,8 @@ (('attack 'touch) (send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'deadly)))) (go-virtual die)))) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (nonzero? (-> self sound)) (update! (-> self sound))) (suspend) @@ -942,7 +950,8 @@ (eval-path-curve! (-> self path) (-> self root trans) f0-4 'interp)))) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -1021,7 +1030,8 @@ (defstate lavayellowtarp-idle (lavayellowtarp) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) diff --git a/goal_src/jak1/levels/maincave/baby-spider.gc b/goal_src/jak1/levels/maincave/baby-spider.gc index 09281d357f..edaeb707d5 100644 --- a/goal_src/jak1/levels/maincave/baby-spider.gc +++ b/goal_src/jak1/levels/maincave/baby-spider.gc @@ -299,7 +299,8 @@ baby-spider-default-event-handler :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) - (loop (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) :num! (seek! max f30-0) :frame-num 0.0) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max f30-0))))))) @@ -339,9 +340,10 @@ baby-spider-default-event-handler (set! (-> self chase-rest-time) (rand-vu-int-range (seconds 1) (seconds 4))) (ja-channel-push! 1 (seconds 0.17)) (ja :group! baby-spider-run-ja :num! min) - (loop (when (time-elapsed? (-> self wiggle-time) (seconds 1)) - (set-time! (-> self wiggle-time)) - (nav-enemy-method-51 self)) + (loop + (when (time-elapsed? (-> self wiggle-time) (seconds 1)) + (set-time! (-> self wiggle-time)) + (nav-enemy-method-51 self)) (suspend) (ja :num! (loop!)))) :post @@ -372,7 +374,8 @@ baby-spider-default-event-handler (set! (-> self rotate-speed) 1456355.5) (set! (-> self turn-time) (seconds 0.075)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) - (loop (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (loop + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! baby-spider-celebrate-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) diff --git a/goal_src/jak1/levels/maincave/dark-crystal.gc b/goal_src/jak1/levels/maincave/dark-crystal.gc index 38f48b83e3..addb46a743 100644 --- a/goal_src/jak1/levels/maincave/dark-crystal.gc +++ b/goal_src/jak1/levels/maincave/dark-crystal.gc @@ -409,7 +409,8 @@ (go dark-crystal-activate)))) :code (behavior () - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defstate dark-crystal-activate (dark-crystal) diff --git a/goal_src/jak1/levels/maincave/driller-lurker.gc b/goal_src/jak1/levels/maincave/driller-lurker.gc index 96186308ca..965b568214 100644 --- a/goal_src/jak1/levels/maincave/driller-lurker.gc +++ b/goal_src/jak1/levels/maincave/driller-lurker.gc @@ -444,7 +444,8 @@ :code (behavior () (update-trans! (-> self sound2) (-> self root-overeride trans)) - (loop (set! (-> self timeout) (rand-vu-int-range 4 8)) + (loop + (set! (-> self timeout) (rand-vu-int-range 4 8)) (ja-channel-push! 1 (seconds 0.2)) (dotimes (gp-0 (-> self timeout)) (let ((f30-0 (rand-vu-float-range 1.0 1.8))) @@ -484,7 +485,8 @@ (ja-channel-push! 2 (seconds 0.2)) (ja :group! driller-lurker-walk-ja :num! min) (ja :chan 1 :group! driller-lurker-walk-up-ja :num! (chan 0) :frame-interp (-> self up-blend)) - (loop (suspend) + (loop + (suspend) (ja :num! (seek!)) (if (= (ja-group-size) 2) (ja :chan 1 :num! (chan 0) :frame-interp (-> self up-blend))) (when (ja-done? 0) @@ -558,7 +560,8 @@ (ja-channel-push! 2 (seconds 0.2)) (ja :group! driller-lurker-run-ja :num! min) (ja :chan 1 :group! driller-lurker-run-up-ja :num! (chan 0) :frame-interp (-> self up-blend)) - (loop (suspend) + (loop + (suspend) (ja :num! (seek!)) (if (= (ja-group-size) 2) (ja :chan 1 :num! (chan 0) :frame-interp (-> self up-blend))) (if (ja-done? 0) (ja :num-func num-func-identity :frame-num 0.0)))) @@ -584,7 +587,8 @@ (ja-channel-push! 2 (seconds 0.2)) (ja :group! driller-lurker-attack-ja :num! min) (ja :chan 1 :group! driller-lurker-attack-up-ja :num! (chan 0) :frame-interp (-> self up-blend)) - (loop (suspend) + (loop + (suspend) (ja :num! (seek!)) (if (= (ja-group-size) 2) (ja :chan 1 :num! (chan 0) :frame-interp (-> self up-blend))) (if (ja-done? 0) (ja :num-func num-func-identity :frame-num 0.0)))) diff --git a/goal_src/jak1/levels/maincave/gnawer.gc b/goal_src/jak1/levels/maincave/gnawer.gc index f5dd3d8df6..84955fbefd 100644 --- a/goal_src/jak1/levels/maincave/gnawer.gc +++ b/goal_src/jak1/levels/maincave/gnawer.gc @@ -623,24 +623,25 @@ (until (ja-done? 0) (suspend) (ja :num! (seek!))) - (loop (let ((gp-2 (rand-vu-int-range 1 2)) - (s4-0 (rand-vu-int-range 1 2))) - (dotimes (s5-0 gp-2) - (dotimes (s3-0 s4-0) - (set! (-> self anim-speed) (rand-vu-float-range 0.8 1.0)) - (ja-channel-push! 1 (seconds 0.075)) - (ja-no-eval :group! gnawer-tear-side-to-side-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek! max (-> self anim-speed))))) - (set! s4-0 (rand-vu-int-range 1 2)) - (dotimes (s3-1 s4-0) - (set! (-> self anim-speed) (rand-vu-float-range 0.8 1.0)) - (ja-channel-push! 1 (seconds 0.075)) - (ja-no-eval :group! gnawer-tug-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek! max (-> self anim-speed))))))) + (loop + (let ((gp-2 (rand-vu-int-range 1 2)) + (s4-0 (rand-vu-int-range 1 2))) + (dotimes (s5-0 gp-2) + (dotimes (s3-0 s4-0) + (set! (-> self anim-speed) (rand-vu-float-range 0.8 1.0)) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! gnawer-tear-side-to-side-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self anim-speed))))) + (set! s4-0 (rand-vu-int-range 1 2)) + (dotimes (s3-1 s4-0) + (set! (-> self anim-speed) (rand-vu-float-range 0.8 1.0)) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! gnawer-tug-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self anim-speed))))))) (ja-channel-push! 1 (seconds 0.075)) (ja-no-eval :group! gnawer-up-to-chew-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -743,10 +744,11 @@ (ja-channel-set! 1) (ja :group! gnawer-run-ja :num! min) (ja-no-eval :num! (seek!)) - (loop (until v1-19 - (suspend) - (ja :num! (seek!)) - (set! v1-19 (or (ja-done? 0) (-> self show-damage?)))) + (loop + (until v1-19 + (suspend) + (ja :num! (seek!)) + (set! v1-19 (or (ja-done? 0) (-> self show-damage?)))) (when (-> self show-damage?) (until (not (-> self show-damage?)) (set! (-> self show-damage?) #f) diff --git a/goal_src/jak1/levels/maincave/maincave-obs.gc b/goal_src/jak1/levels/maincave/maincave-obs.gc index a195a23fe4..cb6f26536b 100644 --- a/goal_src/jak1/levels/maincave/maincave-obs.gc +++ b/goal_src/jak1/levels/maincave/maincave-obs.gc @@ -105,7 +105,8 @@ (target-attack-up *target* 'attack-or-shove 'deadlyup)))))) :code (behavior () - (loop (ja-no-eval :group! cavecrusher-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! cavecrusher-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (update! (-> self sound)) (suspend) @@ -362,7 +363,8 @@ (clear-collide-with-as (-> self root))))))) :code (behavior () - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defmethod init-from-entity! ((this caveflamepots) (arg0 entity-actor)) @@ -479,7 +481,8 @@ (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (* -65536.0 f0-0)))) :code (behavior () - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend))) :post rider-post) @@ -553,7 +556,8 @@ (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (* -65536.0 f0-0)))) :code (behavior () - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend))) :post rider-post) @@ -665,9 +669,10 @@ (caveelevator-method-20 self)) :code (behavior () - (loop (let ((f30-1 (* (get-current-phase (-> self sync)) (the float (ja-num-frames 0))))) - (if (< (-> self prev-frame-num) f30-1) (ja :num! (seek! f30-1 10000.0)) (ja :num-func num-func-identity :frame-num f30-1)) - (set! (-> self prev-frame-num) f30-1)) + (loop + (let ((f30-1 (* (get-current-phase (-> self sync)) (the float (ja-num-frames 0))))) + (if (< (-> self prev-frame-num) f30-1) (ja :num! (seek! f30-1 10000.0)) (ja :num-func num-func-identity :frame-num f30-1)) + (set! (-> self prev-frame-num) f30-1)) (suspend))) :post (behavior () @@ -692,7 +697,8 @@ (-> (the-as art-joint-anim (+ (* (-> self anim 0) 4) (the-as int (-> self draw art-group)))) master-art-group-name) :num! min) - (loop (suspend))) + (loop + (suspend))) :post (behavior () (rider-post) @@ -745,7 +751,8 @@ :code (behavior () (ja :group! (-> self draw art-group data (-> self anim 0)) :num! max) - (loop (suspend))) + (loop + (suspend))) :post (behavior () (rider-post) diff --git a/goal_src/jak1/levels/maincave/mother-spider-egg.gc b/goal_src/jak1/levels/maincave/mother-spider-egg.gc index e6ffcca2ec..38dff47dbc 100644 --- a/goal_src/jak1/levels/maincave/mother-spider-egg.gc +++ b/goal_src/jak1/levels/maincave/mother-spider-egg.gc @@ -197,7 +197,8 @@ :code (behavior () (ja-channel-push! 1 0) - (loop (ja-no-eval :group! spider-egg-idle-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) + (loop + (ja-no-eval :group! spider-egg-idle-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max (-> self anim-speed)))))) @@ -238,7 +239,8 @@ (quaternion-slerp! (-> self root quat) gp-0 s5-0 f0-9)) (suspend) (ja :num! (seek! max 1.3)))) - (loop (ja-no-eval :group! spider-egg-idle-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) + (loop + (ja-no-eval :group! spider-egg-idle-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max (-> self anim-speed)))))) diff --git a/goal_src/jak1/levels/maincave/mother-spider.gc b/goal_src/jak1/levels/maincave/mother-spider.gc index e4fbbf3372..e43a85b700 100644 --- a/goal_src/jak1/levels/maincave/mother-spider.gc +++ b/goal_src/jak1/levels/maincave/mother-spider.gc @@ -553,7 +553,8 @@ (if (grab-player? self) (go mother-spider-traveling (the-as uint 1)))) :code (behavior () - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defstate mother-spider-traveling (mother-spider) @@ -610,10 +611,11 @@ (local-vars (v1-12 symbol) (v1-28 symbol)) (ja-channel-push! 1 (seconds 0.1)) (ja :group! mother-spider-lowering-ja :num! min) - (loop (until v1-12 - (suspend) - (ja :num! (seek!)) - (set! v1-12 (or (ja-done? 0) (-> self hit?)))) + (loop + (until v1-12 + (suspend) + (ja :num! (seek!)) + (set! v1-12 (or (ja-done? 0) (-> self hit?)))) (when (-> self hit?) (until (not (-> self hit?)) (set! (-> self hit?) #f) @@ -699,7 +701,8 @@ (cond ((ja-group? mother-spider-idle-ja) (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval))) (else (ja-channel-push! 1 (seconds 0.25)))) - (loop (ja-no-eval :group! mother-spider-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! mother-spider-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -725,7 +728,8 @@ (suspend) (ja :num! (seek!))) (ja-channel-push! 1 (seconds 0.1)) - (loop (ja-no-eval :group! mother-spider-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! mother-spider-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -816,7 +820,8 @@ (cond ((ja-group? mother-spider-idle-ja) (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval))) (else (ja-channel-push! 1 (seconds 0.25)))) - (loop (ja-no-eval :group! mother-spider-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! mother-spider-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -925,7 +930,8 @@ (suspend) (ja :num! (seek!))) (ja-channel-push! 1 (seconds 0.1)) - (loop (ja-no-eval :group! mother-spider-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! mother-spider-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) diff --git a/goal_src/jak1/levels/maincave/spiderwebs.gc b/goal_src/jak1/levels/maincave/spiderwebs.gc index d9fc5d5273..e3a9c78520 100644 --- a/goal_src/jak1/levels/maincave/spiderwebs.gc +++ b/goal_src/jak1/levels/maincave/spiderwebs.gc @@ -76,7 +76,8 @@ (logior! (-> self mask) (process-mask actor-pause)) (ja :group! spiderwebs-bounce-ja :num! min) (transform-post) - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defstate spiderwebs-bounce (spiderwebs) diff --git a/goal_src/jak1/levels/misty/babak-with-cannon.gc b/goal_src/jak1/levels/misty/babak-with-cannon.gc index 687bbc196a..3454aeb2e7 100644 --- a/goal_src/jak1/levels/misty/babak-with-cannon.gc +++ b/goal_src/jak1/levels/misty/babak-with-cannon.gc @@ -78,7 +78,8 @@ nav-enemy-default-event-handler :code (behavior () (ja-channel-push! 1 (seconds 0.075)) - (loop (ja-no-eval :group! babak-charge-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! babak-charge-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -199,7 +200,8 @@ nav-enemy-default-event-handler (go babak-with-cannon-jump-off-cannon)))) :code (behavior () - (loop (suspend))) + (loop + (suspend))) :post babak-with-cannon-ride-cannon-post) (defstate nav-enemy-die (babak-with-cannon) diff --git a/goal_src/jak1/levels/misty/balloonlurker.gc b/goal_src/jak1/levels/misty/balloonlurker.gc index 394677ade9..53c3641fac 100644 --- a/goal_src/jak1/levels/misty/balloonlurker.gc +++ b/goal_src/jak1/levels/misty/balloonlurker.gc @@ -628,7 +628,8 @@ (ja-channel-push! 1 (seconds 0.1)) (ja :group! balloonlurker-pilot-idle-ja) (ja :num-func num-func-identity :frame-num 0.0) - (loop (suspend) + (loop + (suspend) (ja :num-func num-func-identity :frame-num (-> self parent-override 0 anim-frame)))) :post (behavior () diff --git a/goal_src/jak1/levels/misty/bonelurker.gc b/goal_src/jak1/levels/misty/bonelurker.gc index 7c35671c02..53cfc9a46c 100644 --- a/goal_src/jak1/levels/misty/bonelurker.gc +++ b/goal_src/jak1/levels/misty/bonelurker.gc @@ -165,27 +165,28 @@ nav-enemy-default-event-handler (until (ja-done? 0) (suspend) (ja :num! (seek! max f30-0))) - (loop (cond - ((or (not *target*) (< 36864.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) - (ja-no-eval :group! bonelurker-charge-ja :num! (seek! max f30-0) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek! max f30-0)))) - (else - (ja-no-eval :group! bonelurker-charge-left-ja :num! (seek! max f30-0) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek! max f30-0))) - (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-victory)) - (ja-no-eval :group! bonelurker-charge-right-ja :num! (seek! max f30-0) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek! max f30-0))) - (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-victory)) - (ja-no-eval :group! bonelurker-charge-ja :num! (seek! max f30-0) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek! max f30-0))))))))) + (loop + (cond + ((or (not *target*) (< 36864.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) + (ja-no-eval :group! bonelurker-charge-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)))) + (else + (ja-no-eval :group! bonelurker-charge-left-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0))) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-victory)) + (ja-no-eval :group! bonelurker-charge-right-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0))) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-victory)) + (ja-no-eval :group! bonelurker-charge-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0))))))))) (defstate nav-enemy-stop-chase (bonelurker) :virtual #t @@ -208,16 +209,17 @@ nav-enemy-default-event-handler (until (ja-done? 0) (suspend) (ja :num! (seek! (ja-aframe 48.0 0) f30-0)))) - (loop (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! bonelurker-turn-ja) - (ja :num-func num-func-identity :frame-num 0.0) - (until (nav-enemy-facing-player? 1820.4445) - (ja-blend-eval) - (suspend) - (ja :num! (loop!))) - (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel))) + (loop + (when (not (nav-enemy-facing-player? 2730.6667)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! bonelurker-turn-ja) + (ja :num-func num-func-identity :frame-num 0.0) + (until (nav-enemy-facing-player? 1820.4445) + (ja-blend-eval) + (suspend) + (ja :num! (loop!))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel))) (ja-channel-push! 1 (seconds 0.25)) (ja-no-eval :group! bonelurker-idle-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) diff --git a/goal_src/jak1/levels/misty/misty-conveyor.gc b/goal_src/jak1/levels/misty/misty-conveyor.gc index d06886156e..7362d73442 100644 --- a/goal_src/jak1/levels/misty/misty-conveyor.gc +++ b/goal_src/jak1/levels/misty/misty-conveyor.gc @@ -148,9 +148,10 @@ (behavior () (set! (-> (the-as keg (-> self parent 0)) sync-offset) (the-as float (process->ppointer self))) (ja :num-func num-func-identity :frame-num 0.0) - (loop (let ((gp-0 (-> (the-as process-drawable (-> self parent 0)) node-list data 4))) - (matrix->quaternion (-> self root quat) (-> gp-0 bone transform)) - (vector<-cspace! (-> self root trans) gp-0)) + (loop + (let ((gp-0 (-> (the-as process-drawable (-> self parent 0)) node-list data 4))) + (matrix->quaternion (-> self root quat) (-> gp-0 bone transform)) + (vector<-cspace! (-> self root trans) gp-0)) (set! (-> self path-position quad) (-> self root trans quad)) (set-time! (-> self state-time)) (suspend))) @@ -170,7 +171,8 @@ 0.0 0.0 (forward-up-nopitch->quaternion s3-0 a1-3 (new 'static 'vector :y 1.0 :w 1.0)) - (loop (if (>= (the float (- (current-time) (-> self state-time))) f30-0) (go keg-on-path)) + (loop + (if (>= (the float (- (current-time) (-> self state-time))) f30-0) (go keg-on-path)) (let ((f28-0 (/ (the float (- (current-time) (-> self state-time))) f30-0))) (vector-lerp! (-> self root trans) gp-0 s5-0 f28-0) (set! (-> self path-position quad) (-> self root trans quad)) @@ -199,8 +201,9 @@ (set! sv-48 0.0) (set! sv-64 0.0) (set! sv-80 (- (-> *standard-dynamics* gravity-length))) - (loop (let ((f0-13 (+ (get-current-phase (-> (the-as keg-conveyor-paddle (-> self parent 0)) sync)) f26-1))) - (set! sv-96 (- f0-13 (the float (the int f0-13))))) + (loop + (let ((f0-13 (+ (get-current-phase (-> (the-as keg-conveyor-paddle (-> self parent 0)) sync)) f26-1))) + (set! sv-96 (- f0-13 (the float (the int f0-13))))) (if (< sv-96 f30-0) (go keg-in-chute)) (set! f30-0 sv-96) (set! sv-112 (* sv-96 f28-0)) @@ -270,7 +273,8 @@ (clear-collide-with-as (-> self root)) (vector-normalize! gp-0 1.0) (set-time! (-> self state-time)) - (loop (if (time-elapsed? (-> self state-time) (seconds 1)) (go keg-die)) + (loop + (if (time-elapsed? (-> self state-time) (seconds 1)) (go keg-die)) (let ((v1-23 (-> self root trans))) (vector-float*! s5-0 gp-0 (* f30-0 (seconds-per-frame))) (set! (-> s5-0 y) (* f28-0 (seconds-per-frame))) @@ -342,7 +346,8 @@ (behavior () (ja :num-func num-func-identity :frame-num 0.0) 0.0 - (loop (suspend))) + (loop + (suspend))) :post ja-post) (defstate keg-conveyor-paddle-idle (keg-conveyor-paddle) @@ -351,30 +356,31 @@ (let ((f30-0 57.0) (gp-0 0) (s5-0 (length *keg-conveyor-keg-spawn-table*))) - (loop (let ((s4-0 #f)) - (when (or (not *target*) (< 102400.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (let ((v1-10 (-> *keg-conveyor-keg-spawn-table* gp-0))) - (cond - ((zero? v1-10) (nothing)) - ((= v1-10 1) (keg-conveyor-spawn-keg (the-as keg-conveyor self))) - ((= v1-10 2) (keg-conveyor-spawn-bouncing-keg (the-as keg-conveyor self))) - (else (nothing))))) - (+! gp-0 1) - (if (>= gp-0 s5-0) (set! gp-0 0)) - (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (when (and (not s4-0) (>= (ja-aframe-num 0) f30-0)) - (set! s4-0 #t) - (when (-> self object-on-paddle) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 0) - (set! (-> a1-2 message) 'detach) - (let ((t9-8 send-event-function) - (v1-42 (-> self object-on-paddle))) - (t9-8 (the-as process-tree (if v1-42 (-> v1-42 0 max-value))) a1-2))))) - (suspend) - (ja :num! (seek!))))))) + (loop + (let ((s4-0 #f)) + (when (or (not *target*) (< 102400.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (let ((v1-10 (-> *keg-conveyor-keg-spawn-table* gp-0))) + (cond + ((zero? v1-10) (nothing)) + ((= v1-10 1) (keg-conveyor-spawn-keg (the-as keg-conveyor self))) + ((= v1-10 2) (keg-conveyor-spawn-bouncing-keg (the-as keg-conveyor self))) + (else (nothing))))) + (+! gp-0 1) + (if (>= gp-0 s5-0) (set! gp-0 0)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (when (and (not s4-0) (>= (ja-aframe-num 0) f30-0)) + (set! s4-0 #t) + (when (-> self object-on-paddle) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) self) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'detach) + (let ((t9-8 send-event-function) + (v1-42 (-> self object-on-paddle))) + (t9-8 (the-as process-tree (if v1-42 (-> v1-42 0 max-value))) a1-2))))) + (suspend) + (ja :num! (seek!))))))) :post transform-post) (defbehavior keg-conveyor-paddle-init-by-other keg-conveyor-paddle ((arg0 keg-conveyor-paddle)) diff --git a/goal_src/jak1/levels/misty/misty-obs.gc b/goal_src/jak1/levels/misty/misty-obs.gc index b8534dbd40..be83207ffc 100644 --- a/goal_src/jak1/levels/misty/misty-obs.gc +++ b/goal_src/jak1/levels/misty/misty-obs.gc @@ -973,7 +973,8 @@ :code (behavior () (local-vars (s4-0 int)) - (loop (quaternion-rotate-local-x! (-> self root quat) (-> self root quat) (* -5461.3335 (seconds-per-frame))) + (loop + (quaternion-rotate-local-x! (-> self root quat) (-> self root quat) (* -5461.3335 (seconds-per-frame))) (let ((gp-0 (-> self part)) (s5-0 (-> self root trans))) (let ((f30-0 1274.3112) @@ -1012,10 +1013,11 @@ (defstate windturbine-idle (windturbine) :code (behavior () - (loop (let* ((a0-0 (-> self root trans)) - (f2-0 (-> *wind-work* wind-force (logand (+ (the int (-> a0-0 x)) (the int (-> a0-0 z)) (-> *wind-work* wind-time)) 63))) - (f0-5 (* 0.992 (+ (-> self angle-speed) (* 3.6408892 f2-0))))) - (set! (-> self angle-speed) (fmin 65536.0 f0-5))) + (loop + (let* ((a0-0 (-> self root trans)) + (f2-0 (-> *wind-work* wind-force (logand (+ (the int (-> a0-0 x)) (the int (-> a0-0 z)) (-> *wind-work* wind-time)) 63))) + (f0-5 (* 0.992 (+ (-> self angle-speed) (* 3.6408892 f2-0))))) + (set! (-> self angle-speed) (fmin 65536.0 f0-5))) (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (* -1.0 (seconds-per-frame) (-> self angle-speed))) (if (-> self spawn-particle-enable) (spawn (-> self part) (-> self root trans))) (suspend))) @@ -1074,8 +1076,9 @@ :code (behavior () (ja :num-func num-func-identity :frame-num 0.0) - (loop (if (and *target* (>= 32768.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (level-hint-spawn (text-id misty-bone-bridge-hint) "sksp0435" (the-as entity #f) *entity-pool* (game-task none))) + (loop + (if (and *target* (>= 32768.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (level-hint-spawn (text-id misty-bone-bridge-hint) "sksp0435" (the-as entity #f) *entity-pool* (game-task none))) (suspend))) :post transform-post) @@ -1130,7 +1133,8 @@ (-> self draw art-group data (-> self fall-anim-index)) :num! (identity (the float (+ (-> (ja-group) data 0 length) -1)))) - (loop (suspend))) + (loop + (suspend))) :post rider-post) (defmethod init-from-entity! ((this mis-bone-bridge) (arg0 entity-actor)) @@ -1219,7 +1223,8 @@ (launch-particles (-> *part-id-table* 281) (-> self root trans)) (let ((gp-1 #f) (s5-1 (current-time))) - (loop (ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 15.0 0)) :frame-num (ja-aframe 1.0 0)) + (loop + (ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 15.0 0)) :frame-num (ja-aframe 1.0 0)) (until (ja-done? 0) (when (and (not gp-1) (time-elapsed? s5-1 (seconds 0.15))) (set! gp-1 #t) @@ -1378,7 +1383,8 @@ (ja-channel-set! 0)) :code (behavior () - (loop (suspend))) + (loop + (suspend))) :post ja-post) (defstate rigid-body-platform-float (bone-platform) @@ -1399,7 +1405,8 @@ (ja-channel-push! 1 (seconds 0.1)) (ja :group! mis-bone-platform-idle-ja) (ja :num-func num-func-identity :frame-num 0.0) - (loop (suspend))) + (loop + (suspend))) :post rigid-body-platform-post) (defmethod rigid-body-platform-method-30 ((this bone-platform)) diff --git a/goal_src/jak1/levels/misty/misty-teetertotter.gc b/goal_src/jak1/levels/misty/misty-teetertotter.gc index 1e482e8765..bac1784702 100644 --- a/goal_src/jak1/levels/misty/misty-teetertotter.gc +++ b/goal_src/jak1/levels/misty/misty-teetertotter.gc @@ -50,7 +50,8 @@ :code (behavior () (ja :group! teetertotter-idle-ja :num! min) - (loop (suspend))) + (loop + (suspend))) :post transform-post) (defstate teetertotter-launch (teetertotter) diff --git a/goal_src/jak1/levels/misty/misty-warehouse.gc b/goal_src/jak1/levels/misty/misty-warehouse.gc index 579873932b..e0d4f4e917 100644 --- a/goal_src/jak1/levels/misty/misty-warehouse.gc +++ b/goal_src/jak1/levels/misty/misty-warehouse.gc @@ -37,7 +37,8 @@ (behavior () (ja :group! silostep-idle-ja :num! min) (transform-post) - (loop (suspend))) + (loop + (suspend))) :post ja-post) (defbehavior misty-camera-view silostep () @@ -85,7 +86,8 @@ (ja :num! (seek! (-> self anim-limit))))) (ja :group! silostep-idle-ja :num! (identity (-> self anim-limit))) (rider-post) - (loop (ja-post) + (loop + (ja-post) (suspend))) :post #f) diff --git a/goal_src/jak1/levels/misty/mistycannon.gc b/goal_src/jak1/levels/misty/mistycannon.gc index 7be0776436..0aab19ec95 100644 --- a/goal_src/jak1/levels/misty/mistycannon.gc +++ b/goal_src/jak1/levels/misty/mistycannon.gc @@ -960,7 +960,8 @@ (rider-trans)) :code (behavior () - (loop (mistycannon-method-23 self) + (loop + (mistycannon-method-23 self) (suspend))) :post rider-post) @@ -1074,9 +1075,10 @@ (rider-trans)) :code (behavior () - (loop (if (< (vector-vector-xz-distance (target-pos 0) (-> self center-point)) (-> self center-point w)) - (mistycannon-do-aim (-> *target* control trans) (-> *target* control transv)) - (mistycannon-do-aim (-> self at-point) (new-stack-vector0))) + (loop + (if (< (vector-vector-xz-distance (target-pos 0) (-> self center-point)) (-> self center-point w)) + (mistycannon-do-aim (-> *target* control trans) (-> *target* control transv)) + (mistycannon-do-aim (-> self at-point) (new-stack-vector0))) (mistycannon-method-23 self) (suspend))) :post rider-post) @@ -1100,10 +1102,11 @@ :code (behavior () (set! (-> self player-touching-grips?) #f) - (loop (let ((f0-0 2730.6667) - (v1-0 (-> self tilt))) - (if (< f0-0 (the float (sar (shl (the int (+ (-> v1-0 min) (-> v1-0 value))) 48) 48))) - (angle-tracker-seek! (-> self tilt) 2730.6667))) + (loop + (let ((f0-0 2730.6667) + (v1-0 (-> self tilt))) + (if (< f0-0 (the float (sar (shl (the int (+ (-> v1-0 min) (-> v1-0 value))) 48) 48))) + (angle-tracker-seek! (-> self tilt) 2730.6667))) (mistycannon-method-23 self) (when (and (-> self player-touching-grips?) (not (level-hint-displayed?))) (set! (-> self player-touching-grips?) #f) @@ -1117,7 +1120,8 @@ (set! (-> gp-0 flags) (font-flags shadow kerning large)) (print-game-text (lookup-text! *common-text* (text-id press-to-use) #f) gp-0 #f 128 22)) (when (cpad-pressed? 0 circle) - (loop (send-event *target* 'change-mode 'periscope self) + (loop + (send-event *target* 'change-mode 'periscope self) (suspend) (suspend))))) (suspend))) @@ -1135,12 +1139,13 @@ (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating))) :code (behavior () - (loop (let ((v1-0 (-> self change-event-from))) - (set! (-> self trans quad) (-> (the-as mistycannon (-> v1-0 0)) goggles quad)) - (let ((t9-0 matrix-rotate-yx!) - (a0-1 (-> self tracking)) - (v1-2 (-> (the-as mistycannon (-> v1-0 0)) rotate))) - (t9-0 (the-as matrix a0-1) (the float (sar (shl (the int (+ (-> v1-2 min) (-> v1-2 value))) 48) 48)) 3640.889))) + (loop + (let ((v1-0 (-> self change-event-from))) + (set! (-> self trans quad) (-> (the-as mistycannon (-> v1-0 0)) goggles quad)) + (let ((t9-0 matrix-rotate-yx!) + (a0-1 (-> self tracking)) + (v1-2 (-> (the-as mistycannon (-> v1-0 0)) rotate))) + (t9-0 (the-as matrix a0-1) (the float (sar (shl (the int (+ (-> v1-2 min) (-> v1-2 value))) 48) 48)) 3640.889))) (suspend)))) (defstate mistycannon-player-control (mistycannon) @@ -1163,23 +1168,25 @@ (set-time! (-> self state-time)) (let ((gp-0 0) (s5-0 0)) - (loop (when *camera-read-analog* - (let ((f30-0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0)) - (f28-0 (analog-input (the-as int (-> *cpad-list* cpads 0 lefty)) 128.0 48.0 110.0 -1.0))) - (rotate! self f30-0) - (tilt! self (- f28-0)) - (if (or (!= f30-0 0.0) (!= f28-0 0.0)) - (sound-play "telescope" :id (-> self aim-sound-id)) - (sound-stop (-> self aim-sound-id))))) + (loop + (when *camera-read-analog* + (let ((f30-0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0)) + (f28-0 (analog-input (the-as int (-> *cpad-list* cpads 0 lefty)) 128.0 48.0 110.0 -1.0))) + (rotate! self f30-0) + (tilt! self (- f28-0)) + (if (or (!= f30-0 0.0) (!= f28-0 0.0)) + (sound-play "telescope" :id (-> self aim-sound-id)) + (sound-stop (-> self aim-sound-id))))) (when (cpad-pressed? 0 triangle) (process-entity-status! self (entity-perm-status bit-3) #t) (sound-stop (-> self sound-id)) (send-event *camera* 'change-to-entity-by-name "camera-111") (suspend) - (loop (when (send-event *target* 'end-mode) - (send-event *camera* 'change-state *camera-base-mode* 0) - (process-entity-status! self (entity-perm-status bit-3) #f) - (go mistycannon-waiting-for-player-to-fuck-off)) + (loop + (when (send-event *target* 'end-mode) + (send-event *camera* 'change-state *camera-base-mode* 0) + (process-entity-status! self (entity-perm-status bit-3) #f) + (go mistycannon-waiting-for-player-to-fuck-off)) (suspend))) (let ((v1-45 (and (cpad-hold? 0 x) (time-elapsed? (-> self state-time) (seconds 1))))) (when (zero? s5-0) @@ -1216,7 +1223,8 @@ :trans rider-trans :code (behavior () - (loop (suspend) + (loop + (suspend) (mistycannon-method-23 self) (if (time-elapsed? (-> self state-time) (seconds 1)) (go mistycannon-waiting-for-player)))) :post rider-post) diff --git a/goal_src/jak1/levels/misty/muse.gc b/goal_src/jak1/levels/misty/muse.gc index 13dcf291e7..0a5b1b5577 100644 --- a/goal_src/jak1/levels/misty/muse.gc +++ b/goal_src/jak1/levels/misty/muse.gc @@ -148,7 +148,8 @@ nav-enemy-default-event-handler (ja-blend-eval) (suspend) (ja :num! (seek!)))) - (loop (ja-no-eval :group! muse-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! muse-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (spool-push *art-control* (-> self anim name) 0 self -99.0) (nav-enemy-method-51 self) @@ -187,7 +188,8 @@ nav-enemy-default-event-handler (ja :num! (seek!)))) (else (ja-channel-push! 1 (seconds 0.1)))) (ja :group! muse-run-ja :num! min) - (loop (suspend) + (loop + (suspend) (ja :num! (loop! (* 0.000016276043 (-> self momentum-speed)))))) :post (behavior () diff --git a/goal_src/jak1/levels/misty/quicksandlurker.gc b/goal_src/jak1/levels/misty/quicksandlurker.gc index 0ea67560d3..e4e398e881 100644 --- a/goal_src/jak1/levels/misty/quicksandlurker.gc +++ b/goal_src/jak1/levels/misty/quicksandlurker.gc @@ -469,7 +469,8 @@ (go quicksandlurker-wait))) :code (behavior () - (loop (suspend))) + (loop + (suspend))) :post ja-post) (defstate quicksandlurker-wait (quicksandlurker) @@ -491,19 +492,20 @@ (s5-0 5) (s4-0 0)) (ja-channel-push! 1 (seconds 0.1)) - (loop (when (time-elapsed? (-> self state-time) gp-0) - (ja-no-eval :group! quicksandlurker-idle-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))) - (set-time! (-> self state-time)) - (+! s4-0 1) - (when (< s5-0 s4-0) - (set! s4-0 0) - (ja-no-eval :group! quicksandlurker-yawn-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))))) + (loop + (when (time-elapsed? (-> self state-time) gp-0) + (ja-no-eval :group! quicksandlurker-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))) + (set-time! (-> self state-time)) + (+! s4-0 1) + (when (< s5-0 s4-0) + (set! s4-0 0) + (ja-no-eval :group! quicksandlurker-yawn-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))))) (orient-to-face-target) (ja :group! quicksandlurker-idle-ja) (ja :num-func num-func-identity :frame-num 0.0) @@ -534,15 +536,16 @@ (let ((gp-0 (the int (* 300.0 (rand-vu-float-range 0.8 1.2)))) (s5-0 1) (s4-0 0)) - (loop (when (time-elapsed? (-> self state-time) gp-0) - (ja-no-eval :group! quicksandlurker-idle-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))) - (set-time! (-> self state-time)) - (+! s4-0 1) - (when (>= s4-0 s5-0) - (if (logtest? (-> self draw status) (draw-status was-drawn)) (go quicksandlurker-attack)))) + (loop + (when (time-elapsed? (-> self state-time) gp-0) + (ja-no-eval :group! quicksandlurker-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))) + (set-time! (-> self state-time)) + (+! s4-0 1) + (when (>= s4-0 s5-0) + (if (logtest? (-> self draw status) (draw-status was-drawn)) (go quicksandlurker-attack)))) (orient-to-face-target) (ja :group! quicksandlurker-idle-ja) (ja :num-func num-func-identity :frame-num 0.0) @@ -635,7 +638,8 @@ :to *entity-pool*) (clear-collide-with-as (-> self root)) - (loop (orient-to-face-target) + (loop + (orient-to-face-target) (suspend))) :post quicksandlurker-post) diff --git a/goal_src/jak1/levels/ogre/flying-lurker.gc b/goal_src/jak1/levels/ogre/flying-lurker.gc index d29e58d635..c7eb397a16 100644 --- a/goal_src/jak1/levels/ogre/flying-lurker.gc +++ b/goal_src/jak1/levels/ogre/flying-lurker.gc @@ -116,7 +116,8 @@ (send-event *target* 'attack-invinc #f (static-attack-info ((mode 'instant-death)))) (cleanup-for-death self) (deactivate self) - (loop (suspend))) + (loop + (suspend))) :post ja-post) (defstate plunger-lurker-flee (plunger-lurker) @@ -153,7 +154,8 @@ (until (ja-done? 0) (suspend) (ja :num! (seek!))) - (loop (suspend))) + (loop + (suspend))) :post ja-post) (defstate plunger-lurker-idle (plunger-lurker) @@ -169,7 +171,8 @@ (go plunger-lurker-flee))) :code (behavior () - (loop (ja-no-eval :group! plunger-lurker-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! plunger-lurker-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -324,7 +327,8 @@ (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (logior! (-> self draw status) (draw-status hidden)) - (loop (suspend)))) + (loop + (suspend)))) (defbehavior first? flying-lurker () (not (-> self link prev))) @@ -496,9 +500,10 @@ (t9-10 (if v1-13 (-> v1-13 extra process)) a1-4)))))) :code (behavior () - (loop (when (not (ja-group? flying-lurker-fly-ja)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! flying-lurker-fly-ja)) + (loop + (when (not (ja-group? flying-lurker-fly-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! flying-lurker-fly-ja)) (ja :num! (loop! (flying-lurker-calc-anim-speed))) (suspend) (when (time-elapsed? (-> self last-look-time) (-> self time-to-next-look)) @@ -753,26 +758,27 @@ ((not (-> self link next)) (set! f30-0 0.9) (set! gp-0 0)) ((not (-> self link prev)) (set! f30-0 1.0) (set! gp-0 5)) (else (set! f30-0 1.2) (set! gp-0 11))) - (loop (cond - ((play-movie?) - (ja-channel-set! 0) - (if (= (get-task-status (game-task plunger-lurker-hit)) (task-status invalid)) (go flying-lurker-die)) - (when (and *target* (>= 172032.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) - (process-grab? *target*) - (let ((s5-0 (current-time))) (until (time-elapsed? s5-0 (seconds 1)) (suspend))) - (process-release? *target*) - (send-event self 'saw-player)) - (suspend) - 0) - (else - (ja :group! flying-lurker-fly-ja) - (ja-no-eval :group! flying-lurker-fly-ja :num! (seek! max f30-0) :frame-num (the float gp-0)) - (until (ja-done? 0) - (if (and *target* (>= 172032.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) - (send-event self 'saw-player)) - (suspend) - (ja :num! (seek! max f30-0))) - (set! gp-0 0))))) + (loop + (cond + ((play-movie?) + (ja-channel-set! 0) + (if (= (get-task-status (game-task plunger-lurker-hit)) (task-status invalid)) (go flying-lurker-die)) + (when (and *target* (>= 172032.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) + (process-grab? *target*) + (let ((s5-0 (current-time))) (until (time-elapsed? s5-0 (seconds 1)) (suspend))) + (process-release? *target*) + (send-event self 'saw-player)) + (suspend) + 0) + (else + (ja :group! flying-lurker-fly-ja) + (ja-no-eval :group! flying-lurker-fly-ja :num! (seek! max f30-0) :frame-num (the float gp-0)) + (until (ja-done? 0) + (if (and *target* (>= 172032.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) + (send-event self 'saw-player)) + (suspend) + (ja :num! (seek! max f30-0))) + (set! gp-0 0))))) :post ja-post) (defmethod init-from-entity! ((this flying-lurker) (arg0 entity-actor)) diff --git a/goal_src/jak1/levels/ogre/ogre-obs.gc b/goal_src/jak1/levels/ogre/ogre-obs.gc index bae3e91f71..19ae178bee 100644 --- a/goal_src/jak1/levels/ogre/ogre-obs.gc +++ b/goal_src/jak1/levels/ogre/ogre-obs.gc @@ -431,7 +431,8 @@ :code (behavior () (logior! (-> self draw status) (draw-status hidden)) - (loop (suspend))) + (loop + (suspend))) :post ja-post) (defstate rigid-body-platform-float (ogre-plat) @@ -449,7 +450,8 @@ :code (behavior () (logclear! (-> self draw status) (draw-status hidden)) - (loop (suspend))) + (loop + (suspend))) :post rigid-body-platform-post) (defmethod rigid-body-platform-method-30 ((this ogre-plat)) @@ -686,7 +688,8 @@ :code (behavior () (ja-post) - (loop (suspend)))) + (loop + (suspend)))) (defstate ogre-bridge-activate (ogre-bridge) :code @@ -714,7 +717,8 @@ (behavior () (ja :group! ogre-bridge-assemble-ja :num! max) (transform-post) - (loop (suspend))) + (loop + (suspend))) :post ja-post) (defstate ogre-bridge-break (ogre-bridge) @@ -971,7 +975,8 @@ (ja :num! (seek! max 0.5))) (ja :group! (-> self draw art-group data (-> self idle-anim))) (ja :num-func num-func-identity :frame-num 0.0) - (loop (suspend))) + (loop + (suspend))) :post #f) (defstate water-vol-startup (ogre-lava) @@ -1133,7 +1138,8 @@ :code (behavior () (transform-post) - (loop (logior! (-> self mask) (process-mask sleep)) + (loop + (logior! (-> self mask) (process-mask sleep)) (suspend)))) (defmethod init-from-entity! ((this shortcut-boulder) (arg0 entity-actor)) diff --git a/goal_src/jak1/levels/ogre/ogreboss.gc b/goal_src/jak1/levels/ogre/ogreboss.gc index 44d974bd85..17b713b6f1 100644 --- a/goal_src/jak1/levels/ogre/ogreboss.gc +++ b/goal_src/jak1/levels/ogre/ogreboss.gc @@ -383,7 +383,8 @@ (set! (-> self joint enable) #t) (set! (-> self joint blend) 1.0) (set-time! (-> self state-time)) - (loop (quaternion-vector-angle! (-> self tumble-quat) (-> self spin-axis) (* 32768.0 (seconds-per-frame) (-> self speed))) + (loop + (quaternion-vector-angle! (-> self tumble-quat) (-> self spin-axis) (* 32768.0 (seconds-per-frame) (-> self speed))) (quaternion*! (-> self joint transform quat) (-> self joint transform quat) (-> self tumble-quat)) (+! (-> self size) (* (-> self grow-rate) (seconds-per-frame))) (set! (-> self size) (fmin 1.0 (-> self size))) @@ -545,7 +546,8 @@ (behavior () (clear-collide-with-as (-> self root)) (ja-post) - (loop (suspend)))) + (loop + (suspend)))) (defbehavior ogreboss-super-boulder-init-by-other ogreboss-super-boulder ((arg0 vector) (arg1 float) (arg2 entity-actor)) (set! (-> self entity) arg2) @@ -751,7 +753,8 @@ (none)) (defbehavior ogreboss-idle-loop ogreboss () - (loop (ja-channel-push! 1 (seconds 0.1)) + (loop + (ja-channel-push! 1 (seconds 0.1)) (let ((v1-0 (rand-vu-int-range 0 2))) (cond ((zero? v1-0) @@ -1219,7 +1222,8 @@ (ja-channel-push! 2 (seconds 0.05)) (ja :chan 1 :group! ogreboss-hit-chest-ja :num! min :frame-interp 0.0) (set! (-> self vulnerable) #t) - (loop (if (>= -61440.0 (-> self shuffle-pos)) (set! gp-0 1)) + (loop + (if (>= -61440.0 (-> self shuffle-pos)) (set! gp-0 1)) (if (>= (-> self shuffle-pos) 61440.0) (set! gp-0 0)) (cond ((zero? gp-0) diff --git a/goal_src/jak1/levels/racer_common/racer-states.gc b/goal_src/jak1/levels/racer_common/racer-states.gc index d803c39579..e40d7e4056 100644 --- a/goal_src/jak1/levels/racer_common/racer-states.gc +++ b/goal_src/jak1/levels/racer_common/racer-states.gc @@ -315,19 +315,20 @@ (when (!= (-> self racer slide-shift-x) 0.0) (if (rand-vu-percent? 0.5) (sound-play "zoomer-rev1" :vol 80) (sound-play "zoomer-rev2" :vol 80))) (set! (-> self racer bounce) 0) - (loop (let ((gp-3 (current-time))) - (when (not (ja-group? eichar-racer-turn-ja)) - (ja-channel-push! 4 (seconds 0.1)) - (ja :group! eichar-racer-turn-ja :num! (identity (ja-aframe (-> self racer turn-anim-frame) 0))) - (ja :chan 1 :group! eichar-racer-turn2-ja :num! (chan 0)) - (ja :chan 2 :group! eichar-racer-dig-ja :num! (chan 0)) - (ja :chan 3 :group! eichar-racer-dig2-ja :num! (chan 0))) - (while (not (time-elapsed? gp-3 (seconds 1))) - (if (or (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (or (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1 x) (>= (fabs (-> self racer turn-anim-frame)) 1.0))) - (set! gp-3 (current-time))) - (target-racing-turn-anim) - (suspend))) + (loop + (let ((gp-3 (current-time))) + (when (not (ja-group? eichar-racer-turn-ja)) + (ja-channel-push! 4 (seconds 0.1)) + (ja :group! eichar-racer-turn-ja :num! (identity (ja-aframe (-> self racer turn-anim-frame) 0))) + (ja :chan 1 :group! eichar-racer-turn2-ja :num! (chan 0)) + (ja :chan 2 :group! eichar-racer-dig-ja :num! (chan 0)) + (ja :chan 3 :group! eichar-racer-dig2-ja :num! (chan 0))) + (while (not (time-elapsed? gp-3 (seconds 1))) + (if (or (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + (or (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1 x) (>= (fabs (-> self racer turn-anim-frame)) 1.0))) + (set! gp-3 (current-time))) + (target-racing-turn-anim) + (suspend))) (when (not (ja-group? eichar-racer-stance-ja)) (ja-channel-push! 1 (seconds 0.4)) (ja :group! eichar-racer-stance-ja :num! min)) @@ -463,7 +464,8 @@ (ja :chan 1 :group! eichar-racer-turn2-ja :num! (chan 0)) (ja :chan 2 :group! eichar-racer-dig-ja :num! (chan 0)) (ja :chan 3 :group! eichar-racer-dig2-ja :num! (chan 0))) - (loop (target-racing-turn-anim) + (loop + (target-racing-turn-anim) (suspend))) :post (-> target-racing @@ -1021,7 +1023,8 @@ (ja :chan 1 :group! eichar-racer-turn2-ja :num! (chan 0)) (ja :chan 2 :group! eichar-racer-dig-ja :num! (chan 0)) (ja :chan 3 :group! eichar-racer-dig2-ja :num! (chan 0))) - (loop (target-racing-turn-anim) + (loop + (target-racing-turn-anim) (set-forward-vel 0.0) (suspend))) :post target-racing-post) diff --git a/goal_src/jak1/levels/racer_common/racer.gc b/goal_src/jak1/levels/racer_common/racer.gc index 1338a62bd4..2e39cd13a3 100644 --- a/goal_src/jak1/levels/racer_common/racer.gc +++ b/goal_src/jak1/levels/racer_common/racer.gc @@ -166,8 +166,9 @@ (set! (-> self root root-prim prim-core offense) (collide-offense indestructible)) 0.0 (let ((f30-0 (if (= (-> self condition) 4) 61440.0 20480.0))) - (loop (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action racer))) - (go-virtual wait-for-return)) + (loop + (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action racer))) + (go-virtual wait-for-return)) (when (and (and *target* (>= f30-0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (and (not (movie?)) (not (level-hint-displayed?)))) (hide-hud) @@ -247,8 +248,9 @@ (behavior () (ja-channel-set! 0) (ja-post) - (loop (if (not (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action racer)))) - (go-virtual idle)) + (loop + (if (not (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action racer)))) + (go-virtual idle)) (racer-effect) (suspend)))) diff --git a/goal_src/jak1/levels/racer_common/target-racer.gc b/goal_src/jak1/levels/racer_common/target-racer.gc index 5b08755a2a..32ed714300 100644 --- a/goal_src/jak1/levels/racer_common/target-racer.gc +++ b/goal_src/jak1/levels/racer_common/target-racer.gc @@ -699,7 +699,8 @@ (ja :group! eichar-racer-jump-small-loop-ja :num! min) (ja :chan 1 :group! eichar-racer-jump-small-land-ja :num! (identity (ja-aframe 44.0 0))) (let ((f30-1 0.0)) - (loop (suspend) + (loop + (suspend) (let ((gp-3 (-> self skel root-channel 1))) (set! f30-1 (seek f30-1 1.0 (seconds-per-frame))) (set! (-> gp-3 frame-interp) f30-1)))) diff --git a/goal_src/jak1/levels/robocave/spider-egg.gc b/goal_src/jak1/levels/robocave/spider-egg.gc index 29832ed372..32c551ec5f 100644 --- a/goal_src/jak1/levels/robocave/spider-egg.gc +++ b/goal_src/jak1/levels/robocave/spider-egg.gc @@ -63,12 +63,13 @@ (suspend) (ja :num! (seek! max f30-0)))) (else (ja-channel-push! 1 (seconds 0.2)))) - (loop (let ((gp-2 (rand-vu-int-range 2 6))) - (dotimes (s5-0 gp-2) - (ja-no-eval :group! spider-egg-idle-ja :num! (seek! max f30-0) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek! max f30-0))))) + (loop + (let ((gp-2 (rand-vu-int-range 2 6))) + (dotimes (s5-0 gp-2) + (ja-no-eval :group! spider-egg-idle-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0))))) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! spider-egg-twitch-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) diff --git a/goal_src/jak1/levels/rolling/rolling-lightning-mole.gc b/goal_src/jak1/levels/rolling/rolling-lightning-mole.gc index 7aa57057ca..022f4fecf2 100644 --- a/goal_src/jak1/levels/rolling/rolling-lightning-mole.gc +++ b/goal_src/jak1/levels/rolling/rolling-lightning-mole.gc @@ -336,9 +336,10 @@ (s5-0 (new-stack-vector0))) (set! (-> gp-0 x) 1.0) (set! (-> s5-0 x) 1.0) - (loop (when (cpad-pressed? 1 r3) - (suspend) - (go fleeing-nav-enemy-debug)) + (loop + (when (cpad-pressed? 1 r3) + (suspend) + (go fleeing-nav-enemy-debug)) (let ((s2-0 (new-stack-vector0)) (s4-0 (new-stack-vector0))) (let ((s3-0 (new-stack-matrix0))) @@ -414,7 +415,8 @@ (when (!= (ja-group) lightning-mole-run-ja) (ja-channel-push! 1 (seconds 0.2)) (ja :group! lightning-mole-run-ja)) - (loop (ja :num! (loop! (-> self speed-adjust))) + (loop + (ja :num! (loop! (-> self speed-adjust))) (suspend)) (none)) @@ -491,7 +493,8 @@ (go-virtual nav-enemy-idle))) :code (behavior () - (loop (suspend)))) + (loop + (suspend)))) (defstate lightning-mole-dive (lightning-mole) :trans @@ -907,7 +910,8 @@ :code (behavior () (logior! (-> self draw status) (draw-status hidden)) - (loop (suspend))) + (loop + (suspend))) :post ja-post) (defstate peeper-hide (peeper) @@ -968,7 +972,8 @@ (go peeper-hide))) :code (behavior () - (loop (ja-no-eval :group! lightning-mole-peep-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! lightning-mole-peep-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))) diff --git a/goal_src/jak1/levels/rolling/rolling-obs.gc b/goal_src/jak1/levels/rolling/rolling-obs.gc index 5ea57458d1..4b04487690 100644 --- a/goal_src/jak1/levels/rolling/rolling-obs.gc +++ b/goal_src/jak1/levels/rolling/rolling-obs.gc @@ -76,14 +76,15 @@ :trans rider-trans :code (behavior () - (loop (let ((f0-0 -1.0)) - (when (and *target* *camera*) - (let ((gp-0 (new 'stack-no-clear 'vector))) - (vector-! gp-0 (target-pos 0) (camera-pos)) - (set! f0-0 (ray-capsule-intersect (-> self cyl) (camera-pos) gp-0)))) - (if (< f0-0 0.0) - (ja :num! (seek! (get-current-value-with-mirror (-> self sync) (-> self max-frame)))) - (ja :num! (seek! 0.0)))) + (loop + (let ((f0-0 -1.0)) + (when (and *target* *camera*) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (vector-! gp-0 (target-pos 0) (camera-pos)) + (set! f0-0 (ray-capsule-intersect (-> self cyl) (camera-pos) gp-0)))) + (if (< f0-0 0.0) + (ja :num! (seek! (get-current-value-with-mirror (-> self sync) (-> self max-frame)))) + (ja :num! (seek! 0.0)))) (suspend))) :post rider-post) @@ -105,9 +106,10 @@ :trans rider-trans :code (behavior () - (loop (if (task-closed? (game-task rolling-race) (task-status need-introduction)) - (ja :num! (seek! (-> self min-frame))) - (ja :num! (seek! (-> self max-frame)))) + (loop + (if (task-closed? (game-task rolling-race) (task-status need-introduction)) + (ja :num! (seek! (-> self min-frame))) + (ja :num! (seek! (-> self max-frame)))) (suspend))) :post rider-post) @@ -161,7 +163,8 @@ (vector+! (-> arg0 root trans) (-> arg0 entity extra trans) s5-1))) (defun dark-plants-all-done ((arg0 dark-plant)) - (loop (if (!= (-> arg0 state) dark-plant-gone) (return #f)) + (loop + (if (!= (-> arg0 state) dark-plant-gone) (return #f)) (if (zero? (-> arg0 num-alts)) (return #t)) (let ((v1-9 (-> arg0 alts 0 extra process))) (if (not v1-9) (return #t)) @@ -201,13 +204,14 @@ (v1-5 (the-as number (logior #x3f800000 v1-4))) (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-5)))) 3000))) (set-time! (-> self state-time)) - (loop (when (and (!= (get-task-status (game-task rolling-plants)) (task-status invalid)) - (!= (get-task-status (game-task rolling-plants)) 7)) - (cond - ((time-elapsed? (-> self state-time) gp-0) (go dark-plant-sprout)) - ((dark-plant-check-target self) (set-time! (-> self state-time))) - ((not (dark-plant-has-bad-neighbor self)) (set-time! (-> self state-time))) - (else))) + (loop + (when (and (!= (get-task-status (game-task rolling-plants)) (task-status invalid)) + (!= (get-task-status (game-task rolling-plants)) 7)) + (cond + ((time-elapsed? (-> self state-time) gp-0) (go dark-plant-sprout)) + ((dark-plant-check-target self) (set-time! (-> self state-time))) + ((not (dark-plant-has-bad-neighbor self)) (set-time! (-> self state-time))) + (else))) (suspend)))) :post ja-post) @@ -228,14 +232,15 @@ :trans dark-plant-trans :code (behavior () - (loop (when (and (logtest? (-> self draw status) (draw-status was-drawn)) - *target* - (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (if (rand-vu-percent? 0.3) (sound-play "darkvine-move")) - (when (task-closed? (game-task rolling-plants) (task-status need-hint)) - (level-hint-spawn (text-id rolling-plants-hint) "sksp0113" (the-as entity #f) *entity-pool* (game-task none)) - (if (not (send-event *target* 'query 'powerup (pickup-type eco-green))) - (level-hint-spawn (text-id rolling-plants-hint-eco-green) "sksp0114" (the-as entity #f) *entity-pool* (game-task none))))) + (loop + (when (and (logtest? (-> self draw status) (draw-status was-drawn)) + *target* + (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (if (rand-vu-percent? 0.3) (sound-play "darkvine-move")) + (when (task-closed? (game-task rolling-plants) (task-status need-hint)) + (level-hint-spawn (text-id rolling-plants-hint) "sksp0113" (the-as entity #f) *entity-pool* (game-task none)) + (if (not (send-event *target* 'query 'powerup (pickup-type eco-green))) + (level-hint-spawn (text-id rolling-plants-hint-eco-green) "sksp0114" (the-as entity #f) *entity-pool* (game-task none))))) (let ((gp-1 (-> self skel root-channel 0))) (set! (-> gp-1 frame-group) (the-as art-joint-anim dark-plant-idle-ja)) (set! (-> gp-1 param 0) (the float (+ (-> (the-as art-joint-anim dark-plant-idle-ja) data 0 length) -1))) @@ -350,7 +355,8 @@ (defstate happy-plant-opened (happy-plant) :code (behavior () - (loop (ja-no-eval :group! happy-plant-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! happy-plant-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -415,7 +421,8 @@ :code (behavior () (clear-collide-with-as (-> self root)) - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -541,7 +548,8 @@ (until (ja-done? 0) (suspend) (ja :num! (seek!))) - (loop (ja-no-eval :group! rolling-start-broken-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! rolling-start-broken-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))) @@ -557,7 +565,8 @@ :code (behavior () (lods-assign! (-> self draw) (-> self whole-look)) - (loop (ja-no-eval :group! rolling-start-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! rolling-start-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -636,7 +645,8 @@ :trans gorge-trans :code (behavior () - (loop (suspend) + (loop + (suspend) (if (gorge-behind self) (send-event (ppointer->process (-> self parent)) 'aborted))))) (defbehavior gorge-abort-init-by-other gorge-abort ((arg0 vector) (arg1 vector) (arg2 float)) @@ -650,7 +660,8 @@ :trans gorge-trans :code (behavior () - (loop (suspend) + (loop + (suspend) (if (gorge-in-front self) (send-event (ppointer->process (-> self parent)) 'finished))))) (defbehavior gorge-finish-init-by-other gorge-finish ((arg0 vector) (arg1 vector) (arg2 float)) @@ -835,7 +846,8 @@ :code (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) - (loop (seconds->race-time (-> self this-time) (- (-> *display* game-frame-counter) (-> self state-time))) + (loop + (seconds->race-time (-> self this-time) (- (-> *display* game-frame-counter) (-> self state-time))) (seekl! (-> self timer-pos-offset) 0 (the int (* 5.0 (-> *display* time-adjust-ratio)))) (completed? (-> self ticker)) (gorge-start-draw-time #f #f) @@ -846,7 +858,8 @@ :trans gorge-trans :code (behavior () - (loop (suspend) + (loop + (suspend) (seekl! (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio)))) (when (= (-> self timer-pos-offset) 100) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'enable) @@ -872,7 +885,8 @@ (gorge-trans)) :code (behavior () - (loop (suspend) + (loop + (suspend) (seekl! (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio)))) (when (= (-> self timer-pos-offset) 100) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'enable) diff --git a/goal_src/jak1/levels/rolling/rolling-race-ring.gc b/goal_src/jak1/levels/rolling/rolling-race-ring.gc index ecd847218f..ad6534713a 100644 --- a/goal_src/jak1/levels/rolling/rolling-race-ring.gc +++ b/goal_src/jak1/levels/rolling/rolling-race-ring.gc @@ -643,7 +643,8 @@ (else (spool-push *art-control* "race-ring-anim" 0 self -99.0)))) :code (behavior () - (loop (suspend) + (loop + (suspend) (cond ((first-ring? self)) ((>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self timeout)) @@ -716,7 +717,8 @@ :code (behavior () (if (nonzero? (-> self sound)) (stop! (-> self sound))) - (loop (suspend) + (loop + (suspend) (when (= (get-task-status (the-as game-task (-> self alt-task))) (task-status invalid)) (close-specific-task! (-> self entity extra perm task) (task-status need-hint)) (logclear! (-> self mask) (process-mask actor-pause)) @@ -730,7 +732,8 @@ :code (behavior () (if (nonzero? (-> self sound)) (stop! (-> self sound))) - (loop (suspend)))) + (loop + (suspend)))) (defmethod init-from-entity! ((this race-ring) (arg0 entity-actor)) (let ((a0-1 arg0)) (if (not (entity-actor-lookup a0-1 'next-actor 0)) (stack-size-set! (-> this main-thread) 512))) diff --git a/goal_src/jak1/levels/rolling/rolling-robber.gc b/goal_src/jak1/levels/rolling/rolling-robber.gc index 8c600e974a..a2c3a4ddc1 100644 --- a/goal_src/jak1/levels/rolling/rolling-robber.gc +++ b/goal_src/jak1/levels/rolling/rolling-robber.gc @@ -23,7 +23,8 @@ (set! (-> *camera-other-trans* quad) (-> *math-camera* trans quad)) (set! (-> *camera-other-root* quad) (-> *math-camera* trans quad)) (set-time! (-> self state-time)) - (loop (*! arg2 (- 1.0 (* 0.05 (-> *display* time-adjust-ratio)))) ;; og:preserve-this changed for high fps + (loop + (*! arg2 (- 1.0 (* 0.05 (-> *display* time-adjust-ratio)))) ;; og:preserve-this changed for high fps (when (and (< (fabs arg2) 13.653334) (time-elapsed? (-> self state-time) (seconds 1.5))) (if *target* (process-release? *target*)) (go-virtual wait)) @@ -200,7 +201,8 @@ (defstate robber-debug (robber) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((a1-1 (new 'stack-no-clear 'vector))) (clmf-input gp-0 a1-1 1)) @@ -284,7 +286,8 @@ (when (not (ja-group? robber-fly-ja)) (ja-channel-push! 1 (seconds 0.2)) (ja :group! robber-fly-ja)) - (loop (ja :num! (loop! (robber-calc-anim-speed))) + (loop + (ja :num! (loop! (robber-calc-anim-speed))) (if (< 27.306667 (fabs (-> self speed))) (set! (-> self speed) (* 0.95 (-> self speed)))) (robber-move) (robber-rotate (the-as target #f) 1820.4445) @@ -305,9 +308,10 @@ (go robber-got-away))) :code (behavior () - (loop (when (not (ja-group? robber-fly-ja)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! robber-fly-ja)) + (loop + (when (not (ja-group? robber-fly-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robber-fly-ja)) (ja :num! (loop! (robber-calc-anim-speed))) (robber-calc-speed 32768.0 122880.0 122060.8 20480.0 #f) (robber-move) @@ -351,9 +355,10 @@ (if (time-elapsed? (-> self far-time) (seconds 3)) (set! (-> self near-timer) (the-as int (-> self timeout))))) :code (behavior () - (loop (when (not (ja-group? robber-fly-ja)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! robber-fly-ja)) + (loop + (when (not (ja-group? robber-fly-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! robber-fly-ja)) (ja :num! (loop! (robber-calc-anim-speed))) (robber-calc-speed 61440.0 122880.0 204800.0 16384.0 #t) (robber-move) @@ -392,7 +397,8 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.2)) - (loop (ja-no-eval :group! robber-idle-hover-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! robber-idle-hover-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -416,7 +422,8 @@ (if (< (vector-dot gp-1 (-> self tangent)) 0.0) (set! f0-1 (- f0-1))) (set! (-> self speed) f0-1)) (ja-channel-push! 1 (seconds 0.2)) - (loop (ja-no-eval :group! robber-spots-ja :num! (seek! max 2.0) :frame-num 0.0) + (loop + (ja-no-eval :group! robber-spots-ja :num! (seek! max 2.0) :frame-num 0.0) (until (ja-done? 0) (robber-calc-speed 61440.0 122880.0 2048.0 2048.0 #t) (robber-rotate (the-as target #f) 1820.4445) @@ -438,7 +445,8 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.2)) - (loop (ja-no-eval :group! robber-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! robber-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) diff --git a/goal_src/jak1/levels/snow/ice-cube.gc b/goal_src/jak1/levels/snow/ice-cube.gc index 5401ae5520..d27703d0ad 100644 --- a/goal_src/jak1/levels/snow/ice-cube.gc +++ b/goal_src/jak1/levels/snow/ice-cube.gc @@ -654,7 +654,8 @@ (until (ja-done? 0) (suspend) (ja :num! (seek!))) - (loop (suspend))) + (loop + (suspend))) :post nav-enemy-falling-post) (defstate ice-cube-appear-land (ice-cube) @@ -747,18 +748,19 @@ (set! gp-0 (nav-enemy-method-60 self (not v1-27)))) (suspend) (ja :num! (seek!))) - (loop (let ((s5-0 (and (>= 0.0 (-> self collide-info transv y)) (logtest? (-> self collide-info status) (cshape-moving-flags onsurf))))) - (set! gp-0 (and s5-0 gp-0)) - (if gp-0 (goto cfg-26)) - (integrate-for-enemy-with-move-to-ground! (-> self collide-info) - (-> self collide-info transv) - (collide-kind background) - 32768.0 - #f - #f - #f) - (+! (-> self collide-info transv y) (* -544768.0 (seconds-per-frame))) - (set! gp-0 (nav-enemy-method-60 self (not s5-0)))) + (loop + (let ((s5-0 (and (>= 0.0 (-> self collide-info transv y)) (logtest? (-> self collide-info status) (cshape-moving-flags onsurf))))) + (set! gp-0 (and s5-0 gp-0)) + (if gp-0 (goto cfg-26)) + (integrate-for-enemy-with-move-to-ground! (-> self collide-info) + (-> self collide-info transv) + (collide-kind background) + 32768.0 + #f + #f + #f) + (+! (-> self collide-info transv y) (* -544768.0 (seconds-per-frame))) + (set! gp-0 (nav-enemy-method-60 self (not s5-0)))) (suspend)) (label cfg-26) (let ((gp-1 (new 'stack-no-clear 'vector))) @@ -844,18 +846,19 @@ (set! gp-0 (nav-enemy-method-60 self (not v1-27)))) (suspend) (ja :num! (seek!))) - (loop (let ((s5-0 (and (>= 0.0 (-> self collide-info transv y)) (logtest? (-> self collide-info status) (cshape-moving-flags onsurf))))) - (set! gp-0 (and s5-0 gp-0)) - (if gp-0 (goto cfg-26)) - (integrate-for-enemy-with-move-to-ground! (-> self collide-info) - (-> self collide-info transv) - (collide-kind background) - 32768.0 - #f - #f - #f) - (+! (-> self collide-info transv y) (* -544768.0 (seconds-per-frame))) - (set! gp-0 (nav-enemy-method-60 self (not s5-0)))) + (loop + (let ((s5-0 (and (>= 0.0 (-> self collide-info transv y)) (logtest? (-> self collide-info status) (cshape-moving-flags onsurf))))) + (set! gp-0 (and s5-0 gp-0)) + (if gp-0 (goto cfg-26)) + (integrate-for-enemy-with-move-to-ground! (-> self collide-info) + (-> self collide-info transv) + (collide-kind background) + 32768.0 + #f + #f + #f) + (+! (-> self collide-info transv y) (* -544768.0 (seconds-per-frame))) + (set! gp-0 (nav-enemy-method-60 self (not s5-0)))) (suspend)) (label cfg-26) (let ((gp-1 (new 'stack-no-clear 'vector))) @@ -971,7 +974,8 @@ (ja-channel-push! 2 (seconds 0.07)) (ja :group! ice-cube-invuln-stopping-upright-ja :num! min) (ja :chan 1 :group! ice-cube-invuln-stopping-ja :num! (chan 0) :frame-interp (-> self anim-blend)) - (loop (suspend) + (loop + (suspend) (ja :num! (loop!)) (ja :chan 1 :num! (chan 0) :frame-interp (-> self anim-blend)))) :post nav-enemy-simple-post) @@ -1024,7 +1028,8 @@ (suspend) (ja :num! (seek!))) (ja-channel-push! 1 (seconds 0.2)) - (loop (ja-no-eval :group! ice-cube-breathing-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! ice-cube-breathing-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) diff --git a/goal_src/jak1/levels/snow/snow-ball.gc b/goal_src/jak1/levels/snow/snow-ball.gc index 6d6107ca6c..c5c3622169 100644 --- a/goal_src/jak1/levels/snow/snow-ball.gc +++ b/goal_src/jak1/levels/snow/snow-ball.gc @@ -97,7 +97,8 @@ 0) :code (behavior () - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend))) :post ja-post) @@ -259,7 +260,8 @@ (snow-ball-roller-path-update)) :code (behavior () - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend))) :post transform-post) @@ -352,16 +354,17 @@ (else (rand-vu-int-range 0 1)))) (let ((s4-0 0) (s5-0 (new 'stack-no-clear 'inline-array 'snow-ball-junction 4))) - (loop (let ((s3-0 (/ (+ 98304.0 (rand-vu-float-range 0.0 32768.0)) (path-distance (-> self path gp-0))))) - (snow-ball-method-14 self s5-0 s3-0 gp-0) - (when (snow-ball-method-15 self s5-0 gp-0) - (process-spawn snow-ball-roller (-> self entity) self s3-0 gp-0 s5-0 :to self) - (set-time! (-> self state-time)) - (set! (-> self delay-til-next) (rand-vu-int-range 450 1650)) - (cond - ((= gp-0 (-> self last-path-picked)) (+! (-> self same-path-picked-count) 1)) - (else (set! (-> self last-path-picked) gp-0) (set! (-> self same-path-picked-count) 1))) - (goto cfg-22))) + (loop + (let ((s3-0 (/ (+ 98304.0 (rand-vu-float-range 0.0 32768.0)) (path-distance (-> self path gp-0))))) + (snow-ball-method-14 self s5-0 s3-0 gp-0) + (when (snow-ball-method-15 self s5-0 gp-0) + (process-spawn snow-ball-roller (-> self entity) self s3-0 gp-0 s5-0 :to self) + (set-time! (-> self state-time)) + (set! (-> self delay-til-next) (rand-vu-int-range 450 1650)) + (cond + ((= gp-0 (-> self last-path-picked)) (+! (-> self same-path-picked-count) 1)) + (else (set! (-> self last-path-picked) gp-0) (set! (-> self same-path-picked-count) 1))) + (goto cfg-22))) (+! s4-0 1) (if (< 5 s4-0) (goto cfg-22))))) (label cfg-22) diff --git a/goal_src/jak1/levels/snow/snow-bumper.gc b/goal_src/jak1/levels/snow/snow-bumper.gc index eb85ce174c..8657dc0e6e 100644 --- a/goal_src/jak1/levels/snow/snow-bumper.gc +++ b/goal_src/jak1/levels/snow/snow-bumper.gc @@ -123,7 +123,8 @@ (behavior () (transform-post) (suspend) - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defstate snow-bumper-active-close-idle (snow-bumper) @@ -160,7 +161,8 @@ (behavior () (transform-post) (suspend) - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defstate snow-bumper-deactivate (snow-bumper) diff --git a/goal_src/jak1/levels/snow/snow-bunny.gc b/goal_src/jak1/levels/snow/snow-bunny.gc index c0ab717af3..20e77f61d9 100644 --- a/goal_src/jak1/levels/snow/snow-bunny.gc +++ b/goal_src/jak1/levels/snow/snow-bunny.gc @@ -322,7 +322,8 @@ (-> self draw art-group data (-> self nav-info idle-anim)) :num! (identity (rand-vu-float-range 0.0 (the float (+ (-> (ja-group) data 0 length) -1))))) - (loop (let ((s5-1 (current-time))) (until (time-elapsed? s5-1 (seconds 2.52)) (suspend) (ja :num! (loop!)))) + (loop + (let ((s5-1 (current-time))) (until (time-elapsed? s5-1 (seconds 2.52)) (suspend) (ja :num! (loop!)))) (cond ((zero? gp-2) (if (nav-enemy-method-53 self) (go-virtual snow-bunny-patrol-hop))) (else (+! gp-2 -1))))))) @@ -718,7 +719,8 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.075)) - (loop (ja-no-eval :group! (-> self draw art-group data (-> self nav-info idle-anim)) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info idle-anim)) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) diff --git a/goal_src/jak1/levels/snow/snow-obs.gc b/goal_src/jak1/levels/snow/snow-obs.gc index c156c36bbb..a8fab872fc 100644 --- a/goal_src/jak1/levels/snow/snow-obs.gc +++ b/goal_src/jak1/levels/snow/snow-obs.gc @@ -244,7 +244,8 @@ (ja-channel-push! 1 0) (ja :group! snow-eggtop-idle-ja :num! min) (transform-post) - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defstate snow-eggtop-activate (snow-eggtop) @@ -307,7 +308,8 @@ (process-entity-status! self (entity-perm-status complete) #t) (let ((a0-18 (-> self entity))) (if (and a0-18 (= self (-> a0-18 extra process))) (entity-task-complete-on a0-18))) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'show) - (loop (if (-> self play-sound?) (update! (-> self sound))) + (loop + (if (-> self play-sound?) (update! (-> self sound))) (suspend))) :post rider-post) @@ -387,16 +389,17 @@ :code (behavior () (let ((gp-0 #f)) - (loop (let ((f0-0 (get-current-phase-with-mirror (-> self sync)))) - (ja :num-func num-func-identity :frame-num (* f0-0 (-> self max-frame))) - (cond - ((or (= f0-0 0.0) (= f0-0 1.0)) (set! gp-0 #f)) - (else - (when (not gp-0) - (set! gp-0 #t) - (if (>= f0-0 0.5) - (sound-play-by-name (-> self close-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) - (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t)))))) + (loop + (let ((f0-0 (get-current-phase-with-mirror (-> self sync)))) + (ja :num-func num-func-identity :frame-num (* f0-0 (-> self max-frame))) + (cond + ((or (= f0-0 0.0) (= f0-0 1.0)) (set! gp-0 #f)) + (else + (when (not gp-0) + (set! gp-0 #t) + (if (>= f0-0 0.5) + (sound-play-by-name (-> self close-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) + (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t)))))) (suspend)))) :post pusher-post) @@ -470,20 +473,21 @@ (behavior () (let ((f28-0 0.0) (gp-0 1)) - (loop (let ((f30-0 (get-current-phase-with-mirror (-> self sync)))) - (when (!= f30-0 f28-0) - (let ((v1-3 1)) - (if (< f30-0 f28-0) (set! v1-3 -1)) - (when (!= v1-3 gp-0) - (set! gp-0 v1-3) - (cond - ((> v1-3 0) (sound-play "snow-spat-long" :pitch (rand-vu-float-range -0.2 0.2))) - (1 (sound-play "snow-spat-short" :pitch (rand-vu-float-range -0.2 0.2)))))) - (set! f28-0 f30-0)) - (let ((s5-2 (new 'stack-no-clear 'matrix))) - (matrix-rotate-y! s5-2 (* 16384.0 f30-0)) - (matrix*! s5-2 s5-2 (-> self startmat)) - (matrix->quaternion (-> self root quat) s5-2))) + (loop + (let ((f30-0 (get-current-phase-with-mirror (-> self sync)))) + (when (!= f30-0 f28-0) + (let ((v1-3 1)) + (if (< f30-0 f28-0) (set! v1-3 -1)) + (when (!= v1-3 gp-0) + (set! gp-0 v1-3) + (cond + ((> v1-3 0) (sound-play "snow-spat-long" :pitch (rand-vu-float-range -0.2 0.2))) + (1 (sound-play "snow-spat-short" :pitch (rand-vu-float-range -0.2 0.2)))))) + (set! f28-0 f30-0)) + (let ((s5-2 (new 'stack-no-clear 'matrix))) + (matrix-rotate-y! s5-2 (* 16384.0 f30-0)) + (matrix*! s5-2 s5-2 (-> self startmat)) + (matrix->quaternion (-> self root quat) s5-2))) (suspend)))) :post plat-post) @@ -703,7 +707,8 @@ (set! (-> self root trans quad) (-> self closed-trans quad)) (transform-post) (suspend) - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defstate snow-fort-gate-activate (snow-fort-gate) @@ -717,11 +722,12 @@ :code (behavior () (let ((gp-0 #f)) - (loop (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> self closed-trans quad)) - (+! (-> a1-0 y) -12288.0) - (+! (-> a1-0 z) -12288.0) - (spawn (-> self part) a1-0)) + (loop + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self closed-trans quad)) + (+! (-> a1-0 y) -12288.0) + (+! (-> a1-0 z) -12288.0) + (spawn (-> self part) a1-0)) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> self root trans quad)) (let ((f30-0 (vector-vector-distance-squared s5-0 (-> self open-trans)))) @@ -756,7 +762,8 @@ (transform-post) (suspend) (transform-post) - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defmethod deactivate ((this snow-fort-gate)) @@ -899,7 +906,8 @@ (behavior () (ja :group! snow-gears-idle-ja :num! min) (ja-post) - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defstate snow-gears-activate (snow-gears) @@ -954,7 +962,8 @@ (behavior () (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defmethod init-from-entity! ((this snow-gears) (arg0 entity-actor)) @@ -1001,7 +1010,8 @@ :event snow-switch-event-handler :code (behavior () - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defstate snow-switch-activate (snow-switch) @@ -1036,14 +1046,15 @@ (the-as uint 0))) 0 (let ((gp-2 #f)) - (loop (let ((s5-1 (new 'stack-no-clear 'vector)) - (f0-1 (+ -1433.6 (-> self orig-trans y)))) - (set! (-> s5-1 quad) (-> self root trans quad)) - (cond - ((= (-> s5-1 y) f0-1) (when (not gp-2) (set! gp-2 #t) (send-to-all (-> self link) 'notice))) - (else - (set! (-> s5-1 y) (seek-with-smooth (-> self root trans y) f0-1 (* 6144.0 (seconds-per-frame)) 0.2 204.8)) - (move-to-point! (-> self root) s5-1)))) + (loop + (let ((s5-1 (new 'stack-no-clear 'vector)) + (f0-1 (+ -1433.6 (-> self orig-trans y)))) + (set! (-> s5-1 quad) (-> self root trans quad)) + (cond + ((= (-> s5-1 y) f0-1) (when (not gp-2) (set! gp-2 #t) (send-to-all (-> self link) 'notice))) + (else + (set! (-> s5-1 y) (seek-with-smooth (-> self root trans y) f0-1 (* 6144.0 (seconds-per-frame)) 0.2 204.8)) + (move-to-point! (-> self root) s5-1)))) (suspend)))) :post rider-post) @@ -1055,7 +1066,8 @@ (set! (-> self root trans quad) (-> self orig-trans quad)) (+! (-> self root trans y) -1433.6) (transform-post) - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defmethod init-from-entity! ((this snow-switch) (arg0 entity-actor)) @@ -1126,8 +1138,9 @@ (('trigger) (go snow-log-activate)))) :code (behavior () - (loop (while (let ((v1-0 (-> self master))) (not (if v1-0 (-> v1-0 extra process)))) - (suspend)) + (loop + (while (let ((v1-0 (-> self master))) (not (if v1-0 (-> v1-0 extra process)))) + (suspend)) (suspend) (let* ((v1-3 (-> self master)) (a0-1 (if v1-3 (-> v1-3 extra process)))) @@ -1193,7 +1206,8 @@ (ja-channel-push! 1 (seconds 0.075)) (let ((gp-0 #t) (s5-0 #t)) - (loop (ja-no-eval :group! snow-log-active-loop-ja :num! (seek! max 0.25) :frame-num 0.0) + (loop + (ja-no-eval :group! snow-log-active-loop-ja :num! (seek! max 0.25) :frame-num 0.0) (until (ja-done? 0) (let ((f0-4 (ja-aframe-num 0))) (cond @@ -1270,7 +1284,8 @@ :event snow-log-button-event-handler :code (behavior () - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defstate snow-log-button-activate (snow-log-button) @@ -1283,17 +1298,18 @@ :code (behavior () (sound-play "prec-button1") - (loop (let ((f30-0 (+ -1433.6 (-> self orig-trans y)))) - (when (= (-> self root trans y) f30-0) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 0) - (set! (-> a1-1 message) 'trigger) - (let ((t9-2 send-event-function) - (v1-4 (-> self log))) - (t9-2 (if v1-4 (-> v1-4 extra process)) a1-1))) - (go snow-log-button-idle-down)) - (set! (-> self root trans y) (seek-with-smooth (-> self root trans y) f30-0 (* 12288.0 (seconds-per-frame)) 0.2 204.8))) + (loop + (let ((f30-0 (+ -1433.6 (-> self orig-trans y)))) + (when (= (-> self root trans y) f30-0) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) self) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'trigger) + (let ((t9-2 send-event-function) + (v1-4 (-> self log))) + (t9-2 (if v1-4 (-> v1-4 extra process)) a1-1))) + (go snow-log-button-idle-down)) + (set! (-> self root trans y) (seek-with-smooth (-> self root trans y) f30-0 (* 12288.0 (seconds-per-frame)) 0.2 204.8))) (suspend))) :post rider-post) @@ -1304,7 +1320,8 @@ (set! (-> self root trans quad) (-> self orig-trans quad)) (+! (-> self root trans y) -1433.6) (transform-post) - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defmethod init-from-entity! ((this snow-log-button) (arg0 entity-actor)) diff --git a/goal_src/jak1/levels/snow/snow-ram-boss.gc b/goal_src/jak1/levels/snow/snow-ram-boss.gc index af702658e1..7ec25a86fb 100644 --- a/goal_src/jak1/levels/snow/snow-ram-boss.gc +++ b/goal_src/jak1/levels/snow/snow-ram-boss.gc @@ -552,25 +552,26 @@ :code (behavior () (set! (-> self charge-sound-id) (sound-play "ramboss-charge")) - (loop (let ((gp-1 (-> self parent-override))) - (when (-> gp-1 0 dead?) - (set! (-> gp-1 0 proj-stoked) #f) - (set! (-> gp-1 0 proj-status) (the-as uint 0)) - (sound-stop (-> self charge-sound-id)) - (go-virtual projectile-dissipate)) - (nav-enemy-method-54 (-> gp-1 0) (-> self root trans)) - (update-transforms! (-> self root)) - (cond - ((-> gp-1 0 proj-stoked) - (set! (-> gp-1 0 proj-stoked) #f) - (set! (-> self growth) (seek-with-smooth (-> self growth) 1.0 (* 1.25 (seconds-per-frame)) 0.8 0.01)) - (if (>= (-> self growth) 1.0) (set! (-> gp-1 0 proj-status) (the-as uint 2)) (set! (-> gp-1 0 proj-status) (the-as uint 1)))) - (else - (set! (-> self growth) 0.0) - (set! (-> gp-1 0 proj-stoked) #f) - (set! (-> gp-1 0 proj-status) (the-as uint 0)) - (sound-stop (-> self charge-sound-id)) - (go-virtual projectile-dissipate)))) + (loop + (let ((gp-1 (-> self parent-override))) + (when (-> gp-1 0 dead?) + (set! (-> gp-1 0 proj-stoked) #f) + (set! (-> gp-1 0 proj-status) (the-as uint 0)) + (sound-stop (-> self charge-sound-id)) + (go-virtual projectile-dissipate)) + (nav-enemy-method-54 (-> gp-1 0) (-> self root trans)) + (update-transforms! (-> self root)) + (cond + ((-> gp-1 0 proj-stoked) + (set! (-> gp-1 0 proj-stoked) #f) + (set! (-> self growth) (seek-with-smooth (-> self growth) 1.0 (* 1.25 (seconds-per-frame)) 0.8 0.01)) + (if (>= (-> self growth) 1.0) (set! (-> gp-1 0 proj-status) (the-as uint 2)) (set! (-> gp-1 0 proj-status) (the-as uint 1)))) + (else + (set! (-> self growth) 0.0) + (set! (-> gp-1 0 proj-stoked) #f) + (set! (-> gp-1 0 proj-status) (the-as uint 0)) + (sound-stop (-> self charge-sound-id)) + (go-virtual projectile-dissipate)))) (let ((f0-6 (-> self growth))) (set-vector! (-> self root scale) f0-6 f0-6 f0-6 1.0)) (spawn (-> self part) (-> self root trans)) (suspend)))) @@ -1012,7 +1013,8 @@ :code (behavior () (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) - (loop (clone-anim-once (ppointer->handle (-> self parent-override)) (the-as int (-> self draw origin-joint-index)) #t "") + (loop + (clone-anim-once (ppointer->handle (-> self parent-override)) (the-as int (-> self draw origin-joint-index)) #t "") (let ((a0-4 (-> self parent-override 0 node-list data 9 bone transform))) (set! (-> self collide-info trans quad) (-> a0-4 vector 3 quad))) (transform-post) @@ -1071,7 +1073,8 @@ (seek-toward-heading-vec! (-> self collide-info) gp-0 182044.44 (seconds 0.01))) (suspend) (ja :num! (seek!))) - (loop (suspend))) + (loop + (suspend))) :post nav-enemy-simple-post) (defstate ram-boss-jump-down-hit-ground (ram-boss) @@ -1234,7 +1237,8 @@ :code (behavior () (let ((f30-0 -1.0)) - (loop (set! f30-0 (ram-boss-method-57 self f30-0)) + (loop + (set! f30-0 (ram-boss-method-57 self f30-0)) (cond ((< 5461.3335 (-> self last-turn-speed)) (cond diff --git a/goal_src/jak1/levels/snow/snow-ram.gc b/goal_src/jak1/levels/snow/snow-ram.gc index 8145a00b01..0002a1b697 100644 --- a/goal_src/jak1/levels/snow/snow-ram.gc +++ b/goal_src/jak1/levels/snow/snow-ram.gc @@ -176,7 +176,8 @@ (behavior () (local-vars (sv-16 symbol)) (ja-channel-push! 1 (seconds 0.075)) - (loop (sound-play "set-ram") + (loop + (sound-play "set-ram") (ja-no-eval :group! ram-cock-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) diff --git a/goal_src/jak1/levels/snow/target-ice.gc b/goal_src/jak1/levels/snow/target-ice.gc index 0e3248d30c..06739f5ffa 100644 --- a/goal_src/jak1/levels/snow/target-ice.gc +++ b/goal_src/jak1/levels/snow/target-ice.gc @@ -104,7 +104,8 @@ (when (not (ja-group? eichar-ice-stance-ja)) (ja-channel-push! 1 (the-as time-frame gp-0)) (ja :group! eichar-ice-stance-ja))) - (loop (suspend) + (loop + (suspend) (ja :num! (loop!)))) :post target-post) @@ -194,7 +195,8 @@ (while (!= (-> self skel root-channel 0) (-> self skel channel)) (suspend))) (else (ja-channel-push! 1 (seconds 0.05)) (ja :group! eichar-ice-skate-ja)))))) - (loop (suspend) + (loop + (suspend) (let* ((s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control unknown-vector01) 1.0)) ;; og:preserve-this modified to avoid dividing by zero when jak's speed is 0. ;; this fixes the issue where jak gets stuck on frame 60 of the ice-walk animation diff --git a/goal_src/jak1/levels/snow/target-snowball.gc b/goal_src/jak1/levels/snow/target-snowball.gc index 3afa5b9f10..682f04e229 100644 --- a/goal_src/jak1/levels/snow/target-snowball.gc +++ b/goal_src/jak1/levels/snow/target-snowball.gc @@ -84,7 +84,8 @@ exit) :code (behavior () - (loop (suspend))) + (loop + (suspend))) :post (behavior () (target-snowball-post))) diff --git a/goal_src/jak1/levels/snow/yeti.gc b/goal_src/jak1/levels/snow/yeti.gc index 4c483df607..b01b764af9 100644 --- a/goal_src/jak1/levels/snow/yeti.gc +++ b/goal_src/jak1/levels/snow/yeti.gc @@ -220,7 +220,8 @@ (until (ja-done? 0) (suspend) (ja :num! (seek!))) - (loop (suspend))) + (loop + (suspend))) :post nav-enemy-falling-post) (defstate yeti-slave-appear-land (yeti-slave) @@ -256,7 +257,8 @@ (suspend) (ja :num! (seek!)))) (else (ja-channel-push! 1 (seconds 0.2)))) - (loop (ja-no-eval :group! yeti-walk-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! yeti-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))) @@ -298,7 +300,8 @@ (ja-channel-push! 1 (seconds 0.2)) (ja :group! (-> self draw art-group data (-> self nav-info run-anim))) (ja :num-func num-func-identity :frame-num 0.0))) - (loop (suspend) + (loop + (suspend) (ja :num! (loop! f30-0)))))) (defstate nav-enemy-stare (yeti-slave) @@ -314,17 +317,18 @@ (until (ja-done? 0) (suspend) (ja :num! (seek! (ja-aframe 68.0 0) f30-0)))) - (loop (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) - (ja-no-eval :num! (loop!)) - (ja-channel-push! 1 (seconds 0.2)) - (ja :group! yeti-turn-ja) - (ja :num-func num-func-identity :frame-num 0.0) - (until (nav-enemy-facing-player? 1820.4445) - (ja-blend-eval) - (suspend) - (ja :num! (loop! 0.75))) - (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel))) + (loop + (when (not (nav-enemy-facing-player? 2730.6667)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! yeti-turn-ja) + (ja :num-func num-func-identity :frame-num 0.0) + (until (nav-enemy-facing-player? 1820.4445) + (ja-blend-eval) + (suspend) + (ja :num! (loop! 0.75))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel))) (if (not (ja-group? yeti-idle-ja)) (ja-channel-push! 1 (seconds 0.2))) (ja-no-eval :group! yeti-idle-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) @@ -483,10 +487,11 @@ (defstate yeti-first-time-start (yeti) :code (behavior () - (loop (when *target* - (when (>= (-> self first-time-spawn-dist) (vector-vector-xz-distance (target-pos 0) (-> self root trans))) - (process-entity-status! self (entity-perm-status complete) #t) - (go yeti-idle))) + (loop + (when *target* + (when (>= (-> self first-time-spawn-dist) (vector-vector-xz-distance (target-pos 0) (-> self root trans))) + (process-entity-status! self (entity-perm-status complete) #t) + (go yeti-idle))) (suspend)))) (defstate yeti-resuming-start (yeti) @@ -510,26 +515,27 @@ (defstate yeti-idle (yeti) :code (behavior () - (loop (cond - ((zero? (-> self spawn-delay)) - (let ((v1-1 0)) - (let ((a0-0 (the-as (pointer process-tree) (-> self child-process)))) - (while a0-0 - (+! v1-1 1) - (set! a0-0 (-> a0-0 0 brother)) - (nop!) - (nop!))) - (when (< v1-1 (-> self desired-num-children)) - (set! (-> self spawn-delay) (rand-vu-int-range 150 1200)) - (set-time! (-> self state-time))))) - (else - (when (time-elapsed? (-> self state-time) (-> self spawn-delay)) - (let ((gp-0 (new 'stack-no-clear 'vector)) - (s5-0 (new 'stack-no-clear 'vector))) - (when (yeti-method-20 self gp-0 s5-0) - (process-spawn yeti-slave (-> self entity) self gp-0 s5-0 #f :to self) - (set! (-> self spawn-delay) 0) - 0))))) + (loop + (cond + ((zero? (-> self spawn-delay)) + (let ((v1-1 0)) + (let ((a0-0 (the-as (pointer process-tree) (-> self child-process)))) + (while a0-0 + (+! v1-1 1) + (set! a0-0 (-> a0-0 0 brother)) + (nop!) + (nop!))) + (when (< v1-1 (-> self desired-num-children)) + (set! (-> self spawn-delay) (rand-vu-int-range 150 1200)) + (set-time! (-> self state-time))))) + (else + (when (time-elapsed? (-> self state-time) (-> self spawn-delay)) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector))) + (when (yeti-method-20 self gp-0 s5-0) + (process-spawn yeti-slave (-> self entity) self gp-0 s5-0 #f :to self) + (set! (-> self spawn-delay) 0) + 0))))) (suspend)))) (defmethod init-from-entity! ((this yeti) (arg0 entity-actor)) diff --git a/goal_src/jak1/levels/sunken/bully.gc b/goal_src/jak1/levels/sunken/bully.gc index e613005c63..3fd7490992 100644 --- a/goal_src/jak1/levels/sunken/bully.gc +++ b/goal_src/jak1/levels/sunken/bully.gc @@ -376,7 +376,8 @@ (if arg0 (ja :group! bully-idle-ja :num! (identity (rand-vu-float-range 0.0 (the float (+ (-> (ja-group) data 0 length) -1))))) (ja :group! bully-idle-ja :num! min)) - (loop (suspend) + (loop + (suspend) (ja :num! (loop!)))) :post bully-post) @@ -474,10 +475,11 @@ (set! (-> self bounced?) #f) (ja-channel-push! 1 (seconds 0.2)) (ja :group! bully-spin-ja :num! min) - (loop (until v1-34 - (suspend) - (ja :num! (seek!)) - (set! v1-34 (or (ja-done? 0) (-> self bounced?)))) + (loop + (until v1-34 + (suspend) + (ja :num! (seek!)) + (set! v1-34 (or (ja-done? 0) (-> self bounced?)))) (when (-> self bounced?) (sound-play "bully-bounce" :vol (the float (-> self bounce-volume))) (until (not (-> self bounced?)) diff --git a/goal_src/jak1/levels/sunken/double-lurker.gc b/goal_src/jak1/levels/sunken/double-lurker.gc index a4abcede2d..bc640065cd 100644 --- a/goal_src/jak1/levels/sunken/double-lurker.gc +++ b/goal_src/jak1/levels/sunken/double-lurker.gc @@ -238,7 +238,8 @@ (go double-lurker-top-on-shoulders-die)))) :code (behavior () - (loop (clone-anim-once (ppointer->handle (-> self parent-process)) (the-as int (-> self draw origin-joint-index)) #t "") + (loop + (clone-anim-once (ppointer->handle (-> self parent-process)) (the-as int (-> self draw origin-joint-index)) #t "") (update-transforms! (-> self collide-info)) (suspend)))) diff --git a/goal_src/jak1/levels/sunken/floating-launcher.gc b/goal_src/jak1/levels/sunken/floating-launcher.gc index fee9921d20..6d008c8946 100644 --- a/goal_src/jak1/levels/sunken/floating-launcher.gc +++ b/goal_src/jak1/levels/sunken/floating-launcher.gc @@ -40,7 +40,8 @@ (suspend) (transform-post) (suspend) - (loop (suspend))) + (loop + (suspend))) :post plat-post) (defstate floating-launcher-lowering (floating-launcher) diff --git a/goal_src/jak1/levels/sunken/helix-water.gc b/goal_src/jak1/levels/sunken/helix-water.gc index f6094aa3e9..9150bb26c0 100644 --- a/goal_src/jak1/levels/sunken/helix-water.gc +++ b/goal_src/jak1/levels/sunken/helix-water.gc @@ -103,7 +103,8 @@ (('trigger) (go helix-slide-door-close)))) :code (behavior () - (loop (suspend)))) + (loop + (suspend)))) (defstate helix-slide-door-close (helix-slide-door) :code @@ -119,7 +120,8 @@ (defstate helix-slide-door-idle-closed (helix-slide-door) :code (behavior () - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defmethod init-from-entity! ((this helix-slide-door) (arg0 entity-actor)) @@ -174,7 +176,8 @@ (else (process-entity-status! self (entity-perm-status complete) #t) (go helix-button-activate)))))))) :code (behavior () - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defstate helix-button-activate (helix-button) @@ -321,7 +324,8 @@ (defstate helix-button-idle-down (helix-button) :code (behavior () - (loop (suspend)))) + (loop + (suspend)))) (defmethod init-from-entity! ((this helix-button) (arg0 entity-actor)) (set! (-> this fcell-handle) (the-as handle #f)) @@ -390,7 +394,8 @@ (set! (-> self transv-y) 9216.0) (suspend) (send-event (ppointer->process (-> self dark-eco)) 'move-to (-> self root trans)) - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend))) :post ja-post) @@ -419,7 +424,8 @@ :code (behavior () (send-event (ppointer->process (-> self dark-eco)) 'trigger) - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend))) :post ja-post) diff --git a/goal_src/jak1/levels/sunken/orbit-plat.gc b/goal_src/jak1/levels/sunken/orbit-plat.gc index 7dcbc54baf..3fac572068 100644 --- a/goal_src/jak1/levels/sunken/orbit-plat.gc +++ b/goal_src/jak1/levels/sunken/orbit-plat.gc @@ -138,7 +138,8 @@ (defstate orbit-plat-bottom-idle (orbit-plat-bottom) :code (behavior () - (loop (set! (-> self root trans quad) (-> self parent-override 0 root trans quad)) + (loop + (set! (-> self root trans quad) (-> self parent-override 0 root trans quad)) (+! (-> self root trans y) -5324.8) (spawn (-> self part2) (-> self root trans)) (let* ((a0-6 (-> self parent-override 0 other)) @@ -228,15 +229,16 @@ (transform-post) (suspend) (if (not (ja-done? 0)) (ja :num! (seek! 0.0)))) - (loop (when (nonzero? (-> self root riders num-riders)) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 0) - (set! (-> a1-2 message) 'go) - (let ((t9-4 send-event-function) - (v1-14 (-> self other))) - (t9-4 (if v1-14 (-> v1-14 extra process)) a1-2))) - (go orbit-plat-riding)) + (loop + (when (nonzero? (-> self root riders num-riders)) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) self) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'go) + (let ((t9-4 send-event-function) + (v1-14 (-> self other))) + (t9-4 (if v1-14 (-> v1-14 extra process)) a1-2))) + (go orbit-plat-riding)) (suspend) (if (not (ja-done? 0)) (ja :num! (seek! 0.0))) (when (not (-> self is-reset?)) @@ -294,15 +296,16 @@ (behavior () (set! (-> self plat-status) (the-as uint 1)) (ja-no-eval :num! (seek!)) - (loop (when (zero? (-> self root riders num-riders)) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 0) - (set! (-> a1-1 message) 'stop) - (let ((t9-1 send-event-function) - (v1-13 (-> self other))) - (t9-1 (if v1-13 (-> v1-13 extra process)) a1-1))) - (go orbit-plat-still)) + (loop + (when (zero? (-> self root riders num-riders)) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) self) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'stop) + (let ((t9-1 send-event-function) + (v1-13 (-> self other))) + (t9-1 (if v1-13 (-> v1-13 extra process)) a1-1))) + (go orbit-plat-still)) (suspend) (if (not (ja-done? 0)) (ja :num! (seek!))))) :post plat-post) @@ -472,7 +475,8 @@ (behavior () (set! (-> self plat-status) (the-as uint 0)) (ja-no-eval :num! (seek! 0.0)) - (loop (let ((v1-3 (-> self other))) (when (if v1-3 (-> v1-3 extra process)) (suspend) (go orbit-plat-idle))) + (loop + (let ((v1-3 (-> self other))) (when (if v1-3 (-> v1-3 extra process)) (suspend) (go orbit-plat-idle))) (suspend) (if (not (ja-done? 0)) (ja :num! (seek! 0.0))))) :post ja-post) diff --git a/goal_src/jak1/levels/sunken/puffer.gc b/goal_src/jak1/levels/sunken/puffer.gc index 02ecd4beec..377754bc8e 100644 --- a/goal_src/jak1/levels/sunken/puffer.gc +++ b/goal_src/jak1/levels/sunken/puffer.gc @@ -310,11 +310,12 @@ 0) :code (behavior () - (loop (if (and (and *target* - (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (logtest? (-> self draw status) (draw-status was-drawn)) - (time-elapsed? (-> self state-time) (seconds 0.2))) - (go puffer-patrol)) + (loop + (if (and (and *target* + (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (logtest? (-> self draw status) (draw-status was-drawn)) + (time-elapsed? (-> self state-time) (seconds 0.2))) + (go puffer-patrol)) (puffer-method-26 self) (suspend))) :post puffer-post) @@ -358,7 +359,8 @@ (puffer-method-28 self)) :code (behavior () - (loop (puffer-method-26 self) + (loop + (puffer-method-26 self) (suspend))) :post puffer-post) @@ -392,7 +394,8 @@ (puffer-method-28 self)) :code (behavior () - (loop (puffer-method-26 self) + (loop + (puffer-method-26 self) (suspend))) :post puffer-post) diff --git a/goal_src/jak1/levels/sunken/qbert-plat.gc b/goal_src/jak1/levels/sunken/qbert-plat.gc index c2639b9e5e..1ee2b2c621 100644 --- a/goal_src/jak1/levels/sunken/qbert-plat.gc +++ b/goal_src/jak1/levels/sunken/qbert-plat.gc @@ -94,10 +94,11 @@ :code (behavior () (set-vector! (-> self draw color-emissive) 0.0 0.0 1.0 0.0) - (loop (let ((gp-0 (-> self parent))) - (set! (-> self root-overlay trans quad) (-> (the-as (pointer rigid-body-platform) gp-0) 0 root-overlay trans quad)) - (quaternion-copy! (-> self root-overlay quat) (-> (the-as (pointer rigid-body-platform) gp-0) 0 root-overlay quat)) - (set! (-> self root-overlay scale quad) (-> (the-as (pointer rigid-body-platform) gp-0) 0 root-overlay scale quad))) + (loop + (let ((gp-0 (-> self parent))) + (set! (-> self root-overlay trans quad) (-> (the-as (pointer rigid-body-platform) gp-0) 0 root-overlay trans quad)) + (quaternion-copy! (-> self root-overlay quat) (-> (the-as (pointer rigid-body-platform) gp-0) 0 root-overlay quat)) + (set! (-> self root-overlay scale quad) (-> (the-as (pointer rigid-body-platform) gp-0) 0 root-overlay scale quad))) (suspend))) :post ja-post) @@ -146,11 +147,12 @@ (defstate qbert-plat-wait-for-master (qbert-plat) :code (behavior () - (loop (let ((v1-0 (-> self master))) - (when (if v1-0 (-> v1-0 extra process)) - (suspend) - (rigid-body-platform-method-32 self) - (go-virtual rigid-body-platform-idle))) + (loop + (let ((v1-0 (-> self master))) + (when (if v1-0 (-> v1-0 extra process)) + (suspend) + (rigid-body-platform-method-32 self) + (go-virtual rigid-body-platform-idle))) (suspend) 0)) :post ja-post) @@ -160,7 +162,8 @@ :event qbert-plat-event-handler :code (behavior () - (loop (suspend))) + (loop + (suspend))) :post ja-post) (defstate rigid-body-platform-float (qbert-plat) @@ -281,26 +284,27 @@ (if (!= s5-1 a0-13) (go qbert-plat-master-do-door a0-13)))))))))) :code (behavior () - (loop (when (not (-> self puzzle-beaten?)) - (when (task-complete? *game-info* (game-task sunken-platforms)) - (set! (-> self puzzle-beaten?) #t) - (set! (-> self plat-states) (-> self plat-states-needed-to-open-door)) - (set! (-> self play-door-cam?) #f) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 0) - (set! (-> a1-1 message) 'trigger) - (let ((t9-1 send-event-function) - (v1-8 (-> self door))) - (t9-1 (if v1-8 (-> v1-8 extra process)) a1-1))) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 0) - (set! (-> a1-2 message) 'trigger) - (let ((t9-2 send-event-function) - (v1-12 (-> self door-plat))) - (t9-2 (if v1-12 (-> v1-12 extra process)) a1-2))) - (send-to-all (-> self link) 'notify))) + (loop + (when (not (-> self puzzle-beaten?)) + (when (task-complete? *game-info* (game-task sunken-platforms)) + (set! (-> self puzzle-beaten?) #t) + (set! (-> self plat-states) (-> self plat-states-needed-to-open-door)) + (set! (-> self play-door-cam?) #f) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) self) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'trigger) + (let ((t9-1 send-event-function) + (v1-8 (-> self door))) + (t9-1 (if v1-8 (-> v1-8 extra process)) a1-1))) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) self) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'trigger) + (let ((t9-2 send-event-function) + (v1-12 (-> self door-plat))) + (t9-2 (if v1-12 (-> v1-12 extra process)) a1-2))) + (send-to-all (-> self link) 'notify))) (when (and *target* (not (-> self puzzle-beaten?))) (let ((gp-0 #f)) (let ((s5-1 (logtest? (-> *target* water flags) (water-flags wt09)))) @@ -426,17 +430,18 @@ (defstate qbert-plat-master-wait-for-door (qbert-plat-master) :code (behavior () - (loop (let* ((v1-0 (-> self door)) - (gp-0 (if v1-0 (-> v1-0 extra process))) - (v1-2 (-> self door-plat)) - (s5-0 (if v1-2 (-> v1-2 extra process)))) - (when (and gp-0 s5-0) - (logclear! (-> s5-0 mask) (process-mask platform)) - (when (-> self puzzle-beaten?) - (suspend) - (send-event gp-0 'trigger) - (send-event s5-0 'trigger)) - (go qbert-plat-master-idle))) + (loop + (let* ((v1-0 (-> self door)) + (gp-0 (if v1-0 (-> v1-0 extra process))) + (v1-2 (-> self door-plat)) + (s5-0 (if v1-2 (-> v1-2 extra process)))) + (when (and gp-0 s5-0) + (logclear! (-> s5-0 mask) (process-mask platform)) + (when (-> self puzzle-beaten?) + (suspend) + (send-event gp-0 'trigger) + (send-event s5-0 'trigger)) + (go qbert-plat-master-idle))) (suspend)))) (defmethod init-from-entity! ((this qbert-plat-master) (arg0 entity-actor)) diff --git a/goal_src/jak1/levels/sunken/square-platform.gc b/goal_src/jak1/levels/sunken/square-platform.gc index 2162738405..b959b515f3 100644 --- a/goal_src/jak1/levels/sunken/square-platform.gc +++ b/goal_src/jak1/levels/sunken/square-platform.gc @@ -207,7 +207,8 @@ :code (behavior () (set! (-> self pos-u) 0.0) - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defstate square-platform-rising (square-platform) @@ -232,7 +233,8 @@ (square-platform-method-27 self #t)) :code (behavior () - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend))) :post plat-post) @@ -246,7 +248,8 @@ :code (behavior () (set! (-> self pos-u) 1.0) - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend))) :post plat-post) @@ -273,7 +276,8 @@ (square-platform-method-27 self #f)) :code (behavior () - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend))) :post plat-post) @@ -441,7 +445,8 @@ (let ((v1-20 (-> self plat-id)) (a0-5 (-> self plat-id-dir)) (a1-3 (-> self plat-mask))) - (loop (+! v1-20 a0-5) + (loop + (+! v1-20 a0-5) (cond ((<= v1-20 0) (set! (-> self plat-id) 0) (return #f)) ((>= v1-20 32) (set! (-> self plat-id) 32) (return #f)) diff --git a/goal_src/jak1/levels/sunken/steam-cap.gc b/goal_src/jak1/levels/sunken/steam-cap.gc index 052d580c9a..da819c2415 100644 --- a/goal_src/jak1/levels/sunken/steam-cap.gc +++ b/goal_src/jak1/levels/sunken/steam-cap.gc @@ -527,7 +527,8 @@ :trans rider-trans :code (behavior () - (loop (steam-cap-method-20 self) + (loop + (steam-cap-method-20 self) (steam-cap-method-21 self) (suspend))) :post rider-post) diff --git a/goal_src/jak1/levels/sunken/sun-exit-chamber.gc b/goal_src/jak1/levels/sunken/sun-exit-chamber.gc index 88b8f4f212..41646b32d1 100644 --- a/goal_src/jak1/levels/sunken/sun-exit-chamber.gc +++ b/goal_src/jak1/levels/sunken/sun-exit-chamber.gc @@ -168,7 +168,8 @@ :code (behavior () (set! (-> self root trans quad) (-> self rest-pos quad)) - (loop (let ((f0-0 (-> self parent-process 0 open-level))) (if (< 0.0 f0-0) (go blue-eco-charger-orb-active))) + (loop + (let ((f0-0 (-> self parent-process 0 open-level))) (if (< 0.0 f0-0) (go blue-eco-charger-orb-active))) (suspend))) :post ja-post) @@ -182,37 +183,38 @@ (init-vf0-vector) (blue-eco-charger-orb-method-20 self (-> self parent-process 0 open-level)) (vector-reset! (-> self orbit-rotv)) - (loop (let ((f30-0 (-> self parent-process 0 open-level))) - (if (>= 0.0 f30-0) (go blue-eco-charger-orb-idle)) - (if (zero? (rand-vu-int-count 30)) (blue-eco-charger-orb-method-20 self f30-0)) - (set! (-> self orbit-rotv x) - (seek-with-smooth (-> self orbit-rotv x) (-> self targ-orbit-rotv x) 873.81335 0.8 0.12136297)) - (set! (-> self orbit-rotv y) - (seek-with-smooth (-> self orbit-rotv y) (-> self targ-orbit-rotv y) 873.81335 0.8 0.12136297)) - (set! (-> self orbit-rotv z) - (seek-with-smooth (-> self orbit-rotv z) (-> self targ-orbit-rotv z) 873.81335 0.8 0.12136297)) - (let ((a1-5 (-> self orbit-rot)) - (v1-13 (-> self orbit-rot)) - (a0-6 (new 'stack-no-clear 'vector))) - (.lvf vf1 (&-> (-> self orbit-rotv) quad)) - (let ((f0-11 (seconds-per-frame))) (.mov at-0 f0-11)) - (.mov vf2 at-0) - (.mov.vf vf1 vf0 :mask #b1000) - (.mul.x.vf vf1 vf1 vf2 :mask #b111) - (.svf (&-> a0-6 quad) vf1) - (vector+! a1-5 v1-13 a0-6)) - (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 x) (* 1228.8 f30-0 (cos (-> self orbit-rot x)))) - (set! (-> gp-0 y) (* 1228.8 f30-0 (cos (-> self orbit-rot y)))) - (set! (-> gp-0 z) (* 1228.8 f30-0 (cos (-> self orbit-rot z)))) - (vector+! (-> self root trans) gp-0 (-> self rest-pos)) - (set-vector! gp-0 - (cos (* 436.90668 (the float (mod (current-time) 150)))) - (cos (* 247.39902 (the float (mod (current-time) 264)))) - (cos (* 601.7998 (the float (mod (current-time) 108)))) - 1.0) - (vector-normalize! gp-0 1.0) - (quaternion-vector-angle! (-> self root quat) gp-0 (* 463.8075 (the float (mod (current-time) 141)))))) + (loop + (let ((f30-0 (-> self parent-process 0 open-level))) + (if (>= 0.0 f30-0) (go blue-eco-charger-orb-idle)) + (if (zero? (rand-vu-int-count 30)) (blue-eco-charger-orb-method-20 self f30-0)) + (set! (-> self orbit-rotv x) + (seek-with-smooth (-> self orbit-rotv x) (-> self targ-orbit-rotv x) 873.81335 0.8 0.12136297)) + (set! (-> self orbit-rotv y) + (seek-with-smooth (-> self orbit-rotv y) (-> self targ-orbit-rotv y) 873.81335 0.8 0.12136297)) + (set! (-> self orbit-rotv z) + (seek-with-smooth (-> self orbit-rotv z) (-> self targ-orbit-rotv z) 873.81335 0.8 0.12136297)) + (let ((a1-5 (-> self orbit-rot)) + (v1-13 (-> self orbit-rot)) + (a0-6 (new 'stack-no-clear 'vector))) + (.lvf vf1 (&-> (-> self orbit-rotv) quad)) + (let ((f0-11 (seconds-per-frame))) (.mov at-0 f0-11)) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> a0-6 quad) vf1) + (vector+! a1-5 v1-13 a0-6)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 x) (* 1228.8 f30-0 (cos (-> self orbit-rot x)))) + (set! (-> gp-0 y) (* 1228.8 f30-0 (cos (-> self orbit-rot y)))) + (set! (-> gp-0 z) (* 1228.8 f30-0 (cos (-> self orbit-rot z)))) + (vector+! (-> self root trans) gp-0 (-> self rest-pos)) + (set-vector! gp-0 + (cos (* 436.90668 (the float (mod (current-time) 150)))) + (cos (* 247.39902 (the float (mod (current-time) 264)))) + (cos (* 601.7998 (the float (mod (current-time) 108)))) + 1.0) + (vector-normalize! gp-0 1.0) + (quaternion-vector-angle! (-> self root quat) gp-0 (* 463.8075 (the float (mod (current-time) 141)))))) (let ((gp-1 (new 'stack-no-clear 'vector))) (set! (-> gp-1 x) (rand-vu-float-range -4096.0 4096.0)) (set! (-> gp-1 y) (rand-vu-float-range -4096.0 4096.0)) @@ -263,10 +265,11 @@ (set! (-> self open-level) 0.0) (ja-channel-set! 1) (ja :group! blue-eco-charger-open-ja :num! min) - (loop (when (logtest? (-> self draw status) (draw-status was-drawn)) - (if (and (and *target* (>= 16384.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (not (send-event *target* 'query 'powerup (pickup-type eco-blue)))) - (level-hint-spawn (text-id sunken-blue-eco-charger-hint) "sksp0125" (the-as entity #f) *entity-pool* (game-task none)))) + (loop + (when (logtest? (-> self draw status) (draw-status was-drawn)) + (if (and (and *target* (>= 16384.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (not (send-event *target* 'query 'powerup (pickup-type eco-blue)))) + (level-hint-spawn (text-id sunken-blue-eco-charger-hint) "sksp0125" (the-as entity #f) *entity-pool* (game-task none)))) (when (blue-eco-charger-method-20 self) (increment-success-for-hint (text-id sunken-blue-eco-charger-hint)) (go blue-eco-charger-open #t)) @@ -291,16 +294,17 @@ (suspend) (ja :num! (seek!)) (set! (-> self open-level) (/ (ja-frame-num 0) (the float (+ (-> (ja-group) data 0 length) -1))))) - (loop (cond - ((zero? (get-reminder (get-task-control (game-task sunken-room)) 0)) - (when (time-elapsed? (-> self state-time) (seconds 20)) - (level-hint-spawn (text-id sunken-blue-eco-charger-all-hint) - "sksp0133" - (the-as entity #f) - *entity-pool* - (game-task none)) - (go blue-eco-charger-close))) - (else (go blue-eco-charger-stuck-open))) + (loop + (cond + ((zero? (get-reminder (get-task-control (game-task sunken-room)) 0)) + (when (time-elapsed? (-> self state-time) (seconds 20)) + (level-hint-spawn (text-id sunken-blue-eco-charger-all-hint) + "sksp0133" + (the-as entity #f) + *entity-pool* + (game-task none)) + (go blue-eco-charger-close))) + (else (go blue-eco-charger-stuck-open))) (suspend))) :post ja-post) @@ -310,7 +314,8 @@ (update! (-> self sound))) :code (behavior () - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defstate blue-eco-charger-close (blue-eco-charger) @@ -478,9 +483,10 @@ (logclear! (-> self draw status) (draw-status hidden))) :code (behavior () - (loop (if (>= 214228270000.0 (vector-vector-distance-squared (camera-pos) (-> self root trans))) - (logclear! (-> self draw status) (draw-status hidden)) - (logior! (-> self draw status) (draw-status hidden))) + (loop + (if (>= 214228270000.0 (vector-vector-distance-squared (camera-pos) (-> self root trans))) + (logclear! (-> self draw status) (draw-status hidden)) + (logior! (-> self draw status) (draw-status hidden))) (suspend))) :post ja-post) @@ -517,9 +523,10 @@ (set! (-> self wave-scale) 0.0) (if (-> self door) (send-event (ppointer->process (-> self door)) 'trigger)) (if (-> self button) (send-event (ppointer->process (-> self button)) 'untrigger)) - (loop (if (>= 214228270000.0 (vector-vector-distance-squared (camera-pos) (-> self root trans))) - (logclear! (-> self draw status) (draw-status hidden)) - (logior! (-> self draw status) (draw-status hidden))) + (loop + (if (>= 214228270000.0 (vector-vector-distance-squared (camera-pos) (-> self root trans))) + (logclear! (-> self draw status) (draw-status hidden)) + (logior! (-> self draw status) (draw-status hidden))) (suspend)))) (defstate exit-chamber-rise (exit-chamber) @@ -654,7 +661,8 @@ (exit-chamber-method-20 self 1.0) (suspend) (logclear! (-> self draw status) (draw-status skip-bones))) - (loop (exit-chamber-method-20 self 1.0) + (loop + (exit-chamber-method-20 self 1.0) (suspend))) :post (behavior () diff --git a/goal_src/jak1/levels/sunken/sun-iris-door.gc b/goal_src/jak1/levels/sunken/sun-iris-door.gc index 80203c0204..f08daf52e8 100644 --- a/goal_src/jak1/levels/sunken/sun-iris-door.gc +++ b/goal_src/jak1/levels/sunken/sun-iris-door.gc @@ -72,7 +72,8 @@ (if (should-open? self) (go sun-iris-door-opening)))) :code (behavior () - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend))) :post (behavior () @@ -167,7 +168,8 @@ (go sun-iris-door-closing))) :code (behavior () - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend))) :post (behavior () diff --git a/goal_src/jak1/levels/sunken/sunken-fish.gc b/goal_src/jak1/levels/sunken/sunken-fish.gc index 3e68fde2c8..50547a4013 100644 --- a/goal_src/jak1/levels/sunken/sunken-fish.gc +++ b/goal_src/jak1/levels/sunken/sunken-fish.gc @@ -151,7 +151,8 @@ (sunkenfisha-method-23 self))) :code (behavior () - (loop (ja-no-eval :group! sunkenfisha-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! sunkenfisha-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) diff --git a/goal_src/jak1/levels/sunken/sunken-obs.gc b/goal_src/jak1/levels/sunken/sunken-obs.gc index 51ce6e1f15..3b5d35b859 100644 --- a/goal_src/jak1/levels/sunken/sunken-obs.gc +++ b/goal_src/jak1/levels/sunken/sunken-obs.gc @@ -250,7 +250,8 @@ (while (not (ja-done? 0)) (suspend) (ja-eval)) - (loop (ja-no-eval :group! seaweed-idle-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) + (loop + (ja-no-eval :group! seaweed-idle-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max (-> self anim-speed)))))) diff --git a/goal_src/jak1/levels/sunken/sunken-pipegame.gc b/goal_src/jak1/levels/sunken/sunken-pipegame.gc index 7bd29e7157..3c81122d5b 100644 --- a/goal_src/jak1/levels/sunken/sunken-pipegame.gc +++ b/goal_src/jak1/levels/sunken/sunken-pipegame.gc @@ -468,7 +468,8 @@ (go sunken-pipegame-begin-play))))) :code (behavior () - (loop (suspend)))) + (loop + (suspend)))) (defstate sunken-pipegame-begin-play (sunken-pipegame) :event diff --git a/goal_src/jak1/levels/sunken/target-tube.gc b/goal_src/jak1/levels/sunken/target-tube.gc index eaf718471a..32e95bb534 100644 --- a/goal_src/jak1/levels/sunken/target-tube.gc +++ b/goal_src/jak1/levels/sunken/target-tube.gc @@ -458,7 +458,8 @@ (ja :num! (seek!))) (set! (-> self tube turn-anim-frame) 0.0)) (else (ja-channel-push! 1 (seconds 0.04)))) - (loop (set! (-> self tube turn-anim-targ) (* 20.0 (-> self tube mod-x))) + (loop + (set! (-> self tube turn-anim-targ) (* 20.0 (-> self tube mod-x))) (target-tube-turn-anim) (suspend))) :post @@ -501,7 +502,8 @@ (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!)) (suspend))) (ja-no-eval :group! eichar-jump-loop-ja :num! (loop!) :frame-num 0.0) - (loop (suspend) + (loop + (suspend) (ja :group! eichar-jump-loop-ja :num! (loop!)))) :post (-> target-tube diff --git a/goal_src/jak1/levels/sunken/wall-plat.gc b/goal_src/jak1/levels/sunken/wall-plat.gc index d2b1c89b37..3a4659da92 100644 --- a/goal_src/jak1/levels/sunken/wall-plat.gc +++ b/goal_src/jak1/levels/sunken/wall-plat.gc @@ -44,7 +44,8 @@ (move-to-point! (-> self root) (-> self in-trans)) (transform-post) (clear-collide-with-as (-> self root)) - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defstate wall-plat-extending (wall-plat) @@ -60,7 +61,8 @@ (behavior () (restore-collide-with-as (-> self root)) (set-time! (-> self state-time)) - (loop (seek! (-> self extended-amount) 1.0 (* 2.5 (seconds-per-frame))) + (loop + (seek! (-> self extended-amount) 1.0 (* 2.5 (seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-lerp! gp-0 (-> self in-trans) (-> self out-trans) (-> self extended-amount)) (move-to-point! (-> self root) gp-0)) @@ -78,7 +80,8 @@ (set! (-> self extended-amount) 1.0) (move-to-point! (-> self root) (-> self out-trans)) (transform-post) - (loop (logior! (-> self mask) (process-mask sleep-code)) + (loop + (logior! (-> self mask) (process-mask sleep-code)) (suspend)))) (defstate wall-plat-retracting (wall-plat) @@ -93,7 +96,8 @@ :code (behavior () (set-time! (-> self state-time)) - (loop (seek! (-> self extended-amount) 0.0 (* 2.5 (seconds-per-frame))) + (loop + (seek! (-> self extended-amount) 0.0 (* 2.5 (seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-lerp! gp-0 (-> self in-trans) (-> self out-trans) (-> self extended-amount)) (move-to-point! (-> self root) gp-0)) @@ -116,14 +120,15 @@ :code (behavior () (let ((gp-0 #f)) - (loop (let ((f30-0 (get-current-phase-with-mirror (-> self sync)))) - (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-lerp! s5-0 (-> self in-trans) (-> self out-trans) f30-0) - (move-to-point! (-> self root) s5-0)) - (cond - ((= f30-0 0.0) (set! gp-0 #f) (clear-collide-with-as (-> self root))) - ((= f30-0 1.0) (set! gp-0 #f) (restore-collide-with-as (-> self root))) - (else (when (not gp-0) (sound-play "wall-plat") (set! gp-0 #t)) (restore-collide-with-as (-> self root))))) + (loop + (let ((f30-0 (get-current-phase-with-mirror (-> self sync)))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-lerp! s5-0 (-> self in-trans) (-> self out-trans) f30-0) + (move-to-point! (-> self root) s5-0)) + (cond + ((= f30-0 0.0) (set! gp-0 #f) (clear-collide-with-as (-> self root))) + ((= f30-0 1.0) (set! gp-0 #f) (restore-collide-with-as (-> self root))) + (else (when (not gp-0) (sound-play "wall-plat") (set! gp-0 #t)) (restore-collide-with-as (-> self root))))) (suspend)))) :post rider-post) diff --git a/goal_src/jak1/levels/sunken/wedge-plats.gc b/goal_src/jak1/levels/sunken/wedge-plats.gc index 804b462495..845e5d330e 100644 --- a/goal_src/jak1/levels/sunken/wedge-plats.gc +++ b/goal_src/jak1/levels/sunken/wedge-plats.gc @@ -26,8 +26,9 @@ (defstate wedge-plat-master-idle (wedge-plat-master) :code (behavior () - (loop (set! (-> self rotate-inner) - (the float (sar (shl (the int (+ (-> self rotate-inner) (* (-> self rotspeed) (seconds-per-frame)))) 48) 48))) + (loop + (set! (-> self rotate-inner) + (the float (sar (shl (the int (+ (-> self rotate-inner) (* (-> self rotspeed) (seconds-per-frame)))) 48) 48))) (set! (-> self rotate-outer) (the float (sar (shl (the int (- (-> self rotate-outer) (* (-> self rotspeed) (seconds-per-frame)))) 48) 48))) (suspend)))) @@ -84,7 +85,8 @@ :code (behavior () (ja :num-func num-func-identity :frame-num (ja-aframe 0.0 0)) - (loop (if (wedge-plat-method-27 self) (go wedge-plat-tip)) + (loop + (if (wedge-plat-method-27 self) (go wedge-plat-tip)) (suspend))) :post plat-post) @@ -185,7 +187,8 @@ :trans plat-trans :code (behavior () - (loop (ja :num-func num-func-identity :frame-num (ja-aframe 0.0 0)) + (loop + (ja :num-func num-func-identity :frame-num (ja-aframe 0.0 0)) (if (wedge-plat-method-27 self) (go wedge-plat-outer-tip)) (suspend))) :post plat-post) diff --git a/goal_src/jak1/levels/swamp/billy.gc b/goal_src/jak1/levels/swamp/billy.gc index 4ecd17c595..aed62b4243 100644 --- a/goal_src/jak1/levels/swamp/billy.gc +++ b/goal_src/jak1/levels/swamp/billy.gc @@ -58,7 +58,8 @@ (suspend) (ja :num! (seek!))) (deactivate self) - (loop (suspend))) + (loop + (suspend))) :post ja-post) (defstate billy-snack-idle (billy-snack) @@ -68,7 +69,8 @@ (('eat) (go billy-snack-eat)))) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -660,7 +662,8 @@ (spool-push *art-control* "billy-reject" 0 self -99.0)) :code (behavior () - (loop (billy-game-update) + (loop + (billy-game-update) (if (or (zero? (-> self num-snacks)) (and (zero? (-> self num-rats)) (-> self passed-last-stage)) (and *cheat-mode* (cpad-pressed? 1 x))) @@ -716,7 +719,8 @@ :code (behavior () (if (!= (ja-group) (get-art-elem self)) (ja-channel-push! 1 (seconds 0.2))) - (loop (ja :group! (get-art-elem self)) + (loop + (ja :group! (get-art-elem self)) (let* ((f30-0 5.0) (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-10 (the-as number (logior #x3f800000 v1-9)))) diff --git a/goal_src/jak1/levels/swamp/kermit.gc b/goal_src/jak1/levels/swamp/kermit.gc index 977fc345a7..d0491267dd 100644 --- a/goal_src/jak1/levels/swamp/kermit.gc +++ b/goal_src/jak1/levels/swamp/kermit.gc @@ -726,7 +726,8 @@ nav-enemy-default-event-handler (behavior () (kermit-disable-tongue) (ja :group! kermit-idle-ja :num! min) - (loop (ja :num! (loop!)) + (loop + (ja :num! (loop!)) (suspend))) :post ja-post) @@ -749,7 +750,8 @@ nav-enemy-default-event-handler (if (logtest? (nav-control-flags navcf19) (-> self nav flags)) (kermit-get-new-patrol-point))) :code (behavior () - (loop (ja-no-eval :group! kermit-idle-ja :num! (seek! max 3.0) :frame-num 0.0) + (loop + (ja-no-eval :group! kermit-idle-ja :num! (seek! max 3.0) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max 3.0))) @@ -814,7 +816,8 @@ nav-enemy-default-event-handler (until (ja-done? 0) (suspend) (ja :num! (seek! max 4.0)))) - (loop (kermit-hop 81920.0) + (loop + (kermit-hop 81920.0) (nop!))) :post kermit-post) @@ -845,7 +848,8 @@ nav-enemy-default-event-handler :code (behavior () (ja-channel-push! 1 (seconds 0.17)) - (loop (ja-no-eval :group! kermit-idle-ja :num! (seek! max 3.0) :frame-num 0.0) + (loop + (ja-no-eval :group! kermit-idle-ja :num! (seek! max 3.0) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max 3.0))) @@ -913,7 +917,8 @@ nav-enemy-default-event-handler :code (behavior () (ja-channel-push! 1 (seconds 0.1)) - (loop (ja-no-eval :group! kermit-turn-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! kermit-turn-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (sound-play "kermit-stretch" :id (-> self sound-id) :position (the-as symbol (-> self collide-info trans))) (suspend) @@ -953,7 +958,8 @@ nav-enemy-default-event-handler (ja :num! (seek!))) (set! (-> self tongue-control forward-scale-control) 0.0) (kermit-disable-tongue) - (loop (ja-channel-push! 1 (seconds 0.1)) + (loop + (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! kermit-idle-ja :num! (seek! max 4.0) :frame-num 0.0) (until (ja-done? 0) (suspend) diff --git a/goal_src/jak1/levels/swamp/swamp-bat.gc b/goal_src/jak1/levels/swamp/swamp-bat.gc index b854923c66..1fe7ca43fa 100644 --- a/goal_src/jak1/levels/swamp/swamp-bat.gc +++ b/goal_src/jak1/levels/swamp/swamp-bat.gc @@ -151,16 +151,17 @@ swamp-bat-slave-event-handler (f1-0 32768.0) (s3-0 (the int (* f0-0 (/ 1.0 f1-0) (vector-vector-distance s5-0 (-> self idle-position)))))) (forward-up->quaternion gp-0 s2-0 (new 'static 'vector :y 1.0 :w 1.0)) - (loop (let ((v1-17 (- (current-time) (-> self state-time)))) - (when (>= v1-17 s3-0) - 0 - (goto cfg-10)) - (let ((f30-1 (/ (the float v1-17) (the float s3-0)))) - (when *run-time-assert-enable* - (set-pos *__private-assert-info* "swamp-bat" (the-as uint 283) (the-as uint 20)) - (__assert (< f30-1 1.0) "(< interp 1.0)")) - (vector-lerp! (-> self root trans) s5-0 (-> self idle-position) f30-1) - (quaternion-slerp! (-> self root quat) s4-0 gp-0 f30-1))) + (loop + (let ((v1-17 (- (current-time) (-> self state-time)))) + (when (>= v1-17 s3-0) + 0 + (goto cfg-10)) + (let ((f30-1 (/ (the float v1-17) (the float s3-0)))) + (when *run-time-assert-enable* + (set-pos *__private-assert-info* "swamp-bat" (the-as uint 283) (the-as uint 20)) + (__assert (< f30-1 1.0) "(< interp 1.0)")) + (vector-lerp! (-> self root trans) s5-0 (-> self idle-position) f30-1) + (quaternion-slerp! (-> self root quat) s4-0 gp-0 f30-1))) (ja :num! (loop! (-> self idle-anim-speed))) (suspend) 0))) @@ -170,11 +171,12 @@ swamp-bat-slave-event-handler (set! (-> self launch-ready) #t) (logior! (-> self mask) (process-mask actor-pause)) (let ((f30-2 0.0)) - (loop (let ((f26-0 (cos f30-2)) - (f28-0 (sin f30-2))) - (set! (-> self root trans quad) (-> self idle-path origin quad)) - (vector+*! (-> self root trans) (-> self root trans) (-> self idle-path x-axis) f26-0) - (vector+*! (-> self root trans) (-> self root trans) (-> self idle-path y-axis) f28-0)) + (loop + (let ((f26-0 (cos f30-2)) + (f28-0 (sin f30-2))) + (set! (-> self root trans quad) (-> self idle-path origin quad)) + (vector+*! (-> self root trans) (-> self root trans) (-> self idle-path x-axis) f26-0) + (vector+*! (-> self root trans) (-> self root trans) (-> self idle-path y-axis) f28-0)) (ja :num! (loop! (-> self idle-anim-speed))) (suspend) (+! f30-2 (* 32768.0 (seconds-per-frame) (-> self idle-anim-speed)))))) @@ -192,9 +194,10 @@ swamp-bat-slave-event-handler (let ((s5-0 (new-stack-vector0))) (eval-path-curve-div! (-> self parent-process 0 path-list (-> self path-select)) s5-0 0.0 'interp) (ja :group! swamp-bat-idle-ja) - (loop (let ((s4-0 (- (current-time) (-> self state-time)))) - (if (>= s4-0 (seconds 0.3)) (go swamp-bat-slave-swoop)) - (let ((f0-1 (* 0.011111111 (the float s4-0)))) (vector-lerp! (-> self root trans) gp-0 s5-0 f0-1))) + (loop + (let ((s4-0 (- (current-time) (-> self state-time)))) + (if (>= s4-0 (seconds 0.3)) (go swamp-bat-slave-swoop)) + (let ((f0-1 (* 0.011111111 (the float s4-0)))) (vector-lerp! (-> self root trans) gp-0 s5-0 f0-1))) (ja :num! (loop! (-> self idle-anim-speed))) (suspend) 0)))) @@ -214,7 +217,8 @@ swamp-bat-slave-event-handler (set! (-> self strafe-envelope) 20480.0) (ja-channel-push! 1 (seconds 0.1)) (ja :group! swamp-bat-swoop-ja) - (loop (if (>= (swamp-bat-slave-method-20 self) 2.0) (go swamp-bat-slave-strafe)) + (loop + (if (>= (swamp-bat-slave-method-20 self) 2.0) (go swamp-bat-slave-strafe)) (ja :num! (loop!)) (suspend))) :post swamp-bat-slave-path-post) @@ -226,7 +230,8 @@ swamp-bat-slave-event-handler (set! (-> self strafe-envelope) 20480.0) (ja-channel-push! 1 (seconds 0.1)) (ja :group! swamp-bat-strafe-ja) - (loop (if (>= (swamp-bat-slave-method-20 self) 6.0) (go swamp-bat-slave-return)) + (loop + (if (>= (swamp-bat-slave-method-20 self) 6.0) (go swamp-bat-slave-return)) (ja :num! (loop!)) (suspend))) :post swamp-bat-slave-path-post) @@ -240,13 +245,14 @@ swamp-bat-slave-event-handler (ja :group! swamp-bat-strafe-ja) (let ((f30-0 (+ -1.0 (-> self path-point-count))) (gp-0 #t)) - (loop (let ((f28-0 (swamp-bat-slave-method-20 self))) - (if (>= f28-0 f30-0) (go swamp-bat-slave-idle)) - (when (and gp-0 (>= f28-0 7.0) (< f28-0 8.0)) - (set! gp-0 #f) - (when (!= (-> self path-select) (-> self parent-process 0 path-select)) - (swamp-bat-slave-get-new-path) - (go swamp-bat-slave-idle)))) + (loop + (let ((f28-0 (swamp-bat-slave-method-20 self))) + (if (>= f28-0 f30-0) (go swamp-bat-slave-idle)) + (when (and gp-0 (>= f28-0 7.0) (< f28-0 8.0)) + (set! gp-0 #f) + (when (!= (-> self path-select) (-> self parent-process 0 path-select)) + (swamp-bat-slave-get-new-path) + (go swamp-bat-slave-idle)))) (ja :num! (loop!)) (suspend)))) :post swamp-bat-slave-path-post) @@ -362,15 +368,16 @@ swamp-bat-slave-event-handler (when (zero? (-> self path-count)) (process-entity-status! self (entity-perm-status dead) #t) (deactivate self)) - (loop (when (and (time-elapsed? (-> self state-time) (seconds 0.2)) - *target* - (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (when (not (-> self child-process)) - (process-entity-status! self (entity-perm-status dead) #t) - (deactivate self)) - (swamp-bat-update-path) - (if (or (point-in-vol? (-> self vol) (target-pos 5)) (not (swamp-bat-check-slave-paths-match? (-> self path-select)))) - (go swamp-bat-launch-slaves))) + (loop + (when (and (time-elapsed? (-> self state-time) (seconds 0.2)) + *target* + (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (when (not (-> self child-process)) + (process-entity-status! self (entity-perm-status dead) #t) + (deactivate self)) + (swamp-bat-update-path) + (if (or (point-in-vol? (-> self vol) (target-pos 5)) (not (swamp-bat-check-slave-paths-match? (-> self path-select)))) + (go swamp-bat-launch-slaves))) (let ((gp-1 (new 'static 'matrix))) (quaternion->matrix gp-1 (-> self root quat)) (set! (-> gp-1 vector 3 quad) (-> self root trans quad))) @@ -394,7 +401,8 @@ swamp-bat-slave-event-handler :code (behavior () (set-time! (-> self state-time)) - (loop (swamp-bat-update-path) + (loop + (swamp-bat-update-path) (when (time-elapsed? (-> self state-time) (seconds 0.5)) (set-time! (-> self state-time)) (if (not (swamp-bat-launch-slave)) (go swamp-bat-idle))) diff --git a/goal_src/jak1/levels/swamp/swamp-obs.gc b/goal_src/jak1/levels/swamp/swamp-obs.gc index 3023ad4c26..9e75cc98c0 100644 --- a/goal_src/jak1/levels/swamp/swamp-obs.gc +++ b/goal_src/jak1/levels/swamp/swamp-obs.gc @@ -167,7 +167,8 @@ (new 'stack-no-clear 'vector) (vector-z-quaternion! gp-0 (-> self root quat)) (set! (-> gp-0 w) (- (vector-dot gp-0 (-> self root trans)))) - (loop (set-time! (-> self state-time)) + (loop + (set-time! (-> self state-time)) (ja :group! swamp-spike-up-ja) (until (>= (get-current-phase (-> self sync)) 0.5) (ja :num-func num-func-identity :frame-num 0.0) @@ -515,7 +516,8 @@ :code (behavior () (transform-post) - (loop (logior! (-> self mask) (process-mask sleep)) + (loop + (logior! (-> self mask) (process-mask sleep)) (suspend)))) (defmethod init-from-entity! ((this swamp-rock) (arg0 entity-actor)) @@ -622,7 +624,8 @@ (ja-channel-set! 0)) :code (behavior () - (loop (suspend))) + (loop + (suspend))) :post ja-post) (defstate rigid-body-platform-float (tar-plat) @@ -642,7 +645,8 @@ (ja-channel-push! 1 (seconds 0.1)) (ja :group! tar-plat-idle-ja) (ja :num-func num-func-identity :frame-num 0.0) - (loop (suspend))) + (loop + (suspend))) :post rigid-body-platform-post) (defmethod rigid-body-platform-method-30 ((this tar-plat)) diff --git a/goal_src/jak1/levels/swamp/swamp-rat-nest.gc b/goal_src/jak1/levels/swamp/swamp-rat-nest.gc index d81ecb4bb6..03c593b43e 100644 --- a/goal_src/jak1/levels/swamp/swamp-rat-nest.gc +++ b/goal_src/jak1/levels/swamp/swamp-rat-nest.gc @@ -628,7 +628,8 @@ :event swamp-rat-nest-dummy-event-handler :code (behavior () - (loop (ja :num-func num-func-identity :frame-num max) + (loop + (ja :num-func num-func-identity :frame-num max) (suspend))) :post transform-post) @@ -768,7 +769,8 @@ swamp-rat-nest-default-event-handler :code (behavior () (swamp-rat-nest-check-dummy) - (loop (suspend))) + (loop + (suspend))) :post #f) (defstate swamp-rat-nest-active (swamp-rat-nest) @@ -790,7 +792,8 @@ swamp-rat-nest-default-event-handler (if (< v1-6 (-> self rat-count)) (go swamp-rat-nest-gestate))))) :code (behavior () - (loop (suspend))) + (loop + (suspend))) :post #f) (defstate swamp-rat-nest-gestate (swamp-rat-nest) @@ -807,7 +810,8 @@ swamp-rat-nest-default-event-handler (go swamp-rat-nest-active))) :code (behavior () - (loop (suspend))) + (loop + (suspend))) :post #f) (defstate swamp-rat-nest-victory (swamp-rat-nest) diff --git a/goal_src/jak1/levels/swamp/swamp-rat.gc b/goal_src/jak1/levels/swamp/swamp-rat.gc index 393afba50e..3e4e02c372 100644 --- a/goal_src/jak1/levels/swamp/swamp-rat.gc +++ b/goal_src/jak1/levels/swamp/swamp-rat.gc @@ -93,7 +93,8 @@ swamp-rat-default-event-handler :code (behavior () (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) - (loop (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) :num! (seek! max f30-0) :frame-num 0.0) + (loop + (ja-no-eval :group! (-> self draw art-group data (-> self nav-info walk-anim)) :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max f30-0))))))) @@ -150,9 +151,10 @@ swamp-rat-default-event-handler (set! (-> self chase-rest-time) (rand-vu-int-range (seconds 1) (seconds 4))) (ja-channel-push! 1 (seconds 0.17)) (ja :group! swamp-rat-run-ja :num! min) - (loop (when (time-elapsed? (-> self wiggle-time) (seconds 1)) - (set-time! (-> self wiggle-time)) - (swamp-rat-update-wiggle-params)) + (loop + (when (time-elapsed? (-> self wiggle-time) (seconds 1)) + (set-time! (-> self wiggle-time)) + (swamp-rat-update-wiggle-params)) (suspend) (ja :num! (loop!)))) :post @@ -175,7 +177,8 @@ swamp-rat-default-event-handler (set! (-> self rotate-speed) 1456355.5) (set! (-> self turn-time) (seconds 0.075)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) - (loop (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (loop + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! swamp-rat-celebrate-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) @@ -244,7 +247,8 @@ swamp-rat-default-event-handler (let ((f30-0 0.125)) (set-time! (-> self state-time)) (ja :group! swamp-rat-fall-ja :num! min) - (loop (set! f30-0 (seek f30-0 1.5 0.1)) + (loop + (set! f30-0 (seek f30-0 1.5 0.1)) (vector-v++! (-> self collide-info transv) gp-0) (integrate-for-enemy-with-move-to-ground! (-> self collide-info) (-> self collide-info transv) diff --git a/goal_src/jak1/levels/title/title-obs.gc b/goal_src/jak1/levels/title/title-obs.gc index 2f60c827ed..a7167a829e 100644 --- a/goal_src/jak1/levels/title/title-obs.gc +++ b/goal_src/jak1/levels/title/title-obs.gc @@ -124,7 +124,8 @@ :code (behavior () (ja-post) - (loop (clone-anim-once (ppointer->handle (-> self parent-process)) (the-as int (-> self draw origin-joint-index)) #t "") + (loop + (clone-anim-once (ppointer->handle (-> self parent-process)) (the-as int (-> self draw origin-joint-index)) #t "") (if (nonzero? (-> self main-joint)) (set-trs! (-> self main-joint) (-> self parent-process 0 main-joint trans) @@ -293,7 +294,8 @@ trans) :code (behavior () - (loop (set! (-> self anim) (-> self next-anim)) + (loop + (set! (-> self anim) (-> self next-anim)) (if (not (handle->process (-> self camera))) (set! (-> self camera) (ppointer->handle (process-spawn othercam (handle->process (-> self camera-anim)) 4 #t 'logo :to (handle->process (-> self camera-anim)))))) @@ -324,9 +326,10 @@ (ja-channel-set! 0) (ja-post) (let ((gp-0 *master-mode*)) (set! *master-mode* 'game) (clear-rec *art-control*) (set! *master-mode* gp-0)) - (loop (when (and (none-reserved? *art-control*) (not (paused?))) - (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (seconds 0.1)) (set! *camera-look-through-other* 2) (suspend))) - (go-virtual idle)) + (loop + (when (and (none-reserved? *art-control*) (not (paused?))) + (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (seconds 0.1)) (set! *camera-look-through-other* 2) (suspend))) + (go-virtual idle)) (set! *camera-look-through-other* 2) (suspend)))) diff --git a/goal_src/jak1/levels/training/training-obs.gc b/goal_src/jak1/levels/training/training-obs.gc index 7f7b07d7b8..6c9db9b55c 100644 --- a/goal_src/jak1/levels/training/training-obs.gc +++ b/goal_src/jak1/levels/training/training-obs.gc @@ -66,80 +66,81 @@ :virtual #t :code (behavior () - (loop (when (and *target* - (< (vector-vector-distance (target-pos 0) (-> self root trans)) (-> self range)) - (-> *setting-control* current play-hints) - (and (< 0.0 (-> *setting-control* current dialog-volume)) - (let ((a0-3 (entity-actor-lookup (-> self entity) 'alt-actor 0))) - (or (not a0-3) (not (logtest? (-> a0-3 extra perm status) (entity-perm-status dead))))))) - (when (!= (-> self index) 6) - (while (and *target* - (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf)))) - (suspend)) - (set-time! (-> self state-time)) - (process-grab? *target*) - (process-entity-status! self (entity-perm-status bit-3) #t) - (until (not (or (-> *setting-control* current talking) - (or (-> *setting-control* current spooling) (-> *setting-control* current hint) (-> *setting-control* current ambient)))) - (set-setting! 'allow-progress #f 0.0 0) - (let* ((a0-15 *setting-control*) - (t9-6 (method-of-object a0-15 set-setting)) - (a2-3 'movie) - (a3-1 (process->ppointer self))) - (t9-6 a0-15 self a2-3 a3-1 0.0 0)) - (apply-settings *setting-control*) - (dotimes (gp-1 2) - (while (or (-> *setting-control* current talking) - (-> *setting-control* current spooling) - (-> *setting-control* current hint) - (-> *setting-control* current ambient) - *progress-process*) - (suspend))) - (while (not (time-elapsed? (-> self state-time) (seconds 1))) - (suspend)) - (remove-setting! 'movie) - (apply-settings *setting-control*) - (suspend) - (suspend)) - (process-release? *target*)) - (when (-> *setting-control* current play-hints) - (let ((v1-61 (-> self index))) - (cond - ((zero? v1-61) - (level-hint-spawn (text-id training-money) "asstvb41" (the-as entity #f) *entity-pool* (game-task none)) - (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "orbcam" 0 #f () :to self)) - ((= v1-61 1) - (level-hint-spawn (text-id training-fuel-cell) "asstvb42" (the-as entity #f) *entity-pool* (game-task none)) - (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "fuelcellcam" 0 #f () :to self)) - ((= v1-61 2) - (level-hint-spawn (text-id training-eco-blue) "sagevb22" (the-as entity #f) *entity-pool* (game-task none)) - (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "ecocam" 0 #f () :to self)) - ((= v1-61 3) - (level-hint-spawn (text-id training-precursor-door) "sagevb24" (the-as entity #f) *entity-pool* (game-task none)) - (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "precursordoorcam" 0 #f () :to self)) - ((= v1-61 4) - (level-hint-spawn (text-id training-blue-eco-vent) "asstvb48" (the-as entity #f) *entity-pool* (game-task none)) - (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "ecoventcam" 0 #f () :to self)) - ((= v1-61 5) - (level-hint-spawn (text-id training-eco-green) "sagevb21" (the-as entity #f) *entity-pool* (game-task none)) - (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "greenecocam" 0 #f () :to self)) - ((= v1-61 6) - (when (not (task-complete? *game-info* (game-task training-climb))) - (clear-text-seen! *game-info* (text-id training-double-jump)) - (level-hint-spawn (text-id training-double-jump) "sagevb27" (the-as entity #f) *entity-pool* (game-task none)) - (let ((gp-8 (current-time))) (until (time-elapsed? gp-8 (seconds 30)) (suspend))) - (process-entity-status! self (entity-perm-status bit-3) #f) - (go-virtual idle))))) - (while (-> self child) + (loop + (when (and *target* + (< (vector-vector-distance (target-pos 0) (-> self root trans)) (-> self range)) + (-> *setting-control* current play-hints) + (and (< 0.0 (-> *setting-control* current dialog-volume)) + (let ((a0-3 (entity-actor-lookup (-> self entity) 'alt-actor 0))) + (or (not a0-3) (not (logtest? (-> a0-3 extra perm status) (entity-perm-status dead))))))) + (when (!= (-> self index) 6) + (while (and *target* + (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf)))) + (suspend)) + (set-time! (-> self state-time)) + (process-grab? *target*) + (process-entity-status! self (entity-perm-status bit-3) #t) + (until (not (or (-> *setting-control* current talking) + (or (-> *setting-control* current spooling) (-> *setting-control* current hint) (-> *setting-control* current ambient)))) + (set-setting! 'allow-progress #f 0.0 0) + (let* ((a0-15 *setting-control*) + (t9-6 (method-of-object a0-15 set-setting)) + (a2-3 'movie) + (a3-1 (process->ppointer self))) + (t9-6 a0-15 self a2-3 a3-1 0.0 0)) + (apply-settings *setting-control*) + (dotimes (gp-1 2) + (while (or (-> *setting-control* current talking) + (-> *setting-control* current spooling) + (-> *setting-control* current hint) + (-> *setting-control* current ambient) + *progress-process*) (suspend))) - (let ((a0-61 (-> self entity))) - (if (when a0-61 - (let ((a0-62 (-> a0-61 extra perm task))) (if a0-62 (= a0-62 (game-task none))))) - (set! (-> self entity extra perm task) (game-task complete)))) - (process-entity-status! self (entity-perm-status dead) #t) - (process-entity-status! self (entity-perm-status bit-3) #f) - (deactivate self)) + (while (not (time-elapsed? (-> self state-time) (seconds 1))) + (suspend)) + (remove-setting! 'movie) + (apply-settings *setting-control*) + (suspend) + (suspend)) + (process-release? *target*)) + (when (-> *setting-control* current play-hints) + (let ((v1-61 (-> self index))) + (cond + ((zero? v1-61) + (level-hint-spawn (text-id training-money) "asstvb41" (the-as entity #f) *entity-pool* (game-task none)) + (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "orbcam" 0 #f () :to self)) + ((= v1-61 1) + (level-hint-spawn (text-id training-fuel-cell) "asstvb42" (the-as entity #f) *entity-pool* (game-task none)) + (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "fuelcellcam" 0 #f () :to self)) + ((= v1-61 2) + (level-hint-spawn (text-id training-eco-blue) "sagevb22" (the-as entity #f) *entity-pool* (game-task none)) + (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "ecocam" 0 #f () :to self)) + ((= v1-61 3) + (level-hint-spawn (text-id training-precursor-door) "sagevb24" (the-as entity #f) *entity-pool* (game-task none)) + (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "precursordoorcam" 0 #f () :to self)) + ((= v1-61 4) + (level-hint-spawn (text-id training-blue-eco-vent) "asstvb48" (the-as entity #f) *entity-pool* (game-task none)) + (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "ecoventcam" 0 #f () :to self)) + ((= v1-61 5) + (level-hint-spawn (text-id training-eco-green) "sagevb21" (the-as entity #f) *entity-pool* (game-task none)) + (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "greenecocam" 0 #f () :to self)) + ((= v1-61 6) + (when (not (task-complete? *game-info* (game-task training-climb))) + (clear-text-seen! *game-info* (text-id training-double-jump)) + (level-hint-spawn (text-id training-double-jump) "sagevb27" (the-as entity #f) *entity-pool* (game-task none)) + (let ((gp-8 (current-time))) (until (time-elapsed? gp-8 (seconds 30)) (suspend))) + (process-entity-status! self (entity-perm-status bit-3) #f) + (go-virtual idle))))) + (while (-> self child) + (suspend))) + (let ((a0-61 (-> self entity))) + (if (when a0-61 + (let ((a0-62 (-> a0-61 extra perm task))) (if a0-62 (= a0-62 (game-task none))))) + (set! (-> self entity extra perm task) (game-task complete)))) + (process-entity-status! self (entity-perm-status dead) #t) + (process-entity-status! self (entity-perm-status bit-3) #f) + (deactivate self)) (suspend)))) (defmethod init-from-entity! ((this training-cam) (arg0 entity-actor)) @@ -514,7 +515,8 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.12)) - (loop (ja-no-eval :group! scarecrow-a-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! scarecrow-a-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -638,7 +640,8 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.12)) - (loop (ja-no-eval :group! scarecrow-b-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! scarecrow-b-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) diff --git a/goal_src/jak1/levels/village1/assistant.gc b/goal_src/jak1/levels/village1/assistant.gc index 7ccba6b20b..acc482e0ce 100644 --- a/goal_src/jak1/levels/village1/assistant.gc +++ b/goal_src/jak1/levels/village1/assistant.gc @@ -136,7 +136,8 @@ :code (behavior () (if (!= (ja-group) assistant-idle-leaning-right-ja) (ja-channel-push! 1 (seconds 0.2))) - (loop (process-taskable-method-43 self) + (loop + (process-taskable-method-43 self) (ja :group! assistant-idle-leaning-right-ja) (countdown (gp-0 (+ (the int (rand-float-gen)) 2)) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) diff --git a/goal_src/jak1/levels/village1/explorer.gc b/goal_src/jak1/levels/village1/explorer.gc index eb5ccfded8..c9697a4f69 100644 --- a/goal_src/jak1/levels/village1/explorer.gc +++ b/goal_src/jak1/levels/village1/explorer.gc @@ -121,7 +121,8 @@ :code (behavior () (if (!= (ja-group) explorer-idle-ja) (ja-channel-push! 1 (seconds 0.2))) - (loop (process-taskable-method-43 self) + (loop + (process-taskable-method-43 self) (ja :group! explorer-idle-ja) (let* ((f30-0 2.0) (v1-11 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) diff --git a/goal_src/jak1/levels/village1/fishermans-boat.gc b/goal_src/jak1/levels/village1/fishermans-boat.gc index 7e6ccfde33..023ccd6683 100644 --- a/goal_src/jak1/levels/village1/fishermans-boat.gc +++ b/goal_src/jak1/levels/village1/fishermans-boat.gc @@ -733,7 +733,8 @@ (send-event (handle->process (-> self cam-tracker)) 'mask #x20800) (fishermans-boat-set-path-point 0) (fishermans-boat-next-path-point) - (loop (suspend))) + (loop + (suspend))) :post fishermans-boat-post) (defstate fishermans-boat-entering-village (fishermans-boat) @@ -847,7 +848,8 @@ (send-event (handle->process (-> self cam-tracker)) 'mask #x20800) (fishermans-boat-set-path-point 4) (fishermans-boat-next-path-point) - (loop (suspend))) + (loop + (suspend))) :post fishermans-boat-post) (defstate fishermans-boat-entering-misty (fishermans-boat) @@ -866,7 +868,8 @@ (set-continue! *game-info* "misty-start") (fishermans-boat-set-dock-point 4) (fishermans-boat-set-path-point 2) - (loop (suspend))) + (loop + (suspend))) :post fishermans-boat-post) (defstate fishermans-boat-player-control (fishermans-boat) @@ -887,7 +890,8 @@ (send-event (handle->process (-> self cam-tracker)) 'message 'release) (suspend) (send-event *camera* 'change-state cam-stick 0) - (loop (if (and (= *cheat-mode* 'debug) (cpad-pressed? 0 triangle)) (set! (-> self auto-pilot) #f)) + (loop + (if (and (= *cheat-mode* 'debug) (cpad-pressed? 0 triangle)) (set! (-> self auto-pilot) #f)) (suspend))) :post fishermans-boat-post) diff --git a/goal_src/jak1/levels/village1/sage.gc b/goal_src/jak1/levels/village1/sage.gc index e54c176e8a..5234631022 100644 --- a/goal_src/jak1/levels/village1/sage.gc +++ b/goal_src/jak1/levels/village1/sage.gc @@ -358,7 +358,8 @@ :code (behavior () (if (!= (ja-group) (get-art-elem self)) (ja-channel-push! 1 (seconds 0.2))) - (loop (ja :group! (get-art-elem self)) + (loop + (ja :group! (get-art-elem self)) (let* ((f30-0 3.0) (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-10 (the-as number (logior #x3f800000 v1-9)))) diff --git a/goal_src/jak1/levels/village1/village-obs.gc b/goal_src/jak1/levels/village1/village-obs.gc index 3831c838f1..84543080ab 100644 --- a/goal_src/jak1/levels/village1/village-obs.gc +++ b/goal_src/jak1/levels/village1/village-obs.gc @@ -413,7 +413,8 @@ (defstate mayorgears-idle (mayorgears) :code (behavior () - (loop (if (task-closed? (game-task jungle-lurkerm) (task-status need-reminder)) (ja :num! (loop!)) (ja :num! (loop! 0.0))) + (loop + (if (task-closed? (game-task jungle-lurkerm) (task-status need-reminder)) (ja :num! (loop!)) (ja :num! (loop! 0.0))) (suspend))) :post ja-post) @@ -446,7 +447,8 @@ :virtual #t :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -542,7 +544,8 @@ (go starfish-patrol))) :code (behavior () - (loop (suspend))) + (loop + (suspend))) :post ja-post) (defstate starfish-patrol (starfish) @@ -560,7 +563,8 @@ (set! (-> self target-speed) 4096.0) (set! (-> self rotate-speed) 12743.111) (set! (-> self turn-time) (seconds 0.5)) - (loop (ja-no-eval :group! villa-starfish-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! villa-starfish-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -663,11 +667,12 @@ :code (behavior () (set-time! (-> self state-time)) - (loop (when (time-elapsed? (-> self state-time) (seconds 0.5)) - (set-time! (-> self state-time)) - (if (and (and *target* (>= 204800.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (< (process-drawable-child-count) (-> self child-count))) - (starfish-spawn-child))) + (loop + (when (time-elapsed? (-> self state-time) (seconds 0.5)) + (set-time! (-> self state-time)) + (if (and (and *target* (>= 204800.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (< (process-drawable-child-count) (-> self child-count))) + (starfish-spawn-child))) (suspend))) :post #f) @@ -689,7 +694,8 @@ :code (behavior () (set-time! (-> self state-time)) - (loop (suspend))) + (loop + (suspend))) :post #f) (defmethod init-from-entity! ((this village-fish) (arg0 entity-actor)) @@ -736,8 +742,9 @@ (defstate hutlamp-idle (hutlamp) :code (behavior () - (loop (let ((f0-3 (* 1820.4445 (sin (* 65536.0 (update-clock (-> self clock))))))) - (quaternion-vector-angle! (-> self pivot transform quat) *x-vector* f0-3)) + (loop + (let ((f0-3 (* 1820.4445 (sin (* 65536.0 (update-clock (-> self clock))))))) + (quaternion-vector-angle! (-> self pivot transform quat) *x-vector* f0-3)) (suspend))) :post ja-post) diff --git a/goal_src/jak1/levels/village1/yakow.gc b/goal_src/jak1/levels/village1/yakow.gc index b7c9d88797..c48292f719 100644 --- a/goal_src/jak1/levels/village1/yakow.gc +++ b/goal_src/jak1/levels/village1/yakow.gc @@ -249,38 +249,39 @@ yakow-default-event-handler (defbehavior yakow-blend-walk-run yakow () (let ((gp-0 (current-time))) - (loop (let ((f30-0 (-> self final-speed))) - (cond - ((and (>= 409.6 (-> self final-speed)) (not (-> self rotating))) - (if (not (ja-group? yakow-idle-ja)) (ja-channel-push! 1 (seconds 0.15))) - (ja :group! yakow-idle-ja :num! min) - (while (or (not (time-elapsed? gp-0 (seconds 0.2))) (< (-> self final-speed) 409.6)) - (suspend) - (ja :num! (loop!)))) - (else (set! gp-0 (current-time)))) - (when (not (ja-group? yakow-walk-ja)) - (ja-channel-push! 3 (seconds 0.075)) - (ja :group! yakow-walk-ja :num! min :frame-interp 0.0) - (ja :chan 1 :group! yakow-walk-left-ja :num! min :frame-interp 0.0) - (ja :chan 2 :group! yakow-run-ja :num! min :frame-interp 0.0)) - (if (< (-> self walk-turn-blend) 0.0) (ja :chan 1 :group! yakow-walk-left-ja) (ja :chan 1 :group! yakow-walk-right-ja)) - (cond - ((< f30-0 (-> *YAKOW-bank* min-run-speed)) (set! (-> self run-mode) #f)) - ((< (-> *YAKOW-bank* max-walk-speed) f30-0) (set! (-> self run-mode) #t))) - (if (-> self run-mode) - (seek! (-> self walk-run-blend) 1.0 (* (-> *YAKOW-bank* walk-run-blend-rate) (seconds-per-frame))) - (seek! (-> self walk-run-blend) 0.0 (* (-> *YAKOW-bank* walk-run-blend-rate) (seconds-per-frame)))) - (ja :chan 1 :frame-interp (fabs (-> self walk-turn-blend))) - (ja :chan 2 :frame-interp (-> self walk-run-blend)) - (let* ((f0-25 (* (-> *YAKOW-bank* walk-anim-speed) f30-0)) - (f1-5 (-> *YAKOW-bank* walk-speed)) - (f0-26 (* f0-25 (/ 1.0 f1-5)))) - (let* ((f1-9 (* (-> *YAKOW-bank* run-anim-speed) f30-0)) - (f2-1 (-> *YAKOW-bank* run-speed)) - (f1-12 (fmax (fmin (* f1-9 (/ 1.0 f2-1)) (-> *YAKOW-bank* max-run-anim-speed)) (-> *YAKOW-bank* min-run-anim-speed)))) - (if (-> self run-mode) (set! f0-26 f1-12))) - (if (-> self rotating) (set! f0-26 (fmax (-> *YAKOW-bank* min-walk-anim-speed) f0-26))) - (ja :num! (loop! f0-26)))) + (loop + (let ((f30-0 (-> self final-speed))) + (cond + ((and (>= 409.6 (-> self final-speed)) (not (-> self rotating))) + (if (not (ja-group? yakow-idle-ja)) (ja-channel-push! 1 (seconds 0.15))) + (ja :group! yakow-idle-ja :num! min) + (while (or (not (time-elapsed? gp-0 (seconds 0.2))) (< (-> self final-speed) 409.6)) + (suspend) + (ja :num! (loop!)))) + (else (set! gp-0 (current-time)))) + (when (not (ja-group? yakow-walk-ja)) + (ja-channel-push! 3 (seconds 0.075)) + (ja :group! yakow-walk-ja :num! min :frame-interp 0.0) + (ja :chan 1 :group! yakow-walk-left-ja :num! min :frame-interp 0.0) + (ja :chan 2 :group! yakow-run-ja :num! min :frame-interp 0.0)) + (if (< (-> self walk-turn-blend) 0.0) (ja :chan 1 :group! yakow-walk-left-ja) (ja :chan 1 :group! yakow-walk-right-ja)) + (cond + ((< f30-0 (-> *YAKOW-bank* min-run-speed)) (set! (-> self run-mode) #f)) + ((< (-> *YAKOW-bank* max-walk-speed) f30-0) (set! (-> self run-mode) #t))) + (if (-> self run-mode) + (seek! (-> self walk-run-blend) 1.0 (* (-> *YAKOW-bank* walk-run-blend-rate) (seconds-per-frame))) + (seek! (-> self walk-run-blend) 0.0 (* (-> *YAKOW-bank* walk-run-blend-rate) (seconds-per-frame)))) + (ja :chan 1 :frame-interp (fabs (-> self walk-turn-blend))) + (ja :chan 2 :frame-interp (-> self walk-run-blend)) + (let* ((f0-25 (* (-> *YAKOW-bank* walk-anim-speed) f30-0)) + (f1-5 (-> *YAKOW-bank* walk-speed)) + (f0-26 (* f0-25 (/ 1.0 f1-5)))) + (let* ((f1-9 (* (-> *YAKOW-bank* run-anim-speed) f30-0)) + (f2-1 (-> *YAKOW-bank* run-speed)) + (f1-12 (fmax (fmin (* f1-9 (/ 1.0 f2-1)) (-> *YAKOW-bank* max-run-anim-speed)) (-> *YAKOW-bank* min-run-anim-speed)))) + (if (-> self run-mode) (set! f0-26 f1-12))) + (if (-> self rotating) (set! f0-26 (fmax (-> *YAKOW-bank* min-walk-anim-speed) f0-26))) + (ja :num! (loop! f0-26)))) (ja :chan 1 :num-func num-func-identity :frame-num (ja-frame-num 0)) (ja :chan 2 :num-func num-func-identity :frame-num (ja-frame-num 0)) (suspend) @@ -317,9 +318,10 @@ yakow-default-event-handler :code (behavior () (ja-channel-push! 1 (seconds 0.15)) - (loop (cond - ((rand-vu-percent? 0.2) (effect-control-method-10 (-> self skel effect) 'yakow-1 0.0 -1)) - ((rand-vu-percent? 0.2) (effect-control-method-10 (-> self skel effect) 'yakow-2 0.0 -1))) + (loop + (cond + ((rand-vu-percent? 0.2) (effect-control-method-10 (-> self skel effect) 'yakow-1 0.0 -1)) + ((rand-vu-percent? 0.2) (effect-control-method-10 (-> self skel effect) 'yakow-2 0.0 -1))) (let ((f30-0 (rand-vu-float-range 0.9 1.1))) (ja-no-eval :group! yakow-idle-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) @@ -392,7 +394,8 @@ yakow-default-event-handler (ja :group! yakow-walk-ja :num! (loop!)) (suspend)) (ja-channel-push! 1 (seconds 0.15)) - (loop (ja-no-eval :group! yakow-idle-ja :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! yakow-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))) diff --git a/goal_src/jak1/levels/village2/assistant-village2.gc b/goal_src/jak1/levels/village2/assistant-village2.gc index 48710a7191..a252df817d 100644 --- a/goal_src/jak1/levels/village2/assistant-village2.gc +++ b/goal_src/jak1/levels/village2/assistant-village2.gc @@ -359,7 +359,8 @@ :code (behavior () (if (!= (ja-group) (get-art-elem self)) (ja-channel-push! 1 (seconds 0.05))) - (loop (ja-no-eval :group! (get-art-elem self) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (get-art-elem self) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))) @@ -1097,40 +1098,41 @@ :code (behavior () (if (!= (ja-group) (get-art-elem self)) (ja-channel-push! 1 (seconds 0.05))) - (loop (cond - ((= (get-task-status (game-task village2-levitator)) (task-status invalid)) - (ja-no-eval :group! assistant-village2-idle-after-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (assistant-levitator-blue-beam) - (suspend) - (ja :num! (seek!)))) - (else - (ja :group! assistant-village2-idle-a-ja) - (let* ((f30-0 2.0) - (v1-31 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-32 (the-as number (logior #x3f800000 v1-31)))) - (countdown (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-32)))) 3)) - (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))))) - (ja-no-eval :group! assistant-village2-idle-to-b-ja :num! (seek!) :frame-num 0.0) + (loop + (cond + ((= (get-task-status (game-task village2-levitator)) (task-status invalid)) + (ja-no-eval :group! assistant-village2-idle-after-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (assistant-levitator-blue-beam) + (suspend) + (ja :num! (seek!)))) + (else + (ja :group! assistant-village2-idle-a-ja) + (let* ((f30-0 2.0) + (v1-31 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-32 (the-as number (logior #x3f800000 v1-31)))) + (countdown (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-32)))) 3)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (ja :num! (seek!))) - (ja :group! assistant-village2-idle-b-ja) - (let* ((f30-1 2.0) - (v1-91 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-92 (the-as number (logior #x3f800000 v1-91)))) - (countdown (gp-1 (+ (the int (* f30-1 (+ -1.0 (the-as float v1-92)))) 3)) - (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (suspend) - (ja :num! (seek!))))) - (ja-no-eval :group! assistant-village2-idle-to-a-ja :num! (seek!) :frame-num 0.0) + (ja :num! (seek!))))) + (ja-no-eval :group! assistant-village2-idle-to-b-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!))) + (ja :group! assistant-village2-idle-b-ja) + (let* ((f30-1 2.0) + (v1-91 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-92 (the-as number (logior #x3f800000 v1-91)))) + (countdown (gp-1 (+ (the int (* f30-1 (+ -1.0 (the-as float v1-92)))) 3)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (ja :num! (seek!)))))))) + (ja :num! (seek!))))) + (ja-no-eval :group! assistant-village2-idle-to-a-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)))))))) (defmethod should-display? ((this assistant-levitator)) (or (= (get-task-status (game-task village2-levitator)) (task-status need-reward-speech)) @@ -1140,7 +1142,8 @@ :code (behavior () (ja-channel-set! 0) - (loop (assistant-levitator-blue-glow) + (loop + (assistant-levitator-blue-glow) (assistant-levitator-blue-beam) (update! (-> self sound)) (suspend)))) diff --git a/goal_src/jak1/levels/village2/flutflut-bluehut.gc b/goal_src/jak1/levels/village2/flutflut-bluehut.gc index 8da61e3d1a..a30589e5c6 100644 --- a/goal_src/jak1/levels/village2/flutflut-bluehut.gc +++ b/goal_src/jak1/levels/village2/flutflut-bluehut.gc @@ -43,7 +43,8 @@ :code (behavior () (if (!= (ja-group) (get-art-elem self)) (ja-channel-push! 1 (seconds 0.05))) - (loop (ja :group! flutflut-bluehut-idle-breathe-ja) + (loop + (ja :group! flutflut-bluehut-idle-breathe-ja) (let* ((f30-0 2.0) (v1-8 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-9 (the-as number (logior #x3f800000 v1-8)))) diff --git a/goal_src/jak1/levels/village2/gambler.gc b/goal_src/jak1/levels/village2/gambler.gc index 5eab8410ba..e9cb4197bc 100644 --- a/goal_src/jak1/levels/village2/gambler.gc +++ b/goal_src/jak1/levels/village2/gambler.gc @@ -116,7 +116,8 @@ (when (!= (ja-group) gambler-idle-fidget-ja) (ja-channel-push! 1 (seconds 0.2)) (ja :group! gambler-idle-fidget-ja)) - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))) diff --git a/goal_src/jak1/levels/village2/sage-bluehut.gc b/goal_src/jak1/levels/village2/sage-bluehut.gc index 0e4a9e8853..04346d14fd 100644 --- a/goal_src/jak1/levels/village2/sage-bluehut.gc +++ b/goal_src/jak1/levels/village2/sage-bluehut.gc @@ -163,36 +163,37 @@ :virtual #t :code (behavior () - (loop (let ((gp-0 (get-art-elem self))) - (cond - ((= gp-0 sage-bluehut-idle-stand-ja) - (if (!= (ja-group) gp-0) (ja-channel-push! 1 (seconds 0.2))) - (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-0)) - (let* ((f30-0 3.0) - (v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-16 (the-as number (logior #x3f800000 v1-15)))) - (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-16)))) 5)) - (process-taskable-method-43 self) - (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (if (process-taskable-method-45 self) (go-virtual idle)) - (suspend) - (ja :num! (seek!))))) - (ja-channel-push! 1 (seconds 0.2)) - (ja-no-eval :group! sage-bluehut-idle-ja :num! (seek!) :frame-num 0.0) - (until (ja-done? 0) - (if (process-taskable-method-45 self) (go-virtual idle)) - (suspend) - (ja :num! (seek!)))) - (else + (loop + (let ((gp-0 (get-art-elem self))) + (cond + ((= gp-0 sage-bluehut-idle-stand-ja) + (if (!= (ja-group) gp-0) (ja-channel-push! 1 (seconds 0.2))) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-0)) + (let* ((f30-0 3.0) + (v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-16 (the-as number (logior #x3f800000 v1-15)))) + (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-16)))) 5)) (process-taskable-method-43 self) - (if (!= (ja-group) gp-0) (ja-channel-push! 1 (seconds 0.2))) - (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-0)) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (process-taskable-method-45 self) (go-virtual idle)) (suspend) - (ja :num! (seek!))))))))) + (ja :num! (seek!))))) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! sage-bluehut-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (process-taskable-method-45 self) (go-virtual idle)) + (suspend) + (ja :num! (seek!)))) + (else + (process-taskable-method-43 self) + (if (!= (ja-group) gp-0) (ja-channel-push! 1 (seconds 0.2))) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-0)) + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (process-taskable-method-45 self) (go-virtual idle)) + (suspend) + (ja :num! (seek!))))))))) (defmethod init-from-entity! ((this sage-bluehut) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *sage-bluehut-sg* 3 40 (new 'static 'vector :w 4505.6) 5) diff --git a/goal_src/jak1/levels/village2/swamp-blimp.gc b/goal_src/jak1/levels/village2/swamp-blimp.gc index d2c5c039d1..0e221c81ee 100644 --- a/goal_src/jak1/levels/village2/swamp-blimp.gc +++ b/goal_src/jak1/levels/village2/swamp-blimp.gc @@ -475,8 +475,9 @@ (behavior () (clear-collide-with-as (-> self root)) (logior! (-> self draw status) (draw-status hidden)) - (loop (when (= (get-task-status (-> self entity extra perm task)) (task-status invalid)) - (if (not (-> self child)) (go swamp-tetherrock-die))) + (loop + (when (= (get-task-status (-> self entity extra perm task)) (task-status invalid)) + (if (not (-> self child)) (go swamp-tetherrock-die))) (suspend)))) (defstate swamp-tetherrock-break (swamp-tetherrock) @@ -615,18 +616,19 @@ *entity-pool*)))))))) :code (behavior () - (loop (let ((s4-0 (new 'static 'vector :y 1.0 :w 1.0)) - (s3-0 (new 'stack-no-clear 'vector)) - (s5-0 (new 'stack-no-clear 'vector)) - (gp-0 (new 'stack-no-clear 'quaternion))) - 0.0 - (vector-! s3-0 (-> self tension-pt) (-> self root trans)) - (vector-normalize! s3-0 1.0) - (vector-cross! s5-0 s4-0 s3-0) - (let ((f30-0 (asin (vector-normalize-ret-len! s5-0 1.0)))) - (vector-normalize! s5-0 1.0) - (quaternion-vector-angle! gp-0 s5-0 (* (fmin 1820.4445 f30-0) (- 1.0 (-> self tension))))) - (quaternion*! (-> self root quat) gp-0 (-> self rot-at-init))) + (loop + (let ((s4-0 (new 'static 'vector :y 1.0 :w 1.0)) + (s3-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'quaternion))) + 0.0 + (vector-! s3-0 (-> self tension-pt) (-> self root trans)) + (vector-normalize! s3-0 1.0) + (vector-cross! s5-0 s4-0 s3-0) + (let ((f30-0 (asin (vector-normalize-ret-len! s5-0 1.0)))) + (vector-normalize! s5-0 1.0) + (quaternion-vector-angle! gp-0 s5-0 (* (fmin 1820.4445 f30-0) (- 1.0 (-> self tension))))) + (quaternion*! (-> self root quat) gp-0 (-> self rot-at-init))) (if (and *target* (>= 49152.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (level-hint-spawn (text-id swamp-tetherrock-eco-yellow-hint) "sksp0138" @@ -681,7 +683,8 @@ (behavior () (cleanup-for-death self) (deactivate self) - (loop (suspend)))) + (loop + (suspend)))) (defstate precursor-arm-sink (precursor-arm) :code @@ -691,10 +694,11 @@ (suspend)) (close-specific-task! (-> self entity extra perm task) (task-status need-reminder)) (close-specific-task! (-> self entity extra perm task) (task-status need-resolution)) - (loop (cond - ((< -40960.0 (-> self y-offset)) - (set! (-> self y-offset) (- (-> self y-offset) (* 409.6 (-> *display* time-adjust-ratio))))) - (else (set! (-> self y-offset) -40960.0) (cleanup-for-death self) (deactivate self))) + (loop + (cond + ((< -40960.0 (-> self y-offset)) + (set! (-> self y-offset) (- (-> self y-offset) (* 409.6 (-> *display* time-adjust-ratio))))) + (else (set! (-> self y-offset) -40960.0) (cleanup-for-death self) (deactivate self))) (set! (-> self root trans y) (+ (-> self y-offset) (-> self y-init))) (suspend))) :post transform-post) @@ -732,7 +736,8 @@ (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2017) a2-1)))) :code (behavior () - (loop (set! (-> self tension) 1.5) + (loop + (set! (-> self tension) 1.5) (let* ((f26-0 (+ 225.0 (* 150.0 (sin (rand-vu-float-range 0.0 16384.0))))) (f0-5 (+ 4096.0 (* 8192.0 (sin (rand-vu-float-range 0.0 16384.0))))) (f30-2 (-> self y-offset)) @@ -859,16 +864,17 @@ (v1-6 (the-as number (logior #x3f800000 v1-5)))) (set! (-> self state-time) (the-as time-frame (the int (* f30-1 (+ -1.0 (the-as float v1-6))))))) (ja-channel-push! 1 (seconds 0.5)) - (loop (let* ((f30-2 0.3) - (f28-1 0.25) - (v1-10 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-11 (the-as number (logior #x3f800000 v1-10))) - (f30-3 (+ f30-2 (* f28-1 (+ -1.0 (the-as float v1-11)))))) - (ja-no-eval :group! swamp-rope-swing-ja :num! (seek! max f30-3) :frame-num 0.0) - (until (ja-done? 0) - (swamp-rope-break-code) - (suspend) - (ja :num! (seek! max f30-3)))))) + (loop + (let* ((f30-2 0.3) + (f28-1 0.25) + (v1-10 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-11 (the-as number (logior #x3f800000 v1-10))) + (f30-3 (+ f30-2 (* f28-1 (+ -1.0 (the-as float v1-11)))))) + (ja-no-eval :group! swamp-rope-swing-ja :num! (seek! max f30-3) :frame-num 0.0) + (until (ja-done? 0) + (swamp-rope-break-code) + (suspend) + (ja :num! (seek! max f30-3)))))) :post (behavior () (set! (-> self other-pos quad) (-> self root trans quad)) @@ -907,9 +913,10 @@ :code (behavior () (ja :group! swamp-rope-slack-ja) - (loop (let* ((f0-1 (* 2000.0 (- (-> self old-scale) (-> self root scale y)))) - (f1-3 (+ 0.5 f0-1))) - (set! (-> self frame target) (fmin 1.0 (fmax 0.0 f1-3)))) + (loop + (let* ((f0-1 (* 2000.0 (- (-> self old-scale) (-> self root scale y)))) + (f1-3 (+ 0.5 f0-1))) + (set! (-> self frame target) (fmin 1.0 (fmax 0.0 f1-3)))) (swamp-rope-oscillator-method-10 (-> self frame) 0.0) (let* ((v1-6 (-> self other-entity)) (a0-4 (if v1-6 (-> v1-6 extra process)))) @@ -925,9 +932,10 @@ :code (behavior () (ja :group! swamp-rope-slack-ja) - (loop (let* ((a0-3 (-> self other-entity)) - (v1-3 (if a0-3 (-> a0-3 extra process)))) - (if v1-3 (set! (-> self frame target) (- 1.0 (-> (the-as swamp-rope v1-3) scale-t))))) + (loop + (let* ((a0-3 (-> self other-entity)) + (v1-3 (if a0-3 (-> a0-3 extra process)))) + (if v1-3 (set! (-> self frame target) (- 1.0 (-> (the-as swamp-rope v1-3) scale-t))))) (swamp-rope-oscillator-method-10 (-> self frame) 0.0) (ja :num-func num-func-identity :frame-num (* (-> self frame value) (the float (ja-num-frames 0)))) (suspend))) @@ -1007,9 +1015,10 @@ (set-time! (-> self state-time)) (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-copy! gp-0 (-> self rot-at-init)) - (loop (quaternion-vector-angle! (-> self rot-at-init) - (new 'static 'vector :y 1.0 :w 1.0) - (* 18.204445 (the float (- (current-time) (-> self state-time))))) + (loop + (quaternion-vector-angle! (-> self rot-at-init) + (new 'static 'vector :y 1.0 :w 1.0) + (* 18.204445 (the float (- (current-time) (-> self state-time))))) (quaternion*! (-> self rot-at-init) (-> self rot-at-init) gp-0) (if (< (-> self pos-oscillator target x) 409600.0) (+! (-> self pos-oscillator target x) 40.96)) (if (< (-> self pos-oscillator target y) 4096000.0) (+! (-> self pos-oscillator target y) 819.2)) @@ -1075,10 +1084,11 @@ :code (behavior () (ja :group! swamp-blimp-idle-ja) - (loop (when (< 300 (-> self arm-timer)) - (set! (-> self arm-timer) - (- (the-as time-frame (-> self arm-timer)) (- (current-time) (-> *display* old-base-frame-counter)))) - (if (>= 300 (-> self arm-timer)) (+! (-> self pos-oscillator target y) (* 16384.0 (-> *display* time-adjust-ratio))))) + (loop + (when (< 300 (-> self arm-timer)) + (set! (-> self arm-timer) + (- (the-as time-frame (-> self arm-timer)) (- (current-time) (-> *display* old-base-frame-counter)))) + (if (>= 300 (-> self arm-timer)) (+! (-> self pos-oscillator target y) (* 16384.0 (-> *display* time-adjust-ratio))))) (when (< 240 (-> self arm-timer)) (set! (-> self arm-timer) (- (the-as time-frame (-> self arm-timer)) (- (current-time) (-> *display* old-base-frame-counter)))) diff --git a/goal_src/jak1/levels/village2/village2-obs.gc b/goal_src/jak1/levels/village2/village2-obs.gc index b15fe4da65..b9752eecae 100644 --- a/goal_src/jak1/levels/village2/village2-obs.gc +++ b/goal_src/jak1/levels/village2/village2-obs.gc @@ -94,7 +94,8 @@ (if (task-closed? (the-as game-task (-> self task)) (task-status need-resolution)) (go-virtual rigid-body-platform-idle))) :code (behavior () - (loop (suspend)))) + (loop + (suspend)))) (defstate pontoon-die (pontoon) :code @@ -422,9 +423,10 @@ (logior! (-> self draw status) (draw-status hidden))) :code (behavior () - (loop (when (and (nonzero? (-> self task)) (task-closed? (the-as game-task (-> self task)) (task-status need-resolution))) - (cleanup-for-death self) - (deactivate self)) + (loop + (when (and (nonzero? (-> self task)) (task-closed? (the-as game-task (-> self task)) (task-status need-resolution))) + (cleanup-for-death self) + (deactivate self)) (logior! (-> self mask) (process-mask sleep)) (suspend)))) @@ -512,7 +514,8 @@ (update! (-> self sound))) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 455.1111 (-> *display* time-adjust-ratio))) (suspend) @@ -550,7 +553,8 @@ :code (behavior () (transform-post) - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (cond ((zero? (-> self task))) @@ -631,7 +635,8 @@ (defstate ceilingflag-idle (ceilingflag) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) @@ -1044,7 +1049,8 @@ :trans ogreboss-village2-trans :code (behavior () - (loop (ja-channel-push! 1 (seconds 0.1)) + (loop + (ja-channel-push! 1 (seconds 0.1)) (let ((v1-0 (rand-vu-int-range 0 2))) (cond ((zero? v1-0) diff --git a/goal_src/jak1/levels/village3/assistant-village3.gc b/goal_src/jak1/levels/village3/assistant-village3.gc index 4952b81b8d..8b49bb326a 100644 --- a/goal_src/jak1/levels/village3/assistant-village3.gc +++ b/goal_src/jak1/levels/village3/assistant-village3.gc @@ -87,7 +87,8 @@ :code (behavior () (if (!= (ja-group) (get-art-elem self)) (ja-channel-push! 1 (seconds 0.05))) - (loop (process-taskable-method-43 self) + (loop + (process-taskable-method-43 self) (ja-no-eval :group! assistant-village3-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) diff --git a/goal_src/jak1/levels/village3/minecart.gc b/goal_src/jak1/levels/village3/minecart.gc index 3c0f12220b..02b6589187 100644 --- a/goal_src/jak1/levels/village3/minecart.gc +++ b/goal_src/jak1/levels/village3/minecart.gc @@ -40,10 +40,11 @@ (behavior () (ja-channel-set! 1) (ja :group! (-> self anim)) - (loop (ja :num-func - num-func-identity - :frame-num - (* (get-current-phase (-> self sync)) (the float (+ (-> (ja-group) data 0 length) -1)))) + (loop + (ja :num-func + num-func-identity + :frame-num + (* (get-current-phase (-> self sync)) (the float (+ (-> (ja-group) data 0 length) -1)))) (let ((a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node minecartsteel-lod0-jg cart)))) (update-trans! (-> self sound) a1-1)) (update! (-> self sound)) diff --git a/goal_src/jak1/levels/village3/miners.gc b/goal_src/jak1/levels/village3/miners.gc index 3b0dc65dac..0c9d9c5f93 100644 --- a/goal_src/jak1/levels/village3/miners.gc +++ b/goal_src/jak1/levels/village3/miners.gc @@ -16,7 +16,8 @@ (when (!= (ja-group) (get-art-elem self)) (ja-channel-push! 1 (seconds 0.2)) (ja :group! (get-art-elem self))) - (loop (suspend) + (loop + (suspend) (ja :num! (loop! 2.0)) (if (= (-> self next-state name) 'idle) (process-taskable-method-43 self))) 0) @@ -397,7 +398,8 @@ :virtual #t :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) diff --git a/goal_src/jak1/levels/village3/village3-obs.gc b/goal_src/jak1/levels/village3/village3-obs.gc index d5c387035f..f96e157be5 100644 --- a/goal_src/jak1/levels/village3/village3-obs.gc +++ b/goal_src/jak1/levels/village3/village3-obs.gc @@ -132,62 +132,63 @@ (679 shadow target #t)))) (ja :group! gondola-idle-down-ja))) (transform-post) - (loop (when (and *target* - (and (< (vector-vector-distance (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node gondola-lod0-jg main)) (target-pos 0)) - 81920.0) - (not (movie?)) - (not (level-hint-displayed?)) - (time-elapsed? (-> self state-time) (seconds 3)) - ;; og:preserve-this fix gondola spool not loading because it's "too far away" (technically) - (#if (not PC_PORT) - (file-status *art-control* (-> self anim name) 0) - (begin - (spool-push *art-control* - (-> self anim name) - 0 - self - (vector-vector-distance (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 3)) (target-pos 0))) - (file-status *art-control* (-> self anim name) 0))))) - (let ((s3-0 (get-reminder (get-task-control (game-task village3-button)) 2)) - (s4-1 (and *cheat-mode* (cpad-hold? 0 l3))) - (s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node gondola-lod0-jg main)))) - (cond - ((not (or s4-1 (task-closed? (game-task village3-button) (task-status need-hint))))) - ((and (< (the int (-> *game-info* fuel)) (+ s3-0 2)) (< (the int (-> *game-info* fuel)) 71) (not s4-1)) - (level-hint-spawn (text-id gondola-need-cells) "asstvb75" (the-as entity #f) *entity-pool* (game-task none))) - (else - (level-hint-spawn (text-id gondola-enough-cells) "asstvb76" (the-as entity #f) *entity-pool* (game-task none)) - (let ((s4-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> s4-3 from) self) - (set! (-> s4-3 num-params) 0) - (set! (-> s4-3 message) 'update) - (let ((s3-1 send-event-function) - (v1-36 (entity-actor-lookup (-> self entity) 'alt-actor 0))) - (s3-1 (if v1-36 (-> v1-36 extra process)) s4-3))) - (let ((s4-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> s4-4 from) self) - (set! (-> s4-4 num-params) 0) - (set! (-> s4-4 message) 'update) - (let ((s3-2 send-event-function) - (v1-40 (entity-actor-lookup (-> self entity) 'alt-actor 1))) - (s3-2 (if v1-40 (-> v1-40 extra process)) s4-4))) - (when (and (< (vector-vector-xz-distance s5-1 (-> *target* control trans)) 18432.0) - (and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))))) - (and (< (+ -40960.0 (-> s5-1 y)) (-> *target* control trans y)) - (begin - (hide-hud) - (level-hint-surpress!) - (kill-current-level-hint () '(sidekick voicebox) 'exit) - (hud-hidden?)) - (can-grab-display? self)))) - (let ((s5-2 (new 'stack 'font-context *font-default-matrix* 32 160 0.0 (font-color default) (font-flags shadow kerning)))) - (let ((v1-59 s5-2)) (set! (-> v1-59 width) (the float 440))) - (let ((v1-60 s5-2)) (set! (-> v1-60 height) (the float 80))) - (set! (-> s5-2 flags) (font-flags shadow kerning large)) - (print-game-text (lookup-text! *common-text* (text-id press-to-use) #f) s5-2 #f 128 22)) - (when (and (cpad-pressed? 0 circle) (process-grab? *target*)) - (if arg0 (go-virtual ride-down) (go-virtual ride-up)))))))) + (loop + (when (and *target* + (and (< (vector-vector-distance (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node gondola-lod0-jg main)) (target-pos 0)) + 81920.0) + (not (movie?)) + (not (level-hint-displayed?)) + (time-elapsed? (-> self state-time) (seconds 3)) + ;; og:preserve-this fix gondola spool not loading because it's "too far away" (technically) + (#if (not PC_PORT) + (file-status *art-control* (-> self anim name) 0) + (begin + (spool-push *art-control* + (-> self anim name) + 0 + self + (vector-vector-distance (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 3)) (target-pos 0))) + (file-status *art-control* (-> self anim name) 0))))) + (let ((s3-0 (get-reminder (get-task-control (game-task village3-button)) 2)) + (s4-1 (and *cheat-mode* (cpad-hold? 0 l3))) + (s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node gondola-lod0-jg main)))) + (cond + ((not (or s4-1 (task-closed? (game-task village3-button) (task-status need-hint))))) + ((and (< (the int (-> *game-info* fuel)) (+ s3-0 2)) (< (the int (-> *game-info* fuel)) 71) (not s4-1)) + (level-hint-spawn (text-id gondola-need-cells) "asstvb75" (the-as entity #f) *entity-pool* (game-task none))) + (else + (level-hint-spawn (text-id gondola-enough-cells) "asstvb76" (the-as entity #f) *entity-pool* (game-task none)) + (let ((s4-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-3 from) self) + (set! (-> s4-3 num-params) 0) + (set! (-> s4-3 message) 'update) + (let ((s3-1 send-event-function) + (v1-36 (entity-actor-lookup (-> self entity) 'alt-actor 0))) + (s3-1 (if v1-36 (-> v1-36 extra process)) s4-3))) + (let ((s4-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> s4-4 from) self) + (set! (-> s4-4 num-params) 0) + (set! (-> s4-4 message) 'update) + (let ((s3-2 send-event-function) + (v1-40 (entity-actor-lookup (-> self entity) 'alt-actor 1))) + (s3-2 (if v1-40 (-> v1-40 extra process)) s4-4))) + (when (and (< (vector-vector-xz-distance s5-1 (-> *target* control trans)) 18432.0) + (and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))))) + (and (< (+ -40960.0 (-> s5-1 y)) (-> *target* control trans y)) + (begin + (hide-hud) + (level-hint-surpress!) + (kill-current-level-hint () '(sidekick voicebox) 'exit) + (hud-hidden?)) + (can-grab-display? self)))) + (let ((s5-2 (new 'stack 'font-context *font-default-matrix* 32 160 0.0 (font-color default) (font-flags shadow kerning)))) + (let ((v1-59 s5-2)) (set! (-> v1-59 width) (the float 440))) + (let ((v1-60 s5-2)) (set! (-> v1-60 height) (the float 80))) + (set! (-> s5-2 flags) (font-flags shadow kerning large)) + (print-game-text (lookup-text! *common-text* (text-id press-to-use) #f) s5-2 #f 128 22)) + (when (and (cpad-pressed? 0 circle) (process-grab? *target*)) + (if arg0 (go-virtual ride-down) (go-virtual ride-up)))))))) (spool-push *art-control* (-> self anim name) 0 self -99.0) (suspend)))) @@ -332,7 +333,8 @@ (process-entity-status! self (entity-perm-status complete) #t) (if (not arg1) (sound-play "gdl-start-up")) (let ((f30-0 (if arg1 1.0 0.0))) - (loop (set! f30-0 (seek f30-0 1.0 (* 0.2 (seconds-per-frame)))) + (loop + (set! f30-0 (seek f30-0 1.0 (* 0.2 (seconds-per-frame)))) (ja :num! (loop! f30-0)) (ja-post) (update! (-> self sound)) @@ -371,7 +373,8 @@ (let ((v0-0 1)) (set! (-> self draw mgeo effect 0 effect-bits) (the-as uint v0-0)) v0-0)))) :code (behavior () - (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (loop + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!))))) diff --git a/goal_src/jak1/levels/village_common/villagep-obs.gc b/goal_src/jak1/levels/village_common/villagep-obs.gc index 55d5788247..b4c3f45b4e 100644 --- a/goal_src/jak1/levels/village_common/villagep-obs.gc +++ b/goal_src/jak1/levels/village_common/villagep-obs.gc @@ -75,35 +75,36 @@ (behavior () (remove-setting! 'allow-progress) (set-time! (-> self state-time)) - (loop (when (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (and (>= (-> self level-slot) 0) - (not (movie?)) - (not (level-hint-displayed?)) - (not (logtest? (-> *target* control root-prim prim-core action) - (collide-action edgegrab-cam swingpole-active racer snowball tube flut))) - (let* ((v1-16 (-> self root)) - (a1-2 (-> *target* control trans)) - (f0-1 (vector-y-angle (vector-! (new 'stack-no-clear 'vector) a1-2 (-> v1-16 trans))))) - (or (!= (-> self level-slot) 3) (and (< f0-1 -9102.223) (< -32768.0 f0-1)))))) - (hide-hud) - (level-hint-surpress!) - (kill-current-level-hint () '(sidekick voicebox) 'exit) - (when (and (hud-hidden?) - (can-grab-display? self) - (cond - ((or (= (-> *target* next-state name) 'target-warp-in) (= (-> *target* next-state name) 'target-warp-out)) - (set-time! (-> self state-time)) - #f) - (else #t)) - (time-elapsed? (-> self state-time) (seconds 0.1))) - (if (and (cpad-pressed? 0 circle) (process-grab? *target*)) (go-virtual active)) - (if (and *cheat-mode* (cpad-pressed? 0 l3)) (set! (-> self max-slot) 4)) - (let ((gp-0 (new 'stack 'font-context *font-default-matrix* 32 160 0.0 (font-color default) (font-flags shadow kerning)))) - (let ((v1-53 gp-0)) (set! (-> v1-53 width) (the float 440))) - (let ((v1-54 gp-0)) (set! (-> v1-54 height) (the float 80))) - (let ((v1-55 gp-0)) (set! (-> v1-55 scale) 0.9)) - (set! (-> gp-0 flags) (font-flags shadow kerning large)) - (print-game-text (lookup-text! *common-text* (text-id press-to-use) #f) gp-0 #f 128 22)))) + (loop + (when (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (and (>= (-> self level-slot) 0) + (not (movie?)) + (not (level-hint-displayed?)) + (not (logtest? (-> *target* control root-prim prim-core action) + (collide-action edgegrab-cam swingpole-active racer snowball tube flut))) + (let* ((v1-16 (-> self root)) + (a1-2 (-> *target* control trans)) + (f0-1 (vector-y-angle (vector-! (new 'stack-no-clear 'vector) a1-2 (-> v1-16 trans))))) + (or (!= (-> self level-slot) 3) (and (< f0-1 -9102.223) (< -32768.0 f0-1)))))) + (hide-hud) + (level-hint-surpress!) + (kill-current-level-hint () '(sidekick voicebox) 'exit) + (when (and (hud-hidden?) + (can-grab-display? self) + (cond + ((or (= (-> *target* next-state name) 'target-warp-in) (= (-> *target* next-state name) 'target-warp-out)) + (set-time! (-> self state-time)) + #f) + (else #t)) + (time-elapsed? (-> self state-time) (seconds 0.1))) + (if (and (cpad-pressed? 0 circle) (process-grab? *target*)) (go-virtual active)) + (if (and *cheat-mode* (cpad-pressed? 0 l3)) (set! (-> self max-slot) 4)) + (let ((gp-0 (new 'stack 'font-context *font-default-matrix* 32 160 0.0 (font-color default) (font-flags shadow kerning)))) + (let ((v1-53 gp-0)) (set! (-> v1-53 width) (the float 440))) + (let ((v1-54 gp-0)) (set! (-> v1-54 height) (the float 80))) + (let ((v1-55 gp-0)) (set! (-> v1-55 scale) 0.9)) + (set! (-> gp-0 flags) (font-flags shadow kerning large)) + (print-game-text (lookup-text! *common-text* (text-id press-to-use) #f) gp-0 #f 128 22)))) (suspend)))) (defun get-next-slot-up ((arg0 warp-gate) (arg1 int)) @@ -163,18 +164,19 @@ (s2-0 0) (s4-0 #f) (s3-0 gp-0)) - (loop (when (zero? s2-0) - (cond - ((cpad-pressed? 0 right) - (set! s5-0 #t) - (set! s4-0 #f) - (sound-play "cursor-up-down") - (set! s3-0 (get-next-slot-up self s3-0))) - ((cpad-pressed? 0 left) - (set! s5-0 #t) - (set! s4-0 #t) - (sound-play "cursor-up-down") - (set! s3-0 (get-next-slot-down self s3-0))))) + (loop + (when (zero? s2-0) + (cond + ((cpad-pressed? 0 right) + (set! s5-0 #t) + (set! s4-0 #f) + (sound-play "cursor-up-down") + (set! s3-0 (get-next-slot-up self s3-0))) + ((cpad-pressed? 0 left) + (set! s5-0 #t) + (set! s4-0 #t) + (sound-play "cursor-up-down") + (set! s3-0 (get-next-slot-down self s3-0))))) (if s5-0 (set! s2-0 (seekl s2-0 300 (the int (* 15.0 (-> *display* time-adjust-ratio)))))) (when (>= s2-0 150) (set! gp-0 s3-0) @@ -495,144 +497,145 @@ :code (behavior () (local-vars (v1-18 symbol)) - (loop (let ((v1-5 (and (and *target* (>= (-> self range) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (and (-> *setting-control* current play-hints) - (< 0.0 (-> *setting-control* current dialog-volume)) - (let ((v1-10 (-> self index))) - (cond - ((zero? v1-10) - (and (>= (-> *game-info* fuel) 20.0) - (not (task-closed? (game-task firecanyon-assistant) (task-status need-reward-speech))))) - ((= v1-10 2) (not (task-closed? (game-task village2-levitator) (task-status need-hint)))) - ((= v1-10 3) (not (task-closed? (game-task village3-button) (task-status need-hint)))) - (else #t))))))) - (when v1-5 - (case (-> self index) - ((2 3) - (until v1-18 - (suspend) - (set! v1-18 - (or (not *target*) - (< (-> self range) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))))) - (let* ((v1-23 (-> self index)) - (v1-24 (cond - ((= v1-23 2) (not (task-closed? (game-task village2-levitator) (task-status need-hint)))) - ((= v1-23 3) (not (task-closed? (game-task village3-button) (task-status need-hint))))))) - (when (not v1-24) - (process-entity-status! self (entity-perm-status bit-3) #f) - (process-entity-status! self (entity-perm-status dead) #t) - (deactivate self))))) - (while (and *target* - (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf)))) - (suspend)) - (set-time! (-> self state-time)) - (process-grab? *target*) - (process-entity-status! self (entity-perm-status bit-3) #t) - (kill-current-level-hint '(ambient) () 'exit) - (until (not (or (-> *setting-control* current talking) - (or (-> *setting-control* current spooling) - (-> *setting-control* current hint) - (-> *setting-control* current ambient) - (not *target*) - (logtest? (-> *target* state-flags) (state-flags being-attacked dying))))) - (set-setting! 'allow-progress #f 0.0 0) - (let* ((a0-25 *setting-control*) - (t9-14 (method-of-object a0-25 set-setting)) - (a2-5 'movie) - (a3-1 (process->ppointer self))) - (t9-14 a0-25 self a2-5 a3-1 0.0 0)) - (apply-settings *setting-control*) - (while (or (-> *setting-control* current talking) - (-> *setting-control* current spooling) - (-> *setting-control* current hint) - (!= (-> *level* loading-level) (-> *level* level-default)) - (not *target*) - (logtest? (-> *target* state-flags) (state-flags being-attacked dying)) - *progress-process*) - (suspend)) - (while (not (time-elapsed? (-> self state-time) (seconds 1))) - (suspend)) - (kill-current-level-hint () () 'die) - (suspend) - (kill-current-level-hint () () 'die) - (process-release? *target*) - (remove-setting! 'movie) - (apply-settings *setting-control*) - (suspend) - (suspend)) - (let ((v1-79 (-> self index))) - (cond - ((zero? v1-79) - (let ((gp-0 (-> self entity extra perm))) - (logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage)) - (let ((v1-84 (-> gp-0 user-uint8 0))) - (cond - ((zero? v1-84) - (level-hint-spawn (text-id village1cam-enough-cells) "asstvb04" (the-as entity #f) *entity-pool* (game-task none)) - (process-spawn pov-camera - (-> self entity extra trans) - *village-cam-sg* - "firecanyon-cam" - 0 - #f - '((0 want-force-vis village1 #t) - (0 alive "money-2669") - (0 alive "money-2670") - (0 alive "money-2671") - (0 alive "money-2672") - (0 alive "money-2673") - (0 alive "money-2674") - (0 alive "money-2675") - (0 alive "money-2677") - (0 alive "money-2678")) - :to - self)) - ((= v1-84 1) - (level-hint-spawn (text-id village1cam-enough-cells2) "asstvb08" (the-as entity #f) *entity-pool* (game-task none)) - (process-spawn pov-camera - (-> self entity extra trans) - *village-cam-sg* - "firecanyon-alt-cam" - 0 - #f - '((0 want-force-vis village1 #t) - (0 alive "money-2669") - (0 alive "money-2670") - (0 alive "money-2671") - (0 alive "money-2672") - (0 alive "money-2673") - (0 alive "money-2674") - (0 alive "money-2675") - (0 alive "money-2677") - (0 alive "money-2678")) - :to - self)))) - (set! (-> gp-0 user-int8 0) (seekl (the-as int (-> gp-0 user-uint8 0)) 255 1)))) - ((= v1-79 1)) - ((= v1-79 2) - (when (not (task-closed? (game-task village2-levitator) (task-status need-hint))) - (level-hint-spawn (text-id village2-button-reminder2) "asstvb29" (the-as entity #f) *entity-pool* (game-task none)) - (process-spawn pov-camera (-> self entity extra trans) *village-cam-sg* "vi2-button-cam" 0 #f () :to self))) - ((= v1-79 3) - (when (not (task-closed? (game-task village3-button) (task-status need-hint))) - (level-hint-spawn (text-id village2-button-reminder3) "asstvb30" (the-as entity #f) *entity-pool* (game-task none)) - (process-spawn pov-camera (-> self entity extra trans) *village-cam-sg* "vi3-button-cam" 0 #f () :to self))))) - (while (-> self child) - (suspend)) - (let ((a0-66 (-> self entity))) - (if (when a0-66 - (let ((a0-67 (-> a0-66 extra perm task))) (if a0-67 (= a0-67 (game-task none))))) - (set! (-> self entity extra perm task) (game-task complete)))) - (when (zero? (-> self index)) - (let ((a0-70 (-> self entity extra perm))) - (when (= (-> a0-70 user-uint8 0) 1) - (remove-setting! 'allow-progress) - (let ((gp-3 (current-time))) (until (time-elapsed? gp-3 (seconds 300)) (suspend))) - (go-virtual idle)))) - (process-entity-status! self (entity-perm-status bit-3) #f) - (process-entity-status! self (entity-perm-status dead) #t) - (deactivate self))) + (loop + (let ((v1-5 (and (and *target* (>= (-> self range) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (and (-> *setting-control* current play-hints) + (< 0.0 (-> *setting-control* current dialog-volume)) + (let ((v1-10 (-> self index))) + (cond + ((zero? v1-10) + (and (>= (-> *game-info* fuel) 20.0) + (not (task-closed? (game-task firecanyon-assistant) (task-status need-reward-speech))))) + ((= v1-10 2) (not (task-closed? (game-task village2-levitator) (task-status need-hint)))) + ((= v1-10 3) (not (task-closed? (game-task village3-button) (task-status need-hint)))) + (else #t))))))) + (when v1-5 + (case (-> self index) + ((2 3) + (until v1-18 + (suspend) + (set! v1-18 + (or (not *target*) + (< (-> self range) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))))) + (let* ((v1-23 (-> self index)) + (v1-24 (cond + ((= v1-23 2) (not (task-closed? (game-task village2-levitator) (task-status need-hint)))) + ((= v1-23 3) (not (task-closed? (game-task village3-button) (task-status need-hint))))))) + (when (not v1-24) + (process-entity-status! self (entity-perm-status bit-3) #f) + (process-entity-status! self (entity-perm-status dead) #t) + (deactivate self))))) + (while (and *target* + (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf)))) + (suspend)) + (set-time! (-> self state-time)) + (process-grab? *target*) + (process-entity-status! self (entity-perm-status bit-3) #t) + (kill-current-level-hint '(ambient) () 'exit) + (until (not (or (-> *setting-control* current talking) + (or (-> *setting-control* current spooling) + (-> *setting-control* current hint) + (-> *setting-control* current ambient) + (not *target*) + (logtest? (-> *target* state-flags) (state-flags being-attacked dying))))) + (set-setting! 'allow-progress #f 0.0 0) + (let* ((a0-25 *setting-control*) + (t9-14 (method-of-object a0-25 set-setting)) + (a2-5 'movie) + (a3-1 (process->ppointer self))) + (t9-14 a0-25 self a2-5 a3-1 0.0 0)) + (apply-settings *setting-control*) + (while (or (-> *setting-control* current talking) + (-> *setting-control* current spooling) + (-> *setting-control* current hint) + (!= (-> *level* loading-level) (-> *level* level-default)) + (not *target*) + (logtest? (-> *target* state-flags) (state-flags being-attacked dying)) + *progress-process*) + (suspend)) + (while (not (time-elapsed? (-> self state-time) (seconds 1))) + (suspend)) + (kill-current-level-hint () () 'die) + (suspend) + (kill-current-level-hint () () 'die) + (process-release? *target*) + (remove-setting! 'movie) + (apply-settings *setting-control*) + (suspend) + (suspend)) + (let ((v1-79 (-> self index))) + (cond + ((zero? v1-79) + (let ((gp-0 (-> self entity extra perm))) + (logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage)) + (let ((v1-84 (-> gp-0 user-uint8 0))) + (cond + ((zero? v1-84) + (level-hint-spawn (text-id village1cam-enough-cells) "asstvb04" (the-as entity #f) *entity-pool* (game-task none)) + (process-spawn pov-camera + (-> self entity extra trans) + *village-cam-sg* + "firecanyon-cam" + 0 + #f + '((0 want-force-vis village1 #t) + (0 alive "money-2669") + (0 alive "money-2670") + (0 alive "money-2671") + (0 alive "money-2672") + (0 alive "money-2673") + (0 alive "money-2674") + (0 alive "money-2675") + (0 alive "money-2677") + (0 alive "money-2678")) + :to + self)) + ((= v1-84 1) + (level-hint-spawn (text-id village1cam-enough-cells2) "asstvb08" (the-as entity #f) *entity-pool* (game-task none)) + (process-spawn pov-camera + (-> self entity extra trans) + *village-cam-sg* + "firecanyon-alt-cam" + 0 + #f + '((0 want-force-vis village1 #t) + (0 alive "money-2669") + (0 alive "money-2670") + (0 alive "money-2671") + (0 alive "money-2672") + (0 alive "money-2673") + (0 alive "money-2674") + (0 alive "money-2675") + (0 alive "money-2677") + (0 alive "money-2678")) + :to + self)))) + (set! (-> gp-0 user-int8 0) (seekl (the-as int (-> gp-0 user-uint8 0)) 255 1)))) + ((= v1-79 1)) + ((= v1-79 2) + (when (not (task-closed? (game-task village2-levitator) (task-status need-hint))) + (level-hint-spawn (text-id village2-button-reminder2) "asstvb29" (the-as entity #f) *entity-pool* (game-task none)) + (process-spawn pov-camera (-> self entity extra trans) *village-cam-sg* "vi2-button-cam" 0 #f () :to self))) + ((= v1-79 3) + (when (not (task-closed? (game-task village3-button) (task-status need-hint))) + (level-hint-spawn (text-id village2-button-reminder3) "asstvb30" (the-as entity #f) *entity-pool* (game-task none)) + (process-spawn pov-camera (-> self entity extra trans) *village-cam-sg* "vi3-button-cam" 0 #f () :to self))))) + (while (-> self child) + (suspend)) + (let ((a0-66 (-> self entity))) + (if (when a0-66 + (let ((a0-67 (-> a0-66 extra perm task))) (if a0-67 (= a0-67 (game-task none))))) + (set! (-> self entity extra perm task) (game-task complete)))) + (when (zero? (-> self index)) + (let ((a0-70 (-> self entity extra perm))) + (when (= (-> a0-70 user-uint8 0) 1) + (remove-setting! 'allow-progress) + (let ((gp-3 (current-time))) (until (time-elapsed? gp-3 (seconds 300)) (suspend))) + (go-virtual idle)))) + (process-entity-status! self (entity-perm-status bit-3) #f) + (process-entity-status! self (entity-perm-status dead) #t) + (deactivate self))) (suspend)))) (defmethod init-from-entity! ((this village-cam) (arg0 entity-actor)) diff --git a/goal_src/jak1/old/cavegeyserrock.gc b/goal_src/jak1/old/cavegeyserrock.gc index d68aeb45af..23c77801ed 100644 --- a/goal_src/jak1/old/cavegeyserrock.gc +++ b/goal_src/jak1/old/cavegeyserrock.gc @@ -9,9 +9,7 @@ ;; name in dgo: cavegeyserrock ;; dgos: L1 -#| -This file is only found in early demos. -|# +#| This file is only found in early demos. |# ;; decomp begins diff --git a/goal_src/jak1/pc/debug/anim-tester-x.gc b/goal_src/jak1/pc/debug/anim-tester-x.gc index 286209f93f..f51f74b240 100644 --- a/goal_src/jak1/pc/debug/anim-tester-x.gc +++ b/goal_src/jak1/pc/debug/anim-tester-x.gc @@ -5,8 +5,8 @@ (require "engine/anim/aligner.gc") #| - Code for the PC port anim tester. It's like their original anim tester tool, but actually functional, and with - different features. + Code for the PC port anim tester. It's like their original anim tester tool, but actually functional, and with + different features. |# ;; debug-only file! @@ -324,29 +324,30 @@ (behavior () (let ((need-update #f) (lst (the-as atx-list #f))) - (loop (when (and (-> self cur-joint-geo) (!= (-> self cur-joint-geo) (-> self draw jgeo))) - (process-disconnect self) - (set! (-> self draw art-group) (-> self cur-art-group)) - (set! (-> self draw cur-lod) -1) - (set! (-> self draw jgeo) (-> self cur-joint-geo)) - (set! (-> self draw sink-group) (-> *level* level-default foreground-sink-group 1)) - (set! (-> self draw lod-set lod 0 geo) (-> self cur-mesh-geo)) - (set! (-> self draw lod-set lod 0 dist) (meters 999999)) - (set! (-> self draw bounds w) (meters 10)) - (set! (-> self draw data-format) (the-as uint 1)) - (vector-copy! (-> self draw color-mult) (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) - (vector-copy! (-> self draw color-emissive) (new 'static 'vector)) - (set! (-> self draw secondary-interp) 0.0) - (set! (-> self draw shadow) #f) - (set! (-> self draw shadow-ctrl) #f) - (set! (-> self draw ripple) #f) - (set! (-> self draw level-index) (the-as uint 2)) - (set! (-> self node-list) (make-nodes-from-jg (-> self draw jgeo) *default-skel-template* 'debug)) - (if (not (-> self skel effect)) (set! (-> self skel effect) (new 'process 'effect-control self))) - (fill-skeleton-cache self) - (lod-set! (-> self draw) 0) - (ja-channel-set! 0) - (set! lst (-> self selected-art-group ja-list))) + (loop + (when (and (-> self cur-joint-geo) (!= (-> self cur-joint-geo) (-> self draw jgeo))) + (process-disconnect self) + (set! (-> self draw art-group) (-> self cur-art-group)) + (set! (-> self draw cur-lod) -1) + (set! (-> self draw jgeo) (-> self cur-joint-geo)) + (set! (-> self draw sink-group) (-> *level* level-default foreground-sink-group 1)) + (set! (-> self draw lod-set lod 0 geo) (-> self cur-mesh-geo)) + (set! (-> self draw lod-set lod 0 dist) (meters 999999)) + (set! (-> self draw bounds w) (meters 10)) + (set! (-> self draw data-format) (the-as uint 1)) + (vector-copy! (-> self draw color-mult) (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) + (vector-copy! (-> self draw color-emissive) (new 'static 'vector)) + (set! (-> self draw secondary-interp) 0.0) + (set! (-> self draw shadow) #f) + (set! (-> self draw shadow-ctrl) #f) + (set! (-> self draw ripple) #f) + (set! (-> self draw level-index) (the-as uint 2)) + (set! (-> self node-list) (make-nodes-from-jg (-> self draw jgeo) *default-skel-template* 'debug)) + (if (not (-> self skel effect)) (set! (-> self skel effect) (new 'process 'effect-control self))) + (fill-skeleton-cache self) + (lod-set! (-> self draw) 0) + (ja-channel-set! 0) + (set! lst (-> self selected-art-group ja-list))) (cond ((-> self cur-joint-geo) (if (> 1 (-> self skel active-channels)) (ja-channel-set! 1)) diff --git a/goal_src/jak1/pc/debug/default-menu-pc.gc b/goal_src/jak1/pc/debug/default-menu-pc.gc index 9c31e0acf9..55266492f0 100644 --- a/goal_src/jak1/pc/debug/default-menu-pc.gc +++ b/goal_src/jak1/pc/debug/default-menu-pc.gc @@ -7,9 +7,7 @@ (require "pc/debug/entity-debug.gc") (require "pc/debug/anim-tester-x.gc") -#| - Extra debug menus for PC port. -|# +#| Extra debug menus for PC port. |# (declare-file (debug)) (defmacro new-dm-func (text var func) @@ -425,7 +423,8 @@ (process-spawn-function process :name 'dm-player (lambda :behavior process ((lst pair)) - (loop (suspend) + (loop + (suspend) (set-setting! 'music (the-as symbol (car lst)) 0.0 0) (set! *progress-flava* (the-as int (cdr lst))))) lst)) diff --git a/goal_src/jak1/pc/debug/entity-debug.gc b/goal_src/jak1/pc/debug/entity-debug.gc index 63aa770afa..4805a12e5a 100644 --- a/goal_src/jak1/pc/debug/entity-debug.gc +++ b/goal_src/jak1/pc/debug/entity-debug.gc @@ -6,9 +6,7 @@ (require "engine/debug/debug.gc") (require "engine/game/game-info-h.gc") -#| - Entity debugging utilities. -|# +#| Entity debugging utilities. |# (declare-file (debug)) diff --git a/goal_src/jak1/pc/debug/pc-debug-common.gc b/goal_src/jak1/pc/debug/pc-debug-common.gc index edd4a4a0b9..879ebad077 100644 --- a/goal_src/jak1/pc/debug/pc-debug-common.gc +++ b/goal_src/jak1/pc/debug/pc-debug-common.gc @@ -3,9 +3,7 @@ (require "kernel/gstring.gc") (require "engine/math/math.gc") -#| - Various debugging displays made for the pc port. This file is shared for all games. -|# +#| Various debugging displays made for the pc port. This file is shared for all games. |# ;; debug-only file! (declare-file (debug)) diff --git a/goal_src/jak1/pc/debug/pc-debug-methods.gc b/goal_src/jak1/pc/debug/pc-debug-methods.gc index 9454ba84ae..e1df1c0a8e 100644 --- a/goal_src/jak1/pc/debug/pc-debug-methods.gc +++ b/goal_src/jak1/pc/debug/pc-debug-methods.gc @@ -5,9 +5,7 @@ (require "engine/math/quaternion-h.gc") (require "engine/game/game-info-h.gc") -#| - Various debugging displays made for the pc port. This file includes overrides or game-specific implementations. -|# +#| Various debugging displays made for the pc port. This file includes overrides or game-specific implementations. |# ;; debug-only file! (declare-file (debug)) diff --git a/goal_src/jak1/pc/hud-classes-pc.gc b/goal_src/jak1/pc/hud-classes-pc.gc index d93cbbe1c4..5eb847ad11 100644 --- a/goal_src/jak1/pc/hud-classes-pc.gc +++ b/goal_src/jak1/pc/hud-classes-pc.gc @@ -3,9 +3,7 @@ (require "engine/ui/hud.gc") (require "levels/common/battlecontroller.gc") -#| - Code for extra HUD elements in the PC port. -|# +#| Code for extra HUD elements in the PC port. |# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; constants diff --git a/goal_src/jak1/pc/pckernel-common.gc b/goal_src/jak1/pc/pckernel-common.gc index 48d466aadc..8056343e61 100644 --- a/goal_src/jak1/pc/pckernel-common.gc +++ b/goal_src/jak1/pc/pckernel-common.gc @@ -3,22 +3,22 @@ (require "engine/gfx/sprite/sparticle/sparticle-launcher.gc") #| - This file contains new code that we need for the PC port of the game specifically. - It should be included as part of the game engine package (engine.cgo). - - This file contains various types and functions to store PC-specific information - and also to communicate between the game (GOAL) and the operating system. - This way we can poll, change and display information about the system the game - is running on, such as: - - display devices and their settings, such as fullscreen, DPI, refresh rate, etc. - - audio devices and their settings, such as audio latency, channel number, etc. - - graphics devices and their settings, such as resolution, FPS, anisotropy, shaders, etc. - - input devices and their settings, such as controllers, keyboards, mice, etc. - - information about the game window (position, size) - - PC-specific goodies, enhancements, fixes and settings. - - whatever else. - - If you do not want to include these PC things, you should exclude it from the build system. + This file contains new code that we need for the PC port of the game specifically. + It should be included as part of the game engine package (engine.cgo). + + This file contains various types and functions to store PC-specific information + and also to communicate between the game (GOAL) and the operating system. + This way we can poll, change and display information about the system the game + is running on, such as: + - display devices and their settings, such as fullscreen, DPI, refresh rate, etc. + - audio devices and their settings, such as audio latency, channel number, etc. + - graphics devices and their settings, such as resolution, FPS, anisotropy, shaders, etc. + - input devices and their settings, such as controllers, keyboards, mice, etc. + - information about the game window (position, size) + - PC-specific goodies, enhancements, fixes and settings. + - whatever else. + + If you do not want to include these PC things, you should exclude it from the build system. |# (format 0 "pckernel version: ~D.~D~%" PC_KERNEL_VER_MAJOR PC_KERNEL_VER_MINOR) diff --git a/goal_src/jak1/pc/pckernel-h.gc b/goal_src/jak1/pc/pckernel-h.gc index 389755fa0f..b026a73897 100644 --- a/goal_src/jak1/pc/pckernel-h.gc +++ b/goal_src/jak1/pc/pckernel-h.gc @@ -3,22 +3,22 @@ (require "engine/ps2/pad.gc") #| - This file contains code that we need for the PC port of the game specifically. - It should be included as part of the game engine package (engine.cgo). - - This file contains various types and functions to store PC-specific information - and also to communicate between the game (GOAL) and the operating system. - This way we can poll, change and display information about the system the game - is running on, such as: - - display devices and their settings, such as fullscreen, DPI, refresh rate, etc. - - audio devices and their settings, such as audio latency, channel number, etc. - - graphics devices and their settings, such as resolution, FPS, anisotropy, shaders, etc. - - input devices and their settings, such as controllers, keyboards, mice, etc. - - information about the game window (position, size) - - PC-specific goodies, enhancements, fixes and settings. - - whatever else. - - If you do not want to include these PC things, you should exclude it from the build system. + This file contains code that we need for the PC port of the game specifically. + It should be included as part of the game engine package (engine.cgo). + + This file contains various types and functions to store PC-specific information + and also to communicate between the game (GOAL) and the operating system. + This way we can poll, change and display information about the system the game + is running on, such as: + - display devices and their settings, such as fullscreen, DPI, refresh rate, etc. + - audio devices and their settings, such as audio latency, channel number, etc. + - graphics devices and their settings, such as resolution, FPS, anisotropy, shaders, etc. + - input devices and their settings, such as controllers, keyboards, mice, etc. + - information about the game window (position, size) + - PC-specific goodies, enhancements, fixes and settings. + - whatever else. + + If you do not want to include these PC things, you should exclude it from the build system. |# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/goal_src/jak1/pc/pckernel-impl.gc b/goal_src/jak1/pc/pckernel-impl.gc index b105401ec7..3e61cd0222 100644 --- a/goal_src/jak1/pc/pckernel-impl.gc +++ b/goal_src/jak1/pc/pckernel-impl.gc @@ -2,9 +2,7 @@ (in-package goal) (require "pc/pckernel-h.gc") -#| - This file has the game-specific implementation of the pckernel (see pckernel-h.gc and pckernel.gc). -|# +#| This file has the game-specific implementation of the pckernel (see pckernel-h.gc and pckernel.gc). |# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; constants diff --git a/goal_src/jak1/pc/progress-pc.gc b/goal_src/jak1/pc/progress-pc.gc index 08c4da8d96..c6f02b1c16 100644 --- a/goal_src/jak1/pc/progress-pc.gc +++ b/goal_src/jak1/pc/progress-pc.gc @@ -2,9 +2,7 @@ (in-package goal) (require "engine/ui/progress/progress.gc") -#| - Code for the progress menu in the PC port. The original code is still loaded, this just has some overriden functions. -|# +#| Code for the progress menu in the PC port. The original code is still loaded, this just has some overriden functions. |# ;;--------------------------- ;;--------------------------- @@ -2928,12 +2926,13 @@ ;; override this as well... (set! (-> progress-normal code) (lambda :behavior progress () - (loop (when (and (cpad-hold? 0 l1) (cpad-hold? 0 r1) *cheat-mode*) - (when (and (< (-> self task-index) (-> *level-task-data* (-> self display-level-index) nb-of-tasks)) - (>= (-> self task-index) 0)) - (let ((gp-0 (-> *level-task-data* (-> self display-level-index) task-info (-> self task-index) task-id))) - (close-specific-task! gp-0 (task-status need-resolution)) - (send-event *target* 'get-pickup (pickup-type fuel-cell) (the float gp-0))))) + (loop + (when (and (cpad-hold? 0 l1) (cpad-hold? 0 r1) *cheat-mode*) + (when (and (< (-> self task-index) (-> *level-task-data* (-> self display-level-index) nb-of-tasks)) + (>= (-> self task-index) 0)) + (let ((gp-0 (-> *level-task-data* (-> self display-level-index) task-info (-> self task-index) task-id))) + (close-specific-task! gp-0 (task-status need-resolution)) + (send-event *target* 'get-pickup (pickup-type fuel-cell) (the float gp-0))))) (if (and (= (-> self display-state) (-> self next-display-state)) (= (-> self display-level-index) (-> self next-level-index))) (seekl! (-> self transition-offset) diff --git a/goal_src/jak1/pc/subtitle.gc b/goal_src/jak1/pc/subtitle.gc index 6bf58cefaf..3542b49a80 100644 --- a/goal_src/jak1/pc/subtitle.gc +++ b/goal_src/jak1/pc/subtitle.gc @@ -4,15 +4,15 @@ (require "pc/pckernel.gc") #| - Code for subtitles for the PC port. A PC actor pool is provided, and the subtitle process lives there. - It automatically detects the currently playing cutscene and plays the subtitles for it on channel 0. - The other two channels are for hints, first checked automatically by name, then by text ID. - There is a hack in ambient.gc to store the name of the last ambient hint vag played to aid in this. - - Similarly to the generic text file, only one subtitles text file is loaded at once, stored in a specific - heap. - - In Jak 2, the subtitles are stored directly within the .STR files. We don't have that luxury here, unfortunately. + Code for subtitles for the PC port. A PC actor pool is provided, and the subtitle process lives there. + It automatically detects the currently playing cutscene and plays the subtitles for it on channel 0. + The other two channels are for hints, first checked automatically by name, then by text ID. + There is a hack in ambient.gc to store the name of the last ambient hint vag played to aid in this. + + Similarly to the generic text file, only one subtitles text file is loaded at once, stored in a specific + heap. + + In Jak 2, the subtitles are stored directly within the .STR files. We don't have that luxury here, unfortunately. |# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -434,7 +434,8 @@ (('debug) (go subtitle-debug)))) :code (behavior () - (loop (suspend))) + (loop + (suspend))) :trans (behavior () (load-level-subtitle-files 0) diff --git a/goal_src/jak1/pc/util/display-font-color.gc b/goal_src/jak1/pc/util/display-font-color.gc index 2916b22dab..6d319522cb 100644 --- a/goal_src/jak1/pc/util/display-font-color.gc +++ b/goal_src/jak1/pc/util/display-font-color.gc @@ -41,7 +41,8 @@ (ppointer->handle (process-spawn-function process :name 'display-proc (lambda :behavior process () - (loop (draw-all-font-colors) + (loop + (draw-all-font-colors) (suspend)))))))) (defun-debug stop-display-text-colors () diff --git a/goal_src/jak1/pc/util/font-encode-test.gc b/goal_src/jak1/pc/util/font-encode-test.gc index 3d43ddee8f..790239c5f2 100644 --- a/goal_src/jak1/pc/util/font-encode-test.gc +++ b/goal_src/jak1/pc/util/font-encode-test.gc @@ -48,7 +48,8 @@ (font-flags shadow kerning large middle)))) (set-width! fnt 400) (set-height! fnt 100) - (loop (suspend) + (loop + (suspend) (if (or (cpad-pressed? 0 left) (cpad-hold? 0 l1)) (-! *font-string-val* 1)) (if (or (cpad-pressed? 0 right) (cpad-hold? 0 r1)) (+! *font-string-val* 1)) (minmax! *font-string-val* 1 #x1ff) diff --git a/goal_src/jak1/pc/util/pc-anim-util.gc b/goal_src/jak1/pc/util/pc-anim-util.gc index ca33612b4c..a728348c23 100644 --- a/goal_src/jak1/pc/util/pc-anim-util.gc +++ b/goal_src/jak1/pc/util/pc-anim-util.gc @@ -6,9 +6,9 @@ (require "engine/target/target-h.gc") #| -A random assortment of functions used for manipulating various animations and skeletons in the pc port. - -This is used for funny cheat codes and the like. + A random assortment of functions used for manipulating various animations and skeletons in the pc port. + + This is used for funny cheat codes and the like. |# (define *cheat-big-head-scale* (new 'static 'vector :x 1.5 :y 1.5 :z 1.5 :w 1.0)) diff --git a/goal_src/jak1/pc/util/pc-pad-utils.gc b/goal_src/jak1/pc/util/pc-pad-utils.gc index 3f8b8981e4..2954f8ecc5 100644 --- a/goal_src/jak1/pc/util/pc-pad-utils.gc +++ b/goal_src/jak1/pc/util/pc-pad-utils.gc @@ -90,8 +90,9 @@ (lambda :behavior pc-pad-proc () (stack-size-set! (-> self main-thread) 512) (format #t "Reference keycode constants at https://www.glfw.org/docs/latest/group__keys.html~%") - (loop (dotimes (_ 9) - (format *stdcon* "~%")) + (loop + (dotimes (_ 9) + (format *stdcon* "~%")) (dotimes (ii 2) (format *stdcon* " ~0k~3Lcpad ~D~0L~%" ii) (dotimes (j 8) @@ -229,19 +230,20 @@ (defstate pc-pi-mapping-button (pc-pad-proc) :code (behavior () - (loop (with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf)) (bucket-id debug-no-zbuf)) - (draw-string-xy "PRESS ESCAPE TO EXIT" - buf - 256 - (+ PC_PAD_TOP_Y 32) - (font-color default) - (font-flags shadow kerning large middle)) - (draw-string-xy (string-format "PRESS KEY FOR ~S" (-> *pc-pad-button-names* (-> self input-index))) - buf - 256 - (+ PC_PAD_TOP_Y 64) - (font-color default) - (font-flags shadow kerning large middle))) + (loop + (with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf)) (bucket-id debug-no-zbuf)) + (draw-string-xy "PRESS ESCAPE TO EXIT" + buf + 256 + (+ PC_PAD_TOP_Y 32) + (font-color default) + (font-flags shadow kerning large middle)) + (draw-string-xy (string-format "PRESS KEY FOR ~S" (-> *pc-pad-button-names* (-> self input-index))) + buf + 256 + (+ PC_PAD_TOP_Y 64) + (font-color default) + (font-flags shadow kerning large middle))) (suspend))) :trans (behavior () diff --git a/test/common/formatter/corpus/comments.test.gc b/test/common/formatter/corpus/comments.test.gc index 69d405bde8..89a6c9bf91 100644 --- a/test/common/formatter/corpus/comments.test.gc +++ b/test/common/formatter/corpus/comments.test.gc @@ -62,9 +62,7 @@ Block Comment - Single Line --- -#| -block comment -|# +#| block comment |# === Block Comment - Don't Allow Content on Opening Brace @@ -85,6 +83,26 @@ Block Comment - Don't Allow Content on Opening Brace (println "test") +=== +Block Comment - Don't continually add indentation +=== + +(begin + #| + block comment + test + |# + (println "something")) + +--- + +(begin + #| + block comment + test + |# + (println "something")) + === Block Comment - Allow Annotations === @@ -118,8 +136,8 @@ Block Comment - In Form (println #| - block comment - test + block comment + test |# "test") @@ -150,9 +168,7 @@ Block at the end of a form --- (println "hello world" - #| - wow look at that block comment - |# + #| wow look at that block comment |# ) === @@ -193,3 +209,15 @@ TODO - Comments in arg lists &key (version 6) ;; do NOT use this! ) (println "hello")) + +=== +Block comment - preserve @file +=== + +#|@file + Compiler Setup for Jak 1 +|# + +--- + +#|@file Compiler Setup for Jak 1 |# \ No newline at end of file