diff --git a/decompiler/analysis/cfg_builder.cpp b/decompiler/analysis/cfg_builder.cpp index 76eace150..94ef950a9 100644 --- a/decompiler/analysis/cfg_builder.cpp +++ b/decompiler/analysis/cfg_builder.cpp @@ -741,7 +741,8 @@ void clean_up_cond_no_else_final(Function& func, CondNoElseElement* cne) { if (branch_info_i.written_and_unused.find(reg->reg()) == branch_info_i.written_and_unused.end()) { lg::error("Branch delay register used improperly: {}", reg->to_string(func.ir2.env)); - throw std::runtime_error("Bad delay slot in clean_up_cond_no_else_final"); + throw std::runtime_error("Bad delay slot in clean_up_cond_no_else_final: OP " + + std::to_string(branch->op()->op_id())); } // ASSERT(branch_info_i.written_and_unused.find(reg->reg()) != // branch_info_i.written_and_unused.end()); diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index 16ab971e6..f499217af 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -1888,6 +1888,9 @@ (fo-min) (fo-max) (fo-curve) + (sm09) + (sm10) + (sm11) ) @@ -12122,7 +12125,7 @@ (deftype talker-speech-class (structure) ((name string :offset-assert 0) - (channel uint8 :offset-assert 4) + (channel gui-channel :offset-assert 4) (flags uint8 :offset-assert 5) (speech uint16 :offset-assert 6) (text-message uint32 :offset-assert 8) @@ -12164,14 +12167,14 @@ :size-assert #xd4 :flag-assert #x12006000d4 (:methods - (talker-method-14 () none 14) + (talker-method-14 () _type_ :state 14) (talker-method-15 () none 15) (talker-method-16 () none 16) (talker-method-17 () none 17) ) ) -(define-extern *talker-speech* talker-speech-class) +(define-extern *talker-speech* (inline-array talker-speech-class)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; speech-h ;; @@ -12558,34 +12561,34 @@ (deftype top-anim-joint-control (basic) - ((process uint32 :offset-assert 4) - (interp-select uint64 2 :offset-assert 8) - (base-anim basic :offset-assert 24) - (base-anim-speed float :offset-assert 28) - (base-anim-blend float :offset-assert 32) - (interp float :offset-assert 36) - (frame-group art-joint-anim :offset-assert 40) - (frame-group-push basic :offset-assert 44) - (frame-num float :offset-assert 48) - (frame-targ basic :offset-assert 52) - (frame-speed float :offset-assert 56) - (frame-blend float :offset-assert 60) - (frame-cur-blend float :offset-assert 64) - (frame-start float :offset-assert 68) - (frame-post-blend float :offset-assert 72) - (frame-post-end float :offset-assert 76) - (frame-push-time time-frame :offset-assert 80) - (frame-post-put-away basic :offset-assert 88) - (update-time time-frame :offset-assert 96) + ((process (pointer process-drawable) :offset-assert 4) + (interp-select uint64 2 :offset-assert 8) + (base-anim basic :offset-assert 24) + (base-anim-speed float :offset-assert 28) + (base-anim-blend float :offset-assert 32) + (interp float :offset-assert 36) + (frame-group art-joint-anim :offset-assert 40) + (frame-group-push basic :offset-assert 44) + (frame-num float :offset-assert 48) + (frame-targ basic :offset-assert 52) + (frame-speed float :offset-assert 56) + (frame-blend float :offset-assert 60) + (frame-cur-blend float :offset-assert 64) + (frame-start float :offset-assert 68) + (frame-post-blend float :offset-assert 72) + (frame-post-end float :offset-assert 76) + (frame-push-time time-frame :offset-assert 80) + (frame-post-put-away basic :offset-assert 88) + (update-time time-frame :offset-assert 96) ) :method-count-assert 13 :size-assert #x68 :flag-assert #xd00000068 (:methods - (top-anim-joint-control-method-9 () none 9) - (top-anim-joint-control-method-10 () none 10) - (top-anim-joint-control-method-11 () none 11) - (top-anim-joint-control-method-12 () none 12) + (top-anim-joint-control-method-9 (_type_) none 9) + (top-anim-joint-control-method-10 (_type_) none 10) + (top-anim-joint-control-method-11 (_type_ int) joint-control-channel 11) + (top-anim-joint-control-method-12 (_type_ art-element float int int float float symbol) none 12) ) ) @@ -13701,6 +13704,11 @@ :bitfield #t :type uint32 (disabled) ;; keep object velocity + (af01) + (af02) + (af03) + (af04) + (af05) ) (defenum align-opts @@ -15240,6 +15248,8 @@ ) ;; ---collide-shape-h:nav-flags +(declare-type collide-query structure) + (deftype collide-shape (trsqv) ((actor-hash-index int16 :offset 12) (process process-drawable :offset-assert 140) @@ -15269,7 +15279,7 @@ (collide-shape-method-29 (_type_ vector) none 29) ;; (alloc-riders (_type_ int) none 29) (collide-shape-method-30 () none 30) ;; (move-to-point! (_type_ vector) none 30) (collide-shape-method-31 () none 31) ;; (debug-draw (_type_) none 31) - (collide-shape-method-32 (_type_ vector uint int) none 32) ;; (fill-cache-for-shape! (_type_ float collide-kind) none 32) + (collide-shape-method-32 (_type_ vector collide-query meters) none 32) ;; (fill-cache-for-shape! (_type_ float collide-kind) none 32) (collide-shape-method-33 () none 33) ;; (fill-cache-integrate-and-collide! (_type_ vector collide-kind) none 33) (collide-shape-method-34 () none 34) ;; (find-prim-by-id (_type_ uint) collide-shape-prim 34) (collide-shape-method-35 () none 35) ;; (detect-riders! (_type_) symbol 35) @@ -15367,6 +15377,8 @@ (csrf31) ) +(declare-type collide-query structure) + (deftype collide-shape-moving (collide-shape) ((rider-time time-frame :offset-assert 200) (rider-last-move vector :inline) @@ -15401,7 +15413,7 @@ ;; Failed to read fields. (:methods (new (symbol type process-drawable collide-list-enum) _type_ 0) - (collide-shape-moving-method-55 (_type_) symbol 55) + (collide-shape-moving-method-55 (_type_ collide-query collide-spec float float float) symbol 55) (collide-shape-moving-method-56 () none 56) ;; (set-and-handle-pat! (_type_ pat-surface) none 56) (collide-shape-moving-method-57 () none 57) ;; (integrate-no-collide! (_type_ vector) none 57) (collide-shape-moving-method-58 () none 58) ;; (dummy-58 (_type_ vector) symbol 58) @@ -15509,7 +15521,7 @@ (deftype lightning-tracker (process) ((root basic :offset-assert 128) - (lightning basic :offset-assert 132) + (lightning lightning-spec :offset-assert 132) (callback basic :offset-assert 136) (duration uint64 :offset-assert 144) (start-time time-frame :offset-assert 152) @@ -15792,7 +15804,8 @@ (unknown-word00 int32 :offset 3712) ;; logic-target::target-log-trans (unknown-vector04 vector :inline :offset 3728) ;; logic-target::target-no-ja-move-post (unknown-vector05 vector :inline :offset 3744) ;; logic-target::target-no-ja-move-post - (unknown-vector06 vector :inline :offset 3776) ;; logic-target::target-no-ja-move-post + (unknown-vector06 vector :inline :offset 3760) ;; target::mod-var-jump + (unknown-vector07 vector :inline :offset 3776) ;; logic-target::target-no-ja-move-post (unknown-dynamics00 dynamics :offset 3824) ;; logic-target::reset-target-state (unknown-surface00 surface :offset 3828) ;; logic-target::target-print-stats (unknown-surface01 surface :offset 3832) ;; board-h::want-to-board? @@ -15803,10 +15816,10 @@ (unknown-float09 float :offset 3856) ;; logic-target::turn-to-vector (unknown-float10 float :offset 3860) ;; logic-target::turn-to-vector (unknown-float11 float :offset 3864) ;; logic-target::turn-to-vector - (unknown-vector07 vector :inline :offset 3872) ;; logic-target::turn-to-vector - (unknown-vector08 vector :inline :offset 3888) ;; logic-target::turn-to-vector - (unknown-vector09 vector :inline :offset 3904) ;; logic-target::turn-to-vector - (unknown-vector10 vector :inline :offset 3920) ;; logic-target::turn-to-vector + (unknown-vector08 vector :inline :offset 3872) ;; logic-target::turn-to-vector + (unknown-vector09 vector :inline :offset 3888) ;; logic-target::turn-to-vector + (unknown-vector10 vector :inline :offset 3904) ;; logic-target::turn-to-vector + (unknown-vector11 vector :inline :offset 3920) ;; logic-target::turn-to-vector (unknown-vector-array01 vector 7 :inline :offset 3936) ;; logic-target::turn-to-vector (unknown-vector12 vector :inline :offset 4064) ;; logic-target::read-pad (unknown-vector13 vector :inline :offset 4080) ;; logic-target::read-pad @@ -15840,75 +15853,121 @@ (unknown-float19 float :offset 4644) ;; logic-target::target-compute-slopes (unknown-float20 float :offset 4648) ;; logic-target::target-compute-slopes (unknown-time-frame06 time-frame :offset 4656) ;; board-h::want-to-board? + (unknown-float21 float :offset 4664) ;; target-board-anim-trans (unknown-time-frame07 time-frame :offset 4672) ;; logic-target::turn-around? (unknown-pat-surface00 pat-surface :offset 4680) ;; logic-target::target-print-stats (unknown-vector24 vector :inline :offset 4688) ;; logic-target::add-thrust (unknown-vector25 vector :inline :offset 4720) ;; logic-target::wall-hide? - (unknown-handle01 handle :offset 4768) ;; logic-target::reset-target-state + (unknown-handle00 handle :offset 4768) ;; logic-target::reset-target-state (unknown-pat-surface01 pat-surface :offset 4776) ;; logic-target::target-print-stats - (unknown-float21 float :offset 4780) ;; logic-target::target-compute-slopes - (unknown-float22 float :offset 4784) ;; logic-target::target-compute-slopes - (unknown-float23 float :offset 4788) ;; logic-target::target-compute-slopes - (unknown-float24 float :offset 4792) ;; logic-target::target-compute-slopes - (unknown-float25 float :offset 4796) ;; logic-target::target-compute-slopes + (unknown-float22 float :offset 4780) ;; logic-target::target-compute-slopes + (unknown-float23 float :offset 4784) ;; logic-target::target-compute-slopes + (unknown-float24 float :offset 4788) ;; logic-target::target-compute-slopes + (unknown-float25 float :offset 4792) ;; logic-target::target-compute-slopes + (unknown-float26 float :offset 4796) ;; logic-target::target-compute-slopes (unknown-time-frame08 time-frame :offset 4816) ;; logic-target::turn-around? (unknown-vector26 vector :inline :offset 4928) ;; logic-target::target-add-slide-factor (unknwon-vector27 vector :inline :offset 4976) ;; logic-target::add-thrust - (unknown-float26 float :offset 4992) ;; logic-target::wall-hide? + (unknown-float27 float :offset 4992) ;; logic-target::wall-hide? (unknown-time-frame09 time-frame :offset 5000) ;; logic-target::add-thrust (unknown-sphere-array00 collide-shape-prim-sphere 10 :offset 5016) ;; (method 28 target) - (unknown-float27 float :offset 5132) ;; logic-target::target-print-stats - (unknown-float28 float :offset 5136) ;; logic-target::target-print-stats - (unknown-float29 float :offset 5140) ;; logic-target::target-print-stats + (unknown-word02 int32 :offset 5064) ;; (enter target-roll) + (unknown-time-frame10 time-frame :offset 5072) ;; (exit target-roll) + (unknown-time-frame11 time-frame :offset 5080) ;; (trans target-slide-down-to-ground) + (unknown-time-frame12 time-frame :offset 5096) ;; (exit target-attack) + (unknown-time-frame13 time-frame :offset 5112) ;; (exit target-slide-down) + (unknown-time-frame14 time-frame :offset 5120) ;; (trans target-stance) + (unknown-float28 float :offset 5132) ;; logic-target::target-print-stats + (unknown-float29 float :offset 5136) ;; logic-target::target-print-stats + (unknown-float30 float :offset 5140) ;; logic-target::target-print-stats (unknown-vector28 vector :inline :offset 5152) ;; logic-target::joint-points (unknown-vector29 vector :inline :offset 5168) ;; logic-target::joint-points (unknown-vector30 vector :inline :offset 5184) ;; logic-target::joint-points (unknown-vector31 vector :inline :offset 5200) ;; logic-target::joint-points (unknown-vector32 vector :inline :offset 5216) ;; logic-target::joint-points (unknown-vector33 vector :inline :offset 5232) ;; logic-target::joint-points + (unknown-symbol00 symbol :offset 5248) ;; (exit target-duck-stance) + (unknown-float000 float :offset 5252) ;; target-gun::target-gun-end-mode (unknown-float31 float :offset 5256) ;; logic-target::joint-points (unknown-vector-array02 vector 15 :inline :offset 5264) ;; logic-target::turn-around? (unknown-float32 float :offset 5520) ;; logic-target::turn-around? - (unknown-word02 int32 :offset 5524) ;; logic-target::turn-around? + (unknown-word03 int32 :offset 5524) ;; logic-target::turn-around? (unknown-float33 float :offset 5528) ;; logic-target::target-compute-pole (unknown-vector34 vector :inline :offset 5536) ;; logic-target::target-compute-pole - (unknown-vector35 vector :inline :offset 5568) ;; logic-target::target-compute-pole - (unknown-time-frame10 time-frame :offset 5584) ;; logic-target::target-compute-edge - (unknown-time-frame11 time-frame :offset 5592) ;; logic-target::target-compute-edge - (unknown-handle00 handle :offset 5608) ;; logic-target::reset-target-state - (unknown-symbol00 symbol :offset 5620) ;; logic-target::target-compute-pole - (unknown-cspace02 cspace :inline :offset 5824) ;; logic-target::joint-points - (unknown-vector36 vector :inline :offset 5904) ;; logic-target::target-print-stats - (unknown-float34 float :offset 5908) ;; logic-target::target-print-stats - (unknown-vector37 vector :inline :offset 5920) ;; logic-target::target-print-stats - (unknown-float35 float :offset 5924) ;; logic-target::target-print-stats - (unknown-time-frame12 time-frame :offset 5944) ;; board-h::want-to-board? - (unknown-dword05 uint64 :offset 6008) ;; (method 28 target) - (unknown-symbol01 symbol :offset 6144) ;; logic-target::post-flag-setup + (unknown-vector35 vector :inline :offset 5552) ;; target-board::target-board-compute-edge + (unknown-vector36 vector :inline :offset 5568) ;; logic-target::target-compute-pole + (unknown-time-frame15 time-frame :offset 5584) ;; logic-target::target-compute-edge + (unknown-time-frame16 time-frame :offset 5592) ;; logic-target::target-compute-edge + (unknown-handle01 handle :offset 5608) ;; logic-target::reset-target-state + (unknown-word04 uint32 :offset 5616) + (unknown-spool-anim00 spool-anim :offset 5616) ;; (code target-board-get-on) + (unknown-word05 int32 :offset 5616) + (unknown-symbol01 symbol :offset 5616) + (unknown-float34 float :offset 5616) + (unknown-symbol02 float :offset 5620) ;; logic-target::target-compute-pole + (unknown-symbol03 float :offset 5624) ;; (trans target-duck-high-jump-jump) + (unknown-float35 float :offset 5628) ;; (trans target-high-jump) + (unknown-float36 float :offset 5632) ;; (trans target-board-flip) + (unknown-float37 float :offset 5636) ;; target::init-var-jump + (unknown-vector37 vector :inline :offset 5648) ;; (code target-board-pegasus) + (unknown-vector38 vector :inline :offset 5664) ;; (trans target-board-jump-kick) + (unknown-vector39 vector :inline :offset 5680) ;; (code target-board-pegasus) + (unknown-vector40 vector :inline :offset 5696) ;; (code target-board-pegasus) + (unknown-time-frame17 time-frame :offset 5712) ;; (trans target-board-halfpipe) + (unknown-time-frame18 time-frame :offset 5720) ;; (code target-running-attack) + (unknown-sound-id00 sound-id :offset 5776) ;; (enter target-board-flip) + (unknown-handle02 handle :offset 5792) ;; (event target-board-grenade) + (unknown-impact-control00 impact-control :inline :offset 5824) ;; logic-target::joint-points + (unknown-word06 int32 :offset 5832) ;; (code target-running-attack) + (unknown-vector41 vector :inline :offset 5888) ;; (code target-running-attack) + (unknown-vector42 vector :inline :offset 5904) ;; logic-target::target-print-stats + (unknown-float38 float :offset 5908) ;; logic-target::target-print-stats + (unknown-vector43 vector :inline :offset 5920) ;; logic-target::target-print-stats + (unknown-float39 float :offset 5924) ;; logic-target::target-print-stats + (unknown-time-frame19 time-frame :offset 5936) ;; target::init-var-jump + (unknown-time-frame20 time-frame :offset 5944) ;; board-h::want-to-board? + (unknown-symbol04 symbol :offset 5984) ;; target-board-spin-check + (unknown-symbol05 symbol :offset 5988) ;; target-board::target-board-handler + (unknown-dword05 uint64 :offset 6000) ;; target-board::target-board-handler + (unknown-dword06 uint64 :offset 6008) ;; (method 28 target) + (unknown-combo-tracker00 combo-tracker :inline :offset 6032) ;; (enter target-running-attack) + (unknown-time-frame21 time-frame :offset 6072) ;; (code target-running-attack) + (unknown-dword07 int64 :offset 6096) ;; (enter target-double-jump) + (unknown-dword08 int64 :offset 6104) ;; (enter target-double-jump) + (unknown-dword09 int64 :offset 6112) ;; (enter target-double-jump) + (unknown-dword10 int64 :offset 6120) ;; (enter target-double-jump) + (unknown-symbol06 symbol :offset 6144) ;; logic-target::post-flag-setup + (unknown-quaternion04 quaternion :inline :offset 6160) ;; (enter target-attack) + (unknown-sound-id01 sound-id :offset 6176) ;; (code target-attack) + (unknown-float40 float :offset 6180) ;; (enter target-attack) + (unknown-float41 float :offset 6184) ;; (enter target-attack) (unknown-halfword00 uint16 :offset 6188) ;; logic-target::target-no-move-post (history-length uint16 :offset 6190) ;; logic-target::draw-history - (unknown-word03 int32 :offset 6192) ;; logic-target::target-real-post - (unknown-time-frame13 time-frame :offset 6200) ;; logic-target::post-flag-setup - (unknown-time-frame14 time-frame :offset 6208) ;; logic-target::post-flag-setup - (unknown-time-frame15 time-frame :offset 6216) ;; logic-target::post-flag-setup - (unknown-time-frame16 time-frame :offset 6224) ;; logic-target::post-flag-setup - (unknown-time-frame17 time-frame :offset 6248) ;; logic-target::target-calc-camera-pos - (unknown-time-frame18 time-frame :offset 6256) ;; logic-target::target-calc-camera-pos - (unknown-dword06 int64 :offset 6264) ;; logic-target::reset-target-state - (unknown-sound-id00 sound-id :offset 6240) ;; (method 28 target) - (unknown-sound-id01 sound-id :offset 6244) ;; (method 28 target) - (unknown-sound-id02 sound-id :offset 6292) ;; (method 28 target) - (unknown-word04 int32 :offset 6300) ;; (method 28 target) - (unknown-word05 int32 :offset 6304) ;; (method 28 target) - (unknown-word06 int32 :offset 6308) ;; (method 28 target) - (unknown-word07 int32 :offset 6312) ;; (method 28 target) - (unknown-time-frame19 time-frame :offset 6320) ;; logic-target::flag-setup - (unknown-time-frame20 time-frame :offset 6328) ;; logic-target::flag-setup - (unknown-dword07 int64 :offset 6336) ;; logic-target::flag-setup - (unknown-time-frame21 time-frame :offset 6368) ;; board-h::want-to-board? - (unknown-quaternion04 quaternion :inline :offset 6384) ;; logic-target::flag-setup - (unknown-time-frame22 time-frame :offset 6400) ;; logic-target::wall-hide? - (unknown-time-frame23 time-frame :offset 6408) ;; logic-target::wall-hide? + (unknown-word07 int32 :offset 6192) ;; logic-target::target-real-post + (unknown-time-frame22 time-frame :offset 6200) ;; logic-target::post-flag-setup + (unknown-time-frame23 time-frame :offset 6208) ;; logic-target::post-flag-setup + (unknown-time-frame24 time-frame :offset 6216) ;; logic-target::post-flag-setup + (unknown-time-frame25 time-frame :offset 6224) ;; logic-target::post-flag-setup + (unknown-float42 float :offset 6232) ;; (event target-flop) + (unknown-sound-id02 sound-id :offset 6240) ;; (method 28 target) + (unknown-sound-id03 sound-id :offset 6244) ;; (method 28 target) + (unknown-time-frame26 time-frame :offset 6248) ;; logic-target::target-calc-camera-pos + (unknown-time-frame27 time-frame :offset 6256) ;; logic-target::target-calc-camera-pos + (unknown-dword11 int64 :offset 6264) ;; logic-target::reset-target-state + (unknown-vector44 vector :inline :offset 6272) ;; (code target-roll-flip) + (unknown-float43 float :offset 6288) ;; (code target-roll-flip) + (unknown-sound-id04 sound-id :offset 6292) ;; (method 28 target) + (unknown-word08 int32 :offset 6300) ;; (method 28 target) + (unknown-word09 int32 :offset 6304) ;; (method 28 target) + (unknown-word10 int32 :offset 6308) ;; (method 28 target) + (unknown-word11 int32 :offset 6312) ;; (method 28 target) + (unknown-time-frame28 time-frame :offset 6320) ;; logic-target::flag-setup + (unknown-time-frame29 time-frame :offset 6328) ;; logic-target::flag-setup + (unknown-dword12 int64 :offset 6336) ;; logic-target::flag-setup + (unknown-time-frame30 time-frame :offset 6368) ;; board-h::want-to-board? + (unknown-quaternion05 quaternion :inline :offset 6384) ;; logic-target::flag-setup + (unknown-time-frame31 time-frame :offset 6400) ;; logic-target::wall-hide? + (unknown-time-frame32 time-frame :offset 6408) ;; logic-target::wall-hide? (pad uint8 :offset #x190f) ) :flag-assert #x4400001910 @@ -15979,7 +16038,7 @@ (get-head (_type_) touching-prims-entry 9) ;; (dummy-9 (_type_) none 9) (get-next (_type_ touching-shapes-entry) touching-prims-entry 10) ;; (get-touched-shape (_type_ collide-shape) collide-shape 10) (touching-shapes-entry-method-11 () none 11) ;; (dummy-11 () none 11) - (touching-shapes-entry-method-12 () none 12) ;; (prims-touching? (_type_ collide-shape-moving uint) touching-prims-entry 12) + (touching-shapes-entry-method-12 (_type_ collide-shape uint) touching-prims-entry 12) ;; (prims-touching? (_type_ collide-shape-moving uint) touching-prims-entry 12) (touching-shapes-entry-method-13 () none 13) ;; (prims-touching-action? (_type_ collide-shape collide-action collide-action) touching-prims-entry 13) (touching-shapes-entry-method-14 () none 14) ;; (dummy-14 () none 14) ) @@ -16370,7 +16429,7 @@ (effect-control-method-9 () none 9) ;; (TODO-RENAME-9 (_type_) none 9) (effect-control-method-10 () none 10) ;; (dummy-10 (_type_ symbol float int) object 10) (effect-control-method-11 () none 11) ;; (dummy-11 (_type_ symbol float int basic pat-surface) none 11) - (effect-control-method-12 () none 12) ;; (dummy-12 (_type_ symbol float int basic sound-name) int 12) + (effect-control-method-12 (_type_ symbol float int basic sound-name) int 12) ;; (dummy-12 (_type_ symbol float int basic sound-name) int 12) (set-channel-offset! (_type_ int) none 13) (effect-control-method-14 () none 14) ;; (TODO-RENAME-14 (_type_ float float float) none 14) ) @@ -16772,7 +16831,7 @@ (no-look-around-wait uint64 :offset-assert 2096) ;; time-frame (burn-proc handle :offset-assert 2104) ;; handle (pre-joint-hook (function none :behavior target) :offset-assert 2112) - (notify uint64 :offset-assert 2120) + (notify handle :offset-assert 2120) (mode-cache basic :offset-assert 2128) (mode-param1 uint64 :offset-assert 2136) (mode-param2 uint64 :offset-assert 2144) @@ -22470,7 +22529,7 @@ ;; (define-extern dma-from-spr function) ;; function ;; (define-extern merc-dma-chain-to-spr function) ;; function (define-extern blerc-execute (function none)) -;; (define-extern merc-blend-shape function) ;; (function process-drawable object) +(define-extern merc-blend-shape (function process-drawable object)) ;; (define-extern setup-blerc-chains-for-one-fragment function) ;; (function object object object object object object object) ;; (define-extern setup-blerc-chains function) ;; (function merc-ctrl (pointer int16) dma-buffer none) @@ -25504,7 +25563,7 @@ (water-control-method-10 () none 10) ;; (dummy-10 (_type_) none 10) (water-control-method-11 () none 11) ;; (start-bobbing! (_type_ float int int) none 11) (distance-from-surface (_type_) float 12) - (water-control-method-13 () none 13) ;; (dummy-13 (_type_ float vector int vector) none 13) + (water-control-method-13 (_type_ float vector int vector symbol) none 13) ;; (dummy-13 (_type_ float vector int vector) none 13) (display-water-marks? (_type_) symbol 14) (water-control-method-15 () none 15) ;; (TODO-RENAME-15 (_type_) none 15) (water-control-method-16 () none 16) ;; (TODO-RENAME-16 (_type_) none 16) @@ -26221,9 +26280,9 @@ (define-extern ja-channel-push! (function int time-frame int :behavior process-drawable)) ;; (define-extern ja-channel-float! function) (define-extern joint-control-reset! (function joint-control joint-control-channel none :behavior process-drawable)) -;; (define-extern ja-group-size function) ;; (function int :behavior process-drawable) -;; (define-extern ja-eval function) ;; (function int :behavior process-drawable) -;; (define-extern ja-blend-eval function) ;; (function int :behavior process-drawable) +(define-extern ja-group-size (function int :behavior process-drawable)) +(define-extern ja-eval (function int :behavior process-drawable)) +(define-extern ja-blend-eval (function int :behavior process-drawable)) (define-extern ja-post (function none :behavior process-drawable)) (define-extern sleep-code (function symbol)) ;; (define-extern transform-and-sleep function) @@ -26243,13 +26302,13 @@ ;; ambient ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern can-display-query? function) +(define-extern can-display-query? (function symbol)) (define-extern talker-surpress! (function none)) -;; (define-extern talker-displayed? function) +(define-extern talker-displayed? (function symbol)) ;; (define-extern kill-current-talker function) (define-extern string->talker-speech (function string talker-speech-class)) -(define-extern talker-spawn-func (function talker-speech-class process-tree vector basic int)) -;; (define-extern talker-init function) +(define-extern talker-spawn-func (function talker-speech-class process-tree vector region int)) +(define-extern talker-init (function talker-speech-class vector region none :behavior talker)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; speech ;; @@ -26387,12 +26446,12 @@ |# ;; (define-extern entity-lookup-part-group function) -;; (define-extern clone-anim-once function) ;; (function handle int symbol string none :behavior process-drawable) -;; (define-extern clone-anim function) ;; (function handle int symbol string none :behavior process-drawable) +(define-extern clone-anim-once (function handle symbol string none :behavior process-drawable)) +(define-extern clone-anim (function handle symbol string none :behavior process-drawable)) ;; (define-extern swingpole-init function) ;; (define-extern manipy-post function) (define-extern manipy-init (function vector entity-actor skeleton-group vector none :behavior manipy)) ;; (function vector entity-actor skeleton-group vector none :behavior manipy) -(define-extern part-tracker-init (function sparticle-launch-group time-frame (function part-tracker none) (pointer process-drawable) process collide-prim-core none :behavior part-tracker)) ;; +(define-extern part-tracker-init (function sparticle-launch-group time-frame (function part-tracker none) (pointer process-drawable) process collide-prim-core none :behavior part-tracker)) ;; (define-extern part-tracker-track-root function) ;; (function sparticle-system sparticle-cpuinfo vector none) ;; (define-extern part-tracker-move-to-target function) ;; (function part-tracker vector) ;; (define-extern part-tracker-track-target function) ;; (function part-tracker vector) @@ -26407,7 +26466,7 @@ ;; (define-extern cam-launcher-long-joystick function) ;; (function vector :behavior camera-slave) ;; (define-extern cam-launcher-longfall state) ;; (state camera-slave) ;; (define-extern launcher-init-by-other function) ;; (function vector float int float none :behavior launcher) -;; (define-extern touch-tracker-init function) ;; (function vector float time-frame none :behavior touch-tracker) +(define-extern touch-tracker-init (function vector float time-frame none :behavior touch-tracker)) ;; (define-extern explosion-init-by-other function) ;; (define-extern explosion-spawn function) ;; (define-extern process-drawable-random-point! function) ;; (function process-drawable vector vector) @@ -26596,9 +26655,9 @@ (gun-roty-rel degrees :offset-assert 144) (gun-roty degrees :offset-assert 148) (gun-roty-targ degrees :offset-assert 152) - (hips basic :offset-assert 156) - (upper-body basic :offset-assert 160) - (chest basic :offset-assert 164) + (hips joint-mod :offset-assert 156) + (upper-body joint-mod :offset-assert 160) + (chest joint-mod :offset-assert 164) (fire-dir-rot degrees :offset-assert 168) (fire-dir vector 2 :inline :offset-assert 176) ;; guess (fire-point vector :inline :offset-assert 208) @@ -26649,7 +26708,7 @@ (top-anim-tilt-up degrees :offset-assert 600) (attack-combo combo-tracker :inline :offset-assert 608) (combo-window-start time-frame :offset-assert 656) - (combo-window-state uint32 :offset-assert 664) + (combo-window-state symbol :offset-assert 664) (combo-fire-delay uint32 :offset-assert 668) (charge-ammo float :offset-assert 672) (charge-start-time time-frame :offset-assert 680) @@ -26674,6 +26733,30 @@ ;; board-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defenum board-tricks ;; (method 9 board-info) + :type uint32 + :bitfield #f + (none 0) + (board-spin 1) + (board-boost 2) + (board-flip 3) + (board-rail 4) + (board-rail-jump 5) + (board-nosegrab 6) + (board-method 7) + (board-board-spin 8) + (board-board-flip 9) + (board-noseflip 10) + (board-kickflip 11) + (board-jump 12) + (board-duck-jump 13) + (board-quick-jump 14) + (darkjak 15) + (darkjak-bomb0 16) + (darkjak-bomb1 17) + (darkjak-giant 18) + ) + (deftype board (process-drawable) ((control control-info :offset 128) (shadow-backup shadow-geo :offset 208) @@ -26690,139 +26773,160 @@ ) (deftype board-info (basic) - ((board (pointer board) :offset-assert 4) - (camera-interp float :offset-assert 8) - (process (pointer target) :offset-assert 12) - (board-trans vector :inline :offset-assert 16) - (board-quat vector :inline :offset-assert 32) - (board-scale vector :inline :offset-assert 48) - (main joint-mod :offset-assert 64) - (upper-body basic :offset-assert 68) - (sound-bank-knob float :offset-assert 72) - (sound-air-knob float :offset-assert 76) - (wind-sound-id uint32 :offset-assert 80) - (wind-sound-pitch float :offset-assert 84) - (wind-sound-volume float :offset-assert 88) - (engine-sound-id uint32 :offset-assert 92) - (engine-sound-pitch float :offset-assert 96) - (engine-sound-volume float :offset-assert 100) - (bank-sound-id uint32 :offset-assert 104) - (bank-sound-pitch float :offset-assert 108) - (bank-sound-volume float :offset-assert 112) - (ride-sound-id uint32 :offset-assert 116) - (spin-sound-id uint32 :offset-assert 120) - (spin-sound-volume float :offset-assert 124) - (spin-sound-pitch float :offset-assert 128) - (up-vector vector 2 :inline :offset-assert 144) - (slow-transv vector :inline :offset-assert 176) - (board-time time-frame :offset-assert 192) - (board-get-on-time time-frame :offset-assert 200) - (in-air-time time-frame :offset-assert 208) - (stick-lock basic :offset 240) - (stick-off basic :offset-assert 244) - (stance-info ground-tween-info :inline :offset-assert 248) - (mods-backup basic :offset-assert 284) - (attack-id uint32 :offset-assert 288) - (latch? symbol :offset-assert 292) - (unstuck-time time-frame :offset 344) - (stuck-count int32 :offset-assert 352) - (thrust-scale float :offset-assert 356) - (flip-time time-frame :offset-assert 360) - (transv-max meters :offset-assert 368) - (turn-anim-tilt? symbol :offset-assert 372) - (turn-anim-mag float :offset-assert 376) - (turn-anim-targ float :offset-assert 380) - (turn-anim-frame float :offset-assert 384) - (turn-anim-vel float :offset-assert 388) - (turn-anim-duck float :offset-assert 392) - (turn-anim-duck-vel float :offset-assert 396) - (tilt-anim-frame vector :inline :offset-assert 400) - (tilt-anim-target vector :inline :offset-assert 416) - (smack-surface-time time-frame :offset-assert 432) - (smack-speed meters :offset-assert 440) - (smack-normal vector :inline :offset-assert 448) - (glance-time time-frame :offset-assert 464) - (glance-speed meters :offset-assert 472) - (glance-in-transv vector :inline :offset-assert 480) - (glance-out-transv vector :inline :offset-assert 496) - (glance-normal vector :inline :offset-assert 512) - (on-flat-time time-frame :offset-assert 528) - (jump-land-time time-frame :offset-assert 536) - (slip-factor float :offset-assert 544) - (ground-on-dir vector :inline :offset-assert 560) - (ride-time time-frame :offset-assert 576) - (ride-start-time time-frame :offset-assert 584) - (ride-button-time time-frame :offset-assert 592) - (ride-lean-targ float :offset-assert 600) - (ride-lean float :offset-assert 604) - (ride-leanv float :offset-assert 608) - (ride-lean-mag float :offset-assert 612) - (ride-tilt-targ float :offset-assert 616) - (ride-tilt float :offset-assert 620) - (ride-tiltv float :offset-assert 624) - (ride-tilt-mag float :offset-assert 628) - (ride-lock symbol :offset-assert 632) - (ride-lock-on symbol :offset-assert 636) - (ride-speed meters :offset-assert 640) - (ride-mode uint32 :offset-assert 644) - (ride-rot degrees :offset-assert 648) - (ride-rot-old degrees :offset-assert 652) - (ride-rot-abs degrees 2 :offset-assert 656) - (ride-rtv-abs degrees :offset-assert 664) - (ride-touch-segment vector 2 :inline :offset-assert 672) - (ride-dir vector :inline :offset-assert 704) - (ride-vertex-length int16 :offset-assert 720) - (ride-vertex-length-old int16 :offset-assert 722) - (ride-vertex-base int16 :offset-assert 724) - (ride-vertex-base2 int16 :offset-assert 726) - (ride-vertex-index float :offset-assert 728) - (ride-vertex-index2 float :offset-assert 732) - (ride-vertex-index-old float :offset-assert 736) - (ride-vertex vector 3 :inline :offset-assert 752) - (ride-segment vector :inline :offset-assert 800) - (ride-dir-lean vector :inline :offset-assert 816) - (ride-pad-vector vector 1 :inline :offset-assert 832) - (ride-vertex-old vector 3 :inline :offset-assert 848) - (ride-segment-old vector :inline :offset-assert 896) - (ride-vertex-trail vector 128 :inline :offset-assert 912) - (halfpipe-side-time time-frame :offset-assert 2960) - (halfpipe-jump-time time-frame :offset-assert 2968) - (halfpipe-lip-time time-frame :offset-assert 2976) - (halfpipe-time time-frame :offset-assert 2984) - (halfpipe-gspot-time time-frame :offset-assert 2992) - (halfpipe-lip-event symbol :offset-assert 3000) - (spin-check-time time-frame :offset-assert 3008) - (spin-time time-frame :offset-assert 3016) - (spin-start-time time-frame :offset-assert 3024) - (spin-start-dir vector :inline :offset-assert 3040) - (spin-control float :offset-assert 3056) - (spin-ground-start-time time-frame :offset-assert 3064) - (spin-ground-time time-frame :offset-assert 3072) - (spin-ground-press-time time-frame :offset-assert 3080) - (flip-control float :offset-assert 3088) - (flip-count int32 :offset-assert 3092) - (trickx-count int32 :offset 3144) - (trotyv-max degrees :offset-assert 3148) - (trotyv degrees :offset-assert 3152) - (troty degrees :offset-assert 3156) - (troty-cum degrees :offset-assert 3160) - (upper-body-rotyv-max degrees :offset 3168) - (upper-body-rotyv degrees :offset-assert 3172) - (upper-body-roty degrees :offset-assert 3176) - (cushion-base meters :offset-assert 3180) - (cushion-offset meters :offset-assert 3184) - (shock-offset meters :offset-assert 3188) - (shock-offsetv meters :offset-assert 3192) - (shock-rotx meters :offset-assert 3196) - (trick-count int32 :offset 3204) - (pad uint8 :offset 3399) + ((board (pointer board) :offset-assert 4) + (camera-interp float :offset-assert 8) + (process (pointer target) :offset-assert 12) + (board-trans vector :inline :offset-assert 16) + (board-quat vector :inline :offset-assert 32) + (board-scale vector :inline :offset-assert 48) + (main joint-mod :offset-assert 64) + (upper-body joint-mod :offset-assert 68) + (sound-bank-knob float :offset-assert 72) + (sound-air-knob float :offset-assert 76) + (wind-sound-id uint32 :offset-assert 80) + (wind-sound-pitch float :offset-assert 84) + (wind-sound-volume float :offset-assert 88) + (engine-sound-id uint32 :offset-assert 92) + (engine-sound-pitch float :offset-assert 96) + (engine-sound-volume float :offset-assert 100) + (bank-sound-id uint32 :offset-assert 104) + (bank-sound-pitch float :offset-assert 108) + (bank-sound-volume float :offset-assert 112) + (ride-sound-id uint32 :offset-assert 116) + (spin-sound-id uint32 :offset-assert 120) + (spin-sound-volume float :offset-assert 124) + (spin-sound-pitch float :offset-assert 128) + (unknown-sound-id00 sound-id :offset-assert 132) ;; target-board-anim-trans + (unknown-sound-id01 sound-id :offset-assert 136) ;; (code target-board-hold) + (unknown-sound-id02 sound-id :offset-assert 140) ;; (code target-board-hold) + (up-vector vector 2 :inline :offset-assert 144) + (slow-transv vector :inline :offset-assert 176) + (board-time time-frame :offset-assert 192) + (board-get-on-time time-frame :offset-assert 200) + (in-air-time time-frame :offset-assert 208) + (unknown-time-frame00 time-frame :offset-assert 216) + (unknown-time-frame01 time-frame :offset 224) ;; target-board::target-board-pre-move + (unknown-time-frame02 time-frame :offset 232) ;; target-board-anim-trans + (stick-lock symbol :offset 240) + (stick-off symbol :offset-assert 244) + (stance-info ground-tween-info :inline :offset-assert 248) + (mods-backup basic :offset-assert 284) + (attack-id uint32 :offset-assert 288) + (latch? symbol :offset-assert 292) + (unknown-vector00 vector :inline :offset 304) + (unknown-vector01 vector :inline :offset 320) + (unknown-int00 uint32 :offset 336) + (unknown-symbol00 symbol :offset 340) + (unstuck-time time-frame :offset 344) + (stuck-count int32 :offset-assert 352) + (thrust-scale float :offset-assert 356) + (flip-time time-frame :offset-assert 360) + (transv-max meters :offset-assert 368) + (turn-anim-tilt? symbol :offset-assert 372) + (turn-anim-mag float :offset-assert 376) + (turn-anim-targ float :offset-assert 380) + (turn-anim-frame float :offset-assert 384) + (turn-anim-vel float :offset-assert 388) + (turn-anim-duck float :offset-assert 392) + (turn-anim-duck-vel float :offset-assert 396) + (tilt-anim-frame vector :inline :offset-assert 400) + (tilt-anim-target vector :inline :offset-assert 416) + (smack-surface-time time-frame :offset-assert 432) + (smack-speed meters :offset-assert 440) + (smack-normal vector :inline :offset-assert 448) + (glance-time time-frame :offset-assert 464) + (glance-speed meters :offset-assert 472) + (glance-in-transv vector :inline :offset-assert 480) + (glance-out-transv vector :inline :offset-assert 496) + (glance-normal vector :inline :offset-assert 512) + (on-flat-time time-frame :offset-assert 528) + (jump-land-time time-frame :offset-assert 536) + (slip-factor float :offset-assert 544) + (ground-on-dir vector :inline :offset-assert 560) + (ride-time time-frame :offset-assert 576) + (ride-start-time time-frame :offset-assert 584) + (ride-button-time time-frame :offset-assert 592) + (ride-lean-targ float :offset-assert 600) + (ride-lean float :offset-assert 604) + (ride-leanv float :offset-assert 608) + (ride-lean-mag float :offset-assert 612) + (ride-tilt-targ float :offset-assert 616) + (ride-tilt float :offset-assert 620) + (ride-tiltv float :offset-assert 624) + (ride-tilt-mag float :offset-assert 628) + (ride-lock symbol :offset-assert 632) + (ride-lock-on symbol :offset-assert 636) + (ride-speed meters :offset-assert 640) + (ride-mode uint32 :offset-assert 644) + (ride-rot degrees :offset-assert 648) + (ride-rot-old degrees :offset-assert 652) + (ride-rot-abs degrees 2 :offset-assert 656) + (ride-rtv-abs degrees :offset-assert 664) + (ride-touch-segment vector 2 :inline :offset-assert 672) + (ride-dir vector :inline :offset-assert 704) + (ride-vertex-length int16 :offset-assert 720) + (ride-vertex-length-old int16 :offset-assert 722) + (ride-vertex-base int16 :offset-assert 724) + (ride-vertex-base2 int16 :offset-assert 726) + (ride-vertex-index float :offset-assert 728) + (ride-vertex-index2 float :offset-assert 732) + (ride-vertex-index-old float :offset-assert 736) + (ride-vertex vector 3 :inline :offset-assert 752) + (ride-segment vector :inline :offset-assert 800) + (ride-dir-lean vector :inline :offset-assert 816) + (ride-pad-vector vector 1 :inline :offset-assert 832) + (ride-vertex-old vector 3 :inline :offset-assert 848) + (ride-segment-old vector :inline :offset-assert 896) + (ride-vertex-trail vector 128 :inline :offset-assert 912) + (halfpipe-side-time time-frame :offset-assert 2960) + (halfpipe-jump-time time-frame :offset-assert 2968) + (halfpipe-lip-time time-frame :offset-assert 2976) + (halfpipe-time time-frame :offset-assert 2984) + (halfpipe-gspot-time time-frame :offset-assert 2992) + (halfpipe-lip-event symbol :offset-assert 3000) + (spin-check-time time-frame :offset-assert 3008) + (spin-time time-frame :offset-assert 3016) + (spin-start-time time-frame :offset-assert 3024) + (spin-start-dir vector :inline :offset-assert 3040) + (spin-control float :offset-assert 3056) + (spin-ground-start-time time-frame :offset-assert 3064) + (spin-ground-time time-frame :offset-assert 3072) + (spin-ground-press-time time-frame :offset-assert 3080) + (flip-control float :offset-assert 3088) + (flip-count int32 :offset-assert 3092) + (unknown-time-frame03 time-frame :offset 3104) + (unknown-time-frame04 time-frame :offset 3112) ;; (enter target-board-hold) + (unknown-time-frame05 time-frame :offset 3120) ;; target-board-spin-check + (unknown-time-frame06 time-frame :offset 3128) ;; target-board-spin-check + (unknown-float00 float :offset 3136) ;; target-board-spin-check + (unknown-float01 float :offset 3140) ;; target-board-spin-check + (trickx-count int32 :offset 3144) + (trotyv-max degrees :offset-assert 3148) + (trotyv degrees :offset-assert 3152) + (troty degrees :offset-assert 3156) + (troty-cum degrees :offset-assert 3160) + (unknown-deg00 degrees :offset 3164) ;; target-board-spin-check + (upper-body-rotyv-max degrees :offset 3168) + (upper-body-rotyv degrees :offset-assert 3172) + (upper-body-roty degrees :offset-assert 3176) + (cushion-base meters :offset-assert 3180) + (cushion-offset meters :offset-assert 3184) + (shock-offset meters :offset-assert 3188) + (shock-offsetv meters :offset-assert 3192) + (shock-rotx meters :offset-assert 3196) + (part-control sparticle-launch-control :offset-assert 3200) + (trick-count int32 :offset-assert 3204) + (trick-array board-tricks 16 :offset-assert 3208) + (trick-points-array float 16 :offset 3272) + (trick-list board-tricks 16 :offset 3336) + (pad uint8 :offset 3399) ) :method-count-assert 11 :size-assert #xd48 :flag-assert #xb00000d48 (:methods - (board-info-method-9 () none 9) - (board-info-method-10 () none 10) + (add-to-trick-list "Add specified trick and point amount to trick list." (_type_ board-tricks float) none 9) + (flush-trick-list "Flush trick list and give out points." (_type_) none 10) ) ) @@ -26991,38 +27095,38 @@ (define-extern *target-shadow-control* shadow-control) (define-extern *TARGET-bank* target-bank) -;; (define-extern target-start-attack function) ;; (function none :behavior target) -;; (define-extern target-danger-set! function) ;; (function symbol symbol float :behavior target) +(define-extern target-start-attack (function none :behavior target)) +(define-extern target-danger-set! (function symbol symbol float :behavior target)) (define-extern target-collide-set! (function symbol float int :behavior target)) (define-extern debounce-speed (function float float vector vector float :behavior target)) -;; (define-extern target-align-vel-z-adjust function) ;; (function float float :behavior target) +(define-extern target-align-vel-z-adjust (function float float :behavior target)) ;; (define-extern average-turn-angle function) ;; (function target float) -;; (define-extern can-play-stance-amibent? function) ;; (function symbol :behavior target) -;; (define-extern target-height-above-ground function) ;; (function float :behavior target) -;; (define-extern can-jump? function) ;; (function symbol symbol :behavior target) -;; (define-extern target-jump-go function) -;; (define-extern move-legs? function) ;; (function symbol :behavior target) -;; (define-extern jump-hit-ground-stuck? function) -;; (define-extern target-time-to-ground function) -;; (define-extern fall-test function) ;; (function none :behavior target) -;; (define-extern slide-down-test function) ;; (function none :behavior target) -;; (define-extern smack-surface? function) ;; (function symbol symbol :behavior target) -;; (define-extern can-roll? function) -;; (define-extern can-duck? function) ;; (function symbol :behavior target) +(define-extern can-play-stance-amibent? (function symbol :behavior target)) +(define-extern target-height-above-ground (function float :behavior target)) +(define-extern can-jump? (function symbol symbol :behavior target)) +(define-extern target-jump-go (function none :behavior target)) +(define-extern move-legs? (function symbol :behavior target)) +(define-extern jump-hit-ground-stuck? (function symbol :behavior target)) +(define-extern target-time-to-ground (function time-frame :behavior target)) +(define-extern fall-test (function state float none :behavior target)) +(define-extern slide-down-test (function none :behavior target)) +(define-extern smack-surface? (function symbol symbol :behavior target)) +(define-extern can-roll? (function symbol :behavior target)) +(define-extern can-duck? (function symbol :behavior target)) (define-extern can-exit-duck? (function symbol :behavior target)) ;; (function symbol :behavior target) -;; (define-extern can-hands? function) ;; (function symbol symbol :behavior target) -;; (define-extern can-feet? function) ;; (function symbol :behavior target) -;; (define-extern are-still? function) +(define-extern can-hands? (function symbol symbol :behavior target)) +(define-extern can-feet? (function symbol symbol :behavior target)) +(define-extern are-still? (function symbol :behavior target)) ;; (define-extern vector-local+! function) ;; (function vector vector vector :behavior target) ;; (define-extern move-forward function) ;; (function float vector :behavior target) -;; (define-extern set-forward-vel function) ;; (function float vector :behavior target) -;; (define-extern delete-back-vel function) ;; (function none :behavior target) +(define-extern set-forward-vel (function float vector :behavior target)) +(define-extern delete-back-vel (function none :behavior target)) ;; (define-extern set-side-vel function) ;; (function float vector :behavior target) -;; (define-extern target-timed-invulnerable function) ;; (function time-frame target none) +(define-extern target-timed-invulnerable (function time-frame target none)) (define-extern target-timed-invulnerable-off (function target int none)) ;; (define-extern target-log-attack function) -;; (define-extern ground-tween-initialize function) ;; (function ground-tween-info uint uint uint uint uint uint ground-tween-info :behavior target) -;; (define-extern ground-tween-update function) ;; (function ground-tween-info float float none :behavior target) +(define-extern ground-tween-initialize (function ground-tween-info uint uint uint uint uint uint ground-tween-info :behavior target)) +(define-extern ground-tween-update (function ground-tween-info float float none :behavior target)) (define-extern target-pos (function int vector)) ;; (define-extern target-cam-pos function) ;; (function vector) ;; (define-extern target-rot function) ;; (function quaternion) @@ -27038,8 +27142,8 @@ ;; (define-extern birth-func-set-alpha-from-userdata function) ;; (define-extern part-tracker-track-target-joint function) ;; (function int sparticle-cpuinfo sparticle-launchinfo none) ;; (define-extern process-drawable-burn-effect function) ;; (function time-frame none :behavior target) -;; (define-extern lightning-probe-callback function) -;; (define-extern process-drawable-shock-effect function) +(define-extern lightning-probe-callback (function lightning-tracker none)) +(define-extern process-drawable-shock-effect (function process-drawable lightning-spec (function lightning-tracker none) sparticle-launcher int int float none)) ;; guess ;; (define-extern process-drawable-shock-wall-effect function) ;; (define-extern process-drawable2-shock-effect function) ;; (define-extern process-drawable-shock-skel-effect function) @@ -27062,7 +27166,7 @@ ;; (define-extern target-collision-low-coverage function) ;; (function control-info collide-shape-intersect vector (pointer uint32) (pointer uint64) (pointer symbol) uint) (define-extern target-collision-reaction (function control-info collide-query vector vector cshape-moving-flags)) ;; (function control-info collide-shape-intersect vector vector cshape-moving-flags) (define-extern target-collision-no-reaction (function control-info collide-query vector vector none)) ;; (function control-info collide-shape-intersect vector vector none) -;; (define-extern *collide-edge-board-spec* object) +(define-extern *collide-edge-board-spec* collide-edge-spec) (define-extern rail-surface-touch (function none)) (define-extern gravel-surface-touch (function none)) @@ -27338,77 +27442,81 @@ ;; target-handler ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern target-shoved function) ;; (function meters meters process (state object object target) object :behavior target) +(define-extern target-shoved (function meters meters process (state object object target) object :behavior target)) ;; (define-extern attack-mode-is-invinc function) -;; (define-extern target-attacked function) ;; (function symbol attack-info process process (state symbol attack-info target) object :behavior target) -;; (define-extern target-send-attack function) ;; (function process uint uint int int symbol :behavior target) +(define-extern target-attacked (function symbol attack-info process process (state symbol attack-info target) object :behavior target)) +(define-extern target-send-attack (function process uint uint int int symbol :behavior target)) (define-extern target-generic-event-handler (function process int symbol event-message-block object :behavior target)) ;; (function process int symbol event-message-block object :behavior target) -;; (define-extern target-standard-event-handler function) ;; (function process int symbol event-message-block object :behavior target) -;; (define-extern target-dangerous-event-handler function) ;; (function process int symbol event-message-block object :behavior target) -;; (define-extern target-bonk-event-handler function) ;; (function process int symbol event-message-block object :behavior target) -;; (define-extern target-jump-event-handler function) ;; (function process int symbol event-message-block object :behavior target) -;; (define-extern target-walk-event-handler function) ;; (function process int symbol event-message-block object :behavior target) +(define-extern target-standard-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-dangerous-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-bonk-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-jump-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-walk-event-handler (function process int symbol event-message-block object :behavior target)) (define-extern target-exit (function none :behavior target)) -;; (define-extern target-state-hook-exit function) ;; (function none :behavior target) -;; (define-extern target-effect-exit function) ;; (function none :behavior target) +(define-extern target-state-hook-exit (function none :behavior target)) +(define-extern target-effect-exit (function none :behavior target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target-anim ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; (define-extern target-land-anim function) -;; (define-extern target-stance-anim function) +(define-extern target-stance-anim (function none :behavior target)) ;; (define-extern target-stance-push function) -;; (define-extern target-falling-anim function) ;; (function time-frame time-frame symbol :behavior target) +(define-extern target-falling-anim (function int time-frame symbol :behavior target)) ;; (define-extern target-falling-anim-trans function) ;; (function none :behavior target) -;; (define-extern target-walk-anim function) +(define-extern target-walk-anim (function int none :behavior target)) ;; (define-extern target-hit-ground-flop-anim function) -;; (define-extern target-hit-ground-anim function) ;; (function symbol symbol :behavior target) -;; (define-extern target-attack-air-anim function) +(define-extern target-hit-ground-anim (function symbol symbol :behavior target)) +(define-extern target-attack-air-anim (function none :behavior target)) ;; (define-extern target-edge-grab-anim function) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern target-falling-trans function) ;; (function basic time-frame none :behavior target) -;; (define-extern target-startup state) ;; (state target) -;; (define-extern target-stance state) ;; (state target) -;; (define-extern target-walk state) ;; (state target) -;; (define-extern target-turn-around state) ;; (state target) -;; (define-extern target-slide-down state) ;; (state target) -;; (define-extern *slide-down-mods* surface) -;; (define-extern *slide-jump-mods* surface) -;; (define-extern target-slide-down-to-ground state) -;; (define-extern init-var-jump function) ;; (function float float vector vector vector vector :behavior target) -;; (define-extern mod-var-jump function) ;; (function symbol symbol symbol vector vector :behavior target) -;; (define-extern *duck-mods* surface) ;; surface -;; (define-extern target-duck-stance state) ;; (state target) -;; (define-extern target-duck-walk state) ;; (state target) -;; (define-extern target-jump-top-anim function) -;; (define-extern target-jump state) ;; (state float float surface target) -;; (define-extern target-jump-forward state) ;; (state float float target) -;; (define-extern target-double-jump state) ;; (state float float target) -;; (define-extern target-high-jump state) ;; (state float float basic target) -;; (define-extern target-duck-high-jump state) ;; (state float float symbol target) -;; (define-extern target-duck-high-jump-jump state) ;; (state float float symbol target) -;; (define-extern target-falling state) ;; (state symbol target) -;; (define-extern target-hit-ground state) ;; (state symbol target) -;; (define-extern *attack-mods* surface) ;; surface -;; (define-extern *attack-end-mods* object) -;; (define-extern target-attack state) ;; (state target) -;; (define-extern *run-attack-mods* surface) ;; surface -;; (define-extern target-running-attack state) ;; (state target) -;; (define-extern *jump-attack-mods* surface) ;; surface -;; (define-extern target-attack-air state) ;; (state symbol target) -;; (define-extern *uppercut-mods* object) -;; (define-extern *uppercut-jump-mods* surface) ;; surface -;; (define-extern target-attack-uppercut state) ;; (state float float target) -;; (define-extern target-attack-uppercut-jump state) ;; (state float float target) -;; (define-extern target-flop state) ;; (state float float float target) -;; (define-extern target-flop-hit-ground state) ;; (state symbol target) -;; (define-extern target-roll state) -;; (define-extern target-roll-flip state) +(define-extern target-falling-trans (function symbol time-frame none :behavior target)) +(define-extern target-startup (state target)) +(define-extern target-stance (state target)) +(define-extern target-walk (state target)) +(define-extern target-ice-walk (state target)) ;; called in (trans target-walk), but not defined +(define-extern target-ice-stance (state target)) ;; called in (trans target-stance), but not defined +(define-extern target-turn-around (state target)) +(define-extern target-slide-down (state target)) +(define-extern *slide-down-mods* surface) +(define-extern *slide-jump-mods* surface) +(define-extern target-slide-down-to-ground (state target)) +(define-extern init-var-jump (function float float symbol symbol vector float vector :behavior target)) +(define-extern mod-var-jump (function symbol symbol symbol vector vector :behavior target)) +(define-extern *duck-mods* surface) +(define-extern target-duck-stance (state symbol target)) +(define-extern target-duck-walk (state symbol target)) +(define-extern target-jump-top-anim (function none :behavior target)) +(define-extern target-jump (state float float surface target)) +(define-extern target-jump-forward (state float float target)) +(define-extern target-double-jump (state float float target)) +(define-extern target-high-jump (state float float object target)) +(define-extern target-duck-high-jump (state float float symbol target)) +(define-extern target-duck-high-jump-jump (state float float symbol target)) +(define-extern target-falling (state symbol target)) +(define-extern target-hit-ground (state symbol target)) +(define-extern *attack-mods* surface) +(define-extern *attack-end-mods* surface) +(define-extern target-attack (state target)) +(define-extern *run-attack-mods* surface) +(define-extern target-running-attack (state target)) +(define-extern *jump-attack-mods* surface) +(define-extern target-attack-air (state symbol target)) +(define-extern *uppercut-mods* surface) +(define-extern *uppercut-jump-mods* surface) +(define-extern target-attack-uppercut (state float float target)) +(define-extern target-attack-uppercut-jump (state float float target)) +(define-extern target-flop (state float float float target)) +(define-extern target-flop-hit-ground (state symbol target)) +(define-extern target-roll (state target)) +(define-extern target-roll-flip (state float float target)) +(define-extern target-land-effect (function none :behavior target)) ;; called in (code target-roll-flip), but not actually defined anywhere? +(define-extern target-yellow-jump-blast (state target)) ;; called in (code target-flop), but not defined, causes crash on PCSX2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target2 ;; @@ -27420,7 +27528,7 @@ ;; (define-extern target-stance-look-around state) ;; (state target) ;; (define-extern *look-around-mods* object) ;; (define-extern target-look-around state) ;; (state target) -;; (define-extern target-grab state) ;; (state target) +(define-extern target-grab (state target)) ;; (define-extern target-pole-cycle state) ;; (state handle target) ;; (define-extern target-pole-flip-up state) ;; (state object object float target) ;; (define-extern target-pole-flip-up-jump state) ;; (state float float target) @@ -27430,10 +27538,10 @@ ;; (define-extern target-edge-grab-jump state) ;; (state float float target) ;; (define-extern target-edge-grab-off state) ;; (state target) ;; (define-extern *hit-ground-hard-mods* object) -;; (define-extern target-hit-ground-hard state) ;; (state float target) +(define-extern target-hit-ground-hard (state float target)) ;; (define-extern *hide-mods* surface) -;; (define-extern target-hide state) -;; (define-extern target-launch state) ;; (state float symbol vector int target) +(define-extern target-hide (state target)) +(define-extern target-launch (state float symbol vector int target)) ;; (define-extern target-play-anim state) ;; (state string handle target) (define-extern target-clone-anim (state handle target)) ;; (define-extern *float-mods* object) @@ -27443,13 +27551,13 @@ ;; target-swim ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern target-wade-stance state) ;; (state target) -;; (define-extern target-wade-walk state) ;; (state target) +(define-extern target-wade-stance (state target)) +(define-extern target-wade-walk (state target)) ;; (define-extern target-swim-tilt function) ;; (function float float float float float :behavior target) -;; (define-extern target-swim-stance state) ;; (state target) -;; (define-extern target-swim-walk state) ;; (state target) -;; (define-extern target-swim-down state) ;; (state target) -;; (define-extern target-swim-up state) ;; (state target) +(define-extern target-swim-stance (state target)) +(define-extern target-swim-walk (state target)) +(define-extern target-swim-down (state target)) +(define-extern target-swim-up (state target)) ;; (define-extern target-swim-jump-jump state) ;; (state float float surface target) ;; (define-extern target-swim-jump state) ;; (state float float target) @@ -27461,7 +27569,7 @@ ;; (define-extern *carry-jump-mods* surface) ;; (define-extern target-carry-update function) ;; (define-extern target-carry-post function) -;; (define-extern target-carry-pickup state) +(define-extern target-carry-pickup (state target)) ;; (define-extern target-carry-drop state) ;; (define-extern target-carry-stance state) ;; (define-extern target-carry-walk state) @@ -27475,17 +27583,17 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define-extern target-darkjak-setup (function symbol none :behavior target)) -;; (define-extern want-to-darkjak? function) +(define-extern want-to-darkjak? (function symbol :behavior target)) ;; (define-extern *darkjak-trans-mods* object) ;; (define-extern target-darkjak-end-mode function) ;; (define-extern target-darkjak-process function) -;; (define-extern target-darkjak-get-on state) +(define-extern target-darkjak-get-on (state int target)) ;; (define-extern target-darkjak-get-off state) -;; (define-extern target-darkjak-running-attack state) +(define-extern target-darkjak-running-attack (state target)) ;; (define-extern target-darkjak-bomb-collide function) -;; (define-extern target-darkjak-bomb0 state) +(define-extern target-darkjak-bomb0 (state target)) ;; (define-extern target-bomb1-fire-shot function) -;; (define-extern target-darkjak-bomb1 state) +(define-extern target-darkjak-bomb1 (state target)) ;; (define-extern target-darkjak-giant state) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -27506,15 +27614,15 @@ ;; (define-extern *auto-continue* object) ;; symbol ;; (define-extern next-continue function) (define-extern target-continue (state continue-point target)) -;; (define-extern *smack-mods* surface) ;; surface -;; (define-extern *smack-up-mods* surface) ;; surface +(define-extern *smack-mods* surface) +(define-extern *smack-up-mods* surface) ;; (define-extern velocity-set-to-target! function) ;; (function vector float attack-info vector :behavior target) -;; (define-extern target-hit-effect function) ;; (function attack-info none :behavior target) +(define-extern target-hit-effect (function attack-info none :behavior target)) ;; (define-extern target-hit-push function) ;; (function vector matrix float float attack-info object :behavior target) -;; (define-extern target-hit-orient function) ;; (function attack-info vector symbol :behavior target) +(define-extern target-hit-orient (function attack-info vector symbol :behavior target)) ;; (define-extern target-hit-setup-anim function) ;; (function attack-info object :behavior target) -;; (define-extern target-hit-move function) ;; (function attack-info symbol (function none :behavior target) float none :behavior target) -;; (define-extern target-hit state) ;; (state symbol attack-info target) +(define-extern target-hit-move (function attack-info symbol (function none :behavior target) float none :behavior target)) +(define-extern target-hit (state symbol attack-info target)) ;; (define-extern *death-spool-array* array) ;; (array spool-anim) ;; (define-extern death-movie-remap function) ;; (function int int int) ;; (define-extern *kill-nearby-enemies-info* kill-nearby-enemies-info) @@ -27523,26 +27631,26 @@ ;; (define-extern target-death-anim function) ;; (function spool-anim none :behavior target) ;; (define-extern target-death-main function) ;; (define-extern target-death-reset function) -;; (define-extern target-death state) ;; (state symbol target) +(define-extern target-death (state symbol target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target-gun ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; (define-extern *kernel-packages* object) ;; pair -;; (define-extern *gun-walk-mods* surface) +(define-extern *gun-walk-mods* surface) ;; (define-extern target-gun-event-handler function) (define-extern target-gun-setup (function symbol none :behavior target)) ;; (define-extern target-gun-init function) ;; (define-extern target-gun-exit function) -(define-extern target-gun-end-mode (function none :behavior target)) +(define-extern target-gun-end-mode (function symbol symbol :behavior target)) ;; (define-extern quat<-gun! function) ;; (define-extern target-gun-ammo-out-pick function) ;; (define-extern target-gun-type-set! function) ;; (define-extern target-gun-marking-menu function) ;; (define-extern target-gun-build-track-list function) ;; (define-extern target-gun-find-track function) -;; (define-extern target-top-anim-base-mode function) +(define-extern target-top-anim-base-mode (function int none :behavior target)) ;; (define-extern target-gun-combo-start function) (define-extern target-gun-joint-pre0 (function none :behavior target)) (define-extern target-gun-joint-pre (function none :behavior target)) @@ -27734,8 +27842,8 @@ ;; gun-states ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern target-gun-stance state) -;; (define-extern target-gun-walk state) +(define-extern target-gun-stance (state target)) +(define-extern target-gun-walk (state target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; board-util ;; @@ -27752,40 +27860,40 @@ (define-extern *board-duck-mods* surface) (define-extern *board-air-mods* surface) (define-extern *board-jump-mods* surface) -;; (define-extern *board-ride-jump-mods* surface) -(define-extern *board-duck-jump-mods* object) -(define-extern *board-spin-mods* object) -;; (define-extern *board-spin-post-mods* object) -;; (define-extern *board-flip-mods* object) -;; (define-extern *board-wall-kick-mods* surface) -;; (define-extern *board-halfpipe-mods* surface) +(define-extern *board-ride-jump-mods* surface) +(define-extern *board-duck-jump-mods* surface) +(define-extern *board-spin-mods* surface) +(define-extern *board-spin-post-mods* surface) +(define-extern *board-flip-mods* surface) +(define-extern *board-wall-kick-mods* surface) +(define-extern *board-halfpipe-mods* surface) (define-extern *board-turn-to-mods* surface) -;; (define-extern *board-ride-mods* surface) -;; (define-extern *collide-edge-board-halfpipe-spec* object) -;; (define-extern target-board-handler function) +(define-extern *board-ride-mods* surface) +(define-extern *collide-edge-board-halfpipe-spec* collide-edge-spec) +(define-extern target-board-handler (function process int symbol event-message-block object :behavior target)) (define-extern target-board-setup (function symbol none :behavior target)) -;; (define-extern target-board-init function) -;; (define-extern target-board-exit function) -;; (define-extern target-board-falling-anim-trans function) -;; (define-extern board-on-ground? function) -;; (define-extern target-board-smack-surface? function) -;; (define-extern board-add-thrust function) -;; (define-extern segment-array-vector->index function) -;; (define-extern segment-array-index->vector function) -;; (define-extern target-board-exit-check function) -;; (define-extern target-board-effect function) -;; (define-extern target-board-physics function) -;; (define-extern target-board-collision function) +(define-extern target-board-init (function none :behavior target)) +(define-extern target-board-exit (function none :behavior target)) +(define-extern target-board-falling-anim-trans (function none :behavior target)) +(define-extern board-on-ground? (function symbol :behavior target)) +(define-extern target-board-smack-surface? (function symbol :behavior target)) +(define-extern board-add-thrust (function none :behavior target)) +(define-extern segment-array-vector->index (function (inline-array vector) int float float float)) +(define-extern segment-array-index->vector (function (inline-array vector) int float vector int)) +(define-extern target-board-exit-check (function none :behavior target)) +(define-extern target-board-effect (function none :behavior target)) +(define-extern target-board-physics (function vector none :behavior target)) +(define-extern target-board-collision (function none :behavior target)) (define-extern target-board-joint-points (function none :behavior target)) -;; (define-extern target-board-pre-move function) -;; (define-extern target-board-real-post function) -;; (define-extern probe-test function) -;; (define-extern target-board-compute-edge function) -;; (define-extern board-ride-add-thrust function) -;; (define-extern target-board-ride-post function) -;; (define-extern target-board-post function) -;; (define-extern target-board-center-anim function) -;; (define-extern target-board-turn-anim function) +(define-extern target-board-pre-move (function none :behavior target)) +(define-extern target-board-real-post (function none :behavior target)) +(define-extern probe-test (function control-info vector pat-surface symbol)) +(define-extern target-board-compute-edge (function time-frame :behavior target)) +(define-extern board-ride-add-thrust (function vector float none :behavior target)) +(define-extern target-board-ride-post (function none :behavior target)) +(define-extern target-board-post (function none :behavior target)) +(define-extern target-board-center-anim (function none :behavior target)) +(define-extern target-board-turn-anim (function int none :behavior target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; board-part ;; @@ -27796,35 +27904,35 @@ ;; board-states ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern vector-vector-angle function) -;; (define-extern target-board-anim-trans function) -;; (define-extern target-board-spin-check function) -;; (define-extern target-board-halfpipe-trans function) -;; (define-extern target-board-resolve-points function) -;; (define-extern target-board-ground-check function) -;; (define-extern target-board-halfpipe-check function) -;; (define-extern target-board-jump-trans function) -;; (define-extern target-board-start state) -;; (define-extern target-board-stance state) -;; (define-extern target-board-duck-stance state) -;; (define-extern target-board-jump state) -;; (define-extern target-board-halfpipe state) -;; (define-extern target-board-falling state) -;; (define-extern target-board-jump-kick state) -;; (define-extern target-board-wall-kick state) -;; (define-extern target-board-flip state) -;; (define-extern target-board-hold state) -;; (define-extern target-board-trickx state) -;; (define-extern target-board-hit-ground state) -;; (define-extern target-board-turn-to state) -;; (define-extern target-board-ride-edge state) -;; (define-extern target-board-grenade state) -;; (define-extern target-board-get-on state) -;; (define-extern target-board-pegasus state) -;; (define-extern target-board-get-off state) -;; (define-extern target-board-grab state) -;; (define-extern target-board-clone-anim state) -;; (define-extern target-board-hit state) +(define-extern vector-vector-angle (function vector vector float)) +(define-extern target-board-anim-trans (function none :behavior target)) +(define-extern target-board-spin-check (function none :behavior target)) +(define-extern target-board-halfpipe-trans (function none :behavior target)) +(define-extern target-board-resolve-points (function float float float float none :behavior target)) ;; only arg3 used? +(define-extern target-board-ground-check (function none :behavior target)) +(define-extern target-board-halfpipe-check (function collide-action :behavior target)) +(define-extern target-board-jump-trans (function none :behavior target)) +(define-extern target-board-start (state object target)) +(define-extern target-board-stance (state target)) +(define-extern target-board-duck-stance (state target)) +(define-extern target-board-jump (state meters meters symbol target)) +(define-extern target-board-halfpipe (state target)) +(define-extern target-board-falling (state target)) +(define-extern target-board-jump-kick (state target)) +(define-extern target-board-wall-kick (state vector float target)) +(define-extern target-board-flip (state float float symbol target)) +(define-extern target-board-hold (state float float symbol target)) +(define-extern target-board-trickx (state float float symbol target)) +(define-extern target-board-hit-ground (state target)) +(define-extern target-board-turn-to (state vector time-frame target)) +(define-extern target-board-ride-edge (state symbol object object float target)) +(define-extern target-board-grenade (state handle target)) +(define-extern target-board-get-on (state target)) +(define-extern target-board-pegasus (state handle target)) +(define-extern target-board-get-off (state object symbol target)) ;; unused arg0 +(define-extern target-board-grab (state symbol target)) +(define-extern target-board-clone-anim (state handle target)) +(define-extern target-board-hit (state vector target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mech-h ;; @@ -29326,7 +29434,7 @@ (define-extern update-eyes (function none)) (define-extern get-eye-block (function int int int)) ;; (define-extern convert-eye-data function) ;; (function eye uint float) -;; (define-extern merc-eye-anim function) ;; (function process-drawable none) +(define-extern merc-eye-anim (function process-drawable none)) ;; (define-extern set-eye-draw-flag function) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -30814,17 +30922,17 @@ ;; idle-control ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype idle-control-frame (uint32) - () + ((command uint8 :offset 0) + (anim uint8 :offset 8) + (param0 uint8 :offset 16) + (param1 uint8 :offset 24) + ) :method-count-assert 9 :size-assert #x4 :flag-assert #x900000004 - ;; Failed to read fields. ) -|# -#| (deftype idle-control (structure) ((anim uint32 :offset-assert 0) (current uint32 :offset-assert 4) @@ -30839,7 +30947,6 @@ (idle-control-method-10 () none 10) ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -30864,7 +30971,47 @@ ;; enemy-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(defenum enemy-flag + :type int64 + :bitfield #t + (lock-focus 0) + (death-start 1) + (enable-on-active 2) + (checking-water 3) + (check-water 4) + (spawn-gem 5) + (chase-startup 6) + (attackable-backup 7) + (look-at-focus 8) + (use-notice-distance 9) + (enable-on-notice 10) + (look-at-move-dest 11) + (notice 12) + (auto-reset-penetrate 13) + (jump-check-blocked 14) + (drawn-mirrored 15) + (multi-focus 16) + (alert 17) + (victory 18) + (dangerous-backup 19) + (actor-pause-backup 20) + (trackable 21) + (called-dying 22) + (check-water-backup 23) + (no-initial-move-to-ground 24) + (cam-attack-mode 25) + (trackable-backup 26) + (enable-on-hostile 27) + (directed-ready 28) + (use-trigger 29) + (directed 30) + (dislike-combo 31) + (recover-applied-velocity 32) + (vulnerable-backup 33) + (vulnerable 34) + (recover 35) + ) + (deftype enemy-focus (focus) ((aware uint64 :offset-assert 16) (flags uint64 :offset-assert 24) @@ -30876,9 +31023,7 @@ (enemy-focus-method-13 () none 13) ) ) -|# -#| (deftype enemy-info (basic) ((fact-defaults basic :offset-assert 4) (use-die-falling basic :offset-assert 8) @@ -30969,9 +31114,7 @@ (enemy-info-method-9 () none 9) ) ) -|# -#| (deftype enemy-knocked-info (structure) ((anim-speed float :offset-assert 0) (on-surface-count int32 :offset-assert 4) @@ -30982,9 +31125,7 @@ :size-assert #x18 :flag-assert #x900000018 ) -|# -#| (deftype enemy-jump-info (structure) ((flags uint8 :offset-assert 0) (anim-speed float :offset-assert 4) @@ -30997,9 +31138,7 @@ :size-assert #x58 :flag-assert #x900000058 ) -|# -#| (deftype enemy-init-by-other-params (structure) ((trans vector :inline :offset-assert 0) (quat quaternion :inline :offset-assert 16) @@ -31011,15 +31150,13 @@ :size-assert #x2c :flag-assert #x90000002c ) -|# -#| (deftype enemy-attack-info (structure) ((attack-id uint32 :offset-assert 0) (knocked-type uint8 :offset-assert 4) (blue-juggle-count uint8 :offset-assert 5) (attacker-handle uint64 :offset-assert 8) - (attack-time time-frame :offset-assert 16) + (attack-time time-frame :offset-assert 16) (penetrate-using uint64 :offset-assert 24) (attacker-pos vector :inline :offset-assert 32) (attack-direction vector :inline :offset-assert 48) @@ -31028,9 +31165,7 @@ :size-assert #x40 :flag-assert #x900000040 ) -|# -#| (deftype enemy-best-focus (structure) ((proc basic :offset-assert 0) (rating float :offset-assert 4) @@ -31040,15 +31175,47 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype enemy (process-focusable) - () + ((enemy-flags enemy-flag :offset-assert 208) + (enemy-info symbol :offset-assert 216) + (hit-points int32 :offset-assert 220) + (gnd-collide uint32 :offset-assert 224) + (attack-id uint32 :offset-assert 228) + (persistent-attack-id uint32 :offset-assert 232) + (water-max-height float :offset-assert 236) + (water-surface-height float :offset-assert 240) + (desired-angle float :offset-assert 244) + (jump-why uint64 :offset-assert 248) + (penetrated-by-all uint64 :offset-assert 256) + (penetrated-flinch uint64 :offset-assert 264) + (penetrated-knocked uint64 :offset-assert 272) + (reaction-time uint64 :offset-assert 280) + (notice-time uint64 :offset-assert 288) + (state-timeout uint64 :offset-assert 296) + (auto-reset-penetrate-time uint64 :offset-assert 304) + (hit-focus-time uint64 :offset-assert 312) + (last-draw-time uint64 :offset-assert 320) + (starting-time uint64 :offset-assert 328) + (fated-time uint64 :offset-assert 336) + (focus-pos vector :inline :offset-assert 352) + (event-param-point vector :inline :offset-assert 368) + (jump-dest vector :inline :offset 368) + (focus enemy-focus :inline :offset-assert 384) + (incoming enemy-attack-info :inline :offset-assert 416) + (actor-group actor-group :offset-assert 480) + (actor-group-count int32 :offset-assert 484) + (neck symbol :offset-assert 488) + (on-notice symbol :offset-assert 492) + (on-active symbol :offset-assert 496) + (on-hostile symbol :offset-assert 500) + (on-death symbol :offset-assert 504) + (idle-anim-player idle-control :inline :offset-assert 512) + (rand-gen symbol :offset-assert 528) + ) :method-count-assert 137 :size-assert #x214 :flag-assert #x8901a00214 - ;; Failed to read fields. (:methods (enemy-method-27 () none 27) (enemy-method-28 () none 28) @@ -31162,7 +31329,6 @@ (enemy-method-136 () none 136) ) ) -|# #| (deftype anim-info (structure) @@ -34893,7 +35059,6 @@ ;; pegasus ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype pegasus-path-info (structure) ((num-data int32 :offset-assert 0) (path-data basic :offset-assert 4) @@ -34903,34 +35068,32 @@ :size-assert #xc :flag-assert #x90000000c ) -|# -#| (deftype pegasus (enemy) - ((curve-position float :offset-assert 528) - (speed float :offset-assert 532) - (facing vector :inline :offset-assert 540) - (tangent vector :inline :offset-assert 556) - (run-blend-interp float :offset-assert 572) - (near-timer int32 :offset-assert 576) - (far-time time-frame :offset-assert 580) - (y-offset float :offset-assert 588) - (y-offset-desired float :offset-assert 592) - (y-vel float :offset-assert 596) - (water-height float :offset-assert 600) - (timeout uint64 :offset-assert 604) - (ambient-possible uint64 :offset-assert 612) - (ambient-expire uint64 :offset-assert 620) - (can-run basic :offset-assert 628) - (on-ground basic :offset-assert 632) - (over-ground basic :offset-assert 636) - (allow-idle basic :offset-assert 640) - (path-info UNKNOWN 20 :offset-assert 644) - (previous-path int32 :offset-assert 964) - (current-path int32 :offset-assert 968) - (num-paths int32 :offset-assert 972) - (display-path int32 :offset-assert 976) - (targetted-timer uint64 :offset-assert 980) + ((curve-position float :offset-assert 532) + (speed float :offset-assert 536) + (facing vector :inline :offset-assert 544) + (tangent vector :inline :offset-assert 560) + (run-blend-interp float :offset-assert 576) + (near-timer int32 :offset-assert 580) + (far-time time-frame :offset-assert 584) + (y-offset float :offset-assert 592) + (y-offset-desired float :offset-assert 596) + (y-vel float :offset-assert 600) + (water-height float :offset-assert 604) + (timeout uint64 :offset-assert 608) + (ambient-possible uint64 :offset-assert 616) + (ambient-expire uint64 :offset-assert 624) + (can-run basic :offset-assert 632) + (on-ground basic :offset-assert 636) + (over-ground basic :offset-assert 640) + (allow-idle basic :offset-assert 644) + (path-info pegasus-path-info 20 :offset-assert 648) + (previous-path int32 :offset 968) + (current-path int32 :offset 972) + (num-paths int32 :offset 976) + (display-path int32 :offset 980) + (targetted-timer uint64 :offset 984) ) :method-count-assert 138 :size-assert #x3e0 @@ -34939,7 +35102,6 @@ (pegasus-method-137 () none 137) ) ) -|# ;; (define-extern *pegasus-enemy-info* enemy-info) ;; (define-extern pegasus-draw-section function) @@ -39242,11 +39404,10 @@ ) |# -#| (deftype grenade (projectile) - ((tumble-quat quaternion :inline :offset-assert 476) - (blast-radius float :offset-assert 492) - (end-target uint64 :offset-assert 500) + ((tumble-quat quaternion :inline :offset-assert 480) + (blast-radius float :offset-assert 496) + (end-target uint64 :offset-assert 504) ) :method-count-assert 42 :size-assert #x200 @@ -39256,7 +39417,6 @@ (grenade-method-41 () none 41) ) ) -|# #| (deftype drill-plat (strip-hazard) diff --git a/decompiler/config/jak2/anonymous_function_types.jsonc b/decompiler/config/jak2/anonymous_function_types.jsonc index cefe45c7c..be5e69079 100644 --- a/decompiler/config/jak2/anonymous_function_types.jsonc +++ b/decompiler/config/jak2/anonymous_function_types.jsonc @@ -341,5 +341,21 @@ 7, "(function process int symbol event-message-block object :behavior pov-camera)" ] + ], + "target-board": [ + [26, "(function surface surface surface int none)"], + [27, "(function surface surface surface int none :behavior target)"], + [28, "(function surface surface surface int none :behavior target)"], + [29, "(function surface surface surface int none :behavior target)"] + ], + "target": [ + [1, "(function none :behavior target)"], + [7, "(function none :behavior target)"], + [18, "(function target float :behavior target)"], + [28, "(function surface surface surface int float :behavior target)"], + [34, "(function surface object object int symbol :behavior target)"], + [44, "(function surface surface surface int none :behavior target)"], + [45, "(function surface object object int float :behavior target)"], + [76, "(function surface surface surface int float :behavior target)"] ] } diff --git a/decompiler/config/jak2/hacks.jsonc b/decompiler/config/jak2/hacks.jsonc index 215a9d629..696f4a306 100644 --- a/decompiler/config/jak2/hacks.jsonc +++ b/decompiler/config/jak2/hacks.jsonc @@ -120,7 +120,6 @@ "draw-inline-array-instance-shrub", // "reset-target-tracking", - "(anon-function 1 target)", "target-land-effect", "(method 12 effect-control)", "(method 11 effect-control)", diff --git a/decompiler/config/jak2/label_types.jsonc b/decompiler/config/jak2/label_types.jsonc index 1e793146e..896185eaa 100644 --- a/decompiler/config/jak2/label_types.jsonc +++ b/decompiler/config/jak2/label_types.jsonc @@ -209,5 +209,46 @@ ["L893", "uint64", true], ["L953", "uint64", true], ["L954", "uint64", true] - ] + ], + "board-states": [ + ["L653", "uint64", true], + ["L654", "uint64", true], + ["L655", "uint64", true], + ["L656", "uint64", true], + ["L657", "uint64", true], + ["L658", "uint64", true], + ["L659", "uint64", true], + ["L660", "uint64", true], + ["L661", "uint64", true], + ["L662", "uint64", true], + ["L663", "uint64", true], + ["L664", "uint64", true], + ["L665", "uint64", true], + ["L666", "uint64", true], + ["L667", "uint64", true], + ["L668", "uint64", true], + ["L669", "uint64", true] + ], + "target-board": [ + ["L505", "sound-spec"], + ["L509", "attack-info"], + ["L520", "(pointer uint64)", 1], + ["L521", "uint64", true], + ["L522", "(pointer uint64)", 1], + ["L523", "uint64", true], + ["L524", "uint64", true], + ["L525", "uint64", true], + ["L526", "uint64", true], + ["L527", "uint64", true] + ], + "target": [ + ["L785", "uint64", true], + ["L786", "uint64", true], + ["L787", "uint64", true], + ["L788", "uint64", true], + ["L789", "uint64", true], + ["L790", "uint64", true], + ["L791", "uint64", true] + ], + "target-gun": [["L595", "uint64", true]] } diff --git a/decompiler/config/jak2/stack_structures.jsonc b/decompiler/config/jak2/stack_structures.jsonc index fb40b2484..2111ed648 100644 --- a/decompiler/config/jak2/stack_structures.jsonc +++ b/decompiler/config/jak2/stack_structures.jsonc @@ -781,5 +781,131 @@ "(method 26 level-group)": [ [64, "vector"], [80, "vector"] - ] + ], + "(event target-board-halfpipe)": [[16, "vector"]], + "process-drawable-shock-effect": [[16, "matrix"]], + "(code target-board-get-on)": [[16, "event-message-block"]], + "(enter target-board-get-on)": [ + [16, "vector"], + [32, "vector"], + [48, "vector"], + [64, "vector"] + ], + "(enter target-board-get-off)": [ + [16, "vector"], + [32, "vector"] + ], + "(trans target-board-ride-edge)": [[16, "vector"]], + "target-board-compute-edge": [ + [16, "vector"], + [32, "vector"], + [128, "vector"] + ], + "target-board-spin-check": [ + [16, "vector"], + [32, "vector"] + ], + "(code target-board-hit)": [ + [16, "vector"], + [32, "vector"], + [48, "vector"], + [64, "vector"], + [80, "event-message-block"] + ], + "target-board-ground-check": [ + [16, "vector"], + [32, "event-message-block"] + ], + "(enter target-board-jump)": [ + [48, "vector"], + [64, "event-message-block"] + ], + "(trans target-board-halfpipe)": [ + // stack guess hang + [16, "vector"], + [32, "vector"], + [48, "vector"] + ], + "(enter target-board-halfpipe)": [ + // stack guess hang + [16, "vector"], + [32, "vector"], + [48, "vector"] + ], + "(enter target-board-grenade)": [[16, "vector"]], + "(enter target-board-turn-to)": [ + [16, "vector"], + [32, "vector"] + ], + "(code target-board-hold)": [ + [16, "vector"], + [32, "vector"] + ], + "(code target-board-flip)": [[16, "vector"]], + "(exit target-board-ride-edge)": [[32, "collide-query"]], + "(code target-board-trickx)": [[16, "vector"]], + "(method 9 board-info)": [[16, "event-message-block"]], + "init-var-jump": [ + [16, "event-message-block"], + [96, "vector"] + ], + "(post target-slide-down-to-ground)": [ + // stack guess hang + [16, "vector"], + [32, "vector"], + [48, "vector"], + [64, "vector"], + [80, "vector"] + ], + "(enter target-attack-air)": [ + // stack guess hang + [16, "vector"], + [32, "vector"], + [48, "vector"] + ], + "(event target-attack-uppercut-jump)": [ + // stack guess hang + [16, "vector"], + [32, "vector"], + [48, "vector"] + ], + "target-board-ride-post": [ + [48, "vector"], + [64, "vector"], + [80, "collide-query"] + ], + "probe-test": [[16, "collide-query"]], + "target-board-real-post": [ + [16, "vector"], + [128, "vector"] + ], + "board-add-thrust": [[16, "vector"]], + "target-board-collision": [ + [16, "vector"], + [32, "vector"] + ], + "(code target-roll-flip)": [ + [16, "vector"], + [32, "vector"] + ], + "(code target-flop)": [ + [16, "vector"], + [32, "vector"], + [48, "vector"] + ], + "(trans target-flop)": [[16, "event-message-block"]], + "(enter target-flop)": [[16, "vector"]], + "(code target-running-attack)": [[32, "collide-query"]], + "mod-var-jump": [ + [16, "vector"], + [32, "vector"] + ], + "(trans target-running-attack)": [ + [16, "vector"], + [32, "vector"], + [48, "vector"] + ], + "target-board-pre-move": [[112, "vector"]], + // placeholder + "placeholder-do-not-add-below": [] } diff --git a/decompiler/config/jak2/type_casts.jsonc b/decompiler/config/jak2/type_casts.jsonc index e2a9c19c4..55c991e2b 100644 --- a/decompiler/config/jak2/type_casts.jsonc +++ b/decompiler/config/jak2/type_casts.jsonc @@ -2321,9 +2321,7 @@ [[42, 46], "t2", "(pointer int8)"] ], "(method 14 drawable-tree-array)": [[11, "s5", "drawable-tree-array"]], - "upload-vis-bits": [ - [14, "a1", "(pointer uint128)"] - ], + "upload-vis-bits": [[14, "a1", "(pointer uint128)"]], "set-background-regs!": [ [42, "v1", "(pointer int32)"], [47, "v1", "(pointer int32)"], @@ -2339,19 +2337,13 @@ [941, "a3", "(pointer float)"], [974, "t3", "(pointer int32)"] ], - "(method 16 drawable-inline-array-node)": [ - [[1,7], "v1", "draw-node"] - ], + "(method 16 drawable-inline-array-node)": [[[1, 7], "v1", "draw-node"]], "(method 9 tfragment)": [ [27, "a3", "(pointer int32)"], [32, "t0", "texture"] ], - "add-tfrag-mtx-0": [ - [[3, 17], "a0", "dma-packet"] - ], - "add-tfrag-mtx-1": [ - [[3, 17], "a0", "dma-packet"] - ], + "add-tfrag-mtx-0": [[[3, 17], "a0", "dma-packet"]], + "add-tfrag-mtx-1": [[[3, 17], "a0", "dma-packet"]], "add-tfrag-data": [ [[3, 17], "a0", "dma-packet"], [[24, 31], "v1", "dma-packet"] @@ -2445,7 +2437,152 @@ "end-scan": [ [[18, 22], "v1", "dma-packet"] ], - + "(code target-board-jump)": [[17, "v1", "art-joint-anim"]], + "(code target-board-get-on)": [[55, "v1", "art-joint-anim"]], + "(code target-board-jump-kick)": [[15, "v1", "art-joint-anim"]], + "(code target-board-get-off)": [[78, "v1", "art-joint-anim"]], + "(code target-board-stance)": [[49, "v1", "art-joint-anim"]], + "(code target-board-wall-kick)": [ + [10, "v1", "art-joint-anim"], + [59, "f0", "float"] + ], + "(code target-board-pegasus)": [ + [32, "s4", "art-joint-anim"], + [68, "s4", "process-focusable"], + [85, "s4", "process-focusable"], + [149, "s4", "target"] + ], + "(code target-board-trickx)": [ + [81, "v1", "art-joint-anim"], + [149, "v1", "art-joint-anim"], + [218, "v1", "art-joint-anim"], + [301, "v1", "art-joint-anim"] + ], + "(code target-board-flip)": [ + [108, "v1", "art-joint-anim"], + [218, "v1", "art-joint-anim"], + [319, "v1", "art-joint-anim"], + [385, "v1", "art-joint-anim"] + ], + "(code target-board-hold)": [ + [100, "v1", "art-joint-anim"], + [227, "v1", "art-joint-anim"], + [415, "v1", "art-joint-anim"], + [485, "v1", "art-joint-anim"] + ], + "(code target-board-hit-ground)": [ + [77, "v1", "art-joint-anim"], + [147, "v1", "art-joint-anim"] + ], + "target-board-ground-check": [ + [205, "v1", "board"], + [265, "v1", "board"] + ], + "(enter target-board-jump)": [ + [174, "v1", "board"], + [231, "v1", "board"] + ], + "(trans target-board-ride-edge)": [[107, "v0", "sound-rpc-set-param"]], + "(enter target-board-flip)": [[78, "v0", "sound-rpc-set-param"]], + "target-board-anim-trans": [[192, "v0", "sound-rpc-set-param"]], + "(exit target-board-ride-edge)": [[8, "v0", "sound-rpc-set-param"]], + "(exit target-board-flip)": [[31, "v0", "sound-rpc-set-param"]], + "(exit target-board-hold)": [[9, "v0", "sound-rpc-set-param"]], + "(code target-board-hit)": [ + [304, "v1", "fact-info-target"], + [455, "v1", "fact-info-target"] + ], + "(code target-board-halfpipe)": [ + [173, "t9", "(function none :behavior target)"] + ], + "(event target-board-grab)": [[24, "a0", "process"]], + "(event target-board-halfpipe)": [[82, "v1", "float"]], + "talker-spawn-func": [ + [79, "a0", "talker"], + [82, "v1", "talker"], + [85, "v1", "talker"] + ], + "(method 9 board-info)": [ + [45, "a0", "fact-info-target"], + [55, "a0", "fact-info-target"] + ], + "target-board-real-post": [[346, "v0", "sound-rpc-set-param"]], + "target-board-effect": [[334, "v0", "sound-rpc-set-param"]], + "target-board-handler": [[123, "a0", "process"]], + "(trans target-flop-hit-ground)": [ + [52, "v1", "fact-info-target"], + [58, "v1", "fact-info-target"] + ], + "(code target-flop)": [[32, "v1", "art-joint-anim"]], + "(trans target-flop)": [ + [73, "v1", "fact-info-target"], + [79, "v1", "fact-info-target"], + [108, "v1", "fact-info-target"], + [114, "v1", "fact-info-target"], + [187, "v1", "fact-info-target"], + [193, "v1", "fact-info-target"] + ], + "(enter target-flop)": [ + [2, "v1", "fact-info-target"], + [8, "v1", "fact-info-target"] + ], + "(trans target-attack-uppercut-jump)": [ + [183, "v1", "fact-info-target"], + [189, "v1", "fact-info-target"] + ], + "(trans target-attack-air)": [ + [83, "v1", "fact-info-target"], + [89, "v1", "fact-info-target"] + ], + "(code target-running-attack)": [ + [115, "gp", "art-joint-anim"], + [398, "v1", "art-joint-anim"], + [426, "v1", "art-joint-anim"], + [454, "v1", "art-joint-anim"], + [542, "t1", "sound-name"], + [547, "t1", "sound-name"], + [557, "t1", "sound-name"], + [226, "f26", "float"], + [309, "f26", "float"] + ], + "(trans target-duck-high-jump-jump)": [[11, "v0", "sound-rpc-set-param"]], + "(code target-double-jump)": [ + [81, "v1", "art-joint-anim"], + [119, "v1", "art-joint-anim"] + ], + "(code target-jump-forward)": [[55, "v1", "art-joint-anim"]], + "(code target-falling)": [[67, "v1", "art-joint-anim"]], + "mod-var-jump": [ + [76, "f1", "float"], + [171, "v0", "vector"] + ], + "(code target-slide-down)": [[28, "v1", "art-joint-anim"]], + "(code target-duck-stance)": [ + [59, "v1", "art-joint-anim"], + [291, "v1", "art-joint-anim"], + [112, "v1", "art-joint-anim"], + [239, "v1", "art-joint-anim"] + ], + "(enter target-double-jump)": [[15, "v1", "vector"]], + "(enter target-jump)": [[42, "v1", "vector"]], + "(enter target-high-jump)": [[21, "v1", "vector"]], + "(code target-attack)": [ + [145, "gp", "art-joint-anim"], + [177, "v1", "fact-info-target"], + [183, "v1", "fact-info-target"] + ], + "(event target-running-attack)": [[48, "v1", "target"]], + "(trans target-running-attack)": [ + [211, "v1", "fact-info-target"], + [217, "v1", "fact-info-target"] + ], + "target-gun-end-mode": [[58, "v0", "sound-rpc-set-param"]], + "target-board-physics": [[167, "v0", "sound-rpc-set-param"]], + "clone-anim-once": [ + [[22, 69], "gp", "process-drawable"], + [46, "s5", "collide-shape"], + [107, "v1", "manipy"] + ], // placeholder "placeholder-do-not-add-below": [] } diff --git a/goal_src/jak2/engine/ambient/ambient-h.gc b/goal_src/jak2/engine/ambient/ambient-h.gc index abff5adc5..068c15d74 100644 --- a/goal_src/jak2/engine/ambient/ambient-h.gc +++ b/goal_src/jak2/engine/ambient/ambient-h.gc @@ -8,16 +8,16 @@ ;; DECOMP BEGINS (deftype talker-speech-class (structure) - ((name string :offset-assert 0) - (channel uint8 :offset-assert 4) - (flags uint8 :offset-assert 5) - (speech uint16 :offset-assert 6) - (text-message uint32 :offset-assert 8) - (text-duration uint16 :offset-assert 12) - (delay uint16 :offset-assert 14) - (pos uint16 :offset-assert 16) - (neg uint16 :offset-assert 18) - (on-close basic :offset-assert 20) + ((name string :offset-assert 0) + (channel gui-channel :offset-assert 4) + (flags uint8 :offset-assert 5) + (speech uint16 :offset-assert 6) + (text-message uint32 :offset-assert 8) + (text-duration uint16 :offset-assert 12) + (delay uint16 :offset-assert 14) + (pos uint16 :offset-assert 16) + (neg uint16 :offset-assert 18) + (on-close basic :offset-assert 20) ) :pack-me :method-count-assert 14 @@ -52,7 +52,7 @@ :size-assert #xd4 :flag-assert #x12006000d4 (:methods - (talker-method-14 () none 14) + (talker-method-14 () _type_ :state 14) (talker-method-15 () none 15) (talker-method-16 () none 16) (talker-method-17 () none 17) @@ -60,937 +60,1609 @@ ) -(define *talker-speech* - (the-as talker-speech-class - (new 'static 'inline-array talker-speech-class 188 - (new 'static 'talker-speech-class :name "none") - (new 'static 'talker-speech-class :name "hal001" :channel #x1d :flags #x3 :speech #x1 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "hal002" :channel #x1d :flags #x3 :speech #x2 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "DSbop002" - :channel #x14 - :flags #x3 - :speech #x3 - :text-message #x224 - :text-duration #x5dc - :neg #x1 - :on-close #f +(define *talker-speech* (new 'static 'inline-array talker-speech-class 188 + (new 'static 'talker-speech-class :name "none") + (new 'static 'talker-speech-class + :name "hal001" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x1 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "hal002" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x2 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSbop002" + :channel (gui-channel daxter) + :flags #x3 + :speech #x3 + :text-message #x224 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSbop004" + :channel (gui-channel daxter) + :flags #x3 + :speech #x4 + :text-message #x226 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSbop008" + :channel (gui-channel daxter) + :flags #x3 + :speech #x5 + :text-message #x227 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSbop009" + :channel (gui-channel daxter) + :flags #x3 + :speech #x6 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSbop010" + :channel (gui-channel daxter) + :flags #x3 + :speech #x7 + :text-message #x227 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSbop011" + :channel (gui-channel daxter) + :flags #x3 + :speech #x8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSbop016" + :channel (gui-channel daxter) + :flags #x3 + :speech #x9 + :text-message #x229 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSbop017" + :channel (gui-channel daxter) + :flags #x3 + :speech #xa + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds020" + :channel (gui-channel daxter) + :flags #x3 + :speech #xb + :text-message #x225 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds043" + :channel (gui-channel daxter) + :flags #x11 + :speech #xc + :text-message #x228 + :text-duration #x12c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds043m" + :channel (gui-channel message) + :flags #x10 + :speech #xd + :text-message #x228 + :text-duration #x12c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds046" + :channel (gui-channel daxter) + :flags #x11 + :speech #xe + :text-message #x22a + :text-duration #x12c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds046m" + :channel (gui-channel message) + :flags #x10 + :speech #xf + :text-message #x22a + :text-duration #x12c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds162" + :channel (gui-channel daxter) + :flags #x3 + :speech #x10 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds165" + :channel (gui-channel daxter) + :flags #x3 + :speech #x11 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv039" + :channel (gui-channel alert) + :flags #x3 + :speech #x12 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv037" + :channel (gui-channel alert) + :flags #x3 + :speech #x13 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv056" + :channel (gui-channel alert) + :flags #x3 + :speech #x14 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv054" + :channel (gui-channel alert) + :flags #x3 + :speech #x15 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv055" + :channel (gui-channel alert) + :flags #x3 + :speech #x16 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv107" + :channel (gui-channel alert) + :flags #x3 + :speech #x17 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kg100a" + :channel (gui-channel alert) + :flags #x3 + :speech #x18 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kg104a" + :channel (gui-channel alert) + :flags #x3 + :speech #x19 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kg102a" + :channel (gui-channel alert) + :flags #x3 + :speech #x1a + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kg071a" + :channel (gui-channel alert) + :flags #x3 + :speech #x1b + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kg107a" + :channel (gui-channel alert) + :flags #x3 + :speech #x1c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kg097a" + :channel (gui-channel alert) + :flags #x3 + :speech #x1d + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kg098a" + :channel (gui-channel alert) + :flags #x3 + :speech #x1e + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv063" + :channel (gui-channel alert) + :speech #x1f + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv064" + :channel (gui-channel alert) + :speech #x20 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv065" + :channel (gui-channel alert) + :speech #x21 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv067" + :channel (gui-channel alert) + :speech #x22 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv068" + :channel (gui-channel alert) + :speech #x23 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv069" + :channel (gui-channel alert) + :speech #x24 + :text-message #x246 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv070" + :channel (gui-channel alert) + :speech #x25 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv130" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x26 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv132" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x27 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv071" + :channel (gui-channel alert) + :speech #x28 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv072" + :channel (gui-channel alert) + :speech #x29 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv073" + :channel (gui-channel alert) + :speech #x2a + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv074" + :channel (gui-channel alert) + :speech #x2b + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv075" + :channel (gui-channel alert) + :speech #x2c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv076" + :channel (gui-channel alert) + :speech #x2d + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv077" + :channel (gui-channel alert) + :speech #x2e + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv078" + :channel (gui-channel alert) + :speech #x2f + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv036" + :channel (gui-channel alert) + :speech #x30 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "tor007" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x31 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "tor008" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x32 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "mess004" + :channel (gui-channel message) + :flags #x7 + :speech #x33 + :text-message #x245 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "krew010" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x34 + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds129" + :channel (gui-channel daxter) + :flags #x2 + :speech #x35 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "mess005" + :channel (gui-channel message) + :flags #x3 + :speech #x36 + :text-message #x247 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "mess006" + :channel (gui-channel message) + :speech #x37 + :text-message #x226 + :text-duration #x5dc + :pos #x8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds116" + :channel (gui-channel daxter) + :flags #x2 + :speech #x38 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds117" + :channel (gui-channel daxter) + :flags #x3 + :speech #x39 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds118" + :channel (gui-channel daxter) + :flags #x3 + :speech #x3a + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds119" + :channel (gui-channel daxter) + :flags #x3 + :speech #x3b + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds120" + :channel (gui-channel daxter) + :flags #x3 + :speech #x3c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds121" + :channel (gui-channel daxter) + :flags #x3 + :speech #x3d + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "daxm007" + :channel (gui-channel daxter) + :flags #x3 + :speech #x3e + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "daxm008" + :channel (gui-channel daxter) + :flags #x3 + :speech #x3f + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "daxm009" + :channel (gui-channel daxter) + :flags #x3 + :speech #x40 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "daxm010" + :channel (gui-channel daxter) + :flags #x3 + :speech #x41 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek001" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x42 + :delay #x4b0 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds006" + :channel (gui-channel daxter) + :flags #x3 + :speech #x43 + :delay #xbb8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds029" + :channel (gui-channel daxter) + :flags #x2 + :speech #x44 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds030" + :channel (gui-channel daxter) + :flags #x2 + :speech #x45 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds031" + :channel (gui-channel daxter) + :flags #x2 + :speech #x46 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds032" + :channel (gui-channel daxter) + :flags #x2 + :speech #x47 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds007" + :channel (gui-channel daxter) + :flags #x3 + :speech #x48 + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds372" + :channel (gui-channel daxter) + :flags #x3 + :speech #x49 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "vin011" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x4a + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds009" + :channel (gui-channel daxter) + :flags #x3 + :speech #x4b + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "demo001" + :channel (gui-channel message) + :flags #x3 + :speech #x4c + :text-message #x23d + :text-duration #xbb8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "demo002" + :channel (gui-channel message) + :flags #x3 + :speech #x4d + :text-message #x22b + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "demo003" + :channel (gui-channel message) + :flags #x3 + :speech #x4e + :text-message #x252 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "demo004" + :channel (gui-channel message) + :flags #x3 + :speech #x4f + :text-message #x253 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "demo005" + :channel (gui-channel message) + :flags #x3 + :speech #x50 + :text-message #x226 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kei026" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x51 + :delay #x1770 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kei018" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x52 + :text-message #x241 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSfor001" + :channel (gui-channel daxter) + :flags #x3 + :speech #x53 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds017" + :channel (gui-channel daxter) + :flags #x3 + :speech #x54 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds018" + :channel (gui-channel daxter) + :flags #x3 + :speech #x55 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds019" + :channel (gui-channel daxter) + :flags #x3 + :speech #x56 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds350" + :channel (gui-channel daxter) + :flags #x2 + :speech #x57 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds016" + :channel (gui-channel daxter) + :flags #x3 + :speech #x58 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "sigf001" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x59 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ys001" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x5a + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds151" + :channel (gui-channel daxter) + :flags #x7 + :speech #x5b + :text-message #x239 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "vin002" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x5c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "krew001" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x5d + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "krew002" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x5e + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds005" + :channel (gui-channel daxter) + :flags #x3 + :speech #x5f + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "bru001" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x60 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "tor001" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x61 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "tor002" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x62 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "vin003" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x63 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "vin004" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x64 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kor001" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x65 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kor002" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x66 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "tess001" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x67 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "whack01" + :channel (gui-channel message) + :speech #x68 + :text-message #x24e + :text-duration #xbb8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "vin015" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x69 + :delay #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kei029" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x6a + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "tor005" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x6b + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "vin013" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x6c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "asht006" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x6d + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek002" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x6e + :delay #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "test001" + :channel (gui-channel message) + :speech #x6f + :text-message #x23d + :text-duration #x2328 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "sam001" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x70 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "asht001" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x71 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "str001" + :channel (gui-channel message) + :flags #x3 + :speech #x72 + :text-message #x239 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "str002" + :channel (gui-channel message) + :speech #x73 + :text-message #x239 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "note001" + :channel (gui-channel notice) + :speech #x74 + :text-message #x239 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ys002" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x75 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro01" + :channel (gui-channel notice) + :flags #x20 + :speech #x76 + :text-message #x254 + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro01e" + :channel (gui-channel notice) + :flags #x20 + :speech #x77 + :text-message #x255 + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro01j" + :channel (gui-channel notice) + :flags #x20 + :speech #x78 + :text-message #x257 + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro01k" + :channel (gui-channel notice) + :flags #x20 + :speech #x79 + :text-message #x256 + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro02" + :channel (gui-channel notice) + :flags #xa0 + :speech #x7a + :text-message #x258 + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro03" + :channel (gui-channel notice-low) + :speech #x7b + :text-message #x30c + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro04" + :channel (gui-channel notice) + :flags #x20 + :speech #x7c + :text-message #x25a + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss001" + :channel (gui-channel alert) + :flags #x40 + :speech #x7d + :text-message #x25c + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss002" + :channel (gui-channel alert) + :flags #x40 + :speech #x7e + :text-message #x261 + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss003" + :channel (gui-channel alert) + :flags #x40 + :speech #x7f + :text-message #x262 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss004" + :channel (gui-channel alert) + :flags #x40 + :speech #x80 + :text-message #x263 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss005" + :channel (gui-channel alert) + :flags #x40 + :speech #x81 + :text-message #x264 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss006" + :channel (gui-channel alert) + :flags #x40 + :speech #x82 + :text-message #x265 + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss007" + :channel (gui-channel alert) + :flags #x40 + :speech #x83 + :text-message #x266 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss008" + :channel (gui-channel alert) + :flags #x40 + :speech #x84 + :text-message #x267 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss009" + :channel (gui-channel alert) + :flags #x40 + :speech #x85 + :text-message #x268 + :text-duration #x5dc + :delay #xbb8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss010" + :channel (gui-channel alert) + :flags #x40 + :speech #x86 + :text-message #x269 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss011" + :channel (gui-channel alert) + :flags #x40 + :speech #x87 + :text-message #x25d + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss012" + :channel (gui-channel alert) + :flags #x40 + :speech #x88 + :text-message #x25e + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss013" + :channel (gui-channel alert) + :flags #x40 + :speech #x89 + :text-message #x25f + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss014" + :channel (gui-channel alert) + :flags #x40 + :speech #x8a + :text-message #x260 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "krew003" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x8b + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek010" + :channel (gui-channel daxter) + :flags #x1 + :speech #x8c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek011" + :channel (gui-channel daxter) + :flags #x1 + :speech #x8d + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek012" + :channel (gui-channel daxter) + :flags #x1 + :speech #x8e + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek013" + :channel (gui-channel daxter) + :flags #x1 + :speech #x8f + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek014" + :channel (gui-channel daxter) + :flags #x1 + :speech #x90 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek015" + :channel (gui-channel daxter) + :speech #x91 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek016" + :channel (gui-channel daxter) + :flags #x1 + :speech #x92 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek017" + :channel (gui-channel daxter) + :flags #x1 + :speech #x93 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek018" + :channel (gui-channel daxter) + :flags #x1 + :speech #x94 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek019" + :channel (gui-channel daxter) + :flags #x1 + :speech #x95 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek020" + :channel (gui-channel daxter) + :flags #x1 + :speech #x96 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek021" + :channel (gui-channel daxter) + :flags #x1 + :speech #x97 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek022" + :channel (gui-channel daxter) + :flags #x1 + :speech #x98 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek023" + :channel (gui-channel daxter) + :flags #x1 + :speech #x99 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek024" + :channel (gui-channel daxter) + :flags #x1 + :speech #x9a + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek026" + :channel (gui-channel daxter) + :flags #x1 + :speech #x9b + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek027" + :channel (gui-channel daxter) + :flags #x1 + :speech #x9c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek028" + :channel (gui-channel daxter) + :flags #x1 + :speech #x9d + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek029" + :channel (gui-channel daxter) + :flags #x1 + :speech #x9e + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek030" + :channel (gui-channel daxter) + :flags #x1 + :speech #x9f + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek031" + :channel (gui-channel daxter) + :flags #x1 + :speech #xa0 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek033" + :channel (gui-channel daxter) + :speech #xa1 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek034" + :channel (gui-channel daxter) + :speech #xa2 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek035" + :channel (gui-channel daxter) + :speech #xa3 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek036" + :channel (gui-channel daxter) + :speech #xa4 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek037" + :channel (gui-channel daxter) + :speech #xa5 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek038" + :channel (gui-channel daxter) + :speech #xa6 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek039" + :channel (gui-channel daxter) + :speech #xa7 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek040" + :channel (gui-channel daxter) + :speech #xa8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek041" + :channel (gui-channel daxter) + :speech #xa9 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora006" + :channel (gui-channel alert) + :speech #xaa + :text-message #x26e + :text-duration #x5dc + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora007" + :channel (gui-channel alert) + :speech #xab + :text-message #x26e + :text-duration #x5dc + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora008" + :channel (gui-channel alert) + :speech #xac + :text-message #x26e + :text-duration #x5dc + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora009" + :channel (gui-channel alert) + :speech #xad + :text-message #x26f + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora010" + :channel (gui-channel alert) + :speech #xae + :text-message #x270 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora015" + :channel (gui-channel alert) + :speech #xaf + :text-message #x271 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora016" + :channel (gui-channel alert) + :speech #xb0 + :text-message #x272 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "notice01" + :channel (gui-channel notice-low) + :speech #xb1 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "notice02" + :channel (gui-channel notice-low) + :speech #xb2 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "notice03" + :channel (gui-channel notice-low) + :speech #xb3 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "notice04" + :channel (gui-channel notice-low) + :speech #xb4 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kor004" + :channel (gui-channel voicebox) + :flags #x3 + :speech #xb5 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv080" + :channel (gui-channel alert) + :flags #x2 + :speech #xb6 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds395" + :channel (gui-channel alert) + :flags #x2 + :speech #xb7 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "bru002" + :channel (gui-channel voicebox) + :flags #x3 + :speech #xb8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "bru004" + :channel (gui-channel voicebox) + :flags #x7 + :speech #xb9 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "bb01int" + :channel (gui-channel bbush) + :flags #x2 + :speech #xba + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "bb01fail" + :channel (gui-channel voicebox) + :flags #x2 + :speech #xbb + :neg #x1 + :on-close #f + ) + ) ) - (new 'static 'talker-speech-class - :name "DSbop004" - :channel #x14 - :flags #x3 - :speech #x4 - :text-message #x226 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "DSbop008" - :channel #x14 - :flags #x3 - :speech #x5 - :text-message #x227 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "DSbop009" :channel #x14 :flags #x3 :speech #x6 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "DSbop010" - :channel #x14 - :flags #x3 - :speech #x7 - :text-message #x227 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "DSbop011" :channel #x14 :flags #x3 :speech #x8 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "DSbop016" - :channel #x14 - :flags #x3 - :speech #x9 - :text-message #x229 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "DSbop017" :channel #x14 :flags #x3 :speech #xa :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "ds020" - :channel #x14 - :flags #x3 - :speech #xb - :text-message #x225 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ds043" - :channel #x14 - :flags #x11 - :speech #xc - :text-message #x228 - :text-duration #x12c - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ds043m" - :channel #x43 - :flags #x10 - :speech #xd - :text-message #x228 - :text-duration #x12c - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ds046" - :channel #x14 - :flags #x11 - :speech #xe - :text-message #x22a - :text-duration #x12c - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ds046m" - :channel #x43 - :flags #x10 - :speech #xf - :text-message #x22a - :text-duration #x12c - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "ds162" :channel #x14 :flags #x3 :speech #x10 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds165" :channel #x14 :flags #x3 :speech #x11 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "cityv039" - :channel #x20 - :flags #x3 - :speech #x12 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "cityv037" - :channel #x20 - :flags #x3 - :speech #x13 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "cityv056" - :channel #x20 - :flags #x3 - :speech #x14 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "cityv054" - :channel #x20 - :flags #x3 - :speech #x15 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "cityv055" - :channel #x20 - :flags #x3 - :speech #x16 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "cityv107" - :channel #x20 - :flags #x3 - :speech #x17 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "kg100a" :channel #x20 :flags #x3 :speech #x18 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "kg104a" :channel #x20 :flags #x3 :speech #x19 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "kg102a" :channel #x20 :flags #x3 :speech #x1a :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "kg071a" :channel #x20 :flags #x3 :speech #x1b :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "kg107a" :channel #x20 :flags #x3 :speech #x1c :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "kg097a" :channel #x20 :flags #x3 :speech #x1d :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "kg098a" :channel #x20 :flags #x3 :speech #x1e :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv063" :channel #x20 :speech #x1f :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv064" :channel #x20 :speech #x20 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv065" :channel #x20 :speech #x21 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv067" :channel #x20 :speech #x22 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv068" :channel #x20 :speech #x23 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "cityv069" - :channel #x20 - :speech #x24 - :text-message #x246 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "cityv070" :channel #x20 :speech #x25 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "cityv130" - :channel #x1d - :flags #x3 - :speech #x26 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "cityv132" - :channel #x1d - :flags #x3 - :speech #x27 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "cityv071" :channel #x20 :speech #x28 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv072" :channel #x20 :speech #x29 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv073" :channel #x20 :speech #x2a :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv074" :channel #x20 :speech #x2b :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv075" :channel #x20 :speech #x2c :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv076" :channel #x20 :speech #x2d :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv077" :channel #x20 :speech #x2e :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv078" :channel #x20 :speech #x2f :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv036" :channel #x20 :speech #x30 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "tor007" :channel #x1d :flags #x3 :speech #x31 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "tor008" :channel #x1d :flags #x3 :speech #x32 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "mess004" - :channel #x43 - :flags #x7 - :speech #x33 - :text-message #x245 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "krew010" - :channel #x1d - :flags #x7 - :speech #x34 - :delay #x258 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "ds129" :channel #x14 :flags #x2 :speech #x35 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "mess005" - :channel #x43 - :flags #x3 - :speech #x36 - :text-message #x247 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "mess006" - :channel #x43 - :speech #x37 - :text-message #x226 - :text-duration #x5dc - :pos #x8 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "ds116" :channel #x14 :flags #x2 :speech #x38 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds117" :channel #x14 :flags #x3 :speech #x39 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds118" :channel #x14 :flags #x3 :speech #x3a :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds119" :channel #x14 :flags #x3 :speech #x3b :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds120" :channel #x14 :flags #x3 :speech #x3c :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds121" :channel #x14 :flags #x3 :speech #x3d :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "daxm007" :channel #x14 :flags #x3 :speech #x3e :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "daxm008" :channel #x14 :flags #x3 :speech #x3f :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "daxm009" :channel #x14 :flags #x3 :speech #x40 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "daxm010" :channel #x14 :flags #x3 :speech #x41 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "pek001" - :channel #x1d - :flags #x3 - :speech #x42 - :delay #x4b0 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ds006" - :channel #x14 - :flags #x3 - :speech #x43 - :delay #xbb8 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "ds029" :channel #x14 :flags #x2 :speech #x44 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds030" :channel #x14 :flags #x2 :speech #x45 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds031" :channel #x14 :flags #x2 :speech #x46 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds032" :channel #x14 :flags #x2 :speech #x47 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "ds007" - :channel #x14 - :flags #x3 - :speech #x48 - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "ds372" :channel #x14 :flags #x3 :speech #x49 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "vin011" - :channel #x1d - :flags #x3 - :speech #x4a - :delay #x258 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "ds009" :channel #x14 :flags #x3 :speech #x4b :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "demo001" - :channel #x43 - :flags #x3 - :speech #x4c - :text-message #x23d - :text-duration #xbb8 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "demo002" - :channel #x43 - :flags #x3 - :speech #x4d - :text-message #x22b - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "demo003" - :channel #x43 - :flags #x3 - :speech #x4e - :text-message #x252 - :text-duration #x960 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "demo004" - :channel #x43 - :flags #x3 - :speech #x4f - :text-message #x253 - :text-duration #x960 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "demo005" - :channel #x43 - :flags #x3 - :speech #x50 - :text-message #x226 - :text-duration #x960 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "kei026" - :channel #x1d - :flags #x3 - :speech #x51 - :delay #x1770 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "kei018" - :channel #x1d - :flags #x3 - :speech #x52 - :text-message #x241 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "DSfor001" - :channel #x14 - :flags #x3 - :speech #x53 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "ds017" :channel #x14 :flags #x3 :speech #x54 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds018" :channel #x14 :flags #x3 :speech #x55 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds019" :channel #x14 :flags #x3 :speech #x56 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds350" :channel #x14 :flags #x2 :speech #x57 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds016" :channel #x14 :flags #x3 :speech #x58 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "sigf001" :channel #x1d :flags #x7 :speech #x59 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "ys001" - :channel #x1d - :flags #x7 - :speech #x5a - :delay #x708 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ds151" - :channel #x14 - :flags #x7 - :speech #x5b - :text-message #x239 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "vin002" :channel #x1d :flags #x7 :speech #x5c :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "krew001" :channel #x1d :flags #x3 :speech #x5d :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "krew002" - :channel #x1d - :flags #x7 - :speech #x5e - :delay #x258 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "ds005" :channel #x14 :flags #x3 :speech #x5f :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "bru001" :channel #x1d :flags #x3 :speech #x60 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "tor001" - :channel #x1d - :flags #x7 - :speech #x61 - :delay #x708 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "tor002" - :channel #x1d - :flags #x7 - :speech #x62 - :delay #x708 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "vin003" - :channel #x1d - :flags #x7 - :speech #x63 - :delay #x708 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "vin004" - :channel #x1d - :flags #x3 - :speech #x64 - :delay #x708 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "kor001" - :channel #x1d - :flags #x7 - :speech #x65 - :delay #x708 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "kor002" - :channel #x1d - :flags #x7 - :speech #x66 - :delay #x708 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "tess001" :channel #x1d :flags #x7 :speech #x67 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "whack01" - :channel #x43 - :speech #x68 - :text-message #x24e - :text-duration #xbb8 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "vin015" - :channel #x1d - :flags #x7 - :speech #x69 - :delay #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "kei029" :channel #x1d :flags #x7 :speech #x6a :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "tor005" :channel #x1d :flags #x7 :speech #x6b :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "vin013" :channel #x1d :flags #x7 :speech #x6c :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "asht006" :channel #x1d :flags #x7 :speech #x6d :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "pek002" - :channel #x1d - :flags #x3 - :speech #x6e - :delay #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "test001" - :channel #x43 - :speech #x6f - :text-message #x23d - :text-duration #x2328 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "sam001" :channel #x1d :flags #x3 :speech #x70 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "asht001" - :channel #x1d - :flags #x3 - :speech #x71 - :delay #x708 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "str001" - :channel #x43 - :flags #x3 - :speech #x72 - :text-message #x239 - :text-duration #x960 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "str002" - :channel #x43 - :speech #x73 - :text-message #x239 - :text-duration #x960 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "note001" - :channel #x44 - :speech #x74 - :text-message #x239 - :text-duration #x960 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "ys002" :channel #x1d :flags #x3 :speech #x75 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "intro01" - :channel #x44 - :flags #x20 - :speech #x76 - :text-message #x254 - :text-duration #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "intro01e" - :channel #x44 - :flags #x20 - :speech #x77 - :text-message #x255 - :text-duration #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "intro01j" - :channel #x44 - :flags #x20 - :speech #x78 - :text-message #x257 - :text-duration #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "intro01k" - :channel #x44 - :flags #x20 - :speech #x79 - :text-message #x256 - :text-duration #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "intro02" - :channel #x44 - :flags #xa0 - :speech #x7a - :text-message #x258 - :text-duration #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "intro03" - :channel #x47 - :speech #x7b - :text-message #x30c - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "intro04" - :channel #x44 - :flags #x20 - :speech #x7c - :text-message #x25a - :text-duration #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss001" - :channel #x20 - :flags #x40 - :speech #x7d - :text-message #x25c - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss002" - :channel #x20 - :flags #x40 - :speech #x7e - :text-message #x261 - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss003" - :channel #x20 - :flags #x40 - :speech #x7f - :text-message #x262 - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss004" - :channel #x20 - :flags #x40 - :speech #x80 - :text-message #x263 - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss005" - :channel #x20 - :flags #x40 - :speech #x81 - :text-message #x264 - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss006" - :channel #x20 - :flags #x40 - :speech #x82 - :text-message #x265 - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss007" - :channel #x20 - :flags #x40 - :speech #x83 - :text-message #x266 - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss008" - :channel #x20 - :flags #x40 - :speech #x84 - :text-message #x267 - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss009" - :channel #x20 - :flags #x40 - :speech #x85 - :text-message #x268 - :text-duration #x5dc - :delay #xbb8 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss010" - :channel #x20 - :flags #x40 - :speech #x86 - :text-message #x269 - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss011" - :channel #x20 - :flags #x40 - :speech #x87 - :text-message #x25d - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss012" - :channel #x20 - :flags #x40 - :speech #x88 - :text-message #x25e - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss013" - :channel #x20 - :flags #x40 - :speech #x89 - :text-message #x25f - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss014" - :channel #x20 - :flags #x40 - :speech #x8a - :text-message #x260 - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "krew003" - :channel #x1d - :flags #x3 - :speech #x8b - :delay #x708 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "pek010" :channel #x14 :flags #x1 :speech #x8c :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek011" :channel #x14 :flags #x1 :speech #x8d :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek012" :channel #x14 :flags #x1 :speech #x8e :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek013" :channel #x14 :flags #x1 :speech #x8f :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek014" :channel #x14 :flags #x1 :speech #x90 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek015" :channel #x14 :speech #x91 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek016" :channel #x14 :flags #x1 :speech #x92 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek017" :channel #x14 :flags #x1 :speech #x93 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek018" :channel #x14 :flags #x1 :speech #x94 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek019" :channel #x14 :flags #x1 :speech #x95 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek020" :channel #x14 :flags #x1 :speech #x96 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek021" :channel #x14 :flags #x1 :speech #x97 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek022" :channel #x14 :flags #x1 :speech #x98 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek023" :channel #x14 :flags #x1 :speech #x99 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek024" :channel #x14 :flags #x1 :speech #x9a :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek026" :channel #x14 :flags #x1 :speech #x9b :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek027" :channel #x14 :flags #x1 :speech #x9c :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek028" :channel #x14 :flags #x1 :speech #x9d :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek029" :channel #x14 :flags #x1 :speech #x9e :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek030" :channel #x14 :flags #x1 :speech #x9f :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek031" :channel #x14 :flags #x1 :speech #xa0 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek033" :channel #x14 :speech #xa1 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek034" :channel #x14 :speech #xa2 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek035" :channel #x14 :speech #xa3 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek036" :channel #x14 :speech #xa4 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek037" :channel #x14 :speech #xa5 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek038" :channel #x14 :speech #xa6 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek039" :channel #x14 :speech #xa7 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek040" :channel #x14 :speech #xa8 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek041" :channel #x14 :speech #xa9 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "ora006" - :channel #x20 - :speech #xaa - :text-message #x26e - :text-duration #x5dc - :delay #x258 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ora007" - :channel #x20 - :speech #xab - :text-message #x26e - :text-duration #x5dc - :delay #x258 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ora008" - :channel #x20 - :speech #xac - :text-message #x26e - :text-duration #x5dc - :delay #x258 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ora009" - :channel #x20 - :speech #xad - :text-message #x26f - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ora010" - :channel #x20 - :speech #xae - :text-message #x270 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ora015" - :channel #x20 - :speech #xaf - :text-message #x271 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ora016" - :channel #x20 - :speech #xb0 - :text-message #x272 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "notice01" - :channel #x47 - :speech #xb1 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "notice02" - :channel #x47 - :speech #xb2 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "notice03" - :channel #x47 - :speech #xb3 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "notice04" - :channel #x47 - :speech #xb4 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "kor004" :channel #x1d :flags #x3 :speech #xb5 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "cityv080" - :channel #x20 - :flags #x2 - :speech #xb6 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "ds395" :channel #x20 :flags #x2 :speech #xb7 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "bru002" :channel #x1d :flags #x3 :speech #xb8 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "bru004" :channel #x1d :flags #x7 :speech #xb9 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "bb01int" :channel #x22 :flags #x2 :speech #xba :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "bb01fail" - :channel #x1d - :flags #x2 - :speech #xbb - :neg #x1 - :on-close #f - ) - ) - ) - ) (define-extern talker-surpress! (function none)) diff --git a/goal_src/jak2/engine/anim/aligner-h.gc b/goal_src/jak2/engine/anim/aligner-h.gc index 876ae8485..0d05285bc 100644 --- a/goal_src/jak2/engine/anim/aligner-h.gc +++ b/goal_src/jak2/engine/anim/aligner-h.gc @@ -9,6 +9,11 @@ :bitfield #t :type uint32 (disabled) ;; keep object velocity + (af01) + (af02) + (af03) + (af04) + (af05) ) (defenum align-opts diff --git a/goal_src/jak2/engine/anim/joint-h.gc b/goal_src/jak2/engine/anim/joint-h.gc index bc5d5f0d4..881508abb 100644 --- a/goal_src/jak2/engine/anim/joint-h.gc +++ b/goal_src/jak2/engine/anim/joint-h.gc @@ -54,34 +54,34 @@ (deftype top-anim-joint-control (basic) - ((process uint32 :offset-assert 4) - (interp-select uint64 2 :offset-assert 8) - (base-anim basic :offset-assert 24) - (base-anim-speed float :offset-assert 28) - (base-anim-blend float :offset-assert 32) - (interp float :offset-assert 36) - (frame-group art-joint-anim :offset-assert 40) - (frame-group-push basic :offset-assert 44) - (frame-num float :offset-assert 48) - (frame-targ basic :offset-assert 52) - (frame-speed float :offset-assert 56) - (frame-blend float :offset-assert 60) - (frame-cur-blend float :offset-assert 64) - (frame-start float :offset-assert 68) - (frame-post-blend float :offset-assert 72) - (frame-post-end float :offset-assert 76) - (frame-push-time time-frame :offset-assert 80) - (frame-post-put-away basic :offset-assert 88) - (update-time time-frame :offset-assert 96) + ((process (pointer process-drawable) :offset-assert 4) + (interp-select uint64 2 :offset-assert 8) + (base-anim basic :offset-assert 24) + (base-anim-speed float :offset-assert 28) + (base-anim-blend float :offset-assert 32) + (interp float :offset-assert 36) + (frame-group art-joint-anim :offset-assert 40) + (frame-group-push basic :offset-assert 44) + (frame-num float :offset-assert 48) + (frame-targ basic :offset-assert 52) + (frame-speed float :offset-assert 56) + (frame-blend float :offset-assert 60) + (frame-cur-blend float :offset-assert 64) + (frame-start float :offset-assert 68) + (frame-post-blend float :offset-assert 72) + (frame-post-end float :offset-assert 76) + (frame-push-time time-frame :offset-assert 80) + (frame-post-put-away basic :offset-assert 88) + (update-time time-frame :offset-assert 96) ) :method-count-assert 13 :size-assert #x68 :flag-assert #xd00000068 (:methods - (top-anim-joint-control-method-9 () none 9) - (top-anim-joint-control-method-10 () none 10) - (top-anim-joint-control-method-11 () none 11) - (top-anim-joint-control-method-12 () none 12) + (top-anim-joint-control-method-9 (_type_) none 9) + (top-anim-joint-control-method-10 (_type_) none 10) + (top-anim-joint-control-method-11 (_type_ int) joint-control-channel 11) + (top-anim-joint-control-method-12 (_type_ art-element float int int float float symbol) none 12) ) ) diff --git a/goal_src/jak2/engine/collide/collide-shape-h.gc b/goal_src/jak2/engine/collide/collide-shape-h.gc index 13d1c407d..035f0808a 100644 --- a/goal_src/jak2/engine/collide/collide-shape-h.gc +++ b/goal_src/jak2/engine/collide/collide-shape-h.gc @@ -8,6 +8,7 @@ (declare-type collide-shape trsqv) (declare-type collide-shape-moving collide-shape) (declare-type touching-list structure) +(declare-type collide-query structure) (defenum penetrate :bitfield #t @@ -458,7 +459,7 @@ (collide-shape-method-29 (_type_ vector) none 29) (collide-shape-method-30 () none 30) (collide-shape-method-31 () none 31) - (collide-shape-method-32 (_type_ vector uint int) none 32) + (collide-shape-method-32 (_type_ vector collide-query meters) none 32) (collide-shape-method-33 () none 33) (collide-shape-method-34 () none 34) (collide-shape-method-35 () none 35) @@ -518,7 +519,7 @@ :flag-assert #x44000001dc (:methods (new (symbol type process-drawable collide-list-enum) _type_ 0) - (collide-shape-moving-method-55 (_type_) symbol 55) + (collide-shape-moving-method-55 (_type_ collide-query collide-spec float float float) symbol 55) (collide-shape-moving-method-56 () none 56) (collide-shape-moving-method-57 () none 57) (collide-shape-moving-method-58 () none 58) diff --git a/goal_src/jak2/engine/collide/collide-target-h.gc b/goal_src/jak2/engine/collide/collide-target-h.gc index 4524e852e..70eeeda6b 100644 --- a/goal_src/jak2/engine/collide/collide-target-h.gc +++ b/goal_src/jak2/engine/collide/collide-target-h.gc @@ -30,7 +30,8 @@ (unknown-word00 int32 :offset 3712) (unknown-vector04 vector :inline :offset 3728) (unknown-vector05 vector :inline :offset 3744) - (unknown-vector06 vector :inline :offset 3776) + (unknown-vector06 vector :inline :offset 3760) + (unknown-vector07 vector :inline :offset 3776) (unknown-dynamics00 dynamics :offset 3824) (unknown-surface00 surface :offset 3828) (unknown-surface01 surface :offset 3832) @@ -41,10 +42,10 @@ (unknown-float09 float :offset 3856) (unknown-float10 float :offset 3860) (unknown-float11 float :offset 3864) - (unknown-vector07 vector :inline :offset 3872) - (unknown-vector08 vector :inline :offset 3888) - (unknown-vector09 vector :inline :offset 3904) - (unknown-vector10 vector :inline :offset 3920) + (unknown-vector08 vector :inline :offset 3872) + (unknown-vector09 vector :inline :offset 3888) + (unknown-vector10 vector :inline :offset 3904) + (unknown-vector11 vector :inline :offset 3920) (unknown-vector-array01 vector 7 :inline :offset 3936) (unknown-vector12 vector :inline :offset 4064) (unknown-vector13 vector :inline :offset 4080) @@ -78,75 +79,121 @@ (unknown-float19 float :offset 4644) (unknown-float20 float :offset 4648) (unknown-time-frame06 time-frame :offset 4656) + (unknown-float21 float :offset 4664) (unknown-time-frame07 time-frame :offset 4672) (unknown-pat-surface00 pat-surface :offset 4680) (unknown-vector24 vector :inline :offset 4688) (unknown-vector25 vector :inline :offset 4720) - (unknown-handle01 handle :offset 4768) + (unknown-handle00 handle :offset 4768) (unknown-pat-surface01 pat-surface :offset 4776) - (unknown-float21 float :offset 4780) - (unknown-float22 float :offset 4784) - (unknown-float23 float :offset 4788) - (unknown-float24 float :offset 4792) - (unknown-float25 float :offset 4796) + (unknown-float22 float :offset 4780) + (unknown-float23 float :offset 4784) + (unknown-float24 float :offset 4788) + (unknown-float25 float :offset 4792) + (unknown-float26 float :offset 4796) (unknown-time-frame08 time-frame :offset 4816) (unknown-vector26 vector :inline :offset 4928) (unknwon-vector27 vector :inline :offset 4976) - (unknown-float26 float :offset 4992) + (unknown-float27 float :offset 4992) (unknown-time-frame09 time-frame :offset 5000) (unknown-sphere-array00 collide-shape-prim-sphere 10 :offset 5016) - (unknown-float27 float :offset 5132) - (unknown-float28 float :offset 5136) - (unknown-float29 float :offset 5140) + (unknown-word02 int32 :offset 5064) + (unknown-time-frame10 time-frame :offset 5072) + (unknown-time-frame11 time-frame :offset 5080) + (unknown-time-frame12 time-frame :offset 5096) + (unknown-time-frame13 time-frame :offset 5112) + (unknown-time-frame14 time-frame :offset 5120) + (unknown-float28 float :offset 5132) + (unknown-float29 float :offset 5136) + (unknown-float30 float :offset 5140) (unknown-vector28 vector :inline :offset 5152) (unknown-vector29 vector :inline :offset 5168) (unknown-vector30 vector :inline :offset 5184) (unknown-vector31 vector :inline :offset 5200) (unknown-vector32 vector :inline :offset 5216) (unknown-vector33 vector :inline :offset 5232) + (unknown-symbol00 symbol :offset 5248) + (unknown-float000 float :offset 5252) (unknown-float31 float :offset 5256) (unknown-vector-array02 vector 15 :inline :offset 5264) (unknown-float32 float :offset 5520) - (unknown-word02 int32 :offset 5524) + (unknown-word03 int32 :offset 5524) (unknown-float33 float :offset 5528) (unknown-vector34 vector :inline :offset 5536) - (unknown-vector35 vector :inline :offset 5568) - (unknown-time-frame10 time-frame :offset 5584) - (unknown-time-frame11 time-frame :offset 5592) - (unknown-handle00 handle :offset 5608) - (unknown-symbol00 symbol :offset 5620) - (unknown-cspace02 cspace :inline :offset 5824) - (unknown-vector36 vector :inline :offset 5904) - (unknown-float34 float :offset 5908) - (unknown-vector37 vector :inline :offset 5920) - (unknown-float35 float :offset 5924) - (unknown-time-frame12 time-frame :offset 5944) - (unknown-dword05 uint64 :offset 6008) - (unknown-symbol01 symbol :offset 6144) + (unknown-vector35 vector :inline :offset 5552) + (unknown-vector36 vector :inline :offset 5568) + (unknown-time-frame15 time-frame :offset 5584) + (unknown-time-frame16 time-frame :offset 5592) + (unknown-handle01 handle :offset 5608) + (unknown-word04 uint32 :offset 5616) + (unknown-spool-anim00 spool-anim :offset 5616) + (unknown-word05 int32 :offset 5616) + (unknown-symbol01 symbol :offset 5616) + (unknown-float34 float :offset 5616) + (unknown-symbol02 float :offset 5620) + (unknown-symbol03 float :offset 5624) + (unknown-float35 float :offset 5628) + (unknown-float36 float :offset 5632) + (unknown-float37 float :offset 5636) + (unknown-vector37 vector :inline :offset 5648) + (unknown-vector38 vector :inline :offset 5664) + (unknown-vector39 vector :inline :offset 5680) + (unknown-vector40 vector :inline :offset 5696) + (unknown-time-frame17 time-frame :offset 5712) + (unknown-time-frame18 time-frame :offset 5720) + (unknown-sound-id00 sound-id :offset 5776) + (unknown-handle02 handle :offset 5792) + (unknown-impact-control00 impact-control :inline :offset 5824) + (unknown-word06 int32 :offset 5832) + (unknown-vector41 vector :inline :offset 5888) + (unknown-vector42 vector :inline :offset 5904) + (unknown-float38 float :offset 5908) + (unknown-vector43 vector :inline :offset 5920) + (unknown-float39 float :offset 5924) + (unknown-time-frame19 time-frame :offset 5936) + (unknown-time-frame20 time-frame :offset 5944) + (unknown-symbol04 symbol :offset 5984) + (unknown-symbol05 symbol :offset 5988) + (unknown-dword05 uint64 :offset 6000) + (unknown-dword06 uint64 :offset 6008) + (unknown-combo-tracker00 combo-tracker :inline :offset 6032) + (unknown-time-frame21 time-frame :offset 6072) + (unknown-dword07 int64 :offset 6096) + (unknown-dword08 int64 :offset 6104) + (unknown-dword09 int64 :offset 6112) + (unknown-dword10 int64 :offset 6120) + (unknown-symbol06 symbol :offset 6144) + (unknown-quaternion04 quaternion :inline :offset 6160) + (unknown-sound-id01 sound-id :offset 6176) + (unknown-float40 float :offset 6180) + (unknown-float41 float :offset 6184) (unknown-halfword00 uint16 :offset 6188) (history-length uint16 :offset 6190) - (unknown-word03 int32 :offset 6192) - (unknown-time-frame13 time-frame :offset 6200) - (unknown-time-frame14 time-frame :offset 6208) - (unknown-time-frame15 time-frame :offset 6216) - (unknown-time-frame16 time-frame :offset 6224) - (unknown-time-frame17 time-frame :offset 6248) - (unknown-time-frame18 time-frame :offset 6256) - (unknown-dword06 int64 :offset 6264) - (unknown-sound-id00 sound-id :offset 6240) - (unknown-sound-id01 sound-id :offset 6244) - (unknown-sound-id02 sound-id :offset 6292) - (unknown-word04 int32 :offset 6300) - (unknown-word05 int32 :offset 6304) - (unknown-word06 int32 :offset 6308) - (unknown-word07 int32 :offset 6312) - (unknown-time-frame19 time-frame :offset 6320) - (unknown-time-frame20 time-frame :offset 6328) - (unknown-dword07 int64 :offset 6336) - (unknown-time-frame21 time-frame :offset 6368) - (unknown-quaternion04 quaternion :inline :offset 6384) - (unknown-time-frame22 time-frame :offset 6400) - (unknown-time-frame23 time-frame :offset 6408) + (unknown-word07 int32 :offset 6192) + (unknown-time-frame22 time-frame :offset 6200) + (unknown-time-frame23 time-frame :offset 6208) + (unknown-time-frame24 time-frame :offset 6216) + (unknown-time-frame25 time-frame :offset 6224) + (unknown-float42 float :offset 6232) + (unknown-sound-id02 sound-id :offset 6240) + (unknown-sound-id03 sound-id :offset 6244) + (unknown-time-frame26 time-frame :offset 6248) + (unknown-time-frame27 time-frame :offset 6256) + (unknown-dword11 int64 :offset 6264) + (unknown-vector44 vector :inline :offset 6272) + (unknown-float43 float :offset 6288) + (unknown-sound-id04 sound-id :offset 6292) + (unknown-word08 int32 :offset 6300) + (unknown-word09 int32 :offset 6304) + (unknown-word10 int32 :offset 6308) + (unknown-word11 int32 :offset 6312) + (unknown-time-frame28 time-frame :offset 6320) + (unknown-time-frame29 time-frame :offset 6328) + (unknown-dword12 int64 :offset 6336) + (unknown-time-frame30 time-frame :offset 6368) + (unknown-quaternion05 quaternion :inline :offset 6384) + (unknown-time-frame31 time-frame :offset 6400) + (unknown-time-frame32 time-frame :offset 6408) (pad uint8 :offset 6415) ) :method-count-assert 68 diff --git a/goal_src/jak2/engine/collide/collide-touch-h.gc b/goal_src/jak2/engine/collide/collide-touch-h.gc index a15a96a12..984348f98 100644 --- a/goal_src/jak2/engine/collide/collide-touch-h.gc +++ b/goal_src/jak2/engine/collide/collide-touch-h.gc @@ -99,7 +99,7 @@ (get-head (_type_) touching-prims-entry 9) (get-next (_type_ touching-shapes-entry) touching-prims-entry 10) (touching-shapes-entry-method-11 () none 11) - (touching-shapes-entry-method-12 () none 12) + (touching-shapes-entry-method-12 (_type_ collide-shape uint) touching-prims-entry 12) (touching-shapes-entry-method-13 () none 13) (touching-shapes-entry-method-14 () none 14) ) diff --git a/goal_src/jak2/engine/common_objs/generic-obs-h.gc b/goal_src/jak2/engine/common_objs/generic-obs-h.gc index 41053e8b4..ab66e9cfd 100644 --- a/goal_src/jak2/engine/common_objs/generic-obs-h.gc +++ b/goal_src/jak2/engine/common_objs/generic-obs-h.gc @@ -93,22 +93,22 @@ ) (deftype lightning-tracker (process) - ((root basic :offset-assert 128) - (lightning basic :offset-assert 132) - (callback basic :offset-assert 136) - (duration uint64 :offset-assert 144) - (start-time time-frame :offset-assert 152) - (offset0 vector :inline :offset-assert 160) - (offset1 vector :inline :offset-assert 176) - (target0 uint64 :offset-assert 192) - (target1 uint64 :offset-assert 200) - (target-joint0 int32 :offset-assert 208) - (target-joint1 int32 :offset-assert 212) - (sound uint32 :offset-assert 216) - (userdata uint64 :offset-assert 224) - (user-time time-frame 2 :offset-assert 232) - (user-vector vector :inline :offset-assert 256) - (user-handle handle 2 :offset 288) + ((root basic :offset-assert 128) + (lightning lightning-spec :offset-assert 132) + (callback basic :offset-assert 136) + (duration uint64 :offset-assert 144) + (start-time time-frame :offset-assert 152) + (offset0 vector :inline :offset-assert 160) + (offset1 vector :inline :offset-assert 176) + (target0 uint64 :offset-assert 192) + (target1 uint64 :offset-assert 200) + (target-joint0 int32 :offset-assert 208) + (target-joint1 int32 :offset-assert 212) + (sound uint32 :offset-assert 216) + (userdata uint64 :offset-assert 224) + (user-time time-frame 2 :offset-assert 232) + (user-vector vector :inline :offset-assert 256) + (user-handle handle 2 :offset 288) ) :heap-base #xb0 :method-count-assert 17 diff --git a/goal_src/jak2/engine/common_objs/generic-obs.gc b/goal_src/jak2/engine/common_objs/generic-obs.gc index 3f86fac64..5d15cb35c 100644 --- a/goal_src/jak2/engine/common_objs/generic-obs.gc +++ b/goal_src/jak2/engine/common_objs/generic-obs.gc @@ -5,5 +5,91 @@ ;; name in dgo: generic-obs ;; dgos: ENGINE, GAME +(define-extern ja-post (function none :behavior process-drawable)) +(define-extern merc-blend-shape (function process-drawable object)) +(define-extern merc-eye-anim (function process-drawable none)) + ;; DECOMP BEGINS +(defbehavior clone-anim-once process-drawable ((arg0 handle) (arg1 symbol) (arg2 string)) + (logclear! (-> self skel status) (joint-control-status valid-spooled-frame)) + (let ((gp-0 (handle->process arg0))) + (if gp-0 + (joint-control-copy! (-> self skel) (-> (the-as process-drawable gp-0) skel)) + ) + (cond + ((and (the-as process-drawable gp-0) (joint-control-remap! + (-> self skel) + (-> self draw art-group) + (-> (the-as process-drawable gp-0) draw art-group) + '() + 0 + arg2 + ) + ) + (when arg1 + (let* ((s5-1 (-> self root)) + (a0-7 (if (type? s5-1 collide-shape) + (the-as collide-shape s5-1) + ) + ) + ) + (if a0-7 + (collide-shape-method-29 a0-7 (-> (the-as process-drawable gp-0) root trans)) + (set! (-> self root trans quad) (-> (the-as process-drawable gp-0) root trans quad)) + ) + ) + (quaternion-copy! (-> self root quat) (-> (the-as process-drawable gp-0) root quat)) + ) + (if (logtest? (-> (the-as process-drawable gp-0) skel status) (joint-control-status valid-spooled-frame)) + (logior! (-> self skel status) (joint-control-status valid-spooled-frame)) + ) + (logclear! (-> self draw status) (draw-control-status no-draw no-draw-temp uninited)) + (if (or (zero? (-> self skel active-channels)) (not (-> self skel root-channel 0 frame-group))) + (logior! (-> self draw status) (draw-control-status no-draw-temp)) + ) + (let* ((gp-1 self) + (v1-38 (if (type? gp-1 manipy) + gp-1 + ) + ) + ) + (if (and v1-38 (not (-> (the-as manipy v1-38) draw?))) + (logior! (-> self draw status) (draw-control-status no-draw-temp)) + ) + ) + (joint-control-method-10 (-> self skel)) + (draw-control-method-14 (-> self draw) (-> self node-list) (-> self skel)) + (let ((a0-22 (-> self skel effect))) + (if a0-22 + ((method-of-object a0-22 effect-control-method-9)) + ) + ) + (if (logtest? (-> self skel status) (joint-control-status blend-shape blend-shape-valid)) + (merc-blend-shape self) + ) + (if (logtest? (-> self skel status) (joint-control-status eye-anim-valid eye-anim)) + (merc-eye-anim self) + ) + ) + (else + (set! (-> self skel active-channels) (the-as uint 0)) + (logior! (-> self draw status) (draw-control-status no-draw)) + (ja-post) + ) + ) + ) + 0 + (none) + ) + +(defbehavior clone-anim process-drawable ((arg0 handle) (arg1 symbol) (arg2 string)) + (ja-post) + (while (handle->process arg0) + (clone-anim-once arg0 #t arg2) + (suspend) + ) + (logclear! (-> self skel status) (joint-control-status valid-spooled-frame)) + 0 + (none) + ) \ No newline at end of file diff --git a/goal_src/jak2/engine/common_objs/water-h.gc b/goal_src/jak2/engine/common_objs/water-h.gc index 6369f64ba..e78fce7ee 100644 --- a/goal_src/jak2/engine/common_objs/water-h.gc +++ b/goal_src/jak2/engine/common_objs/water-h.gc @@ -109,7 +109,7 @@ (water-control-method-10 () none 10) (water-control-method-11 () none 11) (distance-from-surface (_type_) float 12) - (water-control-method-13 () none 13) + (water-control-method-13 (_type_ float vector int vector symbol) none 13) (display-water-marks? (_type_) symbol 14) (water-control-method-15 () none 15) (water-control-method-16 () none 16) diff --git a/goal_src/jak2/engine/game/effect-control-h.gc b/goal_src/jak2/engine/game/effect-control-h.gc index 83552ad29..653b54b7b 100644 --- a/goal_src/jak2/engine/game/effect-control-h.gc +++ b/goal_src/jak2/engine/game/effect-control-h.gc @@ -62,7 +62,7 @@ (effect-control-method-9 () none 9) (effect-control-method-10 () none 10) (effect-control-method-11 () none 11) - (effect-control-method-12 () none 12) + (effect-control-method-12 (_type_ symbol float int basic sound-name) int 12) (set-channel-offset! (_type_ int) none 13) (effect-control-method-14 () none 14) ) diff --git a/goal_src/jak2/engine/sound/gsound-h.gc b/goal_src/jak2/engine/sound/gsound-h.gc index 3a42044f9..a7c8eb2c8 100644 --- a/goal_src/jak2/engine/sound/gsound-h.gc +++ b/goal_src/jak2/engine/sound/gsound-h.gc @@ -93,6 +93,9 @@ (fo-min) (fo-max) (fo-curve) + (sm09) + (sm10) + (sm11) ) (defenum stream-status diff --git a/goal_src/jak2/engine/sound/gsound.gc b/goal_src/jak2/engine/sound/gsound.gc index 38d09d2ff..8635c6c72 100644 --- a/goal_src/jak2/engine/sound/gsound.gc +++ b/goal_src/jak2/engine/sound/gsound.gc @@ -408,6 +408,13 @@ 0 ) +(defmacro sound-play (name &key (id (new-sound-id)) + &key (vol 100.0) &key (pitch 0) &key (bend 0) + &key (group sfx) + &key (position #t)) + `(sound-play-by-name (static-sound-name ,name) ,id (the int (* (/ 1024.0 100.0) ,vol)) (the int (* 1524.0 ,pitch)) ,bend (sound-group ,group) ,position) + ) + (defbehavior sound-play-by-name process-drawable ((arg0 sound-name) (arg1 sound-id) (arg2 int) (arg3 int) (arg4 int) (arg5 sound-group) (arg6 object)) (local-vars (sv-16 sound-group)) "Last arg can by a symbol with value [[#t]], in which case it will pull `trans` [[vector]] off the current [[process-drawable]] diff --git a/goal_src/jak2/engine/target/board/board-h.gc b/goal_src/jak2/engine/target/board/board-h.gc index eb7cf9025..8089ec680 100644 --- a/goal_src/jak2/engine/target/board/board-h.gc +++ b/goal_src/jak2/engine/target/board/board-h.gc @@ -5,6 +5,30 @@ ;; name in dgo: board-h ;; dgos: ENGINE, GAME +(defenum board-tricks ;; (method 9 board-info) + :type uint32 + :bitfield #f + (none 0) + (board-spin 1) + (board-boost 2) + (board-flip 3) + (board-rail 4) + (board-rail-jump 5) + (board-nosegrab 6) + (board-method 7) + (board-board-spin 8) + (board-board-flip 9) + (board-noseflip 10) + (board-kickflip 11) + (board-jump 12) + (board-duck-jump 13) + (board-quick-jump 14) + (darkjak 15) + (darkjak-bomb0 16) + (darkjak-bomb1 17) + (darkjak-giant 18) + ) + ;; DECOMP BEGINS (deftype board (process-drawable) @@ -25,139 +49,160 @@ (deftype board-info (basic) - ((board (pointer board) :offset-assert 4) - (camera-interp float :offset-assert 8) - (process (pointer target) :offset-assert 12) - (board-trans vector :inline :offset-assert 16) - (board-quat vector :inline :offset-assert 32) - (board-scale vector :inline :offset-assert 48) - (main joint-mod :offset-assert 64) - (upper-body basic :offset-assert 68) - (sound-bank-knob float :offset-assert 72) - (sound-air-knob float :offset-assert 76) - (wind-sound-id uint32 :offset-assert 80) - (wind-sound-pitch float :offset-assert 84) - (wind-sound-volume float :offset-assert 88) - (engine-sound-id uint32 :offset-assert 92) - (engine-sound-pitch float :offset-assert 96) - (engine-sound-volume float :offset-assert 100) - (bank-sound-id uint32 :offset-assert 104) - (bank-sound-pitch float :offset-assert 108) - (bank-sound-volume float :offset-assert 112) - (ride-sound-id uint32 :offset-assert 116) - (spin-sound-id uint32 :offset-assert 120) - (spin-sound-volume float :offset-assert 124) - (spin-sound-pitch float :offset-assert 128) - (up-vector vector 2 :inline :offset-assert 144) - (slow-transv vector :inline :offset-assert 176) - (board-time time-frame :offset-assert 192) - (board-get-on-time time-frame :offset-assert 200) - (in-air-time time-frame :offset-assert 208) - (stick-lock basic :offset 240) - (stick-off basic :offset-assert 244) - (stance-info ground-tween-info :inline :offset-assert 248) - (mods-backup basic :offset-assert 284) - (attack-id uint32 :offset-assert 288) - (latch? symbol :offset-assert 292) - (unstuck-time time-frame :offset 344) - (stuck-count int32 :offset-assert 352) - (thrust-scale float :offset-assert 356) - (flip-time time-frame :offset-assert 360) - (transv-max meters :offset-assert 368) - (turn-anim-tilt? symbol :offset-assert 372) - (turn-anim-mag float :offset-assert 376) - (turn-anim-targ float :offset-assert 380) - (turn-anim-frame float :offset-assert 384) - (turn-anim-vel float :offset-assert 388) - (turn-anim-duck float :offset-assert 392) - (turn-anim-duck-vel float :offset-assert 396) - (tilt-anim-frame vector :inline :offset-assert 400) - (tilt-anim-target vector :inline :offset-assert 416) - (smack-surface-time time-frame :offset-assert 432) - (smack-speed meters :offset-assert 440) - (smack-normal vector :inline :offset-assert 448) - (glance-time time-frame :offset-assert 464) - (glance-speed meters :offset-assert 472) - (glance-in-transv vector :inline :offset-assert 480) - (glance-out-transv vector :inline :offset-assert 496) - (glance-normal vector :inline :offset-assert 512) - (on-flat-time time-frame :offset-assert 528) - (jump-land-time time-frame :offset-assert 536) - (slip-factor float :offset-assert 544) - (ground-on-dir vector :inline :offset-assert 560) - (ride-time time-frame :offset-assert 576) - (ride-start-time time-frame :offset-assert 584) - (ride-button-time time-frame :offset-assert 592) - (ride-lean-targ float :offset-assert 600) - (ride-lean float :offset-assert 604) - (ride-leanv float :offset-assert 608) - (ride-lean-mag float :offset-assert 612) - (ride-tilt-targ float :offset-assert 616) - (ride-tilt float :offset-assert 620) - (ride-tiltv float :offset-assert 624) - (ride-tilt-mag float :offset-assert 628) - (ride-lock symbol :offset-assert 632) - (ride-lock-on symbol :offset-assert 636) - (ride-speed meters :offset-assert 640) - (ride-mode uint32 :offset-assert 644) - (ride-rot degrees :offset-assert 648) - (ride-rot-old degrees :offset-assert 652) - (ride-rot-abs degrees 2 :offset-assert 656) - (ride-rtv-abs degrees :offset-assert 664) - (ride-touch-segment vector 2 :inline :offset-assert 672) - (ride-dir vector :inline :offset-assert 704) - (ride-vertex-length int16 :offset-assert 720) - (ride-vertex-length-old int16 :offset-assert 722) - (ride-vertex-base int16 :offset-assert 724) - (ride-vertex-base2 int16 :offset-assert 726) - (ride-vertex-index float :offset-assert 728) - (ride-vertex-index2 float :offset-assert 732) - (ride-vertex-index-old float :offset-assert 736) - (ride-vertex vector 3 :inline :offset-assert 752) - (ride-segment vector :inline :offset-assert 800) - (ride-dir-lean vector :inline :offset-assert 816) - (ride-pad-vector vector 1 :inline :offset-assert 832) - (ride-vertex-old vector 3 :inline :offset-assert 848) - (ride-segment-old vector :inline :offset-assert 896) - (ride-vertex-trail vector 128 :inline :offset-assert 912) - (halfpipe-side-time time-frame :offset-assert 2960) - (halfpipe-jump-time time-frame :offset-assert 2968) - (halfpipe-lip-time time-frame :offset-assert 2976) - (halfpipe-time time-frame :offset-assert 2984) - (halfpipe-gspot-time time-frame :offset-assert 2992) - (halfpipe-lip-event symbol :offset-assert 3000) - (spin-check-time time-frame :offset-assert 3008) - (spin-time time-frame :offset-assert 3016) - (spin-start-time time-frame :offset-assert 3024) - (spin-start-dir vector :inline :offset-assert 3040) - (spin-control float :offset-assert 3056) - (spin-ground-start-time time-frame :offset-assert 3064) - (spin-ground-time time-frame :offset-assert 3072) - (spin-ground-press-time time-frame :offset-assert 3080) - (flip-control float :offset-assert 3088) - (flip-count int32 :offset-assert 3092) - (trickx-count int32 :offset 3144) - (trotyv-max degrees :offset-assert 3148) - (trotyv degrees :offset-assert 3152) - (troty degrees :offset-assert 3156) - (troty-cum degrees :offset-assert 3160) - (upper-body-rotyv-max degrees :offset 3168) - (upper-body-rotyv degrees :offset-assert 3172) - (upper-body-roty degrees :offset-assert 3176) - (cushion-base meters :offset-assert 3180) - (cushion-offset meters :offset-assert 3184) - (shock-offset meters :offset-assert 3188) - (shock-offsetv meters :offset-assert 3192) - (shock-rotx meters :offset-assert 3196) - (trick-count int32 :offset 3204) - (pad uint8 :offset 3399) + ((board (pointer board) :offset-assert 4) + (camera-interp float :offset-assert 8) + (process (pointer target) :offset-assert 12) + (board-trans vector :inline :offset-assert 16) + (board-quat vector :inline :offset-assert 32) + (board-scale vector :inline :offset-assert 48) + (main joint-mod :offset-assert 64) + (upper-body joint-mod :offset-assert 68) + (sound-bank-knob float :offset-assert 72) + (sound-air-knob float :offset-assert 76) + (wind-sound-id uint32 :offset-assert 80) + (wind-sound-pitch float :offset-assert 84) + (wind-sound-volume float :offset-assert 88) + (engine-sound-id uint32 :offset-assert 92) + (engine-sound-pitch float :offset-assert 96) + (engine-sound-volume float :offset-assert 100) + (bank-sound-id uint32 :offset-assert 104) + (bank-sound-pitch float :offset-assert 108) + (bank-sound-volume float :offset-assert 112) + (ride-sound-id uint32 :offset-assert 116) + (spin-sound-id uint32 :offset-assert 120) + (spin-sound-volume float :offset-assert 124) + (spin-sound-pitch float :offset-assert 128) + (unknown-sound-id00 sound-id :offset-assert 132) + (unknown-sound-id01 sound-id :offset-assert 136) + (unknown-sound-id02 sound-id :offset-assert 140) + (up-vector vector 2 :inline :offset-assert 144) + (slow-transv vector :inline :offset-assert 176) + (board-time time-frame :offset-assert 192) + (board-get-on-time time-frame :offset-assert 200) + (in-air-time time-frame :offset-assert 208) + (unknown-time-frame00 time-frame :offset-assert 216) + (unknown-time-frame01 time-frame :offset 224) + (unknown-time-frame02 time-frame :offset 232) + (stick-lock symbol :offset 240) + (stick-off symbol :offset-assert 244) + (stance-info ground-tween-info :inline :offset-assert 248) + (mods-backup basic :offset-assert 284) + (attack-id uint32 :offset-assert 288) + (latch? symbol :offset-assert 292) + (unknown-vector00 vector :inline :offset 304) + (unknown-vector01 vector :inline :offset 320) + (unknown-int00 uint32 :offset 336) + (unknown-symbol00 symbol :offset 340) + (unstuck-time time-frame :offset 344) + (stuck-count int32 :offset-assert 352) + (thrust-scale float :offset-assert 356) + (flip-time time-frame :offset-assert 360) + (transv-max meters :offset-assert 368) + (turn-anim-tilt? symbol :offset-assert 372) + (turn-anim-mag float :offset-assert 376) + (turn-anim-targ float :offset-assert 380) + (turn-anim-frame float :offset-assert 384) + (turn-anim-vel float :offset-assert 388) + (turn-anim-duck float :offset-assert 392) + (turn-anim-duck-vel float :offset-assert 396) + (tilt-anim-frame vector :inline :offset-assert 400) + (tilt-anim-target vector :inline :offset-assert 416) + (smack-surface-time time-frame :offset-assert 432) + (smack-speed meters :offset-assert 440) + (smack-normal vector :inline :offset-assert 448) + (glance-time time-frame :offset-assert 464) + (glance-speed meters :offset-assert 472) + (glance-in-transv vector :inline :offset-assert 480) + (glance-out-transv vector :inline :offset-assert 496) + (glance-normal vector :inline :offset-assert 512) + (on-flat-time time-frame :offset-assert 528) + (jump-land-time time-frame :offset-assert 536) + (slip-factor float :offset-assert 544) + (ground-on-dir vector :inline :offset-assert 560) + (ride-time time-frame :offset-assert 576) + (ride-start-time time-frame :offset-assert 584) + (ride-button-time time-frame :offset-assert 592) + (ride-lean-targ float :offset-assert 600) + (ride-lean float :offset-assert 604) + (ride-leanv float :offset-assert 608) + (ride-lean-mag float :offset-assert 612) + (ride-tilt-targ float :offset-assert 616) + (ride-tilt float :offset-assert 620) + (ride-tiltv float :offset-assert 624) + (ride-tilt-mag float :offset-assert 628) + (ride-lock symbol :offset-assert 632) + (ride-lock-on symbol :offset-assert 636) + (ride-speed meters :offset-assert 640) + (ride-mode uint32 :offset-assert 644) + (ride-rot degrees :offset-assert 648) + (ride-rot-old degrees :offset-assert 652) + (ride-rot-abs degrees 2 :offset-assert 656) + (ride-rtv-abs degrees :offset-assert 664) + (ride-touch-segment vector 2 :inline :offset-assert 672) + (ride-dir vector :inline :offset-assert 704) + (ride-vertex-length int16 :offset-assert 720) + (ride-vertex-length-old int16 :offset-assert 722) + (ride-vertex-base int16 :offset-assert 724) + (ride-vertex-base2 int16 :offset-assert 726) + (ride-vertex-index float :offset-assert 728) + (ride-vertex-index2 float :offset-assert 732) + (ride-vertex-index-old float :offset-assert 736) + (ride-vertex vector 3 :inline :offset-assert 752) + (ride-segment vector :inline :offset-assert 800) + (ride-dir-lean vector :inline :offset-assert 816) + (ride-pad-vector vector 1 :inline :offset-assert 832) + (ride-vertex-old vector 3 :inline :offset-assert 848) + (ride-segment-old vector :inline :offset-assert 896) + (ride-vertex-trail vector 128 :inline :offset-assert 912) + (halfpipe-side-time time-frame :offset-assert 2960) + (halfpipe-jump-time time-frame :offset-assert 2968) + (halfpipe-lip-time time-frame :offset-assert 2976) + (halfpipe-time time-frame :offset-assert 2984) + (halfpipe-gspot-time time-frame :offset-assert 2992) + (halfpipe-lip-event symbol :offset-assert 3000) + (spin-check-time time-frame :offset-assert 3008) + (spin-time time-frame :offset-assert 3016) + (spin-start-time time-frame :offset-assert 3024) + (spin-start-dir vector :inline :offset-assert 3040) + (spin-control float :offset-assert 3056) + (spin-ground-start-time time-frame :offset-assert 3064) + (spin-ground-time time-frame :offset-assert 3072) + (spin-ground-press-time time-frame :offset-assert 3080) + (flip-control float :offset-assert 3088) + (flip-count int32 :offset-assert 3092) + (unknown-time-frame03 time-frame :offset 3104) + (unknown-time-frame04 time-frame :offset 3112) + (unknown-time-frame05 time-frame :offset 3120) + (unknown-time-frame06 time-frame :offset 3128) + (unknown-float00 float :offset 3136) + (unknown-float01 float :offset 3140) + (trickx-count int32 :offset 3144) + (trotyv-max degrees :offset-assert 3148) + (trotyv degrees :offset-assert 3152) + (troty degrees :offset-assert 3156) + (troty-cum degrees :offset-assert 3160) + (unknown-deg00 degrees :offset 3164) + (upper-body-rotyv-max degrees :offset 3168) + (upper-body-rotyv degrees :offset-assert 3172) + (upper-body-roty degrees :offset-assert 3176) + (cushion-base meters :offset-assert 3180) + (cushion-offset meters :offset-assert 3184) + (shock-offset meters :offset-assert 3188) + (shock-offsetv meters :offset-assert 3192) + (shock-rotx meters :offset-assert 3196) + (part-control sparticle-launch-control :offset-assert 3200) + (trick-count int32 :offset-assert 3204) + (trick-array board-tricks 16 :offset-assert 3208) + (trick-points-array float 16 :offset 3272) + (trick-list board-tricks 16 :offset 3336) + (pad uint8 :offset 3399) ) :method-count-assert 11 :size-assert #xd48 :flag-assert #xb00000d48 (:methods - (board-info-method-9 () none 9) - (board-info-method-10 () none 10) + (add-to-trick-list (_type_ board-tricks float) none 9) + (flush-trick-list (_type_) none 10) ) ) @@ -204,8 +249,8 @@ ) ) (not *pause-lock*) - (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame21)) (seconds 0.1)) - (>= (-> self control unknown-time-frame06) (-> self control unknown-time-frame12)) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame30)) (seconds 0.1)) + (>= (-> self control unknown-time-frame06) (-> self control unknown-time-frame20)) ) (-> self board latch?) ) diff --git a/goal_src/jak2/engine/target/board/board-states.gc b/goal_src/jak2/engine/target/board/board-states.gc index bb1475ed4..14d2ee699 100644 --- a/goal_src/jak2/engine/target/board/board-states.gc +++ b/goal_src/jak2/engine/target/board/board-states.gc @@ -5,5 +5,3461 @@ ;; name in dgo: board-states ;; dgos: ENGINE, GAME +(define-extern target-time-to-ground (function time-frame :behavior target)) +(define-extern jump-hit-ground-stuck? (function symbol :behavior target)) +(define-extern target-board-start (state object target)) +(define-extern target-board-handler (function process int symbol event-message-block object :behavior target)) +(define-extern ground-tween-initialize (function ground-tween-info uint uint uint uint uint uint ground-tween-info :behavior target)) +(define-extern ground-tween-update (function ground-tween-info float float none :behavior target)) +(define-extern can-play-stance-amibent? (function symbol :behavior target)) +(define-extern ja-blend-eval (function int :behavior process-drawable)) +(define-extern spawn-projectile (function type projectile-init-by-other-params process-tree dead-pool (pointer process))) +(define-extern target-attacked (function symbol attack-info process process (state symbol attack-info target) object :behavior target)) +(define-extern target-grab (state target)) +(define-extern target-clone-anim (state handle target)) +(define-extern clone-anim (function handle symbol string none :behavior process-drawable)) +(define-extern lightning-probe-callback (function lightning-tracker none)) +(define-extern process-drawable-shock-effect (function process-drawable lightning-spec (function lightning-tracker none) sparticle-launcher int int float none)) +(define-extern target-death (state symbol target)) +(define-extern target-hit-effect (function attack-info none :behavior target)) +(define-extern demo? (function symbol)) +(define-extern hide-hud-quick (function symbol none)) +(define-extern *smack-mods* surface) +(define-extern target-hit-orient (function attack-info vector symbol :behavior target)) +(define-extern target-hit-move (function attack-info symbol (function none :behavior target) float none :behavior target)) + +(declare-type grenade projectile) + ;; DECOMP BEGINS +(format 0 "SKIP: target-board-clone-anim in board-states~%") + +(defun vector-vector-angle ((arg0 vector) (arg1 vector)) + (let ((s4-0 (new 'stack-no-clear 'matrix)) + (gp-0 (new 'stack-no-clear 'matrix)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (forward-up-nopitch->inv-matrix gp-0 (new 'static 'vector :z 1.0 :w 1.0) arg1) + (matrix-transpose! s4-0 gp-0) + (vector-matrix*! s3-0 arg0 s4-0) + (vector-y-angle s3-0) + ) + ) + +(defbehavior target-board-anim-trans target () + (let ((f26-0 (deg- + (quaternion-vector-y-angle (-> self control dir-targ) (-> self control local-normal)) + (quaternion-vector-y-angle (-> self control unknown-quaternion00) (-> self control local-normal)) + ) + ) + (f28-0 (* (deg- + (quaternion-vector-y-angle (-> self control unknown-quaternion00) (-> self control local-normal)) + (quaternion-vector-y-angle (-> self control unknown-quaternion03) (-> self control local-normal)) + ) + (-> self clock frames-per-second) + ) + ) + (f30-0 (-> self board turn-anim-targ)) + ) + (let ((f0-1 (lerp-scale 1.0 -1.0 f28-0 -32768.0 32768.0))) + (if (or (< (fabs f0-1) 0.1) (< (-> self control unknown-float10) 0.3)) + (seek! (-> self board turn-anim-mag) 0.0 (* 8.0 (-> self clock seconds-per-frame))) + (seek! (-> self board turn-anim-mag) f0-1 (* 2.0 (-> self clock seconds-per-frame))) + ) + ) + (set! (-> self board turn-anim-targ) (+ (lerp-scale + (* 0.5 (-> *TARGET_BOARD-bank* turn-frames)) + (* -0.5 (-> *TARGET_BOARD-bank* turn-frames)) + f26-0 + -5461.3335 + 5461.3335 + ) + (lerp-scale + (* 0.3 (-> *TARGET_BOARD-bank* turn-frames)) + (* -0.3 (-> *TARGET_BOARD-bank* turn-frames)) + f28-0 + -32768.0 + 32768.0 + ) + (lerp-scale + (* 0.2 (-> *TARGET_BOARD-bank* turn-frames)) + (* -0.2 (-> *TARGET_BOARD-bank* turn-frames)) + (-> self board turn-anim-mag) + 1.0 + -1.0 + ) + ) + ) + (when (and (or (< (* f30-0 (-> self board turn-anim-targ)) 0.0) (= f30-0 0.0)) + (and (< (* 0.2 (-> *TARGET_BOARD-bank* turn-frames)) (fabs (- f30-0 (-> self board turn-anim-targ)))) + (>= (-> self clock frame-counter) (-> self control unknown-time-frame00)) + ) + ) + (let ((v1-50 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-50 command) (sound-command set-param)) + (set! (-> v1-50 id) (-> self board unknown-sound-id00)) + (set! (-> v1-50 params volume) -4) + (set! (-> v1-50 auto-time) 120) + (set! (-> v1-50 auto-from) 2) + (set! (-> v1-50 params mask) (the-as uint 17)) + (-> v1-50 id) + ) + (set! (-> self board unknown-sound-id00) (sound-play "board-turn")) + ) + ) + (set! (-> self board turn-anim-duck-vel) (* 0.98 (-> self board turn-anim-duck-vel))) + (+! (-> self board turn-anim-duck-vel) (* -8.0 (-> self clock seconds-per-frame))) + (when (and (board-on-ground?) + (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame02)) (seconds 0.2)) + ) + (if (logtest? (-> self control status) (cshape-moving-flags csmf11)) + (+! (-> self board turn-anim-duck-vel) (lerp-scale 0.0 15.0 (-> self control unknown-float21) 0.0 81920.0)) + ) + (let ((f0-38 (vector-dot (the-as vector (-> self board up-vector)) (-> self board up-vector 1)))) + (if (< f0-38 1.0) + (+! (-> self board turn-anim-duck-vel) + (* (lerp-scale 400.0 0.0 f0-38 0.6 1.0) (-> self clock seconds-per-frame)) + ) + ) + ) + ) + (none) + ) + +(defbehavior target-board-spin-check target () + (when (and (or (cpad-pressed? (-> self control unknown-cpad-info00 number) r1) + (and (cpad-hold? (-> self control unknown-cpad-info00 number) r1) + (>= (- (-> self clock frame-counter) (-> self board spin-check-time)) (seconds 0.3)) + ) + ) + (not (and (and (-> self next-state) (let ((v1-24 (-> self next-state name))) + (or (= v1-24 'target-board-trickx) (= v1-24 'target-board-hold)) + ) + ) + (< (- (-> self clock frame-counter) (-> self board spin-start-time)) (seconds 0.5)) + ) + ) + (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) + ) + (set! (-> self board spin-start-time) (-> self clock frame-counter)) + (set! (-> self board spin-start-dir quad) (-> self node-list data 3 bone transform vector 2 quad)) + (vector-flatten! (-> self control unknown-vector03) (-> self control unknown-matrix01 vector 2) *up-vector*) + (vector-normalize! (-> self control unknown-vector03) 1.0) + (rot->dir-targ! (-> self control)) + (set! (-> self board trotyv-max) + (lerp-scale + 218453.33 + 91022.22 + (the float (- (-> self clock frame-counter) (-> self control unknown-time-frame06))) + 0.0 + 300.0 + ) + ) + (set! (-> self board trotyv) 0.0) + (set! (-> self board troty) 0.0) + (set! (-> self board troty-cum) 0.0) + (set! (-> self board unknown-deg00) 0.0) + (set! (-> self board spin-sound-id) (the-as uint 0)) + (set! (-> self control unknown-surface00) *board-spin-mods*) + ) + (cond + ((and (cpad-hold? (-> self control unknown-cpad-info00 number) r1) + (and (or (= (-> self control unknown-surface00 name) 'spin) + (< (- (-> self clock frame-counter) (-> self board spin-time)) (seconds 0.05)) + ) + (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) + ) + ) + (set! (-> self board turn-anim-tilt?) #f) + (set! (-> self control unknown-surface00) *board-spin-mods*) + (set! (-> self board spin-time) (-> self clock frame-counter)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 x) (* -0.0078125 (+ -128.0 (the float (-> self control unknown-cpad-info00 leftx))))) + (set! (-> gp-0 y) 0.0) + (set! (-> gp-0 z) (* -0.0078125 (+ -128.0 (the float (-> self control unknown-cpad-info00 lefty))))) + (set! (-> gp-0 w) 0.0) + (let ((f28-0 (analog-input (the int (* 128.0 (-> gp-0 x))) 0.0 64.0 110.0 2184533.2)) + (f30-0 (analog-input (the int (* 128.0 (-> gp-0 z))) 0.0 96.0 110.0 1.0)) + ) + (if (and (zero? (-> self board spin-sound-id)) (< 5461.3335 (fabs (-> self board trotyv)))) + (set! (-> self board spin-sound-id) (the-as uint (sound-play "board-spin-loop"))) + ) + (if (and (< (* 0.9 (fabs (-> self board spin-control))) (fabs f28-0)) + (>= (* (-> self board spin-control) f28-0) 0.0) + ) + (set! (-> self board spin-control) f28-0) + ) + (if (not (-> self control unknown-symbol04)) + (target-danger-set! 'board-spin #f) + ) + (+! (-> self board trotyv) (* (-> self board spin-control) (-> self clock seconds-per-frame))) + (when (and (< (fabs f28-0) 1092266.6) + (< (fabs (-> self board spin-control)) 1092266.6) + (< (* 0.9 (fabs (-> self board flip-control))) (fabs f30-0)) + (>= (* (-> self board flip-control) f30-0) 0.0) + (not (board-on-ground?)) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) 4096.0) + ) + (set! (-> self board flip-control) f30-0) + (go + target-board-flip + (-> *TARGET_BOARD-bank* jump-height-min) + (-> *TARGET_BOARD-bank* jump-height-max) + (if (logtest? (focus-status halfpipe) (-> self focus-status)) + 'halfpipe + ) + ) + ) + ) + ) + ) + (else + (set! (-> self control unknown-surface00) (the-as surface (-> self board mods-backup))) + ) + ) + (set! (-> self board spin-check-time) (-> self clock frame-counter)) + (when (and (or (cpad-pressed? (-> self control unknown-cpad-info00 number) l1) + (< (-> self control unknown-time-frame06) (-> self board unknown-time-frame06)) + ) + (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) + ) + (set! (-> self board turn-anim-tilt?) #f) + (set! (-> self control unknown-surface00) *board-spin-mods*) + (set! (-> self board unknown-time-frame03) (-> self clock frame-counter)) + (let ((gp-2 (new 'stack-no-clear 'vector))) + (set! (-> gp-2 x) (* -0.0078125 (+ -128.0 (the float (-> self control unknown-cpad-info00 leftx))))) + (set! (-> gp-2 y) 0.0) + (set! (-> gp-2 z) (* -0.0078125 (+ -128.0 (the float (-> self control unknown-cpad-info00 lefty))))) + (set! (-> gp-2 w) 0.0) + (let ((f30-1 (analog-input (the int (* 128.0 (-> gp-2 x))) 0.0 64.0 110.0 1.0)) + (f28-1 (analog-input (the int (* 128.0 (-> gp-2 z))) 0.0 96.0 110.0 1.0)) + ) + (when (and (< (fabs f30-1) 0.5) + (< (fabs (-> self board unknown-float00)) 0.5) + (= (-> self board unknown-float01) 0.0) + (< (* 0.9 (fabs (-> self board unknown-float01))) (fabs f28-1)) + (>= (* (-> self board unknown-float01) f28-1) 0.0) + (and (not (board-on-ground?)) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (>= (target-height-above-ground) 4096.0) + (< (seconds 0.165) (target-time-to-ground)) + (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame05)) (seconds 0.05)) + (< (-> self board unknown-time-frame05) (-> self board unknown-time-frame06)) + ) + ) + ) + (set! (-> self board unknown-float01) f28-1) + (go + target-board-hold + (-> *TARGET_BOARD-bank* tricky-jump-height-min) + (-> *TARGET_BOARD-bank* tricky-jump-height-max) + (if (logtest? (focus-status halfpipe) (-> self focus-status)) + 'halfpipe + ) + ) + ) + (when (and (< (fabs f28-1) 0.5) + (< (fabs (-> self board unknown-float01)) 0.5) + (= (-> self board unknown-float00) 0.0) + (< (* 0.9 (fabs (-> self board unknown-float00))) (fabs f30-1)) + (>= (* (-> self board unknown-float00) f30-1) 0.0) + (and (not (board-on-ground?)) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (>= (target-height-above-ground) 4096.0) + (< (seconds 0.165) (target-time-to-ground)) + (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame05)) (seconds 0.05)) + ) + ) + ) + (set! (-> self board unknown-float00) f30-1) + (go + target-board-trickx + (-> *TARGET_BOARD-bank* trickx-jump-height-min) + (-> *TARGET_BOARD-bank* trickx-jump-height-max) + (if (logtest? (focus-status halfpipe) (-> self focus-status)) + 'halfpipe + ) + ) + ) + ) + ) + ) + (none) + ) + +(defbehavior target-board-halfpipe-trans target () + (when (and (logtest? (focus-status halfpipe) (-> self focus-status)) *camera*) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((s5-0 (camera-master-method-15 *camera* (new 'stack-no-clear 'vector)))) + (vector-flatten! gp-0 (-> self control unknown-vector36) (-> *camera* local-down)) + (when (< (vector-dot gp-0 s5-0) 0.0) + (let* ((v1-11 (camera-master-method-14 *camera* (new 'stack-no-clear 'vector))) + (f0-3 (vector-dot (-> self control unknown-vector34) v1-11)) + (s4-1 (vector-float*! (new 'stack-no-clear 'vector) (-> self control unknown-vector34) f0-3)) + ) + (vector-flatten! (the-as vector s4-1) (the-as vector s4-1) (-> *camera* local-down)) + (if (< 0.0 (vector-dot (the-as vector s4-1) s5-0)) + (vector-negate! gp-0 (the-as vector s4-1)) + ) + ) + ) + ) + (vector-normalize! gp-0 8192.0) + (set! (-> gp-0 y) (+ 40960.0 (-> gp-0 y))) + (vector+! gp-0 gp-0 (get-trans self 6)) + (vector-! gp-0 gp-0 (get-trans self 0)) + (send-event *camera* 'relative-position gp-0) + ) + (set-setting! 'matrix-blend-max-angle 'abs #x45088889 0) + (set-setting! 'matrix-blend-max-partial 'abs #x3f000000 0) + ) + 0 + (none) + ) + +(defbehavior target-board-resolve-points target ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (when (= (-> self board main mode) (joint-mod-mode rotate)) + (let ((f0-1 (fabs (-> self board troty-cum)))) + (cond + ((>= f0-1 191146.67) + (add-to-trick-list (-> self board) (board-tricks board-spin) 4000.0) + ) + ((>= f0-1 126520.89) + (add-to-trick-list (-> self board) (board-tricks board-spin) 2000.0) + ) + ((>= f0-1 49152.0) + (add-to-trick-list (-> self board) (board-tricks board-spin) 500.0) + ) + ) + ) + ) + (set! (-> self board troty-cum) 0.0) + (set! (-> self board flip-count) 0) + (if (>= (- (-> self clock frame-counter) (-> self board in-air-time)) (seconds 0.2)) + (flush-trick-list (-> self board)) + ) + 0 + (none) + ) + +(defbehavior target-board-ground-check target () + (local-vars (a0-4 object) (a1-0 object) (a2-3 number) (a3-0 number)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (when (board-on-ground?) + (when (!= (-> self board troty-cum) 0.0) + (let ((f30-0 (fabs (-> self board troty-cum))) + (f28-0 (vector-y-angle (-> self control transv))) + (f0-2 (y-angle (-> self control))) + ) + (if (< (- (-> self clock frame-counter) (-> self board halfpipe-time)) (seconds 0.1)) + (set! f28-0 (+ 32768.0 f28-0)) + ) + (let ((t9-3 deg-diff)) + (set! a0-4 f0-2) + (set! a1-0 f28-0) + (let ((f0-5 (fabs (t9-3 (the-as float a0-4) (the-as float a1-0))))) + (when (and (>= f30-0 49152.0) (>= 4551.1113 f0-5)) + (cond + ((>= f30-0 191146.67) + (add-to-trick-list (-> self board) (board-tricks board-boost) 2000.0) + ) + ((>= f30-0 126520.89) + (add-to-trick-list (-> self board) (board-tricks board-boost) 1000.0) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-boost) 500.0) + ) + ) + (let ((t9-7 lerp-scale) + (a0-8 20480.0) + (a1-4 40960.0) + ) + (set! a2-3 f30-0) + (set! a3-0 49152.0) + (let ((f0-8 (t9-7 a0-8 a1-4 (the-as float a2-3) (the-as float a3-0) 182044.44)) + (v1-28 (-> self control transv)) + ) + (let ((a0-10 (-> self control transv))) + (set! a1-0 (-> self control unknown-matrix01 vector 2)) + (.lvf vf2 (&-> (the-as vector a1-0) quad)) + (.lvf vf1 (&-> a0-10 quad)) + ) + (set! a0-4 f0-8) + (.mov vf3 a0-4) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-28 quad) vf4) + ) + ) + (when (< (vector-length (-> self control transv)) 114688.0) + (let ((t9-8 vector-normalize!)) + (set! a0-4 (-> self control transv)) + (set! a1-0 114688.0) + (t9-8 (the-as vector a0-4) (the-as float a1-0)) + ) + ) + (when (zero? (logand (-> self control old-status) (cshape-moving-flags on-surface))) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self control trans quad)) + (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) + (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when s5-0 + (let ((t9-10 (method-of-type part-tracker activate))) + (t9-10 (the-as part-tracker s5-0) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-11 run-function-in-process) + (a0-13 s5-0) + (a1-8 part-tracker-init) + (a2-8 (-> *part-group-id-table* 119)) + (a3-2 0) + (t0-1 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> gp-0 quad)) + ((the-as (function object object object object object object object object none) t9-11) + a0-13 + a1-8 + a2-8 + a3-2 + t0-1 + t1-0 + t2-0 + t3-0 + ) + ) + (-> s5-0 ppointer) + ) + ) + (let* ((s4-0 (get-process *default-dead-pool* manipy #x4000)) + (s5-1 + (when s4-0 + (let ((t9-13 (method-of-type manipy activate))) + (t9-13 (the-as manipy s4-0) self (symbol->string (-> manipy symbol)) (the-as pointer #x70004000)) + ) + (let ((s5-2 run-function-in-process) + (s3-0 s4-0) + (s2-0 manipy-init) + (s1-0 (-> self entity)) + (t0-2 (art-group-get-by-name *level* "skel-generic-blast" (the-as (pointer uint32) #f))) + (t1-1 #f) + ) + 0 + ((the-as (function object object object object object object none) s5-2) s3-0 s2-0 gp-0 s1-0 t0-2 t1-1) + ) + (-> s4-0 ppointer) + ) + ) + ) + (when s5-1 + (quaternion-copy! (-> (the-as board (-> s5-1 0)) root quat) (-> self control unknown-quaternion00)) + (send-event (ppointer->process s5-1) 'anim-mode 'play1) + (send-event (ppointer->process s5-1) 'anim "idle") + (send-event (ppointer->process s5-1) 'speed #x3fc00000) + (set-vector! (-> (the-as board (-> s5-1 0)) root scale) 0.2 0.4 0.2 1.0) + ) + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) + (let ((gp-1 sound-play-by-name)) + (let ((s5-3 (make-u128 #x74736f (the-as uint #x6f622d6472616f62)))) + (set! a1-0 (new-sound-id)) + (set! a2-3 1024) + (set! a3-0 0) + (set! a0-4 s5-3) + ) + (gp-1 + (the-as sound-name a0-4) + (the-as sound-id a1-0) + (the-as int a2-3) + (the-as int a3-0) + 0 + (sound-group sfx) + #t + ) + ) + ) + ) + ) + ) + ) + ) + (target-board-resolve-points (the-as float a0-4) (the-as float a1-0) (the-as float a2-3) (the-as float a3-0)) + ) + (set! (-> self board turn-anim-tilt?) #t) + (none) + ) + ) + +(defbehavior target-board-halfpipe-check target () + (local-vars (v0-3 collide-action)) + (let ((gp-0 (vector-flatten! + (new-stack-vector0) + (-> self control dynam gravity-normal) + (-> self control unknown-vector22) + ) + ) + ) + (vector-normalize! gp-0 1.0) + (cond + ((and (board-on-ground?) + (= (-> self control ground-pat mode) (pat-mode halfpipe)) + (< 0.0 (vector-dot (-> self control transv) gp-0)) + (and (< (-> self control surface-angle) 0.3) (zero? (-> self board halfpipe-side-time))) + ) + (set! (-> self board halfpipe-side-time) (-> self clock frame-counter)) + (set! v0-3 (logior (-> self control root-prim prim-core action) (collide-action no-normal-reset))) + (set! (-> self control root-prim prim-core action) v0-3) + v0-3 + ) + (else + (if (and (not (board-on-ground?)) + (nonzero? (-> self board halfpipe-side-time)) + (>= (- (-> self clock frame-counter) (-> self board halfpipe-side-time)) (seconds 0.05)) + ) + (go target-board-halfpipe) + ) + (when (>= (- (-> self clock frame-counter) (-> self board halfpipe-side-time)) (seconds 0.2)) + (set! (-> self board halfpipe-side-time) 0) + (set! v0-3 (logclear (-> self control root-prim prim-core action) (collide-action no-normal-reset))) + (set! (-> self control root-prim prim-core action) v0-3) + v0-3 + ) + ) + ) + ) + ) + +(defbehavior target-board-jump-trans target () + (when (and (!= (-> self state-time) (-> self clock frame-counter)) (jump-hit-ground-stuck?)) + (set! (-> self board jump-land-time) (-> self clock frame-counter)) + (go target-board-hit-ground) + ) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.1)) + (target-board-smack-surface?) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 12288.0) + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (zero? (logand (water-flags touch-water) (-> self water flags))) + (zero? (logand (-> self state-flags) (state-flags sf7))) + (not (and (-> self next-state) (= (-> self next-state name) 'target-board-wall-kick))) + ) + ) + (go target-board-jump-kick) + ) + (target-board-spin-check) + (none) + ) + +(defstate target-board-start (target) + :event target-board-handler + :exit target-board-exit + :code (behavior ((arg0 object)) + (target-board-init) + (remove-exit) + (go target-board-get-on) + (none) + ) + :post target-post + ) + +(defstate target-board-stance (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('lip) + (when (and (= (-> self control ground-pat mode) (pat-mode halfpipe)) + (< (-> self control poly-angle) 0.5) + (let ((s5-0 (vector-flatten! + (new-stack-vector0) + (-> self control dynam gravity-normal) + (-> self control unknown-vector22) + ) + ) + ) + (vector-normalize! s5-0 1.0) + (< 0.0 (vector-dot (-> self control transv) s5-0)) + ) + ) + (set! (-> self board halfpipe-lip-time) (-> self clock frame-counter)) + (set! (-> self board halfpipe-side-time) (-> self clock frame-counter)) + (set! (-> self board halfpipe-lip-event) (the-as symbol (-> arg3 param 0))) + (let ((v0-2 (the-as object (logior (-> self control root-prim prim-core action) (collide-action no-normal-reset)))) + ) + (set! (-> self control root-prim prim-core action) (the-as collide-action v0-2)) + v0-2 + ) + ) + ) + (('jump) + (go + target-board-jump + (the-as meters (-> arg3 param 0)) + (the-as meters (-> arg3 param 1)) + (the-as symbol (-> arg3 param 2)) + ) + ) + (else + (target-board-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior () + (set! (-> self control unknown-surface00) *board-walk-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (none) + ) + :exit (behavior () + (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-board-stance) (= v1-3 'target-board-duck-stance)) + ) + ) + ) + (set! (-> self board halfpipe-side-time) 0) + 0 + ) + (logclear! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) + (set! (-> self board turn-anim-tilt?) #f) + (when (not (and (-> self next-state) + (let ((v1-13 (-> self next-state name))) + (or (= v1-13 'target-board-stance) (= v1-13 'target-board-duck-stance) (= v1-13 'target-board-ride-edge)) + ) + ) + ) + (set! (-> self board turn-anim-frame) 0.0) + (set! (-> self board turn-anim-mag) 0.0) + (set! (-> self board turn-anim-vel) 0.0) + (set! (-> self board turn-anim-duck) 0.0) + ) + (target-board-exit) + (none) + ) + :trans (behavior () + (if (and (cpad-hold? (-> self control unknown-cpad-info00 number) l1) + (zero? (logand (-> self state-flags) (state-flags sf9))) + (< (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) + (the-as time-frame (-> *TARGET-bank* ground-timeout)) + ) + ) + (go target-board-duck-stance) + ) + (when (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? 'board) + ) + (let ((gp-0 (vector-flatten! + (new-stack-vector0) + (-> self control dynam gravity-normal) + (-> self control unknown-vector22) + ) + ) + ) + (vector-normalize! gp-0 1.0) + (cond + ((and (< (- (-> self clock frame-counter) (-> self board halfpipe-jump-time)) (seconds 0.5)) + (= (-> self control ground-pat mode) (pat-mode halfpipe)) + ) + ) + ((and (= (-> self control ground-pat mode) (pat-mode halfpipe)) + (< 0.0 (vector-dot (-> self control transv) gp-0)) + (< (-> self control surface-angle) 0.5) + ) + (set! (-> self board halfpipe-jump-time) (-> self clock frame-counter)) + (vector-float*! (-> self control transv) (-> self control transv) 1.5) + ) + (else + (flush-trick-list (-> self board)) + (go target-board-jump (-> *TARGET_BOARD-bank* jump-height-min) (-> *TARGET_BOARD-bank* jump-height-max) #f) + ) + ) + ) + ) + (if (cpad-pressed? (-> self control unknown-cpad-info00 number) r1) + (set! (-> self board spin-ground-press-time) (-> self clock frame-counter)) + ) + (if (and (cpad-hold? (-> self control unknown-cpad-info00 number) r1) + (can-feet? #t) + (< (- (-> self clock frame-counter) (-> self board spin-ground-press-time)) (seconds 0.3)) + (turn-around?) + ) + (set! (-> self board spin-ground-start-time) (-> self clock frame-counter)) + ) + (target-board-halfpipe-check) + (if (target-board-smack-surface?) + 0 + ) + (target-board-anim-trans) + (cond + ((board-on-ground?) + (target-board-ground-check) + (set! (-> self control unknown-surface00) *board-walk-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + ) + ((and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) (seconds 0.1)) + (or (= (-> self control unknown-surface00 name) 'spin) (< 4096.0 (target-height-above-ground))) + ) + (set! (-> self control unknown-surface00) *board-jump-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (target-board-spin-check) + ) + (else + (set! (-> self control unknown-surface00) *board-air-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + ) + ) + (none) + ) + :code (behavior () + (let ((gp-0 (-> self board stance-info))) + (let ((f30-0 (the-as number 0.0)) + (s5-0 30) + (v1-3 (ja-group)) + ) + (when (not (and (and v1-3 (= v1-3 (-> self draw art-group data 161))) (= (ja-group-size) 4))) + (let ((v1-10 (ja-group))) + (when (and v1-10 (= v1-10 (-> self draw art-group data 170))) + (ja-channel-set! 1) + (ja-no-eval :group! (-> self draw art-group data 190) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 190)) frames num-frames) -1)) + 1.8 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.8)) + ) + (suspend) + (set! (-> self board turn-anim-duck) 1.0) + (set! (-> self board turn-anim-duck-vel) 15.0) + ) + ) + (ja-channel-push! 4 (the-as time-frame s5-0)) + (set! f30-0 (ja-frame-num 0)) + ) + ) + (ground-tween-initialize + gp-0 + (the-as uint 0) + (the-as uint (-> self draw art-group data 153)) + (the-as uint (-> self draw art-group data 163)) + (the-as uint (-> self draw art-group data 164)) + (the-as uint (-> self draw art-group data 162)) + (the-as uint (-> self draw art-group data 161)) + ) + (ja :chan 3 :group! (-> self draw art-group data 152)) + (until #f + (target-board-turn-anim 0) + (let ((f0-10 (* 1.6 (-> self control unknown-float25))) + (f1-2 (* 1.6 (-> self control unknown-float26))) + ) + (cond + ((not (-> self board turn-anim-tilt?)) + (set! f0-10 0.0) + (set! f1-2 0.0) + ) + ((= (-> self control ground-pat mode) (pat-mode halfpipe)) + (set! f0-10 0.0) + ) + ) + (let ((t9-9 ground-tween-update) + (a0-24 gp-0) + (a1-4 f0-10) + (a2-3 f1-2) + ) + #x3dcccccd + (t9-9 a0-24 a1-4 a2-3) + ) + ) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) + (cond + ((>= (-> self board turn-anim-duck) 0.0) + (let ((a0-27 (-> self skel root-channel 3))) + (let ((f0-14 (-> self board turn-anim-duck))) + (set! (-> a0-27 frame-interp 1) f0-14) + (set! (-> a0-27 frame-interp 0) f0-14) + ) + (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> self draw art-group data 152))) + (set! (-> a0-27 param 0) 0.0) + (joint-control-channel-group-eval! + a0-27 + (the-as art-joint-anim (-> self draw art-group data 152)) + num-func-chan + ) + ) + ) + (else + (let ((a0-28 (-> self skel root-channel 3))) + (let ((f0-17 (- (-> self board turn-anim-duck)))) + (set! (-> a0-28 frame-interp 1) f0-17) + (set! (-> a0-28 frame-interp 0) f0-17) + ) + (set! (-> a0-28 frame-group) (the-as art-joint-anim (-> self draw art-group data 177))) + (set! (-> a0-28 param 0) 0.0) + (joint-control-channel-group-eval! + a0-28 + (the-as art-joint-anim (-> self draw art-group data 177)) + num-func-chan + ) + ) + ) + ) + (suspend) + (can-play-stance-amibent?) + ) + ) + #f + (none) + ) + :post target-board-post + ) + +(defstate target-board-duck-stance (target) + :event (-> target-board-stance event) + :enter (behavior () + (set! (-> self control unknown-surface00) *board-duck-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (none) + ) + :exit (behavior () + (set! (-> self board turn-anim-duck-vel) -8.0) + ((-> target-board-stance exit)) + (none) + ) + :trans (behavior () + (if (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1)) + ) + (logtest? (-> self state-flags) (state-flags sf9)) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) + (the-as time-frame (-> *TARGET-bank* ground-timeout)) + ) + ) + (begin self (can-exit-duck?)) + ) + (go target-board-stance) + ) + (when (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? 'board) + ) + (let ((gp-0 (vector-flatten! + (new-stack-vector0) + (-> self control dynam gravity-normal) + (-> self control unknown-vector22) + ) + ) + ) + (vector-normalize! gp-0 1.0) + (cond + ((and (< (- (-> self clock frame-counter) (-> self board halfpipe-jump-time)) (seconds 0.5)) + (= (-> self control ground-pat mode) (pat-mode halfpipe)) + ) + ) + ((and (= (-> self control ground-pat mode) (pat-mode halfpipe)) + (< 0.0 (vector-dot (-> self control transv) gp-0)) + (< (-> self control surface-angle) 0.5) + ) + (set! (-> self board halfpipe-jump-time) (-> self clock frame-counter)) + (vector-float*! (-> self control transv) (-> self control transv) 1.5) + ) + (else + (flush-trick-list (-> self board)) + (deg-diff + (vector-y-angle (-> self control unknown-matrix01 vector 2)) + (vector-y-angle (-> self control unknown-vector08)) + ) + (go + target-board-jump + (-> *TARGET_BOARD-bank* duck-jump-height-min) + (-> *TARGET_BOARD-bank* duck-jump-height-max) + (the-as symbol *board-duck-jump-mods*) + ) + ) + ) + ) + ) + (if (cpad-pressed? (-> self control unknown-cpad-info00 number) r1) + (set! (-> self board spin-ground-press-time) (-> self clock frame-counter)) + ) + (if (and (cpad-hold? (-> self control unknown-cpad-info00 number) r1) + (can-feet? #t) + (< (- (-> self clock frame-counter) (-> self board spin-ground-press-time)) (seconds 0.3)) + (turn-around?) + ) + (set! (-> self board spin-ground-start-time) (-> self clock frame-counter)) + ) + (target-board-halfpipe-check) + (if (target-board-smack-surface?) + 0 + ) + (target-board-anim-trans) + (set! (-> self board turn-anim-duck-vel) 8.0) + (cond + ((board-on-ground?) + (target-board-ground-check) + (set! (-> self control unknown-surface00) *board-duck-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + ) + ((and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) (seconds 0.1)) + (or (= (-> self control unknown-surface00 name) 'spin) (< 4096.0 (target-height-above-ground))) + ) + (set! (-> self control unknown-surface00) *board-duck-jump-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (target-board-spin-check) + ) + (else + (set! (-> self control unknown-surface00) *board-air-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + ) + ) + (none) + ) + :code (-> target-board-stance code) + :post target-board-post + ) + +(defstate target-board-jump (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (if (and (= arg2 'edge-grab) (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.1))) + (return #f) + ) + (target-board-handler arg0 arg1 arg2 arg3) + ) + :enter (behavior ((arg0 meters) (arg1 meters) (arg2 symbol)) + (local-vars + (sv-144 (function vector entity-actor skeleton-group vector none :behavior manipy)) + (sv-160 entity) + ) + (if (= arg2 'hit) + (set! arg2 #f) + ) + (when (< (- (-> self clock frame-counter) (-> self board ride-time)) (seconds 0.5)) + (set! arg2 (the-as symbol *board-ride-jump-mods*)) + (let ((s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0))) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + s2-0 + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (set! (-> self control unknown-time-frame00) + (+ (-> self clock frame-counter) + (the int (lerp-scale 225.0 0.0 (vector-dot s2-0 (-> self control unknown-matrix01 vector 2)) -1.0 1.0)) + ) + ) + ) + ) + (set! (-> self control dynam gravity-length) 245760.0) + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((f30-0 0.0)) + (cond + ((and (< 0.0 (-> self board shock-offsetv)) + (< (- (-> self clock frame-counter) (-> self board jump-land-time)) (seconds 0.5)) + (>= (- (-> self clock frame-counter) (-> self board ride-time)) (seconds 0.5)) + ) + (let ((s3-2 (new 'stack-no-clear 'vector))) + (set! (-> s3-2 quad) (-> self control trans quad)) + (set! (-> s3-2 y) (+ 2048.0 (-> s3-2 y))) + (let ((s2-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when s2-1 + (let ((t9-5 (method-of-type part-tracker activate))) + (t9-5 (the-as part-tracker s2-1) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-6 run-function-in-process) + (a0-15 s2-1) + (a1-7 part-tracker-init) + (a2-8 (-> *part-group-id-table* 120)) + (a3-2 0) + (t0-1 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> s3-2 quad)) + ((the-as (function object object object object object object object object none) t9-6) + a0-15 + a1-7 + a2-8 + a3-2 + t0-1 + t1-0 + t2-0 + t3-0 + ) + ) + (-> s2-1 ppointer) + ) + ) + (let* ((s1-1 (get-process *default-dead-pool* manipy #x4000)) + (s2-2 + (when s1-1 + (let ((t9-8 (method-of-type manipy activate))) + (t9-8 (the-as manipy s1-1) self (symbol->string (-> manipy symbol)) (the-as pointer #x70004000)) + ) + (let ((s2-3 run-function-in-process) + (s0-1 s1-1) + ) + (set! sv-144 manipy-init) + (set! sv-160 (-> self entity)) + (let ((t0-2 (art-group-get-by-name *level* "skel-generic-blast" (the-as (pointer uint32) #f))) + (t1-1 #f) + ) + 0 + ((the-as (function object object object object object object none) s2-3) s0-1 sv-144 s3-2 sv-160 t0-2 t1-1) + ) + ) + (-> s1-1 ppointer) + ) + ) + ) + (when s2-2 + (quaternion-copy! (-> (the-as board (-> s2-2 0)) root quat) (-> self control unknown-quaternion00)) + (send-event (ppointer->process s2-2) 'anim-mode 'play1) + (send-event (ppointer->process s2-2) 'anim "idle") + (send-event (ppointer->process s2-2) 'speed #x3fc00000) + (set-vector! (-> (the-as board (-> s2-2 0)) root scale) 0.2 0.4 0.2 1.0) + ) + ) + ) + (set! f30-0 (+ 8192.0 f30-0)) + (add-to-trick-list (-> self board) (board-tricks board-quick-jump) 0.0) + (sound-play "board-q-jump") + ) + (else + (if (= (the-as object arg2) *board-duck-jump-mods*) + (add-to-trick-list (-> self board) (board-tricks board-duck-jump) 0.0) + (add-to-trick-list (-> self board) (board-tricks board-jump) 0.0) + ) + (set! (-> self board unknown-sound-id02) (sound-play "board-jump")) + ) + ) + (init-var-jump + (+ arg0 f30-0) + (+ arg1 f30-0) + #t + #f + (-> self control transv) + (if (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.1)) + 2.0 + 0.0 + ) + ) + ) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (set! arg2 (cond + ((the-as object arg2) + (empty) + arg2 + ) + (else + (the-as symbol *board-jump-mods*) + ) + ) + ) + (set! (-> self control unknown-surface00) (the-as surface arg2)) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (set! (-> self board shock-offsetv) 0.0) + (set! (-> self control unknown-float36) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control unknown-float05))))) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + (none) + ) + :exit target-board-exit + :trans (behavior () + (target-board-jump-trans) + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 6))) + ) + ) + (mod-var-jump #t #f (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + (set! (-> self board shock-offset) (* 0.8 (-> self board shock-offset))) + (none) + ) + :code (behavior ((arg0 meters) (arg1 meters) (arg2 symbol)) + (case arg2 + (('hit) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 158) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 158)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.05)) + ) + (else + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 155) :num! min) + (suspend) + (until (ja-done? 0) + (let ((f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (f0-10 (- 10.0 (ja-aframe-num 0))) + (gp-1 (-> self skel root-channel 0)) + ) + (set! (-> gp-1 param 0) (the float (+ (-> gp-1 frame-group frames num-frames) -1))) + (let ((v1-44 (and (< 0.0 f30-0) (< 0.0 f0-10)))) + (set! (-> gp-1 param 1) + (cond + (v1-44 + (fmin (fmin 1.5 f0-10) (/ (* 5.0 f0-10) (the float (time-to-apex f30-0 -245760.0)))) + ) + ((< (seconds 0.165) (target-time-to-ground)) + 0.5 + ) + (else + 0.25 + ) + ) + ) + ) + (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) + ) + (suspend) + ) + (ja-channel-push! 1 (seconds 0.05)) + ) + ) + (ja :group! (-> self draw art-group data 156)) + (until #f + (suspend) + (ja :num! (loop!)) + ) + #f + (none) + ) + :post target-board-post + ) + +(defstate target-board-halfpipe (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('edge-grab) + (format + #t + "halfpipe found edge ~m~%" + (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + ) + (set! (-> self control unknown-word04) (the-as uint #t)) + (let ((v1-6 *edge-grab-info*)) + (vector-normalize! + (vector-! (-> self control unknown-vector34) (the-as vector (-> v1-6 world-vertex)) (-> v1-6 world-vertex 1)) + 1.0 + ) + ) + (vector-cross! + (-> self control unknown-vector36) + (-> self control unknown-vector34) + (-> self control dynam gravity-normal) + ) + (let ((v1-11 (new-stack-vector0))) + (let ((f0-2 (vector-dot (-> self control unknown-vector36) (-> self control transv)))) + 0.0 + (vector-! + v1-11 + (-> self control transv) + (the-as vector (vector-float*! v1-11 (-> self control unknown-vector36) f0-2)) + ) + ) + (let* ((f0-3 (vector-length v1-11)) + (f1-1 f0-3) + (f2-0 -2048.0) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control unknown-vector36) f2-0)) + (the-as vector (vector-float*! v1-11 v1-11 (/ f0-3 f1-1))) + ) + ) + ) + ) + (('ramp) + (when (not (-> self control unknown-symbol02)) + (let ((v0-3 (the-as object #t))) + (set! (-> self control unknown-symbol02) (the-as float v0-3)) + v0-3 + ) + ) + ) + (('grenade) + (if (< (the-as float (-> arg3 param 0)) + (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + ) + (go target-board-grenade (process->handle arg0)) + ) + ) + (else + (target-board-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior () + (set! (-> self focus-status) (logior (focus-status halfpipe) (-> self focus-status))) + (set! (-> self state-time) (-> self clock frame-counter)) + (logior! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) + (set! (-> self control unknown-surface00) *board-halfpipe-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (set! (-> self control unknown-time-frame17) 0) + (when (< (vector-dot (-> self control unknown-matrix01 vector 1) (-> self control dynam gravity-normal)) 0.7) + (vector-matrix*! + (-> self control unknown-vector00) + (-> self control transv) + (-> self control unknown-matrix00) + ) + (set! (-> self control unknown-vector00 y) 0.0) + (vector-matrix*! + (-> self control transv) + (-> self control unknown-vector00) + (-> self control unknown-matrix01) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #f)) + (set! (-> self control unknown-symbol02) (the-as float #f)) + (target-method-27 *target* *collide-cache* *collide-edge-board-halfpipe-spec*) + (when (not (-> self control unknown-spool-anim00)) + (let ((gp-0 (vector-flatten! + (-> self control unknown-vector36) + (-> self control dynam gravity-normal) + (-> self control unknown-vector22) + ) + ) + ) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 1.0) + (vector-rotate-y! (-> self control unknown-vector34) (-> self control unknown-vector36) 16384.0) + (let ((v1-40 (new-stack-vector0))) + (let ((f0-5 (vector-dot gp-0 (-> self control transv)))) + 0.0 + (vector-! v1-40 (-> self control transv) (the-as vector (vector-float*! v1-40 gp-0 f0-5))) + ) + (let* ((f0-6 (vector-length v1-40)) + (f1-2 f0-6) + (f2-0 -2048.0) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) gp-0 f2-0)) + (the-as vector (vector-float*! v1-40 v1-40 (/ f0-6 f1-2))) + ) + ) + ) + ) + ) + (if (or (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 20480.0) + (< (vector-dot + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00)) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) + ) + 0.3 + ) + ) + (go target-board-turn-to (-> self control transv) (seconds 0.5)) + ) + (none) + ) + :exit (behavior () + (if (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-board-flip) + (= v1-3 'target-board-hold) + (= v1-3 'target-board-trickx) + (= v1-3 'target-board-grenade) + (= v1-3 'target-board-falling) + ) + ) + ) + ) + (logclear! (-> self focus-status) (focus-status halfpipe)) + ) + (send-event *camera* 'relative-position #f) + (remove-setting! 'matrix-blend-max-angle) + (remove-setting! 'matrix-blend-max-partial) + (logclear! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) + (target-board-exit) + (none) + ) + :trans (behavior () + (when (and (or (= (-> self control unknown-symbol02) #t) + (and (< (- (-> self clock frame-counter) (-> self board halfpipe-lip-time)) (seconds 0.1)) + (= (-> self board halfpipe-lip-event) 'lipramp) + ) + ) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (set! (-> self control unknown-symbol02) (the-as float 'done)) + (let ((v1-16 (new-stack-vector0)) + (f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-16 + (-> self control transv) + (the-as vector (vector-float*! v1-16 (-> self control dynam gravity-normal) f0-2)) + ) + (let* ((f1-4 (vector-length v1-16)) + (f2-0 f1-4) + ) + (if (!= f1-4 0.0) + (set! f1-4 0.0) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-2)) + (the-as vector (vector-float*! v1-16 v1-16 (/ f1-4 f2-0))) + ) + ) + ) + ) + (set! (-> self board halfpipe-time) (-> self clock frame-counter)) + (if (= (-> self control unknown-pat-surface01 mode) (pat-mode halfpipe)) + (set! (-> self board halfpipe-gspot-time) (-> self clock frame-counter)) + ) + (when (jump-hit-ground-stuck?) + (vector-float*! (-> self control transv) (-> self control transv) 1.5) + (go target-board-turn-to (-> self control transv) (seconds 0.5)) + ) + (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) + (>= (- (-> self clock frame-counter) (-> self board halfpipe-jump-time)) (seconds 0.6)) + (< (- (-> self clock frame-counter) (-> self state-time)) + (the-as time-frame (-> *TARGET-bank* ground-timeout)) + ) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (set! (-> self board halfpipe-jump-time) (-> self clock frame-counter)) + (vector-float*! (-> self control transv) (-> self control transv) 1.5) + ) + (target-board-spin-check) + (cond + ((> (-> self control unknown-time-frame17) 0) + (cond + ((< 0.7 (-> self control unknown-float10)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self control unknown-vector36 quad)) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 1.0) + (if (< 0.7 (vector-dot (-> self control unknown-vector08) gp-0)) + (+! (-> self control unknown-time-frame17) + (- (-> self clock frame-counter) (-> self clock old-frame-counter)) + ) + (set! (-> self control unknown-time-frame17) 1) + ) + ) + ) + (else + (set! (-> self control unknown-time-frame17) 1) + ) + ) + ) + ((and (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + (< (-> self board halfpipe-lip-time) (+ (-> self state-time) (seconds -0.2))) + ) + (set! (-> self control unknown-time-frame17) 1) + ) + ) + (when (or (>= (-> self control unknown-time-frame17) (seconds 0.05)) + (and (>= (- (-> self clock frame-counter) (-> self board halfpipe-gspot-time)) (seconds 0.5)) + (< (-> self board halfpipe-lip-time) (+ (-> self state-time) (seconds -0.2))) + ) + ) + (+! (-> self control transv x) (* 20480.0 (-> self control unknown-vector36 x))) + (+! (-> self control transv z) (* 20480.0 (-> self control unknown-vector36 z))) + (go target-board-stance) + ) + (target-board-halfpipe-trans) + (none) + ) + :code (behavior () + (cond + ((< (- (-> self clock frame-counter) (-> self board halfpipe-jump-time)) (seconds 0.5)) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 155) :num! (seek! (ja-aframe 8.0 0) 0.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 8.0 0) 0.5)) + ) + (ja-no-eval :group! (-> self draw art-group data 155) + :num! (seek! (ja-aframe 10.0 0) 0.2) + :frame-num (ja-aframe 8.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 10.0 0) 0.2)) + ) + (ja-no-eval :group! (-> self draw art-group data 155) + :num! (seek! (ja-aframe 12.0 0) 0.1) + :frame-num (ja-aframe 10.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 12.0 0) 0.1)) + ) + (sleep-code) + ) + (else + ((the-as (function none :behavior target) (-> target-board-stance code))) + ) + ) + (none) + ) + :post target-board-post + ) + +(defstate target-board-falling (target) + :event target-board-handler + :enter (behavior () + (if (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2) (not *pause-lock*)) + (set! (-> self control unknown-surface00) *board-air-mods*) + (set! (-> self control unknown-surface00) *board-jump-mods*) + ) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (none) + ) + :exit (-> target-board-halfpipe exit) + :trans (behavior () + (target-board-jump-trans) + (if (logtest? (focus-status halfpipe) (-> self focus-status)) + (target-board-halfpipe-trans) + ) + (when (and (= *cheat-mode* 'debug) + (and (cpad-hold? (-> self control unknown-cpad-info00 number) r2) (not *pause-lock*)) + ) + (set! (-> self control unknown-surface00) *board-air-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + ) + (none) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 (-> self draw art-group data 156))) + ) + ((let ((v1-8 (ja-group))) + (and v1-8 (= v1-8 (-> self draw art-group data 187))) + ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.5)) + ) + ((let ((v1-22 (ja-group))) + (and v1-22 (or (= v1-22 (-> self draw art-group data 178)) + (= v1-22 (-> self draw art-group data 182)) + (= v1-22 (-> self draw art-group data 159)) + (= v1-22 (-> self draw art-group data 181)) + ) + ) + ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.2)) + ) + (else + (let ((v1-36 (ja-group))) + (cond + ((and v1-36 (= v1-36 (-> self draw art-group data 176))) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.1)) + ) + (else + (ja-channel-push! 1 (seconds 0.5)) + ) + ) + ) + ) + ) + ) + (cond + ((logtest? (focus-status halfpipe) (-> self focus-status)) + (ja :group! (-> self draw art-group data 152) :num! (identity (ja-aframe 0.0 0))) + (loop + (suspend) + (ja-blend-eval) + ) + ) + (else + (ja :group! (-> self draw art-group data 156)) + (loop + (suspend) + (ja-blend-eval) + (ja :num! (loop!)) + ) + ) + ) + (none) + ) + :post target-board-post + ) + +(defstate target-board-jump-kick (target) + :event target-board-handler + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self control unknown-surface00) *board-jump-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (sound-play "board-k-jump") + (none) + ) + :exit target-board-exit + :trans (behavior () + (if (jump-hit-ground-stuck?) + (go target-board-hit-ground) + ) + (target-board-smack-surface?) + (cond + ((< (- (-> self clock frame-counter) (-> self board smack-surface-time)) (seconds 0.2)) + (go target-board-wall-kick (-> self board smack-normal) (-> self board smack-speed)) + ) + ((< (- (-> self clock frame-counter) (-> self board glance-time)) (seconds 0.2)) + (go + target-board-wall-kick + (vector-normalize-copy! (-> self control unknown-vector38) (-> self board glance-out-transv) 1.0) + (-> self board glance-speed) + ) + ) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 154) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 154)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 2)) + (ja :group! (-> self draw art-group data 156)) + (until #f + (suspend) + (ja :num! (loop!)) + ) + #f + (none) + ) + :post target-board-post + ) + +(defstate target-board-wall-kick (target) + :event target-board-handler + :enter (behavior ((arg0 vector) (arg1 float)) + (sound-play "board-kick") + (set! (-> self control transv quad) (-> arg0 quad)) + (vector-xz-normalize! (-> self control transv) (* 0.8 arg1)) + (set! (-> self control unknown-word04) (the-as uint (fmax 81920.0 (* 0.8 arg1)))) + (set! (-> self control unknown-vector38 quad) (-> arg0 quad)) + (set! (-> self control transv y) 0.0) + (vector-turn-to (vector-negate! (new 'stack-no-clear 'vector) (-> self control transv))) + (set! (-> self control transv y) (- (sqrtf (* 24576.0 (-> self control dynam gravity-length))) + (* 0.008333334 (- (-> self control dynam gravity-length))) + ) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self control unknown-surface00) *board-wall-kick-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (set! (-> self board smack-surface-time) 0) + 0 + (none) + ) + :exit target-board-exit + :trans target-board-jump-trans + :code (behavior ((arg0 vector) (arg1 float)) + (ja-no-eval :group! (-> self draw art-group data 188) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 188)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (if (and (jump-hit-ground-stuck?) (< 31.0 (ja-aframe-num 0))) + (go target-board-hit-ground) + ) + (let ((v1-21 (-> self control unknown-vector38))) + (set! (-> self control transv x) (-> v1-21 x)) + (set! (-> self control transv z) (-> v1-21 z)) + ) + (vector-xz-normalize! (-> self control transv) (the-as float (-> self control unknown-word04))) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (suspend) + (ja :num! (seek!)) + ) + enter-state + (go target-board-falling) + (none) + ) + :post target-board-post + ) + +(defstate target-board-flip (target) + :event (-> target-board-jump event) + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (set! (-> self control unknown-word04) (the-as uint arg2)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control transv) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + (set! (-> self control dynam gravity-length) 245760.0) + (set! (-> self state-time) (-> self clock frame-counter)) + (cond + ((= arg2 'halfpipe) + (set! (-> self focus-status) (logior (focus-status halfpipe) (-> self focus-status))) + (target-board-halfpipe-trans) + ) + (else + (init-var-jump arg0 arg1 #t #f (-> self control transv) 1.0) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (set! (-> self control unknown-float36) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control unknown-float05))))) + ) + ) + ) + (set! (-> self control unknown-surface00) *board-flip-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (let ((v1-25 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-25 command) (sound-command set-param)) + (set! (-> v1-25 id) (-> self board unknown-sound-id02)) + (set! (-> v1-25 params volume) -4) + (set! (-> v1-25 auto-time) 72) + (set! (-> v1-25 auto-from) 2) + (set! (-> v1-25 params mask) (the-as uint 17)) + (-> v1-25 id) + ) + (set! (-> self control unknown-sound-id00) (sound-play "board-flip")) + (target-start-attack) + (target-danger-set! 'board-spin #f) + (none) + ) + :exit (behavior () + (target-danger-set! 'harmless #f) + (set! (-> self board flip-control) 0.0) + (add-to-trick-list + (-> self board) + (board-tricks board-flip) + (+ (* 500.0 (the float (-> self board flip-count))) (if (>= (-> self board flip-count) 2) + 2000.0 + 0.0 + ) + ) + ) + (let ((v1-9 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-9 command) (sound-command set-param)) + (set! (-> v1-9 id) (-> self control unknown-sound-id00)) + (set! (-> v1-9 params volume) -4) + (set! (-> v1-9 auto-time) 24) + (set! (-> v1-9 auto-from) 2) + (set! (-> v1-9 params mask) (the-as uint 17)) + (-> v1-9 id) + ) + ((-> target-board-halfpipe exit)) + (none) + ) + :trans (behavior () + (cond + ((= (-> self control unknown-spool-anim00) 'halfpipe) + (target-board-halfpipe-trans) + ) + (else + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 6))) + ) + ) + (mod-var-jump #t #f (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + (none) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (let ((gp-0 (>= (-> self board flip-control) 0.0))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 x) 0.0) + (set! (-> s5-0 y) 0.0) + (set! (-> s5-0 z) (* -0.0078125 (+ -128.0 (the float (-> self control unknown-cpad-info00 lefty))))) + (set! (-> s5-0 w) 1.0) + (let ((f0-9 (analog-input (the int (* 128.0 (-> s5-0 z))) 0.0 96.0 110.0 1.0)) + (s4-0 0) + ) + (while (not (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r1)) + ) + (or (= f0-9 0.0) (jump-hit-ground-stuck?) (< (target-time-to-ground) (seconds 0.5))) + ) + (nonzero? s4-0) + ) + ) + (cond + (gp-0 + (cond + ((zero? s4-0) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 159) :num! (seek! (ja-aframe 15.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 15.0 0))) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 181) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 181)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ((zero? s4-0) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 178) :num! (seek! (ja-aframe 10.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 10.0 0))) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 182) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 182)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (+! (-> self board flip-count) 1) + (set! f0-9 (analog-input (the int (* 128.0 (-> s5-0 z))) 0.0 96.0 110.0 1.0)) + (+! s4-0 1) + ) + ) + ) + (cond + (gp-0 + (ja-no-eval :group! (-> self draw art-group data 159) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 159)) frames num-frames) -1))) + :frame-num (ja-aframe 15.0 0) + ) + (until (ja-done? 0) + (if (jump-hit-ground-stuck?) + (go target-board-hit-ground) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 178) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 178)) frames num-frames) -1))) + :frame-num (ja-aframe 10.0 0) + ) + (until (ja-done? 0) + (if (jump-hit-ground-stuck?) + (go target-board-hit-ground) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (go target-board-falling) + (none) + ) + :post target-board-post + ) + +(defstate target-board-hold (target) + :event (-> target-board-jump event) + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (set! (-> self control unknown-word04) (the-as uint arg2)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control transv) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + (set! (-> self control dynam gravity-length) 245760.0) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self board unknown-time-frame04) (-> self clock frame-counter)) + (cond + ((= arg2 'halfpipe) + (set! (-> self focus-status) (logior (focus-status halfpipe) (-> self focus-status))) + (target-board-halfpipe-trans) + ) + (else + (init-var-jump arg0 arg1 #t #f (-> self control transv) 1.0) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (set! (-> self control unknown-float36) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control unknown-float05))))) + ) + ) + ) + (set! (-> self control unknown-surface00) *board-flip-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (set! (-> self control dynam gravity-length) 147456.0) + (none) + ) + :exit (behavior () + (set! (-> self board unknown-float01) 0.0) + (set! (-> self board unknown-time-frame05) (-> self clock frame-counter)) + (let ((v1-3 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-3 command) (sound-command set-param)) + (set! (-> v1-3 id) (-> self board unknown-sound-id01)) + (set! (-> v1-3 params volume) -4) + (set! (-> v1-3 auto-time) 24) + (set! (-> v1-3 auto-from) 2) + (set! (-> v1-3 params mask) (the-as uint 17)) + (-> v1-3 id) + ) + (let ((v1-7 (ja-group))) + (if (and v1-7 (= v1-7 (-> self draw art-group data 187))) + (sound-play "board-boots") + ) + ) + ((-> target-board-halfpipe exit)) + (none) + ) + :trans (behavior () + (target-board-spin-check) + (cond + ((= (-> self control unknown-spool-anim00) 'halfpipe) + (target-board-halfpipe-trans) + ) + (else + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 6))) + ) + ) + (mod-var-jump #t #f (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + (none) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 x) 0.0) + (set! (-> v1-0 y) 0.0) + (set! (-> v1-0 z) (* -0.0078125 (+ -128.0 (the float (-> self control unknown-cpad-info00 lefty))))) + (set! (-> v1-0 w) 1.0) + (let ((f30-0 (analog-input (the int (* 128.0 (-> v1-0 z))) 0.0 96.0 110.0 1.0))) + (while (not (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1)) + ) + (jump-hit-ground-stuck?) + (< (target-time-to-ground) (seconds 0.3)) + ) + ) + (cond + ((< f30-0 0.0) + (let ((v1-3 (ja-group))) + (cond + ((and v1-3 (= v1-3 (-> self draw art-group data 183))) + (ja :num! (loop!)) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-method) 500.0) + (set! (-> self board unknown-sound-id01) (sound-play "board-method")) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! (-> self draw art-group data 174) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 174)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja :group! (-> self draw art-group data 183) :num! min) + ) + ) + ) + ) + ((let ((v1-45 (ja-group))) + (and v1-45 (= v1-45 (-> self draw art-group data 185))) + ) + (ja :num! (loop!)) + ) + ((< 40960.0 (target-height-above-ground)) + (add-to-trick-list (-> self board) (board-tricks board-nosegrab) 500.0) + (set! (-> self board unknown-sound-id01) (sound-play "board-nosegrab")) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! (-> self draw art-group data 173) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 173)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja :group! (-> self draw art-group data 185) :num! min) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-noseflip) 500.0) + (set! (-> self board unknown-sound-id01) (sound-play "board-noseflip")) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! (-> self draw art-group data 187) :num! (seek! (ja-aframe 20.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 20.0 0))) + ) + (goto cfg-36) + ) + ) + (suspend) + ) + ) + ) + (label cfg-36) + (let ((v1-121 (ja-group))) + (cond + ((and v1-121 (= v1-121 (-> self draw art-group data 183))) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! (-> self draw art-group data 184) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 184)) frames num-frames) -1)) + 1.5 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ((let ((v1-151 (ja-group))) + (and v1-151 (= v1-151 (-> self draw art-group data 185))) + ) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! (-> self draw art-group data 186) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 186)) frames num-frames) -1)) + 1.5 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ) + ) + (let ((v1-179 (new-stack-vector0)) + (f0-48 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-179 + (-> self control transv) + (the-as vector (vector-float*! v1-179 (-> self control dynam gravity-normal) f0-48)) + ) + (let* ((f1-5 (vector-length v1-179)) + (f2-2 f1-5) + ) + (if (< 0.0 f0-48) + (set! f0-48 0.0) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-48)) + (the-as vector (vector-float*! v1-179 v1-179 (/ f1-5 f2-2))) + ) + ) + ) + (go target-board-falling) + (none) + ) + :post target-board-post + ) + +(defstate target-board-trickx (target) + :event (-> target-board-jump event) + :enter (-> target-board-hold enter) + :exit (behavior () + (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) + (sound-play "board-boots") + ((-> target-board-hold exit)) + (none) + ) + :trans (behavior () + (target-board-spin-check) + (when (!= (-> self control unknown-spool-anim00) 'halfpipe) + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 6))) + ) + ) + (mod-var-jump #t #f (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) + ) + (when (jump-hit-ground-stuck?) + (set! (-> self board jump-land-time) (-> self clock frame-counter)) + (go target-board-hit-ground) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + (none) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (let ((gp-0 (>= (-> self board unknown-float00) 0.0)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 x) 0.0) + (set! (-> s5-0 y) 0.0) + (set! (-> s5-0 z) (* -0.0078125 (+ -128.0 (the float (-> self control unknown-cpad-info00 lefty))))) + (set! (-> s5-0 w) 1.0) + (let ((f0-9 (analog-input (the int (* 128.0 (-> s5-0 z))) 0.0 96.0 110.0 1.0)) + (s4-0 0) + ) + (while (not (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r1)) + ) + (or (= f0-9 0.0) (jump-hit-ground-stuck?) (< (target-time-to-ground) (seconds 0.5))) + ) + (nonzero? s4-0) + ) + ) + (cond + (gp-0 + (add-to-trick-list (-> self board) (board-tricks board-kickflip) 500.0) + (set! (-> self board unknown-sound-id01) (sound-play "board-kickflip")) + (ja-channel-push! 1 (seconds 0.07)) + (ja-no-eval :group! (-> self draw art-group data 175) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 175)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (send-event (ppointer->process (-> self sidekick)) 'matrix #f) + (ja-no-eval :group! (-> self draw art-group data 192) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 192)) frames num-frames) -1)) + 1.05 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.05)) + ) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) + (ja-no-eval :group! (-> self draw art-group data 193) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 193)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-board-spin) 500.0) + (set! (-> self board unknown-sound-id01) (sound-play "board-boardspin")) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 176) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 176)) frames num-frames) -1)) + 0.95 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.95)) + ) + ) + ) + (+! (-> self board trickx-count) 1) + (set! f0-9 (analog-input (the int (* 128.0 (-> s5-0 z))) 0.0 96.0 110.0 1.0)) + (+! s4-0 1) + ) + ) + ) + (go target-board-falling) + (none) + ) + :post target-board-post + ) + +(defstate target-board-hit-ground (target) + :event target-board-handler + :enter (behavior () + (logclear! (-> self focus-status) (focus-status halfpipe)) + (if (= (-> self control ground-pat mode) (pat-mode halfpipe)) + (go target-board-turn-to (-> self control transv) (seconds 0.5)) + ) + (none) + ) + :exit target-board-exit + :trans (behavior () + (when (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? 'board) + ) + (flush-trick-list (-> self board)) + (go target-board-jump (-> *TARGET_BOARD-bank* jump-height-min) (-> *TARGET_BOARD-bank* jump-height-max) #f) + ) + (if (and (cpad-hold? (-> self control unknown-cpad-info00 number) l1) + (zero? (logand (-> self state-flags) (state-flags sf9))) + ) + (go target-board-duck-stance) + ) + (if (target-board-smack-surface?) + 0 + ) + (none) + ) + :code (behavior () + (set! (-> self control unknown-surface00) *board-walk-mods*) + (let ((v1-3 (ja-group))) + (cond + ((and v1-3 (or (= v1-3 (-> self draw art-group data 184)) (= v1-3 (-> self draw art-group data 186)))) + (ja-no-eval :num! (seek! max 1.5)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-18 (ja-group))) + (and v1-18 (= v1-18 (-> self draw art-group data 183))) + ) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! (-> self draw art-group data 184) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 184)) frames num-frames) -1)) + 1.5 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ((let ((v1-48 (ja-group))) + (and v1-48 (= v1-48 (-> self draw art-group data 185))) + ) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! (-> self draw art-group data 186) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 186)) frames num-frames) -1)) + 1.5 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ) + ) + (go target-board-stance) + (none) + ) + :post target-board-post + ) + +(defstate target-board-turn-to (target) + :event target-board-handler + :enter (behavior ((arg0 vector) (arg1 time-frame)) + (logclear! (-> self focus-status) (focus-status halfpipe)) + (when (!= (-> self control dynam gravity-length) 245760.0) + (let ((v1-6 (new-stack-vector0)) + (f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-6 + (-> self control transv) + (the-as vector (vector-float*! v1-6 (-> self control dynam gravity-normal) f0-2)) + ) + (let* ((f1-3 (vector-length v1-6)) + (f2-0 f1-3) + ) + (if (< f0-2 0.0) + (set! f0-2 (* 5.0 f0-2)) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-2)) + (the-as vector (vector-float*! v1-6 v1-6 (/ f1-3 f2-0))) + ) + ) + ) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self control unknown-surface00) *board-turn-to-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (set! (-> self control unknown-time-frame17) arg1) + (vector-normalize-copy! (-> self control unknown-vector38) arg0 1.0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control unknown-vector38) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (set! (-> self control unknown-time-frame00) (+ (-> self clock frame-counter) arg1)) + (none) + ) + :exit target-board-exit + :trans (behavior () + (when (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? 'board) + ) + (flush-trick-list (-> self board)) + (go target-board-jump (-> *TARGET_BOARD-bank* jump-height-min) (-> *TARGET_BOARD-bank* jump-height-max) #f) + ) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (-> self control unknown-time-frame17)) + (go target-board-stance) + ) + (target-board-anim-trans) + (when (board-on-ground?) + (let ((gp-0 (-> self board turn-anim-tilt?))) + (target-board-ground-check) + (set! (-> self board turn-anim-tilt?) gp-0) + ) + ) + (set! (-> self board turn-anim-targ) (* 10.0 (-> self board turn-anim-targ))) + (none) + ) + :code (-> target-board-stance code) + :post target-board-post + ) + +(defstate target-board-ride-edge (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('edge-grab 'push-transv 'push-trans) + #f + ) + (('end-mode) + (when (-> arg3 param 0) + (let ((v1-6 (/ (- (-> self clock frame-counter) (-> self board ride-start-time)) 300))) + (if (> v1-6 0) + (add-to-trick-list (-> self board) (board-tricks board-rail) (* 100.0 (the float v1-6))) + ) + ) + ) + (go target-board-turn-to (-> self control transv) (seconds 0.2)) + ) + (else + (target-board-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior ((arg0 symbol) (arg1 object) (arg2 object) (arg3 float)) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self focus-status) (logior (focus-status rail) (-> self focus-status))) + (logior! (-> self control root-prim prim-core action) (collide-action can-ride)) + (set! (-> self control unknown-surface00) *board-ride-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (let ((v1-12 (-> self control unknown-vector00))) + (set! (-> self board ride-speed) (sqrtf (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z))))) + ) + (set! (-> self board ride-lean-targ) 0.0) + (set! (-> self board ride-lean) 0.0) + (set! (-> self board ride-leanv) 0.0) + (set! (-> self board ride-tilt-targ) 0.0) + (set! (-> self board ride-tilt) 0.0) + (set! (-> self board ride-tiltv) 0.0) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self board spin-control) 0.0) + (set! (-> self board flip-control) 0.0) + (set! (-> self board flip-count) 0) + (set! (-> self board unknown-float00) 0.0) + (set! (-> self board unknown-float01) 0.0) + (set! (-> self control unknown-word04) (the-as uint #t)) + (target-board-compute-edge) + (let ((f0-17 (vector-dot (-> self control unknown-matrix01 vector 2) (-> self control unknown-vector34)))) + (cond + ((< 0.7 f0-17) + (set! (-> self board ride-mode) (the-as uint 0)) + (set! (-> self board ride-rot) 0.0) + ) + ((< f0-17 -0.7) + (set! (-> self board ride-mode) (the-as uint 1)) + (set! (-> self board ride-rot) 32768.0) + ) + (else + (let ((f0-21 (vector-dot (the-as vector (-> self control unknown-matrix01)) (-> self control unknown-vector34)))) + (cond + ((< 0.7 f0-21) + (set! (-> self board ride-mode) (the-as uint 2)) + (set! (-> self board ride-rot) -16384.0) + ) + (else + (set! (-> self board ride-mode) (the-as uint 3)) + (set! (-> self board ride-rot) 16384.0) + ) + ) + ) + ) + ) + ) + (let ((f0-24 0.0)) + (if arg0 + (set! f0-24 (+ 250.0 f0-24)) + ) + (if (and (!= (-> self board ride-rot-old) -1.0) (!= (-> self board ride-rot) (-> self board ride-rot-old))) + (set! f0-24 (+ 500.0 f0-24)) + ) + (add-to-trick-list (-> self board) (board-tricks board-rail-jump) f0-24) + ) + (none) + ) + :exit (behavior () + (logclear! (-> self control status) (cshape-moving-flags csmf16)) + (let ((v1-2 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-2 command) (sound-command set-param)) + (set! (-> v1-2 id) (the-as sound-id (-> self board ride-sound-id))) + (set! (-> v1-2 params volume) -4) + (set! (-> v1-2 auto-time) 24) + (set! (-> v1-2 auto-from) 2) + (set! (-> v1-2 params mask) (the-as uint 17)) + (-> v1-2 id) + ) + ((-> target-board-stance exit)) + (set! (-> self neck flex-blend) 1.0) + (logclear! (-> self focus-status) (focus-status rail)) + (logclear! (-> self control root-prim prim-core action) (collide-action can-ride)) + (set! (-> self board ride-rot-old) (-> self board ride-rot)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self control trans quad)) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (if (collide-shape-moving-method-55 + (-> self control) + s5-0 + (logclear (-> self control root-prim prim-core collide-with) (collide-spec water)) + 8192.0 + 81920.0 + 1024.0 + ) + (set! (-> self control unknown-pat-surface01) (-> s5-0 best-other-tri pat)) + ) + ) + (if (< (-> self control trans y) (-> self control gspot-pos y)) + (set! (-> gp-0 quad) (-> self control gspot-pos quad)) + ) + (collide-shape-method-29 + (-> self control) + (vector+! (new 'stack-no-clear 'vector) gp-0 (new 'static 'vector :y 204.8 :w 1.0)) + ) + ) + (none) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (when (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? 'board) + ) + (let ((v1-15 (/ (- (-> self clock frame-counter) (-> self board ride-start-time)) 300))) + (if (> v1-15 0) + (add-to-trick-list (-> self board) (board-tricks board-rail) (* 100.0 (the float v1-15))) + ) + ) + (set! (-> self control trans y) (+ 1228.8 (-> self control trans y))) + (go + target-board-jump + (-> *TARGET_BOARD-bank* jump-height-min) + (-> *TARGET_BOARD-bank* jump-height-max) + (the-as symbol *board-ride-jump-mods*) + ) + ) + (if (cpad-pressed? (-> self control unknown-cpad-info00 number) circle square) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + (if (-> self control unknown-spool-anim00) + (set! (-> self board ride-button-time) (-> self clock frame-counter)) + ) + (set! (-> self board turn-anim-targ) (* (-> self board ride-lean) (- (-> *TARGET_BOARD-bank* turn-frames)))) + (cond + ((= (-> self board ride-speed) 0.0) + (let ((v1-43 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-43 command) (sound-command set-param)) + (set! (-> v1-43 id) (the-as sound-id (-> self board ride-sound-id))) + (set! (-> v1-43 params volume) -4) + (set! (-> v1-43 auto-time) 24) + (set! (-> v1-43 auto-from) 2) + (set! (-> v1-43 params mask) (the-as uint 17)) + (-> v1-43 id) + ) + ) + (else + (let ((f30-1 + (* (lerp-scale 0.7 1.0 (fabs (-> self board ride-lean)) 0.0 1.0) + (lerp-scale + 0.8 + 1.0 + (fabs (-> self board ride-speed)) + 0.0 + (* 0.5 (-> self control unknown-surface00 transv-max)) + ) + ) + ) + (f0-23 + (+ (lerp-scale 0.0 0.05 (fabs (-> self board ride-lean)) 0.0 1.0) + (lerp-scale + -0.05 + 0.0 + (fabs (-> self board ride-speed)) + 0.0 + (* 0.3 (-> self control unknown-surface00 transv-max)) + ) + ) + ) + ) + (sound-play-by-name + (static-sound-name "board-rail") + (the-as sound-id (-> self board ride-sound-id)) + (the int (* 1024.0 f30-1)) + (the int (* 1524.0 f0-23)) + 0 + (sound-group sfx) + #t + ) + ) + ) + ) + (when (< 4096.0 (-> self board ride-speed)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((v1-63 (-> self control trans)) + (a0-40 (-> self board ride-dir)) + (f0-27 -4096.0) + ) + (.lvf vf2 (&-> a0-40 quad)) + (.lvf vf1 (&-> v1-63 quad)) + (let ((v1-64 f0-27)) + (.mov vf3 v1-64) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> gp-0 quad) vf4) + (set! (-> *part-id-table* 431 init-specs 1 initial-valuef) + (lerp-scale + 0.1 + 2.0 + (fabs (-> self board ride-speed)) + 0.0 + (* 0.3 (-> self control unknown-surface00 transv-max)) + ) + ) + (let ((t9-10 sp-launch-particles-var) + (a0-42 *sp-particle-system-2d*) + (a1-12 (-> *part-id-table* 431)) + (a2-9 *launch-matrix*) + ) + (set! (-> a2-9 trans quad) (-> gp-0 quad)) + (t9-10 a0-42 a1-12 a2-9 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + (none) + ) + ) + :code (behavior ((arg0 symbol) (arg1 object) (arg2 object) (arg3 float)) + (let* ((v1-1 (-> self board ride-mode)) + (gp-0 (cond + ((zero? v1-1) + (-> self draw art-group data 167) + ) + ((= v1-1 1) + (-> self draw art-group data 166) + ) + ((= v1-1 2) + (-> self draw art-group data 169) + ) + ((= v1-1 3) + (-> self draw art-group data 168) + ) + (else + (the-as art-element #f) + ) + ) + ) + ) + (when (!= (ja-group) gp-0) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-0)) + ) + ) + (until #f + (ja :num-func num-func-identity + :frame-num (ja-aframe + (fmax + -5.0 + (fmin 5.0 (+ (* 3.0 (-> self board ride-lean)) + (* 0.5 (sin (* 145.63556 (the float (- (-> self clock frame-counter) (-> self state-time)))))) + ) + ) + ) + 0 + ) + ) + (suspend) + ) + #f + (none) + ) + :post (behavior () + (target-board-ride-post) + (none) + ) + ) + +(defstate target-board-grenade (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('target) + (handle->process (-> self control unknown-handle02)) + ) + (else + (target-board-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior ((arg0 handle)) + (set! (-> self focus-status) (logior (focus-status halfpipe) (-> self focus-status))) + (set! (-> self control unknown-handle02) arg0) + (set! (-> self state-time) (-> self clock frame-counter)) + (logior! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) + (set! (-> self control unknown-surface00) *board-halfpipe-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (let ((v1-12 (new-stack-vector0)) + (f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-12 + (-> self control transv) + (the-as vector (vector-float*! v1-12 (-> self control dynam gravity-normal) f0-1)) + ) + (let* ((f1-2 (vector-length v1-12)) + (f2-0 f1-2) + ) + (if (and (!= f1-2 0.0) (< 2.0 (/ f0-1 f1-2))) + (set! f1-2 0.0) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-1)) + (the-as vector (vector-float*! v1-12 v1-12 (/ f1-2 f2-0))) + ) + ) + ) + (none) + ) + :exit (behavior () + (send-event (handle->process (-> self control unknown-handle02)) 'exit) + ((-> target-board-halfpipe exit)) + (none) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (set! (-> self board halfpipe-time) (-> self clock frame-counter)) + (if (= (-> self control unknown-pat-surface01 mode) (pat-mode halfpipe)) + (set! (-> self board halfpipe-gspot-time) (-> self clock frame-counter)) + ) + (when (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) + (let ((v1-11 (-> self control transv))) + (let ((a0-8 (-> self control transv)) + (a1-2 (-> self control dynam gravity-normal)) + (f0-1 (* 122880.0 (-> self clock seconds-per-frame))) + ) + (.lvf vf2 (&-> a1-2 quad)) + (.lvf vf1 (&-> a0-8 quad)) + (let ((a0-9 f0-1)) + (.mov vf3 a0-9) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-11 quad) vf4) + ) + ) + (when (jump-hit-ground-stuck?) + (vector-float*! (-> self control transv) (-> self control transv) 1.5) + (go target-board-turn-to (-> self control transv) (seconds 0.5)) + ) + (when (>= (- (-> self clock frame-counter) (-> self board halfpipe-gspot-time)) (seconds 0.5)) + (+! (-> self control transv x) (* 20480.0 (-> self control unknown-vector36 x))) + (+! (-> self control transv z) (* 20480.0 (-> self control unknown-vector36 z))) + (go target-board-stance) + ) + (none) + ) + ) + :code (behavior ((arg0 handle)) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 172) :num! (seek! (ja-aframe 19.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 19.0 0))) + ) + (let ((a1-5 (-> self node-list data 41)) + (s5-2 (new 'stack-no-clear 'projectile-init-by-other-params)) + ) + (let ((a0-7 (handle->process arg0))) + (set! (-> s5-2 ent) (if a0-7 + (-> a0-7 entity) + ) + ) + ) + (set! (-> s5-2 charge) 0.1) + (set! (-> s5-2 options) (projectile-options)) + (set! (-> s5-2 notify-handle) (the-as handle #f)) + (set! (-> s5-2 owner-handle) (the-as handle #f)) + (set! (-> s5-2 ignore-handle) (process->handle self)) + (let* ((v1-24 *game-info*) + (a0-13 (+ (-> v1-24 attack-id) 1)) + ) + (set! (-> v1-24 attack-id) a0-13) + (set! (-> s5-2 attack-id) a0-13) + ) + (set! (-> s5-2 timeout) (new 'static 'handle :process #x4b0 :u64 #x4b0)) + (vector<-cspace! (-> s5-2 pos) a1-5) + (set! (-> s5-2 vel quad) (-> *zero-vector* quad)) + (spawn-projectile grenade s5-2 self *default-dead-pool*) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (sleep-code) + (none) + ) + :post target-board-post + ) + +(defstate target-board-get-on (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('attack 'attack-or-shove 'attack-invinc) + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as process (-> arg3 param 0)) + target-hit + ) + ) + (else + (target-generic-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior () + (set! (-> self board shock-offsetv) 0.0) + (set! (-> self state-time) (-> self clock frame-counter)) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (set! (-> self control unknown-surface00) *board-jump-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (let ((a0-5 (target-time-to-ground))) + (cond + ((logtest? (water-flags touch-water) (-> self water flags)) + (let ((v1-10 (new-stack-vector0))) + (let ((f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-10 + (-> self control transv) + (the-as vector (vector-float*! v1-10 (-> self control dynam gravity-normal) f0-2)) + ) + ) + (let* ((f0-3 (vector-length v1-10)) + (f1-1 f0-3) + (f2-2 + (+ (fmax 0.0 (fmin 40960.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (* 0.33 (-> self control dynam gravity-length)) + ) + ) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-2)) + (the-as vector (vector-float*! v1-10 v1-10 (/ f0-3 f1-1))) + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #t)) + ) + ((< a0-5 (seconds 0.25)) + (let ((v1-12 (new-stack-vector0))) + (let ((f0-6 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-12 + (-> self control transv) + (the-as vector (vector-float*! v1-12 (-> self control dynam gravity-normal) f0-6)) + ) + ) + (let* ((f0-7 (vector-length v1-12)) + (f1-3 f0-7) + (f2-5 + (+ (fmax 0.0 (fmin 40960.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (* 0.0016666667 (the float (- (seconds 0.66) a0-5)) (-> self control dynam gravity-length)) + ) + ) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-5)) + (the-as vector (vector-float*! v1-12 v1-12 (/ f0-7 f1-3))) + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #t)) + ) + (else + (let ((v1-14 (new-stack-vector0))) + (let ((f0-10 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-14 + (-> self control transv) + (the-as vector (vector-float*! v1-14 (-> self control dynam gravity-normal) f0-10)) + ) + ) + (let* ((f0-11 (vector-length v1-14)) + (f1-5 f0-11) + (f2-7 (fmax 0.0 (fmin 40960.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))))) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-7)) + (the-as vector (vector-float*! v1-14 v1-14 (/ f0-11 f1-5))) + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + ) + ) + (let ((v1-17 (new-stack-vector0)) + (f0-14 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-17 + (-> self control transv) + (the-as vector (vector-float*! v1-17 (-> self control dynam gravity-normal) f0-14)) + ) + (let* ((f2-8 (vector-length v1-17)) + (f1-8 f2-8) + ) + (if (< 81920.0 f2-8) + (set! f2-8 81920.0) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-14)) + (the-as vector (vector-float*! v1-17 v1-17 (/ f2-8 f1-8))) + ) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + (none) + ) + :exit target-board-exit + :code (behavior () + (send-event (ppointer->process (-> self board board)) 'open) + (ja-channel-push! 1 (the-as time-frame (if (-> self control unknown-spool-anim00) + 9 + 60 + ) + ) + ) + (let ((f30-1 (if (-> self control unknown-spool-anim00) + 1.25 + (fmax 1.0 (fmin 2.0 (/ 249.99 (the float (target-time-to-ground))))) + ) + ) + ) + (ja-no-eval :group! (-> self draw art-group data 170) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 170)) frames num-frames) -1)) + f30-1 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (when (logtest? (-> self control status) (cshape-moving-flags on-surface)) + (set! (-> self board turn-anim-duck-vel) 0.0) + (goto cfg-19) + ) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + (set! (-> self board turn-anim-duck-vel) 15.0) + (while (not (jump-hit-ground-stuck?)) + (suspend) + ) + (label cfg-19) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) + (logior! (-> self control status) (cshape-moving-flags on-surface)) + (go target-board-hit-ground) + (none) + ) + :post target-board-post + ) + +(defstate target-board-pegasus (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('end-mode) + (go target-jump 16384.0 16384.0 (the-as surface #f)) + ) + (else + (target-generic-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior ((arg0 handle)) + (logclear! (-> self focus-status) (focus-status halfpipe)) + (set! (-> self board shock-offsetv) 0.0) + (set! (-> self state-time) (-> self clock frame-counter)) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (none) + ) + :exit target-board-exit + :code (behavior ((arg0 handle)) + (let ((s4-0 (-> self draw art-group data 195)) + (f30-0 0.0) + (s5-0 #t) + ) + (ja-channel-push! 1 (seconds 0.05)) + (set! (-> self control unknown-surface00) *empty-mods*) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) + (set! (-> self control unknown-vector39 quad) (-> self control quat vec quad)) + (ja :group! s4-0 + :num! (seek! (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) + :frame-num 0.0 + ) + (until #f + (let* ((s3-0 (handle->process arg0)) + (s4-1 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when s4-1 + (set! (-> self control unknown-vector38 quad) (-> (get-trans (the-as process-focusable s4-1) 0) quad)) + (set! (-> self control unknown-vector38 y) (+ 4096.0 (-> self control unknown-vector38 y))) + (let* ((s3-2 (-> self control unknown-vector40)) + (a0-15 (the-as process-focusable s4-1)) + (t9-4 (method-of-object a0-15 get-quat)) + ) + 0 + (set! (-> s3-2 quad) (-> (t9-4 a0-15) vec quad)) + ) + ) + (let ((f28-0 (sin (lerp-scale 0.0 16384.0 (ja-aframe-num 0) 0.0 30.0)))) + (let ((f26-0 f28-0)) + (vector-lerp! + (-> self control trans) + (-> self control unknown-vector37) + (-> self control unknown-vector38) + f28-0 + ) + (set! (-> self control trans y) + (lerp (-> self control unknown-vector37 y) (-> self control unknown-vector38 y) f26-0) + ) + ) + (quaternion-slerp! + (-> self control unknown-quaternion00) + (the-as quaternion (-> self control unknown-vector39)) + (the-as quaternion (-> self control unknown-vector40)) + f28-0 + ) + ) + (rot->dir-targ! (-> self control)) + (when s4-1 + (let ((s3-4 self)) + (set! self (the-as target s4-1)) + (set! f30-0 (ja-aframe-num 0)) + f30-0 + (set! self s3-4) + ) + (ja :num-func num-func-identity :frame-num (ja-aframe f30-0 0)) + ) + ) + (when (and s5-0 (>= f30-0 17.0)) + (send-event (ppointer->process (-> self board board)) 'close) + (logclear! (-> self focus-status) (focus-status board)) + (set! s5-0 #f) + ) + (suspend) + 0 + ) + ) + #f + (none) + ) + :post (behavior () + (set! (-> self control unknown-float30) 0.0) + (set! (-> self control unknown-float29) 0.0) + (vector-seek! (-> self control unknown-vector04) *null-vector* (* 16384.0 (-> self clock seconds-per-frame))) + (target-no-move-post) + (target-board-effect) + (none) + ) + ) + +(defstate target-board-get-off (target) + :event (-> target-board-get-on event) + :enter (behavior ((arg0 object) (arg1 symbol)) + (case arg1 + (('pegasus) + (go target-board-pegasus (the-as handle arg0)) + ) + ) + (logclear! (-> self focus-status) (focus-status halfpipe)) + (set! (-> self board shock-offsetv) 0.0) + (set! (-> self state-time) (-> self clock frame-counter)) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (set! (-> self control unknown-surface00) (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 131072.0 + :tiltvv 262144.0 + :transv-max 65536.0 + :target-speed 65536.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 30.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag check-edge air) + ) + ) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (let ((a0-6 (target-time-to-ground))) + (cond + ((< a0-6 (seconds 0.207)) + (let ((v1-16 (new-stack-vector0))) + (let ((f0-3 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-16 + (-> self control transv) + (the-as vector (vector-float*! v1-16 (-> self control dynam gravity-normal) f0-3)) + ) + ) + (let* ((f0-4 (vector-length v1-16)) + (f1-1 f0-4) + (f2-2 + (+ (fmax 0.0 (fmin 40960.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (* 0.0016666667 (the float (- (seconds 0.66) a0-6)) (-> self control dynam gravity-length)) + ) + ) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-2)) + (the-as vector (vector-float*! v1-16 v1-16 (/ f0-4 f1-1))) + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #t)) + ) + (else + (let ((v1-18 (new-stack-vector0))) + (let ((f0-7 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-18 + (-> self control transv) + (the-as vector (vector-float*! v1-18 (-> self control dynam gravity-normal) f0-7)) + ) + ) + (let* ((f0-8 (vector-length v1-18)) + (f1-3 f0-8) + (f2-4 (fmax 0.0 (fmin 40960.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))))) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-4)) + (the-as vector (vector-float*! v1-18 v1-18 (/ f0-8 f1-3))) + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + (none) + ) + :exit target-board-exit + :code (behavior ((arg0 object) (arg1 symbol)) + (local-vars (v1-116 symbol) (a0-35 int)) + (let ((f30-0 1.5151515)) + (let ((v1-1 arg1)) + (cond + ((= v1-1 'hit) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 194) :num! (seek! (ja-aframe 24.0 0) 2.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 24.0 0) 2.5)) + ) + ) + ((-> self control unknown-spool-anim00) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 191) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 191)) frames num-frames) -1)) + f30-0 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) + (ja-no-eval :group! (-> self draw art-group data 171) :num! (seek! (ja-aframe 24.0 0) f30-0) :frame-num 0.0) + (until (ja-done? 0) + (if (and (jump-hit-ground-stuck?) (>= (ja-aframe-num 0) 14.0)) + (go target-falling #f) + ) + (suspend) + (ja :num! (seek! (ja-aframe 24.0 0) f30-0)) + ) + ) + (else + (set! f30-0 (fmax 0.5 (fmin 2.0 (/ 150.0 (the float (target-time-to-ground)))))) + (ja-channel-push! 1 (seconds 0.1)) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) + (ja-no-eval :group! (-> self draw art-group data 171) + :num! (seek! (ja-aframe 24.0 0) f30-0) + :frame-num (ja-aframe 11.0 0) + ) + (until (ja-done? 0) + (if (and (jump-hit-ground-stuck?) (>= (ja-aframe-num 0) 14.0)) + (go target-falling #f) + ) + (suspend) + (ja :num! (seek! (ja-aframe 24.0 0) f30-0)) + ) + ) + ) + ) + (send-event (ppointer->process (-> self board board)) 'close) + (logclear! (-> self focus-status) (focus-status board)) + (ja-no-eval :num! (seek! max f30-0)) + ) + (while (let ((t9-36 ja-done?)) + (set! a0-35 0) + (not (t9-36 a0-35)) + ) + (if (jump-hit-ground-stuck?) + (go target-falling #f) + ) + (suspend) + (ja-eval) + ) + (set! (-> self board turn-anim-duck-vel) 15.0) + (if (and (board-on-ground?) + (let ((v1-114 #x100000)) + (set! a0-35 (the-as int (-> self water flags))) + (not (or (logtest? v1-114 (the-as water-flags a0-35)) + (begin + (let ((v1-117 #t)) + (set! a0-35 (the-as int (logand (-> self control status) (cshape-moving-flags on-water)))) + (set! a0-35 a0-35) + (cmove-#f-zero v1-116 (the-as cshape-moving-flags a0-35) v1-117) + ) + v1-116 + ) + ) + ) + ) + ) + (go target-hit-ground (the-as symbol a0-35)) + (go target-falling (if (= arg1 'hit) + 'hit + ) + ) + ) + (none) + ) + :post (behavior () + (set! (-> self control unknown-float30) 0.0) + (set! (-> self control unknown-float29) 0.0) + (vector-seek! (-> self control unknown-vector04) *null-vector* (* 16384.0 (-> self clock seconds-per-frame))) + (target-post) + (target-board-effect) + (none) + ) + ) + +(defstate target-board-grab (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (cond + ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + (-> self state name) + ) + (else + (case arg2 + (('end-mode) + (go target-board-stance) + ) + (('clone-anim) + (go target-board-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + ) + (('change-mode) + (case (-> arg3 param 0) + (('normal) + enter-state + 'stance + (go target-grab) + ) + ) + ) + (else + (target-generic-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (set! (-> self control unknown-surface00) *grab-mods*) + (set! (-> self neck flex-blend) 0.0) + (logior! (-> self state-flags) (state-flags sf2)) + (logior! (-> self focus-status) (focus-status grabbed)) + (logclear! (-> self focus-status) (focus-status halfpipe)) + (set! (-> self board stick-off) #t) + (none) + ) + :exit (behavior () + (set! (-> self board stick-off) #f) + (logclear! (-> self state-flags) (state-flags sf2)) + (logclear! (-> self focus-status) (focus-status grabbed)) + (logclear! (-> self water flags) (water-flags jump-out)) + (target-board-exit) + (none) + ) + :code (behavior ((arg0 symbol)) + (let ((v1-2 (ja-group))) + (when (not (and v1-2 (= v1-2 (-> self draw art-group data 151)))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 151) :num! (identity (ja-aframe 0.0 0))) + ) + ) + (until #f + (set-forward-vel 0.0) + (suspend) + ) + #f + (none) + ) + :post target-board-post + ) + +;; (defstate target-board-clone-anim (target) +;; :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +;; (if (and (= arg2 'trans) (= (-> arg3 param 0) 'restore)) +;; (set! (-> self control unknown-word04) (the-as uint #f)) +;; ) +;; ((-> target-board-grab event) arg0 arg1 arg2 arg3) +;; ) +;; :enter (-> target-clone-anim enter) +;; :exit (behavior () +;; (set! (-> self control unknown-vector04 y) (the-as float (-> self control unknown-word04))) +;; (set! (-> self control unknown-vector05 y) (-> self control unknown-vector04 y)) +;; (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) +;; ((-> target-clone-anim exit)) +;; ((-> target-board-start exit)) +;; (vector-reset! (-> self control transv)) +;; (none) +;; ) +;; :code (behavior ((arg0 handle)) +;; (set! (-> self control unknown-word04) (the-as uint (-> self control unknown-vector04 y))) +;; (set! (-> self control unknown-vector04 y) 0.0) +;; (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) +;; (clone-anim arg0 #t "") +;; (go target-board-stance) +;; (none) +;; ) +;; :post target-no-ja-move-post +;; ) + +(defstate target-board-hit (target) + :event target-board-handler + :exit (behavior () + (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-death) (= v1-3 'target-board-get-off)) + ) + ) + ) + (logclear! (-> self focus-status) (focus-status dead hit)) + (logclear! (-> self state-flags) (state-flags disable-attacks)) + ) + (let ((gp-1 (logtest? (-> self focus-status) (focus-status hit)))) + (target-exit) + (if gp-1 + (logior! (-> self focus-status) (focus-status hit)) + ) + ) + (set! (-> self state-flags) (logior (state-flags lleg-no-ik rleg-no-ik) (-> self state-flags))) + (target-board-exit) + (none) + ) + :trans (behavior () + (when (= *cheat-mode* 'debug) + (when (and (not *pause-lock*) (cpad-hold? (-> self control unknown-cpad-info00 number) r2)) + (set! (-> self control unknown-time-frame30) (-> self clock frame-counter)) + (pickup-collectable! (-> self fact) (pickup-type health) 100.0 (the-as handle #f)) + (go target-board-stance) + ) + ) + (none) + ) + :code (behavior ((arg0 vector)) + (logclear! (-> self water flags) (water-flags jump-out)) + (logclear! (-> self focus-status) (focus-status halfpipe)) + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((gp-0 (-> self attack-info))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((v1-6 gp-0)) + (set! (-> v1-6 attacker) (the-as handle #f)) + (set! (-> v1-6 mode) 'generic) + (set! (-> v1-6 shove-back) 6144.0) + (set! (-> v1-6 shove-up) 4915.2) + (set! (-> v1-6 angle) #f) + (set! (-> v1-6 trans quad) (-> self control trans quad)) + (set! (-> v1-6 control) 0.0) + (set! (-> v1-6 invinc-time) (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout))) + (set! (-> v1-6 speed) 1.0) + (set! (-> v1-6 damage) (-> *FACT-bank* health-default-inc)) + (set! (-> v1-6 knock) (the-as uint 0)) + ) + (case arg0 + (('shove) + (let ((v1-9 gp-0)) + (set! (-> v1-9 shove-back) (-> *TARGET-bank* smack-surface-dist)) + (set! (-> v1-9 shove-up) (-> *TARGET-bank* smack-surface-height)) + (set! (-> v1-9 angle) 'shove) + ) + ) + ) + self + ((method-of-type attack-info attack-info-method-11)) + (when (zero? (logand (-> gp-0 mask) (attack-info-mask vector))) + (vector-z-quaternion! (-> gp-0 vector) (-> self control unknown-quaternion00)) + (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) + (set! (-> gp-0 vector y) (-> gp-0 shove-up)) + ) + (set! (-> s5-0 quad) (-> gp-0 vector quad)) + (let ((f0-12 (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-0 1.0) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00)) + ) + ) + ) + (if (not (-> self attack-info angle)) + (set! (-> self attack-info angle) (if (>= 0.0 f0-12) + 'front + 'back + ) + ) + ) + ) + (cond + ((= arg0 'attack) + (logior! (-> self focus-status) (focus-status hit)) + (set! (-> self game hit-time) (-> self clock frame-counter)) + (case (-> gp-0 mode) + (('endlessfall) + (cond + ((= (-> self game mode) 'debug) + (let ((s4-1 (new-stack-vector0))) + (set! (-> s4-1 quad) (-> self control unknown-vector23 quad)) + (ja-channel-set! 0) + (let ((s3-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s3-1) (seconds 1)) + (suspend) + ) + ) + (collide-shape-method-29 (-> self control) s4-1) + ) + (set! (-> self control unknown-vector15 quad) (-> self control trans quad)) + (send-event *camera* 'teleport) + (go target-stance) + ) + (else + (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) + (go target-death (-> gp-0 mode)) + ) + ) + ) + (('drown-death 'sharkey 'lava 'dark-eco-pool 'melt 'instant-death 'crush 'death 'grenade 'big-explosion 'bot) + (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) + (if (= (-> self game mode) 'play) + (go target-death (-> gp-0 mode)) + ) + ) + (('death) + (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) + ) + (else + (pickup-collectable! (-> self fact) (pickup-type health) (- (-> gp-0 damage)) (the-as handle #f)) + ) + ) + (target-hit-effect gp-0) + ) + (else + (case (-> gp-0 mode) + (('burn 'burnup) + (sound-play "get-burned") + ) + ) + ) + ) + (when (not (and (= (-> self game mode) 'play) (>= 0.0 (-> (the-as fact-info-target (-> self fact)) health)))) + (when (= (-> gp-0 knock) 8) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (set-forward-vel (* -3.0 (-> gp-0 shove-back))) + (when (demo?) + (if (nonzero? (talker-spawn-func (-> *talker-speech* 78) *entity-pool* (target-pos 0) (the-as region #f))) + (hide-hud-quick #f) + ) + ) + (go target-board-get-off #f 'hit) + ) + (if (= (-> gp-0 control) 1.0) + (go target-board-jump (-> gp-0 shove-up) (-> gp-0 shove-up) 'hit) + ) + ) + (set! (-> self control unknown-surface00) *smack-mods*) + (let ((v1-92 (ja-group))) + (when (not (and v1-92 (or (= v1-92 (-> self draw art-group data 158)) (= v1-92 (-> self draw art-group data 165))))) + (ja-channel-push! 1 (seconds 0.075)) + (if (or (= (-> gp-0 mode) 'shock) (= (-> gp-0 mode) 'shock-red) (= (-> gp-0 mode) 'shockup)) + (ja :group! (-> self draw art-group data 189) :num! min) + (ja :group! (-> self draw art-group data 158) :num! min) + ) + ) + ) + (target-hit-move gp-0 (target-hit-orient gp-0 s5-0) target-board-falling-anim-trans (-> gp-0 speed)) + ) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> (the-as fact-info-target (-> self fact)) health))) + (go target-death (-> gp-0 mode)) + ) + ) + enter-state + (go target-board-hit-ground) + (none) + ) + :post (behavior () + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (vector-float*! + (-> self control dynam gravity) + (-> self control dynam gravity-normal) + (the-as float (-> self control dynam gravity-length)) + ) + (target-post) + (target-board-effect) + (case (-> self attack-info mode) + (('shock 'shock-red 'shockup) + (when (>= (- (-> *display* game-clock frame-counter) (-> self shock-effect-time)) (seconds 0.03)) + (set! (-> self shock-effect-time) (-> *display* game-clock frame-counter)) + (send-event self 'color-effect 'shock 60) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 1) + lightning-probe-callback + (-> *part-id-table* 166) + 0 + 0 + 40960.0 + ) + ) + ) + ) + (target-board-joint-points) + (none) + ) + ) \ No newline at end of file diff --git a/goal_src/jak2/engine/target/board/target-board.gc b/goal_src/jak2/engine/target/board/target-board.gc index 9e3bb4c76..c31244fac 100644 --- a/goal_src/jak2/engine/target/board/target-board.gc +++ b/goal_src/jak2/engine/target/board/target-board.gc @@ -5,5 +5,2974 @@ ;; name in dgo: target-board ;; dgos: ENGINE, GAME +(define-extern *board-walk-mods* surface) +(define-extern *board-duck-mods* surface) +(define-extern *board-air-mods* surface) +(define-extern *board-jump-mods* surface) +(define-extern *board-ride-jump-mods* surface) +(define-extern *board-duck-jump-mods* surface) +(define-extern *board-spin-mods* surface) +(define-extern *board-spin-post-mods* surface) +(define-extern *board-flip-mods* surface) +(define-extern *board-wall-kick-mods* surface) +(define-extern *board-halfpipe-mods* surface) +(define-extern *board-turn-to-mods* surface) +(define-extern *board-ride-mods* surface) +(define-extern *collide-edge-board-halfpipe-spec* collide-edge-spec) +(define-extern target-gun-end-mode (function symbol symbol :behavior target)) +(define-extern target-board-get-off (state object symbol target)) +(define-extern *collide-edge-board-spec* collide-edge-spec) +(define-extern vector-vector-angle (function vector vector float)) +(define-extern target-board-anim-trans (function none :behavior target)) +(define-extern target-board-spin-check (function none :behavior target)) +(define-extern target-board-halfpipe-trans (function none :behavior target)) +(define-extern target-board-resolve-points (function float float float float none :behavior target)) +(define-extern target-board-ground-check (function none :behavior target)) +(define-extern target-board-halfpipe-check (function collide-action :behavior target)) +(define-extern target-board-jump-trans (function none :behavior target)) +(define-extern target-board-start (state object target)) +(define-extern target-board-stance (state target)) +(define-extern target-board-duck-stance (state target)) +(define-extern target-board-jump (state meters meters symbol target)) +(define-extern target-board-halfpipe (state target)) +(define-extern target-board-falling (state target)) +(define-extern target-board-jump-kick (state target)) +(define-extern target-board-wall-kick (state vector float target)) +(define-extern target-board-flip (state float float symbol target)) +(define-extern target-board-hold (state float float symbol target)) +(define-extern target-board-trickx (state float float symbol target)) +(define-extern target-board-hit-ground (state target)) +(define-extern target-board-turn-to (state vector time-frame target)) +(define-extern target-board-ride-edge (state symbol object object float target)) +(define-extern target-board-grenade (state handle target)) +(define-extern target-board-get-on (state target)) +(define-extern target-board-pegasus (state handle target)) +(define-extern target-board-get-off (state object symbol target)) +(define-extern target-board-grab (state symbol target)) +(define-extern target-board-clone-anim (state handle target)) +(define-extern target-board-hit (state vector target)) + ;; DECOMP BEGINS +(define *board-walk-mods* + (new 'static 'surface + :name 'run + :turnv 32768.0 + :turnvv 131072.0 + :tiltv 131072.0 + :tiltvv 2621440.0 + :transv-max 143360.0 + :target-speed 102400.0 + :seek0 0.5 + :seek90 0.5 + :seek180 0.5 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor -0.125 + :slide-factor 1.0 + :slope-up-factor 8192.0 + :slope-down-factor 24576.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 15.0 + :tiltvvf 15.0 + :vel-turn 65536.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (if (< 0.9 (-> self control surface-angle)) + (set! (-> self board on-flat-time) (-> self clock frame-counter)) + ) + (set! (-> self board slip-factor) + (lerp-scale 1.0 (-> arg0 slip-factor) (fabs (-> self control unknown-float24)) 0.0 1.0) + ) + (set! (-> arg0 slip-factor) (-> self board slip-factor)) + (set! (-> arg0 slope-up-factor) (-> arg1 slope-up-factor)) + (set! (-> arg0 slope-down-factor) (-> arg1 slope-down-factor)) + (set! (-> arg0 seek0) (lerp-scale + (* 0.1 (-> arg0 seek0)) + (-> arg0 seek0) + (the float (- (-> self clock frame-counter) (-> self board spin-time))) + 0.0 + 600.0 + ) + ) + (set! (-> arg0 seek90) (lerp-scale + (* 0.1 (-> arg0 seek90)) + (-> arg0 seek90) + (the float (- (-> self clock frame-counter) (-> self board spin-time))) + 0.0 + 600.0 + ) + ) + (set! (-> arg0 vel-turn) (lerp-scale + 131072.0 + (-> arg1 vel-turn) + (the float (- (-> self clock frame-counter) (-> self board spin-time))) + 0.0 + 600.0 + ) + ) + (set! (-> arg0 turnv) (lerp-scale + 91022.22 + (-> arg1 turnv) + (the float (- (-> self clock frame-counter) (-> self board spin-time))) + 0.0 + 600.0 + ) + ) + (when (< (- (-> self clock frame-counter) (-> self board spin-ground-start-time)) (seconds 0.3)) + (set! (-> self control unknown-time-frame12) (-> self clock frame-counter)) + (set! (-> self board spin-ground-time) (-> self clock frame-counter)) + (set! (-> arg0 seek0) (* 0.1 (-> arg0 seek0))) + (set! (-> arg0 seek90) (* 0.1 (-> arg0 seek90))) + (set! (-> arg0 vel-turn) 131072.0) + (set! (-> arg0 turnv) 91022.22) + ) + ) + ) + (none) + ) + :flags (surface-flag turn-to-pad) + ) + ) + +(define *board-duck-mods* (new 'static 'surface + :name 'duck + :turnv 21845.334 + :turnvv 131072.0 + :tiltv 131072.0 + :tiltvv 2621440.0 + :transv-max 151552.0 + :target-speed 102400.0 + :seek0 0.5 + :seek90 0.5 + :seek180 0.5 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 0.5 + :slide-factor 1.0 + :slope-up-factor 8192.0 + :slope-down-factor 24576.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 0.75 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 15.0 + :tiltvvf 15.0 + :vel-turn 65536.0 + :flags (surface-flag no-turn-around turn-to-pad duck) + ) + ) + + +(set! (-> *board-duck-mods* mult-hook) (-> *board-walk-mods* mult-hook)) + +(define *board-air-mods* (new 'static 'surface + :name 'air + :turnv 49152.0 + :turnvv 131072.0 + :tiltv 16384.0 + :tiltvv 131072.0 + :transv-max 143360.0 + :target-speed 102400.0 + :seek0 0.8 + :seek90 0.8 + :seek180 0.8 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 8192.0 + :slope-down-factor 24576.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 60.0 + :vel-turn 65536.0 + :mode 'air + :flags (surface-flag no-turn-around turn-to-pad check-edge air) + ) + ) + +(define *board-jump-mods* (new 'static 'surface + :name 'jump + :turnv 49152.0 + :turnvv 524288.0 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 143360.0 + :target-speed 102400.0 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 30.0 + :tiltvvf 18.0 + :vel-turn 10922.667 + :mode 'air + :flags (surface-flag no-turn-around turn-to-pad check-edge air) + ) + ) + +(define *board-ride-jump-mods* + (new 'static 'surface + :name 'jump + :turnv 49152.0 + :turnvv 32768.0 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 143360.0 + :target-speed 102400.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 300.0 + :tiltvf 30.0 + :tiltvvf 18.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (case arg3 + ((1) + (when (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + (let* ((f30-0 (* 122880.0 (-> self control unknown-float10) (-> self clock seconds-per-frame))) + (a2-1 (-> self board ride-dir)) + (v1-12 (vector-flatten! (new 'stack-no-clear 'vector) (-> self control unknown-vector08) a2-1)) + (v0-3 (-> self control transv)) + ) + (let ((a0-6 (-> self control transv))) + (.lvf vf2 (&-> v1-12 quad)) + (.lvf vf1 (&-> a0-6 quad)) + ) + (let ((v1-13 f30-0)) + (.mov vf3 v1-13) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v0-3 quad) vf4) + ) + ) + ) + ) + (none) + ) + ) + :mode 'air + :flags (surface-flag no-turn-around turn-to-pad check-edge air) + ) + ) + +(define *board-duck-jump-mods* *board-jump-mods*) +(define *board-spin-mods* (copy *board-jump-mods* 'global)) + +(let ((v1-10 *board-spin-mods*)) + (set! (-> v1-10 name) 'spin) + (set! (-> v1-10 flags) (surface-flag no-turn-around check-edge air)) + (set! (-> v1-10 seek0) 0.0) + (set! (-> v1-10 seek90) 0.0) + (set! (-> v1-10 seek180) 0.0) + (set! (-> v1-10 vel-turn) 0.0) + (set! (-> v1-10 turnv) 0.0) + (set! (-> v1-10 turnvv) 0.0) + (set! (-> v1-10 tiltv) 0.0) + (set! (-> v1-10 tiltvf) 0.0) + ) + + +(let ((v1-12 (copy *board-jump-mods* 'global))) + (set! (-> v1-12 seek0) 0.0) + (set! (-> v1-12 seek90) 0.0) + (set! (-> v1-12 seek180) 0.0) + (set! (-> v1-12 vel-turn) 0.0) + (set! *board-spin-post-mods* v1-12) + ) + + +(let ((v1-14 (copy *board-duck-jump-mods* 'global))) + (set! (-> v1-14 flags) (surface-flag no-turn-around turn-to-vel air)) + (set! (-> v1-14 seek0) 0.0) + (set! (-> v1-14 seek90) 0.0) + (set! (-> v1-14 seek180) 0.0) + (set! (-> v1-14 vel-turn) 0.0) + (set! (-> v1-14 turnv) 49152.0) + (set! (-> v1-14 turnvf) 30.0) + (set! (-> v1-14 turnvv) 0.0) + (set! (-> v1-14 turnvvf) 0.0) + (set! *board-flip-mods* v1-14) + ) + +(define *board-wall-kick-mods* + (new 'static 'surface + :name 'jump + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 143360.0 + :target-speed 102400.0 + :seek180 0.8 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 0.8 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :tiltvf 150.0 + :tiltvvf 60.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (when (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.05)) + (set! (-> arg0 turnv) 0.0) + (set! (-> arg0 turnvf) 0.0) + ) + ) + ) + (none) + ) + :mode 'air + :flags (surface-flag no-turn-around turn-to-vel air) + ) + ) + +(define *board-halfpipe-mods* (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 16384.0 + :tiltvv 131072.0 + :transv-max 143360.0 + :target-speed 102400.0 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 60.0 + :mode 'air + :flags (surface-flag no-turn-around turn-to-vel air turn-when-centered) + ) + ) + +(define *board-turn-to-mods* (new 'static 'surface + :name 'run + :turnv 524288.0 + :tiltv 131072.0 + :tiltvv 2621440.0 + :transv-max 143360.0 + :target-speed 102400.0 + :seek0 0.5 + :seek90 0.5 + :seek180 0.5 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 0.5 + :slide-factor 1.0 + :slope-up-factor 8192.0 + :slope-down-factor 24576.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 1.0 + :turnvf 30.0 + :tiltvf 15.0 + :tiltvvf 15.0 + :vel-turn 65536.0 + :flags (surface-flag no-turn-around turn-to-vel turn-when-centered) + ) + ) + + +(set! (-> *board-turn-to-mods* mult-hook) (-> *board-walk-mods* mult-hook)) + +(define *board-ride-mods* (new 'static 'surface + :name 'run + :turnv 218453.33 + :turnvv 131072.0 + :tiltv 131072.0 + :tiltvv 262144.0 + :transv-max 143360.0 + :target-speed 40960.0 + :seek0 0.5 + :seek90 0.5 + :seek180 0.5 + :fric 0.1 + :nonlin-fric-dist 1.0 + :slip-factor 0.6 + :slide-factor 1.0 + :slope-up-factor 24576.0 + :slope-down-factor 49152.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 60.0 + :tiltvvf 30.0 + :mult-hook (lambda ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (set! (-> arg0 slope-up-factor) (-> arg1 slope-up-factor)) + (set! (-> arg0 slope-down-factor) (-> arg1 slope-down-factor)) + ) + ) + (none) + ) + :mode 'ride + :flags (surface-flag no-turn-around turn-to-pad check-edge turn-when-centered) + ) + ) + +(define *collide-edge-board-halfpipe-spec* (new 'static 'collide-edge-spec + :split-dists (new 'static 'array float 2 1024.0 1433.6) + :outward-offset (new 'static 'vector :x 708.608 :y 13312.0 :w 1.0) + :flags #x8 + :max-dist-sqrd-to-outward-pt 150994940.0 + :max-dir-cosa-delta -1.0 + :max-dir-cosa-player -2.0 + :touching-segment #f + :local-cache-fill-box (new 'static 'bounding-box + :min (new 'static 'vector :x -8192.0 :y -16384.0 :z -8192.0 :w 1.0) + :max (new 'static 'vector :x 8192.0 :y 16384.0 :z 8192.0 :w 1.0) + ) + :local-within-reach-box (new 'static 'bounding-box + :min (new 'static 'vector :x -7987.2 :y -16179.2 :z -7987.2 :w 1.0) + :max (new 'static 'vector :x 7987.2 :y 16179.2 :z 7987.2 :w 1.0) + ) + :local-player-spheres (new 'static 'inline-array sphere 12 + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x -737.28 :y 4096.0 :r 3072.0) + (new 'static 'sphere :x -737.28 :y 6553.6 :r 3072.0) + (new 'static 'sphere :x -737.28 :y 9420.8 :r 3072.0) + (new 'static 'sphere :x 1720.32 :y 3686.4 :r 2949.12) + (new 'static 'sphere :x 1720.32 :y 5734.4 :r 2949.12) + (new 'static 'sphere :x 1720.32 :y 8601.6 :r 2949.12) + ) + ) + ) + +(defbehavior target-board-setup target ((arg0 symbol)) + (when (zero? (-> self board)) + (set! (-> self board) (new 'process 'board-info)) + (set! (-> self board process) (the-as (pointer target) (process->ppointer self))) + (set! (-> self board latch?) #f) + (set! (-> self board engine-sound-id) (the-as uint (new-sound-id))) + (set! (-> self board ride-sound-id) (the-as uint (new-sound-id))) + (set! (-> self board spin-sound-id) (the-as uint 0)) + (set! (-> self board wind-sound-id) (the-as uint (new-sound-id))) + (set! (-> self board bank-sound-id) (the-as uint (new-sound-id))) + (let* ((v1-10 (-> self game)) + (a0-5 (+ (-> v1-10 attack-id) 1)) + ) + (set! (-> v1-10 attack-id) a0-5) + (set! (-> self board attack-id) a0-5) + ) + (set! (-> self board board) (the-as (pointer board) #f)) + ) + (cond + (arg0 + (if (not (-> self board board)) + (set! (-> self board board) (process-spawn board :init board-init :from *8k-dead-pool* :to self)) + ) + ) + (else + (when (-> self board board) + (deactivate (-> self board board 0)) + (set! (-> self board board) (the-as (pointer board) #f)) + ) + ) + ) + 0 + (none) + ) + +(defbehavior target-board-init target () + (target-gun-end-mode #f) + (target-exit) + (target-board-setup #t) + (set! (-> self board latch?) #f) + (if (zero? (-> self board main)) + (set! (-> self board main) (new 'process 'joint-mod (joint-mod-mode flex-blend) self 3)) + ) + (if (zero? (-> self board upper-body)) + (set! (-> self board upper-body) (new 'process 'joint-mod (joint-mod-mode flex-blend) self 5)) + ) + (if (zero? (-> self board part-control)) + (set! (-> self board part-control) (create-launch-control (-> *part-group-id-table* 118) self)) + ) + (mode-set! (-> self board main) (joint-mod-mode flex-blend)) + (mode-set! (-> self board upper-body) (joint-mod-mode flex-blend)) + (set! (-> self board engine-sound-pitch) 0.0) + (set! (-> self board engine-sound-volume) 1.0) + (set! (-> self board bank-sound-pitch) 0.0) + (set! (-> self board bank-sound-volume) 0.0) + (set! (-> self board wind-sound-pitch) 0.0) + (set! (-> self board wind-sound-volume) 1.0) + (set! (-> self board spin-sound-volume) 0.0) + (set! (-> self board sound-air-knob) 0.0) + (set! (-> self board sound-bank-knob) 0.0) + (set! (-> self board unknown-sound-id00) (new 'static 'sound-id)) + (set-setting! 'mode-sound-bank 'board 0 0) + (set-setting! 'sound-flava #f #x41f00000 2) + (set! (-> self board board-get-on-time) (-> self clock frame-counter)) + (set! (-> self board stick-lock) #f) + (set! (-> self board stick-off) #f) + (set! (-> self board unstuck-time) (-> self clock frame-counter)) + (set! (-> self board stuck-count) 0) + (set! (-> self board slip-factor) 1.0) + (set! (-> self board unknown-symbol00) #f) + (set! (-> self board halfpipe-side-time) 0) + (set! (-> self board spin-control) 0.0) + (set! (-> self board trotyv) 0.0) + (set! (-> self board troty) 0.0) + (set! (-> self board troty-cum) 0.0) + (set! (-> self board unknown-deg00) 0.0) + (set! (-> self board flip-control) 0.0) + (set! (-> self board flip-count) 0) + (set! (-> self board unknown-float00) 0.0) + (set! (-> self board unknown-float01) 0.0) + (set! (-> self board trick-count) 0) + (countdown (v1-62 16) + (set! (-> self board trick-list 0) (board-tricks none)) + ) + (set! (-> self board upper-body-rotyv) 0.0) + (set! (-> self board upper-body-roty) 0.0) + (set! (-> self board upper-body-rotyv-max) 91022.22) + (set! (-> self board ride-lock) #f) + (set! (-> self board ride-lock-on) #f) + (set! (-> self board ride-rot-old) -1.0) + (set! (-> self control reaction) target-collision-reaction) + (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :noboard #x1 :probe #x1)) + (set! (-> self focus-status) (logior (focus-status board) (-> self focus-status))) + (logclear! (-> self control root-prim prim-core action) (collide-action can-ride)) + (set! (-> self control unknown-float29) 1.0) + (let ((v1-82 (-> self node-list data))) + (set! (-> v1-82 0 param0) cspace<-transformq+world-trans!) + (set! (-> v1-82 0 param1) (the-as basic (-> self control trans))) + (set! (-> v1-82 0 param2) (the-as basic (-> self control unknown-vector05))) + ) + (target-collide-set! 'board 0.0) + (set! (-> self state-flags) (logior (state-flags lleg-no-ik rleg-no-ik) (-> self state-flags))) + (set! (-> self board thrust-scale) 1.0) + (set! (-> self board turn-anim-targ) 0.0) + (set! (-> self board turn-anim-frame) 0.0) + (set! (-> self board turn-anim-vel) 0.0) + (set! (-> self board turn-anim-duck) 0.0) + (set! (-> self board turn-anim-tilt?) #f) + (set! (-> self board cushion-base) 0.0) + (set! (-> self board cushion-offset) 0.0) + (set! (-> self board shock-offset) 0.0) + (set! (-> self board shock-offsetv) 0.0) + (set! (-> self board shock-rotx) 0.0) + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (vector-float*! + (-> self control dynam gravity) + (-> self control dynam gravity-normal) + (the-as float (-> self control dynam gravity-length)) + ) + (set-setting! 'string-spline-max-move 'abs #x46000000 0) + (set-setting! 'string-spline-accel 'abs #x433851ec 0) + (set-setting! 'string-spline-max-move-player 'abs #x45c00000 0) + (set-setting! 'string-spline-accel-player 'abs #x430f5c29 0) + (none) + ) + +(defbehavior target-board-exit target () + (when (not (and (-> self next-state) + (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-board-stance) + (= v1-3 'target-board-jump) + (= v1-3 'target-board-hit-ground) + (= v1-3 'target-board-jump-kick) + (= v1-3 'target-board-wall-kick) + (= v1-3 'target-board-ride-edge) + (= v1-3 'target-board-duck-stance) + (= v1-3 'target-board-falling) + (= v1-3 'target-board-flip) + (= v1-3 'target-board-trickx) + (= v1-3 'target-board-hold) + (= v1-3 'target-board-halfpipe) + (= v1-3 'target-board-grenade) + (= v1-3 'target-board-turn-to) + (= v1-3 'target-board-hit) + (= v1-3 'target-board-get-off) + (= v1-3 'target-board-pegasus) + (= v1-3 'target-board-grab) + (= v1-3 'target-board-clone-anim) + ) + ) + ) + ) + (set! (-> self board latch?) #f) + (mode-set! (-> self board main) (joint-mod-mode flex-blend)) + (mode-set! (-> self board upper-body) (joint-mod-mode flex-blend)) + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (vector-float*! + (-> self control dynam gravity) + (-> self control dynam gravity-normal) + (the-as float (-> self control dynam gravity-length)) + ) + (logclear! (-> self focus-status) (focus-status board)) + (logclear! (-> self control root-prim prim-core action) (collide-action stuck-wall-escape no-normal-reset)) + (logior! (-> self control root-prim prim-core action) (collide-action can-ride)) + (set! (-> self control unknown-surface00) *walk-mods*) + (logclear! (-> self state-flags) (state-flags sf6)) + (remove-setting! 'string-spline-max-move) + (remove-setting! 'string-spline-accel) + (remove-setting! 'string-spline-max-move-player) + (remove-setting! 'string-spline-accel-player) + (let ((v1-43 (-> self node-list data))) + (set! (-> v1-43 0 param0) cspace<-transformq+trans!) + (set! (-> v1-43 0 param1) (the-as basic (-> self control trans))) + (set! (-> v1-43 0 param2) (the-as basic (-> self control unknown-vector05))) + ) + (target-collide-set! 'normal 0.0) + (set! (-> self control reaction) target-collision-reaction) + (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1)) + (sound-stop (the-as sound-id (-> self board wind-sound-id))) + (sound-stop (the-as sound-id (-> self board engine-sound-id))) + (sound-stop (the-as sound-id (-> self board bank-sound-id))) + (sound-stop (the-as sound-id (-> self board ride-sound-id))) + (sound-stop (the-as sound-id (-> self board spin-sound-id))) + (set! (-> self board spin-sound-id) (the-as uint 0)) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) + (set! (-> self control unknown-vector05 quad) (the-as uint128 0)) + (remove-setting! 'sound-flava) + (remove-setting! 'mode-sound-bank) + (target-exit) + ) + (none) + ) + +(defbehavior target-board-falling-anim-trans target () + (let ((v1-2 (ja-group))) + (cond + ((not (and v1-2 (= v1-2 (-> self draw art-group data 156)))) + (ja-channel-push! 1 (seconds 0.33)) + (ja :group! (-> self draw art-group data 156)) + ) + ((let ((v1-11 (ja-group))) + (and v1-11 (= v1-11 (-> self draw art-group data 156))) + ) + (ja :num! (loop!)) + ) + ) + ) + 0 + (none) + ) + +(defbehavior board-on-ground? target () + (logtest? (-> self control status) (cshape-moving-flags on-surface)) + ) + +(defbehavior target-board-smack-surface? target () + (when (and (logtest? (-> self control status) (cshape-moving-flags t-wall)) + (< (+ (-> self clock frame-counter) (seconds -0.05)) (-> self control unknown-time-frame07)) + (< 0.7 (-> self control touch-angle)) + (< 73728.0 (-> self control unknown-float05)) + (and (< (vector-dot (-> self control unknown-vector25) (-> self control dynam gravity-normal)) 0.3) + (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + ) + ) + (set! (-> self board smack-surface-time) (-> self clock frame-counter)) + (set! (-> self board smack-speed) (-> self control unknown-float05)) + (set! (-> self board smack-normal quad) (-> self control unknown-vector25 quad)) + #t + ) + ) + +(defbehavior board-add-thrust target () + (let ((gp-0 (-> self control unknown-vector00))) + (let* ((v1-1 gp-0) + (f0-7 (cond + ((= (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))) 0.0) + 0.0 + ) + (else + (let ((f0-5 (-> gp-0 z)) + (v1-4 gp-0) + ) + (/ f0-5 (sqrtf (+ (* (-> v1-4 x) (-> v1-4 x)) (* (-> v1-4 z) (-> v1-4 z))))) + ) + ) + ) + ) + (f30-0 (if (>= f0-7 0.0) + (+ (* f0-7 (-> self control unknown-surface01 seek0)) + (* (- 1.0 f0-7) (-> self control unknown-surface01 seek90)) + ) + (+ (* (fabs f0-7) (-> self control unknown-surface01 seek180)) + (* (+ 1.0 f0-7) (-> self control unknown-surface01 seek90)) + ) + ) + ) + (f28-0 (cond + ((-> self board stick-off) + 0.0 + ) + ((= (-> self control ground-pat mode) (pat-mode halfpipe)) + 1.0 + ) + (*target-rc-board-controls* + 1.0 + ) + ((< (-> gp-0 z) 0.0) + (fmax 0.75 (-> self control unknown-float10)) + ) + (else + (-> self control unknown-float10) + ) + ) + ) + ) + (when (not (or (= (-> self control unknown-surface01 vel-turn) 0.0) (< (-> gp-0 z) 0.0))) + (let ((f0-22 (atan (-> gp-0 x) (-> gp-0 z)))) + (vector-rotate-y! + gp-0 + gp-0 + (fmin + (* 0.03 (-> self clock time-adjust-ratio) (- f0-22)) + (* (-> self control unknown-surface01 vel-turn) (-> self clock seconds-per-frame)) + ) + ) + ) + ) + (let* ((f0-28 (* f30-0 (-> self board thrust-scale) (lerp-scale 0.4 1.0 f28-0 0.3 1.0))) + (f1-22 (-> self control unknown-surface01 target-speed)) + (f1-23 + (if (< (-> self control unknown-float17) 0.0) + (+ f1-22 (* (- (-> self control unknown-float17)) (-> self control unknown-surface01 slope-down-factor))) + (+ f1-22 (* (- (-> self control unknown-float17)) (-> self control unknown-surface01 slope-up-factor))) + ) + ) + ) + (when (-> self board stick-off) + (set! f0-28 0.0) + (set! f1-23 0.0) + ) + (when (and (< (- (-> self clock frame-counter) (-> self control unknown-time-frame07)) (seconds 1)) + (>= f28-0 0.5) + (< (vector-dot (-> self control unknown-vector25) (-> self control unknown-vector08)) -0.7) + (logtest? (-> self control unknown-surface00 flags) (surface-flag air)) + (< 0.0 (-> gp-0 y)) + ) + (cond + ((and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame07)) (seconds 0.1)) + (< 0.3 (-> self control unknown-float27)) + ) + (set! f0-28 f1-23) + ) + ((< (-> gp-0 z) 0.0) + (set! (-> gp-0 z) 0.0) + ) + ) + ) + (+! (-> gp-0 z) (* f0-28 (-> self clock seconds-per-frame))) + (when (!= f1-23 0.0) + (let ((f0-33 (- 1.0 (/ (* f30-0 (-> self clock seconds-per-frame)) f1-23)))) + (set! (-> gp-0 x) (* (-> gp-0 x) f0-33)) + (set! (-> gp-0 z) (* (-> gp-0 z) f0-33)) + ) + ) + (set! (-> self board transv-max) f1-23) + ) + ) + (let ((f0-35 (-> self control unknown-surface01 transv-max)) + (v1-87 gp-0) + ) + (if (>= (sqrtf (+ (* (-> v1-87 x) (-> v1-87 x)) (* (-> v1-87 z) (-> v1-87 z)))) f0-35) + (vector-xz-normalize! gp-0 f0-35) + ) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-matrix*! s5-0 gp-0 (-> self control unknown-matrix01)) + (vector-float*! s5-0 s5-0 0.5) + (vector+! s5-0 s5-0 (-> self control trans)) + (add-debug-text-sphere + *display-target-marks* + (bucket-id debug-no-zbuf1) + s5-0 + (meters 0.2) + "ltransv" + (the-as rgba (-> (new 'static 'array uint64 1 #x8000ff00) 0)) + ) + (set! (-> s5-0 quad) (-> self control unknwon-vector27 quad)) + (vector-float*! s5-0 s5-0 0.5) + (vector+! s5-0 s5-0 (-> self control trans)) + (add-debug-text-sphere + *display-target-marks* + (bucket-id debug-no-zbuf1) + s5-0 + (meters 0.2) + "btransv" + (the-as rgba (-> (new 'static 'array uint64 1 #x80ffffff) 0)) + ) + ) + ) + 0 + (none) + ) + +(defun segment-array-vector->index ((arg0 (inline-array vector)) (arg1 int) (arg2 float) (arg3 float)) + (let ((gp-0 -1) + (f30-0 0.0) + (f0-0 0.0) + ) + (while (< (+ gp-0 1) arg1) + (+! gp-0 1) + (set! f30-0 (vector-segment-overlap (the-as vector arg2) (-> arg0 gp-0) (-> arg0 (+ gp-0 1)))) + (set! f0-0 (/ arg3 (vector-vector-distance (-> arg0 gp-0) (-> arg0 (+ gp-0 1))))) + (if (>= 1.0 (+ f30-0 f0-0)) + (return (+ (the float gp-0) f30-0 f0-0)) + ) + ) + (+ (the float gp-0) f30-0 f0-0) + ) + ) + +(defun segment-array-index->vector ((arg0 (inline-array vector)) (arg1 int) (arg2 float) (arg3 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((v0-0 (the int arg2))) + (let* ((f0-2 arg2) + (f0-4 (- f0-2 (the float (the int f0-2)))) + ) + (when (>= v0-0 arg1) + (set! v0-0 (+ arg1 -1)) + (set! f0-4 (- arg2 (the float v0-0))) + ) + (let ((v1-5 (-> arg0 v0-0)) + (a1-3 (-> arg0 (+ v0-0 1))) + (a1-4 arg3) + ) + (.lvf vf2 (&-> (vector-! (new 'stack-no-clear 'vector) a1-3 v1-5) quad)) + (.lvf vf1 (&-> v1-5 quad)) + (let ((v1-6 f0-4)) + (.mov vf3 v1-6) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> a1-4 quad) vf4) + ) + ) + v0-0 + ) + ) + ) + +(defbehavior target-board-exit-check target () + (if (and (or (and (cpad-pressed? (-> self control unknown-cpad-info00 number) r2) + (or (!= *cheat-mode* 'debug) + (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l2)) + ) + ) + (not *pause-lock*) + ) + (logtest? (state-flags sf17) (-> self state-flags)) + (zero? (logand (-> *game-info* features) (game-feature board))) + ) + (and (>= (- (-> self clock frame-counter) (-> self board board-get-on-time)) (seconds 1)) + (< (-> self board board-get-on-time) + (max (-> self control unknown-time-frame05) (-> self control unknown-time-frame14)) + ) + (not (and (-> self next-state) (= (-> self next-state name) 'target-board-grab))) + ) + ) + (go target-board-get-off (process->handle self) #f) + ) + 0 + (none) + ) + +(defbehavior target-board-effect target () + (let ((gp-0 0)) + (cond + ((logtest? (focus-status rail) (-> self focus-status)) + (set! gp-0 10) + ) + ((= (-> self control unknown-surface00 name) 'spin) + (set! gp-0 3) + ) + ((and (-> self next-state) (= (-> self next-state name) 'target-board-flip)) + (set! gp-0 4) + ) + ((and (logtest? (-> self control unknown-surface00 flags) (surface-flag air)) + (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + ) + (set! gp-0 1) + ) + ((zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + (set! gp-0 2) + ) + ) + (if (board-on-ground?) + (seek! (-> self board sound-air-knob) 0.0 (* 16.0 (-> self clock seconds-per-frame))) + (seek! + (-> self board sound-air-knob) + (lerp-scale 0.0 1.0 (target-height-above-ground) 409.6 28672.0) + (* 2.0 (-> self clock seconds-per-frame)) + ) + ) + (let ((f30-0 (fabs (/ (-> self board turn-anim-frame) (-> *TARGET_BOARD-bank* turn-frames))))) + (seek! (-> self board sound-bank-knob) f30-0 (if (< (-> self board sound-bank-knob) f30-0) + (* 0.5 (-> self clock seconds-per-frame)) + (-> self clock seconds-per-frame) + ) + ) + (set! (-> self board engine-sound-volume) (lerp-scale 0.8 1.0 f30-0 0.0 1.0)) + ) + (set! (-> self board engine-sound-pitch) + (+ (lerp-scale 0.0 -0.1 (-> self board sound-bank-knob) 0.0 1.0) + (lerp-scale -0.15 0.0 (-> self board shock-offset) -3072.0 52.0192) + ) + ) + (set! (-> self board bank-sound-volume) (lerp-scale 0.0 1.0 (-> self board sound-bank-knob) 0.0 1.0)) + (set! (-> self board bank-sound-pitch) (lerp-scale 0.0 -0.2 (-> self board sound-bank-knob) 0.0 1.0)) + 0 + (let ((f0-25 (-> self board sound-air-knob))) + (if (< 0.0 f0-25) + (set! (-> self board engine-sound-volume) (lerp-scale (-> self board engine-sound-volume) 0.3 f0-25 0.0 1.0)) + ) + ) + (let ((t9-12 sound-play-by-spec) + (a0-18 (new 'static 'sound-spec + :mask (sound-mask volume pitch sm11) + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "board-steady") + ) + ) + ) + (set! (-> a0-18 volume) (the int (* 1024.0 (-> self board engine-sound-volume)))) + (set! (-> a0-18 pitch-mod) (the int (* 1524.0 (-> self board engine-sound-pitch)))) + (set! (-> a0-18 reg 0) (the-as uint gp-0)) + (t9-12 a0-18 (the-as sound-id (-> self board engine-sound-id)) (the-as vector #t)) + ) + (if (< (-> self board bank-sound-volume) 0.1) + (sound-stop (the-as sound-id (-> self board bank-sound-id))) + (sound-play-by-name + (static-sound-name "board-bank") + (the-as sound-id (-> self board bank-sound-id)) + (the int (* 1024.0 (-> self board bank-sound-volume))) + (the int (* 1524.0 (-> self board bank-sound-pitch))) + 0 + (sound-group sfx) + #t + ) + ) + (let ((t9-15 sound-play-by-spec) + (a0-23 (new 'static 'sound-spec + :mask (sound-mask volume pitch sm11) + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "board-wind") + ) + ) + ) + (set! (-> a0-23 volume) (the int (-> self board wind-sound-volume))) + (set! (-> a0-23 pitch-mod) (the int (-> self board wind-sound-pitch))) + (set! (-> a0-23 reg 0) (the-as uint gp-0)) + (t9-15 a0-23 (the-as sound-id (-> self board wind-sound-id)) (the-as vector #t)) + ) + ) + (cond + ((= (-> self control unknown-surface00 name) 'spin) + (seek! + (-> self board spin-sound-volume) + (lerp-scale 0.0 1.0 (fabs (-> self board trotyv)) 0.0 91022.22) + (* 8.0 (-> self clock seconds-per-frame)) + ) + (seek! + (-> self board spin-sound-pitch) + (lerp-scale 0.0 0.3 (fabs (-> self board trotyv)) 36408.89 91022.22) + (-> self clock seconds-per-frame) + ) + (when *sound-player-enable* + (let ((v1-89 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-89 command) (sound-command set-param)) + (set! (-> v1-89 id) (the-as sound-id (-> self board spin-sound-id))) + (set! (-> v1-89 params volume) (the int (* 1024.0 (-> self board spin-sound-volume)))) + (set! (-> v1-89 params mask) (the-as uint 1)) + (-> v1-89 id) + ) + ) + ) + (else + (set! (-> self board spin-sound-volume) 0.0) + ) + ) + (if (!= (-> self board upper-body-rotyv) 0.0) + (mode-set! (-> self board upper-body) (joint-mod-mode rotate)) + ) + (when (= (-> self board upper-body mode) (joint-mod-mode rotate)) + (set! (-> self board upper-body-rotyv) + (* 0.95 + (fmax + (fmin (-> self board upper-body-rotyv) (-> self board upper-body-rotyv-max)) + (- (-> self board upper-body-rotyv-max)) + ) + ) + ) + (+! (-> self board upper-body-rotyv) + (* -10.0 (-> self clock seconds-per-frame) (-> self board upper-body-roty)) + ) + (let ((f1-21 (* (-> self board upper-body-rotyv) (-> self clock seconds-per-frame))) + (f0-65 (-> self board upper-body-roty)) + ) + (+! (-> self board upper-body-roty) f1-21) + (when (< (* f0-65 (-> self board upper-body-roty)) 0.0) + (set! (-> self board upper-body-roty) 0.0) + (set! (-> self board upper-body-rotyv) 0.0) + (mode-set! (-> self board upper-body) (joint-mod-mode flex-blend)) + ) + ) + (twist-set! (-> self board upper-body) (the-as float #f) (-> self board upper-body-roty) (the-as float #f)) + ) + (when (and (board-on-ground?) + (not (or (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp no-draw-bounds no-draw-bounds2)) + (zero? (-> self skel active-channels)) + ) + ) + ) + (sparticle-launch-control-method-11 (-> self board part-control) (-> self control trans)) + (let ((t9-26 (method-of-object (-> self skel effect) effect-control-method-10))) + 'effect-board-poof + 0 + -1 + (t9-26) + ) + (when (< (-> self board shock-offset) -2048.0) + (let ((t9-27 (method-of-object (-> self skel effect) effect-control-method-10))) + 'effect-board-poof + 0 + -1 + (t9-27) + ) + ) + ) + (vector-lerp! (-> self board slow-transv) (-> self board slow-transv) (-> self control transv) 0.2) + (if (< (-> self board slow-transv y) 0.0) + (set! (-> self board slow-transv y) 0.0) + ) + 0 + (none) + ) + +(defbehavior target-board-physics target ((arg0 vector)) + (let ((f30-0 0.5)) + (if (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame02)) (seconds 0.3)) + (+! (-> self board shock-offsetv) (* (- (-> arg0 y) (-> self control transv y)) f30-0)) + (set! (-> self board up-vector 1 quad) (-> self board up-vector 0 quad)) + ) + (+! (-> self board shock-offsetv) + (+ (* -10.0 (-> self clock seconds-per-frame) (-> self board shock-offset)) + (if (board-on-ground?) + (* (-> self control dynam gravity-length) (-> self clock seconds-per-frame) f30-0) + 0.0 + ) + ) + ) + ) + (cond + ((= (-> self control unknown-surface00 mode) 'ride) + (set! (-> self board shock-offsetv) 0.0) + (set! (-> self board shock-offset) (* 0.96 (-> self board shock-offset))) + ) + ((and (or (< (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) (seconds 0.2)) + (< (-> self board shock-offset) 0.0) + ) + (!= (-> self control unknown-surface00 mode) 'air) + ) + (+! (-> self board shock-offset) (* (-> self board shock-offsetv) (-> self clock seconds-per-frame))) + ) + ) + (set! (-> self board shock-offset) + (* (-> self board shock-offset) (lerp-scale 0.99 0.98 (-> self control unknown-float05) 0.0 28672.0)) + ) + (cond + ((< 40960.0 (-> self board shock-offset)) + (set! (-> self board shock-offset) 40960.0) + (set! (-> self board shock-offsetv) 0.0) + ) + ((< (-> self board shock-offset) -3072.0) + (when (< (-> self board shock-offsetv) -12288.0) + (case (-> self control ground-pat material) + (((pat-material waterbottom)) + (let ((gp-1 (sound-play "swim-enter" :pitch -0.5)) + (v1-62 (the-as sound-rpc-set-param (get-sound-buffer-entry))) + ) + (set! (-> v1-62 command) (sound-command set-param)) + (set! (-> v1-62 id) gp-1) + (set! (-> v1-62 params volume) -4) + (set! (-> v1-62 params fo-curve) 1) + (set! (-> v1-62 auto-time) 480) + (set! (-> v1-62 auto-from) 2) + (set! (-> v1-62 params mask) (the-as uint 273)) + (-> v1-62 id) + ) + ) + (else + (sound-play-by-name + (static-sound-name "board-bounce") + (new-sound-id) + (the int (* 1024.0 (lerp-scale 1.0 0.3 (-> self board shock-offsetv) -40960.0 -12288.0))) + 0 + 0 + (sound-group sfx) + #t + ) + ) + ) + ) + (set! (-> self board shock-offset) -3072.0) + (set! (-> self board shock-offsetv) 0.0) + (let ((gp-3 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-3 + (let ((t9-9 (method-of-type part-tracker activate))) + (t9-9 (the-as part-tracker gp-3) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-10 run-function-in-process) + (a0-28 gp-3) + (a1-8 part-tracker-init) + (a2-8 (-> *part-group-id-table* 21)) + (a3-5 0) + (t0-4 #f) + (t1-2 #f) + (t2-2 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> self control trans quad)) + ((the-as (function object object object object object object object object none) t9-10) + a0-28 + a1-8 + a2-8 + a3-5 + t0-4 + t1-2 + t2-2 + t3-0 + ) + ) + (-> gp-3 ppointer) + ) + ) + ) + ) + (set! (-> self control unknown-vector04 y) + (+ (-> self board cushion-base) (-> self board cushion-offset) (-> self board shock-offset)) + ) + (if (< (-> self control unknown-vector04 y) 0.0) + (set! (-> self control unknown-vector04 y) 0.0) + ) + 0 + (none) + ) + +(defbehavior target-board-collision target () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self control transv quad)) + (when (logtest? (focus-status halfpipe) (-> self focus-status)) + (when (-> self control unknown-spool-anim00) + *edge-grab-info* + (let ((v1-9 (new-stack-vector0)) + (f0-1 (vector-dot (-> self control unknown-vector36) (-> self control transv))) + ) + 0.0 + (vector-! + v1-9 + (-> self control transv) + (the-as vector (vector-float*! v1-9 (-> self control unknown-vector36) f0-1)) + ) + (let* ((f1-2 (vector-length v1-9)) + (f2-0 f1-2) + ) + (if (< 0.0 f0-1) + (set! f0-1 -2048.0) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control unknown-vector36) f0-1)) + (the-as vector (vector-float*! v1-9 v1-9 (/ f1-2 f2-0))) + ) + ) + ) + ) + ) + (when *debug-segment* + (let ((s5-0 (-> *display* frames (-> *display* on-screen) profile-array data 0)) + (v1-17 'target) + (s4-0 *profile-target-color*) + ) + (when (and *dproc* *debug-segment*) + (let ((s3-0 (-> s5-0 data (-> s5-0 count)))) + (let ((s2-0 (-> s5-0 base-time))) + (set! (-> s3-0 name) v1-17) + (set! (-> s3-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s2-0)))) + ) + (set! (-> s3-0 depth) (the-as uint (-> s5-0 depth))) + (set! (-> s3-0 color) s4-0) + (set! (-> s5-0 segment (-> s5-0 depth)) s3-0) + ) + (+! (-> s5-0 count) 1) + (+! (-> s5-0 depth) 1) + (set! (-> s5-0 max-depth) (max (-> s5-0 max-depth) (-> s5-0 depth))) + ) + ) + 0 + ) + (let ((a2-6 (new 'stack-no-clear 'collide-query)) + (v1-30 (-> self control)) + ) + (set! (-> a2-6 collide-with) (-> v1-30 root-prim prim-core collide-with)) + (set! (-> a2-6 ignore-process0) self) + (set! (-> a2-6 ignore-process1) #f) + (set! (-> a2-6 ignore-pat) (-> v1-30 pat-ignore-mask)) + (set! (-> a2-6 action-mask) (collide-action solid)) + (collide-shape-method-32 v1-30 (-> v1-30 transv) a2-6 (meters 1.0)) + ) + (when (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) + (set! (-> *collide-edge-board-spec* flags) (logand -3 (-> *collide-edge-board-spec* flags))) + (set! (-> *collide-edge-board-spec* touching-segment) #f) + (target-method-27 *target* *collide-cache* *collide-edge-board-spec*) + ) + (when *debug-segment* + (let ((s5-1 (-> *display* frames (-> *display* on-screen) profile-array data 0))) + (when (and *dproc* *debug-segment*) + (let* ((v1-53 (+ (-> s5-1 depth) -1)) + (s4-1 (-> s5-1 segment v1-53)) + (s3-1 (-> s5-1 base-time)) + ) + (when (>= v1-53 0) + (set! (-> s4-1 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-1)))) + (+! (-> s5-1 depth) -1) + ) + ) + ) + ) + 0 + ) + (target-board-physics gp-0) + (deg-diff (vector-y-angle gp-0) (vector-y-angle (-> self control transv))) + (let* ((v1-60 gp-0) + (f30-0 (sqrtf (+ (* (-> v1-60 x) (-> v1-60 x)) (* (-> v1-60 z) (-> v1-60 z))))) + ) + (when (and (logtest? (-> self control status) (cshape-moving-flags t-wall)) + (and (< 16384.0 f30-0) + (not (and (-> self next-state) (= (-> self next-state name) 'target-board-smack))) + (zero? (logand (focus-status halfpipe) (-> self focus-status))) + (!= (-> self control ground-pat mode) 3) + (>= (- (-> self clock frame-counter) (-> self board halfpipe-time)) (seconds 0.1)) + ) + ) + (let ((s5-3 (new 'stack-no-clear 'vector))) + (set! (-> s5-3 quad) (-> self control unknown-vector25 quad)) + (vector-normalize! s5-3 1.0) + (let ((s3-2 (vector-reflect! (new 'stack-no-clear 'vector) gp-0 s5-3)) + (s4-3 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-3 quad) (-> self control unknown-matrix01 vector 2 quad)) + (set! (-> s3-2 y) 0.0) + (vector-normalize! s3-2 1.0) + (set! (-> s4-3 y) 0.0) + (vector-normalize! s4-3 1.0) + (let ((f0-11 (y-angle (-> self control)))) + (deg-diff f0-11 (vector-y-angle s3-2)) + ) + (let ((s2-2 + (vector-matrix*! (new 'stack-no-clear 'vector) (-> self control transv) (-> self control unknown-matrix00)) + ) + (s3-3 (vector-matrix*! (new 'stack-no-clear 'vector) s3-2 (-> self control unknown-matrix00))) + ) + (logior! (-> self control status) (cshape-moving-flags csmf15)) + (set! (-> self board glance-time) (-> self clock frame-counter)) + (let ((v1-99 s2-2)) + (set! (-> self board glance-speed) (sqrtf (+ (* (-> v1-99 x) (-> v1-99 x)) (* (-> v1-99 z) (-> v1-99 z))))) + ) + (set! (-> self board glance-normal quad) (-> s5-3 quad)) + (set! (-> self board glance-in-transv quad) (-> gp-0 quad)) + (set! (-> s3-3 y) (-> s2-2 y)) + (vector-xz-normalize! s3-3 (-> self board glance-speed)) + (vector-matrix*! (-> self control transv) s3-3 (-> self control unknown-matrix01)) + ) + (set! (-> self board glance-out-transv quad) (-> self control transv quad)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + (when (and (< (vector-dot s4-3 s5-3) -0.77) (zero? (logand (-> self focus-status) (focus-status dead hit)))) + (cond + ((not (and (logtest? (-> self control unknown-surface00 flags) (surface-flag air)) + (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + ) + ) + (if (< 32768.0 f30-0) + (sound-play "board-glance") + ) + (go target-board-turn-to (-> self control transv) (seconds 0.2)) + ) + (else + (set! (-> self control unknown-time-frame00) + (the-as + time-frame + (max (+ (-> self clock frame-counter) (seconds 0.1)) (-> self control unknown-time-frame00)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((gp-3 (new 'stack-no-clear 'collide-query))) + (let ((v1-138 gp-3)) + (set! (-> v1-138 radius) 1638.4) + (set! (-> v1-138 collide-with) + (logclear (-> self control root-prim prim-core collide-with) (collide-spec crate)) + ) + (set! (-> v1-138 ignore-process0) self) + (set! (-> v1-138 ignore-process1) #f) + (set! (-> v1-138 ignore-pat) (-> self control pat-ignore-mask)) + (set! (-> v1-138 action-mask) (collide-action solid)) + ) + (let ((v1-139 (-> gp-3 start-pos))) + (let ((a0-87 (-> self control trans)) + (a1-30 (-> self control unknown-matrix01 vector 2)) + (f0-24 10240.0) + ) + (.lvf vf2 (&-> a1-30 quad)) + (.lvf vf1 (&-> a0-87 quad)) + (let ((a0-88 f0-24)) + (.mov vf3 a0-88) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-139 quad) vf4) + ) + (let ((v1-140 (-> gp-3 start-pos))) + (let ((a0-89 (-> gp-3 start-pos)) + (a1-33 (-> self control dynam gravity-normal)) + (f0-25 8192.0) + ) + (.lvf vf2 (&-> a1-33 quad)) + (.lvf vf1 (&-> a0-89 quad)) + (let ((a0-90 f0-25)) + (.mov vf3 a0-90) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-140 quad) vf4) + ) + (vector-float*! (-> gp-3 move-dist) (-> self control dynam gravity-normal) -49152.0) + (cond + ((>= (fill-and-probe-using-line-sphere *collide-cache* gp-3) 0.0) + (set! (-> self board unknown-vector00 quad) (-> gp-3 best-other-tri intersect quad)) + (set! (-> self board unknown-vector01 quad) (-> gp-3 best-other-tri normal quad)) + (set! (-> self board unknown-int00) (the-as uint (-> gp-3 best-other-tri pat))) + (set! (-> self board unknown-symbol00) #t) + ) + (else + (set! (-> self board unknown-symbol00) #f) + ) + ) + ) + (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + (not (and *cheat-mode* (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) + ) + (set! (-> self control unknown-time-frame14) (-> self clock frame-counter)) + ) + 0 + (none) + ) + ) + +(defbehavior target-board-joint-points target () + (when (-> self board board) + (let ((a1-0 (-> self node-list data 25 bone transform))) + (matrix->transformq (the-as transformq (-> self board board-trans)) a1-0) + ) + (set! (-> self board board-scale quad) (-> self control scale quad)) + (let ((a0-4 (-> *target-shadow-control* settings shadow-dir quad))) + (set! (-> *board-shadow-control* settings shadow-dir quad) a0-4) + ) + ) + 0 + (none) + ) + +(defbehavior target-board-pre-move target () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (cond + ((and (and (logtest? (-> self control unknown-surface00 flags) (surface-flag air)) + (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + ) + (begin + (set! (-> self board in-air-time) (-> self clock frame-counter)) + (and (not (and (-> self next-state) + (let ((v1-12 (-> self next-state name))) + (or (= v1-12 'target-board-stance) (= v1-12 'target-board-duck-stance) (= v1-12 'target-board-turn-to)) + ) + ) + ) + (and (or (and (or (< 20480.0 + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control gspot-pos)) + ) + ) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (< (-> self control unknown-float22) 0.0) + ) + (or (not (or (= (-> self control unknown-pat-surface01 mode) (pat-mode ground)) + (= (-> self control unknown-pat-surface01 mode) (pat-mode halfpipe)) + ) + ) + (or (= (-> self control unknown-pat-surface01 event) (pat-event rail)) + (and (logtest? (-> self water flags) (water-flags active)) + (< (-> self control gspot-pos y) (-> self water surface-height)) + ) + (and (and (-> self next-state) (let ((v1-53 (-> self next-state name))) + (or (= v1-53 'target-board-hold) (= v1-53 'target-board-trickx)) + ) + ) + (zero? (logand (focus-status halfpipe) (-> self focus-status))) + ) + (and (= (-> self control unknown-pat-surface01 mode) (pat-mode halfpipe)) + (and (< (fabs (vector-dot (-> self control gspot-normal) (-> self control dynam gravity-normal))) 0.7) + (zero? (logand (focus-status halfpipe) (-> self focus-status))) + ) + ) + ) + ) + ) + (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.2)) + ) + ) + ) + ) + (set! (-> self control unknown-float30) 0.0) + (set! (-> self control unknown-float29) 0.0) + ) + (else + (set! (-> self control unknown-float30) 1024.0) + (set! (-> self control unknown-float29) 1.0) + (when (< (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.1)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + (-> self control gspot-normal) + ) + (quaternion-slerp! + (-> self control unknown-quaternion00) + (-> self control unknown-quaternion00) + (-> self control dir-targ) + 0.1 + ) + ) + ) + ) + (if (and (cpad-hold? (-> self control unknown-cpad-info00 number) circle square) (not (-> self board ride-lock))) + (logior! (-> self control root-prim prim-core action) (collide-action check-edge)) + (logclear! (-> self control root-prim prim-core action) (collide-action check-edge)) + ) + (if (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons circle square) + ) + ) + (set! (-> self board ride-lock) #f) + ) + (cond + ((and (-> self next-state) (let ((v1-121 (-> self next-state name))) + (or (= v1-121 'target-board-get-on) (= v1-121 'target-board-get-off)) + ) + ) + ) + ((and (-> self next-state) (let ((v1-126 (-> self next-state name))) + (or (= v1-126 'target-board-trickx) (= v1-126 'target-board-hold)) + ) + ) + (seek! (-> self control dynam gravity-length) 245760.0 (* 30.0 (-> self clock seconds-per-frame))) + ) + ((= (-> self control unknown-surface00 name) 'spin) + (set! (-> self control dynam gravity-length) + (lerp-scale 245760.0 204800.0 (fabs (-> self board trotyv)) 0.0 145635.56) + ) + ) + ((and (-> self next-state) (= (-> self next-state name) 'target-board-halfpipe)) + (if (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (set! (-> self control dynam gravity-length) 245760.0) + (set! (-> self control dynam gravity-length) 163840.0) + ) + ) + ((and (-> self next-state) + (let ((v1-159 (-> self next-state name))) + (or (= v1-159 'target-board-stance) (= v1-159 'target-board-duck-stance) (= v1-159 'target-board-turn-to)) + ) + ) + (cond + (#f + (set! (-> self control dynam gravity-length) 245760.0) + ) + ((>= (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) (seconds 0.1)) + (seek! (-> self control dynam gravity-length) 245760.0 (* 245760.0 (-> self clock seconds-per-frame))) + ) + (else + (set! (-> self control dynam gravity-length) 81920.0) + ) + ) + ) + (else + (set! (-> self control dynam gravity-length) 245760.0) + ) + ) + (vector-float*! + (-> self control dynam gravity) + (-> self control dynam gravity-normal) + (the-as float (-> self control dynam gravity-length)) + ) + (if (< (-> self control unknown-float15) 0.0) + (set! (-> self control unknown-float15) (- 1.0 (-> self control unknown-cpad-info00 stick0-speed))) + ) + (when (and (-> self board unknown-symbol00) (zero? (logand (focus-status halfpipe) (-> self focus-status)))) + (let ((f30-0 + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self board unknown-vector00) (-> self control trans)) + ) + ) + (f26-0 + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self board unknown-vector00) (-> self control gspot-pos)) + ) + ) + (f28-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (let ((f0-36 + (* (-> self control unknown-float17) + (vector-length + (vector-flatten! + (new 'stack-no-clear 'vector) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self board unknown-vector00)) + (-> self control unknown-dynamics00 gravity-normal) + ) + ) + ) + ) + ) + (when (and (zero? (shr (shl (-> self board unknown-int00) 54) 61)) + (!= (shr (shl (-> self board unknown-int00) 40) 58) 13) + (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame02)) (seconds 0.2)) + (< 819.2 (- f30-0 f0-36)) + (or (< (-> self board unknown-time-frame01) (-> self control unknown-time-frame06)) + (< (- (-> self clock frame-counter) (-> self board unknown-time-frame01)) (seconds 0.2)) + ) + (< 0.98 (vector-dot (-> self board unknown-vector01) (-> self control unknown-dynamics00 gravity-normal))) + (< f26-0 8192.0) + (< f30-0 8192.0) + (or (< (* 0.2 f28-0) f30-0) + (< (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.1)) + ) + ) + (let ((v1-259 (-> self control transv))) + (let ((a0-74 (-> self control transv)) + (a1-28 (-> self control dynam gravity-normal)) + (f0-44 (* 7.0 (fmin 4096.0 f30-0))) + ) + (.lvf vf2 (&-> a1-28 quad)) + (.lvf vf1 (&-> a0-74 quad)) + (let ((a0-75 f0-44)) + (.mov vf3 a0-75) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-259 quad) vf4) + ) + (if (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.1)) + (set! (-> self board unknown-time-frame01) (-> self clock frame-counter)) + ) + (set! (-> self board unknown-time-frame00) (-> self clock frame-counter)) + ) + ) + (when (and (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + (< 0.0 f28-0) + (or (and (or (< (target-height-above-ground) 4096.0) + (< (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.1)) + ) + (< 8192.0 (- f28-0 (vector-dot (-> self control dynam gravity-normal) (-> self board slow-transv)))) + ) + (< (- (-> self clock frame-counter) (-> self board unknown-time-frame02)) (seconds 0.1)) + ) + (>= 204.8 f30-0) + (not (and (-> self next-state) (= (-> self next-state name) 'target-board-jump))) + ) + (set! (-> self board unknown-time-frame02) (-> self clock frame-counter)) + (vector-length (-> self control transv)) + (let ((v1-302 (new-stack-vector0)) + (f0-51 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-302 + (-> self control transv) + (the-as vector (vector-float*! v1-302 (-> self control dynam gravity-normal) f0-51)) + ) + (let* ((f1-24 (vector-length v1-302)) + (f2-0 f1-24) + (f0-52 (* 0.9 f0-51)) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-52)) + (the-as vector (vector-float*! v1-302 v1-302 (/ f1-24 f2-0))) + ) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + (set! (-> self board turn-anim-duck-vel) 0.0) + ) + ) + ) + 0 + (none) + ) + ) + +(defbehavior target-board-real-post target () + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control unknown-word07) gp-1) + (flag-setup) + (target-board-pre-move) + (build-conversions (-> self control transv)) + (do-rotations1) + (let ((s5-0 (new-stack-vector0))) + (read-pad s5-0) + (when (-> self board stick-off) + (let ((f0-5 0.0)) + (set! (-> self control unknown-cpad-info00 stick0-speed) f0-5) + (set! (-> self control unknown-float12) f0-5) + ) + ) + (when *target-rc-board-controls* + (vector-rotate-y! + s5-0 + (-> self control unknown-matrix01 vector 2) + (* -42.666668 (+ -128.0 (the float (-> self control unknown-cpad-info00 leftx)))) + ) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> self control trans) + s5-0 + (meters 2.0) + (the-as rgba (-> (new 'static 'array uint64 1 #x8000ff00) 0)) + ) + ) + (turn-to-vector s5-0 (-> self control unknown-float12)) + ) + (if (and (= (-> self control unknown-float12) 0.0) + (>= (-> self clock frame-counter) (-> self control unknown-time-frame00)) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flag turn-to-vel))) + (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.1)) + ) + (rot->dir-targ! (-> self control)) + ) + (when (and (< (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) (seconds 0.1)) + (>= (-> self clock frame-counter) (-> self control unknown-time-frame00)) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flag turn-to-vel))) + (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.1)) + ) + (let* ((s3-0 + (vector-flatten! + (new 'stack-no-clear 'vector) + (vector-negate! (new 'stack-no-clear 'vector) (-> self control dynam gravity-normal)) + (-> self control local-normal) + ) + ) + (a2-4 + (forward-up-nopitch->quaternion + (new 'stack-no-clear 'quaternion) + s3-0 + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + ) + ) + (quaternion-slerp! + (-> self control dir-targ) + (-> self control dir-targ) + a2-4 + (* 0.05 (fabs (-> self control unknown-float24))) + ) + ) + ) + (if (cpad-pressed? (-> self control unknown-cpad-info00 number) l1) + (set! (-> self board unknown-time-frame06) (-> self clock frame-counter)) + ) + (board-add-thrust) + (add-gravity) + (cond + ((= (-> self control unknown-surface00 name) 'spin) + (set! (-> self board trotyv) + (* 0.95 (fmax (fmin (-> self board trotyv) (-> self board trotyv-max)) (- (-> self board trotyv-max)))) + ) + (let ((f0-15 (* (-> self board trotyv) (-> self clock seconds-per-frame)))) + (set! (-> self board troty) (the float (sar (shl (the int (+ (-> self board troty) f0-15)) 48) 48))) + (set! (-> self board unknown-deg00) (-> self board troty-cum)) + (+! (-> self board troty-cum) f0-15) + ) + (seek! (-> self board trotyv-max) 91022.22 (* 91022.22 (-> self clock seconds-per-frame))) + (mode-set! (-> self board main) (joint-mod-mode rotate)) + (twist-set! (-> self board main) (the-as float #f) (-> self board troty) (the-as float #f)) + (mode-set! (-> self board board 0 main) (joint-mod-mode rotate)) + (twist-set! (-> self board board 0 main) (the-as float #f) (-> self board troty) (the-as float #f)) + ) + (else + (cond + ((!= (-> self board main mode) (joint-mod-mode flex-blend)) + (let ((f0-24 (fabs (-> self board troty-cum)))) + (cond + ((>= f0-24 191146.67) + (add-to-trick-list (-> self board) (board-tricks board-spin) 4000.0) + ) + ((>= f0-24 126520.89) + (add-to-trick-list (-> self board) (board-tricks board-spin) 2000.0) + ) + ((>= f0-24 49152.0) + (add-to-trick-list (-> self board) (board-tricks board-spin) 500.0) + ) + ) + ) + (let ((v1-131 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-131 command) (sound-command set-param)) + (set! (-> v1-131 id) (the-as sound-id (-> self board spin-sound-id))) + (set! (-> v1-131 params volume) -4) + (set! (-> v1-131 auto-time) 120) + (set! (-> v1-131 auto-from) 2) + (set! (-> v1-131 params mask) (the-as uint 17)) + (-> v1-131 id) + ) + (set! (-> self board spin-sound-id) (the-as uint 0)) + (mode-set! (-> self board main) (joint-mod-mode flex-blend)) + (mode-set! (-> self board board 0 main) (joint-mod-mode flex-blend)) + (let ((s5-3 (new 'stack-no-clear 'vector))) + (set! (-> s5-3 quad) (-> self node-list data 3 bone transform vector 2 quad)) + (vector-rotate-y! s5-3 s5-3 15109.688) + (if (not (and (-> self next-state) + (let ((v1-149 (-> self next-state name))) + (or (= v1-149 'target-board-flip) (= v1-149 'target-board-hold) (= v1-149 'target-board-trickx)) + ) + ) + ) + (forward-up-nopitch->quaternion + (-> self control unknown-quaternion00) + s5-3 + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00)) + ) + ) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + (set! (-> self board upper-body-rotyv) (-> self board trotyv)) + (set! (-> self board troty) 0.0) + (set! (-> self board trotyv) 0.0) + ) + ((and (= (-> self control unknown-symbol04) 'board-spin) + (or (board-on-ground?) (>= (- (-> self clock frame-counter) (-> self board spin-time)) (seconds 0.5))) + ) + (target-danger-set! 'harmless #f) + ) + ) + (when (board-on-ground?) + (set! (-> self board spin-control) 0.0) + (set! (-> self board flip-control) 0.0) + (set! (-> self board unknown-float00) 0.0) + (set! (-> self board unknown-float01) 0.0) + (set! (-> self board ride-rot-old) -1.0) + ) + ) + ) + (do-rotations2) + (reverse-conversions (-> self control transv)) + (pre-collide-setup) + (cond + ((and (-> self next-state) (= (-> self next-state name) 'target-board-get-off)) + (seek! (-> self board cushion-offset) 0.0 (* 20480.0 (-> self clock seconds-per-frame))) + ) + ((and (logtest? (-> self control unknown-surface00 flags) (surface-flag air)) + (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + ) + (seek! + (-> self board cushion-offset) + (lerp-scale (-> *TARGET_BOARD-bank* cushion) 0.0 (target-height-above-ground) 0.0 12288.0) + (* 20480.0 (-> self clock seconds-per-frame)) + ) + ) + ((logtest? (-> self focus-status) (focus-status on-water)) + (seek! + (-> self board cushion-offset) + (+ 2048.0 (-> *TARGET_BOARD-bank* cushion)) + (* 20480.0 (-> self clock seconds-per-frame)) + ) + ) + (else + (seek! + (-> self board cushion-offset) + (-> *TARGET_BOARD-bank* cushion) + (* 8192.0 (-> self clock seconds-per-frame)) + ) + ) + ) + (target-board-collision) + (if (!= (-> self control unknown-float30) 0.0) + (bend-gravity) + ) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (when *debug-segment* + (let ((gp-2 (-> *display* frames (-> *display* on-screen) profile-array data 0)) + (v1-230 'target-post) + (s5-6 *profile-target-post-color*) + ) + (when (and *dproc* *debug-segment*) + (let ((s4-5 (-> gp-2 data (-> gp-2 count)))) + (let ((s3-4 (-> gp-2 base-time))) + (set! (-> s4-5 name) v1-230) + (set! (-> s4-5 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-4)))) + ) + (set! (-> s4-5 depth) (the-as uint (-> gp-2 depth))) + (set! (-> s4-5 color) s5-6) + (set! (-> gp-2 segment (-> gp-2 depth)) s4-5) + ) + (+! (-> gp-2 count) 1) + (+! (-> gp-2 depth) 1) + (set! (-> gp-2 max-depth) (max (-> gp-2 max-depth) (-> gp-2 depth))) + ) + ) + 0 + ) + (ja-post) + (when *debug-segment* + (let ((gp-3 (-> *display* frames (-> *display* on-screen) profile-array data 0))) + (when (and *dproc* *debug-segment*) + (let* ((v1-254 (+ (-> gp-3 depth) -1)) + (s5-7 (-> gp-3 segment v1-254)) + (s4-6 (-> gp-3 base-time)) + ) + (when (>= v1-254 0) + (set! (-> s5-7 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s4-6)))) + (+! (-> gp-3 depth) -1) + ) + ) + ) + ) + 0 + ) + (joint-points) + (do-target-gspot) + (target-powerup-process) + (set! (-> self board board-time) (-> self clock frame-counter)) + (target-board-exit-check) + (target-board-effect) + (when (board-on-ground?) + (set! (-> self board up-vector 1 quad) (-> self board up-vector 0 quad)) + (set! (-> self board up-vector 0 quad) (-> self control local-normal quad)) + (if (= (-> self board troty-cum) 0.0) + (set! (-> self board ground-on-dir quad) (-> self node-list data 3 bone transform vector 2 quad)) + ) + ) + 0 + (none) + ) + +(defun probe-test ((arg0 control-info) (arg1 vector) (arg2 pat-surface)) + (dotimes (s3-0 3) + (let ((s2-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-2 (-> arg0 unknown-sphere-array00 s3-0))) + (set! (-> s2-0 start-pos quad) (-> v1-2 prim-core world-sphere quad)) + (set! (-> s2-0 move-dist quad) (-> arg1 quad)) + (let ((a0-3 s2-0)) + (set! (-> a0-3 radius) (* 0.5 (-> v1-2 prim-core world-sphere w))) + (set! (-> a0-3 collide-with) (-> v1-2 prim-core collide-with)) + (set! (-> a0-3 ignore-process0) (-> arg0 process)) + (set! (-> a0-3 ignore-process1) #f) + (set! (-> a0-3 ignore-pat) arg2) + (set! (-> a0-3 action-mask) (collide-action solid)) + ) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0) + (return (if (= (-> s2-0 best-other-tri pat event) (pat-event rail)) + 'rail + #t + ) + ) + ) + ) + ) + #f + ) + +(defbehavior target-board-compute-edge target () + (local-vars (sv-768 int)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 *edge-grab-info*) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> self control trans quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> self control transv quad)) + (when (not (edge-grab-info-method-9 s4-0)) + (format #t "exit update~%") + (send-event self 'end-mode #f) + (return (the-as time-frame #f)) + ) + (vector-normalize-copy! (-> self board ride-dir) (-> self board ride-segment) 1.0) + (when (>= (- (-> self clock frame-counter) (-> self board ride-time)) (seconds 0.2)) + (set! (-> self board ride-lock-on) #f) + (set! (-> self board ride-start-time) (-> self clock frame-counter)) + (vector-normalize-copy! (-> self board ride-dir) (-> self control transv) 1.0) + (dotimes (v1-25 3) + (vector-reset! (-> self board ride-vertex-old v1-25)) + ) + ) + (set! (-> self board ride-rot-abs 1) (-> self board ride-rot-abs 0)) + (let* ((f30-0 (deg- (vector-y-angle (-> self board ride-dir)) (-> self board ride-rot-abs 0))) + (f30-1 (* f30-0 (lerp-scale 10.0 100.0 (fabs f30-0) 1820.4445 3640.889))) + ) + (+! (-> self board ride-rtv-abs) (* f30-1 (-> self clock seconds-per-frame))) + (set! (-> self board ride-rtv-abs) (* 0.9 (-> self board ride-rtv-abs))) + (+! (-> self board ride-rot-abs 0) (* (-> self board ride-rtv-abs) (-> self clock seconds-per-frame))) + (when (>= 0.0 (* f30-1 (deg- (vector-y-angle (-> self board ride-dir)) (-> self board ride-rot-abs 0)))) + (set! (-> self board ride-rtv-abs) 0.0) + (set! (-> self board ride-rot-abs 0) (vector-y-angle (-> self board ride-dir))) + ) + ) + (set! (-> self control ground-pat) (the-as pat-surface (-> s4-0 edge-tri-pat))) + (vector-normalize! + (vector-! (-> self control unknown-vector34) (-> s4-0 world-vertex 1) (the-as vector (-> s4-0 world-vertex))) + 1.0 + ) + (set! (-> self control unknown-vector36 quad) (-> s4-0 hanging-matrix vector 0 quad)) + (when (< (vector-dot (-> self control unknown-vector34) (-> self board ride-dir)) 0.0) + (let ((s3-2 (new 'stack-no-clear 'vector))) + (set! (-> s3-2 quad) (-> s4-0 world-vertex 0 quad)) + (set! (-> s4-0 world-vertex 0 quad) (-> s4-0 world-vertex 1 quad)) + (set! (-> s4-0 world-vertex 1 quad) (-> s3-2 quad)) + (vector-normalize! + (vector-! (-> self control unknown-vector34) (-> s4-0 world-vertex 1) (the-as vector (-> s4-0 world-vertex))) + 1.0 + ) + (set! (-> s3-2 quad) (-> s4-0 adjacent-edge-left-vertex quad)) + (set! (-> s4-0 adjacent-edge-left-vertex quad) (-> s4-0 adjacent-edge-right-vertex quad)) + (set! (-> s4-0 adjacent-edge-right-vertex quad) (-> s3-2 quad)) + ) + (let ((v1-69 (logtest? (-> s4-0 status) 2))) + (if (logtest? (-> s4-0 status) 1) + (logior! (-> s4-0 status) 2) + (set! (-> s4-0 status) (logand -3 (-> s4-0 status))) + ) + (if v1-69 + (logior! (-> s4-0 status) 1) + (set! (-> s4-0 status) (logand -2 (-> s4-0 status))) + ) + ) + ) + (dotimes (v1-74 3) + (set! (-> self board ride-vertex-old v1-74 quad) (-> self board ride-vertex v1-74 quad)) + ) + (set! (-> self board ride-segment-old quad) (-> self board ride-segment quad)) + (set! (-> self board ride-segment-old quad) (-> self board ride-segment quad)) + (set! (-> self board ride-vertex-length-old) (-> self board ride-vertex-length)) + (set! (-> self board ride-vertex 0 quad) (-> s4-0 world-vertex 0 quad)) + (set! (-> self board ride-vertex 1 quad) (-> s4-0 world-vertex 1 quad)) + (set! (-> self board ride-vertex 2 quad) (the-as uint128 0)) + (set! (-> self board ride-vertex-length) 1) + (cond + ((logtest? (-> s4-0 status) 2) + (vector-normalize! + (vector-! (-> self control unknown-vector35) (-> s4-0 adjacent-edge-right-vertex) (-> s4-0 world-vertex 1)) + 1.0 + ) + (set! (-> self board ride-vertex 2 quad) (-> s4-0 adjacent-edge-right-vertex quad)) + (+! (-> self board ride-vertex-length) 1) + 0 + ) + (else + (set! (-> self control unknown-vector35 quad) (the-as uint128 0)) + ) + ) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (let ((s3-3 0)) + (label cfg-26) + (set! (-> self board ride-vertex-index) + (segment-array-vector->index + (-> self board ride-vertex) + (-> self board ride-vertex-length) + (the-as float (-> self control trans)) + 0.0 + ) + ) + (when (and (< (-> self board ride-vertex-index) 0.0) + (< (- (-> self clock frame-counter) (-> self board ride-time)) (seconds 0.2)) + (zero? s3-3) + ) + (+! s3-3 1) + (dotimes (v1-113 3) + (set! (-> self board ride-vertex v1-113 quad) (-> self board ride-vertex-old v1-113 quad)) + ) + (set! (-> self board ride-vertex-length) (-> self board ride-vertex-length-old)) + (goto cfg-26) + ) + ) + (set! (-> self board ride-vertex-index) (fmax 0.0 (-> self board ride-vertex-index))) + (set! (-> self board ride-vertex-base) + (segment-array-index->vector + (-> self board ride-vertex) + (-> self board ride-vertex-length) + (-> self board ride-vertex-index) + s4-1 + ) + ) + (vector-! + (-> self board ride-segment) + (-> self board ride-vertex (+ (-> self board ride-vertex-base) 1)) + (-> self board ride-vertex (-> self board ride-vertex-base)) + ) + (dotimes (v1-127 3) + (set! (-> self board ride-vertex v1-127 w) 1.0) + ) + (when (>= (- (-> self clock frame-counter) (-> self board ride-time)) (seconds 0.2)) + (set! (-> self board ride-rot-abs 0) (vector-y-angle (-> self board ride-segment))) + (set! (-> self board ride-rtv-abs) 0.0) + ) + (let ((f0-25 (vector-vector-distance (-> self control trans) s4-1))) + (when #t + (let ((s3-5 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> self control trans)))) + (let ((f1-9 (* 12288.0 (-> self clock seconds-per-frame)))) + (if (and (not (-> self board ride-lock-on)) (< f1-9 f0-25)) + (vector-normalize! s3-5 f1-9) + (set! (-> self board ride-lock-on) #t) + ) + ) + (if (probe-test (-> self control) s3-5 (new 'static 'pat-surface :noentity #x1 :noboard #x1 :probe #x1)) + (set! (-> self control status) (logior (cshape-moving-flags csmf16) (-> self control status))) + ((method-of-object (-> self control) collide-shape-method-28)) + ) + ) + ) + ) + ) + (let ((f30-2 (-> self board ride-speed))) + (vector-normalize-copy! (-> self control unknown-vector08) (-> self board ride-segment) 1.0) + (vector-normalize-copy! (-> self control transv) (-> self board ride-segment) f30-2) + (vector-rotate-y! + (-> self board ride-dir-lean) + (-> self control unknown-vector08) + (* -4551.1113 (-> self board ride-lean)) + ) + (when (< (-> self board ride-vertex-base) (+ (-> self board ride-vertex-length) -1)) + (let ((a0-100 (-> self board ride-vertex (+ (-> self board ride-vertex-base) 1))) + (s4-2 0) + ) + (let ((s3-7 (vector-! (new 'stack-no-clear 'vector) (&+ a0-100 16) a0-100))) + (if (< 14563.556 (fabs (deg-diff (vector-y-angle s3-7) (vector-y-angle (-> self control unknown-vector08))))) + (set! s4-2 (logior s4-2 2)) + ) + (if (< (vector-length s3-7) (fmin 1024.0 (* 0.25 (vector-length (-> self board ride-segment))))) + (set! s4-2 (logior s4-2 32)) + ) + ) + (if (nonzero? s4-2) + (+! (-> self board ride-vertex-length) -1) + ) + ) + ) + (let ((s4-3 0)) + (if (and (< (fabs f30-2) 16384.0) + (< (- (-> self clock frame-counter) (-> self board ride-start-time)) (seconds 0.1)) + ) + (set! s4-3 (logior s4-3 1)) + ) + (if (or (< (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self board ride-segment-old) 1.0) + (-> self control unknown-vector08) + ) + 0.02 + ) + (let ((f28-2 (deg-diff (-> self board ride-rot-abs 0) (-> self board ride-rot-abs 1))) + (f26-0 (* 1820.4445 (-> self board ride-lean))) + ) + (when (and (< 0.0 (* f26-0 f28-2)) (!= (-> self board ride-rtv-abs) 0.0)) + (set! (-> self board ride-rtv-abs) 0.0) + (set! (-> self board ride-rot-abs 0) (vector-y-angle (-> self board ride-segment))) + ) + (and (-> self board ride-lock-on) + (or (and (or (< (* f26-0 f28-2) 0.0) (= f26-0 0.0)) + (< 91.022224 (fabs f28-2)) + (and (< 163.84 (fabs (deg-diff f26-0 f28-2))) (format #t "angle ~R ~R~%" f28-2 f26-0)) + ) + (< (lerp-scale 910.2222 2002.4889 (fabs f30-2) 8192.0 24576.0) (fabs f26-0)) + ) + ) + ) + ) + (set! s4-3 (logior s4-3 2)) + ) + (let* ((v1-227 (min (the int (-> self board ride-vertex-index)) (+ (-> self board ride-vertex-length) -1))) + (f28-3 + (vector-length + (vector-! + (new 'stack-no-clear 'vector) + (-> self board ride-vertex (+ v1-227 1)) + (-> self board ride-vertex v1-227) + ) + ) + ) + (s3-8 (new 'stack-no-clear 'collide-query)) + (f26-1 81920.0) + ) + (set! sv-768 8) + (let ((v1-234 s3-8)) + (set! (-> v1-234 radius) 1228.8) + (set! (-> v1-234 collide-with) + (logclear (-> self control root-prim prim-core collide-with) (collide-spec crate)) + ) + (set! (-> v1-234 ignore-process0) self) + (set! (-> v1-234 ignore-process1) #f) + (set! (-> v1-234 ignore-pat) (-> self control pat-ignore-mask)) + (set! (-> v1-234 action-mask) (collide-action solid)) + ) + (let ((v1-235 (-> s3-8 start-pos))) + (let ((a0-127 (-> self control trans)) + (a1-55 (-> self board ride-dir)) + (f0-51 3276.8) + ) + (.lvf vf2 (&-> a1-55 quad)) + (.lvf vf1 (&-> a0-127 quad)) + (let ((a0-128 f0-51)) + (.mov vf3 a0-128) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-235 quad) vf4) + ) + (let ((v1-236 (-> s3-8 start-pos))) + (let ((a0-129 (-> s3-8 start-pos)) + (a1-58 (-> self control dynam gravity-normal)) + (f0-52 5324.8) + ) + (.lvf vf2 (&-> a1-58 quad)) + (.lvf vf1 (&-> a0-129 quad)) + (let ((a0-130 f0-52)) + (.mov vf3 a0-130) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-236 quad) vf4) + ) + (vector-float*! (-> s3-8 move-dist) (-> self control dynam gravity-normal) -49152.0) + (when (>= (fill-and-probe-using-line-sphere *collide-cache* s3-8) 0.0) + (set! f26-1 (- (-> self control trans y) (-> s3-8 best-other-tri intersect y))) + (set! sv-768 (the-as int (-> s3-8 best-other-tri pat))) + ) + (when (and (< (+ (the float (-> self board ride-vertex-length)) (/ 0.0 f28-3)) + (+ (-> self board ride-vertex-index) + (/ (* (-> self board ride-speed) (-> self clock seconds-per-frame)) f28-3) + ) + ) + (>= f28-3 3686.4) + (and (or (>= f26-1 6963.2) (and (>= f26-1 2048.0) (zero? (shr (shl sv-768 54) 61)))) + (logtest? (shr (shl sv-768 57) 57) 8) + ) + ) + (format + #t + "end with length ~M sp:~M ang:~M b:~X ~f/~f~%" + f28-3 + (-> self board ride-speed) + f26-1 + sv-768 + (+ (-> self board ride-vertex-index) + (/ (* (-> self board ride-speed) (-> self clock seconds-per-frame)) + (vector-length (-> self board ride-segment)) + ) + ) + (+ (the float (-> self board ride-vertex-length)) (/ 0.0 f28-3)) + ) + (set! s4-3 (logior s4-3 4)) + ) + ) + (let ((s3-9 (-> self board ride-vertex (-> self board ride-vertex-base)))) + (if (not (or (vector= s3-9 (the-as vector (-> self board ride-vertex-old))) + (vector= s3-9 (-> self board ride-vertex-old 1)) + (vector= s3-9 (-> self board ride-vertex-old 2)) + (vector= (&+ s3-9 16) (the-as vector (-> self board ride-vertex-old))) + (vector= (&+ s3-9 16) (-> self board ride-vertex-old 1)) + (vector= (&+ s3-9 16) (-> self board ride-vertex-old 2)) + ) + ) + (set! s4-3 (logior s4-3 8)) + ) + ) + (if (>= (- (-> self clock frame-counter) (-> self board ride-button-time)) (seconds 0.05)) + (set! s4-3 (logior s4-3 16)) + ) + (if (< (vector-length (-> self board ride-segment)) + (fmin 1024.0 (* 0.25 (vector-length (-> self board ride-segment-old)))) + ) + (set! s4-3 (logior s4-3 32)) + ) + (if (logtest? (cshape-moving-flags csmf16) (-> self control status)) + (set! s4-3 (logior s4-3 64)) + ) + (logclear! (-> self control status) (cshape-moving-flags csmf16)) + (when (and (< (- (-> self clock frame-counter) (-> self board ride-time)) (seconds 0.2)) (nonzero? s4-3)) + (if (logtest? s4-3 1) + (format #t "exit speed ~M~%" f30-2) + ) + (if (logtest? s4-3 2) + (format + #t + "exit angle ~F~%" + (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self board ride-segment-old) 1.0) + (-> self control unknown-vector08) + ) + ) + ) + (if (logtest? s4-3 4) + (format + #t + "exit end ~F/~F~%" + (-> self board ride-vertex-index) + (the float (-> self board ride-vertex-length)) + ) + ) + (if (logtest? s4-3 8) + (format #t "exit match~%") + ) + (if (logtest? s4-3 16) + (format #t "exit button~%") + ) + (if (logtest? s4-3 32) + (format #t "exit length~%") + ) + (when (logtest? s4-3 64) + (set! (-> self board ride-lock-on) #f) + (format #t "exit probe~%") + ) + (if (logtest? s4-3 128) + (format #t "exit probe2~%") + ) + (cond + ((or (logtest? s4-3 1) (and (logtest? s4-3 2) (< (fabs f30-2) 32768.0))) + (let ((gp-1 (-> self control unknown-vector36))) + (let* ((a0-171 (vector-rotate-y! (new 'stack-no-clear 'vector) (-> self board ride-dir) -16384.0)) + (f28-4 (* (-> self board ride-lean) (vector-dot a0-171 gp-1))) + ) + (format #t "throw side ~f ~A speed ~m~%" f28-4 (>= f28-4 0.0) f30-2) + (vector-normalize-copy! + (-> self control transv) + gp-1 + (* (lerp-scale 8192.0 32768.0 (fabs (-> self board ride-lean)) 0.0 1.0) (if (>= f28-4 0.0) + 1.0 + -1.0 + ) + ) + ) + ) + (set! (-> self control unknown-vector08 quad) (-> gp-1 quad)) + ) + ) + ((logtest? s4-3 42) + (collide-shape-method-29 (-> self control) gp-0) + (set! (-> self control transv quad) (-> s5-0 quad)) + ) + ) + (when (zero? (logand s4-3 64)) + (vector-float*! (new 'stack-no-clear 'vector) (-> self control dynam gravity-normal) 819.2) + ((method-of-object (-> self control) collide-shape-method-28)) + ) + (send-event self 'end-mode (zero? (logand s4-3 75))) + ) + ) + (vector-rotate-y! + (-> self control unknown-vector08) + (-> self control unknown-vector08) + (+ (-> self board ride-rot) (* -2730.6667 (-> self board ride-lean))) + ) + (set! (-> self board ride-time) (-> self clock frame-counter)) + (set! (-> self board ride-speed) f30-2) + ) + ) + ) + (let ((v0-3 (-> self clock frame-counter))) + (set! (-> self control unknown-time-frame06) v0-3) + v0-3 + ) + ) + ) + +(defbehavior board-ride-add-thrust target ((arg0 vector) (arg1 float)) + (let* ((f30-0 (-> self board ride-speed)) + (f0-4 + (lerp-scale + (-> self control unknown-surface01 fric) + (* 0.2 (-> self control unknown-surface01 fric)) + f30-0 + 0.0 + (-> self control unknown-surface01 transv-max) + ) + ) + (f30-1 (seek f30-0 0.0 (* f0-4 (-> self clock seconds-per-frame)))) + (f28-0 (vector-dot (-> self board ride-dir) arg0)) + (f0-19 + (+ f30-1 + (* (if (< 0.0 f28-0) + (* f28-0 + (lerp-scale + (-> self control unknown-surface01 target-speed) + 0.0 + (-> self board ride-speed) + 0.0 + (-> self control unknown-surface01 transv-max) + ) + arg1 + ) + (* 40960.0 arg1 f28-0) + ) + (-> self clock seconds-per-frame) + ) + ) + ) + (v1-21 (-> self control unknown-vector08)) + (f1-6 (vector-dot (-> self control dynam gravity-normal) v1-21)) + (f0-20 + (if (< f1-6 0.0) + (+ f0-19 (* (- f1-6) (-> self control unknown-surface01 slope-down-factor) (-> self clock seconds-per-frame))) + (+ f0-19 (* (- f1-6) (-> self control unknown-surface01 slope-up-factor) (-> self clock seconds-per-frame))) + ) + ) + ) + (set! (-> self board ride-speed) (fmax 0.0 (fmin f0-20 (-> self control unknown-surface01 transv-max)))) + ) + 0 + (none) + ) + +(defbehavior target-board-ride-post target () + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control unknown-word07) gp-1) + (flag-setup) + (set! (-> self control unknown-float30) 32.0) + (set! (-> self control unknown-float29) 1.0) + (logior! (-> self control root-prim prim-core action) (collide-action check-edge)) + (if (< (-> self control unknown-float15) 0.0) + (set! (-> self control unknown-float15) (- 1.0 (-> self control unknown-cpad-info00 stick0-speed))) + ) + (build-conversions (-> self control transv)) + (do-rotations1) + (let ((s5-0 (new-stack-vector0))) + (read-pad s5-0) + (turn-to-vector s5-0 (-> self control unknown-float12)) + (if (< 0.0 (-> self control unknown-float10)) + (set! (-> self board ride-pad-vector 0 quad) (-> self control unknown-vector08 quad)) + ) + (board-ride-add-thrust s5-0 (-> self control unknown-float10)) + (let ((s5-1 (vector-rotate-y! (new 'stack-no-clear 'vector) s5-0 16384.0))) + (set! (-> s5-1 y) 0.0) + (vector-xz-normalize! s5-1 (-> self control unknown-float10)) + (let ((f0-16 (vector-dot s5-1 (-> self board ride-dir)))) + (if (>= 0.0 (-> self control unknown-float10)) + (set! f0-16 0.0) + ) + (set! (-> self board ride-lean-targ) f0-16) + (+! (-> self board ride-leanv) + (* 100.0 (-> self clock seconds-per-frame) (- f0-16 (-> self board ride-lean))) + ) + ) + ) + ) + (set! (-> self board ride-leanv) (* 0.95 (-> self board ride-leanv))) + (seek! + (-> self board ride-lean-mag) + (fabs (analog-input (the-as int (-> self control unknown-cpad-info00 leftx)) 128.0 32.0 110.0 1.0)) + (* 2.0 (-> self clock seconds-per-frame)) + ) + (+! (-> self board ride-lean) (* (-> self board ride-leanv) (-> self clock seconds-per-frame))) + (cond + ((< (-> self board ride-lean) -1.0) + (set! (-> self board ride-lean) -1.0) + (set! (-> self board ride-leanv) (* 0.0 (-> self board ride-leanv))) + ) + ((< 1.0 (-> self board ride-lean)) + (set! (-> self board ride-lean) 1.0) + (set! (-> self board ride-leanv) (* 0.0 (-> self board ride-leanv))) + ) + ) + 0 + (add-gravity) + (reverse-conversions (-> self control transv)) + (target-board-compute-edge) + (do-rotations2) + (pre-collide-setup) + (seek! (-> self board cushion-offset) 1638.4 (* 16384.0 (-> self clock seconds-per-frame))) + (let ((s5-3 (new 'stack-no-clear 'vector))) + (set! (-> s5-3 quad) (-> self control transv quad)) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (set! (-> s4-1 quad) (-> self control trans quad)) + (when *debug-segment* + (let ((s3-0 (-> *display* frames (-> *display* on-screen) profile-array data 0)) + (v1-90 'target) + (s2-0 *profile-target-color*) + ) + (when (and *dproc* *debug-segment*) + (let ((s1-0 (-> s3-0 data (-> s3-0 count)))) + (let ((s0-0 (-> s3-0 base-time))) + (set! (-> s1-0 name) v1-90) + (set! (-> s1-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s0-0)))) + ) + (set! (-> s1-0 depth) (the-as uint (-> s3-0 depth))) + (set! (-> s1-0 color) s2-0) + (set! (-> s3-0 segment (-> s3-0 depth)) s1-0) + ) + (+! (-> s3-0 count) 1) + (+! (-> s3-0 depth) 1) + (set! (-> s3-0 max-depth) (max (-> s3-0 max-depth) (-> s3-0 depth))) + ) + ) + 0 + ) + (let ((a2-4 (new 'stack-no-clear 'collide-query)) + (v1-103 (-> self control)) + ) + (set! (-> a2-4 collide-with) (-> v1-103 root-prim prim-core collide-with)) + (set! (-> a2-4 ignore-process0) self) + (set! (-> a2-4 ignore-process1) #f) + (set! (-> a2-4 ignore-pat) (-> v1-103 pat-ignore-mask)) + (set! (-> a2-4 action-mask) (collide-action solid)) + (collide-shape-method-32 v1-103 (-> v1-103 transv) a2-4 (meters 1.0)) + ) + (when (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) + (set! (-> *collide-edge-board-spec* flags) (logand -5 (-> *collide-edge-board-spec* flags))) + (cond + ((>= (- (-> self clock frame-counter) (-> self board ride-time)) (seconds 0.2)) + (set! (-> *collide-edge-board-spec* flags) (logand -3 (-> *collide-edge-board-spec* flags))) + (set! (-> *collide-edge-board-spec* touching-segment) #f) + ) + (else + (logior! (-> *collide-edge-board-spec* flags) 2) + (dotimes (v1-122 2) + (set! (-> self board ride-touch-segment v1-122 quad) + (-> self board ride-vertex (+ (-> self board ride-vertex-base) v1-122) quad) + ) + ) + (set! (-> *collide-edge-board-spec* touching-segment) (the-as symbol (-> self board ride-touch-segment))) + ) + ) + (target-method-27 *target* *collide-cache* *collide-edge-board-spec*) + ) + (when *debug-segment* + (let ((s3-1 (-> *display* frames (-> *display* on-screen) profile-array data 0))) + (when (and *dproc* *debug-segment*) + (let* ((v1-140 (+ (-> s3-1 depth) -1)) + (s2-1 (-> s3-1 segment v1-140)) + (s1-1 (-> s3-1 base-time)) + ) + (when (>= v1-140 0) + (set! (-> s2-1 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s1-1)))) + (+! (-> s3-1 depth) -1) + ) + ) + ) + ) + 0 + ) + (when (logtest? (focus-status rail) (-> self focus-status)) + (let ((s3-2 (new 'stack-no-clear 'vector))) + (let ((f28-1 + (fmax + 0.0 + (segment-array-vector->index + (-> self board ride-vertex) + (-> self board ride-vertex-length) + (the-as float s4-1) + (* (-> self board ride-speed) (-> self clock seconds-per-frame)) + ) + ) + ) + ) + (set! (-> self board ride-vertex-base2) + (segment-array-index->vector (-> self board ride-vertex) (-> self board ride-vertex-length) f28-1 s3-2) + ) + (set! (-> self board ride-vertex-index2) f28-1) + ) + (if (probe-test + (-> self control) + (vector-! (new 'stack-no-clear 'vector) s3-2 (-> self control trans)) + (new 'static 'pat-surface :noentity #x1 :noboard #x1 :probe #x1) + ) + (set! (-> self control status) (logior (cshape-moving-flags csmf16) (-> self control status))) + ) + (if (and (-> self board ride-lock-on) (zero? (logand (cshape-moving-flags csmf16) (-> self control status)))) + (collide-shape-method-29 (-> self control) s3-2) + ) + ) + (set! (-> self control transv quad) (-> s5-3 quad)) + ) + ) + (target-board-physics s5-3) + ) + (bend-gravity) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (when *debug-segment* + (let ((gp-2 (-> *display* frames (-> *display* on-screen) profile-array data 0)) + (v1-182 'target-post) + (s5-4 *profile-target-post-color*) + ) + (when (and *dproc* *debug-segment*) + (let ((s4-2 (-> gp-2 data (-> gp-2 count)))) + (let ((s3-3 (-> gp-2 base-time))) + (set! (-> s4-2 name) v1-182) + (set! (-> s4-2 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-3)))) + ) + (set! (-> s4-2 depth) (the-as uint (-> gp-2 depth))) + (set! (-> s4-2 color) s5-4) + (set! (-> gp-2 segment (-> gp-2 depth)) s4-2) + ) + (+! (-> gp-2 count) 1) + (+! (-> gp-2 depth) 1) + (set! (-> gp-2 max-depth) (max (-> gp-2 max-depth) (-> gp-2 depth))) + ) + ) + 0 + ) + (ja-post) + (when *debug-segment* + (let ((gp-3 (-> *display* frames (-> *display* on-screen) profile-array data 0))) + (when (and *dproc* *debug-segment*) + (let* ((v1-206 (+ (-> gp-3 depth) -1)) + (s5-5 (-> gp-3 segment v1-206)) + (s4-3 (-> gp-3 base-time)) + ) + (when (>= v1-206 0) + (set! (-> s5-5 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s4-3)))) + (+! (-> gp-3 depth) -1) + ) + ) + ) + ) + 0 + ) + (joint-points) + (do-target-gspot) + (vector-cross! + (-> self control local-normal) + (-> self control unknown-vector36) + (-> self control unknown-vector34) + ) + (if (< (vector-dot (-> self control local-normal) (-> self control dynam gravity-normal)) 0.0) + (vector-negate! (-> self control local-normal) (-> self control local-normal)) + ) + (set! (-> self control gspot-normal quad) (-> self control local-normal quad)) + (target-powerup-process) + (target-board-exit-check) + (target-board-effect) + (set! (-> self board board-time) (-> self clock frame-counter)) + 0 + (none) + ) + +(defbehavior target-board-post target () + (target-board-real-post) + (none) + ) + +(defbehavior target-board-center-anim target () + (set! (-> self board turn-anim-frame) 0.0) + 0 + (none) + ) + +(defbehavior target-board-turn-anim target ((arg0 int)) + (let ((f30-0 (-> self clock clock-ratio))) + (let ((s5-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float s5-1))) + (while (nonzero? s5-1) + (+! s5-1 -1) + (set! (-> self control unknown-word07) s5-1) + (set! (-> self board turn-anim-targ) (fmax -10.0 (fmin 10.0 (-> self board turn-anim-targ)))) + (or (not (>= (* (-> self board turn-anim-targ) (-> self board turn-anim-frame)) 0.0)) + (< (fabs (-> self board turn-anim-frame)) (fabs (-> self board turn-anim-targ))) + ) + (+! (-> self board turn-anim-vel) + (* (- (-> self board turn-anim-targ) (-> self board turn-anim-frame)) + (lerp-scale + 20.0 + (if (< (fabs (-> self board turn-anim-frame)) (fabs (-> self board turn-anim-targ))) + 30.0 + 60.0 + ) + (-> self control unknown-float05) + 0.0 + (* 0.3 (-> self board transv-max)) + ) + (-> self clock seconds-per-frame) + ) + ) + (set! (-> self board turn-anim-vel) + (fmax + -100.0 + (fmin + 100.0 + (* (-> self board turn-anim-vel) + (lerp-scale 0.96 0.9 (-> self control unknown-float05) 0.0 (* 0.3 (-> self board transv-max))) + ) + ) + ) + ) + (+! (-> self board turn-anim-frame) (* (-> self board turn-anim-vel) (-> self clock seconds-per-frame))) + (set! (-> self board turn-anim-frame) + (fmax + (fmin (-> self board turn-anim-frame) (-> *TARGET_BOARD-bank* turn-frames)) + (- (-> *TARGET_BOARD-bank* turn-frames)) + ) + ) + (cond + ((and (>= (-> self board turn-anim-frame) (-> *TARGET_BOARD-bank* turn-frames)) + (>= (-> self board turn-anim-vel) 0.0) + ) + (set! (-> self board turn-anim-vel) 0.0) + ) + ((and (>= (- (-> *TARGET_BOARD-bank* turn-frames)) (-> self board turn-anim-frame)) + (>= 0.0 (-> self board turn-anim-vel)) + ) + (set! (-> self board turn-anim-vel) 0.0) + ) + ) + (ja :chan arg0 + :num-func num-func-identity + :frame-num (ja-aframe + (fmax + (fmin + (+ (fmax + (fmin (-> self board turn-anim-frame) (+ -1.0 (-> *TARGET_BOARD-bank* turn-frames))) + (- (+ -1.0 (-> *TARGET_BOARD-bank* turn-frames))) + ) + (* (sin (* 145.63556 (the float (- (-> self clock frame-counter) (-> self state-time))))) + (lerp-scale 1.0 2.0 (fabs (-> self board turn-anim-frame)) 0.0 (-> *TARGET_BOARD-bank* turn-frames)) + ) + ) + (-> *TARGET_BOARD-bank* turn-frames) + ) + (- (-> *TARGET_BOARD-bank* turn-frames)) + ) + arg0 + ) + ) + (let ((f0-59 (fmin + (if (logtest? (-> self control status) (cshape-moving-flags on-surface)) + (seek (-> self board turn-anim-duck) 0.0 (-> self clock seconds-per-frame)) + (-> self board turn-anim-duck) + ) + (lerp-scale + 0.0 + -1.0 + (the float (- (-> self clock frame-counter) (-> self control unknown-time-frame06))) + 30.0 + 120.0 + ) + ) + ) + ) + (+! (-> self board turn-anim-duck) (* (-> self board turn-anim-duck-vel) (-> self clock seconds-per-frame))) + (cond + ((< (-> self board turn-anim-duck) f0-59) + (set! (-> self board turn-anim-duck) f0-59) + (set! (-> self board turn-anim-duck-vel) 0.0) + ) + ((< 1.0 (-> self board turn-anim-duck)) + (set! (-> self board turn-anim-duck) 1.0) + (set! (-> self board turn-anim-duck-vel) 0.0) + ) + ) + ) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + 0 + (none) + ) + +(defmethod add-to-trick-list board-info ((obj board-info) (arg0 board-tricks) (arg1 float)) + "Add specified trick and point amount to trick list." + (send-event (handle->process (-> obj process 0 notify)) 'notify 'trick-point arg0) + (when (and (< (-> obj trick-count) 16) + (and (< 0.0 arg1) (nonzero? (-> (the-as fact-info-target (-> obj process 0 fact)) trick-point-duration))) + ) + (let ((s4-0 0)) + (when (>= (- (-> *display* game-clock frame-counter) + (-> (the-as fact-info-target (-> obj process 0 fact)) trick-point-pickup-time) + ) + (seconds 30) + ) + (countdown (v1-20 16) + (set! (-> obj trick-list 0) (board-tricks none)) + ) + ) + (countdown (v1-23 15) + (if (= (-> obj trick-list v1-23) arg0) + (+! s4-0 1) + ) + (set! (-> obj trick-list (+ v1-23 1)) (-> obj trick-list v1-23)) + ) + (set! (-> obj trick-list 0) arg0) + (let* ((a0-24 (* arg1 (lerp-scale 1.0 0.1 (the float s4-0) 2.0 6.0))) + (s3-1 (the float (* 25 (/ (+ (the int a0-24) 24) 25)))) + ) + (sound-play "do-trick") + (let ((t9-4 format) + (a0-29 #t) + (a1-8 "trick: ~S (~D) ~,,0f") + (v1-30 arg0) + ) + (t9-4 + a0-29 + a1-8 + (cond + ((= v1-30 (board-tricks board-rail-jump)) + "board-rail-jump" + ) + ((= v1-30 (board-tricks board-nosegrab)) + "board-nosegrab" + ) + ((= v1-30 (board-tricks board-board-spin)) + "board-board-spin" + ) + ((= v1-30 (board-tricks board-kickflip)) + "board-kickflip" + ) + ((= v1-30 (board-tricks board-method)) + "board-method" + ) + ((= v1-30 (board-tricks board-spin)) + "board-spin" + ) + ((= v1-30 (board-tricks board-boost)) + "board-boost" + ) + ((= v1-30 (board-tricks darkjak)) + "darkjak" + ) + ((= v1-30 (board-tricks darkjak-giant)) + "darkjak-giant" + ) + ((= v1-30 (board-tricks board-duck-jump)) + "board-duck-jump" + ) + ((= v1-30 (board-tricks board-board-flip)) + "board-board-flip" + ) + ((= v1-30 (board-tricks board-rail)) + "board-rail" + ) + ((= v1-30 (board-tricks none)) + "none" + ) + ((= v1-30 (board-tricks darkjak-bomb0)) + "darkjak-bomb0" + ) + ((= v1-30 (board-tricks board-quick-jump)) + "board-quick-jump" + ) + ((= v1-30 (board-tricks board-noseflip)) + "board-noseflip" + ) + ((= v1-30 (board-tricks darkjak-bomb1)) + "darkjak-bomb1" + ) + ((= v1-30 (board-tricks board-jump)) + "board-jump" + ) + ((= v1-30 (board-tricks board-flip)) + "board-flip" + ) + (else + "*unknown*" + ) + ) + s4-0 + s3-1 + ) + ) + (when (nonzero? (-> obj trick-count)) + (format #t " + combo ~,,0f" (-> obj trick-points-array (+ (-> obj trick-count) -1))) + (+! (-> obj trick-points-array (+ (-> obj trick-count) -1)) + (-> obj trick-points-array (+ (-> obj trick-count) -1)) + ) + ) + (format #t "~%") + (set! (-> obj trick-array (-> obj trick-count)) arg0) + (set! (-> obj trick-points-array (-> obj trick-count)) s3-1) + ) + ) + (+! (-> obj trick-count) 1) + ) + 0 + (none) + ) + +(defmethod flush-trick-list board-info ((obj board-info)) + "Flush trick list and give out points." + (let ((f30-0 0.0)) + (dotimes (v1-0 (-> obj trick-count)) + (+! f30-0 (-> obj trick-points-array v1-0)) + ) + (when (< 0.0 f30-0) + (send-event + (handle->process (-> obj process 0 notify)) + 'notify + 'trick-flush + f30-0 + (-> obj trick-list) + (-> obj trick-count) + ) + (send-event (ppointer->process (-> obj process)) 'get-pickup 19 f30-0) + (sound-play "trick-score") + ) + ) + (set! (-> obj trick-count) 0) + 0 + 0 + (none) + ) \ No newline at end of file diff --git a/goal_src/jak2/engine/target/gun/gun-h.gc b/goal_src/jak2/engine/target/gun/gun-h.gc index 9192da1b1..93e2f28b6 100644 --- a/goal_src/jak2/engine/target/gun/gun-h.gc +++ b/goal_src/jak2/engine/target/gun/gun-h.gc @@ -56,9 +56,9 @@ (gun-roty-rel degrees :offset-assert 144) (gun-roty degrees :offset-assert 148) (gun-roty-targ degrees :offset-assert 152) - (hips basic :offset-assert 156) - (upper-body basic :offset-assert 160) - (chest basic :offset-assert 164) + (hips joint-mod :offset-assert 156) + (upper-body joint-mod :offset-assert 160) + (chest joint-mod :offset-assert 164) (fire-dir-rot degrees :offset-assert 168) (fire-dir vector 2 :inline :offset-assert 176) (fire-point vector :inline :offset-assert 208) @@ -109,7 +109,7 @@ (top-anim-tilt-up degrees :offset-assert 600) (attack-combo combo-tracker :inline :offset-assert 608) (combo-window-start time-frame :offset-assert 656) - (combo-window-state uint32 :offset-assert 664) + (combo-window-state symbol :offset-assert 664) (combo-fire-delay uint32 :offset-assert 668) (charge-ammo float :offset-assert 672) (charge-start-time time-frame :offset-assert 680) @@ -149,7 +149,7 @@ (-> arg0 gun latch?) ) (not (-> arg0 skel top-anim frame-group)) - (>= (- (-> self clock frame-counter) (-> arg0 control unknown-time-frame12)) (seconds 0.1)) + (>= (- (-> self clock frame-counter) (-> arg0 control unknown-time-frame20)) (seconds 0.1)) ) ) diff --git a/goal_src/jak2/engine/target/logic-target.gc b/goal_src/jak2/engine/target/logic-target.gc index c77ff262a..c39a6f57e 100644 --- a/goal_src/jak2/engine/target/logic-target.gc +++ b/goal_src/jak2/engine/target/logic-target.gc @@ -491,7 +491,7 @@ (-> arg0 control unknown-vector21 y) (- (-> (the-as target pp) clock frame-counter) (-> arg0 control unknown-time-frame06)) (- (-> arg0 control trans y) (-> arg0 control unknown-vector21 y)) - (- (-> arg0 control unknown-vector37 y) (-> arg0 control unknown-vector36 y)) + (- (-> arg0 control unknown-vector43 y) (-> arg0 control unknown-vector42 y)) (-> arg0 control ground-impact-vel) ) (let* ((t9-76 format) @@ -499,16 +499,16 @@ (a1-56 "~0k~Tcd: ~,,2M md:~,,2M~%") (v1-191 (vector-! (new-stack-vector0) (-> arg0 control trans) (-> arg0 control unknown-vector21))) (a2-17 (sqrtf (+ (* (-> v1-191 x) (-> v1-191 x)) (* (-> v1-191 z) (-> v1-191 z))))) - (v1-193 (vector-! (new-stack-vector0) (-> arg0 control unknown-vector37) (-> arg0 control unknown-vector36))) + (v1-193 (vector-! (new-stack-vector0) (-> arg0 control unknown-vector43) (-> arg0 control unknown-vector42))) ) (t9-76 a0-131 a1-56 a2-17 (sqrtf (+ (* (-> v1-193 x) (-> v1-193 x)) (* (-> v1-193 z) (-> v1-193 z))))) ) (format arg1 "~0kbend b:~F t:~F s:~F~%" - (-> arg0 control unknown-float27) (-> arg0 control unknown-float28) (-> arg0 control unknown-float29) + (-> arg0 control unknown-float30) ) (set! sv-64 0) (set! sv-72 0) @@ -670,7 +670,7 @@ ) ) (let ((f1-1 (* 0.0625 f1-0))) - (set! (-> self control unknown-word02) a0-3) + (set! (-> self control unknown-word03) a0-3) (set! (-> self control unknown-float32) f1-1) (if (logtest? (-> self control unknown-surface01 flags) (surface-flag no-turn-around)) (set! (-> v1-7 0) (-> self clock frame-counter)) @@ -693,7 +693,7 @@ ;; INFO: Used lq/sq (defbehavior wall-hide? target () (when (and (< 0.7 (-> self control unknown-float12)) - (< 0.7 (-> self control unknown-float26)) + (< 0.7 (-> self control unknown-float27)) (and (< (-> self control unknown-float05) 8192.0) (logtest? (-> self control status) (cshape-moving-flags t-wall)) (zero? (logand (-> self control status) (cshape-moving-flags t-act))) @@ -704,11 +704,11 @@ ) ) ) - (if (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame22)) (seconds 0.1)) - (set! (-> self control unknown-time-frame23) (-> self clock frame-counter)) + (if (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame31)) (seconds 0.1)) + (set! (-> self control unknown-time-frame32) (-> self clock frame-counter)) ) - (set! (-> self control unknown-time-frame22) (-> self clock frame-counter)) - (when (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame23)) (seconds 0.5)) + (set! (-> self control unknown-time-frame31) (-> self clock frame-counter)) + (when (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame32)) (seconds 0.5)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (let ((v1-34 (-> gp-0 bbox)) (a0-13 (-> self control trans)) @@ -814,12 +814,12 @@ (warp-vector-into-surface! gp-0 arg0 (-> self control local-normal) (-> self control unknown-matrix03)) (set! (-> self control unknown-float11) (-> self control unknown-float10)) (set! (-> self control unknown-float09) (-> self control unknown-float08)) - (set! (-> self control unknown-vector08 quad) (-> self control unknown-vector07 quad)) - (set! (-> self control unknown-vector10 quad) (-> self control unknown-vector09 quad)) - (vector-float*! (-> self control unknown-vector09) gp-0 arg1) + (set! (-> self control unknown-vector09 quad) (-> self control unknown-vector08 quad)) + (set! (-> self control unknown-vector11 quad) (-> self control unknown-vector10 quad)) + (vector-float*! (-> self control unknown-vector10) gp-0 arg1) (if (< 0.0 arg1) (warp-vector-into-surface! - (-> self control unknown-vector07) + (-> self control unknown-vector08) arg0 *up-vector* (-> self control unknown-matrix03) @@ -1042,7 +1042,7 @@ (set! (-> s3-1 z) (fmax (fmin 0.0 (-> s3-1 z)) (-> s4-0 z))) (set! (-> s3-1 z) (fmax 0.0 (fmin (-> s3-1 z) (-> s4-0 z)))) ) - (if (< 0.2 (-> self control unknown-float26)) + (if (< 0.2 (-> self control unknown-float27)) (vector-seek! s3-1 s4-0 (* 122880.0 (-> self clock seconds-per-frame))) ) (vector-matrix*! s2-0 s3-1 (-> self control unknown-matrix01)) @@ -1195,17 +1195,17 @@ (vector-matrix*! gp-0 gp-0 s3-0) (set! (-> self control unknown-float19) (- (vector-dot (-> self control surface-normal) gp-0))) (set! (-> self control unknown-float17) (- (vector-dot (-> self control local-normal) gp-0))) - (set! (-> self control unknown-float21) (- (vector-dot (-> self control gspot-normal) gp-0))) - (set! (-> self control unknown-float24) (- (vector-dot s4-0 gp-0))) + (set! (-> self control unknown-float22) (- (vector-dot (-> self control gspot-normal) gp-0))) + (set! (-> self control unknown-float25) (- (vector-dot s4-0 gp-0))) (set-vector! gp-0 1.0 0.0 0.0 1.0) (vector-matrix*! gp-0 gp-0 s3-0) (set! (-> self control unknown-float20) (- (vector-dot (-> self control surface-normal) gp-0))) (set! (-> self control unknown-float18) (- (vector-dot (-> self control local-normal) gp-0))) - (set! (-> self control unknown-float22) (- (vector-dot (-> self control gspot-normal) gp-0))) - (set! (-> self control unknown-float25) (- (vector-dot s4-0 gp-0))) + (set! (-> self control unknown-float23) (- (vector-dot (-> self control gspot-normal) gp-0))) + (set! (-> self control unknown-float26) (- (vector-dot s4-0 gp-0))) (set-vector! gp-0 1.0 0.0 0.0 1.0) (vector-matrix*! gp-0 gp-0 (-> self control unknown-matrix01)) - (set! (-> self control unknown-float23) (vector-dot gp-0 s5-0)) + (set! (-> self control unknown-float24) (vector-dot gp-0 s5-0)) ) 0 ) @@ -1249,7 +1249,7 @@ ) (zero? (logand (-> self control unknown-surface01 flags) (surface-flag turn-to-vel))) ) - (-> self control unknown-vector07) + (-> self control unknown-vector08) ) (else (-> self control transv) @@ -1675,17 +1675,17 @@ (defbehavior flag-setup target () (cond ((= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (if (zero? (-> self control unknown-dword07)) - (set! (-> self control unknown-dword07) - (the-as int (- (-> self clock frame-counter) (-> self control unknown-time-frame19))) + (if (zero? (-> self control unknown-dword12)) + (set! (-> self control unknown-dword12) + (the-as int (- (-> self clock frame-counter) (-> self control unknown-time-frame28))) ) ) - (set! (-> self control unknown-time-frame19) (-> self clock frame-counter)) - (quaternion-copy! (-> self control unknown-quaternion04) (-> self control dir-targ)) + (set! (-> self control unknown-time-frame28) (-> self clock frame-counter)) + (quaternion-copy! (-> self control unknown-quaternion05) (-> self control dir-targ)) ) (else - (set! (-> self control unknown-time-frame20) (-> self clock frame-counter)) - (set! (-> self control unknown-dword07) 0) + (set! (-> self control unknown-time-frame29) (-> self clock frame-counter)) + (set! (-> self control unknown-dword12) 0) 0 ) ) @@ -1708,24 +1708,24 @@ (else (let ((v1-49 (-> self control trans))) (when (logtest? (-> self control old-status) (cshape-moving-flags on-surface)) - (set! (-> self control unknown-vector36 quad) (-> self control unknown-vector21 quad)) - (set! (-> self control unknown-vector37 quad) (-> self control unknown-vector21 quad)) + (set! (-> self control unknown-vector42 quad) (-> self control unknown-vector21 quad)) + (set! (-> self control unknown-vector43 quad) (-> self control unknown-vector21 quad)) ) - (set! (-> self control unknown-vector37 x) (-> v1-49 x)) - (set! (-> self control unknown-vector37 z) (-> v1-49 z)) + (set! (-> self control unknown-vector43 x) (-> v1-49 x)) + (set! (-> self control unknown-vector43 z) (-> v1-49 z)) (if (< (vector-dot (-> self control dynam gravity-normal) - (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector37) v1-49) + (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector43) v1-49) ) 0.0 ) - (set! (-> self control unknown-vector37 y) (-> v1-49 y)) + (set! (-> self control unknown-vector43 y) (-> v1-49 y)) ) ) ) ) (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) r3) - (zero? (-> self control unknown-word03)) + (zero? (-> self control unknown-word07)) (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask movie))) (not *pause-lock*) ) @@ -1800,7 +1800,7 @@ ) ) (send-event *camera* 'reset-follow) - (set! (-> self control unknown-time-frame12) (-> self clock frame-counter)) + (set! (-> self control unknown-time-frame20) (-> self clock frame-counter)) (cond ((logtest? (focus-status mech indax) (-> self focus-status)) (if (not (and (-> self next-state) @@ -1918,7 +1918,7 @@ ) ) ) - (set! (-> self control unknown-float29) + (set! (-> self control unknown-float30) (if (logtest? (-> self control status) (cshape-moving-flags on-surface)) 32.0 2.0 @@ -1949,24 +1949,24 @@ (set! (-> self control unknown-time-frame07) (-> self clock frame-counter)) ) (when (logtest? (-> self state-flags) (state-flags tinvul1)) - (if (< (logand (- (-> self clock frame-counter) (-> self control unknown-time-frame13)) 3) 1) + (if (< (logand (- (-> self clock frame-counter) (-> self control unknown-time-frame22)) 3) 1) (logior! (-> self draw status) (draw-control-status no-draw-bounds)) (logclear! (-> self draw status) (draw-control-status no-draw-bounds)) ) - (if (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame13)) - (-> self control unknown-time-frame14) + (if (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame22)) + (-> self control unknown-time-frame23) ) (target-timed-invulnerable-off self 1) ) ) (when (logtest? (state-flags tinvul2) (-> self state-flags)) - (if (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame15)) - (-> self control unknown-time-frame16) + (if (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame24)) + (-> self control unknown-time-frame25) ) (target-timed-invulnerable-off self 2) ) ) - (set! (-> self control unknown-symbol01) #f) + (set! (-> self control unknown-symbol06) #f) (target-gun-joint-pre) ((-> self pre-joint-hook)) (target-log-trans) @@ -2045,14 +2045,14 @@ (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) ) 0.0 - (-> self control unknown-float28) + (-> self control unknown-float29) ) ) ) (seek! - (-> self control unknown-float27) + (-> self control unknown-float28) f0-1 - (* (-> self control unknown-float29) (-> self clock seconds-per-frame)) + (* (-> self control unknown-float30) (-> self clock seconds-per-frame)) ) ) (set! (-> self control dynam gravity-normal quad) (-> self control unknown-dynamics00 gravity-normal quad)) @@ -2070,7 +2070,7 @@ s5-0 (-> self control unknown-dynamics00 gravity-normal) gp-0 - (-> self control unknown-float27) + (-> self control unknown-float28) ) (let ((a2-3 (matrix-from-two-vectors-smooth! @@ -2188,7 +2188,7 @@ ) ) (let ((gp-2 (vector-cross! - (-> self control unknown-vector35) + (-> self control unknown-vector36) (-> self control unknown-vector34) (-> self control dynam gravity-normal) ) @@ -2198,7 +2198,7 @@ (set! (-> self control unknown-float33) (vector-length s4-1)) (cond ((and (< 819.2 (-> self control unknown-float33)) - (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame10)) (seconds 0.2)) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame15)) (seconds 0.2)) ) (cond ((-> s5-0 pilot-edge-grab?) @@ -2257,8 +2257,8 @@ ((method-of-object (-> self control) collide-shape-method-28)) (vector-float*! (-> self control rider-last-move) s4-1 (-> self clock frames-per-second)) (set! (-> self control rider-time) (-> self clock frame-counter)) - (if (and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame11)) (seconds 0.5)) - (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame10)) (seconds 0.5)) + (if (and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame16)) (seconds 0.5)) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame15)) (seconds 0.5)) ) (send-event self 'end-mode) ) @@ -2275,7 +2275,7 @@ ) (set! (-> self control unknown-float33) 0.0) (set! (-> self control unknown-vector21 quad) (-> self control trans quad)) - (set! (-> self control unknown-time-frame10) (-> self clock frame-counter)) + (set! (-> self control unknown-time-frame15) (-> self clock frame-counter)) ) ) ) @@ -2338,7 +2338,7 @@ ) ) (vector-cross! - (-> self control unknown-vector35) + (-> self control unknown-vector36) (-> self control unknown-vector34) (-> self control dynam gravity-normal) ) @@ -2365,7 +2365,7 @@ (vf4 :class vf) ) (init-vf0-vector) - (let* ((s2-0 (handle->process (-> self control unknown-handle00))) + (let* ((s2-0 (handle->process (-> self control unknown-handle01))) (gp-0 (-> (the-as swingpole s2-0) dir)) ) (set! (-> self control unknown-vector34 quad) (-> gp-0 quad)) @@ -2449,14 +2449,14 @@ ) (let ((a0-26 (vector-! (new-stack-vector0) s5-0 (-> self control unknown-vector30)))) (cond - ((and (< 2457.6 (vector-length a0-26)) (not (-> self control unknown-symbol00))) + ((and (< 2457.6 (vector-length a0-26)) (not (-> self control unknown-symbol02))) (let ((s4-1 (method-of-object (-> self control) collide-shape-method-28))) (vector-normalize! a0-26 2457.6) (s4-1) ) ) (else - (set! (-> self control unknown-symbol00) #t) + (set! (-> self control unknown-symbol02) (the-as float #t)) (collide-shape-method-29 (-> self control) (vector-! (new 'stack-no-clear 'vector) s5-0 (-> self control unknown-vector31)) @@ -2466,7 +2466,7 @@ ) ) ) - (let ((s5-3 (vector-cross! (-> self control unknown-vector35) gp-0 (-> self control dynam gravity-normal)))) + (let ((s5-3 (vector-cross! (-> self control unknown-vector36) gp-0 (-> self control dynam gravity-normal)))) (if (>= 0.0 (vector-dot s5-3 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00))) ) @@ -2522,7 +2522,7 @@ ) (vector<-cspace! gp-0 (-> self node-list data 6)) (cond - ((>= (+ (-> self clock frame-counter) (seconds -2)) (-> self control unknown-time-frame17)) + ((>= (+ (-> self clock frame-counter) (seconds -2)) (-> self control unknown-time-frame26)) (set! (-> self control unknown-vector15 quad) (-> s5-0 quad)) ) ((not (and (logtest? (-> self water flags) (water-flags under-water)) @@ -2533,7 +2533,7 @@ (-> self control unknown-vector15) gp-0 s5-0 - (* 0.0016666667 (the float (- (-> self clock frame-counter) (-> self control unknown-time-frame17)))) + (* 0.0016666667 (the float (- (-> self clock frame-counter) (-> self control unknown-time-frame26)))) ) ) (else @@ -2545,7 +2545,7 @@ 0.0 (fmin 1.0 - (* 0.0011111111 (the float (- (-> self clock frame-counter) (-> self control unknown-time-frame18)))) + (* 0.0011111111 (the float (- (-> self clock frame-counter) (-> self control unknown-time-frame27)))) ) ) ) @@ -2650,9 +2650,7 @@ (vector-average! (-> self control unknown-vector30) gp-0 s5-0) ) (vector-! (-> self control unknown-vector31) (-> self control unknown-vector30) (-> self control trans)) - ((method-of-type impact-control update-from-cspace) - (the-as impact-control (-> self control unknown-cspace02)) - ) + (update-from-cspace (-> self control unknown-impact-control00)) (cond ((logtest? (-> self focus-status) (focus-status edge-grab)) (target-compute-edge) @@ -2691,15 +2689,15 @@ (set! (-> self control unknown-pat-surface01) (-> self control ground-pat)) ) (else - (let* ((gp-0 (new 'stack-no-clear 'collide-query)) - (a0-15 (-> self control)) - (t9-0 (method-of-object a0-15 collide-shape-moving-method-55)) - ) - (logclear (-> self control root-prim prim-core collide-with) (collide-spec water)) - #x46000000 - #x47a00000 - #x44800000 - (if (t9-0 a0-15) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (if (collide-shape-moving-method-55 + (-> self control) + gp-0 + (logclear (-> self control root-prim prim-core collide-with) (collide-spec water)) + 8192.0 + 81920.0 + 1024.0 + ) (set! (-> self control unknown-pat-surface01) (-> gp-0 best-other-tri pat)) ) ) @@ -2717,7 +2715,7 @@ (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) (while (nonzero? gp-1) (+! gp-1 -1) - (set! (-> self control unknown-word03) gp-1) + (set! (-> self control unknown-word07) gp-1) (flag-setup) (if (< (-> self control unknown-float15) 0.0) (set! (-> self control unknown-float15) (- 1.0 (-> self control unknown-cpad-info00 stick0-speed))) @@ -2798,7 +2796,7 @@ (set! (-> a2-3 ignore-pat) (-> v1-52 pat-ignore-mask)) ) (set! (-> a2-3 action-mask) (collide-action solid)) - (collide-shape-method-32 (-> self control) (-> self control transv) (the-as uint a2-3) #x45800000) + (collide-shape-method-32 (-> self control) (-> self control transv) a2-3 (meters 1.0)) ) (if (and (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) (>= (vector-dot @@ -2891,7 +2889,7 @@ (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) (while (nonzero? gp-1) (+! gp-1 -1) - (set! (-> self control unknown-word03) gp-1) + (set! (-> self control unknown-word07) gp-1) (flag-setup) (build-conversions (-> self control transv)) (do-rotations1) @@ -2934,7 +2932,7 @@ (set! (-> a2-0 ignore-pat) (-> v1-30 pat-ignore-mask)) ) (set! (-> a2-0 action-mask) (collide-action solid)) - (collide-shape-method-32 (-> self control) (-> self control transv) (the-as uint a2-0) #x45800000) + (collide-shape-method-32 (-> self control) (-> self control transv) a2-0 (meters 1.0)) ) (if (and (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) (>= (vector-dot @@ -3020,7 +3018,7 @@ (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) (while (nonzero? gp-1) (+! gp-1 -1) - (set! (-> self control unknown-word03) gp-1) + (set! (-> self control unknown-word07) gp-1) (flag-setup) (build-conversions (-> self control transv)) (do-rotations1) @@ -3063,7 +3061,7 @@ (set! (-> a2-0 ignore-pat) (-> v1-29 pat-ignore-mask)) ) (set! (-> a2-0 action-mask) (collide-action solid)) - (collide-shape-method-32 (-> self control) (-> self control transv) (the-as uint a2-0) #x45800000) + (collide-shape-method-32 (-> self control) (-> self control transv) a2-0 (meters 1.0)) ) (if (and (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) (>= (vector-dot @@ -3150,7 +3148,7 @@ (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) (while (nonzero? gp-1) (+! gp-1 -1) - (set! (-> self control unknown-word03) gp-1) + (set! (-> self control unknown-word07) gp-1) (flag-setup) (build-conversions (-> self control transv)) (do-rotations1) @@ -3159,7 +3157,7 @@ (vector-! (-> self control unknown-vector05) (-> self control unknown-vector04) - (-> self control unknown-vector06) + (-> self control unknown-vector07) ) (let ((a1-3 (new 'stack-no-clear 'overlaps-others-params))) (set! (-> a1-3 options) (overlaps-others-options oo0)) @@ -3246,7 +3244,7 @@ (vector-! (-> self control unknown-vector05) (-> self control unknown-vector04) - (-> self control unknown-vector06) + (-> self control unknown-vector07) ) (let ((a1-2 (new 'stack-no-clear 'overlaps-others-params))) (set! (-> a1-2 options) (overlaps-others-options oo0)) @@ -3282,12 +3280,12 @@ (quaternion-identity! (-> self control unknown-quaternion01)) (set! (-> self control unknown-float04) 0.0) (set! (-> self control unknown-time-frame06) (-> self clock frame-counter)) - (set! (-> self control unknown-float27) 0.0) - (set! (-> self control unknown-float29) 32.0) + (set! (-> self control unknown-float28) 0.0) + (set! (-> self control unknown-float30) 32.0) (set! (-> self cam-user-mode) 'normal) - (set! (-> self control unknown-handle00) (the-as handle #f)) (set! (-> self control unknown-handle01) (the-as handle #f)) - (set! (-> self control unknown-dword06) 0) + (set! (-> self control unknown-handle00) (the-as handle #f)) + (set! (-> self control unknown-dword11) 0) (buzz-stop! 0) self ) @@ -3402,10 +3400,10 @@ (set! (-> obj control) s0-0) ) (let ((v1-69 (-> obj control))) - (set! (-> v1-69 unknown-word04) s4-0) - (set! (-> v1-69 unknown-word06) s3-0) - (set! (-> v1-69 unknown-word05) s2-0) - (set! (-> v1-69 unknown-word07) s1-0) + (set! (-> v1-69 unknown-word08) s4-0) + (set! (-> v1-69 unknown-word10) s3-0) + (set! (-> v1-69 unknown-word09) s2-0) + (set! (-> v1-69 unknown-word11) s1-0) (set! (-> v1-69 max-iteration-count) (the-as uint 8)) (set! (-> v1-69 event-self) 'touched) ) @@ -3419,11 +3417,11 @@ (set! (-> obj control unknown-surface01 name) 'current) (set! (-> obj control unknown-surface01 active-hook) nothing) (set! (-> obj control unknown-surface01 touch-hook) nothing) - (set! (-> obj control unknown-dword05) (the-as uint #f)) + (set! (-> obj control unknown-dword06) (the-as uint #f)) (dotimes (v1-84 8) (set! (-> obj attack-info-old v1-84 attacker) (the-as handle #f)) ) - (set! (-> obj notify) (the-as uint #f)) + (set! (-> obj notify) (the-as handle #f)) (set! (-> obj mirror) (the-as (pointer process-drawable) #f)) (initialize-skeleton obj @@ -3500,9 +3498,9 @@ (set! (-> obj control backup-collde-with) (-> v1-163 prim-core collide-with)) ) (set! (-> obj sound) (new 'process 'ambient-sound "none" (-> obj control trans))) + (set! (-> obj control unknown-sound-id04) (new-sound-id)) + (set! (-> obj control unknown-sound-id03) (new-sound-id)) (set! (-> obj control unknown-sound-id02) (new-sound-id)) - (set! (-> obj control unknown-sound-id01) (new-sound-id)) - (set! (-> obj control unknown-sound-id00) (new-sound-id)) (if (and *debug-segment* (!= (-> obj tobot?) 'tobot)) (add-connection *debug-engine* obj target-print-stats obj *stdcon0* #f) ) diff --git a/goal_src/jak2/engine/target/target-h.gc b/goal_src/jak2/engine/target/target-h.gc index e3585c738..bbbacf4ed 100644 --- a/goal_src/jak2/engine/target/target-h.gc +++ b/goal_src/jak2/engine/target/target-h.gc @@ -17,6 +17,93 @@ ;; NOTE - for level-info, defined in `logic-target` (define-extern start (function symbol continue-point target)) +;; for target +(define-extern want-to-darkjak? (function symbol :behavior target)) +(define-extern target-darkjak-get-on (state int target)) +(define-extern target-darkjak-running-attack (state target)) +(define-extern target-darkjak-bomb0 (state target)) +(define-extern target-darkjak-bomb1 (state target)) +(define-extern can-feet? (function symbol symbol :behavior target)) +(define-extern target-attack-air (state symbol target)) +(define-extern target-hit-ground (state symbol target)) +(define-extern slide-down-test (function none :behavior target)) +(define-extern target-startup (state target)) +(define-extern target-standard-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-stance (state target)) +(define-extern target-state-hook-exit (function none :behavior target)) +(define-extern target-wade-stance (state target)) +(define-extern target-ice-stance (state target)) +(define-extern move-legs? (function symbol :behavior target)) +(define-extern target-walk (state target)) +(define-extern can-duck? (function symbol :behavior target)) +(define-extern target-duck-stance (state symbol target)) +(define-extern can-jump? (function symbol symbol :behavior target)) +(define-extern target-jump-go (function none :behavior target)) +(define-extern target-attack (state target)) +(define-extern can-hands? (function symbol symbol :behavior target)) +(define-extern target-running-attack (state target)) +(define-extern target-gun-stance (state target)) +(define-extern target-carry-pickup (state target)) +(define-extern fall-test (function state float none :behavior target)) +(define-extern target-falling (state symbol target)) +(define-extern target-stance-anim (function none :behavior target)) +(define-extern target-effect-exit (function none :behavior target)) +(define-extern target-ice-walk (state target)) +(define-extern can-roll? (function symbol :behavior target)) +(define-extern target-roll (state target)) +(define-extern target-duck-walk (state symbol target)) +(define-extern target-turn-around (state target)) +(define-extern target-hide (state target)) +(define-extern target-walk-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-gun-walk (state target)) +(define-extern target-walk-anim (function int none :behavior target)) +(define-extern set-forward-vel (function float vector :behavior target)) +(define-extern ja-done? (function int symbol :behavior process-drawable)) +(define-extern target-jump (state float float surface target)) +(define-extern delete-back-vel (function none :behavior target)) +(define-extern target-high-jump (state float float object target)) +(define-extern target-attack-uppercut (state float float target)) +(define-extern target-top-anim-base-mode (function int none :behavior target)) +(define-extern target-double-jump (state float float target)) +(define-extern target-flop (state float float float target)) +(define-extern target-jump-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern talker-spawn-func (function talker-speech-class process-tree vector region int)) +(define-extern target-launch (state float symbol vector int target)) +(define-extern ja-group-size (function int :behavior process-drawable)) +(define-extern target-falling-anim (function int time-frame symbol :behavior target)) +(define-extern target-duck-high-jump (state float float symbol target)) +(define-extern target-duck-high-jump-jump (state float float symbol target)) +(define-extern *uppercut-jump-mods* surface) +(define-extern ja-eval (function int :behavior process-drawable)) +(define-extern target-wade-walk (state target)) +(define-extern target-hit-ground-hard (state float target)) +(define-extern target-land-effect (function none :behavior target)) +(define-extern target-hit-ground-anim (function symbol symbol :behavior target)) +(define-extern are-still? (function symbol :behavior target)) +(define-extern *attack-end-mods* surface) +(define-extern target-send-attack (function process uint uint int int symbol :behavior target)) +(define-extern target-dangerous-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-start-attack (function none :behavior target)) +(define-extern target-danger-set! (function symbol symbol float :behavior target)) +(define-extern smack-surface? (function symbol symbol :behavior target)) +(define-extern target-height-above-ground (function float :behavior target)) +(define-extern target-align-vel-z-adjust (function float float :behavior target)) +(define-extern part-tracker-init (function sparticle-launch-group time-frame (function part-tracker none) (pointer process-drawable) process collide-prim-core none :behavior part-tracker)) +(define-extern target-bonk-event-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-attack-air-anim (function none :behavior target)) +(define-extern *uppercut-mods* surface) +(define-extern target-attack-uppercut-jump (state float float target)) +(define-extern touch-tracker-init (function vector float time-frame none :behavior touch-tracker)) +(define-extern target-flop-hit-ground (state symbol target)) +(define-extern target-swim-stance (state target)) +(define-extern target-swim-walk (state target)) +(define-extern target-swim-down (state target)) +(define-extern target-swim-up (state target)) +(define-extern target-yellow-jump-blast (state target)) +(define-extern target-hit (state symbol attack-info target)) +(define-extern target-shoved (function meters meters process (state object object target) object :behavior target)) +(define-extern target-roll-flip (state float float target)) + ;; DECOMP BEGINS (deftype target (process-focusable) @@ -63,7 +150,7 @@ (no-look-around-wait uint64 :offset-assert 2096) (burn-proc handle :offset-assert 2104) (pre-joint-hook (function none :behavior target) :offset-assert 2112) - (notify uint64 :offset-assert 2120) + (notify handle :offset-assert 2120) (mode-cache basic :offset-assert 2128) (mode-param1 uint64 :offset-assert 2136) (mode-param2 uint64 :offset-assert 2144) diff --git a/goal_src/jak2/engine/target/target.gc b/goal_src/jak2/engine/target/target.gc index 017f8858e..9e7334481 100644 --- a/goal_src/jak2/engine/target/target.gc +++ b/goal_src/jak2/engine/target/target.gc @@ -7,3 +7,4234 @@ ;; DECOMP BEGINS +(defbehavior target-falling-trans target ((arg0 symbol) (arg1 time-frame)) + (if (want-to-darkjak?) + (go target-darkjak-get-on 2) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet? #f)) + (go target-attack-air #f) + ) + (if (logtest? (-> self control status) (cshape-moving-flags on-surface)) + (go target-hit-ground #f) + ) + (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + (>= arg1 0) + (>= (- (-> self clock frame-counter) (-> self state-time)) arg1) + (not (and *cheat-mode* (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) + ) + #t + ) + (logior! (-> self control status) (cshape-moving-flags on-surface)) + (go target-hit-ground 'stuck) + ) + (if (!= (-> self state-time) (-> self clock frame-counter)) + (slide-down-test) + ) + 0 + (none) + ) + +(defstate target-startup (target) + :event target-standard-event-handler + :code (behavior () + (suspend) + (suspend) + (go target-stance) + (none) + ) + :post target-no-move-post + ) + +(defstate target-stance (target) + :event target-standard-event-handler + :enter (behavior () + (set! (-> self control unknown-surface00) *walk-mods*) + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :exit (behavior () + (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) + (set! (-> self control unknown-float29) 0.0) + (target-state-hook-exit) + (none) + ) + :trans (behavior () + ((-> self state-hook)) + (if (and (logtest? (water-flags wading) (-> self water flags)) (not (using-gun? self))) + (go target-wade-stance) + ) + (when (= (-> self control ground-pat material) (pat-material ice)) + (set! (-> self control unknown-float29) 0.0) + (logclear! (-> self state-flags) (state-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + (remove-exit) + (go target-ice-stance) + ) + (when (move-legs?) + (set! (-> self control unknown-float29) 0.0) + (logclear! (-> self state-flags) (state-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + (remove-exit) + (go target-walk) + ) + (if (want-to-darkjak?) + (go target-darkjak-get-on 2) + ) + (when (and (cpad-hold? (-> self control unknown-cpad-info00 number) l1) (can-duck?)) + (logclear! (-> self state-flags) (state-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + (set! (-> self control unknown-float29) 0.0) + (remove-exit) + (go target-duck-stance #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 x) + ) + (can-jump? #f) + ) + (target-jump-go) + ) + (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? #t) + ) + (go target-attack) + ) + (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 square) + ) + (can-hands? #t) + ) + (go target-running-attack) + ) + (if (and (using-gun? self) + (and (-> self next-state) (= (-> self next-state name) 'target-stance)) + (let ((v1-85 (ja-group))) + (and v1-85 (= v1-85 (-> self draw art-group data 5))) + ) + ) + (go target-gun-stance) + ) + (if (and (logtest? (-> self game features) (game-feature carry)) + (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 r1) + ) + ) + (go target-carry-pickup) + ) + (slide-down-test) + (fall-test target-falling -4096000.0) + (none) + ) + :code target-stance-anim + :post target-post + ) + +(defstate target-walk (target) + :event target-walk-event-handler + :enter (behavior () + (if (and (using-gun? self) (-> self next-state) (= (-> self next-state name) 'target-walk)) + (go target-gun-walk) + ) + (set! (-> self state-time) (-> self clock 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)) + (target-effect-exit) + (remove-exit) + (go target-ice-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) + ) + (and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (can-roll?)) + ) + (go target-roll) + ) + (when (and (cpad-hold? (-> self control unknown-cpad-info00 number) l1) (can-duck?)) + (target-effect-exit) + (remove-exit) + (go target-duck-walk #f) + ) + (when (not (move-legs?)) + (target-effect-exit) + (remove-exit) + (go target-stance) + ) + (if (want-to-darkjak?) + (go target-darkjak-get-on 2) + ) + (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) + ) + (target-jump-go) + ) + (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? #t) + ) + (go target-attack) + ) + (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 square) + ) + (can-hands? #t) + ) + (go target-running-attack) + ) + (when (and (turn-around?) (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.3))) + (set! (-> self control transv quad) + (-> self control unknown-vector-array02 (-> self control unknown-word03) quad) + ) + (set! (-> self control transv w) 1.0) + (go target-turn-around) + ) + (if (and (logtest? (-> self game features) (game-feature carry)) + (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 r1) + ) + ) + (go target-carry-pickup) + ) + (if (wall-hide?) + (go target-hide) + ) + (slide-down-test) + (fall-test target-falling -4096000.0) + (none) + ) + :code (behavior () + (target-walk-anim -300) + (none) + ) + :post target-post + ) + +(defstate target-turn-around (target) + :event target-standard-event-handler + :enter (behavior () + (vector-turn-to (-> self control transv)) + (set! (-> self control unknown-surface00) *turn-around-mods*) + (set! (-> self control unknown-float29) 1.0) + (none) + ) + :exit (behavior () + (target-state-hook-exit) + (set-forward-vel 0.0) + (set! (-> self control unknown-float05) 0.0) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (set! (-> self control unknown-float29) 0.0) + (none) + ) + :trans (behavior () + ((-> self state-hook)) + (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) + ) + (target-jump-go) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet? #t)) + (go target-attack) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) (can-hands? #t)) + (go target-running-attack) + ) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) (seconds 0.08)) + ) + (go target-falling #f) + ) + (slide-down-test) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.04)) + (ja :group! (-> self draw art-group data 22) :num! min) + (quaternion-rotate-y! (-> self control dir-targ) (-> self control dir-targ) 32768.0) + (compute-alignment! (-> self align)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 2.0)) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + ) + (remove-exit) + (set! (-> self control unknown-float29) 0.0) + (set! (-> self control unknown-float05) (* 40960.0 (-> self darkjak-giant-interp))) + (set-forward-vel (-> self control unknown-float05)) + (target-state-hook-exit) + (go target-walk) + (none) + ) + :post target-no-stick-post + ) + +(defstate target-slide-down (target) + :event target-walk-event-handler + :enter (behavior () + (set! (-> self control unknown-surface00) *jump-mods*) + (none) + ) + :exit (behavior () + (set! (-> self control unknown-time-frame13) (-> self clock frame-counter)) + (none) + ) + :trans (behavior () + (when (or (logtest? (-> self control status) (cshape-moving-flags on-surface)) + (if (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + #t + ) + ) + (logior! (-> self control status) (cshape-moving-flags on-surface)) + (if (using-gun? self) + (go target-stance) + (go target-duck-stance #f) + ) + ) + (none) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (if (not (and v1-2 (= v1-2 (-> self draw art-group data 20)))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data 20) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 20)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post target-post + ) + +(define *slide-down-mods* (new 'static 'surface + :name 'run + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 81920.0 + :target-speed 81920.0 + :seek0 0.4 + :seek90 0.4 + :seek180 0.4 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 60.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :flags (surface-flag no-turn-around) + ) + ) + +(define *slide-jump-mods* (new 'static 'surface + :name 'jump + :turnv 32768.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 65536.0 + :target-speed 65536.0 + :seek0 0.05 + :seek90 0.05 + :seek180 0.05 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 300.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag check-edge air) + ) + ) + +(defstate target-slide-down-to-ground (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('slide) + #f + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self control unknown-surface00) *slide-down-mods*) + (set! (-> self control unknown-time-frame17) 0) + (set! (-> self control unknown-float15) 1.0) + (set! (-> self control unknown-float14) 1.0) + (none) + ) + :exit (behavior () + (target-effect-exit) + (target-exit) + (set! (-> self control unknown-time-frame13) (-> self clock frame-counter)) + (none) + ) + :trans (behavior () + (if (and (or (and (logtest? (-> self control status) (cshape-moving-flags on-surface)) + (and (< 0.9 (-> self control surface-angle)) + (!= (-> self control cur-pat material) 14) + (!= (-> self control cur-pat event) 7) + (!= (-> self control cur-pat event) 14) + (or (= (-> self control cur-pat mode) (pat-mode ground)) + (= (-> self control cur-pat mode) (pat-mode halfpipe)) + ) + ) + ) + (if (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + #t + ) + ) + (zero? (-> self control unknown-time-frame17)) + ) + (set! (-> self control unknown-time-frame17) (-> self clock frame-counter)) + ) + (when (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) + (!= (-> self state-time) (-> self clock frame-counter)) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control unknown-vector16) 1.0) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)) + ) + (vector-normalize-copy! (-> self control transv) (-> self control unknown-vector16) 40960.0) + (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) *slide-jump-mods*) + ) + (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? #t) + (!= (-> self state-time) (-> self clock frame-counter)) + ) + (go target-attack) + ) + (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 square) + ) + (can-hands? #t) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame11)) (seconds 0.7)) + (!= (-> self state-time) (-> self clock frame-counter)) + ) + (go target-running-attack) + ) + (when (= (-> self control unknown-float15) 0.0) + (logior! (-> self control status) (cshape-moving-flags on-surface)) + (if (using-gun? self) + (go target-stance) + (go target-duck-stance #f) + ) + ) + (set! (-> self control unknown-float05) (* 40960.0 (-> self darkjak-giant-interp))) + (none) + ) + :code (-> target-walk code) + :post (behavior () + (cond + ((zero? (-> self control unknown-time-frame17)) + (vector-normalize! + (vector-flatten! + (-> self control unknown-vector16) + (vector-negate! (new 'stack-no-clear 'vector) (-> self control dynam gravity-normal)) + (-> self control surface-normal) + ) + 1.0 + ) + (if (< 0.0 + (vector-dot + (-> self control unknown-vector16) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00)) + ) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control unknown-vector16) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-negate! (new 'stack-no-clear 'vector) (-> self control unknown-vector16)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + ) + ) + ((nonzero? (-> self control unknown-time-frame17)) + (seek! (-> self control unknown-float15) 0.0 (* 4.0 (-> self clock seconds-per-frame))) + ) + ) + (set! (-> self control unknown-time-frame00) (+ (-> self clock frame-counter) (seconds 0.1))) + (target-post) + (none) + ) + ) + +(defbehavior init-var-jump target ((arg0 float) (arg1 float) (arg2 symbol) (arg3 symbol) (arg4 vector) (arg5 float)) + (when (and (logtest? (focus-status dark) (-> self focus-status)) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) 32) + ) + (set! arg0 (* arg0 (-> self darkjak-giant-interp))) + (set! arg1 (* arg1 (-> self darkjak-giant-interp))) + ) + (logclear! (-> self control status) (cshape-moving-flags csmf14)) + (set! (-> self control unknown-time-frame19) (-> self clock frame-counter)) + (delete-back-vel) + (let* ((f0-4 arg5) + (f1-2 0.0) + (f2-2 (+ (* 0.0016666667 (-> self control dynam gravity-length)) + (fmax 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + ) + (f0-5 (* f0-4 (fmax f1-2 (/ (* 0.5 f2-2 f2-2) (-> self control dynam gravity-length))))) + (s3-1 (+ arg0 f0-5)) + ) + (let ((s2-1 (+ arg1 f0-5))) + (when (< (- (-> self clock frame-counter) (-> self control rider-time)) (seconds 0.05)) + (let ((f0-8 + (fmax + 0.0 + (fmin 28672.0 (* 0.5 (vector-dot (-> self control dynam gravity-normal) (-> self control rider-last-move)))) + ) + ) + ) + (set! s3-1 (+ s3-1 f0-8)) + (set! s2-1 (+ s2-1 f0-8)) + ) + (send-event self 'push-transv (-> self control rider-last-move) #x7530) + ) + (set! (-> self control unknown-float36) 0.0) + (set! (-> self control unknown-float37) 0.0) + (cond + (arg3 + (set! (-> self control unknown-word04) + (the-as uint (- s3-1 (+ -409.6 (-> *TARGET-bank* jump-collide-offset)))) + ) + (set! (-> self control unknown-symbol02) (- s2-1 (-> *TARGET-bank* jump-collide-offset))) + ) + (else + (set! (-> self control unknown-word04) (the-as uint s3-1)) + (set! (-> self control unknown-symbol02) s2-1) + ) + ) + ) + (when arg2 + (let ((v1-55 (new-stack-vector0))) + (let ((f0-19 (vector-dot (-> self control dynam gravity-normal) arg4))) + 0.0 + (vector-! v1-55 arg4 (the-as vector (vector-float*! v1-55 (-> self control dynam gravity-normal) f0-19))) + ) + (let* ((f0-20 (vector-length v1-55)) + (f1-16 f0-20) + (f2-13 + (- (sqrtf (* 2.0 (-> self control dynam gravity-length) s3-1)) + (* 0.008333334 (- (-> self control dynam gravity-length))) + ) + ) + ) + (vector+! + arg4 + (the-as vector (vector-float*! arg4 (-> self control dynam gravity-normal) f2-13)) + (the-as vector (vector-float*! v1-55 v1-55 (/ f0-20 f1-16))) + ) + ) + ) + ) + ) + (let ((v0-2 (-> self control unknown-vector37))) + (set! (-> v0-2 quad) (-> self control trans quad)) + v0-2 + ) + ) + +(defbehavior mod-var-jump target ((arg0 symbol) (arg1 symbol) (arg2 symbol) (arg3 vector)) + (local-vars (v0-1 vector)) + (let ((f0-1 (* 0.033333335 (the float (- (-> self clock frame-counter) (-> self state-time)))))) + (cond + ((or (< 1.0 f0-1) (< (-> self control unknown-float36) 0.0) (not arg2)) + (set! (-> self control unknown-float36) -1.0) + ) + (else + (set! (-> self control unknown-float36) f0-1) + (set! (-> self control unknown-float37) f0-1) + (when arg0 + (let ((s3-1 (vector-! (new-stack-vector0) (-> self control trans) (-> self control unknown-vector37))) + (s4-0 (new-stack-vector0)) + ) + (let ((f1-5 (vector-dot (-> self control dynam gravity-normal) arg3))) + 0.0 + (vector-! s4-0 arg3 (the-as vector (vector-float*! s4-0 (-> self control dynam gravity-normal) f1-5))) + ) + (let* ((f30-0 (vector-length s4-0)) + (f28-0 f30-0) + (f0-7 + (- (sqrtf + (* 2.0 + (-> self control dynam gravity-length) + (- (lerp-scale (the-as float (-> self control unknown-word04)) (-> self control unknown-symbol02) f0-1 0.0 1.0) + (vector-dot (-> self control dynam gravity-normal) s3-1) + ) + ) + ) + (* 0.008333334 (- (-> self control dynam gravity-length))) + ) + ) + ) + (vector+! + arg3 + (the-as vector (vector-float*! arg3 (-> self control dynam gravity-normal) f0-7)) + (the-as vector (vector-float*! s4-0 s4-0 (/ f30-0 f28-0))) + ) + ) + ) + ) + ) + ) + ) + 0 + (when (and arg1 (ja-group) (and (-> (ja-group) extra) + (not (and (logtest? (focus-status dark) (-> self focus-status)) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) 32) + ) + ) + #t + ) + ) + (let ((v1-62 (res-lump-struct (-> (ja-group) extra) 'collide-offset vector :time (ja-aframe-num 0)))) + (cond + (v1-62 + (if (and (logtest? (focus-status dark) (-> self focus-status)) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) 32) + ) + (set! (-> v1-62 y) (* 0.5 (-> v1-62 y))) + ) + (set! v0-1 (-> self control unknown-vector06)) + (set! (-> v0-1 quad) (-> v1-62 quad)) + ) + (else + (set! v0-1 (-> self control unknown-vector06)) + (set! (-> v0-1 quad) (the-as uint128 0)) + ) + ) + ) + v0-1 + ) + ) + +(define *duck-mods* + (new 'static 'surface + :name 'duck + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 16384.0 + :target-speed 16384.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (surface-clamp-speed arg0 arg1 arg2 arg3) + (when (= arg3 1) + (cond + ((and (logtest? (focus-status dark) (-> self focus-status)) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) 32) + ) + (set! (-> arg0 target-speed) 81920.0) + ) + ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (set! (-> arg0 target-speed) 40960.0) + ) + (else + (set! (-> arg0 target-speed) 16384.0) + ) + ) + ) + ) + :flags (surface-flag duck) + ) + ) + +(defstate target-duck-stance (target) + :event target-standard-event-handler + :enter (behavior ((arg0 symbol)) + (if (not arg0) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + (set! (-> self control unknown-float29) 1.0) + (set! (-> self control unknown-surface00) *duck-mods*) + (target-collide-set! 'duck 1.0) + (none) + ) + :exit (behavior () + (if (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-duck-walk) + (= v1-3 'target-duck-stance) + (= v1-3 'target-walk) + (= v1-3 'target-stance) + (= v1-3 'target-stance-look-around) + ) + ) + ) + ) + (target-state-hook-exit) + ) + (target-exit) + (if (= (-> self control unknown-symbol00) 'duck) + (target-collide-set! 'normal 0.0) + ) + (none) + ) + :trans (behavior () + ((-> self state-hook)) + (if (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1)) + ) + (logtest? (-> self state-flags) (state-flags sf9)) + ) + (let ((v1-13 (ja-group))) + (and (not (and v1-13 (or (= v1-13 (-> self draw art-group data 60)) + (= v1-13 (-> self draw art-group data 59)) + (= v1-13 (-> self draw art-group data 283)) + (= v1-13 (-> self draw art-group data 282)) + ) + ) + ) + (begin self (can-exit-duck?)) + ) + ) + ) + (go target-stance) + ) + (if (and (move-legs?) (!= (-> self control unknown-surface01 seek0) 0.0)) + (go target-duck-walk 'duck) + ) + (if (want-to-darkjak?) + (go target-darkjak-get-on 2) + ) + (when (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) + ) + (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + (go target-high-jump (-> *TARGET-bank* duck-jump-height-min) (-> *TARGET-bank* duck-jump-height-max) 'duck) + (target-jump-go) + ) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) + (can-hands? #t) + (begin self (can-exit-duck?)) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-jump))) + (zero? (logand (-> self state-flags) (state-flags sf7))) + ) + (go + target-attack-uppercut + (-> *TARGET-bank* attack-jump-height-min) + (-> *TARGET-bank* attack-jump-height-max) + ) + ) + (fall-test target-falling -4096000.0) + (slide-down-test) + (none) + ) + :code (behavior ((arg0 symbol)) + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (or (= v1-2 (-> self draw art-group data 59)) (= v1-2 (-> self draw art-group data 282)))) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self neck base-joint) (the-as uint 8)) + (cond + ((using-gun? self) + (set! (-> self gun surpress-time) (+ (-> self clock frame-counter) (seconds 0.7))) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 283) + 0.0 + 0 + 30 + 1.0 + 6.0 + #f + ) + (ja-no-eval :group! (-> self draw art-group data 283) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 283)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 60) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 60)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (set! (-> self neck flex-blend) 1.0) + (set! (-> self neck base-joint) (the-as uint 6)) + ) + ((let ((v1-68 (ja-group))) + (and (and v1-68 (= v1-68 (-> self draw art-group data 20))) + (= (-> self skel root-channel 0) (-> self skel channel)) + ) + ) + ) + ((let ((v1-78 (ja-group))) + (and v1-78 (or (= v1-78 (-> self draw art-group data 21)) (= v1-78 (-> self draw art-group data 302)))) + ) + (ja-channel-push! 1 (seconds 0.1)) + ) + ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (ja-channel-push! 1 (seconds 0.1)) + ) + (else + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! (-> self draw art-group data 19) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 19)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data 20) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 20)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post target-post + ) + +(defstate target-duck-walk (target) + :event target-standard-event-handler + :enter (behavior ((arg0 symbol)) + (if (not arg0) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + (set! (-> self control unknown-float29) 1.0) + (target-collide-set! 'duck 1.0) + (let ((v1-7 (ja-group))) + (if (not (and v1-7 (or (= v1-7 (-> self draw art-group data 59)) (= v1-7 (-> self draw art-group data 282))))) + (set! (-> self control unknown-surface00) *duck-mods*) + ) + ) + (none) + ) + :exit (-> target-duck-stance exit) + :trans (behavior () + (local-vars (v1-22 joint-control-channel)) + ((-> self state-hook)) + (when (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1)) + ) + (logtest? (-> self state-flags) (state-flags sf9)) + (and (logtest? (water-flags wading) (-> self water flags)) + (>= (- (- (-> self control trans y) (- (-> self water base-height) (-> self water wade-height)))) 2457.6) + ) + ) + (begin self (can-exit-duck?)) + ) + (if (and (using-gun? self) + (begin (set! v1-22 (top-anim-joint-control-method-11 (-> self skel top-anim) 0)) v1-22) + (= (-> v1-22 frame-group) (-> self draw art-group data 283)) + ) + (target-top-anim-base-mode 60) + ) + (go target-walk) + ) + (if (not (move-legs?)) + (go target-duck-stance 'duck) + ) + (if (want-to-darkjak?) + (go target-darkjak-get-on 2) + ) + (when (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) + ) + (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + (go target-high-jump (-> *TARGET-bank* duck-jump-height-min) (-> *TARGET-bank* duck-jump-height-max) 'duck) + (target-jump-go) + ) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) + (can-hands? #t) + (begin self (can-exit-duck?)) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-jump))) + (zero? (logand (-> self state-flags) (state-flags sf7))) + ) + (go + target-attack-uppercut + (-> *TARGET-bank* attack-jump-height-min) + (-> *TARGET-bank* attack-jump-height-max) + ) + ) + (fall-test target-falling -4096000.0) + (slide-down-test) + (none) + ) + :code (behavior ((arg0 symbol)) + (let ((gp-0 (if (using-gun? self) + (-> self draw art-group data 302) + (-> self draw art-group data 21) + ) + ) + (v1-6 (ja-group)) + ) + (cond + ((and (and v1-6 (or (= v1-6 (-> self draw art-group data 21)) (= v1-6 (-> self draw art-group data 302)))) + (= (-> self skel root-channel 0) (-> self skel channel)) + ) + ) + (else + (let ((v1-16 (ja-group))) + (cond + ((and v1-16 (= v1-16 (-> self draw art-group data 20))) + (ja-channel-push! 1 (seconds 0.45)) + (ja :group! gp-0 :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! gp-0 :num! min) + ) + ) + ) + ) + ) + ) + (set! (-> self state-flags) (logior (state-flags lleg-no-ik rleg-no-ik) (-> self state-flags))) + (until #f + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (set! (-> self control unknown-surface00) *duck-mods*) + ) + (ja :num! (loop! (fmin 3.0 (/ (-> self control unknown-float05) + (* 60.0 (/ (-> *TARGET-bank* duck-walk-cycle-dist) (-> *TARGET-bank* run-cycle-length))) + ) + ) + ) + ) + (suspend) + ) + #f + (none) + ) + :post target-post + ) + +(defbehavior target-jump-top-anim target () + (let ((gp-0 (top-anim-joint-control-method-11 (-> self skel top-anim) 0))) + (when gp-0 + (let ((s5-0 (-> gp-0 frame-group)) + (f0-0 (ja-aframe-num 0)) + ) + (when (or (= s5-0 (-> self draw art-group data 304)) (= s5-0 (-> self draw art-group data 300))) + (let ((v1-13 (ja-group))) + (if (and v1-13 (= v1-13 (-> self draw art-group data 30))) + (set! (-> gp-0 frame-num) (/ (- f0-0 (+ 16.0 (-> s5-0 artist-base))) (-> s5-0 artist-step))) + (set! (-> gp-0 frame-num) (/ (- f0-0 (-> s5-0 artist-base)) (-> s5-0 artist-step))) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defstate target-jump (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 surface)) + (when (= (-> self control unknown-symbol06) 'launch) + (talker-spawn-func (-> *talker-speech* 326) *entity-pool* (target-pos 0) (the-as region #f)) + (talker-spawn-func (-> *talker-speech* 327) *entity-pool* (target-pos 0) (the-as region #f)) + enter-state + (let ((a0-7 (-> self control unknown-dword07)) + (a1-3 (-> self control unknown-dword08)) + (a2-3 (-> self control unknown-vector37)) + ) + (set! (-> a2-3 quad) (-> (the-as vector (-> self control unknown-dword09)) quad)) + (go target-launch (the-as float a0-7) (the-as symbol a1-3) a2-3 (-> self control unknown-dword10)) + ) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (sound-play "jump" :vol 70) + (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (set! arg2 (cond + (arg2 + (empty) + arg2 + ) + (else + *jump-mods* + ) + ) + ) + (set! (-> self control unknown-surface00) arg2) + (set! (-> self control unknown-float36) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control unknown-float05))))) + ) + (set! (-> self control unknown-float35) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float05))))) + ) + (none) + ) + :exit target-exit + :trans (behavior () + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 6))) + ) + ) + (let ((t9-0 target-falling-trans) + (a0-1 #f) + (v1-12 (ja-group)) + ) + (t9-0 a0-1 (the-as time-frame (if (and v1-12 (= v1-12 (-> self draw art-group data 27))) + 15 + -1 + ) + ) + ) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + (* 12288.0 (-> self darkjak-giant-interp) (-> self darkjak-giant-interp)) + ) + (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (zero? (logand (water-flags touch-water) (-> self water flags))) + (zero? (logand (state-flags sf7 sf23) (-> self state-flags))) + ) + ) + (go target-double-jump (-> *TARGET-bank* double-jump-height-min) (-> *TARGET-bank* double-jump-height-max)) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) + (and (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + (* 26624.0 (-> self darkjak-giant-interp) (-> self darkjak-giant-interp)) + ) + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame14)) + (the-as time-frame (-> *TARGET-bank* stuck-timeout)) + ) + (zero? (logand (-> self state-flags) (state-flags sf8))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-attack no-hands))) + (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + ) + ) + ) + (go + target-flop + 65502.96 + -163840.0 + (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + 0 + #x47866666 + ) + ) + ) + ) + (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) + (slide-down-test) + (seek! + (-> self control unknown-float35) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float05))))) + (-> self clock seconds-per-frame) + ) + (none) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 surface)) + (let ((f28-0 20.0) + (f30-0 1.0) + ) + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (-> self gun gun-type) + (((pickup-type eco-blue)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 304) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + (else + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 300) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (let ((v1-18 (ja-group))) + (cond + ((and (and v1-18 (= v1-18 (-> self draw art-group data 54))) + (>= 25.0 (ja-aframe-num 0)) + (>= (ja-aframe-num 0) 17.0) + ) + (set! (-> self neck flex-blend) 0.0) + (ja-channel-push! 1 0) + (cond + ((using-gun? self) + (ja :group! (-> self draw art-group data 30) :num! (identity (ja-aframe 16.0 0))) + (set! f28-0 35.0) + ) + (else + (ja :group! (-> self draw art-group data 58) :num! (identity (ja-aframe 25.0 0))) + (set! f28-0 24.0) + (set! f30-0 0.3) + ) + ) + ) + ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 394) :num! min) + (suspend) + 0 + ) + (else + (ja-channel-push! 2 (seconds 0.05)) + (ja :group! (-> self draw art-group data 23) :num! min) + (let ((a0-23 (-> self skel root-channel 1))) + (let ((f0-8 (-> self control unknown-float35))) + (set! (-> a0-23 frame-interp 1) f0-8) + (set! (-> a0-23 frame-interp 0) f0-8) + ) + (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 29))) + (set! (-> a0-23 param 0) 0.0) + (joint-control-channel-group-eval! + a0-23 + (the-as art-joint-anim (-> self draw art-group data 29)) + num-func-chan + ) + ) + (suspend) + (ja :group! (-> self draw art-group data 23) :num! (+!)) + (let ((a0-25 (-> self skel root-channel 1))) + (let ((f0-11 (-> self control unknown-float35))) + (set! (-> a0-25 frame-interp 1) f0-11) + (set! (-> a0-25 frame-interp 0) f0-11) + ) + (set! (-> a0-25 frame-group) (the-as art-joint-anim (-> self draw art-group data 29))) + (set! (-> a0-25 param 0) 0.0) + (joint-control-channel-group-eval! + a0-25 + (the-as art-joint-anim (-> self draw art-group data 29)) + num-func-chan + ) + ) + (suspend) + 0 + ) + ) + ) + (until (ja-done? 0) + (let ((f26-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (f24-0 (- f28-0 (ja-aframe-num 0))) + ) + (target-jump-top-anim) + (ja :num! (seek! max (if (and (< 0.0 f26-1) (< 0.0 f24-0)) + (fmin (fmin 3.0 f24-0) (/ (* 5.0 f24-0) (the float (time-to-apex f26-1 -245760.0)))) + f30-0 + ) + ) + ) + ) + (when (>= (ja-group-size) 2) + (let ((a0-30 (-> self skel root-channel 1))) + (let ((f0-26 (-> self control unknown-float35))) + (set! (-> a0-30 frame-interp 1) f0-26) + (set! (-> a0-30 frame-interp 0) f0-26) + ) + (set! (-> a0-30 param 0) 0.0) + (joint-control-channel-group-eval! a0-30 (the-as art-joint-anim #f) num-func-chan) + ) + ) + (suspend) + ) + ) + (target-falling-anim -1 (seconds 0.2)) + (go target-falling #f) + (none) + ) + :post target-post + ) + +(defstate target-jump-forward (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float)) + ((-> target-jump enter) arg0 arg1 (the-as surface #f)) + (set! (-> self control unknown-surface00) *forward-jump-mods*) + (none) + ) + :exit target-exit + :trans (-> target-jump trans) + :code (behavior ((arg0 float) (arg1 float)) + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (-> self gun gun-type) + (((pickup-type eco-blue)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 304) + 3.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + (else + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 300) + 3.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (ja-channel-set! 1) + (ja-no-eval :group! (-> self draw art-group data 23) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 23)) frames num-frames) -1))) + :frame-num (ja-aframe 3.0 0) + ) + (until (ja-done? 0) + (set! (-> self control unknown-time-frame09) 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! (-> self draw art-group data 27) :num! (loop!) :frame-num 0.0) + (until #f + (suspend) + (target-jump-top-anim) + (ja :group! (-> self draw art-group data 27) :num! (loop!)) + ) + #f + (none) + ) + :post target-post + ) + +(defstate target-double-jump (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float)) + (when (= (-> self control unknown-symbol06) 'launch) + enter-state + (let ((a0-3 (-> self control unknown-dword07)) + (a1-1 (-> self control unknown-dword08)) + (a2-0 (-> self control unknown-vector37)) + ) + (set! (-> a2-0 quad) (-> (the-as vector (-> self control unknown-dword09)) quad)) + (go target-launch (the-as float a0-3) (the-as symbol a1-1) a2-0 (-> self control unknown-dword10)) + ) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (if (!= (-> self control unknown-surface00) *slide-jump-mods*) + (set! (-> self control unknown-surface00) *double-jump-mods*) + ) + (none) + ) + :exit target-exit + :trans (behavior () + (let ((t9-0 target-falling-trans) + (a0-0 #f) + (v1-2 (ja-group)) + ) + (t9-0 a0-0 (the-as time-frame (if (and v1-2 (= v1-2 (-> self draw art-group data 27))) + 15 + -1 + ) + ) + ) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 22118.4) + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame14)) + (the-as time-frame (-> *TARGET-bank* stuck-timeout)) + ) + (zero? (logand (-> self state-flags) (state-flags sf8))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-attack no-hands))) + (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + ) + ) + (go + target-flop + 33775.48 + -122880.0 + (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + 0 + #x47866666 + ) + ) + ) + ) + (if (!= (-> self state-time) (-> self clock frame-counter)) + (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) + ) + (seek! + (-> self control unknown-float35) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float05))))) + (-> self clock seconds-per-frame) + ) + (none) + ) + :code (behavior ((arg0 float) (arg1 float)) + (sound-play "jump-double") + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (-> self gun gun-type) + (((pickup-type eco-blue)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 304) + 7.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + (else + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 300) + 7.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (cond + ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 394) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 394)) frames num-frames) -1))) + :frame-num (ja-aframe 7.0 0) + ) + ) + (else + (ja-channel-push! 2 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 23) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 23)) frames num-frames) -1))) + :frame-num (ja-aframe 5.0 0) + ) + (ja :chan 1 :group! (-> self draw art-group data 29) :num! (chan 0)) + ) + ) + (until (ja-done? 0) + (suspend) + (target-jump-top-anim) + (ja :num! (seek!)) + (when (>= (ja-group-size) 2) + (let ((a0-18 (-> self skel root-channel 1))) + (let ((f0-13 (-> self control unknown-float35))) + (set! (-> a0-18 frame-interp 1) f0-13) + (set! (-> a0-18 frame-interp 0) f0-13) + ) + (set! (-> a0-18 param 0) 0.0) + (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-chan) + ) + ) + ) + (target-falling-anim -1 (seconds 0.2)) + (go target-falling #f) + (none) + ) + :post target-post + ) + +(defstate target-high-jump (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 object)) + (when (and (= (-> self control unknown-symbol06) 'launch) (!= arg2 'launch)) + enter-state + (let ((a0-3 (-> self control unknown-dword07)) + (a1-1 (-> self control unknown-dword08)) + (a2-1 (-> self control unknown-vector37)) + ) + (set! (-> a2-1 quad) (-> (the-as vector (-> self control unknown-dword09)) quad)) + (go target-launch (the-as float a0-3) (the-as symbol a1-1) a2-1 (-> self control unknown-dword10)) + ) + ) + (set! (-> self control unknown-symbol03) (the-as float arg2)) + (if (or (= arg2 'duck) (= arg2 'launch)) + (go target-duck-high-jump arg0 arg1 (the-as symbol arg2)) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (sound-play "jump" :pitch 0.3) + (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) + (set! (-> self control unknown-surface00) (cond + ((= arg2 'flip) + *flip-jump-mods* + ) + ((= arg2 'flop-forward) + *forward-high-jump-mods* + ) + (else + *high-jump-mods* + ) + ) + ) + (set! (-> self control unknown-float35) + (fmax 0.0 (fmin 0.5 (* 0.00008138021 (+ -409.6 (-> self control unknown-float05))))) + ) + (none) + ) + :exit target-exit + :trans (behavior () + (let ((t9-0 target-falling-trans) + (a0-0 #f) + (v1-2 (ja-group)) + ) + (t9-0 a0-0 (the-as time-frame (if (and v1-2 (= v1-2 (-> self draw art-group data 27))) + 15 + -1 + ) + ) + ) + ) + (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 square) + ) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 73728.0) + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame14)) + (the-as time-frame (-> *TARGET-bank* stuck-timeout)) + ) + (zero? (logand (-> self state-flags) (state-flags sf8))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-attack no-hands))) + (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + ) + ) + (go + target-flop + 33775.48 + -122880.0 + (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + 0 + #x47866666 + ) + ) + ) + ) + (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) + (seek! + (-> self control unknown-float35) + (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control unknown-float05))))) + (-> self clock seconds-per-frame) + ) + (none) + ) + :code (-> target-jump code) + :post target-post + ) + +(defstate target-duck-high-jump (target) + :event target-standard-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (set! (-> self state-time) (-> self clock frame-counter)) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (set! (-> self control unknown-surface00) *turn-around-mods*) + (case arg2 + (('launch) + ) + (else + ) + ) + (none) + ) + :exit target-exit + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (let ((v1-2 (ja-group))) + (if (not (and (and v1-2 (= v1-2 (-> self draw art-group data 20))) + (= (-> self skel root-channel 0) (-> self skel channel)) + ) + ) + (ja-channel-push! 1 (seconds 0.04)) + ) + ) + (let ((v1-11 arg2)) + (cond + ((or (= v1-11 'flop) (= v1-11 'flop-forward)) + (ja-no-eval :group! (-> self draw art-group data 58) :num! (seek! (ja-aframe 25.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 25.0 0))) + ) + ) + ((using-gun? self) + (ja :group! (-> self draw art-group data 30) :num! (identity (ja-aframe 16.0 0))) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 30) :num! (seek! (ja-aframe 16.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 16.0 0))) + ) + ) + ) + ) + (go target-duck-high-jump-jump arg0 arg1 arg2) + (none) + ) + :post target-post + ) + +(defstate target-duck-high-jump-jump (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (set! (-> self control unknown-symbol03) (the-as float arg2)) + (set! (-> self state-time) (-> self clock frame-counter)) + (sound-play "jump" :vol 80 :pitch -0.4) + (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (cond + ((= arg2 'launch) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control unknown-surface00) *launch-jump-mods*) + ) + (else + (set! (-> self control unknown-surface00) *high-jump-mods*) + ) + ) + (none) + ) + :exit target-exit + :trans (behavior () + ((-> target-high-jump trans)) + (case (-> self control unknown-symbol03) + (('launch) + (when *sound-player-enable* + (let ((gp-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> gp-0 command) (sound-command set-param)) + (set! (-> gp-0 id) (-> self control unknown-sound-id00)) + (let ((a1-0 (ear-trans 0))) + (let ((s5-0 self)) + (when (= a1-0 #t) + (if (and s5-0 (type? s5-0 process-drawable) (nonzero? (-> s5-0 control))) + (set! a1-0 (-> s5-0 control trans)) + (set! a1-0 (the-as vector #f)) + ) + ) + ) + (sound-trans-convert (the-as vector3w (-> gp-0 params trans)) a1-0) + ) + (set! (-> gp-0 params mask) (the-as uint 32)) + (-> gp-0 id) + ) + ) + ) + ) + (none) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (-> self gun gun-type) + (((pickup-type eco-blue)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 304) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + (else + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 300) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (let* ((f30-0 1.0) + (v1-15 arg2) + (f28-0 (cond + ((= v1-15 'launch) + 110.0 + ) + ((or (= v1-15 'flop) (= v1-15 'flop-forward)) + (set! f30-0 0.75) + 44.0 + ) + (else + 35.0 + ) + ) + ) + ) + (until (ja-done? 0) + (let ((f24-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (f26-0 (- f28-0 (ja-aframe-num 0))) + ) + (target-jump-top-anim) + (let ((f22-1 (fmin (fmin 3.0 f26-0) (/ (* 5.0 f26-0) (the float (time-to-apex f24-0 -245760.0))))) + (s5-0 (-> self skel root-channel 0)) + ) + (set! (-> s5-0 param 0) (the float (+ (-> s5-0 frame-group frames num-frames) -1))) + (let ((v1-38 (cond + ((and (< 0.0 f24-0) (< 0.0 f26-0)) + (if (= arg2 'launch) + (set! f30-0 (lerp f30-0 (* 4.0 f22-1) 0.25)) + ) + f22-1 + ) + (else + f30-0 + ) + ) + ) + ) + (set! (-> s5-0 param 1) v1-38) + ) + (joint-control-channel-group-eval! s5-0 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (suspend) + ) + ) + (cond + ((or (= arg2 'flop) (= arg2 'flop-forward)) + (ja-channel-push! 1 (seconds 0.5)) + (ja-no-eval :group! (-> self draw art-group data 27) :num! (loop!) :frame-num 0.0) + (until #f + (suspend) + (ja :group! (-> self draw art-group data 27) :num! (loop!)) + ) + #f + ) + (else + (ja-no-eval :group! (-> self draw art-group data 27) :num! (loop!) :frame-num 0.0) + (until #f + (suspend) + (ja :group! (-> self draw art-group data 27) :num! (loop!)) + ) + #f + ) + ) + (none) + ) + :post target-post + ) + +(defstate target-falling (target) + :event target-jump-event-handler + :enter (behavior ((arg0 symbol)) + (case arg0 + (('uppercut) + (set! (-> self control unknown-surface00) *uppercut-jump-mods*) + ) + (else + (set! (-> self control unknown-surface00) *jump-mods*) + ) + ) + (set! (-> self control unknown-word04) (the-as uint arg0)) + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :trans (behavior () + (target-falling-trans + (the-as symbol (-> self control unknown-spool-anim00)) + (the-as time-frame (if (= (-> self control unknown-spool-anim00) #f) + 0 + (the-as int (/ (the-as int (-> *TARGET-bank* stuck-time)) 2)) + ) + ) + ) + (none) + ) + :code (behavior ((arg0 symbol)) + (case arg0 + (('uppercut) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (set! (-> self gun surpress-time) 0) + (send-event self 'gun (-> self gun gun-type)) + (set! (-> self gun track-target-hold-time) 0) + 0 + ) + (('hit) + (ja-channel-push! 1 (seconds 0.3)) + (ja-no-eval :group! (-> self draw art-group data 66) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 66)) frames num-frames) -1))) + :frame-num (ja-aframe 15.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (target-falling-anim -1 (seconds 0.33)) + (none) + ) + :post target-post + ) + +(defstate target-hit-ground (target) + :event target-walk-event-handler + :enter (behavior ((arg0 symbol)) + (set! (-> self control unknown-float06) 0.0) + (cond + ((or (= arg0 'stuck) (logtest? (focus-status indax) (-> self focus-status))) + ) + (else + (let ((f0-2 (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector21) (-> self control trans)) + ) + ) + ) + (if (and (< (-> *TARGET-bank* fall-far) f0-2) + (zero? (logand (-> self control status) (cshape-moving-flags on-water))) + ) + (go target-hit-ground-hard f0-2) + ) + ) + ) + ) + (cond + ((= arg0 'stuck) + ) + (else + (target-land-effect) + ) + ) + (set! (-> self control unknown-time-frame11) 0) + (set! (-> self control unknown-time-frame12) 0) + (if (>= (-> self control ground-impact-vel) (-> *TARGET-bank* fall-stumble-threshold)) + (set-forward-vel 0.0) + ) + (if (!= (-> self control ground-pat material) (pat-material ice)) + (delete-back-vel) + ) + (set! (-> self control unknown-surface00) *walk-mods*) + (let ((s5-0 (method-of-object (-> self water) water-control-method-11))) + (lerp-scale 0.0 4096.0 (-> self control ground-impact-vel) 40960.0 102400.0) + 600 + 1500 + (s5-0) + ) + (if (and (logtest? (focus-status dark) (-> self focus-status)) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) 32) + ) + (activate! *camera-smush-control* 1638.4 15 75 1.0 0.9 (-> *display* camera-clock)) + ) + (when (and (using-gun? self) (let ((v1-44 (-> self water flags))) + (not (and (logtest? (water-flags touch-water) v1-44) + (logtest? (water-flags under-water swimming) v1-44) + (zero? (logand (focus-status mech) (-> self focus-status))) + ) + ) + ) + ) + (set! (-> self gun top-anim-low-high) 0.0) + (case (-> self gun gun-type) + (((pickup-type eco-blue)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 305) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + (((pickup-type eco-red) (pickup-type eco-dark)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 301) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + (else + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 301) + 0.0 + 30 + 30 + 1.0 + 25.0 + #f + ) + ) + ) + ) + (none) + ) + :exit (behavior () + (logclear! (-> self state-flags) (state-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + (none) + ) + :trans (behavior () + (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) + ) + (target-jump-go) + ) + (if (and (or (cpad-hold? (-> self control unknown-cpad-info00 number) l1) (begin self (not (can-exit-duck?)))) + (can-duck?) + ) + (go target-duck-stance #f) + ) + (when (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + (if (logtest? (water-flags wading) (-> self water flags)) + (go target-wade-walk) + (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 circle) + ) + (can-feet? #t) + ) + (go target-attack) + ) + (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 square) + ) + (can-hands? #t) + ) + (go target-running-attack) + ) + (fall-test target-falling -4096000.0) + (slide-down-test) + (none) + ) + :code (behavior ((arg0 symbol)) + (let ((gp-0 target-hit-ground-anim) + (s5-0 #f) + ) + (are-still?) + (gp-0 s5-0) + ) + (go target-stance) + (none) + ) + :post target-post + ) + +(define *attack-mods* (new 'static 'surface + :name 'attack + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 object) (arg2 object) (arg3 int)) + (case arg3 + ((1) + (case (-> self control ground-pat event) + (((pat-event slide)) + (set! (-> arg0 seek0) 0.05) + (set! (-> arg0 seek90) 0.05) + (set! (-> arg0 seek180) 0.05) + ) + ) + ) + ) + ) + :mode 'attack + :flags (surface-flag attack spin gun-inactive gun-turn-fast) + ) + ) + +(let ((v1-25 (copy *attack-mods* 'global))) + (set! (-> v1-25 flags) (surface-flag attack spin gun-turn-fast)) + (set! (-> v1-25 mult-hook) (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + ((-> *attack-mods* mult-hook) arg0 arg1 arg2 arg3) + (when (= arg3 1) + (if (and (nonzero? (-> self gun turn-fast-hold-time)) + (< (-> self clock frame-counter) (-> self gun turn-fast-hold-time)) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + ) + ) + (none) + ) + ) + (set! *attack-end-mods* v1-25) + ) + +(defstate target-attack (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('touched) + (cond + (((method-of-type touching-shapes-entry touching-shapes-entry-method-12) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 1920) + ) + (let ((t9-1 target-send-attack) + (a1-2 (-> self control unknown-symbol04)) + (a2-2 (-> arg3 param 0)) + (a3-1 (-> self control unknown-symbol05)) + (t0-0 (-> self control unknown-dword05)) + ) + (-> self control penetrate-using) + (when (t9-1 arg0 (the-as uint a1-2) a2-2 (the-as int a3-1) (the-as int t0-0)) + (set! (-> self gun combo-window-start) (-> self clock frame-counter)) + (let ((v0-2 (the-as object (-> self state name)))) + (set! (-> self gun combo-window-state) (the-as symbol v0-2)) + v0-2 + ) + ) + ) + ) + (else + (target-dangerous-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + (('gun-combo) + (when (-> arg3 param 0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (go target-stance) + ) + #t + ) + (('slide) + #f + ) + (else + (target-dangerous-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (target-start-attack) + (target-danger-set! 'spin #f) + (set! (-> self control unknown-surface00) *attack-mods*) + (set! (-> self water drip-mult) 4.0) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self gun track-target-hold-time) 0) + (if (< 0.0 (-> self control unknown-float10)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control unknown-vector08) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (quaternion-copy! (-> self control unknown-quaternion04) (-> self control dir-targ)) + (set! (-> self control unknown-float40) 0.0) + (set! (-> self control unknown-float41) 0.0) + (none) + ) + :exit (behavior () + (if (zero? (-> self gun track-target-hold-time)) + (quaternion-copy! (-> self control dir-targ) (-> self control unknown-quaternion04)) + ) + (set! (-> self control unknown-time-frame12) (-> self clock frame-counter)) + (target-exit) + (none) + ) + :code (behavior () + (let ((gp-0 (-> self draw art-group data 40))) + (cond + ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (set! gp-0 (-> self draw art-group data 399)) + (quaternion-rotate-y! + (-> self control unknown-quaternion00) + (-> self control unknown-quaternion00) + -1365.3334 + ) + ) + ((using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (-> self gun gun-type) + (((pickup-type eco-yellow)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 248) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + (set! gp-0 (-> self draw art-group data 248)) + (quaternion-rotate-y! (-> self control unknown-quaternion00) (-> self control unknown-quaternion00) -3276.8) + ) + (((pickup-type eco-blue)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 250) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + (set! gp-0 (-> self draw art-group data 250)) + ) + (else + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 248) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + (set! gp-0 (-> self draw art-group data 248)) + (quaternion-rotate-y! (-> self control unknown-quaternion00) (-> self control unknown-quaternion00) -3276.8) + ) + ) + ) + (else + (quaternion-rotate-y! + (-> self control unknown-quaternion00) + (-> self control unknown-quaternion00) + -1365.3334 + ) + ) + ) + (ja-channel-push! 1 (seconds 0.05)) + (set! (-> self control unknown-sound-id01) (sound-play "spin-kick")) + (ja-no-eval :group! gp-0 + :num! (seek! + (the float (+ (-> (the-as art-joint-anim gp-0) frames num-frames) -1)) + (-> self control unknown-surface01 align-speed) + ) + :frame-num 0.0 + ) + ) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (when (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) 2) + (>= (-> (the-as fact-info-target (-> self fact)) eco-level) 1.0) + ) + (let ((s5-1 (method-of-object (-> self skel effect) effect-control-method-10))) + 'group-red-eco-spinkick + (ja-frame-num 0) + 38 + (s5-1) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + (talker-spawn-func (-> *talker-speech* 328) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (when (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) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (target-jump-go) + ) + (suspend) + (ja :num! (seek! max (-> self control unknown-surface01 align-speed))) + ) + (cond + ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (quaternion-rotate-y! + (-> self control unknown-quaternion00) + (-> self control unknown-quaternion00) + -12743.111 + ) + ) + ((using-gun? self) + (when (zero? (-> self gun track-target-hold-time)) + (case (-> self gun gun-type) + (((pickup-type eco-blue)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 251) + 0.0 + 0 + 60 + 1.0 + 6.0 + #f + ) + (quaternion-rotate-y! (-> self control unknown-quaternion00) (-> self control unknown-quaternion00) -3640.889) + ) + (((pickup-type eco-yellow)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 249) + 0.0 + 0 + 60 + 1.0 + 6.0 + #f + ) + (quaternion-rotate-y! + (-> self control unknown-quaternion00) + (-> self control unknown-quaternion00) + -5461.3335 + ) + ) + (else + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 249) + 0.0 + 0 + 60 + 1.0 + 6.0 + #f + ) + (quaternion-rotate-y! + (-> self control unknown-quaternion00) + (-> self control unknown-quaternion00) + -5461.3335 + ) + ) + ) + ) + ) + (else + (quaternion-rotate-y! + (-> self control unknown-quaternion00) + (-> self control unknown-quaternion00) + -1365.3334 + ) + ) + ) + (go target-stance) + (none) + ) + :post target-post + ) + +(define *run-attack-mods* (new 'static 'surface + :name 'punch + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 91750.4 + :target-speed 122880.0 + :seek90 0.5 + :seek180 0.15 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'attack + :flags (surface-flag no-turn-around turn-to-pad attack gun-inactive) + ) + ) + +(defstate target-running-attack (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('touched) + (cond + (((method-of-type touching-shapes-entry touching-shapes-entry-method-12) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 1920) + ) + (let ((t9-1 target-send-attack) + (a0-3 arg0) + (a1-2 (-> self control unknown-symbol04)) + (a2-2 (-> arg3 param 0)) + (a3-1 (-> self control unknown-symbol05)) + (t0-0 (-> self control unknown-dword05)) + ) + (-> self control penetrate-using) + (let ((gp-1 (t9-1 a0-3 (the-as uint a1-2) a2-2 (the-as int a3-1) (the-as int t0-0)))) + (when gp-1 + (set! (-> self control unknown-time-frame17) (-> self clock frame-counter)) + (set! (-> self gun combo-window-start) (-> self clock frame-counter)) + (set! (-> self gun combo-window-state) (-> self state name)) + (let ((v1-13 (if (type? arg0 process-focusable) + arg0 + ) + ) + ) + (when v1-13 + (let* ((s5-1 (-> (the-as target v1-13) control)) + (v1-14 (if (type? s5-1 collide-shape) + s5-1 + ) + ) + ) + (if (and v1-14 (or (logtest? (-> v1-14 root-prim prim-core collide-as) (collide-spec enemy)) + (logtest? (-> v1-14 root-prim prim-core action) (collide-action no-smack)) + ) + ) + (set! (-> self control unknown-word04) (the-as uint (+ (-> self control unknown-word04) 1))) + ) + ) + ) + ) + (cond + ((or (= gp-1 'die) (= gp-1 'push)) + (let ((v0-2 (the-as object (-> self clock frame-counter)))) + (set! (-> self control unknown-time-frame18) (the-as time-frame v0-2)) + v0-2 + ) + ) + ((= gp-1 'back) + (let ((f0-0 -122880.0)) + (set! (-> self control unknown-word04) (the-as uint f0-0)) + f0-0 + ) + ) + ) + ) + ) + ) + ) + (else + (target-dangerous-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + (('gun-combo) + (if (-> arg3 param 0) + (go target-stance) + ) + #t + ) + (('slide) + #f + ) + (else + (target-dangerous-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior () + (if (and (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (and (-> self next-state) (= (-> self next-state name) 'target-running-attack)) + ) + (go target-darkjak-running-attack) + ) + (logclear! + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons square) + ) + (logclear! + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons square) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (combo-tracker-method-12 + (-> self control unknown-combo-tracker00) + *null-vector* + *null-vector* + (the-as process #f) + (-> self clock frame-counter) + ) + (set! (-> self control unknown-time-frame17) 0) + (set! (-> self control unknown-time-frame18) 0) + (set! (-> self control unknown-word04) (the-as uint 0)) + (set! (-> self control unknown-word04) (the-as uint 0.0)) + (set! (-> self control unknown-surface00) *run-attack-mods*) + (cond + ((= (-> self control ground-pat event) (pat-event slide)) + (set! (-> *run-attack-mods* turnv) 0.0) + (set! (-> *run-attack-mods* turnvv) 0.0) + ) + (else + (set! (-> *run-attack-mods* turnv) 655360.0) + (set! (-> *run-attack-mods* turnvv) 655360.0) + ) + ) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self gun track-target-hold-time) 0) + (if (or (< (fabs (-> self control unknown-float18)) 0.3) (< 0.3 (fabs (-> self control unknown-float17)))) + (set! (-> self control unknown-float29) 1.0) + ) + (set! (-> self upper-body twist z) 0.0) + (none) + ) + :exit (behavior () + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (set! (-> *run-attack-mods* turnv) 0.0) + (set! (-> *run-attack-mods* turnvv) 0.0) + (set! (-> self control unknown-time-frame11) (-> self clock frame-counter)) + (target-exit) + (none) + ) + :trans (behavior () + (when (!= (-> self state-time) (-> self clock frame-counter)) + (when (and (or (smack-surface? #t) + (and (>= (-> self control unknown-float19) 0.7) + (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + ) + ) + (begin + (set! (-> self control unknown-time-frame18) (-> self clock frame-counter)) + (set! (-> self control unknown-float29) 0.0) + (let ((v1-11 (new-stack-vector0)) + (f0-3 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-11 + (-> self control transv) + (the-as vector (vector-float*! v1-11 (-> self control dynam gravity-normal) f0-3)) + ) + (let* ((f1-3 (vector-length v1-11)) + (f2-0 f1-3) + (f0-4 (fmin 0.0 f0-3)) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-4)) + (the-as vector (vector-float*! v1-11 v1-11 (/ f1-3 f2-0))) + ) + ) + ) + #t + ) + (or (zero? (-> self control unknown-time-frame17)) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame17)) (seconds 0.04)) + ) + (!= (-> self control unknown-word04) 1) + ) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) + (< 4096.0 (-> self control unknown-float05)) + (or (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.1)) + (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons square) + ) + ) + ) + (zero? (logand (-> self state-flags) (state-flags sf7 sf8))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-attack))) + (let ((v1-48 (ja-group))) + (and (not (and v1-48 (= v1-48 (-> self draw art-group data 406)))) + (and (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-jump))) + (zero? (logand (-> self state-flags) (state-flags sf7))) + ) + ) + ) + ) + (go + target-attack-uppercut + (-> *TARGET-bank* attack-jump-height-min) + (-> *TARGET-bank* attack-jump-height-max) + ) + ) + (if (and (logtest? (water-flags touch-water) (-> self water flags)) + (zero? (mod (- (-> self clock frame-counter) (-> self state-time)) 21)) + ) + (water-control-method-13 + (-> self water) + 0.6 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 8)) + 0 + (-> self control transv) + #f + ) + ) + (when (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) 2) + (>= (-> (the-as fact-info-target (-> self fact)) eco-level) 1.0) + ) + (let ((s5-1 (method-of-object (-> self skel effect) effect-control-method-10))) + 'group-red-eco-spinkick + (ja-frame-num 0) + 22 + (s5-1) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + (talker-spawn-func (-> *talker-speech* 328) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + (none) + ) + :code (behavior () + (if (logtest? (water-flags touch-water) (-> self water flags)) + (sound-play "swim-stroke") + ) + (set! (-> self control dynam gravity-max) 368640.0) + (set! (-> self control dynam gravity-length) 368640.0) + (let ((gp-1 (-> self draw art-group data 48))) + (ja-channel-push! 1 (seconds 0.02)) + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (-> self gun gun-type) + (((pickup-type eco-yellow)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 273) + 0.0 + 30 + 60 + 1.0 + 0.0 + #f + ) + (set! gp-1 (-> self draw art-group data 275)) + ) + (((pickup-type eco-blue)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 275) + 0.0 + 30 + 60 + 1.0 + 0.0 + #f + ) + (set! gp-1 (-> self draw art-group data 275)) + ) + (else + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 273) + 0.0 + 30 + 60 + 1.0 + 0.0 + #f + ) + (set! gp-1 (-> self draw art-group data 273)) + ) + ) + ) + (ja-no-eval :group! gp-1 :num! (seek! (the float (+ (-> (the-as art-joint-anim gp-1) frames num-frames) -1)))) + ) + (target-start-attack) + (target-danger-set! 'punch #f) + (initialize + (-> self control unknown-impact-control00) + self + 22 + 3276.8 + (-> self control root-prim prim-core collide-with) + ) + (let ((f26-0 (the-as number 0.0)) + (f30-0 1.0) + (gp-2 0) + (f28-0 1.0) + ) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (when (not (ja-min? 0)) + (cond + ((and (>= (ja-aframe-num 0) 20.0) + (and (and (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) + (the-as time-frame (-> *TARGET-bank* ground-timeout)) + ) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) + ) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame17)) (seconds 0.04)) + ) + ) + (go target-falling #f) + ) + ((< (the-as float f26-0) 0.0) + (set! f26-0 (seek (the-as float f26-0) -0.04096 (* 491520.0 (-> self clock seconds-per-frame)))) + (set-forward-vel (the-as float f26-0)) + ) + ((and (nonzero? (-> self control unknown-time-frame18)) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame18)) (seconds 0.04)) + ) + (set-forward-vel 0.0) + ) + ((and (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons square) + ) + ) + (>= (- (-> self clock frame-counter) (-> self control unknown-combo-tracker00 move-start-time)) + (seconds 0.05) + ) + ) + (if (= (-> self control ground-pat material) (pat-material ice)) + (set-forward-vel (fmax 32768.0 (* 0.8 (-> self control unknown-float05)))) + (set-forward-vel (* 0.8 (-> self control unknown-float05))) + ) + ) + ((ja-done? 0) + (set-forward-vel (the-as float f26-0)) + ) + (else + (set! f26-0 + (* (target-align-vel-z-adjust (-> self align delta trans z)) (-> self clock frames-per-second) f30-0) + ) + (set-forward-vel (the-as float f26-0)) + ) + ) + ) + (let ((s5-1 (new-stack-vector0))) + (vector-matrix*! s5-1 (-> self control transv) (-> self control unknown-matrix00)) + (set! (-> s5-1 y) 0.0) + (vector-matrix*! (-> self control unknown-vector44) s5-1 (-> self control unknown-matrix01)) + ) + (when (!= (the-as float (-> self control unknown-word04)) 0.0) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (set! f26-0 (-> self control unknown-word04)) + (set! (-> self control unknown-word04) (the-as uint 0.0)) + ) + (when (and (>= (the-as float f26-0) 0.0) + (let ((s5-2 (ja-group)) + (f24-0 (ja-aframe-num 0)) + ) + (if (or (and (= s5-2 (-> self draw art-group data 48)) + (>= f24-0 10.0) + (>= (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 48)) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + (and (= s5-2 (-> self draw art-group data 273)) + (>= f24-0 10.0) + (>= (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 273)) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + (and (= s5-2 (-> self draw art-group data 275)) + (>= f24-0 10.0) + (>= (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 275)) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + ) + #t + ) + ) + ) + (let ((s5-3 (new 'stack-no-clear 'collide-query))) + (when (and (>= (impact-control-method-11 + (-> self control unknown-impact-control00) + s5-3 + (the-as process #f) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1) + ) + 0.0 + ) + (>= 0.0 (vector-dot (-> s5-3 best-other-tri normal) (-> self control unknown-impact-control00 dir))) + ) + (when (= (-> s5-3 best-other-tri pat mode) (pat-mode wall)) + (let ((s4-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when s4-0 + (let ((t9-34 (method-of-type part-tracker activate))) + (t9-34 (the-as part-tracker s4-0) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-35 run-function-in-process) + (a0-62 s4-0) + (a1-17 part-tracker-init) + (a2-13 (-> *part-group-id-table* 11)) + (a3-8 0) + (t0-6 #f) + (t1-5 #f) + (t2-5 #f) + (t3-3 *launch-matrix*) + ) + (set! (-> t3-3 trans quad) (-> s5-3 best-other-tri intersect quad)) + ((the-as (function object object object object object object object object none) t9-35) + a0-62 + a1-17 + a2-13 + a3-8 + t0-6 + t1-5 + t2-5 + t3-3 + ) + ) + (-> s4-0 ppointer) + ) + ) + (let ((t1-6 (if (using-gun? self) + (make-u128 (the-as uint #x7469682d772d68) (the-as uint #x636e75702d6e7567)) + (make-u128 #x746968 (the-as uint #x2d772d68636e7570)) + ) + ) + ) + (effect-control-method-12 + (-> self skel effect) + 'punch + -1.0 + (the-as int (-> self control unknown-impact-control00 joint)) + (the-as basic #f) + (the-as sound-name t1-6) + ) + ) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (set! f26-0 -61440.0) + ) + ) + ) + ) + (suspend) + (ja :num! (seek! max (* (-> self control unknown-surface01 align-speed) f28-0))) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.1)) + (set! (-> *run-attack-mods* turnvv) 0.0) + ) + (if (< 2 gp-2) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control unknown-float43)))) + ) + (+! gp-2 1) + ) + ) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) + (the-as time-frame (-> *TARGET-bank* ground-timeout)) + ) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) + ) + (go target-falling #f) + ) + (when (and (using-gun? self) + (or (< (-> self control unknown-float12) 0.7) (= (-> self gun gun-type) (pickup-type eco-blue))) + ) + (set! (-> self gun surpress-time) (+ (-> self clock frame-counter) (seconds 0.5))) + (when (zero? (-> self gun track-target-hold-time)) + (case (-> self gun gun-type) + (((pickup-type eco-blue)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 276) + 0.0 + 0 + 60 + 1.0 + 12.0 + #f + ) + ) + (else + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 274) + 0.0 + 0 + 60 + 1.0 + 12.0 + #f + ) + ) + ) + ) + ) + (go target-stance) + (none) + ) + :post target-post + ) + +(define *jump-attack-mods* + (new 'static 'surface + :name 'attack + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 24576.0 + :target-speed 24576.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 object) (arg2 object) (arg3 int)) + (let ((v1-0 arg3)) + (the-as symbol (when (= v1-0 1) + (if (and (>= (-> self gun fire-pending) 2) (< (-> self gun fire-pending) 5)) + (logclear! (-> arg0 flags) (surface-flag gun-direct)) + ) + (case (-> self control ground-pat event) + (((pat-event slide)) + (set! (-> arg0 seek0) 0.05) + (set! (-> arg0 seek90) 0.05) + (set! (-> arg0 seek180) 0.05) + ) + ) + ) + ) + ) + ) + :mode 'air + :flags (surface-flag check-edge air attack spin gun-direct laser-hide) + ) + ) + +(defstate target-attack-air (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (let ((v0-0 (target-bonk-event-handler arg0 arg1 arg2 arg3))) + (cond + (v0-0 + (empty) + v0-0 + ) + (else + (target-dangerous-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (set! (-> self state-time) (-> self clock frame-counter)) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (target-start-attack) + (target-danger-set! 'spin-air #f) + (set! (-> self control unknown-surface00) *jump-attack-mods*) + (set! (-> self neck flex-blend) 0.0) + (let ((f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (cond + ((or (>= 0.0 f0-2) (= arg0 'flop)) + (let ((v1-14 (new-stack-vector0))) + (let ((f0-4 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-14 + (-> self control transv) + (the-as vector (vector-float*! v1-14 (-> self control dynam gravity-normal) f0-4)) + ) + ) + (let* ((f0-5 (vector-length v1-14)) + (f1-2 f0-5) + (f2-0 33775.48) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0)) + (the-as vector (vector-float*! v1-14 v1-14 (/ f0-5 f1-2))) + ) + ) + ) + ) + (else + (let* ((f1-5 (/ f0-2 (* (-> self control dynam gravity-length) (-> self clock seconds-per-frame)))) + (f0-7 (* 0.5 f1-5 (-> self clock seconds-per-frame) f0-2)) + ) + (let ((v1-22 (ja-group))) + (if (and v1-22 + (or (= v1-22 (-> self draw art-group data 51)) + (= v1-22 (-> self draw art-group data 267)) + (= v1-22 (-> self draw art-group data 279)) + ) + ) + (set! f0-7 + (fmax + 0.0 + (- (-> *TARGET-bank* attack-jump-height-max) + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control unknown-vector21)) + ) + ) + ) + ) + ) + ) + (let ((v1-33 (new-stack-vector0))) + (let ((f1-11 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-33 + (-> self control transv) + (the-as vector (vector-float*! v1-33 (-> self control dynam gravity-normal) f1-11)) + ) + ) + (let* ((f1-12 (vector-length v1-33)) + (f2-7 f1-12) + (f0-12 (+ 1024.0 (sqrtf (* 245760.0 (+ 2048.0 f0-7))))) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-12)) + (the-as vector (vector-float*! v1-33 v1-33 (/ f1-12 f2-7))) + ) + ) + ) + ) + ) + ) + ) + (set! (-> self control dynam gravity-length) 122880.0) + (set! (-> self control unknown-vector21 quad) (-> self control trans quad)) + (none) + ) + :exit (behavior () + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (set! (-> self control unknown-time-frame12) (-> self clock frame-counter)) + (target-exit) + (none) + ) + :trans (behavior () + (when (logtest? (-> self control status) (cshape-moving-flags on-surface)) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (go target-hit-ground #f) + ) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.5)) + (seek! + (-> self control dynam gravity-length) + (-> self control unknown-dynamics00 gravity-length) + (* 245760.0 (-> self clock seconds-per-frame)) + ) + ) + (when (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.05)) + (< (vector-dot (-> self control dynam gravity-normal) (the-as vector (-> self control unknown-quaternion02))) + (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + ) + ) + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + ) + (when (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) 2) + (>= (-> (the-as fact-info-target (-> self fact)) eco-level) 1.0) + ) + (let ((s5-0 (method-of-object (-> self skel effect) effect-control-method-10))) + 'group-red-eco-spinkick + (ja-frame-num 0) + 31 + (s5-0) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + (talker-spawn-func (-> *talker-speech* 328) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) r1) (zero? (-> self gun fire-pending))) + (case (-> self gun gun-type) + (((pickup-type eco-yellow)) + (+! (-> self gun fire-pending) 5) + ) + (((pickup-type eco-blue)) + (+! (-> self gun fire-pending) 5) + (set! (-> self gun fire-spinv) 218453.33) + ) + (((pickup-type eco-red)) + (+! (-> self gun fire-pending) 2) + ) + ) + ) + (none) + ) + :code (behavior ((arg0 symbol)) + (target-attack-air-anim) + (go target-falling #f) + (none) + ) + :post target-post + ) + +(let ((v1-32 (copy *turn-around-mods* 'global))) + (set! (-> v1-32 flags) (surface-flag attack gun-inactive)) + (set! *uppercut-mods* v1-32) + ) + +(define *uppercut-jump-mods* (new 'static 'surface + :name 'uppercut + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 32768.0 + :target-speed 32768.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (surface-clamp-speed arg0 arg1 arg2 arg3) + (when (= arg3 1) + (when (nonzero? (-> self gun track-target-hold-time)) + (set! (-> arg0 turnv) 262144.0) + (set! (-> arg0 turnvf) 15.0) + ) + ) + ) + :mode 'air + :flags (surface-flag check-edge air attack spin gun-direct laser-hide) + ) + ) + +(defstate target-attack-uppercut (target) + :event target-dangerous-event-handler + :enter (behavior ((arg0 float) (arg1 float)) + (set! (-> self state-time) (-> self clock frame-counter)) + (target-start-attack) + (target-danger-set! 'uppercut #f) + (set! (-> self control unknown-surface00) *uppercut-mods*) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self gun surpress-time) (+ (-> self clock frame-counter) (seconds 0.15))) + (if (using-gun? self) + (target-top-anim-base-mode 37) + ) + (set! (-> self control unknown-sound-id00) (new 'static 'sound-id)) + 0 + (none) + ) + :exit (behavior () + (if (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-bomb1))) + (gui-control-method-16 + *gui-control* + (gui-action play) + (-> self control unknown-sound-id00) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (target-exit) + (none) + ) + :code (behavior ((arg0 float) (arg1 float)) + (let* ((v1-2 (ja-group)) + (f30-0 (if (and v1-2 (= v1-2 (-> self draw art-group data 20))) + 5.0 + 0.0 + ) + ) + ) + (cond + ((using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (-> self gun gun-type) + (((pickup-type eco-blue)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 279) + f30-0 + 5 + 30 + 1.0 + 0.0 + #f + ) + (ja-no-eval :group! (-> self draw art-group data 279) + :num! (seek! (ja-aframe 7.0 0)) + :frame-num (ja-aframe f30-0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 7.0 0))) + ) + ) + (else + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 267) + f30-0 + 5 + 30 + 1.0 + 0.0 + #f + ) + (ja-no-eval :group! (-> self draw art-group data 267) + :num! (seek! (ja-aframe 7.0 0)) + :frame-num (ja-aframe f30-0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 7.0 0))) + ) + ) + ) + ) + ((and (logtest? (focus-status dark) (-> self focus-status)) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) 8) + ) + (set! (-> self control unknown-sound-id00) + (gui-control-method-9 *gui-control* self (gui-channel jak) (gui-action queue) "darkbom1" -99.0 0) + ) + (ja-no-eval :group! (-> self draw art-group data 391) + :num! (seek! (ja-aframe 7.0 0)) + :frame-num (ja-aframe f30-0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 7.0 0))) + ) + (go target-darkjak-bomb1) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 51) + :num! (seek! (ja-aframe 7.0 0)) + :frame-num (ja-aframe f30-0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 7.0 0))) + ) + ) + ) + ) + (go target-attack-uppercut-jump arg0 arg1) + (none) + ) + :post target-post + ) + +(defstate target-attack-uppercut-jump (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('gun-combo) + (when (-> arg3 param 0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (let ((v1-7 (new-stack-vector0))) + (let ((f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-7 + (-> self control transv) + (the-as vector (vector-float*! v1-7 (-> self control dynam gravity-normal) f0-1)) + ) + ) + (let* ((f0-2 (vector-length v1-7)) + (f1-1 f0-2) + (f2-3 + (- (sqrtf (* 8192.0 (-> self control dynam gravity-length))) + (* 0.008333334 (- (-> self control dynam gravity-length))) + ) + ) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-3)) + (the-as vector (vector-float*! v1-7 v1-7 (/ f0-2 f1-1))) + ) + ) + ) + (set! (-> self gun surpress-time) (+ (-> self clock frame-counter) (seconds 0.5))) + (go target-falling 'uppercut) + ) + #t + ) + (else + (target-dangerous-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior ((arg0 float) (arg1 float)) + (if (and (= (-> self control ground-pat material) (pat-material ice)) + (< 32768.0 (-> self control unknown-float05)) + ) + (set-forward-vel 32768.0) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control unknown-surface00) *uppercut-jump-mods*) + (target-start-attack) + (target-danger-set! 'uppercut #f) + (set! (-> self gun combo-window-start) (-> self clock frame-counter)) + (set! (-> self gun combo-window-state) (-> self state name)) + (set! (-> self gun track-target-hold-time) 0) + 0 + (none) + ) + :exit target-exit + :trans (behavior () + (if (logtest? (-> self control status) (cshape-moving-flags on-surface)) + (go target-hit-ground #f) + ) + (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 22118.4) + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame14)) + (the-as time-frame (-> *TARGET-bank* stuck-timeout)) + ) + (zero? (logand (-> self state-flags) (state-flags sf8))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-attack no-hands))) + (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + ) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (build-conversions (-> self control transv)) + (go + target-flop + 65502.96 + -163840.0 + (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + 0 + #x47866666 + ) + ) + ) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) + (and (can-feet? #f) + (let ((v1-65 (ja-group))) + (and v1-65 (or (= v1-65 (-> self draw art-group data 51)) (= v1-65 (-> self draw art-group data 267)))) + ) + (>= (ja-aframe-num 0) 12.0) + ) + ) + (go target-attack-air 'uppercut) + ) + (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) + (when (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) 2) + (>= (-> (the-as fact-info-target (-> self fact)) eco-level) 1.0) + ) + (let ((s5-0 (method-of-object (-> self skel effect) effect-control-method-10))) + 'group-red-eco-spinkick + (ja-frame-num 0) + 22 + (s5-0) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + ) + (if (and (= (-> self control unknown-symbol04) 'uppercut) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) -8192.0) + ) + (target-danger-set! 'harmless #f) + ) + (slide-down-test) + (none) + ) + :code (behavior ((arg0 float) (arg1 float)) + (when (or (= (-> self skel top-anim frame-group) (-> self draw art-group data 267)) + (= (-> self skel top-anim frame-group) (-> self draw art-group data 279)) + ) + (let ((v1-10 (top-anim-joint-control-method-11 (-> self skel top-anim) 0))) + (if v1-10 + (set! (-> v1-10 param 1) 0.9) + ) + ) + ) + (compute-alignment! (-> self align)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.9)) + (compute-alignment! (-> self align)) + (set! (-> self control unknown-float06) 1.0) + (let ((v1-27 (ja-group))) + (if (and v1-27 (= v1-27 (-> self draw art-group data 51))) + (align! + (-> self align) + (the-as align-opts (cond + ((>= 30.0 (ja-aframe-num 0)) + (set! (-> self gun surpress-time) (+ (-> self clock frame-counter) (seconds 0.1))) + (if (nonzero? (-> self gun track-target-hold-time)) + 2 + 18 + ) + ) + ((>= 43.0 (ja-aframe-num 0)) + (set! (-> self control unknown-surface00) *double-jump-mods*) + 2 + ) + (else + 0 + ) + ) + ) + 1.0 + 0.95 + 1.0 + ) + (align! + (-> self align) + (the-as align-opts (cond + ((>= 35.0 (ja-aframe-num 0)) + (set! (-> self gun surpress-time) (+ (-> self clock frame-counter) (seconds 0.1))) + (if (nonzero? (-> self gun track-target-hold-time)) + 2 + 18 + ) + ) + ((>= 43.0 (ja-aframe-num 0)) + (set! (-> self control unknown-surface00) *double-jump-mods*) + 2 + ) + (else + 0 + ) + ) + ) + 1.0 + 0.95 + 1.0 + ) + ) + ) + ) + (set! (-> self gun surpress-time) (-> self clock frame-counter)) + (go target-falling #f) + (none) + ) + :post target-post + ) + +(defstate target-flop (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v1-0 symbol)) + (let ((v0-0 (target-bonk-event-handler arg0 arg1 arg2 arg3))) + (cond + (v0-0 + (empty) + v0-0 + ) + ((begin (set! v1-0 arg2) (= v1-0 'slide)) + #f + ) + ((= v1-0 'swim) + (cond + ((< 6144.0 (target-height-above-ground)) + (sound-play "swim-flop") + (set! (-> self control unknown-float42) 0.0) + (go target-swim-down) + ) + (else + (go target-flop-hit-ground 'swim) + ) + ) + ) + (else + (target-dangerous-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + :enter (behavior ((arg0 float) (arg1 float) (arg2 float)) + (cond + ((and (= (-> (the-as fact-info-target (-> self fact)) eco-type) 1) + (>= (-> (the-as fact-info-target (-> self fact)) eco-level) 1.0) + ) + (go target-yellow-jump-blast) + ) + ((and (logtest? (focus-status dark) (-> self focus-status)) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) 4) + ) + (go target-darkjak-bomb0) + ) + ) + (if (= arg2 0.0) + (set-forward-vel arg2) + (set-forward-vel (-> self control unknown-float05)) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (set! (-> self control unknown-surface00) *flop-mods*) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control unknown-word04) (the-as uint 0)) + (set! (-> self control dynam gravity-max) 245760.0) + (set! (-> self control dynam gravity-length) 245760.0) + (let ((v1-33 (new-stack-vector0))) + (let ((f0-7 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-33 + (-> self control transv) + (the-as vector (vector-float*! v1-33 (-> self control dynam gravity-normal) f0-7)) + ) + ) + (let* ((f0-8 (vector-length v1-33)) + (f1-3 f0-8) + (f2-0 29491.2) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0)) + (the-as vector (vector-float*! v1-33 v1-33 (/ f0-8 f1-3))) + ) + ) + ) + (none) + ) + :exit (behavior () + (let ((v1-2 (top-anim-joint-control-method-11 (-> self skel top-anim) 0))) + (when v1-2 + (case (-> v1-2 frame-group) + (((-> self draw art-group data 286)) + (set! (-> v1-2 param 1) 10.0) + ) + ) + ) + ) + (target-danger-set! 'harmless #f) + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (set! (-> self control dynam gravity quad) (-> self control unknown-dynamics00 gravity quad)) + (set! (-> self neck flex-blend) 1.0) + (none) + ) + :trans (behavior () + (delete-back-vel) + (let ((gp-1 (logtest? (-> self control status) (cshape-moving-flags on-surface)))) + (when (and (not gp-1) + (let ((v1-6 (ja-group))) + (and v1-6 (or (= v1-6 (-> self draw art-group data 53)) (= v1-6 (-> self draw art-group data 55)))) + ) + ) + (when (and (or (< (target-move-dist (seconds 0.1)) 1638.4) + (and (logtest? (-> self control status) (cshape-moving-flags t-wall)) (< 0.7 (-> self control poly-angle))) + ) + (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + (>= (the-as uint (-> self control unknown-word04)) (the-as uint 2)) + ) + (set! (-> self control unknown-time-frame14) (-> self clock frame-counter)) + (set! gp-1 'stuck) + ) + ) + (when gp-1 + (logior! (-> self control status) (cshape-moving-flags on-surface)) + (when (or (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) 2) + (>= (-> (the-as fact-info-target (-> self fact)) eco-level) 1.0) + ) + (and (logtest? (focus-status dark) (-> self focus-status)) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) 2) + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) + (when (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) 2) + (>= (-> (the-as fact-info-target (-> self fact)) eco-level) 1.0) + ) + (let ((s4-0 (method-of-object (-> self skel effect) effect-control-method-10))) + 'group-red-eco-strike-ground + (ja-frame-num 0) + 0 + (s4-0) + ) + ) + (let ((v1-56 (process-spawn touch-tracker :init touch-tracker-init (-> self control trans) #x45800000 30 :to self)) + ) + (send-event + (ppointer->process v1-56) + 'function + (lambda :behavior target + ((arg0 target)) + (set! (-> arg0 control root-prim local-sphere w) + (seek (-> arg0 control root-prim local-sphere w) 28672.0 (* 286720.0 (-> self clock seconds-per-frame))) + ) + ) + ) + ) + ) + (go target-flop-hit-ground gp-1) + ) + ) + (when (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) 2) + (>= (-> (the-as fact-info-target (-> self fact)) eco-level) 1.0) + ) + (let* ((gp-2 (-> self skel effect)) + (s5-2 (method-of-object gp-2 effect-control-method-10)) + ) + 'group-red-eco-spinkick + (ja-frame-num 0) + (if (rand-vu-percent? 0.5) + 22 + 18 + ) + (s5-2) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + ) + (when (and (not (-> self control unknown-symbol04)) + (let ((v1-82 (ja-group))) + (and v1-82 (= v1-82 (-> self draw art-group data 52))) + ) + (>= (ja-aframe-num 0) 8.0) + ) + (target-start-attack) + (target-danger-set! 'flop #f) + ) + (none) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 float)) + (if (using-gun? self) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 286) + 0.0 + 0 + 30 + 1.0 + 0.0 + #f + ) + ) + (ja-channel-set! 2) + (ja-no-eval :group! (-> self draw art-group data 52) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 52)) frames num-frames) -1))) + :frame-num 0.0 + ) + (ja :chan 1 :group! (-> self draw art-group data 55) :num! (chan 0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + (let ((gp-0 (-> self skel root-channel 1))) + (let ((f0-10 (lerp-scale 0.0 1.0 (-> self control unknown-float05) 0.0 40960.0))) + (set! (-> gp-0 frame-interp 1) f0-10) + (set! (-> gp-0 frame-interp 0) f0-10) + ) + (set! (-> gp-0 param 0) (the float (+ (-> gp-0 frame-group frames num-frames) -1))) + (set! (-> gp-0 param 1) 1.0) + (joint-control-channel-group-eval! gp-0 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (set! (-> self control dynam gravity quad) (-> self control unknown-dynamics00 gravity quad)) + (target-danger-set! 'flop-down #f) + (let ((v1-56 (top-anim-joint-control-method-11 (-> self skel top-anim) 0))) + (if (and v1-56 (= (-> v1-56 frame-group) (-> self draw art-group data 286))) + (set! (-> v1-56 param 1) 0.0) + ) + ) + (let ((f30-0 1.0)) + (let ((v1-58 (new-stack-vector0))) + (let ((f0-17 (vector-dot (-> self control dynam gravity-normal) (-> self control unknown-vector44)))) + 0.0 + (vector-! + v1-58 + (-> self control unknown-vector44) + (the-as vector (vector-float*! v1-58 (-> self control dynam gravity-normal) f0-17)) + ) + ) + (let* ((f0-18 (vector-length v1-58)) + (f1-1 f0-18) + (f2-0 -368640.0) + ) + (vector+! + (-> self control unknown-vector44) + (the-as + vector + (vector-float*! (-> self control unknown-vector44) (-> self control dynam gravity-normal) f2-0) + ) + (the-as vector (vector-float*! v1-58 v1-58 (/ f0-18 f1-1))) + ) + ) + ) + (let ((v1-59 (new-stack-vector0))) + (let ((f0-21 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-59 + (-> self control transv) + (the-as vector (vector-float*! v1-59 (-> self control dynam gravity-normal) f0-21)) + ) + ) + (let* ((f0-22 (vector-length v1-59)) + (f1-3 f0-22) + (f2-2 (* -368640.0 f30-0)) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-2)) + (the-as vector (vector-float*! v1-59 v1-59 (/ f0-22 f1-3))) + ) + ) + ) + (suspend) + (until #f + (set! (-> self control unknown-word04) (the-as uint (+ (-> self control unknown-word04) 1))) + (ja :num! (seek!)) + (let ((gp-1 (-> self skel root-channel 1))) + (let ((f0-28 (lerp-scale 0.0 1.0 (-> self control unknown-float05) 0.0 40960.0))) + (set! (-> gp-1 frame-interp 1) f0-28) + (set! (-> gp-1 frame-interp 0) f0-28) + ) + (set! (-> gp-1 param 0) 0.0) + (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-chan) + ) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control unknown-float43)))) + (let ((v1-77 (new-stack-vector0)) + (f0-33 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-77 + (-> self control transv) + (the-as vector (vector-float*! v1-77 (-> self control dynam gravity-normal) f0-33)) + ) + (let* ((f2-3 (vector-length v1-77)) + (f1-7 f2-3) + ) + (if (< (-> self control unknown-surface01 transv-max) f2-3) + (set! f2-3 (-> self control unknown-surface01 transv-max)) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-33)) + (the-as vector (vector-float*! v1-77 v1-77 (/ f2-3 f1-7))) + ) + ) + ) + (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) + (the-as time-frame (-> *TARGET-bank* fall-timeout)) + ) + (!= (-> self tobot?) 'tobot) + ) + (go target-falling #f) + ) + (if (and (= *cheat-mode* 'debug) + (cpad-hold? (-> self control unknown-cpad-info00 number) r2) + (not *pause-lock*) + (!= (-> self tobot?) 'tobot) + ) + (go target-falling #f) + ) + (suspend) + ) + ) + #f + (none) + ) + :post target-post + ) + +(defstate target-flop-hit-ground (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (cond + ((and (-> self next-state) (= (-> self next-state name) 'target-flop-hit-ground)) + (case arg2 + (('swim 'slide) + #f + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + (else + (target-jump-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (let ((f0-1 (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector43) (-> self control trans)) + ) + ) + ) + (if (< (-> *TARGET-bank* fall-far) f0-1) + (go target-hit-ground-hard f0-1) + ) + ) + (target-land-effect) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self control unknown-word04) (the-as uint arg0)) + (set-forward-vel 0.0) + (set! (-> self control unknown-surface00) *flop-land-mods*) + (logclear! (-> *flop-land-mods* flags) (surface-flag check-edge)) + (logior! (-> self state-flags) (state-flags sf15)) + (set! (-> self neck flex-blend) 0.0) + (cond + ((= arg0 'swim) + ) + (else + ) + ) + (none) + ) + :exit target-exit + :trans (behavior () + (when (and (!= (-> self control unknown-spool-anim00) 'stuck) + (!= (-> self state-time) (-> self clock frame-counter)) + ) + (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? #f) + ) + (go target-attack-air 'flop) + ) + ) + (when (and (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) 2) + (>= (-> (the-as fact-info-target (-> self fact)) eco-level) 1.0) + ) + (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.25)) + ) + (let* ((gp-0 (-> self skel effect)) + (s5-0 (method-of-object gp-0 effect-control-method-10)) + ) + 'group-red-eco-spinkick + (ja-frame-num 0) + (if (rand-vu-percent? 0.5) + 22 + 18 + ) + (s5-0) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + ) + (let ((v1-37 (ja-group))) + (if (and (and v1-37 (= v1-37 (-> self draw art-group data 54))) (>= (ja-aframe-num 0) 28.0)) + (logior! (-> *flop-land-mods* flags) (surface-flag check-edge)) + ) + ) + (slide-down-test) + (none) + ) + :code (behavior ((arg0 symbol)) + (let ((gp-0 target-hit-ground-anim) + (s5-0 arg0) + ) + (are-still?) + (gp-0 s5-0) + ) + (go target-falling #f) + (none) + ) + :post target-post + ) + +(defstate target-roll (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (if (= arg2 'touched) + (send-event arg0 'roll) + ) + (case arg2 + (('gun-combo) + (when (-> arg3 param 0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (let ((a0-8 (-> self control))) + (set-quaternion! a0-8 (-> self control dir-targ)) + (go target-duck-stance (the-as symbol a0-8)) + ) + ) + #t + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior () + (target-collide-set! 'duck 1.0) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self neck base-joint) (the-as uint 8)) + (set! (-> self control unknown-surface00) *roll-mods*) + (+! (-> self control unknown-word02) 1) + (rot->dir-targ! (-> self control)) + (set-forward-vel (+ (-> *TARGET-bank* roll-speed-min) + (* (-> *TARGET-bank* roll-speed-inc) (the float (+ (-> self control unknown-word02) -1))) + ) + ) + (if (or (< (fabs (-> self control unknown-float18)) 0.3) (< 0.3 (fabs (-> self control unknown-float17)))) + (set! (-> self control unknown-float29) 1.0) + ) + (set! (-> self control unknown-word04) (the-as uint 0)) + (set! (-> self control unknown-symbol02) 0.0) + (set! (-> self gun track-target-hold-time) 0) + (none) + ) + :exit (behavior () + (when (not (and (-> self next-state) (= (-> self next-state name) 'target-roll))) + (set! (-> self control unknown-word02) 0) + (set! (-> self control unknown-time-frame10) (-> self clock frame-counter)) + ) + (target-exit) + (target-collide-set! 'normal 0.0) + (none) + ) + :code (behavior () + (let ((gp-0 0)) + 0 + (let ((s5-0 0) + (f30-0 1.0) + (s4-0 #f) + ) + (ja-channel-push! 1 (seconds 0.04)) + (cond + ((using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 282) + 0.0 + 15 + 30 + 1.0 + 0.0 + #f + ) + (ja :group! (-> self draw art-group data 282) :num! min) + ) + (else + (ja :group! (-> self draw art-group data 59) :num! min) + ) + ) + (until (ja-done? 0) + (if (cpad-pressed? (-> self control unknown-cpad-info00 number) x) + (set! gp-0 (the-as int (-> self clock frame-counter))) + ) + (when (and (not s4-0) (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.2))) + (set! s4-0 #t) + (set! (-> self gun combo-window-start) (-> self clock frame-counter)) + (set! (-> self gun combo-window-state) (-> self state name)) + ) + (when (and (or (smack-surface? #f) (>= (-> self control unknown-float19) 0.7)) + (>= (the-as uint (- (-> self clock frame-counter) (the-as int (-> self control unknown-word04)))) + (the-as uint 3) + ) + (>= (- (-> self clock frame-counter) (-> self state-time)) 1) + ) + (when (>= 6.0 (ja-aframe-num 0)) + (if (using-gun? self) + (target-top-anim-base-mode 15) + ) + (target-shoved + (-> *TARGET-bank* smack-surface-dist) + (-> *TARGET-bank* smack-surface-height) + (the-as process #f) + target-hit + ) + ) + (if (zero? s5-0) + (set! s5-0 (the-as int (-> self clock frame-counter))) + ) + ) + (if (cpad-pressed? (-> self control unknown-cpad-info00 number) square) + (-> self clock frame-counter) + ) + (compute-alignment! (-> self align)) + (cond + ((nonzero? s5-0) + ) + (else + (align! (-> self align) (align-opts adjust-xz-vel) 1.0 1.0 f30-0) + (let ((s3-2 (new-stack-vector0))) + (vector-matrix*! s3-2 (-> self control transv) (-> self control unknown-matrix00)) + (set! (-> s3-2 y) 0.0) + (vector-matrix*! (-> self control unknown-vector44) s3-2 (-> self control unknown-matrix01)) + ) + ) + ) + (suspend) + (ja :num! (seek!)) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control unknown-float43)))) + ) + ) + (if (and (or (< (- (-> self clock frame-counter) (the-as time-frame gp-0)) + (the-as time-frame (-> *TARGET-bank* roll-jump-pre-window)) + ) + (cpad-pressed? (-> self control unknown-cpad-info00 number) x) + ) + (can-jump? 'target-roll-flip) + ) + (go target-roll-flip (-> *TARGET-bank* roll-flip-height) (-> *TARGET-bank* roll-flip-dist)) + ) + ) + (set! (-> self state-hook-time) (-> self clock frame-counter)) + (set! (-> self state-hook) + (lambda :behavior target + () + (cond + ((>= (- (-> self clock frame-counter) (-> self state-hook-time)) + (the-as time-frame (-> *TARGET-bank* roll-jump-post-window)) + ) + (set! (-> self state-hook) (the-as (function none :behavior target) nothing)) + ) + (else + (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? 'target-roll-flip) + ) + (go target-roll-flip (-> *TARGET-bank* roll-flip-height) (-> *TARGET-bank* roll-flip-dist)) + ) + ) + ) + (none) + ) + ) + (set! (-> self gun surpress-time) (+ (-> self clock frame-counter) (seconds 0.2))) + (go target-duck-stance 'roll) + (none) + ) + :post target-post + ) + +(defstate target-roll-flip (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('gun-combo) + (when (-> arg3 param 0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (go target-falling #f) + ) + #t + ) + (else + (target-jump-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior ((arg0 float) (arg1 float)) + (set! (-> self control unknown-surface00) *roll-flip-mods*) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self neck base-joint) (the-as uint 8)) + (set! (-> self gun track-target-hold-time) 0) + (set! (-> self gun combo-window-start) (-> self clock frame-counter)) + (set! (-> self gun combo-window-state) (-> self state name)) + (target-collide-set! 'duck 1.0) + (none) + ) + :exit (behavior () + (target-exit) + (target-collide-set! 'normal 0.0) + (none) + ) + :trans (behavior () + (if (and (or (smack-surface? #f) + (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + ) + (and (!= (-> self state-time) (-> self clock frame-counter)) (not (using-gun? self))) + ) + (target-shoved + (-> *TARGET-bank* smack-surface-dist) + (-> *TARGET-bank* smack-surface-height) + (the-as process #f) + target-hit + ) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) + (can-feet? #f) + (let ((v1-20 (ja-group))) + (and (and v1-20 (= v1-20 (-> self draw art-group data 27))) + (= (-> self skel root-channel 0) (-> self skel channel)) + ) + ) + ) + (go target-attack-air #f) + ) + (none) + ) + :code (behavior ((arg0 float) (arg1 float)) + (local-vars (v1-37 symbol)) + (ja-channel-push! 1 (seconds 0.04)) + (ja :group! (-> self draw art-group data 61) :num! min) + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 284) + 0.0 + 0 + 30 + 1.0 + 0.0 + #f + ) + ) + (let ((f30-0 1.0)) + (until v1-37 + (compute-alignment! (-> self align)) + (if (not (ja-max? 0)) + (align! + (-> self align) + (align-opts adjust-y-vel adjust-xz-vel) + 1.0 + (/ arg0 (-> *TARGET-bank* roll-flip-art-height)) + (* f30-0 (/ arg1 (-> *TARGET-bank* roll-flip-art-dist))) + ) + (align! + (-> self align) + (align-opts adjust-xz-vel) + 1.0 + 1.0 + (* f30-0 (/ arg1 (-> *TARGET-bank* roll-flip-art-dist))) + ) + ) + (let ((s4-1 (new-stack-vector0))) + (vector-matrix*! s4-1 (-> self control transv) (-> self control unknown-matrix00)) + (set! (-> s4-1 y) 0.0) + (vector-matrix*! (-> self control unknown-vector44) s4-1 (-> self control unknown-matrix01)) + ) + (suspend) + (ja :num! (seek!)) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control unknown-float43)))) + (set! v1-37 + (or (ja-max? 0) + (and (>= (ja-aframe-num 0) 4.0) (logtest? (-> self control status) (cshape-moving-flags on-surface))) + ) + ) + ) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.01)) + (let ((v1-50 (ja-group))) + (when (not (and v1-50 (= v1-50 (-> self draw art-group data 27)))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 27) :num! min) + ) + ) + ) + (let ((v1-59 (new-stack-vector0)) + (f0-19 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-59 + (-> self control transv) + (the-as vector (vector-float*! v1-59 (-> self control dynam gravity-normal) f0-19)) + ) + (let* ((f2-0 (vector-length v1-59)) + (f1-7 f2-0) + (f2-1 (* 0.9 f2-0)) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-19)) + (the-as vector (vector-float*! v1-59 v1-59 (/ f2-1 f1-7))) + ) + ) + ) + (suspend) + (let ((v1-62 (ja-group))) + (if (and v1-62 (= v1-62 (-> self draw art-group data 27))) + (ja :num! (loop!)) + (ja :num-func num-func-identity :frame-num max) + ) + ) + ) + (target-land-effect) + (set! (-> self gun surpress-time) (+ (-> self clock frame-counter) (seconds 0.1))) + (set! (-> self state-hook-time) (-> self clock frame-counter)) + (set! (-> self state-hook) + (lambda :behavior target + () + (cond + ((>= (- (-> self clock frame-counter) (-> self state-hook-time)) (seconds 0.1)) + (set! (-> self state-hook) (the-as (function none :behavior target) nothing)) + ) + (else + (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) + (or (not (-> *TARGET-bank* strafe-duck-jump)) (not (enabled-gun? self))) + ) + (go target-high-jump (-> *TARGET-bank* flip-jump-height-min) (-> *TARGET-bank* flip-jump-height-max) 'flip) + ) + ) + ) + (none) + ) + ) + self + (cond + ((not (can-exit-duck?)) + (go target-duck-stance #f) + ) + (else + (let ((v1-86 (ja-group))) + (if (and v1-86 (= v1-86 (-> self draw art-group data 27))) + (go target-hit-ground #f) + (go target-stance) + ) + ) + ) + ) + (none) + ) + :post target-post + ) \ No newline at end of file diff --git a/goalc/compiler/compilation/Function.cpp b/goalc/compiler/compilation/Function.cpp index 3e0eac37c..dd26bb387 100644 --- a/goalc/compiler/compilation/Function.cpp +++ b/goalc/compiler/compilation/Function.cpp @@ -204,6 +204,7 @@ Val* Compiler::compile_lambda(const goos::Object& form, const goos::Object& rest if (args.has_named("behavior")) { const std::string behavior_type = symbol_string(args.get_named("behavior")); auto self_var = new_func_env->make_gpr(m_ts.make_typespec(behavior_type)); + self_var->mark_as_settable(); IRegConstraint constr; constr.contrain_everywhere = true; constr.desired_register = emitter::gRegInfo.get_process_reg(); diff --git a/test/decompiler/reference/jak2/decompiler-macros.gc b/test/decompiler/reference/jak2/decompiler-macros.gc index 2495aa70d..e326288eb 100644 --- a/test/decompiler/reference/jak2/decompiler-macros.gc +++ b/test/decompiler/reference/jak2/decompiler-macros.gc @@ -917,4 +917,18 @@ :regs14 (gif-reg-id a+d) :regs15 (gif-reg-id a+d) ) - ) \ No newline at end of file + ) + +(defmacro sound-play (name &key (id (new-sound-id)) + &key (vol 100.0) &key (pitch 0) &key (bend 0) + &key (group sfx) + &key (position #t)) + `(sound-play-by-name (static-sound-name ,name) ,id (the int (* (/ 1024.0 100.0) ,vol)) (the int (* 1524.0 ,pitch)) ,bend (sound-group ,group) ,position) + ) + +(defmacro cmove-#f-zero (dest condition src) + `(if (zero? ,condition) + (set! ,dest #f) + (set! ,dest ,src) + ) + ) \ No newline at end of file diff --git a/test/decompiler/reference/jak2/engine/ambient/ambient-h_REF.gc b/test/decompiler/reference/jak2/engine/ambient/ambient-h_REF.gc index f1a9e2c91..60ee951ba 100644 --- a/test/decompiler/reference/jak2/engine/ambient/ambient-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ambient/ambient-h_REF.gc @@ -3,16 +3,16 @@ ;; definition of type talker-speech-class (deftype talker-speech-class (structure) - ((name string :offset-assert 0) - (channel uint8 :offset-assert 4) - (flags uint8 :offset-assert 5) - (speech uint16 :offset-assert 6) - (text-message uint32 :offset-assert 8) - (text-duration uint16 :offset-assert 12) - (delay uint16 :offset-assert 14) - (pos uint16 :offset-assert 16) - (neg uint16 :offset-assert 18) - (on-close basic :offset-assert 20) + ((name string :offset-assert 0) + (channel gui-channel :offset-assert 4) + (flags uint8 :offset-assert 5) + (speech uint16 :offset-assert 6) + (text-message uint32 :offset-assert 8) + (text-duration uint16 :offset-assert 12) + (delay uint16 :offset-assert 14) + (pos uint16 :offset-assert 16) + (neg uint16 :offset-assert 18) + (on-close basic :offset-assert 20) ) :pack-me :method-count-assert 14 @@ -68,7 +68,7 @@ :size-assert #xd4 :flag-assert #x12006000d4 (:methods - (talker-method-14 () none 14) + (talker-method-14 () _type_ :state 14) (talker-method-15 () none 15) (talker-method-16 () none 16) (talker-method-17 () none 17) @@ -100,935 +100,1607 @@ obj ) -;; definition for symbol *talker-speech*, type talker-speech-class -(define *talker-speech* - (the-as talker-speech-class - (new 'static 'inline-array talker-speech-class 188 - (new 'static 'talker-speech-class :name "none") - (new 'static 'talker-speech-class :name "hal001" :channel #x1d :flags #x3 :speech #x1 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "hal002" :channel #x1d :flags #x3 :speech #x2 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "DSbop002" - :channel #x14 - :flags #x3 - :speech #x3 - :text-message #x224 - :text-duration #x5dc - :neg #x1 - :on-close #f +;; definition for symbol *talker-speech*, type (inline-array talker-speech-class) +(define *talker-speech* (new 'static 'inline-array talker-speech-class 188 + (new 'static 'talker-speech-class :name "none") + (new 'static 'talker-speech-class + :name "hal001" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x1 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "hal002" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x2 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSbop002" + :channel (gui-channel daxter) + :flags #x3 + :speech #x3 + :text-message #x224 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSbop004" + :channel (gui-channel daxter) + :flags #x3 + :speech #x4 + :text-message #x226 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSbop008" + :channel (gui-channel daxter) + :flags #x3 + :speech #x5 + :text-message #x227 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSbop009" + :channel (gui-channel daxter) + :flags #x3 + :speech #x6 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSbop010" + :channel (gui-channel daxter) + :flags #x3 + :speech #x7 + :text-message #x227 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSbop011" + :channel (gui-channel daxter) + :flags #x3 + :speech #x8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSbop016" + :channel (gui-channel daxter) + :flags #x3 + :speech #x9 + :text-message #x229 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSbop017" + :channel (gui-channel daxter) + :flags #x3 + :speech #xa + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds020" + :channel (gui-channel daxter) + :flags #x3 + :speech #xb + :text-message #x225 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds043" + :channel (gui-channel daxter) + :flags #x11 + :speech #xc + :text-message #x228 + :text-duration #x12c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds043m" + :channel (gui-channel message) + :flags #x10 + :speech #xd + :text-message #x228 + :text-duration #x12c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds046" + :channel (gui-channel daxter) + :flags #x11 + :speech #xe + :text-message #x22a + :text-duration #x12c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds046m" + :channel (gui-channel message) + :flags #x10 + :speech #xf + :text-message #x22a + :text-duration #x12c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds162" + :channel (gui-channel daxter) + :flags #x3 + :speech #x10 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds165" + :channel (gui-channel daxter) + :flags #x3 + :speech #x11 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv039" + :channel (gui-channel alert) + :flags #x3 + :speech #x12 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv037" + :channel (gui-channel alert) + :flags #x3 + :speech #x13 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv056" + :channel (gui-channel alert) + :flags #x3 + :speech #x14 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv054" + :channel (gui-channel alert) + :flags #x3 + :speech #x15 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv055" + :channel (gui-channel alert) + :flags #x3 + :speech #x16 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv107" + :channel (gui-channel alert) + :flags #x3 + :speech #x17 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kg100a" + :channel (gui-channel alert) + :flags #x3 + :speech #x18 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kg104a" + :channel (gui-channel alert) + :flags #x3 + :speech #x19 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kg102a" + :channel (gui-channel alert) + :flags #x3 + :speech #x1a + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kg071a" + :channel (gui-channel alert) + :flags #x3 + :speech #x1b + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kg107a" + :channel (gui-channel alert) + :flags #x3 + :speech #x1c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kg097a" + :channel (gui-channel alert) + :flags #x3 + :speech #x1d + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kg098a" + :channel (gui-channel alert) + :flags #x3 + :speech #x1e + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv063" + :channel (gui-channel alert) + :speech #x1f + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv064" + :channel (gui-channel alert) + :speech #x20 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv065" + :channel (gui-channel alert) + :speech #x21 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv067" + :channel (gui-channel alert) + :speech #x22 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv068" + :channel (gui-channel alert) + :speech #x23 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv069" + :channel (gui-channel alert) + :speech #x24 + :text-message #x246 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv070" + :channel (gui-channel alert) + :speech #x25 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv130" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x26 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv132" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x27 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv071" + :channel (gui-channel alert) + :speech #x28 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv072" + :channel (gui-channel alert) + :speech #x29 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv073" + :channel (gui-channel alert) + :speech #x2a + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv074" + :channel (gui-channel alert) + :speech #x2b + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv075" + :channel (gui-channel alert) + :speech #x2c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv076" + :channel (gui-channel alert) + :speech #x2d + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv077" + :channel (gui-channel alert) + :speech #x2e + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv078" + :channel (gui-channel alert) + :speech #x2f + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv036" + :channel (gui-channel alert) + :speech #x30 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "tor007" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x31 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "tor008" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x32 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "mess004" + :channel (gui-channel message) + :flags #x7 + :speech #x33 + :text-message #x245 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "krew010" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x34 + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds129" + :channel (gui-channel daxter) + :flags #x2 + :speech #x35 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "mess005" + :channel (gui-channel message) + :flags #x3 + :speech #x36 + :text-message #x247 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "mess006" + :channel (gui-channel message) + :speech #x37 + :text-message #x226 + :text-duration #x5dc + :pos #x8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds116" + :channel (gui-channel daxter) + :flags #x2 + :speech #x38 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds117" + :channel (gui-channel daxter) + :flags #x3 + :speech #x39 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds118" + :channel (gui-channel daxter) + :flags #x3 + :speech #x3a + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds119" + :channel (gui-channel daxter) + :flags #x3 + :speech #x3b + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds120" + :channel (gui-channel daxter) + :flags #x3 + :speech #x3c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds121" + :channel (gui-channel daxter) + :flags #x3 + :speech #x3d + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "daxm007" + :channel (gui-channel daxter) + :flags #x3 + :speech #x3e + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "daxm008" + :channel (gui-channel daxter) + :flags #x3 + :speech #x3f + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "daxm009" + :channel (gui-channel daxter) + :flags #x3 + :speech #x40 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "daxm010" + :channel (gui-channel daxter) + :flags #x3 + :speech #x41 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek001" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x42 + :delay #x4b0 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds006" + :channel (gui-channel daxter) + :flags #x3 + :speech #x43 + :delay #xbb8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds029" + :channel (gui-channel daxter) + :flags #x2 + :speech #x44 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds030" + :channel (gui-channel daxter) + :flags #x2 + :speech #x45 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds031" + :channel (gui-channel daxter) + :flags #x2 + :speech #x46 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds032" + :channel (gui-channel daxter) + :flags #x2 + :speech #x47 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds007" + :channel (gui-channel daxter) + :flags #x3 + :speech #x48 + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds372" + :channel (gui-channel daxter) + :flags #x3 + :speech #x49 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "vin011" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x4a + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds009" + :channel (gui-channel daxter) + :flags #x3 + :speech #x4b + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "demo001" + :channel (gui-channel message) + :flags #x3 + :speech #x4c + :text-message #x23d + :text-duration #xbb8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "demo002" + :channel (gui-channel message) + :flags #x3 + :speech #x4d + :text-message #x22b + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "demo003" + :channel (gui-channel message) + :flags #x3 + :speech #x4e + :text-message #x252 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "demo004" + :channel (gui-channel message) + :flags #x3 + :speech #x4f + :text-message #x253 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "demo005" + :channel (gui-channel message) + :flags #x3 + :speech #x50 + :text-message #x226 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kei026" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x51 + :delay #x1770 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kei018" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x52 + :text-message #x241 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSfor001" + :channel (gui-channel daxter) + :flags #x3 + :speech #x53 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds017" + :channel (gui-channel daxter) + :flags #x3 + :speech #x54 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds018" + :channel (gui-channel daxter) + :flags #x3 + :speech #x55 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds019" + :channel (gui-channel daxter) + :flags #x3 + :speech #x56 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds350" + :channel (gui-channel daxter) + :flags #x2 + :speech #x57 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds016" + :channel (gui-channel daxter) + :flags #x3 + :speech #x58 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "sigf001" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x59 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ys001" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x5a + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds151" + :channel (gui-channel daxter) + :flags #x7 + :speech #x5b + :text-message #x239 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "vin002" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x5c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "krew001" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x5d + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "krew002" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x5e + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds005" + :channel (gui-channel daxter) + :flags #x3 + :speech #x5f + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "bru001" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x60 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "tor001" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x61 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "tor002" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x62 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "vin003" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x63 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "vin004" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x64 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kor001" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x65 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kor002" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x66 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "tess001" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x67 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "whack01" + :channel (gui-channel message) + :speech #x68 + :text-message #x24e + :text-duration #xbb8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "vin015" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x69 + :delay #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kei029" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x6a + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "tor005" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x6b + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "vin013" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x6c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "asht006" + :channel (gui-channel voicebox) + :flags #x7 + :speech #x6d + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek002" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x6e + :delay #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "test001" + :channel (gui-channel message) + :speech #x6f + :text-message #x23d + :text-duration #x2328 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "sam001" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x70 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "asht001" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x71 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "str001" + :channel (gui-channel message) + :flags #x3 + :speech #x72 + :text-message #x239 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "str002" + :channel (gui-channel message) + :speech #x73 + :text-message #x239 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "note001" + :channel (gui-channel notice) + :speech #x74 + :text-message #x239 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ys002" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x75 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro01" + :channel (gui-channel notice) + :flags #x20 + :speech #x76 + :text-message #x254 + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro01e" + :channel (gui-channel notice) + :flags #x20 + :speech #x77 + :text-message #x255 + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro01j" + :channel (gui-channel notice) + :flags #x20 + :speech #x78 + :text-message #x257 + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro01k" + :channel (gui-channel notice) + :flags #x20 + :speech #x79 + :text-message #x256 + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro02" + :channel (gui-channel notice) + :flags #xa0 + :speech #x7a + :text-message #x258 + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro03" + :channel (gui-channel notice-low) + :speech #x7b + :text-message #x30c + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro04" + :channel (gui-channel notice) + :flags #x20 + :speech #x7c + :text-message #x25a + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss001" + :channel (gui-channel alert) + :flags #x40 + :speech #x7d + :text-message #x25c + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss002" + :channel (gui-channel alert) + :flags #x40 + :speech #x7e + :text-message #x261 + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss003" + :channel (gui-channel alert) + :flags #x40 + :speech #x7f + :text-message #x262 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss004" + :channel (gui-channel alert) + :flags #x40 + :speech #x80 + :text-message #x263 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss005" + :channel (gui-channel alert) + :flags #x40 + :speech #x81 + :text-message #x264 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss006" + :channel (gui-channel alert) + :flags #x40 + :speech #x82 + :text-message #x265 + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss007" + :channel (gui-channel alert) + :flags #x40 + :speech #x83 + :text-message #x266 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss008" + :channel (gui-channel alert) + :flags #x40 + :speech #x84 + :text-message #x267 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss009" + :channel (gui-channel alert) + :flags #x40 + :speech #x85 + :text-message #x268 + :text-duration #x5dc + :delay #xbb8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss010" + :channel (gui-channel alert) + :flags #x40 + :speech #x86 + :text-message #x269 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss011" + :channel (gui-channel alert) + :flags #x40 + :speech #x87 + :text-message #x25d + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss012" + :channel (gui-channel alert) + :flags #x40 + :speech #x88 + :text-message #x25e + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss013" + :channel (gui-channel alert) + :flags #x40 + :speech #x89 + :text-message #x25f + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss014" + :channel (gui-channel alert) + :flags #x40 + :speech #x8a + :text-message #x260 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "krew003" + :channel (gui-channel voicebox) + :flags #x3 + :speech #x8b + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek010" + :channel (gui-channel daxter) + :flags #x1 + :speech #x8c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek011" + :channel (gui-channel daxter) + :flags #x1 + :speech #x8d + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek012" + :channel (gui-channel daxter) + :flags #x1 + :speech #x8e + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek013" + :channel (gui-channel daxter) + :flags #x1 + :speech #x8f + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek014" + :channel (gui-channel daxter) + :flags #x1 + :speech #x90 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek015" + :channel (gui-channel daxter) + :speech #x91 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek016" + :channel (gui-channel daxter) + :flags #x1 + :speech #x92 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek017" + :channel (gui-channel daxter) + :flags #x1 + :speech #x93 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek018" + :channel (gui-channel daxter) + :flags #x1 + :speech #x94 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek019" + :channel (gui-channel daxter) + :flags #x1 + :speech #x95 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek020" + :channel (gui-channel daxter) + :flags #x1 + :speech #x96 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek021" + :channel (gui-channel daxter) + :flags #x1 + :speech #x97 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek022" + :channel (gui-channel daxter) + :flags #x1 + :speech #x98 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek023" + :channel (gui-channel daxter) + :flags #x1 + :speech #x99 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek024" + :channel (gui-channel daxter) + :flags #x1 + :speech #x9a + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek026" + :channel (gui-channel daxter) + :flags #x1 + :speech #x9b + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek027" + :channel (gui-channel daxter) + :flags #x1 + :speech #x9c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek028" + :channel (gui-channel daxter) + :flags #x1 + :speech #x9d + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek029" + :channel (gui-channel daxter) + :flags #x1 + :speech #x9e + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek030" + :channel (gui-channel daxter) + :flags #x1 + :speech #x9f + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek031" + :channel (gui-channel daxter) + :flags #x1 + :speech #xa0 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek033" + :channel (gui-channel daxter) + :speech #xa1 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek034" + :channel (gui-channel daxter) + :speech #xa2 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek035" + :channel (gui-channel daxter) + :speech #xa3 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek036" + :channel (gui-channel daxter) + :speech #xa4 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek037" + :channel (gui-channel daxter) + :speech #xa5 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek038" + :channel (gui-channel daxter) + :speech #xa6 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek039" + :channel (gui-channel daxter) + :speech #xa7 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek040" + :channel (gui-channel daxter) + :speech #xa8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "pek041" + :channel (gui-channel daxter) + :speech #xa9 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora006" + :channel (gui-channel alert) + :speech #xaa + :text-message #x26e + :text-duration #x5dc + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora007" + :channel (gui-channel alert) + :speech #xab + :text-message #x26e + :text-duration #x5dc + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora008" + :channel (gui-channel alert) + :speech #xac + :text-message #x26e + :text-duration #x5dc + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora009" + :channel (gui-channel alert) + :speech #xad + :text-message #x26f + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora010" + :channel (gui-channel alert) + :speech #xae + :text-message #x270 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora015" + :channel (gui-channel alert) + :speech #xaf + :text-message #x271 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora016" + :channel (gui-channel alert) + :speech #xb0 + :text-message #x272 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "notice01" + :channel (gui-channel notice-low) + :speech #xb1 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "notice02" + :channel (gui-channel notice-low) + :speech #xb2 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "notice03" + :channel (gui-channel notice-low) + :speech #xb3 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "notice04" + :channel (gui-channel notice-low) + :speech #xb4 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kor004" + :channel (gui-channel voicebox) + :flags #x3 + :speech #xb5 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv080" + :channel (gui-channel alert) + :flags #x2 + :speech #xb6 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds395" + :channel (gui-channel alert) + :flags #x2 + :speech #xb7 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "bru002" + :channel (gui-channel voicebox) + :flags #x3 + :speech #xb8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "bru004" + :channel (gui-channel voicebox) + :flags #x7 + :speech #xb9 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "bb01int" + :channel (gui-channel bbush) + :flags #x2 + :speech #xba + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "bb01fail" + :channel (gui-channel voicebox) + :flags #x2 + :speech #xbb + :neg #x1 + :on-close #f + ) + ) ) - (new 'static 'talker-speech-class - :name "DSbop004" - :channel #x14 - :flags #x3 - :speech #x4 - :text-message #x226 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "DSbop008" - :channel #x14 - :flags #x3 - :speech #x5 - :text-message #x227 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "DSbop009" :channel #x14 :flags #x3 :speech #x6 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "DSbop010" - :channel #x14 - :flags #x3 - :speech #x7 - :text-message #x227 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "DSbop011" :channel #x14 :flags #x3 :speech #x8 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "DSbop016" - :channel #x14 - :flags #x3 - :speech #x9 - :text-message #x229 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "DSbop017" :channel #x14 :flags #x3 :speech #xa :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "ds020" - :channel #x14 - :flags #x3 - :speech #xb - :text-message #x225 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ds043" - :channel #x14 - :flags #x11 - :speech #xc - :text-message #x228 - :text-duration #x12c - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ds043m" - :channel #x43 - :flags #x10 - :speech #xd - :text-message #x228 - :text-duration #x12c - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ds046" - :channel #x14 - :flags #x11 - :speech #xe - :text-message #x22a - :text-duration #x12c - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ds046m" - :channel #x43 - :flags #x10 - :speech #xf - :text-message #x22a - :text-duration #x12c - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "ds162" :channel #x14 :flags #x3 :speech #x10 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds165" :channel #x14 :flags #x3 :speech #x11 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "cityv039" - :channel #x20 - :flags #x3 - :speech #x12 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "cityv037" - :channel #x20 - :flags #x3 - :speech #x13 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "cityv056" - :channel #x20 - :flags #x3 - :speech #x14 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "cityv054" - :channel #x20 - :flags #x3 - :speech #x15 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "cityv055" - :channel #x20 - :flags #x3 - :speech #x16 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "cityv107" - :channel #x20 - :flags #x3 - :speech #x17 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "kg100a" :channel #x20 :flags #x3 :speech #x18 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "kg104a" :channel #x20 :flags #x3 :speech #x19 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "kg102a" :channel #x20 :flags #x3 :speech #x1a :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "kg071a" :channel #x20 :flags #x3 :speech #x1b :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "kg107a" :channel #x20 :flags #x3 :speech #x1c :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "kg097a" :channel #x20 :flags #x3 :speech #x1d :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "kg098a" :channel #x20 :flags #x3 :speech #x1e :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv063" :channel #x20 :speech #x1f :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv064" :channel #x20 :speech #x20 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv065" :channel #x20 :speech #x21 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv067" :channel #x20 :speech #x22 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv068" :channel #x20 :speech #x23 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "cityv069" - :channel #x20 - :speech #x24 - :text-message #x246 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "cityv070" :channel #x20 :speech #x25 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "cityv130" - :channel #x1d - :flags #x3 - :speech #x26 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "cityv132" - :channel #x1d - :flags #x3 - :speech #x27 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "cityv071" :channel #x20 :speech #x28 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv072" :channel #x20 :speech #x29 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv073" :channel #x20 :speech #x2a :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv074" :channel #x20 :speech #x2b :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv075" :channel #x20 :speech #x2c :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv076" :channel #x20 :speech #x2d :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv077" :channel #x20 :speech #x2e :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv078" :channel #x20 :speech #x2f :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "cityv036" :channel #x20 :speech #x30 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "tor007" :channel #x1d :flags #x3 :speech #x31 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "tor008" :channel #x1d :flags #x3 :speech #x32 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "mess004" - :channel #x43 - :flags #x7 - :speech #x33 - :text-message #x245 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "krew010" - :channel #x1d - :flags #x7 - :speech #x34 - :delay #x258 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "ds129" :channel #x14 :flags #x2 :speech #x35 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "mess005" - :channel #x43 - :flags #x3 - :speech #x36 - :text-message #x247 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "mess006" - :channel #x43 - :speech #x37 - :text-message #x226 - :text-duration #x5dc - :pos #x8 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "ds116" :channel #x14 :flags #x2 :speech #x38 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds117" :channel #x14 :flags #x3 :speech #x39 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds118" :channel #x14 :flags #x3 :speech #x3a :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds119" :channel #x14 :flags #x3 :speech #x3b :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds120" :channel #x14 :flags #x3 :speech #x3c :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds121" :channel #x14 :flags #x3 :speech #x3d :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "daxm007" :channel #x14 :flags #x3 :speech #x3e :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "daxm008" :channel #x14 :flags #x3 :speech #x3f :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "daxm009" :channel #x14 :flags #x3 :speech #x40 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "daxm010" :channel #x14 :flags #x3 :speech #x41 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "pek001" - :channel #x1d - :flags #x3 - :speech #x42 - :delay #x4b0 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ds006" - :channel #x14 - :flags #x3 - :speech #x43 - :delay #xbb8 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "ds029" :channel #x14 :flags #x2 :speech #x44 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds030" :channel #x14 :flags #x2 :speech #x45 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds031" :channel #x14 :flags #x2 :speech #x46 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds032" :channel #x14 :flags #x2 :speech #x47 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "ds007" - :channel #x14 - :flags #x3 - :speech #x48 - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "ds372" :channel #x14 :flags #x3 :speech #x49 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "vin011" - :channel #x1d - :flags #x3 - :speech #x4a - :delay #x258 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "ds009" :channel #x14 :flags #x3 :speech #x4b :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "demo001" - :channel #x43 - :flags #x3 - :speech #x4c - :text-message #x23d - :text-duration #xbb8 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "demo002" - :channel #x43 - :flags #x3 - :speech #x4d - :text-message #x22b - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "demo003" - :channel #x43 - :flags #x3 - :speech #x4e - :text-message #x252 - :text-duration #x960 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "demo004" - :channel #x43 - :flags #x3 - :speech #x4f - :text-message #x253 - :text-duration #x960 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "demo005" - :channel #x43 - :flags #x3 - :speech #x50 - :text-message #x226 - :text-duration #x960 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "kei026" - :channel #x1d - :flags #x3 - :speech #x51 - :delay #x1770 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "kei018" - :channel #x1d - :flags #x3 - :speech #x52 - :text-message #x241 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "DSfor001" - :channel #x14 - :flags #x3 - :speech #x53 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "ds017" :channel #x14 :flags #x3 :speech #x54 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds018" :channel #x14 :flags #x3 :speech #x55 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds019" :channel #x14 :flags #x3 :speech #x56 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds350" :channel #x14 :flags #x2 :speech #x57 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "ds016" :channel #x14 :flags #x3 :speech #x58 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "sigf001" :channel #x1d :flags #x7 :speech #x59 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "ys001" - :channel #x1d - :flags #x7 - :speech #x5a - :delay #x708 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ds151" - :channel #x14 - :flags #x7 - :speech #x5b - :text-message #x239 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "vin002" :channel #x1d :flags #x7 :speech #x5c :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "krew001" :channel #x1d :flags #x3 :speech #x5d :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "krew002" - :channel #x1d - :flags #x7 - :speech #x5e - :delay #x258 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "ds005" :channel #x14 :flags #x3 :speech #x5f :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "bru001" :channel #x1d :flags #x3 :speech #x60 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "tor001" - :channel #x1d - :flags #x7 - :speech #x61 - :delay #x708 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "tor002" - :channel #x1d - :flags #x7 - :speech #x62 - :delay #x708 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "vin003" - :channel #x1d - :flags #x7 - :speech #x63 - :delay #x708 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "vin004" - :channel #x1d - :flags #x3 - :speech #x64 - :delay #x708 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "kor001" - :channel #x1d - :flags #x7 - :speech #x65 - :delay #x708 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "kor002" - :channel #x1d - :flags #x7 - :speech #x66 - :delay #x708 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "tess001" :channel #x1d :flags #x7 :speech #x67 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "whack01" - :channel #x43 - :speech #x68 - :text-message #x24e - :text-duration #xbb8 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "vin015" - :channel #x1d - :flags #x7 - :speech #x69 - :delay #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "kei029" :channel #x1d :flags #x7 :speech #x6a :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "tor005" :channel #x1d :flags #x7 :speech #x6b :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "vin013" :channel #x1d :flags #x7 :speech #x6c :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "asht006" :channel #x1d :flags #x7 :speech #x6d :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "pek002" - :channel #x1d - :flags #x3 - :speech #x6e - :delay #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "test001" - :channel #x43 - :speech #x6f - :text-message #x23d - :text-duration #x2328 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "sam001" :channel #x1d :flags #x3 :speech #x70 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "asht001" - :channel #x1d - :flags #x3 - :speech #x71 - :delay #x708 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "str001" - :channel #x43 - :flags #x3 - :speech #x72 - :text-message #x239 - :text-duration #x960 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "str002" - :channel #x43 - :speech #x73 - :text-message #x239 - :text-duration #x960 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "note001" - :channel #x44 - :speech #x74 - :text-message #x239 - :text-duration #x960 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "ys002" :channel #x1d :flags #x3 :speech #x75 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "intro01" - :channel #x44 - :flags #x20 - :speech #x76 - :text-message #x254 - :text-duration #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "intro01e" - :channel #x44 - :flags #x20 - :speech #x77 - :text-message #x255 - :text-duration #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "intro01j" - :channel #x44 - :flags #x20 - :speech #x78 - :text-message #x257 - :text-duration #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "intro01k" - :channel #x44 - :flags #x20 - :speech #x79 - :text-message #x256 - :text-duration #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "intro02" - :channel #x44 - :flags #xa0 - :speech #x7a - :text-message #x258 - :text-duration #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "intro03" - :channel #x47 - :speech #x7b - :text-message #x30c - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "intro04" - :channel #x44 - :flags #x20 - :speech #x7c - :text-message #x25a - :text-duration #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss001" - :channel #x20 - :flags #x40 - :speech #x7d - :text-message #x25c - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss002" - :channel #x20 - :flags #x40 - :speech #x7e - :text-message #x261 - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss003" - :channel #x20 - :flags #x40 - :speech #x7f - :text-message #x262 - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss004" - :channel #x20 - :flags #x40 - :speech #x80 - :text-message #x263 - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss005" - :channel #x20 - :flags #x40 - :speech #x81 - :text-message #x264 - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss006" - :channel #x20 - :flags #x40 - :speech #x82 - :text-message #x265 - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss007" - :channel #x20 - :flags #x40 - :speech #x83 - :text-message #x266 - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss008" - :channel #x20 - :flags #x40 - :speech #x84 - :text-message #x267 - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss009" - :channel #x20 - :flags #x40 - :speech #x85 - :text-message #x268 - :text-duration #x5dc - :delay #xbb8 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss010" - :channel #x20 - :flags #x40 - :speech #x86 - :text-message #x269 - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss011" - :channel #x20 - :flags #x40 - :speech #x87 - :text-message #x25d - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss012" - :channel #x20 - :flags #x40 - :speech #x88 - :text-message #x25e - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss013" - :channel #x20 - :flags #x40 - :speech #x89 - :text-message #x25f - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "miss014" - :channel #x20 - :flags #x40 - :speech #x8a - :text-message #x260 - :text-duration #x5dc - :delay #x384 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "krew003" - :channel #x1d - :flags #x3 - :speech #x8b - :delay #x708 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "pek010" :channel #x14 :flags #x1 :speech #x8c :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek011" :channel #x14 :flags #x1 :speech #x8d :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek012" :channel #x14 :flags #x1 :speech #x8e :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek013" :channel #x14 :flags #x1 :speech #x8f :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek014" :channel #x14 :flags #x1 :speech #x90 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek015" :channel #x14 :speech #x91 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek016" :channel #x14 :flags #x1 :speech #x92 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek017" :channel #x14 :flags #x1 :speech #x93 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek018" :channel #x14 :flags #x1 :speech #x94 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek019" :channel #x14 :flags #x1 :speech #x95 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek020" :channel #x14 :flags #x1 :speech #x96 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek021" :channel #x14 :flags #x1 :speech #x97 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek022" :channel #x14 :flags #x1 :speech #x98 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek023" :channel #x14 :flags #x1 :speech #x99 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek024" :channel #x14 :flags #x1 :speech #x9a :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek026" :channel #x14 :flags #x1 :speech #x9b :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek027" :channel #x14 :flags #x1 :speech #x9c :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek028" :channel #x14 :flags #x1 :speech #x9d :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek029" :channel #x14 :flags #x1 :speech #x9e :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek030" :channel #x14 :flags #x1 :speech #x9f :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek031" :channel #x14 :flags #x1 :speech #xa0 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek033" :channel #x14 :speech #xa1 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek034" :channel #x14 :speech #xa2 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek035" :channel #x14 :speech #xa3 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek036" :channel #x14 :speech #xa4 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek037" :channel #x14 :speech #xa5 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek038" :channel #x14 :speech #xa6 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek039" :channel #x14 :speech #xa7 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek040" :channel #x14 :speech #xa8 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "pek041" :channel #x14 :speech #xa9 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "ora006" - :channel #x20 - :speech #xaa - :text-message #x26e - :text-duration #x5dc - :delay #x258 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ora007" - :channel #x20 - :speech #xab - :text-message #x26e - :text-duration #x5dc - :delay #x258 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ora008" - :channel #x20 - :speech #xac - :text-message #x26e - :text-duration #x5dc - :delay #x258 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ora009" - :channel #x20 - :speech #xad - :text-message #x26f - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ora010" - :channel #x20 - :speech #xae - :text-message #x270 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ora015" - :channel #x20 - :speech #xaf - :text-message #x271 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "ora016" - :channel #x20 - :speech #xb0 - :text-message #x272 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "notice01" - :channel #x47 - :speech #xb1 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "notice02" - :channel #x47 - :speech #xb2 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "notice03" - :channel #x47 - :speech #xb3 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class - :name "notice04" - :channel #x47 - :speech #xb4 - :text-duration #x5dc - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "kor004" :channel #x1d :flags #x3 :speech #xb5 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "cityv080" - :channel #x20 - :flags #x2 - :speech #xb6 - :neg #x1 - :on-close #f - ) - (new 'static 'talker-speech-class :name "ds395" :channel #x20 :flags #x2 :speech #xb7 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "bru002" :channel #x1d :flags #x3 :speech #xb8 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "bru004" :channel #x1d :flags #x7 :speech #xb9 :neg #x1 :on-close #f) - (new 'static 'talker-speech-class :name "bb01int" :channel #x22 :flags #x2 :speech #xba :neg #x1 :on-close #f) - (new 'static 'talker-speech-class - :name "bb01fail" - :channel #x1d - :flags #x2 - :speech #xbb - :neg #x1 - :on-close #f - ) - ) - ) - ) diff --git a/test/decompiler/reference/jak2/engine/anim/joint-h_REF.gc b/test/decompiler/reference/jak2/engine/anim/joint-h_REF.gc index 97292e8e6..d5edef8ac 100644 --- a/test/decompiler/reference/jak2/engine/anim/joint-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/joint-h_REF.gc @@ -82,34 +82,34 @@ ;; definition of type top-anim-joint-control (deftype top-anim-joint-control (basic) - ((process uint32 :offset-assert 4) - (interp-select uint64 2 :offset-assert 8) - (base-anim basic :offset-assert 24) - (base-anim-speed float :offset-assert 28) - (base-anim-blend float :offset-assert 32) - (interp float :offset-assert 36) - (frame-group art-joint-anim :offset-assert 40) - (frame-group-push basic :offset-assert 44) - (frame-num float :offset-assert 48) - (frame-targ basic :offset-assert 52) - (frame-speed float :offset-assert 56) - (frame-blend float :offset-assert 60) - (frame-cur-blend float :offset-assert 64) - (frame-start float :offset-assert 68) - (frame-post-blend float :offset-assert 72) - (frame-post-end float :offset-assert 76) - (frame-push-time time-frame :offset-assert 80) - (frame-post-put-away basic :offset-assert 88) - (update-time time-frame :offset-assert 96) + ((process (pointer process-drawable) :offset-assert 4) + (interp-select uint64 2 :offset-assert 8) + (base-anim basic :offset-assert 24) + (base-anim-speed float :offset-assert 28) + (base-anim-blend float :offset-assert 32) + (interp float :offset-assert 36) + (frame-group art-joint-anim :offset-assert 40) + (frame-group-push basic :offset-assert 44) + (frame-num float :offset-assert 48) + (frame-targ basic :offset-assert 52) + (frame-speed float :offset-assert 56) + (frame-blend float :offset-assert 60) + (frame-cur-blend float :offset-assert 64) + (frame-start float :offset-assert 68) + (frame-post-blend float :offset-assert 72) + (frame-post-end float :offset-assert 76) + (frame-push-time time-frame :offset-assert 80) + (frame-post-put-away basic :offset-assert 88) + (update-time time-frame :offset-assert 96) ) :method-count-assert 13 :size-assert #x68 :flag-assert #xd00000068 (:methods - (top-anim-joint-control-method-9 () none 9) - (top-anim-joint-control-method-10 () none 10) - (top-anim-joint-control-method-11 () none 11) - (top-anim-joint-control-method-12 () none 12) + (top-anim-joint-control-method-9 (_type_) none 9) + (top-anim-joint-control-method-10 (_type_) none 10) + (top-anim-joint-control-method-11 (_type_ int) joint-control-channel 11) + (top-anim-joint-control-method-12 (_type_ art-element float int int float float symbol) none 12) ) ) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc index d693998b1..4a2b4a778 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc @@ -1310,7 +1310,7 @@ (collide-shape-method-29 (_type_ vector) none 29) (collide-shape-method-30 () none 30) (collide-shape-method-31 () none 31) - (collide-shape-method-32 (_type_ vector uint int) none 32) + (collide-shape-method-32 (_type_ vector collide-query meters) none 32) (collide-shape-method-33 () none 33) (collide-shape-method-34 () none 34) (collide-shape-method-35 () none 35) @@ -1614,7 +1614,7 @@ :flag-assert #x44000001dc (:methods (new (symbol type process-drawable collide-list-enum) _type_ 0) - (collide-shape-moving-method-55 (_type_) symbol 55) + (collide-shape-moving-method-55 (_type_ collide-query collide-spec float float float) symbol 55) (collide-shape-moving-method-56 () none 56) (collide-shape-moving-method-57 () none 57) (collide-shape-moving-method-58 () none 58) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-target-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-target-h_REF.gc index 911a5710f..36435e39c 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-target-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-target-h_REF.gc @@ -25,7 +25,8 @@ (unknown-word00 int32 :offset 3712) (unknown-vector04 vector :inline :offset 3728) (unknown-vector05 vector :inline :offset 3744) - (unknown-vector06 vector :inline :offset 3776) + (unknown-vector06 vector :inline :offset 3760) + (unknown-vector07 vector :inline :offset 3776) (unknown-dynamics00 dynamics :offset 3824) (unknown-surface00 surface :offset 3828) (unknown-surface01 surface :offset 3832) @@ -36,10 +37,10 @@ (unknown-float09 float :offset 3856) (unknown-float10 float :offset 3860) (unknown-float11 float :offset 3864) - (unknown-vector07 vector :inline :offset 3872) - (unknown-vector08 vector :inline :offset 3888) - (unknown-vector09 vector :inline :offset 3904) - (unknown-vector10 vector :inline :offset 3920) + (unknown-vector08 vector :inline :offset 3872) + (unknown-vector09 vector :inline :offset 3888) + (unknown-vector10 vector :inline :offset 3904) + (unknown-vector11 vector :inline :offset 3920) (unknown-vector-array01 vector 7 :inline :offset 3936) (unknown-vector12 vector :inline :offset 4064) (unknown-vector13 vector :inline :offset 4080) @@ -73,75 +74,121 @@ (unknown-float19 float :offset 4644) (unknown-float20 float :offset 4648) (unknown-time-frame06 time-frame :offset 4656) + (unknown-float21 float :offset 4664) (unknown-time-frame07 time-frame :offset 4672) (unknown-pat-surface00 pat-surface :offset 4680) (unknown-vector24 vector :inline :offset 4688) (unknown-vector25 vector :inline :offset 4720) - (unknown-handle01 handle :offset 4768) + (unknown-handle00 handle :offset 4768) (unknown-pat-surface01 pat-surface :offset 4776) - (unknown-float21 float :offset 4780) - (unknown-float22 float :offset 4784) - (unknown-float23 float :offset 4788) - (unknown-float24 float :offset 4792) - (unknown-float25 float :offset 4796) + (unknown-float22 float :offset 4780) + (unknown-float23 float :offset 4784) + (unknown-float24 float :offset 4788) + (unknown-float25 float :offset 4792) + (unknown-float26 float :offset 4796) (unknown-time-frame08 time-frame :offset 4816) (unknown-vector26 vector :inline :offset 4928) (unknwon-vector27 vector :inline :offset 4976) - (unknown-float26 float :offset 4992) + (unknown-float27 float :offset 4992) (unknown-time-frame09 time-frame :offset 5000) (unknown-sphere-array00 collide-shape-prim-sphere 10 :offset 5016) - (unknown-float27 float :offset 5132) - (unknown-float28 float :offset 5136) - (unknown-float29 float :offset 5140) + (unknown-word02 int32 :offset 5064) + (unknown-time-frame10 time-frame :offset 5072) + (unknown-time-frame11 time-frame :offset 5080) + (unknown-time-frame12 time-frame :offset 5096) + (unknown-time-frame13 time-frame :offset 5112) + (unknown-time-frame14 time-frame :offset 5120) + (unknown-float28 float :offset 5132) + (unknown-float29 float :offset 5136) + (unknown-float30 float :offset 5140) (unknown-vector28 vector :inline :offset 5152) (unknown-vector29 vector :inline :offset 5168) (unknown-vector30 vector :inline :offset 5184) (unknown-vector31 vector :inline :offset 5200) (unknown-vector32 vector :inline :offset 5216) (unknown-vector33 vector :inline :offset 5232) + (unknown-symbol00 symbol :offset 5248) + (unknown-float000 float :offset 5252) (unknown-float31 float :offset 5256) (unknown-vector-array02 vector 15 :inline :offset 5264) (unknown-float32 float :offset 5520) - (unknown-word02 int32 :offset 5524) + (unknown-word03 int32 :offset 5524) (unknown-float33 float :offset 5528) (unknown-vector34 vector :inline :offset 5536) - (unknown-vector35 vector :inline :offset 5568) - (unknown-time-frame10 time-frame :offset 5584) - (unknown-time-frame11 time-frame :offset 5592) - (unknown-handle00 handle :offset 5608) - (unknown-symbol00 symbol :offset 5620) - (unknown-cspace02 cspace :inline :offset 5824) - (unknown-vector36 vector :inline :offset 5904) - (unknown-float34 float :offset 5908) - (unknown-vector37 vector :inline :offset 5920) - (unknown-float35 float :offset 5924) - (unknown-time-frame12 time-frame :offset 5944) - (unknown-dword05 uint64 :offset 6008) - (unknown-symbol01 symbol :offset 6144) + (unknown-vector35 vector :inline :offset 5552) + (unknown-vector36 vector :inline :offset 5568) + (unknown-time-frame15 time-frame :offset 5584) + (unknown-time-frame16 time-frame :offset 5592) + (unknown-handle01 handle :offset 5608) + (unknown-word04 uint32 :offset 5616) + (unknown-spool-anim00 spool-anim :offset 5616) + (unknown-word05 int32 :offset 5616) + (unknown-symbol01 symbol :offset 5616) + (unknown-float34 float :offset 5616) + (unknown-symbol02 float :offset 5620) + (unknown-symbol03 float :offset 5624) + (unknown-float35 float :offset 5628) + (unknown-float36 float :offset 5632) + (unknown-float37 float :offset 5636) + (unknown-vector37 vector :inline :offset 5648) + (unknown-vector38 vector :inline :offset 5664) + (unknown-vector39 vector :inline :offset 5680) + (unknown-vector40 vector :inline :offset 5696) + (unknown-time-frame17 time-frame :offset 5712) + (unknown-time-frame18 time-frame :offset 5720) + (unknown-sound-id00 sound-id :offset 5776) + (unknown-handle02 handle :offset 5792) + (unknown-impact-control00 impact-control :inline :offset 5824) + (unknown-word06 int32 :offset 5832) + (unknown-vector41 vector :inline :offset 5888) + (unknown-vector42 vector :inline :offset 5904) + (unknown-float38 float :offset 5908) + (unknown-vector43 vector :inline :offset 5920) + (unknown-float39 float :offset 5924) + (unknown-time-frame19 time-frame :offset 5936) + (unknown-time-frame20 time-frame :offset 5944) + (unknown-symbol04 symbol :offset 5984) + (unknown-symbol05 symbol :offset 5988) + (unknown-dword05 uint64 :offset 6000) + (unknown-dword06 uint64 :offset 6008) + (unknown-combo-tracker00 combo-tracker :inline :offset 6032) + (unknown-time-frame21 time-frame :offset 6072) + (unknown-dword07 int64 :offset 6096) + (unknown-dword08 int64 :offset 6104) + (unknown-dword09 int64 :offset 6112) + (unknown-dword10 int64 :offset 6120) + (unknown-symbol06 symbol :offset 6144) + (unknown-quaternion04 quaternion :inline :offset 6160) + (unknown-sound-id01 sound-id :offset 6176) + (unknown-float40 float :offset 6180) + (unknown-float41 float :offset 6184) (unknown-halfword00 uint16 :offset 6188) (history-length uint16 :offset 6190) - (unknown-word03 int32 :offset 6192) - (unknown-time-frame13 time-frame :offset 6200) - (unknown-time-frame14 time-frame :offset 6208) - (unknown-time-frame15 time-frame :offset 6216) - (unknown-time-frame16 time-frame :offset 6224) - (unknown-time-frame17 time-frame :offset 6248) - (unknown-time-frame18 time-frame :offset 6256) - (unknown-dword06 int64 :offset 6264) - (unknown-sound-id00 sound-id :offset 6240) - (unknown-sound-id01 sound-id :offset 6244) - (unknown-sound-id02 sound-id :offset 6292) - (unknown-word04 int32 :offset 6300) - (unknown-word05 int32 :offset 6304) - (unknown-word06 int32 :offset 6308) - (unknown-word07 int32 :offset 6312) - (unknown-time-frame19 time-frame :offset 6320) - (unknown-time-frame20 time-frame :offset 6328) - (unknown-dword07 int64 :offset 6336) - (unknown-time-frame21 time-frame :offset 6368) - (unknown-quaternion04 quaternion :inline :offset 6384) - (unknown-time-frame22 time-frame :offset 6400) - (unknown-time-frame23 time-frame :offset 6408) + (unknown-word07 int32 :offset 6192) + (unknown-time-frame22 time-frame :offset 6200) + (unknown-time-frame23 time-frame :offset 6208) + (unknown-time-frame24 time-frame :offset 6216) + (unknown-time-frame25 time-frame :offset 6224) + (unknown-float42 float :offset 6232) + (unknown-sound-id02 sound-id :offset 6240) + (unknown-sound-id03 sound-id :offset 6244) + (unknown-time-frame26 time-frame :offset 6248) + (unknown-time-frame27 time-frame :offset 6256) + (unknown-dword11 int64 :offset 6264) + (unknown-vector44 vector :inline :offset 6272) + (unknown-float43 float :offset 6288) + (unknown-sound-id04 sound-id :offset 6292) + (unknown-word08 int32 :offset 6300) + (unknown-word09 int32 :offset 6304) + (unknown-word10 int32 :offset 6308) + (unknown-word11 int32 :offset 6312) + (unknown-time-frame28 time-frame :offset 6320) + (unknown-time-frame29 time-frame :offset 6328) + (unknown-dword12 int64 :offset 6336) + (unknown-time-frame30 time-frame :offset 6368) + (unknown-quaternion05 quaternion :inline :offset 6384) + (unknown-time-frame31 time-frame :offset 6400) + (unknown-time-frame32 time-frame :offset 6408) (pad uint8 :offset 6415) ) :method-count-assert 68 diff --git a/test/decompiler/reference/jak2/engine/collide/collide-touch-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-touch-h_REF.gc index 3dfb25e4e..4d7dbbac2 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-touch-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-touch-h_REF.gc @@ -145,7 +145,7 @@ (get-head (_type_) touching-prims-entry 9) (get-next (_type_ touching-shapes-entry) touching-prims-entry 10) (touching-shapes-entry-method-11 () none 11) - (touching-shapes-entry-method-12 () none 12) + (touching-shapes-entry-method-12 (_type_ collide-shape uint) touching-prims-entry 12) (touching-shapes-entry-method-13 () none 13) (touching-shapes-entry-method-14 () none 14) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/generic-obs-h_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/generic-obs-h_REF.gc index 0611b53d2..e784496fd 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/generic-obs-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/generic-obs-h_REF.gc @@ -166,22 +166,22 @@ ;; definition of type lightning-tracker (deftype lightning-tracker (process) - ((root basic :offset-assert 128) - (lightning basic :offset-assert 132) - (callback basic :offset-assert 136) - (duration uint64 :offset-assert 144) - (start-time time-frame :offset-assert 152) - (offset0 vector :inline :offset-assert 160) - (offset1 vector :inline :offset-assert 176) - (target0 uint64 :offset-assert 192) - (target1 uint64 :offset-assert 200) - (target-joint0 int32 :offset-assert 208) - (target-joint1 int32 :offset-assert 212) - (sound uint32 :offset-assert 216) - (userdata uint64 :offset-assert 224) - (user-time time-frame 2 :offset-assert 232) - (user-vector vector :inline :offset-assert 256) - (user-handle handle 2 :offset 288) + ((root basic :offset-assert 128) + (lightning lightning-spec :offset-assert 132) + (callback basic :offset-assert 136) + (duration uint64 :offset-assert 144) + (start-time time-frame :offset-assert 152) + (offset0 vector :inline :offset-assert 160) + (offset1 vector :inline :offset-assert 176) + (target0 uint64 :offset-assert 192) + (target1 uint64 :offset-assert 200) + (target-joint0 int32 :offset-assert 208) + (target-joint1 int32 :offset-assert 212) + (sound uint32 :offset-assert 216) + (userdata uint64 :offset-assert 224) + (user-time time-frame 2 :offset-assert 232) + (user-vector vector :inline :offset-assert 256) + (user-handle handle 2 :offset 288) ) :heap-base #xb0 :method-count-assert 17 @@ -599,7 +599,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/common_objs/water-h_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/water-h_REF.gc index bcfffcddf..093682832 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/water-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/water-h_REF.gc @@ -186,7 +186,7 @@ (water-control-method-10 () none 10) (water-control-method-11 () none 11) (distance-from-surface (_type_) float 12) - (water-control-method-13 () none 13) + (water-control-method-13 (_type_ float vector int vector symbol) none 13) (display-water-marks? (_type_) symbol 14) (water-control-method-15 () none 15) (water-control-method-16 () none 16) diff --git a/test/decompiler/reference/jak2/engine/game/effect-control-h_REF.gc b/test/decompiler/reference/jak2/engine/game/effect-control-h_REF.gc index 402f2a7e3..cd9e97258 100644 --- a/test/decompiler/reference/jak2/engine/game/effect-control-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/effect-control-h_REF.gc @@ -20,7 +20,7 @@ (effect-control-method-9 () none 9) (effect-control-method-10 () none 10) (effect-control-method-11 () none 11) - (effect-control-method-12 () none 12) + (effect-control-method-12 (_type_ symbol float int basic sound-name) int 12) (set-channel-offset! (_type_ int) none 13) (effect-control-method-14 () none 14) ) diff --git a/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc b/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc index f8570997e..df213e44d 100644 --- a/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc @@ -37,139 +37,160 @@ ;; definition of type board-info (deftype board-info (basic) - ((board (pointer board) :offset-assert 4) - (camera-interp float :offset-assert 8) - (process (pointer target) :offset-assert 12) - (board-trans vector :inline :offset-assert 16) - (board-quat vector :inline :offset-assert 32) - (board-scale vector :inline :offset-assert 48) - (main joint-mod :offset-assert 64) - (upper-body basic :offset-assert 68) - (sound-bank-knob float :offset-assert 72) - (sound-air-knob float :offset-assert 76) - (wind-sound-id uint32 :offset-assert 80) - (wind-sound-pitch float :offset-assert 84) - (wind-sound-volume float :offset-assert 88) - (engine-sound-id uint32 :offset-assert 92) - (engine-sound-pitch float :offset-assert 96) - (engine-sound-volume float :offset-assert 100) - (bank-sound-id uint32 :offset-assert 104) - (bank-sound-pitch float :offset-assert 108) - (bank-sound-volume float :offset-assert 112) - (ride-sound-id uint32 :offset-assert 116) - (spin-sound-id uint32 :offset-assert 120) - (spin-sound-volume float :offset-assert 124) - (spin-sound-pitch float :offset-assert 128) - (up-vector vector 2 :inline :offset-assert 144) - (slow-transv vector :inline :offset-assert 176) - (board-time time-frame :offset-assert 192) - (board-get-on-time time-frame :offset-assert 200) - (in-air-time time-frame :offset-assert 208) - (stick-lock basic :offset 240) - (stick-off basic :offset-assert 244) - (stance-info ground-tween-info :inline :offset-assert 248) - (mods-backup basic :offset-assert 284) - (attack-id uint32 :offset-assert 288) - (latch? symbol :offset-assert 292) - (unstuck-time time-frame :offset 344) - (stuck-count int32 :offset-assert 352) - (thrust-scale float :offset-assert 356) - (flip-time time-frame :offset-assert 360) - (transv-max meters :offset-assert 368) - (turn-anim-tilt? symbol :offset-assert 372) - (turn-anim-mag float :offset-assert 376) - (turn-anim-targ float :offset-assert 380) - (turn-anim-frame float :offset-assert 384) - (turn-anim-vel float :offset-assert 388) - (turn-anim-duck float :offset-assert 392) - (turn-anim-duck-vel float :offset-assert 396) - (tilt-anim-frame vector :inline :offset-assert 400) - (tilt-anim-target vector :inline :offset-assert 416) - (smack-surface-time time-frame :offset-assert 432) - (smack-speed meters :offset-assert 440) - (smack-normal vector :inline :offset-assert 448) - (glance-time time-frame :offset-assert 464) - (glance-speed meters :offset-assert 472) - (glance-in-transv vector :inline :offset-assert 480) - (glance-out-transv vector :inline :offset-assert 496) - (glance-normal vector :inline :offset-assert 512) - (on-flat-time time-frame :offset-assert 528) - (jump-land-time time-frame :offset-assert 536) - (slip-factor float :offset-assert 544) - (ground-on-dir vector :inline :offset-assert 560) - (ride-time time-frame :offset-assert 576) - (ride-start-time time-frame :offset-assert 584) - (ride-button-time time-frame :offset-assert 592) - (ride-lean-targ float :offset-assert 600) - (ride-lean float :offset-assert 604) - (ride-leanv float :offset-assert 608) - (ride-lean-mag float :offset-assert 612) - (ride-tilt-targ float :offset-assert 616) - (ride-tilt float :offset-assert 620) - (ride-tiltv float :offset-assert 624) - (ride-tilt-mag float :offset-assert 628) - (ride-lock symbol :offset-assert 632) - (ride-lock-on symbol :offset-assert 636) - (ride-speed meters :offset-assert 640) - (ride-mode uint32 :offset-assert 644) - (ride-rot degrees :offset-assert 648) - (ride-rot-old degrees :offset-assert 652) - (ride-rot-abs degrees 2 :offset-assert 656) - (ride-rtv-abs degrees :offset-assert 664) - (ride-touch-segment vector 2 :inline :offset-assert 672) - (ride-dir vector :inline :offset-assert 704) - (ride-vertex-length int16 :offset-assert 720) - (ride-vertex-length-old int16 :offset-assert 722) - (ride-vertex-base int16 :offset-assert 724) - (ride-vertex-base2 int16 :offset-assert 726) - (ride-vertex-index float :offset-assert 728) - (ride-vertex-index2 float :offset-assert 732) - (ride-vertex-index-old float :offset-assert 736) - (ride-vertex vector 3 :inline :offset-assert 752) - (ride-segment vector :inline :offset-assert 800) - (ride-dir-lean vector :inline :offset-assert 816) - (ride-pad-vector vector 1 :inline :offset-assert 832) - (ride-vertex-old vector 3 :inline :offset-assert 848) - (ride-segment-old vector :inline :offset-assert 896) - (ride-vertex-trail vector 128 :inline :offset-assert 912) - (halfpipe-side-time time-frame :offset-assert 2960) - (halfpipe-jump-time time-frame :offset-assert 2968) - (halfpipe-lip-time time-frame :offset-assert 2976) - (halfpipe-time time-frame :offset-assert 2984) - (halfpipe-gspot-time time-frame :offset-assert 2992) - (halfpipe-lip-event symbol :offset-assert 3000) - (spin-check-time time-frame :offset-assert 3008) - (spin-time time-frame :offset-assert 3016) - (spin-start-time time-frame :offset-assert 3024) - (spin-start-dir vector :inline :offset-assert 3040) - (spin-control float :offset-assert 3056) - (spin-ground-start-time time-frame :offset-assert 3064) - (spin-ground-time time-frame :offset-assert 3072) - (spin-ground-press-time time-frame :offset-assert 3080) - (flip-control float :offset-assert 3088) - (flip-count int32 :offset-assert 3092) - (trickx-count int32 :offset 3144) - (trotyv-max degrees :offset-assert 3148) - (trotyv degrees :offset-assert 3152) - (troty degrees :offset-assert 3156) - (troty-cum degrees :offset-assert 3160) - (upper-body-rotyv-max degrees :offset 3168) - (upper-body-rotyv degrees :offset-assert 3172) - (upper-body-roty degrees :offset-assert 3176) - (cushion-base meters :offset-assert 3180) - (cushion-offset meters :offset-assert 3184) - (shock-offset meters :offset-assert 3188) - (shock-offsetv meters :offset-assert 3192) - (shock-rotx meters :offset-assert 3196) - (trick-count int32 :offset 3204) - (pad uint8 :offset 3399) + ((board (pointer board) :offset-assert 4) + (camera-interp float :offset-assert 8) + (process (pointer target) :offset-assert 12) + (board-trans vector :inline :offset-assert 16) + (board-quat vector :inline :offset-assert 32) + (board-scale vector :inline :offset-assert 48) + (main joint-mod :offset-assert 64) + (upper-body joint-mod :offset-assert 68) + (sound-bank-knob float :offset-assert 72) + (sound-air-knob float :offset-assert 76) + (wind-sound-id uint32 :offset-assert 80) + (wind-sound-pitch float :offset-assert 84) + (wind-sound-volume float :offset-assert 88) + (engine-sound-id uint32 :offset-assert 92) + (engine-sound-pitch float :offset-assert 96) + (engine-sound-volume float :offset-assert 100) + (bank-sound-id uint32 :offset-assert 104) + (bank-sound-pitch float :offset-assert 108) + (bank-sound-volume float :offset-assert 112) + (ride-sound-id uint32 :offset-assert 116) + (spin-sound-id uint32 :offset-assert 120) + (spin-sound-volume float :offset-assert 124) + (spin-sound-pitch float :offset-assert 128) + (unknown-sound-id00 sound-id :offset-assert 132) + (unknown-sound-id01 sound-id :offset-assert 136) + (unknown-sound-id02 sound-id :offset-assert 140) + (up-vector vector 2 :inline :offset-assert 144) + (slow-transv vector :inline :offset-assert 176) + (board-time time-frame :offset-assert 192) + (board-get-on-time time-frame :offset-assert 200) + (in-air-time time-frame :offset-assert 208) + (unknown-time-frame00 time-frame :offset-assert 216) + (unknown-time-frame01 time-frame :offset 224) + (unknown-time-frame02 time-frame :offset 232) + (stick-lock symbol :offset 240) + (stick-off symbol :offset-assert 244) + (stance-info ground-tween-info :inline :offset-assert 248) + (mods-backup basic :offset-assert 284) + (attack-id uint32 :offset-assert 288) + (latch? symbol :offset-assert 292) + (unknown-vector00 vector :inline :offset 304) + (unknown-vector01 vector :inline :offset 320) + (unknown-int00 uint32 :offset 336) + (unknown-symbol00 symbol :offset 340) + (unstuck-time time-frame :offset 344) + (stuck-count int32 :offset-assert 352) + (thrust-scale float :offset-assert 356) + (flip-time time-frame :offset-assert 360) + (transv-max meters :offset-assert 368) + (turn-anim-tilt? symbol :offset-assert 372) + (turn-anim-mag float :offset-assert 376) + (turn-anim-targ float :offset-assert 380) + (turn-anim-frame float :offset-assert 384) + (turn-anim-vel float :offset-assert 388) + (turn-anim-duck float :offset-assert 392) + (turn-anim-duck-vel float :offset-assert 396) + (tilt-anim-frame vector :inline :offset-assert 400) + (tilt-anim-target vector :inline :offset-assert 416) + (smack-surface-time time-frame :offset-assert 432) + (smack-speed meters :offset-assert 440) + (smack-normal vector :inline :offset-assert 448) + (glance-time time-frame :offset-assert 464) + (glance-speed meters :offset-assert 472) + (glance-in-transv vector :inline :offset-assert 480) + (glance-out-transv vector :inline :offset-assert 496) + (glance-normal vector :inline :offset-assert 512) + (on-flat-time time-frame :offset-assert 528) + (jump-land-time time-frame :offset-assert 536) + (slip-factor float :offset-assert 544) + (ground-on-dir vector :inline :offset-assert 560) + (ride-time time-frame :offset-assert 576) + (ride-start-time time-frame :offset-assert 584) + (ride-button-time time-frame :offset-assert 592) + (ride-lean-targ float :offset-assert 600) + (ride-lean float :offset-assert 604) + (ride-leanv float :offset-assert 608) + (ride-lean-mag float :offset-assert 612) + (ride-tilt-targ float :offset-assert 616) + (ride-tilt float :offset-assert 620) + (ride-tiltv float :offset-assert 624) + (ride-tilt-mag float :offset-assert 628) + (ride-lock symbol :offset-assert 632) + (ride-lock-on symbol :offset-assert 636) + (ride-speed meters :offset-assert 640) + (ride-mode uint32 :offset-assert 644) + (ride-rot degrees :offset-assert 648) + (ride-rot-old degrees :offset-assert 652) + (ride-rot-abs degrees 2 :offset-assert 656) + (ride-rtv-abs degrees :offset-assert 664) + (ride-touch-segment vector 2 :inline :offset-assert 672) + (ride-dir vector :inline :offset-assert 704) + (ride-vertex-length int16 :offset-assert 720) + (ride-vertex-length-old int16 :offset-assert 722) + (ride-vertex-base int16 :offset-assert 724) + (ride-vertex-base2 int16 :offset-assert 726) + (ride-vertex-index float :offset-assert 728) + (ride-vertex-index2 float :offset-assert 732) + (ride-vertex-index-old float :offset-assert 736) + (ride-vertex vector 3 :inline :offset-assert 752) + (ride-segment vector :inline :offset-assert 800) + (ride-dir-lean vector :inline :offset-assert 816) + (ride-pad-vector vector 1 :inline :offset-assert 832) + (ride-vertex-old vector 3 :inline :offset-assert 848) + (ride-segment-old vector :inline :offset-assert 896) + (ride-vertex-trail vector 128 :inline :offset-assert 912) + (halfpipe-side-time time-frame :offset-assert 2960) + (halfpipe-jump-time time-frame :offset-assert 2968) + (halfpipe-lip-time time-frame :offset-assert 2976) + (halfpipe-time time-frame :offset-assert 2984) + (halfpipe-gspot-time time-frame :offset-assert 2992) + (halfpipe-lip-event symbol :offset-assert 3000) + (spin-check-time time-frame :offset-assert 3008) + (spin-time time-frame :offset-assert 3016) + (spin-start-time time-frame :offset-assert 3024) + (spin-start-dir vector :inline :offset-assert 3040) + (spin-control float :offset-assert 3056) + (spin-ground-start-time time-frame :offset-assert 3064) + (spin-ground-time time-frame :offset-assert 3072) + (spin-ground-press-time time-frame :offset-assert 3080) + (flip-control float :offset-assert 3088) + (flip-count int32 :offset-assert 3092) + (unknown-time-frame03 time-frame :offset 3104) + (unknown-time-frame04 time-frame :offset 3112) + (unknown-time-frame05 time-frame :offset 3120) + (unknown-time-frame06 time-frame :offset 3128) + (unknown-float00 float :offset 3136) + (unknown-float01 float :offset 3140) + (trickx-count int32 :offset 3144) + (trotyv-max degrees :offset-assert 3148) + (trotyv degrees :offset-assert 3152) + (troty degrees :offset-assert 3156) + (troty-cum degrees :offset-assert 3160) + (unknown-deg00 degrees :offset 3164) + (upper-body-rotyv-max degrees :offset 3168) + (upper-body-rotyv degrees :offset-assert 3172) + (upper-body-roty degrees :offset-assert 3176) + (cushion-base meters :offset-assert 3180) + (cushion-offset meters :offset-assert 3184) + (shock-offset meters :offset-assert 3188) + (shock-offsetv meters :offset-assert 3192) + (shock-rotx meters :offset-assert 3196) + (part-control sparticle-launch-control :offset-assert 3200) + (trick-count int32 :offset-assert 3204) + (trick-array board-tricks 16 :offset-assert 3208) + (trick-points-array float 16 :offset 3272) + (trick-list board-tricks 16 :offset 3336) + (pad uint8 :offset 3399) ) :method-count-assert 11 :size-assert #xd48 :flag-assert #xb00000d48 (:methods - (board-info-method-9 () none 9) - (board-info-method-10 () none 10) + (add-to-trick-list (_type_ board-tricks float) none 9) + (flush-trick-list (_type_) none 10) ) ) @@ -391,8 +412,8 @@ ) ) (not *pause-lock*) - (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame21)) (seconds 0.1)) - (>= (-> self control unknown-time-frame06) (-> self control unknown-time-frame12)) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame30)) (seconds 0.1)) + (>= (-> self control unknown-time-frame06) (-> self control unknown-time-frame20)) ) (-> self board latch?) ) diff --git a/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc b/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc new file mode 100644 index 000000000..2e0a3b136 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc @@ -0,0 +1,3473 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function vector-vector-angle +(defun vector-vector-angle ((arg0 vector) (arg1 vector)) + (let ((s4-0 (new 'stack-no-clear 'matrix)) + (gp-0 (new 'stack-no-clear 'matrix)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (forward-up-nopitch->inv-matrix gp-0 (new 'static 'vector :z 1.0 :w 1.0) arg1) + (matrix-transpose! s4-0 gp-0) + (vector-matrix*! s3-0 arg0 s4-0) + (vector-y-angle s3-0) + ) + ) + +;; definition for function target-board-anim-trans +;; WARN: Return type mismatch float vs none. +(defbehavior target-board-anim-trans target () + (let ((f26-0 (deg- + (quaternion-vector-y-angle (-> self control dir-targ) (-> self control local-normal)) + (quaternion-vector-y-angle (-> self control unknown-quaternion00) (-> self control local-normal)) + ) + ) + (f28-0 (* (deg- + (quaternion-vector-y-angle (-> self control unknown-quaternion00) (-> self control local-normal)) + (quaternion-vector-y-angle (-> self control unknown-quaternion03) (-> self control local-normal)) + ) + (-> self clock frames-per-second) + ) + ) + (f30-0 (-> self board turn-anim-targ)) + ) + (let ((f0-1 (lerp-scale 1.0 -1.0 f28-0 -32768.0 32768.0))) + (if (or (< (fabs f0-1) 0.1) (< (-> self control unknown-float10) 0.3)) + (seek! (-> self board turn-anim-mag) 0.0 (* 8.0 (-> self clock seconds-per-frame))) + (seek! (-> self board turn-anim-mag) f0-1 (* 2.0 (-> self clock seconds-per-frame))) + ) + ) + (set! (-> self board turn-anim-targ) (+ (lerp-scale + (* 0.5 (-> *TARGET_BOARD-bank* turn-frames)) + (* -0.5 (-> *TARGET_BOARD-bank* turn-frames)) + f26-0 + -5461.3335 + 5461.3335 + ) + (lerp-scale + (* 0.3 (-> *TARGET_BOARD-bank* turn-frames)) + (* -0.3 (-> *TARGET_BOARD-bank* turn-frames)) + f28-0 + -32768.0 + 32768.0 + ) + (lerp-scale + (* 0.2 (-> *TARGET_BOARD-bank* turn-frames)) + (* -0.2 (-> *TARGET_BOARD-bank* turn-frames)) + (-> self board turn-anim-mag) + 1.0 + -1.0 + ) + ) + ) + (when (and (or (< (* f30-0 (-> self board turn-anim-targ)) 0.0) (= f30-0 0.0)) + (and (< (* 0.2 (-> *TARGET_BOARD-bank* turn-frames)) (fabs (- f30-0 (-> self board turn-anim-targ)))) + (>= (-> self clock frame-counter) (-> self control unknown-time-frame00)) + ) + ) + (let ((v1-50 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-50 command) (sound-command set-param)) + (set! (-> v1-50 id) (-> self board unknown-sound-id00)) + (set! (-> v1-50 params volume) -4) + (set! (-> v1-50 auto-time) 120) + (set! (-> v1-50 auto-from) 2) + (set! (-> v1-50 params mask) (the-as uint 17)) + (-> v1-50 id) + ) + (set! (-> self board unknown-sound-id00) (sound-play "board-turn")) + ) + ) + (set! (-> self board turn-anim-duck-vel) (* 0.98 (-> self board turn-anim-duck-vel))) + (+! (-> self board turn-anim-duck-vel) (* -8.0 (-> self clock seconds-per-frame))) + (when (and (board-on-ground?) + (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame02)) (seconds 0.2)) + ) + (if (logtest? (-> self control status) (cshape-moving-flags csmf11)) + (+! (-> self board turn-anim-duck-vel) (lerp-scale 0.0 15.0 (-> self control unknown-float21) 0.0 81920.0)) + ) + (let ((f0-38 (vector-dot (the-as vector (-> self board up-vector)) (-> self board up-vector 1)))) + (if (< f0-38 1.0) + (+! (-> self board turn-anim-duck-vel) + (* (lerp-scale 400.0 0.0 f0-38 0.6 1.0) (-> self clock seconds-per-frame)) + ) + ) + ) + ) + (none) + ) + +;; definition for function target-board-spin-check +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior target-board-spin-check target () + (when (and (or (cpad-pressed? (-> self control unknown-cpad-info00 number) r1) + (and (cpad-hold? (-> self control unknown-cpad-info00 number) r1) + (>= (- (-> self clock frame-counter) (-> self board spin-check-time)) (seconds 0.3)) + ) + ) + (not (and (and (-> self next-state) (let ((v1-24 (-> self next-state name))) + (or (= v1-24 'target-board-trickx) (= v1-24 'target-board-hold)) + ) + ) + (< (- (-> self clock frame-counter) (-> self board spin-start-time)) (seconds 0.5)) + ) + ) + (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) + ) + (set! (-> self board spin-start-time) (-> self clock frame-counter)) + (set! (-> self board spin-start-dir quad) (-> self node-list data 3 bone transform vector 2 quad)) + (vector-flatten! (-> self control unknown-vector03) (-> self control unknown-matrix01 vector 2) *up-vector*) + (vector-normalize! (-> self control unknown-vector03) 1.0) + (rot->dir-targ! (-> self control)) + (set! (-> self board trotyv-max) + (lerp-scale + 218453.33 + 91022.22 + (the float (- (-> self clock frame-counter) (-> self control unknown-time-frame06))) + 0.0 + 300.0 + ) + ) + (set! (-> self board trotyv) 0.0) + (set! (-> self board troty) 0.0) + (set! (-> self board troty-cum) 0.0) + (set! (-> self board unknown-deg00) 0.0) + (set! (-> self board spin-sound-id) (the-as uint 0)) + (set! (-> self control unknown-surface00) *board-spin-mods*) + ) + (cond + ((and (cpad-hold? (-> self control unknown-cpad-info00 number) r1) + (and (or (= (-> self control unknown-surface00 name) 'spin) + (< (- (-> self clock frame-counter) (-> self board spin-time)) (seconds 0.05)) + ) + (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) + ) + ) + (set! (-> self board turn-anim-tilt?) #f) + (set! (-> self control unknown-surface00) *board-spin-mods*) + (set! (-> self board spin-time) (-> self clock frame-counter)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 x) (* -0.0078125 (+ -128.0 (the float (-> self control unknown-cpad-info00 leftx))))) + (set! (-> gp-0 y) 0.0) + (set! (-> gp-0 z) (* -0.0078125 (+ -128.0 (the float (-> self control unknown-cpad-info00 lefty))))) + (set! (-> gp-0 w) 0.0) + (let ((f28-0 (analog-input (the int (* 128.0 (-> gp-0 x))) 0.0 64.0 110.0 2184533.2)) + (f30-0 (analog-input (the int (* 128.0 (-> gp-0 z))) 0.0 96.0 110.0 1.0)) + ) + (if (and (zero? (-> self board spin-sound-id)) (< 5461.3335 (fabs (-> self board trotyv)))) + (set! (-> self board spin-sound-id) (the-as uint (sound-play "board-spin-loop"))) + ) + (if (and (< (* 0.9 (fabs (-> self board spin-control))) (fabs f28-0)) + (>= (* (-> self board spin-control) f28-0) 0.0) + ) + (set! (-> self board spin-control) f28-0) + ) + (if (not (-> self control unknown-symbol04)) + (target-danger-set! 'board-spin #f) + ) + (+! (-> self board trotyv) (* (-> self board spin-control) (-> self clock seconds-per-frame))) + (when (and (< (fabs f28-0) 1092266.6) + (< (fabs (-> self board spin-control)) 1092266.6) + (< (* 0.9 (fabs (-> self board flip-control))) (fabs f30-0)) + (>= (* (-> self board flip-control) f30-0) 0.0) + (not (board-on-ground?)) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) 4096.0) + ) + (set! (-> self board flip-control) f30-0) + (go + target-board-flip + (-> *TARGET_BOARD-bank* jump-height-min) + (-> *TARGET_BOARD-bank* jump-height-max) + (if (logtest? (focus-status halfpipe) (-> self focus-status)) + 'halfpipe + ) + ) + ) + ) + ) + ) + (else + (set! (-> self control unknown-surface00) (the-as surface (-> self board mods-backup))) + ) + ) + (set! (-> self board spin-check-time) (-> self clock frame-counter)) + (when (and (or (cpad-pressed? (-> self control unknown-cpad-info00 number) l1) + (< (-> self control unknown-time-frame06) (-> self board unknown-time-frame06)) + ) + (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) + ) + (set! (-> self board turn-anim-tilt?) #f) + (set! (-> self control unknown-surface00) *board-spin-mods*) + (set! (-> self board unknown-time-frame03) (-> self clock frame-counter)) + (let ((gp-2 (new 'stack-no-clear 'vector))) + (set! (-> gp-2 x) (* -0.0078125 (+ -128.0 (the float (-> self control unknown-cpad-info00 leftx))))) + (set! (-> gp-2 y) 0.0) + (set! (-> gp-2 z) (* -0.0078125 (+ -128.0 (the float (-> self control unknown-cpad-info00 lefty))))) + (set! (-> gp-2 w) 0.0) + (let ((f30-1 (analog-input (the int (* 128.0 (-> gp-2 x))) 0.0 64.0 110.0 1.0)) + (f28-1 (analog-input (the int (* 128.0 (-> gp-2 z))) 0.0 96.0 110.0 1.0)) + ) + (when (and (< (fabs f30-1) 0.5) + (< (fabs (-> self board unknown-float00)) 0.5) + (= (-> self board unknown-float01) 0.0) + (< (* 0.9 (fabs (-> self board unknown-float01))) (fabs f28-1)) + (>= (* (-> self board unknown-float01) f28-1) 0.0) + (and (not (board-on-ground?)) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (>= (target-height-above-ground) 4096.0) + (< (seconds 0.165) (target-time-to-ground)) + (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame05)) (seconds 0.05)) + (< (-> self board unknown-time-frame05) (-> self board unknown-time-frame06)) + ) + ) + ) + (set! (-> self board unknown-float01) f28-1) + (go + target-board-hold + (-> *TARGET_BOARD-bank* tricky-jump-height-min) + (-> *TARGET_BOARD-bank* tricky-jump-height-max) + (if (logtest? (focus-status halfpipe) (-> self focus-status)) + 'halfpipe + ) + ) + ) + (when (and (< (fabs f28-1) 0.5) + (< (fabs (-> self board unknown-float01)) 0.5) + (= (-> self board unknown-float00) 0.0) + (< (* 0.9 (fabs (-> self board unknown-float00))) (fabs f30-1)) + (>= (* (-> self board unknown-float00) f30-1) 0.0) + (and (not (board-on-ground?)) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (>= (target-height-above-ground) 4096.0) + (< (seconds 0.165) (target-time-to-ground)) + (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame05)) (seconds 0.05)) + ) + ) + ) + (set! (-> self board unknown-float00) f30-1) + (go + target-board-trickx + (-> *TARGET_BOARD-bank* trickx-jump-height-min) + (-> *TARGET_BOARD-bank* trickx-jump-height-max) + (if (logtest? (focus-status halfpipe) (-> self focus-status)) + 'halfpipe + ) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for function target-board-halfpipe-trans +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-halfpipe-trans target () + (when (and (logtest? (focus-status halfpipe) (-> self focus-status)) *camera*) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((s5-0 (camera-master-method-15 *camera* (new 'stack-no-clear 'vector)))) + (vector-flatten! gp-0 (-> self control unknown-vector36) (-> *camera* local-down)) + (when (< (vector-dot gp-0 s5-0) 0.0) + (let* ((v1-11 (camera-master-method-14 *camera* (new 'stack-no-clear 'vector))) + (f0-3 (vector-dot (-> self control unknown-vector34) v1-11)) + (s4-1 (vector-float*! (new 'stack-no-clear 'vector) (-> self control unknown-vector34) f0-3)) + ) + (vector-flatten! (the-as vector s4-1) (the-as vector s4-1) (-> *camera* local-down)) + (if (< 0.0 (vector-dot (the-as vector s4-1) s5-0)) + (vector-negate! gp-0 (the-as vector s4-1)) + ) + ) + ) + ) + (vector-normalize! gp-0 8192.0) + (set! (-> gp-0 y) (+ 40960.0 (-> gp-0 y))) + (vector+! gp-0 gp-0 (get-trans self 6)) + (vector-! gp-0 gp-0 (get-trans self 0)) + (send-event *camera* 'relative-position gp-0) + ) + (set-setting! 'matrix-blend-max-angle 'abs #x45088889 0) + (set-setting! 'matrix-blend-max-partial 'abs #x3f000000 0) + ) + 0 + (none) + ) + +;; definition for function target-board-resolve-points +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-resolve-points target ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (when (= (-> self board main mode) (joint-mod-mode rotate)) + (let ((f0-1 (fabs (-> self board troty-cum)))) + (cond + ((>= f0-1 191146.67) + (add-to-trick-list (-> self board) (board-tricks board-spin) 4000.0) + ) + ((>= f0-1 126520.89) + (add-to-trick-list (-> self board) (board-tricks board-spin) 2000.0) + ) + ((>= f0-1 49152.0) + (add-to-trick-list (-> self board) (board-tricks board-spin) 500.0) + ) + ) + ) + ) + (set! (-> self board troty-cum) 0.0) + (set! (-> self board flip-count) 0) + (if (>= (- (-> self clock frame-counter) (-> self board in-air-time)) (seconds 0.2)) + (flush-trick-list (-> self board)) + ) + 0 + (none) + ) + +;; definition for function target-board-ground-check +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +;; ERROR: Function may read a register that is not set: a0 +;; ERROR: Function may read a register that is not set: a1 +;; ERROR: Function may read a register that is not set: a2 +;; ERROR: Function may read a register that is not set: a3 +(defbehavior target-board-ground-check target () + (local-vars (a0-4 object) (a1-0 object) (a2-3 number) (a3-0 number)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (when (board-on-ground?) + (when (!= (-> self board troty-cum) 0.0) + (let ((f30-0 (fabs (-> self board troty-cum))) + (f28-0 (vector-y-angle (-> self control transv))) + (f0-2 (y-angle (-> self control))) + ) + (if (< (- (-> self clock frame-counter) (-> self board halfpipe-time)) (seconds 0.1)) + (set! f28-0 (+ 32768.0 f28-0)) + ) + (let ((t9-3 deg-diff)) + (set! a0-4 f0-2) + (set! a1-0 f28-0) + (let ((f0-5 (fabs (t9-3 (the-as float a0-4) (the-as float a1-0))))) + (when (and (>= f30-0 49152.0) (>= 4551.1113 f0-5)) + (cond + ((>= f30-0 191146.67) + (add-to-trick-list (-> self board) (board-tricks board-boost) 2000.0) + ) + ((>= f30-0 126520.89) + (add-to-trick-list (-> self board) (board-tricks board-boost) 1000.0) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-boost) 500.0) + ) + ) + (let ((t9-7 lerp-scale) + (a0-8 20480.0) + (a1-4 40960.0) + ) + (set! a2-3 f30-0) + (set! a3-0 49152.0) + (let ((f0-8 (t9-7 a0-8 a1-4 (the-as float a2-3) (the-as float a3-0) 182044.44)) + (v1-28 (-> self control transv)) + ) + (let ((a0-10 (-> self control transv))) + (set! a1-0 (-> self control unknown-matrix01 vector 2)) + (.lvf vf2 (&-> (the-as vector a1-0) quad)) + (.lvf vf1 (&-> a0-10 quad)) + ) + (set! a0-4 f0-8) + (.mov vf3 a0-4) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-28 quad) vf4) + ) + ) + (when (< (vector-length (-> self control transv)) 114688.0) + (let ((t9-8 vector-normalize!)) + (set! a0-4 (-> self control transv)) + (set! a1-0 114688.0) + (t9-8 (the-as vector a0-4) (the-as float a1-0)) + ) + ) + (when (zero? (logand (-> self control old-status) (cshape-moving-flags on-surface))) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self control trans quad)) + (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) + (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when s5-0 + (let ((t9-10 (method-of-type part-tracker activate))) + (t9-10 (the-as part-tracker s5-0) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-11 run-function-in-process) + (a0-13 s5-0) + (a1-8 part-tracker-init) + (a2-8 (-> *part-group-id-table* 119)) + (a3-2 0) + (t0-1 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> gp-0 quad)) + ((the-as (function object object object object object object object object none) t9-11) + a0-13 + a1-8 + a2-8 + a3-2 + t0-1 + t1-0 + t2-0 + t3-0 + ) + ) + (-> s5-0 ppointer) + ) + ) + (let* ((s4-0 (get-process *default-dead-pool* manipy #x4000)) + (s5-1 + (when s4-0 + (let ((t9-13 (method-of-type manipy activate))) + (t9-13 (the-as manipy s4-0) self (symbol->string (-> manipy symbol)) (the-as pointer #x70004000)) + ) + (let ((s5-2 run-function-in-process) + (s3-0 s4-0) + (s2-0 manipy-init) + (s1-0 (-> self entity)) + (t0-2 (art-group-get-by-name *level* "skel-generic-blast" (the-as (pointer uint32) #f))) + (t1-1 #f) + ) + 0 + ((the-as (function object object object object object object none) s5-2) s3-0 s2-0 gp-0 s1-0 t0-2 t1-1) + ) + (-> s4-0 ppointer) + ) + ) + ) + (when s5-1 + (quaternion-copy! (-> (the-as board (-> s5-1 0)) root quat) (-> self control unknown-quaternion00)) + (send-event (ppointer->process s5-1) 'anim-mode 'play1) + (send-event (ppointer->process s5-1) 'anim "idle") + (send-event (ppointer->process s5-1) 'speed #x3fc00000) + (set-vector! (-> (the-as board (-> s5-1 0)) root scale) 0.2 0.4 0.2 1.0) + ) + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) + (let ((gp-1 sound-play-by-name)) + (let ((s5-3 (make-u128 #x74736f (the-as uint #x6f622d6472616f62)))) + (set! a1-0 (new-sound-id)) + (set! a2-3 1024) + (set! a3-0 0) + (set! a0-4 s5-3) + ) + (gp-1 + (the-as sound-name a0-4) + (the-as sound-id a1-0) + (the-as int a2-3) + (the-as int a3-0) + 0 + (sound-group sfx) + #t + ) + ) + ) + ) + ) + ) + ) + ) + (target-board-resolve-points (the-as float a0-4) (the-as float a1-0) (the-as float a2-3) (the-as float a3-0)) + ) + (set! (-> self board turn-anim-tilt?) #t) + (none) + ) + ) + +;; definition for function target-board-halfpipe-check +;; INFO: Used lq/sq +(defbehavior target-board-halfpipe-check target () + (local-vars (v0-3 collide-action)) + (let ((gp-0 (vector-flatten! + (new-stack-vector0) + (-> self control dynam gravity-normal) + (-> self control unknown-vector22) + ) + ) + ) + (vector-normalize! gp-0 1.0) + (cond + ((and (board-on-ground?) + (= (-> self control ground-pat mode) (pat-mode halfpipe)) + (< 0.0 (vector-dot (-> self control transv) gp-0)) + (and (< (-> self control surface-angle) 0.3) (zero? (-> self board halfpipe-side-time))) + ) + (set! (-> self board halfpipe-side-time) (-> self clock frame-counter)) + (set! v0-3 (logior (-> self control root-prim prim-core action) (collide-action no-normal-reset))) + (set! (-> self control root-prim prim-core action) v0-3) + v0-3 + ) + (else + (if (and (not (board-on-ground?)) + (nonzero? (-> self board halfpipe-side-time)) + (>= (- (-> self clock frame-counter) (-> self board halfpipe-side-time)) (seconds 0.05)) + ) + (go target-board-halfpipe) + ) + (when (>= (- (-> self clock frame-counter) (-> self board halfpipe-side-time)) (seconds 0.2)) + (set! (-> self board halfpipe-side-time) 0) + (set! v0-3 (logclear (-> self control root-prim prim-core action) (collide-action no-normal-reset))) + (set! (-> self control root-prim prim-core action) v0-3) + v0-3 + ) + ) + ) + ) + ) + +;; definition for function target-board-jump-trans +(defbehavior target-board-jump-trans target () + (when (and (!= (-> self state-time) (-> self clock frame-counter)) (jump-hit-ground-stuck?)) + (set! (-> self board jump-land-time) (-> self clock frame-counter)) + (go target-board-hit-ground) + ) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.1)) + (target-board-smack-surface?) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 12288.0) + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (zero? (logand (water-flags touch-water) (-> self water flags))) + (zero? (logand (-> self state-flags) (state-flags sf7))) + (not (and (-> self next-state) (= (-> self next-state name) 'target-board-wall-kick))) + ) + ) + (go target-board-jump-kick) + ) + (target-board-spin-check) + (none) + ) + +;; failed to figure out what this is: +(defstate target-board-start (target) + :event target-board-handler + :exit target-board-exit + :code (behavior ((arg0 object)) + (target-board-init) + (remove-exit) + (go target-board-get-on) + (none) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-board-stance (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('lip) + (when (and (= (-> self control ground-pat mode) (pat-mode halfpipe)) + (< (-> self control poly-angle) 0.5) + (let ((s5-0 (vector-flatten! + (new-stack-vector0) + (-> self control dynam gravity-normal) + (-> self control unknown-vector22) + ) + ) + ) + (vector-normalize! s5-0 1.0) + (< 0.0 (vector-dot (-> self control transv) s5-0)) + ) + ) + (set! (-> self board halfpipe-lip-time) (-> self clock frame-counter)) + (set! (-> self board halfpipe-side-time) (-> self clock frame-counter)) + (set! (-> self board halfpipe-lip-event) (the-as symbol (-> arg3 param 0))) + (let ((v0-2 (the-as object (logior (-> self control root-prim prim-core action) (collide-action no-normal-reset)))) + ) + (set! (-> self control root-prim prim-core action) (the-as collide-action v0-2)) + v0-2 + ) + ) + ) + (('jump) + (go + target-board-jump + (the-as meters (-> arg3 param 0)) + (the-as meters (-> arg3 param 1)) + (the-as symbol (-> arg3 param 2)) + ) + ) + (else + (target-board-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior () + (set! (-> self control unknown-surface00) *board-walk-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (none) + ) + :exit (behavior () + (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-board-stance) (= v1-3 'target-board-duck-stance)) + ) + ) + ) + (set! (-> self board halfpipe-side-time) 0) + 0 + ) + (logclear! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) + (set! (-> self board turn-anim-tilt?) #f) + (when (not (and (-> self next-state) + (let ((v1-13 (-> self next-state name))) + (or (= v1-13 'target-board-stance) (= v1-13 'target-board-duck-stance) (= v1-13 'target-board-ride-edge)) + ) + ) + ) + (set! (-> self board turn-anim-frame) 0.0) + (set! (-> self board turn-anim-mag) 0.0) + (set! (-> self board turn-anim-vel) 0.0) + (set! (-> self board turn-anim-duck) 0.0) + ) + (target-board-exit) + (none) + ) + :trans (behavior () + (if (and (cpad-hold? (-> self control unknown-cpad-info00 number) l1) + (zero? (logand (-> self state-flags) (state-flags sf9))) + (< (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) + (the-as time-frame (-> *TARGET-bank* ground-timeout)) + ) + ) + (go target-board-duck-stance) + ) + (when (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? 'board) + ) + (let ((gp-0 (vector-flatten! + (new-stack-vector0) + (-> self control dynam gravity-normal) + (-> self control unknown-vector22) + ) + ) + ) + (vector-normalize! gp-0 1.0) + (cond + ((and (< (- (-> self clock frame-counter) (-> self board halfpipe-jump-time)) (seconds 0.5)) + (= (-> self control ground-pat mode) (pat-mode halfpipe)) + ) + ) + ((and (= (-> self control ground-pat mode) (pat-mode halfpipe)) + (< 0.0 (vector-dot (-> self control transv) gp-0)) + (< (-> self control surface-angle) 0.5) + ) + (set! (-> self board halfpipe-jump-time) (-> self clock frame-counter)) + (vector-float*! (-> self control transv) (-> self control transv) 1.5) + ) + (else + (flush-trick-list (-> self board)) + (go target-board-jump (-> *TARGET_BOARD-bank* jump-height-min) (-> *TARGET_BOARD-bank* jump-height-max) #f) + ) + ) + ) + ) + (if (cpad-pressed? (-> self control unknown-cpad-info00 number) r1) + (set! (-> self board spin-ground-press-time) (-> self clock frame-counter)) + ) + (if (and (cpad-hold? (-> self control unknown-cpad-info00 number) r1) + (can-feet? #t) + (< (- (-> self clock frame-counter) (-> self board spin-ground-press-time)) (seconds 0.3)) + (turn-around?) + ) + (set! (-> self board spin-ground-start-time) (-> self clock frame-counter)) + ) + (target-board-halfpipe-check) + (if (target-board-smack-surface?) + 0 + ) + (target-board-anim-trans) + (cond + ((board-on-ground?) + (target-board-ground-check) + (set! (-> self control unknown-surface00) *board-walk-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + ) + ((and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) (seconds 0.1)) + (or (= (-> self control unknown-surface00 name) 'spin) (< 4096.0 (target-height-above-ground))) + ) + (set! (-> self control unknown-surface00) *board-jump-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (target-board-spin-check) + ) + (else + (set! (-> self control unknown-surface00) *board-air-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + ) + ) + (none) + ) + :code (behavior () + (let ((gp-0 (-> self board stance-info))) + (let ((f30-0 (the-as number 0.0)) + (s5-0 30) + (v1-3 (ja-group)) + ) + (when (not (and (and v1-3 (= v1-3 (-> self draw art-group data 161))) (= (ja-group-size) 4))) + (let ((v1-10 (ja-group))) + (when (and v1-10 (= v1-10 (-> self draw art-group data 170))) + (ja-channel-set! 1) + (ja-no-eval :group! (-> self draw art-group data 190) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 190)) frames num-frames) -1)) + 1.8 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.8)) + ) + (suspend) + (set! (-> self board turn-anim-duck) 1.0) + (set! (-> self board turn-anim-duck-vel) 15.0) + ) + ) + (ja-channel-push! 4 (the-as time-frame s5-0)) + (set! f30-0 (ja-frame-num 0)) + ) + ) + (ground-tween-initialize + gp-0 + (the-as uint 0) + (the-as uint (-> self draw art-group data 153)) + (the-as uint (-> self draw art-group data 163)) + (the-as uint (-> self draw art-group data 164)) + (the-as uint (-> self draw art-group data 162)) + (the-as uint (-> self draw art-group data 161)) + ) + (ja :chan 3 :group! (-> self draw art-group data 152)) + (until #f + (target-board-turn-anim 0) + (let ((f0-10 (* 1.6 (-> self control unknown-float25))) + (f1-2 (* 1.6 (-> self control unknown-float26))) + ) + (cond + ((not (-> self board turn-anim-tilt?)) + (set! f0-10 0.0) + (set! f1-2 0.0) + ) + ((= (-> self control ground-pat mode) (pat-mode halfpipe)) + (set! f0-10 0.0) + ) + ) + (let ((t9-9 ground-tween-update) + (a0-24 gp-0) + (a1-4 f0-10) + (a2-3 f1-2) + ) + #x3dcccccd + (t9-9 a0-24 a1-4 a2-3) + ) + ) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) + (cond + ((>= (-> self board turn-anim-duck) 0.0) + (let ((a0-27 (-> self skel root-channel 3))) + (let ((f0-14 (-> self board turn-anim-duck))) + (set! (-> a0-27 frame-interp 1) f0-14) + (set! (-> a0-27 frame-interp 0) f0-14) + ) + (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> self draw art-group data 152))) + (set! (-> a0-27 param 0) 0.0) + (joint-control-channel-group-eval! + a0-27 + (the-as art-joint-anim (-> self draw art-group data 152)) + num-func-chan + ) + ) + ) + (else + (let ((a0-28 (-> self skel root-channel 3))) + (let ((f0-17 (- (-> self board turn-anim-duck)))) + (set! (-> a0-28 frame-interp 1) f0-17) + (set! (-> a0-28 frame-interp 0) f0-17) + ) + (set! (-> a0-28 frame-group) (the-as art-joint-anim (-> self draw art-group data 177))) + (set! (-> a0-28 param 0) 0.0) + (joint-control-channel-group-eval! + a0-28 + (the-as art-joint-anim (-> self draw art-group data 177)) + num-func-chan + ) + ) + ) + ) + (suspend) + (can-play-stance-amibent?) + ) + ) + #f + (none) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-duck-stance (target) + :event (-> target-board-stance event) + :enter (behavior () + (set! (-> self control unknown-surface00) *board-duck-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (none) + ) + :exit (behavior () + (set! (-> self board turn-anim-duck-vel) -8.0) + ((-> target-board-stance exit)) + (none) + ) + :trans (behavior () + (if (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1)) + ) + (logtest? (-> self state-flags) (state-flags sf9)) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) + (the-as time-frame (-> *TARGET-bank* ground-timeout)) + ) + ) + (begin self (can-exit-duck?)) + ) + (go target-board-stance) + ) + (when (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? 'board) + ) + (let ((gp-0 (vector-flatten! + (new-stack-vector0) + (-> self control dynam gravity-normal) + (-> self control unknown-vector22) + ) + ) + ) + (vector-normalize! gp-0 1.0) + (cond + ((and (< (- (-> self clock frame-counter) (-> self board halfpipe-jump-time)) (seconds 0.5)) + (= (-> self control ground-pat mode) (pat-mode halfpipe)) + ) + ) + ((and (= (-> self control ground-pat mode) (pat-mode halfpipe)) + (< 0.0 (vector-dot (-> self control transv) gp-0)) + (< (-> self control surface-angle) 0.5) + ) + (set! (-> self board halfpipe-jump-time) (-> self clock frame-counter)) + (vector-float*! (-> self control transv) (-> self control transv) 1.5) + ) + (else + (flush-trick-list (-> self board)) + (deg-diff + (vector-y-angle (-> self control unknown-matrix01 vector 2)) + (vector-y-angle (-> self control unknown-vector08)) + ) + (go + target-board-jump + (-> *TARGET_BOARD-bank* duck-jump-height-min) + (-> *TARGET_BOARD-bank* duck-jump-height-max) + (the-as symbol *board-duck-jump-mods*) + ) + ) + ) + ) + ) + (if (cpad-pressed? (-> self control unknown-cpad-info00 number) r1) + (set! (-> self board spin-ground-press-time) (-> self clock frame-counter)) + ) + (if (and (cpad-hold? (-> self control unknown-cpad-info00 number) r1) + (can-feet? #t) + (< (- (-> self clock frame-counter) (-> self board spin-ground-press-time)) (seconds 0.3)) + (turn-around?) + ) + (set! (-> self board spin-ground-start-time) (-> self clock frame-counter)) + ) + (target-board-halfpipe-check) + (if (target-board-smack-surface?) + 0 + ) + (target-board-anim-trans) + (set! (-> self board turn-anim-duck-vel) 8.0) + (cond + ((board-on-ground?) + (target-board-ground-check) + (set! (-> self control unknown-surface00) *board-duck-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + ) + ((and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) (seconds 0.1)) + (or (= (-> self control unknown-surface00 name) 'spin) (< 4096.0 (target-height-above-ground))) + ) + (set! (-> self control unknown-surface00) *board-duck-jump-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (target-board-spin-check) + ) + (else + (set! (-> self control unknown-surface00) *board-air-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + ) + ) + (none) + ) + :code (-> target-board-stance code) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-jump (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (if (and (= arg2 'edge-grab) (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.1))) + (return #f) + ) + (target-board-handler arg0 arg1 arg2 arg3) + ) + :enter (behavior ((arg0 meters) (arg1 meters) (arg2 symbol)) + (local-vars + (sv-144 (function vector entity-actor skeleton-group vector none :behavior manipy)) + (sv-160 entity) + ) + (if (= arg2 'hit) + (set! arg2 #f) + ) + (when (< (- (-> self clock frame-counter) (-> self board ride-time)) (seconds 0.5)) + (set! arg2 (the-as symbol *board-ride-jump-mods*)) + (let ((s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0))) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + s2-0 + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (set! (-> self control unknown-time-frame00) + (+ (-> self clock frame-counter) + (the int (lerp-scale 225.0 0.0 (vector-dot s2-0 (-> self control unknown-matrix01 vector 2)) -1.0 1.0)) + ) + ) + ) + ) + (set! (-> self control dynam gravity-length) 245760.0) + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((f30-0 0.0)) + (cond + ((and (< 0.0 (-> self board shock-offsetv)) + (< (- (-> self clock frame-counter) (-> self board jump-land-time)) (seconds 0.5)) + (>= (- (-> self clock frame-counter) (-> self board ride-time)) (seconds 0.5)) + ) + (let ((s3-2 (new 'stack-no-clear 'vector))) + (set! (-> s3-2 quad) (-> self control trans quad)) + (set! (-> s3-2 y) (+ 2048.0 (-> s3-2 y))) + (let ((s2-1 (get-process *default-dead-pool* part-tracker #x4000))) + (when s2-1 + (let ((t9-5 (method-of-type part-tracker activate))) + (t9-5 (the-as part-tracker s2-1) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-6 run-function-in-process) + (a0-15 s2-1) + (a1-7 part-tracker-init) + (a2-8 (-> *part-group-id-table* 120)) + (a3-2 0) + (t0-1 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> s3-2 quad)) + ((the-as (function object object object object object object object object none) t9-6) + a0-15 + a1-7 + a2-8 + a3-2 + t0-1 + t1-0 + t2-0 + t3-0 + ) + ) + (-> s2-1 ppointer) + ) + ) + (let* ((s1-1 (get-process *default-dead-pool* manipy #x4000)) + (s2-2 + (when s1-1 + (let ((t9-8 (method-of-type manipy activate))) + (t9-8 (the-as manipy s1-1) self (symbol->string (-> manipy symbol)) (the-as pointer #x70004000)) + ) + (let ((s2-3 run-function-in-process) + (s0-1 s1-1) + ) + (set! sv-144 manipy-init) + (set! sv-160 (-> self entity)) + (let ((t0-2 (art-group-get-by-name *level* "skel-generic-blast" (the-as (pointer uint32) #f))) + (t1-1 #f) + ) + 0 + ((the-as (function object object object object object object none) s2-3) s0-1 sv-144 s3-2 sv-160 t0-2 t1-1) + ) + ) + (-> s1-1 ppointer) + ) + ) + ) + (when s2-2 + (quaternion-copy! (-> (the-as board (-> s2-2 0)) root quat) (-> self control unknown-quaternion00)) + (send-event (ppointer->process s2-2) 'anim-mode 'play1) + (send-event (ppointer->process s2-2) 'anim "idle") + (send-event (ppointer->process s2-2) 'speed #x3fc00000) + (set-vector! (-> (the-as board (-> s2-2 0)) root scale) 0.2 0.4 0.2 1.0) + ) + ) + ) + (set! f30-0 (+ 8192.0 f30-0)) + (add-to-trick-list (-> self board) (board-tricks board-quick-jump) 0.0) + (sound-play "board-q-jump") + ) + (else + (if (= (the-as object arg2) *board-duck-jump-mods*) + (add-to-trick-list (-> self board) (board-tricks board-duck-jump) 0.0) + (add-to-trick-list (-> self board) (board-tricks board-jump) 0.0) + ) + (set! (-> self board unknown-sound-id02) (sound-play "board-jump")) + ) + ) + (init-var-jump + (+ arg0 f30-0) + (+ arg1 f30-0) + #t + #f + (-> self control transv) + (if (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.1)) + 2.0 + 0.0 + ) + ) + ) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (set! arg2 (cond + ((the-as object arg2) + (empty) + arg2 + ) + (else + (the-as symbol *board-jump-mods*) + ) + ) + ) + (set! (-> self control unknown-surface00) (the-as surface arg2)) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (set! (-> self board shock-offsetv) 0.0) + (set! (-> self control unknown-float36) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control unknown-float05))))) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + (none) + ) + :exit target-board-exit + :trans (behavior () + (target-board-jump-trans) + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 6))) + ) + ) + (mod-var-jump #t #f (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + (set! (-> self board shock-offset) (* 0.8 (-> self board shock-offset))) + (none) + ) + :code (behavior ((arg0 meters) (arg1 meters) (arg2 symbol)) + (case arg2 + (('hit) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 158) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 158)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.05)) + ) + (else + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 155) :num! min) + (suspend) + (until (ja-done? 0) + (let ((f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (f0-10 (- 10.0 (ja-aframe-num 0))) + (gp-1 (-> self skel root-channel 0)) + ) + (set! (-> gp-1 param 0) (the float (+ (-> gp-1 frame-group frames num-frames) -1))) + (let ((v1-44 (and (< 0.0 f30-0) (< 0.0 f0-10)))) + (set! (-> gp-1 param 1) + (cond + (v1-44 + (fmin (fmin 1.5 f0-10) (/ (* 5.0 f0-10) (the float (time-to-apex f30-0 -245760.0)))) + ) + ((< (seconds 0.165) (target-time-to-ground)) + 0.5 + ) + (else + 0.25 + ) + ) + ) + ) + (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) + ) + (suspend) + ) + (ja-channel-push! 1 (seconds 0.05)) + ) + ) + (ja :group! (-> self draw art-group data 156)) + (until #f + (suspend) + (ja :num! (loop!)) + ) + #f + (none) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-halfpipe (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('edge-grab) + (format + #t + "halfpipe found edge ~m~%" + (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + ) + (set! (-> self control unknown-word04) (the-as uint #t)) + (let ((v1-6 *edge-grab-info*)) + (vector-normalize! + (vector-! (-> self control unknown-vector34) (the-as vector (-> v1-6 world-vertex)) (-> v1-6 world-vertex 1)) + 1.0 + ) + ) + (vector-cross! + (-> self control unknown-vector36) + (-> self control unknown-vector34) + (-> self control dynam gravity-normal) + ) + (let ((v1-11 (new-stack-vector0))) + (let ((f0-2 (vector-dot (-> self control unknown-vector36) (-> self control transv)))) + 0.0 + (vector-! + v1-11 + (-> self control transv) + (the-as vector (vector-float*! v1-11 (-> self control unknown-vector36) f0-2)) + ) + ) + (let* ((f0-3 (vector-length v1-11)) + (f1-1 f0-3) + (f2-0 -2048.0) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control unknown-vector36) f2-0)) + (the-as vector (vector-float*! v1-11 v1-11 (/ f0-3 f1-1))) + ) + ) + ) + ) + (('ramp) + (when (not (-> self control unknown-symbol02)) + (let ((v0-3 (the-as object #t))) + (set! (-> self control unknown-symbol02) (the-as float v0-3)) + v0-3 + ) + ) + ) + (('grenade) + (if (< (the-as float (-> arg3 param 0)) + (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + ) + (go target-board-grenade (process->handle arg0)) + ) + ) + (else + (target-board-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior () + (set! (-> self focus-status) (logior (focus-status halfpipe) (-> self focus-status))) + (set! (-> self state-time) (-> self clock frame-counter)) + (logior! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) + (set! (-> self control unknown-surface00) *board-halfpipe-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (set! (-> self control unknown-time-frame17) 0) + (when (< (vector-dot (-> self control unknown-matrix01 vector 1) (-> self control dynam gravity-normal)) 0.7) + (vector-matrix*! + (-> self control unknown-vector00) + (-> self control transv) + (-> self control unknown-matrix00) + ) + (set! (-> self control unknown-vector00 y) 0.0) + (vector-matrix*! + (-> self control transv) + (-> self control unknown-vector00) + (-> self control unknown-matrix01) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #f)) + (set! (-> self control unknown-symbol02) (the-as float #f)) + (target-method-27 *target* *collide-cache* *collide-edge-board-halfpipe-spec*) + (when (not (-> self control unknown-spool-anim00)) + (let ((gp-0 (vector-flatten! + (-> self control unknown-vector36) + (-> self control dynam gravity-normal) + (-> self control unknown-vector22) + ) + ) + ) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 1.0) + (vector-rotate-y! (-> self control unknown-vector34) (-> self control unknown-vector36) 16384.0) + (let ((v1-40 (new-stack-vector0))) + (let ((f0-5 (vector-dot gp-0 (-> self control transv)))) + 0.0 + (vector-! v1-40 (-> self control transv) (the-as vector (vector-float*! v1-40 gp-0 f0-5))) + ) + (let* ((f0-6 (vector-length v1-40)) + (f1-2 f0-6) + (f2-0 -2048.0) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) gp-0 f2-0)) + (the-as vector (vector-float*! v1-40 v1-40 (/ f0-6 f1-2))) + ) + ) + ) + ) + ) + (if (or (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 20480.0) + (< (vector-dot + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00)) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) + ) + 0.3 + ) + ) + (go target-board-turn-to (-> self control transv) (seconds 0.5)) + ) + (none) + ) + :exit (behavior () + (if (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-board-flip) + (= v1-3 'target-board-hold) + (= v1-3 'target-board-trickx) + (= v1-3 'target-board-grenade) + (= v1-3 'target-board-falling) + ) + ) + ) + ) + (logclear! (-> self focus-status) (focus-status halfpipe)) + ) + (send-event *camera* 'relative-position #f) + (remove-setting! 'matrix-blend-max-angle) + (remove-setting! 'matrix-blend-max-partial) + (logclear! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) + (target-board-exit) + (none) + ) + :trans (behavior () + (when (and (or (= (-> self control unknown-symbol02) #t) + (and (< (- (-> self clock frame-counter) (-> self board halfpipe-lip-time)) (seconds 0.1)) + (= (-> self board halfpipe-lip-event) 'lipramp) + ) + ) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (set! (-> self control unknown-symbol02) (the-as float 'done)) + (let ((v1-16 (new-stack-vector0)) + (f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-16 + (-> self control transv) + (the-as vector (vector-float*! v1-16 (-> self control dynam gravity-normal) f0-2)) + ) + (let* ((f1-4 (vector-length v1-16)) + (f2-0 f1-4) + ) + (if (!= f1-4 0.0) + (set! f1-4 0.0) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-2)) + (the-as vector (vector-float*! v1-16 v1-16 (/ f1-4 f2-0))) + ) + ) + ) + ) + (set! (-> self board halfpipe-time) (-> self clock frame-counter)) + (if (= (-> self control unknown-pat-surface01 mode) (pat-mode halfpipe)) + (set! (-> self board halfpipe-gspot-time) (-> self clock frame-counter)) + ) + (when (jump-hit-ground-stuck?) + (vector-float*! (-> self control transv) (-> self control transv) 1.5) + (go target-board-turn-to (-> self control transv) (seconds 0.5)) + ) + (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) + (>= (- (-> self clock frame-counter) (-> self board halfpipe-jump-time)) (seconds 0.6)) + (< (- (-> self clock frame-counter) (-> self state-time)) + (the-as time-frame (-> *TARGET-bank* ground-timeout)) + ) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (set! (-> self board halfpipe-jump-time) (-> self clock frame-counter)) + (vector-float*! (-> self control transv) (-> self control transv) 1.5) + ) + (target-board-spin-check) + (cond + ((> (-> self control unknown-time-frame17) 0) + (cond + ((< 0.7 (-> self control unknown-float10)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self control unknown-vector36 quad)) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 1.0) + (if (< 0.7 (vector-dot (-> self control unknown-vector08) gp-0)) + (+! (-> self control unknown-time-frame17) + (- (-> self clock frame-counter) (-> self clock old-frame-counter)) + ) + (set! (-> self control unknown-time-frame17) 1) + ) + ) + ) + (else + (set! (-> self control unknown-time-frame17) 1) + ) + ) + ) + ((and (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + (< (-> self board halfpipe-lip-time) (+ (-> self state-time) (seconds -0.2))) + ) + (set! (-> self control unknown-time-frame17) 1) + ) + ) + (when (or (>= (-> self control unknown-time-frame17) (seconds 0.05)) + (and (>= (- (-> self clock frame-counter) (-> self board halfpipe-gspot-time)) (seconds 0.5)) + (< (-> self board halfpipe-lip-time) (+ (-> self state-time) (seconds -0.2))) + ) + ) + (+! (-> self control transv x) (* 20480.0 (-> self control unknown-vector36 x))) + (+! (-> self control transv z) (* 20480.0 (-> self control unknown-vector36 z))) + (go target-board-stance) + ) + (target-board-halfpipe-trans) + (none) + ) + :code (behavior () + (cond + ((< (- (-> self clock frame-counter) (-> self board halfpipe-jump-time)) (seconds 0.5)) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 155) :num! (seek! (ja-aframe 8.0 0) 0.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 8.0 0) 0.5)) + ) + (ja-no-eval :group! (-> self draw art-group data 155) + :num! (seek! (ja-aframe 10.0 0) 0.2) + :frame-num (ja-aframe 8.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 10.0 0) 0.2)) + ) + (ja-no-eval :group! (-> self draw art-group data 155) + :num! (seek! (ja-aframe 12.0 0) 0.1) + :frame-num (ja-aframe 10.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 12.0 0) 0.1)) + ) + (sleep-code) + ) + (else + ((the-as (function none :behavior target) (-> target-board-stance code))) + ) + ) + (none) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-falling (target) + :event target-board-handler + :enter (behavior () + (if (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2) (not *pause-lock*)) + (set! (-> self control unknown-surface00) *board-air-mods*) + (set! (-> self control unknown-surface00) *board-jump-mods*) + ) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (none) + ) + :exit (-> target-board-halfpipe exit) + :trans (behavior () + (target-board-jump-trans) + (if (logtest? (focus-status halfpipe) (-> self focus-status)) + (target-board-halfpipe-trans) + ) + (when (and (= *cheat-mode* 'debug) + (and (cpad-hold? (-> self control unknown-cpad-info00 number) r2) (not *pause-lock*)) + ) + (set! (-> self control unknown-surface00) *board-air-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + ) + (none) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 (-> self draw art-group data 156))) + ) + ((let ((v1-8 (ja-group))) + (and v1-8 (= v1-8 (-> self draw art-group data 187))) + ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.5)) + ) + ((let ((v1-22 (ja-group))) + (and v1-22 (or (= v1-22 (-> self draw art-group data 178)) + (= v1-22 (-> self draw art-group data 182)) + (= v1-22 (-> self draw art-group data 159)) + (= v1-22 (-> self draw art-group data 181)) + ) + ) + ) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.2)) + ) + (else + (let ((v1-36 (ja-group))) + (cond + ((and v1-36 (= v1-36 (-> self draw art-group data 176))) + (ja-no-eval :num! (seek!)) + (ja-channel-push! 1 (seconds 0.1)) + ) + (else + (ja-channel-push! 1 (seconds 0.5)) + ) + ) + ) + ) + ) + ) + (cond + ((logtest? (focus-status halfpipe) (-> self focus-status)) + (ja :group! (-> self draw art-group data 152) :num! (identity (ja-aframe 0.0 0))) + (loop + (suspend) + (ja-blend-eval) + ) + ) + (else + (ja :group! (-> self draw art-group data 156)) + (loop + (suspend) + (ja-blend-eval) + (ja :num! (loop!)) + ) + ) + ) + (none) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-jump-kick (target) + :event target-board-handler + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self control unknown-surface00) *board-jump-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (sound-play "board-k-jump") + (none) + ) + :exit target-board-exit + :trans (behavior () + (if (jump-hit-ground-stuck?) + (go target-board-hit-ground) + ) + (target-board-smack-surface?) + (cond + ((< (- (-> self clock frame-counter) (-> self board smack-surface-time)) (seconds 0.2)) + (go target-board-wall-kick (-> self board smack-normal) (-> self board smack-speed)) + ) + ((< (- (-> self clock frame-counter) (-> self board glance-time)) (seconds 0.2)) + (go + target-board-wall-kick + (vector-normalize-copy! (-> self control unknown-vector38) (-> self board glance-out-transv) 1.0) + (-> self board glance-speed) + ) + ) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 154) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 154)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 2)) + (ja :group! (-> self draw art-group data 156)) + (until #f + (suspend) + (ja :num! (loop!)) + ) + #f + (none) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-wall-kick (target) + :event target-board-handler + :enter (behavior ((arg0 vector) (arg1 float)) + (sound-play "board-kick") + (set! (-> self control transv quad) (-> arg0 quad)) + (vector-xz-normalize! (-> self control transv) (* 0.8 arg1)) + (set! (-> self control unknown-word04) (the-as uint (fmax 81920.0 (* 0.8 arg1)))) + (set! (-> self control unknown-vector38 quad) (-> arg0 quad)) + (set! (-> self control transv y) 0.0) + (vector-turn-to (vector-negate! (new 'stack-no-clear 'vector) (-> self control transv))) + (set! (-> self control transv y) (- (sqrtf (* 24576.0 (-> self control dynam gravity-length))) + (* 0.008333334 (- (-> self control dynam gravity-length))) + ) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self control unknown-surface00) *board-wall-kick-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (set! (-> self board smack-surface-time) 0) + 0 + (none) + ) + :exit target-board-exit + :trans target-board-jump-trans + :code (behavior ((arg0 vector) (arg1 float)) + (ja-no-eval :group! (-> self draw art-group data 188) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 188)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (if (and (jump-hit-ground-stuck?) (< 31.0 (ja-aframe-num 0))) + (go target-board-hit-ground) + ) + (let ((v1-21 (-> self control unknown-vector38))) + (set! (-> self control transv x) (-> v1-21 x)) + (set! (-> self control transv z) (-> v1-21 z)) + ) + (vector-xz-normalize! (-> self control transv) (the-as float (-> self control unknown-word04))) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (suspend) + (ja :num! (seek!)) + ) + enter-state + (go target-board-falling) + (none) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-flip (target) + :event (-> target-board-jump event) + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (set! (-> self control unknown-word04) (the-as uint arg2)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control transv) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + (set! (-> self control dynam gravity-length) 245760.0) + (set! (-> self state-time) (-> self clock frame-counter)) + (cond + ((= arg2 'halfpipe) + (set! (-> self focus-status) (logior (focus-status halfpipe) (-> self focus-status))) + (target-board-halfpipe-trans) + ) + (else + (init-var-jump arg0 arg1 #t #f (-> self control transv) 1.0) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (set! (-> self control unknown-float36) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control unknown-float05))))) + ) + ) + ) + (set! (-> self control unknown-surface00) *board-flip-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (let ((v1-25 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-25 command) (sound-command set-param)) + (set! (-> v1-25 id) (-> self board unknown-sound-id02)) + (set! (-> v1-25 params volume) -4) + (set! (-> v1-25 auto-time) 72) + (set! (-> v1-25 auto-from) 2) + (set! (-> v1-25 params mask) (the-as uint 17)) + (-> v1-25 id) + ) + (set! (-> self control unknown-sound-id00) (sound-play "board-flip")) + (target-start-attack) + (target-danger-set! 'board-spin #f) + (none) + ) + :exit (behavior () + (target-danger-set! 'harmless #f) + (set! (-> self board flip-control) 0.0) + (add-to-trick-list + (-> self board) + (board-tricks board-flip) + (+ (* 500.0 (the float (-> self board flip-count))) (if (>= (-> self board flip-count) 2) + 2000.0 + 0.0 + ) + ) + ) + (let ((v1-9 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-9 command) (sound-command set-param)) + (set! (-> v1-9 id) (-> self control unknown-sound-id00)) + (set! (-> v1-9 params volume) -4) + (set! (-> v1-9 auto-time) 24) + (set! (-> v1-9 auto-from) 2) + (set! (-> v1-9 params mask) (the-as uint 17)) + (-> v1-9 id) + ) + ((-> target-board-halfpipe exit)) + (none) + ) + :trans (behavior () + (cond + ((= (-> self control unknown-spool-anim00) 'halfpipe) + (target-board-halfpipe-trans) + ) + (else + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 6))) + ) + ) + (mod-var-jump #t #f (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + (none) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (let ((gp-0 (>= (-> self board flip-control) 0.0))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 x) 0.0) + (set! (-> s5-0 y) 0.0) + (set! (-> s5-0 z) (* -0.0078125 (+ -128.0 (the float (-> self control unknown-cpad-info00 lefty))))) + (set! (-> s5-0 w) 1.0) + (let ((f0-9 (analog-input (the int (* 128.0 (-> s5-0 z))) 0.0 96.0 110.0 1.0)) + (s4-0 0) + ) + (while (not (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r1)) + ) + (or (= f0-9 0.0) (jump-hit-ground-stuck?) (< (target-time-to-ground) (seconds 0.5))) + ) + (nonzero? s4-0) + ) + ) + (cond + (gp-0 + (cond + ((zero? s4-0) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 159) :num! (seek! (ja-aframe 15.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 15.0 0))) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 181) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 181)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ((zero? s4-0) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 178) :num! (seek! (ja-aframe 10.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 10.0 0))) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 182) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 182)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (+! (-> self board flip-count) 1) + (set! f0-9 (analog-input (the int (* 128.0 (-> s5-0 z))) 0.0 96.0 110.0 1.0)) + (+! s4-0 1) + ) + ) + ) + (cond + (gp-0 + (ja-no-eval :group! (-> self draw art-group data 159) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 159)) frames num-frames) -1))) + :frame-num (ja-aframe 15.0 0) + ) + (until (ja-done? 0) + (if (jump-hit-ground-stuck?) + (go target-board-hit-ground) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 178) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 178)) frames num-frames) -1))) + :frame-num (ja-aframe 10.0 0) + ) + (until (ja-done? 0) + (if (jump-hit-ground-stuck?) + (go target-board-hit-ground) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (go target-board-falling) + (none) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-hold (target) + :event (-> target-board-jump event) + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (set! (-> self control unknown-word04) (the-as uint arg2)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control transv) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + (set! (-> self control dynam gravity-length) 245760.0) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self board unknown-time-frame04) (-> self clock frame-counter)) + (cond + ((= arg2 'halfpipe) + (set! (-> self focus-status) (logior (focus-status halfpipe) (-> self focus-status))) + (target-board-halfpipe-trans) + ) + (else + (init-var-jump arg0 arg1 #t #f (-> self control transv) 1.0) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (set! (-> self control unknown-float36) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control unknown-float05))))) + ) + ) + ) + (set! (-> self control unknown-surface00) *board-flip-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (set! (-> self control dynam gravity-length) 147456.0) + (none) + ) + :exit (behavior () + (set! (-> self board unknown-float01) 0.0) + (set! (-> self board unknown-time-frame05) (-> self clock frame-counter)) + (let ((v1-3 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-3 command) (sound-command set-param)) + (set! (-> v1-3 id) (-> self board unknown-sound-id01)) + (set! (-> v1-3 params volume) -4) + (set! (-> v1-3 auto-time) 24) + (set! (-> v1-3 auto-from) 2) + (set! (-> v1-3 params mask) (the-as uint 17)) + (-> v1-3 id) + ) + (let ((v1-7 (ja-group))) + (if (and v1-7 (= v1-7 (-> self draw art-group data 187))) + (sound-play "board-boots") + ) + ) + ((-> target-board-halfpipe exit)) + (none) + ) + :trans (behavior () + (target-board-spin-check) + (cond + ((= (-> self control unknown-spool-anim00) 'halfpipe) + (target-board-halfpipe-trans) + ) + (else + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 6))) + ) + ) + (mod-var-jump #t #f (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + (none) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 x) 0.0) + (set! (-> v1-0 y) 0.0) + (set! (-> v1-0 z) (* -0.0078125 (+ -128.0 (the float (-> self control unknown-cpad-info00 lefty))))) + (set! (-> v1-0 w) 1.0) + (let ((f30-0 (analog-input (the int (* 128.0 (-> v1-0 z))) 0.0 96.0 110.0 1.0))) + (while (not (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1)) + ) + (jump-hit-ground-stuck?) + (< (target-time-to-ground) (seconds 0.3)) + ) + ) + (cond + ((< f30-0 0.0) + (let ((v1-3 (ja-group))) + (cond + ((and v1-3 (= v1-3 (-> self draw art-group data 183))) + (ja :num! (loop!)) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-method) 500.0) + (set! (-> self board unknown-sound-id01) (sound-play "board-method")) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! (-> self draw art-group data 174) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 174)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja :group! (-> self draw art-group data 183) :num! min) + ) + ) + ) + ) + ((let ((v1-45 (ja-group))) + (and v1-45 (= v1-45 (-> self draw art-group data 185))) + ) + (ja :num! (loop!)) + ) + ((< 40960.0 (target-height-above-ground)) + (add-to-trick-list (-> self board) (board-tricks board-nosegrab) 500.0) + (set! (-> self board unknown-sound-id01) (sound-play "board-nosegrab")) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! (-> self draw art-group data 173) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 173)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja :group! (-> self draw art-group data 185) :num! min) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-noseflip) 500.0) + (set! (-> self board unknown-sound-id01) (sound-play "board-noseflip")) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! (-> self draw art-group data 187) :num! (seek! (ja-aframe 20.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 20.0 0))) + ) + (goto cfg-36) + ) + ) + (suspend) + ) + ) + ) + (label cfg-36) + (let ((v1-121 (ja-group))) + (cond + ((and v1-121 (= v1-121 (-> self draw art-group data 183))) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! (-> self draw art-group data 184) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 184)) frames num-frames) -1)) + 1.5 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ((let ((v1-151 (ja-group))) + (and v1-151 (= v1-151 (-> self draw art-group data 185))) + ) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! (-> self draw art-group data 186) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 186)) frames num-frames) -1)) + 1.5 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ) + ) + (let ((v1-179 (new-stack-vector0)) + (f0-48 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-179 + (-> self control transv) + (the-as vector (vector-float*! v1-179 (-> self control dynam gravity-normal) f0-48)) + ) + (let* ((f1-5 (vector-length v1-179)) + (f2-2 f1-5) + ) + (if (< 0.0 f0-48) + (set! f0-48 0.0) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-48)) + (the-as vector (vector-float*! v1-179 v1-179 (/ f1-5 f2-2))) + ) + ) + ) + (go target-board-falling) + (none) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-trickx (target) + :event (-> target-board-jump event) + :enter (-> target-board-hold enter) + :exit (behavior () + (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) + (sound-play "board-boots") + ((-> target-board-hold exit)) + (none) + ) + :trans (behavior () + (target-board-spin-check) + (when (!= (-> self control unknown-spool-anim00) 'halfpipe) + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 6))) + ) + ) + (mod-var-jump #t #f (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) + ) + (when (jump-hit-ground-stuck?) + (set! (-> self board jump-land-time) (-> self clock frame-counter)) + (go target-board-hit-ground) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + (none) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (let ((gp-0 (>= (-> self board unknown-float00) 0.0)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 x) 0.0) + (set! (-> s5-0 y) 0.0) + (set! (-> s5-0 z) (* -0.0078125 (+ -128.0 (the float (-> self control unknown-cpad-info00 lefty))))) + (set! (-> s5-0 w) 1.0) + (let ((f0-9 (analog-input (the int (* 128.0 (-> s5-0 z))) 0.0 96.0 110.0 1.0)) + (s4-0 0) + ) + (while (not (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r1)) + ) + (or (= f0-9 0.0) (jump-hit-ground-stuck?) (< (target-time-to-ground) (seconds 0.5))) + ) + (nonzero? s4-0) + ) + ) + (cond + (gp-0 + (add-to-trick-list (-> self board) (board-tricks board-kickflip) 500.0) + (set! (-> self board unknown-sound-id01) (sound-play "board-kickflip")) + (ja-channel-push! 1 (seconds 0.07)) + (ja-no-eval :group! (-> self draw art-group data 175) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 175)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (send-event (ppointer->process (-> self sidekick)) 'matrix #f) + (ja-no-eval :group! (-> self draw art-group data 192) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 192)) frames num-frames) -1)) + 1.05 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.05)) + ) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) + (ja-no-eval :group! (-> self draw art-group data 193) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 193)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (add-to-trick-list (-> self board) (board-tricks board-board-spin) 500.0) + (set! (-> self board unknown-sound-id01) (sound-play "board-boardspin")) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 176) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 176)) frames num-frames) -1)) + 0.95 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.95)) + ) + ) + ) + (+! (-> self board trickx-count) 1) + (set! f0-9 (analog-input (the int (* 128.0 (-> s5-0 z))) 0.0 96.0 110.0 1.0)) + (+! s4-0 1) + ) + ) + ) + (go target-board-falling) + (none) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-hit-ground (target) + :event target-board-handler + :enter (behavior () + (logclear! (-> self focus-status) (focus-status halfpipe)) + (if (= (-> self control ground-pat mode) (pat-mode halfpipe)) + (go target-board-turn-to (-> self control transv) (seconds 0.5)) + ) + (none) + ) + :exit target-board-exit + :trans (behavior () + (when (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? 'board) + ) + (flush-trick-list (-> self board)) + (go target-board-jump (-> *TARGET_BOARD-bank* jump-height-min) (-> *TARGET_BOARD-bank* jump-height-max) #f) + ) + (if (and (cpad-hold? (-> self control unknown-cpad-info00 number) l1) + (zero? (logand (-> self state-flags) (state-flags sf9))) + ) + (go target-board-duck-stance) + ) + (if (target-board-smack-surface?) + 0 + ) + (none) + ) + :code (behavior () + (set! (-> self control unknown-surface00) *board-walk-mods*) + (let ((v1-3 (ja-group))) + (cond + ((and v1-3 (or (= v1-3 (-> self draw art-group data 184)) (= v1-3 (-> self draw art-group data 186)))) + (ja-no-eval :num! (seek! max 1.5)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-18 (ja-group))) + (and v1-18 (= v1-18 (-> self draw art-group data 183))) + ) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! (-> self draw art-group data 184) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 184)) frames num-frames) -1)) + 1.5 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ((let ((v1-48 (ja-group))) + (and v1-48 (= v1-48 (-> self draw art-group data 185))) + ) + (ja-channel-push! 1 (seconds 0.08)) + (ja-no-eval :group! (-> self draw art-group data 186) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 186)) frames num-frames) -1)) + 1.5 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + ) + ) + (go target-board-stance) + (none) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-turn-to (target) + :event target-board-handler + :enter (behavior ((arg0 vector) (arg1 time-frame)) + (logclear! (-> self focus-status) (focus-status halfpipe)) + (when (!= (-> self control dynam gravity-length) 245760.0) + (let ((v1-6 (new-stack-vector0)) + (f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-6 + (-> self control transv) + (the-as vector (vector-float*! v1-6 (-> self control dynam gravity-normal) f0-2)) + ) + (let* ((f1-3 (vector-length v1-6)) + (f2-0 f1-3) + ) + (if (< f0-2 0.0) + (set! f0-2 (* 5.0 f0-2)) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-2)) + (the-as vector (vector-float*! v1-6 v1-6 (/ f1-3 f2-0))) + ) + ) + ) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self control unknown-surface00) *board-turn-to-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (set! (-> self control unknown-time-frame17) arg1) + (vector-normalize-copy! (-> self control unknown-vector38) arg0 1.0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control unknown-vector38) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (set! (-> self control unknown-time-frame00) (+ (-> self clock frame-counter) arg1)) + (none) + ) + :exit target-board-exit + :trans (behavior () + (when (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? 'board) + ) + (flush-trick-list (-> self board)) + (go target-board-jump (-> *TARGET_BOARD-bank* jump-height-min) (-> *TARGET_BOARD-bank* jump-height-max) #f) + ) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (-> self control unknown-time-frame17)) + (go target-board-stance) + ) + (target-board-anim-trans) + (when (board-on-ground?) + (let ((gp-0 (-> self board turn-anim-tilt?))) + (target-board-ground-check) + (set! (-> self board turn-anim-tilt?) gp-0) + ) + ) + (set! (-> self board turn-anim-targ) (* 10.0 (-> self board turn-anim-targ))) + (none) + ) + :code (-> target-board-stance code) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-ride-edge (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('edge-grab 'push-transv 'push-trans) + #f + ) + (('end-mode) + (when (-> arg3 param 0) + (let ((v1-6 (/ (- (-> self clock frame-counter) (-> self board ride-start-time)) 300))) + (if (> v1-6 0) + (add-to-trick-list (-> self board) (board-tricks board-rail) (* 100.0 (the float v1-6))) + ) + ) + ) + (go target-board-turn-to (-> self control transv) (seconds 0.2)) + ) + (else + (target-board-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior ((arg0 symbol) (arg1 object) (arg2 object) (arg3 float)) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self focus-status) (logior (focus-status rail) (-> self focus-status))) + (logior! (-> self control root-prim prim-core action) (collide-action can-ride)) + (set! (-> self control unknown-surface00) *board-ride-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (let ((v1-12 (-> self control unknown-vector00))) + (set! (-> self board ride-speed) (sqrtf (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z))))) + ) + (set! (-> self board ride-lean-targ) 0.0) + (set! (-> self board ride-lean) 0.0) + (set! (-> self board ride-leanv) 0.0) + (set! (-> self board ride-tilt-targ) 0.0) + (set! (-> self board ride-tilt) 0.0) + (set! (-> self board ride-tiltv) 0.0) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self board spin-control) 0.0) + (set! (-> self board flip-control) 0.0) + (set! (-> self board flip-count) 0) + (set! (-> self board unknown-float00) 0.0) + (set! (-> self board unknown-float01) 0.0) + (set! (-> self control unknown-word04) (the-as uint #t)) + (target-board-compute-edge) + (let ((f0-17 (vector-dot (-> self control unknown-matrix01 vector 2) (-> self control unknown-vector34)))) + (cond + ((< 0.7 f0-17) + (set! (-> self board ride-mode) (the-as uint 0)) + (set! (-> self board ride-rot) 0.0) + ) + ((< f0-17 -0.7) + (set! (-> self board ride-mode) (the-as uint 1)) + (set! (-> self board ride-rot) 32768.0) + ) + (else + (let ((f0-21 (vector-dot (the-as vector (-> self control unknown-matrix01)) (-> self control unknown-vector34)))) + (cond + ((< 0.7 f0-21) + (set! (-> self board ride-mode) (the-as uint 2)) + (set! (-> self board ride-rot) -16384.0) + ) + (else + (set! (-> self board ride-mode) (the-as uint 3)) + (set! (-> self board ride-rot) 16384.0) + ) + ) + ) + ) + ) + ) + (let ((f0-24 0.0)) + (if arg0 + (set! f0-24 (+ 250.0 f0-24)) + ) + (if (and (!= (-> self board ride-rot-old) -1.0) (!= (-> self board ride-rot) (-> self board ride-rot-old))) + (set! f0-24 (+ 500.0 f0-24)) + ) + (add-to-trick-list (-> self board) (board-tricks board-rail-jump) f0-24) + ) + (none) + ) + :exit (behavior () + (logclear! (-> self control status) (cshape-moving-flags csmf16)) + (let ((v1-2 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-2 command) (sound-command set-param)) + (set! (-> v1-2 id) (the-as sound-id (-> self board ride-sound-id))) + (set! (-> v1-2 params volume) -4) + (set! (-> v1-2 auto-time) 24) + (set! (-> v1-2 auto-from) 2) + (set! (-> v1-2 params mask) (the-as uint 17)) + (-> v1-2 id) + ) + ((-> target-board-stance exit)) + (set! (-> self neck flex-blend) 1.0) + (logclear! (-> self focus-status) (focus-status rail)) + (logclear! (-> self control root-prim prim-core action) (collide-action can-ride)) + (set! (-> self board ride-rot-old) (-> self board ride-rot)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self control trans quad)) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (if (collide-shape-moving-method-55 + (-> self control) + s5-0 + (logclear (-> self control root-prim prim-core collide-with) (collide-spec water)) + 8192.0 + 81920.0 + 1024.0 + ) + (set! (-> self control unknown-pat-surface01) (-> s5-0 best-other-tri pat)) + ) + ) + (if (< (-> self control trans y) (-> self control gspot-pos y)) + (set! (-> gp-0 quad) (-> self control gspot-pos quad)) + ) + (collide-shape-method-29 + (-> self control) + (vector+! (new 'stack-no-clear 'vector) gp-0 (new 'static 'vector :y 204.8 :w 1.0)) + ) + ) + (none) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (when (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? 'board) + ) + (let ((v1-15 (/ (- (-> self clock frame-counter) (-> self board ride-start-time)) 300))) + (if (> v1-15 0) + (add-to-trick-list (-> self board) (board-tricks board-rail) (* 100.0 (the float v1-15))) + ) + ) + (set! (-> self control trans y) (+ 1228.8 (-> self control trans y))) + (go + target-board-jump + (-> *TARGET_BOARD-bank* jump-height-min) + (-> *TARGET_BOARD-bank* jump-height-max) + (the-as symbol *board-ride-jump-mods*) + ) + ) + (if (cpad-pressed? (-> self control unknown-cpad-info00 number) circle square) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + (if (-> self control unknown-spool-anim00) + (set! (-> self board ride-button-time) (-> self clock frame-counter)) + ) + (set! (-> self board turn-anim-targ) (* (-> self board ride-lean) (- (-> *TARGET_BOARD-bank* turn-frames)))) + (cond + ((= (-> self board ride-speed) 0.0) + (let ((v1-43 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-43 command) (sound-command set-param)) + (set! (-> v1-43 id) (the-as sound-id (-> self board ride-sound-id))) + (set! (-> v1-43 params volume) -4) + (set! (-> v1-43 auto-time) 24) + (set! (-> v1-43 auto-from) 2) + (set! (-> v1-43 params mask) (the-as uint 17)) + (-> v1-43 id) + ) + ) + (else + (let ((f30-1 + (* (lerp-scale 0.7 1.0 (fabs (-> self board ride-lean)) 0.0 1.0) + (lerp-scale + 0.8 + 1.0 + (fabs (-> self board ride-speed)) + 0.0 + (* 0.5 (-> self control unknown-surface00 transv-max)) + ) + ) + ) + (f0-23 + (+ (lerp-scale 0.0 0.05 (fabs (-> self board ride-lean)) 0.0 1.0) + (lerp-scale + -0.05 + 0.0 + (fabs (-> self board ride-speed)) + 0.0 + (* 0.3 (-> self control unknown-surface00 transv-max)) + ) + ) + ) + ) + (sound-play-by-name + (static-sound-name "board-rail") + (the-as sound-id (-> self board ride-sound-id)) + (the int (* 1024.0 f30-1)) + (the int (* 1524.0 f0-23)) + 0 + (sound-group sfx) + #t + ) + ) + ) + ) + (when (< 4096.0 (-> self board ride-speed)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((v1-63 (-> self control trans)) + (a0-40 (-> self board ride-dir)) + (f0-27 -4096.0) + ) + (.lvf vf2 (&-> a0-40 quad)) + (.lvf vf1 (&-> v1-63 quad)) + (let ((v1-64 f0-27)) + (.mov vf3 v1-64) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> gp-0 quad) vf4) + (set! (-> *part-id-table* 431 init-specs 1 initial-valuef) + (lerp-scale + 0.1 + 2.0 + (fabs (-> self board ride-speed)) + 0.0 + (* 0.3 (-> self control unknown-surface00 transv-max)) + ) + ) + (let ((t9-10 sp-launch-particles-var) + (a0-42 *sp-particle-system-2d*) + (a1-12 (-> *part-id-table* 431)) + (a2-9 *launch-matrix*) + ) + (set! (-> a2-9 trans quad) (-> gp-0 quad)) + (t9-10 a0-42 a1-12 a2-9 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + (none) + ) + ) + :code (behavior ((arg0 symbol) (arg1 object) (arg2 object) (arg3 float)) + (let* ((v1-1 (-> self board ride-mode)) + (gp-0 (cond + ((zero? v1-1) + (-> self draw art-group data 167) + ) + ((= v1-1 1) + (-> self draw art-group data 166) + ) + ((= v1-1 2) + (-> self draw art-group data 169) + ) + ((= v1-1 3) + (-> self draw art-group data 168) + ) + (else + (the-as art-element #f) + ) + ) + ) + ) + (when (!= (ja-group) gp-0) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-0)) + ) + ) + (until #f + (ja :num-func num-func-identity + :frame-num (ja-aframe + (fmax + -5.0 + (fmin 5.0 (+ (* 3.0 (-> self board ride-lean)) + (* 0.5 (sin (* 145.63556 (the float (- (-> self clock frame-counter) (-> self state-time)))))) + ) + ) + ) + 0 + ) + ) + (suspend) + ) + #f + (none) + ) + :post (behavior () + (target-board-ride-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate target-board-grenade (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('target) + (handle->process (-> self control unknown-handle02)) + ) + (else + (target-board-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior ((arg0 handle)) + (set! (-> self focus-status) (logior (focus-status halfpipe) (-> self focus-status))) + (set! (-> self control unknown-handle02) arg0) + (set! (-> self state-time) (-> self clock frame-counter)) + (logior! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) + (set! (-> self control unknown-surface00) *board-halfpipe-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (let ((v1-12 (new-stack-vector0)) + (f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-12 + (-> self control transv) + (the-as vector (vector-float*! v1-12 (-> self control dynam gravity-normal) f0-1)) + ) + (let* ((f1-2 (vector-length v1-12)) + (f2-0 f1-2) + ) + (if (and (!= f1-2 0.0) (< 2.0 (/ f0-1 f1-2))) + (set! f1-2 0.0) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-1)) + (the-as vector (vector-float*! v1-12 v1-12 (/ f1-2 f2-0))) + ) + ) + ) + (none) + ) + :exit (behavior () + (send-event (handle->process (-> self control unknown-handle02)) 'exit) + ((-> target-board-halfpipe exit)) + (none) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (set! (-> self board halfpipe-time) (-> self clock frame-counter)) + (if (= (-> self control unknown-pat-surface01 mode) (pat-mode halfpipe)) + (set! (-> self board halfpipe-gspot-time) (-> self clock frame-counter)) + ) + (when (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) + (let ((v1-11 (-> self control transv))) + (let ((a0-8 (-> self control transv)) + (a1-2 (-> self control dynam gravity-normal)) + (f0-1 (* 122880.0 (-> self clock seconds-per-frame))) + ) + (.lvf vf2 (&-> a1-2 quad)) + (.lvf vf1 (&-> a0-8 quad)) + (let ((a0-9 f0-1)) + (.mov vf3 a0-9) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-11 quad) vf4) + ) + ) + (when (jump-hit-ground-stuck?) + (vector-float*! (-> self control transv) (-> self control transv) 1.5) + (go target-board-turn-to (-> self control transv) (seconds 0.5)) + ) + (when (>= (- (-> self clock frame-counter) (-> self board halfpipe-gspot-time)) (seconds 0.5)) + (+! (-> self control transv x) (* 20480.0 (-> self control unknown-vector36 x))) + (+! (-> self control transv z) (* 20480.0 (-> self control unknown-vector36 z))) + (go target-board-stance) + ) + (none) + ) + ) + :code (behavior ((arg0 handle)) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 172) :num! (seek! (ja-aframe 19.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 19.0 0))) + ) + (let ((a1-5 (-> self node-list data 41)) + (s5-2 (new 'stack-no-clear 'projectile-init-by-other-params)) + ) + (let ((a0-7 (handle->process arg0))) + (set! (-> s5-2 ent) (if a0-7 + (-> a0-7 entity) + ) + ) + ) + (set! (-> s5-2 charge) 0.1) + (set! (-> s5-2 options) (projectile-options)) + (set! (-> s5-2 notify-handle) (the-as handle #f)) + (set! (-> s5-2 owner-handle) (the-as handle #f)) + (set! (-> s5-2 ignore-handle) (process->handle self)) + (let* ((v1-24 *game-info*) + (a0-13 (+ (-> v1-24 attack-id) 1)) + ) + (set! (-> v1-24 attack-id) a0-13) + (set! (-> s5-2 attack-id) a0-13) + ) + (set! (-> s5-2 timeout) (new 'static 'handle :process #x4b0 :u64 #x4b0)) + (vector<-cspace! (-> s5-2 pos) a1-5) + (set! (-> s5-2 vel quad) (-> *zero-vector* quad)) + (spawn-projectile grenade s5-2 self *default-dead-pool*) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (sleep-code) + (none) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-get-on (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('attack 'attack-or-shove 'attack-invinc) + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as process (-> arg3 param 0)) + target-hit + ) + ) + (else + (target-generic-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior () + (set! (-> self board shock-offsetv) 0.0) + (set! (-> self state-time) (-> self clock frame-counter)) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (set! (-> self control unknown-surface00) *board-jump-mods*) + (set! (-> self board mods-backup) (-> self control unknown-surface00)) + (let ((a0-5 (target-time-to-ground))) + (cond + ((logtest? (water-flags touch-water) (-> self water flags)) + (let ((v1-10 (new-stack-vector0))) + (let ((f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-10 + (-> self control transv) + (the-as vector (vector-float*! v1-10 (-> self control dynam gravity-normal) f0-2)) + ) + ) + (let* ((f0-3 (vector-length v1-10)) + (f1-1 f0-3) + (f2-2 + (+ (fmax 0.0 (fmin 40960.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (* 0.33 (-> self control dynam gravity-length)) + ) + ) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-2)) + (the-as vector (vector-float*! v1-10 v1-10 (/ f0-3 f1-1))) + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #t)) + ) + ((< a0-5 (seconds 0.25)) + (let ((v1-12 (new-stack-vector0))) + (let ((f0-6 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-12 + (-> self control transv) + (the-as vector (vector-float*! v1-12 (-> self control dynam gravity-normal) f0-6)) + ) + ) + (let* ((f0-7 (vector-length v1-12)) + (f1-3 f0-7) + (f2-5 + (+ (fmax 0.0 (fmin 40960.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (* 0.0016666667 (the float (- (seconds 0.66) a0-5)) (-> self control dynam gravity-length)) + ) + ) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-5)) + (the-as vector (vector-float*! v1-12 v1-12 (/ f0-7 f1-3))) + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #t)) + ) + (else + (let ((v1-14 (new-stack-vector0))) + (let ((f0-10 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-14 + (-> self control transv) + (the-as vector (vector-float*! v1-14 (-> self control dynam gravity-normal) f0-10)) + ) + ) + (let* ((f0-11 (vector-length v1-14)) + (f1-5 f0-11) + (f2-7 (fmax 0.0 (fmin 40960.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))))) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-7)) + (the-as vector (vector-float*! v1-14 v1-14 (/ f0-11 f1-5))) + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + ) + ) + (let ((v1-17 (new-stack-vector0)) + (f0-14 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-17 + (-> self control transv) + (the-as vector (vector-float*! v1-17 (-> self control dynam gravity-normal) f0-14)) + ) + (let* ((f2-8 (vector-length v1-17)) + (f1-8 f2-8) + ) + (if (< 81920.0 f2-8) + (set! f2-8 81920.0) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-14)) + (the-as vector (vector-float*! v1-17 v1-17 (/ f2-8 f1-8))) + ) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + (none) + ) + :exit target-board-exit + :code (behavior () + (send-event (ppointer->process (-> self board board)) 'open) + (ja-channel-push! 1 (the-as time-frame (if (-> self control unknown-spool-anim00) + 9 + 60 + ) + ) + ) + (let ((f30-1 (if (-> self control unknown-spool-anim00) + 1.25 + (fmax 1.0 (fmin 2.0 (/ 249.99 (the float (target-time-to-ground))))) + ) + ) + ) + (ja-no-eval :group! (-> self draw art-group data 170) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 170)) frames num-frames) -1)) + f30-1 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (when (logtest? (-> self control status) (cshape-moving-flags on-surface)) + (set! (-> self board turn-anim-duck-vel) 0.0) + (goto cfg-19) + ) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + (set! (-> self board turn-anim-duck-vel) 15.0) + (while (not (jump-hit-ground-stuck?)) + (suspend) + ) + (label cfg-19) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) + (logior! (-> self control status) (cshape-moving-flags on-surface)) + (go target-board-hit-ground) + (none) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-pegasus (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('end-mode) + (go target-jump 16384.0 16384.0 (the-as surface #f)) + ) + (else + (target-generic-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior ((arg0 handle)) + (logclear! (-> self focus-status) (focus-status halfpipe)) + (set! (-> self board shock-offsetv) 0.0) + (set! (-> self state-time) (-> self clock frame-counter)) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (none) + ) + :exit target-board-exit + :code (behavior ((arg0 handle)) + (let ((s4-0 (-> self draw art-group data 195)) + (f30-0 0.0) + (s5-0 #t) + ) + (ja-channel-push! 1 (seconds 0.05)) + (set! (-> self control unknown-surface00) *empty-mods*) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) + (set! (-> self control unknown-vector39 quad) (-> self control quat vec quad)) + (ja :group! s4-0 + :num! (seek! (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) + :frame-num 0.0 + ) + (until #f + (let* ((s3-0 (handle->process arg0)) + (s4-1 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when s4-1 + (set! (-> self control unknown-vector38 quad) (-> (get-trans (the-as process-focusable s4-1) 0) quad)) + (set! (-> self control unknown-vector38 y) (+ 4096.0 (-> self control unknown-vector38 y))) + (let* ((s3-2 (-> self control unknown-vector40)) + (a0-15 (the-as process-focusable s4-1)) + (t9-4 (method-of-object a0-15 get-quat)) + ) + 0 + (set! (-> s3-2 quad) (-> (t9-4 a0-15) vec quad)) + ) + ) + (let ((f28-0 (sin (lerp-scale 0.0 16384.0 (ja-aframe-num 0) 0.0 30.0)))) + (let ((f26-0 f28-0)) + (vector-lerp! + (-> self control trans) + (-> self control unknown-vector37) + (-> self control unknown-vector38) + f28-0 + ) + (set! (-> self control trans y) + (lerp (-> self control unknown-vector37 y) (-> self control unknown-vector38 y) f26-0) + ) + ) + (quaternion-slerp! + (-> self control unknown-quaternion00) + (the-as quaternion (-> self control unknown-vector39)) + (the-as quaternion (-> self control unknown-vector40)) + f28-0 + ) + ) + (rot->dir-targ! (-> self control)) + (when s4-1 + (let ((s3-4 self)) + (set! self (the-as target s4-1)) + (set! f30-0 (ja-aframe-num 0)) + f30-0 + (set! self s3-4) + ) + (ja :num-func num-func-identity :frame-num (ja-aframe f30-0 0)) + ) + ) + (when (and s5-0 (>= f30-0 17.0)) + (send-event (ppointer->process (-> self board board)) 'close) + (logclear! (-> self focus-status) (focus-status board)) + (set! s5-0 #f) + ) + (suspend) + 0 + ) + ) + #f + (none) + ) + :post (behavior () + (set! (-> self control unknown-float30) 0.0) + (set! (-> self control unknown-float29) 0.0) + (vector-seek! (-> self control unknown-vector04) *null-vector* (* 16384.0 (-> self clock seconds-per-frame))) + (target-no-move-post) + (target-board-effect) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate target-board-get-off (target) + :event (-> target-board-get-on event) + :enter (behavior ((arg0 object) (arg1 symbol)) + (case arg1 + (('pegasus) + (go target-board-pegasus (the-as handle arg0)) + ) + ) + (logclear! (-> self focus-status) (focus-status halfpipe)) + (set! (-> self board shock-offsetv) 0.0) + (set! (-> self state-time) (-> self clock frame-counter)) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (set! (-> self control unknown-surface00) (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 131072.0 + :tiltvv 262144.0 + :transv-max 65536.0 + :target-speed 65536.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 30.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag check-edge air) + ) + ) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (let ((a0-6 (target-time-to-ground))) + (cond + ((< a0-6 (seconds 0.207)) + (let ((v1-16 (new-stack-vector0))) + (let ((f0-3 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-16 + (-> self control transv) + (the-as vector (vector-float*! v1-16 (-> self control dynam gravity-normal) f0-3)) + ) + ) + (let* ((f0-4 (vector-length v1-16)) + (f1-1 f0-4) + (f2-2 + (+ (fmax 0.0 (fmin 40960.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (* 0.0016666667 (the float (- (seconds 0.66) a0-6)) (-> self control dynam gravity-length)) + ) + ) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-2)) + (the-as vector (vector-float*! v1-16 v1-16 (/ f0-4 f1-1))) + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #t)) + ) + (else + (let ((v1-18 (new-stack-vector0))) + (let ((f0-7 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-18 + (-> self control transv) + (the-as vector (vector-float*! v1-18 (-> self control dynam gravity-normal) f0-7)) + ) + ) + (let* ((f0-8 (vector-length v1-18)) + (f1-3 f0-8) + (f2-4 (fmax 0.0 (fmin 40960.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))))) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-4)) + (the-as vector (vector-float*! v1-18 v1-18 (/ f0-8 f1-3))) + ) + ) + ) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + (none) + ) + :exit target-board-exit + :code (behavior ((arg0 object) (arg1 symbol)) + (local-vars (v1-116 symbol) (a0-35 int)) + (let ((f30-0 1.5151515)) + (let ((v1-1 arg1)) + (cond + ((= v1-1 'hit) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 194) :num! (seek! (ja-aframe 24.0 0) 2.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 24.0 0) 2.5)) + ) + ) + ((-> self control unknown-spool-anim00) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 191) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 191)) frames num-frames) -1)) + f30-0 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) + (ja-no-eval :group! (-> self draw art-group data 171) :num! (seek! (ja-aframe 24.0 0) f30-0) :frame-num 0.0) + (until (ja-done? 0) + (if (and (jump-hit-ground-stuck?) (>= (ja-aframe-num 0) 14.0)) + (go target-falling #f) + ) + (suspend) + (ja :num! (seek! (ja-aframe 24.0 0) f30-0)) + ) + ) + (else + (set! f30-0 (fmax 0.5 (fmin 2.0 (/ 150.0 (the float (target-time-to-ground)))))) + (ja-channel-push! 1 (seconds 0.1)) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) + (ja-no-eval :group! (-> self draw art-group data 171) + :num! (seek! (ja-aframe 24.0 0) f30-0) + :frame-num (ja-aframe 11.0 0) + ) + (until (ja-done? 0) + (if (and (jump-hit-ground-stuck?) (>= (ja-aframe-num 0) 14.0)) + (go target-falling #f) + ) + (suspend) + (ja :num! (seek! (ja-aframe 24.0 0) f30-0)) + ) + ) + ) + ) + (send-event (ppointer->process (-> self board board)) 'close) + (logclear! (-> self focus-status) (focus-status board)) + (ja-no-eval :num! (seek! max f30-0)) + ) + (while (let ((t9-36 ja-done?)) + (set! a0-35 0) + (not (t9-36 a0-35)) + ) + (if (jump-hit-ground-stuck?) + (go target-falling #f) + ) + (suspend) + (ja-eval) + ) + (set! (-> self board turn-anim-duck-vel) 15.0) + (if (and (board-on-ground?) + (let ((v1-114 #x100000)) + (set! a0-35 (the-as int (-> self water flags))) + (not (or (logtest? v1-114 (the-as water-flags a0-35)) + (begin + (let ((v1-117 #t)) + (set! a0-35 (the-as int (logand (-> self control status) (cshape-moving-flags on-water)))) + (set! a0-35 a0-35) + (cmove-#f-zero v1-116 (the-as cshape-moving-flags a0-35) v1-117) + ) + v1-116 + ) + ) + ) + ) + ) + (go target-hit-ground (the-as symbol a0-35)) + (go target-falling (if (= arg1 'hit) + 'hit + ) + ) + ) + (none) + ) + :post (behavior () + (set! (-> self control unknown-float30) 0.0) + (set! (-> self control unknown-float29) 0.0) + (vector-seek! (-> self control unknown-vector04) *null-vector* (* 16384.0 (-> self clock seconds-per-frame))) + (target-post) + (target-board-effect) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate target-board-grab (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (cond + ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + (-> self state name) + ) + (else + (case arg2 + (('end-mode) + (go target-board-stance) + ) + (('clone-anim) + (go target-board-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + ) + (('change-mode) + (case (-> arg3 param 0) + (('normal) + enter-state + 'stance + (go target-grab) + ) + ) + ) + (else + (target-generic-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (set! (-> self control unknown-surface00) *grab-mods*) + (set! (-> self neck flex-blend) 0.0) + (logior! (-> self state-flags) (state-flags sf2)) + (logior! (-> self focus-status) (focus-status grabbed)) + (logclear! (-> self focus-status) (focus-status halfpipe)) + (set! (-> self board stick-off) #t) + (none) + ) + :exit (behavior () + (set! (-> self board stick-off) #f) + (logclear! (-> self state-flags) (state-flags sf2)) + (logclear! (-> self focus-status) (focus-status grabbed)) + (logclear! (-> self water flags) (water-flags jump-out)) + (target-board-exit) + (none) + ) + :code (behavior ((arg0 symbol)) + (let ((v1-2 (ja-group))) + (when (not (and v1-2 (= v1-2 (-> self draw art-group data 151)))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 151) :num! (identity (ja-aframe 0.0 0))) + ) + ) + (until #f + (set-forward-vel 0.0) + (suspend) + ) + #f + (none) + ) + :post target-board-post + ) + +;; failed to figure out what this is: +(defstate target-board-clone-anim (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (if (and (= arg2 'trans) (= (-> arg3 param 0) 'restore)) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + ((-> target-board-grab event) arg0 arg1 arg2 arg3) + ) + :enter (-> target-clone-anim enter) + :exit (behavior () + (set! (-> self control unknown-vector04 y) (the-as float (-> self control unknown-word04))) + (set! (-> self control unknown-vector05 y) (-> self control unknown-vector04 y)) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'board) + ((-> target-clone-anim exit)) + ((-> target-board-start exit)) + (vector-reset! (-> self control transv)) + (none) + ) + :code (behavior ((arg0 handle)) + (set! (-> self control unknown-word04) (the-as uint (-> self control unknown-vector04 y))) + (set! (-> self control unknown-vector04 y) 0.0) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) + (clone-anim arg0 #t "") + (go target-board-stance) + (none) + ) + :post target-no-ja-move-post + ) + +;; failed to figure out what this is: +(defstate target-board-hit (target) + :event target-board-handler + :exit (behavior () + (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-death) (= v1-3 'target-board-get-off)) + ) + ) + ) + (logclear! (-> self focus-status) (focus-status dead hit)) + (logclear! (-> self state-flags) (state-flags disable-attacks)) + ) + (let ((gp-1 (logtest? (-> self focus-status) (focus-status hit)))) + (target-exit) + (if gp-1 + (logior! (-> self focus-status) (focus-status hit)) + ) + ) + (set! (-> self state-flags) (logior (state-flags lleg-no-ik rleg-no-ik) (-> self state-flags))) + (target-board-exit) + (none) + ) + :trans (behavior () + (when (= *cheat-mode* 'debug) + (when (and (not *pause-lock*) (cpad-hold? (-> self control unknown-cpad-info00 number) r2)) + (set! (-> self control unknown-time-frame30) (-> self clock frame-counter)) + (pickup-collectable! (-> self fact) (pickup-type health) 100.0 (the-as handle #f)) + (go target-board-stance) + ) + ) + (none) + ) + :code (behavior ((arg0 vector)) + (logclear! (-> self water flags) (water-flags jump-out)) + (logclear! (-> self focus-status) (focus-status halfpipe)) + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((gp-0 (-> self attack-info))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((v1-6 gp-0)) + (set! (-> v1-6 attacker) (the-as handle #f)) + (set! (-> v1-6 mode) 'generic) + (set! (-> v1-6 shove-back) 6144.0) + (set! (-> v1-6 shove-up) 4915.2) + (set! (-> v1-6 angle) #f) + (set! (-> v1-6 trans quad) (-> self control trans quad)) + (set! (-> v1-6 control) 0.0) + (set! (-> v1-6 invinc-time) (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout))) + (set! (-> v1-6 speed) 1.0) + (set! (-> v1-6 damage) (-> *FACT-bank* health-default-inc)) + (set! (-> v1-6 knock) (the-as uint 0)) + ) + (case arg0 + (('shove) + (let ((v1-9 gp-0)) + (set! (-> v1-9 shove-back) (-> *TARGET-bank* smack-surface-dist)) + (set! (-> v1-9 shove-up) (-> *TARGET-bank* smack-surface-height)) + (set! (-> v1-9 angle) 'shove) + ) + ) + ) + self + ((method-of-type attack-info attack-info-method-11)) + (when (zero? (logand (-> gp-0 mask) (attack-info-mask vector))) + (vector-z-quaternion! (-> gp-0 vector) (-> self control unknown-quaternion00)) + (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) + (set! (-> gp-0 vector y) (-> gp-0 shove-up)) + ) + (set! (-> s5-0 quad) (-> gp-0 vector quad)) + (let ((f0-12 (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-0 1.0) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00)) + ) + ) + ) + (if (not (-> self attack-info angle)) + (set! (-> self attack-info angle) (if (>= 0.0 f0-12) + 'front + 'back + ) + ) + ) + ) + (cond + ((= arg0 'attack) + (logior! (-> self focus-status) (focus-status hit)) + (set! (-> self game hit-time) (-> self clock frame-counter)) + (case (-> gp-0 mode) + (('endlessfall) + (cond + ((= (-> self game mode) 'debug) + (let ((s4-1 (new-stack-vector0))) + (set! (-> s4-1 quad) (-> self control unknown-vector23 quad)) + (ja-channel-set! 0) + (let ((s3-1 (-> self clock frame-counter))) + (until (>= (- (-> self clock frame-counter) s3-1) (seconds 1)) + (suspend) + ) + ) + (collide-shape-method-29 (-> self control) s4-1) + ) + (set! (-> self control unknown-vector15 quad) (-> self control trans quad)) + (send-event *camera* 'teleport) + (go target-stance) + ) + (else + (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) + (go target-death (-> gp-0 mode)) + ) + ) + ) + (('drown-death 'sharkey 'lava 'dark-eco-pool 'melt 'instant-death 'crush 'death 'grenade 'big-explosion 'bot) + (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) + (if (= (-> self game mode) 'play) + (go target-death (-> gp-0 mode)) + ) + ) + (('death) + (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) + ) + (else + (pickup-collectable! (-> self fact) (pickup-type health) (- (-> gp-0 damage)) (the-as handle #f)) + ) + ) + (target-hit-effect gp-0) + ) + (else + (case (-> gp-0 mode) + (('burn 'burnup) + (sound-play "get-burned") + ) + ) + ) + ) + (when (not (and (= (-> self game mode) 'play) (>= 0.0 (-> (the-as fact-info-target (-> self fact)) health)))) + (when (= (-> gp-0 knock) 8) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (set-forward-vel (* -3.0 (-> gp-0 shove-back))) + (when (demo?) + (if (nonzero? (talker-spawn-func (-> *talker-speech* 78) *entity-pool* (target-pos 0) (the-as region #f))) + (hide-hud-quick #f) + ) + ) + (go target-board-get-off #f 'hit) + ) + (if (= (-> gp-0 control) 1.0) + (go target-board-jump (-> gp-0 shove-up) (-> gp-0 shove-up) 'hit) + ) + ) + (set! (-> self control unknown-surface00) *smack-mods*) + (let ((v1-92 (ja-group))) + (when (not (and v1-92 (or (= v1-92 (-> self draw art-group data 158)) (= v1-92 (-> self draw art-group data 165))))) + (ja-channel-push! 1 (seconds 0.075)) + (if (or (= (-> gp-0 mode) 'shock) (= (-> gp-0 mode) 'shock-red) (= (-> gp-0 mode) 'shockup)) + (ja :group! (-> self draw art-group data 189) :num! min) + (ja :group! (-> self draw art-group data 158) :num! min) + ) + ) + ) + (target-hit-move gp-0 (target-hit-orient gp-0 s5-0) target-board-falling-anim-trans (-> gp-0 speed)) + ) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> (the-as fact-info-target (-> self fact)) health))) + (go target-death (-> gp-0 mode)) + ) + ) + enter-state + (go target-board-hit-ground) + (none) + ) + :post (behavior () + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (vector-float*! + (-> self control dynam gravity) + (-> self control dynam gravity-normal) + (the-as float (-> self control dynam gravity-length)) + ) + (target-post) + (target-board-effect) + (case (-> self attack-info mode) + (('shock 'shock-red 'shockup) + (when (>= (- (-> *display* game-clock frame-counter) (-> self shock-effect-time)) (seconds 0.03)) + (set! (-> self shock-effect-time) (-> *display* game-clock frame-counter)) + (send-event self 'color-effect 'shock 60) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 1) + lightning-probe-callback + (-> *part-id-table* 166) + 0 + 0 + 40960.0 + ) + ) + ) + ) + (target-board-joint-points) + (none) + ) + ) diff --git a/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc b/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc new file mode 100644 index 000000000..7f45a15a4 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc @@ -0,0 +1,2995 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *board-walk-mods*, type surface +(define *board-walk-mods* + (new 'static 'surface + :name 'run + :turnv 32768.0 + :turnvv 131072.0 + :tiltv 131072.0 + :tiltvv 2621440.0 + :transv-max 143360.0 + :target-speed 102400.0 + :seek0 0.5 + :seek90 0.5 + :seek180 0.5 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor -0.125 + :slide-factor 1.0 + :slope-up-factor 8192.0 + :slope-down-factor 24576.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 15.0 + :tiltvvf 15.0 + :vel-turn 65536.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (if (< 0.9 (-> self control surface-angle)) + (set! (-> self board on-flat-time) (-> self clock frame-counter)) + ) + (set! (-> self board slip-factor) + (lerp-scale 1.0 (-> arg0 slip-factor) (fabs (-> self control unknown-float24)) 0.0 1.0) + ) + (set! (-> arg0 slip-factor) (-> self board slip-factor)) + (set! (-> arg0 slope-up-factor) (-> arg1 slope-up-factor)) + (set! (-> arg0 slope-down-factor) (-> arg1 slope-down-factor)) + (set! (-> arg0 seek0) (lerp-scale + (* 0.1 (-> arg0 seek0)) + (-> arg0 seek0) + (the float (- (-> self clock frame-counter) (-> self board spin-time))) + 0.0 + 600.0 + ) + ) + (set! (-> arg0 seek90) (lerp-scale + (* 0.1 (-> arg0 seek90)) + (-> arg0 seek90) + (the float (- (-> self clock frame-counter) (-> self board spin-time))) + 0.0 + 600.0 + ) + ) + (set! (-> arg0 vel-turn) (lerp-scale + 131072.0 + (-> arg1 vel-turn) + (the float (- (-> self clock frame-counter) (-> self board spin-time))) + 0.0 + 600.0 + ) + ) + (set! (-> arg0 turnv) (lerp-scale + 91022.22 + (-> arg1 turnv) + (the float (- (-> self clock frame-counter) (-> self board spin-time))) + 0.0 + 600.0 + ) + ) + (when (< (- (-> self clock frame-counter) (-> self board spin-ground-start-time)) (seconds 0.3)) + (set! (-> self control unknown-time-frame12) (-> self clock frame-counter)) + (set! (-> self board spin-ground-time) (-> self clock frame-counter)) + (set! (-> arg0 seek0) (* 0.1 (-> arg0 seek0))) + (set! (-> arg0 seek90) (* 0.1 (-> arg0 seek90))) + (set! (-> arg0 vel-turn) 131072.0) + (set! (-> arg0 turnv) 91022.22) + ) + ) + ) + (none) + ) + :flags (surface-flag turn-to-pad) + ) + ) + +;; definition for symbol *board-duck-mods*, type surface +(define *board-duck-mods* (new 'static 'surface + :name 'duck + :turnv 21845.334 + :turnvv 131072.0 + :tiltv 131072.0 + :tiltvv 2621440.0 + :transv-max 151552.0 + :target-speed 102400.0 + :seek0 0.5 + :seek90 0.5 + :seek180 0.5 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 0.5 + :slide-factor 1.0 + :slope-up-factor 8192.0 + :slope-down-factor 24576.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 0.75 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 15.0 + :tiltvvf 15.0 + :vel-turn 65536.0 + :flags (surface-flag no-turn-around turn-to-pad duck) + ) + ) + +;; failed to figure out what this is: +(set! (-> *board-duck-mods* mult-hook) (-> *board-walk-mods* mult-hook)) + +;; definition for symbol *board-air-mods*, type surface +(define *board-air-mods* (new 'static 'surface + :name 'air + :turnv 49152.0 + :turnvv 131072.0 + :tiltv 16384.0 + :tiltvv 131072.0 + :transv-max 143360.0 + :target-speed 102400.0 + :seek0 0.8 + :seek90 0.8 + :seek180 0.8 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 8192.0 + :slope-down-factor 24576.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 60.0 + :vel-turn 65536.0 + :mode 'air + :flags (surface-flag no-turn-around turn-to-pad check-edge air) + ) + ) + +;; definition for symbol *board-jump-mods*, type surface +(define *board-jump-mods* (new 'static 'surface + :name 'jump + :turnv 49152.0 + :turnvv 524288.0 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 143360.0 + :target-speed 102400.0 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 30.0 + :tiltvvf 18.0 + :vel-turn 10922.667 + :mode 'air + :flags (surface-flag no-turn-around turn-to-pad check-edge air) + ) + ) + +;; definition for symbol *board-ride-jump-mods*, type surface +(define *board-ride-jump-mods* + (new 'static 'surface + :name 'jump + :turnv 49152.0 + :turnvv 32768.0 + :tiltv 32768.0 + :tiltvv 131072.0 + :transv-max 143360.0 + :target-speed 102400.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 300.0 + :tiltvf 30.0 + :tiltvvf 18.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (case arg3 + ((1) + (when (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + (let* ((f30-0 (* 122880.0 (-> self control unknown-float10) (-> self clock seconds-per-frame))) + (a2-1 (-> self board ride-dir)) + (v1-12 (vector-flatten! (new 'stack-no-clear 'vector) (-> self control unknown-vector08) a2-1)) + (v0-3 (-> self control transv)) + ) + (let ((a0-6 (-> self control transv))) + (.lvf vf2 (&-> v1-12 quad)) + (.lvf vf1 (&-> a0-6 quad)) + ) + (let ((v1-13 f30-0)) + (.mov vf3 v1-13) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v0-3 quad) vf4) + ) + ) + ) + ) + (none) + ) + ) + :mode 'air + :flags (surface-flag no-turn-around turn-to-pad check-edge air) + ) + ) + +;; definition for symbol *board-duck-jump-mods*, type surface +(define *board-duck-jump-mods* *board-jump-mods*) + +;; definition for symbol *board-spin-mods*, type surface +(define *board-spin-mods* (copy *board-jump-mods* 'global)) + +;; failed to figure out what this is: +(let ((v1-10 *board-spin-mods*)) + (set! (-> v1-10 name) 'spin) + (set! (-> v1-10 flags) (surface-flag no-turn-around check-edge air)) + (set! (-> v1-10 seek0) 0.0) + (set! (-> v1-10 seek90) 0.0) + (set! (-> v1-10 seek180) 0.0) + (set! (-> v1-10 vel-turn) 0.0) + (set! (-> v1-10 turnv) 0.0) + (set! (-> v1-10 turnvv) 0.0) + (set! (-> v1-10 tiltv) 0.0) + (set! (-> v1-10 tiltvf) 0.0) + ) + +;; failed to figure out what this is: +(let ((v1-12 (copy *board-jump-mods* 'global))) + (set! (-> v1-12 seek0) 0.0) + (set! (-> v1-12 seek90) 0.0) + (set! (-> v1-12 seek180) 0.0) + (set! (-> v1-12 vel-turn) 0.0) + (set! *board-spin-post-mods* v1-12) + ) + +;; failed to figure out what this is: +(let ((v1-14 (copy *board-duck-jump-mods* 'global))) + (set! (-> v1-14 flags) (surface-flag no-turn-around turn-to-vel air)) + (set! (-> v1-14 seek0) 0.0) + (set! (-> v1-14 seek90) 0.0) + (set! (-> v1-14 seek180) 0.0) + (set! (-> v1-14 vel-turn) 0.0) + (set! (-> v1-14 turnv) 49152.0) + (set! (-> v1-14 turnvf) 30.0) + (set! (-> v1-14 turnvv) 0.0) + (set! (-> v1-14 turnvvf) 0.0) + (set! *board-flip-mods* v1-14) + ) + +;; definition for symbol *board-wall-kick-mods*, type surface +(define *board-wall-kick-mods* + (new 'static 'surface + :name 'jump + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 143360.0 + :target-speed 102400.0 + :seek180 0.8 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 0.8 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :tiltvf 150.0 + :tiltvvf 60.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (when (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.05)) + (set! (-> arg0 turnv) 0.0) + (set! (-> arg0 turnvf) 0.0) + ) + ) + ) + (none) + ) + :mode 'air + :flags (surface-flag no-turn-around turn-to-vel air) + ) + ) + +;; definition for symbol *board-halfpipe-mods*, type surface +(define *board-halfpipe-mods* (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 16384.0 + :tiltvv 131072.0 + :transv-max 143360.0 + :target-speed 102400.0 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 60.0 + :mode 'air + :flags (surface-flag no-turn-around turn-to-vel air turn-when-centered) + ) + ) + +;; definition for symbol *board-turn-to-mods*, type surface +(define *board-turn-to-mods* (new 'static 'surface + :name 'run + :turnv 524288.0 + :tiltv 131072.0 + :tiltvv 2621440.0 + :transv-max 143360.0 + :target-speed 102400.0 + :seek0 0.5 + :seek90 0.5 + :seek180 0.5 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 0.5 + :slide-factor 1.0 + :slope-up-factor 8192.0 + :slope-down-factor 24576.0 + :slope-slip-angle 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 1.0 + :turnvf 30.0 + :tiltvf 15.0 + :tiltvvf 15.0 + :vel-turn 65536.0 + :flags (surface-flag no-turn-around turn-to-vel turn-when-centered) + ) + ) + +;; failed to figure out what this is: +(set! (-> *board-turn-to-mods* mult-hook) (-> *board-walk-mods* mult-hook)) + +;; definition for symbol *board-ride-mods*, type surface +(define *board-ride-mods* (new 'static 'surface + :name 'run + :turnv 218453.33 + :turnvv 131072.0 + :tiltv 131072.0 + :tiltvv 262144.0 + :transv-max 143360.0 + :target-speed 40960.0 + :seek0 0.5 + :seek90 0.5 + :seek180 0.5 + :fric 0.1 + :nonlin-fric-dist 1.0 + :slip-factor 0.6 + :slide-factor 1.0 + :slope-up-factor 24576.0 + :slope-down-factor 49152.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 60.0 + :tiltvvf 30.0 + :mult-hook (lambda ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (set! (-> arg0 slope-up-factor) (-> arg1 slope-up-factor)) + (set! (-> arg0 slope-down-factor) (-> arg1 slope-down-factor)) + ) + ) + (none) + ) + :mode 'ride + :flags (surface-flag no-turn-around turn-to-pad check-edge turn-when-centered) + ) + ) + +;; definition for symbol *collide-edge-board-halfpipe-spec*, type collide-edge-spec +(define *collide-edge-board-halfpipe-spec* (new 'static 'collide-edge-spec + :split-dists (new 'static 'array float 2 1024.0 1433.6) + :outward-offset (new 'static 'vector :x 708.608 :y 13312.0 :w 1.0) + :flags #x8 + :max-dist-sqrd-to-outward-pt 150994940.0 + :max-dir-cosa-delta -1.0 + :max-dir-cosa-player -2.0 + :touching-segment #f + :local-cache-fill-box (new 'static 'bounding-box + :min (new 'static 'vector :x -8192.0 :y -16384.0 :z -8192.0 :w 1.0) + :max (new 'static 'vector :x 8192.0 :y 16384.0 :z 8192.0 :w 1.0) + ) + :local-within-reach-box (new 'static 'bounding-box + :min (new 'static 'vector :x -7987.2 :y -16179.2 :z -7987.2 :w 1.0) + :max (new 'static 'vector :x 7987.2 :y 16179.2 :z 7987.2 :w 1.0) + ) + :local-player-spheres (new 'static 'inline-array sphere 12 + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x -737.28 :y 4096.0 :r 3072.0) + (new 'static 'sphere :x -737.28 :y 6553.6 :r 3072.0) + (new 'static 'sphere :x -737.28 :y 9420.8 :r 3072.0) + (new 'static 'sphere :x 1720.32 :y 3686.4 :r 2949.12) + (new 'static 'sphere :x 1720.32 :y 5734.4 :r 2949.12) + (new 'static 'sphere :x 1720.32 :y 8601.6 :r 2949.12) + ) + ) + ) + +;; definition for function target-board-handler +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function target-board-setup +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-setup target ((arg0 symbol)) + (when (zero? (-> self board)) + (set! (-> self board) (new 'process 'board-info)) + (set! (-> self board process) (the-as (pointer target) (process->ppointer self))) + (set! (-> self board latch?) #f) + (set! (-> self board engine-sound-id) (the-as uint (new-sound-id))) + (set! (-> self board ride-sound-id) (the-as uint (new-sound-id))) + (set! (-> self board spin-sound-id) (the-as uint 0)) + (set! (-> self board wind-sound-id) (the-as uint (new-sound-id))) + (set! (-> self board bank-sound-id) (the-as uint (new-sound-id))) + (let* ((v1-10 (-> self game)) + (a0-5 (+ (-> v1-10 attack-id) 1)) + ) + (set! (-> v1-10 attack-id) a0-5) + (set! (-> self board attack-id) a0-5) + ) + (set! (-> self board board) (the-as (pointer board) #f)) + ) + (cond + (arg0 + (if (not (-> self board board)) + (set! (-> self board board) (process-spawn board :init board-init :from *8k-dead-pool* :to self)) + ) + ) + (else + (when (-> self board board) + (deactivate (-> self board board 0)) + (set! (-> self board board) (the-as (pointer board) #f)) + ) + ) + ) + 0 + (none) + ) + +;; definition for function target-board-init +(defbehavior target-board-init target () + (target-gun-end-mode #f) + (target-exit) + (target-board-setup #t) + (set! (-> self board latch?) #f) + (if (zero? (-> self board main)) + (set! (-> self board main) (new 'process 'joint-mod (joint-mod-mode flex-blend) self 3)) + ) + (if (zero? (-> self board upper-body)) + (set! (-> self board upper-body) (new 'process 'joint-mod (joint-mod-mode flex-blend) self 5)) + ) + (if (zero? (-> self board part-control)) + (set! (-> self board part-control) (create-launch-control (-> *part-group-id-table* 118) self)) + ) + (mode-set! (-> self board main) (joint-mod-mode flex-blend)) + (mode-set! (-> self board upper-body) (joint-mod-mode flex-blend)) + (set! (-> self board engine-sound-pitch) 0.0) + (set! (-> self board engine-sound-volume) 1.0) + (set! (-> self board bank-sound-pitch) 0.0) + (set! (-> self board bank-sound-volume) 0.0) + (set! (-> self board wind-sound-pitch) 0.0) + (set! (-> self board wind-sound-volume) 1.0) + (set! (-> self board spin-sound-volume) 0.0) + (set! (-> self board sound-air-knob) 0.0) + (set! (-> self board sound-bank-knob) 0.0) + (set! (-> self board unknown-sound-id00) (new 'static 'sound-id)) + (set-setting! 'mode-sound-bank 'board 0 0) + (set-setting! 'sound-flava #f #x41f00000 2) + (set! (-> self board board-get-on-time) (-> self clock frame-counter)) + (set! (-> self board stick-lock) #f) + (set! (-> self board stick-off) #f) + (set! (-> self board unstuck-time) (-> self clock frame-counter)) + (set! (-> self board stuck-count) 0) + (set! (-> self board slip-factor) 1.0) + (set! (-> self board unknown-symbol00) #f) + (set! (-> self board halfpipe-side-time) 0) + (set! (-> self board spin-control) 0.0) + (set! (-> self board trotyv) 0.0) + (set! (-> self board troty) 0.0) + (set! (-> self board troty-cum) 0.0) + (set! (-> self board unknown-deg00) 0.0) + (set! (-> self board flip-control) 0.0) + (set! (-> self board flip-count) 0) + (set! (-> self board unknown-float00) 0.0) + (set! (-> self board unknown-float01) 0.0) + (set! (-> self board trick-count) 0) + (countdown (v1-62 16) + (set! (-> self board trick-list 0) (board-tricks none)) + ) + (set! (-> self board upper-body-rotyv) 0.0) + (set! (-> self board upper-body-roty) 0.0) + (set! (-> self board upper-body-rotyv-max) 91022.22) + (set! (-> self board ride-lock) #f) + (set! (-> self board ride-lock-on) #f) + (set! (-> self board ride-rot-old) -1.0) + (set! (-> self control reaction) target-collision-reaction) + (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :noboard #x1 :probe #x1)) + (set! (-> self focus-status) (logior (focus-status board) (-> self focus-status))) + (logclear! (-> self control root-prim prim-core action) (collide-action can-ride)) + (set! (-> self control unknown-float29) 1.0) + (let ((v1-82 (-> self node-list data))) + (set! (-> v1-82 0 param0) cspace<-transformq+world-trans!) + (set! (-> v1-82 0 param1) (the-as basic (-> self control trans))) + (set! (-> v1-82 0 param2) (the-as basic (-> self control unknown-vector05))) + ) + (target-collide-set! 'board 0.0) + (set! (-> self state-flags) (logior (state-flags lleg-no-ik rleg-no-ik) (-> self state-flags))) + (set! (-> self board thrust-scale) 1.0) + (set! (-> self board turn-anim-targ) 0.0) + (set! (-> self board turn-anim-frame) 0.0) + (set! (-> self board turn-anim-vel) 0.0) + (set! (-> self board turn-anim-duck) 0.0) + (set! (-> self board turn-anim-tilt?) #f) + (set! (-> self board cushion-base) 0.0) + (set! (-> self board cushion-offset) 0.0) + (set! (-> self board shock-offset) 0.0) + (set! (-> self board shock-offsetv) 0.0) + (set! (-> self board shock-rotx) 0.0) + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (vector-float*! + (-> self control dynam gravity) + (-> self control dynam gravity-normal) + (the-as float (-> self control dynam gravity-length)) + ) + (set-setting! 'string-spline-max-move 'abs #x46000000 0) + (set-setting! 'string-spline-accel 'abs #x433851ec 0) + (set-setting! 'string-spline-max-move-player 'abs #x45c00000 0) + (set-setting! 'string-spline-accel-player 'abs #x430f5c29 0) + (none) + ) + +;; definition for function target-board-exit +;; INFO: Used lq/sq +(defbehavior target-board-exit target () + (when (not (and (-> self next-state) + (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-board-stance) + (= v1-3 'target-board-jump) + (= v1-3 'target-board-hit-ground) + (= v1-3 'target-board-jump-kick) + (= v1-3 'target-board-wall-kick) + (= v1-3 'target-board-ride-edge) + (= v1-3 'target-board-duck-stance) + (= v1-3 'target-board-falling) + (= v1-3 'target-board-flip) + (= v1-3 'target-board-trickx) + (= v1-3 'target-board-hold) + (= v1-3 'target-board-halfpipe) + (= v1-3 'target-board-grenade) + (= v1-3 'target-board-turn-to) + (= v1-3 'target-board-hit) + (= v1-3 'target-board-get-off) + (= v1-3 'target-board-pegasus) + (= v1-3 'target-board-grab) + (= v1-3 'target-board-clone-anim) + ) + ) + ) + ) + (set! (-> self board latch?) #f) + (mode-set! (-> self board main) (joint-mod-mode flex-blend)) + (mode-set! (-> self board upper-body) (joint-mod-mode flex-blend)) + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (vector-float*! + (-> self control dynam gravity) + (-> self control dynam gravity-normal) + (the-as float (-> self control dynam gravity-length)) + ) + (logclear! (-> self focus-status) (focus-status board)) + (logclear! (-> self control root-prim prim-core action) (collide-action stuck-wall-escape no-normal-reset)) + (logior! (-> self control root-prim prim-core action) (collide-action can-ride)) + (set! (-> self control unknown-surface00) *walk-mods*) + (logclear! (-> self state-flags) (state-flags sf6)) + (remove-setting! 'string-spline-max-move) + (remove-setting! 'string-spline-accel) + (remove-setting! 'string-spline-max-move-player) + (remove-setting! 'string-spline-accel-player) + (let ((v1-43 (-> self node-list data))) + (set! (-> v1-43 0 param0) cspace<-transformq+trans!) + (set! (-> v1-43 0 param1) (the-as basic (-> self control trans))) + (set! (-> v1-43 0 param2) (the-as basic (-> self control unknown-vector05))) + ) + (target-collide-set! 'normal 0.0) + (set! (-> self control reaction) target-collision-reaction) + (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1)) + (sound-stop (the-as sound-id (-> self board wind-sound-id))) + (sound-stop (the-as sound-id (-> self board engine-sound-id))) + (sound-stop (the-as sound-id (-> self board bank-sound-id))) + (sound-stop (the-as sound-id (-> self board ride-sound-id))) + (sound-stop (the-as sound-id (-> self board spin-sound-id))) + (set! (-> self board spin-sound-id) (the-as uint 0)) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'normal) + (set! (-> self control unknown-vector05 quad) (the-as uint128 0)) + (remove-setting! 'sound-flava) + (remove-setting! 'mode-sound-bank) + (target-exit) + ) + (none) + ) + +;; definition for function target-board-falling-anim-trans +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-falling-anim-trans target () + (let ((v1-2 (ja-group))) + (cond + ((not (and v1-2 (= v1-2 (-> self draw art-group data 156)))) + (ja-channel-push! 1 (seconds 0.33)) + (ja :group! (-> self draw art-group data 156)) + ) + ((let ((v1-11 (ja-group))) + (and v1-11 (= v1-11 (-> self draw art-group data 156))) + ) + (ja :num! (loop!)) + ) + ) + ) + 0 + (none) + ) + +;; definition for function board-on-ground? +(defbehavior board-on-ground? target () + (logtest? (-> self control status) (cshape-moving-flags on-surface)) + ) + +;; definition for function target-board-smack-surface? +;; INFO: Used lq/sq +(defbehavior target-board-smack-surface? target () + (when (and (logtest? (-> self control status) (cshape-moving-flags t-wall)) + (< (+ (-> self clock frame-counter) (seconds -0.05)) (-> self control unknown-time-frame07)) + (< 0.7 (-> self control touch-angle)) + (< 73728.0 (-> self control unknown-float05)) + (and (< (vector-dot (-> self control unknown-vector25) (-> self control dynam gravity-normal)) 0.3) + (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + ) + ) + (set! (-> self board smack-surface-time) (-> self clock frame-counter)) + (set! (-> self board smack-speed) (-> self control unknown-float05)) + (set! (-> self board smack-normal quad) (-> self control unknown-vector25 quad)) + #t + ) + ) + +;; definition for function board-add-thrust +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior board-add-thrust target () + (let ((gp-0 (-> self control unknown-vector00))) + (let* ((v1-1 gp-0) + (f0-7 (cond + ((= (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))) 0.0) + 0.0 + ) + (else + (let ((f0-5 (-> gp-0 z)) + (v1-4 gp-0) + ) + (/ f0-5 (sqrtf (+ (* (-> v1-4 x) (-> v1-4 x)) (* (-> v1-4 z) (-> v1-4 z))))) + ) + ) + ) + ) + (f30-0 (if (>= f0-7 0.0) + (+ (* f0-7 (-> self control unknown-surface01 seek0)) + (* (- 1.0 f0-7) (-> self control unknown-surface01 seek90)) + ) + (+ (* (fabs f0-7) (-> self control unknown-surface01 seek180)) + (* (+ 1.0 f0-7) (-> self control unknown-surface01 seek90)) + ) + ) + ) + (f28-0 (cond + ((-> self board stick-off) + 0.0 + ) + ((= (-> self control ground-pat mode) (pat-mode halfpipe)) + 1.0 + ) + (*target-rc-board-controls* + 1.0 + ) + ((< (-> gp-0 z) 0.0) + (fmax 0.75 (-> self control unknown-float10)) + ) + (else + (-> self control unknown-float10) + ) + ) + ) + ) + (when (not (or (= (-> self control unknown-surface01 vel-turn) 0.0) (< (-> gp-0 z) 0.0))) + (let ((f0-22 (atan (-> gp-0 x) (-> gp-0 z)))) + (vector-rotate-y! + gp-0 + gp-0 + (fmin + (* 0.03 (-> self clock time-adjust-ratio) (- f0-22)) + (* (-> self control unknown-surface01 vel-turn) (-> self clock seconds-per-frame)) + ) + ) + ) + ) + (let* ((f0-28 (* f30-0 (-> self board thrust-scale) (lerp-scale 0.4 1.0 f28-0 0.3 1.0))) + (f1-22 (-> self control unknown-surface01 target-speed)) + (f1-23 + (if (< (-> self control unknown-float17) 0.0) + (+ f1-22 (* (- (-> self control unknown-float17)) (-> self control unknown-surface01 slope-down-factor))) + (+ f1-22 (* (- (-> self control unknown-float17)) (-> self control unknown-surface01 slope-up-factor))) + ) + ) + ) + (when (-> self board stick-off) + (set! f0-28 0.0) + (set! f1-23 0.0) + ) + (when (and (< (- (-> self clock frame-counter) (-> self control unknown-time-frame07)) (seconds 1)) + (>= f28-0 0.5) + (< (vector-dot (-> self control unknown-vector25) (-> self control unknown-vector08)) -0.7) + (logtest? (-> self control unknown-surface00 flags) (surface-flag air)) + (< 0.0 (-> gp-0 y)) + ) + (cond + ((and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame07)) (seconds 0.1)) + (< 0.3 (-> self control unknown-float27)) + ) + (set! f0-28 f1-23) + ) + ((< (-> gp-0 z) 0.0) + (set! (-> gp-0 z) 0.0) + ) + ) + ) + (+! (-> gp-0 z) (* f0-28 (-> self clock seconds-per-frame))) + (when (!= f1-23 0.0) + (let ((f0-33 (- 1.0 (/ (* f30-0 (-> self clock seconds-per-frame)) f1-23)))) + (set! (-> gp-0 x) (* (-> gp-0 x) f0-33)) + (set! (-> gp-0 z) (* (-> gp-0 z) f0-33)) + ) + ) + (set! (-> self board transv-max) f1-23) + ) + ) + (let ((f0-35 (-> self control unknown-surface01 transv-max)) + (v1-87 gp-0) + ) + (if (>= (sqrtf (+ (* (-> v1-87 x) (-> v1-87 x)) (* (-> v1-87 z) (-> v1-87 z)))) f0-35) + (vector-xz-normalize! gp-0 f0-35) + ) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-matrix*! s5-0 gp-0 (-> self control unknown-matrix01)) + (vector-float*! s5-0 s5-0 0.5) + (vector+! s5-0 s5-0 (-> self control trans)) + (add-debug-text-sphere + *display-target-marks* + (bucket-id debug-no-zbuf1) + s5-0 + (meters 0.2) + "ltransv" + (the-as rgba (-> (new 'static 'array uint64 1 #x8000ff00) 0)) + ) + (set! (-> s5-0 quad) (-> self control unknwon-vector27 quad)) + (vector-float*! s5-0 s5-0 0.5) + (vector+! s5-0 s5-0 (-> self control trans)) + (add-debug-text-sphere + *display-target-marks* + (bucket-id debug-no-zbuf1) + s5-0 + (meters 0.2) + "btransv" + (the-as rgba (-> (new 'static 'array uint64 1 #x80ffffff) 0)) + ) + ) + ) + 0 + (none) + ) + +;; definition for function segment-array-vector->index +(defun segment-array-vector->index ((arg0 (inline-array vector)) (arg1 int) (arg2 float) (arg3 float)) + (let ((gp-0 -1) + (f30-0 0.0) + (f0-0 0.0) + ) + (while (< (+ gp-0 1) arg1) + (+! gp-0 1) + (set! f30-0 (vector-segment-overlap (the-as vector arg2) (-> arg0 gp-0) (-> arg0 (+ gp-0 1)))) + (set! f0-0 (/ arg3 (vector-vector-distance (-> arg0 gp-0) (-> arg0 (+ gp-0 1))))) + (if (>= 1.0 (+ f30-0 f0-0)) + (return (+ (the float gp-0) f30-0 f0-0)) + ) + ) + (+ (the float gp-0) f30-0 f0-0) + ) + ) + +;; definition for function segment-array-index->vector +(defun segment-array-index->vector ((arg0 (inline-array vector)) (arg1 int) (arg2 float) (arg3 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((v0-0 (the int arg2))) + (let* ((f0-2 arg2) + (f0-4 (- f0-2 (the float (the int f0-2)))) + ) + (when (>= v0-0 arg1) + (set! v0-0 (+ arg1 -1)) + (set! f0-4 (- arg2 (the float v0-0))) + ) + (let ((v1-5 (-> arg0 v0-0)) + (a1-3 (-> arg0 (+ v0-0 1))) + (a1-4 arg3) + ) + (.lvf vf2 (&-> (vector-! (new 'stack-no-clear 'vector) a1-3 v1-5) quad)) + (.lvf vf1 (&-> v1-5 quad)) + (let ((v1-6 f0-4)) + (.mov vf3 v1-6) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> a1-4 quad) vf4) + ) + ) + v0-0 + ) + ) + ) + +;; definition for function target-board-exit-check +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-exit-check target () + (if (and (or (and (cpad-pressed? (-> self control unknown-cpad-info00 number) r2) + (or (!= *cheat-mode* 'debug) + (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l2)) + ) + ) + (not *pause-lock*) + ) + (logtest? (state-flags sf17) (-> self state-flags)) + (zero? (logand (-> *game-info* features) (game-feature board))) + ) + (and (>= (- (-> self clock frame-counter) (-> self board board-get-on-time)) (seconds 1)) + (< (-> self board board-get-on-time) + (max (-> self control unknown-time-frame05) (-> self control unknown-time-frame14)) + ) + (not (and (-> self next-state) (= (-> self next-state name) 'target-board-grab))) + ) + ) + (go target-board-get-off (process->handle self) #f) + ) + 0 + (none) + ) + +;; definition for function target-board-effect +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-effect target () + (let ((gp-0 0)) + (cond + ((logtest? (focus-status rail) (-> self focus-status)) + (set! gp-0 10) + ) + ((= (-> self control unknown-surface00 name) 'spin) + (set! gp-0 3) + ) + ((and (-> self next-state) (= (-> self next-state name) 'target-board-flip)) + (set! gp-0 4) + ) + ((and (logtest? (-> self control unknown-surface00 flags) (surface-flag air)) + (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + ) + (set! gp-0 1) + ) + ((zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + (set! gp-0 2) + ) + ) + (if (board-on-ground?) + (seek! (-> self board sound-air-knob) 0.0 (* 16.0 (-> self clock seconds-per-frame))) + (seek! + (-> self board sound-air-knob) + (lerp-scale 0.0 1.0 (target-height-above-ground) 409.6 28672.0) + (* 2.0 (-> self clock seconds-per-frame)) + ) + ) + (let ((f30-0 (fabs (/ (-> self board turn-anim-frame) (-> *TARGET_BOARD-bank* turn-frames))))) + (seek! (-> self board sound-bank-knob) f30-0 (if (< (-> self board sound-bank-knob) f30-0) + (* 0.5 (-> self clock seconds-per-frame)) + (-> self clock seconds-per-frame) + ) + ) + (set! (-> self board engine-sound-volume) (lerp-scale 0.8 1.0 f30-0 0.0 1.0)) + ) + (set! (-> self board engine-sound-pitch) + (+ (lerp-scale 0.0 -0.1 (-> self board sound-bank-knob) 0.0 1.0) + (lerp-scale -0.15 0.0 (-> self board shock-offset) -3072.0 52.0192) + ) + ) + (set! (-> self board bank-sound-volume) (lerp-scale 0.0 1.0 (-> self board sound-bank-knob) 0.0 1.0)) + (set! (-> self board bank-sound-pitch) (lerp-scale 0.0 -0.2 (-> self board sound-bank-knob) 0.0 1.0)) + 0 + (let ((f0-25 (-> self board sound-air-knob))) + (if (< 0.0 f0-25) + (set! (-> self board engine-sound-volume) (lerp-scale (-> self board engine-sound-volume) 0.3 f0-25 0.0 1.0)) + ) + ) + (let ((t9-12 sound-play-by-spec) + (a0-18 (new 'static 'sound-spec + :mask (sound-mask volume pitch sm11) + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "board-steady") + ) + ) + ) + (set! (-> a0-18 volume) (the int (* 1024.0 (-> self board engine-sound-volume)))) + (set! (-> a0-18 pitch-mod) (the int (* 1524.0 (-> self board engine-sound-pitch)))) + (set! (-> a0-18 reg 0) (the-as uint gp-0)) + (t9-12 a0-18 (the-as sound-id (-> self board engine-sound-id)) (the-as vector #t)) + ) + (if (< (-> self board bank-sound-volume) 0.1) + (sound-stop (the-as sound-id (-> self board bank-sound-id))) + (sound-play-by-name + (static-sound-name "board-bank") + (the-as sound-id (-> self board bank-sound-id)) + (the int (* 1024.0 (-> self board bank-sound-volume))) + (the int (* 1524.0 (-> self board bank-sound-pitch))) + 0 + (sound-group sfx) + #t + ) + ) + (let ((t9-15 sound-play-by-spec) + (a0-23 (new 'static 'sound-spec + :mask (sound-mask volume pitch sm11) + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "board-wind") + ) + ) + ) + (set! (-> a0-23 volume) (the int (-> self board wind-sound-volume))) + (set! (-> a0-23 pitch-mod) (the int (-> self board wind-sound-pitch))) + (set! (-> a0-23 reg 0) (the-as uint gp-0)) + (t9-15 a0-23 (the-as sound-id (-> self board wind-sound-id)) (the-as vector #t)) + ) + ) + (cond + ((= (-> self control unknown-surface00 name) 'spin) + (seek! + (-> self board spin-sound-volume) + (lerp-scale 0.0 1.0 (fabs (-> self board trotyv)) 0.0 91022.22) + (* 8.0 (-> self clock seconds-per-frame)) + ) + (seek! + (-> self board spin-sound-pitch) + (lerp-scale 0.0 0.3 (fabs (-> self board trotyv)) 36408.89 91022.22) + (-> self clock seconds-per-frame) + ) + (when *sound-player-enable* + (let ((v1-89 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-89 command) (sound-command set-param)) + (set! (-> v1-89 id) (the-as sound-id (-> self board spin-sound-id))) + (set! (-> v1-89 params volume) (the int (* 1024.0 (-> self board spin-sound-volume)))) + (set! (-> v1-89 params mask) (the-as uint 1)) + (-> v1-89 id) + ) + ) + ) + (else + (set! (-> self board spin-sound-volume) 0.0) + ) + ) + (if (!= (-> self board upper-body-rotyv) 0.0) + (mode-set! (-> self board upper-body) (joint-mod-mode rotate)) + ) + (when (= (-> self board upper-body mode) (joint-mod-mode rotate)) + (set! (-> self board upper-body-rotyv) + (* 0.95 + (fmax + (fmin (-> self board upper-body-rotyv) (-> self board upper-body-rotyv-max)) + (- (-> self board upper-body-rotyv-max)) + ) + ) + ) + (+! (-> self board upper-body-rotyv) + (* -10.0 (-> self clock seconds-per-frame) (-> self board upper-body-roty)) + ) + (let ((f1-21 (* (-> self board upper-body-rotyv) (-> self clock seconds-per-frame))) + (f0-65 (-> self board upper-body-roty)) + ) + (+! (-> self board upper-body-roty) f1-21) + (when (< (* f0-65 (-> self board upper-body-roty)) 0.0) + (set! (-> self board upper-body-roty) 0.0) + (set! (-> self board upper-body-rotyv) 0.0) + (mode-set! (-> self board upper-body) (joint-mod-mode flex-blend)) + ) + ) + (twist-set! (-> self board upper-body) (the-as float #f) (-> self board upper-body-roty) (the-as float #f)) + ) + (when (and (board-on-ground?) + (not (or (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp no-draw-bounds no-draw-bounds2)) + (zero? (-> self skel active-channels)) + ) + ) + ) + (sparticle-launch-control-method-11 (-> self board part-control) (-> self control trans)) + (let ((t9-26 (method-of-object (-> self skel effect) effect-control-method-10))) + 'effect-board-poof + 0 + -1 + (t9-26) + ) + (when (< (-> self board shock-offset) -2048.0) + (let ((t9-27 (method-of-object (-> self skel effect) effect-control-method-10))) + 'effect-board-poof + 0 + -1 + (t9-27) + ) + ) + ) + (vector-lerp! (-> self board slow-transv) (-> self board slow-transv) (-> self control transv) 0.2) + (if (< (-> self board slow-transv y) 0.0) + (set! (-> self board slow-transv y) 0.0) + ) + 0 + (none) + ) + +;; definition for function target-board-physics +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-physics target ((arg0 vector)) + (let ((f30-0 0.5)) + (if (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame02)) (seconds 0.3)) + (+! (-> self board shock-offsetv) (* (- (-> arg0 y) (-> self control transv y)) f30-0)) + (set! (-> self board up-vector 1 quad) (-> self board up-vector 0 quad)) + ) + (+! (-> self board shock-offsetv) + (+ (* -10.0 (-> self clock seconds-per-frame) (-> self board shock-offset)) + (if (board-on-ground?) + (* (-> self control dynam gravity-length) (-> self clock seconds-per-frame) f30-0) + 0.0 + ) + ) + ) + ) + (cond + ((= (-> self control unknown-surface00 mode) 'ride) + (set! (-> self board shock-offsetv) 0.0) + (set! (-> self board shock-offset) (* 0.96 (-> self board shock-offset))) + ) + ((and (or (< (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) (seconds 0.2)) + (< (-> self board shock-offset) 0.0) + ) + (!= (-> self control unknown-surface00 mode) 'air) + ) + (+! (-> self board shock-offset) (* (-> self board shock-offsetv) (-> self clock seconds-per-frame))) + ) + ) + (set! (-> self board shock-offset) + (* (-> self board shock-offset) (lerp-scale 0.99 0.98 (-> self control unknown-float05) 0.0 28672.0)) + ) + (cond + ((< 40960.0 (-> self board shock-offset)) + (set! (-> self board shock-offset) 40960.0) + (set! (-> self board shock-offsetv) 0.0) + ) + ((< (-> self board shock-offset) -3072.0) + (when (< (-> self board shock-offsetv) -12288.0) + (case (-> self control ground-pat material) + (((pat-material waterbottom)) + (let ((gp-1 (sound-play "swim-enter" :pitch -0.5)) + (v1-62 (the-as sound-rpc-set-param (get-sound-buffer-entry))) + ) + (set! (-> v1-62 command) (sound-command set-param)) + (set! (-> v1-62 id) gp-1) + (set! (-> v1-62 params volume) -4) + (set! (-> v1-62 params fo-curve) 1) + (set! (-> v1-62 auto-time) 480) + (set! (-> v1-62 auto-from) 2) + (set! (-> v1-62 params mask) (the-as uint 273)) + (-> v1-62 id) + ) + ) + (else + (sound-play-by-name + (static-sound-name "board-bounce") + (new-sound-id) + (the int (* 1024.0 (lerp-scale 1.0 0.3 (-> self board shock-offsetv) -40960.0 -12288.0))) + 0 + 0 + (sound-group sfx) + #t + ) + ) + ) + ) + (set! (-> self board shock-offset) -3072.0) + (set! (-> self board shock-offsetv) 0.0) + (let ((gp-3 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-3 + (let ((t9-9 (method-of-type part-tracker activate))) + (t9-9 (the-as part-tracker gp-3) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-10 run-function-in-process) + (a0-28 gp-3) + (a1-8 part-tracker-init) + (a2-8 (-> *part-group-id-table* 21)) + (a3-5 0) + (t0-4 #f) + (t1-2 #f) + (t2-2 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> self control trans quad)) + ((the-as (function object object object object object object object object none) t9-10) + a0-28 + a1-8 + a2-8 + a3-5 + t0-4 + t1-2 + t2-2 + t3-0 + ) + ) + (-> gp-3 ppointer) + ) + ) + ) + ) + (set! (-> self control unknown-vector04 y) + (+ (-> self board cushion-base) (-> self board cushion-offset) (-> self board shock-offset)) + ) + (if (< (-> self control unknown-vector04 y) 0.0) + (set! (-> self control unknown-vector04 y) 0.0) + ) + 0 + (none) + ) + +;; definition for function target-board-collision +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-collision target () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self control transv quad)) + (when (logtest? (focus-status halfpipe) (-> self focus-status)) + (when (-> self control unknown-spool-anim00) + *edge-grab-info* + (let ((v1-9 (new-stack-vector0)) + (f0-1 (vector-dot (-> self control unknown-vector36) (-> self control transv))) + ) + 0.0 + (vector-! + v1-9 + (-> self control transv) + (the-as vector (vector-float*! v1-9 (-> self control unknown-vector36) f0-1)) + ) + (let* ((f1-2 (vector-length v1-9)) + (f2-0 f1-2) + ) + (if (< 0.0 f0-1) + (set! f0-1 -2048.0) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control unknown-vector36) f0-1)) + (the-as vector (vector-float*! v1-9 v1-9 (/ f1-2 f2-0))) + ) + ) + ) + ) + ) + (when *debug-segment* + (let ((s5-0 (-> *display* frames (-> *display* on-screen) profile-array data 0)) + (v1-17 'target) + (s4-0 *profile-target-color*) + ) + (when (and *dproc* *debug-segment*) + (let ((s3-0 (-> s5-0 data (-> s5-0 count)))) + (let ((s2-0 (-> s5-0 base-time))) + (set! (-> s3-0 name) v1-17) + (set! (-> s3-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s2-0)))) + ) + (set! (-> s3-0 depth) (the-as uint (-> s5-0 depth))) + (set! (-> s3-0 color) s4-0) + (set! (-> s5-0 segment (-> s5-0 depth)) s3-0) + ) + (+! (-> s5-0 count) 1) + (+! (-> s5-0 depth) 1) + (set! (-> s5-0 max-depth) (max (-> s5-0 max-depth) (-> s5-0 depth))) + ) + ) + 0 + ) + (let ((a2-6 (new 'stack-no-clear 'collide-query)) + (v1-30 (-> self control)) + ) + (set! (-> a2-6 collide-with) (-> v1-30 root-prim prim-core collide-with)) + (set! (-> a2-6 ignore-process0) self) + (set! (-> a2-6 ignore-process1) #f) + (set! (-> a2-6 ignore-pat) (-> v1-30 pat-ignore-mask)) + (set! (-> a2-6 action-mask) (collide-action solid)) + (collide-shape-method-32 v1-30 (-> v1-30 transv) a2-6 (meters 1.0)) + ) + (when (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) + (set! (-> *collide-edge-board-spec* flags) (logand -3 (-> *collide-edge-board-spec* flags))) + (set! (-> *collide-edge-board-spec* touching-segment) #f) + (target-method-27 *target* *collide-cache* *collide-edge-board-spec*) + ) + (when *debug-segment* + (let ((s5-1 (-> *display* frames (-> *display* on-screen) profile-array data 0))) + (when (and *dproc* *debug-segment*) + (let* ((v1-53 (+ (-> s5-1 depth) -1)) + (s4-1 (-> s5-1 segment v1-53)) + (s3-1 (-> s5-1 base-time)) + ) + (when (>= v1-53 0) + (set! (-> s4-1 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-1)))) + (+! (-> s5-1 depth) -1) + ) + ) + ) + ) + 0 + ) + (target-board-physics gp-0) + (deg-diff (vector-y-angle gp-0) (vector-y-angle (-> self control transv))) + (let* ((v1-60 gp-0) + (f30-0 (sqrtf (+ (* (-> v1-60 x) (-> v1-60 x)) (* (-> v1-60 z) (-> v1-60 z))))) + ) + (when (and (logtest? (-> self control status) (cshape-moving-flags t-wall)) + (and (< 16384.0 f30-0) + (not (and (-> self next-state) (= (-> self next-state name) 'target-board-smack))) + (zero? (logand (focus-status halfpipe) (-> self focus-status))) + (!= (-> self control ground-pat mode) 3) + (>= (- (-> self clock frame-counter) (-> self board halfpipe-time)) (seconds 0.1)) + ) + ) + (let ((s5-3 (new 'stack-no-clear 'vector))) + (set! (-> s5-3 quad) (-> self control unknown-vector25 quad)) + (vector-normalize! s5-3 1.0) + (let ((s3-2 (vector-reflect! (new 'stack-no-clear 'vector) gp-0 s5-3)) + (s4-3 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-3 quad) (-> self control unknown-matrix01 vector 2 quad)) + (set! (-> s3-2 y) 0.0) + (vector-normalize! s3-2 1.0) + (set! (-> s4-3 y) 0.0) + (vector-normalize! s4-3 1.0) + (let ((f0-11 (y-angle (-> self control)))) + (deg-diff f0-11 (vector-y-angle s3-2)) + ) + (let ((s2-2 + (vector-matrix*! (new 'stack-no-clear 'vector) (-> self control transv) (-> self control unknown-matrix00)) + ) + (s3-3 (vector-matrix*! (new 'stack-no-clear 'vector) s3-2 (-> self control unknown-matrix00))) + ) + (logior! (-> self control status) (cshape-moving-flags csmf15)) + (set! (-> self board glance-time) (-> self clock frame-counter)) + (let ((v1-99 s2-2)) + (set! (-> self board glance-speed) (sqrtf (+ (* (-> v1-99 x) (-> v1-99 x)) (* (-> v1-99 z) (-> v1-99 z))))) + ) + (set! (-> self board glance-normal quad) (-> s5-3 quad)) + (set! (-> self board glance-in-transv quad) (-> gp-0 quad)) + (set! (-> s3-3 y) (-> s2-2 y)) + (vector-xz-normalize! s3-3 (-> self board glance-speed)) + (vector-matrix*! (-> self control transv) s3-3 (-> self control unknown-matrix01)) + ) + (set! (-> self board glance-out-transv quad) (-> self control transv quad)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + (when (and (< (vector-dot s4-3 s5-3) -0.77) (zero? (logand (-> self focus-status) (focus-status dead hit)))) + (cond + ((not (and (logtest? (-> self control unknown-surface00 flags) (surface-flag air)) + (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + ) + ) + (if (< 32768.0 f30-0) + (sound-play "board-glance") + ) + (go target-board-turn-to (-> self control transv) (seconds 0.2)) + ) + (else + (set! (-> self control unknown-time-frame00) + (the-as + time-frame + (max (+ (-> self clock frame-counter) (seconds 0.1)) (-> self control unknown-time-frame00)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((gp-3 (new 'stack-no-clear 'collide-query))) + (let ((v1-138 gp-3)) + (set! (-> v1-138 radius) 1638.4) + (set! (-> v1-138 collide-with) + (logclear (-> self control root-prim prim-core collide-with) (collide-spec crate)) + ) + (set! (-> v1-138 ignore-process0) self) + (set! (-> v1-138 ignore-process1) #f) + (set! (-> v1-138 ignore-pat) (-> self control pat-ignore-mask)) + (set! (-> v1-138 action-mask) (collide-action solid)) + ) + (let ((v1-139 (-> gp-3 start-pos))) + (let ((a0-87 (-> self control trans)) + (a1-30 (-> self control unknown-matrix01 vector 2)) + (f0-24 10240.0) + ) + (.lvf vf2 (&-> a1-30 quad)) + (.lvf vf1 (&-> a0-87 quad)) + (let ((a0-88 f0-24)) + (.mov vf3 a0-88) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-139 quad) vf4) + ) + (let ((v1-140 (-> gp-3 start-pos))) + (let ((a0-89 (-> gp-3 start-pos)) + (a1-33 (-> self control dynam gravity-normal)) + (f0-25 8192.0) + ) + (.lvf vf2 (&-> a1-33 quad)) + (.lvf vf1 (&-> a0-89 quad)) + (let ((a0-90 f0-25)) + (.mov vf3 a0-90) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-140 quad) vf4) + ) + (vector-float*! (-> gp-3 move-dist) (-> self control dynam gravity-normal) -49152.0) + (cond + ((>= (fill-and-probe-using-line-sphere *collide-cache* gp-3) 0.0) + (set! (-> self board unknown-vector00 quad) (-> gp-3 best-other-tri intersect quad)) + (set! (-> self board unknown-vector01 quad) (-> gp-3 best-other-tri normal quad)) + (set! (-> self board unknown-int00) (the-as uint (-> gp-3 best-other-tri pat))) + (set! (-> self board unknown-symbol00) #t) + ) + (else + (set! (-> self board unknown-symbol00) #f) + ) + ) + ) + (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + (not (and *cheat-mode* (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) + ) + (set! (-> self control unknown-time-frame14) (-> self clock frame-counter)) + ) + 0 + (none) + ) + ) + +;; definition for function target-board-joint-points +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-joint-points target () + (when (-> self board board) + (let ((a1-0 (-> self node-list data 25 bone transform))) + (matrix->transformq (the-as transformq (-> self board board-trans)) a1-0) + ) + (set! (-> self board board-scale quad) (-> self control scale quad)) + (let ((a0-4 (-> *target-shadow-control* settings shadow-dir quad))) + (set! (-> *board-shadow-control* settings shadow-dir quad) a0-4) + ) + ) + 0 + (none) + ) + +;; definition for function target-board-pre-move +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-pre-move target () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (cond + ((and (and (logtest? (-> self control unknown-surface00 flags) (surface-flag air)) + (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + ) + (begin + (set! (-> self board in-air-time) (-> self clock frame-counter)) + (and (not (and (-> self next-state) + (let ((v1-12 (-> self next-state name))) + (or (= v1-12 'target-board-stance) (= v1-12 'target-board-duck-stance) (= v1-12 'target-board-turn-to)) + ) + ) + ) + (and (or (and (or (< 20480.0 + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control gspot-pos)) + ) + ) + (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (< (-> self control unknown-float22) 0.0) + ) + (or (not (or (= (-> self control unknown-pat-surface01 mode) (pat-mode ground)) + (= (-> self control unknown-pat-surface01 mode) (pat-mode halfpipe)) + ) + ) + (or (= (-> self control unknown-pat-surface01 event) (pat-event rail)) + (and (logtest? (-> self water flags) (water-flags active)) + (< (-> self control gspot-pos y) (-> self water surface-height)) + ) + (and (and (-> self next-state) (let ((v1-53 (-> self next-state name))) + (or (= v1-53 'target-board-hold) (= v1-53 'target-board-trickx)) + ) + ) + (zero? (logand (focus-status halfpipe) (-> self focus-status))) + ) + (and (= (-> self control unknown-pat-surface01 mode) (pat-mode halfpipe)) + (and (< (fabs (vector-dot (-> self control gspot-normal) (-> self control dynam gravity-normal))) 0.7) + (zero? (logand (focus-status halfpipe) (-> self focus-status))) + ) + ) + ) + ) + ) + (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.2)) + ) + ) + ) + ) + (set! (-> self control unknown-float30) 0.0) + (set! (-> self control unknown-float29) 0.0) + ) + (else + (set! (-> self control unknown-float30) 1024.0) + (set! (-> self control unknown-float29) 1.0) + (when (< (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.1)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + (-> self control gspot-normal) + ) + (quaternion-slerp! + (-> self control unknown-quaternion00) + (-> self control unknown-quaternion00) + (-> self control dir-targ) + 0.1 + ) + ) + ) + ) + (if (and (cpad-hold? (-> self control unknown-cpad-info00 number) circle square) (not (-> self board ride-lock))) + (logior! (-> self control root-prim prim-core action) (collide-action check-edge)) + (logclear! (-> self control root-prim prim-core action) (collide-action check-edge)) + ) + (if (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons circle square) + ) + ) + (set! (-> self board ride-lock) #f) + ) + (cond + ((and (-> self next-state) (let ((v1-121 (-> self next-state name))) + (or (= v1-121 'target-board-get-on) (= v1-121 'target-board-get-off)) + ) + ) + ) + ((and (-> self next-state) (let ((v1-126 (-> self next-state name))) + (or (= v1-126 'target-board-trickx) (= v1-126 'target-board-hold)) + ) + ) + (seek! (-> self control dynam gravity-length) 245760.0 (* 30.0 (-> self clock seconds-per-frame))) + ) + ((= (-> self control unknown-surface00 name) 'spin) + (set! (-> self control dynam gravity-length) + (lerp-scale 245760.0 204800.0 (fabs (-> self board trotyv)) 0.0 145635.56) + ) + ) + ((and (-> self next-state) (= (-> self next-state name) 'target-board-halfpipe)) + (if (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (set! (-> self control dynam gravity-length) 245760.0) + (set! (-> self control dynam gravity-length) 163840.0) + ) + ) + ((and (-> self next-state) + (let ((v1-159 (-> self next-state name))) + (or (= v1-159 'target-board-stance) (= v1-159 'target-board-duck-stance) (= v1-159 'target-board-turn-to)) + ) + ) + (cond + (#f + (set! (-> self control dynam gravity-length) 245760.0) + ) + ((>= (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) (seconds 0.1)) + (seek! (-> self control dynam gravity-length) 245760.0 (* 245760.0 (-> self clock seconds-per-frame))) + ) + (else + (set! (-> self control dynam gravity-length) 81920.0) + ) + ) + ) + (else + (set! (-> self control dynam gravity-length) 245760.0) + ) + ) + (vector-float*! + (-> self control dynam gravity) + (-> self control dynam gravity-normal) + (the-as float (-> self control dynam gravity-length)) + ) + (if (< (-> self control unknown-float15) 0.0) + (set! (-> self control unknown-float15) (- 1.0 (-> self control unknown-cpad-info00 stick0-speed))) + ) + (when (and (-> self board unknown-symbol00) (zero? (logand (focus-status halfpipe) (-> self focus-status)))) + (let ((f30-0 + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self board unknown-vector00) (-> self control trans)) + ) + ) + (f26-0 + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self board unknown-vector00) (-> self control gspot-pos)) + ) + ) + (f28-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + (let ((f0-36 + (* (-> self control unknown-float17) + (vector-length + (vector-flatten! + (new 'stack-no-clear 'vector) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self board unknown-vector00)) + (-> self control unknown-dynamics00 gravity-normal) + ) + ) + ) + ) + ) + (when (and (zero? (shr (shl (-> self board unknown-int00) 54) 61)) + (!= (shr (shl (-> self board unknown-int00) 40) 58) 13) + (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame02)) (seconds 0.2)) + (< 819.2 (- f30-0 f0-36)) + (or (< (-> self board unknown-time-frame01) (-> self control unknown-time-frame06)) + (< (- (-> self clock frame-counter) (-> self board unknown-time-frame01)) (seconds 0.2)) + ) + (< 0.98 (vector-dot (-> self board unknown-vector01) (-> self control unknown-dynamics00 gravity-normal))) + (< f26-0 8192.0) + (< f30-0 8192.0) + (or (< (* 0.2 f28-0) f30-0) + (< (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.1)) + ) + ) + (let ((v1-259 (-> self control transv))) + (let ((a0-74 (-> self control transv)) + (a1-28 (-> self control dynam gravity-normal)) + (f0-44 (* 7.0 (fmin 4096.0 f30-0))) + ) + (.lvf vf2 (&-> a1-28 quad)) + (.lvf vf1 (&-> a0-74 quad)) + (let ((a0-75 f0-44)) + (.mov vf3 a0-75) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-259 quad) vf4) + ) + (if (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.1)) + (set! (-> self board unknown-time-frame01) (-> self clock frame-counter)) + ) + (set! (-> self board unknown-time-frame00) (-> self clock frame-counter)) + ) + ) + (when (and (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + (< 0.0 f28-0) + (or (and (or (< (target-height-above-ground) 4096.0) + (< (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.1)) + ) + (< 8192.0 (- f28-0 (vector-dot (-> self control dynam gravity-normal) (-> self board slow-transv)))) + ) + (< (- (-> self clock frame-counter) (-> self board unknown-time-frame02)) (seconds 0.1)) + ) + (>= 204.8 f30-0) + (not (and (-> self next-state) (= (-> self next-state name) 'target-board-jump))) + ) + (set! (-> self board unknown-time-frame02) (-> self clock frame-counter)) + (vector-length (-> self control transv)) + (let ((v1-302 (new-stack-vector0)) + (f0-51 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-302 + (-> self control transv) + (the-as vector (vector-float*! v1-302 (-> self control dynam gravity-normal) f0-51)) + ) + (let* ((f1-24 (vector-length v1-302)) + (f2-0 f1-24) + (f0-52 (* 0.9 f0-51)) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-52)) + (the-as vector (vector-float*! v1-302 v1-302 (/ f1-24 f2-0))) + ) + ) + ) + (set! (-> self board slow-transv quad) (-> self control transv quad)) + (set! (-> self board turn-anim-duck-vel) 0.0) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for function target-board-real-post +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-real-post target () + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control unknown-word07) gp-1) + (flag-setup) + (target-board-pre-move) + (build-conversions (-> self control transv)) + (do-rotations1) + (let ((s5-0 (new-stack-vector0))) + (read-pad s5-0) + (when (-> self board stick-off) + (let ((f0-5 0.0)) + (set! (-> self control unknown-cpad-info00 stick0-speed) f0-5) + (set! (-> self control unknown-float12) f0-5) + ) + ) + (when *target-rc-board-controls* + (vector-rotate-y! + s5-0 + (-> self control unknown-matrix01 vector 2) + (* -42.666668 (+ -128.0 (the float (-> self control unknown-cpad-info00 leftx)))) + ) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> self control trans) + s5-0 + (meters 2.0) + (the-as rgba (-> (new 'static 'array uint64 1 #x8000ff00) 0)) + ) + ) + (turn-to-vector s5-0 (-> self control unknown-float12)) + ) + (if (and (= (-> self control unknown-float12) 0.0) + (>= (-> self clock frame-counter) (-> self control unknown-time-frame00)) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flag turn-to-vel))) + (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.1)) + ) + (rot->dir-targ! (-> self control)) + ) + (when (and (< (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) (seconds 0.1)) + (>= (-> self clock frame-counter) (-> self control unknown-time-frame00)) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flag turn-to-vel))) + (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.1)) + ) + (let* ((s3-0 + (vector-flatten! + (new 'stack-no-clear 'vector) + (vector-negate! (new 'stack-no-clear 'vector) (-> self control dynam gravity-normal)) + (-> self control local-normal) + ) + ) + (a2-4 + (forward-up-nopitch->quaternion + (new 'stack-no-clear 'quaternion) + s3-0 + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + ) + ) + (quaternion-slerp! + (-> self control dir-targ) + (-> self control dir-targ) + a2-4 + (* 0.05 (fabs (-> self control unknown-float24))) + ) + ) + ) + (if (cpad-pressed? (-> self control unknown-cpad-info00 number) l1) + (set! (-> self board unknown-time-frame06) (-> self clock frame-counter)) + ) + (board-add-thrust) + (add-gravity) + (cond + ((= (-> self control unknown-surface00 name) 'spin) + (set! (-> self board trotyv) + (* 0.95 (fmax (fmin (-> self board trotyv) (-> self board trotyv-max)) (- (-> self board trotyv-max)))) + ) + (let ((f0-15 (* (-> self board trotyv) (-> self clock seconds-per-frame)))) + (set! (-> self board troty) (the float (sar (shl (the int (+ (-> self board troty) f0-15)) 48) 48))) + (set! (-> self board unknown-deg00) (-> self board troty-cum)) + (+! (-> self board troty-cum) f0-15) + ) + (seek! (-> self board trotyv-max) 91022.22 (* 91022.22 (-> self clock seconds-per-frame))) + (mode-set! (-> self board main) (joint-mod-mode rotate)) + (twist-set! (-> self board main) (the-as float #f) (-> self board troty) (the-as float #f)) + (mode-set! (-> self board board 0 main) (joint-mod-mode rotate)) + (twist-set! (-> self board board 0 main) (the-as float #f) (-> self board troty) (the-as float #f)) + ) + (else + (cond + ((!= (-> self board main mode) (joint-mod-mode flex-blend)) + (let ((f0-24 (fabs (-> self board troty-cum)))) + (cond + ((>= f0-24 191146.67) + (add-to-trick-list (-> self board) (board-tricks board-spin) 4000.0) + ) + ((>= f0-24 126520.89) + (add-to-trick-list (-> self board) (board-tricks board-spin) 2000.0) + ) + ((>= f0-24 49152.0) + (add-to-trick-list (-> self board) (board-tricks board-spin) 500.0) + ) + ) + ) + (let ((v1-131 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-131 command) (sound-command set-param)) + (set! (-> v1-131 id) (the-as sound-id (-> self board spin-sound-id))) + (set! (-> v1-131 params volume) -4) + (set! (-> v1-131 auto-time) 120) + (set! (-> v1-131 auto-from) 2) + (set! (-> v1-131 params mask) (the-as uint 17)) + (-> v1-131 id) + ) + (set! (-> self board spin-sound-id) (the-as uint 0)) + (mode-set! (-> self board main) (joint-mod-mode flex-blend)) + (mode-set! (-> self board board 0 main) (joint-mod-mode flex-blend)) + (let ((s5-3 (new 'stack-no-clear 'vector))) + (set! (-> s5-3 quad) (-> self node-list data 3 bone transform vector 2 quad)) + (vector-rotate-y! s5-3 s5-3 15109.688) + (if (not (and (-> self next-state) + (let ((v1-149 (-> self next-state name))) + (or (= v1-149 'target-board-flip) (= v1-149 'target-board-hold) (= v1-149 'target-board-trickx)) + ) + ) + ) + (forward-up-nopitch->quaternion + (-> self control unknown-quaternion00) + s5-3 + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00)) + ) + ) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) + ) + (set! (-> self board upper-body-rotyv) (-> self board trotyv)) + (set! (-> self board troty) 0.0) + (set! (-> self board trotyv) 0.0) + ) + ((and (= (-> self control unknown-symbol04) 'board-spin) + (or (board-on-ground?) (>= (- (-> self clock frame-counter) (-> self board spin-time)) (seconds 0.5))) + ) + (target-danger-set! 'harmless #f) + ) + ) + (when (board-on-ground?) + (set! (-> self board spin-control) 0.0) + (set! (-> self board flip-control) 0.0) + (set! (-> self board unknown-float00) 0.0) + (set! (-> self board unknown-float01) 0.0) + (set! (-> self board ride-rot-old) -1.0) + ) + ) + ) + (do-rotations2) + (reverse-conversions (-> self control transv)) + (pre-collide-setup) + (cond + ((and (-> self next-state) (= (-> self next-state name) 'target-board-get-off)) + (seek! (-> self board cushion-offset) 0.0 (* 20480.0 (-> self clock seconds-per-frame))) + ) + ((and (logtest? (-> self control unknown-surface00 flags) (surface-flag air)) + (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + ) + (seek! + (-> self board cushion-offset) + (lerp-scale (-> *TARGET_BOARD-bank* cushion) 0.0 (target-height-above-ground) 0.0 12288.0) + (* 20480.0 (-> self clock seconds-per-frame)) + ) + ) + ((logtest? (-> self focus-status) (focus-status on-water)) + (seek! + (-> self board cushion-offset) + (+ 2048.0 (-> *TARGET_BOARD-bank* cushion)) + (* 20480.0 (-> self clock seconds-per-frame)) + ) + ) + (else + (seek! + (-> self board cushion-offset) + (-> *TARGET_BOARD-bank* cushion) + (* 8192.0 (-> self clock seconds-per-frame)) + ) + ) + ) + (target-board-collision) + (if (!= (-> self control unknown-float30) 0.0) + (bend-gravity) + ) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (when *debug-segment* + (let ((gp-2 (-> *display* frames (-> *display* on-screen) profile-array data 0)) + (v1-230 'target-post) + (s5-6 *profile-target-post-color*) + ) + (when (and *dproc* *debug-segment*) + (let ((s4-5 (-> gp-2 data (-> gp-2 count)))) + (let ((s3-4 (-> gp-2 base-time))) + (set! (-> s4-5 name) v1-230) + (set! (-> s4-5 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-4)))) + ) + (set! (-> s4-5 depth) (the-as uint (-> gp-2 depth))) + (set! (-> s4-5 color) s5-6) + (set! (-> gp-2 segment (-> gp-2 depth)) s4-5) + ) + (+! (-> gp-2 count) 1) + (+! (-> gp-2 depth) 1) + (set! (-> gp-2 max-depth) (max (-> gp-2 max-depth) (-> gp-2 depth))) + ) + ) + 0 + ) + (ja-post) + (when *debug-segment* + (let ((gp-3 (-> *display* frames (-> *display* on-screen) profile-array data 0))) + (when (and *dproc* *debug-segment*) + (let* ((v1-254 (+ (-> gp-3 depth) -1)) + (s5-7 (-> gp-3 segment v1-254)) + (s4-6 (-> gp-3 base-time)) + ) + (when (>= v1-254 0) + (set! (-> s5-7 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s4-6)))) + (+! (-> gp-3 depth) -1) + ) + ) + ) + ) + 0 + ) + (joint-points) + (do-target-gspot) + (target-powerup-process) + (set! (-> self board board-time) (-> self clock frame-counter)) + (target-board-exit-check) + (target-board-effect) + (when (board-on-ground?) + (set! (-> self board up-vector 1 quad) (-> self board up-vector 0 quad)) + (set! (-> self board up-vector 0 quad) (-> self control local-normal quad)) + (if (= (-> self board troty-cum) 0.0) + (set! (-> self board ground-on-dir quad) (-> self node-list data 3 bone transform vector 2 quad)) + ) + ) + 0 + (none) + ) + +;; definition for function probe-test +;; INFO: Used lq/sq +(defun probe-test ((arg0 control-info) (arg1 vector) (arg2 pat-surface)) + (dotimes (s3-0 3) + (let ((s2-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-2 (-> arg0 unknown-sphere-array00 s3-0))) + (set! (-> s2-0 start-pos quad) (-> v1-2 prim-core world-sphere quad)) + (set! (-> s2-0 move-dist quad) (-> arg1 quad)) + (let ((a0-3 s2-0)) + (set! (-> a0-3 radius) (* 0.5 (-> v1-2 prim-core world-sphere w))) + (set! (-> a0-3 collide-with) (-> v1-2 prim-core collide-with)) + (set! (-> a0-3 ignore-process0) (-> arg0 process)) + (set! (-> a0-3 ignore-process1) #f) + (set! (-> a0-3 ignore-pat) arg2) + (set! (-> a0-3 action-mask) (collide-action solid)) + ) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0) + (return (if (= (-> s2-0 best-other-tri pat event) (pat-event rail)) + 'rail + #t + ) + ) + ) + ) + ) + #f + ) + +;; definition for function target-board-compute-edge +;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. +;; INFO: Used lq/sq +(defbehavior target-board-compute-edge target () + (local-vars (sv-768 int)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 *edge-grab-info*) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> self control trans quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> self control transv quad)) + (when (not (edge-grab-info-method-9 s4-0)) + (format #t "exit update~%") + (send-event self 'end-mode #f) + (return (the-as time-frame #f)) + ) + (vector-normalize-copy! (-> self board ride-dir) (-> self board ride-segment) 1.0) + (when (>= (- (-> self clock frame-counter) (-> self board ride-time)) (seconds 0.2)) + (set! (-> self board ride-lock-on) #f) + (set! (-> self board ride-start-time) (-> self clock frame-counter)) + (vector-normalize-copy! (-> self board ride-dir) (-> self control transv) 1.0) + (dotimes (v1-25 3) + (vector-reset! (-> self board ride-vertex-old v1-25)) + ) + ) + (set! (-> self board ride-rot-abs 1) (-> self board ride-rot-abs 0)) + (let* ((f30-0 (deg- (vector-y-angle (-> self board ride-dir)) (-> self board ride-rot-abs 0))) + (f30-1 (* f30-0 (lerp-scale 10.0 100.0 (fabs f30-0) 1820.4445 3640.889))) + ) + (+! (-> self board ride-rtv-abs) (* f30-1 (-> self clock seconds-per-frame))) + (set! (-> self board ride-rtv-abs) (* 0.9 (-> self board ride-rtv-abs))) + (+! (-> self board ride-rot-abs 0) (* (-> self board ride-rtv-abs) (-> self clock seconds-per-frame))) + (when (>= 0.0 (* f30-1 (deg- (vector-y-angle (-> self board ride-dir)) (-> self board ride-rot-abs 0)))) + (set! (-> self board ride-rtv-abs) 0.0) + (set! (-> self board ride-rot-abs 0) (vector-y-angle (-> self board ride-dir))) + ) + ) + (set! (-> self control ground-pat) (the-as pat-surface (-> s4-0 edge-tri-pat))) + (vector-normalize! + (vector-! (-> self control unknown-vector34) (-> s4-0 world-vertex 1) (the-as vector (-> s4-0 world-vertex))) + 1.0 + ) + (set! (-> self control unknown-vector36 quad) (-> s4-0 hanging-matrix vector 0 quad)) + (when (< (vector-dot (-> self control unknown-vector34) (-> self board ride-dir)) 0.0) + (let ((s3-2 (new 'stack-no-clear 'vector))) + (set! (-> s3-2 quad) (-> s4-0 world-vertex 0 quad)) + (set! (-> s4-0 world-vertex 0 quad) (-> s4-0 world-vertex 1 quad)) + (set! (-> s4-0 world-vertex 1 quad) (-> s3-2 quad)) + (vector-normalize! + (vector-! (-> self control unknown-vector34) (-> s4-0 world-vertex 1) (the-as vector (-> s4-0 world-vertex))) + 1.0 + ) + (set! (-> s3-2 quad) (-> s4-0 adjacent-edge-left-vertex quad)) + (set! (-> s4-0 adjacent-edge-left-vertex quad) (-> s4-0 adjacent-edge-right-vertex quad)) + (set! (-> s4-0 adjacent-edge-right-vertex quad) (-> s3-2 quad)) + ) + (let ((v1-69 (logtest? (-> s4-0 status) 2))) + (if (logtest? (-> s4-0 status) 1) + (logior! (-> s4-0 status) 2) + (set! (-> s4-0 status) (logand -3 (-> s4-0 status))) + ) + (if v1-69 + (logior! (-> s4-0 status) 1) + (set! (-> s4-0 status) (logand -2 (-> s4-0 status))) + ) + ) + ) + (dotimes (v1-74 3) + (set! (-> self board ride-vertex-old v1-74 quad) (-> self board ride-vertex v1-74 quad)) + ) + (set! (-> self board ride-segment-old quad) (-> self board ride-segment quad)) + (set! (-> self board ride-segment-old quad) (-> self board ride-segment quad)) + (set! (-> self board ride-vertex-length-old) (-> self board ride-vertex-length)) + (set! (-> self board ride-vertex 0 quad) (-> s4-0 world-vertex 0 quad)) + (set! (-> self board ride-vertex 1 quad) (-> s4-0 world-vertex 1 quad)) + (set! (-> self board ride-vertex 2 quad) (the-as uint128 0)) + (set! (-> self board ride-vertex-length) 1) + (cond + ((logtest? (-> s4-0 status) 2) + (vector-normalize! + (vector-! (-> self control unknown-vector35) (-> s4-0 adjacent-edge-right-vertex) (-> s4-0 world-vertex 1)) + 1.0 + ) + (set! (-> self board ride-vertex 2 quad) (-> s4-0 adjacent-edge-right-vertex quad)) + (+! (-> self board ride-vertex-length) 1) + 0 + ) + (else + (set! (-> self control unknown-vector35 quad) (the-as uint128 0)) + ) + ) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (let ((s3-3 0)) + (label cfg-26) + (set! (-> self board ride-vertex-index) + (segment-array-vector->index + (-> self board ride-vertex) + (-> self board ride-vertex-length) + (the-as float (-> self control trans)) + 0.0 + ) + ) + (when (and (< (-> self board ride-vertex-index) 0.0) + (< (- (-> self clock frame-counter) (-> self board ride-time)) (seconds 0.2)) + (zero? s3-3) + ) + (+! s3-3 1) + (dotimes (v1-113 3) + (set! (-> self board ride-vertex v1-113 quad) (-> self board ride-vertex-old v1-113 quad)) + ) + (set! (-> self board ride-vertex-length) (-> self board ride-vertex-length-old)) + (goto cfg-26) + ) + ) + (set! (-> self board ride-vertex-index) (fmax 0.0 (-> self board ride-vertex-index))) + (set! (-> self board ride-vertex-base) + (segment-array-index->vector + (-> self board ride-vertex) + (-> self board ride-vertex-length) + (-> self board ride-vertex-index) + s4-1 + ) + ) + (vector-! + (-> self board ride-segment) + (-> self board ride-vertex (+ (-> self board ride-vertex-base) 1)) + (-> self board ride-vertex (-> self board ride-vertex-base)) + ) + (dotimes (v1-127 3) + (set! (-> self board ride-vertex v1-127 w) 1.0) + ) + (when (>= (- (-> self clock frame-counter) (-> self board ride-time)) (seconds 0.2)) + (set! (-> self board ride-rot-abs 0) (vector-y-angle (-> self board ride-segment))) + (set! (-> self board ride-rtv-abs) 0.0) + ) + (let ((f0-25 (vector-vector-distance (-> self control trans) s4-1))) + (when #t + (let ((s3-5 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> self control trans)))) + (let ((f1-9 (* 12288.0 (-> self clock seconds-per-frame)))) + (if (and (not (-> self board ride-lock-on)) (< f1-9 f0-25)) + (vector-normalize! s3-5 f1-9) + (set! (-> self board ride-lock-on) #t) + ) + ) + (if (probe-test (-> self control) s3-5 (new 'static 'pat-surface :noentity #x1 :noboard #x1 :probe #x1)) + (set! (-> self control status) (logior (cshape-moving-flags csmf16) (-> self control status))) + ((method-of-object (-> self control) collide-shape-method-28)) + ) + ) + ) + ) + ) + (let ((f30-2 (-> self board ride-speed))) + (vector-normalize-copy! (-> self control unknown-vector08) (-> self board ride-segment) 1.0) + (vector-normalize-copy! (-> self control transv) (-> self board ride-segment) f30-2) + (vector-rotate-y! + (-> self board ride-dir-lean) + (-> self control unknown-vector08) + (* -4551.1113 (-> self board ride-lean)) + ) + (when (< (-> self board ride-vertex-base) (+ (-> self board ride-vertex-length) -1)) + (let ((a0-100 (-> self board ride-vertex (+ (-> self board ride-vertex-base) 1))) + (s4-2 0) + ) + (let ((s3-7 (vector-! (new 'stack-no-clear 'vector) (&+ a0-100 16) a0-100))) + (if (< 14563.556 (fabs (deg-diff (vector-y-angle s3-7) (vector-y-angle (-> self control unknown-vector08))))) + (set! s4-2 (logior s4-2 2)) + ) + (if (< (vector-length s3-7) (fmin 1024.0 (* 0.25 (vector-length (-> self board ride-segment))))) + (set! s4-2 (logior s4-2 32)) + ) + ) + (if (nonzero? s4-2) + (+! (-> self board ride-vertex-length) -1) + ) + ) + ) + (let ((s4-3 0)) + (if (and (< (fabs f30-2) 16384.0) + (< (- (-> self clock frame-counter) (-> self board ride-start-time)) (seconds 0.1)) + ) + (set! s4-3 (logior s4-3 1)) + ) + (if (or (< (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self board ride-segment-old) 1.0) + (-> self control unknown-vector08) + ) + 0.02 + ) + (let ((f28-2 (deg-diff (-> self board ride-rot-abs 0) (-> self board ride-rot-abs 1))) + (f26-0 (* 1820.4445 (-> self board ride-lean))) + ) + (when (and (< 0.0 (* f26-0 f28-2)) (!= (-> self board ride-rtv-abs) 0.0)) + (set! (-> self board ride-rtv-abs) 0.0) + (set! (-> self board ride-rot-abs 0) (vector-y-angle (-> self board ride-segment))) + ) + (and (-> self board ride-lock-on) + (or (and (or (< (* f26-0 f28-2) 0.0) (= f26-0 0.0)) + (< 91.022224 (fabs f28-2)) + (and (< 163.84 (fabs (deg-diff f26-0 f28-2))) (format #t "angle ~R ~R~%" f28-2 f26-0)) + ) + (< (lerp-scale 910.2222 2002.4889 (fabs f30-2) 8192.0 24576.0) (fabs f26-0)) + ) + ) + ) + ) + (set! s4-3 (logior s4-3 2)) + ) + (let* ((v1-227 (min (the int (-> self board ride-vertex-index)) (+ (-> self board ride-vertex-length) -1))) + (f28-3 + (vector-length + (vector-! + (new 'stack-no-clear 'vector) + (-> self board ride-vertex (+ v1-227 1)) + (-> self board ride-vertex v1-227) + ) + ) + ) + (s3-8 (new 'stack-no-clear 'collide-query)) + (f26-1 81920.0) + ) + (set! sv-768 8) + (let ((v1-234 s3-8)) + (set! (-> v1-234 radius) 1228.8) + (set! (-> v1-234 collide-with) + (logclear (-> self control root-prim prim-core collide-with) (collide-spec crate)) + ) + (set! (-> v1-234 ignore-process0) self) + (set! (-> v1-234 ignore-process1) #f) + (set! (-> v1-234 ignore-pat) (-> self control pat-ignore-mask)) + (set! (-> v1-234 action-mask) (collide-action solid)) + ) + (let ((v1-235 (-> s3-8 start-pos))) + (let ((a0-127 (-> self control trans)) + (a1-55 (-> self board ride-dir)) + (f0-51 3276.8) + ) + (.lvf vf2 (&-> a1-55 quad)) + (.lvf vf1 (&-> a0-127 quad)) + (let ((a0-128 f0-51)) + (.mov vf3 a0-128) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-235 quad) vf4) + ) + (let ((v1-236 (-> s3-8 start-pos))) + (let ((a0-129 (-> s3-8 start-pos)) + (a1-58 (-> self control dynam gravity-normal)) + (f0-52 5324.8) + ) + (.lvf vf2 (&-> a1-58 quad)) + (.lvf vf1 (&-> a0-129 quad)) + (let ((a0-130 f0-52)) + (.mov vf3 a0-130) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-236 quad) vf4) + ) + (vector-float*! (-> s3-8 move-dist) (-> self control dynam gravity-normal) -49152.0) + (when (>= (fill-and-probe-using-line-sphere *collide-cache* s3-8) 0.0) + (set! f26-1 (- (-> self control trans y) (-> s3-8 best-other-tri intersect y))) + (set! sv-768 (the-as int (-> s3-8 best-other-tri pat))) + ) + (when (and (< (+ (the float (-> self board ride-vertex-length)) (/ 0.0 f28-3)) + (+ (-> self board ride-vertex-index) + (/ (* (-> self board ride-speed) (-> self clock seconds-per-frame)) f28-3) + ) + ) + (>= f28-3 3686.4) + (and (or (>= f26-1 6963.2) (and (>= f26-1 2048.0) (zero? (shr (shl sv-768 54) 61)))) + (logtest? (shr (shl sv-768 57) 57) 8) + ) + ) + (format + #t + "end with length ~M sp:~M ang:~M b:~X ~f/~f~%" + f28-3 + (-> self board ride-speed) + f26-1 + sv-768 + (+ (-> self board ride-vertex-index) + (/ (* (-> self board ride-speed) (-> self clock seconds-per-frame)) + (vector-length (-> self board ride-segment)) + ) + ) + (+ (the float (-> self board ride-vertex-length)) (/ 0.0 f28-3)) + ) + (set! s4-3 (logior s4-3 4)) + ) + ) + (let ((s3-9 (-> self board ride-vertex (-> self board ride-vertex-base)))) + (if (not (or (vector= s3-9 (the-as vector (-> self board ride-vertex-old))) + (vector= s3-9 (-> self board ride-vertex-old 1)) + (vector= s3-9 (-> self board ride-vertex-old 2)) + (vector= (&+ s3-9 16) (the-as vector (-> self board ride-vertex-old))) + (vector= (&+ s3-9 16) (-> self board ride-vertex-old 1)) + (vector= (&+ s3-9 16) (-> self board ride-vertex-old 2)) + ) + ) + (set! s4-3 (logior s4-3 8)) + ) + ) + (if (>= (- (-> self clock frame-counter) (-> self board ride-button-time)) (seconds 0.05)) + (set! s4-3 (logior s4-3 16)) + ) + (if (< (vector-length (-> self board ride-segment)) + (fmin 1024.0 (* 0.25 (vector-length (-> self board ride-segment-old)))) + ) + (set! s4-3 (logior s4-3 32)) + ) + (if (logtest? (cshape-moving-flags csmf16) (-> self control status)) + (set! s4-3 (logior s4-3 64)) + ) + (logclear! (-> self control status) (cshape-moving-flags csmf16)) + (when (and (< (- (-> self clock frame-counter) (-> self board ride-time)) (seconds 0.2)) (nonzero? s4-3)) + (if (logtest? s4-3 1) + (format #t "exit speed ~M~%" f30-2) + ) + (if (logtest? s4-3 2) + (format + #t + "exit angle ~F~%" + (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self board ride-segment-old) 1.0) + (-> self control unknown-vector08) + ) + ) + ) + (if (logtest? s4-3 4) + (format + #t + "exit end ~F/~F~%" + (-> self board ride-vertex-index) + (the float (-> self board ride-vertex-length)) + ) + ) + (if (logtest? s4-3 8) + (format #t "exit match~%") + ) + (if (logtest? s4-3 16) + (format #t "exit button~%") + ) + (if (logtest? s4-3 32) + (format #t "exit length~%") + ) + (when (logtest? s4-3 64) + (set! (-> self board ride-lock-on) #f) + (format #t "exit probe~%") + ) + (if (logtest? s4-3 128) + (format #t "exit probe2~%") + ) + (cond + ((or (logtest? s4-3 1) (and (logtest? s4-3 2) (< (fabs f30-2) 32768.0))) + (let ((gp-1 (-> self control unknown-vector36))) + (let* ((a0-171 (vector-rotate-y! (new 'stack-no-clear 'vector) (-> self board ride-dir) -16384.0)) + (f28-4 (* (-> self board ride-lean) (vector-dot a0-171 gp-1))) + ) + (format #t "throw side ~f ~A speed ~m~%" f28-4 (>= f28-4 0.0) f30-2) + (vector-normalize-copy! + (-> self control transv) + gp-1 + (* (lerp-scale 8192.0 32768.0 (fabs (-> self board ride-lean)) 0.0 1.0) (if (>= f28-4 0.0) + 1.0 + -1.0 + ) + ) + ) + ) + (set! (-> self control unknown-vector08 quad) (-> gp-1 quad)) + ) + ) + ((logtest? s4-3 42) + (collide-shape-method-29 (-> self control) gp-0) + (set! (-> self control transv quad) (-> s5-0 quad)) + ) + ) + (when (zero? (logand s4-3 64)) + (vector-float*! (new 'stack-no-clear 'vector) (-> self control dynam gravity-normal) 819.2) + ((method-of-object (-> self control) collide-shape-method-28)) + ) + (send-event self 'end-mode (zero? (logand s4-3 75))) + ) + ) + (vector-rotate-y! + (-> self control unknown-vector08) + (-> self control unknown-vector08) + (+ (-> self board ride-rot) (* -2730.6667 (-> self board ride-lean))) + ) + (set! (-> self board ride-time) (-> self clock frame-counter)) + (set! (-> self board ride-speed) f30-2) + ) + ) + ) + (let ((v0-3 (-> self clock frame-counter))) + (set! (-> self control unknown-time-frame06) v0-3) + v0-3 + ) + ) + ) + +;; definition for function board-ride-add-thrust +;; WARN: Return type mismatch int vs none. +(defbehavior board-ride-add-thrust target ((arg0 vector) (arg1 float)) + (let* ((f30-0 (-> self board ride-speed)) + (f0-4 + (lerp-scale + (-> self control unknown-surface01 fric) + (* 0.2 (-> self control unknown-surface01 fric)) + f30-0 + 0.0 + (-> self control unknown-surface01 transv-max) + ) + ) + (f30-1 (seek f30-0 0.0 (* f0-4 (-> self clock seconds-per-frame)))) + (f28-0 (vector-dot (-> self board ride-dir) arg0)) + (f0-19 + (+ f30-1 + (* (if (< 0.0 f28-0) + (* f28-0 + (lerp-scale + (-> self control unknown-surface01 target-speed) + 0.0 + (-> self board ride-speed) + 0.0 + (-> self control unknown-surface01 transv-max) + ) + arg1 + ) + (* 40960.0 arg1 f28-0) + ) + (-> self clock seconds-per-frame) + ) + ) + ) + (v1-21 (-> self control unknown-vector08)) + (f1-6 (vector-dot (-> self control dynam gravity-normal) v1-21)) + (f0-20 + (if (< f1-6 0.0) + (+ f0-19 (* (- f1-6) (-> self control unknown-surface01 slope-down-factor) (-> self clock seconds-per-frame))) + (+ f0-19 (* (- f1-6) (-> self control unknown-surface01 slope-up-factor) (-> self clock seconds-per-frame))) + ) + ) + ) + (set! (-> self board ride-speed) (fmax 0.0 (fmin f0-20 (-> self control unknown-surface01 transv-max)))) + ) + 0 + (none) + ) + +;; definition for function target-board-ride-post +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-ride-post target () + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control unknown-word07) gp-1) + (flag-setup) + (set! (-> self control unknown-float30) 32.0) + (set! (-> self control unknown-float29) 1.0) + (logior! (-> self control root-prim prim-core action) (collide-action check-edge)) + (if (< (-> self control unknown-float15) 0.0) + (set! (-> self control unknown-float15) (- 1.0 (-> self control unknown-cpad-info00 stick0-speed))) + ) + (build-conversions (-> self control transv)) + (do-rotations1) + (let ((s5-0 (new-stack-vector0))) + (read-pad s5-0) + (turn-to-vector s5-0 (-> self control unknown-float12)) + (if (< 0.0 (-> self control unknown-float10)) + (set! (-> self board ride-pad-vector 0 quad) (-> self control unknown-vector08 quad)) + ) + (board-ride-add-thrust s5-0 (-> self control unknown-float10)) + (let ((s5-1 (vector-rotate-y! (new 'stack-no-clear 'vector) s5-0 16384.0))) + (set! (-> s5-1 y) 0.0) + (vector-xz-normalize! s5-1 (-> self control unknown-float10)) + (let ((f0-16 (vector-dot s5-1 (-> self board ride-dir)))) + (if (>= 0.0 (-> self control unknown-float10)) + (set! f0-16 0.0) + ) + (set! (-> self board ride-lean-targ) f0-16) + (+! (-> self board ride-leanv) + (* 100.0 (-> self clock seconds-per-frame) (- f0-16 (-> self board ride-lean))) + ) + ) + ) + ) + (set! (-> self board ride-leanv) (* 0.95 (-> self board ride-leanv))) + (seek! + (-> self board ride-lean-mag) + (fabs (analog-input (the-as int (-> self control unknown-cpad-info00 leftx)) 128.0 32.0 110.0 1.0)) + (* 2.0 (-> self clock seconds-per-frame)) + ) + (+! (-> self board ride-lean) (* (-> self board ride-leanv) (-> self clock seconds-per-frame))) + (cond + ((< (-> self board ride-lean) -1.0) + (set! (-> self board ride-lean) -1.0) + (set! (-> self board ride-leanv) (* 0.0 (-> self board ride-leanv))) + ) + ((< 1.0 (-> self board ride-lean)) + (set! (-> self board ride-lean) 1.0) + (set! (-> self board ride-leanv) (* 0.0 (-> self board ride-leanv))) + ) + ) + 0 + (add-gravity) + (reverse-conversions (-> self control transv)) + (target-board-compute-edge) + (do-rotations2) + (pre-collide-setup) + (seek! (-> self board cushion-offset) 1638.4 (* 16384.0 (-> self clock seconds-per-frame))) + (let ((s5-3 (new 'stack-no-clear 'vector))) + (set! (-> s5-3 quad) (-> self control transv quad)) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (set! (-> s4-1 quad) (-> self control trans quad)) + (when *debug-segment* + (let ((s3-0 (-> *display* frames (-> *display* on-screen) profile-array data 0)) + (v1-90 'target) + (s2-0 *profile-target-color*) + ) + (when (and *dproc* *debug-segment*) + (let ((s1-0 (-> s3-0 data (-> s3-0 count)))) + (let ((s0-0 (-> s3-0 base-time))) + (set! (-> s1-0 name) v1-90) + (set! (-> s1-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s0-0)))) + ) + (set! (-> s1-0 depth) (the-as uint (-> s3-0 depth))) + (set! (-> s1-0 color) s2-0) + (set! (-> s3-0 segment (-> s3-0 depth)) s1-0) + ) + (+! (-> s3-0 count) 1) + (+! (-> s3-0 depth) 1) + (set! (-> s3-0 max-depth) (max (-> s3-0 max-depth) (-> s3-0 depth))) + ) + ) + 0 + ) + (let ((a2-4 (new 'stack-no-clear 'collide-query)) + (v1-103 (-> self control)) + ) + (set! (-> a2-4 collide-with) (-> v1-103 root-prim prim-core collide-with)) + (set! (-> a2-4 ignore-process0) self) + (set! (-> a2-4 ignore-process1) #f) + (set! (-> a2-4 ignore-pat) (-> v1-103 pat-ignore-mask)) + (set! (-> a2-4 action-mask) (collide-action solid)) + (collide-shape-method-32 v1-103 (-> v1-103 transv) a2-4 (meters 1.0)) + ) + (when (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) + (set! (-> *collide-edge-board-spec* flags) (logand -5 (-> *collide-edge-board-spec* flags))) + (cond + ((>= (- (-> self clock frame-counter) (-> self board ride-time)) (seconds 0.2)) + (set! (-> *collide-edge-board-spec* flags) (logand -3 (-> *collide-edge-board-spec* flags))) + (set! (-> *collide-edge-board-spec* touching-segment) #f) + ) + (else + (logior! (-> *collide-edge-board-spec* flags) 2) + (dotimes (v1-122 2) + (set! (-> self board ride-touch-segment v1-122 quad) + (-> self board ride-vertex (+ (-> self board ride-vertex-base) v1-122) quad) + ) + ) + (set! (-> *collide-edge-board-spec* touching-segment) (the-as symbol (-> self board ride-touch-segment))) + ) + ) + (target-method-27 *target* *collide-cache* *collide-edge-board-spec*) + ) + (when *debug-segment* + (let ((s3-1 (-> *display* frames (-> *display* on-screen) profile-array data 0))) + (when (and *dproc* *debug-segment*) + (let* ((v1-140 (+ (-> s3-1 depth) -1)) + (s2-1 (-> s3-1 segment v1-140)) + (s1-1 (-> s3-1 base-time)) + ) + (when (>= v1-140 0) + (set! (-> s2-1 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s1-1)))) + (+! (-> s3-1 depth) -1) + ) + ) + ) + ) + 0 + ) + (when (logtest? (focus-status rail) (-> self focus-status)) + (let ((s3-2 (new 'stack-no-clear 'vector))) + (let ((f28-1 + (fmax + 0.0 + (segment-array-vector->index + (-> self board ride-vertex) + (-> self board ride-vertex-length) + (the-as float s4-1) + (* (-> self board ride-speed) (-> self clock seconds-per-frame)) + ) + ) + ) + ) + (set! (-> self board ride-vertex-base2) + (segment-array-index->vector (-> self board ride-vertex) (-> self board ride-vertex-length) f28-1 s3-2) + ) + (set! (-> self board ride-vertex-index2) f28-1) + ) + (if (probe-test + (-> self control) + (vector-! (new 'stack-no-clear 'vector) s3-2 (-> self control trans)) + (new 'static 'pat-surface :noentity #x1 :noboard #x1 :probe #x1) + ) + (set! (-> self control status) (logior (cshape-moving-flags csmf16) (-> self control status))) + ) + (if (and (-> self board ride-lock-on) (zero? (logand (cshape-moving-flags csmf16) (-> self control status)))) + (collide-shape-method-29 (-> self control) s3-2) + ) + ) + (set! (-> self control transv quad) (-> s5-3 quad)) + ) + ) + (target-board-physics s5-3) + ) + (bend-gravity) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (when *debug-segment* + (let ((gp-2 (-> *display* frames (-> *display* on-screen) profile-array data 0)) + (v1-182 'target-post) + (s5-4 *profile-target-post-color*) + ) + (when (and *dproc* *debug-segment*) + (let ((s4-2 (-> gp-2 data (-> gp-2 count)))) + (let ((s3-3 (-> gp-2 base-time))) + (set! (-> s4-2 name) v1-182) + (set! (-> s4-2 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-3)))) + ) + (set! (-> s4-2 depth) (the-as uint (-> gp-2 depth))) + (set! (-> s4-2 color) s5-4) + (set! (-> gp-2 segment (-> gp-2 depth)) s4-2) + ) + (+! (-> gp-2 count) 1) + (+! (-> gp-2 depth) 1) + (set! (-> gp-2 max-depth) (max (-> gp-2 max-depth) (-> gp-2 depth))) + ) + ) + 0 + ) + (ja-post) + (when *debug-segment* + (let ((gp-3 (-> *display* frames (-> *display* on-screen) profile-array data 0))) + (when (and *dproc* *debug-segment*) + (let* ((v1-206 (+ (-> gp-3 depth) -1)) + (s5-5 (-> gp-3 segment v1-206)) + (s4-3 (-> gp-3 base-time)) + ) + (when (>= v1-206 0) + (set! (-> s5-5 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s4-3)))) + (+! (-> gp-3 depth) -1) + ) + ) + ) + ) + 0 + ) + (joint-points) + (do-target-gspot) + (vector-cross! + (-> self control local-normal) + (-> self control unknown-vector36) + (-> self control unknown-vector34) + ) + (if (< (vector-dot (-> self control local-normal) (-> self control dynam gravity-normal)) 0.0) + (vector-negate! (-> self control local-normal) (-> self control local-normal)) + ) + (set! (-> self control gspot-normal quad) (-> self control local-normal quad)) + (target-powerup-process) + (target-board-exit-check) + (target-board-effect) + (set! (-> self board board-time) (-> self clock frame-counter)) + 0 + (none) + ) + +;; definition for function target-board-post +(defbehavior target-board-post target () + (target-board-real-post) + (none) + ) + +;; definition for function target-board-center-anim +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-center-anim target () + (set! (-> self board turn-anim-frame) 0.0) + 0 + (none) + ) + +;; definition for function target-board-turn-anim +;; WARN: Return type mismatch int vs none. +(defbehavior target-board-turn-anim target ((arg0 int)) + (let ((f30-0 (-> self clock clock-ratio))) + (let ((s5-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float s5-1))) + (while (nonzero? s5-1) + (+! s5-1 -1) + (set! (-> self control unknown-word07) s5-1) + (set! (-> self board turn-anim-targ) (fmax -10.0 (fmin 10.0 (-> self board turn-anim-targ)))) + (or (not (>= (* (-> self board turn-anim-targ) (-> self board turn-anim-frame)) 0.0)) + (< (fabs (-> self board turn-anim-frame)) (fabs (-> self board turn-anim-targ))) + ) + (+! (-> self board turn-anim-vel) + (* (- (-> self board turn-anim-targ) (-> self board turn-anim-frame)) + (lerp-scale + 20.0 + (if (< (fabs (-> self board turn-anim-frame)) (fabs (-> self board turn-anim-targ))) + 30.0 + 60.0 + ) + (-> self control unknown-float05) + 0.0 + (* 0.3 (-> self board transv-max)) + ) + (-> self clock seconds-per-frame) + ) + ) + (set! (-> self board turn-anim-vel) + (fmax + -100.0 + (fmin + 100.0 + (* (-> self board turn-anim-vel) + (lerp-scale 0.96 0.9 (-> self control unknown-float05) 0.0 (* 0.3 (-> self board transv-max))) + ) + ) + ) + ) + (+! (-> self board turn-anim-frame) (* (-> self board turn-anim-vel) (-> self clock seconds-per-frame))) + (set! (-> self board turn-anim-frame) + (fmax + (fmin (-> self board turn-anim-frame) (-> *TARGET_BOARD-bank* turn-frames)) + (- (-> *TARGET_BOARD-bank* turn-frames)) + ) + ) + (cond + ((and (>= (-> self board turn-anim-frame) (-> *TARGET_BOARD-bank* turn-frames)) + (>= (-> self board turn-anim-vel) 0.0) + ) + (set! (-> self board turn-anim-vel) 0.0) + ) + ((and (>= (- (-> *TARGET_BOARD-bank* turn-frames)) (-> self board turn-anim-frame)) + (>= 0.0 (-> self board turn-anim-vel)) + ) + (set! (-> self board turn-anim-vel) 0.0) + ) + ) + (ja :chan arg0 + :num-func num-func-identity + :frame-num (ja-aframe + (fmax + (fmin + (+ (fmax + (fmin (-> self board turn-anim-frame) (+ -1.0 (-> *TARGET_BOARD-bank* turn-frames))) + (- (+ -1.0 (-> *TARGET_BOARD-bank* turn-frames))) + ) + (* (sin (* 145.63556 (the float (- (-> self clock frame-counter) (-> self state-time))))) + (lerp-scale 1.0 2.0 (fabs (-> self board turn-anim-frame)) 0.0 (-> *TARGET_BOARD-bank* turn-frames)) + ) + ) + (-> *TARGET_BOARD-bank* turn-frames) + ) + (- (-> *TARGET_BOARD-bank* turn-frames)) + ) + arg0 + ) + ) + (let ((f0-59 (fmin + (if (logtest? (-> self control status) (cshape-moving-flags on-surface)) + (seek (-> self board turn-anim-duck) 0.0 (-> self clock seconds-per-frame)) + (-> self board turn-anim-duck) + ) + (lerp-scale + 0.0 + -1.0 + (the float (- (-> self clock frame-counter) (-> self control unknown-time-frame06))) + 30.0 + 120.0 + ) + ) + ) + ) + (+! (-> self board turn-anim-duck) (* (-> self board turn-anim-duck-vel) (-> self clock seconds-per-frame))) + (cond + ((< (-> self board turn-anim-duck) f0-59) + (set! (-> self board turn-anim-duck) f0-59) + (set! (-> self board turn-anim-duck-vel) 0.0) + ) + ((< 1.0 (-> self board turn-anim-duck)) + (set! (-> self board turn-anim-duck) 1.0) + (set! (-> self board turn-anim-duck-vel) 0.0) + ) + ) + ) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + 0 + (none) + ) + +;; definition for method 9 of type board-info +;; WARN: Return type mismatch int vs none. +(defmethod add-to-trick-list board-info ((obj board-info) (arg0 board-tricks) (arg1 float)) + "Add specified trick and point amount to trick list." + (send-event (handle->process (-> obj process 0 notify)) 'notify 'trick-point arg0) + (when (and (< (-> obj trick-count) 16) + (and (< 0.0 arg1) (nonzero? (-> (the-as fact-info-target (-> obj process 0 fact)) trick-point-duration))) + ) + (let ((s4-0 0)) + (when (>= (- (-> *display* game-clock frame-counter) + (-> (the-as fact-info-target (-> obj process 0 fact)) trick-point-pickup-time) + ) + (seconds 30) + ) + (countdown (v1-20 16) + (set! (-> obj trick-list 0) (board-tricks none)) + ) + ) + (countdown (v1-23 15) + (if (= (-> obj trick-list v1-23) arg0) + (+! s4-0 1) + ) + (set! (-> obj trick-list (+ v1-23 1)) (-> obj trick-list v1-23)) + ) + (set! (-> obj trick-list 0) arg0) + (let* ((a0-24 (* arg1 (lerp-scale 1.0 0.1 (the float s4-0) 2.0 6.0))) + (s3-1 (the float (* 25 (/ (+ (the int a0-24) 24) 25)))) + ) + (sound-play "do-trick") + (let ((t9-4 format) + (a0-29 #t) + (a1-8 "trick: ~S (~D) ~,,0f") + (v1-30 arg0) + ) + (t9-4 + a0-29 + a1-8 + (cond + ((= v1-30 (board-tricks board-rail-jump)) + "board-rail-jump" + ) + ((= v1-30 (board-tricks board-nosegrab)) + "board-nosegrab" + ) + ((= v1-30 (board-tricks board-board-spin)) + "board-board-spin" + ) + ((= v1-30 (board-tricks board-kickflip)) + "board-kickflip" + ) + ((= v1-30 (board-tricks board-method)) + "board-method" + ) + ((= v1-30 (board-tricks board-spin)) + "board-spin" + ) + ((= v1-30 (board-tricks board-boost)) + "board-boost" + ) + ((= v1-30 (board-tricks darkjak)) + "darkjak" + ) + ((= v1-30 (board-tricks darkjak-giant)) + "darkjak-giant" + ) + ((= v1-30 (board-tricks board-duck-jump)) + "board-duck-jump" + ) + ((= v1-30 (board-tricks board-board-flip)) + "board-board-flip" + ) + ((= v1-30 (board-tricks board-rail)) + "board-rail" + ) + ((= v1-30 (board-tricks none)) + "none" + ) + ((= v1-30 (board-tricks darkjak-bomb0)) + "darkjak-bomb0" + ) + ((= v1-30 (board-tricks board-quick-jump)) + "board-quick-jump" + ) + ((= v1-30 (board-tricks board-noseflip)) + "board-noseflip" + ) + ((= v1-30 (board-tricks darkjak-bomb1)) + "darkjak-bomb1" + ) + ((= v1-30 (board-tricks board-jump)) + "board-jump" + ) + ((= v1-30 (board-tricks board-flip)) + "board-flip" + ) + (else + "*unknown*" + ) + ) + s4-0 + s3-1 + ) + ) + (when (nonzero? (-> obj trick-count)) + (format #t " + combo ~,,0f" (-> obj trick-points-array (+ (-> obj trick-count) -1))) + (+! (-> obj trick-points-array (+ (-> obj trick-count) -1)) + (-> obj trick-points-array (+ (-> obj trick-count) -1)) + ) + ) + (format #t "~%") + (set! (-> obj trick-array (-> obj trick-count)) arg0) + (set! (-> obj trick-points-array (-> obj trick-count)) s3-1) + ) + ) + (+! (-> obj trick-count) 1) + ) + 0 + (none) + ) + +;; definition for method 10 of type board-info +;; WARN: Return type mismatch int vs none. +(defmethod flush-trick-list board-info ((obj board-info)) + "Flush trick list and give out points." + (let ((f30-0 0.0)) + (dotimes (v1-0 (-> obj trick-count)) + (+! f30-0 (-> obj trick-points-array v1-0)) + ) + (when (< 0.0 f30-0) + (send-event + (handle->process (-> obj process 0 notify)) + 'notify + 'trick-flush + f30-0 + (-> obj trick-list) + (-> obj trick-count) + ) + (send-event (ppointer->process (-> obj process)) 'get-pickup 19 f30-0) + (sound-play "trick-score") + ) + ) + (set! (-> obj trick-count) 0) + 0 + 0 + (none) + ) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-h_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-h_REF.gc index 45bb596c2..31be589bf 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-h_REF.gc @@ -69,9 +69,9 @@ (gun-roty-rel degrees :offset-assert 144) (gun-roty degrees :offset-assert 148) (gun-roty-targ degrees :offset-assert 152) - (hips basic :offset-assert 156) - (upper-body basic :offset-assert 160) - (chest basic :offset-assert 164) + (hips joint-mod :offset-assert 156) + (upper-body joint-mod :offset-assert 160) + (chest joint-mod :offset-assert 164) (fire-dir-rot degrees :offset-assert 168) (fire-dir vector 2 :inline :offset-assert 176) (fire-point vector :inline :offset-assert 208) @@ -122,7 +122,7 @@ (top-anim-tilt-up degrees :offset-assert 600) (attack-combo combo-tracker :inline :offset-assert 608) (combo-window-start time-frame :offset-assert 656) - (combo-window-state uint32 :offset-assert 664) + (combo-window-state symbol :offset-assert 664) (combo-fire-delay uint32 :offset-assert 668) (charge-ammo float :offset-assert 672) (charge-start-time time-frame :offset-assert 680) @@ -487,7 +487,7 @@ (-> arg0 gun latch?) ) (not (-> arg0 skel top-anim frame-group)) - (>= (- (-> self clock frame-counter) (-> arg0 control unknown-time-frame12)) (seconds 0.1)) + (>= (- (-> self clock frame-counter) (-> arg0 control unknown-time-frame20)) (seconds 0.1)) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc b/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc index 8f67c57c9..83d7350cf 100644 --- a/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc @@ -462,7 +462,7 @@ (-> arg0 control unknown-vector21 y) (- (-> (the-as target pp) clock frame-counter) (-> arg0 control unknown-time-frame06)) (- (-> arg0 control trans y) (-> arg0 control unknown-vector21 y)) - (- (-> arg0 control unknown-vector37 y) (-> arg0 control unknown-vector36 y)) + (- (-> arg0 control unknown-vector43 y) (-> arg0 control unknown-vector42 y)) (-> arg0 control ground-impact-vel) ) (let* ((t9-76 format) @@ -470,16 +470,16 @@ (a1-56 "~0k~Tcd: ~,,2M md:~,,2M~%") (v1-191 (vector-! (new-stack-vector0) (-> arg0 control trans) (-> arg0 control unknown-vector21))) (a2-17 (sqrtf (+ (* (-> v1-191 x) (-> v1-191 x)) (* (-> v1-191 z) (-> v1-191 z))))) - (v1-193 (vector-! (new-stack-vector0) (-> arg0 control unknown-vector37) (-> arg0 control unknown-vector36))) + (v1-193 (vector-! (new-stack-vector0) (-> arg0 control unknown-vector43) (-> arg0 control unknown-vector42))) ) (t9-76 a0-131 a1-56 a2-17 (sqrtf (+ (* (-> v1-193 x) (-> v1-193 x)) (* (-> v1-193 z) (-> v1-193 z))))) ) (format arg1 "~0kbend b:~F t:~F s:~F~%" - (-> arg0 control unknown-float27) (-> arg0 control unknown-float28) (-> arg0 control unknown-float29) + (-> arg0 control unknown-float30) ) (set! sv-64 0) (set! sv-72 0) @@ -641,7 +641,7 @@ ) ) (let ((f1-1 (* 0.0625 f1-0))) - (set! (-> self control unknown-word02) a0-3) + (set! (-> self control unknown-word03) a0-3) (set! (-> self control unknown-float32) f1-1) (if (logtest? (-> self control unknown-surface01 flags) (surface-flag no-turn-around)) (set! (-> v1-7 0) (-> self clock frame-counter)) @@ -664,7 +664,7 @@ ;; INFO: Used lq/sq (defbehavior wall-hide? target () (when (and (< 0.7 (-> self control unknown-float12)) - (< 0.7 (-> self control unknown-float26)) + (< 0.7 (-> self control unknown-float27)) (and (< (-> self control unknown-float05) 8192.0) (logtest? (-> self control status) (cshape-moving-flags t-wall)) (zero? (logand (-> self control status) (cshape-moving-flags t-act))) @@ -675,11 +675,11 @@ ) ) ) - (if (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame22)) (seconds 0.1)) - (set! (-> self control unknown-time-frame23) (-> self clock frame-counter)) + (if (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame31)) (seconds 0.1)) + (set! (-> self control unknown-time-frame32) (-> self clock frame-counter)) ) - (set! (-> self control unknown-time-frame22) (-> self clock frame-counter)) - (when (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame23)) (seconds 0.5)) + (set! (-> self control unknown-time-frame31) (-> self clock frame-counter)) + (when (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame32)) (seconds 0.5)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (let ((v1-34 (-> gp-0 bbox)) (a0-13 (-> self control trans)) @@ -785,12 +785,12 @@ (warp-vector-into-surface! gp-0 arg0 (-> self control local-normal) (-> self control unknown-matrix03)) (set! (-> self control unknown-float11) (-> self control unknown-float10)) (set! (-> self control unknown-float09) (-> self control unknown-float08)) - (set! (-> self control unknown-vector08 quad) (-> self control unknown-vector07 quad)) - (set! (-> self control unknown-vector10 quad) (-> self control unknown-vector09 quad)) - (vector-float*! (-> self control unknown-vector09) gp-0 arg1) + (set! (-> self control unknown-vector09 quad) (-> self control unknown-vector08 quad)) + (set! (-> self control unknown-vector11 quad) (-> self control unknown-vector10 quad)) + (vector-float*! (-> self control unknown-vector10) gp-0 arg1) (if (< 0.0 arg1) (warp-vector-into-surface! - (-> self control unknown-vector07) + (-> self control unknown-vector08) arg0 *up-vector* (-> self control unknown-matrix03) @@ -1013,7 +1013,7 @@ (set! (-> s3-1 z) (fmax (fmin 0.0 (-> s3-1 z)) (-> s4-0 z))) (set! (-> s3-1 z) (fmax 0.0 (fmin (-> s3-1 z) (-> s4-0 z)))) ) - (if (< 0.2 (-> self control unknown-float26)) + (if (< 0.2 (-> self control unknown-float27)) (vector-seek! s3-1 s4-0 (* 122880.0 (-> self clock seconds-per-frame))) ) (vector-matrix*! s2-0 s3-1 (-> self control unknown-matrix01)) @@ -1166,17 +1166,17 @@ (vector-matrix*! gp-0 gp-0 s3-0) (set! (-> self control unknown-float19) (- (vector-dot (-> self control surface-normal) gp-0))) (set! (-> self control unknown-float17) (- (vector-dot (-> self control local-normal) gp-0))) - (set! (-> self control unknown-float21) (- (vector-dot (-> self control gspot-normal) gp-0))) - (set! (-> self control unknown-float24) (- (vector-dot s4-0 gp-0))) + (set! (-> self control unknown-float22) (- (vector-dot (-> self control gspot-normal) gp-0))) + (set! (-> self control unknown-float25) (- (vector-dot s4-0 gp-0))) (set-vector! gp-0 1.0 0.0 0.0 1.0) (vector-matrix*! gp-0 gp-0 s3-0) (set! (-> self control unknown-float20) (- (vector-dot (-> self control surface-normal) gp-0))) (set! (-> self control unknown-float18) (- (vector-dot (-> self control local-normal) gp-0))) - (set! (-> self control unknown-float22) (- (vector-dot (-> self control gspot-normal) gp-0))) - (set! (-> self control unknown-float25) (- (vector-dot s4-0 gp-0))) + (set! (-> self control unknown-float23) (- (vector-dot (-> self control gspot-normal) gp-0))) + (set! (-> self control unknown-float26) (- (vector-dot s4-0 gp-0))) (set-vector! gp-0 1.0 0.0 0.0 1.0) (vector-matrix*! gp-0 gp-0 (-> self control unknown-matrix01)) - (set! (-> self control unknown-float23) (vector-dot gp-0 s5-0)) + (set! (-> self control unknown-float24) (vector-dot gp-0 s5-0)) ) 0 ) @@ -1220,7 +1220,7 @@ ) (zero? (logand (-> self control unknown-surface01 flags) (surface-flag turn-to-vel))) ) - (-> self control unknown-vector07) + (-> self control unknown-vector08) ) (else (-> self control transv) @@ -1646,17 +1646,17 @@ (defbehavior flag-setup target () (cond ((= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (if (zero? (-> self control unknown-dword07)) - (set! (-> self control unknown-dword07) - (the-as int (- (-> self clock frame-counter) (-> self control unknown-time-frame19))) + (if (zero? (-> self control unknown-dword12)) + (set! (-> self control unknown-dword12) + (the-as int (- (-> self clock frame-counter) (-> self control unknown-time-frame28))) ) ) - (set! (-> self control unknown-time-frame19) (-> self clock frame-counter)) - (quaternion-copy! (-> self control unknown-quaternion04) (-> self control dir-targ)) + (set! (-> self control unknown-time-frame28) (-> self clock frame-counter)) + (quaternion-copy! (-> self control unknown-quaternion05) (-> self control dir-targ)) ) (else - (set! (-> self control unknown-time-frame20) (-> self clock frame-counter)) - (set! (-> self control unknown-dword07) 0) + (set! (-> self control unknown-time-frame29) (-> self clock frame-counter)) + (set! (-> self control unknown-dword12) 0) 0 ) ) @@ -1679,24 +1679,24 @@ (else (let ((v1-49 (-> self control trans))) (when (logtest? (-> self control old-status) (cshape-moving-flags on-surface)) - (set! (-> self control unknown-vector36 quad) (-> self control unknown-vector21 quad)) - (set! (-> self control unknown-vector37 quad) (-> self control unknown-vector21 quad)) + (set! (-> self control unknown-vector42 quad) (-> self control unknown-vector21 quad)) + (set! (-> self control unknown-vector43 quad) (-> self control unknown-vector21 quad)) ) - (set! (-> self control unknown-vector37 x) (-> v1-49 x)) - (set! (-> self control unknown-vector37 z) (-> v1-49 z)) + (set! (-> self control unknown-vector43 x) (-> v1-49 x)) + (set! (-> self control unknown-vector43 z) (-> v1-49 z)) (if (< (vector-dot (-> self control dynam gravity-normal) - (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector37) v1-49) + (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector43) v1-49) ) 0.0 ) - (set! (-> self control unknown-vector37 y) (-> v1-49 y)) + (set! (-> self control unknown-vector43 y) (-> v1-49 y)) ) ) ) ) (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) r3) - (zero? (-> self control unknown-word03)) + (zero? (-> self control unknown-word07)) (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask movie))) (not *pause-lock*) ) @@ -1771,7 +1771,7 @@ ) ) (send-event *camera* 'reset-follow) - (set! (-> self control unknown-time-frame12) (-> self clock frame-counter)) + (set! (-> self control unknown-time-frame20) (-> self clock frame-counter)) (cond ((logtest? (focus-status mech indax) (-> self focus-status)) (if (not (and (-> self next-state) @@ -1889,7 +1889,7 @@ ) ) ) - (set! (-> self control unknown-float29) + (set! (-> self control unknown-float30) (if (logtest? (-> self control status) (cshape-moving-flags on-surface)) 32.0 2.0 @@ -1920,24 +1920,24 @@ (set! (-> self control unknown-time-frame07) (-> self clock frame-counter)) ) (when (logtest? (-> self state-flags) (state-flags tinvul1)) - (if (< (logand (- (-> self clock frame-counter) (-> self control unknown-time-frame13)) 3) 1) + (if (< (logand (- (-> self clock frame-counter) (-> self control unknown-time-frame22)) 3) 1) (logior! (-> self draw status) (draw-control-status no-draw-bounds)) (logclear! (-> self draw status) (draw-control-status no-draw-bounds)) ) - (if (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame13)) - (-> self control unknown-time-frame14) + (if (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame22)) + (-> self control unknown-time-frame23) ) (target-timed-invulnerable-off self 1) ) ) (when (logtest? (state-flags tinvul2) (-> self state-flags)) - (if (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame15)) - (-> self control unknown-time-frame16) + (if (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame24)) + (-> self control unknown-time-frame25) ) (target-timed-invulnerable-off self 2) ) ) - (set! (-> self control unknown-symbol01) #f) + (set! (-> self control unknown-symbol06) #f) (target-gun-joint-pre) ((-> self pre-joint-hook)) (target-log-trans) @@ -2016,14 +2016,14 @@ (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) ) 0.0 - (-> self control unknown-float28) + (-> self control unknown-float29) ) ) ) (seek! - (-> self control unknown-float27) + (-> self control unknown-float28) f0-1 - (* (-> self control unknown-float29) (-> self clock seconds-per-frame)) + (* (-> self control unknown-float30) (-> self clock seconds-per-frame)) ) ) (set! (-> self control dynam gravity-normal quad) (-> self control unknown-dynamics00 gravity-normal quad)) @@ -2041,7 +2041,7 @@ s5-0 (-> self control unknown-dynamics00 gravity-normal) gp-0 - (-> self control unknown-float27) + (-> self control unknown-float28) ) (let ((a2-3 (matrix-from-two-vectors-smooth! @@ -2159,7 +2159,7 @@ ) ) (let ((gp-2 (vector-cross! - (-> self control unknown-vector35) + (-> self control unknown-vector36) (-> self control unknown-vector34) (-> self control dynam gravity-normal) ) @@ -2169,7 +2169,7 @@ (set! (-> self control unknown-float33) (vector-length s4-1)) (cond ((and (< 819.2 (-> self control unknown-float33)) - (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame10)) (seconds 0.2)) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame15)) (seconds 0.2)) ) (cond ((-> s5-0 pilot-edge-grab?) @@ -2228,8 +2228,8 @@ ((method-of-object (-> self control) collide-shape-method-28)) (vector-float*! (-> self control rider-last-move) s4-1 (-> self clock frames-per-second)) (set! (-> self control rider-time) (-> self clock frame-counter)) - (if (and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame11)) (seconds 0.5)) - (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame10)) (seconds 0.5)) + (if (and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame16)) (seconds 0.5)) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame15)) (seconds 0.5)) ) (send-event self 'end-mode) ) @@ -2246,7 +2246,7 @@ ) (set! (-> self control unknown-float33) 0.0) (set! (-> self control unknown-vector21 quad) (-> self control trans quad)) - (set! (-> self control unknown-time-frame10) (-> self clock frame-counter)) + (set! (-> self control unknown-time-frame15) (-> self clock frame-counter)) ) ) ) @@ -2309,7 +2309,7 @@ ) ) (vector-cross! - (-> self control unknown-vector35) + (-> self control unknown-vector36) (-> self control unknown-vector34) (-> self control dynam gravity-normal) ) @@ -2336,7 +2336,7 @@ (vf4 :class vf) ) (init-vf0-vector) - (let* ((s2-0 (handle->process (-> self control unknown-handle00))) + (let* ((s2-0 (handle->process (-> self control unknown-handle01))) (gp-0 (-> (the-as swingpole s2-0) dir)) ) (set! (-> self control unknown-vector34 quad) (-> gp-0 quad)) @@ -2420,14 +2420,14 @@ ) (let ((a0-26 (vector-! (new-stack-vector0) s5-0 (-> self control unknown-vector30)))) (cond - ((and (< 2457.6 (vector-length a0-26)) (not (-> self control unknown-symbol00))) + ((and (< 2457.6 (vector-length a0-26)) (not (-> self control unknown-symbol02))) (let ((s4-1 (method-of-object (-> self control) collide-shape-method-28))) (vector-normalize! a0-26 2457.6) (s4-1) ) ) (else - (set! (-> self control unknown-symbol00) #t) + (set! (-> self control unknown-symbol02) (the-as float #t)) (collide-shape-method-29 (-> self control) (vector-! (new 'stack-no-clear 'vector) s5-0 (-> self control unknown-vector31)) @@ -2437,7 +2437,7 @@ ) ) ) - (let ((s5-3 (vector-cross! (-> self control unknown-vector35) gp-0 (-> self control dynam gravity-normal)))) + (let ((s5-3 (vector-cross! (-> self control unknown-vector36) gp-0 (-> self control dynam gravity-normal)))) (if (>= 0.0 (vector-dot s5-3 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00))) ) @@ -2493,7 +2493,7 @@ ) (vector<-cspace! gp-0 (-> self node-list data 6)) (cond - ((>= (+ (-> self clock frame-counter) (seconds -2)) (-> self control unknown-time-frame17)) + ((>= (+ (-> self clock frame-counter) (seconds -2)) (-> self control unknown-time-frame26)) (set! (-> self control unknown-vector15 quad) (-> s5-0 quad)) ) ((not (and (logtest? (-> self water flags) (water-flags under-water)) @@ -2504,7 +2504,7 @@ (-> self control unknown-vector15) gp-0 s5-0 - (* 0.0016666667 (the float (- (-> self clock frame-counter) (-> self control unknown-time-frame17)))) + (* 0.0016666667 (the float (- (-> self clock frame-counter) (-> self control unknown-time-frame26)))) ) ) (else @@ -2516,7 +2516,7 @@ 0.0 (fmin 1.0 - (* 0.0011111111 (the float (- (-> self clock frame-counter) (-> self control unknown-time-frame18)))) + (* 0.0011111111 (the float (- (-> self clock frame-counter) (-> self control unknown-time-frame27)))) ) ) ) @@ -2621,9 +2621,7 @@ (vector-average! (-> self control unknown-vector30) gp-0 s5-0) ) (vector-! (-> self control unknown-vector31) (-> self control unknown-vector30) (-> self control trans)) - ((method-of-type impact-control update-from-cspace) - (the-as impact-control (-> self control unknown-cspace02)) - ) + (update-from-cspace (-> self control unknown-impact-control00)) (cond ((logtest? (-> self focus-status) (focus-status edge-grab)) (target-compute-edge) @@ -2662,15 +2660,15 @@ (set! (-> self control unknown-pat-surface01) (-> self control ground-pat)) ) (else - (let* ((gp-0 (new 'stack-no-clear 'collide-query)) - (a0-15 (-> self control)) - (t9-0 (method-of-object a0-15 collide-shape-moving-method-55)) - ) - (logclear (-> self control root-prim prim-core collide-with) (collide-spec water)) - #x46000000 - #x47a00000 - #x44800000 - (if (t9-0 a0-15) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (if (collide-shape-moving-method-55 + (-> self control) + gp-0 + (logclear (-> self control root-prim prim-core collide-with) (collide-spec water)) + 8192.0 + 81920.0 + 1024.0 + ) (set! (-> self control unknown-pat-surface01) (-> gp-0 best-other-tri pat)) ) ) @@ -2688,7 +2686,7 @@ (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) (while (nonzero? gp-1) (+! gp-1 -1) - (set! (-> self control unknown-word03) gp-1) + (set! (-> self control unknown-word07) gp-1) (flag-setup) (if (< (-> self control unknown-float15) 0.0) (set! (-> self control unknown-float15) (- 1.0 (-> self control unknown-cpad-info00 stick0-speed))) @@ -2769,7 +2767,7 @@ (set! (-> a2-3 ignore-pat) (-> v1-52 pat-ignore-mask)) ) (set! (-> a2-3 action-mask) (collide-action solid)) - (collide-shape-method-32 (-> self control) (-> self control transv) (the-as uint a2-3) #x45800000) + (collide-shape-method-32 (-> self control) (-> self control transv) a2-3 (meters 1.0)) ) (if (and (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) (>= (vector-dot @@ -2862,7 +2860,7 @@ (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) (while (nonzero? gp-1) (+! gp-1 -1) - (set! (-> self control unknown-word03) gp-1) + (set! (-> self control unknown-word07) gp-1) (flag-setup) (build-conversions (-> self control transv)) (do-rotations1) @@ -2905,7 +2903,7 @@ (set! (-> a2-0 ignore-pat) (-> v1-30 pat-ignore-mask)) ) (set! (-> a2-0 action-mask) (collide-action solid)) - (collide-shape-method-32 (-> self control) (-> self control transv) (the-as uint a2-0) #x45800000) + (collide-shape-method-32 (-> self control) (-> self control transv) a2-0 (meters 1.0)) ) (if (and (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) (>= (vector-dot @@ -2991,7 +2989,7 @@ (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) (while (nonzero? gp-1) (+! gp-1 -1) - (set! (-> self control unknown-word03) gp-1) + (set! (-> self control unknown-word07) gp-1) (flag-setup) (build-conversions (-> self control transv)) (do-rotations1) @@ -3034,7 +3032,7 @@ (set! (-> a2-0 ignore-pat) (-> v1-29 pat-ignore-mask)) ) (set! (-> a2-0 action-mask) (collide-action solid)) - (collide-shape-method-32 (-> self control) (-> self control transv) (the-as uint a2-0) #x45800000) + (collide-shape-method-32 (-> self control) (-> self control transv) a2-0 (meters 1.0)) ) (if (and (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) (>= (vector-dot @@ -3121,7 +3119,7 @@ (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) (while (nonzero? gp-1) (+! gp-1 -1) - (set! (-> self control unknown-word03) gp-1) + (set! (-> self control unknown-word07) gp-1) (flag-setup) (build-conversions (-> self control transv)) (do-rotations1) @@ -3130,7 +3128,7 @@ (vector-! (-> self control unknown-vector05) (-> self control unknown-vector04) - (-> self control unknown-vector06) + (-> self control unknown-vector07) ) (let ((a1-3 (new 'stack-no-clear 'overlaps-others-params))) (set! (-> a1-3 options) (overlaps-others-options oo0)) @@ -3217,7 +3215,7 @@ (vector-! (-> self control unknown-vector05) (-> self control unknown-vector04) - (-> self control unknown-vector06) + (-> self control unknown-vector07) ) (let ((a1-2 (new 'stack-no-clear 'overlaps-others-params))) (set! (-> a1-2 options) (overlaps-others-options oo0)) @@ -3253,12 +3251,12 @@ (quaternion-identity! (-> self control unknown-quaternion01)) (set! (-> self control unknown-float04) 0.0) (set! (-> self control unknown-time-frame06) (-> self clock frame-counter)) - (set! (-> self control unknown-float27) 0.0) - (set! (-> self control unknown-float29) 32.0) + (set! (-> self control unknown-float28) 0.0) + (set! (-> self control unknown-float30) 32.0) (set! (-> self cam-user-mode) 'normal) - (set! (-> self control unknown-handle00) (the-as handle #f)) (set! (-> self control unknown-handle01) (the-as handle #f)) - (set! (-> self control unknown-dword06) 0) + (set! (-> self control unknown-handle00) (the-as handle #f)) + (set! (-> self control unknown-dword11) 0) (buzz-stop! 0) self ) @@ -3373,10 +3371,10 @@ (set! (-> obj control) s0-0) ) (let ((v1-69 (-> obj control))) - (set! (-> v1-69 unknown-word04) s4-0) - (set! (-> v1-69 unknown-word06) s3-0) - (set! (-> v1-69 unknown-word05) s2-0) - (set! (-> v1-69 unknown-word07) s1-0) + (set! (-> v1-69 unknown-word08) s4-0) + (set! (-> v1-69 unknown-word10) s3-0) + (set! (-> v1-69 unknown-word09) s2-0) + (set! (-> v1-69 unknown-word11) s1-0) (set! (-> v1-69 max-iteration-count) (the-as uint 8)) (set! (-> v1-69 event-self) 'touched) ) @@ -3390,11 +3388,11 @@ (set! (-> obj control unknown-surface01 name) 'current) (set! (-> obj control unknown-surface01 active-hook) nothing) (set! (-> obj control unknown-surface01 touch-hook) nothing) - (set! (-> obj control unknown-dword05) (the-as uint #f)) + (set! (-> obj control unknown-dword06) (the-as uint #f)) (dotimes (v1-84 8) (set! (-> obj attack-info-old v1-84 attacker) (the-as handle #f)) ) - (set! (-> obj notify) (the-as uint #f)) + (set! (-> obj notify) (the-as handle #f)) (set! (-> obj mirror) (the-as (pointer process-drawable) #f)) (initialize-skeleton obj @@ -3471,9 +3469,9 @@ (set! (-> obj control backup-collde-with) (-> v1-163 prim-core collide-with)) ) (set! (-> obj sound) (new 'process 'ambient-sound "none" (-> obj control trans))) + (set! (-> obj control unknown-sound-id04) (new-sound-id)) + (set! (-> obj control unknown-sound-id03) (new-sound-id)) (set! (-> obj control unknown-sound-id02) (new-sound-id)) - (set! (-> obj control unknown-sound-id01) (new-sound-id)) - (set! (-> obj control unknown-sound-id00) (new-sound-id)) (if (and *debug-segment* (!= (-> obj tobot?) 'tobot)) (add-connection *debug-engine* obj target-print-stats obj *stdcon0* #f) ) diff --git a/test/decompiler/reference/jak2/engine/target/target_REF.gc b/test/decompiler/reference/jak2/engine/target/target_REF.gc new file mode 100644 index 000000000..a89baa0dc --- /dev/null +++ b/test/decompiler/reference/jak2/engine/target/target_REF.gc @@ -0,0 +1,4276 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function target-falling-trans +;; WARN: Return type mismatch int vs none. +(defbehavior target-falling-trans target ((arg0 symbol) (arg1 time-frame)) + (if (want-to-darkjak?) + (go target-darkjak-get-on 2) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet? #f)) + (go target-attack-air #f) + ) + (if (logtest? (-> self control status) (cshape-moving-flags on-surface)) + (go target-hit-ground #f) + ) + (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + (>= arg1 0) + (>= (- (-> self clock frame-counter) (-> self state-time)) arg1) + (not (and *cheat-mode* (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) + ) + #t + ) + (logior! (-> self control status) (cshape-moving-flags on-surface)) + (go target-hit-ground 'stuck) + ) + (if (!= (-> self state-time) (-> self clock frame-counter)) + (slide-down-test) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate target-startup (target) + :event target-standard-event-handler + :code (behavior () + (suspend) + (suspend) + (go target-stance) + (none) + ) + :post target-no-move-post + ) + +;; failed to figure out what this is: +(defstate target-stance (target) + :event target-standard-event-handler + :enter (behavior () + (set! (-> self control unknown-surface00) *walk-mods*) + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :exit (behavior () + (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) + (set! (-> self control unknown-float29) 0.0) + (target-state-hook-exit) + (none) + ) + :trans (behavior () + ((-> self state-hook)) + (if (and (logtest? (water-flags wading) (-> self water flags)) (not (using-gun? self))) + (go target-wade-stance) + ) + (when (= (-> self control ground-pat material) (pat-material ice)) + (set! (-> self control unknown-float29) 0.0) + (logclear! (-> self state-flags) (state-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + (remove-exit) + (go target-ice-stance) + ) + (when (move-legs?) + (set! (-> self control unknown-float29) 0.0) + (logclear! (-> self state-flags) (state-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + (remove-exit) + (go target-walk) + ) + (if (want-to-darkjak?) + (go target-darkjak-get-on 2) + ) + (when (and (cpad-hold? (-> self control unknown-cpad-info00 number) l1) (can-duck?)) + (logclear! (-> self state-flags) (state-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + (set! (-> self control unknown-float29) 0.0) + (remove-exit) + (go target-duck-stance #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 x) + ) + (can-jump? #f) + ) + (target-jump-go) + ) + (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? #t) + ) + (go target-attack) + ) + (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 square) + ) + (can-hands? #t) + ) + (go target-running-attack) + ) + (if (and (using-gun? self) + (and (-> self next-state) (= (-> self next-state name) 'target-stance)) + (let ((v1-85 (ja-group))) + (and v1-85 (= v1-85 (-> self draw art-group data 5))) + ) + ) + (go target-gun-stance) + ) + (if (and (logtest? (-> self game features) (game-feature carry)) + (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 r1) + ) + ) + (go target-carry-pickup) + ) + (slide-down-test) + (fall-test target-falling -4096000.0) + (none) + ) + :code target-stance-anim + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-walk (target) + :event target-walk-event-handler + :enter (behavior () + (if (and (using-gun? self) (-> self next-state) (= (-> self next-state name) 'target-walk)) + (go target-gun-walk) + ) + (set! (-> self state-time) (-> self clock 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)) + (target-effect-exit) + (remove-exit) + (go target-ice-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) + ) + (and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (can-roll?)) + ) + (go target-roll) + ) + (when (and (cpad-hold? (-> self control unknown-cpad-info00 number) l1) (can-duck?)) + (target-effect-exit) + (remove-exit) + (go target-duck-walk #f) + ) + (when (not (move-legs?)) + (target-effect-exit) + (remove-exit) + (go target-stance) + ) + (if (want-to-darkjak?) + (go target-darkjak-get-on 2) + ) + (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) + ) + (target-jump-go) + ) + (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? #t) + ) + (go target-attack) + ) + (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 square) + ) + (can-hands? #t) + ) + (go target-running-attack) + ) + (when (and (turn-around?) (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.3))) + (set! (-> self control transv quad) + (-> self control unknown-vector-array02 (-> self control unknown-word03) quad) + ) + (set! (-> self control transv w) 1.0) + (go target-turn-around) + ) + (if (and (logtest? (-> self game features) (game-feature carry)) + (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 r1) + ) + ) + (go target-carry-pickup) + ) + (if (wall-hide?) + (go target-hide) + ) + (slide-down-test) + (fall-test target-falling -4096000.0) + (none) + ) + :code (behavior () + (target-walk-anim -300) + (none) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-turn-around (target) + :event target-standard-event-handler + :enter (behavior () + (vector-turn-to (-> self control transv)) + (set! (-> self control unknown-surface00) *turn-around-mods*) + (set! (-> self control unknown-float29) 1.0) + (none) + ) + :exit (behavior () + (target-state-hook-exit) + (set-forward-vel 0.0) + (set! (-> self control unknown-float05) 0.0) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (set! (-> self control unknown-float29) 0.0) + (none) + ) + :trans (behavior () + ((-> self state-hook)) + (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) + ) + (target-jump-go) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet? #t)) + (go target-attack) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) (can-hands? #t)) + (go target-running-attack) + ) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) (seconds 0.08)) + ) + (go target-falling #f) + ) + (slide-down-test) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.04)) + (ja :group! (-> self draw art-group data 22) :num! min) + (quaternion-rotate-y! (-> self control dir-targ) (-> self control dir-targ) 32768.0) + (compute-alignment! (-> self align)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 2.0)) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + ) + (remove-exit) + (set! (-> self control unknown-float29) 0.0) + (set! (-> self control unknown-float05) (* 40960.0 (-> self darkjak-giant-interp))) + (set-forward-vel (-> self control unknown-float05)) + (target-state-hook-exit) + (go target-walk) + (none) + ) + :post target-no-stick-post + ) + +;; failed to figure out what this is: +(defstate target-slide-down (target) + :event target-walk-event-handler + :enter (behavior () + (set! (-> self control unknown-surface00) *jump-mods*) + (none) + ) + :exit (behavior () + (set! (-> self control unknown-time-frame13) (-> self clock frame-counter)) + (none) + ) + :trans (behavior () + (when (or (logtest? (-> self control status) (cshape-moving-flags on-surface)) + (if (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + #t + ) + ) + (logior! (-> self control status) (cshape-moving-flags on-surface)) + (if (using-gun? self) + (go target-stance) + (go target-duck-stance #f) + ) + ) + (none) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (if (not (and v1-2 (= v1-2 (-> self draw art-group data 20)))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data 20) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 20)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post target-post + ) + +;; definition for symbol *slide-down-mods*, type surface +(define *slide-down-mods* (new 'static 'surface + :name 'run + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 81920.0 + :target-speed 81920.0 + :seek0 0.4 + :seek90 0.4 + :seek180 0.4 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 60.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :flags (surface-flag no-turn-around) + ) + ) + +;; definition for symbol *slide-jump-mods*, type surface +(define *slide-jump-mods* (new 'static 'surface + :name 'jump + :turnv 32768.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 65536.0 + :target-speed 65536.0 + :seek0 0.05 + :seek90 0.05 + :seek180 0.05 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 300.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag check-edge air) + ) + ) + +;; failed to figure out what this is: +(defstate target-slide-down-to-ground (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('slide) + #f + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self control unknown-surface00) *slide-down-mods*) + (set! (-> self control unknown-time-frame17) 0) + (set! (-> self control unknown-float15) 1.0) + (set! (-> self control unknown-float14) 1.0) + (none) + ) + :exit (behavior () + (target-effect-exit) + (target-exit) + (set! (-> self control unknown-time-frame13) (-> self clock frame-counter)) + (none) + ) + :trans (behavior () + (if (and (or (and (logtest? (-> self control status) (cshape-moving-flags on-surface)) + (and (< 0.9 (-> self control surface-angle)) + (!= (-> self control cur-pat material) 14) + (!= (-> self control cur-pat event) 7) + (!= (-> self control cur-pat event) 14) + (or (= (-> self control cur-pat mode) (pat-mode ground)) + (= (-> self control cur-pat mode) (pat-mode halfpipe)) + ) + ) + ) + (if (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + #t + ) + ) + (zero? (-> self control unknown-time-frame17)) + ) + (set! (-> self control unknown-time-frame17) (-> self clock frame-counter)) + ) + (when (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) + (!= (-> self state-time) (-> self clock frame-counter)) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control unknown-vector16) 1.0) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)) + ) + (vector-normalize-copy! (-> self control transv) (-> self control unknown-vector16) 40960.0) + (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) *slide-jump-mods*) + ) + (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? #t) + (!= (-> self state-time) (-> self clock frame-counter)) + ) + (go target-attack) + ) + (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 square) + ) + (can-hands? #t) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame11)) (seconds 0.7)) + (!= (-> self state-time) (-> self clock frame-counter)) + ) + (go target-running-attack) + ) + (when (= (-> self control unknown-float15) 0.0) + (logior! (-> self control status) (cshape-moving-flags on-surface)) + (if (using-gun? self) + (go target-stance) + (go target-duck-stance #f) + ) + ) + (set! (-> self control unknown-float05) (* 40960.0 (-> self darkjak-giant-interp))) + (none) + ) + :code (-> target-walk code) + :post (behavior () + (cond + ((zero? (-> self control unknown-time-frame17)) + (vector-normalize! + (vector-flatten! + (-> self control unknown-vector16) + (vector-negate! (new 'stack-no-clear 'vector) (-> self control dynam gravity-normal)) + (-> self control surface-normal) + ) + 1.0 + ) + (if (< 0.0 + (vector-dot + (-> self control unknown-vector16) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00)) + ) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control unknown-vector16) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-negate! (new 'stack-no-clear 'vector) (-> self control unknown-vector16)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + ) + ) + ((nonzero? (-> self control unknown-time-frame17)) + (seek! (-> self control unknown-float15) 0.0 (* 4.0 (-> self clock seconds-per-frame))) + ) + ) + (set! (-> self control unknown-time-frame00) (+ (-> self clock frame-counter) (seconds 0.1))) + (target-post) + (none) + ) + ) + +;; definition for function init-var-jump +;; INFO: Used lq/sq +(defbehavior init-var-jump target ((arg0 float) (arg1 float) (arg2 symbol) (arg3 symbol) (arg4 vector) (arg5 float)) + (when (and (logtest? (focus-status dark) (-> self focus-status)) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) 32) + ) + (set! arg0 (* arg0 (-> self darkjak-giant-interp))) + (set! arg1 (* arg1 (-> self darkjak-giant-interp))) + ) + (logclear! (-> self control status) (cshape-moving-flags csmf14)) + (set! (-> self control unknown-time-frame19) (-> self clock frame-counter)) + (delete-back-vel) + (let* ((f0-4 arg5) + (f1-2 0.0) + (f2-2 (+ (* 0.0016666667 (-> self control dynam gravity-length)) + (fmax 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + ) + (f0-5 (* f0-4 (fmax f1-2 (/ (* 0.5 f2-2 f2-2) (-> self control dynam gravity-length))))) + (s3-1 (+ arg0 f0-5)) + ) + (let ((s2-1 (+ arg1 f0-5))) + (when (< (- (-> self clock frame-counter) (-> self control rider-time)) (seconds 0.05)) + (let ((f0-8 + (fmax + 0.0 + (fmin 28672.0 (* 0.5 (vector-dot (-> self control dynam gravity-normal) (-> self control rider-last-move)))) + ) + ) + ) + (set! s3-1 (+ s3-1 f0-8)) + (set! s2-1 (+ s2-1 f0-8)) + ) + (send-event self 'push-transv (-> self control rider-last-move) #x7530) + ) + (set! (-> self control unknown-float36) 0.0) + (set! (-> self control unknown-float37) 0.0) + (cond + (arg3 + (set! (-> self control unknown-word04) + (the-as uint (- s3-1 (+ -409.6 (-> *TARGET-bank* jump-collide-offset)))) + ) + (set! (-> self control unknown-symbol02) (- s2-1 (-> *TARGET-bank* jump-collide-offset))) + ) + (else + (set! (-> self control unknown-word04) (the-as uint s3-1)) + (set! (-> self control unknown-symbol02) s2-1) + ) + ) + ) + (when arg2 + (let ((v1-55 (new-stack-vector0))) + (let ((f0-19 (vector-dot (-> self control dynam gravity-normal) arg4))) + 0.0 + (vector-! v1-55 arg4 (the-as vector (vector-float*! v1-55 (-> self control dynam gravity-normal) f0-19))) + ) + (let* ((f0-20 (vector-length v1-55)) + (f1-16 f0-20) + (f2-13 + (- (sqrtf (* 2.0 (-> self control dynam gravity-length) s3-1)) + (* 0.008333334 (- (-> self control dynam gravity-length))) + ) + ) + ) + (vector+! + arg4 + (the-as vector (vector-float*! arg4 (-> self control dynam gravity-normal) f2-13)) + (the-as vector (vector-float*! v1-55 v1-55 (/ f0-20 f1-16))) + ) + ) + ) + ) + ) + (let ((v0-2 (-> self control unknown-vector37))) + (set! (-> v0-2 quad) (-> self control trans quad)) + v0-2 + ) + ) + +;; definition for function mod-var-jump +;; INFO: Used lq/sq +(defbehavior mod-var-jump target ((arg0 symbol) (arg1 symbol) (arg2 symbol) (arg3 vector)) + (local-vars (v0-1 vector)) + (let ((f0-1 (* 0.033333335 (the float (- (-> self clock frame-counter) (-> self state-time)))))) + (cond + ((or (< 1.0 f0-1) (< (-> self control unknown-float36) 0.0) (not arg2)) + (set! (-> self control unknown-float36) -1.0) + ) + (else + (set! (-> self control unknown-float36) f0-1) + (set! (-> self control unknown-float37) f0-1) + (when arg0 + (let ((s3-1 (vector-! (new-stack-vector0) (-> self control trans) (-> self control unknown-vector37))) + (s4-0 (new-stack-vector0)) + ) + (let ((f1-5 (vector-dot (-> self control dynam gravity-normal) arg3))) + 0.0 + (vector-! s4-0 arg3 (the-as vector (vector-float*! s4-0 (-> self control dynam gravity-normal) f1-5))) + ) + (let* ((f30-0 (vector-length s4-0)) + (f28-0 f30-0) + (f0-7 + (- (sqrtf + (* 2.0 + (-> self control dynam gravity-length) + (- (lerp-scale (the-as float (-> self control unknown-word04)) (-> self control unknown-symbol02) f0-1 0.0 1.0) + (vector-dot (-> self control dynam gravity-normal) s3-1) + ) + ) + ) + (* 0.008333334 (- (-> self control dynam gravity-length))) + ) + ) + ) + (vector+! + arg3 + (the-as vector (vector-float*! arg3 (-> self control dynam gravity-normal) f0-7)) + (the-as vector (vector-float*! s4-0 s4-0 (/ f30-0 f28-0))) + ) + ) + ) + ) + ) + ) + ) + 0 + (when (and arg1 (ja-group) (and (-> (ja-group) extra) + (not (and (logtest? (focus-status dark) (-> self focus-status)) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) 32) + ) + ) + #t + ) + ) + (let ((v1-62 (res-lump-struct (-> (ja-group) extra) 'collide-offset vector :time (ja-aframe-num 0)))) + (cond + (v1-62 + (if (and (logtest? (focus-status dark) (-> self focus-status)) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) 32) + ) + (set! (-> v1-62 y) (* 0.5 (-> v1-62 y))) + ) + (set! v0-1 (-> self control unknown-vector06)) + (set! (-> v0-1 quad) (-> v1-62 quad)) + ) + (else + (set! v0-1 (-> self control unknown-vector06)) + (set! (-> v0-1 quad) (the-as uint128 0)) + ) + ) + ) + v0-1 + ) + ) + +;; definition for symbol *duck-mods*, type surface +(define *duck-mods* + (new 'static 'surface + :name 'duck + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 16384.0 + :target-speed 16384.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (surface-clamp-speed arg0 arg1 arg2 arg3) + (when (= arg3 1) + (cond + ((and (logtest? (focus-status dark) (-> self focus-status)) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) 32) + ) + (set! (-> arg0 target-speed) 81920.0) + ) + ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (set! (-> arg0 target-speed) 40960.0) + ) + (else + (set! (-> arg0 target-speed) 16384.0) + ) + ) + ) + ) + :flags (surface-flag duck) + ) + ) + +;; failed to figure out what this is: +(defstate target-duck-stance (target) + :event target-standard-event-handler + :enter (behavior ((arg0 symbol)) + (if (not arg0) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + (set! (-> self control unknown-float29) 1.0) + (set! (-> self control unknown-surface00) *duck-mods*) + (target-collide-set! 'duck 1.0) + (none) + ) + :exit (behavior () + (if (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-duck-walk) + (= v1-3 'target-duck-stance) + (= v1-3 'target-walk) + (= v1-3 'target-stance) + (= v1-3 'target-stance-look-around) + ) + ) + ) + ) + (target-state-hook-exit) + ) + (target-exit) + (if (= (-> self control unknown-symbol00) 'duck) + (target-collide-set! 'normal 0.0) + ) + (none) + ) + :trans (behavior () + ((-> self state-hook)) + (if (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1)) + ) + (logtest? (-> self state-flags) (state-flags sf9)) + ) + (let ((v1-13 (ja-group))) + (and (not (and v1-13 (or (= v1-13 (-> self draw art-group data 60)) + (= v1-13 (-> self draw art-group data 59)) + (= v1-13 (-> self draw art-group data 283)) + (= v1-13 (-> self draw art-group data 282)) + ) + ) + ) + (begin self (can-exit-duck?)) + ) + ) + ) + (go target-stance) + ) + (if (and (move-legs?) (!= (-> self control unknown-surface01 seek0) 0.0)) + (go target-duck-walk 'duck) + ) + (if (want-to-darkjak?) + (go target-darkjak-get-on 2) + ) + (when (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) + ) + (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + (go target-high-jump (-> *TARGET-bank* duck-jump-height-min) (-> *TARGET-bank* duck-jump-height-max) 'duck) + (target-jump-go) + ) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) + (can-hands? #t) + (begin self (can-exit-duck?)) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-jump))) + (zero? (logand (-> self state-flags) (state-flags sf7))) + ) + (go + target-attack-uppercut + (-> *TARGET-bank* attack-jump-height-min) + (-> *TARGET-bank* attack-jump-height-max) + ) + ) + (fall-test target-falling -4096000.0) + (slide-down-test) + (none) + ) + :code (behavior ((arg0 symbol)) + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (or (= v1-2 (-> self draw art-group data 59)) (= v1-2 (-> self draw art-group data 282)))) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self neck base-joint) (the-as uint 8)) + (cond + ((using-gun? self) + (set! (-> self gun surpress-time) (+ (-> self clock frame-counter) (seconds 0.7))) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 283) + 0.0 + 0 + 30 + 1.0 + 6.0 + #f + ) + (ja-no-eval :group! (-> self draw art-group data 283) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 283)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 60) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 60)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (set! (-> self neck flex-blend) 1.0) + (set! (-> self neck base-joint) (the-as uint 6)) + ) + ((let ((v1-68 (ja-group))) + (and (and v1-68 (= v1-68 (-> self draw art-group data 20))) + (= (-> self skel root-channel 0) (-> self skel channel)) + ) + ) + ) + ((let ((v1-78 (ja-group))) + (and v1-78 (or (= v1-78 (-> self draw art-group data 21)) (= v1-78 (-> self draw art-group data 302)))) + ) + (ja-channel-push! 1 (seconds 0.1)) + ) + ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (ja-channel-push! 1 (seconds 0.1)) + ) + (else + (ja-channel-push! 1 (seconds 0.04)) + (ja-no-eval :group! (-> self draw art-group data 19) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 19)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data 20) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 20)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-duck-walk (target) + :event target-standard-event-handler + :enter (behavior ((arg0 symbol)) + (if (not arg0) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + (set! (-> self control unknown-float29) 1.0) + (target-collide-set! 'duck 1.0) + (let ((v1-7 (ja-group))) + (if (not (and v1-7 (or (= v1-7 (-> self draw art-group data 59)) (= v1-7 (-> self draw art-group data 282))))) + (set! (-> self control unknown-surface00) *duck-mods*) + ) + ) + (none) + ) + :exit (-> target-duck-stance exit) + :trans (behavior () + (local-vars (v1-22 joint-control-channel)) + ((-> self state-hook)) + (when (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1)) + ) + (logtest? (-> self state-flags) (state-flags sf9)) + (and (logtest? (water-flags wading) (-> self water flags)) + (>= (- (- (-> self control trans y) (- (-> self water base-height) (-> self water wade-height)))) 2457.6) + ) + ) + (begin self (can-exit-duck?)) + ) + (if (and (using-gun? self) + (begin (set! v1-22 (top-anim-joint-control-method-11 (-> self skel top-anim) 0)) v1-22) + (= (-> v1-22 frame-group) (-> self draw art-group data 283)) + ) + (target-top-anim-base-mode 60) + ) + (go target-walk) + ) + (if (not (move-legs?)) + (go target-duck-stance 'duck) + ) + (if (want-to-darkjak?) + (go target-darkjak-get-on 2) + ) + (when (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) + ) + (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + (go target-high-jump (-> *TARGET-bank* duck-jump-height-min) (-> *TARGET-bank* duck-jump-height-max) 'duck) + (target-jump-go) + ) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) + (can-hands? #t) + (begin self (can-exit-duck?)) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-jump))) + (zero? (logand (-> self state-flags) (state-flags sf7))) + ) + (go + target-attack-uppercut + (-> *TARGET-bank* attack-jump-height-min) + (-> *TARGET-bank* attack-jump-height-max) + ) + ) + (fall-test target-falling -4096000.0) + (slide-down-test) + (none) + ) + :code (behavior ((arg0 symbol)) + (let ((gp-0 (if (using-gun? self) + (-> self draw art-group data 302) + (-> self draw art-group data 21) + ) + ) + (v1-6 (ja-group)) + ) + (cond + ((and (and v1-6 (or (= v1-6 (-> self draw art-group data 21)) (= v1-6 (-> self draw art-group data 302)))) + (= (-> self skel root-channel 0) (-> self skel channel)) + ) + ) + (else + (let ((v1-16 (ja-group))) + (cond + ((and v1-16 (= v1-16 (-> self draw art-group data 20))) + (ja-channel-push! 1 (seconds 0.45)) + (ja :group! gp-0 :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! gp-0 :num! min) + ) + ) + ) + ) + ) + ) + (set! (-> self state-flags) (logior (state-flags lleg-no-ik rleg-no-ik) (-> self state-flags))) + (until #f + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (set! (-> self control unknown-surface00) *duck-mods*) + ) + (ja :num! (loop! (fmin 3.0 (/ (-> self control unknown-float05) + (* 60.0 (/ (-> *TARGET-bank* duck-walk-cycle-dist) (-> *TARGET-bank* run-cycle-length))) + ) + ) + ) + ) + (suspend) + ) + #f + (none) + ) + :post target-post + ) + +;; definition for function target-jump-top-anim +;; WARN: Return type mismatch int vs none. +(defbehavior target-jump-top-anim target () + (let ((gp-0 (top-anim-joint-control-method-11 (-> self skel top-anim) 0))) + (when gp-0 + (let ((s5-0 (-> gp-0 frame-group)) + (f0-0 (ja-aframe-num 0)) + ) + (when (or (= s5-0 (-> self draw art-group data 304)) (= s5-0 (-> self draw art-group data 300))) + (let ((v1-13 (ja-group))) + (if (and v1-13 (= v1-13 (-> self draw art-group data 30))) + (set! (-> gp-0 frame-num) (/ (- f0-0 (+ 16.0 (-> s5-0 artist-base))) (-> s5-0 artist-step))) + (set! (-> gp-0 frame-num) (/ (- f0-0 (-> s5-0 artist-base)) (-> s5-0 artist-step))) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate target-jump (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 surface)) + (when (= (-> self control unknown-symbol06) 'launch) + (talker-spawn-func (-> *talker-speech* 326) *entity-pool* (target-pos 0) (the-as region #f)) + (talker-spawn-func (-> *talker-speech* 327) *entity-pool* (target-pos 0) (the-as region #f)) + enter-state + (let ((a0-7 (-> self control unknown-dword07)) + (a1-3 (-> self control unknown-dword08)) + (a2-3 (-> self control unknown-vector37)) + ) + (set! (-> a2-3 quad) (-> (the-as vector (-> self control unknown-dword09)) quad)) + (go target-launch (the-as float a0-7) (the-as symbol a1-3) a2-3 (-> self control unknown-dword10)) + ) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (sound-play "jump" :vol 70) + (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (set! arg2 (cond + (arg2 + (empty) + arg2 + ) + (else + *jump-mods* + ) + ) + ) + (set! (-> self control unknown-surface00) arg2) + (set! (-> self control unknown-float36) + (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control unknown-float05))))) + ) + (set! (-> self control unknown-float35) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float05))))) + ) + (none) + ) + :exit target-exit + :trans (behavior () + (set! (-> self control unknown-float36) + (fmax + (-> self control unknown-float36) + (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 6))) + ) + ) + (let ((t9-0 target-falling-trans) + (a0-1 #f) + (v1-12 (ja-group)) + ) + (t9-0 a0-1 (the-as time-frame (if (and v1-12 (= v1-12 (-> self draw art-group data 27))) + 15 + -1 + ) + ) + ) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + (* 12288.0 (-> self darkjak-giant-interp) (-> self darkjak-giant-interp)) + ) + (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (zero? (logand (water-flags touch-water) (-> self water flags))) + (zero? (logand (state-flags sf7 sf23) (-> self state-flags))) + ) + ) + (go target-double-jump (-> *TARGET-bank* double-jump-height-min) (-> *TARGET-bank* double-jump-height-max)) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) + (and (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + (* 26624.0 (-> self darkjak-giant-interp) (-> self darkjak-giant-interp)) + ) + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame14)) + (the-as time-frame (-> *TARGET-bank* stuck-timeout)) + ) + (zero? (logand (-> self state-flags) (state-flags sf8))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-attack no-hands))) + (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + ) + ) + ) + (go + target-flop + 65502.96 + -163840.0 + (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + 0 + #x47866666 + ) + ) + ) + ) + (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) + (slide-down-test) + (seek! + (-> self control unknown-float35) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float05))))) + (-> self clock seconds-per-frame) + ) + (none) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 surface)) + (let ((f28-0 20.0) + (f30-0 1.0) + ) + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (-> self gun gun-type) + (((pickup-type eco-blue)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 304) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + (else + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 300) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (let ((v1-18 (ja-group))) + (cond + ((and (and v1-18 (= v1-18 (-> self draw art-group data 54))) + (>= 25.0 (ja-aframe-num 0)) + (>= (ja-aframe-num 0) 17.0) + ) + (set! (-> self neck flex-blend) 0.0) + (ja-channel-push! 1 0) + (cond + ((using-gun? self) + (ja :group! (-> self draw art-group data 30) :num! (identity (ja-aframe 16.0 0))) + (set! f28-0 35.0) + ) + (else + (ja :group! (-> self draw art-group data 58) :num! (identity (ja-aframe 25.0 0))) + (set! f28-0 24.0) + (set! f30-0 0.3) + ) + ) + ) + ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 394) :num! min) + (suspend) + 0 + ) + (else + (ja-channel-push! 2 (seconds 0.05)) + (ja :group! (-> self draw art-group data 23) :num! min) + (let ((a0-23 (-> self skel root-channel 1))) + (let ((f0-8 (-> self control unknown-float35))) + (set! (-> a0-23 frame-interp 1) f0-8) + (set! (-> a0-23 frame-interp 0) f0-8) + ) + (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> self draw art-group data 29))) + (set! (-> a0-23 param 0) 0.0) + (joint-control-channel-group-eval! + a0-23 + (the-as art-joint-anim (-> self draw art-group data 29)) + num-func-chan + ) + ) + (suspend) + (ja :group! (-> self draw art-group data 23) :num! (+!)) + (let ((a0-25 (-> self skel root-channel 1))) + (let ((f0-11 (-> self control unknown-float35))) + (set! (-> a0-25 frame-interp 1) f0-11) + (set! (-> a0-25 frame-interp 0) f0-11) + ) + (set! (-> a0-25 frame-group) (the-as art-joint-anim (-> self draw art-group data 29))) + (set! (-> a0-25 param 0) 0.0) + (joint-control-channel-group-eval! + a0-25 + (the-as art-joint-anim (-> self draw art-group data 29)) + num-func-chan + ) + ) + (suspend) + 0 + ) + ) + ) + (until (ja-done? 0) + (let ((f26-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (f24-0 (- f28-0 (ja-aframe-num 0))) + ) + (target-jump-top-anim) + (ja :num! (seek! max (if (and (< 0.0 f26-1) (< 0.0 f24-0)) + (fmin (fmin 3.0 f24-0) (/ (* 5.0 f24-0) (the float (time-to-apex f26-1 -245760.0)))) + f30-0 + ) + ) + ) + ) + (when (>= (ja-group-size) 2) + (let ((a0-30 (-> self skel root-channel 1))) + (let ((f0-26 (-> self control unknown-float35))) + (set! (-> a0-30 frame-interp 1) f0-26) + (set! (-> a0-30 frame-interp 0) f0-26) + ) + (set! (-> a0-30 param 0) 0.0) + (joint-control-channel-group-eval! a0-30 (the-as art-joint-anim #f) num-func-chan) + ) + ) + (suspend) + ) + ) + (target-falling-anim -1 (seconds 0.2)) + (go target-falling #f) + (none) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-jump-forward (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float)) + ((-> target-jump enter) arg0 arg1 (the-as surface #f)) + (set! (-> self control unknown-surface00) *forward-jump-mods*) + (none) + ) + :exit target-exit + :trans (-> target-jump trans) + :code (behavior ((arg0 float) (arg1 float)) + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (-> self gun gun-type) + (((pickup-type eco-blue)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 304) + 3.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + (else + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 300) + 3.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (ja-channel-set! 1) + (ja-no-eval :group! (-> self draw art-group data 23) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 23)) frames num-frames) -1))) + :frame-num (ja-aframe 3.0 0) + ) + (until (ja-done? 0) + (set! (-> self control unknown-time-frame09) 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! (-> self draw art-group data 27) :num! (loop!) :frame-num 0.0) + (until #f + (suspend) + (target-jump-top-anim) + (ja :group! (-> self draw art-group data 27) :num! (loop!)) + ) + #f + (none) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-double-jump (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float)) + (when (= (-> self control unknown-symbol06) 'launch) + enter-state + (let ((a0-3 (-> self control unknown-dword07)) + (a1-1 (-> self control unknown-dword08)) + (a2-0 (-> self control unknown-vector37)) + ) + (set! (-> a2-0 quad) (-> (the-as vector (-> self control unknown-dword09)) quad)) + (go target-launch (the-as float a0-3) (the-as symbol a1-1) a2-0 (-> self control unknown-dword10)) + ) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (if (!= (-> self control unknown-surface00) *slide-jump-mods*) + (set! (-> self control unknown-surface00) *double-jump-mods*) + ) + (none) + ) + :exit target-exit + :trans (behavior () + (let ((t9-0 target-falling-trans) + (a0-0 #f) + (v1-2 (ja-group)) + ) + (t9-0 a0-0 (the-as time-frame (if (and v1-2 (= v1-2 (-> self draw art-group data 27))) + 15 + -1 + ) + ) + ) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 22118.4) + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame14)) + (the-as time-frame (-> *TARGET-bank* stuck-timeout)) + ) + (zero? (logand (-> self state-flags) (state-flags sf8))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-attack no-hands))) + (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + ) + ) + (go + target-flop + 33775.48 + -122880.0 + (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + 0 + #x47866666 + ) + ) + ) + ) + (if (!= (-> self state-time) (-> self clock frame-counter)) + (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) + ) + (seek! + (-> self control unknown-float35) + (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float05))))) + (-> self clock seconds-per-frame) + ) + (none) + ) + :code (behavior ((arg0 float) (arg1 float)) + (sound-play "jump-double") + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (-> self gun gun-type) + (((pickup-type eco-blue)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 304) + 7.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + (else + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 300) + 7.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (cond + ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 394) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 394)) frames num-frames) -1))) + :frame-num (ja-aframe 7.0 0) + ) + ) + (else + (ja-channel-push! 2 (seconds 0.05)) + (ja-no-eval :group! (-> self draw art-group data 23) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 23)) frames num-frames) -1))) + :frame-num (ja-aframe 5.0 0) + ) + (ja :chan 1 :group! (-> self draw art-group data 29) :num! (chan 0)) + ) + ) + (until (ja-done? 0) + (suspend) + (target-jump-top-anim) + (ja :num! (seek!)) + (when (>= (ja-group-size) 2) + (let ((a0-18 (-> self skel root-channel 1))) + (let ((f0-13 (-> self control unknown-float35))) + (set! (-> a0-18 frame-interp 1) f0-13) + (set! (-> a0-18 frame-interp 0) f0-13) + ) + (set! (-> a0-18 param 0) 0.0) + (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-chan) + ) + ) + ) + (target-falling-anim -1 (seconds 0.2)) + (go target-falling #f) + (none) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-high-jump (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 object)) + (when (and (= (-> self control unknown-symbol06) 'launch) (!= arg2 'launch)) + enter-state + (let ((a0-3 (-> self control unknown-dword07)) + (a1-1 (-> self control unknown-dword08)) + (a2-1 (-> self control unknown-vector37)) + ) + (set! (-> a2-1 quad) (-> (the-as vector (-> self control unknown-dword09)) quad)) + (go target-launch (the-as float a0-3) (the-as symbol a1-1) a2-1 (-> self control unknown-dword10)) + ) + ) + (set! (-> self control unknown-symbol03) (the-as float arg2)) + (if (or (= arg2 'duck) (= arg2 'launch)) + (go target-duck-high-jump arg0 arg1 (the-as symbol arg2)) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (sound-play "jump" :pitch 0.3) + (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) + (set! (-> self control unknown-surface00) (cond + ((= arg2 'flip) + *flip-jump-mods* + ) + ((= arg2 'flop-forward) + *forward-high-jump-mods* + ) + (else + *high-jump-mods* + ) + ) + ) + (set! (-> self control unknown-float35) + (fmax 0.0 (fmin 0.5 (* 0.00008138021 (+ -409.6 (-> self control unknown-float05))))) + ) + (none) + ) + :exit target-exit + :trans (behavior () + (let ((t9-0 target-falling-trans) + (a0-0 #f) + (v1-2 (ja-group)) + ) + (t9-0 a0-0 (the-as time-frame (if (and v1-2 (= v1-2 (-> self draw art-group data 27))) + 15 + -1 + ) + ) + ) + ) + (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 square) + ) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 73728.0) + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame14)) + (the-as time-frame (-> *TARGET-bank* stuck-timeout)) + ) + (zero? (logand (-> self state-flags) (state-flags sf8))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-attack no-hands))) + (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + ) + ) + (go + target-flop + 33775.48 + -122880.0 + (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + 0 + #x47866666 + ) + ) + ) + ) + (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) + (seek! + (-> self control unknown-float35) + (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control unknown-float05))))) + (-> self clock seconds-per-frame) + ) + (none) + ) + :code (-> target-jump code) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-duck-high-jump (target) + :event target-standard-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (set! (-> self state-time) (-> self clock frame-counter)) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (set! (-> self control unknown-surface00) *turn-around-mods*) + (case arg2 + (('launch) + ) + (else + ) + ) + (none) + ) + :exit target-exit + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (let ((v1-2 (ja-group))) + (if (not (and (and v1-2 (= v1-2 (-> self draw art-group data 20))) + (= (-> self skel root-channel 0) (-> self skel channel)) + ) + ) + (ja-channel-push! 1 (seconds 0.04)) + ) + ) + (let ((v1-11 arg2)) + (cond + ((or (= v1-11 'flop) (= v1-11 'flop-forward)) + (ja-no-eval :group! (-> self draw art-group data 58) :num! (seek! (ja-aframe 25.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 25.0 0))) + ) + ) + ((using-gun? self) + (ja :group! (-> self draw art-group data 30) :num! (identity (ja-aframe 16.0 0))) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 30) :num! (seek! (ja-aframe 16.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 16.0 0))) + ) + ) + ) + ) + (go target-duck-high-jump-jump arg0 arg1 arg2) + (none) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-duck-high-jump-jump (target) + :event target-jump-event-handler + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (set! (-> self control unknown-symbol03) (the-as float arg2)) + (set! (-> self state-time) (-> self clock frame-counter)) + (sound-play "jump" :vol 80 :pitch -0.4) + (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (cond + ((= arg2 'launch) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control unknown-surface00) *launch-jump-mods*) + ) + (else + (set! (-> self control unknown-surface00) *high-jump-mods*) + ) + ) + (none) + ) + :exit target-exit + :trans (behavior () + ((-> target-high-jump trans)) + (case (-> self control unknown-symbol03) + (('launch) + (when *sound-player-enable* + (let ((gp-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> gp-0 command) (sound-command set-param)) + (set! (-> gp-0 id) (-> self control unknown-sound-id00)) + (let ((a1-0 (ear-trans 0))) + (let ((s5-0 self)) + (when (= a1-0 #t) + (if (and s5-0 (type? s5-0 process-drawable) (nonzero? (-> s5-0 control))) + (set! a1-0 (-> s5-0 control trans)) + (set! a1-0 (the-as vector #f)) + ) + ) + ) + (sound-trans-convert (the-as vector3w (-> gp-0 params trans)) a1-0) + ) + (set! (-> gp-0 params mask) (the-as uint 32)) + (-> gp-0 id) + ) + ) + ) + ) + (none) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (-> self gun gun-type) + (((pickup-type eco-blue)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 304) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + (else + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 300) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (let* ((f30-0 1.0) + (v1-15 arg2) + (f28-0 (cond + ((= v1-15 'launch) + 110.0 + ) + ((or (= v1-15 'flop) (= v1-15 'flop-forward)) + (set! f30-0 0.75) + 44.0 + ) + (else + 35.0 + ) + ) + ) + ) + (until (ja-done? 0) + (let ((f24-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (f26-0 (- f28-0 (ja-aframe-num 0))) + ) + (target-jump-top-anim) + (let ((f22-1 (fmin (fmin 3.0 f26-0) (/ (* 5.0 f26-0) (the float (time-to-apex f24-0 -245760.0))))) + (s5-0 (-> self skel root-channel 0)) + ) + (set! (-> s5-0 param 0) (the float (+ (-> s5-0 frame-group frames num-frames) -1))) + (let ((v1-38 (cond + ((and (< 0.0 f24-0) (< 0.0 f26-0)) + (if (= arg2 'launch) + (set! f30-0 (lerp f30-0 (* 4.0 f22-1) 0.25)) + ) + f22-1 + ) + (else + f30-0 + ) + ) + ) + ) + (set! (-> s5-0 param 1) v1-38) + ) + (joint-control-channel-group-eval! s5-0 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (suspend) + ) + ) + (cond + ((or (= arg2 'flop) (= arg2 'flop-forward)) + (ja-channel-push! 1 (seconds 0.5)) + (ja-no-eval :group! (-> self draw art-group data 27) :num! (loop!) :frame-num 0.0) + (until #f + (suspend) + (ja :group! (-> self draw art-group data 27) :num! (loop!)) + ) + #f + ) + (else + (ja-no-eval :group! (-> self draw art-group data 27) :num! (loop!) :frame-num 0.0) + (until #f + (suspend) + (ja :group! (-> self draw art-group data 27) :num! (loop!)) + ) + #f + ) + ) + (none) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-falling (target) + :event target-jump-event-handler + :enter (behavior ((arg0 symbol)) + (case arg0 + (('uppercut) + (set! (-> self control unknown-surface00) *uppercut-jump-mods*) + ) + (else + (set! (-> self control unknown-surface00) *jump-mods*) + ) + ) + (set! (-> self control unknown-word04) (the-as uint arg0)) + (set! (-> self state-time) (-> self clock frame-counter)) + (none) + ) + :trans (behavior () + (target-falling-trans + (the-as symbol (-> self control unknown-spool-anim00)) + (the-as time-frame (if (= (-> self control unknown-spool-anim00) #f) + 0 + (the-as int (/ (the-as int (-> *TARGET-bank* stuck-time)) 2)) + ) + ) + ) + (none) + ) + :code (behavior ((arg0 symbol)) + (case arg0 + (('uppercut) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (set! (-> self gun surpress-time) 0) + (send-event self 'gun (-> self gun gun-type)) + (set! (-> self gun track-target-hold-time) 0) + 0 + ) + (('hit) + (ja-channel-push! 1 (seconds 0.3)) + (ja-no-eval :group! (-> self draw art-group data 66) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 66)) frames num-frames) -1))) + :frame-num (ja-aframe 15.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (target-falling-anim -1 (seconds 0.33)) + (none) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-hit-ground (target) + :event target-walk-event-handler + :enter (behavior ((arg0 symbol)) + (set! (-> self control unknown-float06) 0.0) + (cond + ((or (= arg0 'stuck) (logtest? (focus-status indax) (-> self focus-status))) + ) + (else + (let ((f0-2 (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector21) (-> self control trans)) + ) + ) + ) + (if (and (< (-> *TARGET-bank* fall-far) f0-2) + (zero? (logand (-> self control status) (cshape-moving-flags on-water))) + ) + (go target-hit-ground-hard f0-2) + ) + ) + ) + ) + (cond + ((= arg0 'stuck) + ) + (else + (target-land-effect) + ) + ) + (set! (-> self control unknown-time-frame11) 0) + (set! (-> self control unknown-time-frame12) 0) + (if (>= (-> self control ground-impact-vel) (-> *TARGET-bank* fall-stumble-threshold)) + (set-forward-vel 0.0) + ) + (if (!= (-> self control ground-pat material) (pat-material ice)) + (delete-back-vel) + ) + (set! (-> self control unknown-surface00) *walk-mods*) + (let ((s5-0 (method-of-object (-> self water) water-control-method-11))) + (lerp-scale 0.0 4096.0 (-> self control ground-impact-vel) 40960.0 102400.0) + 600 + 1500 + (s5-0) + ) + (if (and (logtest? (focus-status dark) (-> self focus-status)) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) 32) + ) + (activate! *camera-smush-control* 1638.4 15 75 1.0 0.9 (-> *display* camera-clock)) + ) + (when (and (using-gun? self) (let ((v1-44 (-> self water flags))) + (not (and (logtest? (water-flags touch-water) v1-44) + (logtest? (water-flags under-water swimming) v1-44) + (zero? (logand (focus-status mech) (-> self focus-status))) + ) + ) + ) + ) + (set! (-> self gun top-anim-low-high) 0.0) + (case (-> self gun gun-type) + (((pickup-type eco-blue)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 305) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + (((pickup-type eco-red) (pickup-type eco-dark)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 301) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + ) + (else + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 301) + 0.0 + 30 + 30 + 1.0 + 25.0 + #f + ) + ) + ) + ) + (none) + ) + :exit (behavior () + (logclear! (-> self state-flags) (state-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + (none) + ) + :trans (behavior () + (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) + ) + (target-jump-go) + ) + (if (and (or (cpad-hold? (-> self control unknown-cpad-info00 number) l1) (begin self (not (can-exit-duck?)))) + (can-duck?) + ) + (go target-duck-stance #f) + ) + (when (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + (if (logtest? (water-flags wading) (-> self water flags)) + (go target-wade-walk) + (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 circle) + ) + (can-feet? #t) + ) + (go target-attack) + ) + (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 square) + ) + (can-hands? #t) + ) + (go target-running-attack) + ) + (fall-test target-falling -4096000.0) + (slide-down-test) + (none) + ) + :code (behavior ((arg0 symbol)) + (let ((gp-0 target-hit-ground-anim) + (s5-0 #f) + ) + (are-still?) + (gp-0 s5-0) + ) + (go target-stance) + (none) + ) + :post target-post + ) + +;; definition for symbol *attack-mods*, type surface +(define *attack-mods* (new 'static 'surface + :name 'attack + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 object) (arg2 object) (arg3 int)) + (case arg3 + ((1) + (case (-> self control ground-pat event) + (((pat-event slide)) + (set! (-> arg0 seek0) 0.05) + (set! (-> arg0 seek90) 0.05) + (set! (-> arg0 seek180) 0.05) + ) + ) + ) + ) + ) + :mode 'attack + :flags (surface-flag attack spin gun-inactive gun-turn-fast) + ) + ) + +;; failed to figure out what this is: +(let ((v1-25 (copy *attack-mods* 'global))) + (set! (-> v1-25 flags) (surface-flag attack spin gun-turn-fast)) + (set! (-> v1-25 mult-hook) (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + ((-> *attack-mods* mult-hook) arg0 arg1 arg2 arg3) + (when (= arg3 1) + (if (and (nonzero? (-> self gun turn-fast-hold-time)) + (< (-> self clock frame-counter) (-> self gun turn-fast-hold-time)) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + ) + ) + (none) + ) + ) + (set! *attack-end-mods* v1-25) + ) + +;; failed to figure out what this is: +(defstate target-attack (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('touched) + (cond + (((method-of-type touching-shapes-entry touching-shapes-entry-method-12) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 1920) + ) + (let ((t9-1 target-send-attack) + (a1-2 (-> self control unknown-symbol04)) + (a2-2 (-> arg3 param 0)) + (a3-1 (-> self control unknown-symbol05)) + (t0-0 (-> self control unknown-dword05)) + ) + (-> self control penetrate-using) + (when (t9-1 arg0 (the-as uint a1-2) a2-2 (the-as int a3-1) (the-as int t0-0)) + (set! (-> self gun combo-window-start) (-> self clock frame-counter)) + (let ((v0-2 (the-as object (-> self state name)))) + (set! (-> self gun combo-window-state) (the-as symbol v0-2)) + v0-2 + ) + ) + ) + ) + (else + (target-dangerous-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + (('gun-combo) + (when (-> arg3 param 0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (go target-stance) + ) + #t + ) + (('slide) + #f + ) + (else + (target-dangerous-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (target-start-attack) + (target-danger-set! 'spin #f) + (set! (-> self control unknown-surface00) *attack-mods*) + (set! (-> self water drip-mult) 4.0) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self gun track-target-hold-time) 0) + (if (< 0.0 (-> self control unknown-float10)) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (-> self control unknown-vector08) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (quaternion-copy! (-> self control unknown-quaternion04) (-> self control dir-targ)) + (set! (-> self control unknown-float40) 0.0) + (set! (-> self control unknown-float41) 0.0) + (none) + ) + :exit (behavior () + (if (zero? (-> self gun track-target-hold-time)) + (quaternion-copy! (-> self control dir-targ) (-> self control unknown-quaternion04)) + ) + (set! (-> self control unknown-time-frame12) (-> self clock frame-counter)) + (target-exit) + (none) + ) + :code (behavior () + (let ((gp-0 (-> self draw art-group data 40))) + (cond + ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (set! gp-0 (-> self draw art-group data 399)) + (quaternion-rotate-y! + (-> self control unknown-quaternion00) + (-> self control unknown-quaternion00) + -1365.3334 + ) + ) + ((using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (-> self gun gun-type) + (((pickup-type eco-yellow)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 248) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + (set! gp-0 (-> self draw art-group data 248)) + (quaternion-rotate-y! (-> self control unknown-quaternion00) (-> self control unknown-quaternion00) -3276.8) + ) + (((pickup-type eco-blue)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 250) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + (set! gp-0 (-> self draw art-group data 250)) + ) + (else + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 248) + 0.0 + 30 + 30 + 1.0 + 0.0 + #f + ) + (set! gp-0 (-> self draw art-group data 248)) + (quaternion-rotate-y! (-> self control unknown-quaternion00) (-> self control unknown-quaternion00) -3276.8) + ) + ) + ) + (else + (quaternion-rotate-y! + (-> self control unknown-quaternion00) + (-> self control unknown-quaternion00) + -1365.3334 + ) + ) + ) + (ja-channel-push! 1 (seconds 0.05)) + (set! (-> self control unknown-sound-id01) (sound-play "spin-kick")) + (ja-no-eval :group! gp-0 + :num! (seek! + (the float (+ (-> (the-as art-joint-anim gp-0) frames num-frames) -1)) + (-> self control unknown-surface01 align-speed) + ) + :frame-num 0.0 + ) + ) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (when (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) 2) + (>= (-> (the-as fact-info-target (-> self fact)) eco-level) 1.0) + ) + (let ((s5-1 (method-of-object (-> self skel effect) effect-control-method-10))) + 'group-red-eco-spinkick + (ja-frame-num 0) + 38 + (s5-1) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + (talker-spawn-func (-> *talker-speech* 328) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (when (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) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (target-jump-go) + ) + (suspend) + (ja :num! (seek! max (-> self control unknown-surface01 align-speed))) + ) + (cond + ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (quaternion-rotate-y! + (-> self control unknown-quaternion00) + (-> self control unknown-quaternion00) + -12743.111 + ) + ) + ((using-gun? self) + (when (zero? (-> self gun track-target-hold-time)) + (case (-> self gun gun-type) + (((pickup-type eco-blue)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 251) + 0.0 + 0 + 60 + 1.0 + 6.0 + #f + ) + (quaternion-rotate-y! (-> self control unknown-quaternion00) (-> self control unknown-quaternion00) -3640.889) + ) + (((pickup-type eco-yellow)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 249) + 0.0 + 0 + 60 + 1.0 + 6.0 + #f + ) + (quaternion-rotate-y! + (-> self control unknown-quaternion00) + (-> self control unknown-quaternion00) + -5461.3335 + ) + ) + (else + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 249) + 0.0 + 0 + 60 + 1.0 + 6.0 + #f + ) + (quaternion-rotate-y! + (-> self control unknown-quaternion00) + (-> self control unknown-quaternion00) + -5461.3335 + ) + ) + ) + ) + ) + (else + (quaternion-rotate-y! + (-> self control unknown-quaternion00) + (-> self control unknown-quaternion00) + -1365.3334 + ) + ) + ) + (go target-stance) + (none) + ) + :post target-post + ) + +;; definition for symbol *run-attack-mods*, type surface +(define *run-attack-mods* (new 'static 'surface + :name 'punch + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 91750.4 + :target-speed 122880.0 + :seek90 0.5 + :seek180 0.15 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'attack + :flags (surface-flag no-turn-around turn-to-pad attack gun-inactive) + ) + ) + +;; failed to figure out what this is: +(defstate target-running-attack (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('touched) + (cond + (((method-of-type touching-shapes-entry touching-shapes-entry-method-12) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 1920) + ) + (let ((t9-1 target-send-attack) + (a0-3 arg0) + (a1-2 (-> self control unknown-symbol04)) + (a2-2 (-> arg3 param 0)) + (a3-1 (-> self control unknown-symbol05)) + (t0-0 (-> self control unknown-dword05)) + ) + (-> self control penetrate-using) + (let ((gp-1 (t9-1 a0-3 (the-as uint a1-2) a2-2 (the-as int a3-1) (the-as int t0-0)))) + (when gp-1 + (set! (-> self control unknown-time-frame17) (-> self clock frame-counter)) + (set! (-> self gun combo-window-start) (-> self clock frame-counter)) + (set! (-> self gun combo-window-state) (-> self state name)) + (let ((v1-13 (if (type? arg0 process-focusable) + arg0 + ) + ) + ) + (when v1-13 + (let* ((s5-1 (-> (the-as target v1-13) control)) + (v1-14 (if (type? s5-1 collide-shape) + s5-1 + ) + ) + ) + (if (and v1-14 (or (logtest? (-> v1-14 root-prim prim-core collide-as) (collide-spec enemy)) + (logtest? (-> v1-14 root-prim prim-core action) (collide-action no-smack)) + ) + ) + (set! (-> self control unknown-word04) (the-as uint (+ (-> self control unknown-word04) 1))) + ) + ) + ) + ) + (cond + ((or (= gp-1 'die) (= gp-1 'push)) + (let ((v0-2 (the-as object (-> self clock frame-counter)))) + (set! (-> self control unknown-time-frame18) (the-as time-frame v0-2)) + v0-2 + ) + ) + ((= gp-1 'back) + (let ((f0-0 -122880.0)) + (set! (-> self control unknown-word04) (the-as uint f0-0)) + f0-0 + ) + ) + ) + ) + ) + ) + ) + (else + (target-dangerous-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + (('gun-combo) + (if (-> arg3 param 0) + (go target-stance) + ) + #t + ) + (('slide) + #f + ) + (else + (target-dangerous-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior () + (if (and (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (and (-> self next-state) (= (-> self next-state name) 'target-running-attack)) + ) + (go target-darkjak-running-attack) + ) + (logclear! + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons square) + ) + (logclear! + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons square) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (combo-tracker-method-12 + (-> self control unknown-combo-tracker00) + *null-vector* + *null-vector* + (the-as process #f) + (-> self clock frame-counter) + ) + (set! (-> self control unknown-time-frame17) 0) + (set! (-> self control unknown-time-frame18) 0) + (set! (-> self control unknown-word04) (the-as uint 0)) + (set! (-> self control unknown-word04) (the-as uint 0.0)) + (set! (-> self control unknown-surface00) *run-attack-mods*) + (cond + ((= (-> self control ground-pat event) (pat-event slide)) + (set! (-> *run-attack-mods* turnv) 0.0) + (set! (-> *run-attack-mods* turnvv) 0.0) + ) + (else + (set! (-> *run-attack-mods* turnv) 655360.0) + (set! (-> *run-attack-mods* turnvv) 655360.0) + ) + ) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self gun track-target-hold-time) 0) + (if (or (< (fabs (-> self control unknown-float18)) 0.3) (< 0.3 (fabs (-> self control unknown-float17)))) + (set! (-> self control unknown-float29) 1.0) + ) + (set! (-> self upper-body twist z) 0.0) + (none) + ) + :exit (behavior () + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (set! (-> *run-attack-mods* turnv) 0.0) + (set! (-> *run-attack-mods* turnvv) 0.0) + (set! (-> self control unknown-time-frame11) (-> self clock frame-counter)) + (target-exit) + (none) + ) + :trans (behavior () + (when (!= (-> self state-time) (-> self clock frame-counter)) + (when (and (or (smack-surface? #t) + (and (>= (-> self control unknown-float19) 0.7) + (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + ) + ) + (begin + (set! (-> self control unknown-time-frame18) (-> self clock frame-counter)) + (set! (-> self control unknown-float29) 0.0) + (let ((v1-11 (new-stack-vector0)) + (f0-3 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-11 + (-> self control transv) + (the-as vector (vector-float*! v1-11 (-> self control dynam gravity-normal) f0-3)) + ) + (let* ((f1-3 (vector-length v1-11)) + (f2-0 f1-3) + (f0-4 (fmin 0.0 f0-3)) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-4)) + (the-as vector (vector-float*! v1-11 v1-11 (/ f1-3 f2-0))) + ) + ) + ) + #t + ) + (or (zero? (-> self control unknown-time-frame17)) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame17)) (seconds 0.04)) + ) + (!= (-> self control unknown-word04) 1) + ) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) + (< 4096.0 (-> self control unknown-float05)) + (or (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.1)) + (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons square) + ) + ) + ) + (zero? (logand (-> self state-flags) (state-flags sf7 sf8))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-attack))) + (let ((v1-48 (ja-group))) + (and (not (and v1-48 (= v1-48 (-> self draw art-group data 406)))) + (and (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-jump))) + (zero? (logand (-> self state-flags) (state-flags sf7))) + ) + ) + ) + ) + (go + target-attack-uppercut + (-> *TARGET-bank* attack-jump-height-min) + (-> *TARGET-bank* attack-jump-height-max) + ) + ) + (if (and (logtest? (water-flags touch-water) (-> self water flags)) + (zero? (mod (- (-> self clock frame-counter) (-> self state-time)) 21)) + ) + (water-control-method-13 + (-> self water) + 0.6 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 8)) + 0 + (-> self control transv) + #f + ) + ) + (when (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) 2) + (>= (-> (the-as fact-info-target (-> self fact)) eco-level) 1.0) + ) + (let ((s5-1 (method-of-object (-> self skel effect) effect-control-method-10))) + 'group-red-eco-spinkick + (ja-frame-num 0) + 22 + (s5-1) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + (talker-spawn-func (-> *talker-speech* 328) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + (none) + ) + :code (behavior () + (if (logtest? (water-flags touch-water) (-> self water flags)) + (sound-play "swim-stroke") + ) + (set! (-> self control dynam gravity-max) 368640.0) + (set! (-> self control dynam gravity-length) 368640.0) + (let ((gp-1 (-> self draw art-group data 48))) + (ja-channel-push! 1 (seconds 0.02)) + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (-> self gun gun-type) + (((pickup-type eco-yellow)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 273) + 0.0 + 30 + 60 + 1.0 + 0.0 + #f + ) + (set! gp-1 (-> self draw art-group data 275)) + ) + (((pickup-type eco-blue)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 275) + 0.0 + 30 + 60 + 1.0 + 0.0 + #f + ) + (set! gp-1 (-> self draw art-group data 275)) + ) + (else + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 273) + 0.0 + 30 + 60 + 1.0 + 0.0 + #f + ) + (set! gp-1 (-> self draw art-group data 273)) + ) + ) + ) + (ja-no-eval :group! gp-1 :num! (seek! (the float (+ (-> (the-as art-joint-anim gp-1) frames num-frames) -1)))) + ) + (target-start-attack) + (target-danger-set! 'punch #f) + (initialize + (-> self control unknown-impact-control00) + self + 22 + 3276.8 + (-> self control root-prim prim-core collide-with) + ) + (let ((f26-0 (the-as number 0.0)) + (f30-0 1.0) + (gp-2 0) + (f28-0 1.0) + ) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (when (not (ja-min? 0)) + (cond + ((and (>= (ja-aframe-num 0) 20.0) + (and (and (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) + (the-as time-frame (-> *TARGET-bank* ground-timeout)) + ) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) + ) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame17)) (seconds 0.04)) + ) + ) + (go target-falling #f) + ) + ((< (the-as float f26-0) 0.0) + (set! f26-0 (seek (the-as float f26-0) -0.04096 (* 491520.0 (-> self clock seconds-per-frame)))) + (set-forward-vel (the-as float f26-0)) + ) + ((and (nonzero? (-> self control unknown-time-frame18)) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame18)) (seconds 0.04)) + ) + (set-forward-vel 0.0) + ) + ((and (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons square) + ) + ) + (>= (- (-> self clock frame-counter) (-> self control unknown-combo-tracker00 move-start-time)) + (seconds 0.05) + ) + ) + (if (= (-> self control ground-pat material) (pat-material ice)) + (set-forward-vel (fmax 32768.0 (* 0.8 (-> self control unknown-float05)))) + (set-forward-vel (* 0.8 (-> self control unknown-float05))) + ) + ) + ((ja-done? 0) + (set-forward-vel (the-as float f26-0)) + ) + (else + (set! f26-0 + (* (target-align-vel-z-adjust (-> self align delta trans z)) (-> self clock frames-per-second) f30-0) + ) + (set-forward-vel (the-as float f26-0)) + ) + ) + ) + (let ((s5-1 (new-stack-vector0))) + (vector-matrix*! s5-1 (-> self control transv) (-> self control unknown-matrix00)) + (set! (-> s5-1 y) 0.0) + (vector-matrix*! (-> self control unknown-vector44) s5-1 (-> self control unknown-matrix01)) + ) + (when (!= (the-as float (-> self control unknown-word04)) 0.0) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (set! f26-0 (-> self control unknown-word04)) + (set! (-> self control unknown-word04) (the-as uint 0.0)) + ) + (when (and (>= (the-as float f26-0) 0.0) + (let ((s5-2 (ja-group)) + (f24-0 (ja-aframe-num 0)) + ) + (if (or (and (= s5-2 (-> self draw art-group data 48)) + (>= f24-0 10.0) + (>= (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 48)) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + (and (= s5-2 (-> self draw art-group data 273)) + (>= f24-0 10.0) + (>= (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 273)) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + (and (= s5-2 (-> self draw art-group data 275)) + (>= f24-0 10.0) + (>= (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 275)) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + ) + #t + ) + ) + ) + (let ((s5-3 (new 'stack-no-clear 'collide-query))) + (when (and (>= (impact-control-method-11 + (-> self control unknown-impact-control00) + s5-3 + (the-as process #f) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1) + ) + 0.0 + ) + (>= 0.0 (vector-dot (-> s5-3 best-other-tri normal) (-> self control unknown-impact-control00 dir))) + ) + (when (= (-> s5-3 best-other-tri pat mode) (pat-mode wall)) + (let ((s4-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when s4-0 + (let ((t9-34 (method-of-type part-tracker activate))) + (t9-34 (the-as part-tracker s4-0) self (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + ) + (let ((t9-35 run-function-in-process) + (a0-62 s4-0) + (a1-17 part-tracker-init) + (a2-13 (-> *part-group-id-table* 11)) + (a3-8 0) + (t0-6 #f) + (t1-5 #f) + (t2-5 #f) + (t3-3 *launch-matrix*) + ) + (set! (-> t3-3 trans quad) (-> s5-3 best-other-tri intersect quad)) + ((the-as (function object object object object object object object object none) t9-35) + a0-62 + a1-17 + a2-13 + a3-8 + t0-6 + t1-5 + t2-5 + t3-3 + ) + ) + (-> s4-0 ppointer) + ) + ) + (let ((t1-6 (if (using-gun? self) + (make-u128 (the-as uint #x7469682d772d68) (the-as uint #x636e75702d6e7567)) + (make-u128 #x746968 (the-as uint #x2d772d68636e7570)) + ) + ) + ) + (effect-control-method-12 + (-> self skel effect) + 'punch + -1.0 + (the-as int (-> self control unknown-impact-control00 joint)) + (the-as basic #f) + (the-as sound-name t1-6) + ) + ) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (set! f26-0 -61440.0) + ) + ) + ) + ) + (suspend) + (ja :num! (seek! max (* (-> self control unknown-surface01 align-speed) f28-0))) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.1)) + (set! (-> *run-attack-mods* turnvv) 0.0) + ) + (if (< 2 gp-2) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control unknown-float43)))) + ) + (+! gp-2 1) + ) + ) + (if (and (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) + (the-as time-frame (-> *TARGET-bank* ground-timeout)) + ) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) + ) + (go target-falling #f) + ) + (when (and (using-gun? self) + (or (< (-> self control unknown-float12) 0.7) (= (-> self gun gun-type) (pickup-type eco-blue))) + ) + (set! (-> self gun surpress-time) (+ (-> self clock frame-counter) (seconds 0.5))) + (when (zero? (-> self gun track-target-hold-time)) + (case (-> self gun gun-type) + (((pickup-type eco-blue)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 276) + 0.0 + 0 + 60 + 1.0 + 12.0 + #f + ) + ) + (else + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 274) + 0.0 + 0 + 60 + 1.0 + 12.0 + #f + ) + ) + ) + ) + ) + (go target-stance) + (none) + ) + :post target-post + ) + +;; definition for symbol *jump-attack-mods*, type surface +(define *jump-attack-mods* + (new 'static 'surface + :name 'attack + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 24576.0 + :target-speed 24576.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 object) (arg2 object) (arg3 int)) + (let ((v1-0 arg3)) + (the-as symbol (when (= v1-0 1) + (if (and (>= (-> self gun fire-pending) 2) (< (-> self gun fire-pending) 5)) + (logclear! (-> arg0 flags) (surface-flag gun-direct)) + ) + (case (-> self control ground-pat event) + (((pat-event slide)) + (set! (-> arg0 seek0) 0.05) + (set! (-> arg0 seek90) 0.05) + (set! (-> arg0 seek180) 0.05) + ) + ) + ) + ) + ) + ) + :mode 'air + :flags (surface-flag check-edge air attack spin gun-direct laser-hide) + ) + ) + +;; failed to figure out what this is: +(defstate target-attack-air (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (let ((v0-0 (target-bonk-event-handler arg0 arg1 arg2 arg3))) + (cond + (v0-0 + (empty) + v0-0 + ) + (else + (target-dangerous-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (set! (-> self state-time) (-> self clock frame-counter)) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (target-start-attack) + (target-danger-set! 'spin-air #f) + (set! (-> self control unknown-surface00) *jump-attack-mods*) + (set! (-> self neck flex-blend) 0.0) + (let ((f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + (cond + ((or (>= 0.0 f0-2) (= arg0 'flop)) + (let ((v1-14 (new-stack-vector0))) + (let ((f0-4 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-14 + (-> self control transv) + (the-as vector (vector-float*! v1-14 (-> self control dynam gravity-normal) f0-4)) + ) + ) + (let* ((f0-5 (vector-length v1-14)) + (f1-2 f0-5) + (f2-0 33775.48) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0)) + (the-as vector (vector-float*! v1-14 v1-14 (/ f0-5 f1-2))) + ) + ) + ) + ) + (else + (let* ((f1-5 (/ f0-2 (* (-> self control dynam gravity-length) (-> self clock seconds-per-frame)))) + (f0-7 (* 0.5 f1-5 (-> self clock seconds-per-frame) f0-2)) + ) + (let ((v1-22 (ja-group))) + (if (and v1-22 + (or (= v1-22 (-> self draw art-group data 51)) + (= v1-22 (-> self draw art-group data 267)) + (= v1-22 (-> self draw art-group data 279)) + ) + ) + (set! f0-7 + (fmax + 0.0 + (- (-> *TARGET-bank* attack-jump-height-max) + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control unknown-vector21)) + ) + ) + ) + ) + ) + ) + (let ((v1-33 (new-stack-vector0))) + (let ((f1-11 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-33 + (-> self control transv) + (the-as vector (vector-float*! v1-33 (-> self control dynam gravity-normal) f1-11)) + ) + ) + (let* ((f1-12 (vector-length v1-33)) + (f2-7 f1-12) + (f0-12 (+ 1024.0 (sqrtf (* 245760.0 (+ 2048.0 f0-7))))) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-12)) + (the-as vector (vector-float*! v1-33 v1-33 (/ f1-12 f2-7))) + ) + ) + ) + ) + ) + ) + ) + (set! (-> self control dynam gravity-length) 122880.0) + (set! (-> self control unknown-vector21 quad) (-> self control trans quad)) + (none) + ) + :exit (behavior () + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (set! (-> self control unknown-time-frame12) (-> self clock frame-counter)) + (target-exit) + (none) + ) + :trans (behavior () + (when (logtest? (-> self control status) (cshape-moving-flags on-surface)) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (go target-hit-ground #f) + ) + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.5)) + (seek! + (-> self control dynam gravity-length) + (-> self control unknown-dynamics00 gravity-length) + (* 245760.0 (-> self clock seconds-per-frame)) + ) + ) + (when (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.05)) + (< (vector-dot (-> self control dynam gravity-normal) (the-as vector (-> self control unknown-quaternion02))) + (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + ) + ) + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + ) + (when (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) 2) + (>= (-> (the-as fact-info-target (-> self fact)) eco-level) 1.0) + ) + (let ((s5-0 (method-of-object (-> self skel effect) effect-control-method-10))) + 'group-red-eco-spinkick + (ja-frame-num 0) + 31 + (s5-0) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + (talker-spawn-func (-> *talker-speech* 328) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) r1) (zero? (-> self gun fire-pending))) + (case (-> self gun gun-type) + (((pickup-type eco-yellow)) + (+! (-> self gun fire-pending) 5) + ) + (((pickup-type eco-blue)) + (+! (-> self gun fire-pending) 5) + (set! (-> self gun fire-spinv) 218453.33) + ) + (((pickup-type eco-red)) + (+! (-> self gun fire-pending) 2) + ) + ) + ) + (none) + ) + :code (behavior ((arg0 symbol)) + (target-attack-air-anim) + (go target-falling #f) + (none) + ) + :post target-post + ) + +;; failed to figure out what this is: +(let ((v1-32 (copy *turn-around-mods* 'global))) + (set! (-> v1-32 flags) (surface-flag attack gun-inactive)) + (set! *uppercut-mods* v1-32) + ) + +;; definition for symbol *uppercut-jump-mods*, type surface +(define *uppercut-jump-mods* (new 'static 'surface + :name 'uppercut + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 32768.0 + :target-speed 32768.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (surface-clamp-speed arg0 arg1 arg2 arg3) + (when (= arg3 1) + (when (nonzero? (-> self gun track-target-hold-time)) + (set! (-> arg0 turnv) 262144.0) + (set! (-> arg0 turnvf) 15.0) + ) + ) + ) + :mode 'air + :flags (surface-flag check-edge air attack spin gun-direct laser-hide) + ) + ) + +;; failed to figure out what this is: +(defstate target-attack-uppercut (target) + :event target-dangerous-event-handler + :enter (behavior ((arg0 float) (arg1 float)) + (set! (-> self state-time) (-> self clock frame-counter)) + (target-start-attack) + (target-danger-set! 'uppercut #f) + (set! (-> self control unknown-surface00) *uppercut-mods*) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self gun surpress-time) (+ (-> self clock frame-counter) (seconds 0.15))) + (if (using-gun? self) + (target-top-anim-base-mode 37) + ) + (set! (-> self control unknown-sound-id00) (new 'static 'sound-id)) + 0 + (none) + ) + :exit (behavior () + (if (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-bomb1))) + (gui-control-method-16 + *gui-control* + (gui-action play) + (-> self control unknown-sound-id00) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (target-exit) + (none) + ) + :code (behavior ((arg0 float) (arg1 float)) + (let* ((v1-2 (ja-group)) + (f30-0 (if (and v1-2 (= v1-2 (-> self draw art-group data 20))) + 5.0 + 0.0 + ) + ) + ) + (cond + ((using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (case (-> self gun gun-type) + (((pickup-type eco-blue)) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 279) + f30-0 + 5 + 30 + 1.0 + 0.0 + #f + ) + (ja-no-eval :group! (-> self draw art-group data 279) + :num! (seek! (ja-aframe 7.0 0)) + :frame-num (ja-aframe f30-0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 7.0 0))) + ) + ) + (else + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 267) + f30-0 + 5 + 30 + 1.0 + 0.0 + #f + ) + (ja-no-eval :group! (-> self draw art-group data 267) + :num! (seek! (ja-aframe 7.0 0)) + :frame-num (ja-aframe f30-0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 7.0 0))) + ) + ) + ) + ) + ((and (logtest? (focus-status dark) (-> self focus-status)) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) 8) + ) + (set! (-> self control unknown-sound-id00) + (gui-control-method-9 *gui-control* self (gui-channel jak) (gui-action queue) "darkbom1" -99.0 0) + ) + (ja-no-eval :group! (-> self draw art-group data 391) + :num! (seek! (ja-aframe 7.0 0)) + :frame-num (ja-aframe f30-0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 7.0 0))) + ) + (go target-darkjak-bomb1) + ) + (else + (ja-no-eval :group! (-> self draw art-group data 51) + :num! (seek! (ja-aframe 7.0 0)) + :frame-num (ja-aframe f30-0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 7.0 0))) + ) + ) + ) + ) + (go target-attack-uppercut-jump arg0 arg1) + (none) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-attack-uppercut-jump (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('gun-combo) + (when (-> arg3 param 0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (let ((v1-7 (new-stack-vector0))) + (let ((f0-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-7 + (-> self control transv) + (the-as vector (vector-float*! v1-7 (-> self control dynam gravity-normal) f0-1)) + ) + ) + (let* ((f0-2 (vector-length v1-7)) + (f1-1 f0-2) + (f2-3 + (- (sqrtf (* 8192.0 (-> self control dynam gravity-length))) + (* 0.008333334 (- (-> self control dynam gravity-length))) + ) + ) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-3)) + (the-as vector (vector-float*! v1-7 v1-7 (/ f0-2 f1-1))) + ) + ) + ) + (set! (-> self gun surpress-time) (+ (-> self clock frame-counter) (seconds 0.5))) + (go target-falling 'uppercut) + ) + #t + ) + (else + (target-dangerous-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior ((arg0 float) (arg1 float)) + (if (and (= (-> self control ground-pat material) (pat-material ice)) + (< 32768.0 (-> self control unknown-float05)) + ) + (set-forward-vel 32768.0) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control unknown-surface00) *uppercut-jump-mods*) + (target-start-attack) + (target-danger-set! 'uppercut #f) + (set! (-> self gun combo-window-start) (-> self clock frame-counter)) + (set! (-> self gun combo-window-state) (-> self state name)) + (set! (-> self gun track-target-hold-time) 0) + 0 + (none) + ) + :exit target-exit + :trans (behavior () + (if (logtest? (-> self control status) (cshape-moving-flags on-surface)) + (go target-hit-ground #f) + ) + (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 22118.4) + (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame14)) + (the-as time-frame (-> *TARGET-bank* stuck-timeout)) + ) + (zero? (logand (-> self state-flags) (state-flags sf8))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-attack no-hands))) + (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) + ) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (build-conversions (-> self control transv)) + (go + target-flop + 65502.96 + -163840.0 + (the-as float (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + 0 + #x47866666 + ) + ) + ) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) + (and (can-feet? #f) + (let ((v1-65 (ja-group))) + (and v1-65 (or (= v1-65 (-> self draw art-group data 51)) (= v1-65 (-> self draw art-group data 267)))) + ) + (>= (ja-aframe-num 0) 12.0) + ) + ) + (go target-attack-air 'uppercut) + ) + (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) + (when (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) 2) + (>= (-> (the-as fact-info-target (-> self fact)) eco-level) 1.0) + ) + (let ((s5-0 (method-of-object (-> self skel effect) effect-control-method-10))) + 'group-red-eco-spinkick + (ja-frame-num 0) + 22 + (s5-0) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + ) + (if (and (= (-> self control unknown-symbol04) 'uppercut) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) -8192.0) + ) + (target-danger-set! 'harmless #f) + ) + (slide-down-test) + (none) + ) + :code (behavior ((arg0 float) (arg1 float)) + (when (or (= (-> self skel top-anim frame-group) (-> self draw art-group data 267)) + (= (-> self skel top-anim frame-group) (-> self draw art-group data 279)) + ) + (let ((v1-10 (top-anim-joint-control-method-11 (-> self skel top-anim) 0))) + (if v1-10 + (set! (-> v1-10 param 1) 0.9) + ) + ) + ) + (compute-alignment! (-> self align)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.9)) + (compute-alignment! (-> self align)) + (set! (-> self control unknown-float06) 1.0) + (let ((v1-27 (ja-group))) + (if (and v1-27 (= v1-27 (-> self draw art-group data 51))) + (align! + (-> self align) + (the-as align-opts (cond + ((>= 30.0 (ja-aframe-num 0)) + (set! (-> self gun surpress-time) (+ (-> self clock frame-counter) (seconds 0.1))) + (if (nonzero? (-> self gun track-target-hold-time)) + 2 + 18 + ) + ) + ((>= 43.0 (ja-aframe-num 0)) + (set! (-> self control unknown-surface00) *double-jump-mods*) + 2 + ) + (else + 0 + ) + ) + ) + 1.0 + 0.95 + 1.0 + ) + (align! + (-> self align) + (the-as align-opts (cond + ((>= 35.0 (ja-aframe-num 0)) + (set! (-> self gun surpress-time) (+ (-> self clock frame-counter) (seconds 0.1))) + (if (nonzero? (-> self gun track-target-hold-time)) + 2 + 18 + ) + ) + ((>= 43.0 (ja-aframe-num 0)) + (set! (-> self control unknown-surface00) *double-jump-mods*) + 2 + ) + (else + 0 + ) + ) + ) + 1.0 + 0.95 + 1.0 + ) + ) + ) + ) + (set! (-> self gun surpress-time) (-> self clock frame-counter)) + (go target-falling #f) + (none) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-flop (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v1-0 symbol)) + (let ((v0-0 (target-bonk-event-handler arg0 arg1 arg2 arg3))) + (cond + (v0-0 + (empty) + v0-0 + ) + ((begin (set! v1-0 arg2) (= v1-0 'slide)) + #f + ) + ((= v1-0 'swim) + (cond + ((< 6144.0 (target-height-above-ground)) + (sound-play "swim-flop") + (set! (-> self control unknown-float42) 0.0) + (go target-swim-down) + ) + (else + (go target-flop-hit-ground 'swim) + ) + ) + ) + (else + (target-dangerous-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + :enter (behavior ((arg0 float) (arg1 float) (arg2 float)) + (cond + ((and (= (-> (the-as fact-info-target (-> self fact)) eco-type) 1) + (>= (-> (the-as fact-info-target (-> self fact)) eco-level) 1.0) + ) + (go target-yellow-jump-blast) + ) + ((and (logtest? (focus-status dark) (-> self focus-status)) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) 4) + ) + (go target-darkjak-bomb0) + ) + ) + (if (= arg2 0.0) + (set-forward-vel arg2) + (set-forward-vel (-> self control unknown-float05)) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (logclear! (-> self control status) (cshape-moving-flags on-surface on-ground t-surface)) + (set! (-> self control unknown-surface00) *flop-mods*) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control unknown-word04) (the-as uint 0)) + (set! (-> self control dynam gravity-max) 245760.0) + (set! (-> self control dynam gravity-length) 245760.0) + (let ((v1-33 (new-stack-vector0))) + (let ((f0-7 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-33 + (-> self control transv) + (the-as vector (vector-float*! v1-33 (-> self control dynam gravity-normal) f0-7)) + ) + ) + (let* ((f0-8 (vector-length v1-33)) + (f1-3 f0-8) + (f2-0 29491.2) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0)) + (the-as vector (vector-float*! v1-33 v1-33 (/ f0-8 f1-3))) + ) + ) + ) + (none) + ) + :exit (behavior () + (let ((v1-2 (top-anim-joint-control-method-11 (-> self skel top-anim) 0))) + (when v1-2 + (case (-> v1-2 frame-group) + (((-> self draw art-group data 286)) + (set! (-> v1-2 param 1) 10.0) + ) + ) + ) + ) + (target-danger-set! 'harmless #f) + (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (set! (-> self control dynam gravity quad) (-> self control unknown-dynamics00 gravity quad)) + (set! (-> self neck flex-blend) 1.0) + (none) + ) + :trans (behavior () + (delete-back-vel) + (let ((gp-1 (logtest? (-> self control status) (cshape-moving-flags on-surface)))) + (when (and (not gp-1) + (let ((v1-6 (ja-group))) + (and v1-6 (or (= v1-6 (-> self draw art-group data 53)) (= v1-6 (-> self draw art-group data 55)))) + ) + ) + (when (and (or (< (target-move-dist (seconds 0.1)) 1638.4) + (and (logtest? (-> self control status) (cshape-moving-flags t-wall)) (< 0.7 (-> self control poly-angle))) + ) + (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + (>= (the-as uint (-> self control unknown-word04)) (the-as uint 2)) + ) + (set! (-> self control unknown-time-frame14) (-> self clock frame-counter)) + (set! gp-1 'stuck) + ) + ) + (when gp-1 + (logior! (-> self control status) (cshape-moving-flags on-surface)) + (when (or (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) 2) + (>= (-> (the-as fact-info-target (-> self fact)) eco-level) 1.0) + ) + (and (logtest? (focus-status dark) (-> self focus-status)) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) 2) + ) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) + (when (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) 2) + (>= (-> (the-as fact-info-target (-> self fact)) eco-level) 1.0) + ) + (let ((s4-0 (method-of-object (-> self skel effect) effect-control-method-10))) + 'group-red-eco-strike-ground + (ja-frame-num 0) + 0 + (s4-0) + ) + ) + (let ((v1-56 (process-spawn touch-tracker :init touch-tracker-init (-> self control trans) #x45800000 30 :to self)) + ) + (send-event + (ppointer->process v1-56) + 'function + (lambda :behavior target + ((arg0 target)) + (set! (-> arg0 control root-prim local-sphere w) + (seek (-> arg0 control root-prim local-sphere w) 28672.0 (* 286720.0 (-> self clock seconds-per-frame))) + ) + ) + ) + ) + ) + (go target-flop-hit-ground gp-1) + ) + ) + (when (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) 2) + (>= (-> (the-as fact-info-target (-> self fact)) eco-level) 1.0) + ) + (let* ((gp-2 (-> self skel effect)) + (s5-2 (method-of-object gp-2 effect-control-method-10)) + ) + 'group-red-eco-spinkick + (ja-frame-num 0) + (if (rand-vu-percent? 0.5) + 22 + 18 + ) + (s5-2) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + ) + (when (and (not (-> self control unknown-symbol04)) + (let ((v1-82 (ja-group))) + (and v1-82 (= v1-82 (-> self draw art-group data 52))) + ) + (>= (ja-aframe-num 0) 8.0) + ) + (target-start-attack) + (target-danger-set! 'flop #f) + ) + (none) + ) + :code (behavior ((arg0 float) (arg1 float) (arg2 float)) + (if (using-gun? self) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 286) + 0.0 + 0 + 30 + 1.0 + 0.0 + #f + ) + ) + (ja-channel-set! 2) + (ja-no-eval :group! (-> self draw art-group data 52) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 52)) frames num-frames) -1))) + :frame-num 0.0 + ) + (ja :chan 1 :group! (-> self draw art-group data 55) :num! (chan 0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + (let ((gp-0 (-> self skel root-channel 1))) + (let ((f0-10 (lerp-scale 0.0 1.0 (-> self control unknown-float05) 0.0 40960.0))) + (set! (-> gp-0 frame-interp 1) f0-10) + (set! (-> gp-0 frame-interp 0) f0-10) + ) + (set! (-> gp-0 param 0) (the float (+ (-> gp-0 frame-group frames num-frames) -1))) + (set! (-> gp-0 param 1) 1.0) + (joint-control-channel-group-eval! gp-0 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) + (set! (-> self control dynam gravity quad) (-> self control unknown-dynamics00 gravity quad)) + (target-danger-set! 'flop-down #f) + (let ((v1-56 (top-anim-joint-control-method-11 (-> self skel top-anim) 0))) + (if (and v1-56 (= (-> v1-56 frame-group) (-> self draw art-group data 286))) + (set! (-> v1-56 param 1) 0.0) + ) + ) + (let ((f30-0 1.0)) + (let ((v1-58 (new-stack-vector0))) + (let ((f0-17 (vector-dot (-> self control dynam gravity-normal) (-> self control unknown-vector44)))) + 0.0 + (vector-! + v1-58 + (-> self control unknown-vector44) + (the-as vector (vector-float*! v1-58 (-> self control dynam gravity-normal) f0-17)) + ) + ) + (let* ((f0-18 (vector-length v1-58)) + (f1-1 f0-18) + (f2-0 -368640.0) + ) + (vector+! + (-> self control unknown-vector44) + (the-as + vector + (vector-float*! (-> self control unknown-vector44) (-> self control dynam gravity-normal) f2-0) + ) + (the-as vector (vector-float*! v1-58 v1-58 (/ f0-18 f1-1))) + ) + ) + ) + (let ((v1-59 (new-stack-vector0))) + (let ((f0-21 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! + v1-59 + (-> self control transv) + (the-as vector (vector-float*! v1-59 (-> self control dynam gravity-normal) f0-21)) + ) + ) + (let* ((f0-22 (vector-length v1-59)) + (f1-3 f0-22) + (f2-2 (* -368640.0 f30-0)) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-2)) + (the-as vector (vector-float*! v1-59 v1-59 (/ f0-22 f1-3))) + ) + ) + ) + (suspend) + (until #f + (set! (-> self control unknown-word04) (the-as uint (+ (-> self control unknown-word04) 1))) + (ja :num! (seek!)) + (let ((gp-1 (-> self skel root-channel 1))) + (let ((f0-28 (lerp-scale 0.0 1.0 (-> self control unknown-float05) 0.0 40960.0))) + (set! (-> gp-1 frame-interp 1) f0-28) + (set! (-> gp-1 frame-interp 0) f0-28) + ) + (set! (-> gp-1 param 0) 0.0) + (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-chan) + ) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control unknown-float43)))) + (let ((v1-77 (new-stack-vector0)) + (f0-33 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-77 + (-> self control transv) + (the-as vector (vector-float*! v1-77 (-> self control dynam gravity-normal) f0-33)) + ) + (let* ((f2-3 (vector-length v1-77)) + (f1-7 f2-3) + ) + (if (< (-> self control unknown-surface01 transv-max) f2-3) + (set! f2-3 (-> self control unknown-surface01 transv-max)) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-33)) + (the-as vector (vector-float*! v1-77 v1-77 (/ f2-3 f1-7))) + ) + ) + ) + (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) + (the-as time-frame (-> *TARGET-bank* fall-timeout)) + ) + (!= (-> self tobot?) 'tobot) + ) + (go target-falling #f) + ) + (if (and (= *cheat-mode* 'debug) + (cpad-hold? (-> self control unknown-cpad-info00 number) r2) + (not *pause-lock*) + (!= (-> self tobot?) 'tobot) + ) + (go target-falling #f) + ) + (suspend) + ) + ) + #f + (none) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-flop-hit-ground (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (cond + ((and (-> self next-state) (= (-> self next-state name) 'target-flop-hit-ground)) + (case arg2 + (('swim 'slide) + #f + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + (else + (target-jump-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (let ((f0-1 (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector43) (-> self control trans)) + ) + ) + ) + (if (< (-> *TARGET-bank* fall-far) f0-1) + (go target-hit-ground-hard f0-1) + ) + ) + (target-land-effect) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self control unknown-word04) (the-as uint arg0)) + (set-forward-vel 0.0) + (set! (-> self control unknown-surface00) *flop-land-mods*) + (logclear! (-> *flop-land-mods* flags) (surface-flag check-edge)) + (logior! (-> self state-flags) (state-flags sf15)) + (set! (-> self neck flex-blend) 0.0) + (cond + ((= arg0 'swim) + ) + (else + ) + ) + (none) + ) + :exit target-exit + :trans (behavior () + (when (and (!= (-> self control unknown-spool-anim00) 'stuck) + (!= (-> self state-time) (-> self clock frame-counter)) + ) + (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? #f) + ) + (go target-attack-air 'flop) + ) + ) + (when (and (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) 2) + (>= (-> (the-as fact-info-target (-> self fact)) eco-level) 1.0) + ) + (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.25)) + ) + (let* ((gp-0 (-> self skel effect)) + (s5-0 (method-of-object gp-0 effect-control-method-10)) + ) + 'group-red-eco-spinkick + (ja-frame-num 0) + (if (rand-vu-percent? 0.5) + 22 + 18 + ) + (s5-0) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + ) + (let ((v1-37 (ja-group))) + (if (and (and v1-37 (= v1-37 (-> self draw art-group data 54))) (>= (ja-aframe-num 0) 28.0)) + (logior! (-> *flop-land-mods* flags) (surface-flag check-edge)) + ) + ) + (slide-down-test) + (none) + ) + :code (behavior ((arg0 symbol)) + (let ((gp-0 target-hit-ground-anim) + (s5-0 arg0) + ) + (are-still?) + (gp-0 s5-0) + ) + (go target-falling #f) + (none) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-roll (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (if (= arg2 'touched) + (send-event arg0 'roll) + ) + (case arg2 + (('gun-combo) + (when (-> arg3 param 0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (let ((a0-8 (-> self control))) + (set-quaternion! a0-8 (-> self control dir-targ)) + (go target-duck-stance (the-as symbol a0-8)) + ) + ) + #t + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior () + (target-collide-set! 'duck 1.0) + (set! (-> self state-time) (-> self clock frame-counter)) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self neck base-joint) (the-as uint 8)) + (set! (-> self control unknown-surface00) *roll-mods*) + (+! (-> self control unknown-word02) 1) + (rot->dir-targ! (-> self control)) + (set-forward-vel (+ (-> *TARGET-bank* roll-speed-min) + (* (-> *TARGET-bank* roll-speed-inc) (the float (+ (-> self control unknown-word02) -1))) + ) + ) + (if (or (< (fabs (-> self control unknown-float18)) 0.3) (< 0.3 (fabs (-> self control unknown-float17)))) + (set! (-> self control unknown-float29) 1.0) + ) + (set! (-> self control unknown-word04) (the-as uint 0)) + (set! (-> self control unknown-symbol02) 0.0) + (set! (-> self gun track-target-hold-time) 0) + (none) + ) + :exit (behavior () + (when (not (and (-> self next-state) (= (-> self next-state name) 'target-roll))) + (set! (-> self control unknown-word02) 0) + (set! (-> self control unknown-time-frame10) (-> self clock frame-counter)) + ) + (target-exit) + (target-collide-set! 'normal 0.0) + (none) + ) + :code (behavior () + (let ((gp-0 0)) + 0 + (let ((s5-0 0) + (f30-0 1.0) + (s4-0 #f) + ) + (ja-channel-push! 1 (seconds 0.04)) + (cond + ((using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 282) + 0.0 + 15 + 30 + 1.0 + 0.0 + #f + ) + (ja :group! (-> self draw art-group data 282) :num! min) + ) + (else + (ja :group! (-> self draw art-group data 59) :num! min) + ) + ) + (until (ja-done? 0) + (if (cpad-pressed? (-> self control unknown-cpad-info00 number) x) + (set! gp-0 (the-as int (-> self clock frame-counter))) + ) + (when (and (not s4-0) (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.2))) + (set! s4-0 #t) + (set! (-> self gun combo-window-start) (-> self clock frame-counter)) + (set! (-> self gun combo-window-state) (-> self state name)) + ) + (when (and (or (smack-surface? #f) (>= (-> self control unknown-float19) 0.7)) + (>= (the-as uint (- (-> self clock frame-counter) (the-as int (-> self control unknown-word04)))) + (the-as uint 3) + ) + (>= (- (-> self clock frame-counter) (-> self state-time)) 1) + ) + (when (>= 6.0 (ja-aframe-num 0)) + (if (using-gun? self) + (target-top-anim-base-mode 15) + ) + (target-shoved + (-> *TARGET-bank* smack-surface-dist) + (-> *TARGET-bank* smack-surface-height) + (the-as process #f) + target-hit + ) + ) + (if (zero? s5-0) + (set! s5-0 (the-as int (-> self clock frame-counter))) + ) + ) + (if (cpad-pressed? (-> self control unknown-cpad-info00 number) square) + (-> self clock frame-counter) + ) + (compute-alignment! (-> self align)) + (cond + ((nonzero? s5-0) + ) + (else + (align! (-> self align) (align-opts adjust-xz-vel) 1.0 1.0 f30-0) + (let ((s3-2 (new-stack-vector0))) + (vector-matrix*! s3-2 (-> self control transv) (-> self control unknown-matrix00)) + (set! (-> s3-2 y) 0.0) + (vector-matrix*! (-> self control unknown-vector44) s3-2 (-> self control unknown-matrix01)) + ) + ) + ) + (suspend) + (ja :num! (seek!)) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control unknown-float43)))) + ) + ) + (if (and (or (< (- (-> self clock frame-counter) (the-as time-frame gp-0)) + (the-as time-frame (-> *TARGET-bank* roll-jump-pre-window)) + ) + (cpad-pressed? (-> self control unknown-cpad-info00 number) x) + ) + (can-jump? 'target-roll-flip) + ) + (go target-roll-flip (-> *TARGET-bank* roll-flip-height) (-> *TARGET-bank* roll-flip-dist)) + ) + ) + (set! (-> self state-hook-time) (-> self clock frame-counter)) + (set! (-> self state-hook) + (lambda :behavior target + () + (cond + ((>= (- (-> self clock frame-counter) (-> self state-hook-time)) + (the-as time-frame (-> *TARGET-bank* roll-jump-post-window)) + ) + (set! (-> self state-hook) (the-as (function none :behavior target) nothing)) + ) + (else + (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? 'target-roll-flip) + ) + (go target-roll-flip (-> *TARGET-bank* roll-flip-height) (-> *TARGET-bank* roll-flip-dist)) + ) + ) + ) + (none) + ) + ) + (set! (-> self gun surpress-time) (+ (-> self clock frame-counter) (seconds 0.2))) + (go target-duck-stance 'roll) + (none) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-roll-flip (target) + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('gun-combo) + (when (-> arg3 param 0) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) (-> self gun track-trans) (-> self control trans)) + (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ)) + ) + (set-quaternion! (-> self control) (-> self control dir-targ)) + (go target-falling #f) + ) + #t + ) + (else + (target-jump-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + :enter (behavior ((arg0 float) (arg1 float)) + (set! (-> self control unknown-surface00) *roll-flip-mods*) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self neck base-joint) (the-as uint 8)) + (set! (-> self gun track-target-hold-time) 0) + (set! (-> self gun combo-window-start) (-> self clock frame-counter)) + (set! (-> self gun combo-window-state) (-> self state name)) + (target-collide-set! 'duck 1.0) + (none) + ) + :exit (behavior () + (target-exit) + (target-collide-set! 'normal 0.0) + (none) + ) + :trans (behavior () + (if (and (or (smack-surface? #f) + (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) + ) + (and (!= (-> self state-time) (-> self clock frame-counter)) (not (using-gun? self))) + ) + (target-shoved + (-> *TARGET-bank* smack-surface-dist) + (-> *TARGET-bank* smack-surface-height) + (the-as process #f) + target-hit + ) + ) + (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) + (can-feet? #f) + (let ((v1-20 (ja-group))) + (and (and v1-20 (= v1-20 (-> self draw art-group data 27))) + (= (-> self skel root-channel 0) (-> self skel channel)) + ) + ) + ) + (go target-attack-air #f) + ) + (none) + ) + :code (behavior ((arg0 float) (arg1 float)) + (local-vars (v1-37 symbol)) + (ja-channel-push! 1 (seconds 0.04)) + (ja :group! (-> self draw art-group data 61) :num! min) + (when (using-gun? self) + (set! (-> self gun top-anim-low-high) 0.0) + (top-anim-joint-control-method-12 + (-> self skel top-anim) + (-> self draw art-group data 284) + 0.0 + 0 + 30 + 1.0 + 0.0 + #f + ) + ) + (let ((f30-0 1.0)) + (until v1-37 + (compute-alignment! (-> self align)) + (if (not (ja-max? 0)) + (align! + (-> self align) + (align-opts adjust-y-vel adjust-xz-vel) + 1.0 + (/ arg0 (-> *TARGET-bank* roll-flip-art-height)) + (* f30-0 (/ arg1 (-> *TARGET-bank* roll-flip-art-dist))) + ) + (align! + (-> self align) + (align-opts adjust-xz-vel) + 1.0 + 1.0 + (* f30-0 (/ arg1 (-> *TARGET-bank* roll-flip-art-dist))) + ) + ) + (let ((s4-1 (new-stack-vector0))) + (vector-matrix*! s4-1 (-> self control transv) (-> self control unknown-matrix00)) + (set! (-> s4-1 y) 0.0) + (vector-matrix*! (-> self control unknown-vector44) s4-1 (-> self control unknown-matrix01)) + ) + (suspend) + (ja :num! (seek!)) + (set! f30-0 (* f30-0 (fmin 1.0 (-> self control unknown-float43)))) + (set! v1-37 + (or (ja-max? 0) + (and (>= (ja-aframe-num 0) 4.0) (logtest? (-> self control status) (cshape-moving-flags on-surface))) + ) + ) + ) + ) + (set! (-> self state-time) (-> self clock frame-counter)) + (while (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.01)) + (let ((v1-50 (ja-group))) + (when (not (and v1-50 (= v1-50 (-> self draw art-group data 27)))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 27) :num! min) + ) + ) + ) + (let ((v1-59 (new-stack-vector0)) + (f0-19 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-59 + (-> self control transv) + (the-as vector (vector-float*! v1-59 (-> self control dynam gravity-normal) f0-19)) + ) + (let* ((f2-0 (vector-length v1-59)) + (f1-7 f2-0) + (f2-1 (* 0.9 f2-0)) + ) + (vector+! + (-> self control transv) + (the-as vector (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-19)) + (the-as vector (vector-float*! v1-59 v1-59 (/ f2-1 f1-7))) + ) + ) + ) + (suspend) + (let ((v1-62 (ja-group))) + (if (and v1-62 (= v1-62 (-> self draw art-group data 27))) + (ja :num! (loop!)) + (ja :num-func num-func-identity :frame-num max) + ) + ) + ) + (target-land-effect) + (set! (-> self gun surpress-time) (+ (-> self clock frame-counter) (seconds 0.1))) + (set! (-> self state-hook-time) (-> self clock frame-counter)) + (set! (-> self state-hook) + (lambda :behavior target + () + (cond + ((>= (- (-> self clock frame-counter) (-> self state-hook-time)) (seconds 0.1)) + (set! (-> self state-hook) (the-as (function none :behavior target) nothing)) + ) + (else + (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) + (or (not (-> *TARGET-bank* strafe-duck-jump)) (not (enabled-gun? self))) + ) + (go target-high-jump (-> *TARGET-bank* flip-jump-height-min) (-> *TARGET-bank* flip-jump-height-max) 'flip) + ) + ) + ) + (none) + ) + ) + self + (cond + ((not (can-exit-duck?)) + (go target-duck-stance #f) + ) + (else + (let ((v1-86 (ja-group))) + (if (and v1-86 (= v1-86 (-> self draw art-group data 27))) + (go target-hit-ground #f) + (go target-stance) + ) + ) + ) + ) + (none) + ) + :post target-post + )