diff --git a/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc b/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc index 96cb447be1..af696d2787 100644 --- a/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc @@ -5879,5 +5879,10 @@ [32, "quaternion"] ], + "(code target-ice-walk)": [ + [16, "vector"], + [32, "vector"] + ], + "placeholder-do-not-add-below!": [] } diff --git a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc index f76cf1e34b..843a0ca336 100644 --- a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc @@ -6971,5 +6971,15 @@ [218, "v1", "float"] ], + "(code target-ice-stance)": [ + [42, "v1", "art-joint-anim"], + [108, "v1", "art-joint-anim"], + [159, "v1", "art-joint-anim"], + [221, "v1", "art-joint-anim"], + [283, "v1", "art-joint-anim"], + [370, "v1", "art-joint-anim"], + [479, "v1", "art-joint-anim"] + ], + "placeholder-do-not-add-below": [] } diff --git a/goal_src/levels/snow/target-ice.gc b/goal_src/levels/snow/target-ice.gc index f2c76d0068..137a62e7c6 100644 --- a/goal_src/levels/snow/target-ice.gc +++ b/goal_src/levels/snow/target-ice.gc @@ -5,3 +5,570 @@ ;; name in dgo: target-ice ;; dgos: L1, SNO +;; DECOMP BEGINS + +(defstate target-ice-stance (target) + :event + target-standard-event-handler + :enter + (behavior () (set! (-> self control unknown-surface00) *walk-mods*) (none)) + :exit + target-state-hook-exit + :trans + (behavior () + ((-> self state-hook)) + (if (!= (-> self control ground-pat material) (pat-material ice)) + (go target-stance) + ) + (when (move-legs?) + (remove-exit) + (go target-ice-walk) + ) + (when (and + (logtest? + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons l1 r1) + ) + (can-duck?) + ) + (remove-exit) + (go target-duck-stance) + ) + (if (and + (logtest? + (logior + (logior + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) + ) + (if (and + (logtest? + (logior + (logior + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet?) + ) + (go target-attack) + ) + (if (can-hands? #t) + (go target-running-attack) + ) + (slide-down-test) + (fall-test) + (none) + ) + :code + (behavior () + (let ((gp-0 60)) + (let ((v1-2 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((or (= v1-2 (-> self draw art-group data 34)) (= v1-2 (-> self draw art-group data 38))) + (set! gp-0 21) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 71) + ) + (let ((a0-11 (-> self skel root-channel 0))) + (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 72))) + (set! (-> a0-11 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 72)) data 0 length) -1)) + ) + (set! (-> a0-11 param 1) 1.0) + (set! (-> a0-11 frame-num) 0.0) + (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 72)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-12 (-> self skel root-channel 0))) + (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) + (set! (-> a0-12 param 1) 1.0) + (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 51) + ) + (cond + ((rand-vu-percent? 0.3) + (let ((a0-19 (-> self skel root-channel 0))) + (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 53))) + (set! (-> a0-19 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 53)) data 0 length) -1)) + ) + (set! (-> a0-19 param 1) 1.0) + (set! (-> a0-19 frame-num) 0.0) + (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 53)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-20 (-> self skel root-channel 0))) + (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) + (set! (-> a0-20 param 1) 1.0) + (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + (else + (let ((a0-22 (-> self skel root-channel 0))) + (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> self draw art-group data 52))) + (set! (-> a0-22 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 52)) data 0 length) -1)) + ) + (set! (-> a0-22 param 1) 1.0) + (set! (-> a0-22 frame-num) 0.0) + (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> self draw art-group data 52)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-23 (-> self skel root-channel 0))) + (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) + (set! (-> a0-23 param 1) 1.0) + (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 78) + ) + (let ((a0-29 (-> self skel root-channel 0))) + (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> self draw art-group data 79))) + (set! (-> a0-29 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 79)) data 0 length) -1)) + ) + (set! (-> a0-29 param 1) 1.0) + (set! (-> a0-29 frame-num) 0.0) + (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> self draw art-group data 79)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-30 (-> self skel root-channel 0))) + (set! (-> a0-30 param 0) (the float (+ (-> a0-30 frame-group data 0 length) -1))) + (set! (-> a0-30 param 1) 1.0) + (joint-control-channel-group-eval! a0-30 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 84) + ) + (let ((a0-36 (-> self skel root-channel 0))) + (set! (-> a0-36 frame-group) (the-as art-joint-anim (-> self draw art-group data 85))) + (set! (-> a0-36 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 85)) data 0 length) -1)) + ) + (set! (-> a0-36 param 1) 1.0) + (set! (-> a0-36 frame-num) 0.0) + (joint-control-channel-group! a0-36 (the-as art-joint-anim (-> self draw art-group data 85)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-37 (-> self skel root-channel 0))) + (set! (-> a0-37 param 0) (the float (+ (-> a0-37 frame-group data 0 length) -1))) + (set! (-> a0-37 param 1) 1.0) + (joint-control-channel-group-eval! a0-37 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (set! gp-0 0) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 59) + ) + (set! (-> self control unknown-float81) (-> self control unknown-float80)) + (set! (-> self control unknown-surface00) *walk-no-turn-mods*) + (let ((s5-0 (-> self skel root-channel 0))) + (set! (-> s5-0 frame-group) (the-as art-joint-anim (if (rand-vu-percent? 0.3) + (-> self draw art-group data 61) + (-> self draw art-group data 60) + ) + ) + ) + (set! (-> s5-0 param 0) (the float (+ (-> (the-as art-joint-anim (if (rand-vu-percent? 0.3) + (-> self draw art-group data 61) + (-> self draw art-group data 60) + ) + ) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> s5-0 param 1) 1.0) + (set! (-> s5-0 frame-num) 0.0) + (joint-control-channel-group! + s5-0 + (the-as art-joint-anim (if (rand-vu-percent? 0.3) + (-> self draw art-group data 61) + (-> self draw art-group data 60) + ) + ) + num-func-seek! + ) + ) + (until (ja-done? 0) + (set! (-> self control unknown-float81) + (seek (-> self control unknown-float81) 0.0 (-> *display* seconds-per-frame)) + ) + (suspend) + (let ((a0-49 (-> self skel root-channel 0))) + (set! (-> a0-49 param 0) (the float (+ (-> a0-49 frame-group data 0 length) -1))) + (set! (-> a0-49 param 1) 1.0) + (joint-control-channel-group-eval! a0-49 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (set! (-> self control unknown-surface00) *walk-mods*) + (set! (-> self control unknown-float81) 0.0) + (rot->dir-targ! (-> self control)) + ) + ((let ((v1-188 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or (= v1-188 (-> self draw art-group data 31)) (= v1-188 (-> self draw art-group data 32))) + ) + (ja-channel-push! 1 12) + (let ((a0-61 (-> self skel root-channel 0))) + (set! (-> a0-61 frame-group) (the-as art-joint-anim (-> self draw art-group data 30))) + (set! (-> a0-61 param 0) 0.0) + (set! (-> a0-61 param 1) 1.2) + (set! (-> a0-61 frame-num) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 30)) data 0 length) -1)) + ) + (joint-control-channel-group! a0-61 (the-as art-joint-anim (-> self draw art-group data 30)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-62 (-> self skel root-channel 0))) + (set! (-> a0-62 param 0) 0.0) + (set! (-> a0-62 param 1) 1.2) + (joint-control-channel-group-eval! a0-62 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (set! gp-0 60) + ) + ) + ) + (while (< 16384.0 (-> self control unknown-float01)) + (cond + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 103) + ) + ) + (else + (ja-channel-push! 1 gp-0) + (set! gp-0 150) + (let ((v1-219 (-> self skel root-channel 0))) + (set! (-> v1-219 frame-group) (the-as art-joint-anim (-> self draw art-group data 103))) + ) + ) + ) + (suspend) + (let ((a0-72 (-> self skel root-channel 0))) + (set! (-> a0-72 param 0) 1.0) + (joint-control-channel-group-eval! a0-72 (the-as art-joint-anim #f) num-func-loop!) + ) + ) + (when (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 104) + ) + ) + (ja-channel-push! 1 gp-0) + (let ((v1-233 (-> self skel root-channel 0))) + (set! (-> v1-233 frame-group) (the-as art-joint-anim (-> self draw art-group data 104))) + ) + ) + ) + (while #t + (suspend) + (let ((a0-81 (-> self skel root-channel 0))) + (set! (-> a0-81 param 0) 1.0) + (joint-control-channel-group-eval! a0-81 (the-as art-joint-anim #f) num-func-loop!) + ) + ) + (none) + ) + :post + (the-as (function none :behavior target) target-post) + ) + +(defstate target-ice-walk (target) + :event + target-standard-event-handler + :enter + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (set! (-> self control unknown-surface00) *walk-mods*) + (none) + ) + :exit + (behavior () (target-effect-exit) (target-state-hook-exit) (none)) + :trans + (behavior () + ((-> self state-hook)) + (when (!= (-> self control ground-pat material) (pat-material ice)) + (remove-exit) + (go target-walk) + ) + (if (and + (logtest? + (logior + (logior + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons l1 r1) + ) + (and + (>= (- (-> *display* base-frame-counter) (the-as int (-> *TARGET-bank* wheel-timeout))) + (-> self control unknown-dword30) + ) + (and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (can-wheel?)) + ) + ) + (go target-wheel) + ) + (when (and + (logtest? + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons l1 r1) + ) + (can-duck?) + ) + (target-effect-exit) + (remove-exit) + (go target-duck-stance) + ) + (when (and (not (move-legs?)) (let ((gp-0 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + (f0-1 (ja-aframe-num 0)) + ) + (if (and (= gp-0 (-> self draw art-group data 102)) (>= f0-1 30.0) (>= 35.0 f0-1)) + #t + ) + ) + ) + (target-effect-exit) + (remove-exit) + (go target-ice-stance) + ) + (if (and + (logtest? + (logior + (logior + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) + ) + (if (and + (logtest? + (logior + (logior + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet?) + ) + (go target-attack) + ) + (if (can-hands? #t) + (go target-running-attack) + ) + (slide-down-test) + (fall-test) + (none) + ) + :code + (behavior () + (cond + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 23) + ) + (let ((f30-0 (ja-aframe-num 0))) + (ja-channel-push! 1 30) + (let ((gp-0 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + gp-0 + (the-as art-joint-anim (-> self draw art-group data 102)) + num-func-identity + ) + (set! (-> gp-0 frame-num) f30-0) + ) + ) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 102) + ) + ) + (else + (let ((v1-18 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((or (= v1-18 (-> self draw art-group data 60)) (= v1-18 (-> self draw art-group data 61))) + (set! (-> self control unknown-float81) (-> self control unknown-float80)) + (set! (-> self control unknown-surface00) *walk-no-turn-mods*) + (while (< (ja-aframe-num 0) 42.0) + (suspend) + (let ((a0-19 (-> self skel root-channel 0))) + (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) + (set! (-> a0-19 param 1) 1.0) + (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (set! (-> self control unknown-surface00) *walk-mods*) + (set! (-> self control unknown-float81) 0.0) + (ja-channel-push! 1 30) + (let ((gp-1 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + gp-1 + (the-as art-joint-anim (-> self draw art-group data 102)) + num-func-identity + ) + (set! (-> gp-1 frame-num) (ja-aframe 34.0 0)) + ) + (while (!= (-> self skel root-channel 0) (-> self skel channel)) + (suspend) + ) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 59) + ) + (set! (-> self control unknown-float81) (-> self control unknown-float80)) + (set! (-> self control unknown-surface00) *walk-no-turn-mods*) + (let ((gp-2 (-> self skel root-channel 0))) + (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 60))) + (set! (-> gp-2 param 0) (ja-aframe 42.0 0)) + (set! (-> gp-2 param 1) 1.0) + (set! (-> gp-2 frame-num) 0.0) + (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 60)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((gp-3 (-> self skel root-channel 0))) + (set! (-> gp-3 param 0) (ja-aframe 42.0 0)) + (set! (-> gp-3 param 1) 1.0) + (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (set! (-> self control unknown-surface00) *walk-mods*) + (set! (-> self control unknown-float81) 0.0) + (ja-channel-push! 1 30) + (let ((gp-4 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + gp-4 + (the-as art-joint-anim (-> self draw art-group data 102)) + num-func-identity + ) + (set! (-> gp-4 frame-num) (ja-aframe 34.0 0)) + ) + (while (!= (-> self skel root-channel 0) (-> self skel channel)) + (suspend) + ) + ) + (else + (ja-channel-push! 1 15) + (let ((v1-74 (-> self skel root-channel 0))) + (set! (-> v1-74 frame-group) (the-as art-joint-anim (-> self draw art-group data 102))) + ) + ) + ) + ) + ) + ) + (while #t + (suspend) + (let* ((s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control unknown-vector01) 1.0)) + (gp-6 (vector-float*! + (new 'stack-no-clear 'vector) + (-> self control unknown-vector00) + (/ 1.0 (vector-length (-> self control unknown-vector01))) + ) + ) + (f0-18 (fmax -1.0 (fmin 1.0 (vector-dot s5-0 gp-6)))) + (gp-7 (-> self skel root-channel 0)) + ) + (set! (-> gp-7 param 0) (cond + ((< f0-18 0.0) + (lerp-scale 2.0 1.0 f0-18 -1.0 0.5) + ) + ((< 0.5 f0-18) + (lerp-scale 1.0 0.75 f0-18 0.5 1.0) + ) + (else + (lerp-scale 1.33 1.0 f0-18 0.0 0.5) + ) + ) + ) + (joint-control-channel-group-eval! gp-7 (the-as art-joint-anim #f) num-func-loop!) + ) + ) + (none) + ) + :post + (the-as (function none :behavior target) target-post) + ) + + + + diff --git a/test/decompiler/reference/levels/snow/target-ice_REF.gc b/test/decompiler/reference/levels/snow/target-ice_REF.gc new file mode 100644 index 0000000000..fb292acebd --- /dev/null +++ b/test/decompiler/reference/levels/snow/target-ice_REF.gc @@ -0,0 +1,570 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defstate target-ice-stance (target) + :event + target-standard-event-handler + :enter + (behavior () (set! (-> self control unknown-surface00) *walk-mods*) (none)) + :exit + target-state-hook-exit + :trans + (behavior () + ((-> self state-hook)) + (if (!= (-> self control ground-pat material) (pat-material ice)) + (go target-stance) + ) + (when (move-legs?) + (remove-exit) + (go target-ice-walk) + ) + (when (and + (logtest? + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons l1 r1) + ) + (can-duck?) + ) + (remove-exit) + (go target-duck-stance) + ) + (if (and + (logtest? + (logior + (logior + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) + ) + (if (and + (logtest? + (logior + (logior + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet?) + ) + (go target-attack) + ) + (if (can-hands? #t) + (go target-running-attack) + ) + (slide-down-test) + (fall-test) + (none) + ) + :code + (behavior () + (let ((gp-0 60)) + (let ((v1-2 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((or (= v1-2 (-> self draw art-group data 34)) (= v1-2 (-> self draw art-group data 38))) + (set! gp-0 21) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 71) + ) + (let ((a0-11 (-> self skel root-channel 0))) + (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 72))) + (set! (-> a0-11 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 72)) data 0 length) -1)) + ) + (set! (-> a0-11 param 1) 1.0) + (set! (-> a0-11 frame-num) 0.0) + (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 72)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-12 (-> self skel root-channel 0))) + (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) + (set! (-> a0-12 param 1) 1.0) + (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 51) + ) + (cond + ((rand-vu-percent? 0.3) + (let ((a0-19 (-> self skel root-channel 0))) + (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 53))) + (set! (-> a0-19 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 53)) data 0 length) -1)) + ) + (set! (-> a0-19 param 1) 1.0) + (set! (-> a0-19 frame-num) 0.0) + (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 53)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-20 (-> self skel root-channel 0))) + (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) + (set! (-> a0-20 param 1) 1.0) + (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + (else + (let ((a0-22 (-> self skel root-channel 0))) + (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> self draw art-group data 52))) + (set! (-> a0-22 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 52)) data 0 length) -1)) + ) + (set! (-> a0-22 param 1) 1.0) + (set! (-> a0-22 frame-num) 0.0) + (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> self draw art-group data 52)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-23 (-> self skel root-channel 0))) + (set! (-> a0-23 param 0) (the float (+ (-> a0-23 frame-group data 0 length) -1))) + (set! (-> a0-23 param 1) 1.0) + (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 78) + ) + (let ((a0-29 (-> self skel root-channel 0))) + (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> self draw art-group data 79))) + (set! (-> a0-29 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 79)) data 0 length) -1)) + ) + (set! (-> a0-29 param 1) 1.0) + (set! (-> a0-29 frame-num) 0.0) + (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> self draw art-group data 79)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-30 (-> self skel root-channel 0))) + (set! (-> a0-30 param 0) (the float (+ (-> a0-30 frame-group data 0 length) -1))) + (set! (-> a0-30 param 1) 1.0) + (joint-control-channel-group-eval! a0-30 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 84) + ) + (let ((a0-36 (-> self skel root-channel 0))) + (set! (-> a0-36 frame-group) (the-as art-joint-anim (-> self draw art-group data 85))) + (set! (-> a0-36 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 85)) data 0 length) -1)) + ) + (set! (-> a0-36 param 1) 1.0) + (set! (-> a0-36 frame-num) 0.0) + (joint-control-channel-group! a0-36 (the-as art-joint-anim (-> self draw art-group data 85)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-37 (-> self skel root-channel 0))) + (set! (-> a0-37 param 0) (the float (+ (-> a0-37 frame-group data 0 length) -1))) + (set! (-> a0-37 param 1) 1.0) + (joint-control-channel-group-eval! a0-37 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (set! gp-0 0) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 59) + ) + (set! (-> self control unknown-float81) (-> self control unknown-float80)) + (set! (-> self control unknown-surface00) *walk-no-turn-mods*) + (let ((s5-0 (-> self skel root-channel 0))) + (set! (-> s5-0 frame-group) (the-as art-joint-anim (if (rand-vu-percent? 0.3) + (-> self draw art-group data 61) + (-> self draw art-group data 60) + ) + ) + ) + (set! (-> s5-0 param 0) (the float (+ (-> (the-as art-joint-anim (if (rand-vu-percent? 0.3) + (-> self draw art-group data 61) + (-> self draw art-group data 60) + ) + ) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> s5-0 param 1) 1.0) + (set! (-> s5-0 frame-num) 0.0) + (joint-control-channel-group! + s5-0 + (the-as art-joint-anim (if (rand-vu-percent? 0.3) + (-> self draw art-group data 61) + (-> self draw art-group data 60) + ) + ) + num-func-seek! + ) + ) + (until (ja-done? 0) + (set! (-> self control unknown-float81) + (seek (-> self control unknown-float81) 0.0 (-> *display* seconds-per-frame)) + ) + (suspend) + (let ((a0-49 (-> self skel root-channel 0))) + (set! (-> a0-49 param 0) (the float (+ (-> a0-49 frame-group data 0 length) -1))) + (set! (-> a0-49 param 1) 1.0) + (joint-control-channel-group-eval! a0-49 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (set! (-> self control unknown-surface00) *walk-mods*) + (set! (-> self control unknown-float81) 0.0) + (rot->dir-targ! (-> self control)) + ) + ((let ((v1-188 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or (= v1-188 (-> self draw art-group data 31)) (= v1-188 (-> self draw art-group data 32))) + ) + (ja-channel-push! 1 12) + (let ((a0-61 (-> self skel root-channel 0))) + (set! (-> a0-61 frame-group) (the-as art-joint-anim (-> self draw art-group data 30))) + (set! (-> a0-61 param 0) 0.0) + (set! (-> a0-61 param 1) 1.2) + (set! (-> a0-61 frame-num) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 30)) data 0 length) -1)) + ) + (joint-control-channel-group! a0-61 (the-as art-joint-anim (-> self draw art-group data 30)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-62 (-> self skel root-channel 0))) + (set! (-> a0-62 param 0) 0.0) + (set! (-> a0-62 param 1) 1.2) + (joint-control-channel-group-eval! a0-62 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (set! gp-0 60) + ) + ) + ) + (while (< 16384.0 (-> self control unknown-float01)) + (cond + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 103) + ) + ) + (else + (ja-channel-push! 1 gp-0) + (set! gp-0 150) + (let ((v1-219 (-> self skel root-channel 0))) + (set! (-> v1-219 frame-group) (the-as art-joint-anim (-> self draw art-group data 103))) + ) + ) + ) + (suspend) + (let ((a0-72 (-> self skel root-channel 0))) + (set! (-> a0-72 param 0) 1.0) + (joint-control-channel-group-eval! a0-72 (the-as art-joint-anim #f) num-func-loop!) + ) + ) + (when (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 104) + ) + ) + (ja-channel-push! 1 gp-0) + (let ((v1-233 (-> self skel root-channel 0))) + (set! (-> v1-233 frame-group) (the-as art-joint-anim (-> self draw art-group data 104))) + ) + ) + ) + (while #t + (suspend) + (let ((a0-81 (-> self skel root-channel 0))) + (set! (-> a0-81 param 0) 1.0) + (joint-control-channel-group-eval! a0-81 (the-as art-joint-anim #f) num-func-loop!) + ) + ) + (none) + ) + :post + (the-as (function none :behavior target) target-post) + ) + +;; failed to figure out what this is: +(defstate target-ice-walk (target) + :event + target-standard-event-handler + :enter + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (set! (-> self control unknown-surface00) *walk-mods*) + (none) + ) + :exit + (behavior () (target-effect-exit) (target-state-hook-exit) (none)) + :trans + (behavior () + ((-> self state-hook)) + (when (!= (-> self control ground-pat material) (pat-material ice)) + (remove-exit) + (go target-walk) + ) + (if (and + (logtest? + (logior + (logior + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons l1 r1) + ) + (and + (>= (- (-> *display* base-frame-counter) (the-as int (-> *TARGET-bank* wheel-timeout))) + (-> self control unknown-dword30) + ) + (and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (can-wheel?)) + ) + ) + (go target-wheel) + ) + (when (and + (logtest? + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons l1 r1) + ) + (can-duck?) + ) + (target-effect-exit) + (remove-exit) + (go target-duck-stance) + ) + (when (and (not (move-legs?)) (let ((gp-0 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + (f0-1 (ja-aframe-num 0)) + ) + (if (and (= gp-0 (-> self draw art-group data 102)) (>= f0-1 30.0) (>= 35.0 f0-1)) + #t + ) + ) + ) + (target-effect-exit) + (remove-exit) + (go target-ice-stance) + ) + (if (and + (logtest? + (logior + (logior + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) + ) + (if (and + (logtest? + (logior + (logior + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet?) + ) + (go target-attack) + ) + (if (can-hands? #t) + (go target-running-attack) + ) + (slide-down-test) + (fall-test) + (none) + ) + :code + (behavior () + (cond + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 23) + ) + (let ((f30-0 (ja-aframe-num 0))) + (ja-channel-push! 1 30) + (let ((gp-0 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + gp-0 + (the-as art-joint-anim (-> self draw art-group data 102)) + num-func-identity + ) + (set! (-> gp-0 frame-num) f30-0) + ) + ) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 102) + ) + ) + (else + (let ((v1-18 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((or (= v1-18 (-> self draw art-group data 60)) (= v1-18 (-> self draw art-group data 61))) + (set! (-> self control unknown-float81) (-> self control unknown-float80)) + (set! (-> self control unknown-surface00) *walk-no-turn-mods*) + (while (< (ja-aframe-num 0) 42.0) + (suspend) + (let ((a0-19 (-> self skel root-channel 0))) + (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group data 0 length) -1))) + (set! (-> a0-19 param 1) 1.0) + (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (set! (-> self control unknown-surface00) *walk-mods*) + (set! (-> self control unknown-float81) 0.0) + (ja-channel-push! 1 30) + (let ((gp-1 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + gp-1 + (the-as art-joint-anim (-> self draw art-group data 102)) + num-func-identity + ) + (set! (-> gp-1 frame-num) (ja-aframe 34.0 0)) + ) + (while (!= (-> self skel root-channel 0) (-> self skel channel)) + (suspend) + ) + ) + ((= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 59) + ) + (set! (-> self control unknown-float81) (-> self control unknown-float80)) + (set! (-> self control unknown-surface00) *walk-no-turn-mods*) + (let ((gp-2 (-> self skel root-channel 0))) + (set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 60))) + (set! (-> gp-2 param 0) (ja-aframe 42.0 0)) + (set! (-> gp-2 param 1) 1.0) + (set! (-> gp-2 frame-num) 0.0) + (joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 60)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((gp-3 (-> self skel root-channel 0))) + (set! (-> gp-3 param 0) (ja-aframe 42.0 0)) + (set! (-> gp-3 param 1) 1.0) + (joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (set! (-> self control unknown-surface00) *walk-mods*) + (set! (-> self control unknown-float81) 0.0) + (ja-channel-push! 1 30) + (let ((gp-4 (-> self skel root-channel 0))) + (joint-control-channel-group-eval! + gp-4 + (the-as art-joint-anim (-> self draw art-group data 102)) + num-func-identity + ) + (set! (-> gp-4 frame-num) (ja-aframe 34.0 0)) + ) + (while (!= (-> self skel root-channel 0) (-> self skel channel)) + (suspend) + ) + ) + (else + (ja-channel-push! 1 15) + (let ((v1-74 (-> self skel root-channel 0))) + (set! (-> v1-74 frame-group) (the-as art-joint-anim (-> self draw art-group data 102))) + ) + ) + ) + ) + ) + ) + (while #t + (suspend) + (let* ((s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control unknown-vector01) 1.0)) + (gp-6 (vector-float*! + (new 'stack-no-clear 'vector) + (-> self control unknown-vector00) + (/ 1.0 (vector-length (-> self control unknown-vector01))) + ) + ) + (f0-18 (fmax -1.0 (fmin 1.0 (vector-dot s5-0 gp-6)))) + (gp-7 (-> self skel root-channel 0)) + ) + (set! (-> gp-7 param 0) (cond + ((< f0-18 0.0) + (lerp-scale 2.0 1.0 f0-18 -1.0 0.5) + ) + ((< 0.5 f0-18) + (lerp-scale 1.0 0.75 f0-18 0.5 1.0) + ) + (else + (lerp-scale 1.33 1.0 f0-18 0.0 0.5) + ) + ) + ) + (joint-control-channel-group-eval! gp-7 (the-as art-joint-anim #f) num-func-loop!) + ) + ) + (none) + ) + :post + (the-as (function none :behavior target) target-post) + ) + + + +