From 8d1fec34b43f77996b04cb7d24146a86d8209ecc Mon Sep 17 00:00:00 2001 From: ManDude <7569514+ManDude@users.noreply.github.com> Date: Sat, 4 Nov 2023 18:25:13 +0000 Subject: [PATCH] allow per-file override of type-to-artgroup map + use correct divide by zero handler in `civilian.gc` (#3148) --- decompiler/ObjectFile/ObjectFileDB_IR2.cpp | 24 +++++- decompiler/config.cpp | 5 ++ decompiler/config.h | 2 + decompiler/config/jak2/ntsc_v1/art_info.jsonc | 5 ++ goal_src/goal-lib.gc | 36 +++++++- .../levels/city/traffic/citizen/civilian.gc | 2 +- goal_src/jak2/levels/tomb/target-indax.gc | 82 +++++++++--------- .../jak2/levels/tomb/target-indax_REF.gc | 86 ++++++++++--------- 8 files changed, 155 insertions(+), 87 deletions(-) diff --git a/decompiler/ObjectFile/ObjectFileDB_IR2.cpp b/decompiler/ObjectFile/ObjectFileDB_IR2.cpp index e0cdc72f40..f5447c7185 100644 --- a/decompiler/ObjectFile/ObjectFileDB_IR2.cpp +++ b/decompiler/ObjectFile/ObjectFileDB_IR2.cpp @@ -510,6 +510,20 @@ Value try_lookup(const std::unordered_map& map, const Key& key) { } } +const std::string* find_file_override_for_art_group(const Config& config, + const std::string& obj_name, + const std::string& type_name) { + // find file override for this type + auto it_file = config.art_group_file_override.find(obj_name); + if (it_file != config.art_group_file_override.end()) { + auto it_type = it_file->second.find(type_name); + if (it_type != it_file->second.end()) { + return &it_type->second; + } + } + return nullptr; +} + /*! * Analyze registers and determine the type in each register at each instruction. * - Figure out the type of each function, from configs. @@ -550,7 +564,11 @@ void ObjectFileDB::ir2_type_analysis_pass(int seg, const Config& config, ObjectF if (func.guessed_name.kind == FunctionName::FunctionKind::V_STATE) { if (config.art_group_type_remap.find(func.guessed_name.type_name) != config.art_group_type_remap.end()) { - func.ir2.env.set_art_group(config.art_group_type_remap.at(func.guessed_name.type_name)); + auto ag_override = + find_file_override_for_art_group(config, obj_name, func.guessed_name.type_name); + func.ir2.env.set_art_group( + ag_override ? *ag_override + : config.art_group_type_remap.at(func.guessed_name.type_name)); } else { func.ir2.env.set_art_group(func.guessed_name.type_name + "-ag"); } @@ -558,7 +576,9 @@ void ObjectFileDB::ir2_type_analysis_pass(int seg, const Config& config, ObjectF func.type.try_get_tag("behavior").has_value()) { std::string type = func.type.get_tag("behavior"); if (config.art_group_type_remap.find(type) != config.art_group_type_remap.end()) { - func.ir2.env.set_art_group(config.art_group_type_remap.at(type)); + auto ag_override = find_file_override_for_art_group(config, obj_name, type); + func.ir2.env.set_art_group(ag_override ? *ag_override + : config.art_group_type_remap.at(type)); } else { func.ir2.env.set_art_group(type + "-ag"); } diff --git a/decompiler/config.cpp b/decompiler/config.cpp index a69bfbdcb3..a77cf47094 100644 --- a/decompiler/config.cpp +++ b/decompiler/config.cpp @@ -297,6 +297,11 @@ Config make_config_via_json(nlohmann::json& json) { auto art_info_json = read_json_file_from_config(json, "art_info_file"); config.art_group_type_remap = art_info_json.at("type_remap").get>(); + if (art_info_json.contains("file_override")) { + config.art_group_file_override = + art_info_json.at("file_override") + .get>>(); + } config.joint_node_hacks = art_info_json.at("joint_node_hacks").get>(); diff --git a/decompiler/config.h b/decompiler/config.h index 8925c30912..9b2ac66f1d 100644 --- a/decompiler/config.h +++ b/decompiler/config.h @@ -171,6 +171,8 @@ struct Config { DecompileHacks hacks; std::unordered_map art_group_type_remap; + std::unordered_map> + art_group_file_override; std::unordered_map> art_group_info_dump; std::unordered_map> jg_info_dump; std::unordered_map joint_node_hacks; diff --git a/decompiler/config/jak2/ntsc_v1/art_info.jsonc b/decompiler/config/jak2/ntsc_v1/art_info.jsonc index 329ee12e31..ea1e615fcd 100644 --- a/decompiler/config/jak2/ntsc_v1/art_info.jsonc +++ b/decompiler/config/jak2/ntsc_v1/art_info.jsonc @@ -43,6 +43,11 @@ "transport-level": "transport-ag" }, + // remap names for types in an entire file (higher priority) + "file_override": { + "target-indax": {"target": "daxter-ag"} // in target-indax.gc, the remap for 'target' will be set to 'daxter-ag' + }, + // some art groups (like robotboss-ag) have a name for their model that differs // from the usual ag-name + "-lod0". you can add those exceptions here. "joint_node_hacks": { diff --git a/goal_src/goal-lib.gc b/goal_src/goal-lib.gc index 12be289f59..1a7263bb72 100644 --- a/goal_src/goal-lib.gc +++ b/goal_src/goal-lib.gc @@ -715,7 +715,7 @@ ) (defmacro /-0-guard (a b) - "same as divide but returns -1 when divisor is zero (EE-like)." + "same as divide but returns -1 when divisor is zero (EE-like, DIVU)." `(let ((divisor ,b)) (if (zero? divisor) -1 @@ -723,8 +723,24 @@ ) ) +(defmacro /-signed-0-guard (a b) + "same as divide but handles overflow and divide by zero like the EE's DIV instruction." + `(let ((divisor ,b) + (dividend ,a)) + (cond + ((and (= dividend -2147483648) (= divisor -1)) + ;; overflow case + -2147483648) + ((zero? divisor) + (if (< dividend 0) 1 -1)) + (else + (/ dividend divisor)) + ) + ) + ) + (defmacro mod-0-guard (a b) - "same as modulo but returns the dividend when divisor is zero (EE-like)." + "same as modulo but returns the dividend when divisor is zero (EE-like, DIVU)." `(let ((divisor ,b)) (if (zero? divisor) ,a @@ -732,6 +748,22 @@ ) ) +(defmacro mod-signed-0-guard (a b) + "same as modulo but handles overflow and divide by zero like the EE's DIV instruction." + `(let ((divisor ,b) + (dividend ,a)) + (cond + ((and (= dividend -2147483648) (= divisor -1)) + ;; overflow case + 0) + ((zero? divisor) + dividend) + (else + (mod dividend divisor)) + ) + ) + ) + (defmacro float->int (a) "forcefully casts something as a float to int. be careful." `(the int (the float ,a)) diff --git a/goal_src/jak2/levels/city/traffic/citizen/civilian.gc b/goal_src/jak2/levels/city/traffic/citizen/civilian.gc index f783ea287f..bfd3ab1e5d 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/civilian.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/civilian.gc @@ -384,7 +384,7 @@ (+! f30-0 (civilian-method-214 this (-> s3-0 branch-array s0-0) (+ arg1 -1) arg2 s1-0)) ) ;; og:preserve-this changed to fix a divide by zero crash - (set! arg3 (+ s1-0 (the float (/-0-guard (the int f30-0) s2-0)))) + (set! arg3 (+ s1-0 (the float (/-signed-0-guard (the int f30-0) s2-0)))) ) ) ) diff --git a/goal_src/jak2/levels/tomb/target-indax.gc b/goal_src/jak2/levels/tomb/target-indax.gc index 283dc995e0..38ab5d7cdf 100644 --- a/goal_src/jak2/levels/tomb/target-indax.gc +++ b/goal_src/jak2/levels/tomb/target-indax.gc @@ -511,8 +511,8 @@ :code (behavior () (let ((v1-2 (ja-group))) (cond - ((and v1-2 (= v1-2 jakb-darkjak-attack-ice-end-ja)) - (ja-no-eval :group! (-> self draw art-group data 422) :num! (seek!) :frame-num 0.0) + ((and v1-2 (= v1-2 daxter-indax-attack-spin-ja)) + (ja-no-eval :group! daxter-indax-attack-spin-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -520,9 +520,9 @@ (ja-channel-push! 1 (seconds 0.05)) ) ((let ((v1-32 (ja-group))) - (and v1-32 (= v1-32 (-> self draw art-group data 437))) + (and v1-32 (= v1-32 daxter-indax-running-attack-ja)) ) - (ja-no-eval :group! (-> self draw art-group data 442) :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-running-attack-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -530,12 +530,12 @@ (ja-channel-push! 1 (seconds 0.05)) ) ((let ((v1-62 (ja-group))) - (and (and v1-62 (= v1-62 jakb-darkjak-bomb-loop-ja)) + (and (and v1-62 (= v1-62 daxter-indax-run-ja)) (< (-> self skel root-channel 2 frame-interp (-> self skel active-frame-interp)) 0.5) ) ) (ja-channel-push! 1 (seconds 0.1)) - (ja-no-eval :group! (-> self draw art-group data 429) :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-run-to-stance-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -547,7 +547,7 @@ ) ) (until #f - (ja-no-eval :group! jakb-darkjak-get-off-end-ja :num! (seek! max 1.5) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-stance-ja :num! (seek! max 1.5) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max 1.5)) @@ -624,20 +624,20 @@ ) (let ((v1-3 (ja-group))) (cond - ((and v1-3 (or (= v1-3 jakb-darkjak-bomb-ja) (= v1-3 jakb-darkjak-bomb-loop-ja))) + ((and v1-3 (or (= v1-3 daxter-indax-walk-ja) (= v1-3 daxter-indax-run-ja))) (set! f26-0 (ja-frame-num 0)) ) ((let ((v1-9 (ja-group))) - (and (or (and v1-9 (= v1-9 jakb-darkjak-attack-ice-loop-ja)) + (and (or (and v1-9 (= v1-9 daxter-indax-jump-loop-ja)) (let ((v1-15 (ja-group))) - (and (and v1-15 (= v1-15 jakb-darkjak-bomb-land-ja)) (< 15.0 (ja-aframe-num 0))) + (and (and v1-15 (= v1-15 daxter-indax-jump-ja)) (< 15.0 (ja-aframe-num 0))) ) ) (< 12288.0 (-> self control ctrl-xz-vel)) ) ) (ja-channel-push! 1 (seconds 0.01)) - (ja-no-eval :group! (-> self draw art-group data 427) :num! (seek! max 2.0) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-run-squash-ja :num! (seek! max 2.0) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max 2.0)) @@ -649,18 +649,18 @@ ) ) ) - (ja-no-eval :group! jakb-darkjak-bomb-loop-ja :num! (identity f26-0) :dist 13107.2) - (ja-no-eval :chan 1 :group! (-> self draw art-group data 423) :num! (identity f26-0) :dist 12697.6) + (ja-no-eval :group! daxter-indax-run-ja :num! (identity f26-0) :dist 13107.2) + (ja-no-eval :chan 1 :group! daxter-indax-run-look-back-ja :num! (identity f26-0) :dist 12697.6) (let ((a0-25 (-> self skel root-channel 2))) (let ((f0-12 (- 1.0 f30-0))) (set! (-> a0-25 frame-interp 1) f0-12) (set! (-> a0-25 frame-interp 0) f0-12) ) (set! (-> a0-25 dist) 5939.2) - (set! (-> a0-25 frame-group) (the-as art-joint-anim jakb-darkjak-bomb-ja)) + (set! (-> a0-25 frame-group) (the-as art-joint-anim daxter-indax-walk-ja)) (set! (-> a0-25 param 0) 1.0) (set! (-> a0-25 frame-num) f26-0) - (joint-control-channel-group! a0-25 (the-as art-joint-anim jakb-darkjak-bomb-ja) num-func-loop!) + (joint-control-channel-group! a0-25 (the-as art-joint-anim daxter-indax-walk-ja) num-func-loop!) ) (until #f (suspend) @@ -751,12 +751,12 @@ (let ((a1-0 75)) (let ((v1-2 (ja-group))) (cond - ((and v1-2 (or (= v1-2 jakb-darkjak-bomb-land-ja) (= v1-2 jakb-darkjak-attack-ice-loop-ja))) + ((and v1-2 (or (= v1-2 daxter-indax-jump-ja) (= v1-2 daxter-indax-jump-loop-ja))) ) (else (let ((v1-8 (ja-group))) (cond - ((and v1-8 (= v1-8 (-> self draw art-group data 428))) + ((and v1-8 (= v1-8 daxter-indax-attack-spin-air-ja)) (set! a1-0 15) (set! (-> self control unknown-float35) 0.0) ) @@ -770,7 +770,7 @@ ) (ja-channel-push! 1 (the-as time-frame a1-0)) ) - (ja-no-eval :group! jakb-darkjak-attack-ice-loop-ja :num! (loop!) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-jump-loop-ja :num! (loop!) :frame-num 0.0) (until #f (seek! (-> self control unknown-float35) 0.0 (* 10.0 (seconds-per-frame))) (suspend) @@ -823,8 +823,8 @@ ) :code (behavior ((arg0 float) (arg1 float) (arg2 surface)) (ja-channel-push! 2 (seconds 0.02)) - (ja :group! jakb-darkjak-bomb-land-ja :num! min) - (ja :chan 1 :group! (-> self draw art-group data 424) :num! (chan 0)) + (ja :group! daxter-indax-jump-ja :num! min) + (ja :chan 1 :group! daxter-indax-jump-forward-ja :num! (chan 0)) (suspend) (until (ja-done? 0) (let ((f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) @@ -868,7 +868,7 @@ ) (let ((v1-10 (ja-group))) (cond - ((and v1-10 (or (= v1-10 jakb-darkjak-bomb-land-ja) (= v1-10 jakb-darkjak-attack-ice-loop-ja))) + ((and v1-10 (or (= v1-10 daxter-indax-jump-ja) (= v1-10 daxter-indax-jump-loop-ja))) ) (else (set! (-> self control unknown-float35) 0.0) @@ -885,15 +885,15 @@ (sound-play "jump-double") (let ((v1-3 (ja-group))) (cond - ((and (and v1-3 (= v1-3 jakb-darkjak-bomb-land-ja)) (< 0.6 (-> self control unknown-float35))) + ((and (and v1-3 (= v1-3 daxter-indax-jump-ja)) (< 0.6 (-> self control unknown-float35))) (ja-channel-push! 2 (seconds 0.04)) - (ja-no-eval :group! jakb-darkjak-bomb-land-ja :num! (seek!) :frame-num (ja-aframe 1.0 0)) - (ja :chan 1 :group! (-> self draw art-group data 424) :num! (chan 0)) + (ja-no-eval :group! daxter-indax-jump-ja :num! (seek!) :frame-num (ja-aframe 1.0 0)) + (ja :chan 1 :group! daxter-indax-jump-forward-ja :num! (chan 0)) ) (else (ja-channel-push! 2 (seconds 0.05)) - (ja-no-eval :group! jakb-darkjak-bomb-land-ja :num! (seek!) :frame-num (ja-aframe 5.0 0)) - (ja :chan 1 :group! (-> self draw art-group data 424) :num! (chan 0)) + (ja-no-eval :group! daxter-indax-jump-ja :num! (seek!) :frame-num (ja-aframe 5.0 0)) + (ja :chan 1 :group! daxter-indax-jump-forward-ja :num! (chan 0)) ) ) ) @@ -967,7 +967,7 @@ ) :code (behavior ((arg0 symbol)) (ja-channel-push! 1 (seconds 0.05)) - (ja-no-eval :group! jakb-darkjak-attack-ice-loop2-ja :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-jump-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -991,7 +991,7 @@ :code (behavior () (set! (-> self control mod-surface) *indax-bounce-mods*) (ja-channel-push! 1 (seconds 0.02)) - (ja-no-eval :group! (-> self draw art-group data 443) :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-trip-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (compute-alignment! (-> self align)) (align! (-> self align) (align-opts adjust-y-vel adjust-xz-vel) 1.0 1.0 2.0) @@ -1001,7 +1001,7 @@ (while (not (logtest? (-> self control status) (collide-status on-surface))) (suspend) ) - (ja-no-eval :group! (-> self draw art-group data 444) :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-trip-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -1019,7 +1019,7 @@ (target-indax-exit) ) :code (behavior () - (let ((gp-0 jakb-darkjak-attack-ice-end-ja)) + (let ((gp-0 daxter-indax-attack-spin-ja)) (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -1365.3334) (ja-channel-push! 1 (seconds 0.05)) (ja-no-eval :group! gp-0 :num! (seek! max (-> self control current-surface align-speed)) :frame-num 0.0) @@ -1064,7 +1064,7 @@ (target-indax-exit) ) :code (behavior ((arg0 symbol)) - (let ((gp-0 (-> self draw art-group data 428))) + (let ((gp-0 daxter-indax-attack-spin-air-ja)) (ja-channel-push! 1 (seconds 0.05)) (ja-no-eval :group! gp-0 :num! (seek! max (-> self control current-surface align-speed)) :frame-num 0.0) ) @@ -1110,7 +1110,7 @@ ) (set! (-> self control dynam gravity-max) 368640.0) (set! (-> self control dynam gravity-length) 368640.0) - (let ((gp-1 (-> self draw art-group data 437))) + (let ((gp-1 daxter-indax-running-attack-ja)) (ja-channel-push! 1 (seconds 0.02)) (ja-no-eval :group! gp-1 :num! (seek!)) ) @@ -1202,17 +1202,17 @@ (case (-> arg0 angle) (('back) (let ((v1-3 (ja-group))) - (when (not (and v1-3 (= v1-3 (-> self draw art-group data 431)))) + (when (not (and v1-3 (= v1-3 daxter-indax-hit-back-ja))) (ja-channel-push! 1 (seconds 0.075)) - (ja :group! (-> self draw art-group data 431) :num! min) + (ja :group! daxter-indax-hit-back-ja :num! min) ) ) ) (else (let ((v1-12 (ja-group))) - (when (not (and v1-12 (= v1-12 (-> self draw art-group data 430)))) + (when (not (and v1-12 (= v1-12 daxter-indax-hit-front-ja))) (ja-channel-push! 1 (seconds 0.075)) - (ja :group! (-> self draw art-group data 430) :num! min) + (ja :group! daxter-indax-hit-front-ja :num! min) ) ) ) @@ -1378,7 +1378,7 @@ ) ) (ja-channel-push! 1 (seconds 0.1)) - (ja-no-eval :group! (-> self draw art-group data 434) :num! (seek!) :frame-num (ja-aframe f30-0 0)) + (ja-no-eval :group! daxter-indax-death-fall-ja :num! (seek!) :frame-num (ja-aframe f30-0 0)) ) (until (ja-done? 0) (let ((a1-8 (new 'stack-no-clear 'event-message-block))) @@ -1404,7 +1404,7 @@ (set-falloff! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) (set! (-> self control mod-surface) *neutral-mods*) (ja-channel-push! 1 (seconds 0.1)) - (ja-no-eval :group! (-> self draw art-group data 433) :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-death-squashed-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -1419,14 +1419,14 @@ (ja-channel-push! 1 (seconds 0.1)) (cond ((rand-vu-percent? 0.5) - (ja-no-eval :group! (-> self draw art-group data 436) :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-death-eaten-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) ) ) (else - (ja-no-eval :group! (-> self draw art-group data 435) :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-death-kill-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -1441,7 +1441,7 @@ (set-falloff! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) (set! (-> self control mod-surface) *neutral-mods*) (ja-channel-push! 1 (seconds 0.1)) - (ja-no-eval :group! (-> self draw art-group data 435) :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-death-kill-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) diff --git a/test/decompiler/reference/jak2/levels/tomb/target-indax_REF.gc b/test/decompiler/reference/jak2/levels/tomb/target-indax_REF.gc index a5a57a7920..a82e61f305 100644 --- a/test/decompiler/reference/jak2/levels/tomb/target-indax_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/target-indax_REF.gc @@ -509,8 +509,8 @@ :code (behavior () (let ((v1-2 (ja-group))) (cond - ((and v1-2 (= v1-2 jakb-darkjak-attack-ice-end-ja)) - (ja-no-eval :group! (-> self draw art-group data 422) :num! (seek!) :frame-num 0.0) + ((and v1-2 (= v1-2 daxter-indax-attack-spin-ja)) + (ja-no-eval :group! daxter-indax-attack-spin-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -518,9 +518,9 @@ (ja-channel-push! 1 (seconds 0.05)) ) ((let ((v1-32 (ja-group))) - (and v1-32 (= v1-32 (-> self draw art-group data 437))) + (and v1-32 (= v1-32 daxter-indax-running-attack-ja)) ) - (ja-no-eval :group! (-> self draw art-group data 442) :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-running-attack-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -528,12 +528,12 @@ (ja-channel-push! 1 (seconds 0.05)) ) ((let ((v1-62 (ja-group))) - (and (and v1-62 (= v1-62 jakb-darkjak-bomb-loop-ja)) + (and (and v1-62 (= v1-62 daxter-indax-run-ja)) (< (-> self skel root-channel 2 frame-interp (-> self skel active-frame-interp)) 0.5) ) ) (ja-channel-push! 1 (seconds 0.1)) - (ja-no-eval :group! (-> self draw art-group data 429) :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-run-to-stance-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -545,7 +545,7 @@ ) ) (until #f - (ja-no-eval :group! jakb-darkjak-get-off-end-ja :num! (seek! max 1.5) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-stance-ja :num! (seek! max 1.5) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max 1.5)) @@ -623,20 +623,20 @@ ) (let ((v1-3 (ja-group))) (cond - ((and v1-3 (or (= v1-3 jakb-darkjak-bomb-ja) (= v1-3 jakb-darkjak-bomb-loop-ja))) + ((and v1-3 (or (= v1-3 daxter-indax-walk-ja) (= v1-3 daxter-indax-run-ja))) (set! f26-0 (ja-frame-num 0)) ) ((let ((v1-9 (ja-group))) - (and (or (and v1-9 (= v1-9 jakb-darkjak-attack-ice-loop-ja)) + (and (or (and v1-9 (= v1-9 daxter-indax-jump-loop-ja)) (let ((v1-15 (ja-group))) - (and (and v1-15 (= v1-15 jakb-darkjak-bomb-land-ja)) (< 15.0 (ja-aframe-num 0))) + (and (and v1-15 (= v1-15 daxter-indax-jump-ja)) (< 15.0 (ja-aframe-num 0))) ) ) (< 12288.0 (-> self control ctrl-xz-vel)) ) ) (ja-channel-push! 1 (seconds 0.01)) - (ja-no-eval :group! (-> self draw art-group data 427) :num! (seek! max 2.0) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-run-squash-ja :num! (seek! max 2.0) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! max 2.0)) @@ -648,18 +648,18 @@ ) ) ) - (ja-no-eval :group! jakb-darkjak-bomb-loop-ja :num! (identity f26-0) :dist 13107.2) - (ja-no-eval :chan 1 :group! (-> self draw art-group data 423) :num! (identity f26-0) :dist 12697.6) + (ja-no-eval :group! daxter-indax-run-ja :num! (identity f26-0) :dist 13107.2) + (ja-no-eval :chan 1 :group! daxter-indax-run-look-back-ja :num! (identity f26-0) :dist 12697.6) (let ((a0-25 (-> self skel root-channel 2))) (let ((f0-12 (- 1.0 f30-0))) (set! (-> a0-25 frame-interp 1) f0-12) (set! (-> a0-25 frame-interp 0) f0-12) ) (set! (-> a0-25 dist) 5939.2) - (set! (-> a0-25 frame-group) (the-as art-joint-anim jakb-darkjak-bomb-ja)) + (set! (-> a0-25 frame-group) (the-as art-joint-anim daxter-indax-walk-ja)) (set! (-> a0-25 param 0) 1.0) (set! (-> a0-25 frame-num) f26-0) - (joint-control-channel-group! a0-25 (the-as art-joint-anim jakb-darkjak-bomb-ja) num-func-loop!) + (joint-control-channel-group! a0-25 (the-as art-joint-anim daxter-indax-walk-ja) num-func-loop!) ) (until #f (suspend) @@ -751,12 +751,12 @@ (let ((a1-0 75)) (let ((v1-2 (ja-group))) (cond - ((and v1-2 (or (= v1-2 jakb-darkjak-bomb-land-ja) (= v1-2 jakb-darkjak-attack-ice-loop-ja))) + ((and v1-2 (or (= v1-2 daxter-indax-jump-ja) (= v1-2 daxter-indax-jump-loop-ja))) ) (else (let ((v1-8 (ja-group))) (cond - ((and v1-8 (= v1-8 (-> self draw art-group data 428))) + ((and v1-8 (= v1-8 daxter-indax-attack-spin-air-ja)) (set! a1-0 15) (set! (-> self control unknown-float35) 0.0) ) @@ -770,7 +770,7 @@ ) (ja-channel-push! 1 (the-as time-frame a1-0)) ) - (ja-no-eval :group! jakb-darkjak-attack-ice-loop-ja :num! (loop!) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-jump-loop-ja :num! (loop!) :frame-num 0.0) (until #f (seek! (-> self control unknown-float35) 0.0 (* 10.0 (seconds-per-frame))) (suspend) @@ -824,8 +824,8 @@ ) :code (behavior ((arg0 float) (arg1 float) (arg2 surface)) (ja-channel-push! 2 (seconds 0.02)) - (ja :group! jakb-darkjak-bomb-land-ja :num! min) - (ja :chan 1 :group! (-> self draw art-group data 424) :num! (chan 0)) + (ja :group! daxter-indax-jump-ja :num! min) + (ja :chan 1 :group! daxter-indax-jump-forward-ja :num! (chan 0)) (suspend) (until (ja-done? 0) (let ((f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) @@ -870,7 +870,7 @@ ) (let ((v1-10 (ja-group))) (cond - ((and v1-10 (or (= v1-10 jakb-darkjak-bomb-land-ja) (= v1-10 jakb-darkjak-attack-ice-loop-ja))) + ((and v1-10 (or (= v1-10 daxter-indax-jump-ja) (= v1-10 daxter-indax-jump-loop-ja))) ) (else (set! (-> self control unknown-float35) 0.0) @@ -887,15 +887,15 @@ (sound-play "jump-double") (let ((v1-3 (ja-group))) (cond - ((and (and v1-3 (= v1-3 jakb-darkjak-bomb-land-ja)) (< 0.6 (-> self control unknown-float35))) + ((and (and v1-3 (= v1-3 daxter-indax-jump-ja)) (< 0.6 (-> self control unknown-float35))) (ja-channel-push! 2 (seconds 0.04)) - (ja-no-eval :group! jakb-darkjak-bomb-land-ja :num! (seek!) :frame-num (ja-aframe 1.0 0)) - (ja :chan 1 :group! (-> self draw art-group data 424) :num! (chan 0)) + (ja-no-eval :group! daxter-indax-jump-ja :num! (seek!) :frame-num (ja-aframe 1.0 0)) + (ja :chan 1 :group! daxter-indax-jump-forward-ja :num! (chan 0)) ) (else (ja-channel-push! 2 (seconds 0.05)) - (ja-no-eval :group! jakb-darkjak-bomb-land-ja :num! (seek!) :frame-num (ja-aframe 5.0 0)) - (ja :chan 1 :group! (-> self draw art-group data 424) :num! (chan 0)) + (ja-no-eval :group! daxter-indax-jump-ja :num! (seek!) :frame-num (ja-aframe 5.0 0)) + (ja :chan 1 :group! daxter-indax-jump-forward-ja :num! (chan 0)) ) ) ) @@ -970,7 +970,7 @@ ) :code (behavior ((arg0 symbol)) (ja-channel-push! 1 (seconds 0.05)) - (ja-no-eval :group! jakb-darkjak-attack-ice-loop2-ja :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-jump-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -995,7 +995,7 @@ :code (behavior () (set! (-> self control mod-surface) *indax-bounce-mods*) (ja-channel-push! 1 (seconds 0.02)) - (ja-no-eval :group! (-> self draw art-group data 443) :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-trip-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (compute-alignment! (-> self align)) (align! (-> self align) (align-opts adjust-y-vel adjust-xz-vel) 1.0 1.0 2.0) @@ -1005,7 +1005,7 @@ (while (not (logtest? (-> self control status) (collide-status on-surface))) (suspend) ) - (ja-no-eval :group! (-> self draw art-group data 444) :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-trip-land-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -1024,7 +1024,7 @@ (target-indax-exit) ) :code (behavior () - (let ((gp-0 jakb-darkjak-attack-ice-end-ja)) + (let ((gp-0 daxter-indax-attack-spin-ja)) (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -1365.3334) (ja-channel-push! 1 (seconds 0.05)) (ja-no-eval :group! gp-0 :num! (seek! max (-> self control current-surface align-speed)) :frame-num 0.0) @@ -1070,7 +1070,7 @@ (target-indax-exit) ) :code (behavior ((arg0 symbol)) - (let ((gp-0 (-> self draw art-group data 428))) + (let ((gp-0 daxter-indax-attack-spin-air-ja)) (ja-channel-push! 1 (seconds 0.05)) (ja-no-eval :group! gp-0 :num! (seek! max (-> self control current-surface align-speed)) :frame-num 0.0) ) @@ -1117,7 +1117,7 @@ ) (set! (-> self control dynam gravity-max) 368640.0) (set! (-> self control dynam gravity-length) 368640.0) - (let ((gp-1 (-> self draw art-group data 437))) + (let ((gp-1 daxter-indax-running-attack-ja)) (ja-channel-push! 1 (seconds 0.02)) (ja-no-eval :group! gp-1 :num! (seek!)) ) @@ -1210,17 +1210,17 @@ (case (-> arg0 angle) (('back) (let ((v1-3 (ja-group))) - (when (not (and v1-3 (= v1-3 (-> self draw art-group data 431)))) + (when (not (and v1-3 (= v1-3 daxter-indax-hit-back-ja))) (ja-channel-push! 1 (seconds 0.075)) - (ja :group! (-> self draw art-group data 431) :num! min) + (ja :group! daxter-indax-hit-back-ja :num! min) ) ) ) (else (let ((v1-12 (ja-group))) - (when (not (and v1-12 (= v1-12 (-> self draw art-group data 430)))) + (when (not (and v1-12 (= v1-12 daxter-indax-hit-front-ja))) (ja-channel-push! 1 (seconds 0.075)) - (ja :group! (-> self draw art-group data 430) :num! min) + (ja :group! daxter-indax-hit-front-ja :num! min) ) ) ) @@ -1388,7 +1388,7 @@ ) ) (ja-channel-push! 1 (seconds 0.1)) - (ja-no-eval :group! (-> self draw art-group data 434) :num! (seek!) :frame-num (ja-aframe f30-0 0)) + (ja-no-eval :group! daxter-indax-death-fall-ja :num! (seek!) :frame-num (ja-aframe f30-0 0)) ) (until (ja-done? 0) (let ((a1-8 (new 'stack-no-clear 'event-message-block))) @@ -1414,7 +1414,7 @@ (set-falloff! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) (set! (-> self control mod-surface) *neutral-mods*) (ja-channel-push! 1 (seconds 0.1)) - (ja-no-eval :group! (-> self draw art-group data 433) :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-death-squashed-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -1429,14 +1429,14 @@ (ja-channel-push! 1 (seconds 0.1)) (cond ((rand-vu-percent? 0.5) - (ja-no-eval :group! (-> self draw art-group data 436) :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-death-eaten-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) ) ) (else - (ja-no-eval :group! (-> self draw art-group data 435) :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-death-kill-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -1451,7 +1451,7 @@ (set-falloff! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) (set! (-> self control mod-surface) *neutral-mods*) (ja-channel-push! 1 (seconds 0.1)) - (ja-no-eval :group! (-> self draw art-group data 435) :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! daxter-indax-death-kill-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -1465,3 +1465,7 @@ ) :post target-no-stick-post ) + + + +